1 line
1.3 MiB
1 line
1.3 MiB
var _ColorSpaceUtils,_OperatorList,_GlobalImageCache,_StructTreeRoot,_WorkerMessageHandler;function ownKeys(e,r){var o,t=Object.keys(e);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(e),r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)),t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _classPrivateGetter(s,r,a){return a(_assertClassBrand(s,r))}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==typeof t?t:t+""}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===r?String:Number)(t);e=e.call(t,r||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var isNodeJS=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],LINE_FACTOR=1.35,LINE_DESCENT_FACTOR=.35,BASELINE_FACTOR=LINE_DESCENT_FACTOR/LINE_FACTOR,RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},AnnotationEditorPrefix="pdfjs_internal_editor_",AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},AnnotationEditorParamsType={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_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},AnnotationType={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},AnnotationReplyType={GROUP:"Group",REPLY:"R"},AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},AnnotationActionEventType={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"},DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},PageActionEventType={O:"PageOpen",C:"PageClose"},VerbosityLevel={ERRORS:0,WARNINGS:1,INFOS:5},OPS={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},DrawOPS={moveTo:0,lineTo:1,curveTo:2,closePath:3},PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},verbosity=VerbosityLevel.WARNINGS;function setVerbosityLevel(level){Number.isInteger(level)&&(verbosity=level)}function getVerbosityLevel(){return verbosity}function info(msg){verbosity>=VerbosityLevel.INFOS&&console.log("Info: ".concat(msg))}function warn(msg){verbosity>=VerbosityLevel.WARNINGS&&console.log("Warning: ".concat(msg))}function unreachable(msg){throw new Error(msg)}function assert(cond,msg){cond||unreachable(msg)}function _isValidProtocol(url){switch(null==url?void 0:url.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function createValidAbsoluteUrl(url){var baseUrl=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,options=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!url)return null;if(options&&"string"==typeof url&&(options.addDefaultProtocol&&url.startsWith("www.")&&2<=(null==(dots=url.match(/\./g))?void 0:dots.length)&&(url="http://".concat(url)),options.tryConvertEncoding))try{url=stringToUTF8String(url)}catch(_unused){}var dots=baseUrl?URL.parse(url,baseUrl):URL.parse(url);return _isValidProtocol(dots)?dots:null}function updateUrlHash(url,hash){var allowRel=2<arguments.length&&void 0!==arguments[2]&&arguments[2],res=URL.parse(url);return res?(res.hash=hash,res.href):allowRel&&createValidAbsoluteUrl(url,"http://example.com")?url.split("#",1)[0]+"".concat(hash?"#".concat(hash):""):""}function shadow(obj,prop,value){return Object.defineProperty(obj,prop,{value:value,enumerable:!(3<arguments.length&&void 0!==arguments[3]&&arguments[3]),configurable:!0,writable:!1}),value}var BaseException=function(){function BaseException(message,name){this.message=message,this.name=name}return BaseException.prototype=new Error,BaseException.constructor=BaseException}();class PasswordException extends BaseException{constructor(msg,code){super(msg,"PasswordException"),this.code=code}}class UnknownErrorException extends BaseException{constructor(msg,details){super(msg,"UnknownErrorException"),this.details=details}}class InvalidPDFException extends BaseException{constructor(msg){super(msg,"InvalidPDFException")}}class ResponseException extends BaseException{constructor(msg,status,missing){super(msg,"ResponseException"),this.status=status,this.missing=missing}}class FormatError extends BaseException{constructor(msg){super(msg,"FormatError")}}class AbortException extends BaseException{constructor(msg){super(msg,"AbortException")}}function bytesToString(bytes){"object"==typeof bytes&&void 0!==(null==bytes?void 0:bytes.length)||unreachable("Invalid argument for bytesToString");var length=bytes.length;if(length<8192)return String.fromCharCode.apply(null,bytes);for(var strBuf=[],i=0;i<length;i+=8192){var chunkEnd=Math.min(i+8192,length),chunkEnd=bytes.subarray(i,chunkEnd);strBuf.push(String.fromCharCode.apply(null,chunkEnd))}return strBuf.join("")}function stringToBytes(str){"string"!=typeof str&&unreachable("Invalid argument for stringToBytes");for(var length=str.length,bytes=new Uint8Array(length),i=0;i<length;++i)bytes[i]=255&str.charCodeAt(i);return bytes}function string32(value){return String.fromCharCode(value>>24&255,value>>16&255,value>>8&255,255&value)}function objectSize(obj){return Object.keys(obj).length}function isLittleEndian(){var buffer8=new Uint8Array(4);return(buffer8[0]=1)===new Uint32Array(buffer8.buffer,0,1)[0]}function isEvalSupported(){try{return new Function(""),!0}catch(_unused2){return!1}}class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",isLittleEndian())}static get isEvalSupported(){return shadow(this,"isEvalSupported",isEvalSupported())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){var{platform,userAgent}=navigator;return shadow(this,"platform",{isAndroid:userAgent.includes("Android"),isLinux:platform.includes("Linux"),isMac:platform.includes("Mac"),isWindows:platform.includes("Win"),isFirefox:userAgent.includes("Firefox")})}static get isCSSRoundSupported(){var _globalThis$CSS;return shadow(this,"isCSSRoundSupported",null==(_globalThis$CSS=globalThis.CSS)||null==_globalThis$CSS.supports?void 0:_globalThis$CSS.supports("width: round(1.5px, 1px)"))}}var hexNumbers=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));class Util{static makeHexColor(r,g,b){return"#".concat(hexNumbers[r]).concat(hexNumbers[g]).concat(hexNumbers[b])}static scaleMinMax(transform,minMax){var temp;transform[0]?(transform[0]<0&&(temp=minMax[0],minMax[0]=minMax[2],minMax[2]=temp),minMax[0]*=transform[0],minMax[2]*=transform[0],transform[3]<0&&(temp=minMax[1],minMax[1]=minMax[3],minMax[3]=temp),minMax[1]*=transform[3],minMax[3]*=transform[3]):(temp=minMax[0],minMax[0]=minMax[1],minMax[1]=temp,temp=minMax[2],minMax[2]=minMax[3],minMax[3]=temp,transform[1]<0&&(temp=minMax[1],minMax[1]=minMax[3],minMax[3]=temp),minMax[1]*=transform[1],minMax[3]*=transform[1],transform[2]<0&&(temp=minMax[0],minMax[0]=minMax[2],minMax[2]=temp),minMax[0]*=transform[2],minMax[2]*=transform[2]),minMax[0]+=transform[4],minMax[1]+=transform[5],minMax[2]+=transform[4],minMax[3]+=transform[5]}static transform(m1,m2){return[m1[0]*m2[0]+m1[2]*m2[1],m1[1]*m2[0]+m1[3]*m2[1],m1[0]*m2[2]+m1[2]*m2[3],m1[1]*m2[2]+m1[3]*m2[3],m1[0]*m2[4]+m1[2]*m2[5]+m1[4],m1[1]*m2[4]+m1[3]*m2[5]+m1[5]]}static applyTransform(p,m){var pos=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,p0=p[pos],p1=p[pos+1];p[pos]=p0*m[0]+p1*m[2]+m[4],p[pos+1]=p0*m[1]+p1*m[3]+m[5]}static applyTransformToBezier(p,transform){for(var pos=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,m0=transform[0],m1=transform[1],m2=transform[2],m3=transform[3],m4=transform[4],m5=transform[5],i=0;i<6;i+=2){var pI=p[pos+i],pI1=p[pos+i+1];p[pos+i]=pI*m0+pI1*m2+m4,p[pos+i+1]=pI*m1+pI1*m3+m5}}static applyInverseTransform(p,m){var p0=p[0],p1=p[1],d=m[0]*m[3]-m[1]*m[2];p[0]=(p0*m[3]-p1*m[2]+m[2]*m[5]-m[4]*m[3])/d,p[1]=(-p0*m[1]+p1*m[0]+m[4]*m[1]-m[5]*m[0])/d}static axialAlignedBoundingBox(rect,transform,output){var m0=transform[0],m1=transform[1],m2=transform[2],m3=transform[3],m4=transform[4],transform=transform[5],r0=rect[0],r1=rect[1],r2=rect[2],rect=rect[3],a0=m0*r0+m4,a2=a0,m0=m0*r2+m4,m4=m0,b0=m3*r1+transform,b2=b0,m3=m3*rect+transform,transform=m3;0===m1&&0===m2||(a0+=r1=m2*r1,m4+=r1,m0+=r1=m2*rect,a2+=r1,b0+=m2=m1*r0,transform+=m2,m3+=rect=m1*r2,b2+=rect),output[0]=Math.min(output[0],a0,m0,a2,m4),output[1]=Math.min(output[1],b0,m3,b2,transform),output[2]=Math.max(output[2],a0,m0,a2,m4),output[3]=Math.max(output[3],b0,m3,b2,transform)}static inverseTransform(m){var d=m[0]*m[3]-m[1]*m[2];return[m[3]/d,-m[1]/d,-m[2]/d,m[0]/d,(m[2]*m[5]-m[4]*m[3])/d,(m[4]*m[1]-m[5]*m[0])/d]}static singularValueDecompose2dScale(matrix,output){var m0=matrix[0],m1=matrix[1],m2=matrix[2],matrix=matrix[3],a=m0**2+m1**2,c=m2**2+matrix**2,first=(a+c)/2,a=Math.sqrt(first**2-(a*c-(m0*m2+m1*matrix)**2));output[0]=Math.sqrt(first+a||1),output[1]=Math.sqrt(first-a||1)}static normalizeRect(rect){var r=rect.slice(0);return rect[0]>rect[2]&&(r[0]=rect[2],r[2]=rect[0]),rect[1]>rect[3]&&(r[1]=rect[3],r[3]=rect[1]),r}static intersect(rect1,rect2){var yLow,xLow=Math.max(Math.min(rect1[0],rect1[2]),Math.min(rect2[0],rect2[2])),xHigh=Math.min(Math.max(rect1[0],rect1[2]),Math.max(rect2[0],rect2[2]));return xHigh<xLow||(yLow=Math.max(Math.min(rect1[1],rect1[3]),Math.min(rect2[1],rect2[3])),(rect1=Math.min(Math.max(rect1[1],rect1[3]),Math.max(rect2[1],rect2[3])))<yLow)?null:[xLow,yLow,xHigh,rect1]}static pointBoundingBox(x,y,minMax){minMax[0]=Math.min(minMax[0],x),minMax[1]=Math.min(minMax[1],y),minMax[2]=Math.max(minMax[2],x),minMax[3]=Math.max(minMax[3],y)}static rectBoundingBox(x0,y0,x1,y1,minMax){minMax[0]=Math.min(minMax[0],x0,x1),minMax[1]=Math.min(minMax[1],y0,y1),minMax[2]=Math.max(minMax[2],x0,x1),minMax[3]=Math.max(minMax[3],y0,y1)}static bezierBoundingBox(x0,y0,x1,y1,x2,y2,x3,y3,minMax){minMax[0]=Math.min(minMax[0],x0,x3),minMax[1]=Math.min(minMax[1],y0,y3),minMax[2]=Math.max(minMax[2],x0,x3),minMax[3]=Math.max(minMax[3],y0,y3),_assertClassBrand(Util,this,_getExtremum).call(this,x0,x1,x2,x3,y0,y1,y2,y3,3*(3*(x1-x2)-x0+x3),6*(x0-2*x1+x2),3*(x1-x0),minMax),_assertClassBrand(Util,this,_getExtremum).call(this,x0,x1,x2,x3,y0,y1,y2,y3,3*(3*(y1-y2)-y0+y3),6*(y0-2*y1+y2),3*(y1-y0),minMax)}}function _getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,t,minMax){var mt;t<=0||1<=t||(x2=(mt=1-t)*(mt*(mt*x0+3*t*x1)+3*(x0=t*t)*x2)+(x1=x0*t)*x3,x3=mt*(mt*(mt*y0+3*t*y1)+3*x0*y2)+x1*y3,minMax[0]=Math.min(minMax[0],x2),minMax[1]=Math.min(minMax[1],x3),minMax[2]=Math.max(minMax[2],x2),minMax[3]=Math.max(minMax[3],x3))}function _getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,a,b,c,minMax){Math.abs(a)<1e-12?1e-12<=Math.abs(b)&&_assertClassBrand(_Util,this,_getExtremumOnCurve).call(this,x0,x1,x2,x3,y0,y1,y2,y3,-c/b,minMax):(c=b**2-4*c*a)<0||(c=Math.sqrt(c),a=2*a,_assertClassBrand(_Util,this,_getExtremumOnCurve).call(this,x0,x1,x2,x3,y0,y1,y2,y3,(-b+c)/a,minMax),_assertClassBrand(_Util,this,_getExtremumOnCurve).call(this,x0,x1,x2,x3,y0,y1,y2,y3,(-b-c)/a,minMax))}var _Util=Util,PDFStringTranslateTable=[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(str){var encoding,keepEscapeSequence=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if("ï"<=str[0]&&("þ"===str[0]&&"ÿ"===str[1]?(encoding="utf-16be",str.length%2==1&&(str=str.slice(0,-1))):"ÿ"===str[0]&&"þ"===str[1]?(encoding="utf-16le",str.length%2==1&&(str=str.slice(0,-1))):"ï"===str[0]&&"»"===str[1]&&"¿"===str[2]&&(encoding="utf-8"),encoding))try{var decoder=new TextDecoder(encoding,{fatal:!0}),buffer=stringToBytes(str),decoded=decoder.decode(buffer);return keepEscapeSequence||!decoded.includes("")?decoded:decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,"")}catch(ex){warn('stringToPDFString: "'.concat(ex,'".'))}for(var strBuf=[],i=0,ii=str.length;i<ii;i++){var charCode=str.charCodeAt(i);if(keepEscapeSequence||27!==charCode){charCode=PDFStringTranslateTable[charCode];strBuf.push(charCode?String.fromCharCode(charCode):str.charAt(i))}else for(;++i<ii&&27!==str.charCodeAt(i););}return strBuf.join("")}function stringToUTF8String(str){return decodeURIComponent(escape(str))}function utf8StringToString(str){return unescape(encodeURIComponent(str))}function isArrayEqual(arr1,arr2){if(arr1.length!==arr2.length)return!1;for(var i=0,ii=arr1.length;i<ii;i++)if(arr1[i]!==arr2[i])return!1;return!0}function getModificationDate(){var date=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return[date.getUTCFullYear().toString(),(date.getUTCMonth()+1).toString().padStart(2,"0"),date.getUTCDate().toString().padStart(2,"0"),date.getUTCHours().toString().padStart(2,"0"),date.getUTCMinutes().toString().padStart(2,"0"),date.getUTCSeconds().toString().padStart(2,"0")].join("")}var NormalizeRegex=null,NormalizationMap=null;function normalizeUnicode(str){return NormalizeRegex||(NormalizeRegex=/([\xA0\xB5\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+)/g,NormalizationMap=new Map([["ſt","ſt"]])),str.replaceAll(NormalizeRegex,(_,p1,p2)=>p1?p1.normalize("NFKC"):NormalizationMap.get(p2))}function getUuid(){var buf;return"function"==typeof crypto.randomUUID?crypto.randomUUID():(buf=new Uint8Array(32),crypto.getRandomValues(buf),bytesToString(buf))}var AnnotationPrefix="pdfjs_internal_id_";function _isValidExplicitDest(validRef,validName,dest){if(!Array.isArray(dest)||dest.length<2)return!1;var[dest,zoom,...args]=dest;if(!validRef(dest)&&!Number.isInteger(dest))return!1;if(!validName(zoom))return!1;var arg,argsLen=args.length,allowNull=!0;switch(zoom.name){case"XYZ":if(argsLen<2||3<argsLen)return!1;break;case"Fit":case"FitB":return 0===argsLen;case"FitH":case"FitBH":case"FitV":case"FitBV":if(1<argsLen)return!1;break;case"FitR":if(4!==argsLen)return!1;allowNull=!1;break;default:return!1}for(arg of args)if(!("number"==typeof arg||allowNull&&null===arg))return!1;return!0}function MathClamp(v,min,max){return Math.min(Math.max(v,min),max)}function toHexUtil(arr){return Uint8Array.prototype.toHex?arr.toHex():Array.from(arr,num=>hexNumbers[num]).join("")}function toBase64Util(arr){return Uint8Array.prototype.toBase64?arr.toBase64():btoa(bytesToString(arr))}function fromBase64Util(str){return Uint8Array.fromBase64?Uint8Array.fromBase64(str):stringToBytes(atob(str))}"function"!=typeof Promise.try&&(Promise.try=function(fn){for(var _len=arguments.length,args=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return new Promise(resolve=>{resolve(fn(...args))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(numbers){return numbers.reduce((a,b)=>a+b,0)});var CIRCULAR_REF=Symbol("CIRCULAR_REF"),EOF=Symbol("EOF"),CmdCache=Object.create(null),NameCache=Object.create(null),RefCache=Object.create(null);function clearPrimitiveCaches(){CmdCache=Object.create(null),NameCache=Object.create(null),RefCache=Object.create(null)}class Name{constructor(name){this.name=name}static get(name){return NameCache[name]||(NameCache[name]=new Name(name))}}class Cmd{constructor(cmd){this.cmd=cmd}static get(cmd){return CmdCache[cmd]||(CmdCache[cmd]=new Cmd(cmd))}}var nonSerializable=function(){return nonSerializable};class Dict{constructor(){var xref=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;this._map=new Map,this.xref=xref,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=nonSerializable}assignXref(newXref){this.xref=newXref}get size(){return this._map.size}get(key1,key2,key3){key1=this._map.get(key1);return(key1=void 0===key1&&void 0!==key2&&void 0===(key1=this._map.get(key2))&&void 0!==key3?this._map.get(key3):key1)instanceof Ref&&this.xref?this.xref.fetch(key1,this.suppressEncryption):key1}async getAsync(key1,key2,key3){key1=this._map.get(key1);return(key1=void 0===key1&&void 0!==key2&&void 0===(key1=this._map.get(key2))&&void 0!==key3?this._map.get(key3):key1)instanceof Ref&&this.xref?this.xref.fetchAsync(key1,this.suppressEncryption):key1}getArray(key1,key2,key3){var value=this._map.get(key1);if((value=void 0===value&&void 0!==key2&&void 0===(value=this._map.get(key2))&&void 0!==key3?this._map.get(key3):value)instanceof Ref&&this.xref&&(value=this.xref.fetch(value,this.suppressEncryption)),Array.isArray(value))for(var i=0,ii=(value=value.slice()).length;i<ii;i++)value[i]instanceof Ref&&this.xref&&(value[i]=this.xref.fetch(value[i],this.suppressEncryption));return value}getRaw(key){return this._map.get(key)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(key,value){this._map.set(key,value)}has(key){return this._map.has(key)}*[Symbol.iterator](){for(var[key,value]of this._map)yield[key,value instanceof Ref&&this.xref?this.xref.fetch(value,this.suppressEncryption):value]}static get empty(){var emptyDict=new Dict(null);return emptyDict.set=(key,value)=>{unreachable("Should not call `set` on the empty dictionary.")},shadow(this,"empty",emptyDict)}static merge(_ref){var dict,name,values,{xref,dictArray:_ref,mergeSubDicts=!1}=_ref,mergedDict=new Dict(xref),properties=new Map;for(dict of _ref)if(dict instanceof Dict)for(var[key,value]of dict._map){var property=properties.get(key);if(void 0===property)properties.set(key,property=[]);else if(!(mergeSubDicts&&value instanceof Dict))continue;property.push(value)}for([name,values]of properties)if(1!==values.length&&values[0]instanceof Dict){var _dict,subDict=new Dict(xref);for(_dict of values)for(var[_key2,_value]of _dict._map)subDict._map.has(_key2)||subDict._map.set(_key2,_value);0<subDict.size&&mergedDict._map.set(name,subDict)}else mergedDict._map.set(name,values[0]);return properties.clear(),0<mergedDict.size?mergedDict:Dict.empty}clone(){var key,dict=new Dict(this.xref);for(key of this.getKeys())dict.set(key,this.getRaw(key));return dict}delete(key){delete this._map[key]}}class Ref{constructor(num,gen){this.num=num,this.gen=gen}toString(){return 0===this.gen?"".concat(this.num,"R"):"".concat(this.num,"R").concat(this.gen)}static fromString(str){var ref=RefCache[str];return ref||((ref=/^(\d+)R(\d*)$/.exec(str))&&"0"!==ref[1]?RefCache[str]=new Ref(parseInt(ref[1]),ref[2]?parseInt(ref[2]):0):null)}static get(num,gen){var key=0===gen?"".concat(num,"R"):"".concat(num,"R").concat(gen);return RefCache[key]||(RefCache[key]=new Ref(num,gen))}}class RefSet{constructor(){var parent=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;this._set=new Set(null==parent?void 0:parent._set)}has(ref){return this._set.has(ref.toString())}put(ref){this._set.add(ref.toString())}remove(ref){this._set.delete(ref.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(ref){return this._map.get(ref.toString())}has(ref){return this._map.has(ref.toString())}put(ref,obj){this._map.set(ref.toString(),obj)}putAlias(ref,aliasRef){this._map.set(ref.toString(),this.get(aliasRef))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(var[ref,value]of this._map)yield[Ref.fromString(ref),value]}}function isName(v,name){return v instanceof Name&&(void 0===name||v.name===name)}function isCmd(v,cmd){return v instanceof Cmd&&(void 0===cmd||v.cmd===cmd)}function isDict(v,type){return v instanceof Dict&&(void 0===type||isName(v.get("Type"),type))}function isRefsEqual(v1,v2){return v1.num===v2.num&&v1.gen===v2.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(length){unreachable("Abstract method `getBytes` called")}async getImageData(length,decoderOptions){return this.getBytes(length,decoderOptions)}async asyncGetBytes(){unreachable("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){var peekedByte=this.getByte();return-1!==peekedByte&&this.pos--,peekedByte}peekBytes(length){length=this.getBytes(length);return this.pos-=length.length,length}getUint16(){var b0=this.getByte(),b1=this.getByte();return-1===b0||-1===b1?-1:(b0<<8)+b1}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(begin,end){unreachable("Abstract method `getByteRange` called")}getString(length){return bytesToString(this.getBytes(length))}skip(n){this.pos+=n||1}reset(){unreachable("Abstract method `reset` called")}moveStart(){unreachable("Abstract method `moveStart` called")}makeSubStream(start,length){unreachable("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}var PDF_VERSION_REGEXP=/^[1-9]\.\d$/,MAX_INT_32=2**31-1,MIN_INT_32=-(2**31),IDENTITY_MATRIX=[1,0,0,1,0,0],RESOURCES_KEYS_OPERATOR_LIST=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],RESOURCES_KEYS_TEXT_CONTENT=["ExtGState","Font","Properties","XObject"];function getLookupTableFactory(initializer){var lookup;return function(){return initializer&&(lookup=Object.create(null),initializer(lookup),initializer=null),lookup}}class MissingDataException extends BaseException{constructor(begin,end){super("Missing data [".concat(begin,", ").concat(end,")"),"MissingDataException"),this.begin=begin,this.end=end}}class ParserEOFException extends BaseException{constructor(msg){super(msg,"ParserEOFException")}}class XRefEntryException extends BaseException{constructor(msg){super(msg,"XRefEntryException")}}class XRefParseException extends BaseException{constructor(msg){super(msg,"XRefParseException")}}function arrayBuffersToBytes(arr){var length=arr.length;if(0===length)return new Uint8Array(0);if(1===length)return new Uint8Array(arr[0]);for(var dataLength=0,i=0;i<length;i++)dataLength+=arr[i].byteLength;for(var data=new Uint8Array(dataLength),pos=0,_i=0;_i<length;_i++){var item=new Uint8Array(arr[_i]);data.set(item,pos),pos+=item.byteLength}return data}async function fetchBinaryData(url){var response=await fetch(url);if(response.ok)return new Uint8Array(await response.arrayBuffer());throw new Error('Failed to fetch file "'.concat(url,'" with "').concat(response.statusText,'".'))}function getInheritableProperty(_ref2){for(var values,{dict,key,getArray=!1,stopWhenFound=!0}=_ref2,visited=new RefSet;dict instanceof Dict&&(!dict.objId||!visited.has(dict.objId));){dict.objId&&visited.put(dict.objId);var value=getArray?dict.getArray(key):dict.get(key);if(void 0!==value){if(stopWhenFound)return value;(values=values||[]).push(value)}dict=dict.get("Parent")}return values}function getParentToUpdate(dict,ref,xref){for(var visited=new RefSet,firstDict=dict,result={dict:null,ref:null};dict instanceof Dict&&!visited.has(ref)&&(visited.put(ref),!dict.has("T"));){if(!((ref=dict.getRaw("Parent"))instanceof Ref))return result;dict=xref.fetch(ref)}return dict instanceof Dict&&dict!==firstDict&&(result.dict=dict,result.ref=ref),result}var ROMAN_NUMBER_MAP=["","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(number){var lowerCase=1<arguments.length&&void 0!==arguments[1]&&arguments[1],roman=(assert(Number.isInteger(number)&&0<number,"The number should be a positive integer."),"M".repeat(number/1e3|0)+ROMAN_NUMBER_MAP[number%1e3/100|0]+ROMAN_NUMBER_MAP[10+(number%100/10|0)]+ROMAN_NUMBER_MAP[20+number%10]);return lowerCase?roman.toLowerCase():roman}function log2(x){return 0<x?Math.ceil(Math.log2(x)):0}function readInt8(data,offset){return data[offset]<<24>>24}function readInt16(data,offset){return(data[offset]<<24|data[offset+1]<<16)>>16}function readUint16(data,offset){return data[offset]<<8|data[offset+1]}function readUint32(data,offset){return(data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3])>>>0}function isWhiteSpace(ch){return 32===ch||9===ch||13===ch||10===ch}function isBooleanArray(arr,len){return Array.isArray(arr)&&(null===len||arr.length===len)&&arr.every(x=>"boolean"==typeof x)}function isNumberArray(arr,len){return Array.isArray(arr)?(null===len||arr.length===len)&&arr.every(x=>"number"==typeof x):ArrayBuffer.isView(arr)&&!(arr instanceof BigInt64Array||arr instanceof BigUint64Array)&&(null===len||arr.length===len)}function lookupMatrix(arr,fallback){return isNumberArray(arr,6)?arr:fallback}function lookupRect(arr,fallback){return isNumberArray(arr,4)?arr:fallback}function lookupNormalRect(arr,fallback){return isNumberArray(arr,4)?Util.normalizeRect(arr):fallback}function parseXFAPath(path){var positionPattern=/(.+)\[(\d+)\]$/;return path.split(".").map(component=>{var m=component.match(positionPattern);return m?{name:m[1],pos:parseInt(m[2],10)}:{name:component,pos:0}})}function escapePDFName(str){for(var buffer=[],start=0,i=0,ii=str.length;i<ii;i++){var char=str.charCodeAt(i);(char<33||126<char||35===char||40===char||41===char||60===char||62===char||91===char||93===char||123===char||125===char||47===char||37===char)&&(start<i&&buffer.push(str.substring(start,i)),buffer.push("#".concat(char.toString(16))),start=i+1)}return 0===buffer.length?str:(start<str.length&&buffer.push(str.substring(start,str.length)),buffer.join(""))}function escapeString(str){return str.replaceAll(/([()\\\n\r])/g,match=>"\n"===match?"\\n":"\r"===match?"\\r":"\\".concat(match))}function _collectJS(entry,xref,list,parents){if(entry){var js,code,parent=null;if(entry instanceof Ref){if(parents.has(entry))return;parent=entry,parents.put(parent),entry=xref.fetch(entry)}if(Array.isArray(entry))for(var element of entry)_collectJS(element,xref,list,parents);else entry instanceof Dict&&(isName(entry.get("S"),"JavaScript")&&((js=entry.get("JS"))instanceof BaseStream?code=js.getString():"string"==typeof js&&(code=js),code=code&&stringToPDFString(code,!0).replaceAll("\0",""))&&list.push(code),_collectJS(entry.getRaw("Next"),xref,list,parents));parent&&parents.remove(parent)}}function collectActions(xref,dict,eventType){var _list,actions=Object.create(null),additionalActionsDicts=getInheritableProperty({dict:dict,key:"AA",stopWhenFound:!1});if(additionalActionsDicts)for(var i=additionalActionsDicts.length-1;0<=i;i--){var additionalActions=additionalActionsDicts[i];if(additionalActions instanceof Dict)for(var key of additionalActions.getKeys()){var list,action=eventType[key];action&&(list=[],_collectJS(additionalActions.getRaw(key),xref,list,new RefSet),0<list.length)&&(actions[action]=list)}}return dict.has("A")&&(_list=[],_collectJS(dict.get("A"),xref,_list,new RefSet),0<_list.length)&&(actions.Action=_list),0<objectSize(actions)?actions:null}var XMLEntities={60:"<",62:">",38:"&",34:""",39:"'"};function*codePointIter(str){for(var i=0,ii=str.length;i<ii;i++){var char=str.codePointAt(i);55295<char&&(char<57344||65533<char)&&i++,yield char}}function encodeToXmlString(str){for(var buffer=[],start=0,i=0,ii=str.length;i<ii;i++){var entity,char=str.codePointAt(i);32<=char&&char<=126?(entity=XMLEntities[char])&&(start<i&&buffer.push(str.substring(start,i)),buffer.push(entity),start=i+1):(start<i&&buffer.push(str.substring(start,i)),buffer.push("&#x".concat(char.toString(16).toUpperCase(),";")),55295<char&&(char<57344||65533<char)&&i++,start=i+1)}return 0===buffer.length?str:(start<str.length&&buffer.push(str.substring(start,str.length)),buffer.join(""))}function validateFontName(fontFamily){var mustWarn=1<arguments.length&&void 0!==arguments[1]&&arguments[1],m=/^("|').*("|')$/.exec(fontFamily);if(m&&m[1]===m[2]){if(new RegExp("[^\\\\]".concat(m[1])).test(fontFamily.slice(1,-1)))return mustWarn&&warn("FontFamily contains unescaped ".concat(m[1],": ").concat(fontFamily,".")),!1}else for(var ident of fontFamily.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(ident)||!/^[\w-\\]+$/.test(ident))return mustWarn&&warn("FontFamily contains invalid <custom-ident>: ".concat(fontFamily,".")),!1;return!0}function validateCSSFont(cssFontInfo){var CSS_FONT_WEIGHT_VALUES=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily,fontWeight,italicAngle}=cssFontInfo;return!!validateFontName(fontFamily,!0)&&(fontFamily=fontWeight?fontWeight.toString():"",cssFontInfo.fontWeight=CSS_FONT_WEIGHT_VALUES.has(fontFamily)?fontFamily:"400",fontWeight=parseFloat(italicAngle),cssFontInfo.italicAngle=isNaN(fontWeight)||fontWeight<-90||90<fontWeight?"14":italicAngle.toString(),!0)}function recoverJsURL(str){str=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").replaceAll(".","\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(str);return null!=str&&str[2]?{url:str[2],newWindow:"app.launchURL"===str[1]&&"true"===str[3]}:null}function numberToString(value){var roundedValue;return Number.isInteger(value)?value.toString():(roundedValue=Math.round(100*value))%100==0?(roundedValue/100).toString():roundedValue%10==0?value.toFixed(1):value.toFixed(2)}function getNewAnnotationsMap(annotationStorage){if(!annotationStorage)return null;var key,value,annotations,newAnnotationsByPage=new Map;for([key,value]of annotationStorage)key.startsWith(AnnotationEditorPrefix)&&((annotations=newAnnotationsByPage.get(value.pageIndex))||newAnnotationsByPage.set(value.pageIndex,annotations=[]),annotations.push(value));return 0<newAnnotationsByPage.size?newAnnotationsByPage:null}function stringToAsciiOrUTF16BE(str){return isAscii(str)?str:stringToUTF16String(str,!0)}function isAscii(str){return/^[\x00-\x7F]*$/.test(str)}function stringToUTF16HexString(str){for(var buf=[],i=0,ii=str.length;i<ii;i++){var char=str.charCodeAt(i);buf.push(hexNumbers[char>>8&255],hexNumbers[255&char])}return buf.join("")}function stringToUTF16String(str){var buf=[];1<arguments.length&&void 0!==arguments[1]&&arguments[1]&&buf.push("þÿ");for(var i=0,ii=str.length;i<ii;i++){var char=str.charCodeAt(i);buf.push(String.fromCharCode(char>>8&255),String.fromCharCode(255&char))}return buf.join("")}function getRotationMatrix(rotation,width,height){switch(rotation){case 90:return[0,1,-1,0,width,0];case 180:return[-1,0,0,-1,width,height];case 270:return[0,-1,1,0,0,height];default:throw new Error("Invalid rotation")}}function getSizeInBytes(x){return Math.ceil(Math.ceil(Math.log2(1+x))/8)}class QCMS{static get _memoryArray(){var array=_assertClassBrand(QCMS,this,_memoryArray2)._;return null!=array&&array.byteLength?array:_memoryArray2._=_assertClassBrand(QCMS,this,new Uint8Array(this._memory.buffer))}}var wasm,_memoryArray2={_:null};function copy_result(ptr,len){var{_mustAddAlpha,_destBuffer,_destOffset,_destLength,_memoryArray}=QCMS;if(len===_destLength)_destBuffer.set(_memoryArray.subarray(ptr,ptr+len),_destOffset);else if(_mustAddAlpha)for(var i=ptr,ii=ptr+len,j=_destOffset;i<ii;i+=3,j+=4)_destBuffer[j]=_memoryArray[i],_destBuffer[j+1]=_memoryArray[i+1],_destBuffer[j+2]=_memoryArray[i+2],_destBuffer[j+3]=255;else for(var _i2=ptr,_ii=ptr+len,_j=_destOffset;_i2<_ii;_i2+=3,_j+=4)_destBuffer[_j]=_memoryArray[_i2],_destBuffer[_j+1]=_memoryArray[_i2+1],_destBuffer[_j+2]=_memoryArray[_i2+2]}function copy_rgb(ptr){var{_destBuffer,_destOffset,_memoryArray}=QCMS;_destBuffer[_destOffset]=_memoryArray[ptr],_destBuffer[_destOffset+1]=_memoryArray[ptr+1],_destBuffer[_destOffset+2]=_memoryArray[ptr+2]}function make_cssRGB(ptr){var _memoryArray=QCMS["_memoryArray"];QCMS._cssColor=QCMS._makeHexColor(_memoryArray[ptr],_memoryArray[ptr+1],_memoryArray[ptr+2])}_defineProperty(QCMS,"_memory",null),_defineProperty(QCMS,"_mustAddAlpha",!1),_defineProperty(QCMS,"_destBuffer",null),_defineProperty(QCMS,"_destOffset",0),_defineProperty(QCMS,"_destLength",0),_defineProperty(QCMS,"_cssColor",""),_defineProperty(QCMS,"_makeHexColor",null);var cachedTextDecoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}},cachedUint8ArrayMemory0=("undefined"!=typeof TextDecoder&&cachedTextDecoder.decode(),null);function getUint8ArrayMemory0(){return cachedUint8ArrayMemory0=null!==cachedUint8ArrayMemory0&&0!==cachedUint8ArrayMemory0.byteLength?cachedUint8ArrayMemory0:new Uint8Array(wasm.memory.buffer)}function getStringFromWasm0(ptr,len){return ptr>>>=0,cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr,ptr+len))}var WASM_VECTOR_LEN=0;function passArray8ToWasm0(arg,malloc){malloc=malloc(+arg.length,1)>>>0;return getUint8ArrayMemory0().set(arg,malloc),WASM_VECTOR_LEN=arg.length,malloc}function qcms_convert_array(transformer,src){var src=passArray8ToWasm0(src,wasm.__wbindgen_malloc),len0=WASM_VECTOR_LEN;wasm.qcms_convert_array(transformer,src,len0)}function qcms_convert_one(transformer,src,css){wasm.qcms_convert_one(transformer,src,css)}function qcms_convert_three(transformer,src1,src2,src3,css){wasm.qcms_convert_three(transformer,src1,src2,src3,css)}function qcms_convert_four(transformer,src1,src2,src3,src4,css){wasm.qcms_convert_four(transformer,src1,src2,src3,src4,css)}function qcms_transformer_from_memory(mem,in_type,intent){var mem=passArray8ToWasm0(mem,wasm.__wbindgen_malloc),len0=WASM_VECTOR_LEN;return wasm.qcms_transformer_from_memory(mem,len0,in_type,intent)>>>0}function qcms_drop_transformer(transformer){wasm.qcms_drop_transformer(transformer)}var DataType=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"}),Intent=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});async function __wbg_load(module,imports){if("function"==typeof Response&&module instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(module,imports)}catch(e){if("application/wasm"==module.headers.get("Content-Type"))throw e;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",e)}var bytes=await module.arrayBuffer();return WebAssembly.instantiate(bytes,imports)}return(bytes=await WebAssembly.instantiate(module,imports))instanceof WebAssembly.Instance?{instance:bytes,module:module}:bytes}function __wbg_get_imports(){var imports={wbg:{}};return imports.wbg.__wbg_copyresult_b08ee7d273f295dd=function(arg0,arg1){copy_result(arg0>>>0,arg1>>>0)},imports.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(arg0){copy_rgb(arg0>>>0)},imports.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(arg0){make_cssRGB(arg0>>>0)},imports.wbg.__wbindgen_init_externref_table=function(){var table=wasm.__wbindgen_export_0,offset=table.grow(4);table.set(0,void 0),table.set(offset+0,void 0),table.set(offset+1,null),table.set(offset+2,!0),table.set(offset+3,!1)},imports.wbg.__wbindgen_throw=function(arg0,arg1){throw new Error(getStringFromWasm0(arg0,arg1))},imports}function __wbg_init_memory(imports,memory){}function __wbg_finalize_init(instance,module){return wasm=instance.exports,__wbg_init.__wbindgen_wasm_module=module,cachedUint8ArrayMemory0=null,wasm.__wbindgen_start(),wasm}function initSync(module){if(void 0!==wasm)return wasm;void 0!==module&&(Object.getPrototypeOf(module)===Object.prototype?module=module["module"]:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));var imports=__wbg_get_imports();return __wbg_init_memory(imports),module instanceof WebAssembly.Module||(module=new WebAssembly.Module(module)),__wbg_finalize_init(new WebAssembly.Instance(module,imports),module)}async function __wbg_init(module_or_path){if(void 0!==wasm)return wasm;void 0!==module_or_path&&(Object.getPrototypeOf(module_or_path)===Object.prototype?module_or_path=module_or_path["module_or_path"]:console.warn("using deprecated parameters for the initialization function; pass a single object instead"));var imports=__wbg_get_imports(),{instance:module_or_path,module:imports}=(("string"==typeof module_or_path||"function"==typeof Request&&module_or_path instanceof Request||"function"==typeof URL&&module_or_path instanceof URL)&&(module_or_path=fetch(module_or_path)),__wbg_init_memory(imports),await __wbg_load(await module_or_path,imports));return __wbg_finalize_init(module_or_path,imports)}var qcms=null;function resizeRgbImage(src,dest,w1,h1,w2,h2,alpha01){alpha01=1!==alpha01?0:alpha01;for(var oldIndex,xRatio=w1/w2,yRatio=h1/h2,newIndex=0,xScaled=new Uint16Array(w2),w1Scanline=3*w1,i=0;i<w2;i++)xScaled[i]=3*Math.floor(i*xRatio);for(var _i3=0;_i3<h2;_i3++)for(var py=Math.floor(_i3*yRatio)*w1Scanline,j=0;j<w2;j++)oldIndex=py+xScaled[j],dest[newIndex++]=src[oldIndex++],dest[newIndex++]=src[oldIndex++],dest[newIndex++]=src[+oldIndex],newIndex+=alpha01}function resizeRgbaImage(src,dest,w1,h1,w2,h2,alpha01){var xRatio=w1/w2,yRatio=h1/h2,newIndex=0,xScaled=new Uint16Array(w2);if(1===alpha01){for(var i=0;i<w2;i++)xScaled[i]=Math.floor(i*xRatio);for(var src32=new Uint32Array(src.buffer),dest32=new Uint32Array(dest.buffer),rgbMask=FeatureTest.isLittleEndian?16777215:4294967040,_i4=0;_i4<h2;_i4++)for(var buf=src32.subarray(Math.floor(_i4*yRatio)*w1),j=0;j<w2;j++)dest32[newIndex++]|=buf[xScaled[j]]&rgbMask}else{for(var w1Scanline=4*w1,_i5=0;_i5<w2;_i5++)xScaled[_i5]=4*Math.floor(_i5*xRatio);for(var _i6=0;_i6<h2;_i6++)for(var _buf=src.subarray(Math.floor(_i6*yRatio)*w1Scanline),_j2=0;_j2<w2;_j2++){var oldIndex=xScaled[_j2];dest[newIndex++]=_buf[oldIndex],dest[newIndex++]=_buf[oldIndex+1],dest[newIndex++]=_buf[oldIndex+2]}}}function copyRgbaImage(src,dest,alpha01){if(1===alpha01)for(var src32=new Uint32Array(src.buffer),dest32=new Uint32Array(dest.buffer),rgbMask=FeatureTest.isLittleEndian?16777215:4294967040,i=0,ii=src32.length;i<ii;i++)dest32[i]|=src32[i]&rgbMask;else for(var j=0,_i7=0,_ii2=src.length;_i7<_ii2;_i7+=4)dest[j++]=src[_i7],dest[j++]=src[_i7+1],dest[j++]=src[_i7+2]}class ColorSpace{constructor(name,numComps){this.name=name,this.numComps=numComps}getRgb(src,srcOffset){var output=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new Uint8ClampedArray(3);return this.getRgbItem(src,srcOffset,output,0),output}getRgbHex(src,srcOffset){src=this.getRgb(src,srcOffset,_rgbBuf._);return Util.makeHexColor(src[0],src[1],src[2])}getRgbItem(src,srcOffset,dest,destOffset){unreachable("Should not call ColorSpace.getRgbItem")}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){unreachable("Should not call ColorSpace.getRgbBuffer")}getOutputLength(inputLength,alpha01){unreachable("Should not call ColorSpace.getOutputLength")}isPassthrough(bits){return!1}isDefaultDecode(decodeMap,bpc){return ColorSpace.isDefaultDecode(decodeMap,this.numComps)}fillRgb(dest,originalWidth,originalHeight,width,height,actualHeight,bpc,comps,alpha01){var count=originalWidth*originalHeight,rgbBuf=null,numComponentColors=1<<bpc,needsResizing=originalHeight!==height||originalWidth!==width;if(this.isPassthrough(bpc))rgbBuf=comps;else if(1===this.numComps&&numComponentColors<count&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var allColors=new(bpc<=8?Uint8Array:Uint16Array)(numComponentColors),i=0;i<numComponentColors;i++)allColors[i]=i;var colorMap=new Uint8ClampedArray(3*numComponentColors);if(this.getRgbBuffer(allColors,0,numComponentColors,colorMap,0,bpc,0),needsResizing)for(var rgbBuf=new Uint8Array(3*count),rgbPos=0,_i9=0;_i9<count;++_i9){var _key3=3*comps[_i9];rgbBuf[rgbPos++]=colorMap[_key3],rgbBuf[rgbPos++]=colorMap[1+_key3],rgbBuf[rgbPos++]=colorMap[2+_key3]}else for(var destPos=0,_i8=0;_i8<count;++_i8){var key=3*comps[_i8];dest[destPos++]=colorMap[key],dest[destPos++]=colorMap[1+key],dest[destPos++]=colorMap[2+key],destPos+=alpha01}}else needsResizing?(rgbBuf=new Uint8ClampedArray(3*count),this.getRgbBuffer(comps,0,count,rgbBuf,0,bpc,0)):this.getRgbBuffer(comps,0,width*actualHeight,dest,0,bpc,alpha01);if(rgbBuf)if(needsResizing)resizeRgbImage(rgbBuf,dest,originalWidth,originalHeight,width,height,alpha01);else for(var _destPos=0,_rgbPos=0,_i0=0,ii=width*actualHeight;_i0<ii;_i0++)dest[_destPos++]=rgbBuf[_rgbPos++],dest[_destPos++]=rgbBuf[_rgbPos++],dest[_destPos++]=rgbBuf[_rgbPos++],_destPos+=alpha01}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!0)}static isDefaultDecode(decode,numComps){if(Array.isArray(decode))if(2*numComps!==decode.length)warn("The decode map is not the correct length");else for(var i=0,ii=decode.length;i<ii;i+=2)if(0!==decode[i]||1!==decode[i+1])return!1;return!0}}var _rgbBuf={_:new Uint8ClampedArray(3)};class AlternateCS extends ColorSpace{constructor(numComps,base,tintFn){super("Alternate",numComps),this.base=base,this.tintFn=tintFn,this.tmpBuf=new Float32Array(base.numComps)}getRgbItem(src,srcOffset,dest,destOffset){var tmpBuf=this.tmpBuf;this.tintFn(src,srcOffset,tmpBuf,0),this.base.getRgbItem(tmpBuf,0,dest,destOffset)}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var j,tintFn=this.tintFn,base=this.base,scale=1/((1<<bits)-1),baseNumComps=base.numComps,usesZeroToOneRange=base.usesZeroToOneRange,bits=(base.isPassthrough(8)||!usesZeroToOneRange)&&0===alpha01,pos=bits?destOffset:0,baseBuf=bits?dest:new Uint8ClampedArray(baseNumComps*count),numComps=this.numComps,scaled=new Float32Array(numComps),tinted=new Float32Array(baseNumComps),i=0;i<count;i++){for(j=0;j<numComps;j++)scaled[j]=src[srcOffset++]*scale;if(tintFn(scaled,0,tinted,0),usesZeroToOneRange)for(j=0;j<baseNumComps;j++)baseBuf[pos++]=255*tinted[j];else base.getRgbItem(tinted,0,baseBuf,pos),pos+=baseNumComps}bits||base.getRgbBuffer(baseBuf,0,count,dest,destOffset,8,alpha01)}getOutputLength(inputLength,alpha01){return this.base.getOutputLength(inputLength*this.base.numComps/this.numComps,alpha01)}}class PatternCS extends ColorSpace{constructor(baseCS){super("Pattern",null),this.base=baseCS}isDefaultDecode(decodeMap,bpc){unreachable("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(base,highVal,lookup){super("Indexed",1),this.base=base,this.highVal=highVal;var length=base.numComps*(highVal+1);if(this.lookup=new Uint8Array(length),lookup instanceof BaseStream){base=lookup.getBytes(length);this.lookup.set(base)}else{if("string"!=typeof lookup)throw new FormatError("IndexedCS - unrecognized lookup table: ".concat(lookup));for(var i=0;i<length;++i)this.lookup[i]=255&lookup.charCodeAt(i)}}getRgbItem(src,srcOffset,dest,destOffset){var{base,highVal,lookup}=this,src=MathClamp(Math.round(src[srcOffset]),0,highVal)*base.numComps;base.getRgbBuffer(lookup,src,1,dest,destOffset,8,0)}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var{base,highVal,lookup}=this,numComps=base["numComps"],outputDelta=base.getOutputLength(numComps,alpha01),i=0;i<count;++i){var lookupPos=MathClamp(Math.round(src[srcOffset++]),0,highVal)*numComps;base.getRgbBuffer(lookup,lookupPos,1,dest,destOffset,8,alpha01),destOffset+=outputDelta}}getOutputLength(inputLength,alpha01){return this.base.getOutputLength(inputLength*this.base.numComps,alpha01)}isDefaultDecode(decodeMap,bpc){return!Array.isArray(decodeMap)||(2!==decodeMap.length?(warn("Decode map length is not correct"),!0):!Number.isInteger(bpc)||bpc<1?(warn("Bits per component is not correct"),!0):0===decodeMap[0]&&decodeMap[1]===(1<<bpc)-1)}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(src,srcOffset,dest,destOffset){src=255*src[srcOffset];dest[destOffset]=dest[destOffset+1]=dest[destOffset+2]=src}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var scale=255/((1<<bits)-1),j=srcOffset,q=destOffset,i=0;i<count;++i){var c=scale*src[j++];dest[q++]=c,dest[q++]=c,dest[q++]=c,q+=alpha01}}getOutputLength(inputLength,alpha01){return inputLength*(3+alpha01)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(src,srcOffset,dest,destOffset){dest[destOffset]=255*src[srcOffset],dest[destOffset+1]=255*src[srcOffset+1],dest[destOffset+2]=255*src[srcOffset+2]}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){if(8===bits&&0===alpha01)dest.set(src.subarray(srcOffset,srcOffset+3*count),destOffset);else for(var scale=255/((1<<bits)-1),j=srcOffset,q=destOffset,i=0;i<count;++i)dest[q++]=scale*src[j++],dest[q++]=scale*src[j++],dest[q++]=scale*src[j++],q+=alpha01}getOutputLength(inputLength,alpha01){return inputLength*(3+alpha01)/3|0}isPassthrough(bits){return 8===bits}}class DeviceRgbaCS extends ColorSpace{constructor(){super("DeviceRGBA",4)}getOutputLength(inputLength,_alpha01){return 4*inputLength}isPassthrough(bits){return 8===bits}fillRgb(dest,originalWidth,originalHeight,width,height,actualHeight,bpc,comps,alpha01){originalHeight!==height||originalWidth!==width?resizeRgbaImage(comps,dest,originalWidth,originalHeight,width,height,alpha01):copyRgbaImage(comps,dest,alpha01)}}var _DeviceCmykCS_brand=new WeakSet;class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4),_classPrivateMethodInitSpec(this,_DeviceCmykCS_brand)}getRgbItem(src,srcOffset,dest,destOffset){_assertClassBrand(_DeviceCmykCS_brand,this,_toRgb).call(this,src,srcOffset,1,dest,destOffset)}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var scale=1/((1<<bits)-1),i=0;i<count;i++)_assertClassBrand(_DeviceCmykCS_brand,this,_toRgb).call(this,src,srcOffset,scale,dest,destOffset),srcOffset+=4,destOffset+=3+alpha01}getOutputLength(inputLength,alpha01){return inputLength/4*(3+alpha01)|0}}function _toRgb(src,srcOffset,srcScale,dest,destOffset){var c=src[srcOffset]*srcScale,m=src[srcOffset+1]*srcScale,y=src[srcOffset+2]*srcScale,src=src[srcOffset+3]*srcScale;dest[destOffset]=255+c*(-4.387332384609988*c+54.48615194189176*m+18.82290502165302*y+212.25662451639585*src-285.2331026137004)+m*(1.7149763477362134*m-5.6096736904047315*y+-17.873870861415444*src-5.497006427196366)+y*(-2.5217340131683033*y-21.248923337353073*src+17.5119270841813)+src*(-21.86122147463605*src-189.48180835922747),dest[destOffset+1]=255+c*(8.841041422036149*c+60.118027045597366*m+6.871425592049007*y+31.159100130055922*src-79.2970844816548)+m*(-15.310361306967817*m+17.575251261109482*y+131.35250912493976*src-190.9453302588951)+y*(4.444339102852739*y+9.8632861493405*src-24.86741582555878)+src*(-20.737325471181034*src-187.80453709719578),dest[destOffset+2]=255+c*(.8842522430003296*c+8.078677503112928*m+30.89978309703729*y-.23883238689178934*src-14.183576799673286)+m*(10.49593273432072*m+63.02378494754052*y+50.606957656360734*src-112.23884253719248)+y*(.03296041114873217*y+115.60384449646641*src-193.58209356861505)+src*(-22.33816807309886*src-180.12613974708367)}var _CalGrayCS_brand=new WeakSet;class CalGrayCS extends ColorSpace{constructor(whitePoint,blackPoint,gamma){if(super("CalGray",1),_classPrivateMethodInitSpec(this,_CalGrayCS_brand),!whitePoint)throw new FormatError("WhitePoint missing - required for color space CalGray");if([this.XW,this.YW,this.ZW]=whitePoint,[this.XB,this.YB,this.ZB]=blackPoint||[0,0,0],this.G=gamma||1,this.XW<0||this.ZW<0||1!==this.YW)throw new FormatError("Invalid WhitePoint components for ".concat(this.name,", no fallback available"));(this.XB<0||this.YB<0||this.ZB<0)&&(info("Invalid BlackPoint for ".concat(this.name,", falling back to default.")),this.XB=this.YB=this.ZB=0),0===this.XB&&0===this.YB&&0===this.ZB||warn("".concat(this.name,", BlackPoint: XB: ").concat(this.XB,", YB: ").concat(this.YB,", ")+"ZB: ".concat(this.ZB,", only default values are supported.")),this.G<1&&(info("Invalid Gamma: ".concat(this.G," for ").concat(this.name,", falling back to default.")),this.G=1)}getRgbItem(src,srcOffset,dest,destOffset){_assertClassBrand(_CalGrayCS_brand,this,_toRgb2).call(this,src,srcOffset,dest,destOffset,1)}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var scale=1/((1<<bits)-1),i=0;i<count;++i)_assertClassBrand(_CalGrayCS_brand,this,_toRgb2).call(this,src,srcOffset,dest,destOffset,scale),srcOffset+=1,destOffset+=3+alpha01}getOutputLength(inputLength,alpha01){return inputLength*(3+alpha01)}}function _toRgb2(src,srcOffset,dest,destOffset,scale){src=(src[srcOffset]*scale)**this.G,srcOffset=this.YW*src,scale=Math.max(295.8*srcOffset**.3333333333333333-40.8,0);dest[destOffset]=scale,dest[destOffset+1]=scale,dest[destOffset+2]=scale}var _CalRGBCS_brand=new WeakSet;class CalRGBCS extends ColorSpace{constructor(whitePoint,blackPoint,gamma,matrix){if(super("CalRGB",3),_classPrivateMethodInitSpec(this,_CalRGBCS_brand),!whitePoint)throw new FormatError("WhitePoint missing - required for color space CalRGB");var[whitePoint,YW,ZW]=this.whitePoint=whitePoint,[blackPoint,YB,ZB]=this.blackPoint=blackPoint||new Float32Array(3);if([this.GR,this.GG,this.GB]=gamma||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=matrix||new Float32Array([1,0,0,0,1,0,0,0,1]),whitePoint<0||ZW<0||1!==YW)throw new FormatError("Invalid WhitePoint components for ".concat(this.name,", no fallback available"));(blackPoint<0||YB<0||ZB<0)&&(info("Invalid BlackPoint for ".concat(this.name," [").concat(blackPoint,", ").concat(YB,", ").concat(ZB,"], ")+"falling back to default."),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(info("Invalid Gamma [".concat(this.GR,", ").concat(this.GG,", ").concat(this.GB,"] for ")+"".concat(this.name,", falling back to default.")),this.GR=this.GG=this.GB=1)}getRgbItem(src,srcOffset,dest,destOffset){_assertClassBrand(_CalRGBCS_brand,this,_toRgb3).call(this,src,srcOffset,dest,destOffset,1)}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var scale=1/((1<<bits)-1),i=0;i<count;++i)_assertClassBrand(_CalRGBCS_brand,this,_toRgb3).call(this,src,srcOffset,dest,destOffset,scale),srcOffset+=3,destOffset+=3+alpha01}getOutputLength(inputLength,alpha01){return inputLength*(3+alpha01)/3|0}}function _matrixProduct(a,b,result){result[0]=a[0]*b[0]+a[1]*b[1]+a[2]*b[2],result[1]=a[3]*b[0]+a[4]*b[1]+a[5]*b[2],result[2]=a[6]*b[0]+a[7]*b[1]+a[8]*b[2]}function _toFlat(sourceWhitePoint,LMS,result){result[0]=+LMS[0]/sourceWhitePoint[0],result[1]=+LMS[1]/sourceWhitePoint[1],result[2]=+LMS[2]/sourceWhitePoint[2]}function _toD(sourceWhitePoint,LMS,result){result[0]=.95047*LMS[0]/sourceWhitePoint[0],result[1]=+LMS[1]/sourceWhitePoint[1],result[2]=1.08883*LMS[2]/sourceWhitePoint[2]}function _sRGBTransferFunction(color){return color<=.0031308?MathClamp(12.92*color,0,1):.99554525<=color?1:MathClamp(1.055*color**(1/2.4)-.055,0,1)}function _decodeL(L){return L<0?-_assertClassBrand(_CalRGBCS_brand,this,_decodeL).call(this,-L):8<L?((L+16)/116)**3:L*_DECODE_L_CONSTANT._}function _compensateBlackPoint(sourceBlackPoint,XYZ_Flat,result){var X_Scale,Y_Scale,Y_Offset,zeroDecodeL;0===sourceBlackPoint[0]&&0===sourceBlackPoint[1]&&0===sourceBlackPoint[2]?(result[0]=XYZ_Flat[0],result[1]=XYZ_Flat[1],result[2]=XYZ_Flat[2]):(X_Scale=(1-(zeroDecodeL=_assertClassBrand(_CalRGBCS_brand,this,_decodeL).call(this,0)))/(1-_assertClassBrand(_CalRGBCS_brand,this,_decodeL).call(this,sourceBlackPoint[0])),Y_Offset=1-(Y_Scale=(1-zeroDecodeL)/(1-_assertClassBrand(_CalRGBCS_brand,this,_decodeL).call(this,sourceBlackPoint[1]))),sourceBlackPoint=1-(zeroDecodeL=(1-zeroDecodeL)/(1-_assertClassBrand(_CalRGBCS_brand,this,_decodeL).call(this,sourceBlackPoint[2]))),result[0]=XYZ_Flat[0]*X_Scale+(1-X_Scale),result[1]=XYZ_Flat[1]*Y_Scale+Y_Offset,result[2]=XYZ_Flat[2]*zeroDecodeL+sourceBlackPoint)}function _normalizeWhitePointToFlat(sourceWhitePoint,XYZ_In,result){var LMS;1===sourceWhitePoint[0]&&1===sourceWhitePoint[2]?(result[0]=XYZ_In[0],result[1]=XYZ_In[1],result[2]=XYZ_In[2]):(LMS=result,_assertClassBrand(_CalRGBCS_brand,this,_matrixProduct).call(this,_BRADFORD_SCALE_MATRIX._,XYZ_In,LMS),XYZ_In=_tempNormalizeMatrix._,_assertClassBrand(_CalRGBCS_brand,this,_toFlat).call(this,sourceWhitePoint,LMS,XYZ_In),_assertClassBrand(_CalRGBCS_brand,this,_matrixProduct).call(this,_BRADFORD_SCALE_INVERSE_MATRIX._,XYZ_In,result))}function _normalizeWhitePointToD(sourceWhitePoint,XYZ_In,result){var LMS=result,XYZ_In=(_assertClassBrand(_CalRGBCS_brand,this,_matrixProduct).call(this,_BRADFORD_SCALE_MATRIX._,XYZ_In,LMS),_tempNormalizeMatrix._);_assertClassBrand(_CalRGBCS_brand,this,_toD).call(this,sourceWhitePoint,LMS,XYZ_In),_assertClassBrand(_CalRGBCS_brand,this,_matrixProduct).call(this,_BRADFORD_SCALE_INVERSE_MATRIX._,XYZ_In,result)}function _toRgb3(src,srcOffset,dest,destOffset,scale){var A=MathClamp(src[srcOffset]*scale,0,1),B=MathClamp(src[srcOffset+1]*scale,0,1),src=MathClamp(src[srcOffset+2]*scale,0,1),srcOffset=1===A?1:A**this.GR,scale=1===B?1:B**this.GG,A=1===src?1:src**this.GB,B=this.MXA*srcOffset+this.MXB*scale+this.MXC*A,src=this.MYA*srcOffset+this.MYB*scale+this.MYC*A,srcOffset=this.MZA*srcOffset+this.MZB*scale+this.MZC*A,scale=_tempConvertMatrix._,A=(scale[0]=B,scale[1]=src,scale[2]=srcOffset,_tempConvertMatrix2._),B=(_assertClassBrand(_CalRGBCS_brand,this,_normalizeWhitePointToFlat).call(this,this.whitePoint,scale,A),_tempConvertMatrix._),src=(_assertClassBrand(_CalRGBCS_brand,this,_compensateBlackPoint).call(this,this.blackPoint,A,B),_tempConvertMatrix2._),srcOffset=(_assertClassBrand(_CalRGBCS_brand,this,_normalizeWhitePointToD).call(this,_FLAT_WHITEPOINT_MATRIX._,B,src),_tempConvertMatrix._);_assertClassBrand(_CalRGBCS_brand,this,_matrixProduct).call(this,_SRGB_D65_XYZ_TO_RGB_MATRIX._,src,srcOffset),dest[destOffset]=255*_assertClassBrand(_CalRGBCS_brand,this,_sRGBTransferFunction).call(this,srcOffset[0]),dest[destOffset+1]=255*_assertClassBrand(_CalRGBCS_brand,this,_sRGBTransferFunction).call(this,srcOffset[1]),dest[destOffset+2]=255*_assertClassBrand(_CalRGBCS_brand,this,_sRGBTransferFunction).call(this,srcOffset[2])}var _BRADFORD_SCALE_MATRIX={_:new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296])},_BRADFORD_SCALE_INVERSE_MATRIX={_:new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867])},_SRGB_D65_XYZ_TO_RGB_MATRIX={_:new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252])},_FLAT_WHITEPOINT_MATRIX={_:new Float32Array([1,1,1])},_tempNormalizeMatrix={_:new Float32Array(3)},_tempConvertMatrix={_:new Float32Array(3)},_tempConvertMatrix2={_:new Float32Array(3)},_DECODE_L_CONSTANT={_:(24/116)**3/8},_LabCS_brand=new WeakSet;class LabCS extends ColorSpace{constructor(whitePoint,blackPoint,range){if(super("Lab",3),_classPrivateMethodInitSpec(this,_LabCS_brand),!whitePoint)throw new FormatError("WhitePoint missing - required for color space Lab");if([this.XW,this.YW,this.ZW]=whitePoint,[this.amin,this.amax,this.bmin,this.bmax]=range||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=blackPoint||[0,0,0],this.XW<0||this.ZW<0||1!==this.YW)throw new FormatError("Invalid WhitePoint components, no fallback available");(this.XB<0||this.YB<0||this.ZB<0)&&(info("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(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)}getRgbItem(src,srcOffset,dest,destOffset){_assertClassBrand(_LabCS_brand,this,_toRgb4).call(this,src,srcOffset,!1,dest,destOffset)}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){for(var maxVal=(1<<bits)-1,i=0;i<count;i++)_assertClassBrand(_LabCS_brand,this,_toRgb4).call(this,src,srcOffset,maxVal,dest,destOffset),srcOffset+=3,destOffset+=3+alpha01}getOutputLength(inputLength,alpha01){return inputLength*(3+alpha01)/3|0}isDefaultDecode(decodeMap,bpc){return!0}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!1)}}function _fn_g(x){return 6/29<=x?x**3:108/841*(x-4/29)}function _decode(value,high1,low2,high2){return low2+value*(high2-low2)/high1}function _toRgb4(src,srcOffset,maxVal,dest,destOffset){var r,g,Ls=src[srcOffset],as=src[srcOffset+1],src=src[srcOffset+2],srcOffset=(!1!==maxVal&&(Ls=_assertClassBrand(_LabCS_brand,this,_decode).call(this,Ls,maxVal,0,100),as=_assertClassBrand(_LabCS_brand,this,_decode).call(this,as,maxVal,this.amin,this.amax),src=_assertClassBrand(_LabCS_brand,this,_decode).call(this,src,maxVal,this.bmin,this.bmax)),as>this.amax?as=this.amax:as<this.amin&&(as=this.amin),src>this.bmax?src=this.bmax:src<this.bmin&&(src=this.bmin),(Ls+16)/116),maxVal=srcOffset+as/500,Ls=srcOffset-src/200,as=this.XW*_assertClassBrand(_LabCS_brand,this,_fn_g).call(this,maxVal),src=this.YW*_assertClassBrand(_LabCS_brand,this,_fn_g).call(this,srcOffset),maxVal=this.ZW*_assertClassBrand(_LabCS_brand,this,_fn_g).call(this,Ls),srcOffset=this.ZW<1?(r=3.1339*as+-1.617*src+-.4906*maxVal,g=-.9785*as+1.916*src+.0333*maxVal,.072*as+-.229*src+1.4057*maxVal):(r=3.2406*as+-1.5372*src+-.4986*maxVal,g=-.9689*as+1.8758*src+.0415*maxVal,.0557*as+-.204*src+1.057*maxVal);dest[destOffset]=255*Math.sqrt(r),dest[destOffset+1]=255*Math.sqrt(g),dest[destOffset+2]=255*Math.sqrt(srcOffset)}function fetchSync(url){var xhr=new XMLHttpRequest;return xhr.open("GET",url,!1),xhr.responseType="arraybuffer",xhr.send(null),xhr.response}var _transformer=new WeakMap,_convertPixel=new WeakMap;class IccColorSpace extends ColorSpace{constructor(iccProfile,name,numComps){if(!IccColorSpace.isUsable)throw new Error("No ICC color space support");var inType;switch(super(name,numComps),_classPrivateFieldInitSpec(this,_transformer,void 0),_classPrivateFieldInitSpec(this,_convertPixel,void 0),numComps){case 1:inType=DataType.Gray8,_classPrivateFieldSet(_convertPixel,this,(src,srcOffset,css)=>qcms_convert_one(_classPrivateFieldGet(_transformer,this),255*src[srcOffset],css));break;case 3:inType=DataType.RGB8,_classPrivateFieldSet(_convertPixel,this,(src,srcOffset,css)=>qcms_convert_three(_classPrivateFieldGet(_transformer,this),255*src[srcOffset],255*src[srcOffset+1],255*src[srcOffset+2],css));break;case 4:inType=DataType.CMYK,_classPrivateFieldSet(_convertPixel,this,(src,srcOffset,css)=>qcms_convert_four(_classPrivateFieldGet(_transformer,this),255*src[srcOffset],255*src[srcOffset+1],255*src[srcOffset+2],255*src[srcOffset+3],css));break;default:throw new Error("Unsupported number of components: ".concat(numComps))}if(_classPrivateFieldSet(_transformer,this,qcms_transformer_from_memory(iccProfile,inType,Intent.Perceptual)),!_classPrivateFieldGet(_transformer,this))throw new Error("Failed to create ICC color space");_finalizer._.register(this,_classPrivateFieldGet(_transformer,this))}getRgbHex(src,srcOffset){return _classPrivateFieldGet(_convertPixel,this).call(this,src,srcOffset,!0),QCMS._cssColor}getRgbItem(src,srcOffset,dest,destOffset){QCMS._destBuffer=dest,QCMS._destOffset=destOffset,QCMS._destLength=3,_classPrivateFieldGet(_convertPixel,this).call(this,src,srcOffset,!1),QCMS._destBuffer=null}getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){if(src=src.subarray(srcOffset,srcOffset+count*this.numComps),8!==bits)for(var scale=255/((1<<bits)-1),i=0,ii=src.length;i<ii;i++)src[i]*=scale;QCMS._mustAddAlpha=alpha01&&dest.buffer===src.buffer,QCMS._destBuffer=dest,QCMS._destOffset=destOffset,QCMS._destLength=count*(3+alpha01),qcms_convert_array(_classPrivateFieldGet(_transformer,this),src),QCMS._mustAddAlpha=!1,QCMS._destBuffer=null}getOutputLength(inputLength,alpha01){return inputLength/this.numComps*(3+alpha01)|0}static setOptions(_ref3){var{useWasm:_ref3,useWorkerFetch,wasmUrl}=_ref3;useWorkerFetch?(_useWasm._=_assertClassBrand(IccColorSpace,this,_ref3),_wasmUrl._=_assertClassBrand(IccColorSpace,this,wasmUrl)):_useWasm._=_assertClassBrand(IccColorSpace,this,!1)}static get isUsable(){var isUsable=!1;if(_assertClassBrand(IccColorSpace,this,_useWasm)._)if(_assertClassBrand(IccColorSpace,this,_wasmUrl)._)try{this._module=initSync({module:fetchSync("".concat(_assertClassBrand(IccColorSpace,this,_wasmUrl)._,"qcms_bg.wasm"))}),isUsable=!!this._module,QCMS._memory=this._module.memory,QCMS._makeHexColor=Util.makeHexColor}catch(e){warn('ICCBased color space: "'.concat(e,'".'))}else warn("No ICC color space support due to missing `wasmUrl` API option");return shadow(this,"isUsable",isUsable)}}var _useWasm={_:!0},_wasmUrl={_:null},_finalizer={_:new FinalizationRegistry(transformer=>{qcms_drop_transformer(transformer)})};class CmykICCBasedCS extends IccColorSpace{constructor(){super(new Uint8Array(fetchSync("".concat(_iccUrl._,"CGATS001Compat-v2-micro.icc"))),"DeviceCMYK",4)}static setOptions(_ref4){_ref4=_ref4.iccUrl;_iccUrl._=_assertClassBrand(CmykICCBasedCS,this,_ref4)}static get isUsable(){var isUsable=!1;return IccColorSpace.isUsable&&(_assertClassBrand(CmykICCBasedCS,this,_iccUrl)._?isUsable=!0:warn("No CMYK ICC profile support due to missing `iccUrl` API option")),shadow(this,"isUsable",isUsable)}}var _iccUrl={_:void 0};class Stream extends BaseStream{constructor(arrayBuffer,start,length,dict){super(),this.bytes=arrayBuffer instanceof Uint8Array?arrayBuffer:new Uint8Array(arrayBuffer),this.start=start||0,this.pos=this.start,this.end=start+length||this.bytes.length,this.dict=dict}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(length){var bytes=this.bytes,pos=this.pos,strEnd=this.end;return length?(this.pos=length=strEnd<(length=pos+length)?strEnd:length,bytes.subarray(pos,length)):bytes.subarray(pos,strEnd)}getByteRange(begin,end){return end>this.end&&(end=this.end),this.bytes.subarray(begin=begin<0?0:begin,end)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(start,length){var dict=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return new Stream(this.bytes.buffer,start,length,dict)}}class StringStream extends Stream{constructor(str){super(stringToBytes(str))}}class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}class ChunkedStream extends Stream{constructor(length,chunkSize,manager){super(new Uint8Array(length),0,length,null),this.chunkSize=chunkSize,this._loadedChunks=new Set,this.numChunks=Math.ceil(length/chunkSize),this.manager=manager,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){for(var chunks=[],chunk=0,n=this.numChunks;chunk<n;++chunk)this._loadedChunks.has(chunk)||chunks.push(chunk);return chunks}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(begin,chunk){var chunkSize=this.chunkSize;if(begin%chunkSize!=0)throw new Error("Bad begin offset: ".concat(begin));var end=begin+chunk.byteLength;if(end%chunkSize!=0&&end!==this.bytes.length)throw new Error("Bad end offset: ".concat(end));this.bytes.set(new Uint8Array(chunk),begin);for(var chunk=Math.floor(begin/chunkSize),endChunk=Math.floor((end-1)/chunkSize)+1,curChunk=chunk;curChunk<endChunk;++curChunk)this._loadedChunks.add(curChunk)}onReceiveProgressiveData(data){for(var position=this.progressiveDataLength,beginChunk=Math.floor(position/this.chunkSize),endChunk=(this.bytes.set(new Uint8Array(data),position),position+=data.byteLength,(this.progressiveDataLength=position)>=this.end?this.numChunks:Math.floor(position/this.chunkSize)),curChunk=beginChunk;curChunk<endChunk;++curChunk)this._loadedChunks.add(curChunk)}ensureByte(pos){if(!(pos<this.progressiveDataLength)){var chunk=Math.floor(pos/this.chunkSize);if(!(chunk>this.numChunks)&&chunk!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(chunk))throw new MissingDataException(pos,pos+1);this.lastSuccessfulEnsureByteChunk=chunk}}}ensureRange(begin,end){if(!(end<=begin||end<=this.progressiveDataLength)){var beginChunk=Math.floor(begin/this.chunkSize);if(!(beginChunk>this.numChunks))for(var endChunk=Math.min(Math.floor((end-1)/this.chunkSize)+1,this.numChunks),chunk=beginChunk;chunk<endChunk;++chunk)if(!this._loadedChunks.has(chunk))throw new MissingDataException(begin,end)}}nextEmptyChunk(beginChunk){for(var numChunks=this.numChunks,i=0;i<numChunks;++i){var chunk=(beginChunk+i)%numChunks;if(!this._loadedChunks.has(chunk))return chunk}return null}hasChunk(chunk){return this._loadedChunks.has(chunk)}getByte(){var pos=this.pos;return pos>=this.end?-1:(pos>=this.progressiveDataLength&&this.ensureByte(pos),this.bytes[this.pos++])}getBytes(length){var bytes=this.bytes,pos=this.pos,strEnd=this.end;return length?((length=strEnd<(length=pos+length)?strEnd:length)>this.progressiveDataLength&&this.ensureRange(pos,length),this.pos=length,bytes.subarray(pos,length)):(strEnd>this.progressiveDataLength&&this.ensureRange(pos,strEnd),bytes.subarray(pos,strEnd))}getByteRange(begin,end){return begin<0&&(begin=0),(end=end>this.end?this.end:end)>this.progressiveDataLength&&this.ensureRange(begin,end),this.bytes.subarray(begin,end)}makeSubStream(start,length){var dict=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;function ChunkedStreamSubstream(){}length?start+length>this.progressiveDataLength&&this.ensureRange(start,start+length):start>=this.progressiveDataLength&&this.ensureByte(start),(ChunkedStreamSubstream.prototype=Object.create(this)).getMissingChunks=function(){for(var chunkSize=this.chunkSize,beginChunk=Math.floor(this.start/chunkSize),endChunk=Math.floor((this.end-1)/chunkSize)+1,missingChunks=[],chunk=beginChunk;chunk<endChunk;++chunk)this._loadedChunks.has(chunk)||missingChunks.push(chunk);return missingChunks},Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});var subStream=new ChunkedStreamSubstream;return subStream.pos=subStream.start=start,subStream.end=start+length||this.end,subStream.dict=dict,subStream}getBaseStreams(){return[this]}}class ChunkedStreamManager{constructor(pdfNetworkStream,args){this.length=args.length,this.chunkSize=args.rangeChunkSize,this.stream=new ChunkedStream(this.length,this.chunkSize,this),this.pdfNetworkStream=pdfNetworkStream,this.disableAutoFetch=args.disableAutoFetch,this.msgHandler=args.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(begin,end){var rangeReader=this.pdfNetworkStream.getRangeReader(begin,end),chunks=(rangeReader.isStreamingSupported||(rangeReader.onProgress=this.onProgress.bind(this)),[]),loaded=0;return new Promise((resolve,reject)=>{var readChunk=_ref5=>{var chunkData,{value:_ref5,done}=_ref5;try{done?(chunkData=arrayBuffersToBytes(chunks),chunks=null,resolve(chunkData)):(loaded+=_ref5.byteLength,rangeReader.isStreamingSupported&&this.onProgress({loaded:loaded}),chunks.push(_ref5),rangeReader.read().then(readChunk,reject))}catch(e){reject(e)}};rangeReader.read().then(readChunk,reject)}).then(data=>{this.aborted||this.onReceiveData({chunk:data,begin:begin})})}requestAllChunks(){var missingChunks;return 0<arguments.length&&void 0!==arguments[0]&&arguments[0]||(missingChunks=this.stream.getMissingChunks(),this._requestChunks(missingChunks)),this._loadedStreamCapability.promise}_requestChunks(chunks){var chunk,requestId=this.currRequestId++,chunksNeeded=new Set;this._chunksNeededByRequest.set(requestId,chunksNeeded);for(chunk of chunks)this.stream.hasChunk(chunk)||chunksNeeded.add(chunk);if(0===chunksNeeded.size)return Promise.resolve();var _chunk,groupedChunk,capability=Promise.withResolvers(),chunksToRequest=(this._promisesByRequest.set(requestId,capability),[]);for(_chunk of chunksNeeded){var requestIds=this._requestsByChunk.get(_chunk);requestIds||(this._requestsByChunk.set(_chunk,requestIds=[]),chunksToRequest.push(_chunk)),requestIds.push(requestId)}if(0<chunksToRequest.length)for(groupedChunk of this.groupChunks(chunksToRequest)){var begin=groupedChunk.beginChunk*this.chunkSize,end=Math.min(groupedChunk.endChunk*this.chunkSize,this.length);this.sendRequest(begin,end).catch(capability.reject)}return capability.promise.catch(reason=>{if(!this.aborted)throw reason})}getStream(){return this.stream}requestRange(begin,end){end=Math.min(end,this.length);for(var begin=this.getBeginChunk(begin),endChunk=this.getEndChunk(end),chunks=[],chunk=begin;chunk<endChunk;++chunk)chunks.push(chunk);return this._requestChunks(chunks)}requestRanges(){var range,chunksToRequest=[];for(range of 0<arguments.length&&void 0!==arguments[0]?arguments[0]:[])for(var beginChunk=this.getBeginChunk(range.begin),endChunk=this.getEndChunk(range.end),chunk=beginChunk;chunk<endChunk;++chunk)chunksToRequest.includes(chunk)||chunksToRequest.push(chunk);return chunksToRequest.sort((a,b)=>a-b),this._requestChunks(chunksToRequest)}groupChunks(chunks){for(var groupedChunks=[],beginChunk=-1,prevChunk=-1,i=0,ii=chunks.length;i<ii;++i){var chunk=chunks[i];beginChunk<0&&(beginChunk=chunk),0<=prevChunk&&prevChunk+1!==chunk&&(groupedChunks.push({beginChunk:beginChunk,endChunk:prevChunk+1}),beginChunk=chunk),i+1===chunks.length&&groupedChunks.push({beginChunk:beginChunk,endChunk:chunk+1}),prevChunk=chunk}return groupedChunks}onProgress(args){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+args.loaded,total:this.length})}onReceiveData(args){for(var nextEmptyChunk,_requestId,chunk=args.chunk,isProgressive=void 0===args.begin,args=isProgressive?this.progressiveDataLength:args.begin,end=args+chunk.byteLength,beginChunk=Math.floor(args/this.chunkSize),endChunk=end<this.length?Math.floor(end/this.chunkSize):Math.ceil(end/this.chunkSize),loadedRequests=(isProgressive?(this.stream.onReceiveProgressiveData(chunk),this.progressiveDataLength=end):this.stream.onReceiveData(args,chunk),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream),[]),curChunk=beginChunk;curChunk<endChunk;++curChunk){var requestIds=this._requestsByChunk.get(curChunk);if(requestIds){this._requestsByChunk.delete(curChunk);for(var requestId of requestIds){var chunksNeeded=this._chunksNeededByRequest.get(requestId);chunksNeeded.has(curChunk)&&chunksNeeded.delete(curChunk),0<chunksNeeded.size||loadedRequests.push(requestId)}}}this.disableAutoFetch||0!==this._requestsByChunk.size||(1===this.stream.numChunksLoaded?(isProgressive=this.stream.numChunks-1,this.stream.hasChunk(isProgressive)||(nextEmptyChunk=isProgressive)):nextEmptyChunk=this.stream.nextEmptyChunk(endChunk),Number.isInteger(nextEmptyChunk)&&this._requestChunks([nextEmptyChunk]));for(_requestId of loadedRequests){var capability=this._promisesByRequest.get(_requestId);this._promisesByRequest.delete(_requestId),capability.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(err){this._loadedStreamCapability.reject(err)}getBeginChunk(begin){return Math.floor(begin/this.chunkSize)}getEndChunk(end){return Math.floor((end-1)/this.chunkSize)+1}abort(reason){var _this$pdfNetworkStrea,capability;this.aborted=!0,null!=(_this$pdfNetworkStrea=this.pdfNetworkStream)&&_this$pdfNetworkStrea.cancelAllRequests(reason);for(capability of this._promisesByRequest.values())capability.reject(reason)}}function convertToRGBA(params){switch(params.kind){case ImageKind.GRAYSCALE_1BPP:return convertBlackAndWhiteToRGBA(params);case ImageKind.RGB_24BPP:return convertRGBToRGBA(params)}return null}function convertBlackAndWhiteToRGBA(_ref6){for(var{src,srcPos=0,dest,width:_ref6,height,nonBlackColor=4294967295,inverseDecode=!1}=_ref6,black=FeatureTest.isLittleEndian?4278190080:255,[zeroMapping,oneMapping]=inverseDecode?[nonBlackColor,black]:[black,nonBlackColor],widthInSource=_ref6>>3,widthRemainder=7&_ref6,srcLength=src.length,dest=new Uint32Array(dest.buffer),destPos=0,i=0;i<height;i++){for(var max=srcPos+widthInSource;srcPos<max;srcPos++){var _elem=srcPos<srcLength?src[srcPos]:255;dest[destPos++]=128&_elem?oneMapping:zeroMapping,dest[destPos++]=64&_elem?oneMapping:zeroMapping,dest[destPos++]=32&_elem?oneMapping:zeroMapping,dest[destPos++]=16&_elem?oneMapping:zeroMapping,dest[destPos++]=8&_elem?oneMapping:zeroMapping,dest[destPos++]=4&_elem?oneMapping:zeroMapping,dest[destPos++]=2&_elem?oneMapping:zeroMapping,dest[destPos++]=1&_elem?oneMapping:zeroMapping}if(0!=widthRemainder)for(var elem=srcPos<srcLength?src[srcPos++]:255,j=0;j<widthRemainder;j++)dest[destPos++]=elem&1<<7-j?oneMapping:zeroMapping}return{srcPos:srcPos,destPos:destPos}}function convertRGBToRGBA(_ref7){var{src,srcPos:_ref7=0,dest,destPos=0,width,height}=_ref7,i=0,width=width*height*3,len32=width>>2,src32=new Uint32Array(src.buffer,_ref7,len32);if(FeatureTest.isLittleEndian){for(;i<len32-2;i+=3,destPos+=4){var s1=src32[i],s2=src32[i+1],s3=src32[i+2];dest[destPos]=4278190080|s1,dest[destPos+1]=s1>>>24|s2<<8|4278190080,dest[destPos+2]=s2>>>16|s3<<16|4278190080,dest[destPos+3]=s3>>>8|4278190080}for(var j=4*i,jj=_ref7+width;j<jj;j+=3)dest[destPos++]=src[j]|src[j+1]<<8|src[j+2]<<16|4278190080}else{for(;i<len32-2;i+=3,destPos+=4){var _s=src32[i],_s2=src32[i+1],_s3=src32[i+2];dest[destPos]=255|_s,dest[destPos+1]=_s<<24|_s2>>>8|255,dest[destPos+2]=_s2<<16|_s3>>>16|255,dest[destPos+3]=_s3<<8|255}for(var _j3=4*i,_jj=_ref7+width;_j3<_jj;_j3+=3)dest[destPos++]=src[_j3]<<24|src[_j3+1]<<16|src[_j3+2]<<8|255}return{srcPos:_ref7+width,destPos:destPos}}function grayToRGBA(src,dest){if(FeatureTest.isLittleEndian)for(var i=0,ii=src.length;i<ii;i++)dest[i]=65793*src[i]|4278190080;else for(var _i1=0,_ii3=src.length;_i1<_ii3;_i1++)dest[_i1]=16843008*src[_i1]|255}var MIN_IMAGE_DIM=2048,MAX_IMAGE_DIM=65537,MAX_ERROR=128,_ImageResizer_brand=new WeakSet;class ImageResizer{constructor(_imgData,isMask){_classPrivateMethodInitSpec(this,_ImageResizer_brand),this._imgData=_imgData,this._isMask=isMask}static get canUseImageDecoder(){return shadow(this,"canUseImageDecoder",_assertClassBrand(ImageResizer,this,_isImageDecoderSupported)._?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(width,height){var MAX_DIM,area;return!(width<=_assertClassBrand(ImageResizer,this,_goodSquareLength)._&&height<=_assertClassBrand(ImageResizer,this,_goodSquareLength)._)&&(MAX_DIM=this["MAX_DIM"],MAX_DIM<width||MAX_DIM<height||(area=width*height,this._hasMaxArea?area>this.MAX_AREA:!(area<_assertClassBrand(ImageResizer,this,_goodSquareLength)._**2)&&(this._areGoodDims(width,height)?(_goodSquareLength._=_assertClassBrand(ImageResizer,this,Math.max(_assertClassBrand(ImageResizer,this,_goodSquareLength)._,Math.floor(Math.sqrt(width*height)))),!1):(_goodSquareLength._=_assertClassBrand(ImageResizer,this,this._guessMax(_assertClassBrand(ImageResizer,this,_goodSquareLength)._,MAX_DIM,MAX_ERROR,0)),(this.MAX_AREA=_assertClassBrand(ImageResizer,this,_goodSquareLength)._**2)<area))))}static getReducePowerForJPX(width,height,componentsCount){var MAX_DIM,MAX_AREA,area=width*height,componentsCount=2**30/(4*componentsCount);return this.needsToBeResized(width,height)?({MAX_DIM,MAX_AREA}=this,width=Math.max(width/MAX_DIM,height/MAX_DIM,Math.sqrt(area/Math.min(componentsCount,MAX_AREA))),Math.ceil(Math.log2(width))):componentsCount<area?Math.ceil(Math.log2(area/componentsCount)):0}static get MAX_DIM(){return shadow(this,"MAX_DIM",this._guessMax(MIN_IMAGE_DIM,MAX_IMAGE_DIM,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,shadow(this,"MAX_AREA",this._guessMax(_assertClassBrand(ImageResizer,this,_goodSquareLength)._,this.MAX_DIM,MAX_ERROR,0)**2)}static set MAX_AREA(area){0<=area&&(this._hasMaxArea=!0,shadow(this,"MAX_AREA",area))}static setOptions(_ref8){var{canvasMaxAreaInBytes:_ref8=-1,isImageDecoderSupported=!1}=_ref8;this._hasMaxArea||(this.MAX_AREA=_ref8>>2),_isImageDecoderSupported._=_assertClassBrand(ImageResizer,this,isImageDecoderSupported)}static _areGoodDims(width,height){try{var canvas=new OffscreenCanvas(width,height),ctx=canvas.getContext("2d"),opacity=(ctx.fillRect(0,0,1,1),ctx.getImageData(0,0,1,1).data[3]);return canvas.width=canvas.height=1,0!==opacity}catch(_unused3){return!1}}static _guessMax(start,end,tolerance,defaultHeight){for(;start+tolerance+1<end;){var middle=Math.floor((start+end)/2);this._areGoodDims(middle,defaultHeight||middle)?start=middle:end=middle}return start}static async createImage(imgData){var isMask=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return new ImageResizer(imgData,isMask)._createImage()}async _createImage(){var imgData=this["_imgData"],{width,height}=imgData;if(MAX_INT_32<width*height*4){var _result=_assertClassBrand(_ImageResizer_brand,this,_rescaleImageData).call(this);if(_result)return _result}var decoder,step,_result=this._encodeBMP(),_result=await ImageResizer.canUseImageDecoder?(decoder=new ImageDecoder({data:_result,type:"image/bmp",preferAnimation:!1,transfer:[_result.buffer]})).decode().catch(reason=>(warn("BMP image decoding failed: ".concat(reason)),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"})))).finally(()=>{decoder.close()}):createImageBitmap(new Blob([_result.buffer],{type:"image/bmp"})),{MAX_AREA,MAX_DIM}=ImageResizer,MAX_DIM=Math.max(width/MAX_DIM,height/MAX_DIM,Math.sqrt(width*height/MAX_AREA)),MAX_AREA=Math.max(MAX_DIM,2),MAX_DIM=Math.round(10*(MAX_DIM+1.25))/10/MAX_AREA,N=Math.floor(Math.log2(MAX_DIM)),steps=new Array(N+2).fill(2),newWidth=(steps[0]=MAX_AREA,steps.splice(-1,1,MAX_DIM/(1<<N)),width),newHeight=height,MAX_AREA=await _result,bitmap=MAX_AREA.image||MAX_AREA;for(step of steps){var prevWidth=newWidth,prevHeight=newHeight,newWidth=Math.floor(newWidth/step)-1,newHeight=Math.floor(newHeight/step)-1,canvas=new OffscreenCanvas(newWidth,newHeight);canvas.getContext("2d").drawImage(bitmap,0,0,prevWidth,prevHeight,0,0,newWidth,newHeight),bitmap.close(),bitmap=canvas.transferToImageBitmap()}return imgData.data=null,imgData.bitmap=bitmap,imgData.width=newWidth,imgData.height=newHeight,imgData}_encodeBMP(){var{width,height,kind}=this._imgData,data=this._imgData.data,maskTable=colorTable=new Uint8Array(0),compression=0;switch(kind){case ImageKind.GRAYSCALE_1BPP:var bitPerPixel=1,colorTable=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]),rowLen=width+7>>3,rowSize=3+rowLen&-4;if(rowLen!=rowSize){for(var newData=new Uint8Array(rowSize*height),k=0,_i10=0,ii=height*rowLen;_i10<ii;_i10+=rowLen,k+=rowSize)newData.set(data.subarray(_i10,_i10+rowLen),k);data=newData}break;case ImageKind.RGB_24BPP:if(bitPerPixel=24,3&width){for(var _rowLen=3*width,_rowSize=3+_rowLen&-4,extraLen=_rowSize-_rowLen,_newData=new Uint8Array(_rowSize*height),_k=0,_i11=0,_ii4=height*_rowLen;_i11<_ii4;_i11+=_rowLen){for(var row=data.subarray(_i11,_i11+_rowLen),j=0;j<_rowLen;j+=3)_newData[_k++]=row[j+2],_newData[_k++]=row[j+1],_newData[_k++]=row[j];_k+=extraLen}data=_newData}else for(var _i12=0,_ii5=data.length;_i12<_ii5;_i12+=3){var tmp=data[_i12];data[_i12]=data[_i12+2],data[_i12+2]=tmp}break;case ImageKind.RGBA_32BPP:bitPerPixel=32;compression=3,maskTable=new Uint8Array(68),_rowSize=new DataView(maskTable.buffer);FeatureTest.isLittleEndian?(_rowSize.setUint32(0,255,!0),_rowSize.setUint32(4,65280,!0),_rowSize.setUint32(8,16711680,!0),_rowSize.setUint32(12,4278190080,!0)):(_rowSize.setUint32(0,4278190080,!0),_rowSize.setUint32(4,16711680,!0),_rowSize.setUint32(8,65280,!0),_rowSize.setUint32(12,255,!0));break;default:throw new Error("invalid format")}var kind=0,headerLength=40+maskTable.length,fileLength=14+headerLength+colorTable.length+data.length,bmpData=new Uint8Array(fileLength),view=new DataView(bmpData.buffer);return view.setUint16(0,19778,!0),kind+=2,view.setUint32(2,fileLength,!0),kind+=4,view.setUint32(6,0,!0),kind+=4,view.setUint32(10,14+headerLength+colorTable.length,!0),kind+=4,view.setUint32(14,headerLength,!0),kind+=4,view.setInt32(18,width,!0),kind+=4,view.setInt32(22,-height,!0),kind+=4,view.setUint16(26,1,!0),kind+=2,view.setUint16(28,bitPerPixel,!0),kind+=2,view.setUint32(30,compression,!0),kind+=4,view.setUint32(34,0,!0),kind+=4,view.setInt32(38,0,!0),kind+=4,view.setInt32(42,0,!0),kind+=4,view.setUint32(46,colorTable.length/4,!0),kind+=4,view.setUint32(50,0,!0),kind+=4,bmpData.set(maskTable,54),kind+=maskTable.length,bmpData.set(colorTable,kind),kind+=colorTable.length,bmpData.set(data,kind),bmpData}}function _rescaleImageData(){var rgbaData,imgData=this["_imgData"],{data,width,height,kind}=imgData,rgbaSize=width*height*4,K=Math.ceil(Math.log2(rgbaSize/MAX_INT_32)),newWidth=width>>K,newHeight=height>>K,maxHeight=height;try{rgbaData=new Uint8Array(rgbaSize)}catch(_unused16){for(var n=Math.floor(Math.log2(1+rgbaSize));;)try{rgbaData=new Uint8Array(2**n-1);break}catch(_unused17){--n}rgbaSize=width*(maxHeight=Math.floor((2**n-1)/(4*width)))*4;rgbaSize<rgbaData.length&&(rgbaData=new Uint8Array(rgbaSize))}for(var src32=new Uint32Array(rgbaData.buffer),dest32=new Uint32Array(newWidth*newHeight),srcPos=0,newIndex=0,step=Math.ceil(height/maxHeight),remainder=height%maxHeight==0?height:height%maxHeight,k=0;k<step;k++){var h=k<step-1?maxHeight:remainder;srcPos=convertToRGBA({kind:kind,src:data,dest:src32,width:width,height:h,inverseDecode:this._isMask,srcPos:srcPos})["srcPos"];for(var i=0,ii=h>>K;i<ii;i++)for(var buf=src32.subarray((i<<K)*width),j=0;j<newWidth;j++)dest32[newIndex++]=buf[j<<K]}return _ImageResizer.needsToBeResized(newWidth,newHeight)?(imgData.data=dest32,imgData.width=newWidth,imgData.height=newHeight,imgData.kind=ImageKind.RGBA_32BPP,null):((rgbaSize=new OffscreenCanvas(newWidth,newHeight)).getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(dest32.buffer),newWidth,newHeight),0,0),imgData.data=null,imgData.bitmap=rgbaSize.transferToImageBitmap(),imgData.width=newWidth,imgData.height=newHeight,imgData)}var _ImageResizer=ImageResizer,_goodSquareLength={_:MIN_IMAGE_DIM},_isImageDecoderSupported={_:FeatureTest.isImageDecoderSupported},emptyBuffer=new Uint8Array(0);class DecodeStream extends BaseStream{constructor(maybeMinBufferLength){if(super(),this._rawMinBufferLength=maybeMinBufferLength||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=emptyBuffer,this.minBufferLength=512,maybeMinBufferLength)for(;this.minBufferLength<maybeMinBufferLength;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(requested){var buffer=this.buffer;if(requested<=buffer.byteLength)return buffer;for(var size=this.minBufferLength;size<requested;)size*=2;var buffer2=new Uint8Array(size);return buffer2.set(buffer),this.buffer=buffer2}getByte(){for(var pos=this.pos;this.bufferLength<=pos;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(length){var end,decoderOptions=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,pos=this.pos;if(length){for(this.ensureBuffer(pos+length),end=pos+length;!this.eof&&this.bufferLength<end;)this.readBlock(decoderOptions);length=this.bufferLength;length<end&&(end=length)}else{for(;!this.eof;)this.readBlock(decoderOptions);end=this.bufferLength}return this.pos=end,this.buffer.subarray(pos,end)}async getImageData(length,decoderOptions){var data;return this.canAsyncDecodeImageFromBuffer?(data=await this.stream.asyncGetBytes(),this.decodeImage(data,decoderOptions)):this.isAsyncDecoder?this.decodeImage(null,decoderOptions):this.getBytes(length,decoderOptions)}reset(){this.pos=0}makeSubStream(start,length){var dict=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(void 0===length)for(;!this.eof;)this.readBlock();else for(var end=start+length;this.bufferLength<=end&&!this.eof;)this.readBlock();return new Stream(this.buffer,start,length,dict)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}class StreamsSequenceStream extends DecodeStream{constructor(streams){var stream,onError=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,maybeLength=0;for(stream of streams=streams.filter(s=>s instanceof BaseStream))maybeLength+=stream instanceof DecodeStream?stream._rawMinBufferLength:stream.length;super(maybeLength),this.streams=streams,this._onError=onError}readBlock(){var streams=this.streams;if(0===streams.length)this.eof=!0;else{var chunk,streams=streams.shift();try{chunk=streams.getBytes()}catch(reason){if(this._onError)return void this._onError(reason,null==(streams=streams.dict)?void 0:streams.objId);throw reason}var streams=this.bufferLength,newLength=streams+chunk.length;this.ensureBuffer(newLength).set(chunk,streams),this.bufferLength=newLength}}getBaseStreams(){var stream,baseStreamsBuf=[];for(stream of this.streams){var baseStreams=stream.getBaseStreams();baseStreams&&baseStreamsBuf.push(...baseStreams)}return 0<baseStreamsBuf.length?baseStreamsBuf:null}}class ColorSpaceUtils{static parse(_ref9){var parsedCS,{cs:_ref9,xref,resources=null,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache,asyncIfNotCached=!1}=_ref9,resources={xref:xref,resources:resources,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache};if(_ref9 instanceof Ref){var csRef=_ref9,pdfFunctionFactory=globalColorSpaceCache.getByRef(csRef)||localColorSpaceCache.getByRef(csRef);if(pdfFunctionFactory)return pdfFunctionFactory;_ref9=xref.fetch(_ref9)}if(_ref9 instanceof Name){var csName=_ref9.name,pdfFunctionFactory=localColorSpaceCache.getByName(csName);if(pdfFunctionFactory)return pdfFunctionFactory}try{parsedCS=_assertClassBrand(ColorSpaceUtils,this,_parse).call(this,_ref9,resources)}catch(ex){if(!asyncIfNotCached||ex instanceof MissingDataException)throw ex;return Promise.reject(ex)}return(csName||csRef)&&(localColorSpaceCache.set(csName,csRef,parsedCS),csRef)&&globalColorSpaceCache.set(null,csRef,parsedCS),asyncIfNotCached?Promise.resolve(parsedCS):parsedCS}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(_unused4){warn("CMYK fallback: DeviceCMYK")}return shadow(this,"cmyk",new DeviceCmykCS)}}function _subParse(cs,options){var globalColorSpaceCache=options["globalColorSpaceCache"];if(cs instanceof Ref){var csRef=cs,cachedCS=globalColorSpaceCache.getByRef(csRef);if(cachedCS)return cachedCS}cachedCS=_assertClassBrand(_ColorSpaceUtils,this,_parse).call(this,cs,options);return csRef&&globalColorSpaceCache.set(null,csRef,cachedCS),cachedCS}function _parse(cs,options){var{xref,resources,pdfFunctionFactory,globalColorSpaceCache}=options;if((cs=xref.fetchIfRef(cs))instanceof Name)switch(cs.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(resources instanceof Dict){var colorSpaces=resources.get("ColorSpace");if(colorSpaces instanceof Dict){colorSpaces=colorSpaces.get(cs.name);if(colorSpaces){if(colorSpaces instanceof Name)return _assertClassBrand(_ColorSpaceUtils,this,_parse).call(this,colorSpaces,options);cs=colorSpaces;break}}}return warn("Unrecognized ColorSpace: ".concat(cs.name)),this.gray}if(Array.isArray(cs)){var mode=xref.fetchIfRef(cs[0]).name;switch(mode){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":return whitePoint=(params=xref.fetchIfRef(cs[1])).getArray("WhitePoint"),blackPoint=params.getArray("BlackPoint"),gamma=params.get("Gamma"),new CalGrayCS(whitePoint,blackPoint,gamma);case"CalRGB":var params,whitePoint=(params=xref.fetchIfRef(cs[1])).getArray("WhitePoint"),blackPoint=params.getArray("BlackPoint"),gamma=params.getArray("Gamma"),matrix=params.getArray("Matrix");return new CalRGBCS(whitePoint,blackPoint,gamma,matrix);case"ICCBased":gamma=cs[1]instanceof Ref;if(gamma){matrix=globalColorSpaceCache.getByRef(cs[1]);if(matrix)return matrix}var matrix=xref.fetchIfRef(cs[1]),dict=matrix.dict,numComps=dict.get("N");if(IccColorSpace.isUsable)try{var iccCS=new IccColorSpace(matrix.getBytes(),"ICCBased",numComps);return gamma&&globalColorSpaceCache.set(null,cs[1],iccCS),iccCS}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("ICCBased color space (".concat(cs[1],'): "').concat(ex,'".'))}matrix=dict.getRaw("Alternate");if(matrix){gamma=_assertClassBrand(_ColorSpaceUtils,this,_subParse).call(this,matrix,options);if(gamma.numComps===numComps)return gamma;warn("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===numComps)return this.gray;if(3===numComps)return this.rgb;if(4===numComps)return this.cmyk;break;case"Pattern":return baseCS=(baseCS=cs[1]||null)&&_assertClassBrand(_ColorSpaceUtils,this,_subParse).call(this,baseCS,options),new PatternCS(baseCS);case"I":case"Indexed":var baseCS=_assertClassBrand(_ColorSpaceUtils,this,_subParse).call(this,cs[1],options),iccCS=MathClamp(xref.fetchIfRef(cs[2]),0,255),dict=xref.fetchIfRef(cs[3]);return new IndexedCS(baseCS,iccCS,dict);case"Separation":case"DeviceN":matrix=xref.fetchIfRef(cs[1]),gamma=(numComps=Array.isArray(matrix)?matrix.length:1,baseCS=_assertClassBrand(_ColorSpaceUtils,this,_subParse).call(this,cs[2],options),pdfFunctionFactory.create(cs[3]));return new AlternateCS(numComps,baseCS,gamma);case"Lab":whitePoint=(params=xref.fetchIfRef(cs[1])).getArray("WhitePoint"),blackPoint=params.getArray("BlackPoint");iccCS=params.getArray("Range");return new LabCS(whitePoint,blackPoint,iccCS);default:return warn("Unimplemented ColorSpace object: ".concat(mode)),this.gray}}return warn("Unrecognized ColorSpace object: ".concat(cs)),this.gray}_ColorSpaceUtils=ColorSpaceUtils;class JpegError extends BaseException{constructor(msg){super(msg,"JpegError")}}class DNLMarkerError extends BaseException{constructor(message,scanLines){super(message,"DNLMarkerError"),this.scanLines=scanLines}}class EOIMarkerError extends BaseException{constructor(msg){super(msg,"EOIMarkerError")}}var dctZigZag=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]),dctCos1=4017,dctSin1=799,dctCos3=3406,dctSin3=2276,dctCos6=1567,dctSin6=3784,dctSqrt2=5793,dctSqrt1d2=2896;function buildHuffmanTable(codeLengths,values){for(var j,k=0,length=16;0<length&&!codeLengths[length-1];)length--;for(var q,code=[{children:[],index:0}],p=code[0],i=0;i<length;i++){for(j=0;j<codeLengths[i];j++){for((p=code.pop()).children[p.index]=values[k];0<p.index;)p=code.pop();for(p.index++,code.push(p);code.length<=i;)code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q;k++}i+1<length&&(code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q)}return code[0].children}function getBlockBufferOffset(component,row,col){return 64*((component.blocksPerLine+1)*row+col)}function decodeScan(data,offset,frame,components,resetInterval,spectralStart,spectralEnd,successivePrev,successive){var parseDNLMarker=9<arguments.length&&void 0!==arguments[9]&&arguments[9],mcusPerLine=frame.mcusPerLine,progressive=frame.progressive,startOffset=offset,bitsData=0,bitsCount=0;function readBit(){if(0<bitsCount)return bitsData>>--bitsCount&1;if(255===(bitsData=data[offset++])){var nextByte=data[offset++];if(nextByte){if(220===nextByte&&parseDNLMarker){var scanLines=readUint16(data,offset+=2);if(offset+=2,0<scanLines&&scanLines!==frame.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",scanLines)}else if(217===nextByte){if(parseDNLMarker){scanLines=blockRow*(8===frame.precision?8:0);if(0<scanLines&&5<=Math.round(frame.scanLines/scanLines))throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",scanLines)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError("unexpected marker ".concat((bitsData<<8|nextByte).toString(16)))}}return bitsData>>>(bitsCount=7)}function decodeHuffman(tree){for(var node=tree;;){switch(typeof(node=node[readBit()])){case"number":return node;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(length){for(var n=0;0<length;)n=n<<1|readBit(),length--;return n}function receiveAndExtend(length){var n;return 1===length?1===readBit()?1:-1:1<<length-1<=(n=receive(length))?n:n+(-1<<length)+1}var eobrun=0;var successiveACNextValue,successiveACState=0;var blockRow=0;for(var component,i,j,k,n,fileMarker,h,v,componentsLength=components.length,decodeFn=progressive?0===spectralStart?0===successivePrev?function(component,blockOffset){var t=0===(t=decodeHuffman(component.huffmanTableDC))?0:receiveAndExtend(t)<<successive;component.blockData[blockOffset]=component.pred+=t}:function(component,blockOffset){component.blockData[blockOffset]|=readBit()<<successive}:0===successivePrev?function(component,blockOffset){if(0<eobrun)eobrun--;else for(var k=spectralStart,e=spectralEnd;k<=e;){var rs=decodeHuffman(component.huffmanTableAC),s=15&rs,rs=rs>>4;if(0==s){if(rs<15){eobrun=receive(rs)+(1<<rs)-1;break}k+=16}else{rs=dctZigZag[k+=rs];component.blockData[blockOffset+rs]=receiveAndExtend(s)*(1<<successive),k++}}}:function(component,blockOffset){for(var rs,k=spectralStart,e=spectralEnd,r=0;k<=e;){var offsetZ=blockOffset+dctZigZag[k],sign=component.blockData[offsetZ]<0?-1:1;switch(successiveACState){case 0:if(r=(rs=decodeHuffman(component.huffmanTableAC))>>4,0==(rs=15&rs))successiveACState=r<15?(eobrun=receive(r)+(1<<r),4):(r=16,1);else{if(1!=rs)throw new JpegError("invalid ACn encoding");successiveACNextValue=receiveAndExtend(rs),successiveACState=r?2:3}continue;case 1:case 2:component.blockData[offsetZ]?component.blockData[offsetZ]+=sign*(readBit()<<successive):0===--r&&(successiveACState=2===successiveACState?3:0);break;case 3:component.blockData[offsetZ]?component.blockData[offsetZ]+=sign*(readBit()<<successive):(component.blockData[offsetZ]=successiveACNextValue<<successive,successiveACState=0);break;case 4:component.blockData[offsetZ]&&(component.blockData[offsetZ]+=sign*(readBit()<<successive))}k++}4===successiveACState&&0===--eobrun&&(successiveACState=0)}:function(component,blockOffset){for(var t=0===(t=decodeHuffman(component.huffmanTableDC))?0:receiveAndExtend(t),k=(component.blockData[blockOffset]=component.pred+=t,1);k<64;){var rs=decodeHuffman(component.huffmanTableAC),s=15&rs,rs=rs>>4;if(0==s){if(rs<15)break;k+=16}else{rs=dctZigZag[k+=rs];component.blockData[blockOffset+rs]=receiveAndExtend(s),k++}}},mcu=0,mcuExpected=1===componentsLength?components[0].blocksPerLine*components[0].blocksPerColumn:mcusPerLine*frame.mcusPerColumn;mcu<=mcuExpected;){var mcuToRead=resetInterval?Math.min(mcuExpected-mcu,resetInterval):mcuExpected;if(0<mcuToRead){for(i=0;i<componentsLength;i++)components[i].pred=0;if(eobrun=0,1===componentsLength)for(component=components[0],n=0;n<mcuToRead;n++)!function(component,decode,mcu){blockRow=mcu/component.blocksPerLine|0,mcu%=component.blocksPerLine,decode(component,getBlockBufferOffset(component,blockRow,mcu))}(component,decodeFn,mcu),mcu++;else for(n=0;n<mcuToRead;n++){for(i=0;i<componentsLength;i++)for(h=(component=components[i]).h,v=component.v,j=0;j<v;j++)for(k=0;k<h;k++)!function(component,decode,mcu,row,col){blockRow=(mcu/mcusPerLine|0)*component.v+row,row=mcu%mcusPerLine*component.h+col,decode(component,getBlockBufferOffset(component,blockRow,row))}(component,decodeFn,mcu,j,k);mcu++}}if(bitsCount=0,!(fileMarker=findNextFileMarker(data,offset)))break;if(fileMarker.invalid&&(warn("decodeScan - ".concat(0<mcuToRead?"unexpected":"excessive"," MCU data, current marker is: ").concat(fileMarker.invalid)),offset=fileMarker.offset),!(65488<=fileMarker.marker&&fileMarker.marker<=65495))break;offset+=2}return offset-startOffset}function quantizeAndInverse(component,blockBufferOffset,p){var v0,v1,v2,v3,v4,v5,v6,v7,p0,p1,p2,p3,p4,p5,p6,p7,t,qt=component.quantizationTable,blockData=component.blockData;if(!qt)throw new JpegError("missing required Quantization Table.");for(var row=0;row<64;row+=8)p0=blockData[blockBufferOffset+row],p1=blockData[blockBufferOffset+row+1],p2=blockData[blockBufferOffset+row+2],p3=blockData[blockBufferOffset+row+3],p4=blockData[blockBufferOffset+row+4],p5=blockData[blockBufferOffset+row+5],p6=blockData[blockBufferOffset+row+6],p7=blockData[blockBufferOffset+row+7],p0*=qt[row],0==(p1|p2|p3|p4|p5|p6|p7)?(p[row]=t=dctSqrt2*p0+512>>10,p[row+1]=t,p[row+2]=t,p[row+3]=t,p[row+4]=t,p[row+5]=t,p[row+6]=t,p[row+7]=t):(p1*=qt[row+1],p2*=qt[row+2],p3*=qt[row+3],p4*=qt[row+4],p5*=qt[row+5],p6*=qt[row+6],p7*=qt[row+7],v1=(v0=(v0=dctSqrt2*p0+128>>8)+(v1=dctSqrt2*p4+128>>8)+1>>1)-v1,t=(v2=p2)*dctSin6+(v3=p6)*dctCos6+128>>8,v2=v2*dctCos6-v3*dctSin6+128>>8,v6=(v4=(v4=dctSqrt1d2*(p1-p7)+128>>8)+(v6=p5<<4)+1>>1)-v6,v5=(v7=(v7=dctSqrt1d2*(p1+p7)+128>>8)+(v5=p3<<4)+1>>1)-v5,v3=(v0=v0+(v3=t)+1>>1)-v3,v2=(v1=v1+v2+1>>1)-v2,t=v4*dctSin3+v7*dctCos3+2048>>12,v4=v4*dctCos3-v7*dctSin3+2048>>12,v7=t,t=v5*dctSin1+v6*dctCos1+2048>>12,v5=v5*dctCos1-v6*dctSin1+2048>>12,v6=t,p[row]=v0+v7,p[row+7]=v0-v7,p[row+1]=v1+v6,p[row+6]=v1-v6,p[row+2]=v2+v5,p[row+5]=v2-v5,p[row+3]=v3+v4,p[row+4]=v3-v4);for(var col=0;col<8;++col)p0=p[col],0==((p1=p[col+8])|(p2=p[col+16])|(p3=p[col+24])|(p4=p[col+32])|(p5=p[col+40])|(p6=p[col+48])|(p7=p[col+56]))?(blockData[blockBufferOffset+col]=t=(t=dctSqrt2*p0+8192>>14)<-2040?0:2024<=t?255:t+2056>>4,blockData[blockBufferOffset+col+8]=t,blockData[blockBufferOffset+col+16]=t,blockData[blockBufferOffset+col+24]=t,blockData[blockBufferOffset+col+32]=t,blockData[blockBufferOffset+col+40]=t,blockData[blockBufferOffset+col+48]=t,blockData[blockBufferOffset+col+56]=t):(v1=(v0=4112+((v0=dctSqrt2*p0+2048>>12)+(v1=dctSqrt2*p4+2048>>12)+1>>1))-v1,t=(v2=p2)*dctSin6+(v3=p6)*dctCos6+2048>>12,v2=v2*dctCos6-v3*dctSin6+2048>>12,v3=t,v6=(v4=(v4=dctSqrt1d2*(p1-p7)+2048>>12)+(v6=p5)+1>>1)-v6,v5=(v7=(v7=dctSqrt1d2*(p1+p7)+2048>>12)+(v5=p3)+1>>1)-v5,t=v4*dctSin3+v7*dctCos3+2048>>12,v4=v4*dctCos3-v7*dctSin3+2048>>12,v7=t,t=v5*dctSin1+v6*dctCos1+2048>>12,v5=v5*dctCos1-v6*dctSin1+2048>>12,(p0=(v0=v0+v3+1>>1)+v7)<16?p0=0:4080<=p0?p0=255:p0>>=4,(p1=(v1=v1+v2+1>>1)+(v6=t))<16?p1=0:4080<=p1?p1=255:p1>>=4,(p2=(v2=v1-v2)+v5)<16?p2=0:4080<=p2?p2=255:p2>>=4,(p3=(v3=v0-v3)+v4)<16?p3=0:4080<=p3?p3=255:p3>>=4,(p4=v3-v4)<16?p4=0:4080<=p4?p4=255:p4>>=4,(p5=v2-v5)<16?p5=0:4080<=p5?p5=255:p5>>=4,(p6=v1-v6)<16?p6=0:4080<=p6?p6=255:p6>>=4,(p7=v0-v7)<16?p7=0:4080<=p7?p7=255:p7>>=4,blockData[blockBufferOffset+col]=p0,blockData[blockBufferOffset+col+8]=p1,blockData[blockBufferOffset+col+16]=p2,blockData[blockBufferOffset+col+24]=p3,blockData[blockBufferOffset+col+32]=p4,blockData[blockBufferOffset+col+40]=p5,blockData[blockBufferOffset+col+48]=p6,blockData[blockBufferOffset+col+56]=p7)}function buildComponentData(frame,component){for(var blocksPerLine=component.blocksPerLine,blocksPerColumn=component.blocksPerColumn,computationBuffer=new Int16Array(64),blockRow=0;blockRow<blocksPerColumn;blockRow++)for(var blockCol=0;blockCol<blocksPerLine;blockCol++)quantizeAndInverse(component,getBlockBufferOffset(component,blockRow,blockCol),computationBuffer);return component.blockData}function findNextFileMarker(data,currentPos){var startPos=2<arguments.length&&void 0!==arguments[2]?arguments[2]:currentPos,maxPos=data.length-1,newPos=startPos<currentPos?startPos:currentPos;if(maxPos<=currentPos)return null;startPos=readUint16(data,currentPos);if(65472<=startPos&&startPos<=65534)return{invalid:null,marker:startPos,offset:currentPos};for(var newMarker=readUint16(data,newPos);!(65472<=newMarker&&newMarker<=65534);){if(++newPos>=maxPos)return null;newMarker=readUint16(data,newPos)}return{invalid:startPos.toString(16),marker:newMarker,offset:newPos}}function prepareComponents(frame){var component,mcusPerLine=Math.ceil(frame.samplesPerLine/8/frame.maxH),mcusPerColumn=Math.ceil(frame.scanLines/8/frame.maxV);for(component of frame.components){var blocksPerLine=Math.ceil(Math.ceil(frame.samplesPerLine/8)*component.h/frame.maxH),blocksPerColumn=Math.ceil(Math.ceil(frame.scanLines/8)*component.v/frame.maxV),blocksPerLineForMcu=mcusPerLine*component.h,blocksPerColumnForMcu=mcusPerColumn*component.v;component.blockData=new Int16Array(64*blocksPerColumnForMcu*(1+blocksPerLineForMcu)),component.blocksPerLine=blocksPerLine,component.blocksPerColumn=blocksPerColumn}frame.mcusPerLine=mcusPerLine,frame.mcusPerColumn=mcusPerColumn}function readDataBlock(data,offset){var length=readUint16(data,offset),length=(offset+=2)+length-2,fileMarker=findNextFileMarker(data,length,offset),fileMarker=(null!=fileMarker&&fileMarker.invalid&&(warn("readDataBlock - incorrect length, current marker is: "+fileMarker.invalid),length=fileMarker.offset),data.subarray(offset,length));return{appData:fileMarker,oldOffset:offset,newOffset:offset+fileMarker.length}}function skipData(data,offset){var length=readUint16(data,offset),length=(offset+=2)+length-2,data=findNextFileMarker(data,length,offset);return null!=data&&data.invalid?data.offset:length}class JpegImage{constructor(){var{decodeTransform=null,colorTransform=-1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this._decodeTransform=decodeTransform,this._colorTransform=colorTransform}static canUseImageDecoder(data){var colorTransform=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,exifOffsets=null,numComponents=null,fileMarker=readUint16(data,offset=0);if(offset+=2,65496!==fileMarker)throw new JpegError("SOI not found");fileMarker=readUint16(data,offset),offset+=2;markerLoop:for(;65497!==fileMarker;){switch(fileMarker){case 65505:var{appData,oldOffset,newOffset}=readDataBlock(data,offset),offset=newOffset;if(69===appData[0]&&120===appData[1]&&105===appData[2]&&102===appData[3]&&0===appData[4]&&0===appData[5]){if(exifOffsets)throw new JpegError("Duplicate EXIF-blocks found.");exifOffsets={exifStart:oldOffset+6,exifEnd:newOffset}}fileMarker=readUint16(data,offset),offset+=2;continue;case 65472:case 65473:case 65474:numComponents=data[offset+7];break markerLoop;case 65535:255!==data[offset]&&offset--}fileMarker=readUint16(data,offset=skipData(data,offset)),offset+=2}return 4===numComponents||3===numComponents&&0===colorTransform?null:exifOffsets||{}}parse(data){var frame,resetInterval,_component,{dnlScanLines=null}=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},jfif=null,adobe=null,numSOSMarkers=0,quantizationTables=[],huffmanTablesAC=[],huffmanTablesDC=[],fileMarker=readUint16(data,offset=0);if(offset+=2,65496!==fileMarker)throw new JpegError("SOI not found");fileMarker=readUint16(data,offset),offset+=2;markerLoop:for(;65497!==fileMarker;){var i=void 0,j=void 0;switch(fileMarker){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:var{appData,newOffset}=readDataBlock(data,offset),offset=newOffset;65504===fileMarker&&74===appData[0]&&70===appData[1]&&73===appData[2]&&70===appData[3]&&0===appData[4]&&(jfif={version:{major:appData[5],minor:appData[6]},densityUnits:appData[7],xDensity:appData[8]<<8|appData[9],yDensity:appData[10]<<8|appData[11],thumbWidth:appData[12],thumbHeight:appData[13],thumbData:appData.subarray(14,14+3*appData[12]*appData[13])}),65518===fileMarker&&65===appData[0]&&100===appData[1]&&111===appData[2]&&98===appData[3]&&101===appData[4]&&(adobe={version:appData[5]<<8|appData[6],flags0:appData[7]<<8|appData[8],flags1:appData[9]<<8|appData[10],transformCode:appData[11]});break;case 65499:for(var quantizationTablesEnd=readUint16(data,offset)+(offset+=2)-2;offset<quantizationTablesEnd;){var quantizationTableSpec=data[offset++],tableData=new Uint16Array(64);if(quantizationTableSpec>>4==0)for(j=0;j<64;j++)tableData[dctZigZag[j]]=data[offset++];else{if(quantizationTableSpec>>4!=1)throw new JpegError("DQT - invalid table spec");for(j=0;j<64;j++)tableData[dctZigZag[j]]=readUint16(data,offset),offset+=2}quantizationTables[15&quantizationTableSpec]=tableData}break;case 65472:case 65473:case 65474:if(frame)throw new JpegError("Only single frame JPEGs supported");offset+=2,(frame={}).extended=65473===fileMarker,frame.progressive=65474===fileMarker,frame.precision=data[offset++];for(var newOffset=readUint16(data,offset),componentsCount=(offset+=2,frame.scanLines=dnlScanLines||newOffset,frame.samplesPerLine=readUint16(data,offset),offset+=2,frame.components=[],frame.componentIds={},data[offset++]),maxH=0,maxV=0,i=0;i<componentsCount;i++){var componentId=data[offset],h=data[offset+1]>>4,v=15&data[offset+1],qId=(maxH<h&&(maxH=h),maxV<v&&(maxV=v),data[offset+2]),h=frame.components.push({h:h,v:v,quantizationId:qId,quantizationTable:null});frame.componentIds[componentId]=h-1,offset+=3}frame.maxH=maxH,frame.maxV=maxV,prepareComponents(frame);break;case 65476:var huffmanLength=readUint16(data,offset);for(offset+=2,i=2;i<huffmanLength;){for(var huffmanTableSpec=data[offset++],codeLengths=new Uint8Array(16),codeLengthSum=0,j=0;j<16;j++,offset++)codeLengthSum+=codeLengths[j]=data[offset];var huffmanValues=new Uint8Array(codeLengthSum);for(j=0;j<codeLengthSum;j++,offset++)huffmanValues[j]=data[offset];i+=17+codeLengthSum,(huffmanTableSpec>>4==0?huffmanTablesDC:huffmanTablesAC)[15&huffmanTableSpec]=buildHuffmanTable(codeLengths,huffmanValues)}break;case 65501:resetInterval=readUint16(data,offset+=2),offset+=2;break;case 65498:var appData=1==++numSOSMarkers&&!dnlScanLines,selectorsCount=(offset+=2,data[offset++]),components=[];for(i=0;i<selectorsCount;i++){var index=data[offset++],componentIndex=frame.componentIds[index],componentIndex=frame.components[componentIndex],index=(componentIndex.index=index,data[offset++]);componentIndex.huffmanTableDC=huffmanTablesDC[index>>4],componentIndex.huffmanTableAC=huffmanTablesAC[15&index],components.push(componentIndex)}var spectralStart=data[offset++],spectralEnd=data[offset++],successiveApproximation=data[offset++];try{offset+=decodeScan(data,offset,frame,components,resetInterval,spectralStart,spectralEnd,successiveApproximation>>4,15&successiveApproximation,appData)}catch(ex){if(ex instanceof DNLMarkerError)return warn("".concat(ex.message," -- attempting to re-parse the JPEG image.")),this.parse(data,{dnlScanLines:ex.scanLines});if(ex instanceof EOIMarkerError){warn("".concat(ex.message," -- ignoring the rest of the image data."));break markerLoop}throw ex}break;case 65500:offset+=4;break;case 65535:255!==data[offset]&&offset--;break;default:spectralStart=findNextFileMarker(data,offset-2,offset-3);if(null!=spectralStart&&spectralStart.invalid){warn("JpegImage.parse - unexpected data, current marker is: "+spectralStart.invalid),offset=spectralStart.offset;break}if(!spectralStart||offset>=data.length-1){warn("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break markerLoop}throw new JpegError("JpegImage.parse - unknown marker: "+fileMarker.toString(16))}fileMarker=readUint16(data,offset),offset+=2}if(!frame)throw new JpegError("JpegImage.parse - no frame data found.");this.width=frame.samplesPerLine,this.height=frame.scanLines,this.jfif=jfif,this.adobe=adobe,this.components=[];for(_component of frame.components){var quantizationTable=quantizationTables[_component.quantizationId];quantizationTable&&(_component.quantizationTable=quantizationTable),this.components.push({index:_component.index,output:buildComponentData(frame,_component),scaleX:_component.h/frame.maxH,scaleY:_component.v/frame.maxV,blocksPerLine:_component.blocksPerLine,blocksPerColumn:_component.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(width,height){for(var component,componentScaleX,componentScaleY,blocksPerScanline,x,y,j,k,index,output,lastComponentScaleX,isSourcePDF=2<arguments.length&&void 0!==arguments[2]&&arguments[2],scaleX=this.width/width,scaleY=this.height/height,offset=0,numComponents=this.components.length,dataLength=width*height*numComponents,data=new Uint8ClampedArray(dataLength),xScaleBlockOffset=new Uint32Array(width),i=0;i<numComponents;i++){if(componentScaleX=(component=this.components[i]).scaleX*scaleX,componentScaleY=component.scaleY*scaleY,offset=i,output=component.output,blocksPerScanline=component.blocksPerLine+1<<3,componentScaleX!==lastComponentScaleX){for(x=0;x<width;x++)xScaleBlockOffset[x]=(4294967288&(j=0|x*componentScaleX))<<3|7&j;lastComponentScaleX=componentScaleX}for(y=0;y<height;y++)for(index=blocksPerScanline*(4294967288&(j=0|y*componentScaleY))|(7&j)<<3,x=0;x<width;x++)data[offset]=output[index+xScaleBlockOffset[x]],offset+=numComponents}var transform=this._decodeTransform;if(transform=isSourcePDF||4!==numComponents?transform:transform||new Int32Array([-256,255,-256,255,-256,255,-256,255]))for(i=0;i<dataLength;)for(k=j=0;j<numComponents;j++,i++,k+=2)data[i]=(data[i]*transform[k]>>8)+transform[k+1];return data}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(data){for(var Y,Cb,Cr,i=0,length=data.length;i<length;i+=3)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=Y-179.456+1.402*Cr,data[i+1]=Y+135.459-.344*Cb-.714*Cr,data[i+2]=Y-226.816+1.772*Cb;return data}_convertYccToRgba(data,out){for(var i=0,j=0,length=data.length;i<length;i+=3,j+=4){var Y=data[i],Cb=data[i+1],Cr=data[i+2];out[j]=Y-179.456+1.402*Cr,out[j+1]=Y+135.459-.344*Cb-.714*Cr,out[j+2]=Y-226.816+1.772*Cb,out[j+3]=255}return out}_convertYcckToRgb(data){return this._convertYcckToCmyk(data),this._convertCmykToRgb(data)}_convertYcckToRgba(data){return this._convertYcckToCmyk(data),this._convertCmykToRgba(data)}_convertYcckToCmyk(data){for(var Y,Cb,Cr,i=0,length=data.length;i<length;i+=4)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=434.456-Y-1.402*Cr,data[i+1]=119.541-Y+.344*Cb+.714*Cr,data[i+2]=481.816-Y-1.772*Cb;return data}_convertCmykToRgb(data){var count=data.length/4;return ColorSpaceUtils.cmyk.getRgbBuffer(data,0,count,data,0,8,0),data.subarray(0,3*count)}_convertCmykToRgba(data){if(ColorSpaceUtils.cmyk.getRgbBuffer(data,0,data.length/4,data,0,8,1),ColorSpaceUtils.cmyk instanceof DeviceCmykCS)for(var i=3,ii=data.length;i<ii;i+=4)data[i]=255;return data}getData(_ref0){var{width:_ref0,height,forceRGBA=!1,forceRGB=!1,isSourcePDF=!1}=_ref0;if(4<this.numComponents)throw new JpegError("Unsupported color mode");_ref0=this._getLinearizedBlockData(_ref0,height,isSourcePDF);if(1===this.numComponents&&(forceRGBA||forceRGB)){var height=_ref0.length*(forceRGBA?4:3),rgbaData=new Uint8ClampedArray(height),offset=0;if(forceRGBA)grayToRGBA(_ref0,new Uint32Array(rgbaData.buffer));else for(var grayColor of _ref0)rgbaData[offset++]=grayColor,rgbaData[offset++]=grayColor,rgbaData[offset++]=grayColor;return rgbaData}if(3===this.numComponents&&this._isColorConversionNeeded)return forceRGBA?(isSourcePDF=new Uint8ClampedArray(_ref0.length/3*4),this._convertYccToRgba(_ref0,isSourcePDF)):this._convertYccToRgb(_ref0);if(4===this.numComponents){if(this._isColorConversionNeeded)return forceRGBA?this._convertYcckToRgba(_ref0):forceRGB?this._convertYcckToRgb(_ref0):this._convertYcckToCmyk(_ref0);if(forceRGBA)return this._convertCmykToRgba(_ref0);if(forceRGB)return this._convertCmykToRgb(_ref0)}return _ref0}}var _JpegStream_brand=new WeakSet;class JpegStream extends DecodeStream{constructor(stream,maybeLength,params){super(maybeLength),_classPrivateMethodInitSpec(this,_JpegStream_brand),this.stream=stream,this.dict=stream.dict,this.maybeLength=maybeLength,this.params=params}static get canUseImageDecoder(){return shadow(this,"canUseImageDecoder",_assertClassBrand(JpegStream,this,_isImageDecoderSupported2)._?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions(_ref1){var{isImageDecoderSupported:_ref1=!1}=_ref1;_isImageDecoderSupported2._=_assertClassBrand(JpegStream,this,_ref1)}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(requested){}readBlock(){this.decodeImage()}get jpegOptions(){var jpegOptions={decodeTransform:void 0,colorTransform:void 0},decodeArr=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(decodeArr)){for(var bitsPerComponent=this.dict.get("BPC","BitsPerComponent")||8,decodeArrLength=decodeArr.length,transform=new Int32Array(decodeArrLength),transformNeeded=!1,maxValue=(1<<bitsPerComponent)-1,i=0;i<decodeArrLength;i+=2)transform[i]=256*(decodeArr[i+1]-decodeArr[i])|0,transform[i+1]=decodeArr[i]*maxValue|0,256===transform[i]&&0===transform[i+1]||(transformNeeded=!0);transformNeeded&&(jpegOptions.decodeTransform=transform)}return this.params instanceof Dict&&(bitsPerComponent=this.params.get("ColorTransform"),Number.isInteger(bitsPerComponent))&&(jpegOptions.colorTransform=bitsPerComponent),shadow(this,"jpegOptions",jpegOptions)}decodeImage(bytes){var jpegImage;return this.eof||(bytes=_assertClassBrand(_JpegStream_brand,this,_skipUselessBytes).call(this,bytes||this.bytes),(jpegImage=new JpegImage(this.jpegOptions)).parse(bytes),bytes=jpegImage.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0}),this.buffer=bytes,this.bufferLength=bytes.length,this.eof=!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await JpegStream.canUseImageDecoder)return null;var decoder,jpegOptions=this.jpegOptions;if(jpegOptions.decodeTransform)return null;try{var data,useImageDecoder,bytes=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;return bytes?(data=_assertClassBrand(_JpegStream_brand,this,_skipUselessBytes).call(this,bytes),(useImageDecoder=JpegImage.canUseImageDecoder(data,jpegOptions.colorTransform))?(useImageDecoder.exifStart&&(data=data.slice()).fill(0,useImageDecoder.exifStart,useImageDecoder.exifEnd),(await(decoder=new ImageDecoder({data:data,type:"image/jpeg",preferAnimation:!1})).decode()).image):null):null}catch(reason){return warn('getTransferableImage - failed: "'.concat(reason,'".')),null}finally{null!=decoder&&decoder.close()}}}function _skipUselessBytes(data){for(var i=0,ii=data.length-1;i<ii;i++)if(255===data[i]&&216===data[i+1]){0<i&&(data=data.subarray(i));break}return data}var _isImageDecoderSupported2={_:FeatureTest.isImageDecoderSupported},OpenJPEG=async function(){var readyPromiseResolve,readyPromiseReject,Module=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve,readyPromiseReject=reject}),thisProgram="./this.program",quit_=(status,toThrow)=>{throw toThrow};try{new URL(".",import1.meta.url).href}catch(_unused5){}var wasmMemory,EXITSTATUS,HEAP8,HEAPU8,HEAP32,HEAPU32,out=console.log.bind(console),err=console.error.bind(console),ABORT=!1;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b),new Int16Array(b),HEAPU8=new Uint8Array(b),new Uint16Array(b),HEAP32=new Int32Array(b),HEAPU32=new Uint32Array(b),new Float32Array(b),new Float64Array(b),new BigInt64Array(b),new BigUint64Array(b)}var runDependencies=0,dependenciesFulfilled=null;class ExitStatus{constructor(status){_defineProperty(this,"name","ExitStatus"),this.message="Program terminated with exit(".concat(status,")"),this.status=status}}var callRuntimeCallbacks=callbacks=>{for(;0<callbacks.length;)callbacks.shift()(Module)},onPostRuns=[],addOnPostRun=cb=>onPostRuns.push(cb),onPreRuns=[],addOnPreRun=cb=>onPreRuns.push(cb),noExitRuntime=!0,runtimeKeepaliveCounter=0,timers={},handleException=e=>{if(e instanceof ExitStatus||"unwind"==e)return EXITSTATUS;quit_(1,e)},keepRuntimeAlive=()=>noExitRuntime||0<runtimeKeepaliveCounter,_proc_exit=code=>{var _Module$onExit;EXITSTATUS=code,keepRuntimeAlive()||(null!=(_Module$onExit=Module.onExit)&&_Module$onExit.call(Module,code),ABORT=!0),quit_(code,new ExitStatus(code))},_exit=(status,implicit)=>{_proc_exit(EXITSTATUS=status)},maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}};var ENV={},getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var env={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",_:getExecutableName()};for(x in ENV)void 0===ENV[x]?delete env[x]:env[x]=ENV[x];var x,strings=[];for(x in env)strings.push("".concat(x,"=").concat(env[x]));getEnvStrings.strings=strings}return getEnvStrings.strings},stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(0<maxBytesToWrite))return 0;for(var startIdx=outIdx,endIdx=outIdx+maxBytesToWrite-1,i=0;i<str.length;++i){var u=str.charCodeAt(i);if((u=55296<=u&&u<=57343?65536+((1023&u)<<10)|1023&str.charCodeAt(++i):u)<=127){if(endIdx<=outIdx)break;heap[outIdx++]=u}else{if(u<=2047){if(endIdx<=outIdx+1)break;heap[outIdx++]=192|u>>6}else{if(u<=65535){if(endIdx<=outIdx+2)break;heap[outIdx++]=224|u>>12}else{if(endIdx<=outIdx+3)break;heap[outIdx++]=240|u>>18,heap[outIdx++]=128|u>>12&63}heap[outIdx++]=128|u>>6&63}heap[outIdx++]=128|63&u}}return heap[outIdx]=0,outIdx-startIdx},INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992;var printCharBuffers=[null,[],[]],UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder:void 0,UTF8ArrayToString=function(heapOrArray){for(var idx=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,endIdx=idx+(2<arguments.length&&void 0!==arguments[2]?arguments[2]:NaN),endPtr=idx;heapOrArray[endPtr]&&!(endIdx<=endPtr);)++endPtr;if(16<endPtr-idx&&heapOrArray.buffer&&UTF8Decoder)return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr));for(var str="";idx<endPtr;){var u2,u1,u0=heapOrArray[idx++];128&u0?(u1=63&heapOrArray[idx++],192==(224&u0)?str+=String.fromCharCode((31&u0)<<6|u1):(u2=63&heapOrArray[idx++],(u0=224==(240&u0)?(15&u0)<<12|u1<<6|u2:(7&u0)<<18|u1<<12|u2<<6|63&heapOrArray[idx++])<65536?str+=String.fromCharCode(u0):(u1=u0-65536,str+=String.fromCharCode(55296|u1>>10,56320|1023&u1)))):str+=String.fromCharCode(u0)}return str},UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.wasmBinary&&Module.wasmBinary,Module.arguments&&Module.arguments,Module.thisProgram&&(thisProgram=Module.thisProgram),Module.writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var _Module$monitorRunDep,info,wasmImports={l:()=>{var what="",_Module$onAbort=(null!=(_Module$onAbort=Module.onAbort)&&_Module$onAbort.call(Module,what),err(what="Aborted("+what+")"),ABORT=!0,what+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(what));throw readyPromiseReject(_Module$onAbort),_Module$onAbort},k:()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},m:(which,timeout_ms)=>{var id;return timers[which]&&(clearTimeout(timers[which].id),delete timers[which]),timeout_ms&&(id=setTimeout(()=>{delete timers[which];var func=()=>__emscripten_timeout(which,performance.now());if(!ABORT)try{func(),maybeExit()}catch(e){handleException(e)}},timeout_ms),timers[which]={id:id,timeout_ms:timeout_ms}),0},g:function(compG_ptr,nb_pixels){compG_ptr>>=2;var imageData=Module.imageData=new Uint8ClampedArray(nb_pixels),compG_ptr=HEAP32.subarray(compG_ptr,compG_ptr+nb_pixels);imageData.set(compG_ptr)},f:function(compR_ptr,compG_ptr,compB_ptr,nb_pixels){compR_ptr>>=2,compG_ptr>>=2,compB_ptr>>=2;for(var imageData=Module.imageData=new Uint8ClampedArray(3*nb_pixels),compR=HEAP32.subarray(compR_ptr,compR_ptr+nb_pixels),compG=HEAP32.subarray(compG_ptr,compG_ptr+nb_pixels),compB=HEAP32.subarray(compB_ptr,compB_ptr+nb_pixels),i=0;i<nb_pixels;i++)imageData[3*i]=compR[i],imageData[3*i+1]=compG[i],imageData[3*i+2]=compB[i]},e:function(compR_ptr,compG_ptr,compB_ptr,compA_ptr,nb_pixels){compR_ptr>>=2,compG_ptr>>=2,compB_ptr>>=2,compA_ptr>>=2;for(var imageData=Module.imageData=new Uint8ClampedArray(4*nb_pixels),compR=HEAP32.subarray(compR_ptr,compR_ptr+nb_pixels),compG=HEAP32.subarray(compG_ptr,compG_ptr+nb_pixels),compB=HEAP32.subarray(compB_ptr,compB_ptr+nb_pixels),compA=HEAP32.subarray(compA_ptr,compA_ptr+nb_pixels),i=0;i<nb_pixels;i++)imageData[4*i]=compR[i],imageData[4*i+1]=compG[i],imageData[4*i+2]=compB[i],imageData[4*i+3]=compA[i]},n:requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;if(!(2147483648<requestedSize))for(var alignment,cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown),overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);if((size=>{size=(size-wasmMemory.buffer.byteLength+65535)/65536|0;try{return wasmMemory.grow(size),updateMemoryViews(),1}catch(e){}})(Math.min(2147483648,(overGrownHeapSize=Math.max(requestedSize,overGrownHeapSize),alignment=65536,Math.ceil(overGrownHeapSize/alignment)*alignment))))return!0}return!1},p:(__environ,environ_buf)=>{var string,bufSize=0,envp=0;for(string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>2]=ptr,bufSize+=stringToUTF8Array(string,HEAPU8,ptr,1/0)+1,envp+=4}return 0},q:(penviron_count,penviron_buf_size)=>{var string,strings=getEnvStrings(),bufSize=(HEAPU32[penviron_count>>2]=strings.length,0);for(string of strings)bufSize+=(str=>{for(var len=0,i=0;i<str.length;++i){var c=str.charCodeAt(i);c<=127?len++:c<=2047?len+=2:55296<=c&&c<=57343?(len+=4,++i):len+=3}return len})(string)+1;return HEAPU32[penviron_buf_size>>2]=bufSize,0},b:fd=>52,o:function(fd,offset,whence,newOffset){var num;return offset=(num=offset)<INT53_MIN||INT53_MAX<num?NaN:Number(num),70},c:(fd,iov,iovcnt,pnum)=>{for(var stream,curr,buffer,num=0,i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2],len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++)stream=fd,curr=HEAPU8[ptr+j],buffer=void 0,buffer=printCharBuffers[stream],0===curr||10===curr?((1===stream?out:err)(UTF8ArrayToString(buffer)),buffer.length=0):buffer.push(curr);num+=len}return HEAPU32[pnum>>2]=num,0},r:function(compG_ptr,nb_pixels){compG_ptr>>=2;for(var imageData=Module.imageData=new Uint8ClampedArray(4*nb_pixels),compG=HEAP32.subarray(compG_ptr,compG_ptr+nb_pixels),i=0;i<nb_pixels;i++)imageData[4*i]=imageData[4*i+1]=imageData[4*i+2]=compG[i],imageData[4*i+3]=255},i:function(compG_ptr,compA_ptr,nb_pixels){compG_ptr>>=2,compA_ptr>>=2;for(var imageData=Module.imageData=new Uint8ClampedArray(4*nb_pixels),compG=HEAP32.subarray(compG_ptr,compG_ptr+nb_pixels),compA=HEAP32.subarray(compA_ptr,compA_ptr+nb_pixels),i=0;i<nb_pixels;i++)imageData[4*i]=imageData[4*i+1]=imageData[4*i+2]=compG[i],imageData[4*i+3]=compA[i]},d:function(message_ptr){message_ptr=UTF8ToString(message_ptr),(Module.warn||console.warn)("OpenJPEG: ".concat(message_ptr))},j:_proc_exit,h:function(compR_ptr,compG_ptr,compB_ptr,nb_pixels){compR_ptr>>=2,compG_ptr>>=2,compB_ptr>>=2;for(var imageData=Module.imageData=new Uint8ClampedArray(4*nb_pixels),compR=HEAP32.subarray(compR_ptr,compR_ptr+nb_pixels),compG=HEAP32.subarray(compG_ptr,compG_ptr+nb_pixels),compB=HEAP32.subarray(compB_ptr,compB_ptr+nb_pixels),i=0;i<nb_pixels;i++)imageData[4*i]=compR[i],imageData[4*i+1]=compG[i],imageData[4*i+2]=compB[i],imageData[4*i+3]=255},a:function(message_ptr){message_ptr=UTF8ToString(message_ptr),Module.errorMessages?Module.errorMessages+="\n"+message_ptr:Module.errorMessages=message_ptr}},wasmExports=(runDependencies++,null!=(_Module$monitorRunDep=Module.monitorRunDependencies)&&_Module$monitorRunDep.call(Module,runDependencies),info={a:wasmImports},await new Promise((resolve,reject)=>{Module.instantiateWasm(info,(mod,inst)=>{resolve(receiveInstance(mod))})}));function receiveInstance(instance){return wasmExports=instance.exports,wasmMemory=wasmExports.s,updateMemoryViews(),runDependencies--,null!=(instance=Module.monitorRunDependencies)&&instance.call(Module,runDependencies),0==runDependencies&&dependenciesFulfilled&&(instance=dependenciesFulfilled,dependenciesFulfilled=null,instance()),wasmExports}wasmExports.t,Module._malloc=wasmExports.u,Module._free=wasmExports.v,Module._jp2_decode=wasmExports.w;var __emscripten_timeout=wasmExports.x;if(Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);0<Module.preInit.length;)Module.preInit.shift()();return function run(){if(0<runDependencies)dependenciesFulfilled=run;else{if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns),0<runDependencies?dependenciesFulfilled=run:Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),doRun()},1)):doRun()}function doRun(){var _Module$onRuntimeInit;if(Module.calledRun=!0,!ABORT){if(wasmExports.t(),readyPromiseResolve(Module),null!=(_Module$onRuntimeInit=Module.onRuntimeInitialized)&&_Module$onRuntimeInit.call(Module),Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}}}(),readyPromise},openjpeg=OpenJPEG;class JpxError extends BaseException{constructor(msg){super(msg,"JpxError")}}class JpxImage{static setOptions(_ref10){var{handler:_ref10,useWasm,useWorkerFetch,wasmUrl}=_ref10;_useWasm2._=_assertClassBrand(JpxImage,this,useWasm),_useWorkerFetch._=_assertClassBrand(JpxImage,this,useWorkerFetch),_wasmUrl2._=_assertClassBrand(JpxImage,this,wasmUrl),useWorkerFetch||(_handler._=_assertClassBrand(JpxImage,this,_ref10))}static async decode(bytes){var promise,{numComponents=4,isIndexedColormap=!1,smaskInData=!1,reducePower=0}=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},resolve=(_assertClassBrand(JpxImage,this,_modulePromise)._||({promise,resolve}=Promise.withResolvers(),promise=[promise],_assertClassBrand(JpxImage,this,_useWasm2)._?promise.push(openjpeg({warn:warn,instantiateWasm:_assertClassBrand(JpxImage,this,_instantiateWasm).bind(this,resolve)})):_assertClassBrand(JpxImage,this,_getJsModule).call(this,resolve),_modulePromise._=_assertClassBrand(JpxImage,this,Promise.race(promise))),await _assertClassBrand(JpxImage,this,_modulePromise)._);if(!resolve)throw new JpxError("OpenJPEG failed to initialize");try{var size=bytes.length,ptr=resolve._malloc(size);if(resolve.writeArrayToMemory(bytes,ptr),resolve._jp2_decode(ptr,size,0<numComponents?numComponents:0,!!isIndexedColormap,!!smaskInData,reducePower)){var errorMessages=resolve["errorMessages"];if(errorMessages)throw delete resolve.errorMessages,new JpxError(errorMessages);throw new JpxError("Unknown error")}var imageData=resolve["imageData"];return resolve.imageData=null,imageData}finally{ptr&&resolve._free(ptr)}}static cleanup(){_modulePromise._=_assertClassBrand(JpxImage,this,null)}static parseImageProperties(stream){for(var Xsiz,Ysiz,XOsiz,YOsiz,newByte=stream.getByte();0<=newByte;)if(65361==(newByte<<8|(newByte=stream.getByte())))return stream.skip(4),Xsiz=stream.getInt32()>>>0,Ysiz=stream.getInt32()>>>0,XOsiz=stream.getInt32()>>>0,YOsiz=stream.getInt32()>>>0,stream.skip(16),{width:Xsiz-XOsiz,height:Ysiz-YOsiz,bitsPerComponent:8,componentsCount:stream.getUint16()};throw new JpxError("No size marker found in JPX stream")}}async function _getJsModule(fallbackCallback){var path="".concat(_assertClassBrand(_JpxImage,this,_wasmUrl2)._,"openjpeg_nowasm_fallback.js"),instance=null;try{instance=(await import(path)).default()}catch(e){warn("JpxImage#getJsModule: ".concat(e))}fallbackCallback(instance)}async function _instantiateWasm(fallbackCallback,imports,successCallback){try{return _assertClassBrand(_JpxImage,this,_buffer)._||(_assertClassBrand(_JpxImage,this,_useWorkerFetch)._?_buffer._=_assertClassBrand(_JpxImage,this,await fetchBinaryData("".concat(_assertClassBrand(_JpxImage,this,_wasmUrl2)._).concat("openjpeg.wasm"))):_buffer._=_assertClassBrand(_JpxImage,this,await _assertClassBrand(_JpxImage,this,_handler)._.sendWithPromise("FetchBinaryData",{type:"wasmFactory",filename:"openjpeg.wasm"}))),successCallback((await WebAssembly.instantiate(_assertClassBrand(_JpxImage,this,_buffer)._,imports)).instance)}catch(reason){return warn("JpxImage#instantiateWasm: ".concat(reason)),_assertClassBrand(_JpxImage,this,_getJsModule).call(this,fallbackCallback),null}finally{_handler._=_assertClassBrand(_JpxImage,this,null)}}var _JpxImage=JpxImage,_buffer={_:null},_handler={_:null},_modulePromise={_:null},_useWasm2={_:!0},_useWorkerFetch={_:!0},_wasmUrl2={_:null};function addState(parentState,pattern,checkFn,iterateFn,processFn){for(var state=parentState,i=0,ii=pattern.length-1;i<ii;i++)var item=pattern[i],state=state[item]||(state[item]=[]);state[pattern.at(-1)]={checkFn:checkFn,iterateFn:iterateFn,processFn:processFn}}var InitialState=[];addState(InitialState,[OPS.save,OPS.transform,OPS.paintInlineImageXObject,OPS.restore],null,function(context,i){var fnArray=context.fnArray,context=(i-(context.iCurr-3))%4;switch(context){case 0:return fnArray[i]===OPS.save;case 1:return fnArray[i]===OPS.transform;case 2:return fnArray[i]===OPS.paintInlineImageXObject;case 3:return fnArray[i]===OPS.restore}throw new Error("iterateInlineImageGroup - invalid pos: ".concat(context))},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr,iFirstSave=curr-3,iFirstTransform=curr-2,iFirstPIIXO=curr-1,count=Math.min(Math.floor((i-iFirstSave)/4),200);if(count<10)return i-(i-iFirstSave)%4;for(var maxX=0,map=[],maxLineHeight=0,currentX=1,currentY=1,q=0;q<count;q++){var transform=argsArray[iFirstTransform+(q<<2)],_img=argsArray[iFirstPIIXO+(q<<2)][0];1e3<currentX+_img.width&&(maxX=Math.max(maxX,currentX),currentY+=maxLineHeight+2,maxLineHeight=currentX=0),map.push({transform:transform,x:currentX,y:currentY,w:_img.width,h:_img.height}),currentX+=_img.width+2,maxLineHeight=Math.max(maxLineHeight,_img.height)}for(var imgWidth=Math.max(maxX,currentX)+1,curr=currentY+maxLineHeight+1,imgData=new Uint8Array(imgWidth*curr*4),imgRowSize=imgWidth<<2,_q=0;_q<count;_q++){var data=argsArray[iFirstPIIXO+(_q<<2)][0].data,rowSize=map[_q].w<<2,dataOffset=0,offset=map[_q].x+map[_q].y*imgWidth<<2;imgData.set(data.subarray(0,rowSize),offset-imgRowSize);for(var k=0,kk=map[_q].h;k<kk;k++)imgData.set(data.subarray(dataOffset,dataOffset+rowSize),offset),dataOffset+=rowSize,offset+=imgRowSize;for(imgData.set(data.subarray(dataOffset-rowSize,dataOffset),offset);0<=offset;)data[offset-4]=data[offset],data[offset-3]=data[offset+1],data[offset-2]=data[offset+2],data[offset-1]=data[offset+3],data[offset+rowSize]=data[offset+rowSize-4],data[offset+rowSize+1]=data[offset+rowSize-3],data[offset+rowSize+2]=data[offset+rowSize-2],data[offset+rowSize+3]=data[offset+rowSize-1],offset-=imgRowSize}i={width:imgWidth,height:curr};return context.isOffscreenCanvasSupported?((context=new OffscreenCanvas(imgWidth,curr)).getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(imgData.buffer),imgWidth,curr),0,0),i.bitmap=context.transferToImageBitmap(),i.data=null):(i.kind=ImageKind.RGBA_32BPP,i.data=imgData),fnArray.splice(iFirstSave,4*count,OPS.paintInlineImageXObjectGroup),argsArray.splice(iFirstSave,4*count,[i,map]),1+iFirstSave}),addState(InitialState,[OPS.save,OPS.transform,OPS.paintImageMaskXObject,OPS.restore],null,function(context,i){var fnArray=context.fnArray,context=(i-(context.iCurr-3))%4;switch(context){case 0:return fnArray[i]===OPS.save;case 1:return fnArray[i]===OPS.transform;case 2:return fnArray[i]===OPS.paintImageMaskXObject;case 3:return fnArray[i]===OPS.restore}throw new Error("iterateImageMaskGroup - invalid pos: ".concat(context))},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,context=context.iCurr,iFirstSave=context-3,iFirstTransform=context-2,iFirstPIMXO=context-1;if((count=Math.floor((i-iFirstSave)/4))<10)return i-(i-iFirstSave)%4;var isSameImage=!1,firstPIMXOArg0=argsArray[iFirstPIMXO][0],firstTransformArg0=argsArray[iFirstTransform][0],firstTransformArg1=argsArray[iFirstTransform][1],firstTransformArg2=argsArray[iFirstTransform][2],firstTransformArg3=argsArray[iFirstTransform][3];if(firstTransformArg1===firstTransformArg2)for(var isSameImage=!0,iTransform=4+iFirstTransform,iPIMXO=4+iFirstPIMXO,q=1;q<count;q++,iTransform+=4,iPIMXO+=4)if(transformArgs=argsArray[iTransform],argsArray[iPIMXO][0]!==firstPIMXOArg0||transformArgs[0]!==firstTransformArg0||transformArgs[1]!==firstTransformArg1||transformArgs[2]!==firstTransformArg2||transformArgs[3]!==firstTransformArg3){q<10?isSameImage=!1:count=q;break}if(isSameImage){var count=Math.min(count,1e3),positions=new Float32Array(2*count);iTransform=iFirstTransform;for(var _q2=0;_q2<count;_q2++,iTransform+=4)transformArgs=argsArray[iTransform],positions[_q2<<1]=transformArgs[4],positions[1+(_q2<<1)]=transformArgs[5];fnArray.splice(iFirstSave,4*count,OPS.paintImageMaskXObjectRepeat),argsArray.splice(iFirstSave,4*count,[firstPIMXOArg0,firstTransformArg0,firstTransformArg1,firstTransformArg2,firstTransformArg3,positions])}else{count=Math.min(count,100);for(var images=[],_q3=0;_q3<count;_q3++){var transformArgs=argsArray[iFirstTransform+(_q3<<2)],maskParams=argsArray[iFirstPIMXO+(_q3<<2)][0];images.push({data:maskParams.data,width:maskParams.width,height:maskParams.height,interpolate:maskParams.interpolate,count:maskParams.count,transform:transformArgs})}fnArray.splice(iFirstSave,4*count,OPS.paintImageMaskXObjectGroup),argsArray.splice(iFirstSave,4*count,[images])}return 1+iFirstSave}),addState(InitialState,[OPS.save,OPS.transform,OPS.paintImageXObject,OPS.restore],function(context){var argsArray=context.argsArray,context=context.iCurr-2;return 0===argsArray[context][1]&&0===argsArray[context][2]},function(context,i){var iFirstTransform,firstTransformArg0,fnArray=context.fnArray,argsArray=context.argsArray,pos=(i-(context.iCurr-3))%4;switch(pos){case 0:return fnArray[i]===OPS.save;case 1:return fnArray[i]!==OPS.transform?!1:(firstTransformArg0=argsArray[iFirstTransform=context.iCurr-2][0],iFirstTransform=argsArray[iFirstTransform][3],argsArray[i][0]===firstTransformArg0&&0===argsArray[i][1]&&0===argsArray[i][2]&&argsArray[i][3]===iFirstTransform);case 2:return fnArray[i]!==OPS.paintImageXObject?!1:(firstTransformArg0=argsArray[context.iCurr-1][0],argsArray[i][0]===firstTransformArg0);case 3:return fnArray[i]===OPS.restore}throw new Error("iterateImageGroup - invalid pos: ".concat(pos))},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,context=context.iCurr,iFirstSave=context-3,iFirstTransform=context-2,context=argsArray[context-1][0],firstTransformArg0=argsArray[iFirstTransform][0],firstTransformArg3=argsArray[iFirstTransform][3],count=Math.min(Math.floor((i-iFirstSave)/4),1e3);if(count<3)return i-(i-iFirstSave)%4;for(var positions=new Float32Array(2*count),iTransform=iFirstTransform,q=0;q<count;q++,iTransform+=4){var transformArgs=argsArray[iTransform];positions[q<<1]=transformArgs[4],positions[1+(q<<1)]=transformArgs[5]}i=[context,firstTransformArg0,firstTransformArg3,positions];return fnArray.splice(iFirstSave,4*count,OPS.paintImageXObjectRepeat),argsArray.splice(iFirstSave,4*count,i),1+iFirstSave}),addState(InitialState,[OPS.beginText,OPS.setFont,OPS.setTextMatrix,OPS.showText,OPS.endText],null,function(context,i){var firstSetFontArg0,iFirstSetFont,fnArray=context.fnArray,argsArray=context.argsArray,pos=(i-(context.iCurr-4))%5;switch(pos){case 0:return fnArray[i]===OPS.beginText;case 1:return fnArray[i]===OPS.setFont;case 2:return fnArray[i]===OPS.setTextMatrix;case 3:return fnArray[i]!==OPS.showText?!1:(firstSetFontArg0=argsArray[iFirstSetFont=context.iCurr-3][0],iFirstSetFont=argsArray[iFirstSetFont][1],argsArray[i][0]===firstSetFontArg0&&argsArray[i][1]===iFirstSetFont);case 4:return fnArray[i]===OPS.endText}throw new Error("iterateShowTextGroup - invalid pos: ".concat(pos))},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,context=context.iCurr,iFirstBeginText=context-4,iFirstSetFont=context-3,iFirstSetTextMatrix=context-2,iFirstShowText=context-1,firstSetFontArg0=argsArray[iFirstSetFont][0],firstSetFontArg1=argsArray[iFirstSetFont][1],count=Math.min(Math.floor((i-iFirstBeginText)/5),1e3);if(count<3)return i-(i-iFirstBeginText)%5;for(var i=iFirstBeginText,iEndText=(4<=iFirstBeginText&&fnArray[iFirstBeginText-4]===fnArray[iFirstSetFont]&&fnArray[iFirstBeginText-3]===fnArray[iFirstSetTextMatrix]&&fnArray[iFirstBeginText-2]===fnArray[iFirstShowText]&&fnArray[iFirstBeginText-1]===fnArray[context]&&argsArray[iFirstBeginText-4][0]===firstSetFontArg0&&argsArray[iFirstBeginText-4][1]===firstSetFontArg1&&(count++,i-=5),i+4),q=1;q<count;q++)fnArray.splice(iEndText,3),argsArray.splice(iEndText,3),iEndText+=2;return iEndText+1}),addState(InitialState,[OPS.save,OPS.transform,OPS.constructPath,OPS.restore],context=>{var argsArray=context.argsArray,op=argsArray[context.iCurr-1][0];return op!==OPS.stroke&&op!==OPS.closeStroke&&op!==OPS.fillStroke&&op!==OPS.eoFillStroke&&op!==OPS.closeFillStroke&&op!==OPS.closeEOFillStroke||1===(op=argsArray[context.iCurr-2])[0]&&0===op[1]&&0===op[2]&&1===op[3]},()=>!1,(context,i)=>{var{fnArray,argsArray}=context,context=context.iCurr,iFirstSave=context-3,args=argsArray[context-1],transform=argsArray[context-2],[,[buffer],context]=args;if(context){Util.scaleMinMax(transform,context);for(var k=0,kk=buffer.length;k<kk;)switch(buffer[k++]){case DrawOPS.moveTo:case DrawOPS.lineTo:Util.applyTransform(buffer,transform,k),k+=2;break;case DrawOPS.curveTo:Util.applyTransformToBezier(buffer,transform,k),k+=6}}return fnArray.splice(iFirstSave,4,OPS.constructPath),argsArray.splice(iFirstSave,4,args),1+iFirstSave});class NullOptimizer{constructor(queue){this.queue=queue}_optimize(){}push(fn,args){this.queue.fnArray.push(fn),this.queue.argsArray.push(args),this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(queue){super(queue),this.state=null,this.context={iCurr:0,fnArray:queue.fnArray,argsArray:queue.argsArray,isOffscreenCanvasSupported:OperatorList.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){var fnArray=this.queue.fnArray,i=this.lastProcessed,ii=fnArray.length,state=this.state,match=this.match;if(state||match||i+1!==ii||InitialState[fnArray[i]]){for(var context=this.context;i<ii;){if(match){if((0,match.iterateFn)(context,i)){i++;continue}if(i=(0,match.processFn)(context,i+1),state=match=null,(ii=fnArray.length)<=i)break}!(state=(state||InitialState)[fnArray[i]])||Array.isArray(state)?i++:(context.iCurr=i,i++,state=(state.checkFn&&!(0,state.checkFn)(context)||(match=state),null))}this.state=state,this.match=match,this.lastProcessed=i}else this.lastProcessed=ii}flush(){for(;this.match;){var length=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,length),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}}class OperatorList{constructor(){var intent=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,streamSink=1<arguments.length?arguments[1]:void 0;this._streamSink=streamSink,this.fnArray=[],this.argsArray=[],this.optimizer=new(!streamSink||intent&RenderingIntentFlag.OPLIST?NullOptimizer:QueueOptimizer)(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=streamSink?null:Promise.resolve()}static setOptions(_ref11){_ref11=_ref11.isOffscreenCanvasSupported;this.isOffscreenCanvasSupported=_ref11}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(fn,args){this.optimizer.push(fn,args),this.weight++,this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(fn===OPS.restore||fn===OPS.endText))&&this.flush()}addImageOps(fn,args,optionalContent){var hasMask=3<arguments.length&&void 0!==arguments[3]&&arguments[3];hasMask&&(this.addOp(OPS.save),this.addOp(OPS.setGState,[[["SMask",!1]]])),void 0!==optionalContent&&this.addOp(OPS.beginMarkedContentProps,["OC",optionalContent]),this.addOp(fn,args),void 0!==optionalContent&&this.addOp(OPS.endMarkedContent,[]),hasMask&&this.addOp(OPS.restore)}addDependency(dependency){this.dependencies.has(dependency)||(this.dependencies.add(dependency),this.addOp(OPS.dependency,[dependency]))}addDependencies(dependencies){for(var dependency of dependencies)this.addDependency(dependency)}addOpList(opList){if(opList instanceof OperatorList){for(var dependency of opList.dependencies)this.dependencies.add(dependency);for(var i=0,ii=opList.length;i<ii;i++)this.addOp(opList.fnArray[i],opList.argsArray[i])}else warn('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){for(var transfers=[],{fnArray,argsArray,length}=this,i=0;i<length;i++)switch(fnArray[i]){case OPS.paintInlineImageXObject:case OPS.paintInlineImageXObjectGroup:case OPS.paintImageMaskXObject:var{bitmap,data}=argsArray[i][0];(bitmap||null!=data&&data.buffer)&&transfers.push(bitmap||data.buffer);break;case OPS.constructPath:var[,[bitmap],data]=argsArray[i];bitmap&&transfers.push(bitmap.buffer,data.buffer);break;case OPS.paintFormXObjectBegin:var[matrix,bbox]=argsArray[i];matrix&&transfers.push(matrix.buffer),bbox&&transfers.push(bbox.buffer);break;case OPS.setTextMatrix:transfers.push(argsArray[i][0].buffer)}return transfers}flush(){var lastChunk=0<arguments.length&&void 0!==arguments[0]&&arguments[0],separateAnnots=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,length=(this.optimizer.flush(),this.length);this._totalLength+=length,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:lastChunk,separateAnnots:separateAnnots,length:length},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}}function hexToInt(a,size){for(var n=0,i=0;i<=size;i++)n=n<<8|a[i];return n>>>0}function hexToStr(a,size){return 1===size?String.fromCharCode(a[0],a[1]):3===size?String.fromCharCode(a[0],a[1],a[2],a[3]):String.fromCharCode(...a.subarray(0,size+1))}function addHex(a,b,size){for(var c=0,i=size;0<=i;i--)c+=a[i]+b[i],a[i]=255&c,c>>=8}function incHex(a,size){for(var c=1,i=size;0<=i&&0<c;i--)c+=a[i],a[i]=255&c,c>>=8}_defineProperty(_OperatorList=OperatorList,"CHUNK_SIZE",1e3),_defineProperty(OperatorList,"CHUNK_SIZE_ABOUT",_OperatorList.CHUNK_SIZE-5),_defineProperty(OperatorList,"isOffscreenCanvasSupported",!1);var MAX_NUM_SIZE=16,MAX_ENCODED_NUM_SIZE=19;class BinaryCMapStream{constructor(data){this.buffer=data,this.pos=0,this.end=data.length,this.tmpBuf=new Uint8Array(MAX_ENCODED_NUM_SIZE)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){var n=0;do{var b=this.readByte();if(b<0)throw new FormatError("unexpected EOF in bcmap")}while(n=n<<7|127&b,!!(128&b));return n}readSigned(){var n=this.readNumber();return 1&n?~(n>>>1):n>>>1}readHex(num,size){num.set(this.buffer.subarray(this.pos,this.pos+size+1)),this.pos+=size+1}readHexNumber(num,size){var last,stack=this.tmpBuf,sp=0;do{var b=this.readByte();if(b<0)throw new FormatError("unexpected EOF in bcmap")}while(last=!(128&b),stack[sp++]=127&b,!last);for(var i=size,buffer=0,bufferSize=0;0<=i;){for(;bufferSize<8&&0<stack.length;)buffer|=stack[--sp]<<bufferSize,bufferSize+=7;num[i]=255&buffer,i--,buffer>>=8,bufferSize-=8}}readHexSigned(num,size){this.readHexNumber(num,size);for(var sign=1&num[size]?255:0,c=0,i=0;i<=size;i++)c=(1&c)<<8|num[i],num[i]=c>>1^sign}readString(){for(var len=this.readNumber(),buf=new Array(len),i=0;i<len;i++)buf[i]=this.readNumber();return String.fromCharCode(...buf)}}class BinaryCMapReader{async process(data,cMap,extend){for(var code,b,stream=new BinaryCMapStream(data),data=stream.readByte(),useCMap=(cMap.vertical=!!(1&data),null),start=new Uint8Array(MAX_NUM_SIZE),end=new Uint8Array(MAX_NUM_SIZE),char=new Uint8Array(MAX_NUM_SIZE),charCode=new Uint8Array(MAX_NUM_SIZE),tmp=new Uint8Array(MAX_NUM_SIZE);0<=(b=stream.readByte());){var type=b>>5;if(7==type)switch(31&b){case 0:stream.readString();break;case 1:useCMap=stream.readString()}else{var sequence=!!(16&b),dataSize=15&b;if(MAX_NUM_SIZE<1+dataSize)throw new Error("BinaryCMapReader.process: Invalid dataSize.");var subitemsCount=stream.readNumber();switch(type){case 0:stream.readHex(start,dataSize),stream.readHexNumber(end,dataSize),addHex(end,start,dataSize),cMap.addCodespaceRange(1+dataSize,hexToInt(start,dataSize),hexToInt(end,dataSize));for(var i=1;i<subitemsCount;i++)incHex(end,dataSize),stream.readHexNumber(start,dataSize),addHex(start,end,dataSize),stream.readHexNumber(end,dataSize),addHex(end,start,dataSize),cMap.addCodespaceRange(1+dataSize,hexToInt(start,dataSize),hexToInt(end,dataSize));break;case 1:stream.readHex(start,dataSize),stream.readHexNumber(end,dataSize),addHex(end,start,dataSize),stream.readNumber();for(var _i13=1;_i13<subitemsCount;_i13++)incHex(end,dataSize),stream.readHexNumber(start,dataSize),addHex(start,end,dataSize),stream.readHexNumber(end,dataSize),addHex(end,start,dataSize),stream.readNumber();break;case 2:stream.readHex(char,dataSize),code=stream.readNumber(),cMap.mapOne(hexToInt(char,dataSize),code);for(var _i14=1;_i14<subitemsCount;_i14++)incHex(char,dataSize),sequence||(stream.readHexNumber(tmp,dataSize),addHex(char,tmp,dataSize)),code=stream.readSigned()+(code+1),cMap.mapOne(hexToInt(char,dataSize),code);break;case 3:stream.readHex(start,dataSize),stream.readHexNumber(end,dataSize),addHex(end,start,dataSize),code=stream.readNumber(),cMap.mapCidRange(hexToInt(start,dataSize),hexToInt(end,dataSize),code);for(var _i15=1;_i15<subitemsCount;_i15++)incHex(end,dataSize),sequence?start.set(end):(stream.readHexNumber(start,dataSize),addHex(start,end,dataSize)),stream.readHexNumber(end,dataSize),addHex(end,start,dataSize),code=stream.readNumber(),cMap.mapCidRange(hexToInt(start,dataSize),hexToInt(end,dataSize),code);break;case 4:stream.readHex(char,1),stream.readHex(charCode,dataSize),cMap.mapOne(hexToInt(char,1),hexToStr(charCode,dataSize));for(var _i16=1;_i16<subitemsCount;_i16++)incHex(char,1),sequence||(stream.readHexNumber(tmp,1),addHex(char,tmp,1)),incHex(charCode,dataSize),stream.readHexSigned(tmp,dataSize),addHex(charCode,tmp,dataSize),cMap.mapOne(hexToInt(char,1),hexToStr(charCode,dataSize));break;case 5:stream.readHex(start,1),stream.readHexNumber(end,1),addHex(end,start,1),stream.readHex(charCode,dataSize),cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,dataSize));for(var _i17=1;_i17<subitemsCount;_i17++)incHex(end,1),sequence?start.set(end):(stream.readHexNumber(start,1),addHex(start,end,1)),stream.readHexNumber(end,1),addHex(end,start,1),stream.readHex(charCode,dataSize),cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,dataSize));break;default:throw new Error("BinaryCMapReader.process - unknown type: ".concat(type))}}}return useCMap?extend(useCMap):cMap}}class Ascii85Stream extends DecodeStream{constructor(str,maybeLength){maybeLength&&(maybeLength*=.8),super(maybeLength),this.str=str,this.dict=str.dict,this.input=new Uint8Array(5)}readBlock(){for(var str=this.str,c=str.getByte();isWhiteSpace(c);)c=str.getByte();if(-1===c||126===c)this.eof=!0;else{var buffer,bufferLength=this.bufferLength;if(122===c){for(buffer=this.ensureBuffer(bufferLength+4),i=0;i<4;++i)buffer[bufferLength+i]=0;this.bufferLength+=4}else{var input=this.input;for(input[0]=c,i=1;i<5;++i){for(c=str.getByte();isWhiteSpace(c);)c=str.getByte();if(-1===(input[i]=c)||126===c)break}if(buffer=this.ensureBuffer(bufferLength+i-1),this.bufferLength+=i-1,i<5){for(;i<5;++i)input[i]=117;this.eof=!0}for(var t=0,i=0;i<5;++i)t=85*t+(input[i]-33);for(i=3;0<=i;--i)buffer[bufferLength+i]=255&t,t>>=8}}}}class AsciiHexStream extends DecodeStream{constructor(str,maybeLength){maybeLength&&(maybeLength*=.5),super(maybeLength),this.str=str,this.dict=str.dict,this.firstDigit=-1}readBlock(){var bytes=this.str.getBytes(8e3);if(bytes.length){var _ch,maxDecodeLength=bytes.length+1>>1,buffer=this.ensureBuffer(this.bufferLength+maxDecodeLength),bufferLength=this.bufferLength,firstDigit=this.firstDigit;for(_ch of bytes){var digit=void 0;if(48<=_ch&&_ch<=57)digit=15&_ch;else{if(!(65<=_ch&&_ch<=70||97<=_ch&&_ch<=102)){if(62!==_ch)continue;this.eof=!0;break}digit=9+(15&_ch)}firstDigit=firstDigit<0?digit:(buffer[bufferLength++]=firstDigit<<4|digit,-1)}0<=firstDigit&&this.eof&&(buffer[bufferLength++]=firstDigit<<4,firstDigit=-1),this.firstDigit=firstDigit,this.bufferLength=bufferLength}else this.eof=!0}}var ccittEOL=-2,ccittEOF=-1,twoDimPass=0,twoDimHoriz=1,twoDimVert0=2,twoDimVertR1=3,twoDimVertL1=4,twoDimVertR2=5,twoDimVertL2=6,twoDimVertR3=7,twoDimVertL3=8,twoDimTable=[[-1,-1],[-1,-1],[7,twoDimVertL3],[7,twoDimVertR3],[6,twoDimVertL2],[6,twoDimVertL2],[6,twoDimVertR2],[6,twoDimVertR2],[4,twoDimPass],[4,twoDimPass],[4,twoDimPass],[4,twoDimPass],[4,twoDimPass],[4,twoDimPass],[4,twoDimPass],[4,twoDimPass],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimHoriz],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertL1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[3,twoDimVertR1],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0],[1,twoDimVert0]],whiteTable1=[[-1,-1],[12,ccittEOL],[-1,-1],[-1,-1],[-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]],whiteTable2=[[-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]],blackTable1=[[-1,-1],[-1,-1],[12,ccittEOL],[12,ccittEOL],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-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]],blackTable2=[[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]],blackTable3=[[-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(source){var code1,options=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof(null==source?void 0:source.next))throw new Error('CCITTFaxDecoder - invalid "source" parameter.');for(this.source=source,this.eof=!1,this.encoding=options.K||0,this.eoline=options.EndOfLine||!1,this.byteAlign=options.EncodedByteAlign||!1,this.columns=options.Columns||1728,this.rows=options.Rows||0,this.eoblock=null==(source=options.EndOfBlock)||source,this.black=options.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;0===(code1=this._lookBits(12));)this._eatBits(1);1===code1&&this._eatBits(12),0<this.encoding&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;var refPos,blackPixels,bits,i,code1,code2,code3,c,refLine=this.refLine,codingLine=this.codingLine,columns=this.columns;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;if(this.err=!1,this.nextLine2D){for(i=0;codingLine[i]<columns;++i)refLine[i]=codingLine[i];for(refLine[i++]=columns,refLine[i]=columns,codingLine[0]=0,blackPixels=refPos=this.codingPos=0;codingLine[this.codingPos]<columns;)switch(code1=this._getTwoDimCode()){case twoDimPass:this._addPixels(refLine[refPos+1],blackPixels),refLine[refPos+1]<columns&&(refPos+=2);break;case twoDimHoriz:if(code1=code2=0,blackPixels){for(;code1+=code3=this._getBlackCode(),64<=code3;);for(;code2+=code3=this._getWhiteCode(),64<=code3;);}else{for(;code1+=code3=this._getWhiteCode(),64<=code3;);for(;code2+=code3=this._getBlackCode(),64<=code3;);}for(this._addPixels(codingLine[this.codingPos]+code1,blackPixels),codingLine[this.codingPos]<columns&&this._addPixels(codingLine[this.codingPos]+code2,1^blackPixels);refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVertR3:if(this._addPixels(refLine[refPos]+3,blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVertR2:if(this._addPixels(refLine[refPos]+2,blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVertR1:if(this._addPixels(refLine[refPos]+1,blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVert0:if(this._addPixels(refLine[refPos],blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVertL3:if(this._addPixelsNeg(refLine[refPos]-3,blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(0<refPos?--refPos:++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVertL2:if(this._addPixelsNeg(refLine[refPos]-2,blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(0<refPos?--refPos:++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case twoDimVertL1:if(this._addPixelsNeg(refLine[refPos]-1,blackPixels),blackPixels^=1,codingLine[this.codingPos]<columns)for(0<refPos?--refPos:++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case ccittEOF:this._addPixels(columns,0),this.eof=!0;break;default:info("bad 2d code"),this._addPixels(columns,0),this.err=!0}}else for(codingLine[0]=0,blackPixels=this.codingPos=0;codingLine[this.codingPos]<columns;){if(code1=0,blackPixels)for(;code1+=code3=this._getBlackCode(),64<=code3;);else for(;code1+=code3=this._getWhiteCode(),64<=code3;);this._addPixels(codingLine[this.codingPos]+code1,blackPixels),blackPixels^=1}var gotEOL=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(code1=this._lookBits(12),this.eoline)for(;code1!==ccittEOF&&1!==code1;)this._eatBits(1),code1=this._lookBits(12);else for(;0===code1;)this._eatBits(1),code1=this._lookBits(12);1===code1?(this._eatBits(12),gotEOL=!0):code1===ccittEOF&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&0<this.encoding&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&gotEOL&&this.byteAlign){if(1===(code1=this._lookBits(12))){if(this._eatBits(12),0<this.encoding&&(this._lookBits(1),this._eatBits(1)),0<=this.encoding)for(i=0;i<4;++i)1!==(code1=this._lookBits(12))&&info("bad rtc code: "+code1),this._eatBits(12),0<this.encoding&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if((code1=this._lookBits(13))===ccittEOF)return this.eof=!0,-1;if(code1>>1==1)break;this._eatBits(1)}this._eatBits(12),0<this.encoding&&(this._eatBits(1),this.nextLine2D=!(1&code1))}this.outputBits=0<codingLine[0]?codingLine[this.codingPos=0]:codingLine[this.codingPos=1],this.row++}if(8<=this.outputBits)c=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&codingLine[this.codingPos]<columns&&(this.codingPos++,this.outputBits=codingLine[this.codingPos]-codingLine[this.codingPos-1]);else{bits=8,c=0;do{if("number"!=typeof this.outputBits)throw new FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.')}while(this.outputBits>bits?(c<<=bits,1&this.codingPos||(c|=255>>8-bits),this.outputBits-=bits,bits=0):(c<<=this.outputBits,1&this.codingPos||(c|=255>>8-this.outputBits),bits-=this.outputBits,this.outputBits=0,codingLine[this.codingPos]<columns?(this.codingPos++,this.outputBits=codingLine[this.codingPos]-codingLine[this.codingPos-1]):0<bits&&(c<<=bits,bits=0)),bits)}return this.black&&(c^=255),c}_addPixels(a1,blackPixels){var codingLine=this.codingLine,codingPos=this.codingPos;a1>codingLine[codingPos]&&(a1>this.columns&&(info("row is wrong length"),this.err=!0,a1=this.columns),1&codingPos^blackPixels&&++codingPos,codingLine[codingPos]=a1),this.codingPos=codingPos}_addPixelsNeg(a1,blackPixels){var codingLine=this.codingLine,codingPos=this.codingPos;if(a1>codingLine[codingPos])a1>this.columns&&(info("row is wrong length"),this.err=!0,a1=this.columns),1&codingPos^blackPixels&&++codingPos,codingLine[codingPos]=a1;else if(a1<codingLine[codingPos]){for(a1<0&&(info("invalid code"),this.err=!0,a1=0);0<codingPos&&a1<codingLine[codingPos-1];)--codingPos;codingLine[codingPos]=a1}this.codingPos=codingPos}_findTableCode(start,end,table,limit){for(var limitValue=limit||0,i=start;i<=end;++i){var code=this._lookBits(i);if(code===ccittEOF)return[!0,1,!1];if(i<end&&(code<<=end-i),!limitValue||limitValue<=code){code=table[code-limitValue];if(code[0]===i)return this._eatBits(i),[!0,code[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){if(this.eoblock){var code=this._lookBits(7);if(0<(null==(code=twoDimTable[code])?void 0:code[0]))return this._eatBits(code[0]),code[1]}else{code=this._findTableCode(1,7,twoDimTable);if(code[0]&&code[2])return code[1]}return info("Bad two dim code"),ccittEOF}_getWhiteCode(){if(this.eoblock){if((code=this._lookBits(12))===ccittEOF)return 1;if(0<(code=code>>5==0?whiteTable1[code]:whiteTable2[code>>3])[0])return this._eatBits(code[0]),code[1]}else{var code=this._findTableCode(1,9,whiteTable2);if(code[0])return code[1];if((code=this._findTableCode(11,12,whiteTable1))[0])return code[1]}return info("bad white code"),this._eatBits(1),1}_getBlackCode(){if(this.eoblock){if((code=this._lookBits(13))===ccittEOF)return 1;if(0<(code=code>>7==0?blackTable1[code]:code>>9==0&&code>>7!=0?blackTable2[(code>>1)-64]:blackTable3[code>>7])[0])return this._eatBits(code[0]),code[1]}else{var code=this._findTableCode(2,6,blackTable3);if(code[0])return code[1];if((code=this._findTableCode(7,12,blackTable2,64))[0])return code[1];if((code=this._findTableCode(10,13,blackTable1))[0])return code[1]}return info("bad black code"),this._eatBits(1),1}_lookBits(n){for(var c;this.inputBits<n;){if(-1===(c=this.source.next()))return 0===this.inputBits?ccittEOF:this.inputBuf<<n-this.inputBits&65535>>16-n;this.inputBuf=this.inputBuf<<8|c,this.inputBits+=8}return this.inputBuf>>this.inputBits-n&65535>>16-n}_eatBits(n){(this.inputBits-=n)<0&&(this.inputBits=0)}}class CCITTFaxStream extends DecodeStream{constructor(str,maybeLength,params){super(maybeLength),this.str=str,this.dict=str.dict,params instanceof Dict||(params=Dict.empty);maybeLength={next(){return str.getByte()}};this.ccittFaxDecoder=new CCITTFaxDecoder(maybeLength,{K:params.get("K"),EndOfLine:params.get("EndOfLine"),EncodedByteAlign:params.get("EncodedByteAlign"),Columns:params.get("Columns"),Rows:params.get("Rows"),EndOfBlock:params.get("EndOfBlock"),BlackIs1:params.get("BlackIs1")})}readBlock(){for(;!this.eof;){var c=this.ccittFaxDecoder.readNextChar();if(-1===c)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=c}}}var codeLenCodeMap=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lengthDecode=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]),distDecode=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]),fixedLitCodeTab=[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],fixedDistCodeTab=[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],_FlateStream_brand=new WeakSet;class FlateStream extends DecodeStream{constructor(str,maybeLength){super(maybeLength),_classPrivateMethodInitSpec(this,_FlateStream_brand),this.str=str,this.dict=str.dict;maybeLength=str.getByte(),str=str.getByte();if(-1===maybeLength||-1===str)throw new FormatError("Invalid header in flate stream: ".concat(maybeLength,", ").concat(str));if(8!=(15&maybeLength))throw new FormatError("Unknown compression method in flate stream: ".concat(maybeLength,", ").concat(str));if(((maybeLength<<8)+str)%31!=0)throw new FormatError("Bad FCHECK in flate stream: ".concat(maybeLength,", ").concat(str));if(32&str)throw new FormatError("FDICT bit set in flate stream: ".concat(maybeLength,", ").concat(str));this.codeSize=0,this.codeBuf=0}async getImageData(length,_decoderOptions){var data=await this.asyncGetBytes();return data?data.length<=length?data:data.subarray(0,length):this.getBytes(length)}async asyncGetBytes(){this.str.reset();var bytes=this.str.getBytes();try{var chunk,{readable,writable}=new DecompressionStream("deflate"),writer=writable.getWriter(),chunks=(await writer.ready,writer.write(bytes).then(async()=>{await writer.ready,await writer.close()}).catch(()=>{}),[]),totalLength=0;for await(chunk of readable)chunks.push(chunk),totalLength+=chunk.byteLength;var _chunk2,data=new Uint8Array(totalLength),offset=0;for(_chunk2 of chunks)data.set(_chunk2,offset),offset+=_chunk2.byteLength;return data}catch(_unused6){return this.str=new Stream(bytes,2,bytes.length,this.str.dict),this.reset(),null}}get isAsync(){return!0}getBits(bits){for(var b,str=this.str,codeSize=this.codeSize,codeBuf=this.codeBuf;codeSize<bits;){if(-1===(b=str.getByte()))throw new FormatError("Bad encoding in flate stream");codeBuf|=b<<codeSize,codeSize+=8}return b=codeBuf&(1<<bits)-1,this.codeBuf=codeBuf>>bits,this.codeSize=codeSize-=bits,b}getCode(table){for(var b,str=this.str,codes=table[0],maxLen=table[1],codeSize=this.codeSize,codeBuf=this.codeBuf;codeSize<maxLen&&-1!==(b=str.getByte());)codeBuf|=b<<codeSize,codeSize+=8;table=codes[codeBuf&(1<<maxLen)-1],codes=table>>16,table&=65535;if(codes<1||codeSize<codes)throw new FormatError("Bad encoding in flate stream");return this.codeBuf=codeBuf>>codes,this.codeSize=codeSize-codes,table}generateHuffmanTable(lengths){var n=lengths.length,maxLen=0;for(i=0;i<n;++i)lengths[i]>maxLen&&(maxLen=lengths[i]);for(var size=1<<maxLen,codes=new Int32Array(size),len=1,code=0,skip=2;len<=maxLen;++len,code<<=1,skip<<=1)for(var val=0;val<n;++val)if(lengths[val]===len){for(var code2=0,t=code,i=0;i<len;++i)code2=code2<<1|1&t,t>>=1;for(i=code2;i<size;i+=skip)codes[i]=len<<16|val;++code}return[codes,maxLen]}readBlock(){var hdr,litCodeTable,distCodeTable,str=this.str;try{hdr=this.getBits(3)}catch(ex){return void _assertClassBrand(_FlateStream_brand,this,_endsStreamOnError).call(this,ex.message)}if(1&hdr&&(this.eof=!0),0===(hdr>>=1))if(-1===(b=str.getByte()))_assertClassBrand(_FlateStream_brand,this,_endsStreamOnError).call(this,"Bad block header in flate stream");else{var blockLen=b;if(-1===(b=str.getByte()))_assertClassBrand(_FlateStream_brand,this,_endsStreamOnError).call(this,"Bad block header in flate stream");else if(blockLen|=b<<8,-1===(b=str.getByte()))_assertClassBrand(_FlateStream_brand,this,_endsStreamOnError).call(this,"Bad block header in flate stream");else{var check=b;if(-1===(b=str.getByte()))_assertClassBrand(_FlateStream_brand,this,_endsStreamOnError).call(this,"Bad block header in flate stream");else{if((check|=b<<8)!=(65535&~blockLen)&&(0!=blockLen||0!=check))throw new FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var b=this.bufferLength,check=b+blockLen,buffer=this.ensureBuffer(check);this.bufferLength=check,0==blockLen?-1===str.peekByte()&&(this.eof=!0):(check=str.getBytes(blockLen),buffer.set(check,b),check.length<blockLen&&(this.eof=!0))}}}else{if(1===hdr)litCodeTable=fixedLitCodeTab,distCodeTable=fixedDistCodeTab;else{if(2!==hdr)throw new FormatError("Unknown block type in flate stream");for(var str=this.getBits(5)+257,b=this.getBits(5)+1,numCodeLenCodes=this.getBits(4)+4,codeLenCodeLengths=new Uint8Array(codeLenCodeMap.length),i=0;i<numCodeLenCodes;++i)codeLenCodeLengths[codeLenCodeMap[i]]=this.getBits(3);var codeLenCodeTab=this.generateHuffmanTable(codeLenCodeLengths),len=0;i=0;for(var bitsLength,bitsOffset,what,codes=str+b,codeLengths=new Uint8Array(codes);i<codes;){var code=this.getCode(codeLenCodeTab);if(16===code)bitsLength=2,bitsOffset=3,what=len;else{if(17===code)bitsOffset=bitsLength=3;else{if(18!==code){codeLengths[i++]=len=code;continue}bitsLength=7,bitsOffset=11}what=len=0}for(var repeatLength=this.getBits(bitsLength)+bitsOffset;0<repeatLength--;)codeLengths[i++]=what}litCodeTable=this.generateHuffmanTable(codeLengths.subarray(0,str)),distCodeTable=this.generateHuffmanTable(codeLengths.subarray(str,codes))}for(var limit=(buffer=this.buffer)?buffer.length:0,pos=this.bufferLength;;)if((code1=this.getCode(litCodeTable))<256)limit<=pos+1&&(limit=(buffer=this.ensureBuffer(pos+1)).length),buffer[pos++]=code1;else{if(256===code1)return void(this.bufferLength=pos);var code1,code2=(code1=lengthDecode[code1-=257])>>16,dist=(len=(65535&code1)+(code2=0<code2?this.getBits(code2):code2),code1=this.getCode(distCodeTable),(65535&(code1=distDecode[code1]))+(code2=0<(code2=code1>>16)?this.getBits(code2):code2));limit<=pos+len&&(limit=(buffer=this.ensureBuffer(pos+len)).length);for(var k=0;k<len;++k,++pos)buffer[pos]=buffer[pos-dist]}}}}function _endsStreamOnError(err){info(err),this.eof=!0}var QeTable=[{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(data,start,end){this.data=data,this.bp=start,this.dataEnd=end,this.chigh=data[start],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(){var data=this.data,bp=this.bp;255===data[bp]?143<data[bp+1]?(this.clow+=65280,this.ct=8):(this.clow+=data[++bp]<<9,this.ct=7,this.bp=bp):(this.clow+=++bp<this.dataEnd?data[bp]<<8:65280,this.ct=8,this.bp=bp),65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(contexts,pos){var d,cx_index=contexts[pos]>>1,cx_mps=1&contexts[pos],qeTableIcx=QeTable[cx_index],qeIcx=qeTableIcx.qe,a=this.a-qeIcx;if(this.chigh<qeIcx)cx_index=a<qeIcx?(a=qeIcx,d=cx_mps,qeTableIcx.nmps):(a=qeIcx,d=1^cx_mps,1===qeTableIcx.switchFlag&&(cx_mps=d),qeTableIcx.nlps);else{if(this.chigh-=qeIcx,0!=(32768&a))return this.a=a,cx_mps;cx_index=a<qeIcx?(d=1^cx_mps,1===qeTableIcx.switchFlag&&(cx_mps=d),qeTableIcx.nlps):(d=cx_mps,qeTableIcx.nmps)}for(;0===this.ct&&this.byteIn(),a<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--,0==(32768&a););return this.a=a,contexts[pos]=cx_index<<1|cx_mps,d}}class Jbig2Error extends BaseException{constructor(msg){super(msg,"Jbig2Error")}}class ContextCache{getContexts(id){return id in this?this[id]:this[id]=new Int8Array(65536)}}class DecodingContext{constructor(data,start,end){this.data=data,this.start=start,this.end=end}get decoder(){return shadow(this,"decoder",new ArithmeticDecoder(this.data,this.start,this.end))}get contextCache(){return shadow(this,"contextCache",new ContextCache)}}function decodeInteger(contextCache,procedure,decoder){var contexts=contextCache.getContexts(procedure),prev=1;function readBits(length){for(var v=0,i=0;i<length;i++){var bit=decoder.readBit(contexts,prev);prev=prev<256?prev<<1|bit:511&(prev<<1|bit)|256,v=v<<1|bit}return v>>>0}var signedValue,contextCache=readBits(1),procedure=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);return 0===contextCache?signedValue=procedure:0<procedure&&(signedValue=-procedure),MIN_INT_32<=signedValue&&signedValue<=MAX_INT_32?signedValue:null}function decodeIAID(contextCache,decoder,codeLength){for(var contexts=contextCache.getContexts("IAID"),prev=1,i=0;i<codeLength;i++)prev=prev<<1|decoder.readBit(contexts,prev);return codeLength<31?prev&(1<<codeLength)-1:2147483647&prev}var SegmentTypes=["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"],CodingTemplates=[[{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}]],RefinementTemplates=[{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}]}],ReusedContexts=[39717,1941,229,405],RefinementReusedContexts=[32,8];function decodeBitmapTemplate0(width,height,decodingContext){for(var contextLabel,j,pixel,row,row1,row2,decoder=decodingContext.decoder,contexts=decodingContext.contextCache.getContexts("GB"),bitmap=[],i=0;i<height;i++)for(row=bitmap[i]=new Uint8Array(width),contextLabel=(row2=i<2?row:bitmap[i-2])[0]<<13|row2[1]<<12|row2[2]<<11|(row1=i<1?row:bitmap[i-1])[0]<<7|row1[1]<<6|row1[2]<<5|row1[3]<<4,j=0;j<width;j++)row[j]=pixel=decoder.readBit(contexts,contextLabel),contextLabel=(31735&contextLabel)<<1|(j+3<width?row2[j+3]<<11:0)|(j+4<width?row1[j+4]<<4:0)|pixel;return bitmap}function decodeBitmap(mmr,width,height,templateIndex,prediction,skip,at,decodingContext){if(mmr)return decodeMMRBitmap(new Reader(decodingContext.data,decodingContext.start,decodingContext.end),width,height,!1);if(0===templateIndex&&!skip&&!prediction&&4===at.length&&3===at[0].x&&-1===at[0].y&&-3===at[1].x&&-1===at[1].y&&2===at[2].x&&-2===at[2].y&&-2===at[3].x&&-2===at[3].y)return decodeBitmapTemplate0(width,height,decodingContext);for(var useskip=!!skip,template=CodingTemplates[templateIndex].concat(at),templateLength=(template.sort((a,b)=>a.y-b.y||a.x-b.x),template.length),templateX=new Int8Array(templateLength),templateY=new Int8Array(templateLength),changingTemplateEntries=[],reuseMask=0,minX=0,maxX=0,minY=0,k=0;k<templateLength;k++)templateX[k]=template[k].x,templateY[k]=template[k].y,minX=Math.min(minX,template[k].x),maxX=Math.max(maxX,template[k].x),minY=Math.min(minY,template[k].y),k<templateLength-1&&template[k].y===template[k+1].y&&template[k].x===template[k+1].x-1?reuseMask|=1<<templateLength-1-k:changingTemplateEntries.push(k);for(var changingEntriesLength=changingTemplateEntries.length,changingTemplateX=new Int8Array(changingEntriesLength),changingTemplateY=new Int8Array(changingEntriesLength),changingTemplateBit=new Uint16Array(changingEntriesLength),c=0;c<changingEntriesLength;c++)changingTemplateX[c]=template[k=changingTemplateEntries[c]].x,changingTemplateY[c]=template[k].y,changingTemplateBit[c]=1<<templateLength-1-k;for(var j,i0,j0,bit,shift,sbb_left=-minX,sbb_top=-minY,sbb_right=width-maxX,pseudoPixelContext=ReusedContexts[templateIndex],row=new Uint8Array(width),bitmap=[],decoder=decodingContext.decoder,contexts=decodingContext.contextCache.getContexts("GB"),ltp=0,contextLabel=0,i=0;i<height;i++){if(prediction)if(ltp^=decoder.readBit(contexts,pseudoPixelContext)){bitmap.push(row);continue}for(row=new Uint8Array(row),bitmap.push(row),j=0;j<width;j++)if(useskip&&skip[i][j])row[j]=0;else{if(sbb_left<=j&&j<sbb_right&&sbb_top<=i)for(contextLabel=contextLabel<<1&reuseMask,k=0;k<changingEntriesLength;k++)i0=i+changingTemplateY[k],j0=j+changingTemplateX[k],(bit=bitmap[i0][j0])&&(contextLabel|=bit=changingTemplateBit[k]);else for(shift=templateLength-1,k=contextLabel=0;k<templateLength;k++,shift--)0<=(j0=j+templateX[k])&&j0<width&&0<=(i0=i+templateY[k])&&(bit=bitmap[i0][j0])&&(contextLabel|=bit<<shift);var pixel=decoder.readBit(contexts,contextLabel);row[j]=pixel}}return bitmap}function decodeRefinement(width,height,templateIndex,referenceBitmap,offsetX,offsetY,prediction,at,decodingContext){var codingTemplate=RefinementTemplates[templateIndex].coding,codingTemplateLength=(codingTemplate=0===templateIndex?codingTemplate.concat([at[0]]):codingTemplate).length,codingTemplateX=new Int32Array(codingTemplateLength),codingTemplateY=new Int32Array(codingTemplateLength);for(k=0;k<codingTemplateLength;k++)codingTemplateX[k]=codingTemplate[k].x,codingTemplateY[k]=codingTemplate[k].y;var referenceTemplate=RefinementTemplates[templateIndex].reference,referenceTemplateLength=(referenceTemplate=0===templateIndex?referenceTemplate.concat([at[1]]):referenceTemplate).length,referenceTemplateX=new Int32Array(referenceTemplateLength),referenceTemplateY=new Int32Array(referenceTemplateLength);for(k=0;k<referenceTemplateLength;k++)referenceTemplateX[k]=referenceTemplate[k].x,referenceTemplateY[k]=referenceTemplate[k].y;for(var referenceWidth=referenceBitmap[0].length,referenceHeight=referenceBitmap.length,pseudoPixelContext=RefinementReusedContexts[templateIndex],bitmap=[],decoder=decodingContext.decoder,contexts=decodingContext.contextCache.getContexts("GR"),ltp=0,i=0;i<height;i++){if(prediction)if(ltp^=decoder.readBit(contexts,pseudoPixelContext))throw new Jbig2Error("prediction is not supported");var row=new Uint8Array(width);bitmap.push(row);for(var j=0;j<width;j++){for(var i0=void 0,j0=void 0,contextLabel=0,k=0;k<codingTemplateLength;k++)i0=i+codingTemplateY[k],j0=j+codingTemplateX[k],i0<0||j0<0||width<=j0?contextLabel<<=1:contextLabel=contextLabel<<1|bitmap[i0][j0];for(k=0;k<referenceTemplateLength;k++)i0=i+referenceTemplateY[k]-offsetY,j0=j+referenceTemplateX[k]-offsetX,i0<0||referenceHeight<=i0||j0<0||referenceWidth<=j0?contextLabel<<=1:contextLabel=contextLabel<<1|referenceBitmap[i0][j0];var pixel=decoder.readBit(contexts,contextLabel);row[j]=pixel}}return bitmap}function decodeSymbolDictionary(huffman,refinement,symbols,numberOfNewSymbols,numberOfExportedSymbols,huffmanTables,templateIndex,at,refinementTemplateIndex,refinementAt,decodingContext,huffmanInput){if(huffman&&refinement)throw new Jbig2Error("symbol refinement with Huffman is not supported");var tableB1,symbolWidths,newSymbols=[],currentHeight=0,symbolCodeLength=log2(symbols.length+numberOfNewSymbols),decoder=decodingContext.decoder,contextCache=decodingContext.contextCache;for(huffman&&(tableB1=getStandardTable(1),symbolWidths=[],symbolCodeLength=Math.max(symbolCodeLength,1));newSymbols.length<numberOfNewSymbols;){currentHeight+=huffman?huffmanTables.tableDeltaHeight.decode(huffmanInput):decodeInteger(contextCache,"IADH",decoder);for(var currentWidth=0,totalWidth=0,firstSymbol=huffman?symbolWidths.length:0;;){var deltaWidth=huffman?huffmanTables.tableDeltaWidth.decode(huffmanInput):decodeInteger(contextCache,"IADW",decoder);if(null===deltaWidth)break;totalWidth+=currentWidth+=deltaWidth;var numberOfInstances,rdx,rdy,deltaWidth=void 0;refinement?(deltaWidth=1<(numberOfInstances=decodeInteger(contextCache,"IAAI",decoder))?decodeTextRegion(huffman,refinement,currentWidth,currentHeight,0,numberOfInstances,1,symbols.concat(newSymbols),symbolCodeLength,0,0,1,0,huffmanTables,refinementTemplateIndex,refinementAt,decodingContext,0,huffmanInput):(numberOfInstances=decodeIAID(contextCache,decoder,symbolCodeLength),rdx=decodeInteger(contextCache,"IARDX",decoder),rdy=decodeInteger(contextCache,"IARDY",decoder),decodeRefinement(currentWidth,currentHeight,refinementTemplateIndex,numberOfInstances<symbols.length?symbols[numberOfInstances]:newSymbols[numberOfInstances-symbols.length],rdx,rdy,!1,refinementAt,decodingContext)),newSymbols.push(deltaWidth)):huffman?symbolWidths.push(currentWidth):(deltaWidth=decodeBitmap(!1,currentWidth,currentHeight,templateIndex,!1,null,at,decodingContext),newSymbols.push(deltaWidth))}if(huffman&&!refinement){var originalEnd,bitmapSize=huffmanTables.tableBitmapSize.decode(huffmanInput),collectiveBitmap=(huffmanInput.byteAlign(),void 0),numberOfSymbolsDecoded=(0===bitmapSize?collectiveBitmap=readUncompressedBitmap(huffmanInput,totalWidth,currentHeight):(originalEnd=huffmanInput.end,bitmapSize=huffmanInput.position+bitmapSize,huffmanInput.end=bitmapSize,collectiveBitmap=decodeMMRBitmap(huffmanInput,totalWidth,currentHeight,!1),huffmanInput.end=originalEnd,huffmanInput.position=bitmapSize),symbolWidths.length);if(firstSymbol===numberOfSymbolsDecoded-1)newSymbols.push(collectiveBitmap);else for(var xMax,_i18=void 0,y=void 0,xMin=0,symbolBitmap=void 0,_i18=firstSymbol;_i18<numberOfSymbolsDecoded;_i18++){for(xMax=xMin+symbolWidths[_i18],symbolBitmap=[],y=0;y<currentHeight;y++)symbolBitmap.push(collectiveBitmap[y].subarray(xMin,xMax));newSymbols.push(symbolBitmap),xMin=xMax}}}for(var i,ii,exportedSymbols=[],flags=[],currentFlag=!1,totalSymbolsLength=symbols.length+numberOfNewSymbols;flags.length<totalSymbolsLength;){for(var runLength=huffman?tableB1.decode(huffmanInput):decodeInteger(contextCache,"IAEX",decoder);runLength--;)flags.push(currentFlag);currentFlag=!currentFlag}for(i=0,ii=symbols.length;i<ii;i++)flags[i]&&exportedSymbols.push(symbols[i]);for(var j=0;j<numberOfNewSymbols;i++,j++)flags[i]&&exportedSymbols.push(newSymbols[j]);return exportedSymbols}function decodeTextRegion(huffman,refinement,width,height,defaultPixelValue,numberOfSymbolInstances,stripSize,inputSymbols,symbolCodeLength,transposed,dsOffset,referenceCorner,combinationOperator,huffmanTables,refinementTemplateIndex,refinementAt,decodingContext,logStripSize,huffmanInput){if(huffman&&refinement)throw new Jbig2Error("refinement with Huffman is not supported");for(var row,bitmap=[],i=0;i<height;i++)row=new Uint8Array(width),defaultPixelValue&&row.fill(defaultPixelValue),bitmap.push(row);var decoder=decodingContext.decoder,contextCache=decodingContext.contextCache,stripT=huffman?-huffmanTables.tableDeltaT.decode(huffmanInput):-decodeInteger(contextCache,"IADT",decoder),firstS=0;for(i=0;i<numberOfSymbolInstances;){stripT+=huffman?huffmanTables.tableDeltaT.decode(huffmanInput):decodeInteger(contextCache,"IADT",decoder);for(var currentS=firstS+=huffman?huffmanTables.tableFirstS.decode(huffmanInput):decodeInteger(contextCache,"IAFS",decoder);;){var currentT=0,currentT=stripSize*stripT+(currentT=1<stripSize?huffman?huffmanInput.readBits(logStripSize):decodeInteger(contextCache,"IAIT",decoder):currentT),symbolId=huffman?huffmanTables.symbolIDTable.decode(huffmanInput):decodeIAID(contextCache,decoder,symbolCodeLength),applyRefinement=refinement&&(huffman?huffmanInput.readBit():decodeInteger(contextCache,"IARI",decoder)),symbolBitmap=inputSymbols[symbolId],symbolWidth=symbolBitmap[0].length,symbolHeight=symbolBitmap.length,symbolId=(applyRefinement&&(symbolBitmap=decodeRefinement(symbolWidth+=symbolId=decodeInteger(contextCache,"IARDW",decoder),symbolHeight+=applyRefinement=decodeInteger(contextCache,"IARDH",decoder),refinementTemplateIndex,symbolBitmap,(symbolId>>1)+decodeInteger(contextCache,"IARDX",decoder),(applyRefinement>>1)+decodeInteger(contextCache,"IARDY",decoder),!1,refinementAt,decodingContext)),0),offsetT=(transposed?1&referenceCorner?symbolId=symbolHeight-1:currentS+=symbolHeight-1:1<referenceCorner?currentS+=symbolWidth-1:symbolId=symbolWidth-1,currentT-(1&referenceCorner?0:symbolHeight-1)),offsetS=currentS-(2&referenceCorner?symbolWidth-1:0),s2=void 0,t2=void 0,symbolRow=void 0;if(transposed){for(s2=0;s2<symbolHeight;s2++)if(row=bitmap[offsetS+s2]){var symbolRow=symbolBitmap[s2],maxWidth=Math.min(width-offsetT,symbolWidth);switch(combinationOperator){case 0:for(t2=0;t2<maxWidth;t2++)row[offsetT+t2]|=symbolRow[t2];break;case 2:for(t2=0;t2<maxWidth;t2++)row[offsetT+t2]^=symbolRow[t2];break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"))}}}else for(t2=0;t2<symbolHeight;t2++)if(row=bitmap[offsetT+t2])switch(symbolRow=symbolBitmap[t2],combinationOperator){case 0:for(s2=0;s2<symbolWidth;s2++)row[offsetS+s2]|=symbolRow[s2];break;case 2:for(s2=0;s2<symbolWidth;s2++)row[offsetS+s2]^=symbolRow[s2];break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"))}i++;applyRefinement=huffman?huffmanTables.tableDeltaS.decode(huffmanInput):decodeInteger(contextCache,"IADS",decoder);if(null===applyRefinement)break;currentS+=symbolId+applyRefinement+dsOffset}}return bitmap}function decodePatternDictionary(mmr,patternWidth,patternHeight,maxPatternIndex,template,decodingContext){var at=[];mmr||(at.push({x:-patternWidth,y:0}),0===template&&at.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));for(var collectiveBitmap=decodeBitmap(mmr,(maxPatternIndex+1)*patternWidth,patternHeight,template,!1,null,at,decodingContext),patterns=[],i=0;i<=maxPatternIndex;i++){for(var patternBitmap=[],xMin=patternWidth*i,xMax=xMin+patternWidth,y=0;y<patternHeight;y++)patternBitmap.push(collectiveBitmap[y].subarray(xMin,xMax));patterns.push(patternBitmap)}return patterns}function decodeHalftoneRegion(mmr,patterns,template,regionWidth,regionHeight,defaultPixelValue,enableSkip,combinationOperator,gridWidth,gridHeight,gridOffsetX,gridOffsetY,gridVectorX,gridVectorY,decodingContext){if(enableSkip)throw new Jbig2Error("skip is not supported");if(0!==combinationOperator)throw new Jbig2Error('operator "'.concat(combinationOperator,'" is not supported in halftone region'));var j,row,regionBitmap=[];for(i=0;i<regionHeight;i++)row=new Uint8Array(regionWidth),defaultPixelValue&&row.fill(defaultPixelValue),regionBitmap.push(row);var mmrInput,bitmap,mg,ng,bit,patternIndex,patternBitmap,x,y,patternRow,regionRow,enableSkip=patterns.length,combinationOperator=patterns[0],patternWidth=combinationOperator[0].length,patternHeight=combinationOperator.length,bitsPerValue=log2(enableSkip),at=[],grayScaleBitPlanes=(mmr||(at.push({x:template<=1?3:2,y:-1}),0===template&&at.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})),[]);for(mmr&&(mmrInput=new Reader(decodingContext.data,decodingContext.start,decodingContext.end)),i=bitsPerValue-1;0<=i;i--)bitmap=mmr?decodeMMRBitmap(mmrInput,gridWidth,gridHeight,!0):decodeBitmap(!1,gridWidth,gridHeight,template,!1,null,at,decodingContext),grayScaleBitPlanes[i]=bitmap;for(mg=0;mg<gridHeight;mg++)for(ng=0;ng<gridWidth;ng++){for(patternIndex=bit=0,j=bitsPerValue-1;0<=j;j--)patternIndex|=(bit^=grayScaleBitPlanes[j][mg][ng])<<j;if(patternBitmap=patterns[patternIndex],y=gridOffsetY+mg*gridVectorX-ng*gridVectorY>>8,0<=(x=gridOffsetX+mg*gridVectorY+ng*gridVectorX>>8)&&x+patternWidth<=regionWidth&&0<=y&&y+patternHeight<=regionHeight)for(i=0;i<patternHeight;i++)for(regionRow=regionBitmap[y+i],patternRow=patternBitmap[i],j=0;j<patternWidth;j++)regionRow[x+j]|=patternRow[j];else for(var regionX,regionY,i=0;i<patternHeight;i++)if(!((regionY=y+i)<0||regionHeight<=regionY))for(regionRow=regionBitmap[regionY],patternRow=patternBitmap[i],j=0;j<patternWidth;j++)0<=(regionX=x+j)&®ionX<regionWidth&&(regionRow[regionX]|=patternRow[j])}return regionBitmap}function readSegmentHeader(data,start){var segmentHeader={},flags=(segmentHeader.number=readUint32(data,start),data[start+4]),segmentType=63&flags;if(!SegmentTypes[segmentType])throw new Jbig2Error("invalid segment type: "+segmentType);segmentHeader.type=segmentType,segmentHeader.typeName=SegmentTypes[segmentType],segmentHeader.deferredNonRetain=!!(128&flags);var flags=!!(64&flags),referredFlags=data[start+5],referredToCount=referredFlags>>5&7,retainBits=[31&referredFlags],position=start+6;if(7===referredFlags){referredToCount=536870911&readUint32(data,position-1),position+=3;var bytes=referredToCount+7>>3;for(retainBits[0]=data[position++];0<--bytes;)retainBits.push(data[position++])}else if(5===referredFlags||6===referredFlags)throw new Jbig2Error("invalid referred-to flags");segmentHeader.retainBits=retainBits;for(var ii,referredToSegmentNumberSize=4,referredTo=(segmentHeader.number<=256?referredToSegmentNumberSize=1:segmentHeader.number<=65536&&(referredToSegmentNumberSize=2),[]),i=0;i<referredToCount;i++){var number=void 0,number=1===referredToSegmentNumberSize?data[position]:(2===referredToSegmentNumberSize?readUint16:readUint32)(data,position);referredTo.push(number),position+=referredToSegmentNumberSize}if(segmentHeader.referredTo=referredTo,flags?(segmentHeader.pageAssociation=readUint32(data,position),position+=4):segmentHeader.pageAssociation=data[position++],segmentHeader.length=readUint32(data,position),position+=4,4294967295===segmentHeader.length){if(38!=segmentType)throw new Jbig2Error("invalid unknown segment length");var start=readRegionSegmentInformation(data,position),referredFlags=!!(1&data[position+RegionSegmentInformationFieldLength]),searchPattern=new Uint8Array(6);for(referredFlags||(searchPattern[0]=255,searchPattern[1]=172),searchPattern[2]=start.height>>>24&255,searchPattern[3]=start.height>>16&255,searchPattern[4]=start.height>>8&255,searchPattern[5]=255&start.height,i=position,ii=data.length;i<ii;i++){for(var j=0;j<6&&searchPattern[j]===data[i+j];)j++;if(6===j){segmentHeader.length=i+6;break}}if(4294967295===segmentHeader.length)throw new Jbig2Error("segment end was not found")}return segmentHeader.headerEnd=position,segmentHeader}function readSegments(header,data,start,end){for(var segments=[],position=start;position<end;){var segmentHeader=readSegmentHeader(data,position),position=segmentHeader.headerEnd,segment={header:segmentHeader,data:data};if(header.randomAccess||(segment.start=position,position+=segmentHeader.length,segment.end=position),segments.push(segment),51===segmentHeader.type)break}if(header.randomAccess)for(var i=0,ii=segments.length;i<ii;i++)segments[i].start=position,position+=segments[i].header.length,segments[i].end=position;return segments}function readRegionSegmentInformation(data,start){return{width:readUint32(data,start),height:readUint32(data,start+4),x:readUint32(data,start+8),y:readUint32(data,start+12),combinationOperator:7&data[start+16]}}var RegionSegmentInformationFieldLength=17;function processSegment(segment,visitor){var args,at,i,atLength,header=segment.header,data=segment.data,end=segment.end,position=segment.start;switch(header.type){case 0:var dictionary={},dictionaryFlags=readUint16(data,position);if(dictionary.huffman=!!(1&dictionaryFlags),dictionary.refinement=!!(2&dictionaryFlags),dictionary.huffmanDHSelector=dictionaryFlags>>2&3,dictionary.huffmanDWSelector=dictionaryFlags>>4&3,dictionary.bitmapSizeSelector=dictionaryFlags>>6&1,dictionary.aggregationInstancesSelector=dictionaryFlags>>7&1,dictionary.bitmapCodingContextUsed=!!(256&dictionaryFlags),dictionary.bitmapCodingContextRetained=!!(512&dictionaryFlags),dictionary.template=dictionaryFlags>>10&3,dictionary.refinementTemplate=dictionaryFlags>>12&1,position+=2,!dictionary.huffman){for(atLength=0===dictionary.template?4:1,at=[],i=0;i<atLength;i++)at.push({x:readInt8(data,position),y:readInt8(data,position+1)}),position+=2;dictionary.at=at}if(dictionary.refinement&&!dictionary.refinementTemplate){for(at=[],i=0;i<2;i++)at.push({x:readInt8(data,position),y:readInt8(data,position+1)}),position+=2;dictionary.refinementAt=at}dictionary.numberOfExportedSymbols=readUint32(data,position),dictionary.numberOfNewSymbols=readUint32(data,position+=4),args=[dictionary,header.number,header.referredTo,data,position+=4,end];break;case 6:case 7:var dictionaryFlags={},dictionary=(dictionaryFlags.info=readRegionSegmentInformation(data,position),readUint16(data,position+=RegionSegmentInformationFieldLength));if(position+=2,dictionaryFlags.huffman=!!(1&dictionary),dictionaryFlags.refinement=!!(2&dictionary),dictionaryFlags.logStripSize=dictionary>>2&3,dictionaryFlags.stripSize=1<<dictionaryFlags.logStripSize,dictionaryFlags.referenceCorner=dictionary>>4&3,dictionaryFlags.transposed=!!(64&dictionary),dictionaryFlags.combinationOperator=dictionary>>7&3,dictionaryFlags.defaultPixelValue=dictionary>>9&1,dictionaryFlags.dsOffset=dictionary<<17>>27,dictionaryFlags.refinementTemplate=dictionary>>15&1,dictionaryFlags.huffman&&(dictionary=readUint16(data,position),position+=2,dictionaryFlags.huffmanFS=3&dictionary,dictionaryFlags.huffmanDS=dictionary>>2&3,dictionaryFlags.huffmanDT=dictionary>>4&3,dictionaryFlags.huffmanRefinementDW=dictionary>>6&3,dictionaryFlags.huffmanRefinementDH=dictionary>>8&3,dictionaryFlags.huffmanRefinementDX=dictionary>>10&3,dictionaryFlags.huffmanRefinementDY=dictionary>>12&3,dictionaryFlags.huffmanRefinementSizeSelector=!!(16384&dictionary)),dictionaryFlags.refinement&&!dictionaryFlags.refinementTemplate){for(at=[],i=0;i<2;i++)at.push({x:readInt8(data,position),y:readInt8(data,position+1)}),position+=2;dictionaryFlags.refinementAt=at}dictionaryFlags.numberOfSymbolInstances=readUint32(data,position),args=[dictionaryFlags,header.referredTo,data,position+=4,end];break;case 16:dictionary={},dictionaryFlags=data[position++];dictionary.mmr=!!(1&dictionaryFlags),dictionary.template=dictionaryFlags>>1&3,dictionary.patternWidth=data[position++],dictionary.patternHeight=data[position++],dictionary.maxPatternIndex=readUint32(data,position),args=[dictionary,header.number,data,position+=4,end];break;case 22:case 23:dictionaryFlags={},dictionary=(dictionaryFlags.info=readRegionSegmentInformation(data,position),position+=RegionSegmentInformationFieldLength,data[position++]);dictionaryFlags.mmr=!!(1&dictionary),dictionaryFlags.template=dictionary>>1&3,dictionaryFlags.enableSkip=!!(8&dictionary),dictionaryFlags.combinationOperator=dictionary>>4&7,dictionaryFlags.defaultPixelValue=dictionary>>7&1,dictionaryFlags.gridWidth=readUint32(data,position),dictionaryFlags.gridHeight=readUint32(data,position+=4),dictionaryFlags.gridOffsetX=4294967295&readUint32(data,position+=4),dictionaryFlags.gridOffsetY=4294967295&readUint32(data,position+=4),dictionaryFlags.gridVectorX=readUint16(data,position+=4),dictionaryFlags.gridVectorY=readUint16(data,position+=2),args=[dictionaryFlags,header.referredTo,data,position+=2,end];break;case 38:case 39:dictionary={},dictionaryFlags=(dictionary.info=readRegionSegmentInformation(data,position),position+=RegionSegmentInformationFieldLength,data[position++]);if(dictionary.mmr=!!(1&dictionaryFlags),dictionary.template=dictionaryFlags>>1&3,dictionary.prediction=!!(8&dictionaryFlags),!dictionary.mmr){for(atLength=0===dictionary.template?4:1,at=[],i=0;i<atLength;i++)at.push({x:readInt8(data,position),y:readInt8(data,position+1)}),position+=2;dictionary.at=at}args=[dictionary,data,position,end];break;case 48:dictionaryFlags={width:readUint32(data,position),height:readUint32(data,position+4),resolutionX:readUint32(data,position+8),resolutionY:readUint32(data,position+12)},dictionary=(4294967295===dictionaryFlags.height&&delete dictionaryFlags.height,data[position+16]);readUint16(data,position+17),dictionaryFlags.lossless=!!(1&dictionary),dictionaryFlags.refinement=!!(2&dictionary),dictionaryFlags.defaultPixelValue=dictionary>>2&1,dictionaryFlags.combinationOperator=dictionary>>3&3,dictionaryFlags.requiresBuffer=!!(32&dictionary),dictionaryFlags.combinationOperatorOverride=!!(64&dictionary),args=[dictionaryFlags];break;case 49:case 50:case 51:break;case 53:args=[header.number,data,position,end];break;case 62:break;default:throw new Jbig2Error("segment type ".concat(header.typeName,"(").concat(header.type,") is not implemented"))}segment="on"+header.typeName;segment in visitor&&visitor[segment].apply(visitor,args)}function processSegments(segments,visitor){for(var i=0,ii=segments.length;i<ii;i++)processSegment(segments[i],visitor)}function parseJbig2Chunks(chunks){for(var visitor=new SimpleSegmentVisitor,i=0,ii=chunks.length;i<ii;i++){var chunk=chunks[i];processSegments(readSegments({},chunk.data,chunk.start,chunk.end),visitor)}return visitor.buffer}class SimpleSegmentVisitor{onPageInformation(info){var rowSize=(this.currentPageInfo=info).width+7>>3,rowSize=new Uint8ClampedArray(rowSize*info.height);info.defaultPixelValue&&rowSize.fill(255),this.buffer=rowSize}drawBitmap(regionInfo,bitmap){var i,j,mask,offset,pageInfo=this.currentPageInfo,width=regionInfo.width,height=regionInfo.height,rowSize=pageInfo.width+7>>3,combinationOperator=(pageInfo.combinationOperatorOverride?regionInfo:pageInfo).combinationOperator,buffer=this.buffer,mask0=128>>(7®ionInfo.x),offset0=regionInfo.y*rowSize+(regionInfo.x>>3);switch(combinationOperator){case 0:for(i=0;i<height;i++){for(mask=mask0,offset=offset0,j=0;j<width;j++)bitmap[i][j]&&(buffer[offset]|=mask),(mask>>=1)||(mask=128,offset++);offset0+=rowSize}break;case 2:for(i=0;i<height;i++){for(mask=mask0,offset=offset0,j=0;j<width;j++)bitmap[i][j]&&(buffer[offset]^=mask),(mask>>=1)||(mask=128,offset++);offset0+=rowSize}break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"))}}onImmediateGenericRegion(region,data,start,end){var regionInfo=region.info,data=new DecodingContext(data,start,end),start=decodeBitmap(region.mmr,regionInfo.width,regionInfo.height,region.template,region.prediction,null,region.at,data);this.drawBitmap(regionInfo,start)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(dictionary,currentSegment,referredSegments,data,start,end){dictionary.huffman&&(huffmanTables=getSymbolDictionaryHuffmanTables(dictionary,referredSegments,this.customTables),huffmanInput=new Reader(data,start,end));var huffmanTables,huffmanInput,referredSegment,symbols=this.symbols,inputSymbols=(symbols||(this.symbols=symbols={}),[]);for(referredSegment of referredSegments){var referredSymbols=symbols[referredSegment];referredSymbols&&inputSymbols.push(...referredSymbols)}referredSegments=new DecodingContext(data,start,end);symbols[currentSegment]=decodeSymbolDictionary(dictionary.huffman,dictionary.refinement,inputSymbols,dictionary.numberOfNewSymbols,dictionary.numberOfExportedSymbols,huffmanTables,dictionary.template,dictionary.at,dictionary.refinementTemplate,dictionary.refinementAt,referredSegments,huffmanInput)}onImmediateTextRegion(region,referredSegments,data,start,end){var huffmanTables,huffmanInput,referredSegment,regionInfo=region.info,symbols=this.symbols,inputSymbols=[];for(referredSegment of referredSegments){var referredSymbols=symbols[referredSegment];referredSymbols&&inputSymbols.push(...referredSymbols)}var symbolCodeLength=log2(inputSymbols.length),referredSegments=(region.huffman&&(huffmanInput=new Reader(data,start,end),huffmanTables=getTextRegionHuffmanTables(region,referredSegments,this.customTables,inputSymbols.length,huffmanInput)),new DecodingContext(data,start,end)),data=decodeTextRegion(region.huffman,region.refinement,regionInfo.width,regionInfo.height,region.defaultPixelValue,region.numberOfSymbolInstances,region.stripSize,inputSymbols,symbolCodeLength,region.transposed,region.dsOffset,region.referenceCorner,region.combinationOperator,huffmanTables,region.refinementTemplate,region.refinementAt,referredSegments,region.logStripSize,huffmanInput);this.drawBitmap(regionInfo,data)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(dictionary,currentSegment,data,start,end){var patterns=this.patterns,data=(patterns||(this.patterns=patterns={}),new DecodingContext(data,start,end));patterns[currentSegment]=decodePatternDictionary(dictionary.mmr,dictionary.patternWidth,dictionary.patternHeight,dictionary.maxPatternIndex,dictionary.template,data)}onImmediateHalftoneRegion(region,referredSegments,data,start,end){var referredSegments=this.patterns[referredSegments[0]],regionInfo=region.info,data=new DecodingContext(data,start,end),start=decodeHalftoneRegion(region.mmr,referredSegments,region.template,regionInfo.width,regionInfo.height,region.defaultPixelValue,region.enableSkip,region.combinationOperator,region.gridWidth,region.gridHeight,region.gridOffsetX,region.gridOffsetY,region.gridVectorX,region.gridVectorY,data);this.drawBitmap(regionInfo,start)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(currentSegment,data,start,end){var customTables=this.customTables;customTables||(this.customTables=customTables={}),customTables[currentSegment]=decodeTablesSegment(data,start,end)}}class HuffmanLine{constructor(lineData){2===lineData.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=lineData[0],this.rangeLength=0,this.prefixCode=lineData[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=lineData[0],this.prefixLength=lineData[1],this.rangeLength=lineData[2],this.prefixCode=lineData[3],this.isLowerRange="lower"===lineData[4])}}class HuffmanTreeNode{constructor(line){this.children=[],line?(this.isLeaf=!0,this.rangeLength=line.rangeLength,this.rangeLow=line.rangeLow,this.isLowerRange=line.isLowerRange,this.isOOB=line.isOOB):this.isLeaf=!1}buildTree(line,shift){var node,bit=line.prefixCode>>shift&1;shift<=0?this.children[bit]=new HuffmanTreeNode(line):((node=this.children[bit])||(this.children[bit]=node=new HuffmanTreeNode(null)),node.buildTree(line,shift-1))}decodeNode(reader){if(this.isLeaf)return this.isOOB?null:(htOffset=reader.readBits(this.rangeLength),this.rangeLow+(this.isLowerRange?-htOffset:htOffset));var htOffset=this.children[reader.readBit()];if(htOffset)return htOffset.decodeNode(reader);throw new Jbig2Error("invalid Huffman data")}}class HuffmanTable{constructor(lines,prefixCodesDone){prefixCodesDone||this.assignPrefixCodes(lines),this.rootNode=new HuffmanTreeNode(null);for(var i=0,ii=lines.length;i<ii;i++){var line=lines[i];0<line.prefixLength&&this.rootNode.buildTree(line,line.prefixLength-1)}}decode(reader){return this.rootNode.decodeNode(reader)}assignPrefixCodes(lines){for(var linesLength=lines.length,prefixLengthMax=0,i=0;i<linesLength;i++)prefixLengthMax=Math.max(prefixLengthMax,lines[i].prefixLength);for(var histogram=new Uint32Array(prefixLengthMax+1),_i19=0;_i19<linesLength;_i19++)histogram[lines[_i19].prefixLength]++;var currentCode,currentTemp,line,currentLength=1,firstCode=0;for(histogram[0]=0;currentLength<=prefixLengthMax;){for(currentCode=firstCode=firstCode+histogram[currentLength-1]<<1,currentTemp=0;currentTemp<linesLength;)(line=lines[currentTemp]).prefixLength===currentLength&&(line.prefixCode=currentCode,currentCode++),currentTemp++;currentLength++}}}function decodeTablesSegment(data,start,end){for(var prefixLength,rangeLength,flags=data[start],lowestValue=4294967295&readUint32(data,start+1),highestValue=4294967295&readUint32(data,start+5),reader=new Reader(data,start+9,end),prefixSizeBits=1+(flags>>1&7),rangeSizeBits=1+(flags>>4&7),lines=[],currentRangeLow=lowestValue;prefixLength=reader.readBits(prefixSizeBits),rangeLength=reader.readBits(rangeSizeBits),lines.push(new HuffmanLine([currentRangeLow,prefixLength,rangeLength,0])),(currentRangeLow+=1<<rangeLength)<highestValue;);return prefixLength=reader.readBits(prefixSizeBits),lines.push(new HuffmanLine([lowestValue-1,prefixLength,32,0,"lower"])),prefixLength=reader.readBits(prefixSizeBits),lines.push(new HuffmanLine([highestValue,prefixLength,32,0])),1&flags&&(prefixLength=reader.readBits(prefixSizeBits),lines.push(new HuffmanLine([prefixLength,0]))),new HuffmanTable(lines,!1)}var standardTablesCache={};function getStandardTable(number){var lines,table=standardTablesCache[number];if(!table){switch(number){case 1:lines=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:lines=[[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:lines=[[-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:lines=[[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:lines=[[-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:lines=[[-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:lines=[[-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:lines=[[-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:lines=[[-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:lines=[[-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:lines=[[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:lines=[[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:lines=[[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:lines=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:lines=[[-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.".concat(number," does not exist"))}for(var i=0,ii=lines.length;i<ii;i++)lines[i]=new HuffmanLine(lines[i]);table=new HuffmanTable(lines,!0),standardTablesCache[number]=table}return table}class Reader{constructor(data,start,end){this.data=data,this.start=start,this.end=end,this.position=start,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}var bit=this.currentByte>>this.shift&1;return this.shift--,bit}readBits(numBits){for(var result=0,i=numBits-1;0<=i;i--)result|=this.readBit()<<i;return result}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(index,referredTo,customTables){for(var currentIndex=0,i=0,ii=referredTo.length;i<ii;i++){var table=customTables[referredTo[i]];if(table){if(index===currentIndex)return table;currentIndex++}}throw new Jbig2Error("can't find custom Huffman table")}function getTextRegionHuffmanTables(textRegion,referredTo,customTables,numberOfSymbols,reader){for(var codes=[],i=0;i<=34;i++){var codeLength=reader.readBits(4);codes.push(new HuffmanLine([i,codeLength,0,0]))}for(var runCodesTable=new HuffmanTable(codes,!1),_i20=codes.length=0;_i20<numberOfSymbols;){var _codeLength=runCodesTable.decode(reader);if(32<=_codeLength){var repeatedLength=void 0,numberOfRepeats=void 0,j=void 0;switch(_codeLength){case 32:if(0===_i20)throw new Jbig2Error("no previous value in symbol ID table");numberOfRepeats=reader.readBits(2)+3,repeatedLength=codes[_i20-1].prefixLength;break;case 33:numberOfRepeats=reader.readBits(3)+3,repeatedLength=0;break;case 34:numberOfRepeats=reader.readBits(7)+11,repeatedLength=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(j=0;j<numberOfRepeats;j++)codes.push(new HuffmanLine([_i20,repeatedLength,0,0])),_i20++}else codes.push(new HuffmanLine([_i20,_codeLength,0,0])),_i20++}reader.byteAlign();var tableFirstS,tableDeltaS,tableDeltaT,symbolIDTable=new HuffmanTable(codes,!1),customIndex=0;switch(textRegion.huffmanFS){case 0:case 1:tableFirstS=getStandardTable(textRegion.huffmanFS+6);break;case 3:tableFirstS=getCustomHuffmanTable(customIndex,referredTo,customTables),customIndex++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(textRegion.huffmanDS){case 0:case 1:case 2:tableDeltaS=getStandardTable(textRegion.huffmanDS+8);break;case 3:tableDeltaS=getCustomHuffmanTable(customIndex,referredTo,customTables),customIndex++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(textRegion.huffmanDT){case 0:case 1:case 2:tableDeltaT=getStandardTable(textRegion.huffmanDT+11);break;case 3:tableDeltaT=getCustomHuffmanTable(customIndex,referredTo,customTables),customIndex++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(textRegion.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:symbolIDTable,tableFirstS:tableFirstS,tableDeltaS:tableDeltaS,tableDeltaT:tableDeltaT}}function getSymbolDictionaryHuffmanTables(dictionary,referredTo,customTables){var tableDeltaHeight,tableDeltaWidth,tableBitmapSize,customIndex=0;switch(dictionary.huffmanDHSelector){case 0:case 1:tableDeltaHeight=getStandardTable(dictionary.huffmanDHSelector+4);break;case 3:tableDeltaHeight=getCustomHuffmanTable(customIndex,referredTo,customTables),customIndex++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(dictionary.huffmanDWSelector){case 0:case 1:tableDeltaWidth=getStandardTable(dictionary.huffmanDWSelector+2);break;case 3:tableDeltaWidth=getCustomHuffmanTable(customIndex,referredTo,customTables),customIndex++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}return dictionary.bitmapSizeSelector?(tableBitmapSize=getCustomHuffmanTable(customIndex,referredTo,customTables),customIndex++):tableBitmapSize=getStandardTable(1),{tableDeltaHeight:tableDeltaHeight,tableDeltaWidth:tableDeltaWidth,tableBitmapSize:tableBitmapSize,tableAggregateInstances:dictionary.aggregationInstancesSelector?getCustomHuffmanTable(customIndex,referredTo,customTables):getStandardTable(1)}}function readUncompressedBitmap(reader,width,height){for(var bitmap=[],y=0;y<height;y++){var row=new Uint8Array(width);bitmap.push(row);for(var x=0;x<width;x++)row[x]=reader.readBit();reader.byteAlign()}return bitmap}function decodeMMRBitmap(input,width,height,endOfBlock){for(var currentByte,params={K:-1,Columns:width,Rows:height,BlackIs1:!0,EndOfBlock:endOfBlock},decoder=new CCITTFaxDecoder(input,params),bitmap=[],eof=!1,y=0;y<height;y++)for(var row=new Uint8Array(width),shift=(bitmap.push(row),-1),x=0;x<width;x++)shift<0&&(-1===(currentByte=decoder.readNextChar())&&(eof=!(currentByte=0)),shift=7),row[x]=currentByte>>shift&1,shift--;if(endOfBlock&&!eof)for(var i=0;i<5&&-1!==decoder.readNextChar();i++);return bitmap}class Jbig2Image{parseChunks(chunks){return parseJbig2Chunks(chunks)}parse(data){throw new Error("Not implemented: Jbig2Image.parse")}}class Jbig2Stream extends DecodeStream{constructor(stream,maybeLength,params){super(maybeLength),this.stream=stream,this.dict=stream.dict,this.maybeLength=maybeLength,this.params=params}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(requested){}readBlock(){this.decodeImage()}decodeImage(bytes){if(!this.eof){bytes=bytes||this.bytes;for(var globalsStream,jbig2Image=new Jbig2Image,chunks=[],data=(this.params instanceof Dict&&(globalsStream=this.params.get("JBIG2Globals"))instanceof BaseStream&&(globalsStream=globalsStream.getBytes(),chunks.push({data:globalsStream,start:0,end:globalsStream.length})),chunks.push({data:bytes,start:0,end:bytes.length}),jbig2Image.parseChunks(chunks)),dataLength=data.length,i=0;i<dataLength;i++)data[i]^=255;this.buffer=data,this.bufferLength=dataLength,this.eof=!0}return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class JpxStream extends DecodeStream{constructor(stream,maybeLength,params){super(maybeLength),this.stream=stream,this.dict=stream.dict,this.maybeLength=maybeLength,this.params=params}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(requested){}readBlock(decoderOptions){unreachable("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(bytes,decoderOptions){return this.eof||(bytes=bytes||this.bytes,this.buffer=await JpxImage.decode(bytes,decoderOptions),this.bufferLength=this.buffer.length,this.eof=!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class LZWStream extends DecodeStream{constructor(str,maybeLength,earlyChange){super(maybeLength),this.str=str,this.dict=str.dict,this.cachedData=0,this.bitsCached=0;for(var lzwState={earlyChange:earlyChange,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(4096),dictionaryLengths:new Uint16Array(4096),dictionaryPrevCodes:new Uint16Array(4096),currentSequence:new Uint8Array(4096),currentSequenceLength:0},i=0;i<256;++i)lzwState.dictionaryValues[i]=i,lzwState.dictionaryLengths[i]=1;this.lzwState=lzwState}readBits(n){for(var bitsCached=this.bitsCached,cachedData=this.cachedData;bitsCached<n;){var c=this.str.getByte();if(-1===c)return this.eof=!0,null;cachedData=cachedData<<8|c,bitsCached+=8}return this.bitsCached=bitsCached-=n,this.cachedData=cachedData,this.lastCode=null,cachedData>>>bitsCached&(1<<n)-1}readBlock(){var j,q,estimatedDecodedSize=1024,lzwState=this.lzwState;if(lzwState){for(var earlyChange=lzwState.earlyChange,nextCode=lzwState.nextCode,dictionaryValues=lzwState.dictionaryValues,dictionaryLengths=lzwState.dictionaryLengths,dictionaryPrevCodes=lzwState.dictionaryPrevCodes,codeLength=lzwState.codeLength,prevCode=lzwState.prevCode,currentSequence=lzwState.currentSequence,currentSequenceLength=lzwState.currentSequenceLength,decodedLength=0,currentBufferLength=this.bufferLength,buffer=this.ensureBuffer(this.bufferLength+estimatedDecodedSize),i=0;i<512;i++){var code=this.readBits(codeLength),hasPrev=0<currentSequenceLength;if(code<256)currentSequence[0]=code,currentSequenceLength=1;else{if(!(258<=code)){if(256===code){codeLength=9,nextCode=258,currentSequenceLength=0;continue}this.eof=!0,delete this.lzwState;break}if(code<nextCode)for(j=(currentSequenceLength=dictionaryLengths[code])-1,q=code;0<=j;j--)currentSequence[j]=dictionaryValues[q],q=dictionaryPrevCodes[q];else currentSequence[currentSequenceLength++]=currentSequence[0]}if(hasPrev&&(dictionaryPrevCodes[nextCode]=prevCode,dictionaryLengths[nextCode]=dictionaryLengths[prevCode]+1,dictionaryValues[nextCode]=currentSequence[0],codeLength=++nextCode+earlyChange&nextCode+earlyChange-1?codeLength:0|Math.min(Math.log(nextCode+earlyChange)/.6931471805599453+1,12)),prevCode=code,estimatedDecodedSize<(decodedLength+=currentSequenceLength)){for(;(estimatedDecodedSize+=512)<decodedLength;);buffer=this.ensureBuffer(this.bufferLength+estimatedDecodedSize)}for(j=0;j<currentSequenceLength;j++)buffer[currentBufferLength++]=currentSequence[j]}lzwState.nextCode=nextCode,lzwState.codeLength=codeLength,lzwState.prevCode=prevCode,lzwState.currentSequenceLength=currentSequenceLength,this.bufferLength=currentBufferLength}}}class PredictorStream extends DecodeStream{constructor(str,maybeLength,params){if(super(maybeLength),!(params instanceof Dict))return str;maybeLength=this.predictor=params.get("Predictor")||1;if(maybeLength<=1)return str;if(2!==maybeLength&&(maybeLength<10||15<maybeLength))throw new FormatError("Unsupported predictor: ".concat(maybeLength));this.readBlock=2===maybeLength?this.readBlockTiff:this.readBlockPng,this.str=str,this.dict=str.dict;maybeLength=this.colors=params.get("Colors")||1,str=this.bits=params.get("BPC","BitsPerComponent")||8,params=this.columns=params.get("Columns")||1;return this.pixBytes=maybeLength*str+7>>3,this.rowBytes=params*maybeLength*str+7>>3,this}readBlockTiff(){var rowBytes=this.rowBytes,bufferLength=this.bufferLength,buffer=this.ensureBuffer(bufferLength+rowBytes),bits=this.bits,colors=this.colors,rawBytes=this.str.getBytes(rowBytes);if(this.eof=!rawBytes.length,!this.eof){var inbuf=0,outbuf=0,inbits=0,outbits=0,pos=bufferLength;if(1===bits&&1===colors)for(i=0;i<rowBytes;++i){var c=rawBytes[i]^inbuf,inbuf=(1&(c=(c=(c^=c>>1)^c>>2)^c>>4))<<7;buffer[pos++]=c}else if(8===bits){for(i=0;i<colors;++i)buffer[pos++]=rawBytes[i];for(;i<rowBytes;++i)buffer[pos]=buffer[pos-colors]+rawBytes[i],pos++}else if(16===bits){for(var bytesPerPixel=2*colors,i=0;i<bytesPerPixel;++i)buffer[pos++]=rawBytes[i];for(;i<rowBytes;i+=2){var sum=((255&rawBytes[i])<<8)+(255&rawBytes[i+1])+((255&buffer[pos-bytesPerPixel])<<8)+(255&buffer[pos-bytesPerPixel+1]);buffer[pos++]=sum>>8&255,buffer[pos++]=255&sum}}else{var compArray=new Uint8Array(colors+1),bitMask=(1<<bits)-1,j=0,k=bufferLength,columns=this.columns;for(i=0;i<columns;++i)for(var kk=0;kk<colors;++kk)inbits<bits&&(inbuf=inbuf<<8|255&rawBytes[j++],inbits+=8),compArray[kk]=compArray[kk]+(inbuf>>inbits-bits)&bitMask,inbits-=bits,outbuf=outbuf<<bits|compArray[kk],8<=(outbits+=bits)&&(buffer[k++]=outbuf>>outbits-8&255,outbits-=8);0<outbits&&(buffer[k++]=(outbuf<<8-outbits)+(inbuf&(1<<8-outbits)-1))}this.bufferLength+=rowBytes}}readBlockPng(){var rowBytes=this.rowBytes,pixBytes=this.pixBytes,predictor=this.str.getByte(),rawBytes=this.str.getBytes(rowBytes);if(this.eof=!rawBytes.length,!this.eof){var bufferLength=this.bufferLength,buffer=this.ensureBuffer(bufferLength+rowBytes),prevRow=buffer.subarray(bufferLength-rowBytes,bufferLength);0===prevRow.length&&(prevRow=new Uint8Array(rowBytes));var i,c,j=bufferLength;switch(predictor){case 0:for(i=0;i<rowBytes;++i)buffer[j++]=rawBytes[i];break;case 1:for(i=0;i<pixBytes;++i)buffer[j++]=rawBytes[i];for(;i<rowBytes;++i)buffer[j]=buffer[j-pixBytes]+rawBytes[i]&255,j++;break;case 2:for(i=0;i<rowBytes;++i)buffer[j++]=prevRow[i]+rawBytes[i]&255;break;case 3:for(i=0;i<pixBytes;++i)buffer[j++]=(prevRow[i]>>1)+rawBytes[i];for(;i<rowBytes;++i)buffer[j]=(prevRow[i]+buffer[j-pixBytes]>>1)+rawBytes[i]&255,j++;break;case 4:for(i=0;i<pixBytes;++i)up=prevRow[i],c=rawBytes[i],buffer[j++]=up+c;for(;i<rowBytes;++i){var up=prevRow[i],upLeft=prevRow[i-pixBytes],left=buffer[j-pixBytes],p=left+up-upLeft,pa=p-left,pb=(pa<0&&(pa=-pa),p-up),p=(pb<0&&(pb=-pb),p-upLeft);p<0&&(p=-p),c=rawBytes[i],buffer[j++]=pa<=pb&&pa<=p?left+c:pb<=p?up+c:upLeft+c}break;default:throw new FormatError("Unsupported predictor: ".concat(predictor))}this.bufferLength+=rowBytes}}}class RunLengthStream extends DecodeStream{constructor(str,maybeLength){super(maybeLength),this.str=str,this.dict=str.dict}readBlock(){var bufferLength,n,source,buffer,repeatHeader=this.str.getBytes(2);!repeatHeader||repeatHeader.length<2||128===repeatHeader[0]?this.eof=!0:(bufferLength=this.bufferLength,(n=repeatHeader[0])<128?((buffer=this.ensureBuffer(bufferLength+n+1))[bufferLength++]=repeatHeader[1],0<n&&(source=this.str.getBytes(n),buffer.set(source,bufferLength),bufferLength+=n)):((buffer=this.ensureBuffer(bufferLength+(n=257-n)+1)).fill(repeatHeader[1],bufferLength,bufferLength+n),bufferLength+=n),this.bufferLength=bufferLength)}}var MAX_LENGTH_TO_CACHE=1e3;function getInlineImageCacheKey(bytes){for(var strBuf=[],ii=bytes.length,i=0;i<ii-1;)strBuf.push(bytes[i++]<<8|bytes[i++]);return i<ii&&strBuf.push(bytes[i]),ii+"_"+String.fromCharCode.apply(null,strBuf)}var _Parser_brand=new WeakSet;class Parser{constructor(_ref12){var{lexer:_ref12,xref,allowStreams=!1,recoveryMode=!1}=_ref12;_classPrivateMethodInitSpec(this,_Parser_brand),this.lexer=_ref12,this.xref=xref,this.allowStreams=allowStreams,this.recoveryMode=recoveryMode,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof Cmd&&"ID"===this.buf2.cmd?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(e){if(e instanceof MissingDataException)throw e;return!1}}getObj(){var ref,cipherTransform=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,buf1=this.buf1;if(this.shift(),buf1 instanceof Cmd)switch(buf1.cmd){case"BI":return this.makeInlineImage(cipherTransform);case"[":for(var array=[];!isCmd(this.buf1,"]")&&this.buf1!==EOF;)array.push(this.getObj(cipherTransform));if(this.buf1!==EOF)return this.shift(),array;if(this.recoveryMode)return array;throw new ParserEOFException("End of file inside array.");case"<<":for(var dict=new Dict(this.xref);!isCmd(this.buf1,">>")&&this.buf1!==EOF;)if(this.buf1 instanceof Name){var key=this.buf1.name;if(this.shift(),this.buf1===EOF)break;dict.set(key,this.getObj(cipherTransform))}else info("Malformed dictionary: key must be a name object"),this.shift();if(this.buf1!==EOF)return isCmd(this.buf2,"stream")?this.allowStreams?this.makeStream(dict,cipherTransform):dict:(this.shift(),dict);if(this.recoveryMode)return dict;throw new ParserEOFException("End of file inside dictionary.");default:return buf1}return Number.isInteger(buf1)?Number.isInteger(this.buf1)&&isCmd(this.buf2,"R")?(ref=Ref.get(buf1,this.buf1),this.shift(),this.shift(),ref):buf1:"string"==typeof buf1&&cipherTransform?cipherTransform.decryptString(buf1):buf1}findDefaultInlineStreamEnd(stream){for(var ch,knownCommands=this.lexer["knownCommands"],startPos=stream.pos,state=0;-1!==(ch=stream.getByte());)if(0===state)state=69===ch?1:0;else if(1===state)state=73===ch?2:0;else if(32===ch||10===ch||13===ch){var maybeEIPos=stream.pos,followingBytes=stream.peekBytes(15),ii=followingBytes.length;if(0===ii)break;for(var i=0;i<ii;i++)if((0!==(ch=followingBytes[i])||0===followingBytes[i+1])&&10!==ch&&13!==ch&&(ch<32||127<ch)){state=0;break}if(2===state)if(knownCommands){for(var tmpLexer=new Lexer(new Stream(stream.peekBytes(75)),knownCommands),numArgs=(tmpLexer._hexStringWarn=()=>{},0);;){var nextObj=tmpLexer.getObj();if(nextObj===EOF){state=0;break}if(nextObj instanceof Cmd){nextObj=knownCommands[nextObj.cmd];if(!nextObj){state=0;break}if(nextObj.variableArgs?numArgs<=nextObj.numArgs:numArgs===nextObj.numArgs)break;numArgs=0}else numArgs++}if(2===state)break}else warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.")}else state=0;-1===ch&&(warn("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),maybeEIPos)&&(warn('... trying to recover by using the last "EI" occurrence.'),stream.skip(-(stream.pos-maybeEIPos)));var endOffset=4;return stream.skip(-endOffset),ch=stream.peekByte(),stream.skip(endOffset),isWhiteSpace(ch)||endOffset--,stream.pos-endOffset-startPos}findDCTDecodeInlineStreamEnd(stream){for(var b,markerLength,startPos=stream.pos,foundEOI=!1;-1!==(b=stream.getByte());)if(255===b){switch(stream.getByte()){case 0:break;case 255:stream.skip(-1);break;case 217:foundEOI=!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:2<(markerLength=stream.getUint16())?stream.skip(markerLength-2):stream.skip(-2)}if(foundEOI)break}startPos=stream.pos-startPos;return-1===b?(warn("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),stream.skip(-startPos),this.findDefaultInlineStreamEnd(stream)):(this.inlineStreamSkipEI(stream),startPos)}findASCII85DecodeInlineStreamEnd(stream){for(var startPos=stream.pos;-1!==(ch=stream.getByte());)if(126===ch){for(var tildePos=stream.pos,ch=stream.peekByte();isWhiteSpace(ch);)stream.skip(),ch=stream.peekByte();if(62===ch){stream.skip();break}if(stream.pos>tildePos){tildePos=stream.peekBytes(2);if(69===tildePos[0]&&73===tildePos[1])break}}startPos=stream.pos-startPos;return-1===ch?(warn("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),stream.skip(-startPos),this.findDefaultInlineStreamEnd(stream)):(this.inlineStreamSkipEI(stream),startPos)}findASCIIHexDecodeInlineStreamEnd(stream){for(var ch,startPos=stream.pos;-1!==(ch=stream.getByte())&&62!==ch;);startPos=stream.pos-startPos;return-1===ch?(warn("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),stream.skip(-startPos),this.findDefaultInlineStreamEnd(stream)):(this.inlineStreamSkipEI(stream),startPos)}inlineStreamSkipEI(stream){for(var ch,state=0;-1!==(ch=stream.getByte());)if(0===state)state=69===ch?1:0;else if(1===state)state=73===ch?2:0;else if(2===state)break}makeInlineImage(cipherTransform){for(var lexer=this.lexer,stream=lexer.stream,dictMap=Object.create(null);!isCmd(this.buf1,"ID")&&this.buf1!==EOF;){if(!(this.buf1 instanceof Name))throw new FormatError("Dictionary key must be a name object");var key=this.buf1.name;if(this.shift(),this.buf1===EOF)break;dictMap[key]=this.getObj(cipherTransform)}-1!==lexer.beginInlineImagePos&&(dictLength=stream.pos-lexer.beginInlineImagePos);var length,cacheKey,filter=this.xref.fetchIfRef(dictMap.F||dictMap.Filter),filter=(filter instanceof Name?filterName=filter.name:Array.isArray(filter)&&(filter=this.xref.fetchIfRef(filter[0]))instanceof Name&&(filterName=filter.name),stream.pos);switch(filterName){case"DCT":case"DCTDecode":length=this.findDCTDecodeInlineStreamEnd(stream);break;case"A85":case"ASCII85Decode":length=this.findASCII85DecodeInlineStreamEnd(stream);break;case"AHx":case"ASCIIHexDecode":length=this.findASCIIHexDecodeInlineStreamEnd(stream);break;default:length=this.findDefaultInlineStreamEnd(stream)}if(length<MAX_LENGTH_TO_CACHE&&0<dictLength){var filterName=stream.pos,lexer=(stream.pos=lexer.beginInlineImagePos,cacheKey=getInlineImageCacheKey(stream.getBytes(dictLength+length)),stream.pos=filterName,this.imageCache[cacheKey]);if(void 0!==lexer)return this.buf2=Cmd.get("EI"),this.shift(),lexer.reset(),lexer}var _key4,dict=new Dict(this.xref);for(_key4 in dictMap)dict.set(_key4,dictMap[_key4]);var dictLength=stream.makeSubStream(filter,length,dict);return cipherTransform&&(dictLength=cipherTransform.createStream(dictLength,length)),(dictLength=this.filter(dictLength,dict,length)).dict=dict,void 0!==cacheKey&&(dictLength.cacheKey="inline_img_".concat(++this._imageId),this.imageCache[cacheKey]=dictLength),this.buf2=Cmd.get("EI"),this.shift(),dictLength}makeStream(dict,cipherTransform){var lexer=this.lexer,stream=lexer.stream,startPos=(lexer.skipToNextLine(),stream.pos-1),length=dict.get("Length");if(Number.isInteger(length)||(info('Bad length "'.concat(length&&length.toString(),'" in stream.')),length=0),stream.pos=startPos+length,lexer.nextChar(),!this.tryShift()||!isCmd(this.buf2,"endstream")){if((length=_assertClassBrand(_Parser_brand,this,_findStreamLength).call(this,startPos))<0)throw new FormatError("Missing endstream command.");lexer.nextChar(),this.shift()}return this.shift(),this.shift(),stream=stream.makeSubStream(startPos,length,dict),cipherTransform&&(stream=cipherTransform.createStream(stream,length)),(stream=this.filter(stream,dict,length)).dict=dict,stream}filter(stream,dict,length){var filter=dict.get("F","Filter"),params=dict.get("DP","DecodeParms");if(filter instanceof Name)return Array.isArray(params)&&warn("/DecodeParms should not be an Array, when /Filter is a Name."),this.makeFilter(stream,filter.name,length,params);var maybeLength=length;if(Array.isArray(filter))for(var filterArray=filter,paramsArray=params,i=0,ii=filterArray.length;i<ii;++i){if(!((filter=this.xref.fetchIfRef(filterArray[i]))instanceof Name))throw new FormatError('Bad filter name "'.concat(filter,'"'));params=null,Array.isArray(paramsArray)&&i in paramsArray&&(params=this.xref.fetchIfRef(paramsArray[i])),stream=this.makeFilter(stream,filter.name,maybeLength,params),maybeLength=null}return stream}makeFilter(stream,name,maybeLength,params){if(0===maybeLength)return warn('Empty "'.concat(name,'" stream.')),new NullStream;try{switch(name){case"Fl":case"FlateDecode":return params?new PredictorStream(new FlateStream(stream,maybeLength),maybeLength,params):new FlateStream(stream,maybeLength);case"LZW":case"LZWDecode":var earlyChange=1;return params?(params.has("EarlyChange")&&(earlyChange=params.get("EarlyChange")),new PredictorStream(new LZWStream(stream,maybeLength,earlyChange),maybeLength,params)):new LZWStream(stream,maybeLength,earlyChange);case"DCT":case"DCTDecode":return new JpegStream(stream,maybeLength,params);case"JPX":case"JPXDecode":return new JpxStream(stream,maybeLength,params);case"A85":case"ASCII85Decode":return new Ascii85Stream(stream,maybeLength);case"AHx":case"ASCIIHexDecode":return new AsciiHexStream(stream,maybeLength);case"CCF":case"CCITTFaxDecode":return new CCITTFaxStream(stream,maybeLength,params);case"RL":case"RunLengthDecode":return new RunLengthStream(stream,maybeLength);case"JBIG2Decode":return new Jbig2Stream(stream,maybeLength,params)}return warn('Filter "'.concat(name,'" is not supported.')),stream}catch(ex){if(ex instanceof MissingDataException)throw ex;return warn('Invalid stream: "'.concat(ex,'"')),new NullStream}}}function _findStreamLength(startPos){for(var stream=this.lexer["stream"],signatureLength=(stream.pos=startPos,"endstream".length),END_SIGNATURE=new Uint8Array([101,110,100]),endLength=END_SIGNATURE.length,PARTIAL_SIGNATURE=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],normalLength=signatureLength-endLength;stream.pos<stream.end;){var scanBytes=stream.peekBytes(2048),scanLength=scanBytes.length-signatureLength;if(scanLength<=0)break;for(var pos=0;pos<scanLength;){for(var j=0;j<endLength&&scanBytes[pos+j]===END_SIGNATURE[j];)j++;if(endLength<=j){var part,found=!1;for(part of PARTIAL_SIGNATURE){for(var partLen=part.length,k=0;k<partLen&&scanBytes[pos+j+k]===part[k];)k++;if(normalLength<=k){found=!0;break}if(partLen<=k){isWhiteSpace(scanBytes[pos+j+k])&&(info('Found "'.concat(bytesToString([...END_SIGNATURE,...part]),'" when ')+"searching for endstream command."),found=!0);break}}if(found)return stream.pos+=pos,stream.pos-startPos}pos++}stream.pos+=scanLength}return-1}var specialChars=[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(ch){return 48<=ch&&ch<=57?15&ch:65<=ch&&ch<=70||97<=ch&&ch<=102?9+(15&ch):-1}class Lexer{constructor(stream){var knownCommands=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;this.stream=stream,this.nextChar(),this.strBuf=[],this.knownCommands=knownCommands,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){var ch=this.currentChar,eNotation=!1,divideBy=0,sign=1;if(45===ch?(sign=-1,45===(ch=this.nextChar())&&(ch=this.nextChar())):43===ch&&(ch=this.nextChar()),10===ch||13===ch)for(;10===(ch=this.nextChar())||13===ch;);if(46===ch&&(divideBy=10,ch=this.nextChar()),ch<48||57<ch){var msg="Invalid number: ".concat(String.fromCharCode(ch)," (charCode ").concat(ch,")");if(isWhiteSpace(ch)||40===ch||60===ch||-1===ch)return info('Lexer.getNumber - "'.concat(msg,'".')),0;throw new FormatError(msg)}for(var baseValue=ch-48,powerValue=0,powerValueSign=1;0<=(ch=this.nextChar());)if(48<=ch&&ch<=57){var currentDigit=ch-48;eNotation?powerValue=10*powerValue+currentDigit:(0!==divideBy&&(divideBy*=10),baseValue=10*baseValue+currentDigit)}else if(46===ch){if(0!==divideBy)break;divideBy=1}else if(45===ch)warn("Badly formatted number: minus sign in the middle");else{if(69!==ch&&101!==ch)break;if(43===(ch=this.peekChar())||45===ch)powerValueSign=45===ch?-1:1,this.nextChar();else if(ch<48||57<ch)break;eNotation=!0}return 0!==divideBy&&(baseValue/=divideBy),eNotation&&(baseValue*=10**(powerValueSign*powerValue)),sign*baseValue}getString(){for(var numParen=1,done=!1,strBuf=this.strBuf,ch=(strBuf.length=0,this.nextChar());;){var charBuffered=!1;switch(0|ch){case-1:warn("Unterminated string"),done=!0;break;case 40:++numParen,strBuf.push("(");break;case 41:0==--numParen?(this.nextChar(),done=!0):strBuf.push(")");break;case 92:switch(ch=this.nextChar()){case-1:warn("Unterminated string"),done=!0;break;case 110:strBuf.push("\n");break;case 114:strBuf.push("\r");break;case 116:strBuf.push("\t");break;case 98:strBuf.push("\b");break;case 102:strBuf.push("\f");break;case 92:case 40:case 41:strBuf.push(String.fromCharCode(ch));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var x=15&ch,charBuffered=!0;48<=(ch=this.nextChar())&&ch<=55&&(x=(x<<3)+(15&ch),48<=(ch=this.nextChar()))&&ch<=55&&(charBuffered=!1,x=(x<<3)+(15&ch)),strBuf.push(String.fromCharCode(x));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:strBuf.push(String.fromCharCode(ch))}break;default:strBuf.push(String.fromCharCode(ch))}if(done)break;charBuffered||(ch=this.nextChar())}return strBuf.join("")}getName(){var strBuf=this.strBuf;for(strBuf.length=0;0<=(ch=this.nextChar())&&!specialChars[ch];)if(35===ch){if(ch=this.nextChar(),specialChars[ch]){warn("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),strBuf.push("#");break}var x=toHexDigit(ch);if(-1!==x){var ch,previousCh=ch,x2=toHexDigit(ch=this.nextChar());if(-1===x2){if(warn("Lexer_getName: Illegal digit (".concat(String.fromCharCode(ch),") ")+"in hexadecimal number."),strBuf.push("#",String.fromCharCode(previousCh)),specialChars[ch])break;strBuf.push(String.fromCharCode(ch))}else strBuf.push(String.fromCharCode(x<<4|x2))}else strBuf.push("#",String.fromCharCode(ch))}else strBuf.push(String.fromCharCode(ch));return 127<strBuf.length&&warn("Name token is longer than allowed by the spec: ".concat(strBuf.length)),Name.get(strBuf.join(""))}_hexStringWarn(ch){5==this._hexStringNumWarn++?warn("getHexString - ignoring additional invalid characters."):5<this._hexStringNumWarn||warn("getHexString - ignoring invalid character: ".concat(ch))}getHexString(){var digit,strBuf=this.strBuf,ch=(strBuf.length=0,this.currentChar),firstDigit=-1;for(this._hexStringNumWarn=0;;){if(ch<0){warn("Unterminated hex string");break}if(62===ch){this.nextChar();break}ch=(1===specialChars[ch]||(-1===(digit=toHexDigit(ch))?this._hexStringWarn(ch):firstDigit=-1===firstDigit?digit:(strBuf.push(String.fromCharCode(firstDigit<<4|digit)),-1)),this.nextChar())}return-1!==firstDigit&&strBuf.push(String.fromCharCode(firstDigit<<4)),strBuf.join("")}getObj(){for(var comment=!1,ch=this.currentChar;;){if(ch<0)return EOF;if(comment)10!==ch&&13!==ch||(comment=!1);else if(37===ch)comment=!0;else if(1!==specialChars[ch])break;ch=this.nextChar()}switch(0|ch){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),Cmd.get("[");case 93:return this.nextChar(),Cmd.get("]");case 60:return 60===(ch=this.nextChar())?(this.nextChar(),Cmd.get("<<")):this.getHexString();case 62:return 62===(ch=this.nextChar())?(this.nextChar(),Cmd.get(">>")):Cmd.get(">");case 123:return this.nextChar(),Cmd.get("{");case 125:return this.nextChar(),Cmd.get("}");case 41:throw this.nextChar(),new FormatError("Illegal character: ".concat(ch))}var str=String.fromCharCode(ch);if(ch<32||127<ch){var nextCh=this.peekChar();if(32<=nextCh&&nextCh<=127)return this.nextChar(),Cmd.get(str)}for(var knownCommands=this.knownCommands,knownCommandFound=void 0!==(null==knownCommands?void 0:knownCommands[str]);0<=(ch=this.nextChar())&&!specialChars[ch];){var possibleCommand=str+String.fromCharCode(ch);if(knownCommandFound&&void 0===knownCommands[possibleCommand])break;if(128===str.length)throw new FormatError("Command token too long: ".concat(str.length));str=possibleCommand,knownCommandFound=void 0!==(null==knownCommands?void 0:knownCommands[str])}return"true"===str||"false"!==str&&("null"===str?null:("BI"===str&&(this.beginInlineImagePos=this.stream.pos),Cmd.get(str)))}skipToNextLine(){for(var ch=this.currentChar;0<=ch;){if(13===ch){10===(ch=this.nextChar())&&this.nextChar();break}if(10===ch){this.nextChar();break}ch=this.nextChar()}}}class Linearization{static create(stream){function getInt(linDict,name,argument_2){argument_2=2<arguments.length&&void 0!==argument_2&&argument_2,linDict=linDict.get(name);if(Number.isInteger(linDict)&&(argument_2?0<=linDict:0<linDict))return linDict;throw new Error('The "'.concat(name,'" parameter in the linearization ')+"dictionary is invalid.")}var parser=new Parser({lexer:new Lexer(stream),xref:null}),obj1=parser.getObj(),obj2=parser.getObj(),obj3=parser.getObj(),parser=parser.getObj();if(!(Number.isInteger(obj1)&&Number.isInteger(obj2)&&isCmd(obj3,"obj")&&parser instanceof Dict&&"number"==typeof(obj1=parser.get("Linearized"))&&0<obj1))return null;if((obj2=getInt(parser,"L"))!==stream.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:obj2,hints:function(linDict){var hintsLength,hints=linDict.get("H");if(!Array.isArray(hints)||2!==(hintsLength=hints.length)&&4!==hintsLength)throw new Error("Hint array in the linearization dictionary is invalid.");for(var index=0;index<hintsLength;index++){var hint=hints[index];if(!(Number.isInteger(hint)&&0<hint))throw new Error("Hint (".concat(index,") in the linearization dictionary is invalid."))}return hints}(parser),objectNumberFirst:getInt(parser,"O"),endFirst:getInt(parser,"E"),numPages:getInt(parser,"N"),mainXRefEntriesOffset:getInt(parser,"T"),pageFirst:parser.has("P")?getInt(parser,"P",!0):0}}}var BUILT_IN_CMAPS=["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"],MAX_MAP_RANGE=2**24-1;class CMap{constructor(){var builtInCMap=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=builtInCMap}addCodespaceRange(n,low,high){this.codespaceRanges[n-1].push(low,high),this.numCodespaceRanges++}mapCidRange(low,high,dstLow){if(MAX_MAP_RANGE<high-low)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;low<=high;)this._map[low++]=dstLow++}mapBfRange(low,high,dstLow){if(MAX_MAP_RANGE<high-low)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");for(var lastByte=dstLow.length-1;low<=high;){var nextCharCode=(this._map[low++]=dstLow).charCodeAt(lastByte)+1;255<nextCharCode?dstLow=dstLow.substring(0,lastByte-1)+String.fromCharCode(dstLow.charCodeAt(lastByte-1)+1)+"\0":dstLow=dstLow.substring(0,lastByte)+String.fromCharCode(nextCharCode)}}mapBfRangeToArray(low,high,array){if(MAX_MAP_RANGE<high-low)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");for(var ii=array.length,i=0;low<=high&&i<ii;)this._map[low]=array[i++],++low}mapOne(src,dst){this._map[src]=dst}lookup(code){return this._map[code]}contains(code){return void 0!==this._map[code]}forEach(callback){var map=this._map,length=map.length;if(length<=65536)for(var i=0;i<length;i++)void 0!==map[i]&&callback(i,map[i]);else for(var _i21 in map)callback(_i21,map[_i21])}charCodeOf(value){var charCode,map=this._map;if(map.length<=65536)return map.indexOf(value);for(charCode in map)if(map[charCode]===value)return 0|charCode;return-1}getMap(){return this._map}readCharCode(str,offset,out){for(var c=0,codespaceRanges=this.codespaceRanges,n=0,nn=codespaceRanges.length;n<nn;n++)for(var c=(c<<8|str.charCodeAt(offset+n))>>>0,codespaceRange=codespaceRanges[n],k=0,kk=codespaceRange.length;k<kk;){var low=codespaceRange[k++],high=codespaceRange[k++];if(low<=c&&c<=high)return out.charcode=c,void(out.length=n+1)}out.charcode=0,out.length=1}getCharCodeLength(charCode){for(var codespaceRanges=this.codespaceRanges,n=0,nn=codespaceRanges.length;n<nn;n++)for(var codespaceRange=codespaceRanges[n],k=0,kk=codespaceRange.length;k<kk;){var low=codespaceRange[k++],high=codespaceRange[k++];if(low<=charCode&&charCode<=high)return n+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(var i=0;i<65536;i++)if(this._map[i]!==i)return!1;return!0}}class IdentityCMap extends CMap{constructor(vertical,n){super(),this.vertical=vertical,this.addCodespaceRange(n,0,65535)}mapCidRange(low,high,dstLow){unreachable("should not call mapCidRange")}mapBfRange(low,high,dstLow){unreachable("should not call mapBfRange")}mapBfRangeToArray(low,high,array){unreachable("should not call mapBfRangeToArray")}mapOne(src,dst){unreachable("should not call mapCidOne")}lookup(code){return Number.isInteger(code)&&code<=65535?code:void 0}contains(code){return Number.isInteger(code)&&code<=65535}forEach(callback){for(var i=0;i<=65535;i++)callback(i,i)}charCodeOf(value){return Number.isInteger(value)&&value<=65535?value:-1}getMap(){for(var map=new Array(65536),i=0;i<=65535;i++)map[i]=i;return map}get length(){return 65536}get isIdentityCMap(){unreachable("should not access .isIdentityCMap")}}function strToInt(str){for(var a=0,i=0;i<str.length;i++)a=a<<8|str.charCodeAt(i);return a>>>0}function expectString(obj){if("string"!=typeof obj)throw new FormatError("Malformed CMap: expected string.")}function expectInt(obj){if(!Number.isInteger(obj))throw new FormatError("Malformed CMap: expected int.")}function parseBfChar(cMap,lexer){for(;;){var obj=lexer.getObj();if(obj===EOF)break;if(isCmd(obj,"endbfchar"))return;expectString(obj);var src=strToInt(obj);expectString(obj=lexer.getObj()),cMap.mapOne(src,obj)}}function parseBfRange(cMap,lexer){for(;;){if((obj=lexer.getObj())===EOF)break;if(isCmd(obj,"endbfrange"))return;expectString(obj);var low=strToInt(obj),high=(expectString(obj=lexer.getObj()),strToInt(obj));if(obj=lexer.getObj(),Number.isInteger(obj)||"string"==typeof obj){var dstLow=Number.isInteger(obj)?String.fromCharCode(obj):obj;cMap.mapBfRange(low,high,dstLow)}else{if(!isCmd(obj,"["))break;for(var obj=lexer.getObj(),array=[];!isCmd(obj,"]")&&obj!==EOF;)array.push(obj),obj=lexer.getObj();cMap.mapBfRangeToArray(low,high,array)}}throw new FormatError("Invalid bf range.")}function parseCidChar(cMap,lexer){for(;;){var obj=lexer.getObj();if(obj===EOF)break;if(isCmd(obj,"endcidchar"))return;expectString(obj);var src=strToInt(obj);expectInt(obj=lexer.getObj()),cMap.mapOne(src,obj)}}function parseCidRange(cMap,lexer){for(;;){var obj=lexer.getObj();if(obj===EOF)break;if(isCmd(obj,"endcidrange"))return;expectString(obj);var low=strToInt(obj),high=(expectString(obj=lexer.getObj()),strToInt(obj));expectInt(obj=lexer.getObj()),cMap.mapCidRange(low,high,obj)}}function parseCodespaceRange(cMap,lexer){for(;;){var obj=lexer.getObj();if(obj===EOF)break;if(isCmd(obj,"endcodespacerange"))return;if("string"!=typeof obj)break;var low=strToInt(obj);if("string"!=typeof(obj=lexer.getObj()))break;var high=strToInt(obj);cMap.addCodespaceRange(obj.length,low,high)}throw new FormatError("Invalid codespace range.")}function parseWMode(cMap,lexer){lexer=lexer.getObj();Number.isInteger(lexer)&&(cMap.vertical=!!lexer)}function parseCMapName(cMap,lexer){lexer=lexer.getObj();lexer instanceof Name&&(cMap.name=lexer.name)}async function parseCMap(cMap,lexer,fetchBuiltInCMap,useCMap){var previous,embeddedUseCMap;objLoop:for(;;)try{var obj=lexer.getObj();if(obj===EOF)break;if(obj instanceof Name)"WMode"===obj.name?parseWMode(cMap,lexer):"CMapName"===obj.name&&parseCMapName(cMap,lexer),previous=obj;else if(obj instanceof Cmd)switch(obj.cmd){case"endcmap":break objLoop;case"usecmap":previous instanceof Name&&(embeddedUseCMap=previous.name);break;case"begincodespacerange":parseCodespaceRange(cMap,lexer);break;case"beginbfchar":parseBfChar(cMap,lexer);break;case"begincidchar":parseCidChar(cMap,lexer);break;case"beginbfrange":parseBfRange(cMap,lexer);break;case"begincidrange":parseCidRange(cMap,lexer)}}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Invalid cMap data: "+ex);continue}return(useCMap=!useCMap&&embeddedUseCMap?embeddedUseCMap:useCMap)?extendCMap(cMap,fetchBuiltInCMap,useCMap):cMap}async function extendCMap(cMap,fetchBuiltInCMap,useCMap){if(cMap.useCMap=await createBuiltInCMap(useCMap,fetchBuiltInCMap),0===cMap.numCodespaceRanges){for(var useCodespaceRanges=cMap.useCMap.codespaceRanges,i=0;i<useCodespaceRanges.length;i++)cMap.codespaceRanges[i]=useCodespaceRanges[i].slice();cMap.numCodespaceRanges=cMap.useCMap.numCodespaceRanges}return cMap.useCMap.forEach(function(key,value){cMap.contains(key)||cMap.mapOne(key,value)}),cMap}async function createBuiltInCMap(name,fetchBuiltInCMap){if("Identity-H"===name)return new IdentityCMap(!1,2);if("Identity-V"===name)return new IdentityCMap(!0,2);if(!BUILT_IN_CMAPS.includes(name))throw new Error("Unknown CMap name: "+name);var cMap,isCompressed;if(fetchBuiltInCMap)return{cMapData:name,isCompressed}=await fetchBuiltInCMap(name),cMap=new CMap(!0),isCompressed?(new BinaryCMapReader).process(name,cMap,useCMap=>extendCMap(cMap,fetchBuiltInCMap,useCMap)):(isCompressed=new Lexer(new Stream(name)),parseCMap(cMap,isCompressed,fetchBuiltInCMap,null));throw new Error("Built-in CMap parameters are not provided.")}class CMapFactory{static async create(_ref13){var{encoding:_ref13,fetchBuiltInCMap,useCMap}=_ref13;if(_ref13 instanceof Name)return createBuiltInCMap(_ref13.name,fetchBuiltInCMap);if(_ref13 instanceof BaseStream)return(_ref13=await parseCMap(new CMap,new Lexer(_ref13),fetchBuiltInCMap,useCMap)).isIdentityCMap?createBuiltInCMap(_ref13.name,fetchBuiltInCMap):_ref13;throw new Error("Encoding required.")}}var ExpertEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],MacExpertEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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","","","",""],MacRomanEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],StandardEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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","","","",""],WinAnsiEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],SymbolSetEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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",""],ZapfDingbatsEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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(encodingName){switch(encodingName){case"WinAnsiEncoding":return WinAnsiEncoding;case"StandardEncoding":return StandardEncoding;case"MacRomanEncoding":return MacRomanEncoding;case"SymbolSetEncoding":return SymbolSetEncoding;case"ZapfDingbatsEncoding":return ZapfDingbatsEncoding;case"ExpertEncoding":return ExpertEncoding;case"MacExpertEncoding":return MacExpertEncoding;default:return null}}var getGlyphsUnicode=getLookupTableFactory(function(t){t.A=65,t.AE=198,t.AEacute=508,t.AEmacron=482,t.AEsmall=63462,t.Aacute=193,t.Aacutesmall=63457,t.Abreve=258,t.Abreveacute=7854,t.Abrevecyrillic=1232,t.Abrevedotbelow=7862,t.Abrevegrave=7856,t.Abrevehookabove=7858,t.Abrevetilde=7860,t.Acaron=461,t.Acircle=9398,t.Acircumflex=194,t.Acircumflexacute=7844,t.Acircumflexdotbelow=7852,t.Acircumflexgrave=7846,t.Acircumflexhookabove=7848,t.Acircumflexsmall=63458,t.Acircumflextilde=7850,t.Acute=63177,t.Acutesmall=63412,t.Acyrillic=1040,t.Adblgrave=512,t.Adieresis=196,t.Adieresiscyrillic=1234,t.Adieresismacron=478,t.Adieresissmall=63460,t.Adotbelow=7840,t.Adotmacron=480,t.Agrave=192,t.Agravesmall=63456,t.Ahookabove=7842,t.Aiecyrillic=1236,t.Ainvertedbreve=514,t.Alpha=913,t.Alphatonos=902,t.Amacron=256,t.Amonospace=65313,t.Aogonek=260,t.Aring=197,t.Aringacute=506,t.Aringbelow=7680,t.Aringsmall=63461,t.Asmall=63329,t.Atilde=195,t.Atildesmall=63459,t.Aybarmenian=1329,t.B=66,t.Bcircle=9399,t.Bdotaccent=7682,t.Bdotbelow=7684,t.Becyrillic=1041,t.Benarmenian=1330,t.Beta=914,t.Bhook=385,t.Blinebelow=7686,t.Bmonospace=65314,t.Brevesmall=63220,t.Bsmall=63330,t.Btopbar=386,t.C=67,t.Caarmenian=1342,t.Cacute=262,t.Caron=63178,t.Caronsmall=63221,t.Ccaron=268,t.Ccedilla=199,t.Ccedillaacute=7688,t.Ccedillasmall=63463,t.Ccircle=9400,t.Ccircumflex=264,t.Cdot=266,t.Cdotaccent=266,t.Cedillasmall=63416,t.Chaarmenian=1353,t.Cheabkhasiancyrillic=1212,t.Checyrillic=1063,t.Chedescenderabkhasiancyrillic=1214,t.Chedescendercyrillic=1206,t.Chedieresiscyrillic=1268,t.Cheharmenian=1347,t.Chekhakassiancyrillic=1227,t.Cheverticalstrokecyrillic=1208,t.Chi=935,t.Chook=391,t.Circumflexsmall=63222,t.Cmonospace=65315,t.Coarmenian=1361,t.Csmall=63331,t.D=68,t.DZ=497,t.DZcaron=452,t.Daarmenian=1332,t.Dafrican=393,t.Dcaron=270,t.Dcedilla=7696,t.Dcircle=9401,t.Dcircumflexbelow=7698,t.Dcroat=272,t.Ddotaccent=7690,t.Ddotbelow=7692,t.Decyrillic=1044,t.Deicoptic=1006,t.Delta=8710,t.Deltagreek=916,t.Dhook=394,t.Dieresis=63179,t.DieresisAcute=63180,t.DieresisGrave=63181,t.Dieresissmall=63400,t.Digammagreek=988,t.Djecyrillic=1026,t.Dlinebelow=7694,t.Dmonospace=65316,t.Dotaccentsmall=63223,t.Dslash=272,t.Dsmall=63332,t.Dtopbar=395,t.Dz=498,t.Dzcaron=453,t.Dzeabkhasiancyrillic=1248,t.Dzecyrillic=1029,t.Dzhecyrillic=1039,t.E=69,t.Eacute=201,t.Eacutesmall=63465,t.Ebreve=276,t.Ecaron=282,t.Ecedillabreve=7708,t.Echarmenian=1333,t.Ecircle=9402,t.Ecircumflex=202,t.Ecircumflexacute=7870,t.Ecircumflexbelow=7704,t.Ecircumflexdotbelow=7878,t.Ecircumflexgrave=7872,t.Ecircumflexhookabove=7874,t.Ecircumflexsmall=63466,t.Ecircumflextilde=7876,t.Ecyrillic=1028,t.Edblgrave=516,t.Edieresis=203,t.Edieresissmall=63467,t.Edot=278,t.Edotaccent=278,t.Edotbelow=7864,t.Efcyrillic=1060,t.Egrave=200,t.Egravesmall=63464,t.Eharmenian=1335,t.Ehookabove=7866,t.Eightroman=8551,t.Einvertedbreve=518,t.Eiotifiedcyrillic=1124,t.Elcyrillic=1051,t.Elevenroman=8554,t.Emacron=274,t.Emacronacute=7702,t.Emacrongrave=7700,t.Emcyrillic=1052,t.Emonospace=65317,t.Encyrillic=1053,t.Endescendercyrillic=1186,t.Eng=330,t.Enghecyrillic=1188,t.Enhookcyrillic=1223,t.Eogonek=280,t.Eopen=400,t.Epsilon=917,t.Epsilontonos=904,t.Ercyrillic=1056,t.Ereversed=398,t.Ereversedcyrillic=1069,t.Escyrillic=1057,t.Esdescendercyrillic=1194,t.Esh=425,t.Esmall=63333,t.Eta=919,t.Etarmenian=1336,t.Etatonos=905,t.Eth=208,t.Ethsmall=63472,t.Etilde=7868,t.Etildebelow=7706,t.Euro=8364,t.Ezh=439,t.Ezhcaron=494,t.Ezhreversed=440,t.F=70,t.Fcircle=9403,t.Fdotaccent=7710,t.Feharmenian=1366,t.Feicoptic=996,t.Fhook=401,t.Fitacyrillic=1138,t.Fiveroman=8548,t.Fmonospace=65318,t.Fourroman=8547,t.Fsmall=63334,t.G=71,t.GBsquare=13191,t.Gacute=500,t.Gamma=915,t.Gammaafrican=404,t.Gangiacoptic=1002,t.Gbreve=286,t.Gcaron=486,t.Gcedilla=290,t.Gcircle=9404,t.Gcircumflex=284,t.Gcommaaccent=290,t.Gdot=288,t.Gdotaccent=288,t.Gecyrillic=1043,t.Ghadarmenian=1346,t.Ghemiddlehookcyrillic=1172,t.Ghestrokecyrillic=1170,t.Gheupturncyrillic=1168,t.Ghook=403,t.Gimarmenian=1331,t.Gjecyrillic=1027,t.Gmacron=7712,t.Gmonospace=65319,t.Grave=63182,t.Gravesmall=63328,t.Gsmall=63335,t.Gsmallhook=667,t.Gstroke=484,t.H=72,t.H18533=9679,t.H18543=9642,t.H18551=9643,t.H22073=9633,t.HPsquare=13259,t.Haabkhasiancyrillic=1192,t.Hadescendercyrillic=1202,t.Hardsigncyrillic=1066,t.Hbar=294,t.Hbrevebelow=7722,t.Hcedilla=7720,t.Hcircle=9405,t.Hcircumflex=292,t.Hdieresis=7718,t.Hdotaccent=7714,t.Hdotbelow=7716,t.Hmonospace=65320,t.Hoarmenian=1344,t.Horicoptic=1e3,t.Hsmall=63336,t.Hungarumlaut=63183,t.Hungarumlautsmall=63224,t.Hzsquare=13200,t.I=73,t.IAcyrillic=1071,t.IJ=306,t.IUcyrillic=1070,t.Iacute=205,t.Iacutesmall=63469,t.Ibreve=300,t.Icaron=463,t.Icircle=9406,t.Icircumflex=206,t.Icircumflexsmall=63470,t.Icyrillic=1030,t.Idblgrave=520,t.Idieresis=207,t.Idieresisacute=7726,t.Idieresiscyrillic=1252,t.Idieresissmall=63471,t.Idot=304,t.Idotaccent=304,t.Idotbelow=7882,t.Iebrevecyrillic=1238,t.Iecyrillic=1045,t.Ifraktur=8465,t.Igrave=204,t.Igravesmall=63468,t.Ihookabove=7880,t.Iicyrillic=1048,t.Iinvertedbreve=522,t.Iishortcyrillic=1049,t.Imacron=298,t.Imacroncyrillic=1250,t.Imonospace=65321,t.Iniarmenian=1339,t.Iocyrillic=1025,t.Iogonek=302,t.Iota=921,t.Iotaafrican=406,t.Iotadieresis=938,t.Iotatonos=906,t.Ismall=63337,t.Istroke=407,t.Itilde=296,t.Itildebelow=7724,t.Izhitsacyrillic=1140,t.Izhitsadblgravecyrillic=1142,t.J=74,t.Jaarmenian=1345,t.Jcircle=9407,t.Jcircumflex=308,t.Jecyrillic=1032,t.Jheharmenian=1355,t.Jmonospace=65322,t.Jsmall=63338,t.K=75,t.KBsquare=13189,t.KKsquare=13261,t.Kabashkircyrillic=1184,t.Kacute=7728,t.Kacyrillic=1050,t.Kadescendercyrillic=1178,t.Kahookcyrillic=1219,t.Kappa=922,t.Kastrokecyrillic=1182,t.Kaverticalstrokecyrillic=1180,t.Kcaron=488,t.Kcedilla=310,t.Kcircle=9408,t.Kcommaaccent=310,t.Kdotbelow=7730,t.Keharmenian=1364,t.Kenarmenian=1343,t.Khacyrillic=1061,t.Kheicoptic=998,t.Khook=408,t.Kjecyrillic=1036,t.Klinebelow=7732,t.Kmonospace=65323,t.Koppacyrillic=1152,t.Koppagreek=990,t.Ksicyrillic=1134,t.Ksmall=63339,t.L=76,t.LJ=455,t.LL=63167,t.Lacute=313,t.Lambda=923,t.Lcaron=317,t.Lcedilla=315,t.Lcircle=9409,t.Lcircumflexbelow=7740,t.Lcommaaccent=315,t.Ldot=319,t.Ldotaccent=319,t.Ldotbelow=7734,t.Ldotbelowmacron=7736,t.Liwnarmenian=1340,t.Lj=456,t.Ljecyrillic=1033,t.Llinebelow=7738,t.Lmonospace=65324,t.Lslash=321,t.Lslashsmall=63225,t.Lsmall=63340,t.M=77,t.MBsquare=13190,t.Macron=63184,t.Macronsmall=63407,t.Macute=7742,t.Mcircle=9410,t.Mdotaccent=7744,t.Mdotbelow=7746,t.Menarmenian=1348,t.Mmonospace=65325,t.Msmall=63341,t.Mturned=412,t.Mu=924,t.N=78,t.NJ=458,t.Nacute=323,t.Ncaron=327,t.Ncedilla=325,t.Ncircle=9411,t.Ncircumflexbelow=7754,t.Ncommaaccent=325,t.Ndotaccent=7748,t.Ndotbelow=7750,t.Nhookleft=413,t.Nineroman=8552,t.Nj=459,t.Njecyrillic=1034,t.Nlinebelow=7752,t.Nmonospace=65326,t.Nowarmenian=1350,t.Nsmall=63342,t.Ntilde=209,t.Ntildesmall=63473,t.Nu=925,t.O=79,t.OE=338,t.OEsmall=63226,t.Oacute=211,t.Oacutesmall=63475,t.Obarredcyrillic=1256,t.Obarreddieresiscyrillic=1258,t.Obreve=334,t.Ocaron=465,t.Ocenteredtilde=415,t.Ocircle=9412,t.Ocircumflex=212,t.Ocircumflexacute=7888,t.Ocircumflexdotbelow=7896,t.Ocircumflexgrave=7890,t.Ocircumflexhookabove=7892,t.Ocircumflexsmall=63476,t.Ocircumflextilde=7894,t.Ocyrillic=1054,t.Odblacute=336,t.Odblgrave=524,t.Odieresis=214,t.Odieresiscyrillic=1254,t.Odieresissmall=63478,t.Odotbelow=7884,t.Ogoneksmall=63227,t.Ograve=210,t.Ogravesmall=63474,t.Oharmenian=1365,t.Ohm=8486,t.Ohookabove=7886,t.Ohorn=416,t.Ohornacute=7898,t.Ohorndotbelow=7906,t.Ohorngrave=7900,t.Ohornhookabove=7902,t.Ohorntilde=7904,t.Ohungarumlaut=336,t.Oi=418,t.Oinvertedbreve=526,t.Omacron=332,t.Omacronacute=7762,t.Omacrongrave=7760,t.Omega=8486,t.Omegacyrillic=1120,t.Omegagreek=937,t.Omegaroundcyrillic=1146,t.Omegatitlocyrillic=1148,t.Omegatonos=911,t.Omicron=927,t.Omicrontonos=908,t.Omonospace=65327,t.Oneroman=8544,t.Oogonek=490,t.Oogonekmacron=492,t.Oopen=390,t.Oslash=216,t.Oslashacute=510,t.Oslashsmall=63480,t.Osmall=63343,t.Ostrokeacute=510,t.Otcyrillic=1150,t.Otilde=213,t.Otildeacute=7756,t.Otildedieresis=7758,t.Otildesmall=63477,t.P=80,t.Pacute=7764,t.Pcircle=9413,t.Pdotaccent=7766,t.Pecyrillic=1055,t.Peharmenian=1354,t.Pemiddlehookcyrillic=1190,t.Phi=934,t.Phook=420,t.Pi=928,t.Piwrarmenian=1363,t.Pmonospace=65328,t.Psi=936,t.Psicyrillic=1136,t.Psmall=63344,t.Q=81,t.Qcircle=9414,t.Qmonospace=65329,t.Qsmall=63345,t.R=82,t.Raarmenian=1356,t.Racute=340,t.Rcaron=344,t.Rcedilla=342,t.Rcircle=9415,t.Rcommaaccent=342,t.Rdblgrave=528,t.Rdotaccent=7768,t.Rdotbelow=7770,t.Rdotbelowmacron=7772,t.Reharmenian=1360,t.Rfraktur=8476,t.Rho=929,t.Ringsmall=63228,t.Rinvertedbreve=530,t.Rlinebelow=7774,t.Rmonospace=65330,t.Rsmall=63346,t.Rsmallinverted=641,t.Rsmallinvertedsuperior=694,t.S=83,t.SF010000=9484,t.SF020000=9492,t.SF030000=9488,t.SF040000=9496,t.SF050000=9532,t.SF060000=9516,t.SF070000=9524,t.SF080000=9500,t.SF090000=9508,t.SF100000=9472,t.SF110000=9474,t.SF190000=9569,t.SF200000=9570,t.SF210000=9558,t.SF220000=9557,t.SF230000=9571,t.SF240000=9553,t.SF250000=9559,t.SF260000=9565,t.SF270000=9564,t.SF280000=9563,t.SF360000=9566,t.SF370000=9567,t.SF380000=9562,t.SF390000=9556,t.SF400000=9577,t.SF410000=9574,t.SF420000=9568,t.SF430000=9552,t.SF440000=9580,t.SF450000=9575,t.SF460000=9576,t.SF470000=9572,t.SF480000=9573,t.SF490000=9561,t.SF500000=9560,t.SF510000=9554,t.SF520000=9555,t.SF530000=9579,t.SF540000=9578,t.Sacute=346,t.Sacutedotaccent=7780,t.Sampigreek=992,t.Scaron=352,t.Scarondotaccent=7782,t.Scaronsmall=63229,t.Scedilla=350,t.Schwa=399,t.Schwacyrillic=1240,t.Schwadieresiscyrillic=1242,t.Scircle=9416,t.Scircumflex=348,t.Scommaaccent=536,t.Sdotaccent=7776,t.Sdotbelow=7778,t.Sdotbelowdotaccent=7784,t.Seharmenian=1357,t.Sevenroman=8550,t.Shaarmenian=1351,t.Shacyrillic=1064,t.Shchacyrillic=1065,t.Sheicoptic=994,t.Shhacyrillic=1210,t.Shimacoptic=1004,t.Sigma=931,t.Sixroman=8549,t.Smonospace=65331,t.Softsigncyrillic=1068,t.Ssmall=63347,t.Stigmagreek=986,t.T=84,t.Tau=932,t.Tbar=358,t.Tcaron=356,t.Tcedilla=354,t.Tcircle=9417,t.Tcircumflexbelow=7792,t.Tcommaaccent=354,t.Tdotaccent=7786,t.Tdotbelow=7788,t.Tecyrillic=1058,t.Tedescendercyrillic=1196,t.Tenroman=8553,t.Tetsecyrillic=1204,t.Theta=920,t.Thook=428,t.Thorn=222,t.Thornsmall=63486,t.Threeroman=8546,t.Tildesmall=63230,t.Tiwnarmenian=1359,t.Tlinebelow=7790,t.Tmonospace=65332,t.Toarmenian=1337,t.Tonefive=444,t.Tonesix=388,t.Tonetwo=423,t.Tretroflexhook=430,t.Tsecyrillic=1062,t.Tshecyrillic=1035,t.Tsmall=63348,t.Twelveroman=8555,t.Tworoman=8545,t.U=85,t.Uacute=218,t.Uacutesmall=63482,t.Ubreve=364,t.Ucaron=467,t.Ucircle=9418,t.Ucircumflex=219,t.Ucircumflexbelow=7798,t.Ucircumflexsmall=63483,t.Ucyrillic=1059,t.Udblacute=368,t.Udblgrave=532,t.Udieresis=220,t.Udieresisacute=471,t.Udieresisbelow=7794,t.Udieresiscaron=473,t.Udieresiscyrillic=1264,t.Udieresisgrave=475,t.Udieresismacron=469,t.Udieresissmall=63484,t.Udotbelow=7908,t.Ugrave=217,t.Ugravesmall=63481,t.Uhookabove=7910,t.Uhorn=431,t.Uhornacute=7912,t.Uhorndotbelow=7920,t.Uhorngrave=7914,t.Uhornhookabove=7916,t.Uhorntilde=7918,t.Uhungarumlaut=368,t.Uhungarumlautcyrillic=1266,t.Uinvertedbreve=534,t.Ukcyrillic=1144,t.Umacron=362,t.Umacroncyrillic=1262,t.Umacrondieresis=7802,t.Umonospace=65333,t.Uogonek=370,t.Upsilon=933,t.Upsilon1=978,t.Upsilonacutehooksymbolgreek=979,t.Upsilonafrican=433,t.Upsilondieresis=939,t.Upsilondieresishooksymbolgreek=980,t.Upsilonhooksymbol=978,t.Upsilontonos=910,t.Uring=366,t.Ushortcyrillic=1038,t.Usmall=63349,t.Ustraightcyrillic=1198,t.Ustraightstrokecyrillic=1200,t.Utilde=360,t.Utildeacute=7800,t.Utildebelow=7796,t.V=86,t.Vcircle=9419,t.Vdotbelow=7806,t.Vecyrillic=1042,t.Vewarmenian=1358,t.Vhook=434,t.Vmonospace=65334,t.Voarmenian=1352,t.Vsmall=63350,t.Vtilde=7804,t.W=87,t.Wacute=7810,t.Wcircle=9420,t.Wcircumflex=372,t.Wdieresis=7812,t.Wdotaccent=7814,t.Wdotbelow=7816,t.Wgrave=7808,t.Wmonospace=65335,t.Wsmall=63351,t.X=88,t.Xcircle=9421,t.Xdieresis=7820,t.Xdotaccent=7818,t.Xeharmenian=1341,t.Xi=926,t.Xmonospace=65336,t.Xsmall=63352,t.Y=89,t.Yacute=221,t.Yacutesmall=63485,t.Yatcyrillic=1122,t.Ycircle=9422,t.Ycircumflex=374,t.Ydieresis=376,t.Ydieresissmall=63487,t.Ydotaccent=7822,t.Ydotbelow=7924,t.Yericyrillic=1067,t.Yerudieresiscyrillic=1272,t.Ygrave=7922,t.Yhook=435,t.Yhookabove=7926,t.Yiarmenian=1349,t.Yicyrillic=1031,t.Yiwnarmenian=1362,t.Ymonospace=65337,t.Ysmall=63353,t.Ytilde=7928,t.Yusbigcyrillic=1130,t.Yusbigiotifiedcyrillic=1132,t.Yuslittlecyrillic=1126,t.Yuslittleiotifiedcyrillic=1128,t.Z=90,t.Zaarmenian=1334,t.Zacute=377,t.Zcaron=381,t.Zcaronsmall=63231,t.Zcircle=9423,t.Zcircumflex=7824,t.Zdot=379,t.Zdotaccent=379,t.Zdotbelow=7826,t.Zecyrillic=1047,t.Zedescendercyrillic=1176,t.Zedieresiscyrillic=1246,t.Zeta=918,t.Zhearmenian=1338,t.Zhebrevecyrillic=1217,t.Zhecyrillic=1046,t.Zhedescendercyrillic=1174,t.Zhedieresiscyrillic=1244,t.Zlinebelow=7828,t.Zmonospace=65338,t.Zsmall=63354,t.Zstroke=437,t.a=97,t.aabengali=2438,t.aacute=225,t.aadeva=2310,t.aagujarati=2694,t.aagurmukhi=2566,t.aamatragurmukhi=2622,t.aarusquare=13059,t.aavowelsignbengali=2494,t.aavowelsigndeva=2366,t.aavowelsigngujarati=2750,t.abbreviationmarkarmenian=1375,t.abbreviationsigndeva=2416,t.abengali=2437,t.abopomofo=12570,t.abreve=259,t.abreveacute=7855,t.abrevecyrillic=1233,t.abrevedotbelow=7863,t.abrevegrave=7857,t.abrevehookabove=7859,t.abrevetilde=7861,t.acaron=462,t.acircle=9424,t.acircumflex=226,t.acircumflexacute=7845,t.acircumflexdotbelow=7853,t.acircumflexgrave=7847,t.acircumflexhookabove=7849,t.acircumflextilde=7851,t.acute=180,t.acutebelowcmb=791,t.acutecmb=769,t.acutecomb=769,t.acutedeva=2388,t.acutelowmod=719,t.acutetonecmb=833,t.acyrillic=1072,t.adblgrave=513,t.addakgurmukhi=2673,t.adeva=2309,t.adieresis=228,t.adieresiscyrillic=1235,t.adieresismacron=479,t.adotbelow=7841,t.adotmacron=481,t.ae=230,t.aeacute=509,t.aekorean=12624,t.aemacron=483,t.afii00208=8213,t.afii08941=8356,t.afii10017=1040,t.afii10018=1041,t.afii10019=1042,t.afii10020=1043,t.afii10021=1044,t.afii10022=1045,t.afii10023=1025,t.afii10024=1046,t.afii10025=1047,t.afii10026=1048,t.afii10027=1049,t.afii10028=1050,t.afii10029=1051,t.afii10030=1052;t.afii10031=1053,t.afii10032=1054,t.afii10033=1055,t.afii10034=1056,t.afii10035=1057,t.afii10036=1058,t.afii10037=1059,t.afii10038=1060,t.afii10039=1061,t.afii10040=1062,t.afii10041=1063,t.afii10042=1064,t.afii10043=1065,t.afii10044=1066,t.afii10045=1067,t.afii10046=1068,t.afii10047=1069,t.afii10048=1070,t.afii10049=1071,t.afii10050=1168,t.afii10051=1026,t.afii10052=1027,t.afii10053=1028,t.afii10054=1029,t.afii10055=1030,t.afii10056=1031,t.afii10057=1032,t.afii10058=1033,t.afii10059=1034,t.afii10060=1035,t.afii10061=1036,t.afii10062=1038,t.afii10063=63172,t.afii10064=63173,t.afii10065=1072,t.afii10066=1073,t.afii10067=1074,t.afii10068=1075,t.afii10069=1076,t.afii10070=1077,t.afii10071=1105,t.afii10072=1078,t.afii10073=1079,t.afii10074=1080,t.afii10075=1081,t.afii10076=1082,t.afii10077=1083,t.afii10078=1084,t.afii10079=1085,t.afii10080=1086,t.afii10081=1087,t.afii10082=1088,t.afii10083=1089,t.afii10084=1090,t.afii10085=1091,t.afii10086=1092,t.afii10087=1093,t.afii10088=1094,t.afii10089=1095,t.afii10090=1096,t.afii10091=1097,t.afii10092=1098,t.afii10093=1099,t.afii10094=1100,t.afii10095=1101,t.afii10096=1102,t.afii10097=1103,t.afii10098=1169,t.afii10099=1106,t.afii10100=1107,t.afii10101=1108,t.afii10102=1109,t.afii10103=1110,t.afii10104=1111,t.afii10105=1112,t.afii10106=1113,t.afii10107=1114,t.afii10108=1115,t.afii10109=1116,t.afii10110=1118,t.afii10145=1039,t.afii10146=1122,t.afii10147=1138,t.afii10148=1140,t.afii10192=63174,t.afii10193=1119,t.afii10194=1123,t.afii10195=1139,t.afii10196=1141,t.afii10831=63175,t.afii10832=63176,t.afii10846=1241,t.afii299=8206,t.afii300=8207,t.afii301=8205,t.afii57381=1642,t.afii57388=1548,t.afii57392=1632,t.afii57393=1633,t.afii57394=1634,t.afii57395=1635,t.afii57396=1636,t.afii57397=1637,t.afii57398=1638,t.afii57399=1639,t.afii57400=1640,t.afii57401=1641,t.afii57403=1563,t.afii57407=1567,t.afii57409=1569,t.afii57410=1570,t.afii57411=1571,t.afii57412=1572,t.afii57413=1573,t.afii57414=1574,t.afii57415=1575,t.afii57416=1576,t.afii57417=1577,t.afii57418=1578,t.afii57419=1579,t.afii57420=1580,t.afii57421=1581,t.afii57422=1582,t.afii57423=1583,t.afii57424=1584,t.afii57425=1585,t.afii57426=1586,t.afii57427=1587,t.afii57428=1588,t.afii57429=1589,t.afii57430=1590,t.afii57431=1591,t.afii57432=1592,t.afii57433=1593,t.afii57434=1594,t.afii57440=1600,t.afii57441=1601,t.afii57442=1602,t.afii57443=1603,t.afii57444=1604,t.afii57445=1605,t.afii57446=1606,t.afii57448=1608,t.afii57449=1609,t.afii57450=1610,t.afii57451=1611,t.afii57452=1612,t.afii57453=1613,t.afii57454=1614,t.afii57455=1615,t.afii57456=1616,t.afii57457=1617,t.afii57458=1618,t.afii57470=1607,t.afii57505=1700,t.afii57506=1662,t.afii57507=1670,t.afii57508=1688,t.afii57509=1711,t.afii57511=1657,t.afii57512=1672,t.afii57513=1681,t.afii57514=1722,t.afii57519=1746,t.afii57534=1749,t.afii57636=8362,t.afii57645=1470,t.afii57658=1475,t.afii57664=1488,t.afii57665=1489,t.afii57666=1490,t.afii57667=1491,t.afii57668=1492,t.afii57669=1493,t.afii57670=1494,t.afii57671=1495,t.afii57672=1496,t.afii57673=1497,t.afii57674=1498,t.afii57675=1499,t.afii57676=1500,t.afii57677=1501,t.afii57678=1502,t.afii57679=1503,t.afii57680=1504,t.afii57681=1505,t.afii57682=1506,t.afii57683=1507,t.afii57684=1508,t.afii57685=1509,t.afii57686=1510,t.afii57687=1511,t.afii57688=1512,t.afii57689=1513,t.afii57690=1514,t.afii57694=64298,t.afii57695=64299,t.afii57700=64331,t.afii57705=64287,t.afii57716=1520,t.afii57717=1521,t.afii57718=1522,t.afii57723=64309,t.afii57793=1460,t.afii57794=1461,t.afii57795=1462,t.afii57796=1467,t.afii57797=1464,t.afii57798=1463,t.afii57799=1456,t.afii57800=1458,t.afii57801=1457,t.afii57802=1459,t.afii57803=1474,t.afii57804=1473,t.afii57806=1465,t.afii57807=1468,t.afii57839=1469,t.afii57841=1471,t.afii57842=1472,t.afii57929=700,t.afii61248=8453,t.afii61289=8467,t.afii61352=8470,t.afii61573=8236,t.afii61574=8237,t.afii61575=8238,t.afii61664=8204,t.afii63167=1645,t.afii64937=701,t.agrave=224,t.agujarati=2693,t.agurmukhi=2565,t.ahiragana=12354,t.ahookabove=7843,t.aibengali=2448,t.aibopomofo=12574,t.aideva=2320,t.aiecyrillic=1237,t.aigujarati=2704,t.aigurmukhi=2576,t.aimatragurmukhi=2632,t.ainarabic=1593,t.ainfinalarabic=65226,t.aininitialarabic=65227,t.ainmedialarabic=65228,t.ainvertedbreve=515,t.aivowelsignbengali=2504,t.aivowelsigndeva=2376,t.aivowelsigngujarati=2760,t.akatakana=12450,t.akatakanahalfwidth=65393,t.akorean=12623,t.alef=1488,t.alefarabic=1575,t.alefdageshhebrew=64304,t.aleffinalarabic=65166,t.alefhamzaabovearabic=1571,t.alefhamzaabovefinalarabic=65156,t.alefhamzabelowarabic=1573,t.alefhamzabelowfinalarabic=65160,t.alefhebrew=1488,t.aleflamedhebrew=64335,t.alefmaddaabovearabic=1570,t.alefmaddaabovefinalarabic=65154,t.alefmaksuraarabic=1609,t.alefmaksurafinalarabic=65264,t.alefmaksurainitialarabic=65267,t.alefmaksuramedialarabic=65268,t.alefpatahhebrew=64302,t.alefqamatshebrew=64303,t.aleph=8501,t.allequal=8780,t.alpha=945,t.alphatonos=940,t.amacron=257,t.amonospace=65345,t.ampersand=38,t.ampersandmonospace=65286,t.ampersandsmall=63270,t.amsquare=13250,t.anbopomofo=12578,t.angbopomofo=12580,t.angbracketleft=12296,t.angbracketright=12297,t.angkhankhuthai=3674,t.angle=8736,t.anglebracketleft=12296,t.anglebracketleftvertical=65087,t.anglebracketright=12297,t.anglebracketrightvertical=65088,t.angleleft=9001,t.angleright=9002,t.angstrom=8491,t.anoteleia=903,t.anudattadeva=2386,t.anusvarabengali=2434,t.anusvaradeva=2306,t.anusvaragujarati=2690,t.aogonek=261,t.apaatosquare=13056,t.aparen=9372,t.apostrophearmenian=1370,t.apostrophemod=700,t.apple=63743,t.approaches=8784,t.approxequal=8776,t.approxequalorimage=8786,t.approximatelyequal=8773,t.araeaekorean=12686,t.araeakorean=12685,t.arc=8978,t.arighthalfring=7834,t.aring=229,t.aringacute=507,t.aringbelow=7681,t.arrowboth=8596,t.arrowdashdown=8675,t.arrowdashleft=8672,t.arrowdashright=8674,t.arrowdashup=8673,t.arrowdblboth=8660,t.arrowdbldown=8659,t.arrowdblleft=8656,t.arrowdblright=8658,t.arrowdblup=8657,t.arrowdown=8595,t.arrowdownleft=8601,t.arrowdownright=8600,t.arrowdownwhite=8681,t.arrowheaddownmod=709,t.arrowheadleftmod=706,t.arrowheadrightmod=707,t.arrowheadupmod=708,t.arrowhorizex=63719,t.arrowleft=8592,t.arrowleftdbl=8656,t.arrowleftdblstroke=8653,t.arrowleftoverright=8646,t.arrowleftwhite=8678,t.arrowright=8594,t.arrowrightdblstroke=8655,t.arrowrightheavy=10142,t.arrowrightoverleft=8644,t.arrowrightwhite=8680,t.arrowtableft=8676,t.arrowtabright=8677,t.arrowup=8593,t.arrowupdn=8597,t.arrowupdnbse=8616,t.arrowupdownbase=8616,t.arrowupleft=8598,t.arrowupleftofdown=8645,t.arrowupright=8599,t.arrowupwhite=8679,t.arrowvertex=63718,t.asciicircum=94,t.asciicircummonospace=65342,t.asciitilde=126,t.asciitildemonospace=65374,t.ascript=593,t.ascriptturned=594,t.asmallhiragana=12353,t.asmallkatakana=12449,t.asmallkatakanahalfwidth=65383,t.asterisk=42,t.asteriskaltonearabic=1645,t.asteriskarabic=1645,t.asteriskmath=8727,t.asteriskmonospace=65290,t.asterisksmall=65121,t.asterism=8258,t.asuperior=63209,t.asymptoticallyequal=8771,t.at=64,t.atilde=227,t.atmonospace=65312,t.atsmall=65131,t.aturned=592,t.aubengali=2452,t.aubopomofo=12576,t.audeva=2324,t.augujarati=2708,t.augurmukhi=2580,t.aulengthmarkbengali=2519,t.aumatragurmukhi=2636,t.auvowelsignbengali=2508,t.auvowelsigndeva=2380,t.auvowelsigngujarati=2764,t.avagrahadeva=2365,t.aybarmenian=1377,t.ayin=1506,t.ayinaltonehebrew=64288,t.ayinhebrew=1506,t.b=98,t.babengali=2476,t.backslash=92,t.backslashmonospace=65340,t.badeva=2348,t.bagujarati=2732,t.bagurmukhi=2604,t.bahiragana=12400,t.bahtthai=3647,t.bakatakana=12496,t.bar=124,t.barmonospace=65372,t.bbopomofo=12549,t.bcircle=9425,t.bdotaccent=7683,t.bdotbelow=7685,t.beamedsixteenthnotes=9836,t.because=8757,t.becyrillic=1073,t.beharabic=1576,t.behfinalarabic=65168,t.behinitialarabic=65169,t.behiragana=12409,t.behmedialarabic=65170,t.behmeeminitialarabic=64671,t.behmeemisolatedarabic=64520,t.behnoonfinalarabic=64621,t.bekatakana=12505,t.benarmenian=1378,t.bet=1489,t.beta=946,t.betasymbolgreek=976,t.betdagesh=64305,t.betdageshhebrew=64305,t.bethebrew=1489,t.betrafehebrew=64332,t.bhabengali=2477,t.bhadeva=2349,t.bhagujarati=2733,t.bhagurmukhi=2605,t.bhook=595,t.bihiragana=12403,t.bikatakana=12499,t.bilabialclick=664,t.bindigurmukhi=2562,t.birusquare=13105,t.blackcircle=9679,t.blackdiamond=9670,t.blackdownpointingtriangle=9660,t.blackleftpointingpointer=9668,t.blackleftpointingtriangle=9664,t.blacklenticularbracketleft=12304,t.blacklenticularbracketleftvertical=65083,t.blacklenticularbracketright=12305,t.blacklenticularbracketrightvertical=65084,t.blacklowerlefttriangle=9699,t.blacklowerrighttriangle=9698,t.blackrectangle=9644,t.blackrightpointingpointer=9658,t.blackrightpointingtriangle=9654,t.blacksmallsquare=9642,t.blacksmilingface=9787,t.blacksquare=9632,t.blackstar=9733,t.blackupperlefttriangle=9700,t.blackupperrighttriangle=9701,t.blackuppointingsmalltriangle=9652,t.blackuppointingtriangle=9650,t.blank=9251,t.blinebelow=7687,t.block=9608,t.bmonospace=65346,t.bobaimaithai=3610,t.bohiragana=12412,t.bokatakana=12508,t.bparen=9373,t.bqsquare=13251,t.braceex=63732,t.braceleft=123,t.braceleftbt=63731,t.braceleftmid=63730,t.braceleftmonospace=65371,t.braceleftsmall=65115,t.bracelefttp=63729,t.braceleftvertical=65079,t.braceright=125,t.bracerightbt=63742,t.bracerightmid=63741,t.bracerightmonospace=65373,t.bracerightsmall=65116,t.bracerighttp=63740,t.bracerightvertical=65080,t.bracketleft=91,t.bracketleftbt=63728,t.bracketleftex=63727,t.bracketleftmonospace=65339,t.bracketlefttp=63726,t.bracketright=93,t.bracketrightbt=63739,t.bracketrightex=63738,t.bracketrightmonospace=65341,t.bracketrighttp=63737,t.breve=728,t.brevebelowcmb=814,t.brevecmb=774,t.breveinvertedbelowcmb=815,t.breveinvertedcmb=785,t.breveinverteddoublecmb=865,t.bridgebelowcmb=810,t.bridgeinvertedbelowcmb=826,t.brokenbar=166,t.bstroke=384,t.bsuperior=63210,t.btopbar=387,t.buhiragana=12406,t.bukatakana=12502,t.bullet=8226,t.bulletinverse=9688,t.bulletoperator=8729,t.bullseye=9678,t.c=99,t.caarmenian=1390,t.cabengali=2458,t.cacute=263,t.cadeva=2330,t.cagujarati=2714,t.cagurmukhi=2586,t.calsquare=13192,t.candrabindubengali=2433,t.candrabinducmb=784,t.candrabindudeva=2305,t.candrabindugujarati=2689,t.capslock=8682,t.careof=8453,t.caron=711,t.caronbelowcmb=812,t.caroncmb=780,t.carriagereturn=8629,t.cbopomofo=12568,t.ccaron=269,t.ccedilla=231,t.ccedillaacute=7689,t.ccircle=9426,t.ccircumflex=265,t.ccurl=597,t.cdot=267,t.cdotaccent=267,t.cdsquare=13253,t.cedilla=184,t.cedillacmb=807,t.cent=162,t.centigrade=8451,t.centinferior=63199,t.centmonospace=65504,t.centoldstyle=63394,t.centsuperior=63200,t.chaarmenian=1401,t.chabengali=2459,t.chadeva=2331,t.chagujarati=2715,t.chagurmukhi=2587,t.chbopomofo=12564,t.cheabkhasiancyrillic=1213,t.checkmark=10003,t.checyrillic=1095,t.chedescenderabkhasiancyrillic=1215,t.chedescendercyrillic=1207,t.chedieresiscyrillic=1269,t.cheharmenian=1395,t.chekhakassiancyrillic=1228,t.cheverticalstrokecyrillic=1209,t.chi=967,t.chieuchacirclekorean=12919,t.chieuchaparenkorean=12823,t.chieuchcirclekorean=12905,t.chieuchkorean=12618,t.chieuchparenkorean=12809,t.chochangthai=3594,t.chochanthai=3592,t.chochingthai=3593,t.chochoethai=3596,t.chook=392,t.cieucacirclekorean=12918,t.cieucaparenkorean=12822,t.cieuccirclekorean=12904,t.cieuckorean=12616,t.cieucparenkorean=12808,t.cieucuparenkorean=12828,t.circle=9675,t.circlecopyrt=169,t.circlemultiply=8855,t.circleot=8857,t.circleplus=8853,t.circlepostalmark=12342,t.circlewithlefthalfblack=9680,t.circlewithrighthalfblack=9681,t.circumflex=710,t.circumflexbelowcmb=813,t.circumflexcmb=770,t.clear=8999,t.clickalveolar=450,t.clickdental=448,t.clicklateral=449,t.clickretroflex=451,t.club=9827,t.clubsuitblack=9827,t.clubsuitwhite=9831,t.cmcubedsquare=13220,t.cmonospace=65347,t.cmsquaredsquare=13216,t.coarmenian=1409,t.colon=58,t.colonmonetary=8353,t.colonmonospace=65306,t.colonsign=8353,t.colonsmall=65109,t.colontriangularhalfmod=721,t.colontriangularmod=720,t.comma=44,t.commaabovecmb=787,t.commaaboverightcmb=789,t.commaaccent=63171,t.commaarabic=1548,t.commaarmenian=1373,t.commainferior=63201,t.commamonospace=65292,t.commareversedabovecmb=788,t.commareversedmod=701,t.commasmall=65104,t.commasuperior=63202,t.commaturnedabovecmb=786,t.commaturnedmod=699,t.compass=9788,t.congruent=8773,t.contourintegral=8750,t.control=8963,t.controlACK=6,t.controlBEL=7,t.controlBS=8,t.controlCAN=24,t.controlCR=13,t.controlDC1=17,t.controlDC2=18,t.controlDC3=19,t.controlDC4=20,t.controlDEL=127,t.controlDLE=16,t.controlEM=25,t.controlENQ=5,t.controlEOT=4,t.controlESC=27,t.controlETB=23,t.controlETX=3,t.controlFF=12,t.controlFS=28,t.controlGS=29,t.controlHT=9,t.controlLF=10,t.controlNAK=21,t.controlNULL=0,t.controlRS=30,t.controlSI=15,t.controlSO=14,t.controlSOT=2,t.controlSTX=1,t.controlSUB=26,t.controlSYN=22,t.controlUS=31,t.controlVT=11,t.copyright=169,t.copyrightsans=63721,t.copyrightserif=63193,t.cornerbracketleft=12300,t.cornerbracketlefthalfwidth=65378,t.cornerbracketleftvertical=65089,t.cornerbracketright=12301,t.cornerbracketrighthalfwidth=65379,t.cornerbracketrightvertical=65090,t.corporationsquare=13183,t.cosquare=13255,t.coverkgsquare=13254,t.cparen=9374,t.cruzeiro=8354,t.cstretched=663,t.curlyand=8911,t.curlyor=8910,t.currency=164,t.cyrBreve=63185,t.cyrFlex=63186,t.cyrbreve=63188,t.cyrflex=63189,t.d=100,t.daarmenian=1380,t.dabengali=2470,t.dadarabic=1590,t.dadeva=2342,t.dadfinalarabic=65214,t.dadinitialarabic=65215,t.dadmedialarabic=65216,t.dagesh=1468,t.dageshhebrew=1468,t.dagger=8224,t.daggerdbl=8225,t.dagujarati=2726,t.dagurmukhi=2598,t.dahiragana=12384,t.dakatakana=12480,t.dalarabic=1583,t.dalet=1491,t.daletdagesh=64307,t.daletdageshhebrew=64307,t.dalethebrew=1491,t.dalfinalarabic=65194,t.dammaarabic=1615,t.dammalowarabic=1615,t.dammatanaltonearabic=1612,t.dammatanarabic=1612,t.danda=2404,t.dargahebrew=1447,t.dargalefthebrew=1447,t.dasiapneumatacyrilliccmb=1157,t.dblGrave=63187,t.dblanglebracketleft=12298,t.dblanglebracketleftvertical=65085,t.dblanglebracketright=12299,t.dblanglebracketrightvertical=65086,t.dblarchinvertedbelowcmb=811,t.dblarrowleft=8660,t.dblarrowright=8658,t.dbldanda=2405,t.dblgrave=63190,t.dblgravecmb=783,t.dblintegral=8748,t.dbllowline=8215,t.dbllowlinecmb=819,t.dbloverlinecmb=831,t.dblprimemod=698,t.dblverticalbar=8214,t.dblverticallineabovecmb=782,t.dbopomofo=12553,t.dbsquare=13256,t.dcaron=271,t.dcedilla=7697,t.dcircle=9427,t.dcircumflexbelow=7699,t.dcroat=273,t.ddabengali=2465,t.ddadeva=2337,t.ddagujarati=2721,t.ddagurmukhi=2593,t.ddalarabic=1672,t.ddalfinalarabic=64393,t.dddhadeva=2396,t.ddhabengali=2466,t.ddhadeva=2338,t.ddhagujarati=2722,t.ddhagurmukhi=2594,t.ddotaccent=7691,t.ddotbelow=7693,t.decimalseparatorarabic=1643,t.decimalseparatorpersian=1643,t.decyrillic=1076,t.degree=176,t.dehihebrew=1453,t.dehiragana=12391,t.deicoptic=1007,t.dekatakana=12487,t.deleteleft=9003,t.deleteright=8998,t.delta=948,t.deltaturned=397,t.denominatorminusonenumeratorbengali=2552,t.dezh=676,t.dhabengali=2471,t.dhadeva=2343,t.dhagujarati=2727,t.dhagurmukhi=2599,t.dhook=599,t.dialytikatonos=901,t.dialytikatonoscmb=836,t.diamond=9830,t.diamondsuitwhite=9826,t.dieresis=168,t.dieresisacute=63191,t.dieresisbelowcmb=804,t.dieresiscmb=776,t.dieresisgrave=63192,t.dieresistonos=901,t.dihiragana=12386,t.dikatakana=12482,t.dittomark=12291,t.divide=247,t.divides=8739,t.divisionslash=8725,t.djecyrillic=1106,t.dkshade=9619,t.dlinebelow=7695,t.dlsquare=13207,t.dmacron=273,t.dmonospace=65348,t.dnblock=9604,t.dochadathai=3598,t.dodekthai=3604,t.dohiragana=12393,t.dokatakana=12489,t.dollar=36;t.dollarinferior=63203,t.dollarmonospace=65284,t.dollaroldstyle=63268,t.dollarsmall=65129,t.dollarsuperior=63204,t.dong=8363,t.dorusquare=13094,t.dotaccent=729,t.dotaccentcmb=775,t.dotbelowcmb=803,t.dotbelowcomb=803,t.dotkatakana=12539,t.dotlessi=305,t.dotlessj=63166,t.dotlessjstrokehook=644,t.dotmath=8901,t.dottedcircle=9676,t.doubleyodpatah=64287,t.doubleyodpatahhebrew=64287,t.downtackbelowcmb=798,t.downtackmod=725,t.dparen=9375,t.dsuperior=63211,t.dtail=598,t.dtopbar=396,t.duhiragana=12389,t.dukatakana=12485,t.dz=499,t.dzaltone=675,t.dzcaron=454,t.dzcurl=677,t.dzeabkhasiancyrillic=1249,t.dzecyrillic=1109,t.dzhecyrillic=1119,t.e=101,t.eacute=233,t.earth=9793,t.ebengali=2447,t.ebopomofo=12572,t.ebreve=277,t.ecandradeva=2317,t.ecandragujarati=2701,t.ecandravowelsigndeva=2373,t.ecandravowelsigngujarati=2757,t.ecaron=283,t.ecedillabreve=7709,t.echarmenian=1381,t.echyiwnarmenian=1415,t.ecircle=9428,t.ecircumflex=234,t.ecircumflexacute=7871,t.ecircumflexbelow=7705,t.ecircumflexdotbelow=7879,t.ecircumflexgrave=7873,t.ecircumflexhookabove=7875,t.ecircumflextilde=7877,t.ecyrillic=1108,t.edblgrave=517,t.edeva=2319,t.edieresis=235,t.edot=279,t.edotaccent=279,t.edotbelow=7865,t.eegurmukhi=2575,t.eematragurmukhi=2631,t.efcyrillic=1092,t.egrave=232,t.egujarati=2703,t.eharmenian=1383,t.ehbopomofo=12573,t.ehiragana=12360,t.ehookabove=7867,t.eibopomofo=12575,t.eight=56,t.eightarabic=1640,t.eightbengali=2542,t.eightcircle=9319,t.eightcircleinversesansserif=10129,t.eightdeva=2414,t.eighteencircle=9329,t.eighteenparen=9349,t.eighteenperiod=9369,t.eightgujarati=2798,t.eightgurmukhi=2670,t.eighthackarabic=1640,t.eighthangzhou=12328,t.eighthnotebeamed=9835,t.eightideographicparen=12839,t.eightinferior=8328,t.eightmonospace=65304,t.eightoldstyle=63288,t.eightparen=9339,t.eightperiod=9359,t.eightpersian=1784,t.eightroman=8567,t.eightsuperior=8312,t.eightthai=3672,t.einvertedbreve=519,t.eiotifiedcyrillic=1125,t.ekatakana=12456,t.ekatakanahalfwidth=65396,t.ekonkargurmukhi=2676,t.ekorean=12628,t.elcyrillic=1083,t.element=8712,t.elevencircle=9322,t.elevenparen=9342,t.elevenperiod=9362,t.elevenroman=8570,t.ellipsis=8230,t.ellipsisvertical=8942,t.emacron=275,t.emacronacute=7703,t.emacrongrave=7701,t.emcyrillic=1084,t.emdash=8212,t.emdashvertical=65073,t.emonospace=65349,t.emphasismarkarmenian=1371,t.emptyset=8709,t.enbopomofo=12579,t.encyrillic=1085,t.endash=8211,t.endashvertical=65074,t.endescendercyrillic=1187,t.eng=331,t.engbopomofo=12581,t.enghecyrillic=1189,t.enhookcyrillic=1224,t.enspace=8194,t.eogonek=281,t.eokorean=12627,t.eopen=603,t.eopenclosed=666,t.eopenreversed=604,t.eopenreversedclosed=606,t.eopenreversedhook=605,t.eparen=9376,t.epsilon=949,t.epsilontonos=941,t.equal=61,t.equalmonospace=65309,t.equalsmall=65126,t.equalsuperior=8316,t.equivalence=8801,t.erbopomofo=12582,t.ercyrillic=1088,t.ereversed=600,t.ereversedcyrillic=1101,t.escyrillic=1089,t.esdescendercyrillic=1195,t.esh=643,t.eshcurl=646,t.eshortdeva=2318,t.eshortvowelsigndeva=2374,t.eshreversedloop=426,t.eshsquatreversed=645,t.esmallhiragana=12359,t.esmallkatakana=12455,t.esmallkatakanahalfwidth=65386,t.estimated=8494,t.esuperior=63212,t.eta=951,t.etarmenian=1384,t.etatonos=942,t.eth=240,t.etilde=7869,t.etildebelow=7707,t.etnahtafoukhhebrew=1425,t.etnahtafoukhlefthebrew=1425,t.etnahtahebrew=1425,t.etnahtalefthebrew=1425,t.eturned=477,t.eukorean=12641,t.euro=8364,t.evowelsignbengali=2503,t.evowelsigndeva=2375,t.evowelsigngujarati=2759,t.exclam=33,t.exclamarmenian=1372,t.exclamdbl=8252,t.exclamdown=161,t.exclamdownsmall=63393,t.exclammonospace=65281,t.exclamsmall=63265,t.existential=8707,t.ezh=658,t.ezhcaron=495,t.ezhcurl=659,t.ezhreversed=441,t.ezhtail=442,t.f=102,t.fadeva=2398,t.fagurmukhi=2654,t.fahrenheit=8457,t.fathaarabic=1614,t.fathalowarabic=1614,t.fathatanarabic=1611,t.fbopomofo=12552,t.fcircle=9429,t.fdotaccent=7711,t.feharabic=1601,t.feharmenian=1414,t.fehfinalarabic=65234,t.fehinitialarabic=65235,t.fehmedialarabic=65236,t.feicoptic=997,t.female=9792,t.ff=64256,t.f_f=64256,t.ffi=64259,t.f_f_i=64259,t.ffl=64260,t.f_f_l=64260,t.fi=64257,t.f_i=64257,t.fifteencircle=9326,t.fifteenparen=9346,t.fifteenperiod=9366,t.figuredash=8210,t.filledbox=9632,t.filledrect=9644,t.finalkaf=1498,t.finalkafdagesh=64314,t.finalkafdageshhebrew=64314,t.finalkafhebrew=1498,t.finalmem=1501,t.finalmemhebrew=1501,t.finalnun=1503,t.finalnunhebrew=1503,t.finalpe=1507,t.finalpehebrew=1507,t.finaltsadi=1509,t.finaltsadihebrew=1509,t.firsttonechinese=713,t.fisheye=9673,t.fitacyrillic=1139,t.five=53,t.fivearabic=1637,t.fivebengali=2539,t.fivecircle=9316,t.fivecircleinversesansserif=10126,t.fivedeva=2411,t.fiveeighths=8541,t.fivegujarati=2795,t.fivegurmukhi=2667,t.fivehackarabic=1637,t.fivehangzhou=12325,t.fiveideographicparen=12836,t.fiveinferior=8325,t.fivemonospace=65301,t.fiveoldstyle=63285,t.fiveparen=9336,t.fiveperiod=9356,t.fivepersian=1781,t.fiveroman=8564,t.fivesuperior=8309,t.fivethai=3669,t.fl=64258,t.f_l=64258,t.florin=402,t.fmonospace=65350,t.fmsquare=13209,t.fofanthai=3615,t.fofathai=3613,t.fongmanthai=3663,t.forall=8704,t.four=52,t.fourarabic=1636,t.fourbengali=2538,t.fourcircle=9315,t.fourcircleinversesansserif=10125,t.fourdeva=2410,t.fourgujarati=2794,t.fourgurmukhi=2666,t.fourhackarabic=1636,t.fourhangzhou=12324,t.fourideographicparen=12835,t.fourinferior=8324,t.fourmonospace=65300,t.fournumeratorbengali=2551,t.fouroldstyle=63284,t.fourparen=9335,t.fourperiod=9355,t.fourpersian=1780,t.fourroman=8563,t.foursuperior=8308,t.fourteencircle=9325,t.fourteenparen=9345,t.fourteenperiod=9365,t.fourthai=3668,t.fourthtonechinese=715,t.fparen=9377,t.fraction=8260,t.franc=8355,t.g=103,t.gabengali=2455,t.gacute=501,t.gadeva=2327,t.gafarabic=1711,t.gaffinalarabic=64403,t.gafinitialarabic=64404,t.gafmedialarabic=64405,t.gagujarati=2711,t.gagurmukhi=2583,t.gahiragana=12364,t.gakatakana=12460,t.gamma=947,t.gammalatinsmall=611,t.gammasuperior=736,t.gangiacoptic=1003,t.gbopomofo=12557,t.gbreve=287,t.gcaron=487,t.gcedilla=291,t.gcircle=9430,t.gcircumflex=285,t.gcommaaccent=291,t.gdot=289,t.gdotaccent=289,t.gecyrillic=1075,t.gehiragana=12370,t.gekatakana=12466,t.geometricallyequal=8785,t.gereshaccenthebrew=1436,t.gereshhebrew=1523,t.gereshmuqdamhebrew=1437,t.germandbls=223,t.gershayimaccenthebrew=1438,t.gershayimhebrew=1524,t.getamark=12307,t.ghabengali=2456,t.ghadarmenian=1394,t.ghadeva=2328,t.ghagujarati=2712,t.ghagurmukhi=2584,t.ghainarabic=1594,t.ghainfinalarabic=65230,t.ghaininitialarabic=65231,t.ghainmedialarabic=65232,t.ghemiddlehookcyrillic=1173,t.ghestrokecyrillic=1171,t.gheupturncyrillic=1169,t.ghhadeva=2394,t.ghhagurmukhi=2650,t.ghook=608,t.ghzsquare=13203,t.gihiragana=12366,t.gikatakana=12462,t.gimarmenian=1379,t.gimel=1490,t.gimeldagesh=64306,t.gimeldageshhebrew=64306,t.gimelhebrew=1490,t.gjecyrillic=1107,t.glottalinvertedstroke=446,t.glottalstop=660,t.glottalstopinverted=662,t.glottalstopmod=704,t.glottalstopreversed=661,t.glottalstopreversedmod=705,t.glottalstopreversedsuperior=740,t.glottalstopstroke=673,t.glottalstopstrokereversed=674,t.gmacron=7713,t.gmonospace=65351,t.gohiragana=12372,t.gokatakana=12468,t.gparen=9378,t.gpasquare=13228,t.gradient=8711,t.grave=96,t.gravebelowcmb=790,t.gravecmb=768,t.gravecomb=768,t.gravedeva=2387,t.gravelowmod=718,t.gravemonospace=65344,t.gravetonecmb=832,t.greater=62,t.greaterequal=8805,t.greaterequalorless=8923,t.greatermonospace=65310,t.greaterorequivalent=8819,t.greaterorless=8823,t.greateroverequal=8807,t.greatersmall=65125,t.gscript=609,t.gstroke=485,t.guhiragana=12368,t.guillemotleft=171,t.guillemotright=187,t.guilsinglleft=8249,t.guilsinglright=8250,t.gukatakana=12464,t.guramusquare=13080,t.gysquare=13257,t.h=104,t.haabkhasiancyrillic=1193,t.haaltonearabic=1729,t.habengali=2489,t.hadescendercyrillic=1203,t.hadeva=2361,t.hagujarati=2745,t.hagurmukhi=2617,t.haharabic=1581,t.hahfinalarabic=65186,t.hahinitialarabic=65187,t.hahiragana=12399,t.hahmedialarabic=65188,t.haitusquare=13098,t.hakatakana=12495,t.hakatakanahalfwidth=65418,t.halantgurmukhi=2637,t.hamzaarabic=1569,t.hamzalowarabic=1569,t.hangulfiller=12644,t.hardsigncyrillic=1098,t.harpoonleftbarbup=8636,t.harpoonrightbarbup=8640,t.hasquare=13258,t.hatafpatah=1458,t.hatafpatah16=1458,t.hatafpatah23=1458,t.hatafpatah2f=1458,t.hatafpatahhebrew=1458,t.hatafpatahnarrowhebrew=1458,t.hatafpatahquarterhebrew=1458,t.hatafpatahwidehebrew=1458,t.hatafqamats=1459,t.hatafqamats1b=1459,t.hatafqamats28=1459,t.hatafqamats34=1459,t.hatafqamatshebrew=1459,t.hatafqamatsnarrowhebrew=1459,t.hatafqamatsquarterhebrew=1459,t.hatafqamatswidehebrew=1459,t.hatafsegol=1457,t.hatafsegol17=1457,t.hatafsegol24=1457,t.hatafsegol30=1457,t.hatafsegolhebrew=1457,t.hatafsegolnarrowhebrew=1457,t.hatafsegolquarterhebrew=1457,t.hatafsegolwidehebrew=1457,t.hbar=295,t.hbopomofo=12559,t.hbrevebelow=7723,t.hcedilla=7721,t.hcircle=9431,t.hcircumflex=293,t.hdieresis=7719,t.hdotaccent=7715,t.hdotbelow=7717,t.he=1492,t.heart=9829,t.heartsuitblack=9829,t.heartsuitwhite=9825,t.hedagesh=64308,t.hedageshhebrew=64308,t.hehaltonearabic=1729,t.heharabic=1607,t.hehebrew=1492,t.hehfinalaltonearabic=64423,t.hehfinalalttwoarabic=65258,t.hehfinalarabic=65258,t.hehhamzaabovefinalarabic=64421,t.hehhamzaaboveisolatedarabic=64420,t.hehinitialaltonearabic=64424,t.hehinitialarabic=65259,t.hehiragana=12408,t.hehmedialaltonearabic=64425,t.hehmedialarabic=65260,t.heiseierasquare=13179,t.hekatakana=12504,t.hekatakanahalfwidth=65421,t.hekutaarusquare=13110,t.henghook=615,t.herutusquare=13113,t.het=1495,t.hethebrew=1495,t.hhook=614,t.hhooksuperior=689,t.hieuhacirclekorean=12923,t.hieuhaparenkorean=12827,t.hieuhcirclekorean=12909,t.hieuhkorean=12622,t.hieuhparenkorean=12813,t.hihiragana=12402,t.hikatakana=12498,t.hikatakanahalfwidth=65419,t.hiriq=1460,t.hiriq14=1460,t.hiriq21=1460,t.hiriq2d=1460,t.hiriqhebrew=1460,t.hiriqnarrowhebrew=1460,t.hiriqquarterhebrew=1460,t.hiriqwidehebrew=1460,t.hlinebelow=7830,t.hmonospace=65352,t.hoarmenian=1392,t.hohipthai=3627,t.hohiragana=12411,t.hokatakana=12507,t.hokatakanahalfwidth=65422,t.holam=1465,t.holam19=1465,t.holam26=1465,t.holam32=1465,t.holamhebrew=1465,t.holamnarrowhebrew=1465,t.holamquarterhebrew=1465,t.holamwidehebrew=1465,t.honokhukthai=3630,t.hookabovecomb=777,t.hookcmb=777,t.hookpalatalizedbelowcmb=801,t.hookretroflexbelowcmb=802,t.hoonsquare=13122,t.horicoptic=1001,t.horizontalbar=8213,t.horncmb=795,t.hotsprings=9832,t.house=8962,t.hparen=9379,t.hsuperior=688,t.hturned=613,t.huhiragana=12405,t.huiitosquare=13107,t.hukatakana=12501,t.hukatakanahalfwidth=65420,t.hungarumlaut=733,t.hungarumlautcmb=779,t.hv=405,t.hyphen=45,t.hypheninferior=63205,t.hyphenmonospace=65293,t.hyphensmall=65123,t.hyphensuperior=63206,t.hyphentwo=8208,t.i=105,t.iacute=237,t.iacyrillic=1103,t.ibengali=2439,t.ibopomofo=12583,t.ibreve=301,t.icaron=464,t.icircle=9432,t.icircumflex=238,t.icyrillic=1110,t.idblgrave=521,t.ideographearthcircle=12943,t.ideographfirecircle=12939,t.ideographicallianceparen=12863,t.ideographiccallparen=12858,t.ideographiccentrecircle=12965,t.ideographicclose=12294,t.ideographiccomma=12289,t.ideographiccommaleft=65380,t.ideographiccongratulationparen=12855,t.ideographiccorrectcircle=12963,t.ideographicearthparen=12847,t.ideographicenterpriseparen=12861,t.ideographicexcellentcircle=12957,t.ideographicfestivalparen=12864,t.ideographicfinancialcircle=12950,t.ideographicfinancialparen=12854,t.ideographicfireparen=12843,t.ideographichaveparen=12850,t.ideographichighcircle=12964,t.ideographiciterationmark=12293,t.ideographiclaborcircle=12952,t.ideographiclaborparen=12856,t.ideographicleftcircle=12967,t.ideographiclowcircle=12966,t.ideographicmedicinecircle=12969,t.ideographicmetalparen=12846,t.ideographicmoonparen=12842,t.ideographicnameparen=12852,t.ideographicperiod=12290,t.ideographicprintcircle=12958,t.ideographicreachparen=12867,t.ideographicrepresentparen=12857,t.ideographicresourceparen=12862,t.ideographicrightcircle=12968,t.ideographicsecretcircle=12953,t.ideographicselfparen=12866,t.ideographicsocietyparen=12851,t.ideographicspace=12288,t.ideographicspecialparen=12853,t.ideographicstockparen=12849,t.ideographicstudyparen=12859,t.ideographicsunparen=12848,t.ideographicsuperviseparen=12860,t.ideographicwaterparen=12844,t.ideographicwoodparen=12845,t.ideographiczero=12295,t.ideographmetalcircle=12942,t.ideographmooncircle=12938,t.ideographnamecircle=12948,t.ideographsuncircle=12944,t.ideographwatercircle=12940,t.ideographwoodcircle=12941,t.ideva=2311,t.idieresis=239,t.idieresisacute=7727,t.idieresiscyrillic=1253,t.idotbelow=7883,t.iebrevecyrillic=1239,t.iecyrillic=1077,t.ieungacirclekorean=12917,t.ieungaparenkorean=12821,t.ieungcirclekorean=12903,t.ieungkorean=12615,t.ieungparenkorean=12807,t.igrave=236,t.igujarati=2695,t.igurmukhi=2567,t.ihiragana=12356,t.ihookabove=7881,t.iibengali=2440,t.iicyrillic=1080,t.iideva=2312,t.iigujarati=2696,t.iigurmukhi=2568,t.iimatragurmukhi=2624,t.iinvertedbreve=523,t.iishortcyrillic=1081,t.iivowelsignbengali=2496,t.iivowelsigndeva=2368,t.iivowelsigngujarati=2752,t.ij=307,t.ikatakana=12452,t.ikatakanahalfwidth=65394,t.ikorean=12643,t.ilde=732,t.iluyhebrew=1452,t.imacron=299,t.imacroncyrillic=1251,t.imageorapproximatelyequal=8787,t.imatragurmukhi=2623,t.imonospace=65353,t.increment=8710,t.infinity=8734,t.iniarmenian=1387,t.integral=8747,t.integralbottom=8993,t.integralbt=8993,t.integralex=63733,t.integraltop=8992,t.integraltp=8992,t.intersection=8745,t.intisquare=13061,t.invbullet=9688,t.invcircle=9689,t.invsmileface=9787,t.iocyrillic=1105,t.iogonek=303,t.iota=953,t.iotadieresis=970,t.iotadieresistonos=912,t.iotalatin=617,t.iotatonos=943,t.iparen=9380,t.irigurmukhi=2674,t.ismallhiragana=12355,t.ismallkatakana=12451,t.ismallkatakanahalfwidth=65384,t.issharbengali=2554,t.istroke=616,t.isuperior=63213,t.iterationhiragana=12445,t.iterationkatakana=12541,t.itilde=297,t.itildebelow=7725,t.iubopomofo=12585,t.iucyrillic=1102,t.ivowelsignbengali=2495,t.ivowelsigndeva=2367,t.ivowelsigngujarati=2751,t.izhitsacyrillic=1141,t.izhitsadblgravecyrillic=1143,t.j=106,t.jaarmenian=1393,t.jabengali=2460,t.jadeva=2332,t.jagujarati=2716,t.jagurmukhi=2588,t.jbopomofo=12560,t.jcaron=496,t.jcircle=9433,t.jcircumflex=309,t.jcrossedtail=669,t.jdotlessstroke=607,t.jecyrillic=1112,t.jeemarabic=1580,t.jeemfinalarabic=65182,t.jeeminitialarabic=65183,t.jeemmedialarabic=65184,t.jeharabic=1688,t.jehfinalarabic=64395,t.jhabengali=2461,t.jhadeva=2333,t.jhagujarati=2717,t.jhagurmukhi=2589,t.jheharmenian=1403,t.jis=12292,t.jmonospace=65354,t.jparen=9381,t.jsuperior=690,t.k=107,t.kabashkircyrillic=1185,t.kabengali=2453,t.kacute=7729,t.kacyrillic=1082,t.kadescendercyrillic=1179,t.kadeva=2325,t.kaf=1499,t.kafarabic=1603,t.kafdagesh=64315,t.kafdageshhebrew=64315,t.kaffinalarabic=65242,t.kafhebrew=1499,t.kafinitialarabic=65243,t.kafmedialarabic=65244,t.kafrafehebrew=64333,t.kagujarati=2709,t.kagurmukhi=2581,t.kahiragana=12363,t.kahookcyrillic=1220,t.kakatakana=12459,t.kakatakanahalfwidth=65398,t.kappa=954,t.kappasymbolgreek=1008,t.kapyeounmieumkorean=12657,t.kapyeounphieuphkorean=12676,t.kapyeounpieupkorean=12664,t.kapyeounssangpieupkorean=12665,t.karoriisquare=13069,t.kashidaautoarabic=1600,t.kashidaautonosidebearingarabic=1600,t.kasmallkatakana=12533,t.kasquare=13188,t.kasraarabic=1616,t.kasratanarabic=1613,t.kastrokecyrillic=1183,t.katahiraprolongmarkhalfwidth=65392,t.kaverticalstrokecyrillic=1181,t.kbopomofo=12558,t.kcalsquare=13193,t.kcaron=489,t.kcedilla=311,t.kcircle=9434,t.kcommaaccent=311,t.kdotbelow=7731,t.keharmenian=1412,t.kehiragana=12369,t.kekatakana=12465,t.kekatakanahalfwidth=65401,t.kenarmenian=1391,t.kesmallkatakana=12534,t.kgreenlandic=312,t.khabengali=2454,t.khacyrillic=1093,t.khadeva=2326,t.khagujarati=2710,t.khagurmukhi=2582,t.khaharabic=1582,t.khahfinalarabic=65190,t.khahinitialarabic=65191,t.khahmedialarabic=65192,t.kheicoptic=999,t.khhadeva=2393,t.khhagurmukhi=2649,t.khieukhacirclekorean=12920,t.khieukhaparenkorean=12824,t.khieukhcirclekorean=12906,t.khieukhkorean=12619,t.khieukhparenkorean=12810,t.khokhaithai=3586,t.khokhonthai=3589,t.khokhuatthai=3587,t.khokhwaithai=3588,t.khomutthai=3675,t.khook=409,t.khorakhangthai=3590,t.khzsquare=13201,t.kihiragana=12365,t.kikatakana=12461,t.kikatakanahalfwidth=65399,t.kiroguramusquare=13077,t.kiromeetorusquare=13078,t.kirosquare=13076,t.kiyeokacirclekorean=12910,t.kiyeokaparenkorean=12814,t.kiyeokcirclekorean=12896,t.kiyeokkorean=12593,t.kiyeokparenkorean=12800,t.kiyeoksioskorean=12595;t.kjecyrillic=1116,t.klinebelow=7733,t.klsquare=13208,t.kmcubedsquare=13222,t.kmonospace=65355,t.kmsquaredsquare=13218,t.kohiragana=12371,t.kohmsquare=13248,t.kokaithai=3585,t.kokatakana=12467,t.kokatakanahalfwidth=65402,t.kooposquare=13086,t.koppacyrillic=1153,t.koreanstandardsymbol=12927,t.koroniscmb=835,t.kparen=9382,t.kpasquare=13226,t.ksicyrillic=1135,t.ktsquare=13263,t.kturned=670,t.kuhiragana=12367,t.kukatakana=12463,t.kukatakanahalfwidth=65400,t.kvsquare=13240,t.kwsquare=13246,t.l=108,t.labengali=2482,t.lacute=314,t.ladeva=2354,t.lagujarati=2738,t.lagurmukhi=2610,t.lakkhangyaothai=3653,t.lamaleffinalarabic=65276,t.lamalefhamzaabovefinalarabic=65272,t.lamalefhamzaaboveisolatedarabic=65271,t.lamalefhamzabelowfinalarabic=65274,t.lamalefhamzabelowisolatedarabic=65273,t.lamalefisolatedarabic=65275,t.lamalefmaddaabovefinalarabic=65270,t.lamalefmaddaaboveisolatedarabic=65269,t.lamarabic=1604,t.lambda=955,t.lambdastroke=411,t.lamed=1500,t.lameddagesh=64316,t.lameddageshhebrew=64316,t.lamedhebrew=1500,t.lamfinalarabic=65246,t.lamhahinitialarabic=64714,t.laminitialarabic=65247,t.lamjeeminitialarabic=64713,t.lamkhahinitialarabic=64715,t.lamlamhehisolatedarabic=65010,t.lammedialarabic=65248,t.lammeemhahinitialarabic=64904,t.lammeeminitialarabic=64716,t.largecircle=9711,t.lbar=410,t.lbelt=620,t.lbopomofo=12556,t.lcaron=318,t.lcedilla=316,t.lcircle=9435,t.lcircumflexbelow=7741,t.lcommaaccent=316,t.ldot=320,t.ldotaccent=320,t.ldotbelow=7735,t.ldotbelowmacron=7737,t.leftangleabovecmb=794,t.lefttackbelowcmb=792,t.less=60,t.lessequal=8804,t.lessequalorgreater=8922,t.lessmonospace=65308,t.lessorequivalent=8818,t.lessorgreater=8822,t.lessoverequal=8806,t.lesssmall=65124,t.lezh=622,t.lfblock=9612,t.lhookretroflex=621,t.lira=8356,t.liwnarmenian=1388,t.lj=457,t.ljecyrillic=1113,t.ll=63168,t.lladeva=2355,t.llagujarati=2739,t.llinebelow=7739,t.llladeva=2356,t.llvocalicbengali=2529,t.llvocalicdeva=2401,t.llvocalicvowelsignbengali=2531,t.llvocalicvowelsigndeva=2403,t.lmiddletilde=619,t.lmonospace=65356,t.lmsquare=13264,t.lochulathai=3628,t.logicaland=8743,t.logicalnot=172,t.logicalnotreversed=8976,t.logicalor=8744,t.lolingthai=3621,t.longs=383,t.lowlinecenterline=65102,t.lowlinecmb=818,t.lowlinedashed=65101,t.lozenge=9674,t.lparen=9383,t.lslash=322,t.lsquare=8467,t.lsuperior=63214,t.ltshade=9617,t.luthai=3622,t.lvocalicbengali=2444,t.lvocalicdeva=2316,t.lvocalicvowelsignbengali=2530,t.lvocalicvowelsigndeva=2402,t.lxsquare=13267,t.m=109,t.mabengali=2478,t.macron=175,t.macronbelowcmb=817,t.macroncmb=772,t.macronlowmod=717,t.macronmonospace=65507,t.macute=7743,t.madeva=2350,t.magujarati=2734,t.magurmukhi=2606,t.mahapakhhebrew=1444,t.mahapakhlefthebrew=1444,t.mahiragana=12414,t.maichattawalowleftthai=63637,t.maichattawalowrightthai=63636,t.maichattawathai=3659,t.maichattawaupperleftthai=63635,t.maieklowleftthai=63628,t.maieklowrightthai=63627,t.maiekthai=3656,t.maiekupperleftthai=63626,t.maihanakatleftthai=63620,t.maihanakatthai=3633,t.maitaikhuleftthai=63625,t.maitaikhuthai=3655,t.maitholowleftthai=63631,t.maitholowrightthai=63630,t.maithothai=3657,t.maithoupperleftthai=63629,t.maitrilowleftthai=63634,t.maitrilowrightthai=63633,t.maitrithai=3658,t.maitriupperleftthai=63632,t.maiyamokthai=3654,t.makatakana=12510,t.makatakanahalfwidth=65423,t.male=9794,t.mansyonsquare=13127,t.maqafhebrew=1470,t.mars=9794,t.masoracirclehebrew=1455,t.masquare=13187,t.mbopomofo=12551,t.mbsquare=13268,t.mcircle=9436,t.mcubedsquare=13221,t.mdotaccent=7745,t.mdotbelow=7747,t.meemarabic=1605,t.meemfinalarabic=65250,t.meeminitialarabic=65251,t.meemmedialarabic=65252,t.meemmeeminitialarabic=64721,t.meemmeemisolatedarabic=64584,t.meetorusquare=13133,t.mehiragana=12417,t.meizierasquare=13182,t.mekatakana=12513,t.mekatakanahalfwidth=65426,t.mem=1502,t.memdagesh=64318,t.memdageshhebrew=64318,t.memhebrew=1502,t.menarmenian=1396,t.merkhahebrew=1445,t.merkhakefulahebrew=1446,t.merkhakefulalefthebrew=1446,t.merkhalefthebrew=1445,t.mhook=625,t.mhzsquare=13202,t.middledotkatakanahalfwidth=65381,t.middot=183,t.mieumacirclekorean=12914,t.mieumaparenkorean=12818,t.mieumcirclekorean=12900,t.mieumkorean=12609,t.mieumpansioskorean=12656,t.mieumparenkorean=12804,t.mieumpieupkorean=12654,t.mieumsioskorean=12655,t.mihiragana=12415,t.mikatakana=12511,t.mikatakanahalfwidth=65424,t.minus=8722,t.minusbelowcmb=800,t.minuscircle=8854,t.minusmod=727,t.minusplus=8723,t.minute=8242,t.miribaarusquare=13130,t.mirisquare=13129,t.mlonglegturned=624,t.mlsquare=13206,t.mmcubedsquare=13219,t.mmonospace=65357,t.mmsquaredsquare=13215,t.mohiragana=12418,t.mohmsquare=13249,t.mokatakana=12514,t.mokatakanahalfwidth=65427,t.molsquare=13270,t.momathai=3617,t.moverssquare=13223,t.moverssquaredsquare=13224,t.mparen=9384,t.mpasquare=13227,t.mssquare=13235,t.msuperior=63215,t.mturned=623,t.mu=181,t.mu1=181,t.muasquare=13186,t.muchgreater=8811,t.muchless=8810,t.mufsquare=13196,t.mugreek=956,t.mugsquare=13197,t.muhiragana=12416,t.mukatakana=12512,t.mukatakanahalfwidth=65425,t.mulsquare=13205,t.multiply=215,t.mumsquare=13211,t.munahhebrew=1443,t.munahlefthebrew=1443,t.musicalnote=9834,t.musicalnotedbl=9835,t.musicflatsign=9837,t.musicsharpsign=9839,t.mussquare=13234,t.muvsquare=13238,t.muwsquare=13244,t.mvmegasquare=13241,t.mvsquare=13239,t.mwmegasquare=13247,t.mwsquare=13245,t.n=110,t.nabengali=2472,t.nabla=8711,t.nacute=324,t.nadeva=2344,t.nagujarati=2728,t.nagurmukhi=2600,t.nahiragana=12394,t.nakatakana=12490,t.nakatakanahalfwidth=65413,t.napostrophe=329,t.nasquare=13185,t.nbopomofo=12555,t.nbspace=160,t.ncaron=328,t.ncedilla=326,t.ncircle=9437,t.ncircumflexbelow=7755,t.ncommaaccent=326,t.ndotaccent=7749,t.ndotbelow=7751,t.nehiragana=12397,t.nekatakana=12493,t.nekatakanahalfwidth=65416,t.newsheqelsign=8362,t.nfsquare=13195,t.ngabengali=2457,t.ngadeva=2329,t.ngagujarati=2713,t.ngagurmukhi=2585,t.ngonguthai=3591,t.nhiragana=12435,t.nhookleft=626,t.nhookretroflex=627,t.nieunacirclekorean=12911,t.nieunaparenkorean=12815,t.nieuncieuckorean=12597,t.nieuncirclekorean=12897,t.nieunhieuhkorean=12598,t.nieunkorean=12596,t.nieunpansioskorean=12648,t.nieunparenkorean=12801,t.nieunsioskorean=12647,t.nieuntikeutkorean=12646,t.nihiragana=12395,t.nikatakana=12491,t.nikatakanahalfwidth=65414,t.nikhahitleftthai=63641,t.nikhahitthai=3661,t.nine=57,t.ninearabic=1641,t.ninebengali=2543,t.ninecircle=9320,t.ninecircleinversesansserif=10130,t.ninedeva=2415,t.ninegujarati=2799,t.ninegurmukhi=2671,t.ninehackarabic=1641,t.ninehangzhou=12329,t.nineideographicparen=12840,t.nineinferior=8329,t.ninemonospace=65305,t.nineoldstyle=63289,t.nineparen=9340,t.nineperiod=9360,t.ninepersian=1785,t.nineroman=8568,t.ninesuperior=8313,t.nineteencircle=9330,t.nineteenparen=9350,t.nineteenperiod=9370,t.ninethai=3673,t.nj=460,t.njecyrillic=1114,t.nkatakana=12531,t.nkatakanahalfwidth=65437,t.nlegrightlong=414,t.nlinebelow=7753,t.nmonospace=65358,t.nmsquare=13210,t.nnabengali=2467,t.nnadeva=2339,t.nnagujarati=2723,t.nnagurmukhi=2595,t.nnnadeva=2345,t.nohiragana=12398,t.nokatakana=12494,t.nokatakanahalfwidth=65417,t.nonbreakingspace=160,t.nonenthai=3603,t.nonuthai=3609,t.noonarabic=1606,t.noonfinalarabic=65254,t.noonghunnaarabic=1722,t.noonghunnafinalarabic=64415,t.nooninitialarabic=65255,t.noonjeeminitialarabic=64722,t.noonjeemisolatedarabic=64587,t.noonmedialarabic=65256,t.noonmeeminitialarabic=64725,t.noonmeemisolatedarabic=64590,t.noonnoonfinalarabic=64653,t.notcontains=8716,t.notelement=8713,t.notelementof=8713,t.notequal=8800,t.notgreater=8815,t.notgreaternorequal=8817,t.notgreaternorless=8825,t.notidentical=8802,t.notless=8814,t.notlessnorequal=8816,t.notparallel=8742,t.notprecedes=8832,t.notsubset=8836,t.notsucceeds=8833,t.notsuperset=8837,t.nowarmenian=1398,t.nparen=9385,t.nssquare=13233,t.nsuperior=8319,t.ntilde=241,t.nu=957,t.nuhiragana=12396,t.nukatakana=12492,t.nukatakanahalfwidth=65415,t.nuktabengali=2492,t.nuktadeva=2364,t.nuktagujarati=2748,t.nuktagurmukhi=2620,t.numbersign=35,t.numbersignmonospace=65283,t.numbersignsmall=65119,t.numeralsigngreek=884,t.numeralsignlowergreek=885,t.numero=8470,t.nun=1504,t.nundagesh=64320,t.nundageshhebrew=64320,t.nunhebrew=1504,t.nvsquare=13237,t.nwsquare=13243,t.nyabengali=2462,t.nyadeva=2334,t.nyagujarati=2718,t.nyagurmukhi=2590,t.o=111,t.oacute=243,t.oangthai=3629,t.obarred=629,t.obarredcyrillic=1257,t.obarreddieresiscyrillic=1259,t.obengali=2451,t.obopomofo=12571,t.obreve=335,t.ocandradeva=2321,t.ocandragujarati=2705,t.ocandravowelsigndeva=2377,t.ocandravowelsigngujarati=2761,t.ocaron=466,t.ocircle=9438,t.ocircumflex=244,t.ocircumflexacute=7889,t.ocircumflexdotbelow=7897,t.ocircumflexgrave=7891,t.ocircumflexhookabove=7893,t.ocircumflextilde=7895,t.ocyrillic=1086,t.odblacute=337,t.odblgrave=525,t.odeva=2323,t.odieresis=246,t.odieresiscyrillic=1255,t.odotbelow=7885,t.oe=339,t.oekorean=12634,t.ogonek=731,t.ogonekcmb=808,t.ograve=242,t.ogujarati=2707,t.oharmenian=1413,t.ohiragana=12362,t.ohookabove=7887,t.ohorn=417,t.ohornacute=7899,t.ohorndotbelow=7907,t.ohorngrave=7901,t.ohornhookabove=7903,t.ohorntilde=7905,t.ohungarumlaut=337,t.oi=419,t.oinvertedbreve=527,t.okatakana=12458,t.okatakanahalfwidth=65397,t.okorean=12631,t.olehebrew=1451,t.omacron=333,t.omacronacute=7763,t.omacrongrave=7761,t.omdeva=2384,t.omega=969,t.omega1=982,t.omegacyrillic=1121,t.omegalatinclosed=631,t.omegaroundcyrillic=1147,t.omegatitlocyrillic=1149,t.omegatonos=974,t.omgujarati=2768,t.omicron=959,t.omicrontonos=972,t.omonospace=65359,t.one=49,t.onearabic=1633,t.onebengali=2535,t.onecircle=9312,t.onecircleinversesansserif=10122,t.onedeva=2407,t.onedotenleader=8228,t.oneeighth=8539,t.onefitted=63196,t.onegujarati=2791,t.onegurmukhi=2663,t.onehackarabic=1633,t.onehalf=189,t.onehangzhou=12321,t.oneideographicparen=12832,t.oneinferior=8321,t.onemonospace=65297,t.onenumeratorbengali=2548,t.oneoldstyle=63281,t.oneparen=9332,t.oneperiod=9352,t.onepersian=1777,t.onequarter=188,t.oneroman=8560,t.onesuperior=185,t.onethai=3665,t.onethird=8531,t.oogonek=491,t.oogonekmacron=493,t.oogurmukhi=2579,t.oomatragurmukhi=2635,t.oopen=596,t.oparen=9386,t.openbullet=9702,t.option=8997,t.ordfeminine=170,t.ordmasculine=186,t.orthogonal=8735,t.oshortdeva=2322,t.oshortvowelsigndeva=2378,t.oslash=248,t.oslashacute=511,t.osmallhiragana=12361,t.osmallkatakana=12457,t.osmallkatakanahalfwidth=65387,t.ostrokeacute=511,t.osuperior=63216,t.otcyrillic=1151,t.otilde=245,t.otildeacute=7757,t.otildedieresis=7759,t.oubopomofo=12577,t.overline=8254,t.overlinecenterline=65098,t.overlinecmb=773,t.overlinedashed=65097,t.overlinedblwavy=65100,t.overlinewavy=65099,t.overscore=175,t.ovowelsignbengali=2507,t.ovowelsigndeva=2379,t.ovowelsigngujarati=2763,t.p=112,t.paampssquare=13184,t.paasentosquare=13099,t.pabengali=2474,t.pacute=7765,t.padeva=2346,t.pagedown=8671,t.pageup=8670,t.pagujarati=2730,t.pagurmukhi=2602,t.pahiragana=12401,t.paiyannoithai=3631,t.pakatakana=12497,t.palatalizationcyrilliccmb=1156,t.palochkacyrillic=1216,t.pansioskorean=12671,t.paragraph=182,t.parallel=8741,t.parenleft=40,t.parenleftaltonearabic=64830,t.parenleftbt=63725,t.parenleftex=63724,t.parenleftinferior=8333,t.parenleftmonospace=65288,t.parenleftsmall=65113,t.parenleftsuperior=8317,t.parenlefttp=63723,t.parenleftvertical=65077,t.parenright=41,t.parenrightaltonearabic=64831,t.parenrightbt=63736,t.parenrightex=63735,t.parenrightinferior=8334,t.parenrightmonospace=65289,t.parenrightsmall=65114,t.parenrightsuperior=8318,t.parenrighttp=63734,t.parenrightvertical=65078,t.partialdiff=8706,t.paseqhebrew=1472,t.pashtahebrew=1433,t.pasquare=13225,t.patah=1463,t.patah11=1463,t.patah1d=1463,t.patah2a=1463,t.patahhebrew=1463,t.patahnarrowhebrew=1463,t.patahquarterhebrew=1463,t.patahwidehebrew=1463,t.pazerhebrew=1441,t.pbopomofo=12550,t.pcircle=9439,t.pdotaccent=7767,t.pe=1508,t.pecyrillic=1087,t.pedagesh=64324,t.pedageshhebrew=64324,t.peezisquare=13115,t.pefinaldageshhebrew=64323,t.peharabic=1662,t.peharmenian=1402,t.pehebrew=1508,t.pehfinalarabic=64343,t.pehinitialarabic=64344,t.pehiragana=12410,t.pehmedialarabic=64345,t.pekatakana=12506,t.pemiddlehookcyrillic=1191,t.perafehebrew=64334,t.percent=37,t.percentarabic=1642,t.percentmonospace=65285,t.percentsmall=65130,t.period=46,t.periodarmenian=1417,t.periodcentered=183,t.periodhalfwidth=65377,t.periodinferior=63207,t.periodmonospace=65294,t.periodsmall=65106,t.periodsuperior=63208,t.perispomenigreekcmb=834,t.perpendicular=8869,t.perthousand=8240,t.peseta=8359,t.pfsquare=13194,t.phabengali=2475,t.phadeva=2347,t.phagujarati=2731,t.phagurmukhi=2603,t.phi=966,t.phi1=981,t.phieuphacirclekorean=12922,t.phieuphaparenkorean=12826,t.phieuphcirclekorean=12908,t.phieuphkorean=12621,t.phieuphparenkorean=12812,t.philatin=632,t.phinthuthai=3642,t.phisymbolgreek=981,t.phook=421,t.phophanthai=3614,t.phophungthai=3612,t.phosamphaothai=3616,t.pi=960,t.pieupacirclekorean=12915,t.pieupaparenkorean=12819,t.pieupcieuckorean=12662,t.pieupcirclekorean=12901,t.pieupkiyeokkorean=12658,t.pieupkorean=12610,t.pieupparenkorean=12805,t.pieupsioskiyeokkorean=12660,t.pieupsioskorean=12612,t.pieupsiostikeutkorean=12661,t.pieupthieuthkorean=12663,t.pieuptikeutkorean=12659,t.pihiragana=12404,t.pikatakana=12500,t.pisymbolgreek=982,t.piwrarmenian=1411,t.planckover2pi=8463,t.planckover2pi1=8463,t.plus=43,t.plusbelowcmb=799,t.pluscircle=8853,t.plusminus=177,t.plusmod=726,t.plusmonospace=65291,t.plussmall=65122,t.plussuperior=8314,t.pmonospace=65360,t.pmsquare=13272,t.pohiragana=12413,t.pointingindexdownwhite=9759,t.pointingindexleftwhite=9756,t.pointingindexrightwhite=9758,t.pointingindexupwhite=9757,t.pokatakana=12509,t.poplathai=3611,t.postalmark=12306,t.postalmarkface=12320,t.pparen=9387,t.precedes=8826,t.prescription=8478,t.primemod=697,t.primereversed=8245,t.product=8719,t.projective=8965,t.prolongedkana=12540,t.propellor=8984,t.propersubset=8834,t.propersuperset=8835,t.proportion=8759,t.proportional=8733,t.psi=968,t.psicyrillic=1137,t.psilipneumatacyrilliccmb=1158,t.pssquare=13232,t.puhiragana=12407,t.pukatakana=12503,t.pvsquare=13236,t.pwsquare=13242,t.q=113,t.qadeva=2392,t.qadmahebrew=1448,t.qafarabic=1602,t.qaffinalarabic=65238,t.qafinitialarabic=65239,t.qafmedialarabic=65240,t.qamats=1464,t.qamats10=1464,t.qamats1a=1464,t.qamats1c=1464,t.qamats27=1464,t.qamats29=1464,t.qamats33=1464,t.qamatsde=1464,t.qamatshebrew=1464,t.qamatsnarrowhebrew=1464,t.qamatsqatanhebrew=1464,t.qamatsqatannarrowhebrew=1464,t.qamatsqatanquarterhebrew=1464,t.qamatsqatanwidehebrew=1464,t.qamatsquarterhebrew=1464,t.qamatswidehebrew=1464,t.qarneyparahebrew=1439,t.qbopomofo=12561,t.qcircle=9440,t.qhook=672,t.qmonospace=65361,t.qof=1511,t.qofdagesh=64327,t.qofdageshhebrew=64327,t.qofhebrew=1511,t.qparen=9388,t.quarternote=9833,t.qubuts=1467,t.qubuts18=1467,t.qubuts25=1467,t.qubuts31=1467,t.qubutshebrew=1467,t.qubutsnarrowhebrew=1467,t.qubutsquarterhebrew=1467,t.qubutswidehebrew=1467,t.question=63,t.questionarabic=1567,t.questionarmenian=1374,t.questiondown=191,t.questiondownsmall=63423,t.questiongreek=894,t.questionmonospace=65311,t.questionsmall=63295,t.quotedbl=34,t.quotedblbase=8222,t.quotedblleft=8220,t.quotedblmonospace=65282,t.quotedblprime=12318,t.quotedblprimereversed=12317,t.quotedblright=8221,t.quoteleft=8216,t.quoteleftreversed=8219,t.quotereversed=8219,t.quoteright=8217,t.quoterightn=329,t.quotesinglbase=8218,t.quotesingle=39,t.quotesinglemonospace=65287,t.r=114,t.raarmenian=1404,t.rabengali=2480,t.racute=341,t.radeva=2352,t.radical=8730,t.radicalex=63717,t.radoverssquare=13230,t.radoverssquaredsquare=13231,t.radsquare=13229,t.rafe=1471,t.rafehebrew=1471,t.ragujarati=2736,t.ragurmukhi=2608,t.rahiragana=12425,t.rakatakana=12521,t.rakatakanahalfwidth=65431,t.ralowerdiagonalbengali=2545,t.ramiddlediagonalbengali=2544,t.ramshorn=612,t.ratio=8758,t.rbopomofo=12566,t.rcaron=345,t.rcedilla=343,t.rcircle=9441,t.rcommaaccent=343,t.rdblgrave=529,t.rdotaccent=7769,t.rdotbelow=7771,t.rdotbelowmacron=7773,t.referencemark=8251,t.reflexsubset=8838,t.reflexsuperset=8839,t.registered=174,t.registersans=63720,t.registerserif=63194,t.reharabic=1585,t.reharmenian=1408,t.rehfinalarabic=65198,t.rehiragana=12428,t.rekatakana=12524;t.rekatakanahalfwidth=65434,t.resh=1512,t.reshdageshhebrew=64328,t.reshhebrew=1512,t.reversedtilde=8765,t.reviahebrew=1431,t.reviamugrashhebrew=1431,t.revlogicalnot=8976,t.rfishhook=638,t.rfishhookreversed=639,t.rhabengali=2525,t.rhadeva=2397,t.rho=961,t.rhook=637,t.rhookturned=635,t.rhookturnedsuperior=693,t.rhosymbolgreek=1009,t.rhotichookmod=734,t.rieulacirclekorean=12913,t.rieulaparenkorean=12817,t.rieulcirclekorean=12899,t.rieulhieuhkorean=12608,t.rieulkiyeokkorean=12602,t.rieulkiyeoksioskorean=12649,t.rieulkorean=12601,t.rieulmieumkorean=12603,t.rieulpansioskorean=12652,t.rieulparenkorean=12803,t.rieulphieuphkorean=12607,t.rieulpieupkorean=12604,t.rieulpieupsioskorean=12651,t.rieulsioskorean=12605,t.rieulthieuthkorean=12606,t.rieultikeutkorean=12650,t.rieulyeorinhieuhkorean=12653,t.rightangle=8735,t.righttackbelowcmb=793,t.righttriangle=8895,t.rihiragana=12426,t.rikatakana=12522,t.rikatakanahalfwidth=65432,t.ring=730,t.ringbelowcmb=805,t.ringcmb=778,t.ringhalfleft=703,t.ringhalfleftarmenian=1369,t.ringhalfleftbelowcmb=796,t.ringhalfleftcentered=723,t.ringhalfright=702,t.ringhalfrightbelowcmb=825,t.ringhalfrightcentered=722,t.rinvertedbreve=531,t.rittorusquare=13137,t.rlinebelow=7775,t.rlongleg=636,t.rlonglegturned=634,t.rmonospace=65362,t.rohiragana=12429,t.rokatakana=12525,t.rokatakanahalfwidth=65435,t.roruathai=3619,t.rparen=9389,t.rrabengali=2524,t.rradeva=2353,t.rragurmukhi=2652,t.rreharabic=1681,t.rrehfinalarabic=64397,t.rrvocalicbengali=2528,t.rrvocalicdeva=2400,t.rrvocalicgujarati=2784,t.rrvocalicvowelsignbengali=2500,t.rrvocalicvowelsigndeva=2372,t.rrvocalicvowelsigngujarati=2756,t.rsuperior=63217,t.rtblock=9616,t.rturned=633,t.rturnedsuperior=692,t.ruhiragana=12427,t.rukatakana=12523,t.rukatakanahalfwidth=65433,t.rupeemarkbengali=2546,t.rupeesignbengali=2547,t.rupiah=63197,t.ruthai=3620,t.rvocalicbengali=2443,t.rvocalicdeva=2315,t.rvocalicgujarati=2699,t.rvocalicvowelsignbengali=2499,t.rvocalicvowelsigndeva=2371,t.rvocalicvowelsigngujarati=2755,t.s=115,t.sabengali=2488,t.sacute=347,t.sacutedotaccent=7781,t.sadarabic=1589,t.sadeva=2360,t.sadfinalarabic=65210,t.sadinitialarabic=65211,t.sadmedialarabic=65212,t.sagujarati=2744,t.sagurmukhi=2616,t.sahiragana=12373,t.sakatakana=12469,t.sakatakanahalfwidth=65403,t.sallallahoualayhewasallamarabic=65018,t.samekh=1505,t.samekhdagesh=64321,t.samekhdageshhebrew=64321,t.samekhhebrew=1505,t.saraaathai=3634,t.saraaethai=3649,t.saraaimaimalaithai=3652,t.saraaimaimuanthai=3651,t.saraamthai=3635,t.saraathai=3632,t.saraethai=3648,t.saraiileftthai=63622,t.saraiithai=3637,t.saraileftthai=63621,t.saraithai=3636,t.saraothai=3650,t.saraueeleftthai=63624,t.saraueethai=3639,t.saraueleftthai=63623,t.sarauethai=3638,t.sarauthai=3640,t.sarauuthai=3641,t.sbopomofo=12569,t.scaron=353,t.scarondotaccent=7783,t.scedilla=351,t.schwa=601,t.schwacyrillic=1241,t.schwadieresiscyrillic=1243,t.schwahook=602,t.scircle=9442,t.scircumflex=349,t.scommaaccent=537,t.sdotaccent=7777,t.sdotbelow=7779,t.sdotbelowdotaccent=7785,t.seagullbelowcmb=828,t.second=8243,t.secondtonechinese=714,t.section=167,t.seenarabic=1587,t.seenfinalarabic=65202,t.seeninitialarabic=65203,t.seenmedialarabic=65204,t.segol=1462,t.segol13=1462,t.segol1f=1462,t.segol2c=1462,t.segolhebrew=1462,t.segolnarrowhebrew=1462,t.segolquarterhebrew=1462,t.segoltahebrew=1426,t.segolwidehebrew=1462,t.seharmenian=1405,t.sehiragana=12379,t.sekatakana=12475,t.sekatakanahalfwidth=65406,t.semicolon=59,t.semicolonarabic=1563,t.semicolonmonospace=65307,t.semicolonsmall=65108,t.semivoicedmarkkana=12444,t.semivoicedmarkkanahalfwidth=65439,t.sentisquare=13090,t.sentosquare=13091,t.seven=55,t.sevenarabic=1639,t.sevenbengali=2541,t.sevencircle=9318,t.sevencircleinversesansserif=10128,t.sevendeva=2413,t.seveneighths=8542,t.sevengujarati=2797,t.sevengurmukhi=2669,t.sevenhackarabic=1639,t.sevenhangzhou=12327,t.sevenideographicparen=12838,t.seveninferior=8327,t.sevenmonospace=65303,t.sevenoldstyle=63287,t.sevenparen=9338,t.sevenperiod=9358,t.sevenpersian=1783,t.sevenroman=8566,t.sevensuperior=8311,t.seventeencircle=9328,t.seventeenparen=9348,t.seventeenperiod=9368,t.seventhai=3671,t.sfthyphen=173,t.shaarmenian=1399,t.shabengali=2486,t.shacyrillic=1096,t.shaddaarabic=1617,t.shaddadammaarabic=64609,t.shaddadammatanarabic=64606,t.shaddafathaarabic=64608,t.shaddakasraarabic=64610,t.shaddakasratanarabic=64607,t.shade=9618,t.shadedark=9619,t.shadelight=9617,t.shademedium=9618,t.shadeva=2358,t.shagujarati=2742,t.shagurmukhi=2614,t.shalshelethebrew=1427,t.shbopomofo=12565,t.shchacyrillic=1097,t.sheenarabic=1588,t.sheenfinalarabic=65206,t.sheeninitialarabic=65207,t.sheenmedialarabic=65208,t.sheicoptic=995,t.sheqel=8362,t.sheqelhebrew=8362,t.sheva=1456,t.sheva115=1456,t.sheva15=1456,t.sheva22=1456,t.sheva2e=1456,t.shevahebrew=1456,t.shevanarrowhebrew=1456,t.shevaquarterhebrew=1456,t.shevawidehebrew=1456,t.shhacyrillic=1211,t.shimacoptic=1005,t.shin=1513,t.shindagesh=64329,t.shindageshhebrew=64329,t.shindageshshindot=64300,t.shindageshshindothebrew=64300,t.shindageshsindot=64301,t.shindageshsindothebrew=64301,t.shindothebrew=1473,t.shinhebrew=1513,t.shinshindot=64298,t.shinshindothebrew=64298,t.shinsindot=64299,t.shinsindothebrew=64299,t.shook=642,t.sigma=963,t.sigma1=962,t.sigmafinal=962,t.sigmalunatesymbolgreek=1010,t.sihiragana=12375,t.sikatakana=12471,t.sikatakanahalfwidth=65404,t.siluqhebrew=1469,t.siluqlefthebrew=1469,t.similar=8764,t.sindothebrew=1474,t.siosacirclekorean=12916,t.siosaparenkorean=12820,t.sioscieuckorean=12670,t.sioscirclekorean=12902,t.sioskiyeokkorean=12666,t.sioskorean=12613,t.siosnieunkorean=12667,t.siosparenkorean=12806,t.siospieupkorean=12669,t.siostikeutkorean=12668,t.six=54,t.sixarabic=1638,t.sixbengali=2540,t.sixcircle=9317,t.sixcircleinversesansserif=10127,t.sixdeva=2412,t.sixgujarati=2796,t.sixgurmukhi=2668,t.sixhackarabic=1638,t.sixhangzhou=12326,t.sixideographicparen=12837,t.sixinferior=8326,t.sixmonospace=65302,t.sixoldstyle=63286,t.sixparen=9337,t.sixperiod=9357,t.sixpersian=1782,t.sixroman=8565,t.sixsuperior=8310,t.sixteencircle=9327,t.sixteencurrencydenominatorbengali=2553,t.sixteenparen=9347,t.sixteenperiod=9367,t.sixthai=3670,t.slash=47,t.slashmonospace=65295,t.slong=383,t.slongdotaccent=7835,t.smileface=9786,t.smonospace=65363,t.sofpasuqhebrew=1475,t.softhyphen=173,t.softsigncyrillic=1100,t.sohiragana=12381,t.sokatakana=12477,t.sokatakanahalfwidth=65407,t.soliduslongoverlaycmb=824,t.solidusshortoverlaycmb=823,t.sorusithai=3625,t.sosalathai=3624,t.sosothai=3595,t.sosuathai=3626,t.space=32,t.spacehackarabic=32,t.spade=9824,t.spadesuitblack=9824,t.spadesuitwhite=9828,t.sparen=9390,t.squarebelowcmb=827,t.squarecc=13252,t.squarecm=13213,t.squarediagonalcrosshatchfill=9641,t.squarehorizontalfill=9636,t.squarekg=13199,t.squarekm=13214,t.squarekmcapital=13262,t.squareln=13265,t.squarelog=13266,t.squaremg=13198,t.squaremil=13269,t.squaremm=13212,t.squaremsquared=13217,t.squareorthogonalcrosshatchfill=9638,t.squareupperlefttolowerrightfill=9639,t.squareupperrighttolowerleftfill=9640,t.squareverticalfill=9637,t.squarewhitewithsmallblack=9635,t.srsquare=13275,t.ssabengali=2487,t.ssadeva=2359,t.ssagujarati=2743,t.ssangcieuckorean=12617,t.ssanghieuhkorean=12677,t.ssangieungkorean=12672,t.ssangkiyeokkorean=12594,t.ssangnieunkorean=12645,t.ssangpieupkorean=12611,t.ssangsioskorean=12614,t.ssangtikeutkorean=12600,t.ssuperior=63218,t.sterling=163,t.sterlingmonospace=65505,t.strokelongoverlaycmb=822,t.strokeshortoverlaycmb=821,t.subset=8834,t.subsetnotequal=8842,t.subsetorequal=8838,t.succeeds=8827,t.suchthat=8715,t.suhiragana=12377,t.sukatakana=12473,t.sukatakanahalfwidth=65405,t.sukunarabic=1618,t.summation=8721,t.sun=9788,t.superset=8835,t.supersetnotequal=8843,t.supersetorequal=8839,t.svsquare=13276,t.syouwaerasquare=13180,t.t=116,t.tabengali=2468,t.tackdown=8868,t.tackleft=8867,t.tadeva=2340,t.tagujarati=2724,t.tagurmukhi=2596,t.taharabic=1591,t.tahfinalarabic=65218,t.tahinitialarabic=65219,t.tahiragana=12383,t.tahmedialarabic=65220,t.taisyouerasquare=13181,t.takatakana=12479,t.takatakanahalfwidth=65408,t.tatweelarabic=1600,t.tau=964,t.tav=1514,t.tavdages=64330,t.tavdagesh=64330,t.tavdageshhebrew=64330,t.tavhebrew=1514,t.tbar=359,t.tbopomofo=12554,t.tcaron=357,t.tccurl=680,t.tcedilla=355,t.tcheharabic=1670,t.tchehfinalarabic=64379,t.tchehinitialarabic=64380,t.tchehmedialarabic=64381,t.tcircle=9443,t.tcircumflexbelow=7793,t.tcommaaccent=355,t.tdieresis=7831,t.tdotaccent=7787,t.tdotbelow=7789,t.tecyrillic=1090,t.tedescendercyrillic=1197,t.teharabic=1578,t.tehfinalarabic=65174,t.tehhahinitialarabic=64674,t.tehhahisolatedarabic=64524,t.tehinitialarabic=65175,t.tehiragana=12390,t.tehjeeminitialarabic=64673,t.tehjeemisolatedarabic=64523,t.tehmarbutaarabic=1577,t.tehmarbutafinalarabic=65172,t.tehmedialarabic=65176,t.tehmeeminitialarabic=64676,t.tehmeemisolatedarabic=64526,t.tehnoonfinalarabic=64627,t.tekatakana=12486,t.tekatakanahalfwidth=65411,t.telephone=8481,t.telephoneblack=9742,t.telishagedolahebrew=1440,t.telishaqetanahebrew=1449,t.tencircle=9321,t.tenideographicparen=12841,t.tenparen=9341,t.tenperiod=9361,t.tenroman=8569,t.tesh=679,t.tet=1496,t.tetdagesh=64312,t.tetdageshhebrew=64312,t.tethebrew=1496,t.tetsecyrillic=1205,t.tevirhebrew=1435,t.tevirlefthebrew=1435,t.thabengali=2469,t.thadeva=2341,t.thagujarati=2725,t.thagurmukhi=2597,t.thalarabic=1584,t.thalfinalarabic=65196,t.thanthakhatlowleftthai=63640,t.thanthakhatlowrightthai=63639,t.thanthakhatthai=3660,t.thanthakhatupperleftthai=63638,t.theharabic=1579,t.thehfinalarabic=65178,t.thehinitialarabic=65179,t.thehmedialarabic=65180,t.thereexists=8707,t.therefore=8756,t.theta=952,t.theta1=977,t.thetasymbolgreek=977,t.thieuthacirclekorean=12921,t.thieuthaparenkorean=12825,t.thieuthcirclekorean=12907,t.thieuthkorean=12620,t.thieuthparenkorean=12811,t.thirteencircle=9324,t.thirteenparen=9344,t.thirteenperiod=9364,t.thonangmonthothai=3601,t.thook=429,t.thophuthaothai=3602,t.thorn=254,t.thothahanthai=3607,t.thothanthai=3600,t.thothongthai=3608,t.thothungthai=3606,t.thousandcyrillic=1154,t.thousandsseparatorarabic=1644,t.thousandsseparatorpersian=1644,t.three=51,t.threearabic=1635,t.threebengali=2537,t.threecircle=9314,t.threecircleinversesansserif=10124,t.threedeva=2409,t.threeeighths=8540,t.threegujarati=2793,t.threegurmukhi=2665,t.threehackarabic=1635,t.threehangzhou=12323,t.threeideographicparen=12834,t.threeinferior=8323,t.threemonospace=65299,t.threenumeratorbengali=2550,t.threeoldstyle=63283,t.threeparen=9334,t.threeperiod=9354,t.threepersian=1779,t.threequarters=190,t.threequartersemdash=63198,t.threeroman=8562,t.threesuperior=179,t.threethai=3667,t.thzsquare=13204,t.tihiragana=12385,t.tikatakana=12481,t.tikatakanahalfwidth=65409,t.tikeutacirclekorean=12912,t.tikeutaparenkorean=12816,t.tikeutcirclekorean=12898,t.tikeutkorean=12599,t.tikeutparenkorean=12802,t.tilde=732,t.tildebelowcmb=816,t.tildecmb=771,t.tildecomb=771,t.tildedoublecmb=864,t.tildeoperator=8764,t.tildeoverlaycmb=820,t.tildeverticalcmb=830,t.timescircle=8855,t.tipehahebrew=1430,t.tipehalefthebrew=1430,t.tippigurmukhi=2672,t.titlocyrilliccmb=1155,t.tiwnarmenian=1407,t.tlinebelow=7791,t.tmonospace=65364,t.toarmenian=1385,t.tohiragana=12392,t.tokatakana=12488,t.tokatakanahalfwidth=65412,t.tonebarextrahighmod=741,t.tonebarextralowmod=745,t.tonebarhighmod=742,t.tonebarlowmod=744,t.tonebarmidmod=743,t.tonefive=445,t.tonesix=389,t.tonetwo=424,t.tonos=900,t.tonsquare=13095,t.topatakthai=3599,t.tortoiseshellbracketleft=12308,t.tortoiseshellbracketleftsmall=65117,t.tortoiseshellbracketleftvertical=65081,t.tortoiseshellbracketright=12309,t.tortoiseshellbracketrightsmall=65118,t.tortoiseshellbracketrightvertical=65082,t.totaothai=3605,t.tpalatalhook=427,t.tparen=9391,t.trademark=8482,t.trademarksans=63722,t.trademarkserif=63195,t.tretroflexhook=648,t.triagdn=9660,t.triaglf=9668,t.triagrt=9658,t.triagup=9650,t.ts=678,t.tsadi=1510,t.tsadidagesh=64326,t.tsadidageshhebrew=64326,t.tsadihebrew=1510,t.tsecyrillic=1094,t.tsere=1461,t.tsere12=1461,t.tsere1e=1461,t.tsere2b=1461,t.tserehebrew=1461,t.tserenarrowhebrew=1461,t.tserequarterhebrew=1461,t.tserewidehebrew=1461,t.tshecyrillic=1115,t.tsuperior=63219,t.ttabengali=2463,t.ttadeva=2335,t.ttagujarati=2719,t.ttagurmukhi=2591,t.tteharabic=1657,t.ttehfinalarabic=64359,t.ttehinitialarabic=64360,t.ttehmedialarabic=64361,t.tthabengali=2464,t.tthadeva=2336,t.tthagujarati=2720,t.tthagurmukhi=2592,t.tturned=647,t.tuhiragana=12388,t.tukatakana=12484,t.tukatakanahalfwidth=65410,t.tusmallhiragana=12387,t.tusmallkatakana=12483,t.tusmallkatakanahalfwidth=65391,t.twelvecircle=9323,t.twelveparen=9343,t.twelveperiod=9363,t.twelveroman=8571,t.twentycircle=9331,t.twentyhangzhou=21316,t.twentyparen=9351,t.twentyperiod=9371,t.two=50,t.twoarabic=1634,t.twobengali=2536,t.twocircle=9313,t.twocircleinversesansserif=10123,t.twodeva=2408,t.twodotenleader=8229,t.twodotleader=8229,t.twodotleadervertical=65072,t.twogujarati=2792,t.twogurmukhi=2664,t.twohackarabic=1634,t.twohangzhou=12322,t.twoideographicparen=12833,t.twoinferior=8322,t.twomonospace=65298,t.twonumeratorbengali=2549,t.twooldstyle=63282,t.twoparen=9333,t.twoperiod=9353,t.twopersian=1778,t.tworoman=8561,t.twostroke=443,t.twosuperior=178,t.twothai=3666,t.twothirds=8532,t.u=117,t.uacute=250,t.ubar=649,t.ubengali=2441,t.ubopomofo=12584,t.ubreve=365,t.ucaron=468,t.ucircle=9444,t.ucircumflex=251,t.ucircumflexbelow=7799,t.ucyrillic=1091,t.udattadeva=2385,t.udblacute=369,t.udblgrave=533,t.udeva=2313,t.udieresis=252,t.udieresisacute=472,t.udieresisbelow=7795,t.udieresiscaron=474,t.udieresiscyrillic=1265,t.udieresisgrave=476,t.udieresismacron=470,t.udotbelow=7909,t.ugrave=249,t.ugujarati=2697,t.ugurmukhi=2569,t.uhiragana=12358,t.uhookabove=7911,t.uhorn=432,t.uhornacute=7913,t.uhorndotbelow=7921,t.uhorngrave=7915,t.uhornhookabove=7917,t.uhorntilde=7919,t.uhungarumlaut=369,t.uhungarumlautcyrillic=1267,t.uinvertedbreve=535,t.ukatakana=12454,t.ukatakanahalfwidth=65395,t.ukcyrillic=1145,t.ukorean=12636,t.umacron=363,t.umacroncyrillic=1263,t.umacrondieresis=7803,t.umatragurmukhi=2625,t.umonospace=65365,t.underscore=95,t.underscoredbl=8215,t.underscoremonospace=65343,t.underscorevertical=65075,t.underscorewavy=65103,t.union=8746,t.universal=8704,t.uogonek=371,t.uparen=9392,t.upblock=9600,t.upperdothebrew=1476,t.upsilon=965,t.upsilondieresis=971,t.upsilondieresistonos=944,t.upsilonlatin=650,t.upsilontonos=973,t.uptackbelowcmb=797,t.uptackmod=724,t.uragurmukhi=2675,t.uring=367,t.ushortcyrillic=1118,t.usmallhiragana=12357,t.usmallkatakana=12453,t.usmallkatakanahalfwidth=65385,t.ustraightcyrillic=1199,t.ustraightstrokecyrillic=1201,t.utilde=361,t.utildeacute=7801,t.utildebelow=7797,t.uubengali=2442,t.uudeva=2314,t.uugujarati=2698,t.uugurmukhi=2570,t.uumatragurmukhi=2626,t.uuvowelsignbengali=2498,t.uuvowelsigndeva=2370,t.uuvowelsigngujarati=2754,t.uvowelsignbengali=2497,t.uvowelsigndeva=2369,t.uvowelsigngujarati=2753,t.v=118,t.vadeva=2357,t.vagujarati=2741,t.vagurmukhi=2613,t.vakatakana=12535,t.vav=1493,t.vavdagesh=64309,t.vavdagesh65=64309,t.vavdageshhebrew=64309,t.vavhebrew=1493,t.vavholam=64331,t.vavholamhebrew=64331,t.vavvavhebrew=1520,t.vavyodhebrew=1521,t.vcircle=9445,t.vdotbelow=7807,t.vecyrillic=1074,t.veharabic=1700,t.vehfinalarabic=64363,t.vehinitialarabic=64364,t.vehmedialarabic=64365,t.vekatakana=12537,t.venus=9792,t.verticalbar=124,t.verticallineabovecmb=781,t.verticallinebelowcmb=809,t.verticallinelowmod=716,t.verticallinemod=712,t.vewarmenian=1406,t.vhook=651,t.vikatakana=12536,t.viramabengali=2509,t.viramadeva=2381,t.viramagujarati=2765,t.visargabengali=2435,t.visargadeva=2307,t.visargagujarati=2691,t.vmonospace=65366,t.voarmenian=1400,t.voicediterationhiragana=12446,t.voicediterationkatakana=12542,t.voicedmarkkana=12443,t.voicedmarkkanahalfwidth=65438,t.vokatakana=12538,t.vparen=9393,t.vtilde=7805,t.vturned=652,t.vuhiragana=12436,t.vukatakana=12532,t.w=119,t.wacute=7811,t.waekorean=12633,t.wahiragana=12431,t.wakatakana=12527,t.wakatakanahalfwidth=65436,t.wakorean=12632,t.wasmallhiragana=12430,t.wasmallkatakana=12526,t.wattosquare=13143,t.wavedash=12316,t.wavyunderscorevertical=65076,t.wawarabic=1608,t.wawfinalarabic=65262,t.wawhamzaabovearabic=1572,t.wawhamzaabovefinalarabic=65158,t.wbsquare=13277,t.wcircle=9446,t.wcircumflex=373,t.wdieresis=7813,t.wdotaccent=7815,t.wdotbelow=7817,t.wehiragana=12433,t.weierstrass=8472,t.wekatakana=12529,t.wekorean=12638,t.weokorean=12637,t.wgrave=7809,t.whitebullet=9702,t.whitecircle=9675,t.whitecircleinverse=9689,t.whitecornerbracketleft=12302,t.whitecornerbracketleftvertical=65091,t.whitecornerbracketright=12303,t.whitecornerbracketrightvertical=65092,t.whitediamond=9671,t.whitediamondcontainingblacksmalldiamond=9672,t.whitedownpointingsmalltriangle=9663;t.whitedownpointingtriangle=9661,t.whiteleftpointingsmalltriangle=9667,t.whiteleftpointingtriangle=9665,t.whitelenticularbracketleft=12310,t.whitelenticularbracketright=12311,t.whiterightpointingsmalltriangle=9657,t.whiterightpointingtriangle=9655,t.whitesmallsquare=9643,t.whitesmilingface=9786,t.whitesquare=9633,t.whitestar=9734,t.whitetelephone=9743,t.whitetortoiseshellbracketleft=12312,t.whitetortoiseshellbracketright=12313,t.whiteuppointingsmalltriangle=9653,t.whiteuppointingtriangle=9651,t.wihiragana=12432,t.wikatakana=12528,t.wikorean=12639,t.wmonospace=65367,t.wohiragana=12434,t.wokatakana=12530,t.wokatakanahalfwidth=65382,t.won=8361,t.wonmonospace=65510,t.wowaenthai=3623,t.wparen=9394,t.wring=7832,t.wsuperior=695,t.wturned=653,t.wynn=447,t.x=120,t.xabovecmb=829,t.xbopomofo=12562,t.xcircle=9447,t.xdieresis=7821,t.xdotaccent=7819,t.xeharmenian=1389,t.xi=958,t.xmonospace=65368,t.xparen=9395,t.xsuperior=739,t.y=121,t.yaadosquare=13134,t.yabengali=2479,t.yacute=253,t.yadeva=2351,t.yaekorean=12626,t.yagujarati=2735,t.yagurmukhi=2607,t.yahiragana=12420,t.yakatakana=12516,t.yakatakanahalfwidth=65428,t.yakorean=12625,t.yamakkanthai=3662,t.yasmallhiragana=12419,t.yasmallkatakana=12515,t.yasmallkatakanahalfwidth=65388,t.yatcyrillic=1123,t.ycircle=9448,t.ycircumflex=375,t.ydieresis=255,t.ydotaccent=7823,t.ydotbelow=7925,t.yeharabic=1610,t.yehbarreearabic=1746,t.yehbarreefinalarabic=64431,t.yehfinalarabic=65266,t.yehhamzaabovearabic=1574,t.yehhamzaabovefinalarabic=65162,t.yehhamzaaboveinitialarabic=65163,t.yehhamzaabovemedialarabic=65164,t.yehinitialarabic=65267,t.yehmedialarabic=65268,t.yehmeeminitialarabic=64733,t.yehmeemisolatedarabic=64600,t.yehnoonfinalarabic=64660,t.yehthreedotsbelowarabic=1745,t.yekorean=12630,t.yen=165,t.yenmonospace=65509,t.yeokorean=12629,t.yeorinhieuhkorean=12678,t.yerahbenyomohebrew=1450,t.yerahbenyomolefthebrew=1450,t.yericyrillic=1099,t.yerudieresiscyrillic=1273,t.yesieungkorean=12673,t.yesieungpansioskorean=12675,t.yesieungsioskorean=12674,t.yetivhebrew=1434,t.ygrave=7923,t.yhook=436,t.yhookabove=7927,t.yiarmenian=1397,t.yicyrillic=1111,t.yikorean=12642,t.yinyang=9775,t.yiwnarmenian=1410,t.ymonospace=65369,t.yod=1497,t.yoddagesh=64313,t.yoddageshhebrew=64313,t.yodhebrew=1497,t.yodyodhebrew=1522,t.yodyodpatahhebrew=64287,t.yohiragana=12424,t.yoikorean=12681,t.yokatakana=12520,t.yokatakanahalfwidth=65430,t.yokorean=12635,t.yosmallhiragana=12423,t.yosmallkatakana=12519,t.yosmallkatakanahalfwidth=65390,t.yotgreek=1011,t.yoyaekorean=12680,t.yoyakorean=12679,t.yoyakthai=3618,t.yoyingthai=3597,t.yparen=9396,t.ypogegrammeni=890,t.ypogegrammenigreekcmb=837,t.yr=422,t.yring=7833,t.ysuperior=696,t.ytilde=7929,t.yturned=654,t.yuhiragana=12422,t.yuikorean=12684,t.yukatakana=12518,t.yukatakanahalfwidth=65429,t.yukorean=12640,t.yusbigcyrillic=1131,t.yusbigiotifiedcyrillic=1133,t.yuslittlecyrillic=1127,t.yuslittleiotifiedcyrillic=1129,t.yusmallhiragana=12421,t.yusmallkatakana=12517,t.yusmallkatakanahalfwidth=65389,t.yuyekorean=12683,t.yuyeokorean=12682,t.yyabengali=2527,t.yyadeva=2399,t.z=122,t.zaarmenian=1382,t.zacute=378,t.zadeva=2395,t.zagurmukhi=2651,t.zaharabic=1592,t.zahfinalarabic=65222,t.zahinitialarabic=65223,t.zahiragana=12374,t.zahmedialarabic=65224,t.zainarabic=1586,t.zainfinalarabic=65200,t.zakatakana=12470,t.zaqefgadolhebrew=1429,t.zaqefqatanhebrew=1428,t.zarqahebrew=1432,t.zayin=1494,t.zayindagesh=64310,t.zayindageshhebrew=64310,t.zayinhebrew=1494,t.zbopomofo=12567,t.zcaron=382,t.zcircle=9449,t.zcircumflex=7825,t.zcurl=657,t.zdot=380,t.zdotaccent=380,t.zdotbelow=7827,t.zecyrillic=1079,t.zedescendercyrillic=1177,t.zedieresiscyrillic=1247,t.zehiragana=12380,t.zekatakana=12476,t.zero=48,t.zeroarabic=1632,t.zerobengali=2534,t.zerodeva=2406,t.zerogujarati=2790,t.zerogurmukhi=2662,t.zerohackarabic=1632,t.zeroinferior=8320,t.zeromonospace=65296,t.zerooldstyle=63280,t.zeropersian=1776,t.zerosuperior=8304,t.zerothai=3664,t.zerowidthjoiner=65279,t.zerowidthnonjoiner=8204,t.zerowidthspace=8203,t.zeta=950,t.zhbopomofo=12563,t.zhearmenian=1386,t.zhebrevecyrillic=1218,t.zhecyrillic=1078,t.zhedescendercyrillic=1175,t.zhedieresiscyrillic=1245,t.zihiragana=12376,t.zikatakana=12472,t.zinorhebrew=1454,t.zlinebelow=7829,t.zmonospace=65370,t.zohiragana=12382,t.zokatakana=12478,t.zparen=9397,t.zretroflexhook=656,t.zstroke=438,t.zuhiragana=12378,t.zukatakana=12474,t[".notdef"]=0,t.angbracketleftbig=9001,t.angbracketleftBig=9001,t.angbracketleftbigg=9001,t.angbracketleftBigg=9001,t.angbracketrightBig=9002,t.angbracketrightbig=9002,t.angbracketrightBigg=9002,t.angbracketrightbigg=9002,t.arrowhookleft=8618,t.arrowhookright=8617,t.arrowlefttophalf=8636,t.arrowleftbothalf=8637,t.arrownortheast=8599,t.arrownorthwest=8598,t.arrowrighttophalf=8640,t.arrowrightbothalf=8641,t.arrowsoutheast=8600,t.arrowsouthwest=8601,t.backslashbig=8726,t.backslashBig=8726,t.backslashBigg=8726,t.backslashbigg=8726,t.bardbl=8214,t.bracehtipdownleft=65079,t.bracehtipdownright=65079,t.bracehtipupleft=65080,t.bracehtipupright=65080,t.braceleftBig=123,t.braceleftbig=123,t.braceleftbigg=123,t.braceleftBigg=123,t.bracerightBig=125,t.bracerightbig=125,t.bracerightbigg=125,t.bracerightBigg=125,t.bracketleftbig=91,t.bracketleftBig=91,t.bracketleftbigg=91,t.bracketleftBigg=91,t.bracketrightBig=93,t.bracketrightbig=93,t.bracketrightbigg=93,t.bracketrightBigg=93,t.ceilingleftbig=8968,t.ceilingleftBig=8968,t.ceilingleftBigg=8968,t.ceilingleftbigg=8968,t.ceilingrightbig=8969,t.ceilingrightBig=8969,t.ceilingrightbigg=8969,t.ceilingrightBigg=8969,t.circledotdisplay=8857,t.circledottext=8857,t.circlemultiplydisplay=8855,t.circlemultiplytext=8855,t.circleplusdisplay=8853,t.circleplustext=8853,t.contintegraldisplay=8750,t.contintegraltext=8750,t.coproductdisplay=8720,t.coproducttext=8720,t.floorleftBig=8970,t.floorleftbig=8970,t.floorleftbigg=8970,t.floorleftBigg=8970,t.floorrightbig=8971,t.floorrightBig=8971,t.floorrightBigg=8971,t.floorrightbigg=8971,t.hatwide=770,t.hatwider=770,t.hatwidest=770,t.intercal=7488,t.integraldisplay=8747,t.integraltext=8747,t.intersectiondisplay=8898,t.intersectiontext=8898,t.logicalanddisplay=8743,t.logicalandtext=8743,t.logicalordisplay=8744,t.logicalortext=8744,t.parenleftBig=40,t.parenleftbig=40,t.parenleftBigg=40,t.parenleftbigg=40,t.parenrightBig=41,t.parenrightbig=41,t.parenrightBigg=41,t.parenrightbigg=41,t.prime=8242,t.productdisplay=8719,t.producttext=8719,t.radicalbig=8730,t.radicalBig=8730,t.radicalBigg=8730,t.radicalbigg=8730,t.radicalbt=8730,t.radicaltp=8730,t.radicalvertex=8730,t.slashbig=47,t.slashBig=47,t.slashBigg=47,t.slashbigg=47,t.summationdisplay=8721,t.summationtext=8721,t.tildewide=732,t.tildewider=732,t.tildewidest=732,t.uniondisplay=8899,t.unionmultidisplay=8846,t.unionmultitext=8846,t.unionsqdisplay=8852,t.unionsqtext=8852,t.uniontext=8899,t.vextenddouble=8741,t.vextendsingle=8739}),getDingbatsGlyphsUnicode=getLookupTableFactory(function(t){t.space=32,t.a1=9985,t.a2=9986,t.a202=9987,t.a3=9988,t.a4=9742,t.a5=9990,t.a119=9991,t.a118=9992,t.a117=9993,t.a11=9755,t.a12=9758,t.a13=9996,t.a14=9997,t.a15=9998,t.a16=9999,t.a105=1e4,t.a17=10001,t.a18=10002,t.a19=10003,t.a20=10004,t.a21=10005,t.a22=10006,t.a23=10007,t.a24=10008,t.a25=10009,t.a26=10010,t.a27=10011,t.a28=10012,t.a6=10013,t.a7=10014,t.a8=10015,t.a9=10016,t.a10=10017,t.a29=10018,t.a30=10019,t.a31=10020,t.a32=10021,t.a33=10022,t.a34=10023,t.a35=9733,t.a36=10025,t.a37=10026,t.a38=10027,t.a39=10028,t.a40=10029,t.a41=10030,t.a42=10031,t.a43=10032,t.a44=10033,t.a45=10034,t.a46=10035,t.a47=10036,t.a48=10037,t.a49=10038,t.a50=10039,t.a51=10040,t.a52=10041,t.a53=10042,t.a54=10043,t.a55=10044,t.a56=10045,t.a57=10046,t.a58=10047,t.a59=10048,t.a60=10049,t.a61=10050,t.a62=10051,t.a63=10052,t.a64=10053,t.a65=10054,t.a66=10055,t.a67=10056,t.a68=10057,t.a69=10058,t.a70=10059,t.a71=9679,t.a72=10061,t.a73=9632,t.a74=10063,t.a203=10064,t.a75=10065,t.a204=10066,t.a76=9650,t.a77=9660,t.a78=9670,t.a79=10070,t.a81=9687,t.a82=10072,t.a83=10073,t.a84=10074,t.a97=10075,t.a98=10076,t.a99=10077,t.a100=10078,t.a101=10081,t.a102=10082,t.a103=10083,t.a104=10084,t.a106=10085,t.a107=10086,t.a108=10087,t.a112=9827,t.a111=9830,t.a110=9829,t.a109=9824,t.a120=9312,t.a121=9313,t.a122=9314,t.a123=9315,t.a124=9316,t.a125=9317,t.a126=9318,t.a127=9319,t.a128=9320,t.a129=9321,t.a130=10102,t.a131=10103,t.a132=10104,t.a133=10105,t.a134=10106,t.a135=10107,t.a136=10108,t.a137=10109,t.a138=10110,t.a139=10111,t.a140=10112,t.a141=10113,t.a142=10114,t.a143=10115,t.a144=10116,t.a145=10117,t.a146=10118,t.a147=10119,t.a148=10120,t.a149=10121,t.a150=10122,t.a151=10123,t.a152=10124,t.a153=10125,t.a154=10126,t.a155=10127,t.a156=10128,t.a157=10129,t.a158=10130,t.a159=10131,t.a160=10132,t.a161=8594,t.a163=8596,t.a164=8597,t.a196=10136,t.a165=10137,t.a192=10138,t.a166=10139,t.a167=10140,t.a168=10141,t.a169=10142,t.a170=10143,t.a171=10144,t.a172=10145,t.a173=10146,t.a162=10147,t.a174=10148,t.a175=10149,t.a176=10150,t.a177=10151,t.a178=10152,t.a179=10153,t.a193=10154,t.a180=10155,t.a199=10156,t.a181=10157,t.a200=10158,t.a182=10159,t.a201=10161,t.a183=10162,t.a184=10163,t.a197=10164,t.a185=10165,t.a194=10166,t.a198=10167,t.a186=10168,t.a195=10169,t.a187=10170,t.a188=10171,t.a189=10172,t.a190=10173,t.a191=10174,t.a89=10088,t.a90=10089,t.a93=10090,t.a94=10091,t.a91=10092,t.a92=10093,t.a205=10094,t.a85=10095,t.a206=10096,t.a86=10097,t.a87=10098,t.a88=10099,t.a95=10100,t.a96=10101,t[".notdef"]=0}),getSpecialPUASymbols=getLookupTableFactory(function(t){t[63721]=169,t[63193]=169,t[63720]=174,t[63194]=174,t[63722]=8482,t[63195]=8482,t[63729]=9127,t[63730]=9128,t[63731]=9129,t[63740]=9131,t[63741]=9132,t[63742]=9133,t[63726]=9121,t[63727]=9122,t[63728]=9123,t[63737]=9124,t[63738]=9125,t[63739]=9126,t[63723]=9115,t[63724]=9116,t[63725]=9117,t[63734]=9118,t[63735]=9119,t[63736]=9120});function mapSpecialUnicodeValues(code){return 65520<=code&&code<=65535?0:62976<=code&&code<=63743?getSpecialPUASymbols()[code]||code:173===code?45:code}function getUnicodeForGlyph(name,glyphsUnicodeMap){glyphsUnicodeMap=glyphsUnicodeMap[name];if(void 0!==glyphsUnicodeMap)return glyphsUnicodeMap;if(name&&"u"===name[0]){var hexStr,nameLen=name.length;if(7===nameLen&&"n"===name[1]&&"i"===name[2])hexStr=name.substring(3);else{if(!(5<=nameLen&&nameLen<=7))return-1;hexStr=name.substring(1)}if(hexStr===hexStr.toUpperCase()&&0<=(glyphsUnicodeMap=parseInt(hexStr,16)))return glyphsUnicodeMap}return-1}var UnicodeRanges=[[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(value){var lastPosition=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1;if(-1!==lastPosition)for(var range=UnicodeRanges[lastPosition],i=0,ii=range.length;i<ii;i+=2)if(value>=range[i]&&value<=range[i+1])return lastPosition;for(var _i22=0,_ii6=UnicodeRanges.length;_i22<_ii6;_i22++)for(var _range=UnicodeRanges[_i22],j=0,jj=_range.length;j<jj;j+=2)if(value>=_range[j]&&value<=_range[j+1])return _i22;return-1}var SpecialCharRegExp=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),CategoryCache=new Map;function getCharUnicodeCategory(char){var cachedCategory=CategoryCache.get(char);return cachedCategory||(cachedCategory={isWhitespace:!(null==(cachedCategory=char.match(SpecialCharRegExp))||!cachedCategory[1]),isZeroWidthDiacritic:!(null==cachedCategory||!cachedCategory[2]),isInvisibleFormatMark:!(null==cachedCategory||!cachedCategory[3])},CategoryCache.set(char,cachedCategory),cachedCategory)}function clearUnicodeCaches(){CategoryCache.clear()}var SEAC_ANALYSIS_ENABLED=!0,FontFlags={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144},MacStandardGlyphOrdering=[".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(name,glyphsUnicodeMap){if(void 0===glyphsUnicodeMap[name]){var unicode=getUnicodeForGlyph(name,glyphsUnicodeMap);if(-1!==unicode)for(var key in glyphsUnicodeMap)if(glyphsUnicodeMap[key]===unicode)return key;info("Unable to recover a standard glyph name for: "+name)}return name}function type1FontGlyphMapping(properties,builtInEncoding,glyphNames){var charCode,baseEncoding,charCodeToGlyphId=Object.create(null),isSymbolicFont=!!(properties.flags&FontFlags.Symbolic);if(properties.isInternalFont)for(baseEncoding=builtInEncoding,charCode=0;charCode<baseEncoding.length;charCode++)glyphId=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=0<=glyphId?glyphId:0;else if(properties.baseEncodingName)for(baseEncoding=getEncoding(properties.baseEncodingName),charCode=0;charCode<baseEncoding.length;charCode++)glyphId=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=0<=glyphId?glyphId:0;else if(isSymbolicFont)for(charCode in builtInEncoding)charCodeToGlyphId[charCode]=builtInEncoding[charCode];else for(baseEncoding=StandardEncoding,charCode=0;charCode<baseEncoding.length;charCode++)glyphId=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=0<=glyphId?glyphId:0;var differences=properties.differences;if(differences)for(charCode in differences){var glyphsUnicodeMap,standardGlyphName,glyphId,glyphName=differences[charCode];-1===(glyphId=glyphNames.indexOf(glyphName))&&(standardGlyphName=recoverGlyphName(glyphName,glyphsUnicodeMap=glyphsUnicodeMap||getGlyphsUnicode()))!==glyphName&&(glyphId=glyphNames.indexOf(standardGlyphName)),charCodeToGlyphId[charCode]=0<=glyphId?glyphId:0}return charCodeToGlyphId}function normalizeFontName(name){return name.replaceAll(/[,_]/g,"-").replaceAll(/\s/g,"")}var getVerticalPresentationForm=getLookupTableFactory(t=>{t[8211]=65074,t[8212]=65073,t[8229]=65072,t[8230]=65049,t[12289]=65041,t[12290]=65042,t[12296]=65087,t[12297]=65088,t[12298]=65085,t[12299]=65086,t[12300]=65089,t[12301]=65090,t[12302]=65091,t[12303]=65092,t[12304]=65083,t[12305]=65084,t[12308]=65081,t[12309]=65082,t[12310]=65047,t[12311]=65048,t[65103]=65076,t[65281]=65045,t[65288]=65077,t[65289]=65078,t[65292]=65040,t[65306]=65043,t[65307]=65044,t[65311]=65046,t[65339]=65095,t[65341]=65096,t[65343]=65075,t[65371]=65079,t[65373]=65080}),MAX_SIZE_TO_COMPILE=1e3;function compileType3Glyph(_ref14){var{data:_ref14,width,height}=_ref14;if(MAX_SIZE_TO_COMPILE<width||MAX_SIZE_TO_COMPILE<height)return null;var j0,elem,POINT_TYPES=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),width1=width+1,points=new Uint8Array(width1*(height+1)),lineSize=width+7&-8,data=new Uint8Array(lineSize*height),pos=0;for(elem of _ref14)for(var mask=128;0<mask;)data[pos++]=elem&mask?0:255,mask>>=1;var count=0;for(0!==data[pos=0]&&(points[0]=1,++count),j=1;j<width;j++)data[pos]!==data[pos+1]&&(points[j]=data[pos]?2:1,++count),pos++;for(0!==data[pos]&&(points[j]=2,++count),i=1;i<height;i++){j0=i*width1,data[(pos=i*lineSize)-lineSize]!==data[pos]&&(points[j0]=data[pos]?1:8,++count);for(var sum=(data[pos]?4:0)+(data[pos-lineSize]?8:0),j=1;j<width;j++)POINT_TYPES[sum=(sum>>2)+(data[pos+1]?4:0)+(data[pos-lineSize+1]?8:0)]&&(points[j0+j]=POINT_TYPES[sum],++count),pos++;if(data[pos-lineSize]!==data[pos]&&(points[j0+j]=data[pos]?2:4,++count),1e3<count)return null}for(j0=i*width1,0!==data[pos=lineSize*(height-1)]&&(points[j0]=8,++count),j=1;j<width;j++)data[pos]!==data[pos+1]&&(points[j0+j]=data[pos]?4:8,++count),pos++;if(0!==data[pos]&&(points[j0+j]=4,++count),1e3<count)return null;for(var steps=new Int32Array([0,width1,-1,0,-width1,0,0,0,1]),pathBuf=[],{a,b,c,d,e,f}=(new DOMMatrix).scaleSelf(1/width,-1/height).translateSelf(0,-height),i=0;count&&i<=height;i++){for(var p=i*width1,end=p+width;p<end&&!points[p];)p++;if(p!==end){var x=p%width1,y=i,p0=(pathBuf.push(DrawOPS.moveTo,a*x+c*y+e,b*x+d*y+f),p),type=points[p];do{for(var step=steps[type];!points[p+=step];);var pp=points[p]}while(5!==pp&&10!==pp?(type=pp,points[p]=0):points[p]&=(type=pp&51*type>>4)>>2|type<<2,pathBuf.push(DrawOPS.lineTo,a*(x=p%width1)+c*(y=p/width1|0)+e,b*x+d*y+f),points[p]||--count,p0!==p);--i}}return[OPS.rawFillPath,[new Float32Array(pathBuf)],new Float32Array([0,0,width,height])]}var ISOAdobeCharset=[".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"],ExpertCharset=[".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"],ExpertSubsetCharset=[".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"],MAX_SUBR_NESTING=10,CFFStandardStrings=[".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"],NUM_STANDARD_CFF_STRINGS=391,CharstringValidationData=[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}],CharstringValidationData12=[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(stack,index){stack[index-2]=stack[index-2]+stack[index-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(stack,index){stack[index-2]=stack[index-2]-stack[index-1]}},{id:"div",min:2,stackDelta:-1,stackFn(stack,index){stack[index-2]=stack[index-2]/stack[index-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(stack,index){stack[index-1]=-stack[index-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(stack,index){stack[index-2]=stack[index-2]*stack[index-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(file,properties,seacAnalysisEnabled){this.bytes=file.getBytes(),this.properties=properties,this.seacAnalysisEnabled=!!seacAnalysisEnabled}parse(){var charset,encoding,properties=this.properties,cff=new CFF,header=(this.cff=cff,this.parseHeader()),nameIndex=this.parseIndex(header.endPos),topDictIndex=this.parseIndex(nameIndex.endPos),stringIndex=this.parseIndex(topDictIndex.endPos),globalSubrIndex=this.parseIndex(stringIndex.endPos),topDictIndex=this.parseDict(topDictIndex.obj.get(0)),topDictIndex=this.createDict(CFFTopDict,topDictIndex,cff.strings),header=(cff.header=header.obj,cff.names=this.parseNameIndex(nameIndex.obj),cff.strings=this.parseStringIndex(stringIndex.obj),cff.topDict=topDictIndex,cff.globalSubrIndex=globalSubrIndex.obj,this.parsePrivateDict(cff.topDict),cff.isCIDFont=topDictIndex.hasName("ROS"),topDictIndex.getByName("CharStrings")),nameIndex=this.parseIndex(header).obj,stringIndex=topDictIndex.getByName("FontMatrix"),header=(stringIndex&&(properties.fontMatrix=stringIndex),topDictIndex.getByName("FontBBox"));if(header&&(properties.ascent=Math.max(header[3],header[1]),properties.descent=Math.min(header[1],header[3]),properties.ascentScaled=!0),cff.isCIDFont){for(var fdArrayIndex=this.parseIndex(topDictIndex.getByName("FDArray")).obj,i=0,ii=fdArrayIndex.count;i<ii;++i){var dictRaw=fdArrayIndex.get(i),dictRaw=this.createDict(CFFTopDict,this.parseDict(dictRaw),cff.strings);this.parsePrivateDict(dictRaw),cff.fdArray.push(dictRaw)}encoding=null,charset=this.parseCharsets(topDictIndex.getByName("charset"),nameIndex.count,cff.strings,!0),cff.fdSelect=this.parseFDSelect(topDictIndex.getByName("FDSelect"),nameIndex.count)}else charset=this.parseCharsets(topDictIndex.getByName("charset"),nameIndex.count,cff.strings,!1),encoding=this.parseEncoding(topDictIndex.getByName("Encoding"),properties,cff.strings,charset.charset);cff.charset=charset,cff.encoding=encoding;stringIndex=this.parseCharStrings({charStrings:nameIndex,localSubrIndex:topDictIndex.privateDict.subrsIndex,globalSubrIndex:globalSubrIndex.obj,fdSelect:cff.fdSelect,fdArray:cff.fdArray,privateDict:topDictIndex.privateDict});return cff.charStrings=stringIndex.charStrings,cff.seacs=stringIndex.seacs,cff.widths=stringIndex.widths,cff}parseHeader(){for(var bytes=this.bytes,bytesLength=bytes.length,offset=0;offset<bytesLength&&1!==bytes[offset];)++offset;if(bytesLength<=offset)throw new FormatError("Invalid CFF header");0!==offset&&(info("cff data is shifted"),bytes=bytes.subarray(offset),this.bytes=bytes);var major=bytes[0],minor=bytes[1],hdrSize=bytes[2],offSize=bytes[3];return{obj:new CFFHeader(major,minor,hdrSize,offSize),endPos:hdrSize}}parseDict(dict){var pos=0;function parseOperand(){var value=dict[pos++];if(30!==value)return 28===value?(value=readInt16(dict,pos),pos+=2,value):29===value?(value=(value=(value=dict[pos++])<<8|dict[pos++])<<8|dict[pos++])<<8|dict[pos++]:32<=value&&value<=246?value-139:247<=value&&value<=250?256*(value-247)+dict[pos++]+108:251<=value&&value<=254?-256*(value-251)-dict[pos++]-108:(warn('CFFParser_parseDict: "'+value+'" is a reserved command.'),NaN);for(var str="",lookup=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],length=dict.length;pos<length;){var b=dict[pos++],b1=b>>4,b=15&b;if(15==b1)break;if(str+=lookup[b1],15==b)break;str+=lookup[b]}return parseFloat(str)}for(var operands=[],entries=[],pos=0,end=dict.length;pos<end;){var b=dict[pos];b<=21?(12===b&&(b=b<<8|dict[++pos]),entries.push([b,operands]),operands=[],++pos):operands.push(parseOperand())}return entries}parseIndex(pos){var cffIndex=new CFFIndex,bytes=this.bytes,count=bytes[pos++]<<8|bytes[pos++],offsets=[],end=pos;if(0!=count){for(var offsetSize=bytes[pos++],startPos=pos+(1+count)*offsetSize-1,i=0,ii=1+count;i<ii;++i){for(var offset=0,j=0;j<offsetSize;++j)offset=(offset<<=8)+bytes[pos++];offsets.push(startPos+offset)}end=offsets[count]}for(i=0,ii=offsets.length-1;i<ii;++i)cffIndex.add(bytes.subarray(offsets[i],offsets[i+1]));return{obj:cffIndex,endPos:end}}parseNameIndex(index){for(var names=[],i=0,ii=index.count;i<ii;++i){var name=index.get(i);names.push(bytesToString(name))}return names}parseStringIndex(index){for(var strings=new CFFStrings,i=0,ii=index.count;i<ii;++i){var data=index.get(i);strings.add(bytesToString(data))}return strings}createDict(Type,dict,strings){var key,value,cffDict=new Type(strings);for([key,value]of dict)cffDict.setByKey(key,value);return cffDict}parseCharString(state,data,localSubrIndex,globalSubrIndex){if(!data||state.callDepth>MAX_SUBR_NESTING)return!1;for(var stackSize=state.stackSize,stack=state.stack,length=data.length,j=0;j<length;){var value=data[j++],validationCommand=null;if(12===value){var q=data[j++];0===q?(data[j-2]=139,data[j-1]=22,stackSize=0):validationCommand=CharstringValidationData12[q]}else if(28===value)stack[stackSize]=readInt16(data,j),j+=2,stackSize++;else if(14===value){if(4<=stackSize&&(stackSize-=4,this.seacAnalysisEnabled))return state.seac=stack.slice(stackSize,stackSize+4),!1;validationCommand=CharstringValidationData[value]}else if(32<=value&&value<=246)stack[stackSize]=value-139,stackSize++;else if(247<=value&&value<=254)stack[stackSize]=value<251?(value-247<<8)+data[j]+108:-(value-251<<8)-data[j]-108,j++,stackSize++;else if(255===value)stack[stackSize]=(data[j]<<24|data[j+1]<<16|data[j+2]<<8|data[j+3])/65536,j+=4,stackSize++;else if(19===value||20===value){if(state.hints+=stackSize>>1,0===state.hints){data.copyWithin(j-1,j,-1),--j,--length;continue}j+=state.hints+7>>3,stackSize%=2,validationCommand=CharstringValidationData[value]}else{if(10===value||29===value){q=10===value?localSubrIndex:globalSubrIndex;if(!q)return warn("Missing subrsIndex for "+(validationCommand=CharstringValidationData[value]).id),!1;var bias=32768,bias=(q.count<1240?bias=107:q.count<33900&&(bias=1131),stack[--stackSize]+bias);if(bias<0||bias>=q.count||isNaN(bias))return warn("Out of bounds subrIndex for "+(validationCommand=CharstringValidationData[value]).id),!1;if(state.stackSize=stackSize,state.callDepth++,!this.parseCharString(state,q.get(bias),localSubrIndex,globalSubrIndex))return!1;state.callDepth--,stackSize=state.stackSize;continue}if(11===value)return state.stackSize=stackSize,!0;if(0===value&&j===data.length)data[j-1]=14,validationCommand=CharstringValidationData[14];else{if(9===value){data.copyWithin(j-1,j,-1),--j,--length;continue}validationCommand=CharstringValidationData[value]}}if(validationCommand){if(validationCommand.stem&&(state.hints+=stackSize>>1,3===value||23===value?state.hasVStems=!0:!state.hasVStems||1!==value&&18!==value||(warn("CFF stem hints are in wrong order"),data[j-1]=1===value?3:23)),"min"in validationCommand&&!state.undefStack&&stackSize<validationCommand.min)return warn("Not enough parameters for "+validationCommand.id+"; actual: "+stackSize+", expected: "+validationCommand.min),0===stackSize&&(data[j-1]=14,!0);state.firstStackClearing&&validationCommand.stackClearing&&(state.firstStackClearing=!1,2<=(stackSize-=validationCommand.min)&&validationCommand.stem?stackSize%=2:1<stackSize&&warn("Found too many parameters for stack-clearing command"),0<stackSize)&&(state.width=stack[stackSize-1]),"stackDelta"in validationCommand?("stackFn"in validationCommand&&validationCommand.stackFn(stack,stackSize),stackSize+=validationCommand.stackDelta):validationCommand.stackClearing?stackSize=0:validationCommand.resetStack?(stackSize=0,state.undefStack=!1):validationCommand.undefStack&&(state.undefStack=!(stackSize=0),state.firstStackClearing=!1)}}return length<data.length&&data.fill(14,length),state.stackSize=stackSize,!0}parseCharStrings(_ref15){for(var{charStrings,localSubrIndex,globalSubrIndex,fdSelect,fdArray,privateDict}=_ref15,seacs=[],widths=[],count=charStrings.count,i=0;i<count;i++){var fdIndex,charstring=charStrings.get(i),state={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1},valid=!0,localSubrToUse=null,privateDictToUse=privateDict;fdSelect&&fdArray.length?(-1===(fdIndex=fdSelect.getFDIndex(i))&&(warn("Glyph index is not in fd select."),valid=!1),fdIndex>=fdArray.length&&(warn("Invalid fd index for glyph index."),valid=!1),valid&&(localSubrToUse=(privateDictToUse=fdArray[fdIndex].privateDict).subrsIndex)):localSubrIndex&&(localSubrToUse=localSubrIndex),valid=valid&&this.parseCharString(state,charstring,localSubrToUse,globalSubrIndex),null!==state.width?(fdIndex=privateDictToUse.getByName("nominalWidthX"),widths[i]=fdIndex+state.width):(charstring=privateDictToUse.getByName("defaultWidthX"),widths[i]=charstring),null!==state.seac&&(seacs[i]=state.seac),valid||charStrings.set(i,new Uint8Array([14]))}return{charStrings:charStrings,seacs:seacs,widths:widths}}emptyPrivateDictionary(parentDict){var privateDict=this.createDict(CFFPrivateDict,[],parentDict.strings);parentDict.setByKey(18,[0,0]),parentDict.privateDict=privateDict}parsePrivateDict(parentDict){var size,relativeOffset,privateOffset;parentDict.hasName("Private")?(privateOffset=parentDict.getByName("Private"),Array.isArray(privateOffset)&&2===privateOffset.length?(size=privateOffset[0],privateOffset=privateOffset[1],0===size||privateOffset>=this.bytes.length?this.emptyPrivateDictionary(parentDict):(size=this.bytes.subarray(privateOffset,privateOffset+size),size=this.parseDict(size),size=this.createDict(CFFPrivateDict,size,parentDict.strings),0===(parentDict.privateDict=size).getByName("ExpansionFactor")&&size.setByName("ExpansionFactor",.06),size.getByName("Subrs")&&(relativeOffset=privateOffset+(privateOffset=size.getByName("Subrs")),0===privateOffset||relativeOffset>=this.bytes.length?this.emptyPrivateDictionary(parentDict):(privateOffset=this.parseIndex(relativeOffset),size.subrsIndex=privateOffset.obj)))):parentDict.removeByName("Private")):this.emptyPrivateDictionary(parentDict)}parseCharsets(pos,length,strings,cid){if(0===pos)return new CFFCharset(!0,CFFCharsetPredefinedTypes.ISO_ADOBE,ISOAdobeCharset);if(1===pos)return new CFFCharset(!0,CFFCharsetPredefinedTypes.EXPERT,ExpertCharset);if(2===pos)return new CFFCharset(!0,CFFCharsetPredefinedTypes.EXPERT_SUBSET,ExpertSubsetCharset);var id,count,i,bytes=this.bytes,start=pos,format=bytes[pos++],charset=[cid?0:".notdef"];switch(--length,format){case 0:for(i=0;i<length;i++)id=bytes[pos++]<<8|bytes[pos++],charset.push(cid?id:strings.get(id));break;case 1:for(;charset.length<=length;)for(id=bytes[pos++]<<8|bytes[pos++],count=bytes[pos++],i=0;i<=count;i++)charset.push(cid?id++:strings.get(id++));break;case 2:for(;charset.length<=length;)for(id=bytes[pos++]<<8|bytes[pos++],count=bytes[pos++]<<8|bytes[pos++],i=0;i<=count;i++)charset.push(cid?id++:strings.get(id++));break;default:throw new FormatError("Unknown charset format")}var end=pos,start=bytes.subarray(start,end);return new CFFCharset(!1,format,charset,start)}parseEncoding(pos,properties,strings,charset){var encoding=Object.create(null),bytes=this.bytes,predefined=!1,raw=null;if(0===pos||1===pos)for(var predefined=!0,format=pos,baseEncoding=pos?ExpertEncoding:StandardEncoding,i=0,ii=charset.length;i<ii;i++){var index=baseEncoding.indexOf(charset[i]);-1!==index&&(encoding[index]=i)}else{var dataStart=pos;switch(127&(format=bytes[pos++])){case 0:var glyphsCount=bytes[pos++];for(i=1;i<=glyphsCount;i++)encoding[bytes[pos++]]=i;break;case 1:var rangesCount=bytes[pos++],gid=1;for(i=0;i<rangesCount;i++)for(var start=bytes[pos++],left=bytes[pos++],j=start;j<=start+left;j++)encoding[j]=gid++;break;default:throw new FormatError("Unknown encoding format: ".concat(format," in CFF"))}var dataEnd=pos;if(128&format){bytes[dataStart]&=127;var supplementsCount=bytes[pos++];for(i=0;i<supplementsCount;i++){var code=bytes[pos++],sid=(bytes[pos++]<<8)+(255&bytes[pos++]);encoding[code]=charset.indexOf(strings.get(sid))}}raw=bytes.subarray(dataStart,dataEnd)}return format&=127,new CFFEncoding(predefined,format,encoding,raw)}parseFDSelect(pos,length){var bytes=this.bytes,format=bytes[pos++],fdSelect=[];switch(format){case 0:for(i=0;i<length;++i){var id=bytes[pos++];fdSelect.push(id)}break;case 3:for(var rangesCount=bytes[pos++]<<8|bytes[pos++],i=0;i<rangesCount;++i)for(var first=bytes[pos++]<<8|bytes[pos++],fdIndex=(0===i&&0!==first&&(warn("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."),first=0),bytes[pos++]),next=bytes[pos]<<8|bytes[pos+1],j=first;j<next;++j)fdSelect.push(fdIndex);pos+=2;break;default:throw new FormatError('parseFDSelect: Unknown format "'.concat(format,'".'))}if(fdSelect.length!==length)throw new FormatError("parseFDSelect: Invalid font data.");return new CFFFDSelect(format,fdSelect)}}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(){var glyphZero;65535<=this.charStrings.count?warn("Not enough space in charstrings to duplicate first glyph."):(glyphZero=this.charStrings.get(0),this.charStrings.add(glyphZero),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]))}hasGlyphId(id){return!(id<0||id>=this.charStrings.count)&&0<this.charStrings.get(id).length}}class CFFHeader{constructor(major,minor,hdrSize,offSize){this.major=major,this.minor=minor,this.hdrSize=hdrSize,this.offSize=offSize}}class CFFStrings{constructor(){this.strings=[]}get(index){return 0<=index&&index<=NUM_STANDARD_CFF_STRINGS-1?CFFStandardStrings[index]:index-NUM_STANDARD_CFF_STRINGS<=this.strings.length?this.strings[index-NUM_STANDARD_CFF_STRINGS]:CFFStandardStrings[0]}getSID(str){var index=CFFStandardStrings.indexOf(str);return-1!==index?index:-1!==(index=this.strings.indexOf(str))?index+NUM_STANDARD_CFF_STRINGS:-1}add(value){this.strings.push(value)}get count(){return this.strings.length}}class CFFIndex{constructor(){this.objects=[],this.length=0}add(data){this.length+=data.length,this.objects.push(data)}set(index,data){this.length+=data.length-this.objects[index].length,this.objects[index]=data}get(index){return this.objects[index]}get count(){return this.objects.length}}class CFFDict{constructor(tables,strings){this.keyToNameMap=tables.keyToNameMap,this.nameToKeyMap=tables.nameToKeyMap,this.defaults=tables.defaults,this.types=tables.types,this.opcodes=tables.opcodes,this.order=tables.order,this.strings=strings,this.values=Object.create(null)}setByKey(key,value){if(!(key in this.keyToNameMap))return!1;if(0!==value.length){for(var val of value)if(isNaN(val))return warn('Invalid CFFDict value: "'.concat(value,'" for key "').concat(key,'".')),!0;var type=this.types[key];"num"!==type&&"sid"!==type&&"offset"!==type||(value=value[0]),this.values[key]=value}return!0}setByName(name,value){if(!(name in this.nameToKeyMap))throw new FormatError('Invalid dictionary name "'.concat(name,'"'));this.values[this.nameToKeyMap[name]]=value}hasName(name){return this.nameToKeyMap[name]in this.values}getByName(name){var key;if(name in this.nameToKeyMap)return((key=this.nameToKeyMap[name])in this.values?this.values:this.defaults)[key];throw new FormatError("Invalid dictionary name ".concat(name,'"'))}removeByName(name){delete this.values[this.nameToKeyMap[name]]}static createTables(layout){var entry,tables={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(entry of layout){var key=Array.isArray(entry[0])?(entry[0][0]<<8)+entry[0][1]:entry[0];tables.keyToNameMap[key]=entry[1],tables.nameToKeyMap[entry[1]]=key,tables.types[key]=entry[2],tables.defaults[key]=entry[3],tables.opcodes[key]=Array.isArray(entry[0])?entry[0]:[entry[0]],tables.order.push(key)}return tables}}var CFFTopDictLayout=[[[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(CFFTopDictLayout))}constructor(strings){super(CFFTopDict.tables,strings),this.privateDict=null}}var CFFPrivateDictLayout=[[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(CFFPrivateDictLayout))}constructor(strings){super(CFFPrivateDict.tables,strings),this.subrsIndex=null}}var CFFCharsetPredefinedTypes={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(predefined,format,charset,raw){this.predefined=predefined,this.format=format,this.charset=charset,this.raw=raw}}class CFFEncoding{constructor(predefined,format,encoding,raw){this.predefined=predefined,this.format=format,this.encoding=encoding,this.raw=raw}}class CFFFDSelect{constructor(format,fdSelect){this.format=format,this.fdSelect=fdSelect}getFDIndex(glyphIndex){return glyphIndex<0||glyphIndex>=this.fdSelect.length?-1:this.fdSelect[glyphIndex]}}class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(key){return key in this.offsets}track(key,location){if(key in this.offsets)throw new FormatError("Already tracking location of ".concat(key));this.offsets[key]=location}offset(value){for(var key in this.offsets)this.offsets[key]+=value}setEntryLocation(key,values,output){if(!(key in this.offsets))throw new FormatError("Not tracking location of ".concat(key));for(var data=output.data,dataOffset=this.offsets[key],i=0,ii=values.length;i<ii;++i){var offset0=5*i+dataOffset,offset1=offset0+1,offset2=offset0+2,offset3=offset0+3,offset4=offset0+4;if(29!==data[offset0]||0!==data[offset1]||0!==data[offset2]||0!==data[offset3]||0!==data[offset4])throw new FormatError("writing to an offset that is not empty");var value=values[i];data[offset0]=29,data[offset1]=value>>24&255,data[offset2]=value>>16&255,data[offset3]=value>>8&255,data[offset4]=255&value}}}class CFFCompiler{constructor(cff){this.cff=cff}compile(){var cff=this.cff,output={data:[],length:0,add(data){try{this.data.push(...data)}catch(_unused7){this.data=this.data.concat(data)}this.length=this.data.length}},header=this.compileHeader(cff.header),header=(output.add(header),this.compileNameIndex(cff.names));if(output.add(header),cff.isCIDFont&&cff.topDict.hasName("FontMatrix")){var subDict,base=cff.topDict.getByName("FontMatrix");cff.topDict.removeByName("FontMatrix");for(subDict of cff.fdArray){var matrix=base.slice(0);subDict.hasName("FontMatrix")&&(matrix=Util.transform(matrix,subDict.getByName("FontMatrix"))),subDict.setByName("FontMatrix",matrix)}}var header=cff.topDict.getByName("XUID"),header=(16<(null==header?void 0:header.length)&&cff.topDict.removeByName("XUID"),cff.topDict.setByName("charset",0),this.compileTopDicts([cff.topDict],output.length,cff.isCIDFont)),topDictTracker=(output.add(header.output),header.trackers[0]),stringIndex=this.compileStringIndex(cff.strings.strings),stringIndex=(output.add(stringIndex),this.compileIndex(cff.globalSubrIndex)),stringIndex=(output.add(stringIndex),cff.encoding&&cff.topDict.hasName("Encoding")&&(cff.encoding.predefined?topDictTracker.setEntryLocation("Encoding",[cff.encoding.format],output):(stringIndex=this.compileEncoding(cff.encoding),topDictTracker.setEntryLocation("Encoding",[output.length],output),output.add(stringIndex))),this.compileCharset(cff.charset,cff.charStrings.count,cff.strings,cff.isCIDFont)),stringIndex=(topDictTracker.setEntryLocation("charset",[output.length],output),output.add(stringIndex),this.compileCharStrings(cff.charStrings));return topDictTracker.setEntryLocation("CharStrings",[output.length],output),output.add(stringIndex),cff.isCIDFont&&(topDictTracker.setEntryLocation("FDSelect",[output.length],output),stringIndex=this.compileFDSelect(cff.fdSelect),output.add(stringIndex),header=this.compileTopDicts(cff.fdArray,output.length,!0),topDictTracker.setEntryLocation("FDArray",[output.length],output),output.add(header.output),stringIndex=header.trackers,this.compilePrivateDicts(cff.fdArray,stringIndex,output)),this.compilePrivateDicts([cff.topDict],[topDictTracker],output),output.add([0]),output.data}encodeNumber(value){return Number.isInteger(value)?this.encodeInteger(value):this.encodeFloat(value)}static get EncodeFloatRegExp(){return shadow(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(num){for(var value=num.toString(),m=CFFCompiler.EncodeFloatRegExp.exec(value),nibbles=(m&&(m=parseFloat("1e"+((m[2]?+m[2]:0)+m[1].length)),value=(Math.round(num*m)/m).toString()),""),i=0,ii=value.length;i<ii;++i){var a=value[i];nibbles+="e"===a?"-"===value[++i]?"c":"b":"."===a?"a":"-"===a?"e":a}var out=[30];for(i=0,ii=(nibbles+=1&nibbles.length?"f":"ff").length;i<ii;i+=2)out.push(parseInt(nibbles.substring(i,i+2),16));return out}encodeInteger(value){value=-107<=value&&value<=107?[value+139]:108<=value&&value<=1131?[247+((value-=108)>>8),255&value]:-1131<=value&&value<=-108?[251+((value=-value-108)>>8),255&value]:-32768<=value&&value<=32767?[28,value>>8&255,255&value]:[29,value>>24&255,value>>16&255,value>>8&255,255&value];return value}compileHeader(header){return[header.major,header.minor,4,header.offSize]}compileNameIndex(names){var name,nameIndex=new CFFIndex;for(name of names){for(var length=Math.min(name.length,127),sanitizedName=new Array(length),j=0;j<length;j++){var char=name[j];(char<"!"||"~"<char||"["===char||"]"===char||"("===char||")"===char||"{"===char||"}"===char||"<"===char||">"===char||"/"===char||"%"===char)&&(char="_"),sanitizedName[j]=char}""===(sanitizedName=sanitizedName.join(""))&&(sanitizedName="Bad_Font_Name"),nameIndex.add(stringToBytes(sanitizedName))}return this.compileIndex(nameIndex)}compileTopDicts(dicts,length,removeCidKeys){var fontDict,fontDictTrackers=[],fdArrayIndex=new CFFIndex;for(fontDict of dicts){removeCidKeys&&(fontDict.removeByName("CIDFontVersion"),fontDict.removeByName("CIDFontRevision"),fontDict.removeByName("CIDFontType"),fontDict.removeByName("CIDCount"),fontDict.removeByName("UIDBase"));var fontDictTracker=new CFFOffsetTracker,fontDictData=this.compileDict(fontDict,fontDictTracker);fontDictTrackers.push(fontDictTracker),fdArrayIndex.add(fontDictData),fontDictTracker.offset(length)}return{trackers:fontDictTrackers,output:fdArrayIndex=this.compileIndex(fdArrayIndex,fontDictTrackers)}}compilePrivateDicts(dicts,trackers,output){for(var i=0,ii=dicts.length;i<ii;++i){var fontDict=dicts[i],privateDict=fontDict.privateDict;if(!privateDict||!fontDict.hasName("Private"))throw new FormatError("There must be a private dictionary.");var fontDict=new CFFOffsetTracker,privateDictData=this.compileDict(privateDict,fontDict),outputLength=output.length;fontDict.offset(outputLength),privateDictData.length||(outputLength=0),trackers[i].setEntryLocation("Private",[privateDictData.length,outputLength],output),output.add(privateDictData),privateDict.subrsIndex&&privateDict.hasName("Subrs")&&(outputLength=this.compileIndex(privateDict.subrsIndex),fontDict.setEntryLocation("Subrs",[privateDictData.length],output),output.add(outputLength))}}compileDict(dict,offsetTracker){var key,out=[];for(key of dict.order)if(key in dict.values){var values=dict.values[key],_types=dict.types[key];if(Array.isArray(_types)||(_types=[_types]),0!==(values=Array.isArray(values)?values:[values]).length){for(var j=0,jj=_types.length;j<jj;++j){var type=_types[j],value=values[j];switch(type){case"num":case"sid":out.push(...this.encodeNumber(value));break;case"offset":var name=dict.keyToNameMap[key];offsetTracker.isTracking(name)||offsetTracker.track(name,out.length),out.push(29,0,0,0,0);break;case"array":case"delta":out.push(...this.encodeNumber(value));for(var k=1,kk=values.length;k<kk;++k)out.push(...this.encodeNumber(values[k]));break;default:throw new FormatError("Unknown data type of ".concat(type))}}out.push(...dict.opcodes[key])}}return out}compileStringIndex(strings){var string,stringIndex=new CFFIndex;for(string of strings)stringIndex.add(stringToBytes(string));return this.compileIndex(stringIndex)}compileCharStrings(charStrings){for(var charStringsIndex=new CFFIndex,i=0;i<charStrings.count;i++){var glyph=charStrings.get(i);0===glyph.length?charStringsIndex.add(new Uint8Array([139,14])):charStringsIndex.add(glyph)}return this.compileIndex(charStringsIndex)}compileCharset(charset,numGlyphs,strings,isCIDFont){numGlyphs-=1;if(isCIDFont)var isCIDFont=numGlyphs-1,out=new Uint8Array([2,0,1,isCIDFont>>8&255,255&isCIDFont]);else for(var charsetIndex=(out=new Uint8Array(1+2*numGlyphs))[0]=0,numCharsets=charset.charset.length,warned=!1,i=1;i<out.length;i+=2){var name,sid=0;charsetIndex<numCharsets&&(name=charset.charset[charsetIndex++],-1===(sid=strings.getSID(name)))&&(sid=0,warned||(warned=!0,warn("Couldn't find ".concat(name," in CFF strings")))),out[i]=sid>>8&255,out[i+1]=255&sid}return this.compileTypedArray(out)}compileEncoding(encoding){return this.compileTypedArray(encoding.raw)}compileFDSelect(fdSelect){var out,format=fdSelect.format;switch(format){case 0:for((out=new Uint8Array(1+fdSelect.fdSelect.length))[0]=format,i=0;i<fdSelect.fdSelect.length;i++)out[i+1]=fdSelect.fdSelect[i];break;case 3:for(var lastFD=fdSelect.fdSelect[0],ranges=[format,0,0,0,0,lastFD],i=1;i<fdSelect.fdSelect.length;i++){var currentFD=fdSelect.fdSelect[i];currentFD!==lastFD&&(ranges.push(i>>8&255,255&i,currentFD),lastFD=currentFD)}var numRanges=(ranges.length-3)/3;ranges[1]=numRanges>>8&255,ranges[2]=255&numRanges,ranges.push(i>>8&255,255&i),out=new Uint8Array(ranges)}return this.compileTypedArray(out)}compileTypedArray(data){return Array.from(data)}compileIndex(index){var trackers=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],objects=index.objects,count=objects.length;if(0===count)return[0,0];for(var offsetSize,data=[count>>8&255,255&count],lastOffset=1,i=0;i<count;++i)lastOffset+=objects[i].length;data.push(offsetSize=lastOffset<256?1:lastOffset<65536?2:lastOffset<16777216?3:4);var relativeOffset=1;for(i=0;i<count+1;i++)1===offsetSize?data.push(255&relativeOffset):2===offsetSize?data.push(relativeOffset>>8&255,255&relativeOffset):3===offsetSize?data.push(relativeOffset>>16&255,relativeOffset>>8&255,255&relativeOffset):data.push(relativeOffset>>>24&255,relativeOffset>>16&255,relativeOffset>>8&255,255&relativeOffset),objects[i]&&(relativeOffset+=objects[i].length);for(i=0;i<count;i++)trackers[i]&&trackers[i].offset(data.length),data.push(...objects[i]);return data}}var getStdFontMap=getLookupTableFactory(function(t){t["Times-Roman"]="Times-Roman",t.Helvetica="Helvetica",t.Courier="Courier",t.Symbol="Symbol",t["Times-Bold"]="Times-Bold",t["Helvetica-Bold"]="Helvetica-Bold",t["Courier-Bold"]="Courier-Bold",t.ZapfDingbats="ZapfDingbats",t["Times-Italic"]="Times-Italic",t["Helvetica-Oblique"]="Helvetica-Oblique",t["Courier-Oblique"]="Courier-Oblique",t["Times-BoldItalic"]="Times-BoldItalic",t["Helvetica-BoldOblique"]="Helvetica-BoldOblique",t["Courier-BoldOblique"]="Courier-BoldOblique",t.ArialNarrow="Helvetica",t["ArialNarrow-Bold"]="Helvetica-Bold",t["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique",t["ArialNarrow-Italic"]="Helvetica-Oblique",t.ArialBlack="Helvetica",t["ArialBlack-Bold"]="Helvetica-Bold",t["ArialBlack-BoldItalic"]="Helvetica-BoldOblique",t["ArialBlack-Italic"]="Helvetica-Oblique",t["Arial-Black"]="Helvetica",t["Arial-Black-Bold"]="Helvetica-Bold",t["Arial-Black-BoldItalic"]="Helvetica-BoldOblique",t["Arial-Black-Italic"]="Helvetica-Oblique",t.Arial="Helvetica",t["Arial-Bold"]="Helvetica-Bold",t["Arial-BoldItalic"]="Helvetica-BoldOblique",t["Arial-Italic"]="Helvetica-Oblique",t.ArialMT="Helvetica",t["Arial-BoldItalicMT"]="Helvetica-BoldOblique",t["Arial-BoldMT"]="Helvetica-Bold",t["Arial-ItalicMT"]="Helvetica-Oblique",t["Arial-BoldItalicMT-BoldItalic"]="Helvetica-BoldOblique",t["Arial-BoldMT-Bold"]="Helvetica-Bold",t["Arial-ItalicMT-Italic"]="Helvetica-Oblique",t.ArialUnicodeMS="Helvetica",t["ArialUnicodeMS-Bold"]="Helvetica-Bold",t["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique",t["ArialUnicodeMS-Italic"]="Helvetica-Oblique",t["Courier-BoldItalic"]="Courier-BoldOblique",t["Courier-Italic"]="Courier-Oblique",t.CourierNew="Courier",t["CourierNew-Bold"]="Courier-Bold",t["CourierNew-BoldItalic"]="Courier-BoldOblique",t["CourierNew-Italic"]="Courier-Oblique",t["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique",t["CourierNewPS-BoldMT"]="Courier-Bold",t["CourierNewPS-ItalicMT"]="Courier-Oblique",t.CourierNewPSMT="Courier",t["Helvetica-BoldItalic"]="Helvetica-BoldOblique",t["Helvetica-Italic"]="Helvetica-Oblique",t["HelveticaLTStd-Bold"]="Helvetica-Bold",t["Symbol-Bold"]="Symbol",t["Symbol-BoldItalic"]="Symbol",t["Symbol-Italic"]="Symbol",t.TimesNewRoman="Times-Roman",t["TimesNewRoman-Bold"]="Times-Bold",t["TimesNewRoman-BoldItalic"]="Times-BoldItalic",t["TimesNewRoman-Italic"]="Times-Italic",t.TimesNewRomanPS="Times-Roman",t["TimesNewRomanPS-Bold"]="Times-Bold",t["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic",t["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic",t["TimesNewRomanPS-BoldMT"]="Times-Bold",t["TimesNewRomanPS-Italic"]="Times-Italic",t["TimesNewRomanPS-ItalicMT"]="Times-Italic",t.TimesNewRomanPSMT="Times-Roman",t["TimesNewRomanPSMT-Bold"]="Times-Bold",t["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic",t["TimesNewRomanPSMT-Italic"]="Times-Italic"}),getFontNameToFileMap=getLookupTableFactory(function(t){t.Courier="FoxitFixed.pfb",t["Courier-Bold"]="FoxitFixedBold.pfb",t["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb",t["Courier-Oblique"]="FoxitFixedItalic.pfb",t.Helvetica="LiberationSans-Regular.ttf",t["Helvetica-Bold"]="LiberationSans-Bold.ttf",t["Helvetica-BoldOblique"]="LiberationSans-BoldItalic.ttf",t["Helvetica-Oblique"]="LiberationSans-Italic.ttf",t["Times-Roman"]="FoxitSerif.pfb",t["Times-Bold"]="FoxitSerifBold.pfb",t["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb",t["Times-Italic"]="FoxitSerifItalic.pfb",t.Symbol="FoxitSymbol.pfb",t.ZapfDingbats="FoxitDingbats.pfb",t["LiberationSans-Regular"]="LiberationSans-Regular.ttf",t["LiberationSans-Bold"]="LiberationSans-Bold.ttf",t["LiberationSans-Italic"]="LiberationSans-Italic.ttf",t["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}),getNonStdFontMap=getLookupTableFactory(function(t){t.Calibri="Helvetica",t["Calibri-Bold"]="Helvetica-Bold",t["Calibri-BoldItalic"]="Helvetica-BoldOblique",t["Calibri-Italic"]="Helvetica-Oblique",t.CenturyGothic="Helvetica",t["CenturyGothic-Bold"]="Helvetica-Bold",t["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique",t["CenturyGothic-Italic"]="Helvetica-Oblique",t.ComicSansMS="Comic Sans MS",t["ComicSansMS-Bold"]="Comic Sans MS-Bold",t["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic",t["ComicSansMS-Italic"]="Comic Sans MS-Italic",t.GillSansMT="Helvetica",t["GillSansMT-Bold"]="Helvetica-Bold",t["GillSansMT-BoldItalic"]="Helvetica-BoldOblique",t["GillSansMT-Italic"]="Helvetica-Oblique",t.Impact="Helvetica",t["ItcSymbol-Bold"]="Helvetica-Bold",t["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique",t["ItcSymbol-Book"]="Helvetica",t["ItcSymbol-BookItalic"]="Helvetica-Oblique",t["ItcSymbol-Medium"]="Helvetica",t["ItcSymbol-MediumItalic"]="Helvetica-Oblique",t.LucidaConsole="Courier",t["LucidaConsole-Bold"]="Courier-Bold",t["LucidaConsole-BoldItalic"]="Courier-BoldOblique",t["LucidaConsole-Italic"]="Courier-Oblique",t["LucidaSans-Demi"]="Helvetica-Bold",t["MS-Gothic"]="MS Gothic",t["MS-Gothic-Bold"]="MS Gothic-Bold",t["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic",t["MS-Gothic-Italic"]="MS Gothic-Italic",t["MS-Mincho"]="MS Mincho",t["MS-Mincho-Bold"]="MS Mincho-Bold",t["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic",t["MS-Mincho-Italic"]="MS Mincho-Italic",t["MS-PGothic"]="MS PGothic",t["MS-PGothic-Bold"]="MS PGothic-Bold",t["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic",t["MS-PGothic-Italic"]="MS PGothic-Italic",t["MS-PMincho"]="MS PMincho",t["MS-PMincho-Bold"]="MS PMincho-Bold",t["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic",t["MS-PMincho-Italic"]="MS PMincho-Italic",t.NuptialScript="Times-Italic",t.SegoeUISymbol="Helvetica"}),getSerifFonts=getLookupTableFactory(function(t){t["Adobe Jenson"]=!0,t["Adobe Text"]=!0,t.Albertus=!0,t.Aldus=!0,t.Alexandria=!0,t.Algerian=!0,t["American Typewriter"]=!0,t.Antiqua=!0,t.Apex=!0,t.Arno=!0,t.Aster=!0,t.Aurora=!0,t.Baskerville=!0,t.Bell=!0,t.Bembo=!0,t["Bembo Schoolbook"]=!0,t.Benguiat=!0,t["Berkeley Old Style"]=!0,t["Bernhard Modern"]=!0,t["Berthold City"]=!0,t.Bodoni=!0,t["Bauer Bodoni"]=!0,t["Book Antiqua"]=!0,t.Bookman=!0,t["Bordeaux Roman"]=!0,t["Californian FB"]=!0,t.Calisto=!0,t.Calvert=!0,t.Capitals=!0,t.Cambria=!0,t.Cartier=!0,t.Caslon=!0,t.Catull=!0,t.Centaur=!0,t["Century Old Style"]=!0,t["Century Schoolbook"]=!0,t.Chaparral=!0,t["Charis SIL"]=!0,t.Cheltenham=!0,t["Cholla Slab"]=!0,t.Clarendon=!0,t.Clearface=!0,t.Cochin=!0,t.Colonna=!0,t["Computer Modern"]=!0,t["Concrete Roman"]=!0,t.Constantia=!0,t["Cooper Black"]=!0,t.Corona=!0,t.Ecotype=!0,t.Egyptienne=!0,t.Elephant=!0,t.Excelsior=!0,t.Fairfield=!0,t["FF Scala"]=!0,t.Folkard=!0,t.Footlight=!0,t.FreeSerif=!0,t["Friz Quadrata"]=!0,t.Garamond=!0,t.Gentium=!0,t.Georgia=!0,t.Gloucester=!0,t["Goudy Old Style"]=!0,t["Goudy Schoolbook"]=!0,t["Goudy Pro Font"]=!0,t.Granjon=!0,t["Guardian Egyptian"]=!0,t.Heather=!0,t.Hercules=!0,t["High Tower Text"]=!0,t.Hiroshige=!0,t["Hoefler Text"]=!0,t["Humana Serif"]=!0,t.Imprint=!0,t["Ionic No. 5"]=!0,t.Janson=!0,t.Joanna=!0,t.Korinna=!0,t.Lexicon=!0,t.LiberationSerif=!0,t["Liberation Serif"]=!0,t["Linux Libertine"]=!0,t.Literaturnaya=!0,t.Lucida=!0,t["Lucida Bright"]=!0,t.Melior=!0,t.Memphis=!0,t.Miller=!0,t.Minion=!0,t.Modern=!0,t["Mona Lisa"]=!0,t["Mrs Eaves"]=!0,t["MS Serif"]=!0,t["Museo Slab"]=!0,t["New York"]=!0,t["Nimbus Roman"]=!0,t["NPS Rawlinson Roadway"]=!0,t.NuptialScript=!0,t.Palatino=!0,t.Perpetua=!0,t.Plantin=!0,t["Plantin Schoolbook"]=!0,t.Playbill=!0,t["Poor Richard"]=!0,t["Rawlinson Roadway"]=!0,t.Renault=!0,t.Requiem=!0,t.Rockwell=!0,t.Roman=!0,t["Rotis Serif"]=!0,t.Sabon=!0,t.Scala=!0,t.Seagull=!0,t.Sistina=!0,t.Souvenir=!0,t.STIX=!0,t["Stone Informal"]=!0,t["Stone Serif"]=!0,t.Sylfaen=!0,t.Times=!0,t.Trajan=!0,t["Trinité"]=!0,t["Trump Mediaeval"]=!0,t.Utopia=!0,t["Vale Type"]=!0,t["Bitstream Vera"]=!0,t["Vera Serif"]=!0,t.Versailles=!0,t.Wanted=!0,t.Weiss=!0,t["Wide Latin"]=!0,t.Windsor=!0,t.XITS=!0}),getSymbolsFonts=getLookupTableFactory(function(t){t.Dingbats=!0,t.Symbol=!0,t.ZapfDingbats=!0,t.Wingdings=!0,t["Wingdings-Bold"]=!0,t["Wingdings-Regular"]=!0}),getGlyphMapForStandardFonts=getLookupTableFactory(function(t){t[2]=10,t[3]=32,t[4]=33,t[5]=34,t[6]=35,t[7]=36,t[8]=37,t[9]=38,t[10]=39,t[11]=40,t[12]=41,t[13]=42,t[14]=43,t[15]=44,t[16]=45,t[17]=46,t[18]=47,t[19]=48,t[20]=49,t[21]=50,t[22]=51,t[23]=52,t[24]=53,t[25]=54,t[26]=55,t[27]=56,t[28]=57,t[29]=58,t[30]=894,t[31]=60,t[32]=61,t[33]=62,t[34]=63,t[35]=64,t[36]=65,t[37]=66,t[38]=67,t[39]=68,t[40]=69,t[41]=70,t[42]=71,t[43]=72,t[44]=73,t[45]=74,t[46]=75,t[47]=76,t[48]=77,t[49]=78,t[50]=79,t[51]=80,t[52]=81,t[53]=82,t[54]=83,t[55]=84,t[56]=85,t[57]=86,t[58]=87,t[59]=88,t[60]=89,t[61]=90,t[62]=91,t[63]=92,t[64]=93,t[65]=94,t[66]=95,t[67]=96,t[68]=97,t[69]=98,t[70]=99,t[71]=100,t[72]=101,t[73]=102,t[74]=103,t[75]=104,t[76]=105,t[77]=106,t[78]=107,t[79]=108,t[80]=109,t[81]=110,t[82]=111,t[83]=112,t[84]=113,t[85]=114,t[86]=115,t[87]=116,t[88]=117,t[89]=118,t[90]=119,t[91]=120,t[92]=121,t[93]=122,t[94]=123,t[95]=124,t[96]=125,t[97]=126,t[98]=196,t[99]=197,t[100]=199,t[101]=201,t[102]=209,t[103]=214,t[104]=220,t[105]=225,t[106]=224,t[107]=226,t[108]=228,t[109]=227,t[110]=229,t[111]=231,t[112]=233,t[113]=232,t[114]=234,t[115]=235,t[116]=237,t[117]=236,t[118]=238,t[119]=239,t[120]=241,t[121]=243,t[122]=242,t[123]=244,t[124]=246,t[125]=245,t[126]=250,t[127]=249,t[128]=251,t[129]=252,t[130]=8224,t[131]=176,t[132]=162,t[133]=163,t[134]=167,t[135]=8226,t[136]=182,t[137]=223,t[138]=174,t[139]=169,t[140]=8482,t[141]=180,t[142]=168,t[143]=8800,t[144]=198,t[145]=216,t[146]=8734,t[147]=177,t[148]=8804,t[149]=8805,t[150]=165,t[151]=181,t[152]=8706,t[153]=8721,t[154]=8719,t[156]=8747,t[157]=170,t[158]=186,t[159]=8486,t[160]=230,t[161]=248,t[162]=191,t[163]=161,t[164]=172,t[165]=8730,t[166]=402,t[167]=8776,t[168]=8710,t[169]=171,t[170]=187,t[171]=8230,t[179]=8220,t[180]=8221,t[181]=8216,t[182]=8217,t[200]=193,t[203]=205,t[207]=211,t[210]=218,t[223]=711,t[224]=321,t[225]=322,t[226]=352,t[227]=353,t[228]=381,t[229]=382,t[233]=221,t[234]=253,t[252]=263,t[253]=268,t[254]=269,t[258]=258,t[260]=260,t[261]=261,t[265]=280,t[266]=281,t[267]=282,t[268]=283,t[269]=313,t[275]=323,t[276]=324,t[278]=328,t[283]=344,t[284]=345,t[285]=346,t[286]=347,t[292]=367,t[295]=377,t[296]=378,t[298]=380,t[305]=963,t[306]=964,t[307]=966,t[308]=8215,t[309]=8252,t[310]=8319,t[311]=8359,t[312]=8592,t[313]=8593,t[337]=9552,t[493]=1039,t[494]=1040,t[570]=1040,t[571]=1041,t[572]=1042,t[573]=1043,t[574]=1044,t[575]=1045,t[576]=1046,t[577]=1047,t[578]=1048,t[579]=1049,t[580]=1050,t[581]=1051,t[582]=1052,t[583]=1053,t[584]=1054,t[585]=1055,t[586]=1056,t[587]=1057,t[588]=1058,t[589]=1059,t[590]=1060,t[591]=1061,t[592]=1062,t[593]=1063,t[594]=1064,t[595]=1065,t[596]=1066,t[597]=1067,t[598]=1068,t[599]=1069,t[600]=1070,t[672]=1488,t[673]=1489,t[674]=1490,t[675]=1491,t[676]=1492,t[677]=1493,t[678]=1494,t[679]=1495,t[680]=1496,t[681]=1497,t[682]=1498,t[683]=1499,t[684]=1500,t[685]=1501,t[686]=1502,t[687]=1503,t[688]=1504,t[689]=1505,t[690]=1506,t[691]=1507,t[692]=1508,t[693]=1509,t[694]=1510,t[695]=1511,t[696]=1512,t[697]=1513,t[698]=1514,t[705]=1524,t[706]=8362,t[710]=64288,t[711]=64298,t[759]=1617,t[761]=1776,t[763]=1778,t[775]=1652,t[777]=1764,t[778]=1780,t[779]=1781,t[780]=1782,t[782]=771,t[783]=64726,t[786]=8363,t[788]=8532,t[790]=768,t[791]=769,t[792]=768,t[795]=803,t[797]=64336,t[798]=64337,t[799]=64342,t[800]=64343,t[801]=64344,t[802]=64345,t[803]=64362,t[804]=64363,t[805]=64364,t[2424]=7821,t[2425]=7822,t[2426]=7823,t[2427]=7824,t[2428]=7825,t[2429]=7826,t[2430]=7827,t[2433]=7682,t[2678]=8045,t[2679]=8046,t[2830]=1552,t[2838]=686,t[2840]=751,t[2842]=753,t[2843]=754,t[2844]=755,t[2846]=757,t[2856]=767,t[2857]=848,t[2858]=849,t[2862]=853,t[2863]=854,t[2864]=855,t[2865]=861,t[2866]=862,t[2906]=7460,t[2908]=7462,t[2909]=7463,t[2910]=7464,t[2912]=7466,t[2913]=7467,t[2914]=7468,t[2916]=7470,t[2917]=7471,t[2918]=7472,t[2920]=7474,t[2921]=7475,t[2922]=7476,t[2924]=7478,t[2925]=7479,t[2926]=7480,t[2928]=7482,t[2929]=7483,t[2930]=7484,t[2932]=7486,t[2933]=7487,t[2934]=7488,t[2936]=7490,t[2937]=7491,t[2938]=7492,t[2940]=7494,t[2941]=7495,t[2942]=7496,t[2944]=7498,t[2946]=7500,t[2948]=7502,t[2950]=7504,t[2951]=7505,t[2952]=7506,t[2954]=7508,t[2955]=7509,t[2956]=7510,t[2958]=7512,t[2959]=7513,t[2960]=7514,t[2962]=7516,t[2963]=7517,t[2964]=7518,t[2966]=7520,t[2967]=7521,t[2968]=7522,t[2970]=7524,t[2971]=7525,t[2972]=7526,t[2974]=7528,t[2975]=7529,t[2976]=7530,t[2978]=1537,t[2979]=1538,t[2980]=1539,t[2982]=1549,t[2983]=1551,t[2984]=1552,t[2986]=1554,t[2987]=1555,t[2988]=1556,t[2990]=1623,t[2991]=1624,t[2995]=1775,t[2999]=1791,t[3002]=64290,t[3003]=64291,t[3004]=64292,t[3006]=64294,t[3007]=64295,t[3008]=64296,t[3011]=1900,t[3014]=8223,t[3015]=8244,t[3017]=7532,t[3018]=7533,t[3019]=7534,t[3075]=7590,t[3076]=7591,t[3079]=7594,t[3080]=7595,t[3083]=7598,t[3084]=7599,t[3087]=7602,t[3088]=7603,t[3091]=7606,t[3092]=7607,t[3095]=7610,t[3096]=7611,t[3099]=7614,t[3100]=7615,t[3103]=7618,t[3104]=7619,t[3107]=8337,t[3108]=8338,t[3116]=1884,t[3119]=1885,t[3120]=1885,t[3123]=1886,t[3124]=1886,t[3127]=1887,t[3128]=1887,t[3131]=1888,t[3132]=1888,t[3135]=1889,t[3136]=1889,t[3139]=1890,t[3140]=1890,t[3143]=1891,t[3144]=1891,t[3147]=1892,t[3148]=1892,t[3153]=580,t[3154]=581,t[3157]=584,t[3158]=585,t[3161]=588,t[3162]=589,t[3165]=891,t[3166]=892,t[3169]=1274,t[3170]=1275,t[3173]=1278,t[3174]=1279,t[3181]=7622,t[3182]=7623,t[3282]=11799,t[3316]=578,t[3379]=42785,t[3393]=1159,t[3416]=8377}),getSupplementalGlyphMapForArialBlack=getLookupTableFactory(function(t){t[227]=322,t[264]=261,t[291]=346}),getSupplementalGlyphMapForCalibri=getLookupTableFactory(function(t){t[1]=32,t[4]=65,t[5]=192,t[6]=193,t[9]=196,t[17]=66,t[18]=67,t[21]=268,t[24]=68,t[28]=69,t[29]=200,t[30]=201,t[32]=282,t[38]=70,t[39]=71,t[44]=72,t[47]=73,t[48]=204,t[49]=205,t[58]=74,t[60]=75,t[62]=76,t[68]=77,t[69]=78,t[75]=79,t[76]=210,t[80]=214,t[87]=80,t[89]=81,t[90]=82,t[92]=344,t[94]=83,t[97]=352,t[100]=84,t[104]=85,t[109]=220,t[115]=86,t[116]=87,t[121]=88,t[122]=89,t[124]=221,t[127]=90,t[129]=381,t[258]=97,t[259]=224,t[260]=225,t[263]=228,t[268]=261,t[271]=98,t[272]=99,t[273]=263,t[275]=269,t[282]=100,t[286]=101,t[287]=232,t[288]=233,t[290]=283,t[295]=281,t[296]=102,t[336]=103,t[346]=104,t[349]=105,t[350]=236,t[351]=237,t[361]=106,t[364]=107,t[367]=108,t[371]=322,t[373]=109,t[374]=110,t[381]=111,t[382]=242,t[383]=243,t[386]=246,t[393]=112,t[395]=113,t[396]=114,t[398]=345,t[400]=115,t[401]=347,t[403]=353,t[410]=116,t[437]=117,t[442]=252,t[448]=118,t[449]=119,t[454]=120,t[455]=121,t[457]=253,t[460]=122,t[462]=382,t[463]=380,t[853]=44,t[855]=58,t[856]=46,t[876]=47,t[878]=45,t[882]=45,t[894]=40,t[895]=41,t[896]=91,t[897]=93,t[923]=64,t[940]=163,t[1004]=48,t[1005]=49,t[1006]=50,t[1007]=51,t[1008]=52,t[1009]=53,t[1010]=54,t[1011]=55,t[1012]=56,t[1013]=57,t[1081]=37,t[1085]=43,t[1086]=45});function getStandardFontName(name){name=normalizeFontName(name);return getStdFontMap()[name]}function isKnownFontName(name){name=normalizeFontName(name);return!!(getStdFontMap()[name]||getNonStdFontMap()[name]||getSerifFonts()[name]||getSymbolsFonts()[name])}class ToUnicodeMap{constructor(){this._map=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]}get length(){return this._map.length}forEach(callback){for(var charCode in this._map)callback(charCode,this._map[charCode].codePointAt(0))}has(i){return void 0!==this._map[i]}get(i){return this._map[i]}charCodeOf(value){var charCode,map=this._map;if(map.length<=65536)return map.indexOf(value);for(charCode in map)if(map[charCode]===value)return 0|charCode;return-1}amend(map){for(var charCode in map)this._map[charCode]=map[charCode]}}class IdentityToUnicodeMap{constructor(firstChar,lastChar){this.firstChar=firstChar,this.lastChar=lastChar}get length(){return this.lastChar+1-this.firstChar}forEach(callback){for(var i=this.firstChar,ii=this.lastChar;i<=ii;i++)callback(i,i)}has(i){return this.firstChar<=i&&i<=this.lastChar}get(i){if(this.firstChar<=i&&i<=this.lastChar)return String.fromCharCode(i)}charCodeOf(v){return Number.isInteger(v)&&v>=this.firstChar&&v<=this.lastChar?v:-1}amend(map){unreachable("Should not call amend()")}}class CFFFont{constructor(file,properties){this.properties=properties;var parser=new CFFParser(file,properties,SEAC_ANALYSIS_ENABLED),parser=(this.cff=parser.parse(),this.cff.duplicateFirstGlyph(),new CFFCompiler(this.cff));this.seacs=this.cff.seacs;try{this.data=parser.compile()}catch(_unused8){warn("Failed to compile font "+properties.loadedName),this.data=file}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){var glyphId,cff=this.cff,properties=this.properties,{cidToGidMap,cMap}=properties,charsets=cff.charset.charset;if(properties.composite){if(0<(null==cidToGidMap?void 0:cidToGidMap.length))for(var invCidToGidMap=Object.create(null),i=0,ii=cidToGidMap.length;i<ii;i++){var gid=cidToGidMap[i];void 0!==gid&&(invCidToGidMap[gid]=i)}if(charCodeToGlyphId=Object.create(null),cff.isCIDFont)for(glyphId=0;glyphId<charsets.length;glyphId++){var cid=charsets[glyphId],charCode=cMap.charCodeOf(cid);charCodeToGlyphId[charCode=void 0!==(null==invCidToGidMap?void 0:invCidToGidMap[charCode])?invCidToGidMap[charCode]:charCode]=glyphId}else for(glyphId=0;glyphId<cff.charStrings.count;glyphId++)charCodeToGlyphId[charCode=cMap.charCodeOf(glyphId)]=glyphId}else var encoding=cff.encoding?cff.encoding.encoding:null,charCodeToGlyphId=type1FontGlyphMapping(properties,encoding=properties.isInternalFont?properties.defaultEncoding:encoding,charsets);return charCodeToGlyphId}hasGlyphId(id){return this.cff.hasGlyphId(id)}_createBuiltInEncoding(){var{charset,encoding}=this.cff;if(charset&&encoding){var charCode,charsets=charset.charset,encodings=encoding.encoding,map=[];for(charCode in encodings){var glyphId=encodings[charCode];0<=glyphId&&(glyphId=charsets[glyphId])&&(map[charCode]=glyphId)}0<map.length&&(this.properties.builtInEncoding=map)}}}function getFloat214(data,offset){return readInt16(data,offset)/16384}function getSubroutineBias(subrs){var subrs=subrs.length,bias=32768;return subrs<1240?bias=107:subrs<33900&&(bias=1131),bias}function parseCmap(data,start,end){var offset=1===readUint16(data,start+2)?readUint32(data,start+8):readUint32(data,start+16),format=readUint16(data,start+offset);if(4===format){readUint16(data,start+offset+2);for(var segCount=readUint16(data,start+offset+6)>>1,p=start+offset+14,ranges=[],i=0;i<segCount;i++,p+=2)ranges[i]={end:readUint16(data,p)};for(p+=2,i=0;i<segCount;i++,p+=2)ranges[i].start=readUint16(data,p);for(i=0;i<segCount;i++,p+=2)ranges[i].idDelta=readUint16(data,p);for(i=0;i<segCount;i++,p+=2){var idOffset=readUint16(data,p);if(0!==idOffset){ranges[i].ids=[];for(var j=0,jj=ranges[i].end-ranges[i].start+1;j<jj;j++)ranges[i].ids[j]=readUint16(data,p+idOffset),idOffset+=2}}}else{if(12!==format)throw new FormatError("unsupported cmap: ".concat(format));var groups=readUint32(data,start+offset+12);for(p=start+offset+16,ranges=[],i=0;i<groups;i++)start=readUint32(data,p),ranges.push({start:start,end:readUint32(data,p+4),idDelta:readUint32(data,p+8)-start}),p+=12}return ranges}function parseCff(data,start,end,seacAnalysisEnabled){data=new CFFParser(new Stream(data,start,end-start),{},seacAnalysisEnabled).parse();return{glyphs:data.charStrings.objects,subrs:null==(end=data.topDict.privateDict)||null==(end=end.subrsIndex)?void 0:end.objects,gsubrs:null==(start=data.globalSubrIndex)?void 0:start.objects,isCFFCIDFont:data.isCIDFont,fdSelect:data.fdSelect,fdArray:data.fdArray}}function parseGlyfTable(glyf,loca,isGlyphLocationsLong){for(var itemSize,itemDecode=isGlyphLocationsLong?(itemSize=4,readUint32):(itemSize=2,(data,offset)=>2*readUint16(data,offset)),glyphs=[],startOffset=itemDecode(loca,0),j=itemSize;j<loca.length;j+=itemSize){var endOffset=itemDecode(loca,j);glyphs.push(glyf.subarray(startOffset,endOffset)),startOffset=endOffset}return glyphs}function lookupCmap(ranges,unicode){for(var code=unicode.codePointAt(0),unicode=0,l=0,r=ranges.length-1;l<r;){var c=l+r+1>>1;code<ranges[c].start?r=c-1:l=c}return{charCode:code,glyphId:unicode=ranges[l].start<=code&&code<=ranges[l].end?ranges[l].idDelta+(ranges[l].ids?ranges[l].ids[code-ranges[l].start]:code)&65535:unicode}}function compileGlyf(code,cmds,font){function quadraticCurveTo(xa,ya,x,y){cmds.add("Q",[xa,ya,x,y])}var numberOfContours=readInt16(code,i=0),firstPoint=null,x=0,y=0;if(i+=10,numberOfContours<0)do{var flags=readUint16(code,i),glyphIndex=readUint16(code,i+2),arg1=(i+=4,void 0),arg2=void 0,arg1=(1&flags?(arg2=(2&flags?(arg1=readInt16(code,i),readInt16):(arg1=readUint16(code,i),readUint16))(code,i+2),i+=4):arg2=2&flags?(arg1=readInt8(code,i++),readInt8(code,i++)):(arg1=code[i++],code[i++]),y=2&flags?(x=arg1,arg2):x=0,1),arg2=1,scale01=0,scale10=0,glyphIndex=(8&flags?(arg1=arg2=getFloat214(code,i),i+=2):64&flags?(arg1=getFloat214(code,i),arg2=getFloat214(code,i+2),i+=4):128&flags&&(arg1=getFloat214(code,i),scale01=getFloat214(code,i+2),scale10=getFloat214(code,i+4),arg2=getFloat214(code,i+6),i+=8),font.glyphs[glyphIndex])}while(glyphIndex&&(cmds.save(),cmds.transform([arg1,scale01,scale10,arg2,x,y]),compileGlyf(glyphIndex,cmds,font),cmds.restore()),32&flags);else{for(var jj,endPtsOfContours=[],j=0;j<numberOfContours;j++)endPtsOfContours.push(readUint16(code,i)),i+=2;i+=2+readUint16(code,i);for(var numberOfPoints=endPtsOfContours.at(-1)+1,points=[];points.length<numberOfPoints;){var repeat=1;for(8&(flags=code[i++])&&(repeat+=code[i++]);0<repeat--;)points.push({flags:flags})}for(j=0;j<numberOfPoints;j++){switch(18&points[j].flags){case 0:x+=readInt16(code,i),i+=2;break;case 2:x-=code[i++];break;case 18:x+=code[i++]}points[j].x=x}for(j=0;j<numberOfPoints;j++){switch(36&points[j].flags){case 0:y+=readInt16(code,i),i+=2;break;case 4:y-=code[i++];break;case 36:y+=code[i++]}points[j].y=y}for(var startPoint=0,i=0;i<numberOfContours;i++){var p,endPoint=endPtsOfContours[i],contour=points.slice(startPoint,endPoint+1);for(1&contour[0].flags?contour.push(contour[0]):1&contour.at(-1).flags?contour.unshift(contour.at(-1)):(p={flags:1,x:(contour[0].x+contour.at(-1).x)/2,y:(contour[0].y+contour.at(-1).y)/2},contour.unshift(p),contour.push(p)),!function(x,y){firstPoint&&cmds.add("L",firstPoint),firstPoint=[x,y],cmds.add("M",[x,y])}(contour[0].x,contour[0].y),j=1,jj=contour.length;j<jj;j++)1&contour[j].flags?function(x,y){cmds.add("L",[x,y])}(contour[j].x,contour[j].y):1&contour[j+1].flags?(quadraticCurveTo(contour[j].x,contour[j].y,contour[j+1].x,contour[j+1].y),j++):quadraticCurveTo(contour[j].x,contour[j].y,(contour[j].x+contour[j+1].x)/2,(contour[j].y+contour[j+1].y)/2);startPoint=endPoint+1}}}function compileCharString(charStringCode,cmds,font,glyphId){function moveTo(x,y){firstPoint&&cmds.add("L",firstPoint),firstPoint=[x,y],cmds.add("M",[x,y])}function lineTo(x,y){cmds.add("L",[x,y])}function bezierCurveTo(x1,y1,x2,y2,x,y){cmds.add("C",[x1,y1,x2,y2,x,y])}var stack=[],x=0,y=0,stems=0,firstPoint=null;!function parse(code){for(var i=0;i<code.length;){var stackClean=!1,v=code[i++],xa=void 0,xb=void 0,ya=void 0,yb=void 0,y1=void 0,n=void 0,subrCode=void 0;switch(v){case 1:case 3:stems+=stack.length>>1,stackClean=!0;break;case 4:y+=stack.pop(),moveTo(x,y),stackClean=!0;break;case 5:for(;0<stack.length;)x+=stack.shift(),y+=stack.shift(),lineTo(x,y);break;case 6:for(;0<stack.length&&(lineTo(x+=stack.shift(),y),0!==stack.length);)y+=stack.shift(),lineTo(x,y);break;case 7:for(;0<stack.length&&(y+=stack.shift(),lineTo(x,y),0!==stack.length);)lineTo(x+=stack.shift(),y);break;case 8:for(;0<stack.length;)xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y);break;case 10:var _fontDict$privateDict,fdIndex,subrs,n=stack.pop(),subrCode=null;font.isCFFCIDFont?0<=(fdIndex=font.fdSelect.getFDIndex(glyphId))&&fdIndex<font.fdArray.length?(subrs=void 0,(subrs=null!=(_fontDict$privateDict=(fdIndex=font.fdArray[fdIndex]).privateDict)&&_fontDict$privateDict.subrsIndex?fdIndex.privateDict.subrsIndex.objects:subrs)&&(subrCode=subrs[n+=getSubroutineBias(subrs)])):warn("Invalid fd index for glyph index."):subrCode=font.subrs[n+font.subrsBias],subrCode&&parse(subrCode);break;case 11:return;case 12:switch(v=code[i++]){case 34:xb=(xa=x+stack.shift())+stack.shift(),y1=y+stack.shift(),x=xb+stack.shift(),bezierCurveTo(xa,y,xb,y1,x,y1),xb=(xa=x+stack.shift())+stack.shift(),x=xb+stack.shift(),bezierCurveTo(xa,y1,xb,y,x,y);break;case 35:xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y),xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y),stack.pop();break;case 36:bezierCurveTo(xa=x+stack.shift(),y1=y+stack.shift(),xb=xa+stack.shift(),y2=y1+stack.shift(),x=xb+stack.shift(),y2),bezierCurveTo(xa=x+stack.shift(),y2,xb=xa+stack.shift(),y2+stack.shift(),x=xb+stack.shift(),y);break;case 37:var y2=x,y0=y,xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift();x=xb+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y),xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb,y=yb,Math.abs(x-y2)>Math.abs(y-y0)?x+=stack.shift():y+=stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y);break;default:throw new FormatError("unknown operator: 12 ".concat(v))}break;case 14:return void(4<=stack.length&&(_fontDict$privateDict=stack.pop(),fdIndex=stack.pop(),y=stack.pop(),x=stack.pop(),cmds.save(),cmds.translate(x,y),subrs=lookupCmap(font.cmap,String.fromCharCode(font.glyphNameMap[StandardEncoding[_fontDict$privateDict]])),compileCharString(font.glyphs[subrs.glyphId],cmds,font,subrs.glyphId),cmds.restore(),subrs=lookupCmap(font.cmap,String.fromCharCode(font.glyphNameMap[StandardEncoding[fdIndex]])),compileCharString(font.glyphs[subrs.glyphId],cmds,font,subrs.glyphId)));case 18:stems+=stack.length>>1,stackClean=!0;break;case 19:case 20:i+=(stems+=stack.length>>1)+7>>3,stackClean=!0;break;case 21:y+=stack.pop(),moveTo(x+=stack.pop(),y),stackClean=!0;break;case 22:moveTo(x+=stack.pop(),y),stackClean=!0;break;case 23:stems+=stack.length>>1,stackClean=!0;break;case 24:for(;2<stack.length;)xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y);x+=stack.shift(),y+=stack.shift(),lineTo(x,y);break;case 25:for(;6<stack.length;)x+=stack.shift(),y+=stack.shift(),lineTo(x,y);xa=x+stack.shift(),ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y);break;case 26:for(stack.length%2&&(x+=stack.shift());0<stack.length;)xa=x,ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb,y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x,y);break;case 27:for(stack.length%2&&(y+=stack.shift());0<stack.length;)xa=x+stack.shift(),ya=y,xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),bezierCurveTo(xa,ya,xb,y=yb,x,y);break;case 28:stack.push(readInt16(code,i)),i+=2;break;case 29:n=stack.pop()+font.gsubrsBias,(subrCode=font.gsubrs[n])&&parse(subrCode);break;case 30:for(;0<stack.length&&(xa=x,ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+(1===stack.length?stack.shift():0),bezierCurveTo(xa,ya,xb,yb,x,y),0!==stack.length);)xa=x+stack.shift(),ya=y,xb=xa+stack.shift(),yb=ya+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x=xb+(1===stack.length?stack.shift():0),y);break;case 31:for(;0<stack.length&&(xa=x+stack.shift(),ya=y,xb=xa+stack.shift(),yb=ya+stack.shift(),y=yb+stack.shift(),bezierCurveTo(xa,ya,xb,yb,x=xb+(1===stack.length?stack.shift():0),y),0!==stack.length);)xa=x,ya=y+stack.shift(),xb=xa+stack.shift(),yb=ya+stack.shift(),x=xb+stack.shift(),y=yb+(1===stack.length?stack.shift():0),bezierCurveTo(xa,ya,xb,yb,x,y);break;default:if(v<32)throw new FormatError("unknown operator: ".concat(v));v<247?stack.push(v-139):v<251?stack.push(256*(v-247)+code[i++]+108):v<255?stack.push(256*-(v-251)-code[i++]-108):(stack.push((code[i]<<24|code[i+1]<<16|code[i+2]<<8|code[i+3])/65536),i+=4)}stackClean&&(stack.length=0)}}(charStringCode)}var NOOP="";class Commands{constructor(){_defineProperty(this,"cmds",[]),_defineProperty(this,"transformStack",[]),_defineProperty(this,"currentTransform",[1,0,0,1,0,0])}add(cmd,args){if(args){for(var currentTransform=this["currentTransform"],i=0,ii=args.length;i<ii;i+=2)Util.applyTransform(args,currentTransform,i);this.cmds.push("".concat(cmd).concat(args.join(" ")))}else this.cmds.push(cmd)}transform(transf){this.currentTransform=Util.transform(this.currentTransform,transf)}translate(x,y){this.transform([1,0,0,1,x,y])}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(fontMatrix){this.fontMatrix=fontMatrix,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(unicode){var _this$compiledCharCod,compileEx,{charCode:unicode,glyphId}=lookupCmap(this.cmap,unicode),fn=this.compiledGlyphs[glyphId];if(void 0===fn){try{fn=this.compileGlyph(this.glyphs[glyphId],glyphId)}catch(ex){fn=NOOP,compileEx=ex}this.compiledGlyphs[glyphId]=fn}if(null!=(_this$compiledCharCod=this.compiledCharCodeToGlyphId)[unicode]||(_this$compiledCharCod[unicode]=glyphId),compileEx)throw compileEx;return fn}compileGlyph(code,glyphId){var fontMatrix,fdIndex;return null!=code&&code.length&&14!==code[0]?(fontMatrix=this.fontMatrix,this.isCFFCIDFont&&(0<=(fdIndex=this.fdSelect.getFDIndex(glyphId))&&fdIndex<this.fdArray.length?fontMatrix=this.fdArray[fdIndex].getByName("FontMatrix")||FONT_IDENTITY_MATRIX:warn("Invalid fd index for glyph index.")),assert(isNumberArray(fontMatrix,6),"Expected a valid fontMatrix."),(fdIndex=new Commands).transform(fontMatrix.slice()),this.compileGlyphImpl(code,fdIndex,glyphId),fdIndex.add("Z"),fdIndex.getSVG()):NOOP}compileGlyphImpl(){unreachable("Children classes should implement this.")}hasBuiltPath(unicode){var{charCode:unicode,glyphId}=lookupCmap(this.cmap,unicode);return void 0!==this.compiledGlyphs[glyphId]&&void 0!==this.compiledCharCodeToGlyphId[unicode]}}class TrueTypeCompiled extends CompiledFont{constructor(glyphs,cmap,fontMatrix){super(fontMatrix||[488e-6,0,0,488e-6,0,0]),this.glyphs=glyphs,this.cmap=cmap}compileGlyphImpl(code,cmds){compileGlyf(code,cmds,this)}}class Type2Compiled extends CompiledFont{constructor(cffInfo,cmap,fontMatrix){super(fontMatrix||[.001,0,0,.001,0,0]),this.glyphs=cffInfo.glyphs,this.gsubrs=cffInfo.gsubrs||[],this.subrs=cffInfo.subrs||[],this.cmap=cmap,this.glyphNameMap=getGlyphsUnicode(),this.gsubrsBias=getSubroutineBias(this.gsubrs),this.subrsBias=getSubroutineBias(this.subrs),this.isCFFCIDFont=cffInfo.isCFFCIDFont,this.fdSelect=cffInfo.fdSelect,this.fdArray=cffInfo.fdArray}compileGlyphImpl(code,cmds,glyphId){compileCharString(code,cmds,this,glyphId)}}class FontRendererFactory{static create(font,seacAnalysisEnabled){for(var cmap,glyf,loca,cff,indexToLocFormat,unitsPerEm,fontMatrix,data=new Uint8Array(font.data),numTables=readUint16(data,4),i=0,p=12;i<numTables;i++,p+=16){var tag=bytesToString(data.subarray(p,p+4)),offset=readUint32(data,p+8),length=readUint32(data,p+12);switch(tag){case"cmap":cmap=parseCmap(data,offset,offset+length);break;case"glyf":glyf=data.subarray(offset,offset+length);break;case"loca":loca=data.subarray(offset,offset+length);break;case"head":unitsPerEm=readUint16(data,offset+18),indexToLocFormat=readUint16(data,offset+50);break;case"CFF ":cff=parseCff(data,offset,offset+length,seacAnalysisEnabled)}}return glyf?(fontMatrix=unitsPerEm?[1/unitsPerEm,0,0,1/unitsPerEm,0,0]:font.fontMatrix,new TrueTypeCompiled(parseGlyfTable(glyf,loca,indexToLocFormat),cmap,fontMatrix)):new Type2Compiled(cff,cmap,font.fontMatrix)}}var getMetrics=getLookupTableFactory(function(t){t.Courier=600,t["Courier-Bold"]=600,t["Courier-BoldOblique"]=600,t["Courier-Oblique"]=600,t.Helvetica=getLookupTableFactory(function(t){t.space=278,t.exclam=278,t.quotedbl=355,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=667,t.quoteright=222,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=278,t.semicolon=278,t.less=584,t.equal=584,t.greater=584,t.question=556,t.at=1015,t.A=667,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=500,t.K=667,t.L=556,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=278,t.backslash=278,t.bracketright=278,t.asciicircum=469,t.underscore=556,t.quoteleft=222,t.a=556,t.b=556,t.c=500,t.d=556,t.e=556,t.f=278,t.g=556,t.h=556,t.i=222,t.j=222,t.k=500,t.l=222,t.m=833,t.n=556,t.o=556,t.p=556,t.q=556,t.r=333,t.s=500,t.t=278,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=500,t.braceleft=334,t.bar=260,t.braceright=334,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=191,t.quotedblleft=333,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=537,t.bullet=350,t.quotesinglbase=222,t.quotedblbase=333,t.quotedblright=333,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=556,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=222,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=556,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=667,t.aacute=556,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=500,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=500,t.aring=556,t.Ncommaaccent=722,t.lacute=222,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=500,t.scedilla=500,t.iacute=278,t.lozenge=471,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=556,t.Amacron=667,t.rcaron=333,t.ccedilla=500,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=643,t.Umacron=722,t.uring=556,t.threesuperior=333,t.Ograve=778,t.Agrave=667,t.Abreve=667,t.multiply=584,t.uacute=556,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=500,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=260,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=333,t.omacron=556,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=222,t.tcaron=317,t.eogonek=556,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=556,t.zacute=500,t.iogonek=222,t.Oacute=778,t.oacute=556,t.amacron=556,t.sacute=500,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=333,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=556,t.Eogonek=667,t.dcroat=556,t.threequarters=834,t.Scedilla=667,t.lcaron=299,t.Kcommaaccent=667,t.Lacute=556,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=556,t.onehalf=834,t.lessequal=549,t.ocircumflex=556,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=556,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=556,t.Ccaron=722,t.ugrave=556,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=556,t.Rcommaaccent=722,t.Lcommaaccent=556,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=500,t.minus=584,t.Icircumflex=278,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=584,t.odieresis=556,t.udieresis=556,t.notequal=549,t.gcommaaccent=556,t.eth=556,t.zcaron=500,t.ncommaaccent=556,t.onesuperior=333,t.imacron=278,t.Euro=556}),t["Helvetica-Bold"]=getLookupTableFactory(function(t){t.space=278,t.exclam=333,t.quotedbl=474,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=722,t.quoteright=278,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=333,t.semicolon=333,t.less=584,t.equal=584,t.greater=584,t.question=611,t.at=975,t.A=722,t.B=722,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=556,t.K=722,t.L=611,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=584,t.underscore=556,t.quoteleft=278,t.a=556,t.b=611,t.c=556,t.d=611,t.e=556,t.f=333,t.g=611,t.h=611,t.i=278,t.j=278,t.k=556,t.l=278,t.m=889,t.n=611,t.o=611,t.p=611,t.q=611,t.r=389,t.s=556,t.t=333,t.u=611,t.v=556,t.w=778,t.x=556,t.y=556,t.z=500,t.braceleft=389,t.bar=280,t.braceright=389,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=238,t.quotedblleft=500,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=611,t.fl=611,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=556,t.bullet=350,t.quotesinglbase=278,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=611,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=278,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=611,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=722,t.aacute=556,t.Ucircumflex=722,t.yacute=556,t.scommaaccent=556,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=611,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=556,t.aring=556,t.Ncommaaccent=722,t.lacute=278,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=556,t.scedilla=556,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=611,t.acircumflex=556,t.Amacron=722,t.rcaron=389,t.ccedilla=556,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=743,t.Umacron=722,t.uring=611,t.threesuperior=333,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=584,t.uacute=611,t.Tcaron=611,t.partialdiff=494,t.ydieresis=556,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=556,t.nacute=611,t.umacron=611,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=280,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=611,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=389,t.eogonek=556,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=556,t.zacute=500,t.iogonek=278,t.Oacute=778,t.oacute=611,t.amacron=556,t.sacute=556,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=611,t.twosuperior=333,t.Odieresis=778,t.mu=611,t.igrave=278,t.ohungarumlaut=611,t.Eogonek=667,t.dcroat=611,t.threequarters=834,t.Scedilla=667,t.lcaron=400,t.Kcommaaccent=722,t.Lacute=611,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=611,t.onehalf=834,t.lessequal=549,t.ocircumflex=611,t.ntilde=611,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=611,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=611,t.Ccaron=722,t.ugrave=611,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=611,t.Rcommaaccent=722,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=556,t.minus=584,t.Icircumflex=278,t.ncaron=611,t.tcommaaccent=333,t.logicalnot=584,t.odieresis=611,t.udieresis=611,t.notequal=549,t.gcommaaccent=611,t.eth=611,t.zcaron=500,t.ncommaaccent=611,t.onesuperior=333,t.imacron=278,t.Euro=556}),t["Helvetica-BoldOblique"]=getLookupTableFactory(function(t){t.space=278,t.exclam=333,t.quotedbl=474,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=722,t.quoteright=278,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=333,t.semicolon=333,t.less=584,t.equal=584,t.greater=584,t.question=611,t.at=975,t.A=722,t.B=722,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=556,t.K=722,t.L=611,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=584,t.underscore=556,t.quoteleft=278,t.a=556,t.b=611,t.c=556,t.d=611,t.e=556,t.f=333,t.g=611,t.h=611,t.i=278,t.j=278,t.k=556,t.l=278,t.m=889,t.n=611,t.o=611,t.p=611,t.q=611,t.r=389,t.s=556,t.t=333,t.u=611,t.v=556,t.w=778,t.x=556,t.y=556,t.z=500,t.braceleft=389,t.bar=280,t.braceright=389,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=238,t.quotedblleft=500,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=611,t.fl=611,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=556,t.bullet=350,t.quotesinglbase=278,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=611,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=278,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=611,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=722,t.aacute=556,t.Ucircumflex=722,t.yacute=556,t.scommaaccent=556,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=611,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=556,t.aring=556,t.Ncommaaccent=722,t.lacute=278,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=556,t.scedilla=556,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=611,t.acircumflex=556,t.Amacron=722,t.rcaron=389,t.ccedilla=556,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=743,t.Umacron=722,t.uring=611,t.threesuperior=333,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=584,t.uacute=611,t.Tcaron=611,t.partialdiff=494,t.ydieresis=556,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=556,t.nacute=611,t.umacron=611,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=280,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=611,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=389,t.eogonek=556,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=556,t.zacute=500,t.iogonek=278,t.Oacute=778,t.oacute=611,t.amacron=556,t.sacute=556,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=611,t.twosuperior=333,t.Odieresis=778,t.mu=611,t.igrave=278,t.ohungarumlaut=611,t.Eogonek=667,t.dcroat=611,t.threequarters=834,t.Scedilla=667,t.lcaron=400,t.Kcommaaccent=722,t.Lacute=611,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=611,t.onehalf=834,t.lessequal=549,t.ocircumflex=611,t.ntilde=611,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=611,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=611,t.Ccaron=722,t.ugrave=611,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=611,t.Rcommaaccent=722,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=556,t.minus=584,t.Icircumflex=278,t.ncaron=611,t.tcommaaccent=333,t.logicalnot=584,t.odieresis=611,t.udieresis=611,t.notequal=549,t.gcommaaccent=611,t.eth=611,t.zcaron=500,t.ncommaaccent=611,t.onesuperior=333,t.imacron=278,t.Euro=556}),t["Helvetica-Oblique"]=getLookupTableFactory(function(t){t.space=278,t.exclam=278,t.quotedbl=355,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=667,t.quoteright=222,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=278,t.semicolon=278,t.less=584,t.equal=584,t.greater=584,t.question=556,t.at=1015,t.A=667,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=500,t.K=667,t.L=556,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=278,t.backslash=278,t.bracketright=278,t.asciicircum=469,t.underscore=556,t.quoteleft=222,t.a=556,t.b=556,t.c=500,t.d=556,t.e=556,t.f=278,t.g=556,t.h=556,t.i=222,t.j=222,t.k=500,t.l=222,t.m=833,t.n=556,t.o=556,t.p=556,t.q=556,t.r=333,t.s=500,t.t=278,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=500,t.braceleft=334,t.bar=260,t.braceright=334,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=191,t.quotedblleft=333,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=537,t.bullet=350,t.quotesinglbase=222,t.quotedblbase=333,t.quotedblright=333,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=556,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=222,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=556,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=667,t.aacute=556,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=500,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=500,t.aring=556,t.Ncommaaccent=722,t.lacute=222,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=500,t.scedilla=500,t.iacute=278,t.lozenge=471,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=556,t.Amacron=667,t.rcaron=333,t.ccedilla=500,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=643,t.Umacron=722,t.uring=556,t.threesuperior=333,t.Ograve=778,t.Agrave=667,t.Abreve=667,t.multiply=584,t.uacute=556,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=500,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=260,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=333,t.omacron=556,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=222,t.tcaron=317,t.eogonek=556,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=556,t.zacute=500,t.iogonek=222,t.Oacute=778,t.oacute=556,t.amacron=556,t.sacute=500,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=333,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=556,t.Eogonek=667,t.dcroat=556,t.threequarters=834,t.Scedilla=667,t.lcaron=299,t.Kcommaaccent=667,t.Lacute=556,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=556,t.onehalf=834,t.lessequal=549,t.ocircumflex=556,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=556,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=556,t.Ccaron=722,t.ugrave=556,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=556,t.Rcommaaccent=722,t.Lcommaaccent=556,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=500,t.minus=584,t.Icircumflex=278,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=584,t.odieresis=556,t.udieresis=556,t.notequal=549,t.gcommaaccent=556,t.eth=556,t.zcaron=500,t.ncommaaccent=556,t.onesuperior=333,t.imacron=278,t.Euro=556}),t.Symbol=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.universal=713,t.numbersign=500,t.existential=549,t.percent=833,t.ampersand=778,t.suchthat=439,t.parenleft=333,t.parenright=333,t.asteriskmath=500,t.plus=549,t.comma=250,t.minus=549,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=278,t.semicolon=278,t.less=549,t.equal=549,t.greater=549,t.question=444,t.congruent=549,t.Alpha=722,t.Beta=667,t.Chi=722,t.Delta=612,t.Epsilon=611,t.Phi=763,t.Gamma=603,t.Eta=722,t.Iota=333,t.theta1=631,t.Kappa=722,t.Lambda=686,t.Mu=889,t.Nu=722,t.Omicron=722,t.Pi=768,t.Theta=741,t.Rho=556,t.Sigma=592,t.Tau=611,t.Upsilon=690,t.sigma1=439,t.Omega=768,t.Xi=645,t.Psi=795,t.Zeta=611,t.bracketleft=333,t.therefore=863,t.bracketright=333,t.perpendicular=658,t.underscore=500,t.radicalex=500,t.alpha=631,t.beta=549,t.chi=549,t.delta=494,t.epsilon=439,t.phi=521,t.gamma=411,t.eta=603,t.iota=329,t.phi1=603,t.kappa=549,t.lambda=549,t.mu=576,t.nu=521,t.omicron=549,t.pi=549,t.theta=521,t.rho=549,t.sigma=603,t.tau=439,t.upsilon=576,t.omega1=713,t.omega=686,t.xi=493,t.psi=686,t.zeta=494,t.braceleft=480,t.bar=200,t.braceright=480,t.similar=549,t.Euro=750,t.Upsilon1=620,t.minute=247,t.lessequal=549,t.fraction=167,t.infinity=713,t.florin=500,t.club=753,t.diamond=753,t.heart=753,t.spade=753,t.arrowboth=1042,t.arrowleft=987,t.arrowup=603,t.arrowright=987,t.arrowdown=603,t.degree=400,t.plusminus=549,t.second=411,t.greaterequal=549,t.multiply=549,t.proportional=713,t.partialdiff=494,t.bullet=460,t.divide=549,t.notequal=549,t.equivalence=549,t.approxequal=549,t.ellipsis=1e3,t.arrowvertex=603,t.arrowhorizex=1e3,t.carriagereturn=658,t.aleph=823,t.Ifraktur=686,t.Rfraktur=795,t.weierstrass=987,t.circlemultiply=768,t.circleplus=768,t.emptyset=823,t.intersection=768,t.union=768,t.propersuperset=713,t.reflexsuperset=713,t.notsubset=713,t.propersubset=713,t.reflexsubset=713,t.element=713,t.notelement=713,t.angle=768,t.gradient=713,t.registerserif=790,t.copyrightserif=790,t.trademarkserif=890,t.product=823,t.radical=549,t.dotmath=250,t.logicalnot=713,t.logicaland=603,t.logicalor=603,t.arrowdblboth=1042,t.arrowdblleft=987,t.arrowdblup=603,t.arrowdblright=987,t.arrowdbldown=603,t.lozenge=494,t.angleleft=329,t.registersans=790,t.copyrightsans=790,t.trademarksans=786,t.summation=713,t.parenlefttp=384,t.parenleftex=384,t.parenleftbt=384,t.bracketlefttp=384,t.bracketleftex=384,t.bracketleftbt=384,t.bracelefttp=494,t.braceleftmid=494,t.braceleftbt=494,t.braceex=494,t.angleright=329,t.integral=274,t.integraltp=686,t.integralex=686,t.integralbt=686,t.parenrighttp=384,t.parenrightex=384,t.parenrightbt=384,t.bracketrighttp=384,t.bracketrightex=384,t.bracketrightbt=384,t.bracerighttp=494,t.bracerightmid=494,t.bracerightbt=494,t.apple=790}),t["Times-Roman"]=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.quotedbl=408,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=564,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=278,t.semicolon=278,t.less=564,t.equal=564,t.greater=564,t.question=444,t.at=921,t.A=722,t.B=667,t.C=667,t.D=722,t.E=611,t.F=556,t.G=722,t.H=722,t.I=333,t.J=389,t.K=722,t.L=611,t.M=889,t.N=722,t.O=722,t.P=556,t.Q=722,t.R=667,t.S=556,t.T=611,t.U=722,t.V=722,t.W=944,t.X=722,t.Y=722,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=469,t.underscore=500,t.quoteleft=333,t.a=444,t.b=500,t.c=444,t.d=500,t.e=444,t.f=333,t.g=500,t.h=500,t.i=278,t.j=278,t.k=500,t.l=278,t.m=778,t.n=500,t.o=500,t.p=500,t.q=500,t.r=333,t.s=389,t.t=278,t.u=500,t.v=500,t.w=722,t.x=500,t.y=500,t.z=444,t.braceleft=480,t.bar=200,t.braceright=480,t.asciitilde=541,t.exclamdown=333,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=180,t.quotedblleft=444,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=453,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=444,t.quotedblright=444,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=444,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=889,t.ordfeminine=276,t.Lslash=611,t.Oslash=722,t.OE=889,t.ordmasculine=310,t.ae=667,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=500,t.Idieresis=333,t.eacute=444,t.abreve=444,t.uhungarumlaut=500,t.ecaron=444,t.Ydieresis=722,t.divide=564,t.Yacute=722,t.Acircumflex=722,t.aacute=444,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=444,t.Uacute=722,t.uogonek=500,t.Edieresis=611,t.Dcroat=722,t.commaaccent=250,t.copyright=760,t.Emacron=611,t.ccaron=444,t.aring=444,t.Ncommaaccent=722,t.lacute=278,t.agrave=444,t.Tcommaaccent=611,t.Cacute=667,t.atilde=444,t.Edotaccent=611,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=471,t.Rcaron=667,t.Gcommaaccent=722,t.ucircumflex=500,t.acircumflex=444,t.Amacron=722,t.rcaron=333,t.ccedilla=444,t.Zdotaccent=611,t.Thorn=556,t.Omacron=722,t.Racute=667,t.Sacute=556,t.dcaron=588,t.Umacron=722,t.uring=500,t.threesuperior=300,t.Ograve=722,t.Agrave=722,t.Abreve=722,t.multiply=564,t.uacute=500,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=611,t.adieresis=444,t.edieresis=444,t.cacute=444,t.nacute=500,t.umacron=500,t.Ncaron=722,t.Iacute=333,t.plusminus=564,t.brokenbar=200,t.registered=760,t.Gbreve=722,t.Idotaccent=333,t.summation=600,t.Egrave=611,t.racute=333,t.omacron=500,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=326,t.eogonek=444,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=444,t.zacute=444,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=444,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=500,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=611,t.dcroat=500,t.threequarters=750,t.Scedilla=556,t.lcaron=344,t.Kcommaaccent=722,t.Lacute=611,t.trademark=980,t.edotaccent=444,t.Igrave=333,t.Imacron=333,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=500,t.Uhungarumlaut=722,t.Eacute=611,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=500,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=667,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=722,t.zdotaccent=444,t.Ecaron=611,t.Iogonek=333,t.kcommaaccent=500,t.minus=564,t.Icircumflex=333,t.ncaron=500,t.tcommaaccent=278,t.logicalnot=564,t.odieresis=500,t.udieresis=500,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=444,t.ncommaaccent=500,t.onesuperior=300,t.imacron=278,t.Euro=500}),t["Times-Bold"]=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.quotedbl=555,t.numbersign=500,t.dollar=500,t.percent=1e3,t.ampersand=833,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=570,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=570,t.equal=570,t.greater=570,t.question=500,t.at=930,t.A=722,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=778,t.I=389,t.J=500,t.K=778,t.L=667,t.M=944,t.N=722,t.O=778,t.P=611,t.Q=778,t.R=722,t.S=556,t.T=667,t.U=722,t.V=722,t.W=1e3,t.X=722,t.Y=722,t.Z=667,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=581,t.underscore=500,t.quoteleft=333,t.a=500,t.b=556,t.c=444,t.d=556,t.e=444,t.f=333,t.g=500,t.h=556,t.i=278,t.j=333,t.k=556,t.l=278,t.m=833,t.n=556,t.o=500,t.p=556,t.q=556,t.r=444,t.s=389,t.t=333,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=444,t.braceleft=394,t.bar=220,t.braceright=394,t.asciitilde=520,t.exclamdown=333,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=278,t.quotedblleft=500,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=540,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=300,t.Lslash=667,t.Oslash=778,t.OE=1e3,t.ordmasculine=330,t.ae=722,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=556,t.Idieresis=389,t.eacute=444,t.abreve=500,t.uhungarumlaut=556,t.ecaron=444,t.Ydieresis=722,t.divide=570,t.Yacute=722,t.Acircumflex=722,t.aacute=500,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=747,t.Emacron=667,t.ccaron=444,t.aring=500,t.Ncommaaccent=722,t.lacute=278,t.agrave=500,t.Tcommaaccent=667,t.Cacute=722,t.atilde=500,t.Edotaccent=667,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=500,t.Amacron=722,t.rcaron=444,t.ccedilla=444,t.Zdotaccent=667,t.Thorn=611,t.Omacron=778,t.Racute=722,t.Sacute=556,t.dcaron=672,t.Umacron=722,t.uring=556,t.threesuperior=300,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=570,t.uacute=556,t.Tcaron=667,t.partialdiff=494,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=389,t.plusminus=570,t.brokenbar=220,t.registered=747,t.Gbreve=778,t.Idotaccent=389,t.summation=600,t.Egrave=667,t.racute=444,t.omacron=500,t.Zacute=667,t.Zcaron=667,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=416,t.eogonek=444,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=444,t.zacute=444,t.iogonek=278,t.Oacute=778,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=300,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=667,t.dcroat=556,t.threequarters=750,t.Scedilla=556,t.lcaron=394,t.Kcommaaccent=778,t.Lacute=667,t.trademark=1e3,t.edotaccent=444,t.Igrave=389,t.Imacron=389,t.Lcaron=667,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=778,t.degree=400,t.ograve=500,t.Ccaron=722,t.ugrave=556,t.radical=549,t.Dcaron=722,t.rcommaaccent=444,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=722,t.Lcommaaccent=667,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=444,t.Ecaron=667,t.Iogonek=389,t.kcommaaccent=556,t.minus=570,t.Icircumflex=389,t.ncaron=556,t.tcommaaccent=333,t.logicalnot=570,t.odieresis=500,t.udieresis=556,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=444,t.ncommaaccent=556,t.onesuperior=300,t.imacron=278,t.Euro=500}),t["Times-BoldItalic"]=getLookupTableFactory(function(t){t.space=250,t.exclam=389,t.quotedbl=555,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=570,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=570,t.equal=570,t.greater=570,t.question=500,t.at=832,t.A=667,t.B=667,t.C=667,t.D=722,t.E=667,t.F=667,t.G=722,t.H=778,t.I=389,t.J=500,t.K=667,t.L=611,t.M=889,t.N=722,t.O=722,t.P=611,t.Q=722,t.R=667,t.S=556,t.T=611,t.U=722,t.V=667,t.W=889,t.X=667,t.Y=611,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=570,t.underscore=500,t.quoteleft=333,t.a=500,t.b=500,t.c=444,t.d=500,t.e=444,t.f=333,t.g=500,t.h=556,t.i=278,t.j=278,t.k=500,t.l=278,t.m=778,t.n=556,t.o=500,t.p=500,t.q=500,t.r=389,t.s=389,t.t=278,t.u=556,t.v=444,t.w=667,t.x=500,t.y=444,t.z=389,t.braceleft=348,t.bar=220,t.braceright=348,t.asciitilde=570,t.exclamdown=389,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=278,t.quotedblleft=500,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=500,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=944,t.ordfeminine=266,t.Lslash=611,t.Oslash=722,t.OE=944,t.ordmasculine=300,t.ae=722,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=500,t.Idieresis=389,t.eacute=444,t.abreve=500,t.uhungarumlaut=556,t.ecaron=444,t.Ydieresis=611,t.divide=570,t.Yacute=611,t.Acircumflex=667,t.aacute=500,t.Ucircumflex=722,t.yacute=444,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=747,t.Emacron=667,t.ccaron=444,t.aring=500,t.Ncommaaccent=722,t.lacute=278,t.agrave=500,t.Tcommaaccent=611,t.Cacute=667,t.atilde=500,t.Edotaccent=667,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=494,t.Rcaron=667,t.Gcommaaccent=722,t.ucircumflex=556,t.acircumflex=500,t.Amacron=667,t.rcaron=389,t.ccedilla=444,t.Zdotaccent=611,t.Thorn=611,t.Omacron=722,t.Racute=667,t.Sacute=556,t.dcaron=608,t.Umacron=722,t.uring=556,t.threesuperior=300,t.Ograve=722,t.Agrave=667,t.Abreve=667,t.multiply=570,t.uacute=556,t.Tcaron=611,t.partialdiff=494,t.ydieresis=444,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=389,t.plusminus=570,t.brokenbar=220,t.registered=747,t.Gbreve=722,t.Idotaccent=389,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=500,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=366,t.eogonek=444,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=444,t.zacute=389,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=576,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=667,t.dcroat=500,t.threequarters=750,t.Scedilla=556,t.lcaron=382,t.Kcommaaccent=667,t.Lacute=611,t.trademark=1e3,t.edotaccent=444,t.Igrave=389,t.Imacron=389,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=556,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=667,t.Lcommaaccent=611,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=722,t.zdotaccent=389,t.Ecaron=667,t.Iogonek=389,t.kcommaaccent=500,t.minus=606,t.Icircumflex=389,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=606,t.odieresis=500,t.udieresis=556,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=389,t.ncommaaccent=556,t.onesuperior=300,t.imacron=278,t.Euro=500}),t["Times-Italic"]=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.quotedbl=420,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=675,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=675,t.equal=675,t.greater=675,t.question=500,t.at=920,t.A=611,t.B=611,t.C=667,t.D=722,t.E=611,t.F=611,t.G=722,t.H=722,t.I=333,t.J=444,t.K=667,t.L=556,t.M=833,t.N=667,t.O=722,t.P=611,t.Q=722,t.R=611,t.S=500,t.T=556,t.U=722,t.V=611,t.W=833,t.X=611,t.Y=556,t.Z=556,t.bracketleft=389,t.backslash=278,t.bracketright=389,t.asciicircum=422,t.underscore=500,t.quoteleft=333,t.a=500,t.b=500,t.c=444,t.d=500,t.e=444,t.f=278,t.g=500,t.h=500,t.i=278,t.j=278,t.k=444,t.l=278,t.m=722,t.n=500,t.o=500,t.p=500,t.q=500,t.r=389,t.s=389,t.t=278,t.u=500,t.v=444,t.w=667,t.x=444,t.y=444,t.z=389,t.braceleft=400,t.bar=275,t.braceright=400,t.asciitilde=541,t.exclamdown=389,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=214,t.quotedblleft=556,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=523,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=556,t.quotedblright=556,t.guillemotright=500,t.ellipsis=889,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=889,t.AE=889,t.ordfeminine=276,t.Lslash=556,t.Oslash=722,t.OE=944,t.ordmasculine=310,t.ae=667,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=667,t.germandbls=500,t.Idieresis=333,t.eacute=444,t.abreve=500,t.uhungarumlaut=500,t.ecaron=444,t.Ydieresis=556,t.divide=675,t.Yacute=556,t.Acircumflex=611,t.aacute=500,t.Ucircumflex=722,t.yacute=444,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=500,t.Edieresis=611,t.Dcroat=722,t.commaaccent=250,t.copyright=760,t.Emacron=611,t.ccaron=444,t.aring=500,t.Ncommaaccent=667,t.lacute=278,t.agrave=500,t.Tcommaaccent=556,t.Cacute=667,t.atilde=500,t.Edotaccent=611,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=471,t.Rcaron=611,t.Gcommaaccent=722,t.ucircumflex=500,t.acircumflex=500,t.Amacron=611,t.rcaron=389,t.ccedilla=444,t.Zdotaccent=556,t.Thorn=611,t.Omacron=722,t.Racute=611,t.Sacute=500,t.dcaron=544,t.Umacron=722,t.uring=500,t.threesuperior=300,t.Ograve=722,t.Agrave=611,t.Abreve=611,t.multiply=675,t.uacute=500,t.Tcaron=556,t.partialdiff=476,t.ydieresis=444,t.Nacute=667,t.icircumflex=278,t.Ecircumflex=611,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=500,t.umacron=500,t.Ncaron=667,t.Iacute=333,t.plusminus=675,t.brokenbar=275,t.registered=760,t.Gbreve=722,t.Idotaccent=333,t.summation=600,t.Egrave=611,t.racute=389,t.omacron=500,t.Zacute=556,t.Zcaron=556,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=300,t.eogonek=444,t.Uogonek=722,t.Aacute=611,t.Adieresis=611,t.egrave=444,t.zacute=389,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=500,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=611,t.dcroat=500,t.threequarters=750,t.Scedilla=500,t.lcaron=300,t.Kcommaaccent=667,t.Lacute=556,t.trademark=980,t.edotaccent=444,t.Igrave=333,t.Imacron=333,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=500,t.Uhungarumlaut=722,t.Eacute=611,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=500,t.Scommaaccent=500,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=500,t.radical=453,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=667,t.otilde=500,t.Rcommaaccent=611,t.Lcommaaccent=556,t.Atilde=611,t.Aogonek=611,t.Aring=611,t.Otilde=722,t.zdotaccent=389,t.Ecaron=611,t.Iogonek=333,t.kcommaaccent=444,t.minus=675,t.Icircumflex=333,t.ncaron=500,t.tcommaaccent=278,t.logicalnot=675,t.odieresis=500,t.udieresis=500,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=389,t.ncommaaccent=500,t.onesuperior=300,t.imacron=278,t.Euro=500}),t.ZapfDingbats=getLookupTableFactory(function(t){t.space=278,t.a1=974,t.a2=961,t.a202=974,t.a3=980,t.a4=719,t.a5=789,t.a119=790,t.a118=791,t.a117=690,t.a11=960,t.a12=939,t.a13=549,t.a14=855,t.a15=911,t.a16=933,t.a105=911,t.a17=945,t.a18=974,t.a19=755,t.a20=846,t.a21=762,t.a22=761,t.a23=571,t.a24=677,t.a25=763,t.a26=760,t.a27=759,t.a28=754,t.a6=494,t.a7=552,t.a8=537,t.a9=577,t.a10=692,t.a29=786,t.a30=788,t.a31=788,t.a32=790,t.a33=793,t.a34=794,t.a35=816,t.a36=823,t.a37=789,t.a38=841,t.a39=823,t.a40=833,t.a41=816,t.a42=831,t.a43=923,t.a44=744,t.a45=723,t.a46=749,t.a47=790,t.a48=792,t.a49=695,t.a50=776,t.a51=768,t.a52=792,t.a53=759,t.a54=707,t.a55=708,t.a56=682,t.a57=701,t.a58=826,t.a59=815,t.a60=789,t.a61=789,t.a62=707,t.a63=687,t.a64=696,t.a65=689,t.a66=786,t.a67=787,t.a68=713,t.a69=791,t.a70=785,t.a71=791,t.a72=873,t.a73=761,t.a74=762,t.a203=762,t.a75=759,t.a204=759,t.a76=892,t.a77=892,t.a78=788,t.a79=784,t.a81=438,t.a82=138,t.a83=277,t.a84=415,t.a97=392,t.a98=392,t.a99=668,t.a100=668,t.a89=390,t.a90=390,t.a93=317,t.a94=317,t.a91=276,t.a92=276,t.a205=509,t.a85=509,t.a206=410,t.a86=410,t.a87=234,t.a88=234,t.a95=334,t.a96=334,t.a101=732,t.a102=544,t.a103=544,t.a104=910,t.a106=667,t.a107=760,t.a108=760,t.a112=776,t.a111=595,t.a110=694,t.a109=626,t.a120=788,t.a121=788,t.a122=788,t.a123=788,t.a124=788,t.a125=788,t.a126=788,t.a127=788,t.a128=788,t.a129=788,t.a130=788,t.a131=788,t.a132=788,t.a133=788,t.a134=788,t.a135=788,t.a136=788,t.a137=788,t.a138=788,t.a139=788,t.a140=788,t.a141=788,t.a142=788,t.a143=788,t.a144=788,t.a145=788,t.a146=788,t.a147=788,t.a148=788,t.a149=788,t.a150=788,t.a151=788,t.a152=788,t.a153=788,t.a154=788,t.a155=788,t.a156=788,t.a157=788,t.a158=788,t.a159=788,t.a160=894,t.a161=838,t.a163=1016,t.a164=458,t.a196=748,t.a165=924,t.a192=748,t.a166=918,t.a167=927,t.a168=928,t.a169=928,t.a170=834,t.a171=873,t.a172=828,t.a173=924,t.a162=924,t.a174=917,t.a175=930,t.a176=931,t.a177=463,t.a178=883,t.a179=836,t.a193=836,t.a180=867,t.a199=867,t.a181=696,t.a200=696,t.a182=874,t.a201=874,t.a183=760,t.a184=946,t.a197=771,t.a185=865,t.a194=771,t.a198=888,t.a186=967,t.a195=888,t.a187=831,t.a188=873,t.a189=927,t.a190=970,t.a191=918})}),getFontBasicMetrics=getLookupTableFactory(function(t){t.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},t["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439},t["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},t["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},t.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},t["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532},t["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523},t["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532},t["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450},t["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461},t["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441},t["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462},t.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},t.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}),ON_CURVE_POINT=1,X_SHORT_VECTOR=2,Y_SHORT_VECTOR=4,REPEAT_FLAG=8,X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR=16,Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR=32,OVERLAP_SIMPLE=64,ARG_1_AND_2_ARE_WORDS=1,ARGS_ARE_XY_VALUES=2,WE_HAVE_A_SCALE=8,MORE_COMPONENTS=32,WE_HAVE_AN_X_AND_Y_SCALE=64,WE_HAVE_A_TWO_BY_TWO=128,WE_HAVE_INSTRUCTIONS=256;class GlyfTable{constructor(_ref16){for(var{glyfTable:_ref16,isGlyphLocationsLong,locaTable,numGlyphs}=_ref16,loca=(this.glyphs=[],new DataView(locaTable.buffer,locaTable.byteOffset,locaTable.byteLength)),glyf=new DataView(_ref16.buffer,_ref16.byteOffset,_ref16.byteLength),offsetSize=isGlyphLocationsLong?4:2,prev=isGlyphLocationsLong?loca.getUint32(0):2*loca.getUint16(0),pos=0,i=0;i<numGlyphs;i++){pos+=offsetSize;var glyph,next=isGlyphLocationsLong?loca.getUint32(pos):2*loca.getUint16(pos);next===prev?this.glyphs.push(new Glyph({})):(glyph=Glyph.parse(prev,glyf),this.glyphs.push(glyph),prev=next)}}getSize(){return Math.sumPrecise(this.glyphs.map(g=>g.getSize()+3&-4))}write(){var glyph,totalSize=this.getSize(),glyfTable=new DataView(new ArrayBuffer(totalSize)),isLocationLong=131070<totalSize,offsetSize=isLocationLong?4:2,locaTable=new DataView(new ArrayBuffer((this.glyphs.length+1)*offsetSize)),pos=(isLocationLong?locaTable.setUint32(0,0):locaTable.setUint16(0,0),0),locaIndex=0;for(glyph of this.glyphs)pos=(pos+=glyph.write(pos,glyfTable))+3&-4,locaIndex+=offsetSize,isLocationLong?locaTable.setUint32(locaIndex,pos):locaTable.setUint16(locaIndex,pos>>1);return{isLocationLong:isLocationLong,loca:new Uint8Array(locaTable.buffer),glyf:new Uint8Array(glyfTable.buffer)}}scale(factors){for(var i=0,ii=this.glyphs.length;i<ii;i++)this.glyphs[i].scale(factors[i])}}class Glyph{constructor(_ref17){var{header:_ref17=null,simple=null,composites=null}=_ref17;this.header=_ref17,this.simple=simple,this.composites=composites}static parse(pos,glyf){var[read,header]=GlyphHeader.parse(pos,glyf);if(pos+=read,header.numberOfContours<0){for(var composites=[];;){var[n,composite]=CompositeGlyph.parse(pos,glyf);if(pos+=n,composites.push(composite),!(composite.flags&MORE_COMPONENTS))break}return new Glyph({header:header,composites:composites})}read=SimpleGlyph.parse(pos,glyf,header.numberOfContours);return new Glyph({header:header,simple:read})}getSize(){var size;return this.header?(size=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(c=>c.getSize())),this.header.getSize()+size):0}write(pos,buf){if(!this.header)return 0;var spos=pos;if(pos+=this.header.write(pos,buf),this.simple)pos+=this.simple.write(pos,buf);else for(var composite of this.composites)pos+=composite.write(pos,buf);return pos-spos}scale(factor){if(this.header){var xMiddle=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(xMiddle,factor),this.simple)this.simple.scale(xMiddle,factor);else for(var composite of this.composites)composite.scale(xMiddle,factor)}}}class GlyphHeader{constructor(_ref18){var{numberOfContours:_ref18,xMin,yMin,xMax,yMax}=_ref18;this.numberOfContours=_ref18,this.xMin=xMin,this.yMin=yMin,this.xMax=xMax,this.yMax=yMax}static parse(pos,glyf){return[10,new GlyphHeader({numberOfContours:glyf.getInt16(pos),xMin:glyf.getInt16(pos+2),yMin:glyf.getInt16(pos+4),xMax:glyf.getInt16(pos+6),yMax:glyf.getInt16(pos+8)})]}getSize(){return 10}write(pos,buf){return buf.setInt16(pos,this.numberOfContours),buf.setInt16(pos+2,this.xMin),buf.setInt16(pos+4,this.yMin),buf.setInt16(pos+6,this.xMax),buf.setInt16(pos+8,this.yMax),10}scale(x,factor){this.xMin=Math.round(x+(this.xMin-x)*factor),this.xMax=Math.round(x+(this.xMax-x)*factor)}}class Contour{constructor(_ref19){var{flags:_ref19,xCoordinates,yCoordinates}=_ref19;this.xCoordinates=xCoordinates,this.yCoordinates=yCoordinates,this.flags=_ref19}}class SimpleGlyph{constructor(_ref20){var{contours:_ref20,instructions}=_ref20;this.contours=_ref20,this.instructions=instructions}static parse(pos,glyf,numberOfContours){for(var endPtsOfContours=[],i=0;i<numberOfContours;i++){var endPt=glyf.getUint16(pos);pos+=2,endPtsOfContours.push(endPt)}for(var numberOfPt=endPtsOfContours[numberOfContours-1]+1,instructionLength=glyf.getUint16(pos),instructions=(pos+=2,new Uint8Array(glyf).slice(pos,pos+instructionLength)),flags=(pos+=instructionLength,[]),_i23=0;_i23<numberOfPt;pos++,_i23++){var flag=glyf.getUint8(pos);if(flags.push(flag),flag&REPEAT_FLAG){var count=glyf.getUint8(++pos);flag^=REPEAT_FLAG;for(var m=0;m<count;m++)flags.push(flag);_i23+=count}}for(var allXCoordinates=[],xCoordinates=[],yCoordinates=[],pointFlags=[],contours=[],endPtsOfContoursIndex=0,lastCoordinate=0,_i24=0;_i24<numberOfPt;_i24++){var x,_flag=flags[_i24];_flag&X_SHORT_VECTOR?(x=glyf.getUint8(pos++),lastCoordinate+=_flag&X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR?x:-x):_flag&X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR||(lastCoordinate+=glyf.getInt16(pos),pos+=2),xCoordinates.push(lastCoordinate),endPtsOfContours[endPtsOfContoursIndex]===_i24&&(endPtsOfContoursIndex++,allXCoordinates.push(xCoordinates),xCoordinates=[])}for(var lastCoordinate=0,endPtsOfContoursIndex=0,_i25=0;_i25<numberOfPt;_i25++){var y,_flag2=flags[_i25];_flag2&Y_SHORT_VECTOR?(y=glyf.getUint8(pos++),lastCoordinate+=_flag2&Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR?y:-y):_flag2&Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR||(lastCoordinate+=glyf.getInt16(pos),pos+=2),yCoordinates.push(lastCoordinate),pointFlags.push(_flag2&ON_CURVE_POINT|_flag2&OVERLAP_SIMPLE),endPtsOfContours[endPtsOfContoursIndex]===_i25&&(xCoordinates=allXCoordinates[endPtsOfContoursIndex],endPtsOfContoursIndex++,contours.push(new Contour({flags:pointFlags,xCoordinates:xCoordinates,yCoordinates:yCoordinates})),yCoordinates=[],pointFlags=[])}return new SimpleGlyph({contours:contours,instructions:instructions})}getSize(){var contour,size=2*this.contours.length+2+this.instructions.length,lastX=0,lastY=0;for(contour of this.contours){size+=contour.flags.length;for(var i=0,ii=contour.xCoordinates.length;i<ii;i++){var x=contour.xCoordinates[i],y=contour.yCoordinates[i],abs=Math.abs(x-lastX);255<abs?size+=2:0<abs&&(size+=1),lastX=x,255<(abs=Math.abs(y-lastY))?size+=2:0<abs&&(size+=1),lastY=y}}return size}write(pos,buf){var contour,_flag3,spos=pos,xCoordinates=[],yCoordinates=[],flags=[],lastX=0,lastY=0;for(contour of this.contours){for(var i=0,ii=contour.xCoordinates.length;i<ii;i++){var flag=contour.flags[i],x=contour.xCoordinates[i],delta=x-lastX,abs=(0==delta?(flag|=X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR,xCoordinates.push(0)):(abs=Math.abs(delta))<=255?(flag|=0<=delta?X_SHORT_VECTOR|X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR:X_SHORT_VECTOR,xCoordinates.push(abs)):xCoordinates.push(delta),lastX=x,contour.yCoordinates[i]);0==(delta=abs-lastY)?(flag|=Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR,yCoordinates.push(0)):(x=Math.abs(delta))<=255?(flag|=0<=delta?Y_SHORT_VECTOR|Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR:Y_SHORT_VECTOR,yCoordinates.push(x)):yCoordinates.push(delta),lastY=abs,flags.push(flag)}buf.setUint16(pos,xCoordinates.length-1),pos+=2}buf.setUint16(pos,this.instructions.length),pos+=2,this.instructions.length&&(new Uint8Array(buf.buffer,0,buf.buffer.byteLength).set(this.instructions,pos),pos+=this.instructions.length);for(_flag3 of flags)buf.setUint8(pos++,_flag3);for(var _i26=0,_ii7=xCoordinates.length;_i26<_ii7;_i26++){var _x=xCoordinates[_i26],_flag4=flags[_i26];_flag4&X_SHORT_VECTOR?buf.setUint8(pos++,_x):_flag4&X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR||(buf.setInt16(pos,_x),pos+=2)}for(var _i27=0,_ii8=yCoordinates.length;_i27<_ii8;_i27++){var _y=yCoordinates[_i27],_flag5=flags[_i27];_flag5&Y_SHORT_VECTOR?buf.setUint8(pos++,_y):_flag5&Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR||(buf.setInt16(pos,_y),pos+=2)}return pos-spos}scale(x,factor){for(var contour of this.contours)if(0!==contour.xCoordinates.length)for(var i=0,ii=contour.xCoordinates.length;i<ii;i++)contour.xCoordinates[i]=Math.round(x+(contour.xCoordinates[i]-x)*factor)}}class CompositeGlyph{constructor(_ref21){var{flags:_ref21,glyphIndex,argument1,argument2,transf,instructions}=_ref21;this.flags=_ref21,this.glyphIndex=glyphIndex,this.argument1=argument1,this.argument2=argument2,this.transf=transf,this.instructions=instructions}static parse(pos,glyf){var argument1,argument2,instructionLength,spos=pos,transf=[],flags=glyf.getUint16(pos),glyphIndex=glyf.getUint16(pos+2),instructions=(pos+=4,flags&ARG_1_AND_2_ARE_WORDS?(argument2=flags&ARGS_ARE_XY_VALUES?(argument1=glyf.getInt16(pos),glyf.getInt16(pos+2)):(argument1=glyf.getUint16(pos),glyf.getUint16(pos+2)),pos+=4,flags^=ARG_1_AND_2_ARE_WORDS):(argument2=flags&ARGS_ARE_XY_VALUES?(argument1=glyf.getInt8(pos),glyf.getInt8(pos+1)):(argument1=glyf.getUint8(pos),glyf.getUint8(pos+1)),pos+=2),flags&WE_HAVE_A_SCALE?(transf.push(glyf.getUint16(pos)),pos+=2):flags&WE_HAVE_AN_X_AND_Y_SCALE?(transf.push(glyf.getUint16(pos),glyf.getUint16(pos+2)),pos+=4):flags&WE_HAVE_A_TWO_BY_TWO&&(transf.push(glyf.getUint16(pos),glyf.getUint16(pos+2),glyf.getUint16(pos+4),glyf.getUint16(pos+6)),pos+=8),null);return flags&WE_HAVE_INSTRUCTIONS&&(instructionLength=glyf.getUint16(pos),pos+=2,instructions=new Uint8Array(glyf).slice(pos,pos+instructionLength),pos+=instructionLength),[pos-spos,new CompositeGlyph({flags:flags,glyphIndex:glyphIndex,argument1:argument1,argument2:argument2,transf:transf,instructions:instructions})]}getSize(){var size=4+2*this.transf.length;return this.flags&WE_HAVE_INSTRUCTIONS&&(size+=2+this.instructions.length),size+=2,2&this.flags?-128<=this.argument1&&this.argument1<=127&&-128<=this.argument2&&this.argument2<=127||(size+=2):0<=this.argument1&&this.argument1<=255&&0<=this.argument2&&this.argument2<=255||(size+=2),size}write(pos,buf){var spos=pos;return this.flags&ARGS_ARE_XY_VALUES?-128<=this.argument1&&this.argument1<=127&&-128<=this.argument2&&this.argument2<=127||(this.flags|=ARG_1_AND_2_ARE_WORDS):0<=this.argument1&&this.argument1<=255&&0<=this.argument2&&this.argument2<=255||(this.flags|=ARG_1_AND_2_ARE_WORDS),buf.setUint16(pos,this.flags),buf.setUint16(pos+2,this.glyphIndex),pos+=4,this.flags&ARG_1_AND_2_ARE_WORDS?(this.flags&ARGS_ARE_XY_VALUES?(buf.setInt16(pos,this.argument1),buf.setInt16(pos+2,this.argument2)):(buf.setUint16(pos,this.argument1),buf.setUint16(pos+2,this.argument2)),pos+=4):(buf.setUint8(pos,this.argument1),buf.setUint8(pos+1,this.argument2),pos+=2),this.flags&WE_HAVE_INSTRUCTIONS&&(buf.setUint16(pos,this.instructions.length),pos+=2,this.instructions.length)&&(new Uint8Array(buf.buffer,0,buf.buffer.byteLength).set(this.instructions,pos),pos+=this.instructions.length),pos-spos}scale(x,factor){}}function writeInt16(dest,offset,num){dest[offset]=num>>8&255,dest[offset+1]=255&num}function writeInt32(dest,offset,num){dest[offset]=num>>24&255,dest[offset+1]=num>>16&255,dest[offset+2]=num>>8&255,dest[offset+3]=255&num}function writeData(dest,offset,data){if(data instanceof Uint8Array)dest.set(data,offset);else if("string"==typeof data)for(var i=0,ii=data.length;i<ii;i++)dest[offset++]=255&data.charCodeAt(i);else for(var num of data)dest[offset++]=255&num}var OTF_HEADER_SIZE=12,OTF_TABLE_ENTRY_SIZE=16;class OpenTypeFileBuilder{constructor(sfnt){this.sfnt=sfnt,this.tables=Object.create(null)}static getSearchParams(entriesCount,entrySize){for(var maxPower2=1,log2=0;maxPower2<(maxPower2^entriesCount);)maxPower2<<=1,log2++;var searchRange=maxPower2*entrySize;return{range:searchRange,entry:log2,rangeShift:entrySize*entriesCount-searchRange}}toArray(){for(var tableName,sfnt=this.sfnt,tables=this.tables,tablesNames=Object.keys(tables),numTables=(tablesNames.sort(),tablesNames.length),offset=OTF_HEADER_SIZE+numTables*OTF_TABLE_ENTRY_SIZE,tableOffsets=[offset],i=0;i<numTables;i++){var table,paddedLength=((table=tables[tablesNames[i]]).length+3&-4)>>>0;tableOffsets.push(offset+=paddedLength)}var file=new Uint8Array(offset);for(i=0;i<numTables;i++)table=tables[tablesNames[i]],writeData(file,tableOffsets[i],table);"true"===sfnt&&(sfnt=string32(65536)),file[0]=255&sfnt.charCodeAt(0),file[1]=255&sfnt.charCodeAt(1),file[2]=255&sfnt.charCodeAt(2),file[3]=255&sfnt.charCodeAt(3),writeInt16(file,4,numTables);sfnt=OpenTypeFileBuilder.getSearchParams(numTables,16);for(writeInt16(file,6,sfnt.range),writeInt16(file,8,sfnt.entry),writeInt16(file,10,sfnt.rangeShift),offset=OTF_HEADER_SIZE,i=0;i<numTables;i++){tableName=tablesNames[i],file[offset]=255&tableName.charCodeAt(0),file[offset+1]=255&tableName.charCodeAt(1),file[offset+2]=255&tableName.charCodeAt(2),file[offset+3]=255&tableName.charCodeAt(3);for(var checksum=0,j=tableOffsets[i],jj=tableOffsets[i+1];j<jj;j+=4)checksum=checksum+readUint32(file,j)>>>0;writeInt32(file,offset+4,checksum),writeInt32(file,offset+8,tableOffsets[i]),writeInt32(file,offset+12,tables[tableName].length),offset+=OTF_TABLE_ENTRY_SIZE}return file}addTable(tag,data){if(tag in this.tables)throw new Error("Table "+tag+" already exists");this.tables[tag]=data}}var HINTING_ENABLED=!1,COMMAND_MAP={hstem:[1],vstem:[3],vmoveto:[4],rlineto:[5],hlineto:[6],vlineto:[7],rrcurveto:[8],callsubr:[10],flex:[12,35],drop:[12,18],endchar:[14],rmoveto:[21],hmoveto:[22],vhcurveto:[30],hvcurveto:[31]};class Type1CharString{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(encoded,subrs,seacAnalysisEnabled){for(var count=encoded.length,error=!1,i=0;i<count;i++){var wx,sbx,sby,subrNumber,num1,flexArgs,value=encoded[i];if(value<32){switch(value=12===value?(value<<8)+encoded[++i]:value){case 1:HINTING_ENABLED?error=this.executeCommand(2,COMMAND_MAP.hstem):this.stack=[];break;case 3:HINTING_ENABLED?error=this.executeCommand(2,COMMAND_MAP.vstem):this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){error=!0;break}var dy=this.stack.pop();this.stack.push(0,dy)}else error=this.executeCommand(1,COMMAND_MAP.vmoveto);break;case 5:error=this.executeCommand(2,COMMAND_MAP.rlineto);break;case 6:error=this.executeCommand(1,COMMAND_MAP.hlineto);break;case 7:error=this.executeCommand(1,COMMAND_MAP.vlineto);break;case 8:error=this.executeCommand(6,COMMAND_MAP.rrcurveto);break;case 9:this.stack=[];break;case 10:this.stack.length<1?error=!0:error=!subrs[subrNumber=this.stack.pop()]||this.convert(subrs[subrNumber],subrs,seacAnalysisEnabled);break;case 11:return error;case 13:this.stack.length<2?error=!0:(wx=this.stack.pop(),sbx=this.stack.pop(),this.lsb=sbx,this.width=wx,this.stack.push(wx,sbx),error=this.executeCommand(2,COMMAND_MAP.hmoveto));break;case 14:this.output.push(COMMAND_MAP.endchar[0]);break;case 21:this.flexing||(error=this.executeCommand(2,COMMAND_MAP.rmoveto));break;case 22:this.flexing?this.stack.push(0):error=this.executeCommand(1,COMMAND_MAP.hmoveto);break;case 30:error=this.executeCommand(4,COMMAND_MAP.vhcurveto);break;case 31:error=this.executeCommand(4,COMMAND_MAP.hvcurveto);break;case 3072:this.stack=[];break;case 3073:HINTING_ENABLED?error=this.executeCommand(2,COMMAND_MAP.vstem):this.stack=[];break;case 3074:HINTING_ENABLED?error=this.executeCommand(2,COMMAND_MAP.hstem):this.stack=[];break;case 3078:error=seacAnalysisEnabled?(dy=this.stack.at(-5),this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-dy,this.executeCommand(0,COMMAND_MAP.endchar)):this.executeCommand(4,COMMAND_MAP.endchar);break;case 3079:this.stack.length<4?error=!0:(this.stack.pop(),wx=this.stack.pop(),sby=this.stack.pop(),sbx=this.stack.pop(),this.lsb=sbx,this.width=wx,this.stack.push(wx,sbx,sby),error=this.executeCommand(3,COMMAND_MAP.rmoveto));break;case 3084:this.stack.length<2?error=!0:(sby=this.stack.pop(),num1=this.stack.pop(),this.stack.push(num1/sby));break;case 3088:this.stack.length<2?error=!0:(subrNumber=this.stack.pop(),num1=this.stack.pop(),0===subrNumber&&3===num1?(flexArgs=this.stack.splice(-17,17),this.stack.push(flexArgs[2]+flexArgs[0],flexArgs[3]+flexArgs[1],flexArgs[4],flexArgs[5],flexArgs[6],flexArgs[7],flexArgs[8],flexArgs[9],flexArgs[10],flexArgs[11],flexArgs[12],flexArgs[13],flexArgs[14]),error=this.executeCommand(13,COMMAND_MAP.flex,!0),this.flexing=!1,this.stack.push(flexArgs[15],flexArgs[16])):1===subrNumber&&0===num1&&(this.flexing=!0));break;case 3089:break;case 3105:this.stack=[];break;default:warn('Unknown type 1 charstring command of "'+value+'"')}if(error)break}else value<=246?value-=139:value=value<=250?256*(value-247)+encoded[++i]+108:value<=254?-256*(value-251)-encoded[++i]-108:(255&encoded[++i])<<24|(255&encoded[++i])<<16|(255&encoded[++i])<<8|(255&encoded[++i])<<0,this.stack.push(value)}return error}executeCommand(howManyArgs,command,keepStack){var stackLength=this.stack.length;if(stackLength<howManyArgs)return!0;for(var start=stackLength-howManyArgs,i=start;i<stackLength;i++){var value=this.stack[i];Number.isInteger(value)?this.output.push(28,value>>8&255,255&value):this.output.push(255,(value=65536*value|0)>>24&255,value>>16&255,value>>8&255,255&value)}return this.output.push(...command),keepStack?this.stack.splice(start,howManyArgs):this.stack.length=0,!1}}var EEXEC_ENCRYPT_KEY=55665,CHAR_STRS_ENCRYPT_KEY=4330;function isHexDigit(code){return 48<=code&&code<=57||65<=code&&code<=70||97<=code&&code<=102}function decrypt(data,key,discardNumber){if(discardNumber>=data.length)return new Uint8Array(0);for(var j,r=0|key,i=0;i<discardNumber;i++)r=52845*(data[i]+r)+22719&65535;var count=data.length-discardNumber,decrypted=new Uint8Array(count);for(i=discardNumber,j=0;j<count;i++,j++){var value=data[i];decrypted[j]=value^r>>8,r=52845*(value+r)+22719&65535}return decrypted}function decryptAscii(data,key,discardNumber){for(var r=0|key,count=data.length,decrypted=new Uint8Array(count>>>1),i=0,j=0;i<count;i++){var digit1=data[i];if(isHexDigit(digit1)){i++;for(var digit2=void 0;i<count&&!isHexDigit(digit2=data[i]);)i++;i<count&&(digit1=parseInt(String.fromCharCode(digit1,digit2),16),decrypted[j++]=digit1^r>>8,r=52845*(digit1+r)+22719&65535)}}return decrypted.slice(discardNumber,j)}function isSpecial(c){return 47===c||91===c||93===c||123===c||125===c||40===c||41===c}class Type1Parser{constructor(stream,encrypted,seacAnalysisEnabled){var isBinary;encrypted&&(isBinary=!((isHexDigit((encrypted=stream.getBytes())[0])||isWhiteSpace(encrypted[0]))&&isHexDigit(encrypted[1])&&isHexDigit(encrypted[2])&&isHexDigit(encrypted[3])&&isHexDigit(encrypted[4])&&isHexDigit(encrypted[5])&&isHexDigit(encrypted[6])&&isHexDigit(encrypted[7])),stream=new Stream((isBinary?decrypt:decryptAscii)(encrypted,EEXEC_ENCRYPT_KEY,4))),this.seacAnalysisEnabled=!!seacAnalysisEnabled,this.stream=stream,this.nextChar()}readNumberArray(){this.getToken();for(var array=[];;){var token=this.getToken();if(null===token||"]"===token||"}"===token)break;array.push(parseFloat(token||0))}return array}readNumber(){var token=this.getToken();return parseFloat(token||0)}readInt(){var token=this.getToken();return 0|parseInt(token||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){for(var comment=!1,ch=this.currentChar;;){if(-1===ch)return null;if(comment)10!==ch&&13!==ch||(comment=!1);else if(37===ch)comment=!0;else if(!isWhiteSpace(ch))break;ch=this.nextChar()}if(isSpecial(ch))return this.nextChar(),String.fromCharCode(ch);for(var token="";token+=String.fromCharCode(ch),0<=(ch=this.nextChar())&&!isWhiteSpace(ch)&&!isSpecial(ch););return token}readCharStrings(bytes,lenIV){return-1===lenIV?bytes:decrypt(bytes,CHAR_STRS_ENCRYPT_KEY,lenIV)}extractFontProgram(properties){for(var token,glyph,length,data,lenIV,encoded,_encoded2,_glyph,stream=this.stream,subrs=[],charstrings=[],privateData=Object.create(null),program=(privateData.lenIV=4,{subrs:[],charstrings:[],properties:{privateData:privateData}});null!==(token=this.getToken());)if("/"===token)switch(token=this.getToken()){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();;){if(null===(token=this.getToken())||"end"===token)break;"/"===token&&(glyph=this.getToken(),length=this.readInt(),this.getToken(),data=0<length?stream.getBytes(length):new Uint8Array(0),lenIV=program.properties.privateData.lenIV,encoded=this.readCharStrings(data,lenIV),this.nextChar(),"noaccess"===(token=this.getToken())?this.getToken():"/"===token&&this.prevChar(),charstrings.push({glyph:glyph,encoded:encoded}))}break;case"Subrs":for(this.readInt(),this.getToken();"dup"===this.getToken();){var index=this.readInt(),_encoded=(length=this.readInt(),this.getToken(),data=0<length?stream.getBytes(length):new Uint8Array(0),lenIV=program.properties.privateData.lenIV,this.readCharStrings(data,lenIV));this.nextChar(),"noaccess"===(token=this.getToken())&&this.getToken(),subrs[index]=_encoded}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var blueArray=this.readNumberArray();0<blueArray.length&&blueArray.length%2==0&&HINTING_ENABLED&&(program.properties.privateData[token]=blueArray);break;case"StemSnapH":case"StemSnapV":program.properties.privateData[token]=this.readNumberArray();break;case"StdHW":case"StdVW":program.properties.privateData[token]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":program.properties.privateData[token]=this.readNumber();break;case"ExpansionFactor":program.properties.privateData[token]=this.readNumber()||.06;break;case"ForceBold":program.properties.privateData[token]=this.readBoolean()}for({encoded:_encoded2,glyph:_glyph}of charstrings){var charString=new Type1CharString,error=charString.convert(_encoded2,subrs,this.seacAnalysisEnabled),output=charString.output,error={glyphName:_glyph,charstring:output=error?[14]:output,width:charString.width,lsb:charString.lsb,seac:charString.seac};".notdef"===_glyph?program.charstrings.unshift(error):program.charstrings.push(error),properties.builtInEncoding&&-1<(output=properties.builtInEncoding.indexOf(_glyph))&&void 0===properties.widths[output]&&output>=properties.firstChar&&output<=properties.lastChar&&(properties.widths[output]=charString.width)}return program}extractFontHeader(properties){for(var token;null!==(token=this.getToken());)if("/"===token)switch(token=this.getToken()){case"FontMatrix":var matrix=this.readNumberArray();properties.fontMatrix=matrix;break;case"Encoding":var matrix=this.getToken(),encoding=void 0;if(/^\d+$/.test(matrix)){var encoding=[],size=0|parseInt(matrix,10);this.getToken();for(var j=0;j<size;j++){for(token=this.getToken();"dup"!==token&&"def"!==token;)if(null===(token=this.getToken()))return;if("def"===token)break;var index=this.readInt(),glyph=(this.getToken(),this.getToken());encoding[index]=glyph,this.getToken()}}else encoding=getEncoding(matrix);properties.builtInEncoding=encoding;break;case"FontBBox":var fontBBox=this.readNumberArray();properties.ascent=Math.max(fontBBox[3],fontBBox[1]),properties.descent=Math.min(fontBBox[1],fontBBox[3]),properties.ascentScaled=!0}}}function findBlock(streamBytes,signature,startIndex){for(var streamBytesLength=streamBytes.length,signatureLength=signature.length,scanLength=streamBytesLength-signatureLength,i=startIndex,found=!1;i<scanLength;){for(var j=0;j<signatureLength&&streamBytes[i+j]===signature[j];)j++;if(signatureLength<=j){for(i+=j;i<streamBytesLength&&isWhiteSpace(streamBytes[i]);)i++;found=!0;break}i++}return{found:found,length:i}}function getHeaderBlock(stream,suggestedLength){var headerBytes,headerBytesLength,EEXEC_SIGNATURE=[101,101,120,101,99],streamStartPos=stream.pos;try{headerBytesLength=(headerBytes=stream.getBytes(suggestedLength)).length}catch(_unused9){}if(headerBytesLength===suggestedLength&&(block=findBlock(headerBytes,EEXEC_SIGNATURE,suggestedLength-2*EEXEC_SIGNATURE.length)).found&&block.length===suggestedLength)return{stream:new Stream(headerBytes),length:suggestedLength};warn('Invalid "Length1" property in Type1 font -- trying to recover.'),stream.pos=streamStartPos;for(var actualLength,block;0!==(block=findBlock(stream.peekBytes(2048),EEXEC_SIGNATURE,0)).length;)if(stream.pos+=block.length,block.found){actualLength=stream.pos-streamStartPos;break}return stream.pos=streamStartPos,actualLength?{stream:new Stream(stream.getBytes(actualLength)),length:actualLength}:(warn('Unable to recover "Length1" property in Type1 font -- using as is.'),{stream:new Stream(stream.getBytes(suggestedLength)),length:suggestedLength})}function getEexecBlock(stream,suggestedLength){stream=stream.getBytes();if(0===stream.length)throw new FormatError("getEexecBlock - no font program found.");return{stream:new Stream(stream),length:stream.length}}class Type1Font{constructor(name,file,properties){var key,headerBlockLength=properties.length1,eexecBlockLength=properties.length2,pfbHeader=file.peekBytes(6),pfbHeaderPresent=128===pfbHeader[0]&&1===pfbHeader[1],headerBlockLength=(pfbHeaderPresent&&(file.skip(6),headerBlockLength=pfbHeader[5]<<24|pfbHeader[4]<<16|pfbHeader[3]<<8|pfbHeader[2]),getHeaderBlock(file,headerBlockLength)),headerBlockLength=(new Type1Parser(headerBlockLength.stream,!1,SEAC_ANALYSIS_ENABLED).extractFontHeader(properties),pfbHeaderPresent&&(eexecBlockLength=(pfbHeader=file.getBytes(6))[5]<<24|pfbHeader[4]<<16|pfbHeader[3]<<8|pfbHeader[2]),getEexecBlock(file,eexecBlockLength)),data=new Type1Parser(headerBlockLength.stream,!0,SEAC_ANALYSIS_ENABLED).extractFontProgram(properties);for(key in data.properties)properties[key]=data.properties[key];pfbHeaderPresent=data.charstrings,pfbHeader=this.getType2Charstrings(pfbHeaderPresent),file=this.getType2Subrs(data.subrs);this.charstrings=pfbHeaderPresent,this.data=this.wrap(name,pfbHeader,this.charstrings,file,properties),this.seacs=this.getSeacs(data.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){var glyphName,charset=[".notdef"];for({glyphName}of this.charstrings)charset.push(glyphName);return charset}getGlyphMapping(properties){var charstrings=this.charstrings;if(properties.composite){for(var charCodeToGlyphId=Object.create(null),_glyphId=0,charstringsLen=charstrings.length;_glyphId<charstringsLen;_glyphId++)charCodeToGlyphId[properties.cMap.charCodeOf(_glyphId)]=_glyphId+1;return charCodeToGlyphId}for(var builtInEncoding,glyphNames=[".notdef"],glyphId=0;glyphId<charstrings.length;glyphId++)glyphNames.push(charstrings[glyphId].glyphName);var encoding=properties.builtInEncoding;if(encoding)for(var _charCode in builtInEncoding=Object.create(null),encoding)0<=(glyphId=glyphNames.indexOf(encoding[_charCode]))&&(builtInEncoding[_charCode]=glyphId);return type1FontGlyphMapping(properties,builtInEncoding,glyphNames)}hasGlyphId(id){return!(id<0||id>=this.numGlyphs)&&(0===id||0<this.charstrings[id-1].charstring.length)}getSeacs(charstrings){for(var seacMap=[],i=0,ii=charstrings.length;i<ii;i++){var charstring=charstrings[i];charstring.seac&&(seacMap[i+1]=charstring.seac)}return seacMap}getType2Charstrings(type1Charstrings){var type1Charstring,type2Charstrings=[];for(type1Charstring of type1Charstrings)type2Charstrings.push(type1Charstring.charstring);return type2Charstrings}getType2Subrs(type1Subrs){for(var bias=0,count=type1Subrs.length,bias=count<1133?107:count<33769?1131:32768,type2Subrs=[],i=0;i<bias;i++)type2Subrs.push([11]);for(i=0;i<count;i++)type2Subrs.push(type1Subrs[i]);return type2Subrs}wrap(name,glyphs,charstrings,subrs,properties){for(var ii,cff=new CFF,topDict=(cff.header=new CFFHeader(1,0,4,4),cff.names=[name],new CFFTopDict),strings=(topDict.setByName("version",391),topDict.setByName("Notice",392),topDict.setByName("FullName",393),topDict.setByName("FamilyName",394),topDict.setByName("Weight",395),topDict.setByName("Encoding",null),topDict.setByName("FontMatrix",properties.fontMatrix),topDict.setByName("FontBBox",properties.bbox),topDict.setByName("charset",null),topDict.setByName("CharStrings",null),topDict.setByName("Private",null),cff.topDict=topDict,new CFFStrings),count=(strings.add("Version 0.11"),strings.add("See original notice"),strings.add(name),strings.add(name),strings.add("Medium"),cff.strings=strings,cff.globalSubrIndex=new CFFIndex,glyphs.length),charsetArray=[".notdef"],i=0;i<count;i++){var glyphName=charstrings[i].glyphName;-1===CFFStandardStrings.indexOf(glyphName)&&strings.add(glyphName),charsetArray.push(glyphName)}cff.charset=new CFFCharset(!1,0,charsetArray);var charStringsIndex=new CFFIndex;for(charStringsIndex.add([139,14]),i=0;i<count;i++)charStringsIndex.add(glyphs[i]);cff.charStrings=charStringsIndex;var privateDict=new CFFPrivateDict,fields=(privateDict.setByName("Subrs",null),["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"]);for(i=0,ii=fields.length;i<ii;i++){var field=fields[i];if(field in properties.privateData){var value=properties.privateData[field];if(Array.isArray(value))for(var j=value.length-1;0<j;j--)value[j]-=value[j-1];privateDict.setByName(field,value)}}cff.topDict.privateDict=privateDict;var subrIndex=new CFFIndex;for(i=0,ii=subrs.length;i<ii;i++)subrIndex.add(subrs[i]);return privateDict.subrsIndex=subrIndex,new CFFCompiler(cff).compile()}}var PRIVATE_USE_AREAS=[[57344,63743],[1048576,1114109]],PDF_GLYPH_SPACE_UNITS=1e3,EXPORT_DATA_PROPERTIES=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],EXPORT_DATA_EXTRA_PROPERTIES=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function adjustWidths(properties){if(properties.fontMatrix&&properties.fontMatrix[0]!==FONT_IDENTITY_MATRIX[0]){var glyph,scale=.001/properties.fontMatrix[0],glyphsWidths=properties.widths;for(glyph in glyphsWidths)glyphsWidths[glyph]*=scale;properties.defaultWidth*=scale}}function adjustTrueTypeToUnicode(properties,isSymbolicFont,nameRecords){if(!properties.isInternalFont&&!properties.hasIncludedToUnicodeMap&&!properties.hasEncoding&&!(properties.toUnicode instanceof IdentityToUnicodeMap)&&isSymbolicFont&&0!==nameRecords.length&&properties.defaultEncoding!==WinAnsiEncoding){for(var r of nameRecords)if(!isWinNameRecord(r))return;var charCode,encoding=WinAnsiEncoding,toUnicode=[],glyphsUnicodeMap=getGlyphsUnicode();for(charCode in encoding){var glyphName=encoding[charCode];""!==glyphName&&void 0!==(glyphName=glyphsUnicodeMap[glyphName])&&(toUnicode[charCode]=String.fromCharCode(glyphName))}0<toUnicode.length&&properties.toUnicode.amend(toUnicode)}}function adjustType1ToUnicode(properties,builtInEncoding){if(!properties.isInternalFont&&!(properties.hasIncludedToUnicodeMap||builtInEncoding===properties.defaultEncoding||properties.toUnicode instanceof IdentityToUnicodeMap)){var charCode,unicode,toUnicode=[],glyphsUnicodeMap=getGlyphsUnicode();for(charCode in builtInEncoding)properties.hasEncoding&&(properties.baseEncodingName||void 0!==properties.differences[charCode])||-1!==(unicode=getUnicodeForGlyph(builtInEncoding[charCode],glyphsUnicodeMap))&&(toUnicode[charCode]=String.fromCharCode(unicode));0<toUnicode.length&&properties.toUnicode.amend(toUnicode)}}function amendFallbackToUnicode(properties){if(properties.fallbackToUnicode&&!(properties.toUnicode instanceof IdentityToUnicodeMap)){var charCode,toUnicode=[];for(charCode in properties.fallbackToUnicode)properties.toUnicode.has(charCode)||(toUnicode[charCode]=properties.fallbackToUnicode[charCode]);0<toUnicode.length&&properties.toUnicode.amend(toUnicode)}}class fonts_Glyph{constructor(originalCharCode,fontChar,unicode,accent,width,vmetric,operatorListId,isSpace,isInFont){this.originalCharCode=originalCharCode,this.fontChar=fontChar,this.unicode=unicode,this.accent=accent,this.width=width,this.vmetric=vmetric,this.operatorListId=operatorListId,this.isSpace=isSpace,this.isInFont=isInFont}get category(){return shadow(this,"category",getCharUnicodeCategory(this.unicode),!0)}}function int16(b0,b1){return(b0<<8)+b1}function writeSignedInt16(bytes,index,value){bytes[index+1]=value,bytes[index]=value>>>8}function signedInt16(b0,b1){b0=(b0<<8)+b1;return 32768&b0?b0-65536:b0}function writeUint32(bytes,index,value){bytes[index+3]=255&value,bytes[index+2]=value>>>8,bytes[index+1]=value>>>16,bytes[index]=value>>>24}function int32(b0,b1,b2,b3){return(b0<<24)+(b1<<16)+(b2<<8)+b3}function string16(value){return String.fromCharCode(value>>8&255,255&value)}function safeString16(value){return 32767<value?value=32767:value<-32768&&(value=-32768),String.fromCharCode(value>>8&255,255&value)}function isTrueTypeFile(file){file=file.peekBytes(4);return 65536===readUint32(file,0)||"true"===bytesToString(file)}function isTrueTypeCollectionFile(file){return"ttcf"===bytesToString(file.peekBytes(4))}function isOpenTypeFile(file){return"OTTO"===bytesToString(file.peekBytes(4))}function isType1File(file){file=file.peekBytes(2);return 37===file[0]&&33===file[1]||128===file[0]&&1===file[1]}function isCFFFile(file){file=file.peekBytes(4);return 1<=file[0]&&1<=file[3]&&file[3]<=4}function getFontFileType(file,_ref22){var fileType,fileSubtype,{type:_ref22,subtype,composite}=_ref22;return isTrueTypeFile(file)||isTrueTypeCollectionFile(file)?fileType=composite?"CIDFontType2":"TrueType":isOpenTypeFile(file)?fileType=composite?"CIDFontType2":"OpenType":isType1File(file)?fileType=composite?"CIDFontType0":"MMType1"===_ref22?"MMType1":"Type1":fileSubtype=isCFFFile(file)?composite?(fileType="CIDFontType0","CIDFontType0C"):(fileType="MMType1"===_ref22?"MMType1":"Type1","Type1C"):(warn("getFontFileType: Unable to detect correct font file Type/Subtype."),fileType=_ref22,subtype),[fileType,fileSubtype]}function applyStandardFontGlyphMap(map,glyphMap){for(var charCode in glyphMap)map[+charCode]=glyphMap[charCode]}function buildToFontChar(encoding,glyphsUnicodeMap,differences){for(var unicode,charCode,toFontChar=[],i=0,ii=encoding.length;i<ii;i++)-1!==(unicode=getUnicodeForGlyph(encoding[i],glyphsUnicodeMap))&&(toFontChar[i]=unicode);for(charCode in differences)-1!==(unicode=getUnicodeForGlyph(differences[charCode],glyphsUnicodeMap))&&(toFontChar[+charCode]=unicode);return toFontChar}function isMacNameRecord(r){return 1===r.platform&&0===r.encoding&&0===r.language}function isWinNameRecord(r){return 3===r.platform&&1===r.encoding&&1033===r.language}function convertCidString(charCode,cid){var shouldThrow=2<arguments.length&&void 0!==arguments[2]&&arguments[2];switch(cid.length){case 1:return cid.charCodeAt(0);case 2:return cid.charCodeAt(0)<<8|cid.charCodeAt(1)}var msg="Unsupported CID string (charCode ".concat(charCode,'): "').concat(cid,'".');if(shouldThrow)throw new FormatError(msg);return warn(msg),cid}function adjustMapping(charCodeToGlyphId,hasGlyph,newGlyphZeroId,toUnicode){var originalCharCode,code,newMap=Object.create(null),toUnicodeExtraMap=new Map,toFontChar=[],usedGlyphIds=new Set,privateUseAreaIndex=0,nextAvailableFontCharCode=PRIVATE_USE_AREAS[privateUseAreaIndex][0],privateUseOffetEnd=PRIVATE_USE_AREAS[privateUseAreaIndex][1],LIGATURE_TO_UNICODE=null;for(originalCharCode in charCodeToGlyphId){var glyphId=charCodeToGlyphId[originalCharCode];if(hasGlyph(glyphId)){if(privateUseOffetEnd<nextAvailableFontCharCode){if(++privateUseAreaIndex>=PRIVATE_USE_AREAS.length){warn("Ran out of space in font private use area.");break}nextAvailableFontCharCode=PRIVATE_USE_AREAS[privateUseAreaIndex][0],privateUseOffetEnd=PRIVATE_USE_AREAS[privateUseAreaIndex][1]}var fontCharCode=nextAvailableFontCharCode++,unicode=(0===glyphId&&(glyphId=newGlyphZeroId),toUnicode.get(originalCharCode));if("string"==typeof unicode)if(1===unicode.length)unicode=unicode.codePointAt(0);else{if(!LIGATURE_TO_UNICODE)for(var LIGATURE_TO_UNICODE=new Map,i=64256;i<=64335;i++){var normalized=String.fromCharCode(i).normalize("NFKD");1<normalized.length&&LIGATURE_TO_UNICODE.set(normalized,i)}unicode=LIGATURE_TO_UNICODE.get(unicode)||unicode.codePointAt(0)}!unicode||(code=unicode,PRIVATE_USE_AREAS[0][0]<=code&&code<=PRIVATE_USE_AREAS[0][1])||PRIVATE_USE_AREAS[1][0]<=code&&code<=PRIVATE_USE_AREAS[1][1]||usedGlyphIds.has(glyphId)||(toUnicodeExtraMap.set(unicode,glyphId),usedGlyphIds.add(glyphId)),newMap[fontCharCode]=glyphId,toFontChar[originalCharCode]=fontCharCode}}return{toFontChar:toFontChar,charCodeToGlyphId:newMap,toUnicodeExtraMap:toUnicodeExtraMap,nextAvailableFontCharCode:nextAvailableFontCharCode}}function getRanges(glyphs,toUnicodeExtraMap,numGlyphs){var charCode,codes=[];for(charCode in glyphs)glyphs[charCode]>=numGlyphs||codes.push({fontCharCode:0|charCode,glyphId:glyphs[charCode]});if(toUnicodeExtraMap)for(var[unicode,glyphId]of toUnicodeExtraMap)numGlyphs<=glyphId||codes.push({fontCharCode:unicode,glyphId:glyphId});0===codes.length&&codes.push({fontCharCode:0,glyphId:0}),codes.sort((a,b)=>a.fontCharCode-b.fontCharCode);for(var ranges=[],length=codes.length,n=0;n<length;){for(var start=codes[n].fontCharCode,codeIndices=[codes[n].glyphId],end=(++n,start);n<length&&end+1===codes[n].fontCharCode&&(codeIndices.push(codes[n].glyphId),++n,65535!=++end););ranges.push([start,end,codeIndices])}return ranges}function createCmapTable(glyphs,toUnicodeExtraMap,numGlyphs){for(var ii,ranges=getRanges(glyphs,toUnicodeExtraMap,numGlyphs),glyphs=65535<ranges.at(-1)[1]?2:1,toUnicodeExtraMap="\0\0"+string16(glyphs)+"\0\0"+string32(4+8*glyphs),i=ranges.length-1;0<=i&&!(ranges[i][0]<=65535);--i);var range,end,numGlyphs=i+1,trailingRangesCount=(ranges[i][0]<65535&&65535===ranges[i][1]&&(ranges[i][1]=65534),ranges[i][1]<65535?1:0),segCount=numGlyphs+trailingRangesCount,searchParams=OpenTypeFileBuilder.getSearchParams(segCount,2),startCount="",endCount="",idDeltas="",idRangeOffsets="",glyphsIds="",bias=0;for(i=0,ii=numGlyphs;i<ii;i++){start=(range=ranges[i])[0],end=range[1],startCount+=string16(start),endCount+=string16(end);for(var codes,contiguous=!0,j=1,jj=(codes=range[2]).length;j<jj;++j)if(codes[j]!==codes[j-1]+1){contiguous=!1;break}if(contiguous)idDeltas+=string16(codes[0]-start&65535),idRangeOffsets+=string16(0);else{var offset=2*(segCount-i)+2*bias;for(bias+=end-start+1,idDeltas+=string16(0),idRangeOffsets+=string16(offset),j=0,jj=codes.length;j<jj;++j)glyphsIds+=string16(codes[j])}}0<trailingRangesCount&&(endCount+="ÿÿ",startCount+="ÿÿ",idDeltas+="\0",idRangeOffsets+="\0\0");var numGlyphs="\0\0"+string16(2*segCount)+string16(searchParams.range)+string16(searchParams.entry)+string16(searchParams.rangeShift)+endCount+"\0\0"+startCount+idDeltas+idRangeOffsets+glyphsIds,format31012="",trailingRangesCount="";if(1<glyphs){for(toUnicodeExtraMap+="\0\0\n"+string32(4+8*glyphs+4+numGlyphs.length),format31012="",i=0,ii=ranges.length;i<ii;i++){var start=(range=ranges[i])[0],code=(codes=range[2])[0];for(j=1,jj=codes.length;j<jj;++j)codes[j]!==codes[j-1]+1&&(end=range[0]+j-1,format31012+=string32(start)+string32(end)+string32(code),start=end+1,code=codes[j]);format31012+=string32(start)+string32(range[1])+string32(code)}trailingRangesCount="\0\f\0\0"+string32(format31012.length+16)+"\0\0\0\0"+string32(format31012.length/12)}return toUnicodeExtraMap+"\0"+string16(numGlyphs.length+4)+numGlyphs+trailingRangesCount+format31012}function validateOS2Table(os2,file){file.pos=(file.start||0)+os2.offset;var version=file.getUint16(),selection=(file.skip(60),file.getUint16());return!(version<4&&768&selection||(version=file.getUint16(),file.getUint16()<version)||(file.skip(6),0===file.getUint16())||(os2.data[8]=os2.data[9]=0))}function createOS2Table(properties,charstrings,override){override=override||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var ulUnicodeRange1=0,ulUnicodeRange2=0,ulUnicodeRange3=0,ulUnicodeRange4=0,firstCharIndex=null,lastCharIndex=0,position=-1;if(charstrings){for(var code in charstrings)if(((code|=0)<firstCharIndex||!firstCharIndex)&&(firstCharIndex=code),lastCharIndex<code&&(lastCharIndex=code),(position=getUnicodeRangeFor(code,position))<32)ulUnicodeRange1|=1<<position;else if(position<64)ulUnicodeRange2|=1<<position-32;else if(position<96)ulUnicodeRange3|=1<<position-64;else{if(!(position<123))throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage");ulUnicodeRange4|=1<<position-96}65535<lastCharIndex&&(lastCharIndex=65535)}else firstCharIndex=0,lastCharIndex=255;var charstrings=properties.bbox||[0,0,0,0],unitsPerEm=override.unitsPerEm||(properties.fontMatrix?1/Math.max(...properties.fontMatrix.slice(0,4).map(Math.abs)):1e3),unitsPerEm=properties.ascentScaled?1:unitsPerEm/PDF_GLYPH_SPACE_UNITS,typoAscent=override.ascent||Math.round(unitsPerEm*(properties.ascent||charstrings[3])),unitsPerEm=override.descent||Math.round(unitsPerEm*(properties.descent||charstrings[1])),charstrings=(0<unitsPerEm&&0<properties.descent&&charstrings[1]<0&&(unitsPerEm=-unitsPerEm),override.yMax||typoAscent),override=-override.yMin||-unitsPerEm;return"\0$ô\0\0\0»\0\0\0»\0\0ß\x001\0\0\0\0"+String.fromCharCode(properties.fixedPitch?9:0)+"\0\0\0\0\0\0"+string32(ulUnicodeRange1)+string32(ulUnicodeRange2)+string32(ulUnicodeRange3)+string32(ulUnicodeRange4)+"*21*"+string16(properties.italicAngle?1:0)+string16(firstCharIndex||properties.firstChar)+string16(lastCharIndex||properties.lastChar)+string16(typoAscent)+string16(unitsPerEm)+"\0d"+string16(charstrings)+string16(override)+"\0\0\0\0\0\0\0\0"+string16(properties.xHeight)+string16(properties.capHeight)+string16(0)+string16(firstCharIndex||properties.firstChar)+"\0"}function createPostTable(properties){return"\0\0\0"+string32(Math.floor(65536*properties.italicAngle))+"\0\0\0\0"+string32(properties.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(name){return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(name,proto){for(var strings=[(proto=proto||[[],[]])[0][0]||"Original licence",proto[0][1]||name,proto[0][2]||"Unknown",proto[0][3]||"uniqueID",proto[0][4]||name,proto[0][5]||"Version 0.11",proto[0][6]||createPostscriptName(name),proto[0][7]||"Unknown",proto[0][8]||"Unknown",proto[0][9]||"Unknown"],stringsUnicode=[],i=0,ii=strings.length;i<ii;i++){for(var str,strBufUnicode=[],j=0,jj=(str=proto[1][i]||strings[i]).length;j<jj;j++)strBufUnicode.push(string16(str.charCodeAt(j)));stringsUnicode.push(strBufUnicode.join(""))}var names=[strings,stringsUnicode],platforms=["\0","\0"],encodings=["\0\0","\0"],languages=["\0\0","\t"],name=strings.length*platforms.length,nameTable="\0\0"+string16(name)+string16(12*name+6),strOffset=0;for(i=0,ii=platforms.length;i<ii;i++){var strs=names[i];for(j=0,jj=strs.length;j<jj;j++)str=strs[j],nameTable+=platforms[i]+encodings[i]+languages[i]+string16(j)+string16(str.length)+string16(strOffset),strOffset+=str.length}return nameTable+=strings.join("")+stringsUnicode.join("")}class Font{constructor(name,file,properties,evaluatorOptions){this.name=name,this.psName=null,this.mimetype=null,this.disableFontFace=evaluatorOptions.disableFontFace,this.fontExtraProperties=evaluatorOptions.fontExtraProperties,this.loadedName=properties.loadedName,this.isType3Font=properties.isType3Font,this.missingFile=!1,this.cssFontInfo=properties.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);var isSerifFont=!!(properties.flags&FontFlags.Serif);if(!isSerifFont&&!properties.isSimulatedFlags){var namePart,evaluatorOptions=name.replaceAll(/[,_]/g,"-").split("-",1)[0],serifFonts=getSerifFonts();for(namePart of evaluatorOptions.split("+"))if(serifFonts[namePart]){isSerifFont=!0;break}}this.isSerifFont=isSerifFont,this.isSymbolicFont=!!(properties.flags&FontFlags.Symbolic),this.isMonospace=!!(properties.flags&FontFlags.FixedPitch);var data,{type,subtype}=properties,evaluatorOptions=(this.type=type,this.subtype=subtype,this.systemFontInfo=properties.systemFontInfo,name.match(/^InvalidPDFjsFont_(.*)_\d+$/));if(this.isInvalidPDFjsFont=!!evaluatorOptions,this.isInvalidPDFjsFont?this.fallbackName=evaluatorOptions[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",null!=(evaluatorOptions=this.systemFontInfo)&&evaluatorOptions.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=",".concat(this.fallbackName)),this.differences=properties.differences,this.widths=properties.widths,this.defaultWidth=properties.defaultWidth,this.composite=properties.composite,this.cMap=properties.cMap,this.capHeight=properties.capHeight/PDF_GLYPH_SPACE_UNITS,this.ascent=properties.ascent/PDF_GLYPH_SPACE_UNITS,this.descent=properties.descent/PDF_GLYPH_SPACE_UNITS,this.lineHeight=this.ascent-this.descent,this.fontMatrix=properties.fontMatrix,this.bbox=properties.bbox,this.defaultEncoding=properties.defaultEncoding,this.toUnicode=properties.toUnicode,this.toFontChar=[],"Type3"===properties.type)for(var charCode=0;charCode<256;charCode++)this.toFontChar[charCode]=this.differences[charCode]||properties.defaultEncoding[charCode];else if(this.cidEncoding=properties.cidEncoding||"",this.vertical=!!properties.vertical,this.vertical&&(this.vmetrics=properties.vmetrics,this.defaultVMetrics=properties.defaultVMetrics),!file||file.isEmpty)file&&warn('Font file is empty in "'+name+'" ('+this.loadedName+")"),this.fallbackToSystemFont(properties);else{[type,subtype]=getFontFileType(file,properties),type===this.type&&subtype===this.subtype||info("Inconsistent font file Type/SubType, expected: "+"".concat(this.type,"/").concat(this.subtype," but found: ").concat(type,"/").concat(subtype,"."));try{switch(type){case"MMType1":info("MMType1 font ("+name+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var cff="Type1C"===subtype||"CIDFontType0C"===subtype?new CFFFont(file,properties):new Type1Font(name,file,properties);adjustWidths(properties),data=this.convert(name,cff,properties);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",data=this.checkAndRepair(name,file,properties),adjustWidths(properties),this.isOpenType&&(type="OpenType");break;default:throw new FormatError("Font ".concat(type," is not supported"))}}catch(e){return warn(e),void this.fallbackToSystemFont(properties)}amendFallbackToUnicode(properties),this.data=data,this.type=type,this.subtype=subtype,this.fontMatrix=properties.fontMatrix,this.widths=properties.widths,this.defaultWidth=properties.defaultWidth,this.toUnicode=properties.toUnicode,this.seacMap=properties.seacMap}}get renderer(){return shadow(this,"renderer",FontRendererFactory.create(this,SEAC_ANALYSIS_ENABLED))}exportData(){var prop,exportDataProps=this.fontExtraProperties?[...EXPORT_DATA_PROPERTIES,...EXPORT_DATA_EXTRA_PROPERTIES]:EXPORT_DATA_PROPERTIES,data=Object.create(null);for(prop of exportDataProps){var value=this[prop];void 0!==value&&(data[prop]=value)}return data}fallbackToSystemFont(properties){this.missingFile=!0;var _map,glyphsUnicodeMap,_map2,{name,type}=this,fontName=normalizeFontName(name),stdFontMap=getStdFontMap(),nonStdFontMap=getNonStdFontMap(),isStandardFont=!!stdFontMap[fontName],isMappedToStandardFont=!(!nonStdFontMap[fontName]||!stdFontMap[nonStdFontMap[fontName]]),fontName=stdFontMap[fontName]||nonStdFontMap[fontName]||fontName,stdFontMap=getFontBasicMetrics()[fontName],nonStdFontMap=(stdFontMap&&(isNaN(this.ascent)&&(this.ascent=stdFontMap.ascent/PDF_GLYPH_SPACE_UNITS),isNaN(this.descent)&&(this.descent=stdFontMap.descent/PDF_GLYPH_SPACE_UNITS),isNaN(this.capHeight))&&(this.capHeight=stdFontMap.capHeight/PDF_GLYPH_SPACE_UNITS),this.bold=/bold/gi.test(fontName),this.italic=/oblique|italic/gi.test(fontName),this.black=/Black/g.test(name),/Narrow/g.test(name));if(this.remeasure=(!isStandardFont||nonStdFontMap)&&0<Object.keys(this.widths).length,(isStandardFont||isMappedToStandardFont)&&"CIDFontType2"===type&&this.cidEncoding.startsWith("Identity-")){var cidToGidMap=properties.cidToGidMap,map=[];if(applyStandardFontGlyphMap(map,getGlyphMapForStandardFonts()),/Arial-?Black/i.test(name)?applyStandardFontGlyphMap(map,getSupplementalGlyphMapForArialBlack()):/Calibri/i.test(name)&&applyStandardFontGlyphMap(map,getSupplementalGlyphMapForCalibri()),cidToGidMap){for(var charCode in map){var cid=map[charCode];void 0!==cidToGidMap[cid]&&(map[+charCode]=cidToGidMap[cid])}cidToGidMap.length!==this.toUnicode.length&&properties.hasIncludedToUnicodeMap&&this.toUnicode instanceof IdentityToUnicodeMap&&this.toUnicode.forEach(function(charCode,unicodeCharCode){var cid=map[charCode];void 0===cidToGidMap[cid]&&(map[+charCode]=unicodeCharCode)})}this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach(function(charCode,unicodeCharCode){map[+charCode]=unicodeCharCode}),this.toFontChar=map,this.toUnicode=new ToUnicodeMap(map)}else/Symbol/i.test(fontName)?this.toFontChar=buildToFontChar(SymbolSetEncoding,getGlyphsUnicode(),this.differences):/Dingbats/i.test(fontName)?this.toFontChar=buildToFontChar(ZapfDingbatsEncoding,getDingbatsGlyphsUnicode(),this.differences):isStandardFont||isMappedToStandardFont?(_map=buildToFontChar(this.defaultEncoding,getGlyphsUnicode(),this.differences),"CIDFontType2"!==type||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach(function(charCode,unicodeCharCode){_map[+charCode]=unicodeCharCode}),this.toFontChar=_map):(glyphsUnicodeMap=getGlyphsUnicode(),_map2=[],this.toUnicode.forEach((charCode,unicodeCharCode)=>{var unicode;this.composite||-1!==(unicode=getUnicodeForGlyph(this.differences[charCode]||this.defaultEncoding[charCode],glyphsUnicodeMap))&&(unicodeCharCode=unicode),_map2[+charCode]=unicodeCharCode}),this.composite&&this.toUnicode instanceof IdentityToUnicodeMap&&/Tahoma|Verdana/i.test(name)&&applyStandardFontGlyphMap(_map2,getGlyphMapForStandardFonts()),this.toFontChar=_map2);amendFallbackToUnicode(properties),this.loadedName=fontName.split("-",1)[0]}checkAndRepair(name,font,properties){var VALID_TABLES=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(file,numTables){var tables=Object.create(null);tables["OS/2"]=null,tables.cmap=null,tables.head=null,tables.hhea=null,tables.hmtx=null,tables.maxp=null,tables.name=null,tables.post=null;for(var i=0;i<numTables;i++){var table=function(file){var tag=file.getString(4),checksum=file.getInt32()>>>0,offset=file.getInt32()>>>0,length=file.getInt32()>>>0,previousPosition=file.pos,data=(file.pos=file.start||0,file.skip(offset),file.getBytes(length));file.pos=previousPosition,"head"===tag&&(data[8]=data[9]=data[10]=data[11]=0,data[17]|=32);return{tag:tag,checksum:checksum,length:length,offset:offset,data:data}}(file);VALID_TABLES.includes(table.tag)&&0!==table.length&&(tables[table.tag]=table)}return tables}function readOpenTypeHeader(ttf){return{version:ttf.getString(4),numTables:ttf.getUint16(),searchRange:ttf.getUint16(),entrySelector:ttf.getUint16(),rangeShift:ttf.getUint16()}}function readTrueTypeCollectionData(ttc,fontName){for(var fallbackData,{numFonts,offsetTable}=function(ttc){for(var ttcTag=ttc.getString(4),majorVersion=(assert("ttcf"===ttcTag,"Must be a TrueType Collection font."),ttc.getUint16()),minorVersion=ttc.getUint16(),numFonts=ttc.getInt32()>>>0,offsetTable=[],i=0;i<numFonts;i++)offsetTable.push(ttc.getInt32()>>>0);var header={ttcTag:ttcTag,majorVersion:majorVersion,minorVersion:minorVersion,numFonts:numFonts,offsetTable:offsetTable};switch(majorVersion){case 1:return header;case 2:return header.dsigTag=ttc.getInt32()>>>0,header.dsigLength=ttc.getInt32()>>>0,header.dsigOffset=ttc.getInt32()>>>0,header}throw new FormatError("Invalid TrueType Collection majorVersion: ".concat(majorVersion,"."))}(ttc),fontNameParts=fontName.split("+"),i=0;i<numFonts;i++){ttc.pos=(ttc.start||0)+offsetTable[i];var potentialHeader=readOpenTypeHeader(ttc),potentialTables=readTables(ttc,potentialHeader.numTables);if(!potentialTables.name)throw new FormatError('TrueType Collection font must contain a "name" table.');for(var[nameTable]=readNameTable(potentialTables.name),j=0,jj=nameTable.length;j<jj;j++)for(var k=0,kk=nameTable[j].length;k<kk;k++){var _nameTable$j$k,nameEntry=null==(_nameTable$j$k=nameTable[j][k])?void 0:_nameTable$j$k.replaceAll(/\s/g,"");if(nameEntry){if(nameEntry===fontName)return{header:potentialHeader,tables:potentialTables};if(!(fontNameParts.length<2))for(var part of fontNameParts)nameEntry===part&&(fallbackData={name:part,header:potentialHeader,tables:potentialTables})}}}if(fallbackData)return warn('TrueType Collection does not contain "'.concat(fontName,'" font, ')+'falling back to "'.concat(fallbackData.name,'" font instead.')),{header:fallbackData.header,tables:fallbackData.tables};throw new FormatError('TrueType Collection does not contain "'.concat(fontName,'" font.'))}function sanitizeGlyphLocations(loca,glyf,numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry,maxSizeOfInstructions){var itemSize,itemDecode,itemEncode=isGlyphLocationsLong?(itemSize=4,itemDecode=function(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]},function(data,offset,value){data[offset]=value>>>24&255,data[offset+1]=value>>16&255,data[offset+2]=value>>8&255,data[offset+3]=255&value}):(itemSize=2,itemDecode=function(data,offset){return data[offset]<<9|data[offset+1]<<1},function(data,offset,value){data[offset]=value>>9&255,data[offset+1]=value>>1&255}),numGlyphsOut=dupFirstEntry?numGlyphs+1:numGlyphs,isGlyphLocationsLong=itemSize*(1+numGlyphsOut),locaData=new Uint8Array(isGlyphLocationsLong),oldGlyfData=(locaData.set(loca.data.subarray(0,isGlyphLocationsLong)),loca.data=locaData,glyf.data),oldGlyfDataLength=oldGlyfData.length,newGlyfData=new Uint8Array(oldGlyfDataLength),locaEntries=[];for(j=i=0;i<numGlyphs+1;i++,j+=itemSize){var offset=itemDecode(locaData,j);locaEntries.push({index:i,offset:offset=oldGlyfDataLength<offset?oldGlyfDataLength:offset,endOffset:0})}for(locaEntries.sort((a,b)=>a.offset-b.offset),i=0;i<numGlyphs;i++)locaEntries[i].endOffset=locaEntries[i+1].offset;for(locaEntries.sort((a,b)=>a.index-b.index),i=0;i<numGlyphs;i++){var{offset:_offset,endOffset}=locaEntries[i];if(0!==_offset||0!==endOffset)break;_offset=locaEntries[i+1].offset;if(0!==_offset){locaEntries[i].endOffset=_offset;break}}var isGlyphLocationsLong=locaEntries.at(-2),missingGlyphs=(0!==isGlyphLocationsLong.offset&&0===isGlyphLocationsLong.endOffset&&(isGlyphLocationsLong.endOffset=oldGlyfDataLength),Object.create(null)),writeOffset=0;for(itemEncode(locaData,0,writeOffset),i=0,j=itemSize;i<numGlyphs;i++,j+=itemSize){var glyphProfile=function(source,sourceStart,sourceEnd,dest,destStart,hintsValid){var glyphProfile={length:0,sizeOfInstructions:0};if(!(sourceStart<0||sourceStart>=source.length||sourceEnd>source.length||sourceEnd-sourceStart<=12)){var glyf=source.subarray(sourceStart,sourceEnd),source=signedInt16(glyf[2],glyf[3]),sourceStart=signedInt16(glyf[4],glyf[5]),sourceEnd=signedInt16(glyf[6],glyf[7]),yMax=signedInt16(glyf[8],glyf[9]),contoursCount=(sourceEnd<source&&(writeSignedInt16(glyf,2,sourceEnd),writeSignedInt16(glyf,6,source)),yMax<sourceStart&&(writeSignedInt16(glyf,4,yMax),writeSignedInt16(glyf,8,sourceStart)),signedInt16(glyf[0],glyf[1]));if(contoursCount<0)contoursCount<-1||(dest.set(glyf,destStart),glyphProfile.length=glyf.length);else{for(var j=10,flagsCount=0,i=0;i<contoursCount;i++){flagsCount=1+(glyf[j]<<8|glyf[j+1]);j+=2}var sourceEnd=j,source=glyf[j]<<8|glyf[j+1],yMax=j+=2+(glyphProfile.sizeOfInstructions=source),coordinatesLength=0;for(i=0;i<flagsCount;i++){var flag=glyf[j++],xLength=(192&flag&&(glyf[j-1]=63&flag),2),yLength=(2&flag?xLength=1:16&flag&&(xLength=0),2),xLength=(4&flag?yLength=1:32&flag&&(yLength=0),xLength+yLength);coordinatesLength+=xLength,8&flag&&(0===(yLength=glyf[j++])&&(glyf[j-1]^=8),i+=yLength,coordinatesLength+=yLength*xLength)}0===coordinatesLength||(sourceStart=j+coordinatesLength)>glyf.length||(!hintsValid&&0<source?(dest.set(glyf.subarray(0,sourceEnd),destStart),dest.set([0,0],destStart+sourceEnd),dest.set(glyf.subarray(yMax,sourceStart),destStart+sourceEnd+2),3<glyf.length-(sourceStart-=source)&&(sourceStart=sourceStart+3&-4),glyphProfile.length=sourceStart):3<glyf.length-sourceStart?(dest.set(glyf.subarray(0,sourceStart=sourceStart+3&-4),destStart),glyphProfile.length=sourceStart):(dest.set(glyf,destStart),glyphProfile.length=glyf.length))}}return glyphProfile}(oldGlyfData,locaEntries[i].offset,locaEntries[i].endOffset,newGlyfData,writeOffset,hintsValid),newLength=glyphProfile.length;0===newLength&&(missingGlyphs[i]=!0),glyphProfile.sizeOfInstructions>maxSizeOfInstructions&&(maxSizeOfInstructions=glyphProfile.sizeOfInstructions),itemEncode(locaData,j,writeOffset+=newLength)}if(0===writeOffset){for(var simpleGlyph=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]),i=0,j=itemSize;i<numGlyphsOut;i++,j+=itemSize)itemEncode(locaData,j,simpleGlyph.length);glyf.data=simpleGlyph}else dupFirstEntry?(isGlyphLocationsLong=itemDecode(locaData,itemSize),newGlyfData.length>isGlyphLocationsLong+writeOffset?glyf.data=newGlyfData.subarray(0,isGlyphLocationsLong+writeOffset):(glyf.data=new Uint8Array(isGlyphLocationsLong+writeOffset),glyf.data.set(newGlyfData.subarray(0,writeOffset))),glyf.data.set(newGlyfData.subarray(0,isGlyphLocationsLong),writeOffset),itemEncode(loca.data,locaData.length-itemSize,writeOffset+isGlyphLocationsLong)):glyf.data=newGlyfData.subarray(0,writeOffset);return{missingGlyphs:missingGlyphs,maxSizeOfInstructions:maxSizeOfInstructions}}function readNameTable(nameTable){var start=(font.start||0)+nameTable.offset,names=(font.pos=start,[[],[]]),records=[],nameTable=nameTable.length,end=start+nameTable,format=font.getUint16();if(!(0!==format||nameTable<6)){for(var ii,numRecords=font.getUint16(),stringsStart=font.getUint16(),i=0;i<numRecords&&font.pos+12<=end;i++){var r={platform:font.getUint16(),encoding:font.getUint16(),language:font.getUint16(),name:font.getUint16(),length:font.getUint16(),offset:font.getUint16()};(isMacNameRecord(r)||isWinNameRecord(r))&&records.push(r)}for(i=0,ii=records.length;i<ii;i++){var record=records[i];if(!(record.length<=0)){var pos=start+stringsStart+record.offset;if(!(pos+record.length>end)){font.pos=pos;pos=record.name;if(record.encoding){for(var str="",j=0,jj=record.length;j<jj;j+=2)str+=String.fromCharCode(font.getUint16());names[1][pos]=str}else names[0][pos]=font.getString(record.length)}}}}return[names,records]}var header,tables,TTOpsStackDeltas=[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(table,ttContext){for(var j,n,b,funcId,pc,data=table.data,i=0,lastEndf=0,lastDeff=0,stack=[],callstack=[],functionsCalled=[],tooComplexToFollowFunctions=ttContext.tooComplexToFollowFunctions,inFDEF=!1,ifLevel=0,inELSE=0,ii=data.length;i<ii;){var op=data[i++];if(64===op)if(n=data[i++],inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(65===op)if(n=data[i++],inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(b<<8|data[i++]);else if(176==(248&op))if(n=op-176+1,inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(184==(248&op))if(n=op-184+1,inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(signedInt16(b,data[i++]));else if(43!==op||tooComplexToFollowFunctions)if(44!==op||tooComplexToFollowFunctions)if(45===op)if(inFDEF)inFDEF=!1,lastEndf=i;else{if(!(pc=callstack.pop()))return warn("TT: ENDF bad stack"),void(ttContext.hintsValid=!1);funcId=functionsCalled.pop(),data=pc.data,i=pc.i,ttContext.functionsStackDeltas[funcId]=stack.length-pc.stackTop}else 137===op?((inFDEF||inELSE)&&(warn("TT: nested IDEFs not allowed"),tooComplexToFollowFunctions=!0),inFDEF=!0,lastDeff=i):88===op?++ifLevel:27===op?inELSE=ifLevel:89===op?(inELSE===ifLevel&&(inELSE=0),--ifLevel):28!==op||inFDEF||inELSE||0<(offset=stack.at(-1))&&(i+=offset-1);else(inFDEF||inELSE)&&(warn("TT: nested FDEFs not allowed"),tooComplexToFollowFunctions=!0),inFDEF=!0,lastDeff=i,funcId=stack.pop(),ttContext.functionsDefined[funcId]={data:data,i:i};else if(!inFDEF&&!inELSE)if(funcId=stack.at(-1),isNaN(funcId))info("TT: CALL empty stack (or invalid entry).");else if(ttContext.functionsUsed[funcId]=!0,funcId in ttContext.functionsStackDeltas){var offset=stack.length+ttContext.functionsStackDeltas[funcId];if(offset<0)return warn("TT: CALL invalid functions stack delta."),void(ttContext.hintsValid=!1);stack.length=offset}else if(funcId in ttContext.functionsDefined&&!functionsCalled.includes(funcId)){if(callstack.push({data:data,i:i,stackTop:stack.length-1}),functionsCalled.push(funcId),!(pc=ttContext.functionsDefined[funcId]))return warn("TT: CALL non-existent function"),void(ttContext.hintsValid=!1);data=pc.data,i=pc.i}if(!inFDEF&&!inELSE){var stackDelta=0;for(op<=142?stackDelta=TTOpsStackDeltas[op]:192<=op&&op<=223?stackDelta=-1:224<=op&&(stackDelta=-2),113<=op&&op<=117&&(n=stack.pop(),isNaN(n)||(stackDelta=2*-n));stackDelta<0&&0<stack.length;)stack.pop(),stackDelta++;for(;0<stackDelta;)stack.push(NaN),stackDelta--}}ttContext.tooComplexToFollowFunctions=tooComplexToFollowFunctions;var content=[data];i>data.length&&content.push(new Uint8Array(i-data.length)),lastEndf<lastDeff&&(warn("TT: complementing a missing function tail"),content.push(new Uint8Array([34,45]))),function(table,content){if(1<content.length){var j,jj,newLength=0;for(j=0,jj=content.length;j<jj;j++)newLength+=content[j].length;newLength=newLength+3&-4;var result=new Uint8Array(newLength),pos=0;for(j=0,jj=content.length;j<jj;j++)result.set(content[j],pos),pos+=content[j].length;table.data=result,table.length=newLength}}(table,content)}var ttcData=!(tables=isTrueTypeCollectionFile(font=new Stream(new Uint8Array(font.getBytes())))?(header=(ttcData=readTrueTypeCollectionData(font,this.name)).header,ttcData.tables):(header=readOpenTypeHeader(font),readTables(font,header.numTables)))["CFF "];if(ttcData){if(!tables.loca)throw new FormatError('Required "loca" table is not found');tables.glyf||(warn('Required "glyf" table is not found -- trying to recover.'),tables.glyf={tag:"glyf",data:new Uint8Array(0)}),this.isOpenType=!1}else{var _properties$cidToGidM=properties.composite&&(0<(null==(_properties$cidToGidM=properties.cidToGidMap)?void 0:_properties$cidToGidM.length)||!(properties.cMap instanceof IdentityCMap));if("OTTO"===header.version&&!_properties$cidToGidM||!tables.head||!tables.hhea||!tables.maxp||!tables.post)return cffFile=new Stream(tables["CFF "].data),cff=new CFFFont(cffFile,properties),this.convert(name,cff,properties);delete tables.glyf,delete tables.loca,delete tables.fpgm,delete tables.prep,delete tables["cvt "],this.isOpenType=!0}if(!tables.maxp)throw new FormatError('Required "maxp" table is not found');font.pos=(font.start||0)+tables.maxp.offset;var _properties$cidToGidM=font.getInt32(),numGlyphs=font.getUint16();if(65536!==_properties$cidToGidM&&20480!==_properties$cidToGidM){if(6===tables.maxp.length)_properties$cidToGidM=20480;else{if(!(32<=tables.maxp.length))throw new FormatError('"maxp" table has a wrong version number');_properties$cidToGidM=65536}writeUint32(tables.maxp.data,0,_properties$cidToGidM)}if((null==(_properties$scaleFact=properties.scaleFactors)?void 0:_properties$scaleFact.length)===numGlyphs&&ttcData)for(var scaleFactors=properties["scaleFactors"],_properties$scaleFact=int16(tables.head.data[50],tables.head.data[51]),glyphs=new GlyfTable({glyfTable:tables.glyf.data,isGlyphLocationsLong:_properties$scaleFact,locaTable:tables.loca.data,numGlyphs:numGlyphs}),{glyf:glyphs,loca,isLocationLong}=(glyphs.scale(scaleFactors),glyphs.write()),metrics=(tables.glyf.data=glyphs,tables.loca.data=loca,isLocationLong!==!!_properties$scaleFact&&(tables.head.data[50]=0,tables.head.data[51]=isLocationLong?1:0),tables.hmtx.data),i=0;i<numGlyphs;i++){var j=4*i,advanceWidth=Math.round(scaleFactors[i]*int16(metrics[j],metrics[1+j])),advanceWidth=(metrics[j]=advanceWidth>>8&255,metrics[1+j]=255&advanceWidth,Math.round(scaleFactors[i]*signedInt16(metrics[2+j],metrics[3+j])));writeSignedInt16(metrics,2+j,advanceWidth)}var glyphs=numGlyphs+1,loca=!0,_properties$scaleFact=(65535<glyphs&&(loca=!1,glyphs=numGlyphs,warn("Not enough space in glyfs to duplicate first glyph.")),0),isLocationLong=0,_properties$scaleFact=(65536<=_properties$cidToGidM&&32<=tables.maxp.length&&(font.pos+=8,2<font.getUint16()&&(tables.maxp.data[14]=0,tables.maxp.data[15]=2),font.pos+=4,_properties$scaleFact=font.getUint16(),font.pos+=4,isLocationLong=font.getUint16()),tables.maxp.data[4]=glyphs>>8,tables.maxp.data[5]=255&glyphs,function(fpgm,prep,cvt,maxFunctionDefs){var ttContext={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};return fpgm&&sanitizeTTProgram(fpgm,ttContext),prep&&sanitizeTTProgram(prep,ttContext),fpgm&&function(ttContext,maxFunctionDefs){if(!ttContext.tooComplexToFollowFunctions)if(ttContext.functionsDefined.length>maxFunctionDefs)warn("TT: more functions defined than expected"),ttContext.hintsValid=!1;else for(var j=0,jj=ttContext.functionsUsed.length;j<jj;j++){if(maxFunctionDefs<j)return warn("TT: invalid function id: "+j),ttContext.hintsValid=!1;if(ttContext.functionsUsed[j]&&!ttContext.functionsDefined[j])return warn("TT: undefined function: "+j),ttContext.hintsValid=!1}}(ttContext,maxFunctionDefs),cvt&&1&cvt.length&&((prep=new Uint8Array(cvt.length+1)).set(cvt.data),cvt.data=prep),ttContext.hintsValid}(tables.fpgm,tables.prep,tables["cvt "],_properties$scaleFact));if(_properties$scaleFact||(delete tables.fpgm,delete tables.prep,delete tables["cvt "]),!function(file,header,metrics,headTable,numGlyphs,dupFirstEntry){var caretOffset;header?(file.pos=(file.start||0)+header.offset,file.pos+=4,file.pos+=2,file.pos+=2,file.pos+=2,file.pos+=2,file.pos+=2,file.pos+=2,file.pos+=2,file.pos+=2,file.pos+=2,caretOffset=file.getUint16(),file.pos+=8,file.pos+=2,file=file.getUint16(),0===caretOffset||2&int16(headTable.data[44],headTable.data[45])||(header.data[22]=0,header.data[23]=0),numGlyphs<file&&(info("The numOfMetrics (".concat(file,") should not be ")+"greater than the numGlyphs (".concat(numGlyphs,").")),header.data[34]=(65280&(file=numGlyphs))>>8,header.data[35]=255&file),0<(caretOffset=numGlyphs-file-(metrics.length-4*file>>1))&&((headTable=new Uint8Array(metrics.length+2*caretOffset)).set(metrics.data),dupFirstEntry&&(headTable[metrics.length]=metrics.data[2],headTable[metrics.length+1]=metrics.data[3]),metrics.data=headTable)):metrics&&(metrics.data=null)}(font,tables.hhea,tables.hmtx,tables.head,glyphs,loca),!tables.head)throw new FormatError('Required "head" table is not found');!function(head,numGlyphs,locaLength){var version=int32((head=head.data)[0],head[1],head[2],head[3]);if(version>>16!=1&&(info("Attempting to fix invalid version in head table: "+version),head[0]=0,head[1]=1,head[2]=0,head[3]=0),(version=int16(head[50],head[51]))<0||1<version){info("Attempting to fix invalid indexToLocFormat in head table: "+version);numGlyphs=numGlyphs+1;if(locaLength===numGlyphs<<1)head[50]=0,head[51]=0;else{if(locaLength!==numGlyphs<<2)throw new FormatError("Could not fix indexToLocFormat: "+version);head[50]=0,head[51]=1}}}(tables.head,numGlyphs,ttcData?tables.loca.length:0);var missingGlyphs=Object.create(null);if(ttcData&&(_isGlyphLocationsLong=int16(tables.head.data[50],tables.head.data[51]),_isGlyphLocationsLong=sanitizeGlyphLocations(tables.loca,tables.glyf,numGlyphs,_isGlyphLocationsLong,_properties$scaleFact,loca,isLocationLong),missingGlyphs=_isGlyphLocationsLong.missingGlyphs,65536<=_properties$cidToGidM)&&32<=tables.maxp.length&&(tables.maxp.data[26]=_isGlyphLocationsLong.maxSizeOfInstructions>>8,tables.maxp.data[27]=255&_isGlyphLocationsLong.maxSizeOfInstructions),!tables.hhea)throw new FormatError('Required "hhea" table is not found');0===tables.hhea.data[10]&&0===tables.hhea.data[11]&&(tables.hhea.data[10]=255,tables.hhea.data[11]=255);var _properties$scaleFact={unitsPerEm:int16(tables.head.data[18],tables.head.data[19]),yMax:signedInt16(tables.head.data[42],tables.head.data[43]),yMin:signedInt16(tables.head.data[38],tables.head.data[39]),ascent:signedInt16(tables.hhea.data[4],tables.hhea.data[5]),descent:signedInt16(tables.hhea.data[6],tables.hhea.data[7]),lineGap:signedInt16(tables.hhea.data[8],tables.hhea.data[9])},charCodeToGlyphId=(this.ascent=_properties$scaleFact.ascent/_properties$scaleFact.unitsPerEm,this.descent=_properties$scaleFact.descent/_properties$scaleFact.unitsPerEm,this.lineGap=_properties$scaleFact.lineGap/_properties$scaleFact.unitsPerEm,null!=(isLocationLong=this.cssFontInfo)&&isLocationLong.lineHeight?(this.lineHeight=this.cssFontInfo.metrics.lineHeight,this.lineGap=this.cssFontInfo.metrics.lineGap):this.lineHeight=this.ascent-this.descent+this.lineGap,tables.post&&!function(post,propertiesObj,maxpNumGlyphs){var glyphNames,start=(font.start||0)+post.offset,end=(font.pos=start)+post.length,version=font.getInt32(),valid=(font.skip(28),!0);switch(version){case 65536:glyphNames=MacStandardGlyphOrdering;break;case 131072:var _numGlyphs=font.getUint16();if(_numGlyphs!==maxpNumGlyphs)valid=!1;else{for(var glyphNameIndexes=[],i=0;i<_numGlyphs;++i){var index=font.getUint16();if(32768<=index){valid=!1;break}glyphNameIndexes.push(index)}if(valid){for(var customNames=[],strBuf=[];font.pos<end;){var stringLength=font.getByte();for(strBuf.length=stringLength,i=0;i<stringLength;++i)strBuf[i]=String.fromCharCode(font.getByte());customNames.push(strBuf.join(""))}for(glyphNames=[],i=0;i<_numGlyphs;++i){var j=glyphNameIndexes[i];j<258?glyphNames.push(MacStandardGlyphOrdering[j]):glyphNames.push(customNames[j-258])}}}break;case 196608:break;default:warn("Unknown/unsupported post table version "+version),valid=!1,propertiesObj.defaultEncoding&&(glyphNames=propertiesObj.defaultEncoding)}propertiesObj.glyphNames=glyphNames}(tables.post,properties,numGlyphs),tables.post={tag:"post",data:createPostTable(properties)},Object.create(null));function hasGlyph(glyphId){return!missingGlyphs[glyphId]}if(properties.composite){var cidToGidMap=properties.cidToGidMap||[],isCidToGidMapEmpty=0===cidToGidMap.length;properties.cMap.forEach(function(charCode,cid){if(65535<(cid="string"==typeof cid?convertCidString(charCode,cid,!0):cid))throw new FormatError("Max size of CID is 65,535");var glyphId=-1;isCidToGidMapEmpty?glyphId=cid:void 0!==cidToGidMap[cid]&&(glyphId=cidToGidMap[cid]),0<=glyphId&&glyphId<numGlyphs&&hasGlyph(glyphId)&&(charCodeToGlyphId[charCode]=glyphId)})}else{var _properties$cidToGidM=function(cmap,file,isSymbolicFont,hasEncoding){if(!cmap)return warn("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};for(var potentialTable,start=(file.start||0)+cmap.offset,numTables=(file.pos=start,file.skip(2),file.getUint16()),canBreak=!1,i=0;i<numTables;i++){var correctlySorted,nextBytes,platformId=file.getUint16(),encodingId=file.getUint16(),offset=file.getInt32()>>>0,useTable=!1;if((null==potentialTable?void 0:potentialTable.platformId)!==platformId||(null==potentialTable?void 0:potentialTable.encodingId)!==encodingId)if(0===platformId&&(0===encodingId||1===encodingId||3===encodingId)||1===platformId&&0===encodingId?useTable=!0:3!==platformId||1!==encodingId||!hasEncoding&&potentialTable?isSymbolicFont&&3===platformId&&0===encodingId&&(correctlySorted=useTable=!0,correctlySorted=!(i<numTables-1&&int16((nextBytes=file.peekBytes(2))[0],nextBytes[1])<platformId)&&correctlySorted)&&(canBreak=!0):(useTable=!0,isSymbolicFont||(canBreak=!0)),useTable&&(potentialTable={platformId:platformId,encodingId:encodingId,offset:offset}),canBreak)break}if(potentialTable&&(file.pos=start+potentialTable.offset),!potentialTable||-1===file.peekByte())return warn("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var cmap=file.getUint16(),hasShortCmap=!1,mappings=[];if(0===cmap){for(file.skip(4),j=0;j<256;j++){var index=file.getByte();index&&mappings.push({charCode:j,glyphId:index})}hasShortCmap=!0}else if(2===cmap){file.skip(4);for(var subHeaderKeys=[],maxSubHeaderKey=0,_i28=0;_i28<256;_i28++){var subHeaderKey=file.getUint16()>>3;subHeaderKeys.push(subHeaderKey),maxSubHeaderKey=Math.max(subHeaderKey,maxSubHeaderKey)}for(var subHeaders=[],_i29=0;_i29<=maxSubHeaderKey;_i29++)subHeaders.push({firstCode:file.getUint16(),entryCount:file.getUint16(),idDelta:signedInt16(file.getByte(),file.getByte()),idRangePos:file.pos+file.getUint16()});for(var _i30=0;_i30<256;_i30++)if(0===subHeaderKeys[_i30])file.pos=subHeaders[0].idRangePos+2*_i30,glyphId=file.getUint16(),mappings.push({charCode:_i30,glyphId:glyphId});else for(var s=subHeaders[subHeaderKeys[_i30]],j=0;j<s.entryCount;j++){var charCode=(_i30<<8)+j+s.firstCode;file.pos=s.idRangePos+2*j,0!==(glyphId=file.getUint16())&&(glyphId=(glyphId+s.idDelta)%65536),mappings.push({charCode:charCode,glyphId:glyphId})}}else if(4===cmap){file.skip(4);for(var segCount=file.getUint16()>>1,segments=(file.skip(6),[]),segIndex=0;segIndex<segCount;segIndex++)segments.push({end:file.getUint16()});for(file.skip(2),segIndex=0;segIndex<segCount;segIndex++)segments[segIndex].start=file.getUint16();for(segIndex=0;segIndex<segCount;segIndex++)segments[segIndex].delta=file.getUint16();var offsetsCount=0;for(segIndex=0;segIndex<segCount;segIndex++){var segment=segments[segIndex],rangeOffset=file.getUint16();rangeOffset?(segment.offsetIndex=offsetIndex=(rangeOffset>>1)-(segCount-segIndex),offsetsCount=Math.max(offsetsCount,offsetIndex+segment.end-segment.start+1)):segment.offsetIndex=-1}var offsets=[];for(j=0;j<offsetsCount;j++)offsets.push(file.getUint16());for(segIndex=0;segIndex<segCount;segIndex++){var start=(segment=segments[segIndex]).start,end=segment.end,delta=segment.delta,offsetIndex=segment.offsetIndex;for(j=start;j<=end;j++)65535!==j&&mappings.push({charCode:j,glyphId:glyphId=(glyphId=offsetIndex<0?j:offsets[offsetIndex+j-start])+delta&65535})}}else if(6===cmap){file.skip(4);var firstCode=file.getUint16(),entryCount=file.getUint16();for(j=0;j<entryCount;j++){var glyphId=file.getUint16();mappings.push({charCode:firstCode+j,glyphId:glyphId})}}else{if(12!==cmap)return warn("cmap table has unsupported format: "+cmap),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};file.skip(10);var nGroups=file.getInt32()>>>0;for(j=0;j<nGroups;j++)for(var startCharCode=file.getInt32()>>>0,endCharCode=file.getInt32()>>>0,glyphCode=file.getInt32()>>>0,_charCode3=startCharCode;_charCode3<=endCharCode;_charCode3++)mappings.push({charCode:_charCode3,glyphId:glyphCode++})}mappings.sort((a,b)=>a.charCode-b.charCode);var map,finalMappings=[],seenCharCodes=new Set;for(map of mappings){var _charCode4=map["charCode"];seenCharCodes.has(_charCode4)||(seenCharCodes.add(_charCode4),finalMappings.push(map))}return{platformId:potentialTable.platformId,encodingId:potentialTable.encodingId,mappings:finalMappings,hasShortCmap:hasShortCmap}}(tables.cmap,font,this.isSymbolicFont,properties.hasEncoding),cmapPlatformId=_properties$cidToGidM.platformId,cmapEncodingId=_properties$cidToGidM.encodingId,cmapMappings=_properties$cidToGidM.mappings,baseEncoding=[],forcePostTable=!1;if(!properties.hasEncoding||"MacRomanEncoding"!==properties.baseEncodingName&&"WinAnsiEncoding"!==properties.baseEncodingName||(baseEncoding=getEncoding(properties.baseEncodingName)),properties.hasEncoding&&!this.isSymbolicFont&&(3===cmapPlatformId&&1===cmapEncodingId||1===cmapPlatformId&&0===cmapEncodingId))for(var glyphsUnicodeMap=getGlyphsUnicode(),charCode=0;charCode<256;charCode++){var glyphName=void 0;if(glyphName=(void 0!==this.differences[charCode]?this.differences:baseEncoding.length&&""!==baseEncoding[charCode]?baseEncoding:StandardEncoding)[charCode]){var mapping,glyphName=recoverGlyphName(glyphName,glyphsUnicodeMap),unicodeOrCharCode=void 0;if(3===cmapPlatformId&&1===cmapEncodingId?unicodeOrCharCode=glyphsUnicodeMap[glyphName]:1===cmapPlatformId&&0===cmapEncodingId&&(unicodeOrCharCode=MacRomanEncoding.indexOf(glyphName)),void 0===unicodeOrCharCode)if(properties.glyphNames||!properties.hasIncludedToUnicodeMap||this.toUnicode instanceof IdentityToUnicodeMap||(glyphName=this.toUnicode.get(charCode))&&(unicodeOrCharCode=glyphName.codePointAt(0)),void 0===unicodeOrCharCode)continue;for(mapping of cmapMappings)if(mapping.charCode===unicodeOrCharCode){charCodeToGlyphId[charCode]=mapping.glyphId;break}}}else if(0===cmapPlatformId){for(var _mapping of cmapMappings)charCodeToGlyphId[_mapping.charCode]=_mapping.glyphId;forcePostTable=!0}else if(3===cmapPlatformId&&0===cmapEncodingId)for(var _mapping2 of cmapMappings){var _charCode5=_mapping2.charCode;61440<=_charCode5&&_charCode5<=61695&&(_charCode5&=255),charCodeToGlyphId[_charCode5]=_mapping2.glyphId}else for(var _mapping3 of cmapMappings)charCodeToGlyphId[_mapping3.charCode]=_mapping3.glyphId;if(properties.glyphNames&&(baseEncoding.length||this.differences.length))for(var _glyphName,_i31=0;_i31<256;++_i31)(forcePostTable||void 0===charCodeToGlyphId[_i31])&&(_glyphName=this.differences[_i31]||baseEncoding[_i31])&&0<(_glyphName=properties.glyphNames.indexOf(_glyphName))&&hasGlyph(_glyphName)&&(charCodeToGlyphId[_i31]=_glyphName)}0===charCodeToGlyphId.length&&(charCodeToGlyphId[0]=0);var _isGlyphLocationsLong=loca?glyphs-1:0;if(properties.cssFontInfo||(isLocationLong=adjustMapping(charCodeToGlyphId,hasGlyph,_isGlyphLocationsLong,this.toUnicode),this.toFontChar=isLocationLong.toFontChar,tables.cmap={tag:"cmap",data:createCmapTable(isLocationLong.charCodeToGlyphId,isLocationLong.toUnicodeExtraMap,glyphs)},tables["OS/2"]&&validateOS2Table(tables["OS/2"],font))||(tables["OS/2"]={tag:"OS/2",data:createOS2Table(properties,isLocationLong.charCodeToGlyphId,_properties$scaleFact)}),!ttcData)try{var cff,cffFile=new Stream(tables["CFF "].data),compiler=((cff=new CFFParser(cffFile,properties,SEAC_ANALYSIS_ENABLED).parse()).duplicateFirstGlyph(),new CFFCompiler(cff));tables["CFF "].data=compiler.compile()}catch(_unused0){warn("Failed to compile font "+properties.loadedName)}tables.name?([_properties$cidToGidM,loca]=readNameTable(tables.name),tables.name.data=createNameTable(name,_properties$cidToGidM),this.psName=_properties$cidToGidM[0][6]||null,properties.composite||adjustTrueTypeToUnicode(properties,this.isSymbolicFont,loca)):tables.name={tag:"name",data:createNameTable(this.name)};var tableTag,builder=new OpenTypeFileBuilder(header.version);for(tableTag in tables)builder.addTable(tableTag,tables[tableTag].data);return builder.toArray()}convert(fontName,font,properties){properties.fixedPitch=!1,properties.builtInEncoding&&adjustType1ToUnicode(properties,properties.builtInEncoding);var glyphZeroId=1,mapping=(font instanceof CFFFont&&(glyphZeroId=font.numGlyphs-1),font.getGlyphMapping(properties)),newMapping=null,newCharCodeToGlyphId=mapping,toUnicodeExtraMap=null,numGlyphs=(properties.cssFontInfo||(newMapping=adjustMapping(mapping,font.hasGlyphId.bind(font),glyphZeroId,this.toUnicode),this.toFontChar=newMapping.toFontChar,newCharCodeToGlyphId=newMapping.charCodeToGlyphId,toUnicodeExtraMap=newMapping.toUnicodeExtraMap),font.numGlyphs);function createCharCode(charCodeToGlyphId,glyphId){for(var charCode in charCodeToGlyphId)if(glyphId===charCodeToGlyphId[charCode])return 0|charCode;return newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode]=glyphId,newMapping.nextAvailableFontCharCode++}var seacs=font.seacs;if(newMapping&&SEAC_ANALYSIS_ENABLED&&null!=seacs&&seacs.length){var glyphId,matrix=properties.fontMatrix||FONT_IDENTITY_MATRIX,charset=font.getCharset(),seacMap=Object.create(null);for(glyphId in seacs){var seac=seacs[glyphId|=0],baseGlyphName=StandardEncoding[seac[2]],accentGlyphName=StandardEncoding[seac[3]],baseGlyphId=charset.indexOf(baseGlyphName),accentGlyphId=charset.indexOf(accentGlyphName);if(!(baseGlyphId<0||accentGlyphId<0)){var accentOffset={x:seac[0]*matrix[0]+seac[1]*matrix[2]+matrix[4],y:seac[0]*matrix[1]+seac[1]*matrix[3]+matrix[5]},baseGlyphName=function(charCodeToGlyphId,glyphId){var charCode,charCodes=null;for(charCode in charCodeToGlyphId)glyphId===charCodeToGlyphId[charCode]&&(charCodes=charCodes||[]).push(0|charCode);return charCodes}(mapping,glyphId);if(baseGlyphName)for(var charCode of baseGlyphName){var charCodeToGlyphId=newMapping.charCodeToGlyphId,baseFontCharCode=createCharCode(charCodeToGlyphId,baseGlyphId),charCodeToGlyphId=createCharCode(charCodeToGlyphId,accentGlyphId);seacMap[charCode]={baseFontCharCode:baseFontCharCode,accentFontCharCode:charCodeToGlyphId,accentOffset:accentOffset}}}}properties.seacMap=seacMap}var glyphZeroId=properties.fontMatrix?1/Math.max(...properties.fontMatrix.slice(0,4).map(Math.abs)):1e3,builder=new OpenTypeFileBuilder("OTTO");return builder.addTable("CFF ",font.data),builder.addTable("OS/2",createOS2Table(properties,newCharCodeToGlyphId)),builder.addTable("cmap",createCmapTable(newCharCodeToGlyphId,toUnicodeExtraMap,numGlyphs)),builder.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(glyphZeroId)+"\0\0\0\0\v~'\0\0\0\0\v~'\0\0"+safeString16(properties.descent)+"ÿ"+safeString16(properties.ascent)+string16(properties.italicAngle?2:0)+"\0\0\0\0\0\0\0"),builder.addTable("hhea","\0\0\0"+safeString16(properties.ascent)+safeString16(properties.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(properties.capHeight)+safeString16(Math.tan(properties.italicAngle)*properties.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(numGlyphs)),builder.addTable("hmtx",function(){for(var charstrings=font.charstrings,cffWidths=font.cff?font.cff.widths:null,hmtx="\0\0\0\0",i=1,ii=numGlyphs;i<ii;i++){var charstring,width=0;charstrings?width="width"in(charstring=charstrings[i-1])?charstring.width:0:cffWidths&&(width=Math.ceil(cffWidths[i]||0)),hmtx+=string16(width)+string16(0)}return hmtx}()),builder.addTable("maxp","\0\0P\0"+string16(numGlyphs)),builder.addTable("name",createNameTable(fontName)),builder.addTable("post",createPostTable(properties)),builder.toArray()}get _spaceWidth(){var width,glyphName;for(glyphName of["space","minus","one","i","I"]){if(glyphName in this.widths){width=this.widths[glyphName];break}var glyphUnicode=getGlyphsUnicode()[glyphName],charcode=0;if((charcode=!(charcode=this.composite&&this.cMap.contains(glyphUnicode)&&"string"==typeof(charcode=this.cMap.lookup(glyphUnicode))?convertCidString(glyphUnicode,charcode):charcode)&&this.toUnicode?this.toUnicode.charCodeOf(glyphUnicode):charcode)<=0&&(charcode=glyphUnicode),width=this.widths[charcode])break}return shadow(this,"_spaceWidth",width||this.defaultWidth)}_charToGlyph(charcode){var _this$cMap,operatorListId,_this$vmetrics,widthCode,isInFont,glyphName,_this$seacMap,fontCharCode,isSpace=1<arguments.length&&void 0!==arguments[1]&&arguments[1],glyph=this._glyphCache[charcode];return(null==glyph?void 0:glyph.isSpace)===isSpace?glyph:(widthCode=charcode,null!=(_this$cMap=this.cMap)&&_this$cMap.contains(charcode)&&"string"==typeof(widthCode=this.cMap.lookup(charcode))&&(widthCode=convertCidString(charcode,widthCode)),"number"!=typeof(_this$cMap=this.widths[widthCode])&&(_this$cMap=this.defaultWidth),_this$vmetrics=null==(_this$vmetrics=this.vmetrics)?void 0:_this$vmetrics[widthCode],"number"==typeof(widthCode=this.toUnicode.get(charcode)||charcode)&&(widthCode=String.fromCharCode(widthCode)),isInFont=void 0!==this.toFontChar[charcode],fontCharCode=this.toFontChar[charcode]||charcode,this.missingFile&&(".notdef"!==(glyphName=this.differences[charcode]||this.defaultEncoding[charcode])&&""!==glyphName||"Type1"!==this.type||(fontCharCode=32,""===glyphName&&(_this$cMap=_this$cMap||this._spaceWidth,widthCode=String.fromCharCode(fontCharCode))),fontCharCode=mapSpecialUnicodeValues(fontCharCode)),this.isType3Font&&(operatorListId=fontCharCode),(glyphName=null)!=(_this$seacMap=this.seacMap)&&_this$seacMap[charcode]&&(isInFont=!0,fontCharCode=(_this$seacMap=this.seacMap[charcode]).baseFontCharCode,glyphName={fontChar:String.fromCodePoint(_this$seacMap.accentFontCharCode),offset:_this$seacMap.accentOffset}),_this$seacMap="","number"==typeof fontCharCode&&(fontCharCode<=1114111?_this$seacMap=String.fromCodePoint(fontCharCode):warn("charToGlyph - invalid fontCharCode: ".concat(fontCharCode))),this.missingFile&&this.vertical&&1===_this$seacMap.length&&(fontCharCode=getVerticalPresentationForm()[_this$seacMap.charCodeAt(0)])&&(_this$seacMap=widthCode=String.fromCharCode(fontCharCode)),glyph=new fonts_Glyph(charcode,_this$seacMap,widthCode,glyphName,_this$cMap,_this$vmetrics,operatorListId,isSpace,isInFont),this._glyphCache[charcode]=glyph)}charsToGlyphs(chars){var glyphs=this._charsCache[chars];if(glyphs)return glyphs;if(glyphs=[],this.cMap)for(var c=Object.create(null),ii=chars.length,i=0;i<ii;){this.cMap.readCharCode(chars,i,c);var{charcode,length}=c,charcode=(i+=length,this._charToGlyph(charcode,1===length&&32===chars.charCodeAt(i-1)));glyphs.push(charcode)}else for(var _i32=0,_ii9=chars.length;_i32<_ii9;++_i32){var _charcode=chars.charCodeAt(_i32),_charcode=this._charToGlyph(_charcode,32===_charcode);glyphs.push(_charcode)}return this._charsCache[chars]=glyphs}getCharPositions(chars){var positions=[];if(this.cMap)for(var c=Object.create(null),i=0;i<chars.length;){this.cMap.readCharCode(chars,i,c);var length=c.length;positions.push([i,i+length]),i+=length}else for(var _i33=0,ii=chars.length;_i33<ii;++_i33)positions.push([_i33,_i33+1]);return positions}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(str){for(var buffers=[],currentBuf=[],getCharCode=this.toUnicode instanceof IdentityToUnicodeMap?unicode=>this.toUnicode.charCodeOf(unicode):unicode=>this.toUnicode.charCodeOf(String.fromCodePoint(unicode)),i=0,ii=str.length;i<ii;i++){var unicode=str.codePointAt(i);if(55295<unicode&&(unicode<57344||65533<unicode)&&i++,this.toUnicode){var charCode=getCharCode(unicode);if(-1!==charCode){buffers.length%2==1&&(buffers.push(currentBuf.join("")),currentBuf.length=0);for(var j=(this.cMap?this.cMap.getCharCodeLength(charCode):1)-1;0<=j;j--)currentBuf.push(String.fromCharCode(charCode>>8*j&255));continue}}buffers.length%2!=1&&(buffers.push(currentBuf.join("")),currentBuf.length=0),currentBuf.push(String.fromCodePoint(unicode))}return buffers.push(currentBuf.join("")),buffers}}class ErrorFont{constructor(error){this.error=error,this.loadedName="g_font_error",this.missingFile=!0}charsToGlyphs(){return[]}encodeString(chars){return[chars]}exportData(){return{error:this.error}}}var ShadingType={FUNCTION_BASED:1,AXIAL:2,RADIAL:3,FREE_FORM_MESH:4,LATTICE_FORM_MESH:5,COONS_PATCH_MESH:6,TENSOR_PATCH_MESH:7};class Pattern{constructor(){unreachable("Cannot initialize Pattern.")}static parseShading(shading,xref,res,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache){var dict=shading instanceof BaseStream?shading.dict:shading,type=dict.get("ShadingType");try{switch(type){case ShadingType.AXIAL:case ShadingType.RADIAL:return new RadialAxialShading(dict,xref,res,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache);case ShadingType.FREE_FORM_MESH:case ShadingType.LATTICE_FORM_MESH:case ShadingType.COONS_PATCH_MESH:case ShadingType.TENSOR_PATCH_MESH:return new MeshShading(shading,xref,res,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache);default:throw new FormatError("Unsupported ShadingType: "+type)}}catch(ex){if(ex instanceof MissingDataException)throw ex;return warn(ex),new DummyShading}}}class BaseShading{getIR(){unreachable("Abstract method `getIR` called.")}}_defineProperty(BaseShading,"SMALL_NUMBER",1e-6);class RadialAxialShading extends BaseShading{constructor(dict,xref,resources,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache){super(),this.shadingType=dict.get("ShadingType");var coordsLen=0;if(this.shadingType===ShadingType.AXIAL?coordsLen=4:this.shadingType===ShadingType.RADIAL&&(coordsLen=6),this.coordsArr=dict.getArray("Coords"),!isNumberArray(this.coordsArr,coordsLen))throw new FormatError("RadialAxialShading: Invalid /Coords array.");var r1,y2,r2,cs=ColorSpaceUtils.parse({cs:dict.getRaw("CS")||dict.getRaw("ColorSpace"),xref:xref,resources:resources,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache}),t0=(this.bbox=lookupNormalRect(dict.getArray("BBox"),null),0),coordsLen=1,xref=dict.getArray("Domain"),resources=(isNumberArray(xref,2)&&([t0,coordsLen]=xref),!1),globalColorSpaceCache=!1,localColorSpaceCache=dict.getArray("Extend"),x2=(isBooleanArray(localColorSpaceCache,2)&&([resources,globalColorSpaceCache]=localColorSpaceCache),this.shadingType!==ShadingType.RADIAL||resources&&globalColorSpaceCache||([xref,localColorSpaceCache,r1,x2,y2,r2]=this.coordsArr,r1<=r2+(xref=Math.hypot(xref-x2,localColorSpaceCache-y2))&&r2<=r1+xref&&warn("Unsupported radial gradient.")),this.extendStart=resources,this.extendEnd=globalColorSpaceCache,dict.getRaw("Function")),fn=pdfFunctionFactory.create(x2,!0),step=(coordsLen-t0)/840,colorStops=this.colorStops=[];if(coordsLen<=t0||step<=0)info("Bad shading domain.");else{for(var color=new Float32Array(cs.numComps),ratio=new Float32Array(1),iBase=0,rgbBuffer=(ratio[0]=t0,fn(ratio,0,color,0),new Uint8ClampedArray(3)),[rBase,gBase,bBase]=(cs.getRgb(color,0,rgbBuffer),rgbBuffer),iPrev=(colorStops.push([0,Util.makeHexColor(rBase,gBase,bBase)]),1),[rPrev,gPrev,bPrev]=(ratio[0]=t0+step,fn(ratio,0,color,0),cs.getRgb(color,0,rgbBuffer),rgbBuffer),maxSlopeR=rPrev-rBase+1,maxSlopeG=gPrev-gBase+1,maxSlopeB=bPrev-bBase+1,minSlopeR=rPrev-rBase-1,minSlopeG=gPrev-gBase-1,minSlopeB=bPrev-bBase-1,i=2;i<840;i++){ratio[0]=t0+i*step,fn(ratio,0,color,0),cs.getRgb(color,0,rgbBuffer);var[r,g,b]=rgbBuffer,run=i-iBase,maxSlopeR=Math.min(maxSlopeR,(r-rBase+1)/run),maxSlopeG=Math.min(maxSlopeG,(g-gBase+1)/run),maxSlopeB=Math.min(maxSlopeB,(b-bBase+1)/run),minSlopeR=Math.max(minSlopeR,(r-rBase-1)/run),minSlopeG=Math.max(minSlopeG,(g-gBase-1)/run),minSlopeB=Math.max(minSlopeB,(b-bBase-1)/run);minSlopeR<=maxSlopeR&&minSlopeG<=maxSlopeG&&minSlopeB<=maxSlopeB||(run=Util.makeHexColor(rPrev,gPrev,bPrev),colorStops.push([iPrev/840,run]),maxSlopeR=r-rPrev+1,maxSlopeG=g-gPrev+1,maxSlopeB=b-bPrev+1,minSlopeR=r-rPrev-1,minSlopeG=g-gPrev-1,minSlopeB=b-bPrev-1,iBase=iPrev,rBase=rPrev,gBase=gPrev,bBase=bPrev),iPrev=i,rPrev=r,gPrev=g,bPrev=b}colorStops.push([1,Util.makeHexColor(rPrev,gPrev,bPrev)]);localColorSpaceCache="transparent";dict.has("Background")&&(localColorSpaceCache=cs.getRgbHex(dict.get("Background"),0)),resources||(colorStops.unshift([0,localColorSpaceCache]),colorStops[1][0]+=BaseShading.SMALL_NUMBER),globalColorSpaceCache||(colorStops.at(-1)[0]-=BaseShading.SMALL_NUMBER,colorStops.push([1,localColorSpaceCache])),this.colorStops=colorStops}}getIR(){var type,p0,p1,r0,r1,{coordsArr,shadingType}=this;return shadingType===ShadingType.AXIAL?(p0=[coordsArr[0],coordsArr[1]],p1=[coordsArr[2],coordsArr[3]],r1=r0=null,type="axial"):shadingType===ShadingType.RADIAL?(p0=[coordsArr[0],coordsArr[1]],p1=[coordsArr[3],coordsArr[4]],r0=coordsArr[2],r1=coordsArr[5],type="radial"):unreachable("getPattern type unknown: ".concat(shadingType)),["RadialAxial",type,this.bbox,this.colorStops,p0,p1,r0,r1]}}class MeshStreamReader{constructor(stream,context){this.stream=stream,this.context=context,this.buffer=0,this.bufferLength=0;stream=context.numComps,this.tmpCompsBuf=new Float32Array(stream),stream=context.colorSpace.numComps;this.tmpCsCompsBuf=context.colorFn?new Float32Array(stream):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(!(0<this.bufferLength)){var nextByte=this.stream.getByte();if(nextByte<0)return!1;this.buffer=nextByte,this.bufferLength=8}return!0}readBits(n){var nextByte,stream=this["stream"],{buffer,bufferLength}=this;if(32===n)return 0===bufferLength?stream.getInt32()>>>0:(buffer=buffer<<24|stream.getByte()<<16|stream.getByte()<<8|stream.getByte(),nextByte=stream.getByte(),this.buffer=nextByte&(1<<bufferLength)-1,(buffer<<8-bufferLength|(255&nextByte)>>bufferLength)>>>0);if(8===n&&0===bufferLength)return stream.getByte();for(;bufferLength<n;)buffer=buffer<<8|stream.getByte(),bufferLength+=8;return this.bufferLength=bufferLength-=n,this.buffer=buffer&(1<<bufferLength)-1,buffer>>bufferLength}align(){this.buffer=0,this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){var{bitsPerCoordinate,decode}=this.context,xi=this.readBits(bitsPerCoordinate),yi=this.readBits(bitsPerCoordinate),bitsPerCoordinate=bitsPerCoordinate<32?1/((1<<bitsPerCoordinate)-1):2.3283064365386963e-10;return[xi*bitsPerCoordinate*(decode[1]-decode[0])+decode[0],yi*bitsPerCoordinate*(decode[3]-decode[2])+decode[2]]}readComponents(){for(var{bitsPerComponent,colorFn,colorSpace,decode,numComps}=this.context,scale=bitsPerComponent<32?1/((1<<bitsPerComponent)-1):2.3283064365386963e-10,components=this.tmpCompsBuf,i=0,j=4;i<numComps;i++,j+=2){var ci=this.readBits(bitsPerComponent);components[i]=ci*scale*(decode[j+1]-decode[j])+decode[j]}var color=this.tmpCsCompsBuf;return null!=colorFn&&colorFn(components,0,color,0),colorSpace.getRgb(color,0)}}var bCache=Object.create(null);function buildB(count){for(var lut=[],i=0;i<=count;i++){var t=i/count,t_=1-t;lut.push(new Float32Array([t_**3,3*t*t_**2,3*t**2*t_,t**3]))}return lut}function getB(count){return bCache[count]||(bCache[count]=buildB(count))}function clearPatternCaches(){bCache=Object.create(null)}class MeshShading extends BaseShading{constructor(stream,xref,resources,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache){if(super(),!(stream instanceof BaseStream))throw new FormatError("Mesh data is not a stream");var dict=stream.dict,xref=(this.shadingType=dict.get("ShadingType"),this.bbox=lookupNormalRect(dict.getArray("BBox"),null),ColorSpaceUtils.parse({cs:dict.getRaw("CS")||dict.getRaw("ColorSpace"),xref:xref,resources:resources,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache})),resources=(this.background=dict.has("Background")?xref.getRgb(dict.get("Background"),0):null,dict.getRaw("Function")),globalColorSpaceCache=resources?pdfFunctionFactory.create(resources,!0):null,localColorSpaceCache=(this.coords=[],this.colors=[],this.figures=[],{bitsPerCoordinate:dict.get("BitsPerCoordinate"),bitsPerComponent:dict.get("BitsPerComponent"),bitsPerFlag:dict.get("BitsPerFlag"),decode:dict.getArray("Decode"),colorFn:globalColorSpaceCache,colorSpace:xref,numComps:globalColorSpaceCache?1:xref.numComps}),reader=new MeshStreamReader(stream,localColorSpaceCache),patchMesh=!1;switch(this.shadingType){case ShadingType.FREE_FORM_MESH:this._decodeType4Shading(reader);break;case ShadingType.LATTICE_FORM_MESH:var verticesPerRow=0|dict.get("VerticesPerRow");if(verticesPerRow<2)throw new FormatError("Invalid VerticesPerRow");this._decodeType5Shading(reader,verticesPerRow);break;case ShadingType.COONS_PATCH_MESH:this._decodeType6Shading(reader),patchMesh=!0;break;case ShadingType.TENSOR_PATCH_MESH:this._decodeType7Shading(reader),patchMesh=!0;break;default:unreachable("Unsupported mesh type.")}if(patchMesh){this._updateBounds();for(var i=0,ii=this.figures.length;i<ii;i++)this._buildFigureFromPatch(i)}this._updateBounds(),this._packData()}_decodeType4Shading(reader){for(var coords=this.coords,colors=this.colors,operators=[],ps=[],verticesLeft=0;reader.hasData;){var f=reader.readFlag(),coord=reader.readCoordinate(),color=reader.readComponents();if(0===verticesLeft){if(!(0<=f&&f<=2))throw new FormatError("Unknown type4 flag");switch(f){case 0:verticesLeft=3;break;case 1:ps.push(ps.at(-2),ps.at(-1)),verticesLeft=1;break;case 2:ps.push(ps.at(-3),ps.at(-1)),verticesLeft=1}operators.push(f)}ps.push(coords.length),coords.push(coord),colors.push(color),verticesLeft--,reader.align()}this.figures.push({type:"triangles",coords:new Int32Array(ps),colors:new Int32Array(ps)})}_decodeType5Shading(reader,verticesPerRow){for(var coords=this.coords,colors=this.colors,ps=[];reader.hasData;){var coord=reader.readCoordinate(),color=reader.readComponents();ps.push(coords.length),coords.push(coord),colors.push(color)}this.figures.push({type:"lattice",coords:new Int32Array(ps),colors:new Int32Array(ps),verticesPerRow:verticesPerRow})}_decodeType6Shading(reader){for(var coords=this.coords,colors=this.colors,ps=new Int32Array(16),cs=new Int32Array(4);reader.hasData;){var f=reader.readFlag();if(!(0<=f&&f<=3))throw new FormatError("Unknown type6 flag");for(var pi=coords.length,i=0,ii=0!==f?8:12;i<ii;i++)coords.push(reader.readCoordinate());for(var ci=colors.length,_i34=0,_ii0=0!==f?2:4;_i34<_ii0;_i34++)colors.push(reader.readComponents());var tmp3,tmp4,tmp1=void 0,tmp2=void 0;switch(f){case 0:ps[12]=pi+3,ps[13]=pi+4,ps[14]=pi+5,ps[15]=pi+6,ps[8]=pi+2,ps[11]=pi+7,ps[4]=pi+1,ps[7]=pi+8,ps[0]=pi,ps[1]=pi+11,ps[2]=pi+10,ps[3]=pi+9,cs[2]=ci+1,cs[3]=ci+2,cs[0]=ci,cs[1]=ci+3;break;case 1:tmp1=ps[12],tmp2=ps[13],tmp3=ps[14],tmp4=ps[15],ps[12]=tmp4,ps[13]=pi+0,ps[14]=pi+1,ps[15]=pi+2,ps[8]=tmp3,ps[11]=pi+3,ps[4]=tmp2,ps[7]=pi+4,ps[0]=tmp1,ps[1]=pi+7,ps[2]=pi+6,ps[3]=pi+5,tmp1=cs[2],tmp2=cs[3],cs[2]=tmp2,cs[3]=ci,cs[0]=tmp1,cs[1]=ci+1;break;case 2:tmp1=ps[15],tmp2=ps[11],ps[12]=ps[3],ps[13]=pi+0,ps[14]=pi+1,ps[15]=pi+2,ps[8]=ps[7],ps[11]=pi+3,ps[4]=tmp2,ps[7]=pi+4,ps[0]=tmp1,ps[1]=pi+7,ps[2]=pi+6,ps[3]=pi+5,tmp1=cs[3],cs[2]=cs[1],cs[3]=ci,cs[0]=tmp1,cs[1]=ci+1;break;case 3:ps[12]=ps[0],ps[13]=pi+0,ps[14]=pi+1,ps[15]=pi+2,ps[8]=ps[1],ps[11]=pi+3,ps[4]=ps[2],ps[7]=pi+4,ps[0]=ps[3],ps[1]=pi+7,ps[2]=pi+6,ps[3]=pi+5,cs[2]=cs[0],cs[3]=ci,cs[0]=cs[1],cs[1]=ci+1}ps[5]=coords.length,coords.push([(-4*coords[ps[0]][0]-coords[ps[15]][0]+6*(coords[ps[4]][0]+coords[ps[1]][0])-2*(coords[ps[12]][0]+coords[ps[3]][0])+3*(coords[ps[13]][0]+coords[ps[7]][0]))/9,(-4*coords[ps[0]][1]-coords[ps[15]][1]+6*(coords[ps[4]][1]+coords[ps[1]][1])-2*(coords[ps[12]][1]+coords[ps[3]][1])+3*(coords[ps[13]][1]+coords[ps[7]][1]))/9]),ps[6]=coords.length,coords.push([(-4*coords[ps[3]][0]-coords[ps[12]][0]+6*(coords[ps[2]][0]+coords[ps[7]][0])-2*(coords[ps[0]][0]+coords[ps[15]][0])+3*(coords[ps[4]][0]+coords[ps[14]][0]))/9,(-4*coords[ps[3]][1]-coords[ps[12]][1]+6*(coords[ps[2]][1]+coords[ps[7]][1])-2*(coords[ps[0]][1]+coords[ps[15]][1])+3*(coords[ps[4]][1]+coords[ps[14]][1]))/9]),ps[9]=coords.length,coords.push([(-4*coords[ps[12]][0]-coords[ps[3]][0]+6*(coords[ps[8]][0]+coords[ps[13]][0])-2*(coords[ps[0]][0]+coords[ps[15]][0])+3*(coords[ps[11]][0]+coords[ps[1]][0]))/9,(-4*coords[ps[12]][1]-coords[ps[3]][1]+6*(coords[ps[8]][1]+coords[ps[13]][1])-2*(coords[ps[0]][1]+coords[ps[15]][1])+3*(coords[ps[11]][1]+coords[ps[1]][1]))/9]),ps[10]=coords.length,coords.push([(-4*coords[ps[15]][0]-coords[ps[0]][0]+6*(coords[ps[11]][0]+coords[ps[14]][0])-2*(coords[ps[12]][0]+coords[ps[3]][0])+3*(coords[ps[2]][0]+coords[ps[8]][0]))/9,(-4*coords[ps[15]][1]-coords[ps[0]][1]+6*(coords[ps[11]][1]+coords[ps[14]][1])-2*(coords[ps[12]][1]+coords[ps[3]][1])+3*(coords[ps[2]][1]+coords[ps[8]][1]))/9]),this.figures.push({type:"patch",coords:new Int32Array(ps),colors:new Int32Array(cs)})}}_decodeType7Shading(reader){for(var coords=this.coords,colors=this.colors,ps=new Int32Array(16),cs=new Int32Array(4);reader.hasData;){var f=reader.readFlag();if(!(0<=f&&f<=3))throw new FormatError("Unknown type7 flag");for(var pi=coords.length,i=0,ii=0!==f?12:16;i<ii;i++)coords.push(reader.readCoordinate());for(var ci=colors.length,_i35=0,_ii1=0!==f?2:4;_i35<_ii1;_i35++)colors.push(reader.readComponents());var tmp3,tmp4,tmp1=void 0,tmp2=void 0;switch(f){case 0:ps[12]=pi+3,ps[13]=pi+4,ps[14]=pi+5,ps[15]=pi+6,ps[8]=pi+2,ps[9]=pi+13,ps[10]=pi+14,ps[11]=pi+7,ps[4]=pi+1,ps[5]=pi+12,ps[6]=pi+15,ps[7]=pi+8,ps[0]=pi,ps[1]=pi+11,ps[2]=pi+10,ps[3]=pi+9,cs[2]=ci+1,cs[3]=ci+2,cs[0]=ci,cs[1]=ci+3;break;case 1:tmp1=ps[12],tmp2=ps[13],tmp3=ps[14],tmp4=ps[15],ps[12]=tmp4,ps[13]=pi+0,ps[14]=pi+1,ps[15]=pi+2,ps[8]=tmp3,ps[9]=pi+9,ps[10]=pi+10,ps[11]=pi+3,ps[4]=tmp2,ps[5]=pi+8,ps[6]=pi+11,ps[7]=pi+4,ps[0]=tmp1,ps[1]=pi+7,ps[2]=pi+6,ps[3]=pi+5,tmp1=cs[2],tmp2=cs[3],cs[2]=tmp2,cs[3]=ci,cs[0]=tmp1,cs[1]=ci+1;break;case 2:tmp1=ps[15],tmp2=ps[11],ps[12]=ps[3],ps[13]=pi+0,ps[14]=pi+1,ps[15]=pi+2,ps[8]=ps[7],ps[9]=pi+9,ps[10]=pi+10,ps[11]=pi+3,ps[4]=tmp2,ps[5]=pi+8,ps[6]=pi+11,ps[7]=pi+4,ps[0]=tmp1,ps[1]=pi+7,ps[2]=pi+6,ps[3]=pi+5,tmp1=cs[3],cs[2]=cs[1],cs[3]=ci,cs[0]=tmp1,cs[1]=ci+1;break;case 3:ps[12]=ps[0],ps[13]=pi+0,ps[14]=pi+1,ps[15]=pi+2,ps[8]=ps[1],ps[9]=pi+9,ps[10]=pi+10,ps[11]=pi+3,ps[4]=ps[2],ps[5]=pi+8,ps[6]=pi+11,ps[7]=pi+4,ps[0]=ps[3],ps[1]=pi+7,ps[2]=pi+6,ps[3]=pi+5,cs[2]=cs[0],cs[3]=ci,cs[0]=cs[1],cs[1]=ci+1}this.figures.push({type:"patch",coords:new Int32Array(ps),colors:new Int32Array(cs)})}}_buildFigureFromPatch(index){for(var figure=this.figures[index],coords=(assert("patch"===figure.type,"Unexpected patch mesh figure"),this.coords),colors=this.colors,pi=figure.coords,figure=figure.colors,figureMinX=Math.min(coords[pi[0]][0],coords[pi[3]][0],coords[pi[12]][0],coords[pi[15]][0]),figureMinY=Math.min(coords[pi[0]][1],coords[pi[3]][1],coords[pi[12]][1],coords[pi[15]][1]),figureMaxX=Math.max(coords[pi[0]][0],coords[pi[3]][0],coords[pi[12]][0],coords[pi[15]][0]),figureMaxY=Math.max(coords[pi[0]][1],coords[pi[3]][1],coords[pi[12]][1],coords[pi[15]][1]),splitXBy=MathClamp(Math.ceil((figureMaxX-figureMinX)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0])),MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT),splitYBy=MathClamp(Math.ceil((figureMaxY-figureMinY)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1])),MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT),figureMaxX=splitXBy+1,figureCoords=new Int32Array((splitYBy+1)*figureMaxX),figureColors=new Int32Array((splitYBy+1)*figureMaxX),k=0,cl=new Uint8Array(3),cr=new Uint8Array(3),c0=colors[figure[0]],c1=colors[figure[1]],c2=colors[figure[2]],c3=colors[figure[3]],bRow=getB(splitYBy),bCol=getB(splitXBy),row=0;row<=splitYBy;row++){cl[0]=(c0[0]*(splitYBy-row)+c2[0]*row)/splitYBy|0,cl[1]=(c0[1]*(splitYBy-row)+c2[1]*row)/splitYBy|0,cl[2]=(c0[2]*(splitYBy-row)+c2[2]*row)/splitYBy|0,cr[0]=(c1[0]*(splitYBy-row)+c3[0]*row)/splitYBy|0,cr[1]=(c1[1]*(splitYBy-row)+c3[1]*row)/splitYBy|0,cr[2]=(c1[2]*(splitYBy-row)+c3[2]*row)/splitYBy|0;for(var col=0;col<=splitXBy;col++,k++)if(0!==row&&row!==splitYBy||0!==col&&col!==splitXBy){for(var x=0,y=0,q=0,i=0;i<=3;i++)for(var j=0;j<=3;j++,q++){var m=bRow[row][i]*bCol[col][j];x+=coords[pi[q]][0]*m,y+=coords[pi[q]][1]*m}figureCoords[k]=coords.length,coords.push([x,y]),figureColors[k]=colors.length;var newColor=new Uint8Array(3);newColor[0]=(cl[0]*(splitXBy-col)+cr[0]*col)/splitXBy|0,newColor[1]=(cl[1]*(splitXBy-col)+cr[1]*col)/splitXBy|0,newColor[2]=(cl[2]*(splitXBy-col)+cr[2]*col)/splitXBy|0,colors.push(newColor)}}figureCoords[0]=pi[0],figureColors[0]=figure[0],figureCoords[splitXBy]=pi[3],figureColors[splitXBy]=figure[1],figureCoords[figureMaxX*splitYBy]=pi[12],figureColors[figureMaxX*splitYBy]=figure[2],figureCoords[figureMaxX*splitYBy+splitXBy]=pi[15],figureColors[figureMaxX*splitYBy+splitXBy]=figure[3],this.figures[index]={type:"lattice",coords:figureCoords,colors:figureColors,verticesPerRow:figureMaxX}}_updateBounds(){for(var maxX=minX=this.coords[0][0],maxY=minY=this.coords[0][1],i=1,ii=this.coords.length;i<ii;i++)var x=this.coords[i][0],y=this.coords[i][1],minX=x<minX?x:minX,minY=y<minY?y:minY,maxX=maxX<x?x:maxX,maxY=maxY<y?y:maxY;this.bounds=[minX,minY,maxX,maxY]}_packData(){var ii,coords=this.coords,coordsPacked=new Float32Array(2*coords.length),i=0;for(j=0,ii=coords.length;i<ii;i++){var xy=coords[i];coordsPacked[j++]=xy[0],coordsPacked[j++]=xy[1]}this.coords=coordsPacked;var colors=this.colors,colorsPacked=new Uint8Array(3*colors.length);for(j=i=0,ii=colors.length;i<ii;i++){var c=colors[i];colorsPacked[j++]=c[0],colorsPacked[j++]=c[1],colorsPacked[j++]=c[2]}this.colors=colorsPacked;var figures=this.figures;for(i=0,ii=figures.length;i<ii;i++)for(var figure=figures[i],ps=figure.coords,cs=figure.colors,j=0,jj=ps.length;j<jj;j++)ps[j]*=2,cs[j]*=3}getIR(){var bounds=this["bounds"];if(bounds[2]-bounds[0]==0||bounds[3]-bounds[1]==0)throw new FormatError("Invalid MeshShading bounds: [".concat(bounds,"]."));return["Mesh",this.shadingType,this.coords,this.colors,this.figures,bounds,this.bbox,this.background]}}_defineProperty(MeshShading,"MIN_SPLIT_PATCH_CHUNKS_AMOUNT",3),_defineProperty(MeshShading,"MAX_SPLIT_PATCH_CHUNKS_AMOUNT",20),_defineProperty(MeshShading,"TRIANGLE_DENSITY",20);class DummyShading extends BaseShading{getIR(){return["Dummy"]}}function getTilingPatternIR(operatorList,dict,color){var matrix=lookupMatrix(dict.getArray("Matrix"),IDENTITY_MATRIX),bbox=lookupNormalRect(dict.getArray("BBox"),null);if(!bbox||bbox[2]-bbox[0]==0||bbox[3]-bbox[1]==0)throw new FormatError("Invalid getTilingPatternIR /BBox array.");var xstep=dict.get("XStep");if("number"!=typeof xstep)throw new FormatError("Invalid getTilingPatternIR /XStep value.");var ystep=dict.get("YStep");if("number"!=typeof ystep)throw new FormatError("Invalid getTilingPatternIR /YStep value.");var paintType=dict.get("PaintType");if(!Number.isInteger(paintType))throw new FormatError("Invalid getTilingPatternIR /PaintType value.");dict=dict.get("TilingType");if(Number.isInteger(dict))return["TilingPattern",color,operatorList,matrix,bbox,xstep,ystep,paintType,dict];throw new FormatError("Invalid getTilingPatternIR /TilingType value.")}var CalibriBoldFactors=[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],CalibriBoldMetrics={lineHeight:1.2207,lineGap:.2207},CalibriBoldItalicFactors=[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],CalibriBoldItalicMetrics={lineHeight:1.2207,lineGap:.2207},CalibriItalicFactors=[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],CalibriItalicMetrics={lineHeight:1.2207,lineGap:.2207},CalibriRegularFactors=[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],CalibriRegularMetrics={lineHeight:1.2207,lineGap:.2207},HelveticaBoldFactors=[.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],HelveticaBoldMetrics={lineHeight:1.2,lineGap:.2},HelveticaBoldItalicFactors=[.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],HelveticaBoldItalicMetrics={lineHeight:1.35,lineGap:.2},HelveticaItalicFactors=[.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],HelveticaItalicMetrics={lineHeight:1.35,lineGap:.2},HelveticaRegularFactors=[.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],HelveticaRegularMetrics={lineHeight:1.2,lineGap:.2},LiberationSansBoldWidths=[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],LiberationSansBoldMapping=[-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],LiberationSansBoldItalicWidths=[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],LiberationSansBoldItalicMapping=[-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],LiberationSansItalicWidths=[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],LiberationSansItalicMapping=[-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],LiberationSansRegularWidths=[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],LiberationSansRegularMapping=[-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],MyriadProBoldFactors=[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],MyriadProBoldMetrics={lineHeight:1.2,lineGap:.2},MyriadProBoldItalicFactors=[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],MyriadProBoldItalicMetrics={lineHeight:1.2,lineGap:.2},MyriadProItalicFactors=[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],MyriadProItalicMetrics={lineHeight:1.2,lineGap:.2},MyriadProRegularFactors=[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],MyriadProRegularMetrics={lineHeight:1.2,lineGap:.2},SegoeuiBoldFactors=[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],SegoeuiBoldMetrics={lineHeight:1.33008,lineGap:0},SegoeuiBoldItalicFactors=[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],SegoeuiBoldItalicMetrics={lineHeight:1.33008,lineGap:0},SegoeuiItalicFactors=[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],SegoeuiItalicMetrics={lineHeight:1.33008,lineGap:0},SegoeuiRegularFactors=[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],SegoeuiRegularMetrics={lineHeight:1.33008,lineGap:0},getXFAFontMap=getLookupTableFactory(function(t){t["MyriadPro-Regular"]=t["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:MyriadProRegularFactors,baseWidths:LiberationSansRegularWidths,baseMapping:LiberationSansRegularMapping,metrics:MyriadProRegularMetrics},t["MyriadPro-Bold"]=t["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:MyriadProBoldFactors,baseWidths:LiberationSansBoldWidths,baseMapping:LiberationSansBoldMapping,metrics:MyriadProBoldMetrics},t["MyriadPro-It"]=t["MyriadPro-Italic"]=t["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:MyriadProItalicFactors,baseWidths:LiberationSansItalicWidths,baseMapping:LiberationSansItalicMapping,metrics:MyriadProItalicMetrics},t["MyriadPro-BoldIt"]=t["MyriadPro-BoldItalic"]=t["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:MyriadProBoldItalicFactors,baseWidths:LiberationSansBoldItalicWidths,baseMapping:LiberationSansBoldItalicMapping,metrics:MyriadProBoldItalicMetrics},t.ArialMT=t.Arial=t["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:LiberationSansRegularWidths,baseMapping:LiberationSansRegularMapping},t["Arial-BoldMT"]=t["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:LiberationSansBoldWidths,baseMapping:LiberationSansBoldMapping},t["Arial-ItalicMT"]=t["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:LiberationSansItalicWidths,baseMapping:LiberationSansItalicMapping},t["Arial-BoldItalicMT"]=t["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:LiberationSansBoldItalicWidths,baseMapping:LiberationSansBoldItalicMapping},t["Calibri-Regular"]={name:"LiberationSans-Regular",factors:CalibriRegularFactors,baseWidths:LiberationSansRegularWidths,baseMapping:LiberationSansRegularMapping,metrics:CalibriRegularMetrics},t["Calibri-Bold"]={name:"LiberationSans-Bold",factors:CalibriBoldFactors,baseWidths:LiberationSansBoldWidths,baseMapping:LiberationSansBoldMapping,metrics:CalibriBoldMetrics},t["Calibri-Italic"]={name:"LiberationSans-Italic",factors:CalibriItalicFactors,baseWidths:LiberationSansItalicWidths,baseMapping:LiberationSansItalicMapping,metrics:CalibriItalicMetrics},t["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:CalibriBoldItalicFactors,baseWidths:LiberationSansBoldItalicWidths,baseMapping:LiberationSansBoldItalicMapping,metrics:CalibriBoldItalicMetrics},t["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:SegoeuiRegularFactors,baseWidths:LiberationSansRegularWidths,baseMapping:LiberationSansRegularMapping,metrics:SegoeuiRegularMetrics},t["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:SegoeuiBoldFactors,baseWidths:LiberationSansBoldWidths,baseMapping:LiberationSansBoldMapping,metrics:SegoeuiBoldMetrics},t["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:SegoeuiItalicFactors,baseWidths:LiberationSansItalicWidths,baseMapping:LiberationSansItalicMapping,metrics:SegoeuiItalicMetrics},t["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:SegoeuiBoldItalicFactors,baseWidths:LiberationSansBoldItalicWidths,baseMapping:LiberationSansBoldItalicMapping,metrics:SegoeuiBoldItalicMetrics},t["Helvetica-Regular"]=t.Helvetica={name:"LiberationSans-Regular",factors:HelveticaRegularFactors,baseWidths:LiberationSansRegularWidths,baseMapping:LiberationSansRegularMapping,metrics:HelveticaRegularMetrics},t["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:HelveticaBoldFactors,baseWidths:LiberationSansBoldWidths,baseMapping:LiberationSansBoldMapping,metrics:HelveticaBoldMetrics},t["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:HelveticaItalicFactors,baseWidths:LiberationSansItalicWidths,baseMapping:LiberationSansItalicMapping,metrics:HelveticaItalicMetrics},t["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:HelveticaBoldItalicFactors,baseWidths:LiberationSansBoldItalicWidths,baseMapping:LiberationSansBoldItalicMapping,metrics:HelveticaBoldItalicMetrics}});function getXfaFontName(name){name=normalizeFontName(name);return getXFAFontMap()[name]}function getXfaFontWidths(name){name=getXfaFontName(name);if(!name)return null;var currentArray,unicode,glyphIndex,{baseWidths:name,baseMapping,factors}=name,rescaledBaseWidths=factors?name.map((w,i)=>w*factors[i]):name,currentCode=-2,newWidths=[];for([unicode,glyphIndex]of baseMapping.map((charUnicode,index)=>[charUnicode,index]).sort((_ref23,_ref24)=>{var[_ref23]=_ref23,[_ref24]=_ref24;return _ref23-_ref24}))-1!==unicode&&(unicode===currentCode+1?(currentArray.push(rescaledBaseWidths[glyphIndex]),currentCode+=1):(currentCode=unicode,currentArray=[rescaledBaseWidths[glyphIndex]],newWidths.push(unicode,currentArray)));return newWidths}function getXfaFontDict(name){var widths=getXfaFontWidths(name),dict=new Dict(null),name=(dict.set("BaseFont",Name.get(name)),dict.set("Type",Name.get("Font")),dict.set("Subtype",Name.get("CIDFontType2")),dict.set("Encoding",Name.get("Identity-H")),dict.set("CIDToGIDMap",Name.get("Identity")),dict.set("W",widths),dict.set("FirstChar",widths[0]),dict.set("LastChar",widths.at(-2)+widths.at(-1).length-1),new Dict(null)),widths=(dict.set("FontDescriptor",name),new Dict(null));return widths.set("Ordering","Identity"),widths.set("Registry","Adobe"),widths.set("Supplement",0),dict.set("CIDSystemInfo",widths),dict}class PostScriptParser{constructor(lexer){this.lexer=lexer,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(type){return this.token.type===type&&(this.nextToken(),!0)}expect(type){if(this.accept(type))return!0;throw new FormatError("Unexpected symbol: found ".concat(this.token.type," expected ").concat(type,"."))}parse(){return this.nextToken(),this.expect(PostScriptTokenTypes.LBRACE),this.parseBlock(),this.expect(PostScriptTokenTypes.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(PostScriptTokenTypes.NUMBER))this.operators.push(this.prev.value);else if(this.accept(PostScriptTokenTypes.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(PostScriptTokenTypes.LBRACE))return;this.parseCondition()}}parseCondition(){var conditionLocation=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(PostScriptTokenTypes.RBRACE),this.accept(PostScriptTokenTypes.IF))this.operators[conditionLocation]=this.operators.length;else{if(!this.accept(PostScriptTokenTypes.LBRACE))throw new FormatError("PS Function: error parsing conditional.");var jumpLocation=this.operators.length,endOfTrue=(this.operators.push(null,null),this.operators.length);this.parseBlock(),this.expect(PostScriptTokenTypes.RBRACE),this.expect(PostScriptTokenTypes.IFELSE),this.operators[jumpLocation]=this.operators.length,this.operators[jumpLocation+1]="j",this.operators[conditionLocation]=endOfTrue}this.operators[conditionLocation+1]="jz"}}var PostScriptTokenTypes={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(type,value){this.type=type,this.value=value}static getOperator(op){var _PostScriptToken$opCa;return(_PostScriptToken$opCa=PostScriptToken.opCache)[op]||(_PostScriptToken$opCa[op]=new PostScriptToken(PostScriptTokenTypes.OPERATOR,op))}static get LBRACE(){return shadow(this,"LBRACE",new PostScriptToken(PostScriptTokenTypes.LBRACE,"{"))}static get RBRACE(){return shadow(this,"RBRACE",new PostScriptToken(PostScriptTokenTypes.RBRACE,"}"))}static get IF(){return shadow(this,"IF",new PostScriptToken(PostScriptTokenTypes.IF,"IF"))}static get IFELSE(){return shadow(this,"IFELSE",new PostScriptToken(PostScriptTokenTypes.IFELSE,"IFELSE"))}}class PostScriptLexer{constructor(stream){this.stream=stream,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){for(var comment=!1,ch=this.currentChar;;){if(ch<0)return EOF;if(comment)10!==ch&&13!==ch||(comment=!1);else if(37===ch)comment=!0;else if(!isWhiteSpace(ch))break;ch=this.nextChar()}switch(0|ch){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(PostScriptTokenTypes.NUMBER,this.getNumber());case 123:return this.nextChar(),PostScriptToken.LBRACE;case 125:return this.nextChar(),PostScriptToken.RBRACE}var strBuf=this.strBuf;for(strBuf.length=0,strBuf[0]=String.fromCharCode(ch);0<=(ch=this.nextChar())&&(65<=ch&&ch<=90||97<=ch&&ch<=122);)strBuf.push(String.fromCharCode(ch));var str=strBuf.join("");switch(str.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(str)}}getNumber(){var ch=this.currentChar,strBuf=this.strBuf;for(strBuf.length=0,strBuf[0]=String.fromCharCode(ch);0<=(ch=this.nextChar())&&(48<=ch&&ch<=57||45===ch||46===ch);)strBuf.push(String.fromCharCode(ch));var value=parseFloat(strBuf.join(""));if(isNaN(value))throw new FormatError("Invalid floating point number: ".concat(value));return value}}class BaseLocalCache{constructor(options){this._onlyRefs=!0===(null==options?void 0:options.onlyRefs),this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new RefSetCache}getByName(name){this._onlyRefs&&unreachable("Should not call `getByName` method.");var ref=this._nameRefMap.get(name);return ref?this.getByRef(ref):this._imageMap.get(name)||null}getByRef(ref){return this._imageCache.get(ref)||null}set(name,ref,data){unreachable("Abstract method `set` called.")}}class LocalImageCache extends BaseLocalCache{set(name){var ref=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,data=2<arguments.length?arguments[2]:void 0;if("string"!=typeof name)throw new Error('LocalImageCache.set - expected "name" argument.');if(ref)return this._imageCache.has(ref)?void 0:(this._nameRefMap.set(name,ref),void this._imageCache.put(ref,data));this._imageMap.has(name)||this._imageMap.set(name,data)}}class LocalColorSpaceCache extends BaseLocalCache{set(){var name=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,ref=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,data=2<arguments.length?arguments[2]:void 0;if("string"!=typeof name&&!ref)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(ref)return this._imageCache.has(ref)?void 0:(null!==name&&this._nameRefMap.set(name,ref),void this._imageCache.put(ref,data));this._imageMap.has(name)||this._imageMap.set(name,data)}}class LocalFunctionCache extends BaseLocalCache{constructor(options){super({onlyRefs:!0})}set(){var ref=1<arguments.length?arguments[1]:void 0,data=2<arguments.length?arguments[2]:void 0;if(!ref)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(ref)||this._imageCache.put(ref,data)}}class LocalGStateCache extends BaseLocalCache{set(name){var ref=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,data=2<arguments.length?arguments[2]:void 0;if("string"!=typeof name)throw new Error('LocalGStateCache.set - expected "name" argument.');if(ref)return this._imageCache.has(ref)?void 0:(this._nameRefMap.set(name,ref),void this._imageCache.put(ref,data));this._imageMap.has(name)||this._imageMap.set(name,data)}}class LocalTilingPatternCache extends BaseLocalCache{constructor(options){super({onlyRefs:!0})}set(){var ref=1<arguments.length?arguments[1]:void 0,data=2<arguments.length?arguments[2]:void 0;if(!ref)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(ref)||this._imageCache.put(ref,data)}}class RegionalImageCache extends BaseLocalCache{constructor(options){super({onlyRefs:!0})}set(){var ref=1<arguments.length?arguments[1]:void 0,data=2<arguments.length?arguments[2]:void 0;if(!ref)throw new Error('RegionalImageCache.set - expected "ref" argument.');this._imageCache.has(ref)||this._imageCache.put(ref,data)}}class GlobalColorSpaceCache extends BaseLocalCache{constructor(options){super({onlyRefs:!0})}set(){var ref=1<arguments.length?arguments[1]:void 0,data=2<arguments.length?arguments[2]:void 0;if(!ref)throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');this._imageCache.has(ref)||this._imageCache.put(ref,data)}clear(){this._imageCache.clear()}}var _decodeFailedSet=new WeakMap,_GlobalImageCache_brand=new WeakSet;class GlobalImageCache{constructor(){_classPrivateMethodInitSpec(this,_GlobalImageCache_brand),_classPrivateFieldInitSpec(this,_decodeFailedSet,new RefSet),this._refCache=new RefSetCache,this._imageCache=new RefSetCache}shouldCache(ref,pageIndex){var pageIndexSet=this._refCache.get(ref);return pageIndexSet||(pageIndexSet=new Set,this._refCache.put(ref,pageIndexSet)),pageIndexSet.add(pageIndex),!(pageIndexSet.size<GlobalImageCache.NUM_PAGES_THRESHOLD||!this._imageCache.has(ref)&&_classPrivateGetter(_GlobalImageCache_brand,this,_get_cacheLimitReached))}addDecodeFailed(ref){_classPrivateFieldGet(_decodeFailedSet,this).put(ref)}hasDecodeFailed(ref){return _classPrivateFieldGet(_decodeFailedSet,this).has(ref)}addByteSize(ref,byteSize){ref=this._imageCache.get(ref);ref&&!ref.byteSize&&(ref.byteSize=byteSize)}getData(ref,pageIndex){var pageIndexSet=this._refCache.get(ref);return pageIndexSet&&!(pageIndexSet.size<GlobalImageCache.NUM_PAGES_THRESHOLD)&&(ref=this._imageCache.get(ref))?(pageIndexSet.add(pageIndex),ref):null}setData(ref,data){if(!this._refCache.has(ref))throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');this._imageCache.has(ref)||(_classPrivateGetter(_GlobalImageCache_brand,this,_get_cacheLimitReached)?warn("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(ref,data))}clear(){0<arguments.length&&void 0!==arguments[0]&&arguments[0]||(_classPrivateFieldGet(_decodeFailedSet,this).clear(),this._refCache.clear()),this._imageCache.clear()}}function _get_byteSize(_this){var imageData,byteSize=0;for(imageData of _this._imageCache)byteSize+=imageData.byteSize;return byteSize}function _get_cacheLimitReached(_this2){return!(_this2._imageCache.size<_GlobalImageCache.MIN_IMAGES_TO_CACHE||_classPrivateGetter(_GlobalImageCache_brand,_this2,_get_byteSize)<_GlobalImageCache.MAX_BYTE_SIZE)}_defineProperty(_GlobalImageCache=GlobalImageCache,"NUM_PAGES_THRESHOLD",2),_defineProperty(GlobalImageCache,"MIN_IMAGES_TO_CACHE",10),_defineProperty(GlobalImageCache,"MAX_BYTE_SIZE",5e7);class PDFFunctionFactory{constructor(_ref25){var{xref:_ref25,isEvalSupported=!0}=_ref25;this.xref=_ref25,this.isEvalSupported=!1!==isEvalSupported}create(fn){var parsedFn,fnRef,parseArray=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(fn instanceof Ref?fnRef=fn:fn instanceof Dict?fnRef=fn.objId:fn instanceof BaseStream&&(fnRef=null==(_fn$dict=fn.dict)?void 0:_fn$dict.objId),fnRef){var _fn$dict=this._localFunctionCache.getByRef(fnRef);if(_fn$dict)return _fn$dict}_fn$dict=this.xref.fetchIfRef(fn);if(Array.isArray(_fn$dict)){if(!parseArray)throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');parsedFn=PDFFunction.parseArray(this,_fn$dict)}else parsedFn=PDFFunction.parse(this,_fn$dict);return fnRef&&this._localFunctionCache.set(null,fnRef,parsedFn),parsedFn}get _localFunctionCache(){return shadow(this,"_localFunctionCache",new LocalFunctionCache)}}function toNumberArray(arr){return Array.isArray(arr)?isNumberArray(arr,null)?arr:arr.map(x=>+x):null}class PDFFunction{static getSampleArray(size,outputSize,bps,stream){for(var length=1,i=0,ii=size.length;i<ii;i++)length*=size[i];length*=outputSize;var array=new Array(length),codeSize=0,codeBuf=0,sampleMul=1/(2**bps-1),strBytes=stream.getBytes((length*bps+7)/8),strIdx=0;for(i=0;i<length;i++){for(;codeSize<bps;)codeBuf=(codeBuf<<=8)|strBytes[strIdx++],codeSize+=8;codeSize-=bps,array[i]=(codeBuf>>codeSize)*sampleMul,codeBuf&=(1<<codeSize)-1}return array}static parse(factory,fn){var dict=fn.dict||fn;switch(dict.get("FunctionType")){case 0:return this.constructSampled(factory,fn,dict);case 1:break;case 2:return this.constructInterpolated(factory,dict);case 3:return this.constructStiched(factory,dict);case 4:return this.constructPostScript(factory,fn,dict)}throw new FormatError("Unknown type of function")}static parseArray(factory,fnObj){var fn,xref=factory["xref"],fnArray=[];for(fn of fnObj)fnArray.push(this.parse(factory,xref.fetchIfRef(fn)));return function(src,srcOffset,dest,destOffset){for(var i=0,ii=fnArray.length;i<ii;i++)fnArray[i](src,srcOffset,dest,destOffset+i)}}static constructSampled(factory,fn,dict){function toMultiArray(arr){for(var inputLength=arr.length,out=[],index=0,i=0;i<inputLength;i+=2)out[index++]=[arr[i],arr[i+1]];return out}function interpolate(x,xmin,xmax,ymin,ymax){return ymin+(ymax-ymin)/(xmax-xmin)*(x-xmin)}var domain=toNumberArray(dict.getArray("Domain")),range=toNumberArray(dict.getArray("Range"));if(!domain||!range)throw new FormatError("No domain or range");var inputSize=domain.length/2,outputSize=range.length/2,domain=toMultiArray(domain),range=toMultiArray(range),size=toNumberArray(dict.getArray("Size")),bps=dict.get("BitsPerSample"),order=dict.get("Order")||1;if(1!==order&&info("No support for cubic spline interpolation: "+order),encode=toNumberArray(dict.getArray("Encode")))encode=toMultiArray(encode);else for(var encode=[],i=0;i<inputSize;++i)encode.push([0,size[i]-1]);var decode=(decode=toNumberArray(dict.getArray("Decode")))?toMultiArray(decode):range,samples=this.getSampleArray(size,outputSize,bps,fn);return function(src,srcOffset,dest,destOffset){var cubeVertices=1<<inputSize,cubeN=new Float64Array(cubeVertices).fill(1),cubeVertex=new Uint32Array(cubeVertices),k=outputSize,pos=1;for(i=0;i<inputSize;++i){for(var domain_2i=domain[i][0],domain_2i_1=domain[i][1],domain_2i=interpolate(MathClamp(src[srcOffset+i],domain_2i,domain_2i_1),domain_2i,domain_2i_1,encode[i][0],encode[i][1]),domain_2i_1=size[i],e0=(domain_2i=MathClamp(domain_2i,0,domain_2i_1-1))<domain_2i_1-1?Math.floor(domain_2i):domain_2i-1,n0=e0+1-domain_2i,n1=domain_2i-e0,offset0=e0*k,offset1=offset0+k,j=0;j<cubeVertices;j++)j&pos?(cubeN[j]*=n1,cubeVertex[j]+=offset1):(cubeN[j]*=n0,cubeVertex[j]+=offset0);k*=domain_2i_1,pos<<=1}for(j=0;j<outputSize;++j){for(var rj=0,i=0;i<cubeVertices;i++)rj+=samples[cubeVertex[i]+j]*cubeN[i];rj=interpolate(rj,0,1,decode[j][0],decode[j][1]),dest[destOffset+j]=MathClamp(rj,range[j][0],range[j][1])}}}static constructInterpolated(factory,dict){for(var c0=toNumberArray(dict.getArray("C0"))||[0],c1=toNumberArray(dict.getArray("C1"))||[1],n=dict.get("N"),diff=[],i=0,ii=c0.length;i<ii;++i)diff.push(c1[i]-c0[i]);var length=diff.length;return function(src,srcOffset,dest,destOffset){for(var x=1===n?src[srcOffset]:src[srcOffset]**n,j=0;j<length;++j)dest[destOffset+j]=c0[j]+x*diff[j]}}static constructStiched(factory,dict){var domain=toNumberArray(dict.getArray("Domain"));if(!domain)throw new FormatError("No domain");if(1!=domain.length/2)throw new FormatError("Bad domain for stiched function");var fn,xref=factory["xref"],fns=[];for(fn of dict.get("Functions"))fns.push(this.parse(factory,xref.fetchIfRef(fn)));var bounds=toNumberArray(dict.getArray("Bounds")),encode=toNumberArray(dict.getArray("Encode")),tmpBuf=new Float32Array(1);return function(src,srcOffset,dest,destOffset){for(var v=MathClamp(src[srcOffset],domain[0],domain[1]),length=bounds.length,i=0;i<length&&!(v<bounds[i]);++i);var src=domain[0],srcOffset=(0<i&&(src=bounds[i-1]),domain[1]),rmin=(i<bounds.length&&(srcOffset=bounds[i]),encode[2*i]),rmax=encode[2*i+1];tmpBuf[0]=src===srcOffset?rmin:rmin+(v-src)*(rmax-rmin)/(srcOffset-src),fns[i](tmpBuf,0,dest,destOffset)}}static constructPostScript(factory,fn,dict){var domain=toNumberArray(dict.getArray("Domain")),range=toNumberArray(dict.getArray("Range"));if(!domain)throw new FormatError("No domain.");if(!range)throw new FormatError("No range.");dict=new PostScriptLexer(fn),fn=new PostScriptParser(dict).parse();if(factory.isEvalSupported&&FeatureTest.isEvalSupported){dict=(new PostScriptCompiler).compile(fn,domain,range);if(dict)return new Function("src","srcOffset","dest","destOffset",dict)}info("Unable to compile PS function");var numOutputs=range.length>>1,numInputs=domain.length>>1,evaluator=new PostScriptEvaluator(fn),cache=Object.create(null),cache_available=8192,tmpBuf=new Float32Array(numInputs);return function(src,srcOffset,dest,destOffset){var key="",input=tmpBuf;for(i=0;i<numInputs;i++)value=src[srcOffset+i],key+=(input[i]=value)+"_";var cachedValue=cache[key];if(void 0!==cachedValue)dest.set(cachedValue,destOffset);else{for(var output=new Float32Array(numOutputs),stack=evaluator.execute(input),stackIndex=stack.length-numOutputs,i=0;i<numOutputs;i++){var value=stack[stackIndex+i],bound=range[2*i];(value<bound||(bound=range[2*i+1])<value)&&(value=bound),output[i]=value}0<cache_available&&(cache_available--,cache[key]=output),dest.set(output,destOffset)}}}}function isPDFFunction(v){var fnDict;if(v instanceof Dict)fnDict=v;else{if(!(v instanceof BaseStream))return!1;fnDict=v.dict}return fnDict.has("FunctionType")}class PostScriptStack{constructor(initialStack){this.stack=initialStack?Array.from(initialStack):[]}push(value){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(value)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(n){if(this.stack.length+n>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");for(var stack=this.stack,i=stack.length-n,j=n-1;0<=j;j--,i++)stack.push(stack[i])}index(n){this.push(this.stack[this.stack.length-n-1])}roll(n,p){for(var stack=this.stack,l=stack.length-n,r=stack.length-1,p=l+(p-Math.floor(p/n)*n),i=l,j=r;i<j;i++,j--){var t=stack[i];stack[i]=stack[j],stack[j]=t}for(var _i36=l,_j4=p-1;_i36<_j4;_i36++,_j4--){var _t=stack[_i36];stack[_i36]=stack[_j4],stack[_j4]=_t}for(var _i37=p,_j5=r;_i37<_j5;_i37++,_j5--){var _t2=stack[_i37];stack[_i37]=stack[_j5],stack[_j5]=_t2}}}_defineProperty(PostScriptStack,"MAX_STACK_SIZE",100);class PostScriptEvaluator{constructor(operators){this.operators=operators}execute(initialStack){for(var operator,a,b,stack=new PostScriptStack(initialStack),counter=0,operators=this.operators,length=operators.length;counter<length;)if("number"==typeof(operator=operators[counter++]))stack.push(operator);else switch(operator){case"jz":b=stack.pop(),(a=stack.pop())||(counter=b);break;case"j":counter=a=stack.pop();break;case"abs":a=stack.pop(),stack.push(Math.abs(a));break;case"add":b=stack.pop(),a=stack.pop(),stack.push(a+b);break;case"and":b=stack.pop(),"boolean"==typeof(a=stack.pop())&&"boolean"==typeof b?stack.push(a&&b):stack.push(a&b);break;case"atan":b=stack.pop(),a=stack.pop(),(a=Math.atan2(a,b)/Math.PI*180)<0&&(a+=360),stack.push(a);break;case"bitshift":b=stack.pop(),0<(a=stack.pop())?stack.push(a<<b):stack.push(a>>b);break;case"ceiling":a=stack.pop(),stack.push(Math.ceil(a));break;case"copy":a=stack.pop(),stack.copy(a);break;case"cos":a=stack.pop(),stack.push(Math.cos(a%360/180*Math.PI));break;case"cvi":a=0|stack.pop(),stack.push(a);break;case"cvr":break;case"div":b=stack.pop(),a=stack.pop(),stack.push(a/b);break;case"dup":stack.copy(1);break;case"eq":b=stack.pop(),a=stack.pop(),stack.push(a===b);break;case"exch":stack.roll(2,1);break;case"exp":b=stack.pop(),a=stack.pop(),stack.push(a**b);break;case"false":stack.push(!1);break;case"floor":a=stack.pop(),stack.push(Math.floor(a));break;case"ge":b=stack.pop(),a=stack.pop(),stack.push(b<=a);break;case"gt":b=stack.pop(),a=stack.pop(),stack.push(b<a);break;case"idiv":b=stack.pop(),a=stack.pop(),stack.push(a/b|0);break;case"index":a=stack.pop(),stack.index(a);break;case"le":b=stack.pop(),a=stack.pop(),stack.push(a<=b);break;case"ln":a=stack.pop(),stack.push(Math.log(a));break;case"log":a=stack.pop(),stack.push(Math.log10(a));break;case"lt":b=stack.pop(),a=stack.pop(),stack.push(a<b);break;case"mod":b=stack.pop(),a=stack.pop(),stack.push(a%b);break;case"mul":b=stack.pop(),a=stack.pop(),stack.push(a*b);break;case"ne":b=stack.pop(),a=stack.pop(),stack.push(a!==b);break;case"neg":a=stack.pop(),stack.push(-a);break;case"not":"boolean"==typeof(a=stack.pop())?stack.push(!a):stack.push(~a);break;case"or":b=stack.pop(),"boolean"==typeof(a=stack.pop())&&"boolean"==typeof b?stack.push(a||b):stack.push(a|b);break;case"pop":stack.pop();break;case"roll":b=stack.pop(),a=stack.pop(),stack.roll(a,b);break;case"round":a=stack.pop(),stack.push(Math.round(a));break;case"sin":a=stack.pop(),stack.push(Math.sin(a%360/180*Math.PI));break;case"sqrt":a=stack.pop(),stack.push(Math.sqrt(a));break;case"sub":b=stack.pop(),a=stack.pop(),stack.push(a-b);break;case"true":stack.push(!0);break;case"truncate":a=(a=stack.pop())<0?Math.ceil(a):Math.floor(a),stack.push(a);break;case"xor":b=stack.pop(),"boolean"==typeof(a=stack.pop())&&"boolean"==typeof b?stack.push(a!==b):stack.push(a^b);break;default:throw new FormatError("Unknown operator ".concat(operator))}return stack.stack}}class AstNode{constructor(type){this.type=type}visit(visitor){unreachable("abstract method")}}class AstArgument extends AstNode{constructor(index,min,max){super("args"),this.index=index,this.min=min,this.max=max}visit(visitor){visitor.visitArgument(this)}}class AstLiteral extends AstNode{constructor(number){super("literal"),this.number=number,this.min=number,this.max=number}visit(visitor){visitor.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(op,arg1,arg2,min,max){super("binary"),this.op=op,this.arg1=arg1,this.arg2=arg2,this.min=min,this.max=max}visit(visitor){visitor.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(arg,max){super("max"),this.arg=arg,this.min=arg.min,this.max=max}visit(visitor){visitor.visitMin(this)}}class AstVariable extends AstNode{constructor(index,min,max){super("var"),this.index=index,this.min=min,this.max=max}visit(visitor){visitor.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(variable,arg){super("definition"),this.variable=variable,this.arg=arg}visit(visitor){visitor.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(arg){this.parts.push("Math.max(",arg.min,", Math.min(",arg.max,", src[srcOffset + ",arg.index,"]))")}visitVariable(variable){this.parts.push("v",variable.index)}visitLiteral(literal){this.parts.push(literal.number)}visitBinaryOperation(operation){this.parts.push("("),operation.arg1.visit(this),this.parts.push(" ",operation.op," "),operation.arg2.visit(this),this.parts.push(")")}visitVariableDefinition(definition){this.parts.push("var "),definition.variable.visit(this),this.parts.push(" = "),definition.arg.visit(this),this.parts.push(";")}visitMin(max){this.parts.push("Math.min("),max.arg.visit(this),this.parts.push(", ",max.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(num1,num2){return"literal"===num2.type&&0===num2.number?num1:"literal"===num1.type&&0===num1.number?num2:"literal"===num2.type&&"literal"===num1.type?new AstLiteral(num1.number+num2.number):new AstBinaryOperation("+",num1,num2,num1.min+num2.min,num1.max+num2.max)}function buildMulOperation(num1,num2){if("literal"===num2.type){if(0===num2.number)return new AstLiteral(0);if(1===num2.number)return num1;if("literal"===num1.type)return new AstLiteral(num1.number*num2.number)}if("literal"===num1.type){if(0===num1.number)return new AstLiteral(0);if(1===num1.number)return num2}var min=Math.min(num1.min*num2.min,num1.min*num2.max,num1.max*num2.min,num1.max*num2.max),max=Math.max(num1.min*num2.min,num1.min*num2.max,num1.max*num2.min,num1.max*num2.max);return new AstBinaryOperation("*",num1,num2,min,max)}function buildSubOperation(num1,num2){if("literal"===num2.type){if(0===num2.number)return num1;if("literal"===num1.type)return new AstLiteral(num1.number-num2.number)}return"binary"===num2.type&&"-"===num2.op&&"literal"===num1.type&&1===num1.number&&"literal"===num2.arg1.type&&1===num2.arg1.number?num2.arg2:new AstBinaryOperation("-",num1,num2,num1.min-num2.max,num1.max-num2.min)}function buildMinOperation(num1,max){return num1.min>=max?new AstLiteral(max):num1.max<=max?num1:new AstMin(num1,max)}class PostScriptCompiler{compile(code,domain,range){for(var n,num1,num2,ast1,ast2,tmpVar,item,stack=[],instructions=[],inputSize=domain.length>>1,outputSize=range.length>>1,lastRegister=0,i=0;i<inputSize;i++)stack.push(new AstArgument(i,domain[2*i],domain[2*i+1]));for(var _i38=0,ii=code.length;_i38<ii;_i38++)if("number"==typeof(item=code[_i38]))stack.push(new AstLiteral(item));else switch(item){case"add":if(stack.length<2)return null;num2=stack.pop(),num1=stack.pop(),stack.push(buildAddOperation(num1,num2));break;case"cvr":if(stack.length<1)return null;break;case"mul":if(stack.length<2)return null;num2=stack.pop(),num1=stack.pop(),stack.push(buildMulOperation(num1,num2));break;case"sub":if(stack.length<2)return null;num2=stack.pop(),num1=stack.pop(),stack.push(buildSubOperation(num1,num2));break;case"exch":if(stack.length<2)return null;ast1=stack.pop(),ast2=stack.pop(),stack.push(ast1,ast2);break;case"pop":if(stack.length<1)return null;stack.pop();break;case"index":if(stack.length<1)return null;if("literal"!==(num1=stack.pop()).type)return null;if((n=num1.number)<0||!Number.isInteger(n)||stack.length<n)return null;"literal"===(ast1=stack[stack.length-n-1]).type||"var"===ast1.type?stack.push(ast1):(tmpVar=new AstVariable(lastRegister++,ast1.min,ast1.max),stack[stack.length-n-1]=tmpVar,stack.push(tmpVar),instructions.push(new AstVariableDefinition(tmpVar,ast1)));break;case"dup":if(stack.length<1)return null;"number"==typeof code[_i38+1]&&"gt"===code[_i38+2]&&code[_i38+3]===_i38+7&&"jz"===code[_i38+4]&&"pop"===code[_i38+5]&&code[_i38+6]===code[_i38+1]?(num1=stack.pop(),stack.push(buildMinOperation(num1,code[_i38+1])),_i38+=6):"literal"===(ast1=stack.at(-1)).type||"var"===ast1.type?stack.push(ast1):(tmpVar=new AstVariable(lastRegister++,ast1.min,ast1.max),stack[stack.length-1]=tmpVar,stack.push(tmpVar),instructions.push(new AstVariableDefinition(tmpVar,ast1)));break;case"roll":if(stack.length<2)return null;if(num2=stack.pop(),num1=stack.pop(),"literal"!==num2.type||"literal"!==num1.type)return null;if(ast2=num2.number,(n=num1.number)<=0||!Number.isInteger(n)||!Number.isInteger(ast2)||stack.length<n)return null;0!=(ast2=(ast2%n+n)%n)&&stack.push(...stack.splice(stack.length-n,n-ast2));break;default:return null}if(stack.length!==outputSize)return null;var instruction,result=[];for(instruction of instructions){var statementBuilder=new ExpressionBuilderVisitor;instruction.visit(statementBuilder),result.push(statementBuilder.toString())}for(var _i39=0,_ii10=stack.length;_i39<_ii10;_i39++){var expr=stack[_i39],_statementBuilder=new ExpressionBuilderVisitor,min=(expr.visit(_statementBuilder),range[2*_i39]),max=range[2*_i39+1],_statementBuilder=[_statementBuilder.toString()];min>expr.min&&(_statementBuilder.unshift("Math.max(",min,", "),_statementBuilder.push(")")),max<expr.max&&(_statementBuilder.unshift("Math.min(",max,", "),_statementBuilder.push(")")),_statementBuilder.unshift("dest[destOffset + ",_i39,"] = "),_statementBuilder.push(";"),result.push(_statementBuilder.join(""))}return result.join("\n")}}var baseTypes=["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"],arabicTypes=["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(i){return 0!=(1&i)}function isEven(i){return 0==(1&i)}function findUnequal(arr,start,value){for(var j=start,jj=arr.length;j<jj;++j)if(arr[j]!==value)return j;return j}function reverseValues(arr,start,end){for(var i=start,j=end-1;i<j;++i,--j){var temp=arr[i];arr[i]=arr[j],arr[j]=temp}}function createBidiText(str,isLTR){var dir="ltr";return 2<arguments.length&&void 0!==arguments[2]&&arguments[2]?dir="ttb":isLTR||(dir="rtl"),{str:str,dir:dir}}var chars=[],types=[];function bidi(str){var startLevel=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,vertical=2<arguments.length&&void 0!==arguments[2]&&arguments[2],isLTR=!0,strLength=str.length;if(0===strLength||vertical)return createBidiText(str,isLTR,vertical);chars.length=strLength,types.length=strLength;var numBidi=0;for(i=0;i<strLength;++i){chars[i]=str.charAt(i);var charCode=str.charCodeAt(i),charType="L";charCode<=255?charType=baseTypes[charCode]:1424<=charCode&&charCode<=1524?charType="R":1536<=charCode&&charCode<=1791?(charType=arabicTypes[255&charCode])||warn("Bidi: invalid Unicode character "+charCode.toString(16)):(1792<=charCode&&charCode<=2220||64336<=charCode&&charCode<=65023||65136<=charCode&&charCode<=65279)&&(charType="AL"),"R"!==charType&&"AL"!==charType&&"AN"!==charType||numBidi++,types[i]=charType}if(0===numBidi)return createBidiText(str,isLTR=!0);-1===startLevel&&(startLevel=numBidi/strLength<.3&&4<strLength?(isLTR=!0,0):(isLTR=!1,1));var levels=[];for(i=0;i<strLength;++i)levels[i]=startLevel;var t,end,before,after,e=isOdd(startLevel)?"R":"L",sor=e,eor=sor,lastType=sor;for(i=0;i<strLength;++i)"NSM"===types[i]?types[i]=lastType:lastType=types[i];for(lastType=sor,i=0;i<strLength;++i)"EN"===(t=types[i])?types[i]="AL"===lastType?"AN":"EN":"R"!==t&&"L"!==t&&"AL"!==t||(lastType=t);for(i=0;i<strLength;++i)"AL"===(t=types[i])&&(types[i]="R");for(i=1;i<strLength-1;++i)"ES"===types[i]&&"EN"===types[i-1]&&"EN"===types[i+1]&&(types[i]="EN"),"CS"!==types[i]||"EN"!==types[i-1]&&"AN"!==types[i-1]||types[i+1]!==types[i-1]||(types[i]=types[i-1]);for(i=0;i<strLength;++i)if("EN"===types[i]){for(var j=i-1;0<=j&&"ET"===types[j];--j)types[j]="EN";for(var _j6=i+1;_j6<strLength&&"ET"===types[_j6];++_j6)types[_j6]="EN"}for(i=0;i<strLength;++i)"WS"!==(t=types[i])&&"ES"!==t&&"ET"!==t&&"CS"!==t||(types[i]="ON");for(lastType=sor,i=0;i<strLength;++i)"EN"===(t=types[i])?types[i]="L"===lastType?"L":"EN":"R"!==t&&"L"!==t||(lastType=t);for(i=0;i<strLength;++i)"ON"===types[i]&&(end=findUnequal(types,i+1,"ON"),before=sor,after=eor,(before="L"!==(before=0<i?types[i-1]:before)?"R":before)===(after="L"!==(after=end+1<strLength?types[end+1]:eor)?"R":after)&&types.fill(before,i,end),i=end-1);for(i=0;i<strLength;++i)"ON"===types[i]&&(types[i]=e);for(i=0;i<strLength;++i)t=types[i],isEven(levels[i])?"R"===t?levels[i]+=1:"AN"!==t&&"EN"!==t||(levels[i]+=2):"L"!==t&&"AN"!==t&&"EN"!==t||(levels[i]+=1);var level,highestLevel=-1,lowestOddLevel=99;for(i=0,ii=levels.length;i<ii;++i)highestLevel<(level=levels[i])&&(highestLevel=level),level<lowestOddLevel&&isOdd(level)&&(lowestOddLevel=level);for(level=highestLevel;lowestOddLevel<=level;--level){for(var start=-1,i=0,ii=levels.length;i<ii;++i)levels[i]<level?0<=start&&(reverseValues(chars,start,i),start=-1):start<0&&(start=i);0<=start&&reverseValues(chars,start,levels.length)}for(i=0,ii=chars.length;i<ii;++i){var _ch2=chars[i];"<"!==_ch2&&">"!==_ch2||(chars[i]="")}return createBidiText(chars.join(""),isLTR)}var NORMAL={style:"normal",weight:"normal"},BOLD={style:"normal",weight:"bold"},ITALIC={style:"italic",weight:"normal"},BOLDITALIC={style:"italic",weight:"bold"},substitutionMap=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:NORMAL,ultimate:"serif"}],["Times-Bold",{alias:"Times-Roman",style:BOLD,ultimate:"serif"}],["Times-Italic",{alias:"Times-Roman",style:ITALIC,ultimate:"serif"}],["Times-BoldItalic",{alias:"Times-Roman",style:BOLDITALIC,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:NORMAL,ultimate:"sans-serif"}],["Helvetica-Bold",{alias:"Helvetica",path:"LiberationSans-Bold.ttf",style:BOLD,ultimate:"sans-serif"}],["Helvetica-Oblique",{alias:"Helvetica",path:"LiberationSans-Italic.ttf",style:ITALIC,ultimate:"sans-serif"}],["Helvetica-BoldOblique",{alias:"Helvetica",path:"LiberationSans-BoldItalic.ttf",style:BOLDITALIC,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:NORMAL,ultimate:"monospace"}],["Courier-Bold",{alias:"Courier",style:BOLD,ultimate:"monospace"}],["Courier-Oblique",{alias:"Courier",style:ITALIC,ultimate:"monospace"}],["Courier-BoldOblique",{alias:"Courier",style:BOLDITALIC,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:NORMAL,fallback:"Helvetica"}],["ArialNarrow-Bold",{alias:"ArialNarrow",style:BOLD,fallback:"Helvetica-Bold"}],["ArialNarrow-Italic",{alias:"ArialNarrow",style:ITALIC,fallback:"Helvetica-Oblique"}],["ArialNarrow-BoldItalic",{alias:"ArialNarrow",style:BOLDITALIC,fallback:"Helvetica-BoldOblique"}],["Calibri",{local:["Calibri","Carlito"],style:NORMAL,fallback:"Helvetica"}],["Calibri-Bold",{alias:"Calibri",style:BOLD,fallback:"Helvetica-Bold"}],["Calibri-Italic",{alias:"Calibri",style:ITALIC,fallback:"Helvetica-Oblique"}],["Calibri-BoldItalic",{alias:"Calibri",style:BOLDITALIC,fallback:"Helvetica-BoldOblique"}],["Wingdings",{local:["Wingdings","URW Dingbats"],style:NORMAL}],["Wingdings-Regular",{alias:"Wingdings"}],["Wingdings-Bold",{alias:"Wingdings"}]]),fontAliases=new Map([["Arial-Black","ArialBlack"]]);function getStyleToAppend(style){switch(style){case BOLD:return"Bold";case ITALIC:return"Italic";case BOLDITALIC:return"Bold Italic";default:if("bold"===(null==style?void 0:style.weight))return"Bold";if("italic"===(null==style?void 0:style.style))return"Italic"}return""}function getFamilyName(str){var keywords=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 str.split(/[- ,+]+/g).filter(tok=>!keywords.has(tok.toLowerCase())).join(" ")}function generateFont(_ref26,src,localFontPath){var{alias,local,path,fallback,style,ultimate}=_ref26,useFallback=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],usePath=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],append=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"",result={style:null,ultimate:null};if(local){var name,extra=append?" ".concat(append):"";for(name of local)src.push("local(".concat(name).concat(extra,")"))}return alias&&(local=substitutionMap.get(alias),alias=append||getStyleToAppend(style),Object.assign(result,generateFont(local,src,localFontPath,useFallback&&!fallback,usePath&&!path,alias))),style&&(result.style=style),ultimate&&(result.ultimate=ultimate),useFallback&&fallback&&(local=generateFont(substitutionMap.get(fallback),src,localFontPath,useFallback,usePath&&!path,append)["ultimate"],result.ultimate||(result.ultimate=local)),usePath&&path&&localFontPath&&src.push("url(".concat(localFontPath).concat(path,")")),result}function getFontSubstitution(systemFontCache,idFactory,localFontPath,baseFontName,standardFontName,type){if(baseFontName.startsWith("InvalidPDFjsFont_"))return null;var type=baseFontName=normalizeFontName(baseFontName="TrueType"!==type&&"Type1"!==type||!/^[A-Z]{6}\+/.test(baseFontName)?baseFontName:baseFontName.slice(7)),substitutionInfo=systemFontCache.get(type);if(!substitutionInfo){var substitution=substitutionMap.get(baseFontName);if(!substitution)for(var[alias,subst]of fontAliases)if(baseFontName.startsWith(alias)){baseFontName="".concat(subst).concat(baseFontName.substring(alias.length)),substitution=substitutionMap.get(baseFontName);break}var mustAddBaseFont=!1,standardFontName=(substitution||(substitution=substitutionMap.get(standardFontName),mustAddBaseFont=!0),"".concat(idFactory.getDocId(),"_s").concat(idFactory.createFontId()));if(!substitution)return validateFontName(baseFontName)?(idFactory=/bold/gi.test(baseFontName),italic=/oblique|italic/gi.test(baseFontName),idFactory=idFactory&&italic&&BOLDITALIC||idFactory&&BOLD||italic&&ITALIC||NORMAL,substitutionInfo={css:'"'.concat(getFamilyName(baseFontName),'",').concat(standardFontName),guessFallback:!0,loadedName:standardFontName,baseFontName:baseFontName,src:"local(".concat(baseFontName,")"),style:idFactory},systemFontCache.set(type,substitutionInfo),substitutionInfo):(warn("Cannot substitute the font because of its name: ".concat(baseFontName)),systemFontCache.set(type,null),null);var italic=[],{style:idFactory,ultimate:mustAddBaseFont}=(mustAddBaseFont&&validateFontName(baseFontName)&&italic.push("local(".concat(baseFontName,")")),generateFont(substitution,italic,localFontPath)),localFontPath=null===mustAddBaseFont,mustAddBaseFont=localFontPath?"":",".concat(mustAddBaseFont);substitutionInfo={css:'"'.concat(getFamilyName(baseFontName),'",').concat(standardFontName).concat(mustAddBaseFont),guessFallback:localFontPath,loadedName:standardFontName,baseFontName:baseFontName,src:italic.join(","),style:idFactory},systemFontCache.set(type,substitutionInfo)}return substitutionInfo}var SEED=3285377520,MASK_HIGH=4294901760,MASK_LOW=65535;class MurmurHash3_64{constructor(seed){this.h1=seed?4294967295&seed:SEED,this.h2=seed?4294967295&seed:SEED}update(input){if("string"==typeof input)for(var data=new Uint8Array(2*input.length),length=0,i=0,ii=input.length;i<ii;i++){var code=input.charCodeAt(i);code<=255?data[length++]=code:(data[length++]=code>>>8,data[length++]=255&code)}else{if(!ArrayBuffer.isView(input))throw new Error("Invalid data format, must be a string or TypedArray.");length=(data=input.slice()).byteLength}for(var k2,blockCounts=length>>2,tailLength=length-4*blockCounts,dataUint32=new Uint32Array(data.buffer,0,blockCounts),k1=0,h1=this.h1,h2=this.h2,C1=3432918353,C2=461845907,C1_LOW=C1&MASK_LOW,C2_LOW=C2&MASK_LOW,_i40=0;_i40<blockCounts;_i40++)1&_i40?h1=5*(h1=(h1^=k1=(k1=(k1=(k1=dataUint32[_i40])*C1&MASK_HIGH|k1*C1_LOW&MASK_LOW)<<15|k1>>>17)*C2&MASK_HIGH|k1*C2_LOW&MASK_LOW)<<13|h1>>>19)+3864292196:h2=5*(h2=(h2^=(k2=(k2=(k2=dataUint32[_i40])*C1&MASK_HIGH|k2*C1_LOW&MASK_LOW)<<15|k2>>>17)*C2&MASK_HIGH|k2*C2_LOW&MASK_LOW)<<13|h2>>>19)+3864292196;switch(k1=0,tailLength){case 3:k1^=data[4*blockCounts+2]<<16;case 2:k1^=data[4*blockCounts+1]<<8;case 1:k1=(k1=(k1=(k1^=data[4*blockCounts])*C1&MASK_HIGH|k1*C1_LOW&MASK_LOW)<<15|k1>>>17)*C2&MASK_HIGH|k1*C2_LOW&MASK_LOW,1&blockCounts?h1^=k1:h2^=k1}this.h1=h1,this.h2=h2}hexdigest(){var h1=this.h1,h2=this.h2,h1=3981806797*(h1^=h2>>>1)&MASK_HIGH|36045*h1&MASK_LOW;return h1=444984403*(h1^=(h2=4283543511*h2&MASK_HIGH|(2950163797*(h2<<16|h1>>>16)&MASK_HIGH)>>>16)>>>1)&MASK_HIGH|60499*h1&MASK_LOW,((h1^=(h2=3301882366*h2&MASK_HIGH|(3120437893*(h2<<16|h1>>>16)&MASK_HIGH)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(h2>>>0).toString(16).padStart(8,"0")}}function resizeImageMask(src,bpc,w1,h1,w2,h2){for(var j,py,oldIndex,length=w2*h2,dest=new(bpc<=8?Uint8Array:bpc<=16?Uint16Array:Uint32Array)(length),xRatio=w1/w2,yRatio=h1/h2,newIndex=0,xScaled=new Uint16Array(w2),w1Scanline=w1,i=0;i<w2;i++)xScaled[i]=Math.floor(i*xRatio);for(i=0;i<h2;i++)for(py=Math.floor(i*yRatio)*w1Scanline,j=0;j<w2;j++)oldIndex=py+xScaled[j],dest[newIndex++]=src[oldIndex];return dest}var _PDFImage_brand=new WeakSet;class PDFImage{constructor(_ref27){var{xref:_ref27,res,image,isInline=!1,smask=null,mask=null,isMask=!1,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache}=_ref27,dict=(_classPrivateMethodInitSpec(this,_PDFImage_brand),(this.image=image).dict),filter=dict.get("F","Filter");switch(filter instanceof Name?filterName=filter.name:Array.isArray(filter)&&(filter=_ref27.fetchIfRef(filter[0]))instanceof Name&&(filterName=filter.name),filterName){case"JPXDecode":({width:image.width,height:image.height,componentsCount:image.numComps,bitsPerComponent:image.bitsPerComponent}=JpxImage.parseImageProperties(image.stream)),image.stream.reset();var reducePower=ImageResizer.getReducePowerForJPX(image.width,image.height,image.numComps);this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:dict.has("SMaskInData"),reducePower:reducePower},reducePower&&(reducePower=2**reducePower,image.width=Math.ceil(image.width/reducePower),image.height=Math.ceil(image.height/reducePower));break;case"JBIG2Decode":image.bitsPerComponent=1,image.numComps=1}var filter=dict.get("W","Width"),filterName=dict.get("H","Height");if(Number.isInteger(image.width)&&0<image.width&&Number.isInteger(image.height)&&0<image.height&&(image.width!==filter||image.height!==filterName))warn("PDFImage - using the Width/Height of the image data, rather than the image dictionary."),filter=image.width,filterName=image.height;else{var validWidth="number"==typeof filter&&0<filter,validHeight="number"==typeof filterName&&0<filterName;if(!validWidth||!validHeight){if(!image.fallbackDims)throw new FormatError("Invalid image width: ".concat(filter," or height: ").concat(filterName));warn("PDFImage - using the Width/Height of the parent image, for SMask/Mask data."),validWidth||(filter=image.fallbackDims.width),validHeight||(filterName=image.fallbackDims.height)}}this.width=filter,this.height=filterName,this.interpolate=dict.get("I","Interpolate"),this.imageMask=dict.get("IM","ImageMask")||!1,this.matte=dict.get("Matte")||!1;validWidth=image.bitsPerComponent;if(!validWidth&&!(validWidth=dict.get("BPC","BitsPerComponent"))){if(!this.imageMask)throw new FormatError("Bits per component missing in image: ".concat(this.imageMask));validWidth=1}if(this.bpc=validWidth,!this.imageMask){var colorSpace=dict.getRaw("CS")||dict.getRaw("ColorSpace"),validHeight=!!colorSpace;if(validHeight)null!=(_this$jpxDecoderOptio=this.jpxDecoderOptions)&&_this$jpxDecoderOptio.smaskInData&&(colorSpace=Name.get("DeviceRGBA"));else if(this.jpxDecoderOptions)colorSpace=Name.get("DeviceRGBA");else switch(image.numComps){case 1:colorSpace=Name.get("DeviceGray");break;case 3:colorSpace=Name.get("DeviceRGB");break;case 4:colorSpace=Name.get("DeviceCMYK");break;default:throw new Error("Images with ".concat(image.numComps," color components not supported."))}this.colorSpace=ColorSpaceUtils.parse({cs:colorSpace,xref:_ref27,resources:isInline?res:null,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache}),this.numComps=this.colorSpace.numComps,this.jpxDecoderOptions&&(this.jpxDecoderOptions.numComponents=validHeight?this.numComps:0,this.jpxDecoderOptions.isIndexedColormap="Indexed"===this.colorSpace.name)}if(this.decode=dict.getArray("D","Decode"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,validWidth)||isMask&&!ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;for(var _this$jpxDecoderOptio,max=(1<<validWidth)-1,isIndexed=(this.decodeCoefficients=[],this.decodeAddends=[],"Indexed"===(null==(_this$jpxDecoderOptio=this.colorSpace)?void 0:_this$jpxDecoderOptio.name)),i=0,j=0;i<this.decode.length;i+=2,++j){var dmin=this.decode[i],dmax=this.decode[i+1];this.decodeCoefficients[j]=isIndexed?(dmax-dmin)/max:dmax-dmin,this.decodeAddends[j]=isIndexed?dmin:max*dmin}}smask?(null==smask.fallbackDims&&(smask.fallbackDims={width:filter,height:filterName}),this.smask=new PDFImage({xref:_ref27,res:res,image:smask,isInline:isInline,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache})):mask&&(mask instanceof BaseStream?mask.dict.get("IM","ImageMask")?(null==mask.fallbackDims&&(mask.fallbackDims={width:filter,height:filterName}),this.mask=new PDFImage({xref:_ref27,res:res,image:mask,isInline:isInline,isMask:!0,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache})):warn("Ignoring /Mask in image without /ImageMask."):this.mask=mask)}static async buildImage(_ref28){var{xref:_ref28,res,image,isInline=!1,pdfFunctionFactory,globalColorSpaceCache,localColorSpaceCache}=_ref28,imageData=image,smaskData=null,maskData=null,smask=image.dict.get("SMask"),image=image.dict.get("Mask");return smask?smask instanceof BaseStream?smaskData=smask:warn("Unsupported /SMask format."):image&&(image instanceof BaseStream||Array.isArray(image)?maskData=image:warn("Unsupported /Mask format.")),new PDFImage({xref:_ref28,res:res,image:imageData,isInline:isInline,smask:smaskData,mask:maskData,pdfFunctionFactory:pdfFunctionFactory,globalColorSpaceCache:globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache})}static async createMask(_ref29){var imgData,{image:_ref29,isOffscreenCanvasSupported=!1}=_ref29,dict=_ref29["dict"],width=dict.get("W","Width"),height=dict.get("H","Height"),interpolate=dict.get("I","Interpolate"),dict=dict.getArray("D","Decode"),dict=0<(null==dict?void 0:dict[0]),computedLength=(width+7>>3)*height,imgArray=_ref29.getBytes(computedLength),isSingleOpaquePixel=1===width&&1===height&&dict==(0===imgArray.length||!!(128&imgArray[0]));if(isSingleOpaquePixel)return{isSingleOpaquePixel:isSingleOpaquePixel};if(isOffscreenCanvasSupported)return ImageResizer.needsToBeResized(width,height)?(convertBlackAndWhiteToRGBA({src:imgArray,dest:isSingleOpaquePixel=new Uint8ClampedArray(width*height*4),width:width,height:height,nonBlackColor:0,inverseDecode:dict}),ImageResizer.createImage({kind:ImageKind.RGBA_32BPP,data:isSingleOpaquePixel,width:width,height:height,interpolate:interpolate})):(convertBlackAndWhiteToRGBA({src:imgArray,dest:(imgData=(isSingleOpaquePixel=(isOffscreenCanvasSupported=new OffscreenCanvas(width,height)).getContext("2d")).createImageData(width,height)).data,width:width,height:height,nonBlackColor:0,inverseDecode:dict}),isSingleOpaquePixel.putImageData(imgData,0,0),{data:null,width:width,height:height,interpolate:interpolate,bitmap:isOffscreenCanvasSupported.transferToImageBitmap()});var data,actualLength=imgArray.byteLength,isSingleOpaquePixel=computedLength===actualLength;if(_ref29 instanceof DecodeStream&&(!dict||isSingleOpaquePixel)?data=imgArray:dict?((data=new Uint8Array(computedLength)).set(imgArray),data.fill(255,actualLength)):data=new Uint8Array(imgArray),dict)for(var i=0;i<actualLength;i++)data[i]^=255;return{data:data,width:width,height:height,interpolate:interpolate}}get drawWidth(){var _this$smask;return Math.max(this.width,(null==(_this$smask=this.smask)?void 0:_this$smask.width)||0,(null==(_this$smask=this.mask)?void 0:_this$smask.width)||0)}get drawHeight(){var _this$smask2;return Math.max(this.height,(null==(_this$smask2=this.smask)?void 0:_this$smask2.height)||0,(null==(_this$smask2=this.mask)?void 0:_this$smask2.height)||0)}decodeBuffer(buffer){var bpc=this.bpc,numComps=this.numComps,decodeAddends=this.decodeAddends,decodeCoefficients=this.decodeCoefficients,max=(1<<bpc)-1;if(1===bpc)for(i=0,ii=buffer.length;i<ii;i++)buffer[i]=+!buffer[i];else for(var index=0,i=0,ii=this.width*this.height;i<ii;i++)for(var j=0;j<numComps;j++)buffer[index]=MathClamp(decodeAddends[j]+buffer[index]*decodeCoefficients[j],0,max),index++}getComponents(buffer){var bpc=this.bpc;if(8===bpc)return buffer;var width=this.width,height=this.height,numComps=this.numComps,length=width*height*numComps,bufferPos=0,output=new(bpc<=8?Uint8Array:bpc<=16?Uint16Array:Uint32Array)(length),rowComps=width*numComps,max=(1<<bpc)-1,i=0;if(1===bpc)for(var mask,loop1End,loop2End,j=0;j<height;j++){for(loop1End=i+(-8&rowComps),loop2End=i+rowComps;i<loop1End;)buf=buffer[bufferPos++],output[i]=buf>>7&1,output[i+1]=buf>>6&1,output[i+2]=buf>>5&1,output[i+3]=buf>>4&1,output[i+4]=buf>>3&1,output[i+5]=buf>>2&1,output[i+6]=buf>>1&1,output[i+7]=1&buf,i+=8;if(i<loop2End)for(buf=buffer[bufferPos++],mask=128;i<loop2End;)output[i++]=+!!(buf&mask),mask>>=1}else for(var bits=0,buf=0,i=0,ii=length;i<ii;++i){for(i%rowComps==0&&(bits=buf=0);bits<bpc;)buf=buf<<8|buffer[bufferPos++],bits+=8;var remainingBits=bits-bpc,value=buf>>remainingBits;value<0?value=0:max<value&&(value=max),output[i]=value,buf&=(1<<remainingBits)-1,bits=remainingBits}return output}async fillOpacity(rgbaBuf,width,height,actualHeight,image){var sw,sh,smask=this.smask,mask=this.mask;if(smask)sw=smask.width,sh=smask.height,alphaBuf=new Uint8ClampedArray(sw*sh),await smask.fillGrayBuffer(alphaBuf),sw===width&&sh===height||(alphaBuf=resizeImageMask(alphaBuf,smask.bpc,sw,sh,width,height));else if(mask)if(mask instanceof PDFImage){for(sw=mask.width,sh=mask.height,alphaBuf=new Uint8ClampedArray(sw*sh),mask.numComps=1,await mask.fillGrayBuffer(alphaBuf),i=0,ii=sw*sh;i<ii;++i)alphaBuf[i]=255-alphaBuf[i];sw===width&&sh===height||(alphaBuf=resizeImageMask(alphaBuf,mask.bpc,sw,sh,width,height))}else{if(!Array.isArray(mask))throw new FormatError("Unknown mask format.");for(var alphaBuf=new Uint8ClampedArray(width*height),numComps=this.numComps,i=0,ii=width*height;i<ii;++i){for(var opacity=0,imageOffset=i*numComps,j=0;j<numComps;++j){var color=image[imageOffset+j],maskOffset=2*j;if(color<mask[maskOffset]||color>mask[1+maskOffset]){opacity=255;break}}alphaBuf[i]=opacity}}if(alphaBuf)for(i=0,j=3,ii=width*actualHeight;i<ii;++i,j+=4)rgbaBuf[j]=alphaBuf[i];else for(i=0,j=3,ii=width*actualHeight;i<ii;++i,j+=4)rgbaBuf[j]=255}undoPreblend(buffer,width,height){var _this$smask3=null==(_this$smask3=this.smask)?void 0:_this$smask3.matte;if(_this$smask3)for(var _this$smask3=this.colorSpace.getRgb(_this$smask3,0),matteR=_this$smask3[0],matteG=_this$smask3[1],matteB=_this$smask3[2],length=width*height*4,i=0;i<length;i+=4){var alpha=buffer[i+3];0===alpha?(buffer[i]=255,buffer[i+1]=255,buffer[i+2]=255):(buffer[i]=(buffer[i]-matteR)*(alpha=255/alpha)+matteR,buffer[i+1]=(buffer[i+1]-matteG)*alpha+matteG,buffer[i+2]=(buffer[i+2]-matteB)*alpha+matteB)}}async createImageData(){var forceRGBA=0<arguments.length&&void 0!==arguments[0]&&arguments[0],isOffscreenCanvasSupported=1<arguments.length&&void 0!==arguments[1]&&arguments[1],drawWidth=this.drawWidth,drawHeight=this.drawHeight,imgData={width:drawWidth,height:drawHeight,interpolate:this.interpolate,kind:0,data:null},numComps=this.numComps,originalWidth=this.width,originalHeight=this.height,bpc=this.bpc,numComps=originalWidth*numComps*bpc+7>>3,mustBeResized=isOffscreenCanvasSupported&&ImageResizer.needsToBeResized(drawWidth,drawHeight);if(!this.smask&&!this.mask&&"DeviceRGBA"===this.colorSpace.name)return imgData.kind=ImageKind.RGBA_32BPP,_imgArray=imgData.data=await this.getImageBytes(originalHeight*originalWidth*4,{}),isOffscreenCanvasSupported?mustBeResized?ImageResizer.createImage(imgData,!1):this.createBitmap(ImageKind.RGBA_32BPP,drawWidth,drawHeight,_imgArray):imgData;if(!forceRGBA){if("DeviceGray"===this.colorSpace.name&&1===bpc?kind=ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==bpc||this.needsDecode||(kind=ImageKind.RGB_24BPP),kind&&!this.smask&&!this.mask&&drawWidth===originalWidth&&drawHeight===originalHeight){var _imgArray=await _assertClassBrand(_PDFImage_brand,this,_getImage).call(this,originalWidth,originalHeight);if(_imgArray)return _imgArray;_imgArray=await this.getImageBytes(originalHeight*numComps,{});if(isOffscreenCanvasSupported)return mustBeResized?ImageResizer.createImage({data:_imgArray,kind:kind,width:drawWidth,height:drawHeight,interpolate:this.interpolate},this.needsDecode):this.createBitmap(kind,originalWidth,originalHeight,_imgArray);if(imgData.kind=kind,imgData.data=_imgArray,this.needsDecode){assert(kind===ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");for(var buffer=imgData.data,i=0,ii=buffer.length;i<ii;i++)buffer[i]^=255}return imgData}if(this.image instanceof JpegStream&&!this.smask&&!this.mask&&!this.needsDecode){var imageLength=originalHeight*numComps;if(isOffscreenCanvasSupported&&!mustBeResized){var isHandled=!1;switch(this.colorSpace.name){case"DeviceGray":imageLength*=4,isHandled=!0;break;case"DeviceRGB":imageLength=imageLength/3*4,isHandled=!0;break;case"DeviceCMYK":isHandled=!0}if(isHandled)return await _assertClassBrand(_PDFImage_brand,this,_getImage).call(this,drawWidth,drawHeight)||(_imgArray=await this.getImageBytes(imageLength,{drawWidth:drawWidth,drawHeight:drawHeight,forceRGBA:!0}),this.createBitmap(ImageKind.RGBA_32BPP,drawWidth,drawHeight,_imgArray))}else switch(this.colorSpace.name){case"DeviceGray":imageLength*=3;case"DeviceRGB":case"DeviceCMYK":return imgData.kind=ImageKind.RGB_24BPP,imgData.data=await this.getImageBytes(imageLength,{drawWidth:drawWidth,drawHeight:drawHeight,forceRGB:!0}),mustBeResized?ImageResizer.createImage(imgData):imgData}}}var canvas,ctx,canvasImgData,data,alpha01,maybeUndoPreblend,kind=await this.getImageBytes(originalHeight*numComps,{internal:!0}),_imgArray=0|kind.length/numComps*drawHeight/originalHeight,numComps=this.getComponents(kind);return isOffscreenCanvasSupported&&!mustBeResized&&(data=(canvasImgData=(ctx=(canvas=new OffscreenCanvas(drawWidth,drawHeight)).getContext("2d")).createImageData(drawWidth,drawHeight)).data),imgData.kind=ImageKind.RGBA_32BPP,forceRGBA||this.smask||this.mask?(isOffscreenCanvasSupported&&!mustBeResized||(data=new Uint8ClampedArray(drawWidth*drawHeight*4)),alpha01=1,maybeUndoPreblend=!0,await this.fillOpacity(data,drawWidth,drawHeight,_imgArray,numComps)):(alpha01=!isOffscreenCanvasSupported||mustBeResized?(imgData.kind=ImageKind.RGB_24BPP,data=new Uint8ClampedArray(drawWidth*drawHeight*3),0):(new Uint32Array(data.buffer).fill(FeatureTest.isLittleEndian?4278190080:255),1),maybeUndoPreblend=!1),this.needsDecode&&this.decodeBuffer(numComps),this.colorSpace.fillRgb(data,originalWidth,originalHeight,drawWidth,drawHeight,_imgArray,bpc,numComps,alpha01),maybeUndoPreblend&&this.undoPreblend(data,drawWidth,_imgArray),isOffscreenCanvasSupported&&!mustBeResized?(ctx.putImageData(canvasImgData,0,0),{data:null,width:drawWidth,height:drawHeight,bitmap:canvas.transferToImageBitmap(),interpolate:this.interpolate}):(imgData.data=data,mustBeResized?ImageResizer.createImage(imgData):imgData)}async fillGrayBuffer(buffer){var numComps=this.numComps;if(1!==numComps)throw new FormatError("Reading gray scale from a color image: ".concat(numComps));var width=this.width,height=this.height,bpc=this.bpc,numComps=await this.getImageBytes(height*(width*numComps*bpc+7>>3),{internal:!0}),comps=this.getComponents(numComps);if(1===bpc)if(length=width*height,this.needsDecode)for(i=0;i<length;++i)buffer[i]=comps[i]-1&255;else for(i=0;i<length;++i)buffer[i]=255&-comps[i];else{this.needsDecode&&this.decodeBuffer(comps);for(var length=width*height,scale=255/((1<<bpc)-1),i=0;i<length;++i)buffer[i]=scale*comps[i]}}createBitmap(kind,width,height,src){var imgData,canvas=new OffscreenCanvas(width,height),ctx=canvas.getContext("2d");return kind===ImageKind.RGBA_32BPP?imgData=new ImageData(src,width,height):(imgData=ctx.createImageData(width,height),convertToRGBA({kind:kind,src:src,dest:new Uint32Array(imgData.data.buffer),width:width,height:height,inverseDecode:this.needsDecode})),ctx.putImageData(imgData,0,0),{data:null,width:width,height:height,bitmap:canvas.transferToImageBitmap(),interpolate:this.interpolate}}async getImageBytes(length,_ref30){var{drawWidth:_ref30,drawHeight,forceRGBA=!1,forceRGB=!1,internal=!1}=_ref30,_ref30=(this.image.reset(),this.image.drawWidth=_ref30||this.width,this.image.drawHeight=drawHeight||this.height,this.image.forceRGBA=!!forceRGBA,this.image.forceRGB=!!forceRGB,await this.image.getImageData(length,this.jpxDecoderOptions));return internal||this.image instanceof DecodeStream?_ref30:(assert(_ref30 instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.'),new Uint8Array(_ref30))}}async function _getImage(width,height){var bitmap=await this.image.getTransferableImage();return bitmap?{data:null,width:width,height:height,bitmap:bitmap,interpolate:this.interpolate}:null}var DefaultPartialEvaluatorOptions=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}),PatternType={TILING:1,SHADING:2},TEXT_CHUNK_BATCH_SIZE=10,deferred=Promise.resolve();function normalizeBlendMode(value){var parsingArray=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(value)){for(var val of value){val=normalizeBlendMode(val,!0);if(val)return val}warn("Unsupported blend mode Array: ".concat(value))}else{if(!(value instanceof Name))return parsingArray?null:"source-over";switch(value.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(parsingArray)return null;warn("Unsupported blend mode: ".concat(value.name))}return"source-over"}function addCachedImageOps(opList,_ref31){var{objId:_ref31,fn,args,optionalContent,hasMask}=_ref31;_ref31&&opList.addDependency(_ref31),opList.addImageOps(fn,args,optionalContent,hasMask),fn===OPS.paintImageMaskXObject&&0<(null==(_ref31=args[0])?void 0:_ref31.count)&&args[0].count++}class TimeSlotManager{constructor(){this.reset()}check(){return!(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)&&(this.checked=0,this.endTime<=Date.now())}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS,this.checked=0}}_defineProperty(TimeSlotManager,"TIME_SLOT_DURATION_MS",20),_defineProperty(TimeSlotManager,"CHECK_TIME_EVERY",100);class PartialEvaluator{constructor(_ref32){var{xref:_ref32,handler,pageIndex,idFactory,fontCache,builtInCMapCache,standardFontDataCache,globalColorSpaceCache,globalImageCache,systemFontCache,options=null}=_ref32;this.xref=_ref32,this.handler=handler,this.pageIndex=pageIndex,this.idFactory=idFactory,this.fontCache=fontCache,this.builtInCMapCache=builtInCMapCache,this.standardFontDataCache=standardFontDataCache,this.globalColorSpaceCache=globalColorSpaceCache,this.globalImageCache=globalImageCache,this.systemFontCache=systemFontCache,this.options=options||DefaultPartialEvaluatorOptions,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(){var newOptions=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,newEvaluator=Object.create(this);return newEvaluator.options=Object.assign(Object.create(null),this.options,newOptions),newEvaluator}hasBlendModes(resources,nonBlendModesSet){if(resources instanceof Dict&&(!resources.objId||!nonBlendModesSet.has(resources.objId))){for(var ref,processed=new RefSet(nonBlendModesSet),nodes=(resources.objId&&processed.put(resources.objId),[resources]),xref=this.xref;nodes.length;){var node=nodes.shift(),graphicStates=node.get("ExtGState");if(graphicStates instanceof Dict)for(var graphicState of graphicStates.getRawValues()){if(graphicState instanceof Ref){if(processed.has(graphicState))continue;try{graphicState=xref.fetch(graphicState)}catch(ex){processed.put(graphicState),info('hasBlendModes - ignoring ExtGState: "'.concat(ex,'".'));continue}}if(graphicState instanceof Dict){graphicState.objId&&processed.put(graphicState.objId);graphicState=graphicState.get("BM");if(graphicState instanceof Name){if("Normal"!==graphicState.name)return!0}else if(void 0!==graphicState&&Array.isArray(graphicState))for(var element of graphicState)if(element instanceof Name&&"Normal"!==element.name)return!0}}graphicStates=node.get("XObject");if(graphicStates instanceof Dict)for(var xObject of graphicStates.getRawValues()){if(xObject instanceof Ref){if(processed.has(xObject))continue;try{xObject=xref.fetch(xObject)}catch(ex){processed.put(xObject),info('hasBlendModes - ignoring XObject: "'.concat(ex,'".'));continue}}xObject instanceof BaseStream&&(xObject.dict.objId&&processed.put(xObject.dict.objId),(xObject=xObject.dict.get("Resources"))instanceof Dict)&&(xObject.objId&&processed.has(xObject.objId)||(nodes.push(xObject),xObject.objId&&processed.put(xObject.objId)))}}for(ref of processed)nonBlendModesSet.put(ref)}return!1}async fetchBuiltInCMap(name){var cachedData=this.builtInCMapCache.get(name);return cachedData||(cachedData=this.options.useWorkerFetch?{cMapData:await fetchBinaryData("".concat(this.options.cMapUrl).concat(name,".bcmap")),isCompressed:!0}:await this.handler.sendWithPromise("FetchBinaryData",{type:"cMapReaderFactory",name:name}),this.builtInCMapCache.set(name,cachedData),cachedData)}async fetchStandardFontData(name){var cachedData=this.standardFontDataCache.get(name);if(cachedData)return new Stream(cachedData);if(this.options.useSystemFonts&&"Symbol"!==name&&"ZapfDingbats"!==name)return null;var data,cachedData=getFontNameToFileMap()[name];try{data=this.options.useWorkerFetch?await fetchBinaryData("".concat(this.options.standardFontDataUrl).concat(cachedData)):await this.handler.sendWithPromise("FetchBinaryData",{type:"standardFontDataFactory",filename:cachedData})}catch(ex){return warn(ex),null}return this.standardFontDataCache.set(name,data),new Stream(data)}async buildFormXObject(resources,xobj,smask,operatorList,task,initialState,localColorSpaceCache,seenRefs){var optionalContent,groupOptions,dict=xobj["dict"],matrix=lookupMatrix(dict.getArray("Matrix"),null),bbox=lookupNormalRect(dict.getArray("BBox"),null),group=(void 0!==(optionalContent=dict.has("OC")?await this.parseMarkedContentProps(dict.get("OC"),resources):optionalContent)&&operatorList.addOp(OPS.beginMarkedContentProps,["OC",optionalContent]),dict.get("Group")),localColorSpaceCache=(group&&(groupOptions={matrix:matrix,bbox:bbox,smask:smask,isolated:!1,knockout:!1},colorSpace=null,isName(group.get("S"),"Transparency")&&(groupOptions.isolated=group.get("I")||!1,groupOptions.knockout=group.get("K")||!1,group.has("CS"))&&(colorSpace=(localColorSpaceCache=this._getColorSpace(group.getRaw("CS"),resources,localColorSpaceCache))instanceof ColorSpace?localColorSpaceCache:await this._handleColorSpace(localColorSpaceCache)),null!=smask&&smask.backdrop&&(colorSpace=colorSpace||ColorSpaceUtils.rgb,smask.backdrop=colorSpace.getRgbHex(smask.backdrop,0)),operatorList.addOp(OPS.beginGroup,[groupOptions])),matrix&&new Float32Array(matrix)),colorSpace=!group&&bbox&&new Float32Array(bbox)||null,smask=(operatorList.addOp(OPS.paintFormXObjectBegin,[localColorSpaceCache,colorSpace]),dict.get("Resources"));await this.getOperatorList({stream:xobj,task:task,resources:smask instanceof Dict?smask:resources,operatorList:operatorList,initialState:initialState,prevRefs:seenRefs}),operatorList.addOp(OPS.paintFormXObjectEnd,[]),group&&operatorList.addOp(OPS.endGroup,[groupOptions]),void 0!==optionalContent&&operatorList.addOp(OPS.endMarkedContent,[])}_sendImgData(objId,imgData){var transfers=imgData?[imgData.bitmap||imgData.data.buffer]:null;return this.parsingType3Font||2<arguments.length&&void 0!==arguments[2]&&arguments[2]?this.handler.send("commonobj",[objId,"Image",imgData],transfers):this.handler.send("obj",[objId,this.pageIndex,"Image",imgData],transfers)}async buildPaintImageXObject(_ref33){var optionalContent,fn,args,imgData,{resources:_ref33,image,isInline=!1,operatorList,cacheKey,localImageCache,localColorSpaceCache}=_ref33,{maxImageSize,ignoreErrors,isOffscreenCanvasSupported}=this.options,dict=image["dict"],imageRef=dict.objId,w=dict.get("W","Width"),h=dict.get("H","Height");if(w&&"number"==typeof w&&h&&"number"==typeof h){if(-1!==maxImageSize&&maxImageSize<w*h){var maxImageSize="Image exceeded maximum allowed size and was removed.";if(ignoreErrors)return void warn(maxImageSize);throw new Error(maxImageSize)}if(dict.has("OC")&&(optionalContent=await this.parseMarkedContentProps(dict.get("OC"),_ref33)),dict.get("IM","ImageMask")||!1)return(imgData=await PDFImage.createMask({image:image,isOffscreenCanvasSupported:isOffscreenCanvasSupported&&!this.parsingType3Font})).isSingleOpaquePixel?(fn=OPS.paintSolidColorImageMask,operatorList.addImageOps(fn,args=[],optionalContent),void(cacheKey&&(localImageCache.set(cacheKey,imageRef,maxImageSize={fn:fn,args:args,optionalContent:optionalContent}),imageRef)&&this._regionalImageCache.set(null,imageRef,maxImageSize))):this.parsingType3Font?(args=compileType3Glyph(imgData))?void operatorList.addImageOps(OPS.constructPath,args,optionalContent):(warn("Cannot compile Type3 glyph."),void operatorList.addImageOps(OPS.paintImageMaskXObject,[imgData],optionalContent)):(maxImageSize="mask_".concat(this.idFactory.createObjId()),operatorList.addDependency(maxImageSize),imgData.dataLen=imgData.bitmap?imgData.width*imgData.height*4:imgData.data.length,this._sendImgData(maxImageSize,imgData),fn=OPS.paintImageMaskXObject,args=[{data:maxImageSize,width:imgData.width,height:imgData.height,interpolate:imgData.interpolate,count:1}],operatorList.addImageOps(fn,args,optionalContent),void(cacheKey&&(localImageCache.set(cacheKey,imageRef,maxImageSize={objId:maxImageSize,fn:fn,args:args,optionalContent:optionalContent}),imageRef)&&this._regionalImageCache.set(null,imageRef,maxImageSize)));maxImageSize=dict.has("SMask")||dict.has("Mask");if(isInline&&w+h<200&&!maxImageSize)try{var imageObj=new PDFImage({xref:this.xref,res:_ref33,image:image,isInline:isInline,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache});imgData=await imageObj.createImageData(!0,!1),operatorList.addImageOps(OPS.paintInlineImageXObject,[imgData],optionalContent)}catch(reason){dict='Unable to decode inline image: "'.concat(reason,'".');if(!ignoreErrors)throw new Error(dict);warn(dict)}else{var objId="img_".concat(this.idFactory.createObjId()),cacheGlobally=!1,imageObj=null;if(this.parsingType3Font?objId="".concat(this.idFactory.getDocId(),"_type3_").concat(objId):cacheKey&&imageRef&&(cacheGlobally=this.globalImageCache.shouldCache(imageRef,this.pageIndex))&&(assert(!isInline,"Cannot cache an inline image globally."),objId="".concat(this.idFactory.getDocId(),"_").concat(objId)),operatorList.addDependency(objId),fn=OPS.paintImageXObject,args=[objId,w,h],operatorList.addImageOps(fn,args,optionalContent,maxImageSize),cacheGlobally){if(imageObj={objId:objId,fn:fn,args:args,optionalContent:optionalContent,hasMask:maxImageSize,byteSize:0},this.globalImageCache.hasDecodeFailed(imageRef))return this.globalImageCache.setData(imageRef,imageObj),void this._sendImgData(objId,null,cacheGlobally);if(25e4<w*h||maxImageSize){ignoreErrors=await this.handler.sendWithPromise("commonobj",[objId,"CopyLocalImage",{imageRef:imageRef}]);if(ignoreErrors)return this.globalImageCache.setData(imageRef,imageObj),void this.globalImageCache.addByteSize(imageRef,ignoreErrors)}}PDFImage.buildImage({xref:this.xref,res:_ref33,image:image,isInline:isInline,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache}).then(async imageObj=>((imgData=await imageObj.createImageData(!1,isOffscreenCanvasSupported)).dataLen=imgData.bitmap?imgData.width*imgData.height*4:imgData.data.length,imgData.ref=imageRef,cacheGlobally&&this.globalImageCache.addByteSize(imageRef,imgData.dataLen),this._sendImgData(objId,imgData,cacheGlobally))).catch(reason=>(warn('Unable to decode image "'.concat(objId,'": "').concat(reason,'".')),imageRef&&this.globalImageCache.addDecodeFailed(imageRef),this._sendImgData(objId,null,cacheGlobally))),cacheKey&&(dict={objId:objId,fn:fn,args:args,optionalContent:optionalContent,hasMask:maxImageSize},localImageCache.set(cacheKey,imageRef,dict),imageRef)&&(this._regionalImageCache.set(null,imageRef,dict),cacheGlobally)&&(assert(imageObj,"The global cache-data must be available."),this.globalImageCache.setData(imageRef,imageObj))}}else warn("Image dimensions are missing, or not numbers.")}handleSMask(smask,resources,operatorList,task,stateManager,localColorSpaceCache,seenRefs){var smaskContent=smask.get("G"),smaskOptions={subtype:smask.get("S").name,backdrop:smask.get("BC")},smask=smask.get("TR");if(isPDFFunction(smask)){for(var transferFn=this._pdfFunctionFactory.create(smask),transferMap=new Uint8Array(256),tmp=new Float32Array(1),i=0;i<256;i++)tmp[0]=i/255,transferFn(tmp,0,tmp,0),transferMap[i]=255*tmp[0]|0;smaskOptions.transferMap=transferMap}return this.buildFormXObject(resources,smaskContent,smaskOptions,operatorList,task,stateManager.state.clone({newPath:!0}),localColorSpaceCache,seenRefs)}handleTransferFunction(tr){var transferArray;if(Array.isArray(tr))transferArray=tr;else{if(!isPDFFunction(tr))return null;transferArray=[tr]}var entry,transferMaps=[],numFns=0,numEffectfulFns=0;for(entry of transferArray){var transferObj=this.xref.fetchIfRef(entry);if(numFns++,isName(transferObj,"Identity"))transferMaps.push(null);else{if(!isPDFFunction(transferObj))return null;for(var transferFn=this._pdfFunctionFactory.create(transferObj),transferMap=new Uint8Array(256),tmp=new Float32Array(1),j=0;j<256;j++)tmp[0]=j/255,transferFn(tmp,0,tmp,0),transferMap[j]=255*tmp[0]|0;transferMaps.push(transferMap),numEffectfulFns++}}return 1!==numFns&&4!==numFns||0===numEffectfulFns?null:transferMaps}handleTilingType(fn,color,resources,pattern,patternDict,operatorList,task,localTilingPatternCache){var tilingOpList=new OperatorList,resources=Dict.merge({xref:this.xref,dictArray:[patternDict.get("Resources"),resources]});return this.getOperatorList({stream:pattern,task:task,resources:resources,operatorList:tilingOpList}).then(function(){var operatorListIR=tilingOpList.getIR(),tilingPatternIR=getTilingPatternIR(operatorListIR,patternDict,color);operatorList.addDependencies(tilingOpList.dependencies),operatorList.addOp(fn,tilingPatternIR),patternDict.objId&&localTilingPatternCache.set(null,patternDict.objId,{operatorListIR:operatorListIR,dict:patternDict})}).catch(reason=>{if(!(reason instanceof AbortException)){if(!this.options.ignoreErrors)throw reason;warn('handleTilingType - ignoring pattern: "'.concat(reason,'".'))}})}async handleSetFont(resources,fontArgs,fontRef,operatorList,task,state){var fallbackFontDict=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null,cssFontInfo=7<arguments.length&&void 0!==arguments[7]?arguments[7]:null,fontArgs=(null==fontArgs?void 0:fontArgs[0])instanceof Name?fontArgs[0].name:null,fontArgs=await this.loadFont(fontArgs,fontRef,resources,task,fallbackFontDict,cssFontInfo);return fontArgs.font.isType3Font&&operatorList.addDependencies(fontArgs.type3Dependencies),state.font=fontArgs.font,fontArgs.send(this.handler),fontArgs.loadedName}handleText(chars,state){var font=state.font,chars=font.charsToGlyphs(chars);return font.data&&(state.textRenderingMode&TextRenderingMode.ADD_TO_PATH_FLAG||"Pattern"===state.fillColorSpace.name||font.disableFontFace)&&PartialEvaluator.buildFontPaths(font,chars,this.handler,this.options),chars}ensureStateFont(state){if(!state.font){state=new FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw state;warn('ensureStateFont: "'.concat(state,'".'))}}async setGState(_ref34){var key,value,_this3=this,{resources,gState:_ref34,operatorList,cacheKey,task,stateManager,localGStateCache,localColorSpaceCache,seenRefs}=_ref34,gStateRef=_ref34.objId,isSimpleGState=!0,gStateObj=[],promise=Promise.resolve();for([key,value]of _ref34)await async function(key,value){switch(key){case"Type":break;case"LW":"number"!=typeof value?warn("Invalid LW (line width): ".concat(value)):gStateObj.push([key,Math.abs(value)]);break;case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":gStateObj.push([key,value]);break;case"Font":isSimpleGState=!1,promise=promise.then(()=>_this3.handleSetFont(resources,null,value[0],operatorList,task,stateManager.state).then(function(loadedName){operatorList.addDependency(loadedName),gStateObj.push([key,[loadedName,value[1]]])}));break;case"BM":gStateObj.push([key,normalizeBlendMode(value)]);break;case"SMask":isName(value,"None")?gStateObj.push([key,!1]):value instanceof Dict?(isSimpleGState=!1,promise=promise.then(()=>_this3.handleSMask(value,resources,operatorList,task,stateManager,localColorSpaceCache,seenRefs)),gStateObj.push([key,!0])):warn("Unsupported SMask type");break;case"TR":var transferMaps=_this3.handleTransferFunction(value);gStateObj.push([key,transferMaps]);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 "+key);break;default:info("Unknown graphic state operator "+key)}}(key,value);await promise,0<gStateObj.length&&operatorList.addOp(OPS.setGState,[gStateObj]),isSimpleGState&&localGStateCache.set(cacheKey,gStateRef,gStateObj)}loadFont(fontName,font,resources,task){var fontRef,fallbackFontDict=4<arguments.length&&void 0!==arguments[4]?arguments[4]:null,cssFontInfo=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new ErrorFont('Font "'.concat(fontName,'" is not available.')),dict:font});if(font?font instanceof Ref&&(fontRef=font):(fontRes=resources.get("Font"))&&(fontRef=fontRes.getRaw(fontName)),fontRef){if(null!=(fontRes=this.type3FontRefs)&&fontRes.has(fontRef))return errorFont();if(this.fontCache.has(fontRef))return this.fontCache.get(fontRef);try{font=this.xref.fetchIfRef(fontRef)}catch(ex){warn('loadFont - lookup failed: "'.concat(ex,'".'))}}if(!(font instanceof Dict)){if(!this.options.ignoreErrors&&!this.parsingType3Font)return warn('Font "'.concat(fontName,'" is not available.')),errorFont();warn('Font "'.concat(fontName,'" is not available -- attempting to fallback to a default font.')),font=fallbackFontDict||PartialEvaluator.fallbackFontDict}if(font.cacheKey&&this.fontCache.has(font.cacheKey))return this.fontCache.get(font.cacheKey);var preEvaluatedFont,{promise:fontRes,resolve}=Promise.withResolvers();try{(preEvaluatedFont=this.preEvaluateFont(font)).cssFontInfo=cssFontInfo}catch(reason){return warn('loadFont - preEvaluateFont failed: "'.concat(reason,'".')),errorFont()}var{descriptor:fallbackFontDict,hash:cssFontInfo}=preEvaluatedFont,errorFont=fontRef instanceof Ref;if(cssFontInfo&&fallbackFontDict instanceof Dict){fallbackFontDict=fallbackFontDict.fontAliases||(fallbackFontDict.fontAliases=Object.create(null));if(fallbackFontDict[cssFontInfo]){var aliasFontRef=fallbackFontDict[cssFontInfo].aliasRef;if(errorFont&&aliasFontRef&&this.fontCache.has(aliasFontRef))return this.fontCache.putAlias(fontRef,aliasFontRef),this.fontCache.get(fontRef)}else fallbackFontDict[cssFontInfo]={fontID:this.idFactory.createFontId()};errorFont&&(fallbackFontDict[cssFontInfo].aliasRef=fontRef),aliasFontRef=fallbackFontDict[cssFontInfo].fontID}else aliasFontRef=this.idFactory.createFontId();return assert(null==aliasFontRef?void 0:aliasFontRef.startsWith("f"),'The "fontID" must be (correctly) defined.'),errorFont?this.fontCache.put(fontRef,fontRes):(font.cacheKey="cacheKey_".concat(aliasFontRef),this.fontCache.put(font.cacheKey,fontRes)),font.loadedName="".concat(this.idFactory.getDocId(),"_").concat(aliasFontRef),this.translateFont(preEvaluatedFont).then(async translatedFont=>{var translated=new TranslatedFont({loadedName:font.loadedName,font:translatedFont,dict:font});if(translatedFont.isType3Font)try{await translated.loadType3Data(this,resources,task)}catch(reason){throw new Error("Type3 font load error: ".concat(reason))}resolve(translated)}).catch(reason=>{warn('loadFont - translateFont failed: "'.concat(reason,'".')),resolve(new TranslatedFont({loadedName:font.loadedName,font:new ErrorFont(null==reason?void 0:reason.message),dict:font}))}),fontRes}buildPath(fn,args,state){var{pathMinMax:minMax,pathBuffer}=state;switch(0|fn){case OPS.rectangle:var x=state.currentPointX=args[0],y=state.currentPointY=args[1],width=args[2],height=args[3],xw=x+width,yh=y+height;0===width||0===height?pathBuffer.push(DrawOPS.moveTo,x,y,DrawOPS.lineTo,xw,yh,DrawOPS.closePath):pathBuffer.push(DrawOPS.moveTo,x,y,DrawOPS.lineTo,xw,y,DrawOPS.lineTo,xw,yh,DrawOPS.lineTo,x,yh,DrawOPS.closePath),Util.rectBoundingBox(x,y,xw,yh,minMax);break;case OPS.moveTo:width=state.currentPointX=args[0],height=state.currentPointY=args[1];pathBuffer.push(DrawOPS.moveTo,width,height),Util.pointBoundingBox(width,height,minMax);break;case OPS.lineTo:x=state.currentPointX=args[0],y=state.currentPointY=args[1];pathBuffer.push(DrawOPS.lineTo,x,y),Util.pointBoundingBox(x,y,minMax);break;case OPS.curveTo:var xw=state.currentPointX,yh=state.currentPointY,[width,height,x,y,_x4,_y4]=args;state.currentPointX=_x4,state.currentPointY=_y4,pathBuffer.push(DrawOPS.curveTo,width,height,x,y,_x4,_y4),Util.bezierBoundingBox(xw,yh,width,height,x,y,_x4,_y4,minMax);break;case OPS.curveTo2:var xw=state.currentPointX,yh=state.currentPointY,[width,height,x,y]=args;state.currentPointX=x,state.currentPointY=y,pathBuffer.push(DrawOPS.curveTo,xw,yh,width,height,x,y),Util.bezierBoundingBox(xw,yh,xw,yh,width,height,x,y,minMax);break;case OPS.curveTo3:var _x4=state.currentPointX,_y4=state.currentPointY,[xw,yh,width,height]=args;state.currentPointX=width,state.currentPointY=height,pathBuffer.push(DrawOPS.curveTo,xw,yh,width,height,width,height),Util.bezierBoundingBox(_x4,_y4,xw,yh,width,height,width,height,minMax);break;case OPS.closePath:pathBuffer.push(DrawOPS.closePath)}}_getColorSpace(cs,resources,localColorSpaceCache){return ColorSpaceUtils.parse({cs:cs,xref:this.xref,resources:resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:localColorSpaceCache,asyncIfNotCached:!0})}async _handleColorSpace(csPromise){try{return await csPromise}catch(ex){if(ex instanceof AbortException)return null;if(this.options.ignoreErrors)return warn('_handleColorSpace - ignoring ColorSpace: "'.concat(ex,'".')),null;throw ex}}parseShading(_ref35){var{shading:_ref35,resources,localColorSpaceCache,localShadingPatternCache}=_ref35,id=localShadingPatternCache.get(_ref35);if(!id){try{var patternIR=Pattern.parseShading(_ref35,this.xref,resources,this._pdfFunctionFactory,this.globalColorSpaceCache,localColorSpaceCache).getIR()}catch(reason){if(reason instanceof AbortException)return null;if(this.options.ignoreErrors)return warn('parseShading - ignoring shading: "'.concat(reason,'".')),localShadingPatternCache.set(_ref35,null),null;throw reason}id="pattern_".concat(this.idFactory.createObjId()),this.parsingType3Font&&(id="".concat(this.idFactory.getDocId(),"_type3_").concat(id)),localShadingPatternCache.set(_ref35,id),this.parsingType3Font?this.handler.send("commonobj",[id,"Pattern",patternIR]):this.handler.send("obj",[id,this.pageIndex,"Pattern",patternIR])}return id}handleColorN(operatorList,fn,args,cs,patterns,resources,task,localColorSpaceCache,localTilingPatternCache,localShadingPatternCache){var patternName=args.pop();if(patternName instanceof Name){var patterns=patterns.getRaw(patternName.name),localTilingPattern=patterns instanceof Ref&&localTilingPatternCache.getByRef(patterns);if(localTilingPattern)try{var color=cs.base?cs.base.getRgbHex(args,0):null,tilingPatternIR=getTilingPatternIR(localTilingPattern.operatorListIR,localTilingPattern.dict,color);return void operatorList.addOp(fn,tilingPatternIR)}catch(_unused1){}localTilingPattern=this.xref.fetchIfRef(patterns);if(localTilingPattern){color=localTilingPattern instanceof BaseStream?localTilingPattern.dict:localTilingPattern,tilingPatternIR=color.get("PatternType");if(tilingPatternIR===PatternType.TILING)return patterns=cs.base?cs.base.getRgbHex(args,0):null,this.handleTilingType(fn,patterns,resources,localTilingPattern,color,operatorList,task,localTilingPatternCache);if(tilingPatternIR===PatternType.SHADING)return cs=color.get("Shading"),void((args=this.parseShading({shading:cs,resources:resources,localColorSpaceCache:localColorSpaceCache,localShadingPatternCache:localShadingPatternCache}))&&(patterns=lookupMatrix(color.getArray("Matrix"),null),operatorList.addOp(fn,["Shading",args,patterns])));throw new FormatError("Unknown PatternType: ".concat(tilingPatternIR))}}throw new FormatError("Unknown PatternName: ".concat(patternName))}_parseVisibilityExpression(array,nestingCounter,currentResult){if(10<++nestingCounter)warn("Visibility expression is too deeply nested");else{var length=array.length,operator=this.xref.fetchIfRef(array[0]);if(length<2||!(operator instanceof Name))warn("Invalid visibility expression");else{switch(operator.name){case"And":case"Or":case"Not":currentResult.push(operator.name);break;default:return void warn("Invalid operator ".concat(operator.name," in visibility expression"))}for(var i=1;i<length;i++){var nestedResult,raw=array[i],object=this.xref.fetchIfRef(raw);Array.isArray(object)?(currentResult.push(nestedResult=[]),this._parseVisibilityExpression(object,nestingCounter,nestedResult)):raw instanceof Ref&¤tResult.push(raw.toString())}}}}async parseMarkedContentProps(contentProperties,resources){if(contentProperties instanceof Name)var optionalContent=resources.get("Properties").get(contentProperties.name);else{if(!(contentProperties instanceof Dict))throw new FormatError("Optional content properties malformed.");optionalContent=contentProperties}contentProperties=null==(resources=optionalContent.get("Type"))?void 0:resources.name;if("OCG"===contentProperties)return{type:contentProperties,id:optionalContent.objId};if("OCMD"===contentProperties){resources=optionalContent.get("VE");if(Array.isArray(resources)){var result=[];if(this._parseVisibilityExpression(resources,0,result),0<result.length)return{type:"OCMD",expression:result}}resources=optionalContent.get("OCGs");if(Array.isArray(resources)||resources instanceof Dict){var groupIds=[];if(Array.isArray(resources))for(var ocg of resources)groupIds.push(ocg.toString());else groupIds.push(resources.objId);return{type:contentProperties,ids:groupIds,policy:optionalContent.get("P")instanceof Name?optionalContent.get("P").name:null,expression:null}}if(resources instanceof Ref)return{type:contentProperties,id:resources.toString()}}return null}getOperatorList(_ref36){var self,xref,localImageCache,localColorSpaceCache,localGStateCache,localTilingPatternCache,localShadingPatternCache,xobjs,patterns,stateManager,preprocessor,timeSlotManager,{stream:_ref36,task,resources,operatorList,initialState=null,fallbackFontDict=null,prevRefs=null}=_ref36,_stream$dict2=null==(_stream$dict2=_ref36.dict)?void 0:_stream$dict2.objId,seenRefs=new RefSet(prevRefs);if(_stream$dict2){if(null!=prevRefs&&prevRefs.has(_stream$dict2))throw new Error("getOperatorList - ignoring circular reference: ".concat(_stream$dict2));seenRefs.put(_stream$dict2)}if(resources=resources||Dict.empty,initialState=initialState||new EvalState,operatorList)return xref=(self=this).xref,localImageCache=new LocalImageCache,localColorSpaceCache=new LocalColorSpaceCache,localGStateCache=new LocalGStateCache,localTilingPatternCache=new LocalTilingPatternCache,localShadingPatternCache=new Map,xobjs=resources.get("XObject")||Dict.empty,patterns=resources.get("Pattern")||Dict.empty,stateManager=new StateManager(initialState),preprocessor=new EvaluatorPreprocessor(_ref36,xref,stateManager),timeSlotManager=new TimeSlotManager,new Promise(function promiseBody(resolve,reject){for(var stop,i,ii,cs,name,isValidName,_ret,next=function(promise){Promise.all([promise,operatorList.ready]).then(function(){try{promiseBody(resolve,reject)}catch(ex){reject(ex)}},reject)},operation=(task.ensureNotTerminated(),timeSlotManager.reset(),{});!(stop=timeSlotManager.check())&&0!==(_ret=function(){if(operation.args=null,!preprocessor.read(operation))return 0;var args=operation.args,fn=operation.fn;switch(0|fn){case OPS.paintXObject:if(isValidName=args[0]instanceof Name,name=args[0].name,isValidName){var localImage=localImageCache.getByName(name);if(localImage)return addCachedImageOps(operatorList,localImage),args=null,1}return next(new Promise(function(resolveXObject,rejectXObject){if(!isValidName)throw new FormatError("XObject must be referred to by name.");var xobj=xobjs.getRaw(name);if(xobj instanceof Ref){var cachedImage=localImageCache.getByRef(xobj)||self._regionalImageCache.getByRef(xobj)||self.globalImageCache.getData(xobj,self.pageIndex);if(cachedImage)return addCachedImageOps(operatorList,cachedImage),void resolveXObject();xobj=xref.fetch(xobj)}if(!(xobj instanceof BaseStream))throw new FormatError("XObject should be a stream");cachedImage=xobj.dict.get("Subtype");if(!(cachedImage instanceof Name))throw new FormatError("XObject should have a Name subtype");if("Form"===cachedImage.name)stateManager.save(),self.buildFormXObject(resources,xobj,null,operatorList,task,stateManager.state.clone({newPath:!0}),localColorSpaceCache,seenRefs).then(function(){stateManager.restore(),resolveXObject()},rejectXObject);else if("Image"===cachedImage.name)self.buildPaintImageXObject({resources:resources,image:xobj,operatorList:operatorList,cacheKey:name,localImageCache:localImageCache,localColorSpaceCache:localColorSpaceCache}).then(resolveXObject,rejectXObject);else{if("PS"!==cachedImage.name)throw new FormatError("Unhandled XObject subtype ".concat(cachedImage.name));info("Ignored XObject subtype PS"),resolveXObject()}}).catch(function(reason){if(!(reason instanceof AbortException)){if(!self.options.ignoreErrors)throw reason;warn('getOperatorList - ignoring XObject: "'.concat(reason,'".'))}})),{v:void 0};case OPS.setFont:var fontSize=args[1];return next(self.handleSetFont(resources,args,null,operatorList,task,stateManager.state,fallbackFontDict).then(function(loadedName){operatorList.addDependency(loadedName),operatorList.addOp(OPS.setFont,[loadedName,fontSize])})),{v:void 0};case OPS.endInlineImage:localImage=args[0].cacheKey;if(localImage){var _localImage=localImageCache.getByName(localImage);if(_localImage)return addCachedImageOps(operatorList,_localImage),args=null,1}return next(self.buildPaintImageXObject({resources:resources,image:args[0],isInline:!0,operatorList:operatorList,cacheKey:localImage,localImageCache:localImageCache,localColorSpaceCache:localColorSpaceCache})),{v:void 0};case OPS.showText:if(!stateManager.state.font)return self.ensureStateFont(stateManager.state),1;args[0]=self.handleText(args[0],stateManager.state);break;case OPS.showSpacedText:if(!stateManager.state.font)return self.ensureStateFont(stateManager.state),1;var arrItem,combinedGlyphs=[],state=stateManager.state;for(arrItem of args[0])"string"==typeof arrItem?combinedGlyphs.push(...self.handleText(arrItem,state)):"number"==typeof arrItem&&combinedGlyphs.push(arrItem);args[0]=combinedGlyphs,fn=OPS.showText;break;case OPS.nextLineShowText:if(!stateManager.state.font)return self.ensureStateFont(stateManager.state),1;operatorList.addOp(OPS.nextLine),args[0]=self.handleText(args[0],stateManager.state),fn=OPS.showText;break;case OPS.nextLineSetSpacingShowText:if(!stateManager.state.font)return self.ensureStateFont(stateManager.state),1;operatorList.addOp(OPS.nextLine),operatorList.addOp(OPS.setWordSpacing,[args.shift()]),operatorList.addOp(OPS.setCharSpacing,[args.shift()]),args[0]=self.handleText(args[0],stateManager.state),fn=OPS.showText;break;case OPS.setTextRenderingMode:stateManager.state.textRenderingMode=args[0];break;case OPS.setFillColorSpace:_localImage=self._getColorSpace(args[0],resources,localColorSpaceCache);return _localImage instanceof ColorSpace?(stateManager.state.fillColorSpace=_localImage,1):(next(self._handleColorSpace(_localImage).then(colorSpace=>{stateManager.state.fillColorSpace=colorSpace||ColorSpaceUtils.gray})),{v:void 0});case OPS.setStrokeColorSpace:localImage=self._getColorSpace(args[0],resources,localColorSpaceCache);return localImage instanceof ColorSpace?(stateManager.state.strokeColorSpace=localImage,1):(next(self._handleColorSpace(localImage).then(colorSpace=>{stateManager.state.strokeColorSpace=colorSpace||ColorSpaceUtils.gray})),{v:void 0});case OPS.setFillColor:args=[(cs=stateManager.state.fillColorSpace).getRgbHex(args,0)],fn=OPS.setFillRGBColor;break;case OPS.setStrokeColor:args=[(cs=stateManager.state.strokeColorSpace).getRgbHex(args,0)],fn=OPS.setStrokeRGBColor;break;case OPS.setFillGray:stateManager.state.fillColorSpace=ColorSpaceUtils.gray,args=[ColorSpaceUtils.gray.getRgbHex(args,0)],fn=OPS.setFillRGBColor;break;case OPS.setStrokeGray:stateManager.state.strokeColorSpace=ColorSpaceUtils.gray,args=[ColorSpaceUtils.gray.getRgbHex(args,0)],fn=OPS.setStrokeRGBColor;break;case OPS.setFillCMYKColor:stateManager.state.fillColorSpace=ColorSpaceUtils.cmyk,args=[ColorSpaceUtils.cmyk.getRgbHex(args,0)],fn=OPS.setFillRGBColor;break;case OPS.setStrokeCMYKColor:stateManager.state.strokeColorSpace=ColorSpaceUtils.cmyk,args=[ColorSpaceUtils.cmyk.getRgbHex(args,0)],fn=OPS.setStrokeRGBColor;break;case OPS.setFillRGBColor:stateManager.state.fillColorSpace=ColorSpaceUtils.rgb,args=[ColorSpaceUtils.rgb.getRgbHex(args,0)];break;case OPS.setStrokeRGBColor:stateManager.state.strokeColorSpace=ColorSpaceUtils.rgb,args=[ColorSpaceUtils.rgb.getRgbHex(args,0)];break;case OPS.setFillColorN:if(cs=stateManager.state.patternFillColorSpace){if("Pattern"===cs.name)return next(self.handleColorN(operatorList,OPS.setFillColorN,args,cs,patterns,resources,task,localColorSpaceCache,localTilingPatternCache,localShadingPatternCache)),{v:void 0};args=[cs.getRgbHex(args,0)],fn=OPS.setFillRGBColor}else{if(isNumberArray(args,null)){args=[ColorSpaceUtils.gray.getRgbHex(args,0)],fn=OPS.setFillRGBColor;break}args=[],fn=OPS.setFillTransparent}break;case OPS.setStrokeColorN:if(cs=stateManager.state.patternStrokeColorSpace){if("Pattern"===cs.name)return next(self.handleColorN(operatorList,OPS.setStrokeColorN,args,cs,patterns,resources,task,localColorSpaceCache,localTilingPatternCache,localShadingPatternCache)),{v:void 0};args=[cs.getRgbHex(args,0)],fn=OPS.setStrokeRGBColor}else{if(isNumberArray(args,null)){args=[ColorSpaceUtils.gray.getRgbHex(args,0)],fn=OPS.setStrokeRGBColor;break}args=[],fn=OPS.setStrokeTransparent}break;case OPS.shadingFill:try{var shadingRes=resources.get("Shading");if(!shadingRes)throw new FormatError("No shading resource found");if(!(shading=shadingRes.get(args[0].name)))throw new FormatError("No shading object found")}catch(reason){if(reason instanceof AbortException)return 1;if(self.options.ignoreErrors)return warn('getOperatorList - ignoring Shading: "'.concat(reason,'".')),1;throw reason}_localImage=self.parseShading({shading:shading,resources:resources,localColorSpaceCache:localColorSpaceCache,localShadingPatternCache:localShadingPatternCache});if(!_localImage)return 1;args=[_localImage],fn=OPS.shadingFill;break;case OPS.setGState:if(isValidName=args[0]instanceof Name,name=args[0].name,isValidName){localImage=localGStateCache.getByName(name);if(localImage)return 0<localImage.length&&operatorList.addOp(OPS.setGState,[localImage]),args=null,1}return next(new Promise(function(resolveGState,rejectGState){if(!isValidName)throw new FormatError("GState must be referred to by name.");var extGState=resources.get("ExtGState");if(!(extGState instanceof Dict))throw new FormatError("ExtGState should be a dictionary.");extGState=extGState.get(name);if(!(extGState instanceof Dict))throw new FormatError("GState should be a dictionary.");self.setGState({resources:resources,gState:extGState,operatorList:operatorList,cacheKey:name,task:task,stateManager:stateManager,localGStateCache:localGStateCache,localColorSpaceCache:localColorSpaceCache,seenRefs:seenRefs}).then(resolveGState,rejectGState)}).catch(function(reason){if(!(reason instanceof AbortException)){if(!self.options.ignoreErrors)throw reason;warn('getOperatorList - ignoring ExtGState: "'.concat(reason,'".'))}})),{v:void 0};case OPS.setLineWidth:var[shadingRes]=args;if("number"!=typeof shadingRes)return warn("Invalid setLineWidth: ".concat(shadingRes)),1;args[0]=Math.abs(shadingRes);break;case OPS.moveTo:case OPS.lineTo:case OPS.curveTo:case OPS.curveTo2:case OPS.curveTo3:case OPS.closePath:case OPS.rectangle:return self.buildPath(fn,args,stateManager.state),1;case OPS.stroke:case OPS.closeStroke:case OPS.fill:case OPS.eoFill:case OPS.fillStroke:case OPS.eoFillStroke:case OPS.closeFillStroke:case OPS.closeEOFillStroke:case OPS.endPath:var{pathBuffer:shading,pathMinMax:_localImage}=stateManager["state"];return fn!==OPS.closeStroke&&fn!==OPS.closeFillStroke&&fn!==OPS.closeEOFillStroke||shading.push(DrawOPS.closePath),0===shading.length?operatorList.addOp(OPS.constructPath,[fn,[null],null]):(operatorList.addOp(OPS.constructPath,[fn,[new Float32Array(shading)],_localImage.slice()]),shading.length=0,_localImage.set([1/0,1/0,-1/0,-1/0],0)),1;case OPS.setTextMatrix:return operatorList.addOp(fn,[new Float32Array(args)]),1;case OPS.markPoint:case OPS.markPointProps:case OPS.beginCompat:case OPS.endCompat:return 1;case OPS.beginMarkedContentProps:if(!(args[0]instanceof Name))return warn("Expected name for beginMarkedContentProps arg0=".concat(args[0])),operatorList.addOp(OPS.beginMarkedContentProps,["OC",null]),1;if("OC"===args[0].name)return next(self.parseMarkedContentProps(args[1],resources).then(data=>{operatorList.addOp(OPS.beginMarkedContentProps,["OC",data])}).catch(reason=>{if(!(reason instanceof AbortException)){if(!self.options.ignoreErrors)throw reason;warn('getOperatorList - ignoring beginMarkedContentProps: "'.concat(reason,'".')),operatorList.addOp(OPS.beginMarkedContentProps,["OC",null])}})),{v:void 0};args=[args[0].name,args[1]instanceof Dict?args[1].get("MCID"):null];break;case OPS.beginMarkedContent:case OPS.endMarkedContent:default:if(null!==args){for(i=0,ii=args.length;i<ii&&!(args[i]instanceof Dict);i++);if(i<ii)return warn("getOperatorList - ignoring operator: "+fn),1}}operatorList.addOp(fn,args)}());)if(1!==_ret&&_ret)return _ret.v;stop?next(deferred):(closePendingRestoreOPS(),resolve())}).catch(reason=>{if(!(reason instanceof AbortException)){if(!this.options.ignoreErrors)throw reason;warn('getOperatorList - ignoring errors during "'.concat(task.name,'" ')+'task: "'.concat(reason,'".')),closePendingRestoreOPS()}});throw new Error('getOperatorList: missing "operatorList" parameter');function closePendingRestoreOPS(){for(var i=0,ii=preprocessor.savedStatesDepth;i<ii;i++)operatorList.addOp(OPS.restore,[])}}getTextContent(_ref37){var{stream:_ref37,task,resources,stateManager=null,includeMarkedContent=!1,sink,seenStyles=new Set,viewBox,lang=null,markedContentData=null,disableNormalization=!1,keepWhiteSpace=!1,prevRefs=null,intersector=null}=_ref37,_stream$dict3=null==(_stream$dict3=_ref37.dict)?void 0:_stream$dict3.objId,seenRefs=new RefSet(prevRefs);if(_stream$dict3){if(null!=prevRefs&&prevRefs.has(_stream$dict3))throw new Error("getTextContent - ignoring circular reference: ".concat(_stream$dict3));seenRefs.put(_stream$dict3)}resources=resources||Dict.empty,stateManager=stateManager||new StateManager(new TextState),includeMarkedContent&&(markedContentData=markedContentData||{level:0});var textContent={items:[],styles:Object.create(null),lang:lang},textContentItem={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},twoLastChars=[" "," "],twoLastCharsPos=0;function saveLastChar(char){var nextPos=(twoLastCharsPos+1)%2,ret=" "!==twoLastChars[twoLastCharsPos]&&" "===twoLastChars[nextPos];return twoLastChars[twoLastCharsPos]=char,twoLastCharsPos=nextPos,!keepWhiteSpace&&ret}function shouldAddWhitepsace(){return!keepWhiteSpace&&" "!==twoLastChars[twoLastCharsPos]&&" "===twoLastChars[(twoLastCharsPos+1)%2]}function resetLastChars(){twoLastChars[0]=twoLastChars[1]=" ",twoLastCharsPos=0}var textState,TRACKING_SPACE_FACTOR=.102,NOT_A_SPACE_FACTOR=.03,NEGATIVE_SPACE_FACTOR=-.2,SPACE_IN_FLOW_MIN_FACTOR=.102,SPACE_IN_FLOW_MAX_FACTOR=.6,VERTICAL_SHIFT_RATIO=.25,self=this,xref=this.xref,showSpacedTextBuffer=[],xobjs=null,emptyXObjectCache=new LocalImageCache,emptyGStateCache=new LocalGStateCache,preprocessor=new EvaluatorPreprocessor(_ref37,xref,stateManager);function pushWhitespace(_ref38){var{width:_ref38=0,height=0,transform=textContentItem.prevTransform,fontName=textContentItem.fontName}=_ref38;null!=intersector&&intersector.addExtraChar(" "),textContent.items.push({str:" ",dir:"ltr",width:_ref38,height:height,transform:transform,fontName:fontName,hasEOL:!1})}function getCurrentTextTransform(){var font=textState.font,tsm=[textState.fontSize*textState.textHScale,0,0,textState.fontSize,0,textState.textRise];return font.isType3Font&&(textState.fontSize<=1||font.isCharBBox)&&!isArrayEqual(textState.fontMatrix,FONT_IDENTITY_MATRIX)&&0<(font=font.bbox[3]-font.bbox[1])&&(tsm[3]*=font*textState.fontMatrix[3]),Util.transform(textState.ctm,Util.transform(textState.textMatrix,tsm))}async function handleSetFont(fontName,fontRef){fontName=await self.loadFont(fontName,fontRef,resources,task);textState.loadedName=fontName.loadedName,textState.font=fontName.font,textState.fontMatrix=fontName.font.fontMatrix||FONT_IDENTITY_MATRIX}function applyInverseRotation(x,y,matrix){var scale=Math.hypot(matrix[0],matrix[1]);return[(matrix[0]*x+matrix[1]*y)/scale,(matrix[2]*x+matrix[3]*y)/scale]}function compareWithLastPosition(glyphWidth){var currentTransform=getCurrentTextTransform(),posX=currentTransform[4],posY=currentTransform[5];if(null!=(_textState$font=textState.font)&&_textState$font.vertical){if(posX<viewBox[0]||posX>viewBox[2]||posY+glyphWidth<viewBox[1]||posY>viewBox[3])return}else if(posX+glyphWidth<viewBox[0]||posX>viewBox[2]||posY<viewBox[1]||posY>viewBox[3])return;if(textState.font&&textContentItem.prevTransform){var lastPosX=textContentItem.prevTransform[4],lastPosY=textContentItem.prevTransform[5];if(lastPosX!==posX||lastPosY!==posY){var _textOrientation,_textState$font=-1;switch(currentTransform[0]&&0===currentTransform[1]&&0===currentTransform[2]?_textState$font=0<currentTransform[0]?0:180:currentTransform[1]&&0===currentTransform[0]&&0===currentTransform[3]&&(_textState$font=0<currentTransform[1]?90:270),_textState$font){case 0:break;case 90:[posX,posY]=[posY,posX],[lastPosX,lastPosY]=[lastPosY,lastPosX];break;case 180:[posX,posY,lastPosX,lastPosY]=[-posX,-posY,-lastPosX,-lastPosY];break;case 270:[posX,posY]=[-posY,-posX],[lastPosX,lastPosY]=[-lastPosY,-lastPosX];break;default:[posX,posY]=applyInverseRotation(posX,posY,currentTransform),[lastPosX,lastPosY]=applyInverseRotation(lastPosX,lastPosY,textContentItem.prevTransform)}textState.font.vertical?(glyphWidth=posX-lastPosX,(_textState$font=(lastPosY-posY)/textContentItem.textAdvanceScale)<(_textOrientation=Math.sign(textContentItem.height))*textContentItem.negativeSpaceMax?(Math.abs(glyphWidth)>.5*textContentItem.width?appendEOL:(resetLastChars(),flushTextContentItem))():Math.abs(glyphWidth)>textContentItem.width?appendEOL():(_textState$font<=_textOrientation*textContentItem.notASpace&&resetLastChars(),_textState$font<=_textOrientation*textContentItem.trackingSpaceMin?shouldAddWhitepsace()?(resetLastChars(),flushTextContentItem(),pushWhitespace({height:Math.abs(_textState$font)})):textContentItem.height+=_textState$font:addFakeSpaces(_textState$font,textContentItem.prevTransform,_textOrientation)||(0===textContentItem.str.length?(resetLastChars(),pushWhitespace({height:Math.abs(_textState$font)})):textContentItem.height+=_textState$font),Math.abs(glyphWidth)>textContentItem.width*VERTICAL_SHIFT_RATIO&&flushTextContentItem())):(_textOrientation=posY-lastPosY,(_textState$font=(posX-lastPosX)/textContentItem.textAdvanceScale)<(glyphWidth=Math.sign(textContentItem.width))*textContentItem.negativeSpaceMax?(Math.abs(_textOrientation)>.5*textContentItem.height?appendEOL:(resetLastChars(),flushTextContentItem))():Math.abs(_textOrientation)>textContentItem.height?appendEOL():(_textState$font<=glyphWidth*textContentItem.notASpace&&resetLastChars(),_textState$font<=glyphWidth*textContentItem.trackingSpaceMin?shouldAddWhitepsace()?(resetLastChars(),flushTextContentItem(),pushWhitespace({width:Math.abs(_textState$font)})):textContentItem.width+=_textState$font:addFakeSpaces(_textState$font,textContentItem.prevTransform,glyphWidth)||(0===textContentItem.str.length?(resetLastChars(),pushWhitespace({width:Math.abs(_textState$font)})):textContentItem.width+=_textState$font),Math.abs(_textOrientation)>textContentItem.height*VERTICAL_SHIFT_RATIO&&flushTextContentItem()))}}return 1}function buildTextContentItem(_ref39){var{chars:_ref39,extraSpacing}=_ref39,font=textState.font;if(_ref39)for(var glyphs=font.charsToGlyphs(_ref39),scale=textState.fontMatrix[0]*textState.fontSize,i=0,ii=glyphs.length;i<ii;i++){var _charSpacing,glyphWidth,textChunk,glyph=glyphs[i],category=glyph["category"];category.isInvisibleFormatMark||(_charSpacing=textState.charSpacing+(i+1===ii?extraSpacing:0),glyphWidth=glyph.width,glyphWidth=(glyphWidth=font.vertical?glyph.vmetric?glyph.vmetric[0]:-glyphWidth:glyphWidth)*scale,!keepWhiteSpace&&category.isWhitespace?(font.vertical?(_charSpacing+=-glyphWidth+textState.wordSpacing,textState.translateTextMatrix(0,-_charSpacing)):(_charSpacing+=glyphWidth+textState.wordSpacing,textState.translateTextMatrix(_charSpacing*textState.textHScale,0)),saveLastChar(" ")):category.isZeroWidthDiacritic||compareWithLastPosition(glyphWidth)?(textChunk=function(){var loadedName,font,style;return textContentItem.initialized||({font,loadedName}=textState,seenStyles.has(loadedName)||(seenStyles.add(loadedName),textContent.styles[loadedName]={fontFamily:font.fallbackName,ascent:font.ascent,descent:font.descent,vertical:font.vertical},self.options.fontExtraProperties&&font.systemFontInfo&&((style=textContent.styles[loadedName]).fontSubstitution=font.systemFontInfo.css,style.fontSubstitutionLoadedName=font.systemFontInfo.loadedName)),textContentItem.fontName=loadedName,style=textContentItem.transform=getCurrentTextTransform(),font.vertical?(textContentItem.width=textContentItem.totalWidth=Math.hypot(style[0],style[1]),textContentItem.height=textContentItem.totalHeight=0,textContentItem.vertical=!0):(textContentItem.width=textContentItem.totalWidth=0,textContentItem.height=textContentItem.totalHeight=Math.hypot(style[2],style[3]),textContentItem.vertical=!1),loadedName=Math.hypot(textState.textLineMatrix[0],textState.textLineMatrix[1]),font=Math.hypot(textState.ctm[0],textState.ctm[1]),style=(textContentItem.textAdvanceScale=font*loadedName,textState)["fontSize"],textContentItem.trackingSpaceMin=style*TRACKING_SPACE_FACTOR,textContentItem.notASpace=style*NOT_A_SPACE_FACTOR,textContentItem.negativeSpaceMax=style*NEGATIVE_SPACE_FACTOR,textContentItem.spaceInFlowMin=style*SPACE_IN_FLOW_MIN_FACTOR,textContentItem.spaceInFlowMax=style*SPACE_IN_FLOW_MAX_FACTOR,textContentItem.hasEOL=!1,textContentItem.initialized=!0),textContentItem}(),category.isZeroWidthDiacritic&&(glyphWidth=0),font.vertical?(null!=intersector&&intersector.addGlyph(getCurrentTextTransform(),0,glyphWidth,glyph.unicode),textState.translateTextMatrix(0,glyphWidth),glyphWidth=Math.abs(glyphWidth),textChunk.height+=glyphWidth):(glyphWidth*=textState.textHScale,null!=intersector&&intersector.addGlyph(getCurrentTextTransform(),glyphWidth,0,glyph.unicode),textState.translateTextMatrix(glyphWidth,0),textChunk.width+=glyphWidth),glyphWidth&&(textChunk.prevTransform=getCurrentTextTransform()),saveLastChar(category=glyph.unicode)&&(textChunk.str.push(" "),null!=intersector)&&intersector.addExtraChar(" "),intersector||textChunk.str.push(category),_charSpacing&&(font.vertical?textState.translateTextMatrix(0,-_charSpacing):textState.translateTextMatrix(_charSpacing*textState.textHScale,0))):font.vertical?textState.translateTextMatrix(0,glyphWidth):textState.translateTextMatrix(glyphWidth*textState.textHScale,0))}else(_ref39=textState.charSpacing+extraSpacing)&&(font.vertical?textState.translateTextMatrix(0,-_ref39):textState.translateTextMatrix(_ref39*textState.textHScale,0)),keepWhiteSpace&&compareWithLastPosition(0)}function appendEOL(){null!=intersector&&intersector.addExtraChar("\n"),resetLastChars(),textContentItem.initialized?(textContentItem.hasEOL=!0,flushTextContentItem()):textContent.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:textState.loadedName,hasEOL:!0})}function addFakeSpaces(width,transf,textOrientation){var height;if(!(textOrientation*textContentItem.spaceInFlowMin<=width&&width<=textOrientation*textContentItem.spaceInFlowMax))return textOrientation=textContentItem.fontName,height=0,textContentItem.vertical&&(height=width,width=0),flushTextContentItem(),resetLastChars(),pushWhitespace({width:Math.abs(width),height:Math.abs(height),transform:transf||getCurrentTextTransform(),fontName:textOrientation}),1;textContentItem.initialized&&(resetLastChars(),textContentItem.str.push(" "),null!=intersector)&&intersector.addExtraChar(" ")}function flushTextContentItem(){var textChunk,text;textContentItem.initialized&&textContentItem.str&&(textContentItem.vertical?textContentItem.totalHeight+=textContentItem.height*textContentItem.textAdvanceScale:textContentItem.totalWidth+=textContentItem.width*textContentItem.textAdvanceScale,textContent.items.push((text=(textChunk=textContentItem).str.join(""),{str:(text=bidi(text=disableNormalization?text:normalizeUnicode(text),-1,textChunk.vertical)).str,dir:text.dir,width:Math.abs(textChunk.totalWidth),height:Math.abs(textChunk.totalHeight),transform:textChunk.transform,fontName:textChunk.fontName,hasEOL:textChunk.hasEOL})),textContentItem.initialized=!1,textContentItem.str.length=0)}function enqueueChunk(argument_0){var length=textContent.items.length;0===length||0<arguments.length&&void 0!==argument_0&&argument_0&&length<TEXT_CHUNK_BATCH_SIZE||(null!=sink&&sink.enqueue(textContent,length),textContent.items=[],textContent.styles=Object.create(null))}var timeSlotManager=new TimeSlotManager;return new Promise(function promiseBody(resolve,reject){for(var stop,name,isValidName,next=function(promise){enqueueChunk(!0),Promise.all([promise,null==sink?void 0:sink.ready]).then(function(){try{promiseBody(resolve,reject)}catch(ex){reject(ex)}},reject)},operation=(task.ensureNotTerminated(),timeSlotManager.reset(),{}),args=[];!(stop=timeSlotManager.check())&&(args.length=0,operation.args=args,preprocessor.read(operation));){var previousState=textState,fn=(textState=stateManager.state,operation.fn),args=operation.args;switch(0|fn){case OPS.setFont:var fontNameArg=args[0].name,fontSizeArg=args[1];if(textState.font&&fontNameArg===textState.fontName&&fontSizeArg===textState.fontSize)break;return flushTextContentItem(),textState.fontName=fontNameArg,textState.fontSize=fontSizeArg,void next(handleSetFont(fontNameArg,null));case OPS.setTextRise:textState.textRise=args[0];break;case OPS.setHScale:textState.textHScale=args[0]/100;break;case OPS.setLeading:textState.leading=args[0];break;case OPS.moveText:textState.translateTextLineMatrix(args[0],args[1]),textState.textMatrix=textState.textLineMatrix.slice();break;case OPS.setLeadingMoveText:textState.leading=-args[1],textState.translateTextLineMatrix(args[0],args[1]),textState.textMatrix=textState.textLineMatrix.slice();break;case OPS.nextLine:textState.carriageReturn();break;case OPS.setTextMatrix:textState.setTextMatrix(args[0],args[1],args[2],args[3],args[4],args[5]),textState.setTextLineMatrix(args[0],args[1],args[2],args[3],args[4],args[5]),fontSizeArg=void 0,textContentItem.initialized&&(fontSizeArg=Math.hypot(textState.textLineMatrix[0],textState.textLineMatrix[1]),(fontSizeArg=Math.hypot(textState.ctm[0],textState.ctm[1])*fontSizeArg)!==textContentItem.textAdvanceScale)&&(textContentItem.vertical?(textContentItem.totalHeight+=textContentItem.height*textContentItem.textAdvanceScale,textContentItem.height=0):(textContentItem.totalWidth+=textContentItem.width*textContentItem.textAdvanceScale,textContentItem.width=0),textContentItem.textAdvanceScale=fontSizeArg);break;case OPS.setCharSpacing:textState.charSpacing=args[0];break;case OPS.setWordSpacing:textState.wordSpacing=args[0];break;case OPS.beginText:textState.textMatrix=IDENTITY_MATRIX.slice(),textState.textLineMatrix=IDENTITY_MATRIX.slice();break;case OPS.showSpacedText:if(!stateManager.state.font){self.ensureStateFont(stateManager.state);continue}for(var spaceFactor=(textState.font.vertical?1:-1)*textState.fontSize/1e3,elements=args[0],i=0,ii=elements.length;i<ii;i++){var str,item=elements[i];"string"==typeof item?showSpacedTextBuffer.push(item):"number"==typeof item&&0!==item&&(str=showSpacedTextBuffer.join(""),showSpacedTextBuffer.length=0,buildTextContentItem({chars:str,extraSpacing:item*spaceFactor}))}0<showSpacedTextBuffer.length&&buildTextContentItem({chars:showSpacedTextBuffer.join(""),extraSpacing:showSpacedTextBuffer.length=0});break;case OPS.showText:if(!stateManager.state.font){self.ensureStateFont(stateManager.state);continue}buildTextContentItem({chars:args[0],extraSpacing:0});break;case OPS.nextLineShowText:if(!stateManager.state.font){self.ensureStateFont(stateManager.state);continue}textState.carriageReturn(),buildTextContentItem({chars:args[0],extraSpacing:0});break;case OPS.nextLineSetSpacingShowText:if(!stateManager.state.font){self.ensureStateFont(stateManager.state);continue}textState.wordSpacing=args[0],textState.charSpacing=args[1],textState.carriageReturn(),buildTextContentItem({chars:args[2],extraSpacing:0});break;case OPS.paintXObject:if(flushTextContentItem(),null!=xobjs||(xobjs=resources.get("XObject")||Dict.empty),isValidName=args[0]instanceof Name,name=args[0].name,isValidName&&emptyXObjectCache.getByName(name))break;return void next(new Promise(function(resolveXObject,rejectXObject){if(!isValidName)throw new FormatError("XObject must be referred to by name.");var xobj=xobjs.getRaw(name);if(xobj instanceof Ref){if(emptyXObjectCache.getByRef(xobj))return void resolveXObject();if(self.globalImageCache.getData(xobj,self.pageIndex))return void resolveXObject();xobj=xref.fetch(xobj)}if(!(xobj instanceof BaseStream))throw new FormatError("XObject should be a stream");var matrix,sinkWrapper,dict=xobj["dict"],type=dict.get("Subtype");if(!(type instanceof Name))throw new FormatError("XObject should have a Name subtype");"Form"!==type.name?(emptyXObjectCache.set(name,dict.objId,!0),resolveXObject()):(type=stateManager.state.clone(),type=new StateManager(type),(matrix=lookupMatrix(dict.getArray("Matrix"),null))&&type.transform(matrix),matrix=dict.get("Resources"),enqueueChunk(),sinkWrapper={enqueueInvoked:!1,enqueue(chunk,size){this.enqueueInvoked=!0,sink.enqueue(chunk,size)},get desiredSize(){var _sink$desiredSize;return null!=(_sink$desiredSize=sink.desiredSize)?_sink$desiredSize:0},get ready(){return sink.ready}},self.getTextContent({stream:xobj,task:task,resources:matrix instanceof Dict?matrix:resources,stateManager:type,includeMarkedContent:includeMarkedContent,sink:sink&&sinkWrapper,seenStyles:seenStyles,viewBox:viewBox,lang:lang,markedContentData:markedContentData,disableNormalization:disableNormalization,keepWhiteSpace:keepWhiteSpace,prevRefs:seenRefs}).then(function(){sinkWrapper.enqueueInvoked||emptyXObjectCache.set(name,dict.objId,!0),resolveXObject()},rejectXObject))}).catch(function(reason){if(!(reason instanceof AbortException)){if(!self.options.ignoreErrors)throw reason;warn('getTextContent - ignoring XObject: "'.concat(reason,'".'))}}));case OPS.setGState:if(isValidName=args[0]instanceof Name,name=args[0].name,isValidName&&emptyGStateCache.getByName(name))break;return void next(new Promise(function(resolveGState,rejectGState){if(!isValidName)throw new FormatError("GState must be referred to by name.");var extGState=resources.get("ExtGState");if(!(extGState instanceof Dict))throw new FormatError("ExtGState should be a dictionary.");extGState=extGState.get(name);if(!(extGState instanceof Dict))throw new FormatError("GState should be a dictionary.");var gStateFont=extGState.get("Font");gStateFont?(flushTextContentItem(),textState.fontName=null,textState.fontSize=gStateFont[1],handleSetFont(null,gStateFont[0]).then(resolveGState,rejectGState)):(emptyGStateCache.set(name,extGState.objId,!0),resolveGState())}).catch(function(reason){if(!(reason instanceof AbortException)){if(!self.options.ignoreErrors)throw reason;warn('getTextContent - ignoring ExtGState: "'.concat(reason,'".'))}}));case OPS.beginMarkedContent:flushTextContentItem(),includeMarkedContent&&(markedContentData.level++,textContent.items.push({type:"beginMarkedContent",tag:args[0]instanceof Name?args[0].name:null}));break;case OPS.beginMarkedContentProps:flushTextContentItem(),includeMarkedContent&&(markedContentData.level++,fontNameArg=null,args[1]instanceof Dict&&(fontNameArg=args[1].get("MCID")),textContent.items.push({type:"beginMarkedContentProps",id:Number.isInteger(fontNameArg)?"".concat(self.idFactory.getPageObjId(),"_mc").concat(fontNameArg):null,tag:args[0]instanceof Name?args[0].name:null}));break;case OPS.endMarkedContent:if(flushTextContentItem(),includeMarkedContent){if(0===markedContentData.level)break;markedContentData.level--,textContent.items.push({type:"endMarkedContent"})}break;case OPS.restore:!previousState||previousState.font===textState.font&&previousState.fontSize===textState.fontSize&&previousState.fontName===textState.fontName||flushTextContentItem()}if(textContent.items.length>=(null!=(fn=null==sink?void 0:sink.desiredSize)?fn:1)){stop=!0;break}}stop?next(deferred):(flushTextContentItem(),enqueueChunk(),resolve())}).catch(reason=>{if(!(reason instanceof AbortException)){if(!this.options.ignoreErrors)throw reason;warn('getTextContent - ignoring errors during "'.concat(task.name,'" ')+'task: "'.concat(reason,'".')),flushTextContentItem(),enqueueChunk()}})}async extractDataStructures(dict,properties){var cidToGidBytes,xref=this.xref,toUnicodePromise=this.readToUnicode(properties.toUnicode);if(properties.composite){var cidSystemInfo=dict.get("CIDSystemInfo");cidSystemInfo instanceof Dict&&(properties.cidSystemInfo={registry:stringToPDFString(cidSystemInfo.get("Registry")),ordering:stringToPDFString(cidSystemInfo.get("Ordering")),supplement:cidSystemInfo.get("Supplement")});try{var cidToGidMap=dict.get("CIDToGIDMap");cidToGidMap instanceof BaseStream&&(cidToGidBytes=cidToGidMap.getBytes())}catch(ex){if(!this.options.ignoreErrors)throw ex;warn('extractDataStructures - ignoring CIDToGIDMap data: "'.concat(ex,'".'))}}var differences=[],cidSystemInfo=null;if(dict.has("Encoding")){if((encoding=dict.get("Encoding"))instanceof Dict){if(cidSystemInfo=(cidSystemInfo=encoding.get("BaseEncoding"))instanceof Name?cidSystemInfo.name:null,encoding.has("Differences")){var entry,index=0;for(entry of encoding.get("Differences")){var data=xref.fetchIfRef(entry);if("number"==typeof data)index=data;else{if(!(data instanceof Name))throw new FormatError("Invalid entry in 'Differences' array: ".concat(data));differences[index++]=data.name}}}}else if(encoding instanceof Name)cidSystemInfo=encoding.name;else{cidToGidMap="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new FormatError(cidToGidMap);warn(cidToGidMap)}"MacRomanEncoding"!==cidSystemInfo&&"MacExpertEncoding"!==cidSystemInfo&&"WinAnsiEncoding"!==cidSystemInfo&&(cidSystemInfo=null)}var isSymbolicFont,encoding,cidToGidMap=!properties.file||properties.isInternalFont,isSymbolsFontName=getSymbolsFonts()[properties.name],isNonsymbolicFont=((cidSystemInfo=cidSystemInfo&&cidToGidMap&&isSymbolsFontName?null:cidSystemInfo)?properties.defaultEncoding=getEncoding(cidSystemInfo):(isSymbolicFont=!!(properties.flags&FontFlags.Symbolic),isNonsymbolicFont=!!(properties.flags&FontFlags.Nonsymbolic),encoding=StandardEncoding,"TrueType"!==properties.type||isNonsymbolicFont||(encoding=WinAnsiEncoding),(isSymbolicFont||isSymbolsFontName)&&(encoding=MacRomanEncoding,cidToGidMap)&&(/Symbol/i.test(properties.name)?encoding=SymbolSetEncoding:/Dingbats/i.test(properties.name)?encoding=ZapfDingbatsEncoding:/Wingdings/i.test(properties.name)&&(encoding=WinAnsiEncoding)),properties.defaultEncoding=encoding),properties.differences=differences,properties.baseEncodingName=cidSystemInfo,properties.hasEncoding=!!cidSystemInfo||0<differences.length,properties.dict=dict,properties.toUnicode=await toUnicodePromise,await this.buildToUnicode(properties));return properties.toUnicode=isNonsymbolicFont,cidToGidBytes&&(properties.cidToGidMap=this.readCidToGidMap(cidToGidBytes,isNonsymbolicFont)),properties}_simpleFontToUnicode(properties){var charcode,forceGlyphs=1<arguments.length&&void 0!==arguments[1]&&arguments[1],toUnicode=(assert(!properties.composite,"Must be a simple font."),[]),encoding=properties.defaultEncoding.slice(),baseEncodingName=properties.baseEncodingName,differences=properties.differences;for(charcode in differences){var glyphName=differences[charcode];".notdef"!==glyphName&&(encoding[charcode]=glyphName)}var _charcode2,glyphsUnicodeMap=getGlyphsUnicode();for(_charcode2 in encoding){var _glyphName2=encoding[_charcode2];if(""!==_glyphName2){var unicode=glyphsUnicodeMap[_glyphName2];if(void 0!==unicode)toUnicode[_charcode2]=String.fromCharCode(unicode);else{var code=0;switch(_glyphName2[0]){case"G":3===_glyphName2.length&&(code=parseInt(_glyphName2.substring(1),16));break;case"g":5===_glyphName2.length&&(code=parseInt(_glyphName2.substring(1),16));break;case"C":case"c":if(3<=_glyphName2.length&&_glyphName2.length<=4){var codeStr=_glyphName2.substring(1);if(forceGlyphs){code=parseInt(codeStr,16);break}if(code=+codeStr,Number.isNaN(code)&&Number.isInteger(parseInt(codeStr,16)))return this._simpleFontToUnicode(properties,!0)}break;case"u":-1!==(unicode=getUnicodeForGlyph(_glyphName2,glyphsUnicodeMap))&&(code=unicode);break;default:switch(_glyphName2){case"f_h":case"f_t":case"T_h":toUnicode[_charcode2]=_glyphName2.replaceAll("_","");continue}}if(0<code&&code<=1114111&&Number.isInteger(code)){if(baseEncodingName&&code===+_charcode2){var baseEncoding=getEncoding(baseEncodingName);if(baseEncoding&&(_glyphName2=baseEncoding[_charcode2])){toUnicode[_charcode2]=String.fromCharCode(glyphsUnicodeMap[_glyphName2]);continue}}toUnicode[_charcode2]=String.fromCodePoint(code)}}}}return toUnicode}async buildToUnicode(properties){var ordering,_properties$toUnicode,ucs2CMap,toUnicode,buf;return properties.hasIncludedToUnicodeMap=0<(null==(_properties$toUnicode=properties.toUnicode)?void 0:_properties$toUnicode.length),properties.hasIncludedToUnicodeMap?(!properties.composite&&properties.hasEncoding&&(properties.fallbackToUnicode=this._simpleFontToUnicode(properties)),properties.toUnicode):properties.composite?!properties.composite||(!properties.cMap.builtInCMap||properties.cMap instanceof IdentityCMap)&&("Adobe"!==(null==(_properties$toUnicode=properties.cidSystemInfo)?void 0:_properties$toUnicode.registry)||"GB1"!==properties.cidSystemInfo.ordering&&"CNS1"!==properties.cidSystemInfo.ordering&&"Japan1"!==properties.cidSystemInfo.ordering&&"Korea1"!==properties.cidSystemInfo.ordering)?new IdentityToUnicodeMap(properties.firstChar,properties.lastChar):({registry:_properties$toUnicode,ordering}=properties.cidSystemInfo,_properties$toUnicode=Name.get("".concat(_properties$toUnicode,"-").concat(ordering,"-UCS2")),ucs2CMap=await CMapFactory.create({encoding:_properties$toUnicode,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),toUnicode=[],buf=[],properties.cMap.forEach(function(charcode,cid){if(65535<cid)throw new FormatError("Max size of CID is 65,535");var ucs2=ucs2CMap.lookup(cid);if(ucs2){for(var i=buf.length=0,ii=ucs2.length;i<ii;i+=2)buf.push((ucs2.charCodeAt(i)<<8)+ucs2.charCodeAt(i+1));toUnicode[charcode]=String.fromCharCode(...buf)}}),new ToUnicodeMap(toUnicode)):new ToUnicodeMap(this._simpleFontToUnicode(properties))}async readToUnicode(cmapObj){if(cmapObj){var cmap;if(cmapObj instanceof Name)return(cmap=await CMapFactory.create({encoding:cmapObj,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}))instanceof IdentityCMap?new IdentityToUnicodeMap(0,65535):new ToUnicodeMap(cmap.getMap());if(cmapObj instanceof BaseStream)try{var map,_cmap=await CMapFactory.create({encoding:cmapObj,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return _cmap instanceof IdentityCMap?new IdentityToUnicodeMap(0,65535):(map=new Array(_cmap.length),_cmap.forEach(function(charCode,token){if("number"==typeof token)map[charCode]=String.fromCodePoint(token);else{token.length%2!=0&&(token="\0"+token);for(var str=[],k=0;k<token.length;k+=2){var w2,w1=token.charCodeAt(k)<<8|token.charCodeAt(k+1);55296!=(63488&w1)?str.push(w1):(k+=2,w2=token.charCodeAt(k)<<8|token.charCodeAt(k+1),str.push(((1023&w1)<<10)+(1023&w2)+65536))}map[charCode]=String.fromCodePoint(...str)}}),new ToUnicodeMap(map))}catch(reason){if(reason instanceof AbortException)return null;if(this.options.ignoreErrors)return warn('readToUnicode - ignoring ToUnicode data: "'.concat(reason,'".')),null;throw reason}}return null}readCidToGidMap(glyphsData,toUnicode){for(var result=[],j=0,jj=glyphsData.length;j<jj;j++){var glyphID=glyphsData[j++]<<8|glyphsData[j],code=j>>1;0==glyphID&&!toUnicode.has(code)||(result[code]=glyphID)}return result}extractWidths(dict,descriptor,properties){var xref=this.xref,glyphsWidths=[],defaultWidth=0,glyphsVMetrics=[];if(properties.composite){var dw=dict.get("DW"),defaultWidth="number"==typeof dw?Math.ceil(dw):1e3,widths=dict.get("W");if(Array.isArray(widths))for(var i=0,ii=widths.length;i<ii;i++){var start=xref.fetchIfRef(widths[i++]);if(!Number.isInteger(start))break;var code=xref.fetchIfRef(widths[i]);if(Array.isArray(code))for(var c of code){c=xref.fetchIfRef(c);"number"==typeof c&&(glyphsWidths[start]=c),start++}else{if(!Number.isInteger(code))break;var _width2=xref.fetchIfRef(widths[++i]);if("number"==typeof _width2)for(var j=start;j<=code;j++)glyphsWidths[j]=_width2}}if(properties.vertical){var dw=dict.getArray("DW2"),defaultVMetrics=[(vmetrics=isNumberArray(dw,2)?dw:[880,-1e3])[1],.5*defaultWidth,vmetrics[0]],vmetrics=dict.get("W2");if(Array.isArray(vmetrics))for(var _i41=0,_ii11=vmetrics.length;_i41<_ii11;_i41++){var _start=xref.fetchIfRef(vmetrics[_i41++]);if(!Number.isInteger(_start))break;var _code=xref.fetchIfRef(vmetrics[_i41]);if(Array.isArray(_code))for(var _j7=0,jj=_code.length;_j7<jj;_j7++){var vmetric=[xref.fetchIfRef(_code[_j7++]),xref.fetchIfRef(_code[_j7++]),xref.fetchIfRef(_code[_j7])];isNumberArray(vmetric,null)&&(glyphsVMetrics[_start]=vmetric),_start++}else{if(!Number.isInteger(_code))break;var _vmetric=[xref.fetchIfRef(vmetrics[++_i41]),xref.fetchIfRef(vmetrics[++_i41]),xref.fetchIfRef(vmetrics[++_i41])];if(isNumberArray(_vmetric,null))for(var _j8=_start;_j8<=_code;_j8++)glyphsVMetrics[_j8]=_vmetric}}}}else{dw=dict.get("Widths");if(Array.isArray(dw)){var w,_j9=properties.firstChar;for(w of dw){var _width3=xref.fetchIfRef(w);"number"==typeof _width3&&(glyphsWidths[_j9]=_width3),_j9++}dw=descriptor.get("MissingWidth");defaultWidth="number"==typeof dw?dw:0}else{descriptor=dict.get("BaseFont");descriptor instanceof Name&&(dw=this.getBaseFontMetrics(descriptor.name),glyphsWidths=this.buildCharCodeToWidth(dw.widths,properties),defaultWidth=dw.defaultWidth)}}var glyph,isMonospace=!0,firstWidth=defaultWidth;for(glyph in glyphsWidths){var glyphWidth=glyphsWidths[glyph];if(glyphWidth)if(firstWidth){if(firstWidth!==glyphWidth){isMonospace=!1;break}}else firstWidth=glyphWidth}isMonospace?properties.flags|=FontFlags.FixedPitch:properties.flags&=~FontFlags.FixedPitch,properties.defaultWidth=defaultWidth,properties.widths=glyphsWidths,properties.defaultVMetrics=defaultVMetrics,properties.vmetrics=glyphsVMetrics}isSerifFont(baseFontName){baseFontName=baseFontName.split("-",1)[0];return baseFontName in getSerifFonts()||/serif/gi.test(baseFontName)}getBaseFontMetrics(name){var defaultWidth=0,widths=Object.create(null),monospace=!1,lookupName=getStdFontMap()[name]||name,Metrics=getMetrics(),Metrics=Metrics[lookupName=lookupName in Metrics?lookupName:this.isSerifFont(name)?"Times-Roman":"Helvetica"];return"number"==typeof Metrics?(defaultWidth=Metrics,monospace=!0):widths=Metrics(),{defaultWidth:defaultWidth,monospace:monospace,widths:widths}}buildCharCodeToWidth(widthsByGlyphName,properties){for(var widths=Object.create(null),differences=properties.differences,encoding=properties.defaultEncoding,charCode=0;charCode<256;charCode++)charCode in differences&&widthsByGlyphName[differences[charCode]]?widths[charCode]=widthsByGlyphName[differences[charCode]]:charCode in encoding&&widthsByGlyphName[encoding[charCode]]&&(widths[charCode]=widthsByGlyphName[encoding[charCode]]);return widths}preEvaluateFont(dict){var baseDict=dict,type=dict.get("Subtype");if(!(type instanceof Name))throw new FormatError("invalid font Subtype");var composite=!1;if("Type0"===type.name){var df=dict.get("DescendantFonts");if(!df)throw new FormatError("Descendant fonts are not specified");if(!((dict=Array.isArray(df)?this.xref.fetchIfRef(df[0]):df)instanceof Dict))throw new FormatError("Descendant font is not a dictionary.");if(!((type=dict.get("Subtype"))instanceof Name))throw new FormatError("invalid font Subtype");composite=!0}var df=dict.get("FirstChar"),lastChar=(Number.isInteger(df)||(df=0),dict.get("LastChar")),descriptor=(Number.isInteger(lastChar)||(lastChar=composite?65535:255),dict.get("FontDescriptor")),toUnicode=dict.get("ToUnicode")||baseDict.get("ToUnicode");if(descriptor){var hash=new MurmurHash3_64,encoding=baseDict.getRaw("Encoding");if(encoding instanceof Name)hash.update(encoding.name);else if(encoding instanceof Ref)hash.update(encoding.toString());else if(encoding instanceof Dict)for(var entry of encoding.getRawValues())if(entry instanceof Name)hash.update(entry.name);else if(entry instanceof Ref)hash.update(entry.toString());else if(Array.isArray(entry)){for(var diffLength=entry.length,diffBuf=new Array(diffLength),j=0;j<diffLength;j++){var diffEntry=entry[j];diffEntry instanceof Name?diffBuf[j]=diffEntry.name:("number"==typeof diffEntry||diffEntry instanceof Ref)&&(diffBuf[j]=diffEntry.toString())}hash.update(diffBuf.join())}hash.update("".concat(df,"-").concat(lastChar)),toUnicode instanceof BaseStream?(encoding=(encoding=toUnicode.str||toUnicode).buffer?new Uint8Array(encoding.buffer.buffer,0,encoding.bufferLength):new Uint8Array(encoding.bytes.buffer,encoding.start,encoding.end-encoding.start),hash.update(encoding)):toUnicode instanceof Name&&hash.update(toUnicode.name);encoding=dict.get("Widths")||baseDict.get("Widths");if(Array.isArray(encoding)){var _entry,widthsBuf=[];for(_entry of encoding)("number"==typeof _entry||_entry instanceof Ref)&&widthsBuf.push(_entry.toString());hash.update(widthsBuf.join())}if(composite){hash.update("compositeFont");encoding=dict.get("W")||baseDict.get("W");if(Array.isArray(encoding)){var _entry2,_widthsBuf=[];for(_entry2 of encoding)if("number"==typeof _entry2||_entry2 instanceof Ref)_widthsBuf.push(_entry2.toString());else if(Array.isArray(_entry2)){var element,subWidthsBuf=[];for(element of _entry2)("number"==typeof element||element instanceof Ref)&&subWidthsBuf.push(element.toString());_widthsBuf.push("[".concat(subWidthsBuf.join(),"]"))}hash.update(_widthsBuf.join())}encoding=dict.getRaw("CIDToGIDMap")||baseDict.getRaw("CIDToGIDMap");encoding instanceof Name?hash.update(encoding.name):encoding instanceof Ref?hash.update(encoding.toString()):encoding instanceof BaseStream&&hash.update(encoding.peekBytes())}}return{descriptor:descriptor,dict:dict,baseDict:baseDict,composite:composite,type:type.name,firstChar:df,lastChar:lastChar,toUnicode:toUnicode,hash:hash?hash.hexdigest():""}}async translateFont(_ref40){var{descriptor:_ref40,dict,baseDict,composite,type,firstChar,lastChar,toUnicode,cssFontInfo}=_ref40,isType3Font="Type3"===type;if(!_ref40){if(!isType3Font){if(!((baseFontName=dict.get("BaseFont"))instanceof Name))throw new FormatError("Base font is not specified");var baseFontName=baseFontName.name.replaceAll(/[,_]/g,"-"),metrics=this.getBaseFontMetrics(baseFontName),fontNameWoStyle=baseFontName.split("-",1)[0],fontNameWoStyle=(this.isSerifFont(fontNameWoStyle)?FontFlags.Serif:0)|(metrics.monospace?FontFlags.FixedPitch:0)|(getSymbolsFonts()[fontNameWoStyle]?FontFlags.Symbolic:FontFlags.Nonsymbolic),fontNameWoStyle={type:type,name:baseFontName,loadedName:baseDict.loadedName,systemFontInfo:null,widths:metrics.widths,defaultWidth:metrics.defaultWidth,isSimulatedFlags:!0,flags:fontNameWoStyle,firstChar:firstChar,lastChar:lastChar,toUnicode:toUnicode,xHeight:0,capHeight:0,italicAngle:0,isType3Font:isType3Font},widths=dict.get("Widths"),standardFontName=getStandardFontName(baseFontName),file=null,standardFontName=(standardFontName&&(file=await this.fetchStandardFontData(standardFontName),fontNameWoStyle.isInternalFont=!!file),!fontNameWoStyle.isInternalFont&&this.options.useSystemFonts&&(fontNameWoStyle.systemFontInfo=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,baseFontName,standardFontName,type)),await this.extractDataStructures(dict,fontNameWoStyle));if(Array.isArray(widths)){var w,glyphWidths=[],j=firstChar;for(w of widths){var width=this.xref.fetchIfRef(w);"number"==typeof width&&(glyphWidths[j]=width),j++}standardFontName.widths=glyphWidths}else standardFontName.widths=this.buildCharCodeToWidth(metrics.widths,standardFontName);return new Font(baseFontName,file,standardFontName,this.options)}_ref40=Dict.empty}var fontFile,length3,fontNameWoStyle=_ref40.get("FontName"),widths=dict.get("BaseFont"),metrics=("string"==typeof fontNameWoStyle&&(fontNameWoStyle=Name.get(fontNameWoStyle)),"string"==typeof widths&&(widths=Name.get(widths)),null==fontNameWoStyle?void 0:fontNameWoStyle.name),baseFontName=null==widths?void 0:widths.name;if(isType3Font?metrics||(fontNameWoStyle=Name.get(type)):metrics!==baseFontName&&(info("The FontDescriptor's FontName is \"".concat(metrics,'" but ')+"should be the same as the Font's BaseFont \"".concat(baseFontName,'".')),fontNameWoStyle=(fontNameWoStyle=metrics&&baseFontName&&(baseFontName.startsWith(metrics)||!isKnownFontName(metrics)&&isKnownFontName(baseFontName))?null:fontNameWoStyle)||widths),!(fontNameWoStyle instanceof Name))throw new FormatError("invalid font name");try{if(fontFile=_ref40.get("FontFile","FontFile2","FontFile3")){if(!(fontFile instanceof BaseStream))throw new FormatError("FontFile should be a stream");if(fontFile.isEmpty)throw new FormatError("FontFile is empty")}}catch(ex){if(!this.options.ignoreErrors)throw ex;warn('translateFont - fetching "'.concat(fontNameWoStyle.name,'" font file: "').concat(ex,'".')),fontFile=null}var subtype,length1,file=!1,standardFontName=null,metrics=null,widths=(fontFile?fontFile.dict&&((baseFontName=fontFile.dict.get("Subtype"))instanceof Name&&(subtype=baseFontName.name),length1=fontFile.dict.get("Length1"),length2=fontFile.dict.get("Length2"),length3=fontFile.dict.get("Length3")):cssFontInfo?(widths=getXfaFontName(fontNameWoStyle.name))&&(cssFontInfo.fontFamily="".concat(cssFontInfo.fontFamily,"-PdfJS-XFA"),cssFontInfo.metrics=widths.metrics||null,standardFontName=widths.factors||null,file=!!(fontFile=await this.fetchStandardFontData(widths.name)),baseDict=dict=getXfaFontDict(fontNameWoStyle.name),composite=!0):isType3Font||!(file=(baseFontName=getStandardFontName(fontNameWoStyle.name))?!!(fontFile=await this.fetchStandardFontData(baseFontName)):file)&&this.options.useSystemFonts&&(metrics=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,fontNameWoStyle.name,baseFontName,type)),lookupMatrix(dict.getArray("FontMatrix"),FONT_IDENTITY_MATRIX)),baseFontName=lookupNormalRect(_ref40.getArray("FontBBox")||dict.getArray("FontBBox"),isType3Font?[0,0,0,0]:void 0),ascent=_ref40.get("Ascent"),descent=("number"!=typeof ascent&&(ascent=void 0),_ref40.get("Descent")),xHeight=("number"!=typeof descent&&(descent=void 0),_ref40.get("XHeight")),capHeight=("number"!=typeof xHeight&&(xHeight=0),_ref40.get("CapHeight")),flags=("number"!=typeof capHeight&&(capHeight=0),_ref40.get("Flags")),italicAngle=(Number.isInteger(flags)||(flags=0),_ref40.get("ItalicAngle")),type={type:type,name:fontNameWoStyle.name,subtype:subtype,file:fontFile,length1:length1,length2:length2,length3:length3,isInternalFont:file,loadedName:baseDict.loadedName,composite:composite,fixedPitch:!1,fontMatrix:widths,firstChar:firstChar,lastChar:lastChar,toUnicode:toUnicode,bbox:baseFontName,ascent:ascent,descent:descent,xHeight:xHeight,capHeight:capHeight,flags:flags,italicAngle:italicAngle="number"!=typeof italicAngle?0:italicAngle,isType3Font:isType3Font,cssFontInfo:cssFontInfo,scaleFactors:standardFontName,systemFontInfo:metrics},length2=(composite&&((subtype=baseDict.get("Encoding"))instanceof Name&&(type.cidEncoding=subtype.name),length1=await CMapFactory.create({encoding:subtype,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),type.cMap=length1,type.vertical=type.cMap.vertical),await this.extractDataStructures(dict,type));return this.extractWidths(dict,_ref40,length2),new Font(fontNameWoStyle.name,fontFile,length2,this.options)}static buildFontPaths(font,glyphs,handler,evaluatorOptions){function buildPath(fontChar){var glyphName="".concat(font.loadedName,"_path_").concat(fontChar);try{font.renderer.hasBuiltPath(fontChar)||handler.send("commonobj",[glyphName,"FontPath",font.renderer.getPathJs(fontChar)])}catch(reason){if(!evaluatorOptions.ignoreErrors)throw reason;warn("buildFontPaths - ignoring ".concat(glyphName,' glyph: "').concat(reason,'".'))}}for(var glyph of glyphs){buildPath(glyph.fontChar);glyph=glyph.accent;null!=glyph&&glyph.fontChar&&buildPath(glyph.fontChar)}}static get fallbackFontDict(){var dict=new Dict;return dict.set("BaseFont",Name.get("Helvetica")),dict.set("Type",Name.get("FallbackType")),dict.set("Subtype",Name.get("FallbackType")),dict.set("Encoding",Name.get("WinAnsiEncoding")),shadow(this,"fallbackFontDict",dict)}}var _sent=new WeakMap,_type3Loaded=new WeakMap,_TranslatedFont_brand=new WeakSet;class TranslatedFont{constructor(_ref41){var{loadedName:_ref41,font,dict}=_ref41;_classPrivateMethodInitSpec(this,_TranslatedFont_brand),_classPrivateFieldInitSpec(this,_sent,!1),_classPrivateFieldInitSpec(this,_type3Loaded,null),this.loadedName=_ref41,this.font=font,this.dict=dict,this.type3Dependencies=font.isType3Font?new Set:null}send(handler){_classPrivateFieldGet(_sent,this)||(_classPrivateFieldSet(_sent,this,!0),handler.send("commonobj",[this.loadedName,"Font",this.font.exportData()]))}fallback(handler,evaluatorOptions){this.font.data&&(this.font.disableFontFace=!0,PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,handler,evaluatorOptions))}loadType3Data(evaluator,resources,task){var _this4=this;if(!_classPrivateFieldGet(_type3Loaded,this)){var key,{font,type3Dependencies}=this,type3Evaluator=(assert(font.isType3Font,"Must be a Type3 font."),evaluator.clone({ignoreErrors:!1})),evaluator=new RefSet(evaluator.type3FontRefs),loadCharProcsPromise=(this.dict.objId&&!evaluator.has(this.dict.objId)&&evaluator.put(this.dict.objId),type3Evaluator.type3FontRefs=evaluator,Promise.resolve()),charProcs=this.dict.get("CharProcs"),fontResources=this.dict.get("Resources")||resources,charProcOperatorList=Object.create(null),[evaluator,resources,x1,y1]=font.bbox,fontBBoxSize=Math.hypot(x1-evaluator,y1-resources);for(key of charProcs.getKeys())!function(key){loadCharProcsPromise=loadCharProcsPromise.then(()=>{var glyphStream=charProcs.get(key),operatorList=new OperatorList;return type3Evaluator.getOperatorList({stream:glyphStream,task:task,resources:fontResources,operatorList:operatorList}).then(()=>{switch(operatorList.fnArray[0]){case OPS.setCharWidthAndBounds:_assertClassBrand(_TranslatedFont_brand,_this4,_removeType3ColorOperators).call(_this4,operatorList,fontBBoxSize);break;case OPS.setCharWidth:fontBBoxSize||_assertClassBrand(_TranslatedFont_brand,_this4,_guessType3FontBBox).call(_this4,operatorList)}charProcOperatorList[key]=operatorList.getIR();for(var dependency of operatorList.dependencies)type3Dependencies.add(dependency)}).catch(function(reason){warn('Type3 font resource "'.concat(key,'" is not available.'));var dummyOperatorList=new OperatorList;charProcOperatorList[key]=dummyOperatorList.getIR()})})}(key);_classPrivateFieldSet(_type3Loaded,this,loadCharProcsPromise.then(()=>{font.charProcOperatorList=charProcOperatorList,this._bbox&&(font.isCharBBox=!0,font.bbox=this._bbox)}))}return _classPrivateFieldGet(_type3Loaded,this)}}function _removeType3ColorOperators(operatorList){for(var fontBBoxSize=1<arguments.length&&void 0!==arguments[1]?arguments[1]:NaN,charBBox=Util.normalizeRect(operatorList.argsArray[0].slice(2)),width=charBBox[2]-charBBox[0],height=charBBox[3]-charBBox[1],charBBoxSize=Math.hypot(width,height),i=(0==width||0==height?(operatorList.fnArray.splice(0,1),operatorList.argsArray.splice(0,1)):(0===fontBBoxSize||10<=Math.round(charBBoxSize/fontBBoxSize))&&(null==this._bbox&&(this._bbox=[1/0,1/0,-1/0,-1/0]),Util.rectBoundingBox(...charBBox,this._bbox)),0),ii=operatorList.length;i<ii;){switch(operatorList.fnArray[i]){case OPS.setCharWidthAndBounds:break;case OPS.setStrokeColorSpace:case OPS.setFillColorSpace:case OPS.setStrokeColor:case OPS.setStrokeColorN:case OPS.setFillColor:case OPS.setFillColorN:case OPS.setStrokeGray:case OPS.setFillGray:case OPS.setStrokeRGBColor:case OPS.setFillRGBColor:case OPS.setStrokeCMYKColor:case OPS.setFillCMYKColor:case OPS.shadingFill:case OPS.setRenderingIntent:operatorList.fnArray.splice(i,1),operatorList.argsArray.splice(i,1),ii--;continue;case OPS.setGState:for(var[gStateObj]=operatorList.argsArray[i],j=0,jj=gStateObj.length;j<jj;){var[gStateKey]=gStateObj[j];switch(gStateKey){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":gStateObj.splice(j,1),jj--;continue}j++}}i++}}function _guessType3FontBBox(operatorList){for(var minMax,i=1,ii=operatorList.length;i<ii;)operatorList.fnArray[i]===OPS.constructPath&&(minMax=operatorList.argsArray[i][2],null==this._bbox&&(this._bbox=[1/0,1/0,-1/0,-1/0]),Util.rectBoundingBox(...minMax,this._bbox)),i++}class StateManager{constructor(){var initialState=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new EvalState;this.state=initialState,this.stateStack=[]}save(){var old=this.state;this.stateStack.push(this.state),this.state=old.clone()}restore(){var prev=this.stateStack.pop();prev&&(this.state=prev)}transform(args){this.state.ctm=Util.transform(this.state.ctm,args)}}class TextState{constructor(){this.ctm=new Float32Array(IDENTITY_MATRIX),this.fontName=null,this.fontSize=0,this.loadedName=null,this.font=null,this.fontMatrix=FONT_IDENTITY_MATRIX,this.textMatrix=IDENTITY_MATRIX.slice(),this.textLineMatrix=IDENTITY_MATRIX.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}setTextMatrix(a,b,c,d,e,f){var m=this.textMatrix;m[0]=a,m[1]=b,m[2]=c,m[3]=d,m[4]=e,m[5]=f}setTextLineMatrix(a,b,c,d,e,f){var m=this.textLineMatrix;m[0]=a,m[1]=b,m[2]=c,m[3]=d,m[4]=e,m[5]=f}translateTextMatrix(x,y){var m=this.textMatrix;m[4]=m[0]*x+m[2]*y+m[4],m[5]=m[1]*x+m[3]*y+m[5]}translateTextLineMatrix(x,y){var m=this.textLineMatrix;m[4]=m[0]*x+m[2]*y+m[4],m[5]=m[1]*x+m[3]*y+m[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()}clone(){var clone=Object.create(this);return clone.textMatrix=this.textMatrix.slice(),clone.textLineMatrix=this.textLineMatrix.slice(),clone.fontMatrix=this.fontMatrix.slice(),clone}}class EvalState{constructor(){this.ctm=new Float32Array(IDENTITY_MATRIX),this.font=null,this.textRenderingMode=TextRenderingMode.FILL,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(colorSpace){this._fillColorSpace=this.patternFillColorSpace=colorSpace}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(colorSpace){this._strokeColorSpace=this.patternStrokeColorSpace=colorSpace}clone(){var{newPath=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},clone=Object.create(this);return newPath&&(clone.pathBuffer=[],clone.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])),clone}}class EvaluatorPreprocessor{static get opMap(){return shadow(this,"opMap",Object.assign(Object.create(null),{w:{id:OPS.setLineWidth,numArgs:1,variableArgs:!1},J:{id:OPS.setLineCap,numArgs:1,variableArgs:!1},j:{id:OPS.setLineJoin,numArgs:1,variableArgs:!1},M:{id:OPS.setMiterLimit,numArgs:1,variableArgs:!1},d:{id:OPS.setDash,numArgs:2,variableArgs:!1},ri:{id:OPS.setRenderingIntent,numArgs:1,variableArgs:!1},i:{id:OPS.setFlatness,numArgs:1,variableArgs:!1},gs:{id:OPS.setGState,numArgs:1,variableArgs:!1},q:{id:OPS.save,numArgs:0,variableArgs:!1},Q:{id:OPS.restore,numArgs:0,variableArgs:!1},cm:{id:OPS.transform,numArgs:6,variableArgs:!1},m:{id:OPS.moveTo,numArgs:2,variableArgs:!1},l:{id:OPS.lineTo,numArgs:2,variableArgs:!1},c:{id:OPS.curveTo,numArgs:6,variableArgs:!1},v:{id:OPS.curveTo2,numArgs:4,variableArgs:!1},y:{id:OPS.curveTo3,numArgs:4,variableArgs:!1},h:{id:OPS.closePath,numArgs:0,variableArgs:!1},re:{id:OPS.rectangle,numArgs:4,variableArgs:!1},S:{id:OPS.stroke,numArgs:0,variableArgs:!1},s:{id:OPS.closeStroke,numArgs:0,variableArgs:!1},f:{id:OPS.fill,numArgs:0,variableArgs:!1},F:{id:OPS.fill,numArgs:0,variableArgs:!1},"f*":{id:OPS.eoFill,numArgs:0,variableArgs:!1},B:{id:OPS.fillStroke,numArgs:0,variableArgs:!1},"B*":{id:OPS.eoFillStroke,numArgs:0,variableArgs:!1},b:{id:OPS.closeFillStroke,numArgs:0,variableArgs:!1},"b*":{id:OPS.closeEOFillStroke,numArgs:0,variableArgs:!1},n:{id:OPS.endPath,numArgs:0,variableArgs:!1},W:{id:OPS.clip,numArgs:0,variableArgs:!1},"W*":{id:OPS.eoClip,numArgs:0,variableArgs:!1},BT:{id:OPS.beginText,numArgs:0,variableArgs:!1},ET:{id:OPS.endText,numArgs:0,variableArgs:!1},Tc:{id:OPS.setCharSpacing,numArgs:1,variableArgs:!1},Tw:{id:OPS.setWordSpacing,numArgs:1,variableArgs:!1},Tz:{id:OPS.setHScale,numArgs:1,variableArgs:!1},TL:{id:OPS.setLeading,numArgs:1,variableArgs:!1},Tf:{id:OPS.setFont,numArgs:2,variableArgs:!1},Tr:{id:OPS.setTextRenderingMode,numArgs:1,variableArgs:!1},Ts:{id:OPS.setTextRise,numArgs:1,variableArgs:!1},Td:{id:OPS.moveText,numArgs:2,variableArgs:!1},TD:{id:OPS.setLeadingMoveText,numArgs:2,variableArgs:!1},Tm:{id:OPS.setTextMatrix,numArgs:6,variableArgs:!1},"T*":{id:OPS.nextLine,numArgs:0,variableArgs:!1},Tj:{id:OPS.showText,numArgs:1,variableArgs:!1},TJ:{id:OPS.showSpacedText,numArgs:1,variableArgs:!1},"'":{id:OPS.nextLineShowText,numArgs:1,variableArgs:!1},'"':{id:OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1},d0:{id:OPS.setCharWidth,numArgs:2,variableArgs:!1},d1:{id:OPS.setCharWidthAndBounds,numArgs:6,variableArgs:!1},CS:{id:OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1},cs:{id:OPS.setFillColorSpace,numArgs:1,variableArgs:!1},SC:{id:OPS.setStrokeColor,numArgs:4,variableArgs:!0},SCN:{id:OPS.setStrokeColorN,numArgs:33,variableArgs:!0},sc:{id:OPS.setFillColor,numArgs:4,variableArgs:!0},scn:{id:OPS.setFillColorN,numArgs:33,variableArgs:!0},G:{id:OPS.setStrokeGray,numArgs:1,variableArgs:!1},g:{id:OPS.setFillGray,numArgs:1,variableArgs:!1},RG:{id:OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1},rg:{id:OPS.setFillRGBColor,numArgs:3,variableArgs:!1},K:{id:OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1},k:{id:OPS.setFillCMYKColor,numArgs:4,variableArgs:!1},sh:{id:OPS.shadingFill,numArgs:1,variableArgs:!1},BI:{id:OPS.beginInlineImage,numArgs:0,variableArgs:!1},ID:{id:OPS.beginImageData,numArgs:0,variableArgs:!1},EI:{id:OPS.endInlineImage,numArgs:1,variableArgs:!1},Do:{id:OPS.paintXObject,numArgs:1,variableArgs:!1},MP:{id:OPS.markPoint,numArgs:1,variableArgs:!1},DP:{id:OPS.markPointProps,numArgs:2,variableArgs:!1},BMC:{id:OPS.beginMarkedContent,numArgs:1,variableArgs:!1},BDC:{id:OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1},EMC:{id:OPS.endMarkedContent,numArgs:0,variableArgs:!1},BX:{id:OPS.beginCompat,numArgs:0,variableArgs:!1},EX:{id:OPS.endCompat,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}constructor(stream,xref){var stateManager=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new StateManager;this.parser=new Parser({lexer:new Lexer(stream,EvaluatorPreprocessor.opMap),xref:xref}),this.stateManager=stateManager,this.nonProcessedArgs=[],this._isPathOp=!1,this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(operation){for(var args=operation.args;;){var obj=this.parser.getObj();if(obj instanceof Cmd){var cmd=obj.cmd,opSpec=EvaluatorPreprocessor.opMap[cmd];if(!opSpec){warn('Unknown command "'.concat(cmd,'".'));continue}var fn=opSpec.id,numArgs=opSpec.numArgs,argsLength=null!==args?args.length:0;if(this._isPathOp||(this._numInvalidPathOPS=0),this._isPathOp=fn>=OPS.moveTo&&fn<=OPS.endPath,opSpec.variableArgs)numArgs<argsLength&&info("Command ".concat(cmd,": expected [0, ").concat(numArgs,"] args, ")+"but received ".concat(argsLength," args."));else{if(argsLength!==numArgs){for(var nonProcessedArgs=this.nonProcessedArgs;numArgs<argsLength;)nonProcessedArgs.push(args.shift()),argsLength--;for(;argsLength<numArgs&&0!==nonProcessedArgs.length;)(args=null===args?[]:args).unshift(nonProcessedArgs.pop()),argsLength++}if(argsLength<numArgs){opSpec="command ".concat(cmd,": expected ").concat(numArgs," args, ")+"but received ".concat(argsLength," args.");if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new FormatError("Invalid ".concat(opSpec));warn("Skipping ".concat(opSpec)),null!==args&&(args.length=0);continue}}return this.preprocessCommand(fn,args),operation.fn=fn,operation.args=args,!0}if(obj===EOF)return!1;if(null!==obj&&((args=null===args?[]:args).push(obj),33<args.length))throw new FormatError("Too many arguments")}}preprocessCommand(fn,args){switch(0|fn){case OPS.save:this.stateManager.save();break;case OPS.restore:this.stateManager.restore();break;case OPS.transform:this.stateManager.transform(args)}}}_defineProperty(EvaluatorPreprocessor,"MAX_INVALID_PATH_OPS",10);class DefaultAppearanceEvaluator extends EvaluatorPreprocessor{constructor(str){super(new StringStream(str))}parse(){var operation={fn:0,args:[]},result={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){if(operation.args.length=0,!this.read(operation))break;if(0===this.savedStatesDepth){var{fn,args}=operation;switch(0|fn){case OPS.setFont:var[fontName,fontSize]=args;fontName instanceof Name&&(result.fontName=fontName.name),"number"==typeof fontSize&&0<fontSize&&(result.fontSize=fontSize);break;case OPS.setFillRGBColor:ColorSpaceUtils.rgb.getRgbItem(args,0,result.fontColor,0);break;case OPS.setFillGray:ColorSpaceUtils.gray.getRgbItem(args,0,result.fontColor,0);break;case OPS.setFillCMYKColor:ColorSpaceUtils.cmyk.getRgbItem(args,0,result.fontColor,0)}}}}catch(reason){warn('parseDefaultAppearance - ignoring errors: "'.concat(reason,'".'))}return result}}function parseDefaultAppearance(str){return new DefaultAppearanceEvaluator(str).parse()}class AppearanceStreamEvaluator extends EvaluatorPreprocessor{constructor(stream,evaluatorOptions,xref,globalColorSpaceCache){super(stream),this.stream=stream,this.evaluatorOptions=evaluatorOptions,this.xref=xref,this.globalColorSpaceCache=globalColorSpaceCache,this.resources=null==(evaluatorOptions=stream.dict)?void 0:evaluatorOptions.get("Resources")}parse(){var operation={fn:0,args:[]},result={scaleFactor:1,fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3),fillColorSpace:ColorSpaceUtils.gray},breakLoop=!1,stack=[];try{for(;;){if(operation.args.length=0,breakLoop||!this.read(operation))break;var{fn,args}=operation;switch(0|fn){case OPS.save:stack.push({scaleFactor:result.scaleFactor,fontSize:result.fontSize,fontName:result.fontName,fontColor:result.fontColor.slice(),fillColorSpace:result.fillColorSpace});break;case OPS.restore:result=stack.pop()||result;break;case OPS.setTextMatrix:result.scaleFactor*=Math.hypot(args[0],args[1]);break;case OPS.setFont:var[fontName,fontSize]=args;fontName instanceof Name&&(result.fontName=fontName.name),"number"==typeof fontSize&&0<fontSize&&(result.fontSize=fontSize*result.scaleFactor);break;case OPS.setFillColorSpace:result.fillColorSpace=ColorSpaceUtils.parse({cs:args[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case OPS.setFillColor:result.fillColorSpace.getRgbItem(args,0,result.fontColor,0);break;case OPS.setFillRGBColor:ColorSpaceUtils.rgb.getRgbItem(args,0,result.fontColor,0);break;case OPS.setFillGray:ColorSpaceUtils.gray.getRgbItem(args,0,result.fontColor,0);break;case OPS.setFillCMYKColor:ColorSpaceUtils.cmyk.getRgbItem(args,0,result.fontColor,0);break;case OPS.showText:case OPS.showSpacedText:case OPS.nextLineShowText:case OPS.nextLineSetSpacingShowText:breakLoop=!0}}}catch(reason){warn('parseAppearanceStream - ignoring errors: "'.concat(reason,'".'))}return this.stream.reset(),delete result.scaleFactor,delete result.fillColorSpace,result}get _localColorSpaceCache(){return shadow(this,"_localColorSpaceCache",new LocalColorSpaceCache)}get _pdfFunctionFactory(){return shadow(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}}function parseAppearanceStream(stream,evaluatorOptions,xref,globalColorSpaceCache){return new AppearanceStreamEvaluator(stream,evaluatorOptions,xref,globalColorSpaceCache).parse()}function getPdfColor(color,isFill){var gray;return color[0]===color[1]&&color[1]===color[2]?(gray=color[0]/255,"".concat(numberToString(gray)," ").concat(isFill?"g":"G")):Array.from(color,c=>numberToString(c/255)).join(" ")+" ".concat(isFill?"rg":"RG")}function createDefaultAppearance(_ref42){var{fontSize:_ref42,fontName,fontColor}=_ref42;return"/".concat(escapePDFName(fontName)," ").concat(_ref42," Tf ").concat(getPdfColor(fontColor,!0))}class FakeUnicodeFont{constructor(xref,fontFamily){this.xref=xref,this.widths=null,this.firstChar=1/0,this.lastChar=-1/0,this.fontFamily=fontFamily;xref=new OffscreenCanvas(1,1);this.ctxMeasure=xref.getContext("2d",{willReadFrequently:!0}),FakeUnicodeFont._fontNameId||(FakeUnicodeFont._fontNameId=1),this.fontName=Name.get("InvalidPDFjsFont_".concat(fontFamily,"_").concat(FakeUnicodeFont._fontNameId++))}get fontDescriptorRef(){var fontDescriptor;return FakeUnicodeFont._fontDescriptorRef||((fontDescriptor=new Dict(this.xref)).set("Type",Name.get("FontDescriptor")),fontDescriptor.set("FontName",this.fontName),fontDescriptor.set("FontFamily","MyriadPro Regular"),fontDescriptor.set("FontBBox",[0,0,0,0]),fontDescriptor.set("FontStretch",Name.get("Normal")),fontDescriptor.set("FontWeight",400),fontDescriptor.set("ItalicAngle",0),FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(fontDescriptor)),FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){var char,width,descendantFont=new Dict(this.xref),widths=(descendantFont.set("BaseFont",this.fontName),descendantFont.set("Type",Name.get("Font")),descendantFont.set("Subtype",Name.get("CIDFontType0")),descendantFont.set("CIDToGIDMap",Name.get("Identity")),descendantFont.set("FirstChar",this.firstChar),descendantFont.set("LastChar",this.lastChar),descendantFont.set("FontDescriptor",this.fontDescriptorRef),descendantFont.set("DW",1e3),[]),currentChar=null,currentWidths=null;for([char,width]of[...this.widths.entries()].sort())currentChar?char===currentChar+currentWidths.length?currentWidths.push(width):(widths.push(currentChar,currentWidths),currentChar=char,currentWidths=[width]):(currentChar=char,currentWidths=[width]);currentChar&&widths.push(currentChar,currentWidths),descendantFont.set("W",widths);var cidSystemInfo=new Dict(this.xref);return cidSystemInfo.set("Ordering","Identity"),cidSystemInfo.set("Registry","Adobe"),cidSystemInfo.set("Supplement",0),descendantFont.set("CIDSystemInfo",cidSystemInfo),this.xref.getNewPersistentRef(descendantFont)}get baseFontRef(){var baseFont=new Dict(this.xref);return baseFont.set("BaseFont",this.fontName),baseFont.set("Type",Name.get("Font")),baseFont.set("Subtype",Name.get("Type0")),baseFont.set("Encoding",Name.get("Identity-H")),baseFont.set("DescendantFonts",[this.descendantFontRef]),baseFont.set("ToUnicode",Name.get("Identity-H")),this.xref.getNewPersistentRef(baseFont)}get resources(){var resources=new Dict(this.xref),font=new Dict(this.xref);return font.set(this.fontName.name,this.baseFontRef),resources.set("Font",font),resources}_createContext(){return this.widths=new Map,this.ctxMeasure.font="1000px ".concat(this.fontFamily),this.ctxMeasure}createFontResources(text){var line,ctx=this._createContext();for(line of text.split(/\r\n?|\n/))for(var char of line.split("")){var code=char.charCodeAt(0);this.widths.has(code)||(char=ctx.measureText(char),char=Math.ceil(char.width),this.widths.set(code,char),this.firstChar=Math.min(code,this.firstChar),this.lastChar=Math.max(code,this.lastChar))}return this.resources}static getFirstPositionInfo(rect,rotation,fontSize){var[rect,y1,x2,y2]=rect,x2=x2-rect,rect=y2-y1,y2=(rotation%180!=0&&([x2,rect]=[rect,x2]),LINE_FACTOR*fontSize);return{coords:[0,rect+LINE_DESCENT_FACTOR*fontSize-y2],bbox:[0,0,x2,rect],matrix:0!==rotation?getRotationMatrix(rotation,rect,y2):void 0}}createAppearance(text,rect,rotation,fontSize,bgColor,strokeAlpha){var line,ctx=this._createContext(),lines=[],maxWidth=-1/0;for(line of text.split(/\r\n?|\n/)){lines.push(line);var code,lineWidth=ctx.measureText(line).width,maxWidth=Math.max(maxWidth,lineWidth);for(code of codePointIter(line)){var char=String.fromCodePoint(code),width=this.widths.get(code);void 0===width&&(char=ctx.measureText(char),width=Math.ceil(char.width),this.widths.set(code,width),this.firstChar=Math.min(code,this.firstChar),this.lastChar=Math.max(code,this.lastChar))}}var[text,rect,x2,y2]=rect,x2=x2-text,text=y2-rect,y2=(rotation%180!=0&&([x2,text]=[text,x2]),1),rect=(x2<(maxWidth*=fontSize/1e3)&&(y2=x2/maxWidth),1),lineHeight=LINE_FACTOR*fontSize,lineDescent=LINE_DESCENT_FACTOR*fontSize,maxHeight=lineHeight*lines.length;text<maxHeight&&(rect=text/maxHeight);var _line,maxHeight=fontSize*Math.min(y2,rect),buffer=["q","0 0 ".concat(numberToString(x2)," ").concat(numberToString(text)," re W n"),"BT","1 0 0 1 0 ".concat(numberToString(text+lineDescent)," Tm 0 Tc ").concat(getPdfColor(bgColor,!0)),"/".concat(this.fontName.name," ").concat(numberToString(maxHeight)," Tf")],fontSize=this.resources,vShift=(1!==(strokeAlpha="number"==typeof strokeAlpha&&0<=strokeAlpha&&strokeAlpha<=1?strokeAlpha:1)&&(buffer.push("/R0 gs"),y2=new Dict(this.xref),(rect=new Dict(this.xref)).set("ca",strokeAlpha),rect.set("CA",strokeAlpha),rect.set("Type",Name.get("ExtGState")),y2.set("R0",rect),fontSize.set("ExtGState",y2)),numberToString(lineHeight));for(_line of lines)buffer.push("0 -".concat(vShift," Td <").concat(stringToUTF16HexString(_line),"> Tj"));buffer.push("ET","Q");lineDescent=buffer.join("\n"),bgColor=new Dict(this.xref),bgColor.set("Subtype",Name.get("Form")),bgColor.set("Type",Name.get("XObject")),bgColor.set("BBox",[0,0,x2,text]),bgColor.set("Length",lineDescent.length),bgColor.set("Resources",fontSize),rotation&&(maxHeight=getRotationMatrix(rotation,x2,text),bgColor.set("Matrix",maxHeight)),strokeAlpha=new StringStream(lineDescent);return strokeAlpha.dict=bgColor,strokeAlpha}}function makeColorComp(n){return Math.floor(255*Math.max(0,Math.min(1,n))).toString(16).padStart(2,"0")}function scaleAndClamp(x){return Math.max(0,Math.min(255,255*x))}class ColorConverters{static CMYK_G(_ref43){var[_ref43,y,m,k]=_ref43;return["G",1-Math.min(1,.3*_ref43+.59*m+.11*y+k)]}static G_CMYK(_ref44){var[_ref44]=_ref44;return["CMYK",0,0,0,1-_ref44]}static G_RGB(_ref45){var[_ref45]=_ref45;return["RGB",_ref45,_ref45,_ref45]}static G_rgb(_ref46){var[_ref46]=_ref46;return[_ref46=scaleAndClamp(_ref46),_ref46,_ref46]}static G_HTML(_ref47){var[_ref47]=_ref47,_ref47=makeColorComp(_ref47);return"#".concat(_ref47).concat(_ref47).concat(_ref47)}static RGB_G(_ref48){var[_ref48,g,b]=_ref48;return["G",.3*_ref48+.59*g+.11*b]}static RGB_rgb(color){return color.map(scaleAndClamp)}static RGB_HTML(color){return"#".concat(color.map(makeColorComp).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(_ref49){var[_ref49,y,m,k]=_ref49;return["RGB",1-Math.min(1,_ref49+k),1-Math.min(1,m+k),1-Math.min(1,y+k)]}static CMYK_rgb(_ref50){var[_ref50,y,m,k]=_ref50;return[scaleAndClamp(1-Math.min(1,_ref50+k)),scaleAndClamp(1-Math.min(1,m+k)),scaleAndClamp(1-Math.min(1,y+k))]}static CMYK_HTML(components){components=this.CMYK_RGB(components).slice(1);return this.RGB_HTML(components)}static RGB_CMYK(_ref51){var[_ref51,g,b]=_ref51,_ref51=1-_ref51,g=1-g,b=1-b;return["CMYK",_ref51,g,b,Math.min(_ref51,g,b)]}}var DateFormats=["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"],TimeFormats=["HH:MM","h:MM tt","HH:MM:ss","h:MM:ss tt"];class NameOrNumberTree{constructor(root,xref,type){this.root=root,this.xref=xref,this._type=type}getAll(){var map=new Map;if(this.root)for(var xref=this.xref,processed=new RefSet,queue=(processed.put(this.root),[this.root]);0<queue.length;){var obj=xref.fetchIfRef(queue.shift());if(obj instanceof Dict)if(obj.has("Kids")){var kid,kids=obj.get("Kids");if(Array.isArray(kids))for(kid of kids){if(processed.has(kid))throw new FormatError('Duplicate entry in "'.concat(this._type,'" tree.'));queue.push(kid),processed.put(kid)}}else{var entries=obj.get(this._type);if(Array.isArray(entries))for(var i=0,ii=entries.length;i<ii;i+=2)map.set(xref.fetchIfRef(entries[i]),xref.fetchIfRef(entries[i+1]))}}return map}getRaw(key){if(this.root){for(var xref=this.xref,kidsOrEntries=xref.fetchIfRef(this.root),loopCount=0;kidsOrEntries.has("Kids");){if(10<++loopCount)return warn('Search depth limit reached for "'.concat(this._type,'" tree.')),null;var kids=kidsOrEntries.get("Kids");if(!Array.isArray(kids))return null;for(var l=0,r=kids.length-1;l<=r;){var m=l+r>>1,kid=xref.fetchIfRef(kids[m]),limits=kid.get("Limits");if(key<xref.fetchIfRef(limits[0]))r=m-1;else{if(!(key>xref.fetchIfRef(limits[1]))){kidsOrEntries=kid;break}l=1+m}}if(r<l)return null}var entries=kidsOrEntries.get(this._type);if(Array.isArray(entries))for(var _l=0,_r=entries.length-2;_l<=_r;){var tmp=_l+_r>>1,tmp=tmp+(1&tmp),currentKey=xref.fetchIfRef(entries[tmp]);if(key<currentKey)_r=tmp-2;else{if(!(currentKey<key))return entries[1+tmp];_l=2+tmp}}}return null}get(key){return this.xref.fetchIfRef(this.getRaw(key))}}class NameTree extends NameOrNumberTree{constructor(root,xref){super(root,xref,"Names")}}class NumberTree extends NameOrNumberTree{constructor(root,xref){super(root,xref,"Nums")}}function clearGlobalCaches(){clearPatternCaches(),clearPrimitiveCaches(),clearUnicodeCaches(),JpxImage.cleanup()}function pickPlatformItem(dict){return dict instanceof Dict?dict.has("UF")?dict.get("UF"):dict.has("F")?dict.get("F"):dict.has("Unix")?dict.get("Unix"):dict.has("Mac")?dict.get("Mac"):dict.has("DOS")?dict.get("DOS"):null:null}function stripPath(str){return str.substring(str.lastIndexOf("/")+1)}var _contentAvailable=new WeakMap;class FileSpec{constructor(root,xref){var skipContent=2<arguments.length&&void 0!==arguments[2]&&arguments[2];_classPrivateFieldInitSpec(this,_contentAvailable,!1),root instanceof Dict&&(this.xref=xref,(this.root=root).has("FS")&&(this.fs=root.get("FS")),root.has("RF")&&warn("Related file specifications are not supported"),skipContent||(root.has("EF")?_classPrivateFieldSet(_contentAvailable,this,!0):warn("Non-embedded file specifications are not supported")))}get filename(){var filename="",item=pickPlatformItem(this.root);return shadow(this,"filename",(filename=item&&"string"==typeof item?stringToPDFString(item,!0).replaceAll("\\\\","\\").replaceAll("\\/","/").replaceAll("\\","/"):filename)||"unnamed")}get content(){if(!_classPrivateFieldGet(_contentAvailable,this))return null;this._contentRef||(this._contentRef=pickPlatformItem(null==(_this$root=this.root)?void 0:_this$root.get("EF")));var fileObj,_this$root=null;return this._contentRef?(fileObj=this.xref.fetchIfRef(this._contentRef))instanceof BaseStream?_this$root=fileObj.getBytes():warn("Embedded file specification points to non-existing/invalid content"):warn("Embedded file specification does not have any content"),_this$root}get description(){var description="",_this$root2=null==(_this$root2=this.root)?void 0:_this$root2.get("Desc");return shadow(this,"description",description=_this$root2&&"string"==typeof _this$root2?stringToPDFString(_this$root2):description)}get serializable(){return{rawFilename:this.filename,filename:stripPath(this.filename),content:this.content,description:this.description}}}var XMLParserErrorCode={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};function isWhitespace(s,index){s=s[index];return" "===s||"\n"===s||"\r"===s||"\t"===s}function isWhitespaceString(s){for(var i=0,ii=s.length;i<ii;i++)if(!isWhitespace(s,i))return!1;return!0}class XMLParserBase{_resolveEntities(s){return s.replaceAll(/&([^;]+);/g,(all,entity)=>{if("#x"===entity.substring(0,2))return String.fromCodePoint(parseInt(entity.substring(2),16));if("#"===entity.substring(0,1))return String.fromCodePoint(parseInt(entity.substring(1),10));switch(entity){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(entity)})}_parseContent(s,start){var attributes=[],pos=start;function skipWs(){for(;pos<s.length&&isWhitespace(s,pos);)++pos}for(;pos<s.length&&!isWhitespace(s,pos)&&">"!==s[pos]&&"/"!==s[pos];)++pos;var name=s.substring(start,pos);for(skipWs();pos<s.length&&">"!==s[pos]&&"/"!==s[pos]&&"?"!==s[pos];){skipWs();for(var attrValue,attrName="";pos<s.length&&!isWhitespace(s,pos)&&"="!==s[pos];)attrName+=s[pos],++pos;if(skipWs(),"="!==s[pos])return null;++pos,skipWs();var attrEndChar=s[pos];if('"'!==attrEndChar&&"'"!==attrEndChar)return null;attrEndChar=s.indexOf(attrEndChar,++pos);if(attrEndChar<0)return null;attrValue=s.substring(pos,attrEndChar),attributes.push({name:attrName,value:this._resolveEntities(attrValue)}),pos=attrEndChar+1,skipWs()}return{name:name,attributes:attributes,parsed:pos-start}}_parseProcessingInstruction(s,start){var pos=start;for(;pos<s.length&&!isWhitespace(s,pos)&&">"!==s[pos]&&"?"!==s[pos]&&"/"!==s[pos];)++pos;for(var name=s.substring(start,pos);pos<s.length&&isWhitespace(s,pos);)++pos;for(var attrStart=pos;pos<s.length&&("?"!==s[pos]||">"!==s[pos+1]);)++pos;return{name:name,value:s.substring(attrStart,pos),parsed:pos-start}}parseXml(s){for(var i=0;i<s.length;){var j=i;if("<"===s[i]){var q=void 0;switch(s[++j]){case"/":if(++j,(q=s.indexOf(">",j))<0)return void this.onError(XMLParserErrorCode.UnterminatedElement);this.onEndElement(s.substring(j,q)),j=q+1;break;case"?":++j;var pi=this._parseProcessingInstruction(s,j);if("?>"!==s.substring(j+pi.parsed,j+pi.parsed+2))return void this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration);this.onPi(pi.name,pi.value),j+=pi.parsed+2;break;case"!":if("--"===s.substring(j+1,j+3)){if((q=s.indexOf("--\x3e",j+3))<0)return void this.onError(XMLParserErrorCode.UnterminatedComment);this.onComment(s.substring(j+3,q)),j=q+3}else if("[CDATA["===s.substring(j+1,j+8)){if((q=s.indexOf("]]>",j+8))<0)return void this.onError(XMLParserErrorCode.UnterminatedCdat);this.onCdata(s.substring(j+8,q)),j=q+3}else{if("DOCTYPE"!==s.substring(j+1,j+8))return void this.onError(XMLParserErrorCode.MalformedElement);var pi=s.indexOf("[",j+8),complexDoctype=!1;if((q=s.indexOf(">",j+8))<0)return void this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);if(0<pi&&pi<q){if((q=s.indexOf("]>",j+8))<0)return void this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);complexDoctype=!0}var doctypeContent=s.substring(j+8,q+(complexDoctype?1:0));this.onDoctype(doctypeContent),j=q+(complexDoctype?2:1)}break;default:doctypeContent=this._parseContent(s,j);if(null===doctypeContent)return void this.onError(XMLParserErrorCode.MalformedElement);complexDoctype=!1;if("/>"===s.substring(j+doctypeContent.parsed,j+doctypeContent.parsed+2))complexDoctype=!0;else if(">"!==s.substring(j+doctypeContent.parsed,j+doctypeContent.parsed+1))return void this.onError(XMLParserErrorCode.UnterminatedElement);this.onBeginElement(doctypeContent.name,doctypeContent.attributes,complexDoctype),j+=doctypeContent.parsed+(complexDoctype?2:1)}}else{for(;j<s.length&&"<"!==s[j];)j++;var text=s.substring(i,j);this.onText(this._resolveEntities(text))}i=j}}onResolveEntity(name){return"&".concat(name,";")}onPi(name,value){}onComment(text){}onCdata(text){}onDoctype(doctypeContent){}onText(text){}onBeginElement(name,attributes,isEmpty){}onEndElement(name){}onError(code){}}class SimpleDOMNode{constructor(nodeName,nodeValue){this.nodeName=nodeName,this.nodeValue=nodeValue,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){var _this$childNodes;return null==(_this$childNodes=this.childNodes)?void 0:_this$childNodes[0]}get nextSibling(){var childNodes=this.parentNode.childNodes;if(childNodes){var index=childNodes.indexOf(this);if(-1!==index)return childNodes[index+1]}}get textContent(){return this.childNodes?this.childNodes.map(child=>child.textContent).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){var _this$childNodes2;return 0<(null==(_this$childNodes2=this.childNodes)?void 0:_this$childNodes2.length)}searchNode(paths,pos){if(pos>=paths.length)return this;var component=paths[pos];if(component.name.startsWith("#")&&pos<paths.length-1)return this.searchNode(paths,pos+1);for(var _node$childNodes,stack=[],node=this;;){if(component.name===node.nodeName){if(0!==component.pos){if(0===stack.length)return null;var child,[parent]=stack.pop(),siblingPos=0;for(child of parent.childNodes)if(component.name===child.nodeName){if(siblingPos===component.pos)return child.searchNode(paths,pos+1);siblingPos++}return node.searchNode(paths,pos+1)}parent=node.searchNode(paths,pos+1);if(null!==parent)return parent}if(0<(null==(_node$childNodes=node.childNodes)?void 0:_node$childNodes.length))stack.push([node,0]),node=node.childNodes[0];else{if(0===stack.length)return null;for(;0!==stack.length;){var[_parent2,currentPos]=stack.pop(),currentPos=currentPos+1;if(currentPos<_parent2.childNodes.length){stack.push([_parent2,currentPos]),node=_parent2.childNodes[currentPos];break}}if(0===stack.length)return null}}}dump(buffer){if("#text"===this.nodeName)buffer.push(encodeToXmlString(this.nodeValue));else{if(buffer.push("<".concat(this.nodeName)),this.attributes)for(var attribute of this.attributes)buffer.push(" ".concat(attribute.name,'="').concat(encodeToXmlString(attribute.value),'"'));if(this.hasChildNodes()){buffer.push(">");for(var child of this.childNodes)child.dump(buffer);buffer.push("</".concat(this.nodeName,">"))}else this.nodeValue?buffer.push(">".concat(encodeToXmlString(this.nodeValue),"</").concat(this.nodeName,">")):buffer.push("/>")}}}class SimpleXMLParser extends XMLParserBase{constructor(_ref52){var{hasAttributes:_ref52=!1,lowerCaseName=!1}=_ref52;super(),this._currentFragment=null,this._stack=null,this._errorCode=XMLParserErrorCode.NoError,this._hasAttributes=_ref52,this._lowerCaseName=lowerCaseName}parseFromString(data){if(this._currentFragment=[],this._stack=[],this._errorCode=XMLParserErrorCode.NoError,this.parseXml(data),this._errorCode===XMLParserErrorCode.NoError){var[data]=this._currentFragment;if(data)return{documentElement:data}}}onText(text){isWhitespaceString(text)||(text=new SimpleDOMNode("#text",text),this._currentFragment.push(text))}onCdata(text){text=new SimpleDOMNode("#text",text);this._currentFragment.push(text)}onBeginElement(name,attributes,isEmpty){this._lowerCaseName&&(name=name.toLowerCase());name=new SimpleDOMNode(name);name.childNodes=[],this._hasAttributes&&(name.attributes=attributes),this._currentFragment.push(name),isEmpty||(this._stack.push(this._currentFragment),this._currentFragment=name.childNodes)}onEndElement(name){this._currentFragment=this._stack.pop()||[];var childNode,lastElement=this._currentFragment.at(-1);if(!lastElement)return null;for(childNode of lastElement.childNodes)childNode.parentNode=lastElement;return lastElement}onError(code){this._errorCode=code}}class MetadataParser{constructor(data){data=this._repair(data);var xmlDocument=new SimpleXMLParser({lowerCaseName:!0}).parseFromString(data);this._metadataMap=new Map,this._data=data,xmlDocument&&this._parse(xmlDocument)}_repair(data){return data.replace(/^[^<]+/,"").replaceAll(/>\\376\\377([^<]+)/g,function(all,codes){for(var bytes=codes.replaceAll(/\\([0-3])([0-7])([0-7])/g,function(code,d1,d2,d3){return String.fromCharCode(64*d1+8*d2+ +d3)}).replaceAll(/&(amp|apos|gt|lt|quot);/g,function(str,name){switch(name){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: ".concat(name," isn't defined."))}),charBuf=[">"],i=0,ii=bytes.length;i<ii;i+=2){var code=256*bytes.charCodeAt(i)+bytes.charCodeAt(i+1);charBuf.push(32<=code&&code<127&&60!==code&&62!==code&&38!==code?String.fromCharCode(code):"&#x"+(65536+code).toString(16).substring(1)+";")}return charBuf.join("")})}_getSequence(entry){var name=entry.nodeName;return"rdf:bag"!==name&&"rdf:seq"!==name&&"rdf:alt"!==name?null:entry.childNodes.filter(node=>"rdf:li"===node.nodeName)}_parseArray(entry){var seqNode;entry.hasChildNodes()&&([seqNode]=entry.childNodes,seqNode=this._getSequence(seqNode)||[],this._metadataMap.set(entry.nodeName,seqNode.map(node=>node.textContent.trim())))}_parse(xmlDocument){var rdf=xmlDocument.documentElement;if("rdf:rdf"!==rdf.nodeName)for(rdf=rdf.firstChild;rdf&&"rdf:rdf"!==rdf.nodeName;)rdf=rdf.nextSibling;if(rdf&&"rdf:rdf"===rdf.nodeName&&rdf.hasChildNodes())for(var desc of rdf.childNodes)if("rdf:description"===desc.nodeName)for(var entry of desc.childNodes){var name=entry.nodeName;switch(name){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(entry);continue}this._metadataMap.set(name,entry.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}var MAX_DEPTH=40,StructElementType={PAGE_CONTENT:1,STREAM_CONTENT:2,OBJECT:3,ANNOTATION:4,ELEMENT:5},_StructTreeRoot_brand=new WeakSet;class StructTreeRoot{constructor(xref,rootDict,rootRef){_classPrivateMethodInitSpec(this,_StructTreeRoot_brand),this.xref=xref,this.dict=rootDict,this.ref=rootRef instanceof Ref?rootRef:null,this.roleMap=new Map,this.structParentIds=null}init(){this.readRoleMap()}addAnnotationIdToPage(pageRef,id){_assertClassBrand(_StructTreeRoot_brand,this,_addIdToPage).call(this,pageRef,id,StructElementType.ANNOTATION)}readRoleMap(){var roleMapDict=this.dict.get("RoleMap");if(roleMapDict instanceof Dict)for(var[key,value]of roleMapDict)value instanceof Name&&this.roleMap.set(key,value.name)}static async canCreateStructureTree(_ref53){var{catalogRef:_ref53,pdfManager,newAnnotationsByPage}=_ref53;if(!(_ref53 instanceof Ref))return warn("Cannot save the struct tree: no catalog reference."),!1;var pageIndex,elements,nextKey=0,hasNothingToUpdate=!0;for([pageIndex,elements]of newAnnotationsByPage){var element,_element$accessibilit,pageRef=(await pdfManager.getPage(pageIndex))["ref"];if(!(pageRef instanceof Ref)){warn("Cannot save the struct tree: page ".concat(pageIndex," has no ref.")),hasNothingToUpdate=!0;break}for(element of elements)null!=(_element$accessibilit=element.accessibilityData)&&_element$accessibilit.type&&(element.parentTreeId=nextKey++,hasNothingToUpdate=!1)}if(hasNothingToUpdate){for(var _elements of newAnnotationsByPage.values())for(var _element of _elements)delete _element.parentTreeId;return!1}return!0}static async createStructureTree(_ref54){var ref,obj,{newAnnotationsByPage:_ref54,xref,catalogRef,pdfManager,changes}=_ref54,root=await pdfManager.ensureCatalog("cloneDict"),cache=new RefSetCache,catalogRef=(cache.put(catalogRef,root),xref.getNewTemporaryRef()),root=(root.set("StructTreeRoot",catalogRef),new Dict(xref)),parentTreeRef=(root.set("Type",Name.get("StructTreeRoot")),xref.getNewTemporaryRef()),kids=(root.set("ParentTree",parentTreeRef),[]),parentTree=(root.set("K",kids),cache.put(catalogRef,root),new Dict(xref)),nums=[],_ref54=(parentTree.set("Nums",nums),await _assertClassBrand(StructTreeRoot,this,_writeKids).call(this,{newAnnotationsByPage:_ref54,structTreeRootRef:catalogRef,structTreeRoot:null,kids:kids,nums:nums,xref:xref,pdfManager:pdfManager,changes:changes,cache:cache}));root.set("ParentTreeNextKey",_ref54),cache.put(parentTreeRef,parentTree);for([ref,obj]of cache.items())changes.put(ref,{data:obj})}async canUpdateStructTree(_ref55){var{pdfManager,newAnnotationsByPage:_ref55}=_ref55;if(!this.ref)return warn("Cannot update the struct tree: no root reference."),!1;var nextKey=this.dict.get("ParentTreeNextKey");if(!Number.isInteger(nextKey)||nextKey<0)return warn("Cannot update the struct tree: invalid next key."),!1;var parentTree=this.dict.get("ParentTree");if(!(parentTree instanceof Dict))return warn("Cannot update the struct tree: ParentTree isn't a dict."),!1;var nums=parentTree.get("Nums");if(!Array.isArray(nums))return warn("Cannot update the struct tree: nums isn't an array."),!1;var pageIndex,numberTree=new NumberTree(parentTree,this.xref);for(pageIndex of _ref55.keys()){var pageDict=(await pdfManager.getPage(pageIndex))["pageDict"];if(pageDict.has("StructParents")){pageDict=pageDict.get("StructParents");if(!Number.isInteger(pageDict)||!Array.isArray(numberTree.get(pageDict)))return warn("Cannot save the struct tree: page ".concat(pageIndex," has a wrong id.")),!1}}var _pageIndex,elements,hasNothingToUpdate=!0;for([_pageIndex,elements]of _ref55){var element,_element$accessibilit2,_pageDict=(await pdfManager.getPage(_pageIndex))["pageDict"];_collectParents.call(StructTreeRoot,{elements:elements,xref:this.xref,pageDict:_pageDict,numberTree:numberTree});for(element of elements)null!=(_element$accessibilit2=element.accessibilityData)&&_element$accessibilit2.type&&(0<=element.accessibilityData.structParent||(element.parentTreeId=nextKey++),hasNothingToUpdate=!1)}if(hasNothingToUpdate){for(var _elements2 of _ref55.values())for(var _element2 of _elements2)delete _element2.parentTreeId,delete _element2.structTreeParent;return!1}return!0}async updateStructureTree(_ref56){var{newAnnotationsByPage:_ref56,pdfManager,changes}=_ref56,{ref:structTreeRootRef,xref}=this,structTreeRoot=this.dict.clone(),cache=new RefSetCache,parentTreeRef=(cache.put(structTreeRootRef,structTreeRoot),structTreeRoot.getRaw("ParentTree")),parentTreeRef=(parentTreeRef instanceof Ref?parentTree=xref.fetch(parentTreeRef):(parentTree=parentTreeRef,parentTreeRef=xref.getNewTemporaryRef(),structTreeRoot.set("ParentTree",parentTreeRef)),parentTree=parentTree.clone(),cache.put(parentTreeRef,parentTree),parentTree.getRaw("Nums")),numsRef=null,parentTree=(parentTreeRef instanceof Ref&&(numsRef=parentTreeRef,parentTreeRef=xref.fetch(numsRef)),parentTreeRef=parentTreeRef.slice(),numsRef||parentTree.set("Nums",parentTreeRef),await _writeKids.call(StructTreeRoot,{newAnnotationsByPage:_ref56,structTreeRootRef:structTreeRootRef,structTreeRoot:this,kids:null,nums:parentTreeRef,xref:xref,pdfManager:pdfManager,changes:changes,cache:cache}));if(-1!==parentTree){structTreeRoot.set("ParentTreeNextKey",parentTree),numsRef&&cache.put(numsRef,parentTreeRef);for(var[ref,obj]of cache.items())changes.put(ref,{data:obj})}}}function _addIdToPage(pageRef,id,type){var ids;pageRef instanceof Ref&&!(id<0)&&(this.structParentIds||(this.structParentIds=new RefSetCache),(ids=this.structParentIds.get(pageRef))||this.structParentIds.put(pageRef,ids=[]),ids.push([id,type]))}async function _writeKids(_ref93){var structTreePageObjs,pageIndex,elements,{newAnnotationsByPage:_ref93,structTreeRootRef,structTreeRoot,kids,nums,xref,pdfManager,changes,cache}=_ref93,objr=Name.get("OBJR"),nextKey=-1;for([pageIndex,elements]of _ref93){var accessibilityData,ref,parentTreeId,structTreeParent,page=await pdfManager.getPage(pageIndex),pageRef=page["ref"],isPageRef=pageRef instanceof Ref;for({accessibilityData,ref,parentTreeId,structTreeParent}of elements)if(null!=accessibilityData&&accessibilityData.type){var structParent=accessibilityData["structParent"];if(structTreeRoot&&Number.isInteger(structParent)&&0<=structParent){var objs=(structTreePageObjs=structTreePageObjs||new Map).get(pageIndex),objs=(void 0===objs&&(objs=new StructTreePage(structTreeRoot,page.pageDict).collectObjects(pageRef),structTreePageObjs.set(pageIndex,objs)),null==objs?void 0:objs.get(structParent));if(objs){structParent=xref.fetch(objs).clone();_writeProperties.call(_StructTreeRoot,structParent,accessibilityData),changes.put(objs,{data:structParent});continue}}var nextKey=Math.max(nextKey,parentTreeId),objs=xref.getNewTemporaryRef(),structParent=new Dict(xref),objDict=(_writeProperties.call(_StructTreeRoot,structParent,accessibilityData),await _assertClassBrand(_StructTreeRoot,this,_updateParentTag).call(this,{structTreeParent:structTreeParent,tagDict:structParent,newTagRef:objs,structTreeRootRef:structTreeRootRef,fallbackKids:kids,xref:xref,cache:cache}),new Dict(xref));structParent.set("K",objDict),objDict.set("Type",objr),isPageRef&&objDict.set("Pg",pageRef),objDict.set("Obj",ref),cache.put(objs,structParent),nums.push(parentTreeId,objs)}}return nextKey+1}function _writeProperties(tagDict,_ref94){var{type:_ref94,title,lang,alt,expanded,actualText}=_ref94;tagDict.set("S",Name.get(_ref94)),title&&tagDict.set("T",stringToAsciiOrUTF16BE(title)),lang&&tagDict.set("Lang",stringToAsciiOrUTF16BE(lang)),alt&&tagDict.set("Alt",stringToAsciiOrUTF16BE(alt)),expanded&&tagDict.set("E",stringToAsciiOrUTF16BE(expanded)),actualText&&tagDict.set("ActualText",stringToAsciiOrUTF16BE(actualText))}function _collectParents(_ref95){var element,_id,elems,{elements:_ref95,xref,pageDict,numberTree}=_ref95,idToElements=new Map;for(element of _ref95)element.structTreeParentId&&(_id=parseInt(element.structTreeParentId.split("_mc")[1],10),(elems=idToElements.get(_id))||idToElements.set(_id,elems=[]),elems.push(element));_ref95=pageDict.get("StructParents");if(Number.isInteger(_ref95)){var kidRef,updateElement=(kid,pageKid,kidRef)=>{kid=idToElements.get(kid);if(kid){var parentRef=pageKid.getRaw("P"),parentDict=xref.fetchIfRef(parentRef);if(parentRef instanceof Ref&&parentDict instanceof Dict){var _element4,params={ref:kidRef,dict:pageKid};for(_element4 of kid)_element4.structTreeParent=params}return!0}return!1};for(kidRef of numberTree.get(_ref95))if(kidRef instanceof Ref){var pageKid=xref.fetch(kidRef),k=pageKid.get("K");if(Number.isInteger(k))updateElement(k,pageKid,kidRef);else if(Array.isArray(k))for(var kid of k){if(kid=xref.fetchIfRef(kid),Number.isInteger(kid)&&updateElement(kid,pageKid,kidRef))break;if(kid instanceof Dict){if(!isName(kid.get("Type"),"MCR"))break;kid=kid.get("MCID");if(Number.isInteger(kid)&&updateElement(kid,pageKid,kidRef))break}}}}}async function _updateParentTag(_ref96){var{structTreeParent:_ref96,tagDict,newTagRef,structTreeRootRef,fallbackKids,xref,cache}=_ref96,ref=null,_ref96=_ref96&&(ref=_ref96["ref"],_ref96.dict.getRaw("P"))||structTreeRootRef,structTreeRootRef=(tagDict.set("P",_ref96),xref.fetchIfRef(_ref96));structTreeRootRef?((tagDict=cache.get(_ref96))||(tagDict=structTreeRootRef.clone(),cache.put(_ref96,tagDict)),(_ref96=(structTreeRootRef=tagDict.getRaw("K"))instanceof Ref?cache.get(structTreeRootRef):null)||(_ref96=xref.fetchIfRef(structTreeRootRef),_ref96=Array.isArray(_ref96)?_ref96.slice():[structTreeRootRef],structTreeRootRef=xref.getNewTemporaryRef(),tagDict.set("K",structTreeRootRef),cache.put(structTreeRootRef,_ref96)),xref=_ref96.indexOf(ref),_ref96.splice(0<=xref?xref+1:_ref96.length,0,newTagRef)):fallbackKids.push(newTagRef)}_StructTreeRoot=StructTreeRoot;class StructElementNode{constructor(tree,dict){this.tree=tree,this.xref=tree.xref,this.dict=dict,this.kids=[],this.parseKids()}get role(){var nameObj=this.dict.get("S"),nameObj=nameObj instanceof Name?nameObj.name:"",root=this.tree["root"];return null!=(root=root.roleMap.get(nameObj))?root:nameObj}parseKids(){var pageObjId=null,objRef=this.dict.getRaw("Pg"),objRef=(objRef instanceof Ref&&(pageObjId=objRef.toString()),this.dict.get("K"));if(Array.isArray(objRef))for(var kid of objRef){kid=this.parseKid(pageObjId,this.xref.fetchIfRef(kid));kid&&this.kids.push(kid)}else{objRef=this.parseKid(pageObjId,objRef);objRef&&this.kids.push(objRef)}}parseKid(pageObjId,kid){var pageRef,kidRef;return Number.isInteger(kid)?this.tree.pageDict.objId!==pageObjId?null:new StructElement({type:StructElementType.PAGE_CONTENT,mcid:kid,pageObjId:pageObjId}):kid instanceof Dict?((pageRef=kid.getRaw("Pg"))instanceof Ref&&(pageObjId=pageRef.toString()),"MCR"===(pageRef=kid.get("Type")instanceof Name?kid.get("Type").name:null)?this.tree.pageDict.objId!==pageObjId?null:(kidRef=kid.getRaw("Stm"),new StructElement({type:StructElementType.STREAM_CONTENT,refObjId:kidRef instanceof Ref?kidRef.toString():null,pageObjId:pageObjId,mcid:kid.get("MCID")})):"OBJR"===pageRef?this.tree.pageDict.objId!==pageObjId?null:(kidRef=kid.getRaw("Obj"),new StructElement({type:StructElementType.OBJECT,refObjId:kidRef instanceof Ref?kidRef.toString():null,pageObjId:pageObjId})):new StructElement({type:StructElementType.ELEMENT,dict:kid})):null}}class StructElement{constructor(_ref57){var{type:_ref57,dict=null,mcid=null,pageObjId=null,refObjId=null}=_ref57;this.type=_ref57,this.dict=dict,this.mcid=mcid,this.pageObjId=pageObjId,this.refObjId=refObjId,this.parentNode=null}}class StructTreePage{constructor(structTreeRoot,pageDict){var _structTreeRoot$xref;this.root=structTreeRoot,this.xref=null!=(_structTreeRoot$xref=null==structTreeRoot?void 0:structTreeRoot.xref)?_structTreeRoot$xref:null,this.rootDict=null!=(_structTreeRoot$xref=null==structTreeRoot?void 0:structTreeRoot.dict)?_structTreeRoot$xref:null,this.pageDict=pageDict,this.nodes=[]}collectObjects(pageRef){if(!(this.root&&this.rootDict&&pageRef instanceof Ref))return null;var parentTree=this.rootDict.get("ParentTree");if(!parentTree)return null;var _this$root$structPare=null==(_this$root$structPare=this.root.structParentIds)?void 0:_this$root$structPare.get(pageRef);if(!_this$root$structPare)return null;var elemId,map=new Map,numberTree=new NumberTree(parentTree,this.xref);for([elemId]of _this$root$structPare){var obj=numberTree.getRaw(elemId);obj instanceof Ref&&map.set(elemId,obj)}return map}parse(pageRef){if(this.root&&this.rootDict&&pageRef instanceof Ref){var parentTree=this.rootDict.get("ParentTree");if(parentTree){var id=this.pageDict.get("StructParents"),_this$root$structPare2=null==(_this$root$structPare2=this.root.structParentIds)?void 0:_this$root$structPare2.get(pageRef);if(Number.isInteger(id)||_this$root$structPare2){var map=new Map,numberTree=new NumberTree(parentTree,this.xref);if(Number.isInteger(id)){pageRef=numberTree.get(id);if(Array.isArray(pageRef))for(var ref of pageRef)ref instanceof Ref&&this.addNode(this.xref.fetch(ref),map)}if(_this$root$structPare2)for(var[elemId,type]of _this$root$structPare2){var _elem$kids,elemId=numberTree.get(elemId);elemId&&1===(null==(elemId=this.addNode(this.xref.fetchIfRef(elemId),map))||null==(_elem$kids=elemId.kids)?void 0:_elem$kids.length)&&elemId.kids[0].type===StructElementType.OBJECT&&(elemId.kids[0].type=type)}}}}}addNode(dict,map){var level=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;if(MAX_DEPTH<level)return warn("StructTree MAX_DEPTH reached."),null;if(!(dict instanceof Dict))return null;if(map.has(dict))return map.get(dict);var element=new StructElementNode(this,dict),parent=(map.set(dict,element),dict.get("P"));if(parent instanceof Dict&&!isName(parent.get("Type"),"StructTreeRoot")){parent=this.addNode(parent,map,level+1);if(parent){var kid,save=!1;for(kid of parent.kids)kid.type===StructElementType.ELEMENT&&kid.dict===dict&&(kid.parentNode=element,save=!0);save||map.delete(dict)}}else this.addTopLevelNode(dict,element)||map.delete(dict);return element}addTopLevelNode(dict,element){var obj=this.rootDict.get("K");if(!obj)return!1;if(obj instanceof Dict)return obj.objId===dict.objId&&(this.nodes[0]=element,!0);if(!Array.isArray(obj))return!0;for(var save=!1,i=0;i<obj.length;i++){var kidRef=obj[i];(null==kidRef?void 0:kidRef.toString())===dict.objId&&(this.nodes[i]=element,save=!0)}return save}get serializable(){var child,root=Object.create(null);root.children=[],root.role="Root";for(child of this.nodes)child&&!function nodeToSerializable(node,parent,argument_2){var level=2<arguments.length&&void 0!==argument_2?argument_2:0;if(MAX_DEPTH<level)warn("StructTree too deep to be fully serialized.");else{var kid,obj=Object.create(null),argument_2=(obj.role=node.role,obj.children=[],parent.children.push(obj),node.dict.get("Alt")),parent=("string"==typeof(argument_2="string"!=typeof argument_2?node.dict.get("ActualText"):argument_2)&&(obj.alt=stringToPDFString(argument_2)),node.dict.get("A")),argument_2=(parent instanceof Dict&&((argument_2=lookupNormalRect(parent.getArray("BBox"),null))?obj.bbox=argument_2:(argument_2=parent.get("Width"),parent=parent.get("Height"),"number"==typeof argument_2&&0<argument_2&&"number"==typeof parent&&0<parent&&(obj.bbox=[0,0,argument_2,parent]))),node.dict.get("Lang"));"string"==typeof argument_2&&(obj.lang=stringToPDFString(argument_2));for(kid of node.kids){var kidElement=kid.type===StructElementType.ELEMENT?kid.parentNode:null;kidElement?nodeToSerializable(kidElement,obj,level+1):kid.type===StructElementType.PAGE_CONTENT||kid.type===StructElementType.STREAM_CONTENT?obj.children.push({type:"content",id:"p".concat(kid.pageObjId,"_mc").concat(kid.mcid)}):kid.type===StructElementType.OBJECT?obj.children.push({type:"object",id:kid.refObjId}):kid.type===StructElementType.ANNOTATION&&obj.children.push({type:"annotation",id:"".concat(AnnotationPrefix).concat(kid.refObjId)})}}}(child,root);return root}}var isRef=v=>v instanceof Ref,isValidExplicitDest=_isValidExplicitDest.bind(null,isRef,isName);function fetchDest(dest){return dest instanceof Dict&&(dest=dest.get("D")),isValidExplicitDest(dest)?dest:null}function fetchRemoteDest(action){action=action.get("D");if(action){if("string"==typeof(action=action instanceof Name?action.name:action))return stringToPDFString(action,!0);if(isValidExplicitDest(action))return JSON.stringify(action)}return null}var _actualNumPages=new WeakMap,_catDict=new WeakMap,_Catalog_brand=new WeakSet;class Catalog{constructor(pdfManager,_xref){if(_classPrivateMethodInitSpec(this,_Catalog_brand),_classPrivateFieldInitSpec(this,_actualNumPages,null),_classPrivateFieldInitSpec(this,_catDict,null),_defineProperty(this,"builtInCMapCache",new Map),_defineProperty(this,"fontCache",new RefSetCache),_defineProperty(this,"globalColorSpaceCache",new GlobalColorSpaceCache),_defineProperty(this,"globalImageCache",new GlobalImageCache),_defineProperty(this,"nonBlendModesSet",new RefSet),_defineProperty(this,"pageDictCache",new RefSetCache),_defineProperty(this,"pageIndexCache",new RefSetCache),_defineProperty(this,"pageKidsCountCache",new RefSetCache),_defineProperty(this,"standardFontDataCache",new Map),_defineProperty(this,"systemFontCache",new Map),this.pdfManager=pdfManager,this.xref=_xref,_classPrivateFieldSet(_catDict,this,_xref.getCatalogObj()),!(_classPrivateFieldGet(_catDict,this)instanceof Dict))throw new FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict}cloneDict(){return _classPrivateFieldGet(_catDict,this).clone()}get version(){var version=_classPrivateFieldGet(_catDict,this).get("Version");if(version instanceof Name){if(PDF_VERSION_REGEXP.test(version.name))return shadow(this,"version",version.name);warn("Invalid PDF catalog version: ".concat(version.name))}return shadow(this,"version",null)}get lang(){var lang=_classPrivateFieldGet(_catDict,this).get("Lang");return shadow(this,"lang",lang&&"string"==typeof lang?stringToPDFString(lang):null)}get needsRendering(){var needsRendering=_classPrivateFieldGet(_catDict,this).get("NeedsRendering");return shadow(this,"needsRendering","boolean"==typeof needsRendering&&needsRendering)}get collection(){var collection=null;try{var obj=_classPrivateFieldGet(_catDict,this).get("Collection");obj instanceof Dict&&0<obj.size&&(collection=obj)}catch(ex){if(ex instanceof MissingDataException)throw ex;info("Cannot fetch Collection entry; assuming no collection is present.")}return shadow(this,"collection",collection)}get acroForm(){var acroForm=null;try{var obj=_classPrivateFieldGet(_catDict,this).get("AcroForm");obj instanceof Dict&&0<obj.size&&(acroForm=obj)}catch(ex){if(ex instanceof MissingDataException)throw ex;info("Cannot fetch AcroForm entry; assuming no forms are present.")}return shadow(this,"acroForm",acroForm)}get acroFormRef(){var value=_classPrivateFieldGet(_catDict,this).getRaw("AcroForm");return shadow(this,"acroFormRef",value instanceof Ref?value:null)}get metadata(){var streamRef=_classPrivateFieldGet(_catDict,this).getRaw("Metadata");if(!(streamRef instanceof Ref))return shadow(this,"metadata",null);var metadata=null;try{var _this$xref$encrypt,type,subtype,data,stream=this.xref.fetch(streamRef,!(null!=(_this$xref$encrypt=this.xref.encrypt)&&_this$xref$encrypt.encryptMetadata));stream instanceof BaseStream&&stream.dict instanceof Dict&&(type=stream.dict.get("Type"),subtype=stream.dict.get("Subtype"),isName(type,"Metadata"))&&isName(subtype,"XML")&&(data=stringToUTF8String(stream.getString()))&&(metadata=new MetadataParser(data).serializable)}catch(ex){if(ex instanceof MissingDataException)throw ex;info('Skipping invalid Metadata: "'.concat(ex,'".'))}return shadow(this,"metadata",metadata)}get markInfo(){var markInfo=null;try{markInfo=_assertClassBrand(_Catalog_brand,this,_readMarkInfo).call(this)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Unable to read mark info.")}return shadow(this,"markInfo",markInfo)}get structTreeRoot(){var structTree=null;try{structTree=_assertClassBrand(_Catalog_brand,this,_readStructTreeRoot).call(this)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Unable read to structTreeRoot info.")}return shadow(this,"structTreeRoot",structTree)}get toplevelPagesDict(){var pagesObj=_classPrivateFieldGet(_catDict,this).get("Pages");if(pagesObj instanceof Dict)return shadow(this,"toplevelPagesDict",pagesObj);throw new FormatError("Invalid top-level pages dictionary.")}get documentOutline(){var obj=null;try{obj=_assertClassBrand(_Catalog_brand,this,_readDocumentOutline).call(this)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Unable to read document outline.")}return shadow(this,"documentOutline",obj)}get permissions(){var permissions=null;try{permissions=_assertClassBrand(_Catalog_brand,this,_readPermissions).call(this)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Unable to read permissions.")}return shadow(this,"permissions",permissions)}get optionalContentConfig(){var config=null;try{var properties=_classPrivateFieldGet(_catDict,this).get("OCProperties");if(!properties)return shadow(this,"optionalContentConfig",null);var defaultConfig=properties.get("D");if(!defaultConfig)return shadow(this,"optionalContentConfig",null);var groupsData=properties.get("OCGs");if(!Array.isArray(groupsData))return shadow(this,"optionalContentConfig",null);var groupRef,groupRefCache=new RefSetCache;for(groupRef of groupsData)groupRef instanceof Ref&&!groupRefCache.has(groupRef)&&groupRefCache.put(groupRef,_assertClassBrand(_Catalog_brand,this,_readOptionalContentGroup).call(this,groupRef));config=_assertClassBrand(_Catalog_brand,this,_readOptionalContentConfig).call(this,defaultConfig,groupRefCache)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Unable to read optional content config: ".concat(ex))}return shadow(this,"optionalContentConfig",config)}setActualNumPages(){_classPrivateFieldSet(_actualNumPages,this,0<arguments.length&&void 0!==arguments[0]?arguments[0]:null)}get hasActualNumPages(){return null!==_classPrivateFieldGet(_actualNumPages,this)}get _pagesCount(){var obj=this.toplevelPagesDict.get("Count");if(Number.isInteger(obj))return shadow(this,"_pagesCount",obj);throw new FormatError("Page count in top-level pages dictionary is not an integer.")}get numPages(){var _classPrivateFieldGet2;return null!=(_classPrivateFieldGet2=_classPrivateFieldGet(_actualNumPages,this))?_classPrivateFieldGet2:this._pagesCount}get destinations(){var obj,rawDests=_assertClassBrand(_Catalog_brand,this,_readDests).call(this),dests=Object.create(null);for(obj of rawDests)if(obj instanceof NameTree)for(var[key,value]of obj.getAll()){value=fetchDest(value);value&&(dests[stringToPDFString(key,!0)]=value)}else if(obj instanceof Dict)for(var[_key5,_value2]of obj){_value2=fetchDest(_value2);_value2&&!dests[_key5=stringToPDFString(_key5,!0)]&&(dests[_key5]=_value2)}return shadow(this,"destinations",dests)}getDestination(id){if(this.hasOwnProperty("destinations"))return null!=(_this$destinations$id=this.destinations[id])?_this$destinations$id:null;var obj,_this$destinations$id=_assertClassBrand(_Catalog_brand,this,_readDests).call(this);for(obj of _this$destinations$id)if(obj instanceof NameTree||obj instanceof Dict){var dest=fetchDest(obj.get(id));if(dest)return dest}if(_this$destinations$id.length){_this$destinations$id=this.destinations[id];if(_this$destinations$id)return _this$destinations$id}return null}get pageLabels(){var obj=null;try{obj=_assertClassBrand(_Catalog_brand,this,_readPageLabels).call(this)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn("Unable to read page labels.")}return shadow(this,"pageLabels",obj)}get pageLayout(){var obj=_classPrivateFieldGet(_catDict,this).get("PageLayout"),pageLayout="";if(obj instanceof Name)switch(obj.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":pageLayout=obj.name}return shadow(this,"pageLayout",pageLayout)}get pageMode(){var obj=_classPrivateFieldGet(_catDict,this).get("PageMode"),pageMode="UseNone";if(obj instanceof Name)switch(obj.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":pageMode=obj.name}return shadow(this,"pageMode",pageMode)}get viewerPreferences(){var obj=_classPrivateFieldGet(_catDict,this).get("ViewerPreferences");if(!(obj instanceof Dict))return shadow(this,"viewerPreferences",null);var key,value,prefs=null;for([key,value]of obj){var prefValue=void 0;switch(key){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof value&&(prefValue=value);break;case"NonFullScreenPageMode":if(value instanceof Name)switch(value.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":prefValue=value.name;break;default:prefValue="UseNone"}break;case"Direction":if(value instanceof Name)switch(value.name){case"L2R":case"R2L":prefValue=value.name;break;default:prefValue="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(value instanceof Name)switch(value.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":prefValue=value.name;break;default:prefValue="CropBox"}break;case"PrintScaling":if(value instanceof Name)switch(value.name){case"None":case"AppDefault":prefValue=value.name;break;default:prefValue="AppDefault"}break;case"Duplex":if(value instanceof Name)switch(value.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":prefValue=value.name;break;default:prefValue="None"}break;case"PrintPageRange":Array.isArray(value)&&value.length%2==0&&value.every((page,i,arr)=>Number.isInteger(page)&&0<page&&(0===i||page>=arr[i-1])&&page<=this.numPages)&&(prefValue=value);break;case"NumCopies":Number.isInteger(value)&&0<value&&(prefValue=value);break;default:warn("Ignoring non-standard key in ViewerPreferences: ".concat(key,"."));continue}void 0===prefValue?warn('Bad value, for key "'.concat(key,'", in ViewerPreferences: ').concat(value,".")):(prefs=null!=prefs?prefs:Object.create(null))[key]=prefValue}return shadow(this,"viewerPreferences",prefs)}get openAction(){var destDict,resultObj,obj=_classPrivateFieldGet(_catDict,this).get("OpenAction"),openAction=Object.create(null);return obj instanceof Dict?((destDict=new Dict(this.xref)).set("A",obj),resultObj={url:null,dest:null,action:null},Catalog.parseDestDictionary({destDict:destDict,resultObj:resultObj}),Array.isArray(resultObj.dest)?openAction.dest=resultObj.dest:resultObj.action&&(openAction.action=resultObj.action)):isValidExplicitDest(obj)&&(openAction.dest=obj),shadow(this,"openAction",0<objectSize(openAction)?openAction:null)}get attachments(){var key,value,obj=_classPrivateFieldGet(_catDict,this).get("Names"),attachments=null;if(obj instanceof Dict&&obj.has("EmbeddedFiles"))for([key,value]of new NameTree(obj.getRaw("EmbeddedFiles"),this.xref).getAll()){var fs=new FileSpec(value,this.xref);(attachments=null!=attachments?attachments:Object.create(null))[stringToPDFString(key,!0)]=fs.serializable}return shadow(this,"attachments",attachments)}get xfaImages(){var key,value,obj=_classPrivateFieldGet(_catDict,this).get("Names"),xfaImages=null;if(obj instanceof Dict&&obj.has("XFAImages"))for([key,value]of new NameTree(obj.getRaw("XFAImages"),this.xref).getAll())value instanceof BaseStream&&(xfaImages=null!=xfaImages?xfaImages:new Map).set(stringToPDFString(key,!0),value.getBytes());return shadow(this,"xfaImages",xfaImages)}get jsActions(){var javaScript=_assertClassBrand(_Catalog_brand,this,_collectJavaScript).call(this),actions=collectActions(this.xref,_classPrivateFieldGet(_catDict,this),DocumentActionEventType);if(javaScript){actions=actions||Object.create(null);for(var[key,val]of javaScript)key in actions?actions[key].push(val):actions[key]=[val]}return shadow(this,"jsActions",actions)}async cleanup(){var dict,manuallyTriggered=0<arguments.length&&void 0!==arguments[0]&&arguments[0];clearGlobalCaches(),this.globalColorSpaceCache.clear(),this.globalImageCache.clear(manuallyTriggered),this.pageKidsCountCache.clear(),this.pageIndexCache.clear(),this.pageDictCache.clear(),this.nonBlendModesSet.clear();for({dict}of await Promise.all(this.fontCache))delete dict.cacheKey;this.fontCache.clear(),this.builtInCMapCache.clear(),this.standardFontDataCache.clear(),this.systemFontCache.clear()}async getPageDict(pageIndex){for(var nodesToVisit=[this.toplevelPagesDict],visitedNodes=new RefSet,pagesRef=_classPrivateFieldGet(_catDict,this).getRaw("Pages"),xref=(pagesRef instanceof Ref&&visitedNodes.put(pagesRef),this.xref),pageKidsCountCache=this.pageKidsCountCache,pageIndexCache=this.pageIndexCache,pageDictCache=this.pageDictCache,currentPageIndex=0;nodesToVisit.length;){var currentNode=nodesToVisit.pop();if(currentNode instanceof Ref){var _count=pageKidsCountCache.get(currentNode);if(0<=_count&¤tPageIndex+_count<=pageIndex)currentPageIndex+=_count;else{if(visitedNodes.has(currentNode))throw new FormatError("Pages tree contains circular reference.");visitedNodes.put(currentNode);_count=await(pageDictCache.get(currentNode)||xref.fetchAsync(currentNode));if(_count instanceof Dict){var type=_count.getRaw("Type");if(isName(type=type instanceof Ref?await xref.fetchAsync(type):type,"Page")||!_count.has("Kids")){if(pageKidsCountCache.has(currentNode)||pageKidsCountCache.put(currentNode,1),pageIndexCache.has(currentNode)||pageIndexCache.put(currentNode,currentPageIndex),currentPageIndex===pageIndex)return[_count,currentNode];currentPageIndex++;continue}}nodesToVisit.push(_count)}}else{if(!(currentNode instanceof Dict))throw new FormatError("Page dictionary kid reference points to wrong type of object.");type=currentNode["objId"],_count=currentNode.getRaw("Count");if(_count instanceof Ref&&(_count=await xref.fetchAsync(_count)),Number.isInteger(_count)&&0<=_count&&(type&&!pageKidsCountCache.has(type)&&pageKidsCountCache.put(type,_count),currentPageIndex+_count<=pageIndex))currentPageIndex+=_count;else{var kids=currentNode.getRaw("Kids");if(kids instanceof Ref&&(kids=await xref.fetchAsync(kids)),Array.isArray(kids))for(var last=kids.length-1;0<=last;last--){var lastKid=kids[last];nodesToVisit.push(lastKid),currentNode===this.toplevelPagesDict&&lastKid instanceof Ref&&!pageDictCache.has(lastKid)&&pageDictCache.put(lastKid,xref.fetchAsync(lastKid))}else{var _type=currentNode.getRaw("Type");if(!isName(_type=_type instanceof Ref?await xref.fetchAsync(_type):_type,"Page")&¤tNode.has("Kids"))throw new FormatError("Page dictionary kids object is not an array.");if(currentPageIndex===pageIndex)return[currentNode,null];currentPageIndex++}}}}throw new Error("Page index ".concat(pageIndex," not found."))}async getAllPageDicts(){var recoveryMode=0<arguments.length&&void 0!==arguments[0]&&arguments[0],ignoreErrors=this.pdfManager.evaluatorOptions["ignoreErrors"],queue=[{currentNode:this.toplevelPagesDict,posInKids:0}],visitedNodes=new RefSet,pagesRef=_classPrivateFieldGet(_catDict,this).getRaw("Pages"),map=(pagesRef instanceof Ref&&visitedNodes.put(pagesRef),new Map),xref=this.xref,pageIndexCache=this.pageIndexCache,pageIndex=0;function addPageError(error){if(error instanceof XRefEntryException&&!recoveryMode)throw error;recoveryMode&&ignoreErrors&&0===pageIndex&&(warn('getAllPageDicts - Skipping invalid first page: "'.concat(error,'".')),error=Dict.empty),map.set(pageIndex++,[error,null])}for(;0<queue.length;){var queueItem=queue.at(-1),{currentNode,posInKids}=queueItem,currentNode=currentNode.getRaw("Kids");if(currentNode instanceof Ref)try{currentNode=await xref.fetchAsync(currentNode)}catch(ex){addPageError(ex);break}if(!Array.isArray(currentNode)){addPageError(new FormatError("Page dictionary kids object is not an array."));break}if(posInKids>=currentNode.length)queue.pop();else{currentNode=currentNode[posInKids],posInKids=void 0;if(currentNode instanceof Ref){if(visitedNodes.has(currentNode)){addPageError(new FormatError("Pages tree contains circular reference."));break}visitedNodes.put(currentNode);try{posInKids=await xref.fetchAsync(currentNode)}catch(ex){addPageError(ex);break}}else posInKids=currentNode;if(!(posInKids instanceof Dict)){addPageError(new FormatError("Page dictionary kid reference points to wrong type of object."));break}var type=posInKids.getRaw("Type");if(type instanceof Ref)try{type=await xref.fetchAsync(type)}catch(ex){addPageError(ex);break}isName(type,"Page")||!posInKids.has("Kids")?(type=posInKids,(currentNode=currentNode instanceof Ref?currentNode:null)&&!pageIndexCache.has(currentNode)&&pageIndexCache.put(currentNode,pageIndex),map.set(pageIndex++,[type,currentNode])):queue.push({currentNode:posInKids,posInKids:0}),queueItem.posInKids++}}return map}getPageIndex(pageRef){var xref,total,next,cachedPageIndex=this.pageIndexCache.get(pageRef);return void 0!==cachedPageIndex?Promise.resolve(cachedPageIndex):(xref=this.xref,total=0,(next=ref=>function(kidRef){var parentRef,total=0;return xref.fetchAsync(kidRef).then(function(node){if(isRefsEqual(kidRef,pageRef)&&!isDict(node,"Page")&&!(node instanceof Dict&&!node.has("Type")&&node.has("Contents")))throw new FormatError("The reference does not point to a /Page dictionary.");if(!node)return null;if(node instanceof Dict)return parentRef=node.getRaw("Parent"),node.getAsync("Parent");throw new FormatError("Node must be a dictionary.")}).then(function(parent){if(!parent)return null;if(parent instanceof Dict)return parent.getAsync("Kids");throw new FormatError("Parent must be a dictionary.")}).then(function(kids){if(!kids)return null;var kid,kidPromises=[],found=!1;for(kid of kids){if(!(kid instanceof Ref))throw new FormatError("Kid must be a reference.");if(isRefsEqual(kid,kidRef)){found=!0;break}kidPromises.push(xref.fetchAsync(kid).then(function(obj){if(!(obj instanceof Dict))throw new FormatError("Kid node must be a dictionary.");obj.has("Count")?total+=obj.get("Count"):total++}))}if(found)return Promise.all(kidPromises).then(()=>[total,parentRef]);throw new FormatError("Kid reference not found in parent's kids.")})}(ref).then(args=>{var parentRef;return args?([args,parentRef]=args,total+=args,next(parentRef)):(this.pageIndexCache.put(pageRef,total),total)}))(pageRef))}get baseUrl(){var uri=_classPrivateFieldGet(_catDict,this).get("URI");if(uri instanceof Dict){uri=uri.get("Base");if("string"==typeof uri){uri=createValidAbsoluteUrl(uri,null,{tryConvertEncoding:!0});if(uri)return shadow(this,"baseUrl",uri.href)}}return shadow(this,"baseUrl",this.pdfManager.docBaseUrl)}static parseDestDictionary(_ref58){var{destDict:_ref58,resultObj,docBaseUrl=null,docAttachments=null}=_ref58;if(_ref58 instanceof Dict){var dest,action=_ref58.get("A");if(action instanceof Dict||(_ref58.has("Dest")?action=_ref58.get("Dest"):(action=_ref58.get("AA"))instanceof Dict&&(action.has("D")?action=action.get("D"):action.has("U")&&(action=action.get("U")))),action instanceof Dict){var actionType=action.get("S");if(!(actionType instanceof Name))return void warn("parseDestDictionary: Invalid type in Action dictionary.");var actionName=actionType.name;switch(actionName){case"ResetForm":var obj,flags=action.get("Flags"),flags=0==(1&("number"==typeof flags?flags:0)),fields=[],refs=[];for(obj of action.get("Fields")||[])obj instanceof Ref?refs.push(obj.toString()):"string"==typeof obj&&fields.push(stringToPDFString(obj));resultObj.resetForm={fields:fields,refs:refs,include:flags};break;case"URI":(url=action.get("URI"))instanceof Name&&(url="/"+url.name);break;case"GoTo":dest=action.get("D");break;case"Launch":case"GoToR":var url,flags=action.get("F"),rawFilename=(flags instanceof Dict?(rawFilename=new FileSpec(flags,null,!0).serializable["rawFilename"],url=rawFilename):"string"==typeof flags&&(url=flags),fetchRemoteDest(action)),flags=(rawFilename&&"string"==typeof url&&(url=url.split("#",1)[0]+"#"+rawFilename),action.get("NewWindow"));"boolean"==typeof flags&&(resultObj.newWindow=flags);break;case"GoToE":var attachment,rawFilename=action.get("T");(attachment=docAttachments&&rawFilename instanceof Dict&&(flags=rawFilename.get("R"),rawFilename=rawFilename.get("N"),isName(flags,"C"))&&"string"==typeof rawFilename?docAttachments[stringToPDFString(rawFilename,!0)]:attachment)?(resultObj.attachment=attachment,(flags=fetchRemoteDest(action))&&(resultObj.attachmentDest=flags)):warn('parseDestDictionary - unimplemented "GoToE" action.');break;case"Named":rawFilename=action.get("N");rawFilename instanceof Name&&(resultObj.action=rawFilename.name);break;case"SetOCGState":flags=action.get("State"),rawFilename=action.get("PreserveRB");if(Array.isArray(flags)&&0!==flags.length){var elem,stateArr=[];for(elem of flags)if(elem instanceof Name)switch(elem.name){case"ON":case"OFF":case"Toggle":stateArr.push(elem.name)}else elem instanceof Ref&&stateArr.push(elem.toString());stateArr.length===flags.length&&(resultObj.setOCGState={state:stateArr,preserveRB:"boolean"!=typeof rawFilename||rawFilename})}break;case"JavaScript":var js,flags=action.get("JS"),rawFilename=(flags instanceof BaseStream?js=flags.getString():"string"==typeof flags&&(js=flags),js&&recoverJsURL(stringToPDFString(js,!0)));if(rawFilename){url=rawFilename.url,resultObj.newWindow=rawFilename.newWindow;break}default:"JavaScript"!==actionName&&"SubmitForm"!==actionName&&warn('parseDestDictionary - unsupported action: "'.concat(actionName,'".'))}}else _ref58.has("Dest")&&(dest=_ref58.get("Dest"));"string"==typeof url&&((actionType=createValidAbsoluteUrl(url,docBaseUrl,{addDefaultProtocol:!0,tryConvertEncoding:!0}))&&(resultObj.url=actionType.href),resultObj.unsafeUrl=url),dest&&("string"==typeof(dest=dest instanceof Name?dest.name:dest)?resultObj.dest=stringToPDFString(dest,!0):isValidExplicitDest(dest)&&(resultObj.dest=dest))}else warn("parseDestDictionary: `destDict` must be a dictionary.")}}function _readMarkInfo(){var obj=_classPrivateFieldGet(_catDict,this).get("MarkInfo");if(!(obj instanceof Dict))return null;var key,markInfo={Marked:!1,UserProperties:!1,Suspects:!1};for(key in markInfo){var value=obj.get(key);"boolean"==typeof value&&(markInfo[key]=value)}return markInfo}function _readStructTreeRoot(){var rawObj=_classPrivateFieldGet(_catDict,this).getRaw("StructTreeRoot"),obj=this.xref.fetchIfRef(rawObj);return obj instanceof Dict?((obj=new StructTreeRoot(this.xref,obj,rawObj)).init(),obj):null}function _readDocumentOutline(){var obj=_classPrivateFieldGet(_catDict,this).get("Outlines");if(!(obj instanceof Dict))return null;if(!((obj=obj.getRaw("First"))instanceof Ref))return null;for(var root={items:[]},queue=[{obj:obj,parent:root}],processed=new RefSet,xref=(processed.put(obj),this.xref),blackColor=new Uint8ClampedArray(3);0<queue.length;){var data,title,flags,count,rgbColor,color,i=queue.shift(),outlineDict=xref.fetchIfRef(i.obj);null!==outlineDict&&(outlineDict.has("Title")||warn("Invalid outline item encountered."),_Catalog.parseDestDictionary({destDict:outlineDict,resultObj:data={url:null,dest:null,action:null},docBaseUrl:this.baseUrl,docAttachments:this.attachments}),title=outlineDict.get("Title"),flags=outlineDict.get("F")||0,color=outlineDict.getArray("C"),count=outlineDict.get("Count"),rgbColor=blackColor,!isNumberArray(color,3)||0===color[0]&&0===color[1]&&0===color[2]||(rgbColor=ColorSpaceUtils.rgb.getRgb(color,0)),color={action:data.action,attachment:data.attachment,dest:data.dest,url:data.url,unsafeUrl:data.unsafeUrl,newWindow:data.newWindow,setOCGState:data.setOCGState,title:"string"==typeof title?stringToPDFString(title):"",color:rgbColor,count:Number.isInteger(count)?count:void 0,bold:!!(2&flags),italic:!!(1&flags),items:[]},i.parent.items.push(color),(obj=outlineDict.getRaw("First"))instanceof Ref&&!processed.has(obj)&&(queue.push({obj:obj,parent:color}),processed.put(obj)),(obj=outlineDict.getRaw("Next"))instanceof Ref&&!processed.has(obj))&&(queue.push({obj:obj,parent:i.parent}),processed.put(obj))}return 0<root.items.length?root.items:null}function _readPermissions(){var encrypt=this.xref.trailer.get("Encrypt");if(!(encrypt instanceof Dict))return null;var flags=encrypt.get("P");if("number"!=typeof flags)return null;flags+=2**32;var key,permissions=[];for(key in PermissionFlag){var value=PermissionFlag[key];flags&value&&permissions.push(value)}return permissions}function _readOptionalContentGroup(groupRef){var group=this.xref.fetch(groupRef),groupRef={id:groupRef.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},name=group.get("Name"),name=("string"==typeof name&&(groupRef.name=stringToPDFString(name)),group.getArray("Intent")),name=((name=Array.isArray(name)?name:[name]).every(i=>i instanceof Name)&&(groupRef.intent=name.map(i=>i.name)),group.get("Usage"));if(name instanceof Dict){var usageObj=groupRef.usage,group=name.get("Print");if(group instanceof Dict){var printState=group.get("PrintState");if(printState instanceof Name)switch(printState.name){case"ON":case"OFF":usageObj.print={printState:printState.name}}}group=name.get("View");if(group instanceof Dict){var viewState=group.get("ViewState");if(viewState instanceof Name)switch(viewState.name){case"ON":case"OFF":usageObj.view={viewState:viewState.name}}}}return groupRef}function _readOptionalContentConfig(config,groupRefCache){function parseOnOff(refs){var onParsed=[];if(Array.isArray(refs))for(var value of refs)value instanceof Ref&&groupRefCache.has(value)&&onParsed.push(value.toString());return onParsed}function parseOrder(refs,argument_1){var nestedLevels=1<arguments.length&&void 0!==argument_1?argument_1:0;if(!Array.isArray(refs))return null;var value,nestedOrder,order=[];for(value of refs)value instanceof Ref&&groupRefCache.has(value)?(parsedOrderRefs.put(value),order.push(value.toString())):(nestedOrder=function(ref,nestedLevels){if(++nestedLevels>MAX_NESTED_LEVELS)return warn("parseNestedOrder - reached MAX_NESTED_LEVELS."),null;ref=xref.fetchIfRef(ref);if(!Array.isArray(ref))return null;var nestedName=xref.fetchIfRef(ref[0]);if("string"!=typeof nestedName)return null;ref=parseOrder(ref.slice(1),nestedLevels);return null!=ref&&ref.length?{name:stringToPDFString(nestedName),order:ref}:null}(value,nestedLevels))&&order.push(nestedOrder);if(!(0<nestedLevels)){var groupRef,hiddenGroups=[];for([groupRef]of groupRefCache.items())parsedOrderRefs.has(groupRef)||hiddenGroups.push(groupRef.toString());hiddenGroups.length&&order.push({name:null,order:hiddenGroups})}return order}var xref=this.xref,parsedOrderRefs=new RefSet,MAX_NESTED_LEVELS=10,rbGroups=config.get("RBGroups");if(Array.isArray(rbGroups))for(var value of rbGroups){value=xref.fetchIfRef(value);if(Array.isArray(value)&&value.length){var ref,parsedRbGroup=new Set;for(ref of value)ref instanceof Ref&&groupRefCache.has(ref)&&!parsedRbGroup.has(ref.toString())&&(parsedRbGroup.add(ref.toString()),groupRefCache.get(ref).rbGroups.push(parsedRbGroup))}}return{name:"string"==typeof config.get("Name")?stringToPDFString(config.get("Name")):null,creator:"string"==typeof config.get("Creator")?stringToPDFString(config.get("Creator")):null,baseState:config.get("BaseState")instanceof Name?config.get("BaseState").name:null,on:parseOnOff(config.get("ON")),off:parseOnOff(config.get("OFF")),order:parseOrder(config.get("Order")),groups:[...groupRefCache]}}function _readDests(){var obj=_classPrivateFieldGet(_catDict,this).get("Names"),rawDests=[];return null!=obj&&obj.has("Dests")&&rawDests.push(new NameTree(obj.getRaw("Dests"),this.xref)),_classPrivateFieldGet(_catDict,this).has("Dests")&&rawDests.push(_classPrivateFieldGet(_catDict,this).get("Dests")),rawDests}function _readPageLabels(){var obj=_classPrivateFieldGet(_catDict,this).getRaw("PageLabels");if(!obj)return null;for(var pageLabels=new Array(this.numPages),style=null,prefix="",nums=new NumberTree(obj,this.xref).getAll(),currentLabel="",currentIndex=1,i=0,ii=this.numPages;i<ii;i++){var labelDict=nums.get(i);if(void 0!==labelDict){if(!(labelDict instanceof Dict))throw new FormatError("PageLabel is not a dictionary.");if(labelDict.has("Type")&&!isName(labelDict.get("Type"),"PageLabel"))throw new FormatError("Invalid type in PageLabel dictionary.");if(labelDict.has("S")){var s=labelDict.get("S");if(!(s instanceof Name))throw new FormatError("Invalid style in PageLabel dictionary.");style=s.name}else style=null;if(labelDict.has("P")){s=labelDict.get("P");if("string"!=typeof s)throw new FormatError("Invalid prefix in PageLabel dictionary.");prefix=stringToPDFString(s)}else prefix="";if(labelDict.has("St")){labelDict=labelDict.get("St");if(!(Number.isInteger(labelDict)&&1<=labelDict))throw new FormatError("Invalid start in PageLabel dictionary.");currentIndex=labelDict}else currentIndex=1}switch(style){case"D":currentLabel=currentIndex;break;case"R":case"r":currentLabel=toRomanNumerals(currentIndex,"r"===style);break;case"A":case"a":var letterIndex=currentIndex-1,currentLabel=String.fromCharCode(("a"===style?97:65)+letterIndex%26).repeat(Math.floor(letterIndex/26)+1);break;default:if(style)throw new FormatError('Invalid style "'.concat(style,'" in PageLabel dictionary.'));currentLabel=""}pageLabels[i]=prefix+currentLabel,currentIndex++}return pageLabels}function _collectJavaScript(){var key,value,obj=_classPrivateFieldGet(_catDict,this).get("Names"),javaScript=null;function appendIfJavaScriptDict(name,jsDict){if(jsDict instanceof Dict&&isName(jsDict.get("S"),"JavaScript")){jsDict=jsDict.get("JS");if(jsDict instanceof BaseStream)jsDict=jsDict.getString();else if("string"!=typeof jsDict)return;(jsDict=stringToPDFString(jsDict,!0).replaceAll("\0",""))&&(javaScript=javaScript||new Map).set(name,jsDict)}}if(obj instanceof Dict&&obj.has("JavaScript"))for([key,value]of new NameTree(obj.getRaw("JavaScript"),this.xref).getAll())appendIfJavaScriptDict(stringToPDFString(key,!0),value);obj=_classPrivateFieldGet(_catDict,this).get("OpenAction");return obj&&appendIfJavaScriptDict("OpenAction",obj),javaScript}function mayHaveChildren(value){return value instanceof Ref||value instanceof Dict||value instanceof BaseStream||Array.isArray(value)}function addChildren(node,nodesToVisit){if(node instanceof Dict)node=node.getRawValues();else if(node instanceof BaseStream)node=node.dict.getRawValues();else if(!Array.isArray(node))return;for(var rawValue of node)mayHaveChildren(rawValue)&&nodesToVisit.push(rawValue)}var _Catalog=Catalog,_ObjectLoader_brand=new WeakSet;class ObjectLoader{constructor(dict,keys,xref){_classPrivateMethodInitSpec(this,_ObjectLoader_brand),_defineProperty(this,"refSet",new RefSet),this.dict=dict,this.keys=keys,this.xref=xref}async load(){var key,{keys,dict}=this,nodesToVisit=[];for(key of keys){var rawValue=dict.getRaw(key);void 0!==rawValue&&nodesToVisit.push(rawValue)}await _assertClassBrand(_ObjectLoader_brand,this,_walk).call(this,nodesToVisit),this.refSet=null}static async load(obj,keys,xref){xref.stream.isDataLoaded||await new ObjectLoader(obj,keys,xref).load()}}async function _walk(nodesToVisit){for(var nodesToRevisit=[],pendingRequests=[];nodesToVisit.length;){var currentNode=nodesToVisit.pop();if(currentNode instanceof Ref){if(this.refSet.has(currentNode))continue;try{this.refSet.put(currentNode),currentNode=this.xref.fetch(currentNode)}catch(ex){if(!(ex instanceof MissingDataException))return warn('ObjectLoader.#walk - requesting all data: "'.concat(ex,'".')),void await this.xref.stream.manager.requestAllChunks();nodesToRevisit.push(currentNode),pendingRequests.push({begin:ex.begin,end:ex.end})}}if(currentNode instanceof BaseStream){var baseStreams=currentNode.getBaseStreams();if(baseStreams){var stream,foundMissingData=!1;for(stream of baseStreams)stream.isDataLoaded||(foundMissingData=!0,pendingRequests.push({begin:stream.start,end:stream.end}));foundMissingData&&nodesToRevisit.push(currentNode)}}addChildren(currentNode,nodesToVisit)}if(pendingRequests.length){await this.xref.stream.manager.requestRanges(pendingRequests);for(var node of nodesToRevisit)node instanceof Ref&&this.refSet.remove(node);await _assertClassBrand(_ObjectLoader_brand,this,_walk).call(this,nodesToRevisit)}}var $acceptWhitespace=Symbol(),$addHTML=Symbol(),$appendChild=Symbol(),$childrenToHTML=Symbol(),$clean=Symbol(),$cleanPage=Symbol(),$cleanup=Symbol(),$clone=Symbol(),$consumed=Symbol(),$content=Symbol("content"),$data=Symbol("data"),$dump=Symbol(),$extra=Symbol("extra"),$finalize=Symbol(),$flushHTML=Symbol(),$getAttributeIt=Symbol(),$getAttributes=Symbol(),$getAvailableSpace=Symbol(),$getChildrenByClass=Symbol(),$getChildrenByName=Symbol(),$getChildrenByNameIt=Symbol(),$getDataValue=Symbol(),$getExtra=Symbol(),$getRealChildrenByNameIt=Symbol(),$getChildren=Symbol(),$getContainedChildren=Symbol(),$getNextPage=Symbol(),$getSubformParent=Symbol(),$getParent=Symbol(),$getTemplateRoot=Symbol(),$globalData=Symbol(),$hasSettableValue=Symbol(),$ids=Symbol(),$indexOf=Symbol(),$insertAt=Symbol(),$isCDATAXml=Symbol(),$isBindable=Symbol(),$isDataValue=Symbol(),$isDescendent=Symbol(),$isNsAgnostic=Symbol(),$isSplittable=Symbol(),$isThereMoreWidth=Symbol(),$isTransparent=Symbol(),$isUsable=Symbol(),$lastAttribute=Symbol(),$namespaceId=Symbol("namespaceId"),$nodeName=Symbol("nodeName"),$nsAttributes=Symbol(),$onChild=Symbol(),$onChildCheck=Symbol(),$onText=Symbol(),$pushGlyphs=Symbol(),$popPara=Symbol(),$pushPara=Symbol(),$removeChild=Symbol(),$root=Symbol("root"),$resolvePrototypes=Symbol(),$searchNode=Symbol(),$setId=Symbol(),$setSetAttributes=Symbol(),$setValue=Symbol(),$tabIndex=Symbol(),$text=Symbol(),$toPages=Symbol(),$toHTML=Symbol(),$toString=Symbol(),$toStyle=Symbol(),$uid=Symbol("uid"),$buildXFAObject=Symbol(),NamespaceIds={config:{id:0,check:ns=>ns.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:ns=>ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:ns=>ns.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:ns=>ns.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:ns=>ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:ns=>"http://ns.adobe.com/xdp/pdf/"===ns},signature:{id:6,check:ns=>"http://www.w3.org/2000/09/xmldsig#"===ns},sourceSet:{id:7,check:ns=>ns.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:ns=>"http://www.w3.org/1999/XSL/Transform"===ns},template:{id:9,check:ns=>ns.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:ns=>ns.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:ns=>"http://ns.adobe.com/xdp/"===ns},xfdf:{id:12,check:ns=>"http://ns.adobe.com/xfdf/"===ns},xhtml:{id:13,check:ns=>"http://www.w3.org/1999/xhtml"===ns},xmpmeta:{id:14,check:ns=>"http://ns.adobe.com/xmpmeta/"===ns}},dimConverters={pt:x=>x,cm:x=>x/2.54*72,mm:x=>x/25.4*72,in:x=>72*x,px:x=>x},measurementPattern=/([+-]?\d+\.?\d*)(.*)/;function stripQuotes(str){return str.startsWith("'")||str.startsWith('"')?str.slice(1,-1):str}function getInteger(_ref59){var{data:_ref59,defaultValue,validate}=_ref59;return _ref59&&(_ref59=_ref59.trim(),_ref59=parseInt(_ref59,10),!isNaN(_ref59))&&validate(_ref59)?_ref59:defaultValue}function getFloat(_ref60){var{data:_ref60,defaultValue,validate}=_ref60;return _ref60&&(_ref60=_ref60.trim(),_ref60=parseFloat(_ref60),!isNaN(_ref60))&&validate(_ref60)?_ref60:defaultValue}function getKeyword(_ref61){var{data:_ref61,defaultValue,validate}=_ref61;return _ref61&&validate(_ref61=_ref61.trim())?_ref61:defaultValue}function getStringOption(data,options){return getKeyword({data:data,defaultValue:options[0],validate:k=>options.includes(k)})}function getMeasurement(str){var match,unit,def=(def=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"0")||"0";return!str||!(match=str.trim().match(measurementPattern))||([,match,unit]=match,match=parseFloat(match),isNaN(match))?getMeasurement(def):0===match?0:(unit=dimConverters[unit])?unit(match):match}function getRatio(data){var den;return!data||(1===(data=data.split(":",2).map(x=>parseFloat(x.trim())).filter(x=>!isNaN(x))).length&&data.push(1),0===data.length)?{num:1,den:1}:([data,den]=data,{num:data,den:den})}function getRelevant(data){return data?data.trim().split(/\s+/).map(e=>({excluded:"-"===e[0],viewname:e.substring(1)})):[]}function getColor(data){var color,[r,g,b]=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[0,0,0];return!data||(color=data.split(",",3).map(c=>MathClamp(parseInt(c.trim(),10),0,255)).map(c=>isNaN(c)?0:c)).length<3||([r,g,b]=color),{r:r,g:g,b:b}}function getBBox(data){var y,width,height;return!data||(data=data.split(",",4).map(m=>getMeasurement(m.trim(),"-1"))).length<4||data[2]<0||data[3]<0?{x:-1,y:-1,width:-1,height:-1}:([data,y,width,height]=data,{x:data,y:y,width:width,height:height})}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(success,html,bbox,breakNode){this.success=success,this.html=html,this.bbox=bbox,this.breakNode=breakNode}isBreak(){return!!this.breakNode}static breakNode(node){return new HTMLResult(!1,null,null,node)}static success(html){var bbox=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return new HTMLResult(!0,html,bbox,null)}}class FontFinder{constructor(pdfFonts){this.fonts=new Map,this.cache=new Map,this.warned=new Set,this.defaultFont=null,this.add(pdfFonts)}add(pdfFonts){var pdfFont,_pdfFont,reallyMissingFonts=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;for(pdfFont of pdfFonts)this.addPdfFont(pdfFont);for(_pdfFont of this.fonts.values())_pdfFont.regular||(_pdfFont.regular=_pdfFont.italic||_pdfFont.bold||_pdfFont.bolditalic);if(reallyMissingFonts&&0!==reallyMissingFonts.size){var missing,myriad=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(missing of reallyMissingFonts)this.fonts.set(missing,myriad)}}addPdfFont(pdfFont){var cssFontInfo=pdfFont.cssFontInfo,name=cssFontInfo.fontFamily,font=this.fonts.get(name),name=(font||(font=Object.create(null),this.fonts.set(name,font),this.defaultFont)||(this.defaultFont=font),""),fontWeight=parseFloat(cssFontInfo.fontWeight);0!==parseFloat(cssFontInfo.italicAngle)?name=700<=fontWeight?"bolditalic":"italic":700<=fontWeight&&(name="bold"),!name&&((pdfFont.name.includes("Bold")||null!=(cssFontInfo=pdfFont.psName)&&cssFontInfo.includes("Bold"))&&(name="bold"),pdfFont.name.includes("Italic")||pdfFont.name.endsWith("It")||null!=(fontWeight=pdfFont.psName)&&fontWeight.includes("Italic")||null!=(cssFontInfo=pdfFont.psName)&&cssFontInfo.endsWith("It"))&&(name+="italic"),font[name=name||"regular"]=pdfFont}getDefault(){return this.defaultFont}find(fontName){var mustWarn=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],font=this.fonts.get(fontName)||this.cache.get(fontName);if(font)return font;var pattern=/,|-|_| |bolditalic|bold|italic|regular|it/gi,name=fontName.replaceAll(pattern,"");if(font=this.fonts.get(name))return this.cache.set(fontName,font),font;var family,pdfFont,_pdfFont2$regular$nam,_pdfFont4$regular$nam,name=name.toLowerCase(),maybe=[];for([family,pdfFont]of this.fonts.entries())family.replaceAll(pattern,"").toLowerCase().startsWith(name)&&maybe.push(pdfFont);if(0===maybe.length)for(var[,_pdfFont2]of this.fonts.entries())null!=(_pdfFont2$regular$nam=_pdfFont2.regular.name)&&_pdfFont2$regular$nam.replaceAll(pattern,"").toLowerCase().startsWith(name)&&maybe.push(_pdfFont2);if(0===maybe.length){name=name.replaceAll(/psmt|mt/gi,"");for(var[_family,_pdfFont3]of this.fonts.entries())_family.replaceAll(pattern,"").toLowerCase().startsWith(name)&&maybe.push(_pdfFont3)}if(0===maybe.length)for(var _pdfFont4 of this.fonts.values())null!=(_pdfFont4$regular$nam=_pdfFont4.regular.name)&&_pdfFont4$regular$nam.replaceAll(pattern,"").toLowerCase().startsWith(name)&&maybe.push(_pdfFont4);return 1<=maybe.length?(1!==maybe.length&&mustWarn&&warn("XFA - Too many choices to guess the correct font: ".concat(fontName)),this.cache.set(fontName,maybe[0]),maybe[0]):(mustWarn&&!this.warned.has(fontName)&&(this.warned.add(fontName),warn("XFA - Cannot find the font: ".concat(fontName))),null)}}function selectFont(xfaFont,typeface){return"italic"===xfaFont.posture?"bold"===xfaFont.weight?typeface.bolditalic:typeface.italic:"bold"===xfaFont.weight?typeface.bold:typeface.regular}function fonts_getMetrics(xfaFont){var name,real=1<arguments.length&&void 0!==arguments[1]&&arguments[1],pdfFont=null;return xfaFont&&(name=stripQuotes(xfaFont.typeface),name=xfaFont[$globalData].fontFinder.find(name),pdfFont=selectFont(xfaFont,name)),pdfFont?(name=xfaFont.size||10,{lineHeight:(real=pdfFont.lineHeight?Math.max(real?0:1.2,pdfFont.lineHeight):1.2)*name,lineGap:(pdfFont=void 0===pdfFont.lineGap?.2:pdfFont.lineGap)*name,lineNoGap:Math.max(1,real-pdfFont)*name}):{lineHeight:12,lineGap:2,lineNoGap:10}}var WIDTH_FACTOR=1.02;class FontInfo{constructor(xfaFont,margin,lineHeight,fontFinder){this.lineHeight=lineHeight,this.paraMargin=margin||{top:0,bottom:0,left:0,right:0},xfaFont&&(this.xfaFont={typeface:xfaFont.typeface,posture:xfaFont.posture,weight:xfaFont.weight,size:xfaFont.size,letterSpacing:xfaFont.letterSpacing},lineHeight=fontFinder.find(xfaFont.typeface))&&(this.pdfFont=selectFont(xfaFont,lineHeight),this.pdfFont)||([this.pdfFont,this.xfaFont]=this.defaultFont(fontFinder))}defaultFont(fontFinder){var fontFinder=fontFinder.find("Helvetica",!1)||fontFinder.find("Myriad Pro",!1)||fontFinder.find("Arial",!1)||fontFinder.getDefault();return null!=fontFinder&&fontFinder.regular?[fontFinder=fontFinder.regular,{typeface:fontFinder.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]:[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(defaultXfaFont,defaultParaMargin,defaultLineHeight,fontFinder){this.fontFinder=fontFinder,this.stack=[new FontInfo(defaultXfaFont,defaultParaMargin,defaultLineHeight,fontFinder)]}pushData(xfaFont,margin,lineHeight){var name,_name,lastFont=this.stack.at(-1);for(name of["typeface","posture","weight","size","letterSpacing"])xfaFont[name]||(xfaFont[name]=lastFont.xfaFont[name]);for(_name of["top","bottom","left","right"])isNaN(margin[_name])&&(margin[_name]=lastFont.paraMargin[_name]);lineHeight=new FontInfo(xfaFont,margin,lineHeight||lastFont.lineHeight,this.fontFinder);lineHeight.pdfFont||(lineHeight.pdfFont=lastFont.pdfFont),this.stack.push(lineHeight)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}class TextMeasure{constructor(defaultXfaFont,defaultParaMargin,defaultLineHeight,fonts){this.glyphs=[],this.fontSelector=new FontSelector(defaultXfaFont,defaultParaMargin,defaultLineHeight,fonts),this.extraHeight=0}pushData(xfaFont,margin,lineHeight){this.fontSelector.pushData(xfaFont,margin,lineHeight)}popFont(xfaFont){return this.fontSelector.popFont()}addPara(){var lastFont=this.fontSelector.topFont();this.extraHeight+=lastFont.paraMargin.top+lastFont.paraMargin.bottom}addString(str){if(str){var lastFont=this.fontSelector.topFont(),fontSize=lastFont.xfaFont.size;if(lastFont.pdfFont){var line,letterSpacing=lastFont.xfaFont.letterSpacing,pdfFont=lastFont.pdfFont,fontLineHeight=pdfFont.lineHeight||1.2,lineHeight=lastFont.lineHeight||Math.max(1.2,fontLineHeight)*fontSize,lastFont=void 0===pdfFont.lineGap?.2:pdfFont.lineGap,firstLineHeight=Math.max(1,fontLineHeight-lastFont)*fontSize,scale=fontSize/1e3,fallbackWidth=pdfFont.defaultWidth||pdfFont.charsToGlyphs(" ")[0].width;for(line of str.split(/[\u2029\n]/)){var glyph,encodedLine=pdfFont.encodeString(line).join("");for(glyph of pdfFont.charsToGlyphs(encodedLine)){var width=glyph.width||fallbackWidth;this.glyphs.push([width*scale+letterSpacing,lineHeight,firstLineHeight,glyph.unicode,!1])}this.glyphs.push([0,0,0,"\n",!0])}}else for(var _line2 of str.split(/[\u2029\n]/)){for(var char of _line2.split(""))this.glyphs.push([fontSize,1.2*fontSize,fontSize,char,!1]);this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}}compute(maxWidth){for(var lastSpacePos=-1,lastSpaceWidth=0,width=0,height=0,currentLineWidth=0,currentLineHeight=0,isBroken=!1,isFirstLine=!0,i=0,ii=this.glyphs.length;i<ii;i++){var[glyphWidth,lineHeight,firstLineHeight,char,isEOL]=this.glyphs[i],char=" "===char,firstLineHeight=isFirstLine?firstLineHeight:lineHeight;isEOL?(width=Math.max(width,currentLineWidth),height+=currentLineHeight,currentLineHeight=firstLineHeight,lastSpaceWidth=currentLineWidth=0,isFirstLine=!(lastSpacePos=-1)):char?maxWidth<currentLineWidth+glyphWidth?(width=Math.max(width,currentLineWidth),height+=currentLineHeight,currentLineHeight=firstLineHeight,lastSpacePos=-1,isFirstLine=!(isBroken=!(lastSpaceWidth=currentLineWidth=0))):(currentLineHeight=Math.max(firstLineHeight,currentLineHeight),lastSpaceWidth=currentLineWidth,currentLineWidth+=glyphWidth,lastSpacePos=i):maxWidth<currentLineWidth+glyphWidth?(height+=currentLineHeight,currentLineHeight=firstLineHeight,-1!==lastSpacePos?(i=lastSpacePos,width=Math.max(width,lastSpaceWidth),lastSpacePos=-1,lastSpaceWidth=currentLineWidth=0):(width=Math.max(width,currentLineWidth),currentLineWidth=glyphWidth),isFirstLine=!(isBroken=!0)):(currentLineWidth+=glyphWidth,currentLineHeight=Math.max(firstLineHeight,currentLineHeight))}return width=Math.max(width,currentLineWidth),height+=currentLineHeight+this.extraHeight,{width:WIDTH_FACTOR*width,height:height,isBroken:isBroken}}}var namePattern=/^[^.[]+/,indexPattern=/^[^\]]+/,operators={dot:0,dotDot:1,dotHash:2,dotBracket:3,dotParen:4},shortcuts=new Map([["$data",(root,current)=>root.datasets?root.datasets.data:root],["$record",(root,current)=>(root.datasets?root.datasets.data:root)[$getChildren]()[0]],["$template",(root,current)=>root.template],["$connectionSet",(root,current)=>root.connectionSet],["$form",(root,current)=>root.form],["$layout",(root,current)=>root.layout],["$host",(root,current)=>root.host],["$dataWindow",(root,current)=>root.dataWindow],["$event",(root,current)=>root.event],["!",(root,current)=>root.datasets],["$xfa",(root,current)=>root],["xfa",(root,current)=>root],["$",(root,current)=>current]]),somCache=new WeakMap;function parseIndex(index){return"*"===(index=index.trim())?1/0:parseInt(index,10)||0}function parseExpression(expr,dotDotAllowed){var noExpr=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],match=expr.match(namePattern);if(!match)return null;for(var[name]=match,parsed=[{name:name,cacheName:"."+name,index:0,js:null,formCalc:null,operator:operators.dot}],pos=name.length;pos<expr.length;){var spos=pos;if("["===expr.charAt(pos++)){if(!(match=expr.slice(pos).match(indexPattern)))return warn("XFA - Invalid index in SOM expression"),null;parsed.at(-1).index=parseIndex(match[0]),pos+=match[0].length+1}else{var operator=void 0;switch(expr.charAt(pos)){case".":if(!dotDotAllowed)return null;pos++,operator=operators.dotDot;break;case"#":pos++,operator=operators.dotHash;break;case"[":if(noExpr)return warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."),null;operator=operators.dotBracket;break;case"(":if(noExpr)return warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."),null;operator=operators.dotParen;break;default:operator=operators.dot}if(!(match=expr.slice(pos).match(namePattern)))break;[name]=match,pos+=name.length,parsed.push({name:name,cacheName:expr.slice(spos,pos),operator:operator,index:0,js:null,formCalc:null})}}return parsed}function searchNode(root,container,expr){var dotDotAllowed=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],useCache=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],parsed=parseExpression(expr,dotDotAllowed);if(!parsed)return null;for(var isQualified,_ret2,dotDotAllowed=shortcuts.get(parsed[0].name),i=0,ii=(dotDotAllowed?(isQualified=!0,root=[dotDotAllowed(root,container)],i=1):(isQualified=null===container,root=[container||root]),parsed.length);i<ii;i++)if(0!==(_ret2=function(){var node,{name,cacheName,operator,index}=parsed[i],nodes=[];for(node of root)if(node.isXFAObject){var children=void 0,cached=void 0;if(useCache&&((cached=somCache.get(node))||(cached=new Map,somCache.set(node,cached)),children=cached.get(cacheName)),!children){switch(operator){case operators.dot:children=node[$getChildrenByName](name,!1);break;case operators.dotDot:children=node[$getChildrenByName](name,!0);break;case operators.dotHash:children=(children=node[$getChildrenByClass](name)).isXFAObjectArray?children.children:[children]}useCache&&cached.set(cacheName,children)}0<children.length&&nodes.push(children)}if(0===nodes.length&&!isQualified&&0===i)return(container=container[$getParent]())?(i=-1,root=[container],0):{v:null};root=isFinite(index)?nodes.filter(node=>index<node.length).map(node=>node[index]):nodes.flat()}())&&_ret2)return _ret2.v;return 0===root.length?null:root}function createDataNode(root,container,expr){var parsed=parseExpression(expr);if(parsed&&!parsed.some(x=>x.operator===operators.dotDot)){var expr=shortcuts.get(parsed[0].name),i=0;expr?(root=expr(root,container),i=1):root=container||root;for(var ii=parsed.length;i<ii;i++){var{name,operator,index}=parsed[i];if(!isFinite(index))return parsed[i].index=0,root.createNodes(parsed.slice(i));var children=void 0;switch(operator){case operators.dot:children=root[$getChildrenByName](name,!1);break;case operators.dotDot:children=root[$getChildrenByName](name,!0);break;case operators.dotHash:children=(children=root[$getChildrenByClass](name)).isXFAObjectArray?children.children:[children]}if(0===children.length)return root.createNodes(parsed.slice(i));if(!(index<children.length))return parsed[i].index=index-children.length,root.createNodes(parsed.slice(i));operator=children[index];if(!operator.isXFAObject)return warn("XFA - Cannot create a node."),null;root=operator}}return null}var _applyPrototype=Symbol(),_attributes=Symbol(),_attributeNames=Symbol(),_children=Symbol("_children"),_cloneAttribute=Symbol(),_dataValue=Symbol(),_defaultValue=Symbol(),_filteredChildrenGenerator=Symbol(),_getPrototype=Symbol(),_getUnsetAttributes=Symbol(),_hasChildren=Symbol(),_max=Symbol(),_options=Symbol(),_parent=Symbol("parent"),_resolvePrototypesHelper=Symbol(),_setAttributes=Symbol(),_validator=Symbol(),uid=0,NS_DATASETS=NamespaceIds.datasets.id;class XFAObject{constructor(nsId,name){var hasChildren=2<arguments.length&&void 0!==arguments[2]&&arguments[2];this[$namespaceId]=nsId,this[$nodeName]=name,this[_hasChildren]=hasChildren,this[_parent]=null,this[_children]=[],this[$uid]="".concat(name).concat(uid++),this[$globalData]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(path){var name,index,root=this,node=null;for({name,index}of path){for(var i=0,ii=isFinite(index)?index:0;i<=ii;i++){var nsId=root[$namespaceId]===NS_DATASETS?-1:root[$namespaceId],node=new XmlObject(nsId,name);root[$appendChild](node)}root=node}return node}[$onChild](child){if(this[_hasChildren]&&this[$onChildCheck](child)){var name=child[$nodeName],node=this[name];if(!(node instanceof XFAObjectArray))return null!==node&&this[$removeChild](node),this[name]=child,this[$appendChild](child),!0;if(node.push(child))return this[$appendChild](child),!0;node="";this.id?node=" (id: ".concat(this.id,")"):this.name&&(node=" (name: ".concat(this.name," ").concat(this.h.value,")")),warn('XFA - node "'.concat(this[$nodeName],'"').concat(node,' has already enough "').concat(name,'"!'))}return!1}[$onChildCheck](child){return this.hasOwnProperty(child[$nodeName])&&child[$namespaceId]===this[$namespaceId]}[$isNsAgnostic](){return!1}[$acceptWhitespace](){return!1}[$isCDATAXml](){return!1}[$isBindable](){return!1}[$popPara](){this.para&&this[$getTemplateRoot]()[$extra].paraStack.pop()}[$pushPara](){this[$getTemplateRoot]()[$extra].paraStack.push(this.para)}[$setId](ids){this.id&&this[$namespaceId]===NamespaceIds.template.id&&ids.set(this.id,this)}[$getTemplateRoot](){return this[$globalData].template}[$isSplittable](){return!1}[$isThereMoreWidth](){return!1}[$appendChild](child){(child[_parent]=this)[_children].push(child),!child[$globalData]&&this[$globalData]&&(child[$globalData]=this[$globalData])}[$removeChild](child){child=this[_children].indexOf(child);this[_children].splice(child,1)}[$hasSettableValue](){return this.hasOwnProperty("value")}[$setValue](_){}[$onText](_){}[$finalize](){}[$clean](builder){delete this[_hasChildren],this[$cleanup]&&(builder.clean(this[$cleanup]),delete this[$cleanup])}[$indexOf](child){return this[_children].indexOf(child)}[$insertAt](i,child){(child[_parent]=this)[_children].splice(i,0,child),!child[$globalData]&&this[$globalData]&&(child[$globalData]=this[$globalData])}[$isTransparent](){return!this.name}[$lastAttribute](){return""}[$text](){return 0===this[_children].length?this[$content]:this[_children].map(c=>c[$text]()).join("")}get[_attributeNames](){var proto=Object.getPrototypeOf(this);if(!proto._attributes){var name,attributes=proto._attributes=new Set;for(name of Object.getOwnPropertyNames(this)){if(null===this[name]||this[name]instanceof XFAObject||this[name]instanceof XFAObjectArray)break;attributes.add(name)}}return shadow(this,_attributeNames,proto._attributes)}[$isDescendent](parent){for(var node=this;node;){if(node===parent)return!0;node=node[$getParent]()}return!1}[$getParent](){return this[_parent]}[$getSubformParent](){return this[$getParent]()}[$getChildren](){var name=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return name?this[name]:this[_children]}[$dump](){var name,dumped=Object.create(null);this[$content]&&(dumped.$content=this[$content]);for(name of Object.getOwnPropertyNames(this)){var value=this[name];null!==value&&(value instanceof XFAObject?dumped[name]=value[$dump]():value instanceof XFAObjectArray?value.isEmpty()||(dumped[name]=value.dump()):dumped[name]=value)}return dumped}[$toStyle](){return null}[$toHTML](){return HTMLResult.EMPTY}*[$getContainedChildren](){for(var node of this[$getChildren]())yield node}*[_filteredChildrenGenerator](filter,include){for(var node of this[$getContainedChildren]()){var availableSpace;filter&&include!==filter.has(node[$nodeName])||(availableSpace=this[$getAvailableSpace](),(availableSpace=node[$toHTML](availableSpace)).success||(this[$extra].failingNode=node),yield availableSpace)}}[$flushHTML](){return null}[$addHTML](html,bbox){this[$extra].children.push(html)}[$getAvailableSpace](){}[$childrenToHTML](_ref62){var{filter:_ref62=null,include=!0}=_ref62;if(this[$extra].generator){var availableSpace=this[$getAvailableSpace](),availableSpace=this[$extra].failingNode[$toHTML](availableSpace);if(!availableSpace.success)return availableSpace;availableSpace.html&&this[$addHTML](availableSpace.html,availableSpace.bbox),delete this[$extra].failingNode}else this[$extra].generator=this[_filteredChildrenGenerator](_ref62,include);for(;;){var gen=this[$extra].generator.next();if(gen.done)break;gen=gen.value;if(!gen.success)return gen;gen.html&&this[$addHTML](gen.html,gen.bbox)}return this[$extra].generator=null,HTMLResult.EMPTY}[$setSetAttributes](attributes){this[_setAttributes]=new Set(Object.keys(attributes))}[_getUnsetAttributes](protoAttributes){var allAttr=this[_attributeNames],setAttr=this[_setAttributes];return[...protoAttributes].filter(x=>allAttr.has(x)&&!setAttr.has(x))}[$resolvePrototypes](ids){var child,ancestors=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new Set;for(child of this[_children])child[_resolvePrototypesHelper](ids,ancestors)}[_resolvePrototypesHelper](ids,ancestors){var proto=this[_getPrototype](ids,ancestors);proto?this[_applyPrototype](proto,ids,ancestors):this[$resolvePrototypes](ids,ancestors)}[_getPrototype](ids,ancestors){var{use,usehref}=this;if(!use&&!usehref)return null;var proto=null,somExpression=null,id=null,ref=use;if(usehref?(ref=usehref).startsWith("#som(")&&usehref.endsWith(")")?somExpression=usehref.slice("#som(".length,-1):usehref.startsWith(".#som(")&&usehref.endsWith(")")?somExpression=usehref.slice(".#som(".length,-1):usehref.startsWith("#")?id=usehref.slice(1):usehref.startsWith(".#")&&(id=usehref.slice(2)):use.startsWith("#")?id=use.slice(1):somExpression=use,this.use=this.usehref="",!(proto=id?ids.get(id):(proto=searchNode(ids.get($root),this,somExpression,!0,!1))&&proto[0]))return warn("XFA - Invalid prototype reference: ".concat(ref,".")),null;if(proto[$nodeName]!==this[$nodeName])return warn("XFA - Incompatible prototype: ".concat(proto[$nodeName]," !== ").concat(this[$nodeName],".")),null;if(ancestors.has(proto))return warn("XFA - Cycle detected in prototypes use."),null;ancestors.add(proto);usehref=proto[_getPrototype](ids,ancestors);return usehref&&proto[_applyPrototype](usehref,ids,ancestors),proto[$resolvePrototypes](ids,ancestors),ancestors.delete(proto),proto}[_applyPrototype](proto,ids,ancestors){if(ancestors.has(proto))warn("XFA - Cycle detected in prototypes use.");else{var unsetAttrName,name;!this[$content]&&proto[$content]&&(this[$content]=proto[$content]),new Set(ancestors).add(proto);for(unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes]))this[unsetAttrName]=proto[unsetAttrName],this[_setAttributes]&&this[_setAttributes].add(unsetAttrName);for(name of Object.getOwnPropertyNames(this))if(!this[_attributeNames].has(name)){var value=this[name],protoValue=proto[name];if(value instanceof XFAObjectArray){for(var child of value[_children])child[_resolvePrototypesHelper](ids,ancestors);for(var i=value[_children].length,ii=protoValue[_children].length;i<ii;i++){var _child=proto[_children][i][$clone]();if(!value.push(_child))break;(_child[_parent]=this)[_children].push(_child),_child[_resolvePrototypesHelper](ids,ancestors)}}else null!==value?(value[$resolvePrototypes](ids,ancestors),protoValue&&value[_applyPrototype](protoValue,ids,ancestors)):null!==protoValue&&(((protoValue=protoValue[$clone]())[_parent]=this)[name]=protoValue,this[_children].push(protoValue),protoValue[_resolvePrototypesHelper](ids,ancestors))}}}static[_cloneAttribute](obj){return Array.isArray(obj)?obj.map(x=>XFAObject[_cloneAttribute](x)):"object"==typeof obj&&null!==obj?Object.assign({},obj):obj}[$clone](){var $symbol,name,value,child,clone=Object.create(Object.getPrototypeOf(this));for($symbol of Object.getOwnPropertySymbols(this))try{clone[$symbol]=this[$symbol]}catch(_unused10){shadow(clone,$symbol,this[$symbol])}clone[$uid]="".concat(clone[$nodeName]).concat(uid++),clone[_children]=[];for(name of Object.getOwnPropertyNames(this))this[_attributeNames].has(name)?clone[name]=XFAObject[_cloneAttribute](this[name]):(value=this[name],clone[name]=value instanceof XFAObjectArray?new XFAObjectArray(value[_max]):null);for(child of this[_children]){var _name2=child[$nodeName],clonedChild=child[$clone]();clone[_children].push(clonedChild),null===(clonedChild[_parent]=clone)[_name2]?clone[_name2]=clonedChild:clone[_name2][_children].push(clonedChild)}return clone}[$getChildren](){var name=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return name?this[_children].filter(c=>c[$nodeName]===name):this[_children]}[$getChildrenByClass](name){return this[name]}[$getChildrenByName](name,allTransparent){return Array.from(this[$getChildrenByNameIt](name,allTransparent,!(2<arguments.length&&void 0!==arguments[2])||arguments[2]))}[$getChildrenByNameIt](name,allTransparent){var _this5=this,first=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];return function*(){if("parent"===name)yield _this5[_parent];else{for(var child of _this5[_children])child[$nodeName]===name&&(yield child),child.name===name&&(yield child),(allTransparent||child[$isTransparent]())&&(yield*child[$getChildrenByNameIt](name,allTransparent,!1));first&&_this5[_attributeNames].has(name)&&(yield new XFAAttribute(_this5,name,_this5[name]))}}()}}class XFAObjectArray{constructor(){this[_max]=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1/0,this[_children]=[]}get isXFAObject(){return!1}get isXFAObjectArray(){return!0}push(child){return this[_children].length<=this[_max]?(this[_children].push(child),!0):(warn('XFA - node "'.concat(child[$nodeName],'" accepts no more than ').concat(this[_max]," children")),!1)}isEmpty(){return 0===this[_children].length}dump(){return 1===this[_children].length?this[_children][0][$dump]():this[_children].map(x=>x[$dump]())}[$clone](){var clone=new XFAObjectArray(this[_max]);return clone[_children]=this[_children].map(c=>c[$clone]()),clone}get children(){return this[_children]}clear(){this[_children].length=0}}class XFAAttribute{constructor(node,name,value){this[_parent]=node,this[$nodeName]=name,this[$content]=value,this[$consumed]=!1,this[$uid]="attribute".concat(uid++)}[$getParent](){return this[_parent]}[$isDataValue](){return!0}[$getDataValue](){return this[$content].trim()}[$setValue](value){value=value.value||"",this[$content]=value.toString()}[$text](){return this[$content]}[$isDescendent](parent){return this[_parent]===parent||this[_parent][$isDescendent](parent)}}class XmlObject extends XFAObject{constructor(nsId,name){var attributes=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(super(nsId,name),this[$content]="",this[_dataValue]=null,"#text"!==name){var attrName,value,map=new Map;this[_attributes]=map;for([attrName,value]of Object.entries(attributes))map.set(attrName,new XFAAttribute(this,attrName,value));attributes.hasOwnProperty($nsAttributes)&&void 0!==(nsId=attributes[$nsAttributes].xfa.dataNode)&&("dataGroup"===nsId?this[_dataValue]=!1:"dataValue"===nsId&&(this[_dataValue]=!0))}this[$consumed]=!1}[$toString](buf){var tagName=this[$nodeName];if("#text"===tagName)buf.push(encodeToXmlString(this[$content]));else{var name,value,tagName=utf8StringToString(tagName),prefix=this[$namespaceId]===NS_DATASETS?"xfa:":"";buf.push("<".concat(prefix).concat(tagName));for([name,value]of this[_attributes].entries()){var utf8Name=utf8StringToString(name);buf.push(" ".concat(utf8Name,'="').concat(encodeToXmlString(value[$content]),'"'))}if(null!==this[_dataValue]&&(this[_dataValue]?buf.push(' xfa:dataNode="dataValue"'):buf.push(' xfa:dataNode="dataGroup"')),this[$content]||0!==this[_children].length){if(buf.push(">"),this[$content])"string"==typeof this[$content]?buf.push(encodeToXmlString(this[$content])):this[$content][$toString](buf);else for(var child of this[_children])child[$toString](buf);buf.push("</".concat(prefix).concat(tagName,">"))}else buf.push("/>")}}[$onChild](child){var node;return this[$content]&&(node=new XmlObject(this[$namespaceId],"#text"),this[$appendChild](node),node[$content]=this[$content],this[$content]=""),this[$appendChild](child),!0}[$onText](str){this[$content]+=str}[$finalize](){var node;this[$content]&&0<this[_children].length&&(node=new XmlObject(this[$namespaceId],"#text"),this[$appendChild](node),node[$content]=this[$content],delete this[$content])}[$toHTML](){return"#text"===this[$nodeName]?HTMLResult.success({name:"#text",value:this[$content]}):HTMLResult.EMPTY}[$getChildren](){var name=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return name?this[_children].filter(c=>c[$nodeName]===name):this[_children]}[$getAttributes](){return this[_attributes]}[$getChildrenByClass](name){var value=this[_attributes].get(name);return void 0!==value?value:this[$getChildren](name)}*[$getChildrenByNameIt](name,allTransparent){var child,value=this[_attributes].get(name);value&&(yield value);for(child of this[_children])child[$nodeName]===name&&(yield child),allTransparent&&(yield*child[$getChildrenByNameIt](name,allTransparent))}*[$getAttributeIt](name,skipConsumed){var child,value=this[_attributes].get(name);!value||skipConsumed&&value[$consumed]||(yield value);for(child of this[_children])yield*child[$getAttributeIt](name,skipConsumed)}*[$getRealChildrenByNameIt](name,allTransparent,skipConsumed){for(var child of this[_children])child[$nodeName]!==name||skipConsumed&&child[$consumed]||(yield child),allTransparent&&(yield*child[$getRealChildrenByNameIt](name,allTransparent,skipConsumed))}[$isDataValue](){return null===this[_dataValue]?0===this[_children].length||this[_children][0][$namespaceId]===NamespaceIds.xhtml.id:this[_dataValue]}[$getDataValue](){return null!==this[_dataValue]||0===this[_children].length?this[$content].trim():this[_children][0][$namespaceId]===NamespaceIds.xhtml.id?this[_children][0][$text]().trim():null}[$setValue](value){value=value.value||"",this[$content]=value.toString()}[$dump](){var child,name,value,hasNS=0<arguments.length&&void 0!==arguments[0]&&arguments[0],dumped=Object.create(null);hasNS&&(dumped.$ns=this[$namespaceId]),this[$content]&&(dumped.$content=this[$content]),dumped.$name=this[$nodeName],dumped.children=[];for(child of this[_children])dumped.children.push(child[$dump](hasNS));dumped.attributes=Object.create(null);for([name,value]of this[_attributes])dumped.attributes[name]=value[$content];return dumped}}class ContentObject extends XFAObject{constructor(nsId,name){super(nsId,name),this[$content]=""}[$onText](text){this[$content]+=text}[$finalize](){}}class OptionObject extends ContentObject{constructor(nsId,name,options){super(nsId,name),this[_options]=options}[$finalize](){this[$content]=getKeyword({data:this[$content],defaultValue:this[_options][0],validate:k=>this[_options].includes(k)})}[$clean](builder){super[$clean](builder),delete this[_options]}}class StringObject extends ContentObject{[$finalize](){this[$content]=this[$content].trim()}}class IntegerObject extends ContentObject{constructor(nsId,name,defaultValue,validator){super(nsId,name),this[_defaultValue]=defaultValue,this[_validator]=validator}[$finalize](){this[$content]=getInteger({data:this[$content],defaultValue:this[_defaultValue],validate:this[_validator]})}[$clean](builder){super[$clean](builder),delete this[_defaultValue],delete this[_validator]}}class Option01 extends IntegerObject{constructor(nsId,name){super(nsId,name,0,n=>1===n)}}class Option10 extends IntegerObject{constructor(nsId,name){super(nsId,name,1,n=>0===n)}}function measureToString(m){return"string"==typeof m?"0px":Number.isInteger(m)?"".concat(m,"px"):"".concat(m.toFixed(2),"px")}var converters={anchorType(node,style){var parent=node[$getSubformParent]();if(parent&&(!parent.layout||"position"===parent.layout))switch("transform"in style||(style.transform=""),node.anchorType){case"bottomCenter":style.transform+="translate(-50%, -100%)";break;case"bottomLeft":style.transform+="translate(0,-100%)";break;case"bottomRight":style.transform+="translate(-100%,-100%)";break;case"middleCenter":style.transform+="translate(-50%,-50%)";break;case"middleLeft":style.transform+="translate(0,-50%)";break;case"middleRight":style.transform+="translate(-100%,-50%)";break;case"topCenter":style.transform+="translate(-50%,0)";break;case"topRight":style.transform+="translate(-100%,0)"}},dimensions(node,style){var _parent$layout,w,parent=node[$getSubformParent](),width=node.w,height=node.h;null!=(_parent$layout=parent.layout)&&_parent$layout.includes("row")&&(_parent$layout=parent[$extra],-1===(parent=node.colSpan)?(w=Math.sumPrecise(_parent$layout.columnWidths.slice(_parent$layout.currentColumn)),_parent$layout.currentColumn=0):(w=Math.sumPrecise(_parent$layout.columnWidths.slice(_parent$layout.currentColumn,_parent$layout.currentColumn+parent)),_parent$layout.currentColumn=(_parent$layout.currentColumn+node.colSpan)%_parent$layout.columnWidths.length),isNaN(w)||(width=node.w=w)),style.width=""!==width?measureToString(width):"auto",style.height=""!==height?measureToString(height):"auto"},position(node,style){var parent=node[$getSubformParent]();null!=parent&&parent.layout&&"position"!==parent.layout||(style.position="absolute",style.left=measureToString(node.x),style.top=measureToString(node.y))},rotate(node,style){node.rotate&&("transform"in style||(style.transform=""),style.transform+="rotate(-".concat(node.rotate,"deg)"),style.transformOrigin="top left")},presence(node,style){switch(node.presence){case"invisible":style.visibility="hidden";break;case"hidden":case"inactive":style.display="none"}},hAlign(node,style){if("para"===node[$nodeName])switch(node.hAlign){case"justifyAll":style.textAlign="justify-all";break;case"radix":style.textAlign="left";break;default:style.textAlign=node.hAlign}else switch(node.hAlign){case"left":style.alignSelf="start";break;case"center":style.alignSelf="center";break;case"right":style.alignSelf="end"}},margin(node,style){node.margin&&(style.margin=node.margin[$toStyle]().margin)}};function setMinMaxDimensions(node,style){"position"===node[$getSubformParent]().layout&&(0<node.minW&&(style.minWidth=measureToString(node.minW)),0<node.maxW&&(style.maxWidth=measureToString(node.maxW)),0<node.minH&&(style.minHeight=measureToString(node.minH)),0<node.maxH)&&(style.maxHeight=measureToString(node.maxH))}function layoutText(text,xfaFont,margin,lineHeight,fontFinder,width){xfaFont=new TextMeasure(xfaFont,margin,lineHeight,fontFinder);return"string"==typeof text?xfaFont.addString(text):text[$pushGlyphs](xfaFont),xfaFont.compute(width)}function layoutNode(node,availableSpace){var height=null,width=null,isBroken=!1;if((!node.w||!node.h)&&node.value){var marginH=0,marginV=0,lineHeight=(node.margin&&(marginH=node.margin.leftInset+node.margin.rightInset,marginV=node.margin.topInset+node.margin.bottomInset),null),margin=null,font=(node.para&&(margin=Object.create(null),lineHeight=""===node.para.lineHeight?null:node.para.lineHeight,margin.top=""===node.para.spaceAbove?0:node.para.spaceAbove,margin.bottom=""===node.para.spaceBelow?0:node.para.spaceBelow,margin.left=""===node.para.marginLeft?0:node.para.marginLeft,margin.right=""===node.para.marginRight?0:node.para.marginRight),node.font);if(!font)for(var root=node[$getTemplateRoot](),parent=node[$getParent]();parent&&parent!==root;){if(parent.font){font=parent.font;break}parent=parent[$getParent]()}var res,availableSpace=(node.w||availableSpace.width)-marginH,fontFinder=node[$globalData].fontFinder;node.value.exData&&node.value.exData[$content]&&"text/html"===node.value.exData.contentType?(width=(res=layoutText(node.value.exData[$content],font,margin,lineHeight,fontFinder,availableSpace)).width,height=res.height,isBroken=res.isBroken):(res=node.value[$text]())&&(width=(res=layoutText(res,font,margin,lineHeight,fontFinder,availableSpace)).width,height=res.height,isBroken=res.isBroken),null===width||node.w||(width+=marginH),null===height||node.h||(height+=marginV)}return{w:width,h:height,isBroken:isBroken}}function computeBbox(node,html,availableSpace){var bbox;if(""!==node.w&&""!==node.h)bbox=[node.x,node.y,node.w,node.h];else{if(!availableSpace)return null;var _parent3,width=node.w,parent=(""===width&&(width=0===node.maxW?"position"===(parent=node[$getSubformParent]()).layout&&""!==parent.w?0:node.minW:Math.min(node.maxW,availableSpace.width),html.attributes.style.width=measureToString(width)),node.h);""===parent&&(parent=0===node.maxH?"position"===(_parent3=node[$getSubformParent]()).layout&&""!==_parent3.h?0:node.minH:Math.min(node.maxH,availableSpace.height),html.attributes.style.height=measureToString(parent)),bbox=[node.x,node.y,width,parent]}return bbox}function fixDimensions(node){var colSpan,_parent$layout2,parent=node[$getSubformParent]();null!=(_parent$layout2=parent.layout)&&_parent$layout2.includes("row")&&(_parent$layout2=parent[$extra],_parent$layout2=-1===(colSpan=node.colSpan)?Math.sumPrecise(_parent$layout2.columnWidths.slice(_parent$layout2.currentColumn)):Math.sumPrecise(_parent$layout2.columnWidths.slice(_parent$layout2.currentColumn,_parent$layout2.currentColumn+colSpan)),isNaN(_parent$layout2)||(node.w=_parent$layout2)),parent.layout&&"position"!==parent.layout&&(node.x=node.y=0),"table"===node.layout&&""===node.w&&Array.isArray(node.columnWidths)&&(node.w=Math.sumPrecise(node.columnWidths))}function layoutClass(node){switch(node.layout){case"position":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";default:return"xfaPosition"}}function toStyle(node){for(var name,style=Object.create(null),_len2=arguments.length,names=new Array(1<_len2?_len2-1:0),_key6=1;_key6<_len2;_key6++)names[_key6-1]=arguments[_key6];for(name of names){var value=node[name];null!==value&&(converters.hasOwnProperty(name)?converters[name](node,style):value instanceof XFAObject&&((value=value[$toStyle]())?Object.assign(style,value):warn("(DEBUG) - XFA - style for ".concat(name," not implemented yet"))))}return style}function createWrapper(node,html){var _key7,attributes=html["attributes"],style=attributes["style"],wrapper={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};if(attributes.class.push("xfaWrapped"),node.border){var width,height,{widths,insets:attributes}=node.border[$extra],top=attributes[0],left=attributes[3],insetsH=attributes[0]+attributes[2],insetsW=attributes[1]+attributes[3];switch(node.border.hand){case"even":top-=widths[0]/2,left-=widths[3]/2,width="calc(100% + ".concat((widths[1]+widths[3])/2-insetsW,"px)"),height="calc(100% + ".concat((widths[0]+widths[2])/2-insetsH,"px)");break;case"left":top-=widths[0],left-=widths[3],width="calc(100% + ".concat(widths[1]+widths[3]-insetsW,"px)"),height="calc(100% + ".concat(widths[0]+widths[2]-insetsH,"px)");break;case"right":width=insetsW?"calc(100% - ".concat(insetsW,"px)"):"100%",height=insetsH?"calc(100% - ".concat(insetsH,"px)"):"100%"}var key,attributes=["xfaBorder"],border=(isPrintOnly(node.border)&&attributes.push("xfaPrintOnly"),{name:"div",attributes:{class:attributes,style:{top:"".concat(top,"px"),left:"".concat(left,"px"),width:width,height:height}},children:[]});for(key of["border","borderWidth","borderColor","borderRadius","borderStyle"])void 0!==style[key]&&(border.attributes.style[key]=style[key],delete style[key]);wrapper.children.push(border,html)}else wrapper.children.push(html);for(_key7 of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])void 0!==style[_key7]&&(wrapper.attributes.style[_key7]=style[_key7],delete style[_key7]);return wrapper.attributes.style.position="absolute"===style.position?"absolute":"relative",delete style.position,style.alignSelf&&(wrapper.attributes.style.alignSelf=style.alignSelf,delete style.alignSelf),wrapper}function fixTextIndent(styles){var name,padding,indent=getMeasurement(styles.textIndent,"0px");0<=indent||(padding=getMeasurement(styles[name="padding"+("left"==("right"===styles.textAlign?"right":"left")?"Left":"Right")],"0px"),styles[name]="".concat(padding-indent,"px"))}function setAccess(node,classNames){switch(node.access){case"nonInteractive":classNames.push("xfaNonInteractive");break;case"readOnly":classNames.push("xfaReadOnly");break;case"protected":classNames.push("xfaDisabled")}}function isPrintOnly(node){return 0<node.relevant.length&&!node.relevant[0].excluded&&"print"===node.relevant[0].viewname}function getCurrentPara(node){node=node[$getTemplateRoot]()[$extra].paraStack;return node.length?node.at(-1):null}function setPara(node,nodeStyle,value){if(null!=(_value$attributes$cla=value.attributes.class)&&_value$attributes$cla.includes("xfaRich")){nodeStyle&&(""===node.h&&(nodeStyle.height="auto"),""===node.w)&&(nodeStyle.width="auto");var _value$attributes$cla=getCurrentPara(node);if(_value$attributes$cla){var valueStyle=value.attributes.style;switch(valueStyle.display="flex",valueStyle.flexDirection="column",_value$attributes$cla.vAlign){case"top":valueStyle.justifyContent="start";break;case"bottom":valueStyle.justifyContent="end";break;case"middle":valueStyle.justifyContent="center"}var key,val,nodeStyle=_value$attributes$cla[$toStyle]();for([key,val]of Object.entries(nodeStyle))key in valueStyle||(valueStyle[key]=val)}}}function setFontFamily(xfaFont,node,fontFinder,style){var name,fontFamily;fontFinder?(name=stripQuotes(xfaFont.typeface),style.fontFamily='"'.concat(name,'"'),(fontFinder=fontFinder.find(name))&&(fontFamily=fontFinder.regular.cssFontInfo["fontFamily"],fontFamily!==name&&(style.fontFamily='"'.concat(fontFamily,'"')),(name=getCurrentPara(node))&&""!==name.lineHeight||style.lineHeight||(fontFamily=selectFont(xfaFont,fontFinder))&&(style.lineHeight=Math.max(1.2,fontFamily.lineHeight)))):delete style.fontFamily}function fixURL(str){str=createValidAbsoluteUrl(str,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return str?str.href:null}function createLine(node,children){return{name:"div",attributes:{class:["lr-tb"===node.layout?"xfaLr":"xfaRl"]},children:children}}function flushHTML(node){var html,htmlFromFailing;return!node[$extra]||(html={name:"div",attributes:node[$extra].attributes,children:node[$extra].children},node[$extra].failingNode&&(htmlFromFailing=node[$extra].failingNode[$flushHTML]())&&(node.layout.endsWith("-tb")?html.children.push(createLine(node,[htmlFromFailing])):html.children.push(htmlFromFailing)),0===html.children.length)?null:html}function addHTML(node,html,bbox){var extra=node[$extra],availableSpace=extra.availableSpace,[x,y,w,h]=bbox;switch(node.layout){case"position":extra.width=Math.max(extra.width,x+w),extra.height=Math.max(extra.height,y+h),extra.children.push(html);break;case"lr-tb":case"rl-tb":extra.line&&1!==extra.attempt||(extra.line=createLine(node,[]),extra.children.push(extra.line),extra.numberInLine=0),extra.numberInLine+=1,extra.line.children.push(html),0===extra.attempt?(extra.currentWidth+=w,extra.height=Math.max(extra.height,extra.prevHeight+h)):(extra.currentWidth=w,extra.prevHeight=extra.height,extra.height+=h,extra.attempt=0),extra.width=Math.max(extra.width,extra.currentWidth);break;case"rl-row":case"row":extra.children.push(html),extra.width+=w,extra.height=Math.max(extra.height,h);var child,height=measureToString(extra.height);for(child of extra.children)child.attributes.style.height=height;break;case"table":case"tb":extra.width=MathClamp(w,extra.width,availableSpace.width),extra.height+=h,extra.children.push(html)}}function getAvailableSpace(node){var availableSpace=node[$extra].availableSpace,marginV=node.margin?node.margin.topInset+node.margin.bottomInset:0,marginH=node.margin?node.margin.leftInset+node.margin.rightInset:0;switch(node.layout){case"lr-tb":case"rl-tb":return 0===node[$extra].attempt?{width:availableSpace.width-marginH-node[$extra].currentWidth,height:availableSpace.height-marginV-node[$extra].prevHeight}:{width:availableSpace.width-marginH,height:availableSpace.height-marginV-node[$extra].height};case"rl-row":case"row":return{width:Math.sumPrecise(node[$extra].columnWidths.slice(node[$extra].currentColumn)),height:availableSpace.height-marginH};case"table":case"tb":return{width:availableSpace.width-marginH,height:availableSpace.height-marginV-node[$extra].height};default:return availableSpace}}function getTransformedBBox(node){var x,y,w=""===node.w?NaN:node.w,h=""===node.h?NaN:node.h,[centerX,centerY]=[0,0];switch(node.anchorType||""){case"bottomCenter":[centerX,centerY]=[w/2,h];break;case"bottomLeft":[centerX,centerY]=[0,h];break;case"bottomRight":[centerX,centerY]=[w,h];break;case"middleCenter":[centerX,centerY]=[w/2,h/2];break;case"middleLeft":[centerX,centerY]=[0,h/2];break;case"middleRight":[centerX,centerY]=[w,h/2];break;case"topCenter":[centerX,centerY]=[w/2,0];break;case"topRight":[centerX,centerY]=[w,0]}switch(node.rotate||0){case 0:[x,y]=[-centerX,-centerY];break;case 90:[x,y]=[-centerY,centerX],[w,h]=[h,-w];break;case 180:[x,y]=[centerX,centerY],[w,h]=[-w,-h];break;case 270:[x,y]=[centerY,-centerX],[w,h]=[-h,w]}return[node.x+x+Math.min(0,w),node.y+y+Math.min(0,h),Math.abs(w),Math.abs(h)]}function checkDimensions(node,space){var _parent$$extra;if(null===node[$getTemplateRoot]()[$extra].firstUnsplittable)return!0;if(0===node.w||0===node.h)return!0;var parent=node[$getSubformParent](),attempt=(null==(_parent$$extra=parent[$extra])?void 0:_parent$$extra.attempt)||0,[,y,w,h]=getTransformedBBox(node);switch(parent.layout){case"lr-tb":case"rl-tb":return 0===attempt?node[$getTemplateRoot]()[$extra].noLayoutFailure?""!==node.w?Math.round(w-space.width)<=2:2<space.width:!(""!==node.h&&2<Math.round(h-space.height))&&(""!==node.w?Math.round(w-space.width)<=2||0===parent[$extra].numberInLine&&2<space.height:2<space.width):!!node[$getTemplateRoot]()[$extra].noLayoutFailure||!(""!==node.h&&2<Math.round(h-space.height))&&(""===node.w||Math.round(w-space.width)<=2||!parent[$isThereMoreWidth]())&&2<space.height;case"table":case"tb":return node[$getTemplateRoot]()[$extra].noLayoutFailure?!0:""===node.h||node[$isSplittable]()?(""===node.w||Math.round(w-space.width)<=2||!parent[$isThereMoreWidth]())&&2<space.height:Math.round(h-space.height)<=2;case"position":return node[$getTemplateRoot]()[$extra].noLayoutFailure?!0:""===node.h||Math.round(h+y-space.height)<=2||h+y>node[$getTemplateRoot]()[$extra].currentContentArea.h;case"rl-row":case"row":return node[$getTemplateRoot]()[$extra].noLayoutFailure?!0:""===node.h||Math.round(h-space.height)<=2;default:return!0}}var TEMPLATE_NS_ID=NamespaceIds.template.id,SVG_NS="http://www.w3.org/2000/svg",MAX_ATTEMPTS_FOR_LRTB_LAYOUT=2,MAX_EMPTY_PAGES=3,DEFAULT_TAB_INDEX=5e3,HEADING_PATTERN=/^H(\d+)$/,MIMES=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"]),IMAGES_HEADERS=[[[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(node){return node&&node.border&&(node=node.border[$getExtra]())?{w:node.widths[0]+node.widths[2]+node.insets[0]+node.insets[2],h:node.widths[1]+node.widths[3]+node.insets[1]+node.insets[3]}:{w:0,h:0}}function hasMargin(node){return node.margin&&(node.margin.topInset||node.margin.rightInset||node.margin.bottomInset||node.margin.leftInset)}function _setValue(templateNode,value){var nodeValue;templateNode.value||(nodeValue=new Value({}),templateNode[$appendChild](nodeValue),templateNode.value=nodeValue),templateNode.value[$setValue](value)}function*getContainedChildren(node){for(var child of node[$getChildren]())child instanceof SubformSet?yield*child[$getContainedChildren]():yield child}function isRequired(node){return"error"===(null==(node=node.validate)?void 0:node.nullTest)}function setTabIndex(node){for(;node;){if(!node.traversal)return void(node[$tabIndex]=node[$getParent]()[$tabIndex]);if(node[$tabIndex])return;var child,next=null;for(child of node.traversal[$getChildren]())if("next"===child.operation){next=child;break}if(!next||!next.ref)return void(node[$tabIndex]=node[$getParent]()[$tabIndex]);var root=node[$getTemplateRoot](),root=(node[$tabIndex]=++root[$tabIndex],root[$searchNode](next.ref,node));if(!root)return;node=root[0]}}function applyAssist(obj,attributes){var assistTitle,assist=obj.assist;assist&&((assistTitle=assist[$toHTML]())&&(attributes.title=assistTitle),assistTitle=assist.role.match(HEADING_PATTERN))&&(assist=assistTitle[1],attributes.role="heading",attributes["aria-level"]=assist),"table"===obj.layout?attributes.role="table":"row"===obj.layout?attributes.role="row":"row"===(assistTitle=obj[$getParent]()).layout&&(attributes.role="TH"===(null==(assist=assistTitle.assist)?void 0:assist.role)?"columnheader":"cell")}function ariaLabel(obj){return obj.assist?(obj=obj.assist).speak&&""!==obj.speak[$content]?obj.speak[$content]:obj.toolTip?obj.toolTip[$content]:null:null}function valueToHtml(value){return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:value}]})}function setFirstUnsplittable(node){var root=node[$getTemplateRoot]();null===root[$extra].firstUnsplittable&&(root[$extra].firstUnsplittable=node,root[$extra].noLayoutFailure=!0)}function unsetFirstUnsplittable(node){var root=node[$getTemplateRoot]();root[$extra].firstUnsplittable===node&&(root[$extra].noLayoutFailure=!1)}function handleBreak(node){if(node[$extra])return!1;if(node[$extra]=Object.create(null),"auto"===node.targetType)return!1;var root=node[$getTemplateRoot](),target=null;if(node.target){if(!(target=root[$searchNode](node.target,node[$getParent]())))return!1;target=target[0]}var{currentPageArea:root,currentContentArea}=root[$extra];if("pageArea"===node.targetType)return target instanceof PageArea||(target=null),node.startNew?(node[$extra].target=target||root,!0):!(!target||target===root||(node[$extra].target=target,0));var pageArea=(target=target instanceof ContentArea?target:null)&&target[$getParent](),nextPageArea=pageArea;if(node.startNew)var contentAreas,indexForCurrent=target?(indexForCurrent=(contentAreas=pageArea.contentArea.children).indexOf(currentContentArea),contentAreas=contentAreas.indexOf(target),-1!==indexForCurrent&&indexForCurrent<contentAreas&&(nextPageArea=null),contentAreas-1):root.contentArea.children.indexOf(currentContentArea);else{if(!target||target===currentContentArea)return!1;indexForCurrent=pageArea.contentArea.children.indexOf(target)-1,nextPageArea=pageArea===root?null:pageArea}return node[$extra].target=nextPageArea,node[$extra].index=indexForCurrent,!0}function handleOverflow(node,extraNode,space){var root=node[$getTemplateRoot](),saved=root[$extra].noLayoutFailure,savedMethod=extraNode[$getSubformParent],space=(extraNode[$getSubformParent]=()=>node,root[$extra].noLayoutFailure=!0,extraNode[$toHTML](space));node[$addHTML](space.html,space.bbox),root[$extra].noLayoutFailure=saved,extraNode[$getSubformParent]=savedMethod}class AppearanceFilter extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"appearanceFilter"),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Arc extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"arc",!0),this.circular=getInteger({data:attributes.circular,defaultValue:0,validate:x=>1===x}),this.hand=getStringOption(attributes.hand,["even","left","right"]),this.id=attributes.id||"",this.startAngle=getFloat({data:attributes.startAngle,defaultValue:0,validate:x=>!0}),this.sweepAngle=getFloat({data:attributes.sweepAngle,defaultValue:360,validate:x=>!0}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.edge=null,this.fill=null}[$toHTML](){var largeArc,x2,y2,arc,edge=this.edge||new Edge({}),edgeStyle=edge[$toStyle](),style=Object.create(null),_this$fill=("visible"===(null==(_this$fill=this.fill)?void 0:_this$fill.presence)?Object.assign(style,this.fill[$toStyle]()):style.fill="transparent",style.strokeWidth=measureToString("visible"===edge.presence?edge.thickness:0),style.stroke=edgeStyle.color,{xmlns:SVG_NS,style:{width:"100%",height:"100%",overflow:"visible"}}),edge=(360===this.sweepAngle?arc={name:"ellipse",attributes:{xmlns:SVG_NS,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:style}}:(edge=this.startAngle*Math.PI/180,edgeStyle=this.sweepAngle*Math.PI/180,largeArc=180<this.sweepAngle?1:0,[edge,edgeStyle,x2,y2]=[50*(1+Math.cos(edge)),50*(1-Math.sin(edge)),50*(1+Math.cos(edge+edgeStyle)),50*(1-Math.sin(edge+edgeStyle))],arc={name:"path",attributes:{xmlns:SVG_NS,d:"M ".concat(edge," ").concat(edgeStyle," A 50 50 0 ").concat(largeArc," 0 ").concat(x2," ").concat(y2),vectorEffect:"non-scaling-stroke",style:style}},Object.assign(_this$fill,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})),{name:"svg",children:[arc],attributes:_this$fill});return hasMargin(this[$getParent]()[$getParent]())?HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[edge]}):(edge.attributes.style.position="absolute",HTMLResult.success(edge))}}class Area extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"area",!0),this.colSpan=getInteger({data:attributes.colSpan,defaultValue:1,validate:n=>1<=n||-1===n}),this.id=attributes.id||"",this.name=attributes.name||"",this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.x=getMeasurement(attributes.x,"0pt"),this.y=getMeasurement(attributes.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}*[$getContainedChildren](){yield*getContainedChildren(this)}[$isTransparent](){return!0}[$isBindable](){return!0}[$addHTML](html,bbox){var[bbox,y,w,h]=bbox;this[$extra].width=Math.max(this[$extra].width,bbox+w),this[$extra].height=Math.max(this[$extra].height,y+h),this[$extra].children.push(html)}[$getAvailableSpace](){return this[$extra].availableSpace}[$toHTML](availableSpace){var style=toStyle(this,"position"),attributes={style:style,id:this[$uid],class:["xfaArea"]},children=(isPrintOnly(this)&&attributes.class.push("xfaPrintOnly"),this.name&&(attributes.xfaName=this.name),[]),availableSpace=(this[$extra]={children:children,width:0,height:0,availableSpace:availableSpace},this[$childrenToHTML]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0}));if(!availableSpace.success)return availableSpace.isBreak()?availableSpace:(delete this[$extra],HTMLResult.FAILURE);style.width=measureToString(this[$extra].width),style.height=measureToString(this[$extra].height);availableSpace={name:"div",attributes:attributes,children:children},style=[this.x,this.y,this[$extra].width,this[$extra].height];return delete this[$extra],HTMLResult.success(availableSpace,style)}}class Assist extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"assist",!0),this.id=attributes.id||"",this.role=attributes.role||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.speak=null,this.toolTip=null}[$toHTML](){var _this$toolTip;return(null==(_this$toolTip=this.toolTip)?void 0:_this$toolTip[$content])||null}}class Barcode extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"barcode",!0),this.charEncoding=getKeyword({data:attributes.charEncoding?attributes.charEncoding.toLowerCase():"",defaultValue:"",validate:k=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(k)||k.match(/iso-8859-\d{2}/)}),this.checksum=getStringOption(attributes.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]),this.dataColumnCount=getInteger({data:attributes.dataColumnCount,defaultValue:-1,validate:x=>0<=x}),this.dataLength=getInteger({data:attributes.dataLength,defaultValue:-1,validate:x=>0<=x}),this.dataPrep=getStringOption(attributes.dataPrep,["none","flateCompress"]),this.dataRowCount=getInteger({data:attributes.dataRowCount,defaultValue:-1,validate:x=>0<=x}),this.endChar=attributes.endChar||"",this.errorCorrectionLevel=getInteger({data:attributes.errorCorrectionLevel,defaultValue:-1,validate:x=>0<=x&&x<=8}),this.id=attributes.id||"",this.moduleHeight=getMeasurement(attributes.moduleHeight,"5mm"),this.moduleWidth=getMeasurement(attributes.moduleWidth,"0.25mm"),this.printCheckDigit=getInteger({data:attributes.printCheckDigit,defaultValue:0,validate:x=>1===x}),this.rowColumnRatio=getRatio(attributes.rowColumnRatio),this.startChar=attributes.startChar||"",this.textLocation=getStringOption(attributes.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]),this.truncate=getInteger({data:attributes.truncate,defaultValue:0,validate:x=>1===x}),this.type=getStringOption(attributes.type?attributes.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(attributes.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.wideNarrowRatio=getRatio(attributes.wideNarrowRatio),this.encrypt=null,this.extras=null}}class Bind extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"bind",!0),this.match=getStringOption(attributes.match,["once","dataRef","global","none"]),this.ref=attributes.ref||"",this.picture=null}}class BindItems extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"bindItems"),this.connection=attributes.connection||"",this.labelRef=attributes.labelRef||"",this.ref=attributes.ref||"",this.valueRef=attributes.valueRef||""}}class Bookend extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"bookend"),this.id=attributes.id||"",this.leader=attributes.leader||"",this.trailer=attributes.trailer||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class BooleanElement extends Option01{constructor(attributes){super(TEMPLATE_NS_ID,"boolean"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$toHTML](availableSpace){return valueToHtml(1===this[$content]?"1":"0")}}class Border extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"border",!0),this.break=getStringOption(attributes.break,["close","open"]),this.hand=getStringOption(attributes.hand,["even","left","right"]),this.id=attributes.id||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.corner=new XFAObjectArray(4),this.edge=new XFAObjectArray(4),this.extras=null,this.fill=null,this.margin=null}[$getExtra](){if(!this[$extra]){var edges=this.edge.children.slice();if(edges.length<4)for(var defaultEdge=edges.at(-1)||new Edge({}),i=edges.length;i<4;i++)edges.push(defaultEdge);var widths=edges.map(edge=>edge.thickness),insets=[0,0,0,0];this.margin&&(insets[0]=this.margin.topInset,insets[1]=this.margin.rightInset,insets[2]=this.margin.bottomInset,insets[3]=this.margin.leftInset),this[$extra]={widths:widths,insets:insets,edges:edges}}return this[$extra]}[$toStyle](){var edges=this[$getExtra]()["edges"],edgeStyles=edges.map(node=>{node=node[$toStyle]();return node.color||(node.color="#000000"),node}),style=Object.create(null);if(this.margin&&Object.assign(style,this.margin[$toStyle]()),"visible"===(null==(edges=this.fill)?void 0:edges.presence)&&Object.assign(style,this.fill[$toStyle]()),this.corner.children.some(node=>0!==node.radius)){var cornerStyles=this.corner.children.map(node=>node[$toStyle]());if(2===cornerStyles.length||3===cornerStyles.length)for(var last=cornerStyles.at(-1),i=cornerStyles.length;i<4;i++)cornerStyles.push(last);style.borderRadius=cornerStyles.map(s=>s.radius).join(" ")}switch(this.presence){case"invisible":case"hidden":style.borderStyle="";break;case"inactive":style.borderStyle="none";break;default:style.borderStyle=edgeStyles.map(s=>s.style).join(" ")}return style.borderWidth=edgeStyles.map(s=>s.width).join(" "),style.borderColor=edgeStyles.map(s=>s.color).join(" "),style}}class Break extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"break",!0),this.after=getStringOption(attributes.after,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.afterTarget=attributes.afterTarget||"",this.before=getStringOption(attributes.before,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.beforeTarget=attributes.beforeTarget||"",this.bookendLeader=attributes.bookendLeader||"",this.bookendTrailer=attributes.bookendTrailer||"",this.id=attributes.id||"",this.overflowLeader=attributes.overflowLeader||"",this.overflowTarget=attributes.overflowTarget||"",this.overflowTrailer=attributes.overflowTrailer||"",this.startNew=getInteger({data:attributes.startNew,defaultValue:0,validate:x=>1===x}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}}class BreakAfter extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"breakAfter",!0),this.id=attributes.id||"",this.leader=attributes.leader||"",this.startNew=getInteger({data:attributes.startNew,defaultValue:0,validate:x=>1===x}),this.target=attributes.target||"",this.targetType=getStringOption(attributes.targetType,["auto","contentArea","pageArea"]),this.trailer=attributes.trailer||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.script=null}}class BreakBefore extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"breakBefore",!0),this.id=attributes.id||"",this.leader=attributes.leader||"",this.startNew=getInteger({data:attributes.startNew,defaultValue:0,validate:x=>1===x}),this.target=attributes.target||"",this.targetType=getStringOption(attributes.targetType,["auto","contentArea","pageArea"]),this.trailer=attributes.trailer||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.script=null}[$toHTML](availableSpace){return this[$extra]={},HTMLResult.FAILURE}}class Button extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"button",!0),this.highlight=getStringOption(attributes.highlight,["inverted","none","outline","push"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}[$toHTML](availableSpace){var event,jsURL,href,grandpa=this[$getParent]()[$getParent](),htmlButton={name:"button",attributes:{id:this[$uid],class:["xfaButton"],style:{}},children:[]};for(event of grandpa.event.children)"click"===event.activity&&event.script&&(jsURL=recoverJsURL(event.script[$content]))&&(href=fixURL(jsURL.url))&&htmlButton.children.push({name:"a",attributes:{id:"link"+this[$uid],href:href,newWindow:jsURL.newWindow,class:["xfaLink"],style:{}},children:[]});return HTMLResult.success(htmlButton)}}class Calculate extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"calculate",!0),this.id=attributes.id||"",this.override=getStringOption(attributes.override,["disabled","error","ignore","warning"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.message=null,this.script=null}}class Caption extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"caption",!0),this.id=attributes.id||"",this.placement=getStringOption(attributes.placement,["left","bottom","inline","right","top"]),this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.reserve=Math.ceil(getMeasurement(attributes.reserve)),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.font=null,this.margin=null,this.para=null,this.value=null}[$setValue](value){_setValue(this,value)}[$getExtra](availableSpace){if(!this[$extra]){var{width,height}=availableSpace;switch(this.placement){case"left":case"right":case"inline":width=this.reserve<=0?width:this.reserve;break;case"top":case"bottom":height=this.reserve<=0?height:this.reserve}this[$extra]=layoutNode(this,{width:width,height:height})}return this[$extra]}[$toHTML](availableSpace){if(!this.value)return HTMLResult.EMPTY;this[$pushPara]();var value=this.value[$toHTML](availableSpace).html;if(!value)return this[$popPara](),HTMLResult.EMPTY;var savedReserve=this.reserve;if(this.reserve<=0){var{w,h}=this[$getExtra](availableSpace);switch(this.placement){case"left":case"right":case"inline":this.reserve=w;break;case"top":case"bottom":this.reserve=h}}var availableSpace=[],style=(availableSpace.push("string"==typeof value?{name:"#text",value:value}:value),toStyle(this,"font","margin","visibility"));switch(this.placement){case"left":case"right":0<this.reserve&&(style.width=measureToString(this.reserve));break;case"top":case"bottom":0<this.reserve&&(style.height=measureToString(this.reserve))}return setPara(this,null,value),this[$popPara](),this.reserve=savedReserve,HTMLResult.success({name:"div",attributes:{style:style,class:["xfaCaption"]},children:availableSpace})}}class Certificate extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"certificate"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Certificates extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"certificates",!0),this.credentialServerPolicy=getStringOption(attributes.credentialServerPolicy,["optional","required"]),this.id=attributes.id||"",this.url=attributes.url||"",this.urlPolicy=attributes.urlPolicy||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.encryption=null,this.issuers=null,this.keyUsage=null,this.oids=null,this.signing=null,this.subjectDNs=null}}class CheckButton extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"checkButton",!0),this.id=attributes.id||"",this.mark=getStringOption(attributes.mark,["default","check","circle","cross","diamond","square","star"]),this.shape=getStringOption(attributes.shape,["square","round"]),this.size=getMeasurement(attributes.size,"10pt"),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.extras=null,this.margin=null}[$toHTML](availableSpace){var groupId,type,className,style=toStyle(this,"margin"),size=measureToString(this.size),size=(style.width=style.height=size,this[$getParent]()[$getParent]()),items=size.items.children.length&&size.items.children[0][$toHTML]().html||[],items={on:(void 0!==items[0]?items[0]:"on").toString(),off:(void 0!==items[1]?items[1]:"off").toString()},_field$value=((null==(_field$value=size.value)?void 0:_field$value[$text]())||"off")===items.on||void 0,container=size[$getSubformParent](),fieldId=size[$uid],_container$$data=(container=container instanceof ExclGroup?(groupId=container[$uid],type="radio",className="xfaRadio",(null==(_container$$data=container[$data])?void 0:_container$$data[$uid])||container[$uid]):(type="checkbox",className="xfaCheckbox",(null==(_container$$data=size[$data])?void 0:_container$$data[$uid])||size[$uid]),{name:"input",attributes:{class:[className],style:style,fieldId:fieldId,dataId:container,type:type,checked:_field$value,xfaOn:items.on,xfaOff:items.off,"aria-label":ariaLabel(size),"aria-required":!1}});return groupId&&(_container$$data.attributes.name=groupId),isRequired(size)&&(_container$$data.attributes["aria-required"]=!0,_container$$data.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[_container$$data]})}}class ChoiceList extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"choiceList",!0),this.commitOn=getStringOption(attributes.commitOn,["select","exit"]),this.id=attributes.id||"",this.open=getStringOption(attributes.open,["userControl","always","multiSelect","onEntry"]),this.textEntry=getInteger({data:attributes.textEntry,defaultValue:0,validate:x=>1===x}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.extras=null,this.margin=null}[$toHTML](availableSpace){var style=toStyle(this,"border","margin"),field=this[$getParent]()[$getParent](),_field$font=(null==(_field$font=field.font)?void 0:_field$font.size)||10,optionStyle={fontSize:"calc(".concat(_field$font,"px * var(--total-scale-factor))")},children=[];if(0<field.items.children.length){for(var _field$font=field.items,displayedIndex=0,saveIndex=0,displayed=(2===_field$font.children.length&&(saveIndex=1-(displayedIndex=_field$font.children[0].save)),_field$font.children[displayedIndex][$toHTML]().html),values=_field$font.children[saveIndex][$toHTML]().html,selected=!1,value=(null==(displayedIndex=field.value)?void 0:displayedIndex[$text]())||"",i=0,ii=displayed.length;i<ii;i++){var option={name:"option",attributes:{value:values[i]||displayed[i],style:optionStyle},value:displayed[i]};values[i]===value&&(option.attributes.selected=selected=!0),children.push(option)}selected||children.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}saveIndex={class:["xfaSelect"],fieldId:field[$uid],dataId:(null==(_field$font=field[$data])?void 0:_field$font[$uid])||field[$uid],style:style,"aria-label":ariaLabel(field),"aria-required":!1};return isRequired(field)&&(saveIndex["aria-required"]=!0,saveIndex.required=!0),"multiSelect"===this.open&&(saveIndex.multiple=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:children,attributes:saveIndex}]})}}class Color extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"color",!0),this.cSpace=getStringOption(attributes.cSpace,["SRGB"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.value=attributes.value?getColor(attributes.value):"",this.extras=null}[$hasSettableValue](){return!1}[$toStyle](){return this.value?Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"comb"),this.id=attributes.id||"",this.numberOfCells=getInteger({data:attributes.numberOfCells,defaultValue:0,validate:x=>0<=x}),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Connect extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"connect",!0),this.connection=attributes.connection||"",this.id=attributes.id||"",this.ref=attributes.ref||"",this.usage=getStringOption(attributes.usage,["exportAndImport","exportOnly","importOnly"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.picture=null}}class ContentArea extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"contentArea",!0),this.h=getMeasurement(attributes.h),this.id=attributes.id||"",this.name=attributes.name||"",this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.w=getMeasurement(attributes.w),this.x=getMeasurement(attributes.x,"0pt"),this.y=getMeasurement(attributes.y,"0pt"),this.desc=null,this.extras=null}[$toHTML](availableSpace){var style={left:measureToString(this.x),top:measureToString(this.y),width:measureToString(this.w),height:measureToString(this.h)},classNames=["xfaContentarea"];return isPrintOnly(this)&&classNames.push("xfaPrintOnly"),HTMLResult.success({name:"div",children:[],attributes:{style:style,class:classNames,id:this[$uid]}})}}class Corner extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"corner",!0),this.id=attributes.id||"",this.inverted=getInteger({data:attributes.inverted,defaultValue:0,validate:x=>1===x}),this.join=getStringOption(attributes.join,["square","round"]),this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.radius=getMeasurement(attributes.radius),this.stroke=getStringOption(attributes.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=getMeasurement(attributes.thickness,"0.5pt"),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null}[$toStyle](){var style=toStyle(this,"visibility");return style.radius=measureToString("square"===this.join?0:this.radius),style}}class DateElement extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"date"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){var date=this[$content].trim();this[$content]=date?new Date(date):null}[$toHTML](availableSpace){return valueToHtml(this[$content]?this[$content].toString():"")}}class DateTime extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"dateTime"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){var date=this[$content].trim();this[$content]=date?new Date(date):null}[$toHTML](availableSpace){return valueToHtml(this[$content]?this[$content].toString():"")}}class DateTimeEdit extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"dateTimeEdit",!0),this.hScrollPolicy=getStringOption(attributes.hScrollPolicy,["auto","off","on"]),this.id=attributes.id||"",this.picker=getStringOption(attributes.picker,["host","none"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[$toHTML](availableSpace){var style=toStyle(this,"border","font","margin"),field=this[$getParent]()[$getParent](),_field$$data3={name:"input",attributes:{type:"text",fieldId:field[$uid],dataId:(null==(_field$$data3=field[$data])?void 0:_field$$data3[$uid])||field[$uid],class:["xfaTextfield"],style:style,"aria-label":ariaLabel(field),"aria-required":!1}};return isRequired(field)&&(_field$$data3.attributes["aria-required"]=!0,_field$$data3.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[_field$$data3]})}}class Decimal extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"decimal"),this.fracDigits=getInteger({data:attributes.fracDigits,defaultValue:2,validate:x=>!0}),this.id=attributes.id||"",this.leadDigits=getInteger({data:attributes.leadDigits,defaultValue:-1,validate:x=>!0}),this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){var number=parseFloat(this[$content].trim());this[$content]=isNaN(number)?null:number}[$toHTML](availableSpace){return valueToHtml(null!==this[$content]?this[$content].toString():"")}}class DefaultUi extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"defaultUi",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}}class Desc extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"desc",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.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(attributes){super(TEMPLATE_NS_ID,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class DigestMethods extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"digestMethods",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.digestMethod=new XFAObjectArray}}class Draw extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"draw",!0),this.anchorType=getStringOption(attributes.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:attributes.colSpan,defaultValue:1,validate:n=>1<=n||-1===n}),this.h=attributes.h?getMeasurement(attributes.h):"",this.hAlign=getStringOption(attributes.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=attributes.id||"",this.locale=attributes.locale||"",this.maxH=getMeasurement(attributes.maxH,"0pt"),this.maxW=getMeasurement(attributes.maxW,"0pt"),this.minH=getMeasurement(attributes.minH,"0pt"),this.minW=getMeasurement(attributes.minW,"0pt"),this.name=attributes.name||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(attributes.relevant),this.rotate=getInteger({data:attributes.rotate,defaultValue:0,validate:x=>x%90==0}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.w=attributes.w?getMeasurement(attributes.w):"",this.x=getMeasurement(attributes.x,"0pt"),this.y=getMeasurement(attributes.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}[$setValue](value){_setValue(this,value)}[$toHTML](availableSpace){if(setTabIndex(this),"hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;fixDimensions(this),this[$pushPara]();var savedW=this.w,savedH=this.h,{w,h,isBroken}=layoutNode(this,availableSpace);if(w&&""===this.w){if(isBroken&&this[$getSubformParent]()[$isThereMoreWidth]())return this[$popPara](),HTMLResult.FAILURE;this.w=w}if(h&&""===this.h&&(this.h=h),setFirstUnsplittable(this),!checkDimensions(this,availableSpace))return this.w=savedW,this.h=savedH,this[$popPara](),HTMLResult.FAILURE;unsetFirstUnsplittable(this);isBroken=toStyle(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin"),setMinMaxDimensions(this,isBroken),isBroken.margin&&(isBroken.padding=isBroken.margin,delete isBroken.margin),w=["xfaDraw"],this.font&&w.push("xfaFont"),isPrintOnly(this)&&w.push("xfaPrintOnly"),h={style:isBroken,id:this[$uid],class:w},this.name&&(h.xfaName=this.name),w={name:"div",attributes:h,children:[]},applyAssist(this,h),h=computeBbox(this,w,availableSpace),availableSpace=this.value?this.value[$toHTML](availableSpace).html:null;return null===availableSpace?(this.w=savedW,this.h=savedH,this[$popPara]()):(w.children.push(availableSpace),setPara(this,isBroken,availableSpace),this.w=savedW,this.h=savedH,this[$popPara]()),HTMLResult.success(createWrapper(this,w),h)}}class Edge extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"edge",!0),this.cap=getStringOption(attributes.cap,["square","butt","round"]),this.id=attributes.id||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.stroke=getStringOption(attributes.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=getMeasurement(attributes.thickness,"0.5pt"),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null}[$toStyle](){var style=toStyle(this,"visibility");if(Object.assign(style,{linecap:this.cap,width:measureToString(this.thickness),color:this.color?this.color[$toStyle]():"#000000",style:""}),"visible"!==this.presence)style.style="none";else switch(this.stroke){case"solid":style.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":style.style="dashed";break;case"dotted":style.style="dotted";break;case"embossed":style.style="ridge";break;case"etched":style.style="groove";break;case"lowered":style.style="inset";break;case"raised":style.style="outset"}return style}}class Encoding extends OptionObject{constructor(attributes){super(TEMPLATE_NS_ID,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Encodings extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"encodings",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.encoding=new XFAObjectArray}}class Encrypt extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"encrypt",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.certificate=null}}class EncryptData extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"encryptData",!0),this.id=attributes.id||"",this.operation=getStringOption(attributes.operation,["encrypt","decrypt"]),this.target=attributes.target||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.filter=null,this.manifest=null}}class Encryption extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"encryption",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.certificate=new XFAObjectArray}}class EncryptionMethod extends OptionObject{constructor(attributes){super(TEMPLATE_NS_ID,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class EncryptionMethods extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"encryptionMethods",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.encryptionMethod=new XFAObjectArray}}class Event extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"event",!0),this.activity=getStringOption(attributes.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=attributes.id||"",this.listen=getStringOption(attributes.listen,["refOnly","refAndDescendents"]),this.name=attributes.name||"",this.ref=attributes.ref||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.encryptData=null,this.execute=null,this.script=null,this.signData=null,this.submit=null}}class ExData extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"exData"),this.contentType=attributes.contentType||"",this.href=attributes.href||"",this.id=attributes.id||"",this.maxLength=getInteger({data:attributes.maxLength,defaultValue:-1,validate:x=>-1<=x}),this.name=attributes.name||"",this.rid=attributes.rid||"",this.transferEncoding=getStringOption(attributes.transferEncoding,["none","base64","package"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$isCDATAXml](){return"text/html"===this.contentType}[$onChild](child){return("text/html"===this.contentType&&child[$namespaceId]===NamespaceIds.xhtml.id||"text/xml"===this.contentType)&&(this[$content]=child,!0)}[$toHTML](availableSpace){return"text/html"===this.contentType&&this[$content]?this[$content][$toHTML](availableSpace):HTMLResult.EMPTY}}class ExObject extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"exObject",!0),this.archive=attributes.archive||"",this.classId=attributes.classId||"",this.codeBase=attributes.codeBase||"",this.codeType=attributes.codeType||"",this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.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(attributes){super(TEMPLATE_NS_ID,"exclGroup",!0),this.access=getStringOption(attributes.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=attributes.accessKey||"",this.anchorType=getStringOption(attributes.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:attributes.colSpan,defaultValue:1,validate:n=>1<=n||-1===n}),this.h=attributes.h?getMeasurement(attributes.h):"",this.hAlign=getStringOption(attributes.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=attributes.id||"",this.layout=getStringOption(attributes.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.maxH=getMeasurement(attributes.maxH,"0pt"),this.maxW=getMeasurement(attributes.maxW,"0pt"),this.minH=getMeasurement(attributes.minH,"0pt"),this.minW=getMeasurement(attributes.minW,"0pt"),this.name=attributes.name||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.w=attributes.w?getMeasurement(attributes.w):"",this.x=getMeasurement(attributes.x,"0pt"),this.y=getMeasurement(attributes.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}[$isBindable](){return!0}[$hasSettableValue](){return!0}[$setValue](value){for(var field of this.field.children){var nodeValue;field.value||(nodeValue=new Value({}),field[$appendChild](nodeValue),field.value=nodeValue),field.value[$setValue](value)}}[$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[$extra].attempt&&0<this[$extra].numberInLine||this[$getParent]()[$isThereMoreWidth]()}[$isSplittable](){var _parent$layout3,parent=this[$getSubformParent]();return!!parent[$isSplittable]()&&(void 0!==this[$extra]._isSplittable?this[$extra]._isSplittable:"position"===this.layout||this.layout.includes("row")?this[$extra]._isSplittable=!1:(null==(_parent$layout3=parent.layout)||!_parent$layout3.endsWith("-tb")||0===parent[$extra].numberInLine)&&(this[$extra]._isSplittable=!0))}[$flushHTML](){return flushHTML(this)}[$addHTML](html,bbox){addHTML(this,html,bbox)}[$getAvailableSpace](){return getAvailableSpace(this)}[$toHTML](availableSpace){if(setTabIndex(this),"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;fixDimensions(this);var children=[],attributes={id:this[$uid],class:[]},isSplittable=(setAccess(this,attributes.class),this[$extra]||(this[$extra]=Object.create(null)),Object.assign(this[$extra],{children:children,attributes:attributes,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,availableSpace.width),height:Math.min(this.h||1/0,availableSpace.height)},width:0,height:0,prevHeight:0,currentWidth:0}),this[$isSplittable]());if(isSplittable||setFirstUnsplittable(this),!checkDimensions(this,availableSpace))return HTMLResult.FAILURE;for(var filter=new Set(["field"]),availableSpace=(this.layout.includes("row")&&(availableSpace=this[$getSubformParent]().columnWidths,Array.isArray(availableSpace))&&0<availableSpace.length&&(this[$extra].columnWidths=availableSpace,this[$extra].currentColumn=0),toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign")),classNames=["xfaExclgroup"],cl=layoutClass(this),isLrTb=(cl&&classNames.push(cl),isPrintOnly(this)&&classNames.push("xfaPrintOnly"),attributes.style=availableSpace,attributes.class=classNames,this.name&&(attributes.xfaName=this.name),this[$pushPara](),"lr-tb"===this.layout||"rl-tb"===this.layout),maxRun=isLrTb?MAX_ATTEMPTS_FOR_LRTB_LAYOUT:1;this[$extra].attempt<maxRun;this[$extra].attempt++){isLrTb&&this[$extra].attempt===MAX_ATTEMPTS_FOR_LRTB_LAYOUT-1&&(this[$extra].numberInLine=0);var result=this[$childrenToHTML]({filter:filter,include:!0});if(result.success)break;if(result.isBreak())return this[$popPara](),result;if(isLrTb&&0===this[$extra].attempt&&0===this[$extra].numberInLine&&!this[$getTemplateRoot]()[$extra].noLayoutFailure){this[$extra].attempt=maxRun;break}}return this[$popPara](),isSplittable||unsetFirstUnsplittable(this),this[$extra].attempt===maxRun?(isSplittable||delete this[$extra],HTMLResult.FAILURE):(classNames=cl=0,this.margin&&(cl=this.margin.leftInset+this.margin.rightInset,classNames=this.margin.topInset+this.margin.bottomInset),isSplittable=Math.max(this[$extra].width+cl,this.w||0),cl=Math.max(this[$extra].height+classNames,this.h||0),classNames=[this.x,this.y,isSplittable,cl],""===this.w&&(availableSpace.width=measureToString(isSplittable)),""===this.h&&(availableSpace.height=measureToString(cl)),isSplittable={name:"div",attributes:attributes,children:children},applyAssist(this,attributes),delete this[$extra],HTMLResult.success(createWrapper(this,isSplittable),classNames))}}class Execute extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"execute"),this.connection=attributes.connection||"",this.executeType=getStringOption(attributes.executeType,["import","remerge"]),this.id=attributes.id||"",this.runAt=getStringOption(attributes.runAt,["client","both","server"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Extras extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"extras",!0),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.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(attributes){super(TEMPLATE_NS_ID,"field",!0),this.access=getStringOption(attributes.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=attributes.accessKey||"",this.anchorType=getStringOption(attributes.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:attributes.colSpan,defaultValue:1,validate:n=>1<=n||-1===n}),this.h=attributes.h?getMeasurement(attributes.h):"",this.hAlign=getStringOption(attributes.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=attributes.id||"",this.locale=attributes.locale||"",this.maxH=getMeasurement(attributes.maxH,"0pt"),this.maxW=getMeasurement(attributes.maxW,"0pt"),this.minH=getMeasurement(attributes.minH,"0pt"),this.minW=getMeasurement(attributes.minW,"0pt"),this.name=attributes.name||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(attributes.relevant),this.rotate=getInteger({data:attributes.rotate,defaultValue:0,validate:x=>x%90==0}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.w=attributes.w?getMeasurement(attributes.w):"",this.x=getMeasurement(attributes.x,"0pt"),this.y=getMeasurement(attributes.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}[$isBindable](){return!0}[$setValue](value){_setValue(this,value)}[$toHTML](availableSpace){var node;if(setTabIndex(this),!this.ui){switch(this.ui=new Ui({}),this.ui[$globalData]=this[$globalData],this[$appendChild](this.ui),this.items.children.length){case 0:node=new TextEdit({}),this.ui.textEdit=node;break;case 1:node=new CheckButton({}),this.ui.checkButton=node;break;case 2:node=new ChoiceList({}),this.ui.choiceList=node}this.ui[$appendChild](node)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;this.caption&&delete this.caption[$extra],this[$pushPara]();var caption=this.caption?this.caption[$toHTML](availableSpace).html:null,savedW=this.w,savedH=this.h,marginH=0,marginV=0,borderDims=(this.margin&&(marginH=this.margin.leftInset+this.margin.rightInset,marginV=this.margin.topInset+this.margin.bottomInset),null);if(""===this.w||""===this.h){var width=null,height=null,uiW=0,uiH=0;if(this.ui.checkButton?uiW=uiH=this.ui.checkButton.size:({w,h}=layoutNode(this,availableSpace),uiH=null!==w?(uiW=w,h):fonts_getMetrics(this.font,!0).lineNoGap),uiW+=(borderDims=getBorderDims(this.ui[$getExtra]())).w,uiH+=borderDims.h,this.caption){var{w,h,isBroken}=this.caption[$getExtra](availableSpace);if(isBroken&&this[$getSubformParent]()[$isThereMoreWidth]())return this[$popPara](),HTMLResult.FAILURE;switch(width=w,height=h,this.caption.placement){case"left":case"right":case"inline":width+=uiW;break;case"top":case"bottom":height+=uiH}}else width=uiW,height=uiH;width&&""===this.w&&(width+=marginH,this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<width?width:this.minW)),height&&""===this.h&&(height+=marginV,this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<height?height:this.minH))}if(this[$popPara](),fixDimensions(this),setFirstUnsplittable(this),!checkDimensions(this,availableSpace))return this.w=savedW,this.h=savedH,this[$popPara](),HTMLResult.FAILURE;unsetFirstUnsplittable(this);var isBroken=toStyle(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign"),w=(setMinMaxDimensions(this,isBroken),["xfaField"]),h=(this.font&&w.push("xfaFont"),isPrintOnly(this)&&w.push("xfaPrintOnly"),{style:isBroken,id:this[$uid],class:w}),marginH=(isBroken.margin&&(isBroken.padding=isBroken.margin,delete isBroken.margin),setAccess(this,w),this.name&&(h.xfaName=this.name),[]),w={name:"div",attributes:h,children:marginH},h=(applyAssist(this,h),this.border?this.border[$toStyle]():null),bbox=computeBbox(this,w,availableSpace),ui=this.ui[$toHTML]().html;if(ui){this[$tabIndex]&&(null!=(_ui$children=ui.children)&&_ui$children[0]?ui.children[0].attributes.tabindex=this[$tabIndex]:ui.attributes.tabindex=this[$tabIndex]),(_ui$children=ui.attributes).style||(_ui$children.style=Object.create(null));var htmlValue,_ui$children=null;if(this.ui.button?(1===ui.children.length&&([_ui$children]=ui.children.splice(0,1)),Object.assign(ui.attributes.style,h)):Object.assign(isBroken,h),marginH.push(ui),this.value&&(this.ui.imageEdit?ui.children.push(this.value[$toHTML]().html):this.ui.button||(marginH="",this.value.exData?marginH=this.value.exData[$text]():this.value.text?marginH=this.value.text[$getExtra]():null!==(htmlValue=this.value[$toHTML]().html)&&(marginH=htmlValue.children[0].value),this.ui.textEdit&&null!=(htmlValue=this.value.text)&&htmlValue.maxChars&&(ui.children[0].attributes.maxLength=this.value.text.maxChars),marginH&&(this.ui.numericEdit&&(marginH=parseFloat(marginH),marginH=isNaN(marginH)?"":marginH.toString()),"textarea"===ui.children[0].name?ui.children[0].attributes.textContent=marginH:ui.children[0].attributes.value=marginH))),!this.ui.imageEdit&&null!=(htmlValue=ui.children)&&htmlValue[0]&&this.h&&(borderDims=borderDims||getBorderDims(this.ui[$getExtra]()),marginH=0,this.caption&&["top","bottom"].includes(this.caption.placement)?((marginH=this.caption.reserve)<=0&&(marginH=this.caption[$getExtra](availableSpace).h),htmlValue=this.h-marginH-marginV-borderDims.h,ui.children[0].attributes.style.height=measureToString(htmlValue)):ui.children[0].attributes.style.height="100%"),_ui$children&&ui.children.push(_ui$children),caption){if(this.ui.button)return isBroken.padding&&delete isBroken.padding,"div"===caption.name&&(caption.name="span"),ui.children.push(caption),HTMLResult.success(w,bbox);switch(this.ui.checkButton&&(caption.attributes.class[0]="xfaCaptionForCheckButton"),(availableSpace=ui.attributes).class||(availableSpace.class=[]),ui.children.splice(0,0,caption),this.caption.placement){case"left":ui.attributes.class.push("xfaLeft");break;case"right":ui.attributes.class.push("xfaRight");break;case"top":ui.attributes.class.push("xfaTop");break;case"bottom":ui.attributes.class.push("xfaBottom");break;case"inline":ui.attributes.class.push("xfaLeft")}}else ui.attributes.class&&ui.attributes.class.push("xfaLeft");this.w=savedW,this.h=savedH}else Object.assign(isBroken,h);return HTMLResult.success(createWrapper(this,w),bbox)}}class Fill extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"fill",!0),this.id=attributes.id||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null,this.linear=null,this.pattern=null,this.radial=null,this.solid=null,this.stipple=null}[$toStyle](){var name,parent=this[$getParent](),ggrandpa=parent[$getParent]()[$getParent](),style=Object.create(null),propName="color",altPropName=propName;parent instanceof Border&&(propName="background-color",altPropName="background",ggrandpa instanceof Ui)&&(style.backgroundColor="white"),(parent instanceof Rectangle||parent instanceof Arc)&&(propName=altPropName="fill",style.fill="white");for(name of Object.getOwnPropertyNames(this))if("extras"!==name&&"color"!==name){var obj=this[name];if(obj instanceof XFAObject)return(obj=obj[$toStyle](this.color))&&(style[obj.startsWith("#")?propName:altPropName]=obj),style}return null!=(ggrandpa=this.color)&&ggrandpa.value&&(style[(parent=this.color[$toStyle]()).startsWith("#")?propName:altPropName]=parent),style}}class Filter extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"filter",!0),this.addRevocationInfo=getStringOption(attributes.addRevocationInfo,["","required","optional","none"]),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.version=getInteger({data:this.version,defaultValue:5,validate:x=>1<=x&&x<=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(attributes){super(TEMPLATE_NS_ID,"float"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){var number=parseFloat(this[$content].trim());this[$content]=isNaN(number)?null:number}[$toHTML](availableSpace){return valueToHtml(null!==this[$content]?this[$content].toString():"")}}class template_Font extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"font",!0),this.baselineShift=getMeasurement(attributes.baselineShift),this.fontHorizontalScale=getFloat({data:attributes.fontHorizontalScale,defaultValue:100,validate:x=>0<=x}),this.fontVerticalScale=getFloat({data:attributes.fontVerticalScale,defaultValue:100,validate:x=>0<=x}),this.id=attributes.id||"",this.kerningMode=getStringOption(attributes.kerningMode,["none","pair"]),this.letterSpacing=getMeasurement(attributes.letterSpacing,"0"),this.lineThrough=getInteger({data:attributes.lineThrough,defaultValue:0,validate:x=>1===x||2===x}),this.lineThroughPeriod=getStringOption(attributes.lineThroughPeriod,["all","word"]),this.overline=getInteger({data:attributes.overline,defaultValue:0,validate:x=>1===x||2===x}),this.overlinePeriod=getStringOption(attributes.overlinePeriod,["all","word"]),this.posture=getStringOption(attributes.posture,["normal","italic"]),this.size=getMeasurement(attributes.size,"10pt"),this.typeface=attributes.typeface||"Courier",this.underline=getInteger({data:attributes.underline,defaultValue:0,validate:x=>1===x||2===x}),this.underlinePeriod=getStringOption(attributes.underlinePeriod,["all","word"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.weight=getStringOption(attributes.weight,["normal","bold"]),this.extras=null,this.fill=null}[$clean](builder){super[$clean](builder),this[$globalData].usedTypefaces.add(this.typeface)}[$toStyle](){var style=toStyle(this,"fill"),color=style.color;return color&&("#000000"===color?delete style.color:color.startsWith("#")||(style.background=color,style.backgroundClip="text",style.color="transparent")),this.baselineShift&&(style.verticalAlign=measureToString(this.baselineShift)),style.fontKerning="none"===this.kerningMode?"none":"normal",style.letterSpacing=measureToString(this.letterSpacing),0!==this.lineThrough&&(style.textDecoration="line-through",2===this.lineThrough)&&(style.textDecorationStyle="double"),0!==this.overline&&(style.textDecoration="overline",2===this.overline)&&(style.textDecorationStyle="double"),style.fontStyle=this.posture,style.fontSize=measureToString(.99*this.size),setFontFamily(this,this,this[$globalData].fontFinder,style),0!==this.underline&&(style.textDecoration="underline",2===this.underline)&&(style.textDecorationStyle="double"),style.fontWeight=this.weight,style}}class Format extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"format",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.picture=null}}class Handler extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"handler"),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Hyphenation extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"hyphenation"),this.excludeAllCaps=getInteger({data:attributes.excludeAllCaps,defaultValue:0,validate:x=>1===x}),this.excludeInitialCap=getInteger({data:attributes.excludeInitialCap,defaultValue:0,validate:x=>1===x}),this.hyphenate=getInteger({data:attributes.hyphenate,defaultValue:0,validate:x=>1===x}),this.id=attributes.id||"",this.pushCharacterCount=getInteger({data:attributes.pushCharacterCount,defaultValue:3,validate:x=>0<=x}),this.remainCharacterCount=getInteger({data:attributes.remainCharacterCount,defaultValue:3,validate:x=>0<=x}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.wordCharacterCount=getInteger({data:attributes.wordCharacterCount,defaultValue:7,validate:x=>0<=x})}}class Image extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"image"),this.aspect=getStringOption(attributes.aspect,["fit","actual","height","none","width"]),this.contentType=attributes.contentType||"",this.href=attributes.href||"",this.id=attributes.id||"",this.name=attributes.name||"",this.transferEncoding=getStringOption(attributes.transferEncoding,["base64","none","package"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$toHTML](){if(this.contentType&&!MIMES.has(this.contentType.toLowerCase()))return HTMLResult.EMPTY;var buffer=null==(_this$$globalData$ima=this[$globalData].images)?void 0:_this$$globalData$ima.get(this.href);if(!buffer&&(this.href||!this[$content]))return HTMLResult.EMPTY;if(!(buffer=buffer||"base64"!==this.transferEncoding?buffer:fromBase64Util(this[$content])))return HTMLResult.EMPTY;if(!this.contentType){for(var[header,type]of IMAGES_HEADERS)if(buffer.length>header.length&&header.every((x,i)=>x===buffer[i])){this.contentType=type;break}if(!this.contentType)return HTMLResult.EMPTY}var style,_this$$globalData$ima=new Blob([buffer],{type:this.contentType});switch(this.aspect){case"fit":case"actual":break;case"height":style={height:"100%",objectFit:"fill"};break;case"none":style={width:"100%",height:"100%",objectFit:"fill"};break;case"width":style={width:"100%",objectFit:"fill"}}var parent=this[$getParent]();return HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:style,src:URL.createObjectURL(_this$$globalData$ima),alt:parent?ariaLabel(parent[$getParent]()):null}})}}class ImageEdit extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"imageEdit",!0),this.data=getStringOption(attributes.data,["link","embed"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.extras=null,this.margin=null}[$toHTML](availableSpace){return"embed"===this.data?HTMLResult.success({name:"div",children:[],attributes:{}}):HTMLResult.EMPTY}}class Integer extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"integer"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){var number=parseInt(this[$content].trim(),10);this[$content]=isNaN(number)?null:number}[$toHTML](availableSpace){return valueToHtml(null!==this[$content]?this[$content].toString():"")}}class Issuers extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"issuers",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.certificate=new XFAObjectArray}}class Items extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"items",!0),this.id=attributes.id||"",this.name=attributes.name||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.ref=attributes.ref||"",this.save=getInteger({data:attributes.save,defaultValue:0,validate:x=>1===x}),this.use=attributes.use||"",this.usehref=attributes.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}[$toHTML](){var child,output=[];for(child of this[$getChildren]())output.push(child[$text]());return HTMLResult.success(output)}}class Keep extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"keep",!0),this.id=attributes.id||"";var options=["none","contentArea","pageArea"];this.intact=getStringOption(attributes.intact,options),this.next=getStringOption(attributes.next,options),this.previous=getStringOption(attributes.previous,options),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}}class KeyUsage extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"keyUsage");var options=["","yes","no"];this.crlSign=getStringOption(attributes.crlSign,options),this.dataEncipherment=getStringOption(attributes.dataEncipherment,options),this.decipherOnly=getStringOption(attributes.decipherOnly,options),this.digitalSignature=getStringOption(attributes.digitalSignature,options),this.encipherOnly=getStringOption(attributes.encipherOnly,options),this.id=attributes.id||"",this.keyAgreement=getStringOption(attributes.keyAgreement,options),this.keyCertSign=getStringOption(attributes.keyCertSign,options),this.keyEncipherment=getStringOption(attributes.keyEncipherment,options),this.nonRepudiation=getStringOption(attributes.nonRepudiation,options),this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Line extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"line",!0),this.hand=getStringOption(attributes.hand,["even","left","right"]),this.id=attributes.id||"",this.slope=getStringOption(attributes.slope,["\\","/"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.edge=null}[$toHTML](){var x1,y1,x2,y2,parent=this[$getParent]()[$getParent](),edge=this.edge||new Edge({}),edgeStyle=edge[$toStyle](),style=Object.create(null),edge="visible"===edge.presence?edge.thickness:0,edgeStyle=(style.strokeWidth=measureToString(edge),style.stroke=edgeStyle.color,"100%"),height="100%";parent.w<=edge?([x1,y1,x2,y2]=["50%",0,"50%","100%"],edgeStyle=style.strokeWidth):parent.h<=edge?([x1,y1,x2,y2]=[0,"50%","100%","50%"],height=style.strokeWidth):"\\"===this.slope?[x1,y1,x2,y2]=[0,0,"100%","100%"]:[x1,y1,x2,y2]=[0,"100%","100%",0];edge={name:"svg",children:[{name:"line",attributes:{xmlns:SVG_NS,x1:x1,y1:y1,x2:x2,y2:y2,style:style}}],attributes:{xmlns:SVG_NS,width:edgeStyle,height:height,style:{overflow:"visible"}}};return hasMargin(parent)?HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[edge]}):(edge.attributes.style.position="absolute",HTMLResult.success(edge))}}class Linear extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"linear",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["toRight","toBottom","toLeft","toTop"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null}[$toStyle](startColor){startColor=startColor?startColor[$toStyle]():"#FFFFFF";var transf=this.type.replace(/([RBLT])/," $1").toLowerCase(),endColor=this.color?this.color[$toStyle]():"#000000";return"linear-gradient(".concat(transf,", ").concat(startColor,", ").concat(endColor,")")}}class LockDocument extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"lockDocument"),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){this[$content]=getStringOption(this[$content],["auto","0","1"])}}class Manifest extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"manifest",!0),this.action=getStringOption(attributes.action,["include","all","exclude"]),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.ref=new XFAObjectArray}}class Margin extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"margin",!0),this.bottomInset=getMeasurement(attributes.bottomInset,"0"),this.id=attributes.id||"",this.leftInset=getMeasurement(attributes.leftInset,"0"),this.rightInset=getMeasurement(attributes.rightInset,"0"),this.topInset=getMeasurement(attributes.topInset,"0"),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}[$toStyle](){return{margin:measureToString(this.topInset)+" "+measureToString(this.rightInset)+" "+measureToString(this.bottomInset)+" "+measureToString(this.leftInset)}}}class Mdp extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"mdp"),this.id=attributes.id||"",this.permissions=getInteger({data:attributes.permissions,defaultValue:2,validate:x=>1===x||3===x}),this.signatureType=getStringOption(attributes.signatureType,["filler","author"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Medium extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"medium"),this.id=attributes.id||"",this.imagingBBox=getBBox(attributes.imagingBBox),this.long=getMeasurement(attributes.long),this.orientation=getStringOption(attributes.orientation,["portrait","landscape"]),this.short=getMeasurement(attributes.short),this.stock=attributes.stock||"",this.trayIn=getStringOption(attributes.trayIn,["auto","delegate","pageFront"]),this.trayOut=getStringOption(attributes.trayOut,["auto","delegate"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Message extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"message",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.text=new XFAObjectArray}}class NumericEdit extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"numericEdit",!0),this.hScrollPolicy=getStringOption(attributes.hScrollPolicy,["auto","off","on"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[$toHTML](availableSpace){var style=toStyle(this,"border","font","margin"),field=this[$getParent]()[$getParent](),_field$$data4={name:"input",attributes:{type:"text",fieldId:field[$uid],dataId:(null==(_field$$data4=field[$data])?void 0:_field$$data4[$uid])||field[$uid],class:["xfaTextfield"],style:style,"aria-label":ariaLabel(field),"aria-required":!1}};return isRequired(field)&&(_field$$data4.attributes["aria-required"]=!0,_field$$data4.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[_field$$data4]})}}class Occur extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"occur",!0),this.id=attributes.id||"",this.initial=""!==attributes.initial?getInteger({data:attributes.initial,defaultValue:"",validate:x=>!0}):"",this.max=""!==attributes.max?getInteger({data:attributes.max,defaultValue:1,validate:x=>!0}):"",this.min=""!==attributes.min?getInteger({data:attributes.min,defaultValue:1,validate:x=>!0}):"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}[$clean](){var parent=this[$getParent](),originalMin=this.min;""===this.min&&(this.min=parent instanceof PageArea||parent instanceof PageSet?0:1),""===this.max&&(this.max=""===originalMin?parent instanceof PageArea||parent instanceof PageSet?-1:1:this.min),-1!==this.max&&this.max<this.min&&(this.max=this.min),""===this.initial&&(this.initial=parent instanceof Template?1:this.min)}}class Oid extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"oid"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Oids extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"oids",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.oid=new XFAObjectArray}}class Overflow extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"overflow"),this.id=attributes.id||"",this.leader=attributes.leader||"",this.target=attributes.target||"",this.trailer=attributes.trailer||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$getExtra](){var parent,target,leader,root;return this[$extra]||(parent=this[$getParent](),target=(root=this[$getTemplateRoot]())[$searchNode](this.target,parent),leader=root[$searchNode](this.leader,parent),root=root[$searchNode](this.trailer,parent),this[$extra]={target:(null==target?void 0:target[0])||null,leader:(null==leader?void 0:leader[0])||null,trailer:(null==root?void 0:root[0])||null,addLeader:!1,addTrailer:!1}),this[$extra]}}class PageArea extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"pageArea",!0),this.blankOrNotBlank=getStringOption(attributes.blankOrNotBlank,["any","blank","notBlank"]),this.id=attributes.id||"",this.initialNumber=getInteger({data:attributes.initialNumber,defaultValue:1,validate:x=>!0}),this.name=attributes.name||"",this.numbered=getInteger({data:attributes.numbered,defaultValue:1,validate:x=>!0}),this.oddOrEven=getStringOption(attributes.oddOrEven,["any","even","odd"]),this.pagePosition=getStringOption(attributes.pagePosition,["any","first","last","only","rest"]),this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.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}[$isUsable](){return this[$extra]?!this.occur||-1===this.occur.max||this[$extra].numberOfUse<this.occur.max:(this[$extra]={numberOfUse:0},!0)}[$cleanPage](){delete this[$extra]}[$getNextPage](){this[$extra]||(this[$extra]={numberOfUse:0});var parent=this[$getParent]();return"orderedOccurrence"===parent.relation&&this[$isUsable]()?(this[$extra].numberOfUse+=1,this):parent[$getNextPage]()}[$getAvailableSpace](){return this[$extra].space||{width:0,height:0}}[$toHTML](){this[$extra]||(this[$extra]={numberOfUse:1});var x,children=[],style=(this[$extra].children=children,Object.create(null));return this.medium&&this.medium.short&&this.medium.long?(style.width=measureToString(this.medium.short),style.height=measureToString(this.medium.long),this[$extra].space={width:this.medium.short,height:this.medium.long},"landscape"===this.medium.orientation&&(x=style.width,style.width=style.height,style.height=x,this[$extra].space={width:this.medium.long,height:this.medium.short})):warn("XFA - No medium specified in pageArea: please file a bug."),this[$childrenToHTML]({filter:new Set(["area","draw","field","subform"]),include:!0}),this[$childrenToHTML]({filter:new Set(["contentArea"]),include:!0}),HTMLResult.success({name:"div",children:children,attributes:{class:["xfaPage"],id:this[$uid],style:style,xfaName:this.name}})}}class PageSet extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"pageSet",!0),this.duplexImposition=getStringOption(attributes.duplexImposition,["longEdge","shortEdge"]),this.id=attributes.id||"",this.name=attributes.name||"",this.relation=getStringOption(attributes.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]),this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.occur=null,this.pageArea=new XFAObjectArray,this.pageSet=new XFAObjectArray}[$cleanPage](){for(var page of this.pageArea.children)page[$cleanPage]();for(var _page of this.pageSet.children)_page[$cleanPage]()}[$isUsable](){return!this.occur||-1===this.occur.max||this[$extra].numberOfUse<this.occur.max}[$getNextPage](){if(this[$extra]||(this[$extra]={numberOfUse:1,pageIndex:-1,pageSetIndex:-1}),"orderedOccurrence"===this.relation){if(this[$extra].pageIndex+1<this.pageArea.children.length)return this[$extra].pageIndex+=1,this.pageArea.children[this[$extra].pageIndex][$getNextPage]();if(this[$extra].pageSetIndex+1<this.pageSet.children.length)return this[$extra].pageSetIndex+=1,this.pageSet.children[this[$extra].pageSetIndex][$getNextPage]();if(this[$isUsable]())this[$extra].numberOfUse+=1,this[$extra].pageIndex=-1,this[$extra].pageSetIndex=-1;else{var parent=this[$getParent]();if(parent instanceof PageSet)return parent[$getNextPage]();this[$cleanPage]()}return this[$getNextPage]()}var parent=this[$getTemplateRoot]()[$extra].pageNumber,parity=parent%2==0?"even":"odd",position=0===parent?"first":"rest",parent=this.pageArea.children.find(p=>p.oddOrEven===parity&&p.pagePosition===position);return parent||this.pageArea.children.find(p=>"any"===p.oddOrEven&&p.pagePosition===position)||this.pageArea.children.find(p=>"any"===p.oddOrEven&&"any"===p.pagePosition)||this.pageArea.children[0]}}class Para extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"para",!0),this.hAlign=getStringOption(attributes.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=attributes.id||"",this.lineHeight=attributes.lineHeight?getMeasurement(attributes.lineHeight,"0pt"):"",this.marginLeft=attributes.marginLeft?getMeasurement(attributes.marginLeft,"0pt"):"",this.marginRight=attributes.marginRight?getMeasurement(attributes.marginRight,"0pt"):"",this.orphans=getInteger({data:attributes.orphans,defaultValue:0,validate:x=>0<=x}),this.preserve=attributes.preserve||"",this.radixOffset=attributes.radixOffset?getMeasurement(attributes.radixOffset,"0pt"):"",this.spaceAbove=attributes.spaceAbove?getMeasurement(attributes.spaceAbove,"0pt"):"",this.spaceBelow=attributes.spaceBelow?getMeasurement(attributes.spaceBelow,"0pt"):"",this.tabDefault=attributes.tabDefault?getMeasurement(this.tabDefault):"",this.tabStops=(attributes.tabStops||"").trim().split(/\s+/).map((x,i)=>i%2==1?getMeasurement(x):x),this.textIndent=attributes.textIndent?getMeasurement(attributes.textIndent,"0pt"):"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.vAlign=getStringOption(attributes.vAlign,["top","bottom","middle"]),this.widows=getInteger({data:attributes.widows,defaultValue:0,validate:x=>0<=x}),this.hyphenation=null}[$toStyle](){var style=toStyle(this,"hAlign");return""!==this.marginLeft&&(style.paddingLeft=measureToString(this.marginLeft)),""!==this.marginRight&&(style.paddingRight=measureToString(this.marginRight)),""!==this.spaceAbove&&(style.paddingTop=measureToString(this.spaceAbove)),""!==this.spaceBelow&&(style.paddingBottom=measureToString(this.spaceBelow)),""!==this.textIndent&&(style.textIndent=measureToString(this.textIndent),fixTextIndent(style)),0<this.lineHeight&&(style.lineHeight=measureToString(this.lineHeight)),""!==this.tabDefault&&(style.tabSize=measureToString(this.tabDefault)),this.tabStops.length,this.hyphenatation&&Object.assign(style,this.hyphenatation[$toStyle]()),style}}class PasswordEdit extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"passwordEdit",!0),this.hScrollPolicy=getStringOption(attributes.hScrollPolicy,["auto","off","on"]),this.id=attributes.id||"",this.passwordChar=attributes.passwordChar||"*",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.extras=null,this.margin=null}}class template_Pattern extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"pattern",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null}[$toStyle](startColor){startColor=startColor?startColor[$toStyle]():"#FFFFFF";var endColor=this.color?this.color[$toStyle]():"#000000",cmd="repeating-linear-gradient",colors="".concat(startColor,",").concat(startColor," ").concat(5,"px,").concat(endColor," ").concat(5,"px,").concat(endColor," ").concat(10,"px");switch(this.type){case"crossHatch":return"".concat(cmd,"(to top,").concat(colors,") ").concat(cmd,"(to right,").concat(colors,")");case"crossDiagonal":return"".concat(cmd,"(45deg,").concat(colors,") ").concat(cmd,"(-45deg,").concat(colors,")");case"diagonalLeft":return"".concat(cmd,"(45deg,").concat(colors,")");case"diagonalRight":return"".concat(cmd,"(-45deg,").concat(colors,")");case"horizontal":return"".concat(cmd,"(to top,").concat(colors,")");case"vertical":return"".concat(cmd,"(to right,").concat(colors,")")}return""}}class Picture extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"picture"),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Proto extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"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(attributes){super(TEMPLATE_NS_ID,"radial",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["toEdge","toCenter"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null}[$toStyle](startColor){startColor=startColor?startColor[$toStyle]():"#FFFFFF";var endColor=this.color?this.color[$toStyle]():"#000000",endColor="toEdge"===this.type?"".concat(startColor,",").concat(endColor):"".concat(endColor,",").concat(startColor);return"radial-gradient(circle at center, ".concat(endColor,")")}}class Reason extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"reason"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Reasons extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"reasons",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.reason=new XFAObjectArray}}class Rectangle extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"rectangle",!0),this.hand=getStringOption(attributes.hand,["even","left","right"]),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.corner=new XFAObjectArray(4),this.edge=new XFAObjectArray(4),this.fill=null}[$toHTML](){var edge=this.edge.children.length?this.edge.children[0]:new Edge({}),edgeStyle=edge[$toStyle](),style=Object.create(null);"visible"===(null==(_this$fill3=this.fill)?void 0:_this$fill3.presence)?Object.assign(style,this.fill[$toStyle]()):style.fill="transparent",style.strokeWidth=measureToString("visible"===edge.presence?edge.thickness:0),style.stroke=edgeStyle.color;var _this$fill3=(this.corner.children.length?this.corner.children[0]:new Corner({}))[$toStyle](),edge={name:"svg",children:[{name:"rect",attributes:{xmlns:SVG_NS,width:"100%",height:"100%",x:0,y:0,rx:_this$fill3.radius,ry:_this$fill3.radius,style:style}}],attributes:{xmlns:SVG_NS,style:{overflow:"visible"},width:"100%",height:"100%"}};return hasMargin(this[$getParent]()[$getParent]())?HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[edge]}):(edge.attributes.style.position="absolute",HTMLResult.success(edge))}}class RefElement extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"ref"),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Script extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"script"),this.binding=attributes.binding||"",this.contentType=attributes.contentType||"",this.id=attributes.id||"",this.name=attributes.name||"",this.runAt=getStringOption(attributes.runAt,["client","both","server"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class SetProperty extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"setProperty"),this.connection=attributes.connection||"",this.ref=attributes.ref||"",this.target=attributes.target||""}}class SignData extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"signData",!0),this.id=attributes.id||"",this.operation=getStringOption(attributes.operation,["sign","clear","verify"]),this.ref=attributes.ref||"",this.target=attributes.target||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.filter=null,this.manifest=null}}class Signature extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"signature",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["PDF1.3","PDF1.6"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.border=null,this.extras=null,this.filter=null,this.manifest=null,this.margin=null}}class Signing extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"signing",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.certificate=new XFAObjectArray}}class Solid extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"solid",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null}[$toStyle](startColor){return startColor?startColor[$toStyle]():"#FFFFFF"}}class Speak extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"speak"),this.disable=getInteger({data:attributes.disable,defaultValue:0,validate:x=>1===x}),this.id=attributes.id||"",this.priority=getStringOption(attributes.priority,["custom","caption","name","toolTip"]),this.rid=attributes.rid||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Stipple extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"stipple",!0),this.id=attributes.id||"",this.rate=getInteger({data:attributes.rate,defaultValue:50,validate:x=>0<=x&&x<=100}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.color=null,this.extras=null}[$toStyle](bgColor){var alpha=this.rate/100;return Util.makeHexColor(Math.round(bgColor.value.r*(1-alpha)+this.value.r*alpha),Math.round(bgColor.value.g*(1-alpha)+this.value.g*alpha),Math.round(bgColor.value.b*(1-alpha)+this.value.b*alpha))}}class Subform extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"subform",!0),this.access=getStringOption(attributes.access,["open","nonInteractive","protected","readOnly"]),this.allowMacro=getInteger({data:attributes.allowMacro,defaultValue:0,validate:x=>1===x}),this.anchorType=getStringOption(attributes.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:attributes.colSpan,defaultValue:1,validate:n=>1<=n||-1===n}),this.columnWidths=(attributes.columnWidths||"").trim().split(/\s+/).map(x=>"-1"===x?-1:getMeasurement(x)),this.h=attributes.h?getMeasurement(attributes.h):"",this.hAlign=getStringOption(attributes.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=attributes.id||"",this.layout=getStringOption(attributes.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.locale=attributes.locale||"",this.maxH=getMeasurement(attributes.maxH,"0pt"),this.maxW=getMeasurement(attributes.maxW,"0pt"),this.mergeMode=getStringOption(attributes.mergeMode,["consumeData","matchTemplate"]),this.minH=getMeasurement(attributes.minH,"0pt"),this.minW=getMeasurement(attributes.minW,"0pt"),this.name=attributes.name||"",this.presence=getStringOption(attributes.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(attributes.relevant),this.restoreState=getStringOption(attributes.restoreState,["manual","auto"]),this.scope=getStringOption(attributes.scope,["name","none"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.w=attributes.w?getMeasurement(attributes.w):"",this.x=getMeasurement(attributes.x,"0pt"),this.y=getMeasurement(attributes.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}[$getSubformParent](){var parent=this[$getParent]();return parent instanceof SubformSet?parent[$getSubformParent]():parent}[$isBindable](){return!0}[$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[$extra].attempt&&0<this[$extra].numberInLine||this[$getParent]()[$isThereMoreWidth]()}*[$getContainedChildren](){yield*getContainedChildren(this)}[$flushHTML](){return flushHTML(this)}[$addHTML](html,bbox){addHTML(this,html,bbox)}[$getAvailableSpace](){return getAvailableSpace(this)}[$isSplittable](){var _parent$layout4,parent=this[$getSubformParent]();return!!parent[$isSplittable]()&&(void 0!==this[$extra]._isSplittable?this[$extra]._isSplittable:"position"===this.layout||this.layout.includes("row")||this.keep&&"none"!==this.keep.intact?this[$extra]._isSplittable=!1:(null==(_parent$layout4=parent.layout)||!_parent$layout4.endsWith("-tb")||0===parent[$extra].numberInLine)&&(this[$extra]._isSplittable=!0))}[$toHTML](availableSpace){if(setTabIndex(this),this.break&&("auto"===this.break.after&&""===this.break.afterTarget||((node=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()}))[$globalData]=this[$globalData],this[$appendChild](node),this.breakAfter.push(node)),"auto"===this.break.before&&""===this.break.beforeTarget||((node=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()}))[$globalData]=this[$globalData],this[$appendChild](node),this.breakBefore.push(node)),""!==this.break.overflowTarget&&((node=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer}))[$globalData]=this[$globalData],this[$appendChild](node),this.overflow.push(node)),this[$removeChild](this.break),this.break=null),"hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;if((1<this.breakBefore.children.length||1<this.breakAfter.children.length)&&warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug."),1<=this.breakBefore.children.length){var node=this.breakBefore.children[0];if(handleBreak(node))return HTMLResult.breakNode(node)}if(null!=(node=this[$extra])&&node.afterBreakAfter)return HTMLResult.EMPTY;fixDimensions(this);var node=[],attributes={id:this[$uid],class:[]},root=(setAccess(this,attributes.class),this[$extra]||(this[$extra]=Object.create(null)),Object.assign(this[$extra],{children:node,line:null,attributes:attributes,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,availableSpace.width),height:Math.min(this.h||1/0,availableSpace.height)},width:0,height:0,prevHeight:0,currentWidth:0}),this[$getTemplateRoot]()),savedNoLayoutFailure=root[$extra].noLayoutFailure,isSplittable=this[$isSplittable]();if(isSplittable||setFirstUnsplittable(this),!checkDimensions(this,availableSpace))return HTMLResult.FAILURE;for(var filter=new Set(["area","draw","exclGroup","field","subform","subformSet"]),columnWidths=(this.layout.includes("row")&&(columnWidths=this[$getSubformParent]().columnWidths,Array.isArray(columnWidths))&&0<columnWidths.length&&(this[$extra].columnWidths=columnWidths,this[$extra].currentColumn=0),toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign")),classNames=["xfaSubform"],cl=layoutClass(this),isLrTb=(cl&&classNames.push(cl),attributes.style=columnWidths,attributes.class=classNames,this.name&&(attributes.xfaName=this.name),this.overflow&&(cl=this.overflow[$getExtra]()).addLeader&&(cl.addLeader=!1,handleOverflow(this,cl.leader,availableSpace)),this[$pushPara](),"lr-tb"===this.layout||"rl-tb"===this.layout),maxRun=isLrTb?MAX_ATTEMPTS_FOR_LRTB_LAYOUT:1;this[$extra].attempt<maxRun;this[$extra].attempt++){isLrTb&&this[$extra].attempt===MAX_ATTEMPTS_FOR_LRTB_LAYOUT-1&&(this[$extra].numberInLine=0);var _result2=this[$childrenToHTML]({filter:filter,include:!0});if(_result2.success)break;if(_result2.isBreak())return this[$popPara](),_result2;if(isLrTb&&0===this[$extra].attempt&&0===this[$extra].numberInLine&&!root[$extra].noLayoutFailure){this[$extra].attempt=maxRun;break}}if(this[$popPara](),isSplittable||unsetFirstUnsplittable(this),root[$extra].noLayoutFailure=savedNoLayoutFailure,this[$extra].attempt===maxRun)return this.overflow&&(this[$getTemplateRoot]()[$extra].overflowNode=this.overflow),isSplittable||delete this[$extra],HTMLResult.FAILURE;this.overflow&&(classNames=this.overflow[$getExtra]()).addTrailer&&(classNames.addTrailer=!1,handleOverflow(this,classNames.trailer,availableSpace));cl=0,savedNoLayoutFailure=0,this.margin&&(cl=this.margin.leftInset+this.margin.rightInset,savedNoLayoutFailure=this.margin.topInset+this.margin.bottomInset),isSplittable=Math.max(this[$extra].width+cl,this.w||0),classNames=Math.max(this[$extra].height+savedNoLayoutFailure,this.h||0),availableSpace=[this.x,this.y,isSplittable,classNames];if(""===this.w&&(columnWidths.width=measureToString(isSplittable)),""===this.h&&(columnWidths.height=measureToString(classNames)),("0px"===columnWidths.width||"0px"===columnWidths.height)&&0===node.length)return HTMLResult.EMPTY;cl={name:"div",attributes:attributes,children:node},applyAssist(this,attributes),savedNoLayoutFailure=HTMLResult.success(createWrapper(this,cl),availableSpace);if(1<=this.breakAfter.children.length){isSplittable=this.breakAfter.children[0];if(handleBreak(isSplittable))return this[$extra].afterBreakAfter=savedNoLayoutFailure,HTMLResult.breakNode(isSplittable)}return delete this[$extra],savedNoLayoutFailure}}class SubformSet extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"subformSet",!0),this.id=attributes.id||"",this.name=attributes.name||"",this.relation=getStringOption(attributes.relation,["ordered","choice","unordered"]),this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.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}*[$getContainedChildren](){yield*getContainedChildren(this)}[$getSubformParent](){for(var parent=this[$getParent]();!(parent instanceof Subform);)parent=parent[$getParent]();return parent}[$isBindable](){return!0}}class SubjectDN extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"subjectDN"),this.delimiter=attributes.delimiter||",",this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){this[$content]=new Map(this[$content].split(this.delimiter).map(kv=>((kv=kv.split("=",2))[0]=kv[0].trim(),kv)))}}class SubjectDNs extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"subjectDNs",!0),this.id=attributes.id||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.subjectDN=new XFAObjectArray}}class Submit extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"submit",!0),this.embedPDF=getInteger({data:attributes.embedPDF,defaultValue:0,validate:x=>1===x}),this.format=getStringOption(attributes.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]),this.id=attributes.id||"",this.target=attributes.target||"",this.textEncoding=getKeyword({data:attributes.textEncoding?attributes.textEncoding.toLowerCase():"",defaultValue:"",validate:k=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(k)||k.match(/iso-8859-\d{2}/)}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.xdpContent=attributes.xdpContent||"",this.encrypt=null,this.encryptData=new XFAObjectArray,this.signData=new XFAObjectArray}}class Template extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"template",!0),this.baseProfile=getStringOption(attributes.baseProfile,["full","interactiveForms"]),this.extras=null,this.subform=new XFAObjectArray}[$finalize](){0===this.subform.children.length&&warn("XFA - No subforms in template node."),2<=this.subform.children.length&&warn("XFA - Several subforms in template node: please file a bug."),this[$tabIndex]=DEFAULT_TAB_INDEX}[$isSplittable](){return!0}[$searchNode](expr,container){return expr.startsWith("#")?[this[$ids].get(expr.slice(1))]:searchNode(this,container,expr,!0,!0)}*[$toPages](){var _this6=this;if(!this.subform.children.length)return HTMLResult.success({name:"div",children:[]});this[$extra]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};for(var _root$break,targetPageArea,_ret3,root=this.subform.children[0],pageAreas=(root.pageSet[$cleanPage](),root.pageSet.pageArea.children),mainHtml={name:"div",children:[]},pageArea=null,breakBefore=null,breakBeforeTarget=null,breakBeforeTarget=(1<=root.breakBefore.children.length?breakBeforeTarget=(breakBefore=root.breakBefore.children[0]).target:1<=root.subform.children.length&&1<=root.subform.children[0].breakBefore.children.length?breakBeforeTarget=(breakBefore=root.subform.children[0].breakBefore.children[0]).target:null!=(_root$break=root.break)&&_root$break.beforeTarget?breakBeforeTarget=(breakBefore=root.break).beforeTarget:1<=root.subform.children.length&&null!=(_root$break=root.subform.children[0].break)&&_root$break.beforeTarget&&(breakBeforeTarget=(breakBefore=root.subform.children[0].break).beforeTarget),breakBefore&&(_root$break=this[$searchNode](breakBeforeTarget,breakBefore[$getParent]()))instanceof PageArea&&(pageArea=_root$break,breakBefore[$extra]={}),(pageArea=pageArea||pageAreas[0])[$extra]={numberOfUse:1},pageArea[$getParent]()),leader=(breakBeforeTarget[$extra]={numberOfUse:1,pageIndex:breakBeforeTarget.pageArea.children.indexOf(pageArea),pageSetIndex:0},null),trailer=null,hasSomething=!0,hasSomethingCounter=0,startIndex=0;;)if(_ret3=yield*function*(){if(hasSomething)hasSomethingCounter=0;else if(mainHtml.children.pop(),++hasSomethingCounter===MAX_EMPTY_PAGES)return warn("XFA - Something goes wrong: please file a bug."),{v:mainHtml};targetPageArea=null;for(var page=(_this6[$extra].currentPageArea=pageArea)[$toHTML]().html,contentAreas=(mainHtml.children.push(page),leader&&(_this6[$extra].noLayoutFailure=!0,page.children.push(leader[$toHTML](pageArea[$extra].space).html),leader=null),trailer&&(_this6[$extra].noLayoutFailure=!0,page.children.push(trailer[$toHTML](pageArea[$extra].space).html),trailer=null),pageArea.contentArea.children),htmlContentAreas=page.children.filter(node=>node.attributes.class.includes("xfaContentarea")),flush=(hasSomething=!1,_this6[$extra].firstUnsplittable=null,_this6[$extra].noLayoutFailure=!1,index=>{var _html$children,html=root[$flushHTML]();html&&(hasSomething=hasSomething||0<(null==(_html$children=html.children)?void 0:_html$children.length),htmlContentAreas[index].children.push(html))}),i=startIndex,ii=contentAreas.length;i<ii;i++){var _html$html$children,_target,index,contentArea=_this6[$extra].currentContentArea=contentAreas[i],contentArea={width:contentArea.w,height:contentArea.h},contentArea=(startIndex=0,leader&&(htmlContentAreas[i].children.push(leader[$toHTML](contentArea).html),leader=null),trailer&&(htmlContentAreas[i].children.push(trailer[$toHTML](contentArea).html),trailer=null),root[$toHTML](contentArea));if(contentArea.success)return contentArea.html?(hasSomething=hasSomething||0<(null==(_html$html$children=contentArea.html.children)?void 0:_html$html$children.length),htmlContentAreas[i].children.push(contentArea.html)):!hasSomething&&1<mainHtml.children.length&&mainHtml.children.pop(),{v:mainHtml};contentArea.isBreak()?(_html$html$children=contentArea.breakNode,flush(i),"auto"!==_html$html$children.targetType&&(_html$html$children.leader&&(leader=(leader=_this6[$searchNode](_html$html$children.leader,_html$html$children[$getParent]()))?leader[0]:null),_html$html$children.trailer&&(trailer=(trailer=_this6[$searchNode](_html$html$children.trailer,_html$html$children[$getParent]()))?trailer[0]:null),i="pageArea"===_html$html$children.targetType?(targetPageArea=_html$html$children[$extra].target,1/0):_html$html$children[$extra].target?(targetPageArea=_html$html$children[$extra].target,startIndex=_html$html$children[$extra].index+1,1/0):_html$html$children[$extra].index)):_this6[$extra].overflowNode?(contentArea=_this6[$extra].overflowNode,_this6[$extra].overflowNode=null,_target=(contentArea=contentArea[$getExtra]()).target,contentArea.addLeader=null!==contentArea.leader,contentArea.addTrailer=null!==contentArea.trailer,flush(i),contentArea=i,i=1/0,_target instanceof PageArea?targetPageArea=_target:_target instanceof ContentArea&&(-1!==(index=contentAreas.indexOf(_target))?contentArea<index?i=index-1:startIndex=index:(targetPageArea=_target[$getParent](),startIndex=targetPageArea.contentArea.children.indexOf(_target)))):flush(i)}_this6[$extra].pageNumber+=1,targetPageArea&&(targetPageArea[$isUsable]()?targetPageArea[$extra].numberOfUse+=1:targetPageArea=null),pageArea=targetPageArea||pageArea[$getNextPage](),yield null}())return _ret3.v}}class Text extends ContentObject{constructor(attributes){super(TEMPLATE_NS_ID,"text"),this.id=attributes.id||"",this.maxChars=getInteger({data:attributes.maxChars,defaultValue:0,validate:x=>0<=x}),this.name=attributes.name||"",this.rid=attributes.rid||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$acceptWhitespace](){return!0}[$onChild](child){return child[$namespaceId]===NamespaceIds.xhtml.id?(this[$content]=child,!0):(warn("XFA - Invalid content in Text: ".concat(child[$nodeName],".")),!1)}[$onText](str){this[$content]instanceof XFAObject||super[$onText](str)}[$finalize](){"string"==typeof this[$content]&&(this[$content]=this[$content].replaceAll("\r\n","\n"))}[$getExtra](){return"string"==typeof this[$content]?this[$content].split(/[\u2029\u2028\n]/).filter(line=>!!line).join("\n"):this[$content][$text]()}[$toHTML](availableSpace){var html;return"string"==typeof this[$content]?(html=valueToHtml(this[$content]).html,this[$content].includes("\u2029")?(html.name="div",html.children=[],this[$content].split("\u2029").map(para=>para.split(/[\u2028\n]/).flatMap(line=>[{name:"span",value:line},{name:"br"}])).forEach(lines=>{html.children.push({name:"p",children:lines})})):/[\u2028\n]/.test(this[$content])&&(html.name="div",html.children=[],this[$content].split(/[\u2028\n]/).forEach(line=>{html.children.push({name:"span",value:line},{name:"br"})})),HTMLResult.success(html)):this[$content][$toHTML](availableSpace)}}class TextEdit extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"textEdit",!0),this.allowRichText=getInteger({data:attributes.allowRichText,defaultValue:0,validate:x=>1===x}),this.hScrollPolicy=getStringOption(attributes.hScrollPolicy,["auto","off","on"]),this.id=attributes.id||"",this.multiLine=getInteger({data:attributes.multiLine,defaultValue:"",validate:x=>0===x||1===x}),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.vScrollPolicy=getStringOption(attributes.vScrollPolicy,["auto","off","on"]),this.border=null,this.comb=null,this.extras=null,this.margin=null}[$toHTML](availableSpace){var _field$$data5,style=toStyle(this,"border","font","margin"),field=this[$getParent]()[$getParent]();return""===this.multiLine&&(this.multiLine=field instanceof Draw?1:0),_field$$data5=1===this.multiLine?{name:"textarea",attributes:{dataId:(null==(_field$$data5=field[$data])?void 0:_field$$data5[$uid])||field[$uid],fieldId:field[$uid],class:["xfaTextfield"],style:style,"aria-label":ariaLabel(field),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:(null==(_field$$data5=field[$data])?void 0:_field$$data5[$uid])||field[$uid],fieldId:field[$uid],class:["xfaTextfield"],style:style,"aria-label":ariaLabel(field),"aria-required":!1}},isRequired(field)&&(_field$$data5.attributes["aria-required"]=!0,_field$$data5.attributes.required=!0),HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[_field$$data5]})}}class Time extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"time"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}[$finalize](){var date=this[$content].trim();this[$content]=date?new Date(date):null}[$toHTML](availableSpace){return valueToHtml(this[$content]?this[$content].toString():"")}}class TimeStamp extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"timeStamp"),this.id=attributes.id||"",this.server=attributes.server||"",this.type=getStringOption(attributes.type,["optional","required"]),this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class ToolTip extends StringObject{constructor(attributes){super(TEMPLATE_NS_ID,"toolTip"),this.id=attributes.id||"",this.rid=attributes.rid||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Traversal extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"traversal",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.traverse=new XFAObjectArray}}class Traverse extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"traverse",!0),this.id=attributes.id||"",this.operation=getStringOption(attributes.operation,["next","back","down","first","left","right","up"]),this.ref=attributes.ref||"",this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.script=null}get name(){return this.operation}[$isTransparent](){return!1}}class Ui extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"ui",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.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}[$getExtra](){if(void 0===this[$extra]){for(var name of Object.getOwnPropertyNames(this))if("extras"!==name&&"picture"!==name){name=this[name];if(name instanceof XFAObject)return this[$extra]=name}this[$extra]=null}return this[$extra]}[$toHTML](availableSpace){var obj=this[$getExtra]();return obj?obj[$toHTML](availableSpace):HTMLResult.EMPTY}}class Validate extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"validate",!0),this.formatTest=getStringOption(attributes.formatTest,["warning","disabled","error"]),this.id=attributes.id||"",this.nullTest=getStringOption(attributes.nullTest,["disabled","error","warning"]),this.scriptTest=getStringOption(attributes.scriptTest,["error","disabled","warning"]),this.use=attributes.use||"",this.usehref=attributes.usehref||"",this.extras=null,this.message=null,this.picture=null,this.script=null}}class Value extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"value",!0),this.id=attributes.id||"",this.override=getInteger({data:attributes.override,defaultValue:0,validate:x=>1===x}),this.relevant=getRelevant(attributes.relevant),this.use=attributes.use||"",this.usehref=attributes.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}[$setValue](value){var parent=this[$getParent]();if(parent instanceof Field&&(null!=(parent=parent.ui)&&parent.imageEdit))return this.image||(this.image=new Image({}),this[$appendChild](this.image)),void(this.image[$content]=value[$content]);parent=value[$nodeName];if(null!==this[parent])this[parent][$content]=value[$content];else{for(var name of Object.getOwnPropertyNames(this)){var obj=this[name];obj instanceof XFAObject&&(this[name]=null,this[$removeChild](obj))}this[value[$nodeName]]=value,this[$appendChild](value)}}[$text](){if(this.exData)return("string"==typeof this.exData[$content]?this.exData[$content]:this.exData[$content][$text]()).trim();for(var name of Object.getOwnPropertyNames(this))if("image"!==name){name=this[name];if(name instanceof XFAObject)return(name[$content]||"").toString().trim()}return null}[$toHTML](availableSpace){for(var name of Object.getOwnPropertyNames(this)){name=this[name];if(name instanceof XFAObject)return name[$toHTML](availableSpace)}return HTMLResult.EMPTY}}class Variables extends XFAObject{constructor(attributes){super(TEMPLATE_NS_ID,"variables",!0),this.id=attributes.id||"",this.use=attributes.use||"",this.usehref=attributes.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}[$isTransparent](){return!0}}class TemplateNamespace{static[$buildXFAObject](name,attributes){if(TemplateNamespace.hasOwnProperty(name))return(name=TemplateNamespace[name](attributes))[$setSetAttributes](attributes),name}static appearanceFilter(attrs){return new AppearanceFilter(attrs)}static arc(attrs){return new Arc(attrs)}static area(attrs){return new Area(attrs)}static assist(attrs){return new Assist(attrs)}static barcode(attrs){return new Barcode(attrs)}static bind(attrs){return new Bind(attrs)}static bindItems(attrs){return new BindItems(attrs)}static bookend(attrs){return new Bookend(attrs)}static boolean(attrs){return new BooleanElement(attrs)}static border(attrs){return new Border(attrs)}static break(attrs){return new Break(attrs)}static breakAfter(attrs){return new BreakAfter(attrs)}static breakBefore(attrs){return new BreakBefore(attrs)}static button(attrs){return new Button(attrs)}static calculate(attrs){return new Calculate(attrs)}static caption(attrs){return new Caption(attrs)}static certificate(attrs){return new Certificate(attrs)}static certificates(attrs){return new Certificates(attrs)}static checkButton(attrs){return new CheckButton(attrs)}static choiceList(attrs){return new ChoiceList(attrs)}static color(attrs){return new Color(attrs)}static comb(attrs){return new Comb(attrs)}static connect(attrs){return new Connect(attrs)}static contentArea(attrs){return new ContentArea(attrs)}static corner(attrs){return new Corner(attrs)}static date(attrs){return new DateElement(attrs)}static dateTime(attrs){return new DateTime(attrs)}static dateTimeEdit(attrs){return new DateTimeEdit(attrs)}static decimal(attrs){return new Decimal(attrs)}static defaultUi(attrs){return new DefaultUi(attrs)}static desc(attrs){return new Desc(attrs)}static digestMethod(attrs){return new DigestMethod(attrs)}static digestMethods(attrs){return new DigestMethods(attrs)}static draw(attrs){return new Draw(attrs)}static edge(attrs){return new Edge(attrs)}static encoding(attrs){return new Encoding(attrs)}static encodings(attrs){return new Encodings(attrs)}static encrypt(attrs){return new Encrypt(attrs)}static encryptData(attrs){return new EncryptData(attrs)}static encryption(attrs){return new Encryption(attrs)}static encryptionMethod(attrs){return new EncryptionMethod(attrs)}static encryptionMethods(attrs){return new EncryptionMethods(attrs)}static event(attrs){return new Event(attrs)}static exData(attrs){return new ExData(attrs)}static exObject(attrs){return new ExObject(attrs)}static exclGroup(attrs){return new ExclGroup(attrs)}static execute(attrs){return new Execute(attrs)}static extras(attrs){return new Extras(attrs)}static field(attrs){return new Field(attrs)}static fill(attrs){return new Fill(attrs)}static filter(attrs){return new Filter(attrs)}static float(attrs){return new Float(attrs)}static font(attrs){return new template_Font(attrs)}static format(attrs){return new Format(attrs)}static handler(attrs){return new Handler(attrs)}static hyphenation(attrs){return new Hyphenation(attrs)}static image(attrs){return new Image(attrs)}static imageEdit(attrs){return new ImageEdit(attrs)}static integer(attrs){return new Integer(attrs)}static issuers(attrs){return new Issuers(attrs)}static items(attrs){return new Items(attrs)}static keep(attrs){return new Keep(attrs)}static keyUsage(attrs){return new KeyUsage(attrs)}static line(attrs){return new Line(attrs)}static linear(attrs){return new Linear(attrs)}static lockDocument(attrs){return new LockDocument(attrs)}static manifest(attrs){return new Manifest(attrs)}static margin(attrs){return new Margin(attrs)}static mdp(attrs){return new Mdp(attrs)}static medium(attrs){return new Medium(attrs)}static message(attrs){return new Message(attrs)}static numericEdit(attrs){return new NumericEdit(attrs)}static occur(attrs){return new Occur(attrs)}static oid(attrs){return new Oid(attrs)}static oids(attrs){return new Oids(attrs)}static overflow(attrs){return new Overflow(attrs)}static pageArea(attrs){return new PageArea(attrs)}static pageSet(attrs){return new PageSet(attrs)}static para(attrs){return new Para(attrs)}static passwordEdit(attrs){return new PasswordEdit(attrs)}static pattern(attrs){return new template_Pattern(attrs)}static picture(attrs){return new Picture(attrs)}static proto(attrs){return new Proto(attrs)}static radial(attrs){return new Radial(attrs)}static reason(attrs){return new Reason(attrs)}static reasons(attrs){return new Reasons(attrs)}static rectangle(attrs){return new Rectangle(attrs)}static ref(attrs){return new RefElement(attrs)}static script(attrs){return new Script(attrs)}static setProperty(attrs){return new SetProperty(attrs)}static signData(attrs){return new SignData(attrs)}static signature(attrs){return new Signature(attrs)}static signing(attrs){return new Signing(attrs)}static solid(attrs){return new Solid(attrs)}static speak(attrs){return new Speak(attrs)}static stipple(attrs){return new Stipple(attrs)}static subform(attrs){return new Subform(attrs)}static subformSet(attrs){return new SubformSet(attrs)}static subjectDN(attrs){return new SubjectDN(attrs)}static subjectDNs(attrs){return new SubjectDNs(attrs)}static submit(attrs){return new Submit(attrs)}static template(attrs){return new Template(attrs)}static text(attrs){return new Text(attrs)}static textEdit(attrs){return new TextEdit(attrs)}static time(attrs){return new Time(attrs)}static timeStamp(attrs){return new TimeStamp(attrs)}static toolTip(attrs){return new ToolTip(attrs)}static traversal(attrs){return new Traversal(attrs)}static traverse(attrs){return new Traverse(attrs)}static ui(attrs){return new Ui(attrs)}static validate(attrs){return new Validate(attrs)}static value(attrs){return new Value(attrs)}static variables(attrs){return new Variables(attrs)}}var bind_NS_DATASETS=NamespaceIds.datasets.id;function createText(content){var node=new Text({});return node[$content]=content,node}class Binder{constructor(root){var _root$datasets;this.root=root,this.datasets=root.datasets,this.data=(null==(_root$datasets=root.datasets)?void 0:_root$datasets.data)||new XmlObject(NamespaceIds.datasets.id,"data"),this.emptyMerge=0===this.data[$getChildren]().length,this.root.form=this.form=root.template[$clone]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){return this._bindElement(this.form,this.data),this.form}getData(){return this.data}_bindValue(formNode,data,picture){var value;formNode[$data]=data,formNode[$hasSettableValue]()?data[$isDataValue]()?(value=data[$getDataValue](),formNode[$setValue](createText(value))):formNode instanceof Field&&"multiSelect"===(null==(value=formNode.ui)||null==(value=value.choiceList)?void 0:value.open)?(value=data[$getChildren]().map(child=>child[$content].trim()).join("\n"),formNode[$setValue](createText(value))):this._isConsumeData()&&warn("XFA - Nodes haven't the same type."):!data[$isDataValue]()||this._isMatchTemplate()?this._bindElement(formNode,data):warn("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(name,isValue,dataNode,global){var generator,match;if(!name)return null;for(var i=0;i<3;i++){for(generator=dataNode[$getRealChildrenByNameIt](name,!1,!0);;){if(!(match=generator.next().value))break;if(isValue===match[$isDataValue]())return match}if(dataNode[$namespaceId]===NamespaceIds.datasets.id&&"data"===dataNode[$nodeName])break;dataNode=dataNode[$getParent]()}return global?(match=(generator=this.data[$getRealChildrenByNameIt](name,!0,!1)).next().value)||(null!=(match=(generator=this.data[$getAttributeIt](name,!0)).next().value)&&match[$isDataValue]()?match:null):null}_setProperties(formNode,dataNode){if(formNode.hasOwnProperty("setProperty"))for(var{ref,target,connection}of formNode.setProperty.children){var targetNodes,targetParent,content,name,attrs;connection||ref&&((connection=searchNode(this.root,dataNode,ref,!1,!1))?([connection]=connection,connection[$isDescendent](this.data)?(targetNodes=searchNode(this.root,formNode,target,!1,!1))?([targetNodes]=targetNodes,targetNodes[$isDescendent](formNode)?(targetParent=targetNodes[$getParent](),targetNodes instanceof SetProperty||targetParent instanceof SetProperty?warn("XFA - Invalid target: cannot be a setProperty or one of its properties."):targetNodes instanceof BindItems||targetParent instanceof BindItems?warn("XFA - Invalid target: cannot be a bindItems or one of its properties."):(content=connection[$text](),name=targetNodes[$nodeName],targetNodes instanceof XFAAttribute?((attrs=Object.create(null))[name]=content,attrs=Reflect.construct(Object.getPrototypeOf(targetParent).constructor,[attrs]),targetParent[name]=attrs[name]):targetNodes.hasOwnProperty($content)?(targetNodes[$data]=connection,targetNodes[$content]=content,targetNodes[$finalize]()):warn("XFA - Invalid node to use in setProperty"))):warn("XFA - Invalid target: must be a property or subproperty.")):warn("XFA - Invalid target: ".concat(target,".")):warn("XFA - Invalid node: must be a data node.")):warn("XFA - Invalid reference: ".concat(ref,".")))}}_bindItems(formNode,dataNode){if(formNode.hasOwnProperty("items")&&formNode.hasOwnProperty("bindItems")&&!formNode.bindItems.isEmpty()){for(var item of formNode.items.children)formNode[$removeChild](item);formNode.items.clear();var ref,labelRef,valueRef,connection,labels=new Items({}),values=new Items({});formNode[$appendChild](labels),formNode.items.push(labels),formNode[$appendChild](values),formNode.items.push(values);for({ref,labelRef,valueRef,connection}of formNode.bindItems.children)if(!connection&&ref){var labelNodes,nodes=searchNode(this.root,dataNode,ref,!1,!1);if(nodes)for(var node of nodes)node[$isDescendent](this.datasets)?(labelNodes=searchNode(this.root,node,labelRef,!0,!1))?([labelNodes]=labelNodes,labelNodes[$isDescendent](this.datasets)?(node=searchNode(this.root,node,valueRef,!0,!1))?([node]=node,node[$isDescendent](this.datasets)?(labelNodes=createText(labelNodes[$text]()),node=createText(node[$text]()),labels[$appendChild](labelNodes),labels.text.push(labelNodes),values[$appendChild](node),values.text.push(node)):warn("XFA - Invalid value: must be a datasets child.")):warn("XFA - Invalid value: ".concat(valueRef,".")):warn("XFA - Invalid label: must be a datasets child.")):warn("XFA - Invalid label: ".concat(labelRef,".")):warn("XFA - Invalid ref (".concat(ref,"): must be a datasets child."));else warn("XFA - Invalid reference: ".concat(ref,"."))}}}_bindOccurrences(formNode,matches,picture){var baseClone;if(1<matches.length&&((baseClone=formNode[$clone]())[$removeChild](baseClone.occur),baseClone.occur=null),this._bindValue(formNode,matches[0],picture),this._setProperties(formNode,matches[0]),this._bindItems(formNode,matches[0]),1!==matches.length)for(var parent=formNode[$getParent](),name=formNode[$nodeName],pos=parent[$indexOf](formNode),i=1,ii=matches.length;i<ii;i++){var match=matches[i],clone=baseClone[$clone]();parent[name].push(clone),parent[$insertAt](pos+i,clone),this._bindValue(clone,match,picture),this._setProperties(clone,match),this._bindItems(clone,match)}}_createOccurrences(formNode){if(this.emptyMerge){var occur=formNode["occur"];if(occur&&!(occur.initial<=1)){var parent=formNode[$getParent](),name=formNode[$nodeName];if(parent[name]instanceof XFAObjectArray){var currentNumber=(formNode.name?parent[name].children.filter(e=>e.name===formNode.name):parent[name].children).length,pos=parent[$indexOf](formNode)+1,ii=occur.initial-currentNumber;if(ii){var nodeClone=formNode[$clone]();nodeClone[$removeChild](nodeClone.occur),nodeClone.occur=null,parent[name].push(nodeClone),parent[$insertAt](pos,nodeClone);for(var i=1;i<ii;i++){var clone=nodeClone[$clone]();parent[name].push(clone),parent[$insertAt](pos+i,clone)}}}}}}_getOccurInfo(formNode){var{name:formNode,occur}=formNode;return occur&&formNode?(formNode=-1===occur.max?1/0:occur.max,[occur.min,formNode]):[1,1]}_setAndBind(formNode,dataNode){this._setProperties(formNode,dataNode),this._bindItems(formNode,dataNode),this._bindElement(formNode,dataNode)}_bindElement(formNode,dataNode){var child,uselessNodes=[];this._createOccurrences(formNode);for(child of formNode[$getChildren]())if(!child[$data])if(void 0===this._mergeMode&&"subform"===child[$nodeName]){this._mergeMode="consumeData"===child.mergeMode;var dataChildren=dataNode[$getChildren]();0<dataChildren.length?this._bindOccurrences(child,[dataChildren[0]],null):this.emptyMerge&&(dataChildren=dataNode[$namespaceId]===bind_NS_DATASETS?-1:dataNode[$namespaceId],dataChildren=child[$data]=new XmlObject(dataChildren,child.name||"root"),dataNode[$appendChild](dataChildren),this._bindElement(child,dataChildren))}else if(child[$isBindable]()){var global=!1,dataChildren=null,ref=null,match=null;if(child.bind){switch(child.bind.match){case"none":this._setAndBind(child,dataNode);continue;case"global":global=!0;break;case"dataRef":if(!child.bind.ref){warn("XFA - ref is empty in node ".concat(child[$nodeName],".")),this._setAndBind(child,dataNode);continue}ref=child.bind.ref}child.bind.picture&&(dataChildren=child.bind.picture[$content])}var[min,max]=this._getOccurInfo(child);if(ref){if(null===(match=searchNode(this.root,dataNode,ref,!0,!1))){if(!(match=createDataNode(this.data,dataNode,ref)))continue;this._isConsumeData()&&(match[$consumed]=!0),this._setAndBind(child,match);continue}(match=this._isConsumeData()?match.filter(node=>!node[$consumed]):match).length>max?match=match.slice(0,max):0===match.length&&(match=null),match&&this._isConsumeData()&&match.forEach(node=>{node[$consumed]=!0})}else{if(!child.name){this._setAndBind(child,dataNode);continue}if(this._isConsumeData()){for(var matches=[];matches.length<max;){var found=this._findDataByNameToConsume(child.name,child[$hasSettableValue](),dataNode,global);if(!found)break;found[$consumed]=!0,matches.push(found)}match=0<matches.length?matches:null}else{if(!(match=dataNode[$getRealChildrenByNameIt](child.name,!1,this.emptyMerge).next().value)){if(0===min){uselessNodes.push(child);continue}var _nsId=dataNode[$namespaceId]===bind_NS_DATASETS?-1:dataNode[$namespaceId],match=child[$data]=new XmlObject(_nsId,child.name);this.emptyMerge&&(match[$consumed]=!0),dataNode[$appendChild](match),this._setAndBind(child,match);continue}this.emptyMerge&&(match[$consumed]=!0),match=[match]}}match?this._bindOccurrences(child,match,dataChildren):0<min?this._setAndBind(child,dataNode):uselessNodes.push(child)}uselessNodes.forEach(node=>node[$getParent]()[$removeChild](node))}}class DataHandler{constructor(root,data){this.data=data,this.dataset=root.datasets||null}serialize(storage){for(var stack=[[-1,this.data[$getChildren]()]];0<stack.length;){var last=stack.at(-1),[i,children]=last;if(i+1===children.length)stack.pop();else{var value,i=children[++last[0]],children=storage.get(i[$uid]);if(children)i[$setValue](children);else for(value of i[$getAttributes]().values()){var entry=storage.get(value[$uid]);if(entry){value[$setValue](entry);break}}last=i[$getChildren]();0<last.length&&stack.push([-1,last])}}var buf=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(var _child3 of this.dataset[$getChildren]())"data"!==_child3[$nodeName]&&_child3[$toString](buf);return this.data[$toString](buf),buf.push("</xfa:datasets>"),buf.join("")}}var CONFIG_NS_ID=NamespaceIds.config.id;class Acrobat extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"acrobat7",!0),this.dynamicRender=null}}class ADBE_JSConsole extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends Option01{constructor(attributes){super(CONFIG_NS_ID,"addSilentPrint")}}class AddViewerPreferences extends Option01{constructor(attributes){super(CONFIG_NS_ID,"addViewerPreferences")}}class AdjustData extends Option10{constructor(attributes){super(CONFIG_NS_ID,"adjustData")}}class AdobeExtensionLevel extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"adobeExtensionLevel",0,n=>1<=n&&n<=8)}}class Agent extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"agent",!0),this.name=attributes.name?attributes.name.trim():"",this.common=new XFAObjectArray}}class AlwaysEmbed extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"alwaysEmbed")}}class Amd extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"amd")}}class config_Area extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"area"),this.level=getInteger({data:attributes.level,defaultValue:0,validate:n=>1<=n&&n<=3}),this.name=getStringOption(attributes.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"autoSave",["disabled","enabled"])}}class Base extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"base")}}class BatchOutput extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"batchOutput"),this.format=getStringOption(attributes.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"behaviorOverride")}[$finalize](){this[$content]=new Map(this[$content].trim().split(/\s+/).filter(x=>x.includes(":")).map(x=>x.split(":",2)))}}class Cache extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"cache",!0),this.templateCache=null}}class Change extends Option01{constructor(attributes){super(CONFIG_NS_ID,"change")}}class Common extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"compress"),this.scope=getStringOption(attributes.scope,["imageOnly","document"])}}class CompressLogicalStructure extends Option01{constructor(attributes){super(CONFIG_NS_ID,"compressLogicalStructure")}}class CompressObjectStream extends Option10{constructor(attributes){super(CONFIG_NS_ID,"compressObjectStream")}}class Compression extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"compression",!0),this.compressLogicalStructure=null,this.compressObjectStream=null,this.level=null,this.type=null}}class Config extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"config",!0),this.acrobat=null,this.present=null,this.trace=null,this.agent=new XFAObjectArray}}class Conformance extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"conformance",["A","B"])}}class ContentCopy extends Option01{constructor(attributes){super(CONFIG_NS_ID,"contentCopy")}}class Copies extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"copies",1,n=>1<=n)}}class Creator extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"creator")}}class CurrentPage extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"currentPage",0,n=>0<=n)}}class Data extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"debug",!0),this.uri=null}}class DefaultTypeface extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"defaultTypeface"),this.writingScript=getStringOption(attributes.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends Option01{constructor(attributes){super(CONFIG_NS_ID,"documentAssembly")}}class Driver extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"driver",!0),this.name=attributes.name?attributes.name.trim():"",this.fontInfo=null,this.xdc=null}}class DuplexOption extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"dynamicRender",["forbidden","required"])}}class Embed extends Option01{constructor(attributes){super(CONFIG_NS_ID,"embed")}}class config_Encrypt extends Option01{constructor(attributes){super(CONFIG_NS_ID,"encrypt")}}class config_Encryption extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"encryption",!0),this.encrypt=null,this.encryptionLevel=null,this.permissions=null}}class EncryptionLevel extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"encryptionLevel",["40bit","128bit"])}}class Enforce extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"enforce")}}class Equate extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"equate"),this.force=getInteger({data:attributes.force,defaultValue:1,validate:n=>0===n}),this.from=attributes.from||"",this.to=attributes.to||""}}class EquateRange extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"equateRange"),this.from=attributes.from||"",this.to=attributes.to||"",this._unicodeRange=attributes.unicodeRange||""}get unicodeRange(){var range,ranges=[],unicodeRegex=/U\+([0-9a-fA-F]+)/;for(range of this._unicodeRange.split(",").map(x=>x.trim()).filter(x=>!!x))1===(range=range.split("-",2).map(x=>{x=x.match(unicodeRegex);return x?parseInt(x[1],16):0})).length&&range.push(range[0]),ranges.push(range);return shadow(this,"unicodeRange",ranges)}}class Exclude extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"exclude")}[$finalize](){this[$content]=this[$content].trim().split(/\s+/).filter(x=>x&&["calculate","close","enter","exit","initialize","ready","validate"].includes(x))}}class ExcludeNS extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"excludeNS")}}class FlipLabel extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"flipLabel",["usePrinterSetting","on","off"])}}class config_FontInfo extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"formFieldFilling")}}class GroupParent extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"groupParent")}}class IfEmpty extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"includeXDPContent")}}class IncrementalLoad extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends Option01{constructor(attributes){super(CONFIG_NS_ID,"incrementalMerge")}}class Interactive extends Option01{constructor(attributes){super(CONFIG_NS_ID,"interactive")}}class Jog extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"labelPrinter",!0),this.name=getStringOption(attributes.name,["zpl","dpl","ipl","tcpl"]),this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}}class Layout extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"layout",["paginate","panel"])}}class Level extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"level",0,n=>0<n)}}class Linearized extends Option01{constructor(attributes){super(CONFIG_NS_ID,"linearized")}}class Locale extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"locale")}}class LocaleSet extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"localeSet")}}class Log extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"log",!0),this.mode=null,this.threshold=null,this.to=null,this.uri=null}}class MapElement extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"map",!0),this.equate=new XFAObjectArray,this.equateRange=new XFAObjectArray}}class MediumInfo extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"mediumInfo",!0),this.map=null}}class config_Message extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"message",!0),this.msgId=null,this.severity=null}}class Messaging extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"messaging",!0),this.message=new XFAObjectArray}}class Mode extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"mode",["append","overwrite"])}}class ModifyAnnots extends Option01{constructor(attributes){super(CONFIG_NS_ID,"modifyAnnots")}}class MsgId extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"msgId",1,n=>1<=n)}}class NameAttr extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"nameAttr")}}class NeverEmbed extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"neverEmbed")}}class NumberOfCopies extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"numberOfCopies",null,n=>2<=n&&n<=5)}}class OpenAction extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"openAction",!0),this.destination=null}}class Output extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"output",!0),this.to=null,this.type=null,this.uri=null}}class OutputBin extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"outputBin")}}class OutputXSL extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"outputXSL",!0),this.uri=null}}class Overprint extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"overprint",["none","both","draw","field"])}}class Packets extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"packets")}[$finalize](){"*"!==this[$content]&&(this[$content]=this[$content].trim().split(/\s+/).filter(x=>["config","datasets","template","xfdf","xslt"].includes(x)))}}class PageOffset extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"pageOffset"),this.x=getInteger({data:attributes.x,defaultValue:"useXDCSetting",validate:n=>!0}),this.y=getInteger({data:attributes.y,defaultValue:"useXDCSetting",validate:n=>!0})}}class PageRange extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"pageRange")}[$finalize](){for(var numbers=this[$content].trim().split(/\s+/).map(x=>parseInt(x,10)),ranges=[],i=0,ii=numbers.length;i<ii;i+=2)ranges.push(numbers.slice(i,i+2));this[$content]=ranges}}class Pagination extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"part",1,n=>!1)}}class Pcl extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"pcl",!0),this.name=attributes.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(attributes){super(CONFIG_NS_ID,"pdf",!0),this.name=attributes.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(attributes){super(CONFIG_NS_ID,"pdfa",!0),this.amd=null,this.conformance=null,this.includeXDPContent=null,this.part=null}}class Permissions extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"pickTrayByPDFSize")}}class config_Picture extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"picture")}}class PlaintextMetadata extends Option01{constructor(attributes){super(CONFIG_NS_ID,"plaintextMetadata")}}class Presence extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"print")}}class PrintHighQuality extends Option01{constructor(attributes){super(CONFIG_NS_ID,"printHighQuality")}}class PrintScaling extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"printScaling",["appdefault","noScaling"])}}class PrinterName extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"printerName")}}class Producer extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"producer")}}class Ps extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"ps",!0),this.name=attributes.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(attributes){super(CONFIG_NS_ID,"range")}[$finalize](){this[$content]=this[$content].split(",",2).map(range=>range.split("-").map(x=>parseInt(x.trim(),10))).filter(range=>range.every(x=>!isNaN(x))).map(range=>(1===range.length&&range.push(range[0]),range))}}class Record extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"record")}[$finalize](){this[$content]=this[$content].trim();var n=parseInt(this[$content],10);!isNaN(n)&&0<=n&&(this[$content]=n)}}class Relevant extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"relevant")}[$finalize](){this[$content]=this[$content].trim().split(/\s+/)}}class Rename extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"rename")}[$finalize](){this[$content]=this[$content].trim(),(this[$content].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[$content]))&&warn("XFA - Rename: invalid XFA name")}}class RenderPolicy extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"renderPolicy",["server","client"])}}class RunScripts extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"runScripts",["both","client","none","server"])}}class config_Script extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"script",!0),this.currentPage=null,this.exclude=null,this.runScripts=null}}class ScriptModel extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"scriptModel",["XFA","none"])}}class Severity extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"silentPrint",!0),this.addSilentPrint=null,this.printerName=null}}class Staple extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"staple"),this.mode=getStringOption(attributes.mode,["usePrinterSetting","on","off"])}}class StartNode extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"startNode")}}class StartPage extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"startPage",0,n=>!0)}}class SubmitFormat extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"submitUrl")}}class SubsetBelow extends IntegerObject{constructor(attributes){super(CONFIG_NS_ID,"subsetBelow",100,n=>0<=n&&n<=100)}}class SuppressBanner extends Option01{constructor(attributes){super(CONFIG_NS_ID,"suppressBanner")}}class Tagged extends Option01{constructor(attributes){super(CONFIG_NS_ID,"tagged")}}class config_Template extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"template",!0),this.base=null,this.relevant=null,this.startPage=null,this.uri=null,this.xsl=null}}class Threshold extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"threshold",["trace","error","information","warning"])}}class To extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"templateCache"),this.maxEntries=getInteger({data:attributes.maxEntries,defaultValue:5,validate:n=>0<=n})}}class Trace extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"trace",!0),this.area=new XFAObjectArray}}class Transform extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends StringObject{constructor(attributes){super(CONFIG_NS_ID,"uri")}}class config_Validate extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"validateApprovalSignatures")}[$finalize](){this[$content]=this[$content].trim().split(/\s+/).filter(x=>["docReady","postSign"].includes(x))}}class ValidationMessaging extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"VersionControl"),this.outputBelow=getStringOption(attributes.outputBelow,["warn","error","update"]),this.sourceAbove=getStringOption(attributes.sourceAbove,["warn","error"]),this.sourceBelow=getStringOption(attributes.sourceBelow,["update","maintain"])}}class ViewerPreferences extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"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(attributes){super(CONFIG_NS_ID,"webClient",!0),this.name=attributes.name?attributes.name.trim():"",this.fontInfo=null,this.xdc=null}}class Whitespace extends OptionObject{constructor(attributes){super(CONFIG_NS_ID,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends ContentObject{constructor(attributes){super(CONFIG_NS_ID,"window")}[$finalize](){var pair=this[$content].split(",",2).map(x=>parseInt(x.trim(),10));pair.some(x=>isNaN(x))?this[$content]=[0,0]:(1===pair.length&&pair.push(pair[0]),this[$content]=pair)}}class Xdc extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"xdc",!0),this.uri=new XFAObjectArray,this.xsl=new XFAObjectArray}}class Xdp extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"xdp",!0),this.packets=null}}class Xsl extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"xsl",!0),this.debug=null,this.uri=null}}class Zpl extends XFAObject{constructor(attributes){super(CONFIG_NS_ID,"zpl",!0),this.name=attributes.name?attributes.name.trim():"",this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}}class ConfigNamespace{static[$buildXFAObject](name,attributes){if(ConfigNamespace.hasOwnProperty(name))return ConfigNamespace[name](attributes)}static acrobat(attrs){return new Acrobat(attrs)}static acrobat7(attrs){return new Acrobat7(attrs)}static ADBE_JSConsole(attrs){return new ADBE_JSConsole(attrs)}static ADBE_JSDebugger(attrs){return new ADBE_JSDebugger(attrs)}static addSilentPrint(attrs){return new AddSilentPrint(attrs)}static addViewerPreferences(attrs){return new AddViewerPreferences(attrs)}static adjustData(attrs){return new AdjustData(attrs)}static adobeExtensionLevel(attrs){return new AdobeExtensionLevel(attrs)}static agent(attrs){return new Agent(attrs)}static alwaysEmbed(attrs){return new AlwaysEmbed(attrs)}static amd(attrs){return new Amd(attrs)}static area(attrs){return new config_Area(attrs)}static attributes(attrs){return new Attributes(attrs)}static autoSave(attrs){return new AutoSave(attrs)}static base(attrs){return new Base(attrs)}static batchOutput(attrs){return new BatchOutput(attrs)}static behaviorOverride(attrs){return new BehaviorOverride(attrs)}static cache(attrs){return new Cache(attrs)}static change(attrs){return new Change(attrs)}static common(attrs){return new Common(attrs)}static compress(attrs){return new Compress(attrs)}static compressLogicalStructure(attrs){return new CompressLogicalStructure(attrs)}static compressObjectStream(attrs){return new CompressObjectStream(attrs)}static compression(attrs){return new Compression(attrs)}static config(attrs){return new Config(attrs)}static conformance(attrs){return new Conformance(attrs)}static contentCopy(attrs){return new ContentCopy(attrs)}static copies(attrs){return new Copies(attrs)}static creator(attrs){return new Creator(attrs)}static currentPage(attrs){return new CurrentPage(attrs)}static data(attrs){return new Data(attrs)}static debug(attrs){return new Debug(attrs)}static defaultTypeface(attrs){return new DefaultTypeface(attrs)}static destination(attrs){return new Destination(attrs)}static documentAssembly(attrs){return new DocumentAssembly(attrs)}static driver(attrs){return new Driver(attrs)}static duplexOption(attrs){return new DuplexOption(attrs)}static dynamicRender(attrs){return new DynamicRender(attrs)}static embed(attrs){return new Embed(attrs)}static encrypt(attrs){return new config_Encrypt(attrs)}static encryption(attrs){return new config_Encryption(attrs)}static encryptionLevel(attrs){return new EncryptionLevel(attrs)}static enforce(attrs){return new Enforce(attrs)}static equate(attrs){return new Equate(attrs)}static equateRange(attrs){return new EquateRange(attrs)}static exclude(attrs){return new Exclude(attrs)}static excludeNS(attrs){return new ExcludeNS(attrs)}static flipLabel(attrs){return new FlipLabel(attrs)}static fontInfo(attrs){return new config_FontInfo(attrs)}static formFieldFilling(attrs){return new FormFieldFilling(attrs)}static groupParent(attrs){return new GroupParent(attrs)}static ifEmpty(attrs){return new IfEmpty(attrs)}static includeXDPContent(attrs){return new IncludeXDPContent(attrs)}static incrementalLoad(attrs){return new IncrementalLoad(attrs)}static incrementalMerge(attrs){return new IncrementalMerge(attrs)}static interactive(attrs){return new Interactive(attrs)}static jog(attrs){return new Jog(attrs)}static labelPrinter(attrs){return new LabelPrinter(attrs)}static layout(attrs){return new Layout(attrs)}static level(attrs){return new Level(attrs)}static linearized(attrs){return new Linearized(attrs)}static locale(attrs){return new Locale(attrs)}static localeSet(attrs){return new LocaleSet(attrs)}static log(attrs){return new Log(attrs)}static map(attrs){return new MapElement(attrs)}static mediumInfo(attrs){return new MediumInfo(attrs)}static message(attrs){return new config_Message(attrs)}static messaging(attrs){return new Messaging(attrs)}static mode(attrs){return new Mode(attrs)}static modifyAnnots(attrs){return new ModifyAnnots(attrs)}static msgId(attrs){return new MsgId(attrs)}static nameAttr(attrs){return new NameAttr(attrs)}static neverEmbed(attrs){return new NeverEmbed(attrs)}static numberOfCopies(attrs){return new NumberOfCopies(attrs)}static openAction(attrs){return new OpenAction(attrs)}static output(attrs){return new Output(attrs)}static outputBin(attrs){return new OutputBin(attrs)}static outputXSL(attrs){return new OutputXSL(attrs)}static overprint(attrs){return new Overprint(attrs)}static packets(attrs){return new Packets(attrs)}static pageOffset(attrs){return new PageOffset(attrs)}static pageRange(attrs){return new PageRange(attrs)}static pagination(attrs){return new Pagination(attrs)}static paginationOverride(attrs){return new PaginationOverride(attrs)}static part(attrs){return new Part(attrs)}static pcl(attrs){return new Pcl(attrs)}static pdf(attrs){return new Pdf(attrs)}static pdfa(attrs){return new Pdfa(attrs)}static permissions(attrs){return new Permissions(attrs)}static pickTrayByPDFSize(attrs){return new PickTrayByPDFSize(attrs)}static picture(attrs){return new config_Picture(attrs)}static plaintextMetadata(attrs){return new PlaintextMetadata(attrs)}static presence(attrs){return new Presence(attrs)}static present(attrs){return new Present(attrs)}static print(attrs){return new Print(attrs)}static printHighQuality(attrs){return new PrintHighQuality(attrs)}static printScaling(attrs){return new PrintScaling(attrs)}static printerName(attrs){return new PrinterName(attrs)}static producer(attrs){return new Producer(attrs)}static ps(attrs){return new Ps(attrs)}static range(attrs){return new Range(attrs)}static record(attrs){return new Record(attrs)}static relevant(attrs){return new Relevant(attrs)}static rename(attrs){return new Rename(attrs)}static renderPolicy(attrs){return new RenderPolicy(attrs)}static runScripts(attrs){return new RunScripts(attrs)}static script(attrs){return new config_Script(attrs)}static scriptModel(attrs){return new ScriptModel(attrs)}static severity(attrs){return new Severity(attrs)}static silentPrint(attrs){return new SilentPrint(attrs)}static staple(attrs){return new Staple(attrs)}static startNode(attrs){return new StartNode(attrs)}static startPage(attrs){return new StartPage(attrs)}static submitFormat(attrs){return new SubmitFormat(attrs)}static submitUrl(attrs){return new SubmitUrl(attrs)}static subsetBelow(attrs){return new SubsetBelow(attrs)}static suppressBanner(attrs){return new SuppressBanner(attrs)}static tagged(attrs){return new Tagged(attrs)}static template(attrs){return new config_Template(attrs)}static templateCache(attrs){return new TemplateCache(attrs)}static threshold(attrs){return new Threshold(attrs)}static to(attrs){return new To(attrs)}static trace(attrs){return new Trace(attrs)}static transform(attrs){return new Transform(attrs)}static type(attrs){return new Type(attrs)}static uri(attrs){return new Uri(attrs)}static validate(attrs){return new config_Validate(attrs)}static validateApprovalSignatures(attrs){return new ValidateApprovalSignatures(attrs)}static validationMessaging(attrs){return new ValidationMessaging(attrs)}static version(attrs){return new Version(attrs)}static versionControl(attrs){return new VersionControl(attrs)}static viewerPreferences(attrs){return new ViewerPreferences(attrs)}static webClient(attrs){return new WebClient(attrs)}static whitespace(attrs){return new Whitespace(attrs)}static window(attrs){return new Window(attrs)}static xdc(attrs){return new Xdc(attrs)}static xdp(attrs){return new Xdp(attrs)}static xsl(attrs){return new Xsl(attrs)}static zpl(attrs){return new Zpl(attrs)}}var CONNECTION_SET_NS_ID=NamespaceIds.connectionSet.id;class ConnectionSet extends XFAObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"connectionSet",!0),this.wsdlConnection=new XFAObjectArray,this.xmlConnection=new XFAObjectArray,this.xsdConnection=new XFAObjectArray}}class EffectiveInputPolicy extends XFAObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"effectiveInputPolicy"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class EffectiveOutputPolicy extends XFAObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"effectiveOutputPolicy"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class Operation extends StringObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"operation"),this.id=attributes.id||"",this.input=attributes.input||"",this.name=attributes.name||"",this.output=attributes.output||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class RootElement extends StringObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"rootElement"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class SoapAction extends StringObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"soapAction"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class SoapAddress extends StringObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"soapAddress"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class connection_set_Uri extends StringObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"uri"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class WsdlAddress extends StringObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"wsdlAddress"),this.id=attributes.id||"",this.name=attributes.name||"",this.use=attributes.use||"",this.usehref=attributes.usehref||""}}class WsdlConnection extends XFAObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"wsdlConnection",!0),this.dataDescription=attributes.dataDescription||"",this.name=attributes.name||"",this.effectiveInputPolicy=null,this.effectiveOutputPolicy=null,this.operation=null,this.soapAction=null,this.soapAddress=null,this.wsdlAddress=null}}class XmlConnection extends XFAObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"xmlConnection",!0),this.dataDescription=attributes.dataDescription||"",this.name=attributes.name||"",this.uri=null}}class XsdConnection extends XFAObject{constructor(attributes){super(CONNECTION_SET_NS_ID,"xsdConnection",!0),this.dataDescription=attributes.dataDescription||"",this.name=attributes.name||"",this.rootElement=null,this.uri=null}}class ConnectionSetNamespace{static[$buildXFAObject](name,attributes){if(ConnectionSetNamespace.hasOwnProperty(name))return ConnectionSetNamespace[name](attributes)}static connectionSet(attrs){return new ConnectionSet(attrs)}static effectiveInputPolicy(attrs){return new EffectiveInputPolicy(attrs)}static effectiveOutputPolicy(attrs){return new EffectiveOutputPolicy(attrs)}static operation(attrs){return new Operation(attrs)}static rootElement(attrs){return new RootElement(attrs)}static soapAction(attrs){return new SoapAction(attrs)}static soapAddress(attrs){return new SoapAddress(attrs)}static uri(attrs){return new connection_set_Uri(attrs)}static wsdlAddress(attrs){return new WsdlAddress(attrs)}static wsdlConnection(attrs){return new WsdlConnection(attrs)}static xmlConnection(attrs){return new XmlConnection(attrs)}static xsdConnection(attrs){return new XsdConnection(attrs)}}var DATASETS_NS_ID=NamespaceIds.datasets.id;class datasets_Data extends XmlObject{constructor(attributes){super(DATASETS_NS_ID,"data",attributes)}[$isNsAgnostic](){return!0}}class Datasets extends XFAObject{constructor(attributes){super(DATASETS_NS_ID,"datasets",!0),this.data=null,this.Signature=null}[$onChild](child){var name=child[$nodeName];("data"===name&&child[$namespaceId]===DATASETS_NS_ID||"Signature"===name&&child[$namespaceId]===NamespaceIds.signature.id)&&(this[name]=child),this[$appendChild](child)}}class DatasetsNamespace{static[$buildXFAObject](name,attributes){if(DatasetsNamespace.hasOwnProperty(name))return DatasetsNamespace[name](attributes)}static datasets(attributes){return new Datasets(attributes)}static data(attributes){return new datasets_Data(attributes)}}var LOCALE_SET_NS_ID=NamespaceIds.localeSet.id;class CalendarSymbols extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"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(attributes){super(LOCALE_SET_NS_ID,"currencySymbol"),this.name=getStringOption(attributes.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"currencySymbols",!0),this.currencySymbol=new XFAObjectArray(3)}}class DatePattern extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"datePattern"),this.name=getStringOption(attributes.name,["full","long","med","short"])}}class DatePatterns extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"datePatterns",!0),this.datePattern=new XFAObjectArray(4)}}class DateTimeSymbols extends ContentObject{constructor(attributes){super(LOCALE_SET_NS_ID,"dateTimeSymbols")}}class Day extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"day")}}class DayNames extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"dayNames",!0),this.abbr=getInteger({data:attributes.abbr,defaultValue:0,validate:x=>1===x}),this.day=new XFAObjectArray(7)}}class Era extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"era")}}class EraNames extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"eraNames",!0),this.era=new XFAObjectArray(2)}}class locale_set_Locale extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"locale",!0),this.desc=attributes.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(attributes){super(LOCALE_SET_NS_ID,"localeSet",!0),this.locale=new XFAObjectArray}}class Meridiem extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"meridiem")}}class MeridiemNames extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"meridiemNames",!0),this.meridiem=new XFAObjectArray(2)}}class Month extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"month")}}class MonthNames extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"monthNames",!0),this.abbr=getInteger({data:attributes.abbr,defaultValue:0,validate:x=>1===x}),this.month=new XFAObjectArray(12)}}class NumberPattern extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"numberPattern"),this.name=getStringOption(attributes.name,["full","long","med","short"])}}class NumberPatterns extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"numberPatterns",!0),this.numberPattern=new XFAObjectArray(4)}}class NumberSymbol extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"numberSymbol"),this.name=getStringOption(attributes.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"numberSymbols",!0),this.numberSymbol=new XFAObjectArray(5)}}class TimePattern extends StringObject{constructor(attributes){super(LOCALE_SET_NS_ID,"timePattern"),this.name=getStringOption(attributes.name,["full","long","med","short"])}}class TimePatterns extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"timePatterns",!0),this.timePattern=new XFAObjectArray(4)}}class TypeFace extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"typeFace",!0),this.name=""|attributes.name}}class TypeFaces extends XFAObject{constructor(attributes){super(LOCALE_SET_NS_ID,"typeFaces",!0),this.typeFace=new XFAObjectArray}}class LocaleSetNamespace{static[$buildXFAObject](name,attributes){if(LocaleSetNamespace.hasOwnProperty(name))return LocaleSetNamespace[name](attributes)}static calendarSymbols(attrs){return new CalendarSymbols(attrs)}static currencySymbol(attrs){return new CurrencySymbol(attrs)}static currencySymbols(attrs){return new CurrencySymbols(attrs)}static datePattern(attrs){return new DatePattern(attrs)}static datePatterns(attrs){return new DatePatterns(attrs)}static dateTimeSymbols(attrs){return new DateTimeSymbols(attrs)}static day(attrs){return new Day(attrs)}static dayNames(attrs){return new DayNames(attrs)}static era(attrs){return new Era(attrs)}static eraNames(attrs){return new EraNames(attrs)}static locale(attrs){return new locale_set_Locale(attrs)}static localeSet(attrs){return new locale_set_LocaleSet(attrs)}static meridiem(attrs){return new Meridiem(attrs)}static meridiemNames(attrs){return new MeridiemNames(attrs)}static month(attrs){return new Month(attrs)}static monthNames(attrs){return new MonthNames(attrs)}static numberPattern(attrs){return new NumberPattern(attrs)}static numberPatterns(attrs){return new NumberPatterns(attrs)}static numberSymbol(attrs){return new NumberSymbol(attrs)}static numberSymbols(attrs){return new NumberSymbols(attrs)}static timePattern(attrs){return new TimePattern(attrs)}static timePatterns(attrs){return new TimePatterns(attrs)}static typeFace(attrs){return new TypeFace(attrs)}static typeFaces(attrs){return new TypeFaces(attrs)}}var SIGNATURE_NS_ID=NamespaceIds.signature.id;class signature_Signature extends XFAObject{constructor(attributes){super(SIGNATURE_NS_ID,"signature",!0)}}class SignatureNamespace{static[$buildXFAObject](name,attributes){if(SignatureNamespace.hasOwnProperty(name))return SignatureNamespace[name](attributes)}static signature(attributes){return new signature_Signature(attributes)}}var STYLESHEET_NS_ID=NamespaceIds.stylesheet.id;class Stylesheet extends XFAObject{constructor(attributes){super(STYLESHEET_NS_ID,"stylesheet",!0)}}class StylesheetNamespace{static[$buildXFAObject](name,attributes){if(StylesheetNamespace.hasOwnProperty(name))return StylesheetNamespace[name](attributes)}static stylesheet(attributes){return new Stylesheet(attributes)}}var XDP_NS_ID=NamespaceIds.xdp.id;class xdp_Xdp extends XFAObject{constructor(attributes){super(XDP_NS_ID,"xdp",!0),this.uuid=attributes.uuid||"",this.timeStamp=attributes.timeStamp||"",this.config=null,this.connectionSet=null,this.datasets=null,this.localeSet=null,this.stylesheet=new XFAObjectArray,this.template=null}[$onChildCheck](child){var ns=NamespaceIds[child[$nodeName]];return ns&&child[$namespaceId]===ns.id}}class XdpNamespace{static[$buildXFAObject](name,attributes){if(XdpNamespace.hasOwnProperty(name))return XdpNamespace[name](attributes)}static xdp(attributes){return new xdp_Xdp(attributes)}}var XHTML_NS_ID=NamespaceIds.xhtml.id,$richText=Symbol(),VALID_STYLES=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"]),StyleMapping=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",value=>"none"===value?"none":"normal"],["xfa-font-horizontal-scale",value=>"scaleX(".concat(Math.max(0,parseInt(value)/100).toFixed(2),")")],["xfa-font-vertical-scale",value=>"scaleY(".concat(Math.max(0,parseInt(value)/100).toFixed(2),")")],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(value,original)=>measureToString(.99*(value=original.fontSize=Math.abs(getMeasurement(value))))],["letter-spacing",value=>measureToString(getMeasurement(value))],["line-height",value=>measureToString(getMeasurement(value))],["margin",value=>measureToString(getMeasurement(value))],["margin-bottom",value=>measureToString(getMeasurement(value))],["margin-left",value=>measureToString(getMeasurement(value))],["margin-right",value=>measureToString(getMeasurement(value))],["margin-top",value=>measureToString(getMeasurement(value))],["text-indent",value=>measureToString(getMeasurement(value))],["font-family",value=>value],["vertical-align",value=>measureToString(getMeasurement(value))]]),spacesRegExp=/\s+/g,crlfRegExp=/[\r\n]+/g,crlfForRichTextRegExp=/\r\n?/g;function mapStyle(styleStr,node,richText){var style=Object.create(null);if(styleStr){var key,value,original=Object.create(null);for([key,value]of styleStr.split(";").map(s=>s.split(":",2))){var newValue,mapping=StyleMapping.get(key);""!==mapping&&(newValue=value,mapping&&(newValue="string"==typeof mapping?mapping:mapping(value,original)),key.endsWith("scale")?style.transform=style.transform?"".concat(style[key]," ").concat(newValue):newValue:style[key.replaceAll(/-([a-zA-Z])/g,(_,x)=>x.toUpperCase())]=newValue)}style.fontFamily&&setFontFamily({typeface:style.fontFamily,weight:style.fontWeight||"normal",posture:style.fontStyle||"normal",size:original.fontSize||0},node,node[$globalData].fontFinder,style),richText&&style.verticalAlign&&"0px"!==style.verticalAlign&&style.fontSize&&(styleStr=getMeasurement(style.fontSize),style.fontSize=measureToString(.583*styleStr),style.verticalAlign=measureToString(Math.sign(getMeasurement(style.verticalAlign))*styleStr*.333)),richText&&style.fontSize&&(style.fontSize="calc(".concat(style.fontSize," * var(--total-scale-factor))")),fixTextIndent(style)}return style}function checkStyle(node){return node.style?node.style.split(";").filter(s=>!!s.trim()).map(s=>s.split(":",2).map(t=>t.trim())).filter(_ref63=>{var[_ref63,value]=_ref63;return"font-family"===_ref63&&node[$globalData].usedTypefaces.add(value),VALID_STYLES.has(_ref63)}).map(kv=>kv.join(":")).join(";"):""}var NoWhites=new Set(["body","html"]);class XhtmlObject extends XmlObject{constructor(attributes,name){super(XHTML_NS_ID,name),this[$richText]=!1,this.style=attributes.style||""}[$clean](builder){super[$clean](builder),this.style=checkStyle(this)}[$acceptWhitespace](){return!NoWhites.has(this[$nodeName])}[$onText](str){1<arguments.length&&void 0!==arguments[1]&&arguments[1]?this[$richText]=!0:(str=str.replaceAll(crlfRegExp,""),this.style.includes("xfa-spacerun:yes")||(str=str.replaceAll(spacesRegExp," "))),str&&(this[$content]+=str)}[$pushGlyphs](measure){var key,value,mustPop=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],xfaFont=Object.create(null),margin={top:NaN,bottom:NaN,left:NaN,right:NaN},lineHeight=null;for([key,value]of this.style.split(";").map(s=>s.split(":",2)))switch(key){case"font-family":xfaFont.typeface=stripQuotes(value);break;case"font-size":xfaFont.size=getMeasurement(value);break;case"font-weight":xfaFont.weight=value;break;case"font-style":xfaFont.posture=value;break;case"letter-spacing":xfaFont.letterSpacing=getMeasurement(value);break;case"margin":var values=value.split(/ \t/).map(x=>getMeasurement(x));switch(values.length){case 1:margin.top=margin.bottom=margin.left=margin.right=values[0];break;case 2:margin.top=margin.bottom=values[0],margin.left=margin.right=values[1];break;case 3:margin.top=values[0],margin.bottom=values[2],margin.left=margin.right=values[1];break;case 4:margin.top=values[0],margin.left=values[1],margin.bottom=values[2],margin.right=values[3]}break;case"margin-top":margin.top=getMeasurement(value);break;case"margin-bottom":margin.bottom=getMeasurement(value);break;case"margin-left":margin.left=getMeasurement(value);break;case"margin-right":margin.right=getMeasurement(value);break;case"line-height":lineHeight=getMeasurement(value)}if(measure.pushData(xfaFont,margin,lineHeight),this[$content])measure.addString(this[$content]);else for(var child of this[$getChildren]())"#text"===child[$nodeName]?measure.addString(child[$content]):child[$pushGlyphs](measure);mustPop&&measure.popFont()}[$toHTML](availableSpace){var value,children=[];return this[$extra]={children:children},this[$childrenToHTML]({}),0!==children.length||this[$content]?(value=this[$richText]?this[$content]?this[$content].replaceAll(crlfForRichTextRegExp,"\n"):void 0:this[$content]||void 0,HTMLResult.success({name:this[$nodeName],attributes:{href:this.href,style:mapStyle(this.style,this,this[$richText])},children:children,value:value})):HTMLResult.EMPTY}}class A extends XhtmlObject{constructor(attributes){super(attributes,"a"),this.href=fixURL(attributes.href)||""}}class B extends XhtmlObject{constructor(attributes){super(attributes,"b")}[$pushGlyphs](measure){measure.pushFont({weight:"bold"}),super[$pushGlyphs](measure),measure.popFont()}}class Body extends XhtmlObject{constructor(attributes){super(attributes,"body")}[$toHTML](availableSpace){var availableSpace=super[$toHTML](availableSpace),html=availableSpace["html"];return html?(html.name="div",html.attributes.class=["xfaRich"],availableSpace):HTMLResult.EMPTY}}class Br extends XhtmlObject{constructor(attributes){super(attributes,"br")}[$text](){return"\n"}[$pushGlyphs](measure){measure.addString("\n")}[$toHTML](availableSpace){return HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(attributes){super(attributes,"html")}[$toHTML](availableSpace){var children=[];if(this[$extra]={children:children},this[$childrenToHTML]({}),0===children.length)return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[$content]||""});if(1===children.length){var _child$attributes,child=children[0];if(null!=(_child$attributes=child.attributes)&&_child$attributes.class.includes("xfaRich"))return HTMLResult.success(child)}return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:children})}}class I extends XhtmlObject{constructor(attributes){super(attributes,"i")}[$pushGlyphs](measure){measure.pushFont({posture:"italic"}),super[$pushGlyphs](measure),measure.popFont()}}class Li extends XhtmlObject{constructor(attributes){super(attributes,"li")}}class Ol extends XhtmlObject{constructor(attributes){super(attributes,"ol")}}class P extends XhtmlObject{constructor(attributes){super(attributes,"p")}[$pushGlyphs](measure){super[$pushGlyphs](measure,!1),measure.addString("\n"),measure.addPara(),measure.popFont()}[$text](){return this[$getParent]()[$getChildren]().at(-1)===this?super[$text]():super[$text]()+"\n"}}class Span extends XhtmlObject{constructor(attributes){super(attributes,"span")}}class Sub extends XhtmlObject{constructor(attributes){super(attributes,"sub")}}class Sup extends XhtmlObject{constructor(attributes){super(attributes,"sup")}}class Ul extends XhtmlObject{constructor(attributes){super(attributes,"ul")}}class XhtmlNamespace{static[$buildXFAObject](name,attributes){if(XhtmlNamespace.hasOwnProperty(name))return XhtmlNamespace[name](attributes)}static a(attributes){return new A(attributes)}static b(attributes){return new B(attributes)}static body(attributes){return new Body(attributes)}static br(attributes){return new Br(attributes)}static html(attributes){return new Html(attributes)}static i(attributes){return new I(attributes)}static li(attributes){return new Li(attributes)}static ol(attributes){return new Ol(attributes)}static p(attributes){return new P(attributes)}static span(attributes){return new Span(attributes)}static sub(attributes){return new Sub(attributes)}static sup(attributes){return new Sup(attributes)}static ul(attributes){return new Ul(attributes)}}var NamespaceSetUp={config:ConfigNamespace,connection:ConnectionSetNamespace,datasets:DatasetsNamespace,localeSet:LocaleSetNamespace,signature:SignatureNamespace,stylesheet:StylesheetNamespace,template:TemplateNamespace,xdp:XdpNamespace,xhtml:XhtmlNamespace};class UnknownNamespace{constructor(nsId){this.namespaceId=nsId}[$buildXFAObject](name,attributes){return new XmlObject(this.namespaceId,name,attributes)}}class Root extends XFAObject{constructor(ids){super(-1,"root",Object.create(null)),this.element=null,this[$ids]=ids}[$onChild](child){return this.element=child,!0}[$finalize](){super[$finalize](),this.element.template instanceof Template&&(this[$ids].set($root,this.element),this.element.template[$resolvePrototypes](this[$ids]),this.element.template[$ids]=this[$ids])}}class Empty extends XFAObject{constructor(){super(-1,"",Object.create(null))}[$onChild](_){return!1}}class Builder{constructor(){var rootNameSpace=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;this._namespaceStack=[],this._nsAgnosticLevel=0,this._namespacePrefixes=new Map,this._namespaces=new Map,this._nextNsId=Math.max(...Object.values(NamespaceIds).map(_ref64=>{_ref64=_ref64.id;return _ref64})),this._currentNamespace=rootNameSpace||new UnknownNamespace(++this._nextNsId)}buildRoot(ids){return new Root(ids)}build(_ref65){var{nsPrefix:_ref65,name,attributes,namespace,prefixes}=_ref65,hasNamespaceDef=null!==namespace;if(hasNamespaceDef&&(this._namespaceStack.push(this._currentNamespace),this._currentNamespace=this._searchNamespace(namespace)),prefixes&&this._addNamespacePrefix(prefixes),attributes.hasOwnProperty($nsAttributes)){var ns,attrs,dataTemplate=NamespaceSetUp.datasets,namespace=attributes[$nsAttributes],xfaAttrs=null;for([ns,attrs]of Object.entries(namespace))if(this._getNamespaceToUse(ns)===dataTemplate){xfaAttrs={xfa:attrs};break}xfaAttrs?attributes[$nsAttributes]=xfaAttrs:delete attributes[$nsAttributes]}namespace=this._getNamespaceToUse(_ref65),_ref65=(null==namespace?void 0:namespace[$buildXFAObject](name,attributes))||new Empty;return _ref65[$isNsAgnostic]()&&this._nsAgnosticLevel++,(hasNamespaceDef||prefixes||_ref65[$isNsAgnostic]())&&(_ref65[$cleanup]={hasNamespace:hasNamespaceDef,prefixes:prefixes,nsAgnostic:_ref65[$isNsAgnostic]()}),_ref65}isNsAgnostic(){return 0<this._nsAgnosticLevel}_searchNamespace(nsName){var ns=this._namespaces.get(nsName);if(!ns){for(var[name,{check}]of Object.entries(NamespaceIds))if(check(nsName)){if(ns=NamespaceSetUp[name])return this._namespaces.set(nsName,ns),ns;break}ns=new UnknownNamespace(++this._nextNsId),this._namespaces.set(nsName,ns)}return ns}_addNamespacePrefix(prefixes){for(var{prefix,value}of prefixes){var value=this._searchNamespace(value),prefixStack=this._namespacePrefixes.get(prefix);prefixStack||this._namespacePrefixes.set(prefix,prefixStack=[]),prefixStack.push(value)}}_getNamespaceToUse(prefix){var prefixStack;return prefix?0<(null==(prefixStack=this._namespacePrefixes.get(prefix))?void 0:prefixStack.length)?prefixStack.at(-1):(warn("Unknown namespace prefix: ".concat(prefix,".")),null):this._currentNamespace}clean(data){var{hasNamespace:data,prefixes,nsAgnostic}=data;data&&(this._currentNamespace=this._namespaceStack.pop()),prefixes&&prefixes.forEach(_ref66=>{_ref66=_ref66.prefix;this._namespacePrefixes.get(_ref66).pop()}),nsAgnostic&&this._nsAgnosticLevel--}}class XFAParser extends XMLParserBase{constructor(){var rootNameSpace=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,richText=1<arguments.length&&void 0!==arguments[1]&&arguments[1];super(),this._builder=new Builder(rootNameSpace),this._stack=[],this._globalData={usedTypefaces:new Set},this._ids=new Map,this._current=this._builder.buildRoot(this._ids),this._errorCode=XMLParserErrorCode.NoError,this._whiteRegex=/^\s+$/,this._nbsps=/\xa0+/g,this._richText=richText}parse(data){if(this.parseXml(data),this._errorCode===XMLParserErrorCode.NoError)return this._current[$finalize](),this._current.element}onText(text){text=text.replace(this._nbsps,match=>match.slice(1)+" "),this._richText||this._current[$acceptWhitespace]()?this._current[$onText](text,this._richText):this._whiteRegex.test(text)||this._current[$onText](text.trim())}onCdata(text){this._current[$onText](text)}_mkAttributes(attributes,tagName){var name,value,prefix,_attributeObj$$nsAttr,ns,attrName,namespace=null,prefixes=null,attributeObj=Object.create({});for({name,value}of attributes)"xmlns"===name?namespace?warn("XFA - multiple namespace definition in <".concat(tagName,">")):namespace=value:name.startsWith("xmlns:")?(prefix=name.substring("xmlns:".length),(prefixes=null!=prefixes?prefixes:[]).push({prefix:prefix,value:value})):-1===(prefix=name.indexOf(":"))?attributeObj[name]=value:(_attributeObj$$nsAttr=null!=(_attributeObj$$nsAttr=attributeObj[$nsAttributes])?_attributeObj$$nsAttr:attributeObj[$nsAttributes]=Object.create(null),[ns,attrName]=[name.slice(0,prefix),name.slice(prefix+1)],(_attributeObj$$nsAttr[ns]||(_attributeObj$$nsAttr[ns]=Object.create(null)))[attrName]=value);return[namespace,prefixes,attributeObj]}_getNameAndPrefix(name,nsAgnostic){var i=name.indexOf(":");return-1===i?[name,null]:[name.substring(i+1),nsAgnostic?"":name.substring(0,i)]}onBeginElement(tagName,attributes,isEmpty){var[attributes,prefixes,attributesObj]=this._mkAttributes(attributes,tagName),[tagName,nsPrefix]=this._getNameAndPrefix(tagName,this._builder.isNsAgnostic()),nsPrefix=this._builder.build({nsPrefix:nsPrefix,name:tagName,attributes:attributesObj,namespace:attributes,prefixes:prefixes});nsPrefix[$globalData]=this._globalData,isEmpty?(nsPrefix[$finalize](),this._current[$onChild](nsPrefix)&&nsPrefix[$setId](this._ids),nsPrefix[$clean](this._builder)):(this._stack.push(this._current),this._current=nsPrefix)}onEndElement(name){var parser,node=this._current;node[$isCDATAXml]()&&"string"==typeof node[$content]&&((parser=new XFAParser)._globalData=this._globalData,parser=parser.parse(node[$content]),node[$content]=null,node[$onChild](parser)),node[$finalize](),this._current=this._stack.pop(),this._current[$onChild](node)&&node[$setId](this._ids),node[$clean](this._builder)}onError(code){this._errorCode=code}}class XFAFactory{constructor(data){try{this.root=(new XFAParser).parse(XFAFactory._createDocument(data));var binder=new Binder(this.root);this.form=binder.bind(),this.dataHandler=new DataHandler(this.root,binder.getData()),this.form[$globalData].template=this.form}catch(e){warn("XFA - an error occurred during parsing and binding: ".concat(e))}}isValid(){return!(!this.root||!this.form)}_createPagesHelper(){var iterator=this.form[$toPages]();return new Promise((resolve,reject)=>{var nextIteration=()=>{try{var value=iterator.next();value.done?resolve(value.value):setTimeout(nextIteration,0)}catch(e){reject(e)}};setTimeout(nextIteration,0)})}async _createPages(){try{this.pages=await this._createPagesHelper(),this.dims=this.pages.children.map(c=>{var{width:c,height}=c.attributes.style;return[0,0,parseInt(c),parseInt(height)]})}catch(e){warn("XFA - an error occurred during layout: ".concat(e))}}getBoundingBox(pageIndex){return this.dims[pageIndex]}async getNumPages(){return this.pages||await this._createPages(),this.dims.length}setImages(images){this.form[$globalData].images=images}setFonts(fonts){this.form[$globalData].fontFinder=new FontFinder(fonts);var missingFonts=[];for(typeface of this.form[$globalData].usedTypefaces){var typeface=stripQuotes(typeface);this.form[$globalData].fontFinder.find(typeface)||missingFonts.push(typeface)}return 0<missingFonts.length?missingFonts:null}appendFonts(fonts,reallyMissingFonts){this.form[$globalData].fontFinder.add(fonts,reallyMissingFonts)}async getPages(){this.pages||await this._createPages();var pages=this.pages;return this.pages=null,pages}serializeData(storage){return this.dataHandler.serialize(storage)}static _createDocument(data){return data["/xdp:xdp"]?Object.values(data).join(""):data["xdp:xdp"]}static getRichTextAsHtml(rc){if(rc&&"string"==typeof rc)try{var newRoot,html,attributes,root=new XFAParser(XhtmlNamespace,!0).parse(rc),result=(["body","xhtml"].includes(root[$nodeName])||((newRoot=XhtmlNamespace.body({}))[$appendChild](root),root=newRoot),root[$toHTML]());return result.success?(html=result["html"],attributes=html["attributes"],attributes&&(attributes.class&&(attributes.class=attributes.class.filter(attr=>!attr.startsWith("xfa"))),attributes.dir="auto"),{html:html,str:root[$text]()}):null}catch(e){warn("XFA - an error occurred during parsing of rich text: ".concat(e))}return null}}class AnnotationFactory{static createGlobals(pdfManager){return Promise.all([pdfManager.ensureCatalog("acroForm"),pdfManager.ensureDoc("xfaDatasets"),pdfManager.ensureCatalog("structTreeRoot"),pdfManager.ensureCatalog("baseUrl"),pdfManager.ensureCatalog("attachments"),pdfManager.ensureCatalog("globalColorSpaceCache")]).then(_ref67=>{var[_ref67,xfaDatasets,structTreeRoot,baseUrl,attachments,globalColorSpaceCache]=_ref67;return{pdfManager:pdfManager,acroForm:_ref67 instanceof Dict?_ref67:Dict.empty,xfaDatasets:xfaDatasets,structTreeRoot:structTreeRoot,baseUrl:baseUrl,attachments:attachments,globalColorSpaceCache:globalColorSpaceCache}},reason=>(warn('createGlobals: "'.concat(reason,'".')),null))}static async create(xref,ref,annotationGlobals,idFactory,collectFields,orphanFields,pageRef){var pageIndex=collectFields?await this._getPageIndex(xref,ref,annotationGlobals.pdfManager):null;return annotationGlobals.pdfManager.ensure(this,"_create",[xref,ref,annotationGlobals,idFactory,collectFields,orphanFields,pageIndex,pageRef])}static _create(xref,ref,annotationGlobals,idFactory){var collectFields=4<arguments.length&&void 0!==arguments[4]&&arguments[4],orphanFields=5<arguments.length&&void 0!==arguments[5]?arguments[5]:null,pageIndex=6<arguments.length&&void 0!==arguments[6]?arguments[6]:null,pageRef=7<arguments.length&&void 0!==arguments[7]?arguments[7]:null,dict=xref.fetchIfRef(ref);if(dict instanceof Dict){var{acroForm,pdfManager}=annotationGlobals,idFactory=ref instanceof Ref?ref.toString():"annot_".concat(idFactory.createObjId()),subtype=dict.get("Subtype"),parameters={xref:xref,ref:ref,dict:dict,subtype:subtype=subtype instanceof Name?subtype.name:null,id:idFactory,annotationGlobals:annotationGlobals,collectFields:collectFields,orphanFields:orphanFields,needAppearances:!collectFields&&!0===acroForm.get("NeedAppearances"),pageIndex:pageIndex,evaluatorOptions:pdfManager.evaluatorOptions,pageRef:pageRef};switch(subtype){case"Link":return new LinkAnnotation(parameters);case"Text":return new TextAnnotation(parameters);case"Widget":var fieldType=getInheritableProperty({dict:dict,key:"FT"});switch(fieldType=fieldType instanceof Name?fieldType.name:null){case"Tx":return new TextWidgetAnnotation(parameters);case"Btn":return new ButtonWidgetAnnotation(parameters);case"Ch":return new ChoiceWidgetAnnotation(parameters);case"Sig":return new SignatureWidgetAnnotation(parameters)}return warn('Unimplemented widget field type "'.concat(fieldType,'", ')+"falling back to base field type."),new WidgetAnnotation(parameters);case"Popup":return new PopupAnnotation(parameters);case"FreeText":return new FreeTextAnnotation(parameters);case"Line":return new LineAnnotation(parameters);case"Square":return new SquareAnnotation(parameters);case"Circle":return new CircleAnnotation(parameters);case"PolyLine":return new PolylineAnnotation(parameters);case"Polygon":return new PolygonAnnotation(parameters);case"Caret":return new CaretAnnotation(parameters);case"Ink":return new InkAnnotation(parameters);case"Highlight":return new HighlightAnnotation(parameters);case"Underline":return new UnderlineAnnotation(parameters);case"Squiggly":return new SquigglyAnnotation(parameters);case"StrikeOut":return new StrikeOutAnnotation(parameters);case"Stamp":return new StampAnnotation(parameters);case"FileAttachment":return new FileAttachmentAnnotation(parameters);default:return collectFields||warn(subtype?'Unimplemented annotation type "'.concat(subtype,'", ')+"falling back to base annotation.":"Annotation is missing the required /Subtype."),new Annotation(parameters)}}}static async _getPageIndex(xref,ref,pdfManager){try{var annotDict=await xref.fetchIfRefAsync(ref);if(!(annotDict instanceof Dict))return-1;var pageRef=annotDict.getRaw("P");if(pageRef instanceof Ref)try{return await pdfManager.ensureCatalog("getPageIndex",[pageRef])}catch(ex){info('_getPageIndex -- not a valid page reference: "'.concat(ex,'".'))}if(annotDict.has("Kids"))return-1;for(var numPages=await pdfManager.ensureDoc("numPages"),_pageIndex2=0;_pageIndex2<numPages;_pageIndex2++){var annotRef,page=await pdfManager.getPage(_pageIndex2);for(annotRef of await pdfManager.ensure(page,"annotations"))if(annotRef instanceof Ref&&isRefsEqual(annotRef,ref))return _pageIndex2}}catch(ex){warn('_getPageIndex: "'.concat(ex,'".'))}return-1}static generateImages(annotations,xref,isOffscreenCanvasSupported){if(!isOffscreenCanvasSupported)return warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."),null;var imagePromises,bitmapId,bitmap;for({bitmapId,bitmap}of annotations)bitmap&&(imagePromises=imagePromises||new Map).set(bitmapId,StampAnnotation.createImage(bitmap,xref));return imagePromises}static async saveNewAnnotations(evaluator,task,annotations,imagePromises,changes){var baseFontRef,annotation,xref=evaluator.xref,promises=[],isOffscreenCanvasSupported=evaluator.options["isOffscreenCanvasSupported"];for(annotation of annotations)if(!annotation.deleted)switch(annotation.annotationType){case AnnotationEditorType.FREETEXT:baseFontRef||((baseFont=new Dict(xref)).set("BaseFont",Name.get("Helvetica")),baseFont.set("Type",Name.get("Font")),baseFont.set("Subtype",Name.get("Type1")),baseFont.set("Encoding",Name.get("WinAnsiEncoding")),baseFontRef=xref.getNewTemporaryRef(),changes.put(baseFontRef,{data:baseFont})),promises.push(FreeTextAnnotation.createNewAnnotation(xref,annotation,changes,{evaluator:evaluator,task:task,baseFontRef:baseFontRef}));break;case AnnotationEditorType.HIGHLIGHT:annotation.quadPoints?promises.push(HighlightAnnotation.createNewAnnotation(xref,annotation,changes)):promises.push(InkAnnotation.createNewAnnotation(xref,annotation,changes));break;case AnnotationEditorType.INK:promises.push(InkAnnotation.createNewAnnotation(xref,annotation,changes));break;case AnnotationEditorType.STAMP:var imageStream,smaskRef,smaskStream,baseFont=isOffscreenCanvasSupported?await(null==imagePromises?void 0:imagePromises.get(annotation.bitmapId)):null;null!=baseFont&&baseFont.imageStream&&({imageStream,smaskStream}=baseFont,smaskStream&&(smaskRef=xref.getNewTemporaryRef(),changes.put(smaskRef,{data:smaskStream}),imageStream.dict.set("SMask",smaskRef)),smaskStream=baseFont.imageRef=xref.getNewTemporaryRef(),changes.put(smaskStream,{data:imageStream}),baseFont.imageStream=baseFont.smaskStream=null),promises.push(StampAnnotation.createNewAnnotation(xref,annotation,changes,{image:baseFont}));break;case AnnotationEditorType.SIGNATURE:promises.push(StampAnnotation.createNewAnnotation(xref,annotation,changes,{}))}return{annotations:await Promise.all(promises)}}static async printNewAnnotations(annotationGlobals,evaluator,task,annotations,imagePromises){if(!annotations)return null;var annotation,{options,xref}=evaluator,promises=[];for(annotation of annotations)if(!annotation.deleted)switch(annotation.annotationType){case AnnotationEditorType.FREETEXT:promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals,xref,annotation,{evaluator:evaluator,task:task,evaluatorOptions:options}));break;case AnnotationEditorType.HIGHLIGHT:annotation.quadPoints?promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals,xref,annotation,{evaluatorOptions:options})):promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals,xref,annotation,{evaluatorOptions:options}));break;case AnnotationEditorType.INK:promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals,xref,annotation,{evaluatorOptions:options}));break;case AnnotationEditorType.STAMP:var imageStream,smaskStream,image=options.isOffscreenCanvasSupported?await(null==imagePromises?void 0:imagePromises.get(annotation.bitmapId)):null;null!=image&&image.imageStream&&({imageStream,smaskStream}=image,smaskStream&&imageStream.dict.set("SMask",smaskStream),image.imageRef=new JpegStream(imageStream,imageStream.length),image.imageStream=image.smaskStream=null),promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals,xref,annotation,{image:image,evaluatorOptions:options}));break;case AnnotationEditorType.SIGNATURE:promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals,xref,annotation,{evaluatorOptions:options}))}return Promise.all(promises)}}function getRgbColor(color){var defaultColor=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new Uint8ClampedArray(3);if(!Array.isArray(color))return defaultColor;var rgbColor=defaultColor||new Uint8ClampedArray(3);switch(color.length){case 0:return null;case 1:return ColorSpaceUtils.gray.getRgbItem(color,0,rgbColor,0),rgbColor;case 3:return ColorSpaceUtils.rgb.getRgbItem(color,0,rgbColor,0),rgbColor;case 4:return ColorSpaceUtils.cmyk.getRgbItem(color,0,rgbColor,0),rgbColor;default:return defaultColor}}function getPdfColorArray(color){return Array.from(color,c=>c/255)}function getQuadPoints(dict,rect){var quadPoints=dict.getArray("QuadPoints");if(!isNumberArray(quadPoints,null)||0===quadPoints.length||0<quadPoints.length%8)return null;for(var newQuadPoints=new Float32Array(quadPoints.length),i=0,ii=quadPoints.length;i<ii;i+=8){var[x1,y1,x2,y2,x3,y3,x4,y4]=quadPoints.slice(i,i+8),minX=Math.min(x1,x2,x3,x4),x1=Math.max(x1,x2,x3,x4),x2=Math.min(y1,y2,y3,y4),x3=Math.max(y1,y2,y3,y4);if(null!==rect&&(minX<rect[0]||x1>rect[2]||x2<rect[1]||x3>rect[3]))return null;newQuadPoints.set([minX,x3,x1,x3,minX,x2,x1,x2],i)}return newQuadPoints}function getTransformMatrix(rect,bbox,matrix){var minMax=new Float32Array([1/0,1/0,-1/0,-1/0]),[bbox,matrix,minMax,maxY]=(Util.axialAlignedBoundingBox(bbox,matrix,minMax),minMax);return bbox===minMax||matrix===maxY?[1,0,0,1,rect[0],rect[1]]:[minMax=(rect[2]-rect[0])/(minMax-bbox),0,0,maxY=(rect[3]-rect[1])/(maxY-matrix),rect[0]-bbox*minMax,rect[1]-matrix*maxY]}class Annotation{constructor(params){var{dict,xref,annotationGlobals,ref,orphanFields}=params,orphanFields=null==orphanFields?void 0:orphanFields.get(ref),ref=(orphanFields&&dict.set("Parent",orphanFields),this.setTitle(dict.get("T")),this.setContents(dict.get("Contents")),this.setModificationDate(dict.get("M")),this.setFlags(dict.get("F")),this.setRectangle(dict.getArray("Rect")),this.setColor(dict.getArray("C")),this.setBorderStyle(dict),this.setAppearance(dict),this.setOptionalContent(dict),dict.get("MK")),orphanFields=(this.setBorderAndBackgroundColors(ref),this.setRotation(ref,dict),this.ref=params.ref instanceof Ref?params.ref:null,this._streams=[],this.appearance&&this._streams.push(this.appearance),!!(this.flags&AnnotationFlag.LOCKED)),ref=!!(this.flags&AnnotationFlag.LOCKEDCONTENTS);if(this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:params.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:params.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&AnnotationFlag.NOROTATE),noHTML:orphanFields&&ref,isEditable:!1,structParent:-1},annotationGlobals.structTreeRoot&&(orphanFields=dict.get("StructParent"),this.data.structParent=orphanFields=Number.isInteger(orphanFields)&&0<=orphanFields?orphanFields:-1,annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef,orphanFields)),params.collectFields){ref=dict.get("Kids");if(Array.isArray(ref)){var kid,kidIds=[];for(kid of ref)kid instanceof Ref&&kidIds.push(kid.toString());0!==kidIds.length&&(this.data.kidIds=kidIds)}this.data.actions=collectActions(xref,dict,AnnotationActionEventType),this.data.fieldName=this._constructFieldName(dict),this.data.pageIndex=params.pageIndex}annotationGlobals=dict.get("IT");annotationGlobals instanceof Name&&(this.data.it=annotationGlobals.name),this._isOffscreenCanvasSupported=params.evaluatorOptions.isOffscreenCanvasSupported,this._fallbackFontDict=null,this._needAppearances=!1}_hasFlag(flags,flag){return!!(flags&flag)}_buildFlags(noView,noPrint){var flags=this["flags"];return void 0===noView?void 0===noPrint?void 0:noPrint?flags&~AnnotationFlag.PRINT:flags&~AnnotationFlag.HIDDEN|AnnotationFlag.PRINT:noView?(flags|=AnnotationFlag.PRINT,noPrint?flags&~AnnotationFlag.NOVIEW|AnnotationFlag.HIDDEN:flags&~AnnotationFlag.HIDDEN|AnnotationFlag.NOVIEW):(flags&=~(AnnotationFlag.HIDDEN|AnnotationFlag.NOVIEW),noPrint?flags&~AnnotationFlag.PRINT:flags|AnnotationFlag.PRINT)}_isViewable(flags){return!this._hasFlag(flags,AnnotationFlag.INVISIBLE)&&!this._hasFlag(flags,AnnotationFlag.NOVIEW)}_isPrintable(flags){return this._hasFlag(flags,AnnotationFlag.PRINT)&&!this._hasFlag(flags,AnnotationFlag.HIDDEN)&&!this._hasFlag(flags,AnnotationFlag.INVISIBLE)}mustBeViewed(annotationStorage,_renderForms){annotationStorage=null==annotationStorage||null==(annotationStorage=annotationStorage.get(this.data.id))?void 0:annotationStorage.noView;return void 0!==annotationStorage?!annotationStorage:this.viewable&&!this._hasFlag(this.flags,AnnotationFlag.HIDDEN)}mustBePrinted(annotationStorage){annotationStorage=null==annotationStorage||null==(annotationStorage=annotationStorage.get(this.data.id))?void 0:annotationStorage.noPrint;return void 0!==annotationStorage?!annotationStorage:this.printable}mustBeViewedWhenEditing(isEditing){var modifiedIds=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return isEditing?!this.data.isEditable:!(null!=modifiedIds&&modifiedIds.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(data){data="string"==typeof data?stringToPDFString(data):"";return{str:data,dir:data&&"rtl"===bidi(data).dir?"rtl":"ltr"}}setDefaultAppearance(params){var{dict:params,annotationGlobals}=params,params=getInheritableProperty({dict:params,key:"DA"})||annotationGlobals.acroForm.get("DA");this._defaultAppearance="string"==typeof params?params:"",this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance)}setTitle(title){this._title=this._parseStringHelper(title)}setContents(contents){this._contents=this._parseStringHelper(contents)}setModificationDate(modificationDate){this.modificationDate="string"==typeof modificationDate?modificationDate:null}setFlags(flags){this.flags=Number.isInteger(flags)&&0<flags?flags:0,this.flags&AnnotationFlag.INVISIBLE&&"Annotation"!==this.constructor.name&&(this.flags^=AnnotationFlag.INVISIBLE)}hasFlag(flag){return this._hasFlag(this.flags,flag)}setRectangle(rectangle){this.rectangle=lookupNormalRect(rectangle,[0,0,0,0])}setColor(color){this.color=getRgbColor(color)}setLineEndings(lineEndings){if(this.lineEndings=["None","None"],Array.isArray(lineEndings)&&2===lineEndings.length)for(var i=0;i<2;i++){var obj=lineEndings[i];if(obj instanceof Name)switch(obj.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[i]=obj.name;continue}warn("Ignoring invalid lineEnding: ".concat(obj))}}setRotation(mk,dict){this.rotation=0;mk=mk instanceof Dict?mk.get("R")||0:dict.get("Rotate")||0;Number.isInteger(mk)&&0!==mk&&((mk%=360)<0&&(mk+=360),mk%90==0)&&(this.rotation=mk)}setBorderAndBackgroundColors(mk){mk instanceof Dict?(this.borderColor=getRgbColor(mk.getArray("BC"),null),this.backgroundColor=getRgbColor(mk.getArray("BG"),null)):this.borderColor=this.backgroundColor=null}setBorderStyle(borderStyle){var dict,dictType;this.borderStyle=new AnnotationBorderStyle,borderStyle instanceof Dict&&(borderStyle.has("BS")?(dict=borderStyle.get("BS"))instanceof Dict&&((dictType=dict.get("Type"))&&!isName(dictType,"Border")||(this.borderStyle.setWidth(dict.get("W"),this.rectangle),this.borderStyle.setStyle(dict.get("S")),this.borderStyle.setDashArray(dict.getArray("D")))):borderStyle.has("Border")?(dictType=borderStyle.getArray("Border"),Array.isArray(dictType)&&3<=dictType.length&&(this.borderStyle.setHorizontalCornerRadius(dictType[0]),this.borderStyle.setVerticalCornerRadius(dictType[1]),this.borderStyle.setWidth(dictType[2],this.rectangle),4===dictType.length)&&this.borderStyle.setDashArray(dictType[3],!0)):this.borderStyle.setWidth(0))}setAppearance(dict){this.appearance=null;var appearanceStates=dict.get("AP");appearanceStates instanceof Dict&&((appearanceStates=appearanceStates.get("N"))instanceof BaseStream?this.appearance=appearanceStates:appearanceStates instanceof Dict&&(dict=dict.get("AS"))instanceof Name&&appearanceStates.has(dict.name)&&(appearanceStates=appearanceStates.get(dict.name))instanceof BaseStream&&(this.appearance=appearanceStates))}setOptionalContent(dict){this.oc=null;dict=dict.get("OC");dict instanceof Name?warn("setOptionalContent: Support for /Name-entry is not implemented."):dict instanceof Dict&&(this.oc=dict)}async loadResources(keys,appearance){appearance=await appearance.dict.getAsync("Resources");return appearance&&await ObjectLoader.load(appearance,keys,appearance.xref),appearance}async getOperatorList(evaluator,task,intent,annotationStorage){var{hasOwnCanvas,id,rect}=this.data,appearance=this.appearance,hasOwnCanvas=!!(hasOwnCanvas&&intent&RenderingIntentFlag.DISPLAY);if(hasOwnCanvas&&(0===this.width||0===this.height))return this.data.hasOwnCanvas=!1,{opList:new OperatorList,separateForm:!1,separateCanvas:!1};if(!appearance){if(!hasOwnCanvas)return{opList:new OperatorList,separateForm:!1,separateCanvas:!1};(appearance=new StringStream("")).dict=new Dict}var optionalContent,intent=appearance.dict,resources=await this.loadResources(RESOURCES_KEYS_OPERATOR_LIST,appearance),bbox=lookupRect(intent.getArray("BBox"),[0,0,1,1]),intent=lookupMatrix(intent.getArray("Matrix"),IDENTITY_MATRIX),bbox=getTransformMatrix(rect,bbox,intent),opList=new OperatorList;return void 0!==(optionalContent=this.oc?await evaluator.parseMarkedContentProps(this.oc,null):optionalContent)&&opList.addOp(OPS.beginMarkedContentProps,["OC",optionalContent]),opList.addOp(OPS.beginAnnotation,[id,rect,bbox,intent,hasOwnCanvas]),await evaluator.getOperatorList({stream:appearance,task:task,resources:resources,operatorList:opList,fallbackFontDict:this._fallbackFontDict}),opList.addOp(OPS.endAnnotation,[]),void 0!==optionalContent&&opList.addOp(OPS.endMarkedContent,[]),this.reset(),{opList:opList,separateForm:!1,separateCanvas:hasOwnCanvas}}async save(evaluator,task,annotationStorage,changes){return null}get overlaysTextContent(){return!1}get hasTextContent(){return!1}async extractTextContent(evaluator,task,viewBox){var text,buffer,firstPosition,sink,resources;this.appearance&&(resources=await this.loadResources(RESOURCES_KEYS_TEXT_CONTENT,this.appearance),text=[],buffer=[],firstPosition=null,sink={desiredSize:Math.Infinity,ready:!0,enqueue(chunk,size){for(var item of chunk.items)void 0!==item.str&&(firstPosition=firstPosition||item.transform.slice(-2),buffer.push(item.str),item.hasEOL)&&(text.push(buffer.join("").trimEnd()),buffer.length=0)}},await evaluator.getTextContent({stream:this.appearance,task:task,resources:resources,includeMarkedContent:!0,keepWhiteSpace:!0,sink:sink,viewBox:viewBox}),this.reset(),buffer.length&&text.push(buffer.join("").trimEnd()),1<text.length||text[0])&&(task=lookupRect((evaluator=this.appearance.dict).getArray("BBox"),null),resources=lookupMatrix(evaluator.getArray("Matrix"),null),this.data.textPosition=this._transformPoint(firstPosition,task,resources),this.data.textContent=text)}_transformPoint(coords,bbox,matrix){var rect=this.data["rect"],bbox=getTransformMatrix(rect,bbox=bbox||[0,0,1,1],matrix=matrix||[1,0,0,1,0,0]),rect=(bbox[4]-=rect[0],bbox[5]-=rect[1],coords.slice());return Util.applyTransform(rect,bbox),Util.applyTransform(rect,matrix),rect}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(var stream of this._streams)stream.reset()}_constructFieldName(dict){if(!dict.has("T")&&!dict.has("Parent"))return warn("Unknown field name, falling back to empty field name."),"";if(!dict.has("Parent"))return stringToPDFString(dict.get("T"));var fieldName=[],loopDict=(dict.has("T")&&fieldName.unshift(stringToPDFString(dict.get("T"))),dict),visited=new RefSet;for(dict.objId&&visited.put(dict.objId);loopDict.has("Parent")&&(loopDict=loopDict.get("Parent"))instanceof Dict&&(!loopDict.objId||!visited.has(loopDict.objId));)loopDict.objId&&visited.put(loopDict.objId),loopDict.has("T")&&fieldName.unshift(stringToPDFString(loopDict.get("T")));return fieldName.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=AnnotationBorderStyleType.SOLID,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}setWidth(width){var maxWidth,rect=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];width instanceof Name?this.width=0:"number"==typeof width&&(0<width&&(this.rawWidth=width,maxWidth=(rect[2]-rect[0])/2,rect=(rect[3]-rect[1])/2,0<maxWidth)&&0<rect&&(maxWidth<width||rect<width)&&(warn("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width)),width=1),this.width=width)}setStyle(style){if(style instanceof Name)switch(style.name){case"S":this.style=AnnotationBorderStyleType.SOLID;break;case"D":this.style=AnnotationBorderStyleType.DASHED;break;case"B":this.style=AnnotationBorderStyleType.BEVELED;break;case"I":this.style=AnnotationBorderStyleType.INSET;break;case"U":this.style=AnnotationBorderStyleType.UNDERLINE}}setDashArray(dashArray){var forceStyle=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(dashArray)){var element,isValid=!0,allZeros=!0;for(element of dashArray){if(!(0<=+element)){isValid=!1;break}0<element&&(allZeros=!1)}0===dashArray.length||isValid&&!allZeros?(this.dashArray=dashArray,forceStyle&&this.setStyle(Name.get("D"))):this.width=0}else dashArray&&(this.width=0)}setHorizontalCornerRadius(radius){Number.isInteger(radius)&&(this.horizontalCornerRadius=radius)}setVerticalCornerRadius(radius){Number.isInteger(radius)&&(this.verticalCornerRadius=radius)}}class MarkupAnnotation extends Annotation{constructor(params){super(params);var parent,params=params["dict"],rawIRT=(params.has("IRT")&&(rawIRT=params.getRaw("IRT"),this.data.inReplyTo=rawIRT instanceof Ref?rawIRT.toString():null,rawIRT=params.get("RT"),this.data.replyType=rawIRT instanceof Name?rawIRT.name:AnnotationReplyType.REPLY),null);this.data.replyType===AnnotationReplyType.GROUP?(parent=params.get("IRT"),this.setTitle(parent.get("T")),this.data.titleObj=this._title,this.setContents(parent.get("Contents")),this.data.contentsObj=this._contents,parent.has("CreationDate")?(this.setCreationDate(parent.get("CreationDate")),this.data.creationDate=this.creationDate):this.data.creationDate=null,parent.has("M")?(this.setModificationDate(parent.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,rawIRT=parent.getRaw("Popup"),parent.has("C")?(this.setColor(parent.getArray("C")),this.data.color=this.color):this.data.color=null):(this.data.titleObj=this._title,this.setCreationDate(params.get("CreationDate")),this.data.creationDate=this.creationDate,rawIRT=params.getRaw("Popup"),params.has("C")||(this.data.color=null)),this.data.popupRef=rawIRT instanceof Ref?rawIRT.toString():null,params.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(params.get("RC")))}setCreationDate(creationDate){this.creationDate="string"==typeof creationDate?creationDate:null}_setDefaultAppearance(_ref68){for(var{xref:_ref68,extra,strokeColor,fillColor,blendMode,strokeAlpha,fillAlpha,pointsCallback}=_ref68,bbox=this.data.rect=[1/0,1/0,-1/0,-1/0],buffer=["q"],pointsArray=(extra&&buffer.push(extra),strokeColor&&buffer.push("".concat(strokeColor[0]," ").concat(strokeColor[1]," ").concat(strokeColor[2]," RG")),fillColor&&buffer.push("".concat(fillColor[0]," ").concat(fillColor[1]," ").concat(fillColor[2]," rg")),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]])),i=0,ii=pointsArray.length;i<ii;i+=8){var points=pointsCallback(buffer,pointsArray.subarray(i,i+8));Util.rectBoundingBox(...points,bbox)}buffer.push("Q");extra=new Dict(_ref68),strokeColor=new Dict(_ref68),strokeColor.set("Subtype",Name.get("Form")),fillColor=new StringStream(buffer.join(" ")),fillColor.dict=strokeColor,extra.set("Fm0",fillColor),strokeColor=new Dict(_ref68),blendMode&&strokeColor.set("BM",Name.get(blendMode)),"number"==typeof strokeAlpha&&strokeColor.set("CA",strokeAlpha),"number"==typeof fillAlpha&&strokeColor.set("ca",fillAlpha),blendMode=new Dict(_ref68),blendMode.set("GS0",strokeColor),strokeAlpha=new Dict(_ref68),strokeAlpha.set("ExtGState",blendMode),strokeAlpha.set("XObject",extra),fillAlpha=new Dict(_ref68);fillAlpha.set("Resources",strokeAlpha),fillAlpha.set("BBox",bbox),this.appearance=new StringStream("/GS0 gs /Fm0 Do"),this.appearance.dict=fillAlpha,this._streams.push(this.appearance,fillColor)}static async createNewAnnotation(xref,annotation,changes,params){var apRef,annotationDict,annotationRef=annotation.ref||(annotation.ref=xref.getNewTemporaryRef()),params=await this.createNewAppearanceStream(annotation,xref,params);return params?(apRef=xref.getNewTemporaryRef(),annotationDict=this.createNewDict(annotation,xref,{apRef:apRef}),changes.put(apRef,{data:params})):annotationDict=this.createNewDict(annotation,xref,{}),Number.isInteger(annotation.parentTreeId)&&annotationDict.set("StructParent",annotation.parentTreeId),changes.put(annotationRef,{data:annotationDict}),{ref:annotationRef}}static async createNewPrintAnnotation(annotationGlobals,xref,annotation,params){var ap=await this.createNewAppearanceStream(annotation,xref,params),ap=this.createNewDict(annotation,xref,ap?{ap:ap}:{}),ap=new this.prototype.constructor({dict:ap,xref:xref,annotationGlobals:annotationGlobals,evaluatorOptions:params.evaluatorOptions});return annotation.ref&&(ap.ref=ap.refToReplace=annotation.ref),ap}}class WidgetAnnotation extends Annotation{constructor(params){super(params);var{dict,xref,annotationGlobals}=params,data=this.data,fieldValue=(this._needAppearances=params.needAppearances,data.annotationType=AnnotationType.WIDGET,void 0===data.fieldName&&(data.fieldName=this._constructFieldName(dict)),void 0===data.actions&&(data.actions=collectActions(xref,dict,AnnotationActionEventType)),getInheritableProperty({dict:dict,key:"V",getArray:!0})),defaultFieldValue=(data.fieldValue=this._decodeFormValue(fieldValue),getInheritableProperty({dict:dict,key:"DV",getArray:!0})),defaultFieldValue=(data.defaultFieldValue=this._decodeFormValue(defaultFieldValue),void 0===fieldValue&&annotationGlobals.xfaDatasets&&(defaultFieldValue=this._title.str)&&(this._hasValueFromXFA=!0,data.fieldValue=fieldValue=annotationGlobals.xfaDatasets.getValue(defaultFieldValue)),void 0===fieldValue&&null!==data.defaultFieldValue&&(data.fieldValue=data.defaultFieldValue),data.alternativeText=stringToPDFString(dict.get("TU")||""),this.setDefaultAppearance(params),data.hasAppearance||(data.hasAppearance=this._needAppearances&&void 0!==data.fieldValue&&null!==data.fieldValue),getInheritableProperty({dict:dict,key:"FT"})),fieldValue=(data.fieldType=defaultFieldValue instanceof Name?defaultFieldValue.name:null,getInheritableProperty({dict:dict,key:"DR"})),params=annotationGlobals.acroForm.get("DR"),annotationGlobals=null==(defaultFieldValue=this.appearance)?void 0:defaultFieldValue.dict.get("Resources");this._fieldResources={localResources:fieldValue,acroFormResources:params,appearanceResources:annotationGlobals,mergedResources:Dict.merge({xref:xref,dictArray:[fieldValue,annotationGlobals,params],mergeSubDicts:!0})},data.fieldFlags=getInheritableProperty({dict:dict,key:"Ff"}),(!Number.isInteger(data.fieldFlags)||data.fieldFlags<0)&&(data.fieldFlags=0),data.password=this.hasFieldFlag(AnnotationFieldFlag.PASSWORD),data.readOnly=this.hasFieldFlag(AnnotationFieldFlag.READONLY),data.required=this.hasFieldFlag(AnnotationFieldFlag.REQUIRED),data.hidden=this._hasFlag(data.annotationFlags,AnnotationFlag.HIDDEN)||this._hasFlag(data.annotationFlags,AnnotationFlag.NOVIEW)}_decodeFormValue(formValue){return Array.isArray(formValue)?formValue.filter(item=>"string"==typeof item).map(item=>stringToPDFString(item)):formValue instanceof Name?stringToPDFString(formValue.name):"string"==typeof formValue?stringToPDFString(formValue):null}hasFieldFlag(flag){return!!(this.data.fieldFlags&flag)}_isViewable(flags){return!0}mustBeViewed(annotationStorage,renderForms){return renderForms?this.viewable:super.mustBeViewed(annotationStorage,renderForms)&&!this._hasFlag(this.flags,AnnotationFlag.NOVIEW)}getRotationMatrix(annotationStorage){annotationStorage=null==annotationStorage||null==(annotationStorage=annotationStorage.get(this.data.id))?void 0:annotationStorage.rotation;return 0===(annotationStorage=void 0===annotationStorage?this.rotation:annotationStorage)?IDENTITY_MATRIX:getRotationMatrix(annotationStorage,this.width,this.height)}getBorderAndBackgroundAppearances(annotationStorage){var str,borderWidth,annotationStorage=null==annotationStorage||null==(annotationStorage=annotationStorage.get(this.data.id))?void 0:annotationStorage.rotation;return void 0===annotationStorage&&(annotationStorage=this.rotation),this.backgroundColor||this.borderColor?(annotationStorage=0===annotationStorage||180===annotationStorage?"0 0 ".concat(this.width," ").concat(this.height," re"):"0 0 ".concat(this.height," ").concat(this.width," re"),str="",this.backgroundColor&&(str="".concat(getPdfColor(this.backgroundColor,!0)," ").concat(annotationStorage," f ")),this.borderColor&&(borderWidth=this.borderStyle.width||1,str+="".concat(borderWidth," w ").concat(getPdfColor(this.borderColor,!1)," ").concat(annotationStorage," S ")),str):""}async getOperatorList(evaluator,task,intent,annotationStorage){var content,opList,optionalContent,bbox;return!(intent&RenderingIntentFlag.ANNOTATIONS_FORMS)||this instanceof SignatureWidgetAnnotation||this.data.noHTML||this.data.hasOwnCanvas?!this._hasText||(content=await this._getAppearance(evaluator,task,intent,annotationStorage),this.appearance&&null===content)?super.getOperatorList(evaluator,task,intent,annotationStorage):(opList=new OperatorList,this._defaultAppearance&&null!==content?(intent=!!(this.data.hasOwnCanvas&&intent&RenderingIntentFlag.DISPLAY),bbox=[0,0,this.width,this.height],bbox=getTransformMatrix(this.data.rect,bbox,[1,0,0,1,0,0]),void 0!==(optionalContent=this.oc?await evaluator.parseMarkedContentProps(this.oc,null):optionalContent)&&opList.addOp(OPS.beginMarkedContentProps,["OC",optionalContent]),opList.addOp(OPS.beginAnnotation,[this.data.id,this.data.rect,bbox,this.getRotationMatrix(annotationStorage),intent]),bbox=new StringStream(content),await evaluator.getOperatorList({stream:bbox,task:task,resources:this._fieldResources.mergedResources,operatorList:opList}),opList.addOp(OPS.endAnnotation,[]),void 0!==optionalContent&&opList.addOp(OPS.endMarkedContent,[]),{opList:opList,separateForm:!1,separateCanvas:intent}):{opList:opList,separateForm:!1,separateCanvas:!1}):{opList:new OperatorList,separateForm:!0,separateCanvas:!1}}_getMKDict(rotation){var mk=new Dict(null);return rotation&&mk.set("R",rotation),this.borderColor&&mk.set("BC",getPdfColorArray(this.borderColor)),this.backgroundColor&&mk.set("BG",getPdfColorArray(this.backgroundColor)),0<mk.size?mk:null}amendSavedDict(annotationStorage,dict){}setValue(dict,value,xref,changes){var{dict:xref,ref:parentRef}=getParentToUpdate(dict,this.ref,xref);if(xref){if(!changes.has(parentRef))return(xref=xref.clone()).set("V",value),changes.put(parentRef,{data:xref}),xref}else dict.set("V",value);return null}async save(evaluator,task,annotationStorage,changes){var storageEntry=null==annotationStorage?void 0:annotationStorage.get(this.data.id),flags=this._buildFlags(null==storageEntry?void 0:storageEntry.noView,null==storageEntry?void 0:storageEntry.noPrint),value=null==storageEntry?void 0:storageEntry.value,storageEntry=null==storageEntry?void 0:storageEntry.rotation;if(value===this.data.fieldValue||void 0===value){if(!this._hasValueFromXFA&&void 0===storageEntry&&void 0===flags)return;value=value||this.data.fieldValue}if(void 0!==storageEntry||this._hasValueFromXFA||!Array.isArray(value)||!Array.isArray(this.data.fieldValue)||!isArrayEqual(value,this.data.fieldValue)||void 0!==flags){void 0===storageEntry&&(storageEntry=this.rotation);var appearance=null;if(this._needAppearances||null!==(appearance=await this._getAppearance(evaluator,task,RenderingIntentFlag.SAVE,annotationStorage))||void 0!==flags){var task=!1,evaluator=(null!=appearance&&appearance.needAppearances&&(task=!0,appearance=null),evaluator)["xref"],originalDict=evaluator.fetchIfRef(this.ref);if(originalDict instanceof Dict){var key,dict=new Dict(evaluator);for(key of originalDict.getKeys())"AP"!==key&&dict.set(key,originalDict.getRaw(key));void 0!==flags&&(dict.set("F",flags),null!==appearance||task||(flags=originalDict.getRaw("AP"))&&dict.set("AP",flags));var flags={path:this.data.fieldName,value:value},value=this.setValue(dict,Array.isArray(value)?value.map(stringToAsciiOrUTF16BE):stringToAsciiOrUTF16BE(value),evaluator,changes),value=(this.amendSavedDict(annotationStorage,value||dict),this._getMKDict(storageEntry));value&&dict.set("MK",value),changes.put(this.ref,{data:dict,xfa:flags,needAppearances:task}),null!==appearance&&(value=evaluator.getNewTemporaryRef(),flags=new Dict(evaluator),dict.set("AP",flags),flags.set("N",value),task=this._getSaveFieldResources(evaluator),(appearance=(flags=new StringStream(appearance)).dict=new Dict(evaluator)).set("Subtype",Name.get("Form")),appearance.set("Resources",task),evaluator=storageEntry%180==0?[0,0,this.width,this.height]:[0,0,this.height,this.width],appearance.set("BBox",evaluator),(task=this.getRotationMatrix(annotationStorage))!==IDENTITY_MATRIX&&appearance.set("Matrix",task),changes.put(value,{data:flags,xfa:null,needAppearances:!1})),dict.set("M","D:".concat(getModificationDate()))}}}}async _getAppearance(evaluator,task,intent,annotationStorage){if(this.data.password)return null;var storageEntry=null==annotationStorage?void 0:annotationStorage.get(this.data.id);if(storageEntry&&(value=storageEntry.formattedValue||storageEntry.value,rotation=storageEntry.rotation),void 0===rotation&&void 0===value&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;var value,storageEntry=this.getBorderAndBackgroundAppearances(annotationStorage);if(void 0===value&&!(value=this.data.fieldValue))return"/Tx BMC q ".concat(storageEntry,"Q EMC");if(assert("string"==typeof(value=Array.isArray(value)&&1===value.length?value[0]:value),"Expected `value` to be a string."),value=value.trimEnd(),this.data.combo&&(option=this.data.options.find(_ref69=>{_ref69=_ref69.exportValue;return value===_ref69}),value=(null==option?void 0:option.displayValue)||value),""===value)return"/Tx BMC q ".concat(storageEntry,"Q EMC");void 0===rotation&&(rotation=this.rotation);var lines,defaultAppearance,fontSize,lineHeight,line,option=-1,{width:totalWidth,height:totalHeight}=(this.data.multiLine?option=(lines=value.split(/\r\n?|\n/).map(line=>line.normalize("NFC"))).length:lines=[value.replace(/\r\n?|\n/,"").normalize("NFC")],this),font=(90!==rotation&&270!==rotation||([totalWidth,totalHeight]=[totalHeight,totalWidth]),this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g")),await WidgetAnnotation._getFontData(evaluator,task,this.data.defaultAppearanceData,this._fieldResources.mergedResources)),encodedLines=[],encodingError=!1;for(line of lines){var encodedString=font.encodeString(line);1<encodedString.length&&(encodingError=!0),encodedLines.push(encodedString.join(""))}if(encodingError&&intent&RenderingIntentFlag.SAVE)return{needAppearances:!0};if(encodingError&&this._isOffscreenCanvasSupported){var rotation=this.data.comb?"monospace":"sans-serif",intent=new FakeUnicodeFont(evaluator.xref,rotation),rotation=intent.createFontResources(lines.join("")),newFont=rotation.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){var key,oldFont=this._fieldResources.mergedResources.get("Font");for(key of newFont.getKeys())oldFont.set(key,newFont.getRaw(key))}else this._fieldResources.mergedResources.set("Font",newFont);for(var intent=intent.fontName.name,font=await WidgetAnnotation._getFontData(evaluator,task,{fontName:intent,fontSize:0},rotation),i=0,ii=encodedLines.length;i<ii;i++)encodedLines[i]=stringToUTF16String(lines[i]);evaluator=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0,this.data.defaultAppearanceData.fontName=intent,[defaultAppearance,fontSize,lineHeight]=this._computeFontSize(totalHeight-2,totalWidth-4,value,font,option),this.data.defaultAppearanceData=evaluator}else this._isOffscreenCanvasSupported||warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."),[defaultAppearance,fontSize,lineHeight]=this._computeFontSize(totalHeight-2,totalWidth-4,value,font,option);task=font.descent,task=isNaN(task)?BASELINE_FACTOR*lineHeight:Math.max(BASELINE_FACTOR*lineHeight,Math.abs(task)*fontSize),rotation=Math.min(Math.floor((totalHeight-fontSize)/2),1),intent=this.data.textAlignment;return this.data.multiLine?this._getMultilineAppearance(defaultAppearance,encodedLines,font,fontSize,totalWidth,totalHeight,intent,2,rotation,task,lineHeight,annotationStorage):this.data.comb?this._getCombAppearance(defaultAppearance,font,encodedLines[0],fontSize,totalWidth,totalHeight,2,rotation,task,lineHeight,annotationStorage):(evaluator=rotation+task,0===intent||2<intent?"/Tx BMC q ".concat(storageEntry,"BT ")+defaultAppearance+" 1 0 0 1 ".concat(numberToString(2)," ").concat(numberToString(evaluator)," Tm (").concat(escapeString(encodedLines[0]),") Tj")+" ET Q EMC":(option=this._renderText(encodedLines[0],font,fontSize,totalWidth,intent,{shift:0},2,evaluator),"/Tx BMC q ".concat(storageEntry,"BT ")+defaultAppearance+" 1 0 0 1 0 0 Tm ".concat(option)+" ET Q EMC"))}static async _getFontData(evaluator,task,appearanceData,resources){var operatorList=new OperatorList,initialState={font:null,clone(){return this}},{fontName:appearanceData,fontSize}=appearanceData;return await evaluator.handleSetFont(resources,[appearanceData&&Name.get(appearanceData),fontSize],null,operatorList,task,initialState,null),initialState.font}_getTextWidth(text,font){return Math.sumPrecise(font.charsToGlyphs(text).map(g=>g.width))/1e3}_computeFontSize(height,width,text,font,lineCount){var fontSize=this.data.defaultAppearanceData["fontSize"],lineHeight=(fontSize||12)*LINE_FACTOR,numberOfLines=Math.round(height/lineHeight);if(!fontSize){var roundWithTwoDigits=x=>Math.floor(100*x)/100;if(-1===lineCount)lineHeight=this._getTextWidth(text,font),fontSize=roundWithTwoDigits(Math.min(height/LINE_FACTOR,width/lineHeight)),numberOfLines=1;else{var line,lineHeight=text.split(/\r\n?|\n/),cachedLines=[];for(line of lineHeight){var encoded=font.encodeString(line).join(""),glyphs=font.charsToGlyphs(encoded),positions=font.getCharPositions(encoded);cachedLines.push({line:encoded,glyphs:glyphs,positions:positions})}var isTooBig=fsize=>{var cache,totalHeight=0;for(cache of cachedLines)if(totalHeight+=this._splitLine(null,font,fsize,width,cache).length*fsize,height<totalHeight)return!0;return!1};for(numberOfLines=Math.max(numberOfLines,lineCount);;){if(!isTooBig(fontSize=roundWithTwoDigits(height/numberOfLines/LINE_FACTOR)))break;numberOfLines++}}var{fontName:text,fontColor:lineHeight}=this.data.defaultAppearanceData;this._defaultAppearance=createDefaultAppearance({fontSize:fontSize,fontName:text,fontColor:lineHeight})}return[this._defaultAppearance,fontSize,height/numberOfLines]}_renderText(text,font,fontSize,totalWidth,alignment,prevInfo,hPadding,vPadding){totalWidth=numberToString((alignment=1===alignment?(totalWidth-this._getTextWidth(text,font)*fontSize)/2:2===alignment?totalWidth-this._getTextWidth(text,font)*fontSize-hPadding:hPadding)-prevInfo.shift);return prevInfo.shift=alignment,vPadding=numberToString(vPadding),"".concat(totalWidth," ").concat(vPadding," Td (").concat(escapeString(text),") Tj")}_getSaveFieldResources(xref){var{localResources,appearanceResources,acroFormResources}=this._fieldResources,fontName=null==(_this$data$defaultApp=this.data.defaultAppearanceData)?void 0:_this$data$defaultApp.fontName;if(fontName){for(var resources of[localResources,appearanceResources])if(resources instanceof Dict){var localFont=resources.get("Font");if(localFont instanceof Dict&&localFont.has(fontName))return resources}if(acroFormResources instanceof Dict){var _this$data$defaultApp=acroFormResources.get("Font");if(_this$data$defaultApp instanceof Dict&&_this$data$defaultApp.has(fontName))return(appearanceResources=new Dict(xref)).set(fontName,_this$data$defaultApp.getRaw(fontName)),(acroFormResources=new Dict(xref)).set("Font",appearanceResources),Dict.merge({xref:xref,dictArray:[acroFormResources,localResources],mergeSubDicts:!0})}}return localResources||Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(params){super(params);var keystrokeAction,params=params["dict"],alignment=(params.has("PMD")&&(this.flags|=AnnotationFlag.HIDDEN,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=""),getInheritableProperty({dict:params,key:"Q"})),alignment=((!Number.isInteger(alignment)||alignment<0||2<alignment)&&(alignment=null),this.data.textAlignment=alignment,getInheritableProperty({dict:params,key:"MaxLen"})),params=((!Number.isInteger(alignment)||alignment<0)&&(alignment=0),this.data.maxLen=alignment,this.data.multiLine=this.hasFieldFlag(AnnotationFieldFlag.MULTILINE),this.data.comb=this.hasFieldFlag(AnnotationFieldFlag.COMB)&&!this.data.multiLine&&!this.data.password&&!this.hasFieldFlag(AnnotationFieldFlag.FILESELECT)&&0!==this.data.maxLen,this.data.doNotScroll=this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL),this)["data"]["actions"];for(keystrokeAction of(null==params?void 0:params.Keystroke)||[]){var m=keystrokeAction.trim().match(/^AF(Date|Time)_Keystroke(?:Ex)?\(['"]?([^'"]+)['"]?\);$/);if(m){var format=m[2],num=parseInt(format,10);isNaN(num)||Math.floor(Math.log10(num))+1!==m[2].length||(format=null!=(num=("Date"===m[1]?DateFormats:TimeFormats)[num])?num:format),this.data["Date"===m[1]?"dateFormat":"timeFormat"]=format;break}}}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(defaultAppearance,font,text,fontSize,width,height,hPadding,vPadding,descent,lineHeight,annotationStorage){var start,end,width=width/this.data.maxLen,annotationStorage=this.getBorderAndBackgroundAppearances(annotationStorage),buf=[];for([start,end]of font.getCharPositions(text))buf.push("(".concat(escapeString(text.substring(start,end)),") Tj"));font=buf.join(" ".concat(numberToString(width)," 0 Td "));return"/Tx BMC q ".concat(annotationStorage,"BT ")+defaultAppearance+" 1 0 0 1 ".concat(numberToString(hPadding)," ").concat(numberToString(vPadding+descent)," Tm ").concat(font)+" ET Q EMC"}_getMultilineAppearance(defaultAppearance,lines,font,fontSize,width,height,alignment,hPadding,vPadding,descent,lineHeight,annotationStorage){for(var buf=[],totalWidth=width-2*hPadding,prevInfo={shift:0},i=0,ii=lines.length;i<ii;i++)for(var line=lines[i],chunks=this._splitLine(line,font,fontSize,totalWidth),j=0,jj=chunks.length;j<jj;j++){var chunk=chunks[j];buf.push(this._renderText(chunk,font,fontSize,width,alignment,prevInfo,hPadding,0===i&&0===j?-vPadding-(lineHeight-descent):-lineHeight))}var annotationStorage=this.getBorderAndBackgroundAppearances(annotationStorage),renderedText=buf.join("\n");return"/Tx BMC q ".concat(annotationStorage,"BT ")+defaultAppearance+" 1 0 0 1 0 ".concat(numberToString(height)," Tm ").concat(renderedText)+" ET Q EMC"}_splitLine(line,font,fontSize,width){var cache=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},glyphs=(line=cache.line||line,cache.glyphs||font.charsToGlyphs(line));if(glyphs.length<=1)return[line];for(var positions=cache.positions||font.getCharPositions(line),scale=fontSize/1e3,chunks=[],lastSpacePosInStringStart=-1,lastSpacePosInStringEnd=-1,lastSpacePos=-1,startChunk=0,currentWidth=0,i=0,ii=glyphs.length;i<ii;i++){var[start,end]=positions[i],glyph=glyphs[i],glyphWidth=glyph.width*scale;" "===glyph.unicode?lastSpacePos=width<currentWidth+glyphWidth?(chunks.push(line.substring(startChunk,start)),startChunk=start,currentWidth=glyphWidth,lastSpacePosInStringStart=-1):(currentWidth+=glyphWidth,lastSpacePosInStringStart=start,lastSpacePosInStringEnd=end,i):width<currentWidth+glyphWidth?currentWidth=-1!==lastSpacePosInStringStart?(chunks.push(line.substring(startChunk,lastSpacePosInStringEnd)),startChunk=lastSpacePosInStringEnd,i=lastSpacePos+1,lastSpacePosInStringStart=-1,0):(chunks.push(line.substring(startChunk,start)),startChunk=start,glyphWidth):currentWidth+=glyphWidth}return startChunk<line.length&&chunks.push(line.substring(startChunk,line.length)),chunks}async extractTextContent(evaluator,task,viewBox){await super.extractTextContent(evaluator,task,viewBox);evaluator=this.data.textContent;evaluator&&(task=evaluator.join("\n"))!==this.data.fieldValue&&(viewBox=task.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g,(_m,p1)=>p1?"\\".concat(p1):"\\s+"),new RegExp("^\\s*".concat(viewBox,"\\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,type:"text"}}}class ButtonWidgetAnnotation extends WidgetAnnotation{constructor(params){super(params),this.checkedAppearance=null,this.uncheckedAppearance=null;var isRadio=this.hasFieldFlag(AnnotationFieldFlag.RADIO),isPushButton=this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);this.data.checkBox=!isRadio&&!isPushButton,this.data.radioButton=isRadio&&!isPushButton,this.data.pushButton=isPushButton,this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(params):this.data.radioButton?this._processRadioButton(params):this.data.pushButton?(this.data.hasOwnCanvas=!0,this.data.noHTML=!1,this._processPushButton(params)):warn("Invalid field flags for button widget annotation")}async getOperatorList(evaluator,task,intent,annotationStorage){var storageEntry,value,savedMatrix,rotation;return this.data.pushButton?super.getOperatorList(evaluator,task,intent,!1,annotationStorage):(rotation=value=null,annotationStorage&&(value=(storageEntry=annotationStorage.get(this.data.id))?storageEntry.value:null,rotation=storageEntry?storageEntry.rotation:null),null===value&&this.appearance?super.getOperatorList(evaluator,task,intent,annotationStorage):(storageEntry=(value=null==value?this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue:value)?this.checkedAppearance:this.uncheckedAppearance)?(value=this.appearance,savedMatrix=lookupMatrix(storageEntry.dict.getArray("Matrix"),IDENTITY_MATRIX),rotation&&storageEntry.dict.set("Matrix",this.getRotationMatrix(annotationStorage)),this.appearance=storageEntry,rotation=super.getOperatorList(evaluator,task,intent,annotationStorage),this.appearance=value,storageEntry.dict.set("Matrix",savedMatrix),rotation):{opList:new OperatorList,separateForm:!1,separateCanvas:!1})}async save(evaluator,task,annotationStorage,changes){this.data.checkBox?this._saveCheckbox(evaluator,task,annotationStorage,changes):this.data.radioButton&&this._saveRadioButton(evaluator,task,annotationStorage,changes)}async _saveCheckbox(evaluator,task,annotationStorage,changes){if(annotationStorage){var annotationStorage=annotationStorage.get(this.data.id),flags=this._buildFlags(null==annotationStorage?void 0:annotationStorage.noView,null==annotationStorage?void 0:annotationStorage.noPrint),rotation=null==annotationStorage?void 0:annotationStorage.rotation,annotationStorage=null==annotationStorage?void 0:annotationStorage.value;if(void 0===rotation&&void 0===flags){if(void 0===annotationStorage)return;if(this.data.fieldValue===this.data.exportValue===annotationStorage)return}var xfa,dict=evaluator.xref.fetchIfRef(this.ref);dict instanceof Dict&&(dict=dict.clone(),void 0===rotation&&(rotation=this.rotation),void 0===annotationStorage&&(annotationStorage=this.data.fieldValue===this.data.exportValue),xfa={path:this.data.fieldName,value:annotationStorage?this.data.exportValue:""},annotationStorage=Name.get(annotationStorage?this.data.exportValue:"Off"),this.setValue(dict,annotationStorage,evaluator.xref,changes),dict.set("AS",annotationStorage),dict.set("M","D:".concat(getModificationDate())),void 0!==flags&&dict.set("F",flags),(evaluator=this._getMKDict(rotation))&&dict.set("MK",evaluator),changes.put(this.ref,{data:dict,xfa:xfa,needAppearances:!1}))}}async _saveRadioButton(evaluator,task,annotationStorage,changes){if(annotationStorage){var annotationStorage=annotationStorage.get(this.data.id),flags=this._buildFlags(null==annotationStorage?void 0:annotationStorage.noView,null==annotationStorage?void 0:annotationStorage.noPrint),rotation=null==annotationStorage?void 0:annotationStorage.rotation,annotationStorage=null==annotationStorage?void 0:annotationStorage.value;if(void 0===rotation&&void 0===flags){if(void 0===annotationStorage)return;if(this.data.fieldValue===this.data.buttonValue===annotationStorage)return}var xfa,name,dict=evaluator.xref.fetchIfRef(this.ref);dict instanceof Dict&&(dict=dict.clone(),void 0===annotationStorage&&(annotationStorage=this.data.fieldValue===this.data.buttonValue),void 0===rotation&&(rotation=this.rotation),xfa={path:this.data.fieldName,value:annotationStorage?this.data.buttonValue:""},name=Name.get(annotationStorage?this.data.buttonValue:"Off"),annotationStorage&&this.setValue(dict,name,evaluator.xref,changes),dict.set("AS",name),dict.set("M","D:".concat(getModificationDate())),void 0!==flags&&dict.set("F",flags),(annotationStorage=this._getMKDict(rotation))&&dict.set("MK",annotationStorage),changes.put(this.ref,{data:dict,xfa:xfa,needAppearances:!1}))}}_getDefaultCheckedAppearance(params,type){var char,{width,height}=this,bbox=[0,0,width,height],fontSize=.8*Math.min(width,height),type=("check"===type?(metrics={width:.755*fontSize,height:.705*fontSize},char="3"):"disc"===type?(metrics={width:.791*fontSize,height:.705*fontSize},char="l"):unreachable("_getDefaultCheckedAppearance - unsupported type: ".concat(type)),numberToString((width-metrics.width)/2)),width=numberToString((height-metrics.height)/2),height="q BT /PdfJsZaDb ".concat(fontSize," Tf 0 g ").concat(type," ").concat(width," Td (").concat(char,") Tj ET Q"),metrics=new Dict(params.xref),fontSize=(metrics.set("FormType",1),metrics.set("Subtype",Name.get("Form")),metrics.set("Type",Name.get("XObject")),metrics.set("BBox",bbox),metrics.set("Matrix",[1,0,0,1,0,0]),metrics.set("Length",height.length),new Dict(params.xref)),type=new Dict(params.xref);type.set("PdfJsZaDb",this.fallbackFontDict),fontSize.set("Font",type),metrics.set("Resources",fontSize),this.checkedAppearance=new StringStream(height),this.checkedAppearance.dict=metrics,this._streams.push(this.checkedAppearance)}_processCheckBox(params){var asValue,exportValues,customAppearance=params.dict.get("AP");customAppearance instanceof Dict&&(customAppearance=customAppearance.get("N"))instanceof Dict&&("string"==typeof(asValue=this._decodeFormValue(params.dict.get("AS")))&&(this.data.fieldValue=asValue),asValue=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",0===(exportValues=this._decodeFormValue(customAppearance.getKeys())).length?exportValues.push("Off",asValue):1===exportValues.length?"Off"===exportValues[0]?exportValues.push(asValue):exportValues.unshift("Off"):exportValues.includes(asValue)?(exportValues.length=0,exportValues.push("Off",asValue)):(asValue=exportValues.find(v=>"Off"!==v),exportValues.length=0,exportValues.push("Off",asValue)),exportValues.includes(this.data.fieldValue)||(this.data.fieldValue="Off"),this.data.exportValue=exportValues[1],asValue=customAppearance.get(this.data.exportValue),this.checkedAppearance=asValue instanceof BaseStream?asValue:null,exportValues=customAppearance.get("Off"),this.uncheckedAppearance=exportValues instanceof BaseStream?exportValues:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(params,"check"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,null===this.data.defaultFieldValue)&&(this.data.defaultFieldValue="Off")}_processRadioButton(params){this.data.buttonValue=null;var fieldParent=params.dict.get("Parent"),fieldParent=(fieldParent instanceof Dict&&(this.parent=params.dict.getRaw("Parent"),(fieldParent=fieldParent.get("V"))instanceof Name)&&(this.data.fieldValue=this._decodeFormValue(fieldParent)),params.dict.get("AP"));if(fieldParent instanceof Dict){fieldParent=fieldParent.get("N");if(fieldParent instanceof Dict){for(var key of fieldParent.getKeys())if("Off"!==key){this.data.buttonValue=this._decodeFormValue(key);break}var checkedAppearance=fieldParent.get(this.data.buttonValue),checkedAppearance=(this.checkedAppearance=checkedAppearance instanceof BaseStream?checkedAppearance:null,fieldParent.get("Off"));this.uncheckedAppearance=checkedAppearance instanceof BaseStream?checkedAppearance:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(params,"disc"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}}}_processPushButton(params){var{dict:params,annotationGlobals}=params;params.has("A")||params.has("AA")||this.data.alternativeText?(this.data.isTooltipOnly=!params.has("A")&&!params.has("AA"),Catalog.parseDestDictionary({destDict:params,resultObj:this.data,docBaseUrl:annotationGlobals.baseUrl,docAttachments:annotationGlobals.attachments})):warn("Push buttons without action dictionaries are not supported")}getFieldObject(){var exportValues,type="button";return this.data.checkBox?(type="checkbox",exportValues=this.data.exportValue):this.data.radioButton&&(type="radiobutton",exportValues=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:exportValues,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:type}}get fallbackFontDict(){var dict=new Dict;return dict.set("BaseFont",Name.get("ZapfDingbats")),dict.set("Type",Name.get("FallbackType")),dict.set("Subtype",Name.get("FallbackType")),dict.set("Encoding",Name.get("ZapfDingbatsEncoding")),shadow(this,"fallbackFontDict",dict)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(params){super(params);var{dict:params,xref}=params,options=(this.indices=params.getArray("I"),this.hasIndices=Array.isArray(this.indices)&&0<this.indices.length,this.data.options=[],getInheritableProperty({dict:params,key:"Opt"}));if(Array.isArray(options))for(var i=0,ii=options.length;i<ii;i++){var option=xref.fetchIfRef(options[i]),isOptionArray=Array.isArray(option);this.data.options[i]={exportValue:this._decodeFormValue(isOptionArray?xref.fetchIfRef(option[0]):option),displayValue:this._decodeFormValue(isOptionArray?xref.fetchIfRef(option[1]):option)}}if(this.hasIndices){this.data.fieldValue=[];var _i42,_ii12=this.data.options.length;for(_i42 of this.indices)Number.isInteger(_i42)&&0<=_i42&&_i42<_ii12&&this.data.fieldValue.push(this.data.options[_i42].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:(params=this.data).fieldValue||(params.fieldValue=[]);0===this.data.options.length&&0<this.data.fieldValue.length&&(this.data.options=this.data.fieldValue.map(value=>({exportValue:value,displayValue:value}))),this.data.combo=this.hasFieldFlag(AnnotationFieldFlag.COMBO),this.data.multiSelect=this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT),this._hasText=!0}getFieldObject(){var type=this.data.combo?"combobox":"listbox",value=0<this.data.fieldValue.length?this.data.fieldValue[0]:null;return{id:this.data.id,value:value,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:type}}amendSavedDict(annotationStorage,dict){if(this.hasIndices){for(var values=null==annotationStorage||null==(annotationStorage=annotationStorage.get(this.data.id))?void 0:annotationStorage.value,indices=(Array.isArray(values)||(values=[values]),[]),options=this.data["options"],i=0,j=0,ii=options.length;i<ii;i++)options[i].exportValue===values[j]&&(indices.push(i),j+=1);dict.set("I",indices)}}async _getAppearance(evaluator,task,intent,annotationStorage){if(this.data.combo)return super._getAppearance(evaluator,task,intent,annotationStorage);var exportedValue,intent=null==annotationStorage?void 0:annotationStorage.get(this.data.id);if(intent&&(rotation=intent.rotation,exportedValue=intent.value),void 0===rotation&&void 0===exportedValue&&!this._needAppearances)return null;void 0===exportedValue?exportedValue=this.data.fieldValue:Array.isArray(exportedValue)||(exportedValue=[exportedValue]);for(var{width:totalWidth,height:totalHeight}=this,lineCount=(90!==rotation&&270!==rotation||([totalWidth,totalHeight]=[totalHeight,totalWidth]),this.data.options.length),valueIndices=[],i=0;i<lineCount;i++){var exportValue=this.data.options[i]["exportValue"];exportedValue.includes(exportValue)&&valueIndices.push(i)}this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));var defaultAppearance,font=await WidgetAnnotation._getFontData(evaluator,task,this.data.defaultAppearanceData,this._fieldResources.mergedResources),fontSize=this.data.defaultAppearanceData["fontSize"];if(fontSize)defaultAppearance=this._defaultAppearance;else{var value,displayValue,annotationStorage=(totalHeight-1)/lineCount,lineWidth=-1;for({displayValue}of this.data.options){var width=this._getTextWidth(displayValue,font);lineWidth<width&&(lineWidth=width,value=displayValue)}[defaultAppearance,fontSize]=this._computeFontSize(annotationStorage,totalWidth-4,value,font,-1)}var rotation,lineHeight=fontSize*LINE_FACTOR,vPadding=(lineHeight-fontSize)/2,intent=Math.floor(totalHeight/lineHeight),firstIndex=0,end=(0<valueIndices.length&&(rotation=Math.min(...valueIndices),evaluator=Math.max(...valueIndices),rotation<(firstIndex=Math.max(0,evaluator-intent+1)))&&(firstIndex=rotation),Math.min(firstIndex+intent+1,lineCount)),buf=["/Tx BMC q","1 1 ".concat(totalWidth," ").concat(totalHeight," re W n")];if(valueIndices.length){buf.push("0.600006 0.756866 0.854904 rg");for(var index of valueIndices)firstIndex<=index&&index<end&&buf.push("1 ".concat(totalHeight-(index-firstIndex+1)*lineHeight," ").concat(totalWidth," ").concat(lineHeight," re f"))}buf.push("BT",defaultAppearance,"1 0 0 1 0 ".concat(totalHeight," Tm"));for(var prevInfo={shift:0},_i43=firstIndex;_i43<end;_i43++){var _displayValue=this.data.options[_i43]["displayValue"];buf.push(this._renderText(_displayValue,font,fontSize,totalWidth,0,prevInfo,2,(_i43===firstIndex?vPadding:0)-lineHeight))}return buf.push("ET Q EMC"),buf.join("\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(params){super(params),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(params){super(params),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,params=params.dict;this.data.annotationType=AnnotationType.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=params.has("Name")?params.get("Name").name:"Note"),params.has("State")?(this.data.state=params.get("State")||null,this.data.stateModel=params.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}}class LinkAnnotation extends Annotation{constructor(params){super(params);var{dict:params,annotationGlobals}=params,quadPoints=(this.data.annotationType=AnnotationType.LINK,this.data.noHTML=!1,getQuadPoints(params,this.rectangle));quadPoints&&(this.data.quadPoints=quadPoints),(quadPoints=this.data).borderColor||(quadPoints.borderColor=this.data.color),Catalog.parseDestDictionary({destDict:params,resultObj:this.data,docBaseUrl:annotationGlobals.baseUrl,docAttachments:annotationGlobals.attachments})}}class PopupAnnotation extends Annotation{constructor(params){super(params);var parentFlags,params=params["dict"],parentItem=(this.data.annotationType=AnnotationType.POPUP,this.data.noHTML=!1,0!==this.width&&0!==this.height||(this.data.rect=null),params.get("Parent"));parentItem?(this.data.parentRect=lookupNormalRect(parentItem.getArray("Rect"),null),(parentItem=isName(parentItem.get("RT"),AnnotationReplyType.GROUP)?parentItem.get("IRT"):parentItem).has("M")?(this.setModificationDate(parentItem.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,parentItem.has("C")?(this.setColor(parentItem.getArray("C")),this.data.color=this.color):this.data.color=null,this.viewable||(parentFlags=parentItem.get("F"),this._isViewable(parentFlags)&&this.setFlags(parentFlags)),this.setTitle(parentItem.get("T")),this.data.titleObj=this._title,this.setContents(parentItem.get("Contents")),this.data.contentsObj=this._contents,parentItem.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(parentItem.get("RC"))),this.data.open=!!params.get("Open")):warn("Popup annotation has a missing or invalid parent annotation.")}}class FreeTextAnnotation extends MarkupAnnotation{constructor(params){super(params),this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1;var matrix,coords,bbox,{annotationGlobals,evaluatorOptions,xref}=params;this.data.annotationType=AnnotationType.FREETEXT,this.setDefaultAppearance(params),this._hasAppearance=!!this.appearance,this._hasAppearance?({fontColor:evaluatorOptions,fontSize:annotationGlobals}=parseAppearanceStream(this.appearance,evaluatorOptions,xref,annotationGlobals.globalColorSpaceCache),this.data.defaultAppearanceData.fontColor=evaluatorOptions,this.data.defaultAppearanceData.fontSize=annotationGlobals||10):({fontColor:annotationGlobals,fontSize:evaluatorOptions}=((evaluatorOptions=this.data.defaultAppearanceData).fontSize||(evaluatorOptions.fontSize=10),this.data.defaultAppearanceData),this._contents.str&&(this.data.textContent=this._contents.str.split(/\r\n?|\n/).map(line=>line.trimEnd()),{coords,bbox,matrix}=FakeUnicodeFont.getFirstPositionInfo(this.rectangle,this.rotation,evaluatorOptions),this.data.textPosition=this._transformPoint(coords,bbox,matrix)),this._isOffscreenCanvasSupported?(coords=params.dict.get("CA"),bbox=new FakeUnicodeFont(xref,"sans-serif"),this.appearance=bbox.createAppearance(this._contents.str,this.rectangle,this.rotation,evaluatorOptions,annotationGlobals,coords),this._streams.push(this.appearance)):warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly."))}get hasTextContent(){return this._hasAppearance}static createNewDict(annotation,xref,_ref70){var{apRef:_ref70,ap}=_ref70,{color:annotation,fontSize,oldAnnotation,rect,rotation,user,value}=annotation,freetext=oldAnnotation||new Dict(xref),oldAnnotation=(freetext.set("Type",Name.get("Annot")),freetext.set("Subtype",Name.get("FreeText")),oldAnnotation?(freetext.set("M","D:".concat(getModificationDate())),freetext.delete("RC")):freetext.set("CreationDate","D:".concat(getModificationDate())),freetext.set("Rect",rect),"/Helv ".concat(fontSize," Tf ").concat(getPdfColor(annotation,!0)));return freetext.set("DA",oldAnnotation),freetext.set("Contents",stringToAsciiOrUTF16BE(value)),freetext.set("F",4),freetext.set("Border",[0,0,0]),freetext.set("Rotate",rotation),user&&freetext.set("T",stringToAsciiOrUTF16BE(user)),(_ref70||ap)&&(rect=new Dict(xref),freetext.set("AP",rect),_ref70?rect.set("N",_ref70):rect.set("N",ap)),freetext}static async createNewAppearanceStream(annotation,xref,params){var line,{baseFontRef:params,evaluator,task}=params,{color:annotation,fontSize,rect,rotation,value}=annotation,resources=new Dict(xref),font=new Dict(xref),helv=(params?font.set("Helv",params):((params=new Dict(xref)).set("BaseFont",Name.get("Helvetica")),params.set("Type",Name.get("Font")),params.set("Subtype",Name.get("Type1")),params.set("Encoding",Name.get("WinAnsiEncoding")),font.set("Helv",params)),resources.set("Font",font),await WidgetAnnotation._getFontData(evaluator,task,{fontName:"Helv",fontSize:fontSize},resources)),[params,font,evaluator,task]=rect,w=evaluator-params,h=task-font,evaluator=(rotation%180!=0&&([w,h]=[h,w]),value.split("\n")),scale=fontSize/1e3,totalWidth=-1/0,encodedLines=[];for(line of evaluator){var encoded=helv.encodeString(line);if(1<encoded.length)return null;line=encoded.join(""),encodedLines.push(line);var glyph,lineWidth=0;for(glyph of helv.charsToGlyphs(line))lineWidth+=glyph.width*scale;totalWidth=Math.max(totalWidth,lineWidth)}var params=1,task=(w<totalWidth&&(params=w/totalWidth),1),font=LINE_FACTOR*fontSize,lineAscent=(LINE_FACTOR-LINE_DESCENT_FACTOR)*fontSize,value=font*evaluator.length;h<value&&(task=h/value);var firstPoint,clipBox,matrix,evaluator=fontSize*Math.min(params,task);switch(rotation){case 0:matrix=[1,0,0,1],clipBox=[rect[0],rect[1],w,h],firstPoint=[rect[0],rect[3]-lineAscent];break;case 90:matrix=[0,1,-1,0],clipBox=[rect[1],-rect[2],w,h],firstPoint=[rect[1],-rect[0]-lineAscent];break;case 180:matrix=[-1,0,0,-1],clipBox=[-rect[2],-rect[3],w,h],firstPoint=[-rect[2],-rect[1]-lineAscent];break;case 270:matrix=[0,-1,1,0],clipBox=[-rect[3],rect[0],w,h],firstPoint=[-rect[3],rect[2]-lineAscent]}for(var buffer=["q","".concat(matrix.join(" ")," 0 0 cm"),"".concat(clipBox.join(" ")," re W n"),"BT","".concat(getPdfColor(annotation,!0)),"0 Tc /Helv ".concat(numberToString(evaluator)," Tf")],vShift=(buffer.push("".concat(firstPoint.join(" ")," Td (").concat(escapeString(encodedLines[0]),") Tj")),numberToString(font)),i=1,ii=encodedLines.length;i<ii;i++){var _line3=encodedLines[i];buffer.push("0 -".concat(vShift," Td (").concat(escapeString(_line3),") Tj"))}buffer.push("ET","Q");value=buffer.join("\n"),fontSize=new Dict(xref),fontSize.set("FormType",1),fontSize.set("Subtype",Name.get("Form")),fontSize.set("Type",Name.get("XObject")),fontSize.set("BBox",rect),fontSize.set("Resources",resources),fontSize.set("Matrix",[1,0,0,1,-rect[0],-rect[1]]),params=new StringStream(value);return params.dict=fontSize,params}}class LineAnnotation extends MarkupAnnotation{constructor(params){super(params);var strokeColor,strokeAlpha,fillAlpha,borderWidth,borderAdjust,{dict:params,xref}=params,lineCoordinates=(this.data.annotationType=AnnotationType.LINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,lookupRect(params.getArray("L"),[0,0,0,0]));this.data.lineCoordinates=Util.normalizeRect(lineCoordinates),this.setLineEndings(params.getArray("LE")),this.data.lineEndings=this.lineEndings,this.appearance||(strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],strokeAlpha=params.get("CA"),fillAlpha=(params=(params=getRgbColor(params.getArray("IC"),null))?getPdfColorArray(params):null)?strokeAlpha:null,borderWidth=this.borderStyle.width||1,borderAdjust=[this.data.lineCoordinates[0]-(borderAdjust=2*borderWidth),this.data.lineCoordinates[1]-borderAdjust,this.data.lineCoordinates[2]+borderAdjust,this.data.lineCoordinates[3]+borderAdjust],Util.intersect(this.rectangle,borderAdjust)||(this.rectangle=borderAdjust),this._setDefaultAppearance({xref:xref,extra:"".concat(borderWidth," w"),strokeColor:strokeColor,fillColor:params,strokeAlpha:strokeAlpha,fillAlpha:fillAlpha,pointsCallback:(buffer,points)=>(buffer.push("".concat(lineCoordinates[0]," ").concat(lineCoordinates[1]," m"),"".concat(lineCoordinates[2]," ").concat(lineCoordinates[3]," l"),"S"),[points[0]-borderWidth,points[7]-borderWidth,points[2]+borderWidth,points[3]+borderWidth])}))}}class SquareAnnotation extends MarkupAnnotation{constructor(params){super(params);var strokeColor,strokeAlpha,fillColor,{dict:params,xref}=params;this.data.annotationType=AnnotationType.SQUARE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,!this.appearance&&(strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],strokeAlpha=params.get("CA"),params=getRgbColor(params.getArray("IC"),null),params=(fillColor=params?getPdfColorArray(params):null)?strokeAlpha:null,0!==this.borderStyle.width||fillColor)&&this._setDefaultAppearance({xref:xref,extra:"".concat(this.borderStyle.width," w"),strokeColor:strokeColor,fillColor:fillColor,strokeAlpha:strokeAlpha,fillAlpha:params,pointsCallback:(buffer,points)=>{var x=points[4]+this.borderStyle.width/2,y=points[5]+this.borderStyle.width/2,width=points[6]-points[4]-this.borderStyle.width,height=points[3]-points[7]-this.borderStyle.width;return buffer.push("".concat(x," ").concat(y," ").concat(width," ").concat(height," re")),fillColor?buffer.push("B"):buffer.push("S"),[points[0],points[7],points[2],points[3]]}})}}class CircleAnnotation extends MarkupAnnotation{constructor(params){super(params);var strokeColor,strokeAlpha,fillColor,controlPointsDistance,{dict:params,xref}=params;this.data.annotationType=AnnotationType.CIRCLE,!this.appearance&&(strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],strokeAlpha=params.get("CA"),params=getRgbColor(params.getArray("IC"),null),params=(fillColor=params?getPdfColorArray(params):null)?strokeAlpha:null,0!==this.borderStyle.width||fillColor)&&(controlPointsDistance=4/3*Math.tan(Math.PI/8),this._setDefaultAppearance({xref:xref,extra:"".concat(this.borderStyle.width," w"),strokeColor:strokeColor,fillColor:fillColor,strokeAlpha:strokeAlpha,fillAlpha:params,pointsCallback:(buffer,points)=>{var x0=points[0]+this.borderStyle.width/2,y0=points[1]-this.borderStyle.width/2,x1=points[6]-this.borderStyle.width/2,y1=points[7]+this.borderStyle.width/2,xMid=x0+(x1-x0)/2,yMid=y0+(y1-y0)/2,xOffset=(x1-x0)/2*controlPointsDistance,yOffset=(y1-y0)/2*controlPointsDistance;return buffer.push("".concat(xMid," ").concat(y1," m"),"".concat(xMid+xOffset," ").concat(y1," ").concat(x1," ").concat(yMid+yOffset," ").concat(x1," ").concat(yMid," c"),"".concat(x1," ").concat(yMid-yOffset," ").concat(xMid+xOffset," ").concat(y0," ").concat(xMid," ").concat(y0," c"),"".concat(xMid-xOffset," ").concat(y0," ").concat(x0," ").concat(yMid-yOffset," ").concat(x0," ").concat(yMid," c"),"".concat(x0," ").concat(yMid+yOffset," ").concat(xMid-xOffset," ").concat(y1," ").concat(xMid," ").concat(y1," c"),"h"),fillColor?buffer.push("B"):buffer.push("S"),[points[0],points[7],points[2],points[3]]}}))}}class PolylineAnnotation extends MarkupAnnotation{constructor(params){super(params);var{dict:params,xref}=params,rawVertices=(this.data.annotationType=AnnotationType.POLYLINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.vertices=null,this instanceof PolygonAnnotation||(this.setLineEndings(params.getArray("LE")),this.data.lineEndings=this.lineEndings),params.getArray("Vertices"));if(isNumberArray(rawVertices,null)){var vertices=this.data.vertices=Float32Array.from(rawVertices);if(!this.appearance){for(var rawVertices=this.color?getPdfColorArray(this.color):[0,0,0],params=params.get("CA"),borderWidth=this.borderStyle.width||1,borderAdjust=2*borderWidth,bbox=[1/0,1/0,-1/0,-1/0],i=0,ii=vertices.length;i<ii;i+=2)Util.rectBoundingBox(vertices[i]-borderAdjust,vertices[i+1]-borderAdjust,vertices[i]+borderAdjust,vertices[i+1]+borderAdjust,bbox);Util.intersect(this.rectangle,bbox)||(this.rectangle=bbox),this._setDefaultAppearance({xref:xref,extra:"".concat(borderWidth," w"),strokeColor:rawVertices,strokeAlpha:params,pointsCallback:(buffer,points)=>{for(var _i44=0,_ii13=vertices.length;_i44<_ii13;_i44+=2)buffer.push("".concat(vertices[_i44]," ").concat(vertices[_i44+1]," ").concat(0===_i44?"m":"l"));return buffer.push("S"),[points[0],points[7],points[2],points[3]]}})}}}}class PolygonAnnotation extends PolylineAnnotation{constructor(params){super(params),this.data.annotationType=AnnotationType.POLYGON}}class CaretAnnotation extends MarkupAnnotation{constructor(params){super(params),this.data.annotationType=AnnotationType.CARET}}class InkAnnotation extends MarkupAnnotation{constructor(params){super(params),this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;var{dict:params,xref}=params,rawInkLists=(this.data.annotationType=AnnotationType.INK,this.data.inkLists=[],this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=params.get("CA")||1,params.getArray("InkList"));if(Array.isArray(rawInkLists)){for(var i=0,ii=rawInkLists.length;i<ii;++i)if(Array.isArray(rawInkLists[i])){var inkList=new Float32Array(rawInkLists[i].length);this.data.inkLists.push(inkList);for(var j=0,jj=rawInkLists[i].length;j<jj;j+=2){var x=xref.fetchIfRef(rawInkLists[i][j]),y=xref.fetchIfRef(rawInkLists[i][j+1]);"number"==typeof x&&"number"==typeof y&&(inkList[j]=x,inkList[j+1]=y)}}if(!this.appearance){var _inkList,strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],params=params.get("CA"),borderWidth=this.borderStyle.width||1,borderAdjust=2*borderWidth,bbox=[1/0,1/0,-1/0,-1/0];for(_inkList of this.data.inkLists)for(var _i45=0,_ii14=_inkList.length;_i45<_ii14;_i45+=2)Util.rectBoundingBox(_inkList[_i45]-borderAdjust,_inkList[_i45+1]-borderAdjust,_inkList[_i45]+borderAdjust,_inkList[_i45+1]+borderAdjust,bbox);Util.intersect(this.rectangle,bbox)||(this.rectangle=bbox),this._setDefaultAppearance({xref:xref,extra:"".concat(borderWidth," w"),strokeColor:strokeColor,strokeAlpha:params,pointsCallback:(buffer,points)=>{for(var _inkList2 of this.data.inkLists){for(var _i46=0,_ii15=_inkList2.length;_i46<_ii15;_i46+=2)buffer.push("".concat(_inkList2[_i46]," ").concat(_inkList2[_i46+1]," ").concat(0===_i46?"m":"l"));buffer.push("S")}return[points[0],points[7],points[2],points[3]]}})}}}static createNewDict(annotation,xref,_ref71){var{apRef:_ref71,ap}=_ref71,{oldAnnotation:annotation,color,opacity,paths,outlines,rect,rotation,thickness,user}=annotation,ink=annotation||new Dict(xref),annotation=(ink.set("Type",Name.get("Annot")),ink.set("Subtype",Name.get("Ink")),ink.set(annotation?"M":"CreationDate","D:".concat(getModificationDate())),ink.set("Rect",rect),ink.set("InkList",(null==outlines?void 0:outlines.points)||paths.points),ink.set("F",4),ink.set("Rotate",rotation),user&&ink.set("T",stringToAsciiOrUTF16BE(user)),outlines&&ink.set("IT",Name.get("InkHighlight")),new Dict(xref)),rect=(ink.set("BS",annotation),annotation.set("W",thickness),ink.set("C",getPdfColorArray(color)),ink.set("CA",opacity),new Dict(xref));return ink.set("AP",rect),_ref71?rect.set("N",_ref71):rect.set("N",ap),ink}static async createNewAppearanceStream(annotation,xref,params){if(annotation.outlines)return this.createNewAppearanceStreamForHighlight(annotation,xref,params);var outline,{color:params,rect:annotation,paths,thickness,opacity}=annotation,appearanceBuffer=["".concat(thickness," w 1 J 1 j"),"".concat(getPdfColor(params,!1))];1!==opacity&&appearanceBuffer.push("/R0 gs");for(outline of paths.lines){appearanceBuffer.push("".concat(numberToString(outline[4])," ").concat(numberToString(outline[5])," m"));for(var c1x,c1y,c2x,c2y,x,y,i=6,ii=outline.length;i<ii;i+=6)isNaN(outline[i])?appearanceBuffer.push("".concat(numberToString(outline[i+4])," ").concat(numberToString(outline[i+5])," l")):([c1x,c1y,c2x,c2y,x,y]=outline.slice(i,i+6),appearanceBuffer.push([c1x,c1y,c2x,c2y,x,y].map(numberToString).join(" ")+" c"));6===outline.length&&appearanceBuffer.push("".concat(numberToString(outline[4])," ").concat(numberToString(outline[5])," l"))}appearanceBuffer.push("S");thickness=appearanceBuffer.join("\n"),params=new Dict(xref),params.set("FormType",1),params.set("Subtype",Name.get("Form")),params.set("Type",Name.get("XObject")),params.set("BBox",annotation),params.set("Length",thickness.length),1!==opacity&&(paths=new Dict(xref),annotation=new Dict(xref),(xref=new Dict(xref)).set("CA",opacity),xref.set("Type",Name.get("ExtGState")),annotation.set("R0",xref),paths.set("ExtGState",annotation),params.set("Resources",paths)),opacity=new StringStream(thickness);return opacity.dict=params,opacity}static async createNewAppearanceStreamForHighlight(annotation,xref,params){var{color:annotation,rect,outlines:{outline},opacity}=annotation,appearanceBuffer=["".concat(getPdfColor(annotation,!0)),"/R0 gs"];appearanceBuffer.push("".concat(numberToString(outline[4])," ").concat(numberToString(outline[5])," m"));for(var c1x,c1y,c2x,c2y,x,y,i=6,ii=outline.length;i<ii;i+=6)isNaN(outline[i])?appearanceBuffer.push("".concat(numberToString(outline[i+4])," ").concat(numberToString(outline[i+5])," l")):([c1x,c1y,c2x,c2y,x,y]=outline.slice(i,i+6),appearanceBuffer.push([c1x,c1y,c2x,c2y,x,y].map(numberToString).join(" ")+" c"));appearanceBuffer.push("h f");var annotation=appearanceBuffer.join("\n"),appearanceStreamDict=new Dict(xref),rect=(appearanceStreamDict.set("FormType",1),appearanceStreamDict.set("Subtype",Name.get("Form")),appearanceStreamDict.set("Type",Name.get("XObject")),appearanceStreamDict.set("BBox",rect),appearanceStreamDict.set("Length",annotation.length),new Dict(xref)),extGState=new Dict(xref),rect=(rect.set("ExtGState",extGState),appearanceStreamDict.set("Resources",rect),new Dict(xref)),xref=(extGState.set("R0",rect),rect.set("BM",Name.get("Multiply")),1!==opacity&&(rect.set("ca",opacity),rect.set("Type",Name.get("ExtGState"))),new StringStream(annotation));return xref.dict=appearanceStreamDict,xref}}class HighlightAnnotation extends MarkupAnnotation{constructor(params){super(params);var _this$appearance2,{dict:params,xref}=params;this.data.annotationType=AnnotationType.HIGHLIGHT,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=params.get("CA")||1,(this.data.quadPoints=getQuadPoints(params,null))?(_this$appearance2=null==(_this$appearance2=this.appearance)?void 0:_this$appearance2.dict.get("Resources"),this.appearance&&null!=_this$appearance2&&_this$appearance2.has("ExtGState")||(this.appearance&&warn("HighlightAnnotation - ignoring built-in appearance stream."),_this$appearance2=this.color?getPdfColorArray(this.color):[1,1,0],params=params.get("CA"),this._setDefaultAppearance({xref:xref,fillColor:_this$appearance2,blendMode:"Multiply",fillAlpha:params,pointsCallback:(buffer,points)=>(buffer.push("".concat(points[0]," ").concat(points[1]," m"),"".concat(points[2]," ").concat(points[3]," l"),"".concat(points[6]," ").concat(points[7]," l"),"".concat(points[4]," ").concat(points[5]," l"),"f"),[points[0],points[7],points[2],points[3]])}))):this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(annotation,xref,_ref72){var{apRef:_ref72,ap}=_ref72,{color:annotation,oldAnnotation,opacity,rect,rotation,user,quadPoints}=annotation,highlight=oldAnnotation||new Dict(xref);return highlight.set("Type",Name.get("Annot")),highlight.set("Subtype",Name.get("Highlight")),highlight.set(oldAnnotation?"M":"CreationDate","D:".concat(getModificationDate())),highlight.set("CreationDate","D:".concat(getModificationDate())),highlight.set("Rect",rect),highlight.set("F",4),highlight.set("Border",[0,0,0]),highlight.set("Rotate",rotation),highlight.set("QuadPoints",quadPoints),highlight.set("C",getPdfColorArray(annotation)),highlight.set("CA",opacity),user&&highlight.set("T",stringToAsciiOrUTF16BE(user)),(_ref72||ap)&&(oldAnnotation=new Dict(xref),highlight.set("AP",oldAnnotation),oldAnnotation.set("N",_ref72||ap)),highlight}static async createNewAppearanceStream(annotation,xref,params){var outline,{color:annotation,rect,outlines,opacity}=annotation,appearanceBuffer=["".concat(getPdfColor(annotation,!0)),"/R0 gs"],buffer=[];for(outline of outlines){buffer.length=0,buffer.push("".concat(numberToString(outline[0])," ").concat(numberToString(outline[1])," m"));for(var i=2,ii=outline.length;i<ii;i+=2)buffer.push("".concat(numberToString(outline[i])," ").concat(numberToString(outline[i+1])," l"));buffer.push("h"),appearanceBuffer.push(buffer.join("\n"))}appearanceBuffer.push("f*");var annotation=appearanceBuffer.join("\n"),outlines=new Dict(xref),rect=(outlines.set("FormType",1),outlines.set("Subtype",Name.get("Form")),outlines.set("Type",Name.get("XObject")),outlines.set("BBox",rect),outlines.set("Length",annotation.length),new Dict(xref)),extGState=new Dict(xref),rect=(rect.set("ExtGState",extGState),outlines.set("Resources",rect),new Dict(xref)),xref=(extGState.set("R0",rect),rect.set("BM",Name.get("Multiply")),1!==opacity&&(rect.set("ca",opacity),rect.set("Type",Name.get("ExtGState"))),new StringStream(annotation));return xref.dict=outlines,xref}}class UnderlineAnnotation extends MarkupAnnotation{constructor(params){super(params);var strokeColor,{dict:params,xref}=params;this.data.annotationType=AnnotationType.UNDERLINE,(this.data.quadPoints=getQuadPoints(params,null))?this.appearance||(strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],params=params.get("CA"),this._setDefaultAppearance({xref:xref,extra:"[] 0 d 0.571 w",strokeColor:strokeColor,strokeAlpha:params,pointsCallback:(buffer,points)=>(buffer.push("".concat(points[4]," ").concat(points[5]+1.3," m"),"".concat(points[6]," ").concat(points[7]+1.3," l"),"S"),[points[0],points[7],points[2],points[3]])})):this.data.popupRef=null}get overlaysTextContent(){return!0}}class SquigglyAnnotation extends MarkupAnnotation{constructor(params){super(params);var strokeColor,{dict:params,xref}=params;this.data.annotationType=AnnotationType.SQUIGGLY,(this.data.quadPoints=getQuadPoints(params,null))?this.appearance||(strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],params=params.get("CA"),this._setDefaultAppearance({xref:xref,extra:"[] 0 d 1 w",strokeColor:strokeColor,strokeAlpha:params,pointsCallback:(buffer,points)=>{var dy=(points[1]-points[5])/6,shift=dy,x=points[4],y=points[5],xEnd=points[6];for(buffer.push("".concat(x," ").concat(y+shift," m"));shift=0===shift?dy:0,buffer.push("".concat(x+=2," ").concat(y+shift," l")),x<xEnd;);return buffer.push("S"),[points[4],y-2*dy,xEnd,y+2*dy]}})):this.data.popupRef=null}get overlaysTextContent(){return!0}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(params){super(params);var strokeColor,{dict:params,xref}=params;this.data.annotationType=AnnotationType.STRIKEOUT,(this.data.quadPoints=getQuadPoints(params,null))?this.appearance||(strokeColor=this.color?getPdfColorArray(this.color):[0,0,0],params=params.get("CA"),this._setDefaultAppearance({xref:xref,extra:"[] 0 d 1 w",strokeColor:strokeColor,strokeAlpha:params,pointsCallback:(buffer,points)=>(buffer.push("".concat((points[0]+points[4])/2," ")+"".concat((points[1]+points[5])/2," m"),"".concat((points[2]+points[6])/2," ")+"".concat((points[3]+points[7])/2," l"),"S"),[points[0],points[7],points[2],points[3]])})):this.data.popupRef=null}get overlaysTextContent(){return!0}}var _savedHasOwnCanvas=new WeakMap;class StampAnnotation extends MarkupAnnotation{constructor(params){super(params),_classPrivateFieldInitSpec(this,_savedHasOwnCanvas,null),this.data.annotationType=AnnotationType.STAMP,this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1}mustBeViewedWhenEditing(isEditing){var modifiedIds=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return isEditing?(this.data.isEditable&&(null==_classPrivateFieldGet(_savedHasOwnCanvas,this)&&_classPrivateFieldSet(_savedHasOwnCanvas,this,this.data.hasOwnCanvas),this.data.hasOwnCanvas=!0),!0):(null!==_classPrivateFieldGet(_savedHasOwnCanvas,this)&&(this.data.hasOwnCanvas=_classPrivateFieldGet(_savedHasOwnCanvas,this),_classPrivateFieldSet(_savedHasOwnCanvas,this,null)),!(null!=modifiedIds&&modifiedIds.has(this.data.id)))}static async createImage(bitmap,xref){var{width,height}=bitmap,canvas=new OffscreenCanvas(width,height),ctx=canvas.getContext("2d",{alpha:!0}),data=(ctx.drawImage(bitmap,0,0),ctx.getImageData(0,0,width,height).data),buf32=new Uint32Array(data.buffer),data=buf32.some(FeatureTest.isLittleEndian?x=>x>>>24!=255:x=>255!=(255&x)),ctx=(data&&(ctx.fillStyle="white",ctx.fillRect(0,0,width,height),ctx.drawImage(bitmap,0,0)),canvas.convertToBlob({type:"image/jpeg",quality:1}).then(blob=>blob.arrayBuffer())),bitmap=Name.get("XObject"),canvas=Name.get("Image"),image=new Dict(xref),smaskStream=(image.set("Type",bitmap),image.set("Subtype",canvas),image.set("BitsPerComponent",8),image.set("ColorSpace",Name.get("DeviceRGB")),image.set("Filter",Name.get("DCTDecode")),image.set("BBox",[0,0,width,height]),image.set("Width",width),image.set("Height",height),null);if(data){var alphaBuffer=new Uint8Array(buf32.length);if(FeatureTest.isLittleEndian)for(var i=0,ii=buf32.length;i<ii;i++)alphaBuffer[i]=buf32[i]>>>24;else for(var _i47=0,_ii16=buf32.length;_i47<_ii16;_i47++)alphaBuffer[_i47]=255&buf32[_i47];data=new Dict(xref);data.set("Type",bitmap),data.set("Subtype",canvas),data.set("BitsPerComponent",8),data.set("ColorSpace",Name.get("DeviceGray")),data.set("Width",width),data.set("Height",height),smaskStream=new Stream(alphaBuffer,0,0,data)}return{imageStream:new Stream(await ctx,0,0,image),smaskStream:smaskStream,width:width,height:height}}static createNewDict(annotation,xref,_ref73){var{apRef:_ref73,ap}=_ref73,{oldAnnotation:annotation,rect,rotation,user}=annotation,stamp=annotation||new Dict(xref);return stamp.set("Type",Name.get("Annot")),stamp.set("Subtype",Name.get("Stamp")),stamp.set(annotation?"M":"CreationDate","D:".concat(getModificationDate())),stamp.set("Rect",rect),stamp.set("F",4),stamp.set("Border",[0,0,0]),stamp.set("Rotate",rotation),user&&stamp.set("T",stringToAsciiOrUTF16BE(user)),(_ref73||ap)&&(annotation=new Dict(xref),stamp.set("AP",annotation),_ref73?annotation.set("N",_ref73):annotation.set("N",ap)),stamp}static async createNewAppearanceStream(annotation,xref,params){var width,height,xobject,resources;return annotation.oldAnnotation?null:annotation.isSignature?_assertClassBrand(StampAnnotation,this,_createNewAppearanceStreamForDrawing).call(this,annotation,xref):(annotation=annotation["rotation"],{imageRef:params,width,height}=params.image,resources=new Dict(xref),xobject=new Dict(xref),resources.set("XObject",xobject),xobject.set("Im0",params),xobject="q ".concat(width," 0 0 ").concat(height," 0 0 cm /Im0 Do Q"),(params=new Dict(xref)).set("FormType",1),params.set("Subtype",Name.get("Form")),params.set("Type",Name.get("XObject")),params.set("BBox",[0,0,width,height]),params.set("Resources",resources),annotation&&(xref=getRotationMatrix(annotation,width,height),params.set("Matrix",xref)),(resources=new StringStream(xobject)).dict=params,resources)}}async function _createNewAppearanceStreamForDrawing(annotation,xref){var line,{areContours:annotation,color,rect,lines,thickness}=annotation,appearanceBuffer=["".concat(thickness," w 1 J 1 j"),"".concat(getPdfColor(color,annotation))];for(line of lines){appearanceBuffer.push("".concat(numberToString(line[4])," ").concat(numberToString(line[5])," m"));for(var c1x,c1y,c2x,c2y,x,y,i=6,ii=line.length;i<ii;i+=6)isNaN(line[i])?appearanceBuffer.push("".concat(numberToString(line[i+4])," ").concat(numberToString(line[i+5])," l")):([c1x,c1y,c2x,c2y,x,y]=line.slice(i,i+6),appearanceBuffer.push([c1x,c1y,c2x,c2y,x,y].map(numberToString).join(" ")+" c"));6===line.length&&appearanceBuffer.push("".concat(numberToString(line[4])," ").concat(numberToString(line[5])," l"))}appearanceBuffer.push(annotation?"F":"S");thickness=appearanceBuffer.join("\n"),color=new Dict(xref),color.set("FormType",1),color.set("Subtype",Name.get("Form")),color.set("Type",Name.get("XObject")),color.set("BBox",rect),color.set("Length",thickness.length),lines=new StringStream(thickness);return lines.dict=color,lines}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(params){super(params);var{dict:params,xref}=params,xref=new FileSpec(params.get("FS"),xref),xref=(this.data.annotationType=AnnotationType.FILEATTACHMENT,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.file=xref.serializable,params.get("Name")),xref=(this.data.name=xref instanceof Name?stringToPDFString(xref.name):"PushPin",params.get("ca"));this.data.fillAlpha="number"==typeof xref&&0<=xref&&xref<=1?xref:null}}var PARAMS={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(data,offset,length){for(var h0=1732584193,h1=-271733879,h2=-1732584194,h3=271733878,paddedLength=length+72&-64,padded=new Uint8Array(paddedLength),i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;var n=paddedLength-8,w=(i<n&&(i=n),padded[i++]=length<<3&255,padded[i++]=length>>5&255,padded[i++]=length>>13&255,padded[i++]=length>>21&255,padded[i++]=length>>>29&255,i+=3,new Int32Array(16)),{k,r}=PARAMS;for(i=0;i<paddedLength;){for(j=0;j<16;++j,i+=4)w[j]=padded[i]|padded[i+1]<<8|padded[i+2]<<16|padded[i+3]<<24;for(var a=h0,b=h1,c=h2,d=h3,f=void 0,g=void 0,j=0;j<64;++j)var g=j<16?(f=b&c|~b&d,j):j<32?(f=d&b|~d&c,5*j+1&15):j<48?(f=b^c^d,3*j+5&15):(f=c^(b|~d),7*j&15),tmp=d,rotateArg=a+f+k[j]+w[g]|0,rotate=r[j],d=c,c=b,b=b+(rotateArg<<rotate|rotateArg>>>32-rotate)|0,a=tmp;h0=h0+a|0,h1=h1+b|0,h2=h2+c|0,h3=h3+d|0}return new Uint8Array([255&h0,h0>>8&255,h0>>16&255,h0>>>24&255,255&h1,h1>>8&255,h1>>16&255,h1>>>24&255,255&h2,h2>>8&255,h2>>16&255,h2>>>24&255,255&h3,h3>>8&255,h3>>16&255,h3>>>24&255])}function decodeString(str){try{return stringToUTF8String(str)}catch(ex){return warn('UTF-8 decoding failed: "'.concat(ex,'".')),str}}class DatasetXMLParser extends SimpleXMLParser{constructor(options){super(options),this.node=null}onEndElement(name){var node=super.onEndElement(name);if(node&&"xfa:datasets"===name)throw this.node=node,new Error("Aborting DatasetXMLParser.")}}class DatasetReader{constructor(data){if(data.datasets)this.node=new SimpleXMLParser({hasAttributes:!0}).parseFromString(data.datasets).documentElement;else{var parser=new DatasetXMLParser({hasAttributes:!0});try{parser.parseFromString(data["xdp:xdp"])}catch(_unused11){}this.node=parser.node}}getValue(path){var first;return this.node&&(path=path&&this.node.searchNode(parseXFAPath(path),0))?"value"===(null==(first=path.firstChild)?void 0:first.nodeName)?path.children.map(child=>decodeString(child.textContent)):decodeString(path.textContent):""}}var _annotation=new WeakMap,_minX=new WeakMap,_minY=new WeakMap,_maxX=new WeakMap,_maxY=new WeakMap,_quadPoints=new WeakMap,_text=new WeakMap,_extraChars=new WeakMap,_lastIntersectingQuadIndex=new WeakMap,_canTakeExtraChars=new WeakMap,_SingleIntersector_brand=new WeakSet;class SingleIntersector{constructor(annotation){_classPrivateMethodInitSpec(this,_SingleIntersector_brand),_classPrivateFieldInitSpec(this,_annotation,void 0),_classPrivateFieldInitSpec(this,_minX,1/0),_classPrivateFieldInitSpec(this,_minY,1/0),_classPrivateFieldInitSpec(this,_maxX,-1/0),_classPrivateFieldInitSpec(this,_maxY,-1/0),_classPrivateFieldInitSpec(this,_quadPoints,void 0),_classPrivateFieldInitSpec(this,_text,[]),_classPrivateFieldInitSpec(this,_extraChars,[]),_classPrivateFieldInitSpec(this,_lastIntersectingQuadIndex,-1),_classPrivateFieldInitSpec(this,_canTakeExtraChars,!1),_classPrivateFieldSet(_annotation,this,annotation);for(var _quadPoints2=_classPrivateFieldSet(_quadPoints,this,annotation.data.quadPoints),i=0,ii=_quadPoints2.length;i<ii;i+=8)_classPrivateFieldSet(_minX,this,Math.min(_classPrivateFieldGet(_minX,this),_quadPoints2[i])),_classPrivateFieldSet(_maxX,this,Math.max(_classPrivateFieldGet(_maxX,this),_quadPoints2[i+2])),_classPrivateFieldSet(_minY,this,Math.min(_classPrivateFieldGet(_minY,this),_quadPoints2[i+5])),_classPrivateFieldSet(_maxY,this,Math.max(_classPrivateFieldGet(_maxY,this),_quadPoints2[i+1]))}overlaps(other){return!(_classPrivateFieldGet(_minX,this)>=_classPrivateFieldGet(_maxX,other)||_classPrivateFieldGet(_maxX,this)<=_classPrivateFieldGet(_minX,other)||_classPrivateFieldGet(_minY,this)>=_classPrivateFieldGet(_maxY,other)||_classPrivateFieldGet(_maxY,this)<=_classPrivateFieldGet(_minY,other))}addGlyph(x,y,glyph){return _assertClassBrand(_SingleIntersector_brand,this,_intersects).call(this,x,y)?(0<_classPrivateFieldGet(_extraChars,this).length&&(_classPrivateFieldGet(_text,this).push(_classPrivateFieldGet(_extraChars,this).join("")),_classPrivateFieldGet(_extraChars,this).length=0),_classPrivateFieldGet(_text,this).push(glyph),_classPrivateFieldSet(_canTakeExtraChars,this,!0),!0):(this.disableExtraChars(),!1)}addExtraChar(char){_classPrivateFieldGet(_canTakeExtraChars,this)&&_classPrivateFieldGet(_extraChars,this).push(char)}disableExtraChars(){_classPrivateFieldGet(_canTakeExtraChars,this)&&(_classPrivateFieldSet(_canTakeExtraChars,this,!1),_classPrivateFieldGet(_extraChars,this).length=0)}setText(){_classPrivateFieldGet(_annotation,this).data.overlaidText=_classPrivateFieldGet(_text,this).join("")}}function _intersects(x,y){if(!(_classPrivateFieldGet(_minX,this)>=x||_classPrivateFieldGet(_maxX,this)<=x||_classPrivateFieldGet(_minY,this)>=y||_classPrivateFieldGet(_maxY,this)<=y)){var quadPoints=_classPrivateFieldGet(_quadPoints,this);if(8===quadPoints.length)return!0;if(0<=_classPrivateFieldGet(_lastIntersectingQuadIndex,this)){var i=_classPrivateFieldGet(_lastIntersectingQuadIndex,this);if(!(quadPoints[i]>=x||quadPoints[i+2]<=x||quadPoints[i+5]>=y||quadPoints[i+1]<=y))return!0;_classPrivateFieldSet(_lastIntersectingQuadIndex,this,-1)}for(var _i54=0,ii=quadPoints.length;_i54<ii;_i54+=8)if(!(quadPoints[_i54]>=x||quadPoints[_i54+2]<=x||quadPoints[_i54+5]>=y||quadPoints[_i54+1]<=y))return _classPrivateFieldSet(_lastIntersectingQuadIndex,this,_i54),!0}return!1}var _intersectors=new WeakMap;class Intersector{constructor(annotations){_classPrivateFieldInitSpec(this,_intersectors,new Map);for(var annotation of annotations)if(annotation.data.quadPoints){var otherIntersector,overlapping,intersector=new SingleIntersector(annotation);for([otherIntersector,overlapping]of _classPrivateFieldGet(_intersectors,this))otherIntersector.overlaps(intersector)&&(overlapping?overlapping.add(intersector):_classPrivateFieldGet(_intersectors,this).set(otherIntersector,new Set([intersector])));_classPrivateFieldGet(_intersectors,this).set(intersector,null)}}addGlyph(transform,width,height,glyph){var overlappingIntersectors,intersector,overlapping,x=transform[4]+width/2,y=transform[5]+height/2;for([intersector,overlapping]of _classPrivateFieldGet(_intersectors,this))overlappingIntersectors?overlappingIntersectors.has(intersector)?intersector.addGlyph(x,y,glyph):intersector.disableExtraChars():intersector.addGlyph(x,y,glyph)&&(overlappingIntersectors=overlapping)}addExtraChar(char){for(var intersector of _classPrivateFieldGet(_intersectors,this).keys())intersector.addExtraChar(char)}setText(){for(var intersector of _classPrivateFieldGet(_intersectors,this).keys())intersector.setText()}}class Word64{constructor(highInteger,lowInteger){this.high=0|highInteger,this.low=0|lowInteger}and(word){this.high&=word.high,this.low&=word.low}xor(word){this.high^=word.high,this.low^=word.low}shiftRight(places){32<=places?(this.low=this.high>>>places-32|0,this.high=0):(this.low=this.low>>>places|this.high<<32-places,this.high=this.high>>>places|0)}rotateRight(places){var low,high;32&places?(high=this.low,low=this.high):(low=this.low,high=this.high),this.low=low>>>(places&=31)|high<<32-places,this.high=high>>>places|low<<32-places}not(){this.high=~this.high,this.low=~this.low}add(word){var lowAdd=(this.low>>>0)+(word.low>>>0),word=(this.high>>>0)+(word.high>>>0);4294967295<lowAdd&&(word+=1),this.low=0|lowAdd,this.high=0|word}copyTo(bytes,offset){bytes[offset]=this.high>>>24&255,bytes[offset+1]=this.high>>16&255,bytes[offset+2]=this.high>>8&255,bytes[offset+3]=255&this.high,bytes[offset+4]=this.low>>>24&255,bytes[offset+5]=this.low>>16&255,bytes[offset+6]=this.low>>8&255,bytes[offset+7]=255&this.low}assign(word){this.high=word.high,this.low=word.low}}var calculate_sha_other_PARAMS={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(result,x,y,z,tmp){result.assign(x),result.and(y),tmp.assign(x),tmp.not(),tmp.and(z),result.xor(tmp)}function maj(result,x,y,z,tmp){result.assign(x),result.and(y),tmp.assign(x),tmp.and(z),result.xor(tmp),tmp.assign(y),tmp.and(z),result.xor(tmp)}function sigma(result,x,tmp){result.assign(x),result.rotateRight(28),tmp.assign(x),tmp.rotateRight(34),result.xor(tmp),tmp.assign(x),tmp.rotateRight(39),result.xor(tmp)}function sigmaPrime(result,x,tmp){result.assign(x),result.rotateRight(14),tmp.assign(x),tmp.rotateRight(18),result.xor(tmp),tmp.assign(x),tmp.rotateRight(41),result.xor(tmp)}function littleSigma(result,x,tmp){result.assign(x),result.rotateRight(1),tmp.assign(x),tmp.rotateRight(8),result.xor(tmp),tmp.assign(x),tmp.shiftRight(7),result.xor(tmp)}function littleSigmaPrime(result,x,tmp){result.assign(x),result.rotateRight(19),tmp.assign(x),tmp.rotateRight(61),result.xor(tmp),tmp.assign(x),tmp.shiftRight(6),result.xor(tmp)}function calculateSHA512(data,offset,length){for(var h0,h1,h2,h3,h4,h5,h6,j,mode384=3<arguments.length&&void 0!==arguments[3]&&arguments[3],h7=mode384?(h0=new Word64(3418070365,3238371032),h1=new Word64(1654270250,914150663),h2=new Word64(2438529370,812702999),h3=new Word64(355462360,4144912697),h4=new Word64(1731405415,4290775857),h5=new Word64(2394180231,1750603025),h6=new Word64(3675008525,1694076839),new Word64(1203062813,3204075428)):(h0=new Word64(1779033703,4089235720),h1=new Word64(3144134277,2227873595),h2=new Word64(1013904242,4271175723),h3=new Word64(2773480762,1595750129),h4=new Word64(1359893119,2917565137),h5=new Word64(2600822924,725511199),h6=new Word64(528734635,4215389547),new Word64(1541459225,327033209)),paddedLength=128*Math.ceil((length+17)/128),padded=new Uint8Array(paddedLength),i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;var n=paddedLength-16,w=(i<n&&(i=n),i+=11,padded[i++]=length>>>29&255,padded[i++]=length>>21&255,padded[i++]=length>>13&255,padded[i++]=length>>5&255,padded[i++]=length<<3&255,new Array(80));for(i=0;i<80;i++)w[i]=new Word64(0,0);var tmp3,result,k=calculate_sha_other_PARAMS["k"],a=new Word64(0,0),b=new Word64(0,0),c=new Word64(0,0),d=new Word64(0,0),e=new Word64(0,0),f=new Word64(0,0),g=new Word64(0,0),h=new Word64(0,0),t1=new Word64(0,0),t2=new Word64(0,0),tmp1=new Word64(0,0),tmp2=new Word64(0,0);for(i=0;i<paddedLength;){for(j=0;j<16;++j)w[j].high=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],w[j].low=padded[i+4]<<24|padded[i+5]<<16|padded[i+6]<<8|padded[i+7],i+=8;for(j=16;j<80;++j)littleSigmaPrime(tmp3=w[j],w[j-2],tmp2),tmp3.add(w[j-7]),littleSigma(tmp1,w[j-15],tmp2),tmp3.add(tmp1),tmp3.add(w[j-16]);for(a.assign(h0),b.assign(h1),c.assign(h2),d.assign(h3),e.assign(h4),f.assign(h5),g.assign(h6),h.assign(h7),j=0;j<80;++j)t1.assign(h),sigmaPrime(tmp1,e,tmp2),t1.add(tmp1),ch(tmp1,e,f,g,tmp2),t1.add(tmp1),t1.add(k[j]),t1.add(w[j]),sigma(t2,a,tmp2),maj(tmp1,a,b,c,tmp2),t2.add(tmp1),tmp3=h,h=g,g=f,f=e,d.add(t1),e=d,d=c,c=b,b=a,tmp3.assign(t1),tmp3.add(t2),a=tmp3;h0.add(a),h1.add(b),h2.add(c),h3.add(d),h4.add(e),h5.add(f),h6.add(g),h7.add(h)}return mode384?(result=new Uint8Array(48),h0.copyTo(result,0),h1.copyTo(result,8),h2.copyTo(result,16),h3.copyTo(result,24),h4.copyTo(result,32),h5.copyTo(result,40)):(result=new Uint8Array(64),h0.copyTo(result,0),h1.copyTo(result,8),h2.copyTo(result,16),h3.copyTo(result,24),h4.copyTo(result,32),h5.copyTo(result,40),h6.copyTo(result,48),h7.copyTo(result,56)),result}function calculateSHA384(data,offset,length){return calculateSHA512(data,offset,length,!0)}var calculate_sha256_PARAMS={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(x,n){return x>>>n|x<<32-n}function calculate_sha256_ch(x,y,z){return x&y^~x&z}function calculate_sha256_maj(x,y,z){return x&y^x&z^y&z}function calculate_sha256_sigma(x){return rotr(x,2)^rotr(x,13)^rotr(x,22)}function calculate_sha256_sigmaPrime(x){return rotr(x,6)^rotr(x,11)^rotr(x,25)}function calculate_sha256_littleSigma(x){return rotr(x,7)^rotr(x,18)^x>>>3}function calculate_sha256_littleSigmaPrime(x){return rotr(x,17)^rotr(x,19)^x>>>10}function calculateSHA256(data,offset,length){for(var h0=1779033703,h1=3144134277,h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225,paddedLength=64*Math.ceil((length+9)/64),padded=new Uint8Array(paddedLength),i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;var n=paddedLength-8,w=(i<n&&(i=n),i+=3,padded[i++]=length>>>29&255,padded[i++]=length>>21&255,padded[i++]=length>>13&255,padded[i++]=length>>5&255,padded[i++]=length<<3&255,new Uint32Array(64)),k=calculate_sha256_PARAMS["k"];for(i=0;i<paddedLength;){for(j=0;j<16;++j)w[j]=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],i+=4;for(j=16;j<64;++j)w[j]=calculate_sha256_littleSigmaPrime(w[j-2])+w[j-7]+calculate_sha256_littleSigma(w[j-15])+w[j-16]|0;for(var t1,t2,a=h0,b=h1,c=h2,d=h3,e=h4,f=h5,g=h6,h=h7,j=0;j<64;++j)t1=h+calculate_sha256_sigmaPrime(e)+calculate_sha256_ch(e,f,g)+k[j]+w[j],t2=calculate_sha256_sigma(a)+calculate_sha256_maj(a,b,c),h=g,g=f,f=e,e=d+t1|0,d=c,c=b,b=a,a=t1+t2|0;h0=h0+a|0,h1=h1+b|0,h2=h2+c|0,h3=h3+d|0,h4=h4+e|0,h5=h5+f|0,h6=h6+g|0,h7=h7+h|0}return new Uint8Array([h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6,h7>>24&255,h7>>16&255,h7>>8&255,255&h7])}var chunkSize=512;class DecryptStream extends DecodeStream{constructor(str,maybeLength,decrypt){super(maybeLength),this.str=str,this.dict=str.dict,this.decrypt=decrypt,this.nextChunk=null,this.initialized=!1}readBlock(){var chunk,_this$nextChunk,newLength;this.initialized?chunk=this.nextChunk:(chunk=this.str.getBytes(chunkSize),this.initialized=!0),null!=chunk&&chunk.length?(this.nextChunk=this.str.getBytes(chunkSize),_this$nextChunk=0<(null==(_this$nextChunk=this.nextChunk)?void 0:_this$nextChunk.length),chunk=(0,this.decrypt)(chunk,!_this$nextChunk),newLength=(_this$nextChunk=this.bufferLength)+chunk.length,this.ensureBuffer(newLength).set(chunk,_this$nextChunk),this.bufferLength=newLength):this.eof=!0}}class ARCFourCipher{constructor(key){this.a=0,this.b=0;for(var s=new Uint8Array(256),keyLength=key.length,i=0;i<256;++i)s[i]=i;for(var _i48=0,j=0;_i48<256;++_i48){var tmp=s[_i48],j=j+tmp+key[_i48%keyLength]&255;s[_i48]=s[j],s[j]=tmp}this.s=s}encryptBlock(data){for(var a=this.a,b=this.b,s=this.s,n=data.length,output=new Uint8Array(n),i=0;i<n;++i){var tmp=s[a=a+1&255],tmp2=s[b=b+tmp&255];s[a]=tmp2,s[b]=tmp,output[i]=data[i]^s[tmp+tmp2&255]}return this.a=a,this.b=b,output}decryptBlock(data){return this.encryptBlock(data)}encrypt(data){return this.encryptBlock(data)}}class NullCipher{decryptBlock(data){return data}encrypt(data){return data}}class AESBaseCipher{constructor(){_defineProperty(this,"_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])),_defineProperty(this,"_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])),_defineProperty(this,"_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])),_defineProperty(this,"_mixCol",new Uint8Array(256).map((_,i)=>i<128?i<<1:i<<1^27)),this.buffer=new Uint8Array(16),this.bufferPosition=0}_expandKey(cipherKey){unreachable("Cannot call `_expandKey` on the base class")}_decrypt(input,key){var u,v,state=new Uint8Array(16);state.set(input);for(var j=0,k=this._keySize;j<16;++j,++k)state[j]^=key[k];for(var i=this._cyclesOfRepetition-1;1<=i;--i){t=state[13],state[13]=state[9],state[9]=state[5],state[5]=state[1],state[1]=t,t=state[14],u=state[10],state[14]=state[6],state[10]=state[2],state[6]=t,state[2]=u,t=state[15],u=state[11],v=state[7],state[15]=state[3],state[11]=t,state[7]=u,state[3]=v;for(var _j0=0;_j0<16;++_j0)state[_j0]=this._inv_s[state[_j0]];for(var _j1=0,_k2=16*i;_j1<16;++_j1,++_k2)state[_j1]^=key[_k2];for(var _j10=0;_j10<16;_j10+=4){var s0=this._mix[state[_j10]],s1=this._mix[state[_j10+1]],s2=this._mix[state[_j10+2]],s3=this._mix[state[_j10+3]],t=s0^s1>>>8^s1<<24^s2>>>16^s2<<16^s3>>>24^s3<<8;state[_j10]=t>>>24&255,state[_j10+1]=t>>16&255,state[_j10+2]=t>>8&255,state[_j10+3]=255&t}}t=state[13],state[13]=state[9],state[9]=state[5],state[5]=state[1],state[1]=t,t=state[14],u=state[10],state[14]=state[6],state[10]=state[2],state[6]=t,state[2]=u,t=state[15],u=state[11],v=state[7],state[15]=state[3],state[11]=t,state[7]=u,state[3]=v;for(var _j11=0;_j11<16;++_j11)state[_j11]=this._inv_s[state[_j11]],state[_j11]^=key[_j11];return state}_encrypt(input,key){var u,v,s=this._s,state=new Uint8Array(16);state.set(input);for(var j=0;j<16;++j)state[j]^=key[j];for(var i=1;i<this._cyclesOfRepetition;i++){for(var _j12=0;_j12<16;++_j12)state[_j12]=s[state[_j12]];v=state[1],state[1]=state[5],state[5]=state[9],state[9]=state[13],state[13]=v,v=state[2],u=state[6],state[2]=state[10],state[6]=state[14],state[10]=v,state[14]=u,v=state[3],u=state[7],t=state[11],state[3]=state[15],state[7]=v,state[11]=u,state[15]=t;for(var _j13=0;_j13<16;_j13+=4){var s0=state[_j13],s1=state[_j13+1],s2=state[_j13+2],s3=state[_j13+3],t=s0^s1^s2^s3;state[_j13]^=t^this._mixCol[s0^s1],state[_j13+1]^=t^this._mixCol[s1^s2],state[_j13+2]^=t^this._mixCol[s2^s3],state[_j13+3]^=t^this._mixCol[s3^s0]}for(var _j14=0,k=16*i;_j14<16;++_j14,++k)state[_j14]^=key[k]}for(var _j15=0;_j15<16;++_j15)state[_j15]=s[state[_j15]];v=state[1],state[1]=state[5],state[5]=state[9],state[9]=state[13],state[13]=v,v=state[2],u=state[6],state[2]=state[10],state[6]=state[14],state[10]=v,state[14]=u,v=state[3],u=state[7],t=state[11],state[3]=state[15],state[7]=v,state[11]=u,state[15]=t;for(var _j16=0,_k3=this._keySize;_j16<16;++_j16,++_k3)state[_j16]^=key[_k3];return state}_decryptBlock2(data,finalize){for(var sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv,i=0;i<sourceLength;++i)if(buffer[bufferLength]=data[i],!(++bufferLength<16)){for(var plain=this._decrypt(buffer,this._key),j=0;j<16;++j)plain[j]^=iv[j];iv=buffer,result.push(plain),buffer=new Uint8Array(16),bufferLength=0}if(this.buffer=buffer,this.bufferLength=bufferLength,this.iv=iv,0===result.length)return new Uint8Array(0);var outputLength=16*result.length;if(finalize){var lastBlock=result.at(-1),psLen=lastBlock[15];if(psLen<=16){for(var _i49=15,ii=16-psLen;ii<=_i49;--_i49)if(lastBlock[_i49]!==psLen){psLen=0;break}outputLength-=psLen,result[result.length-1]=lastBlock.subarray(0,16-psLen)}}for(var output=new Uint8Array(outputLength),_i50=0,_j17=0,_ii17=result.length;_i50<_ii17;++_i50,_j17+=16)output.set(result[_i50],_j17);return output}decryptBlock(data,finalize){var iv=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition;if(iv)this.iv=iv;else{for(var i=0;bufferLength<16&&i<sourceLength;++i,++bufferLength)buffer[bufferLength]=data[i];if(bufferLength<16)return this.bufferLength=bufferLength,new Uint8Array(0);this.iv=buffer,data=data.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=this._decryptBlock2,this.decryptBlock(data,finalize)}encrypt(data,iv){var sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[];iv=iv||new Uint8Array(16);for(var i=0;i<sourceLength;++i)if(buffer[bufferLength]=data[i],!(++bufferLength<16)){for(var j=0;j<16;++j)buffer[j]^=iv[j];var cipher=this._encrypt(buffer,this._key);result.push(iv=cipher),buffer=new Uint8Array(16),bufferLength=0}if(this.buffer=buffer,this.bufferLength=bufferLength,this.iv=iv,0===result.length)return new Uint8Array(0);for(var output=new Uint8Array(16*result.length),_i51=0,_j18=0,ii=result.length;_i51<ii;++_i51,_j18+=16)output.set(result[_i51],_j18);return output}}class AES128Cipher extends AESBaseCipher{constructor(key){super(),_defineProperty(this,"_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])),this._cyclesOfRepetition=10,this._keySize=160,this._key=this._expandKey(key)}_expandKey(cipherKey){var s=this._s,rcon=this._rcon,result=new Uint8Array(176);result.set(cipherKey);for(var j=16,i=1;j<176;++i){var t1=result[j-3],t2=result[j-2],t3=result[j-1],t4=result[j-4],t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4];t1^=rcon[i];for(var n=0;n<4;++n)result[j]=t1^=result[j-16],result[++j]=t2^=result[j-16],result[++j]=t3^=result[j-16],result[++j]=t4^=result[j-16],j++}return result}}class AES256Cipher extends AESBaseCipher{constructor(key){super(),this._cyclesOfRepetition=14,this._keySize=224,this._key=this._expandKey(key)}_expandKey(cipherKey){for(var t1,t2,t3,t4,s=this._s,result=new Uint8Array(240),r=(result.set(cipherKey),1),j=32;j<240;){j%32==16?(t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4]):j%32==0&&(t1=result[j-3],t2=result[j-2],t3=result[j-1],t4=result[j-4],t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4],t1^=r,256<=(r<<=1))&&(r=255&(27^r));for(var n=0;n<4;++n)result[j]=t1^=result[j-32],result[++j]=t2^=result[j-32],result[++j]=t3^=result[j-32],result[++j]=t4^=result[j-32],j++}return result}}class PDFBase{_hash(password,input,userBytes){unreachable("Abstract method `_hash` called")}checkOwnerPassword(password,ownerValidationSalt,userBytes,ownerPassword){var hashData=new Uint8Array(password.length+56);return hashData.set(password,0),hashData.set(ownerValidationSalt,password.length),hashData.set(userBytes,password.length+ownerValidationSalt.length),isArrayEqual(this._hash(password,hashData,userBytes),ownerPassword)}checkUserPassword(password,userValidationSalt,userPassword){var hashData=new Uint8Array(password.length+8);return hashData.set(password,0),hashData.set(userValidationSalt,password.length),isArrayEqual(this._hash(password,hashData,[]),userPassword)}getOwnerKey(password,ownerKeySalt,userBytes,ownerEncryption){var hashData=new Uint8Array(password.length+56),ownerKeySalt=(hashData.set(password,0),hashData.set(ownerKeySalt,password.length),hashData.set(userBytes,password.length+ownerKeySalt.length),this._hash(password,hashData,userBytes));return new AES256Cipher(ownerKeySalt).decryptBlock(ownerEncryption,!1,new Uint8Array(16))}getUserKey(password,userKeySalt,userEncryption){var hashData=new Uint8Array(password.length+8),userKeySalt=(hashData.set(password,0),hashData.set(userKeySalt,password.length),this._hash(password,hashData,[]));return new AES256Cipher(userKeySalt).decryptBlock(userEncryption,!1,new Uint8Array(16))}}class PDF17 extends PDFBase{_hash(password,input,userBytes){return calculateSHA256(input,0,input.length)}}class PDF20 extends PDFBase{_hash(password,input,userBytes){for(var k=calculateSHA256(input,0,input.length).subarray(0,32),e=[0],i=0;i<64||e.at(-1)>i-32;){for(var combinedLength=password.length+k.length+userBytes.length,combinedArray=new Uint8Array(combinedLength),writeOffset=0,k1=(combinedArray.set(password,0),writeOffset+=password.length,combinedArray.set(k,writeOffset),writeOffset+=k.length,combinedArray.set(userBytes,writeOffset),new Uint8Array(64*combinedLength)),j=0,pos=0;j<64;j++,pos+=combinedLength)k1.set(combinedArray,pos);e=new AES128Cipher(k.subarray(0,16)).encrypt(k1,k.subarray(16,32)),writeOffset=Math.sumPrecise(e.slice(0,16))%3;0==writeOffset?k=calculateSHA256(e,0,e.length):1==writeOffset?k=calculateSHA384(e,0,e.length):2==writeOffset&&(k=calculateSHA512(e,0,e.length)),i++}return k.subarray(0,32)}}class CipherTransform{constructor(stringCipherConstructor,streamCipherConstructor){this.StringCipherConstructor=stringCipherConstructor,this.StreamCipherConstructor=streamCipherConstructor}createStream(stream,length){var cipher=new this.StreamCipherConstructor;return new DecryptStream(stream,length,function(data,finalize){return cipher.decryptBlock(data,finalize)})}decryptString(s){var cipher=new this.StringCipherConstructor,s=stringToBytes(s);return bytesToString(cipher.decryptBlock(s,!0))}encryptString(s){var _data4,buf,pad,cipher=new this.StringCipherConstructor;return cipher instanceof AESBaseCipher?(pad=16-s.length%16,s+=String.fromCharCode(pad).repeat(pad),pad=new Uint8Array(16),crypto.getRandomValues(pad),_data4=stringToBytes(s),_data4=cipher.encrypt(_data4,pad),(buf=new Uint8Array(16+_data4.length)).set(pad),buf.set(_data4,16),bytesToString(buf)):(pad=stringToBytes(s),bytesToString(pad=cipher.encrypt(pad)))}}var _CipherTransformFactory_brand=new WeakSet;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]))}constructor(dict,_fileId,_password){_classPrivateMethodInitSpec(this,_CipherTransformFactory_brand);var filter=dict.get("Filter");if(!isName(filter,"Standard"))throw new FormatError("unknown encryption method");this.filterName=filter.name;filter=(this.dict=dict).get("V");if(!Number.isInteger(filter)||1!==filter&&2!==filter&&4!==filter&&5!==filter)throw new FormatError("unsupported encryption algorithm");this.algorithm=filter;var _keyLength=dict.get("Length");if(_keyLength||(filter<=3?_keyLength=40:(cfDict=dict.get("CF"),streamCryptoName=dict.get("StmF"),cfDict instanceof Dict&&streamCryptoName instanceof Name&&(cfDict.suppressEncryption=!0,(_keyLength=(null==(cfDict=cfDict.get(streamCryptoName.name))?void 0:cfDict.get("Length"))||128)<40)&&(_keyLength<<=3))),!Number.isInteger(_keyLength)||_keyLength<40||_keyLength%8!=0)throw new FormatError("invalid key length");var passwordBytes,userValidationSalt,ownerEncryption,userEncryption,perms,ownerValidationSalt,uBytes,streamCryptoName=stringToBytes(dict.get("O")),cfDict=stringToBytes(dict.get("U")),_ownerPassword=streamCryptoName.subarray(0,32),_userPassword=cfDict.subarray(0,32),_flags2=dict.get("P"),_revision=dict.get("R"),_encryptMetadata=(4===filter||5===filter)&&!1!==dict.get("EncryptMetadata"),_fileId=(this.encryptMetadata=_encryptMetadata,stringToBytes(_fileId));if(_password){if(6===_revision)try{_password=utf8StringToString(_password)}catch(_unused12){warn("CipherTransformFactory: Unable to convert UTF8 encoded password.")}passwordBytes=stringToBytes(_password)}if(!(ownerValidationSalt=5!==filter?_assertClassBrand(_CipherTransformFactory_brand,this,_prepareKeyData).call(this,_fileId,passwordBytes,_ownerPassword,_userPassword,_flags2,_revision,_keyLength,_encryptMetadata):(ownerValidationSalt=streamCryptoName.subarray(32,40),streamCryptoName=streamCryptoName.subarray(40,48),uBytes=cfDict.subarray(0,48),userValidationSalt=cfDict.subarray(32,40),cfDict=cfDict.subarray(40,48),ownerEncryption=stringToBytes(dict.get("OE")),userEncryption=stringToBytes(dict.get("UE")),perms=stringToBytes(dict.get("Perms")),_assertClassBrand(_CipherTransformFactory_brand,this,_createEncryptionKey).call(this,_revision,passwordBytes,_ownerPassword,ownerValidationSalt,streamCryptoName,uBytes,_userPassword,userValidationSalt,cfDict,ownerEncryption,userEncryption,perms)))){if(!_password)throw new PasswordException("No password given",PasswordResponses.NEED_PASSWORD);streamCryptoName=_assertClassBrand(_CipherTransformFactory_brand,this,_decodeUserPassword).call(this,passwordBytes,_ownerPassword,_revision,_keyLength);ownerValidationSalt=_assertClassBrand(_CipherTransformFactory_brand,this,_prepareKeyData).call(this,_fileId,streamCryptoName,_ownerPassword,_userPassword,_flags2,_revision,_keyLength,_encryptMetadata)}if(!ownerValidationSalt)throw new PasswordException("Incorrect Password",PasswordResponses.INCORRECT_PASSWORD);4===filter&&ownerValidationSalt.length<16?(this.encryptionKey=new Uint8Array(16),this.encryptionKey.set(ownerValidationSalt)):this.encryptionKey=ownerValidationSalt,4<=filter&&((uBytes=dict.get("CF"))instanceof Dict&&(uBytes.suppressEncryption=!0),this.cf=uBytes,this.stmf=dict.get("StmF")||Name.get("Identity"),this.strf=dict.get("StrF")||Name.get("Identity"),this.eff=dict.get("EFF")||this.stmf)}createCipherTransform(num,gen){var key;return 4===this.algorithm||5===this.algorithm?new CipherTransform(_assertClassBrand(_CipherTransformFactory_brand,this,_buildCipherConstructor).call(this,this.cf,this.strf,num,gen,this.encryptionKey),_assertClassBrand(_CipherTransformFactory_brand,this,_buildCipherConstructor).call(this,this.cf,this.stmf,num,gen,this.encryptionKey)):(key=_assertClassBrand(_CipherTransformFactory_brand,this,_buildObjectKey).call(this,num,gen,this.encryptionKey,!1),num=function(){return new ARCFourCipher(key)},new CipherTransform(num,num))}}function _createEncryptionKey(revision,password,ownerPassword,ownerValidationSalt,ownerKeySalt,uBytes,userPassword,userValidationSalt,userKeySalt,ownerEncryption,userEncryption,perms){password=password?(passwordLength=Math.min(127,password.length),password.subarray(0,passwordLength)):[];var passwordLength=new(6===revision?PDF20:PDF17);return passwordLength.checkUserPassword(password,userValidationSalt,userPassword)?passwordLength.getUserKey(password,userKeySalt,userEncryption):password.length&&passwordLength.checkOwnerPassword(password,ownerValidationSalt,uBytes,ownerPassword)?passwordLength.getOwnerKey(password,ownerKeySalt,uBytes,ownerEncryption):null}function _prepareKeyData(fileId,password,ownerPassword,userPassword,flags,revision,keyLength,encryptMetadata){var hashDataSize=40+ownerPassword.length+fileId.length,hashData=new Uint8Array(hashDataSize),i=0;if(password)for(n=Math.min(32,password.length);i<n;++i)hashData[i]=password[i];for(j=0;i<32;)hashData[i++]=_CipherTransformFactory._defaultPasswordBytes[j++];hashData.set(ownerPassword,i),i+=ownerPassword.length,hashData[i++]=255&flags,hashData[i++]=flags>>8&255,hashData[i++]=flags>>16&255,hashData[i++]=flags>>>24&255,hashData.set(fileId,i),i+=fileId.length,4<=revision&&!encryptMetadata&&(hashData.fill(255,i,i+4),i+=4);var hash=calculateMD5(hashData,0,i),keyLengthInBytes=keyLength>>3;if(3<=revision)for(j=0;j<50;++j)hash=calculateMD5(hash,0,keyLengthInBytes);var encryptionKey=hash.subarray(0,keyLengthInBytes);if(3<=revision){hashData.set(_CipherTransformFactory._defaultPasswordBytes,i=0),hashData.set(fileId,i+=32),i+=fileId.length;for(var checkData=new ARCFourCipher(encryptionKey).encryptBlock(calculateMD5(hashData,0,i)),n=encryptionKey.length,derivedKey=new Uint8Array(n),j=1;j<=19;++j){for(var k=0;k<n;++k)derivedKey[k]=encryptionKey[k]^j;checkData=new ARCFourCipher(derivedKey).encryptBlock(checkData)}}else checkData=new ARCFourCipher(encryptionKey).encryptBlock(_CipherTransformFactory._defaultPasswordBytes);return checkData.every((data,k)=>userPassword[k]===data)?encryptionKey:null}function _decodeUserPassword(password,ownerPassword,revision,keyLength){for(var hashData=new Uint8Array(32),i=0,n=Math.min(32,password.length);i<n;++i)hashData[i]=password[i];for(var j=0;i<32;)hashData[i++]=_CipherTransformFactory._defaultPasswordBytes[j++];var hash=calculateMD5(hashData,0,i),keyLengthInBytes=keyLength>>3;if(3<=revision)for(j=0;j<50;++j)hash=calculateMD5(hash,0,hash.length);if(3<=revision)for(var userPassword=ownerPassword,derivedKey=new Uint8Array(keyLengthInBytes),j=19;0<=j;j--){for(var k=0;k<keyLengthInBytes;++k)derivedKey[k]=hash[k]^j;userPassword=new ARCFourCipher(derivedKey).encryptBlock(userPassword)}else userPassword=new ARCFourCipher(hash.subarray(0,keyLengthInBytes)).encryptBlock(ownerPassword);return userPassword}function _buildObjectKey(num,gen,encryptionKey){var isAes=3<arguments.length&&void 0!==arguments[3]&&arguments[3],n=encryptionKey.length,key=new Uint8Array(n+9),i=(key.set(encryptionKey),n);return key[i++]=255&num,key[i++]=num>>8&255,key[i++]=num>>16&255,key[i++]=255&gen,key[i++]=gen>>8&255,isAes&&(key[i++]=115,key[i++]=65,key[i++]=108,key[i++]=84),calculateMD5(key,0,i).subarray(0,Math.min(n+5,16))}function _buildCipherConstructor(cf,name,num,gen,key){if(!(name instanceof Name))throw new FormatError("Invalid crypt filter name.");var self=this,cf=cf.get(name.name),name=null==cf?void 0:cf.get("CFM");if(!name||"None"===name.name)return function(){return new NullCipher};if("V2"===name.name)return function(){return new ARCFourCipher(_assertClassBrand(_CipherTransformFactory_brand,self,_buildObjectKey).call(self,num,gen,key,!1))};if("AESV2"===name.name)return function(){return new AES128Cipher(_assertClassBrand(_CipherTransformFactory_brand,self,_buildObjectKey).call(self,num,gen,key,!0))};if("AESV3"===name.name)return function(){return new AES256Cipher(key)};throw new FormatError("Unknown crypto method")}var _CipherTransformFactory=CipherTransformFactory,_firstXRefStmPos=new WeakMap;class XRef{constructor(stream,pdfManager){_classPrivateFieldInitSpec(this,_firstXRefStmPos,null),this.stream=stream,this.pdfManager=pdfManager,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new RefSet,this._newPersistentRefNum=null,this._newTemporaryRefNum=null,this._persistentRefsCache=null}getNewPersistentRef(obj){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);var num=this._newPersistentRefNum++;return this._cacheMap.set(num,obj),Ref.get(num,0)}getNewTemporaryRef(){if(null===this._newTemporaryRefNum&&(this._newTemporaryRefNum=this.entries.length||1,this._newPersistentRefNum)){this._persistentRefsCache=new Map;for(var i=this._newTemporaryRefNum;i<this._newPersistentRefNum;i++)this._persistentRefsCache.set(i,this._cacheMap.get(i)),this._cacheMap.delete(i)}return Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){if(this._newTemporaryRefNum=null,this._persistentRefsCache)for(var[num,obj]of this._persistentRefsCache)this._cacheMap.set(num,obj);this._persistentRefsCache=null}setStartXRef(startXRef){this.startXRefQueue=[startXRef]}parse(){var encrypt,ids,root,recoveryMode=0<arguments.length&&void 0!==arguments[0]&&arguments[0],trailerDict=recoveryMode?(warn("Indexing all PDF objects"),this.indexObjects()):this.readXRef();trailerDict.assignXref(this),this.trailer=trailerDict;try{encrypt=trailerDict.get("Encrypt")}catch(ex){if(ex instanceof MissingDataException)throw ex;warn('XRef.parse - Invalid "Encrypt" reference: "'.concat(ex,'".'))}encrypt instanceof Dict&&(ids=null!=(ids=trailerDict.get("ID"))&&ids.length?ids[0]:"",encrypt.suppressEncryption=!0,this.encrypt=new CipherTransformFactory(encrypt,ids,this.pdfManager.password));try{root=trailerDict.get("Root")}catch(ex){if(ex instanceof MissingDataException)throw ex;warn('XRef.parse - Invalid "Root" reference: "'.concat(ex,'".'))}if(root instanceof Dict)try{if(root.get("Pages")instanceof Dict)return void(this.root=root)}catch(ex){if(ex instanceof MissingDataException)throw ex;warn('XRef.parse - Invalid "Pages" reference: "'.concat(ex,'".'))}if(recoveryMode)throw new InvalidPDFException("Invalid Root reference.");throw new XRefParseException}processXRefTable(parser){if("tableState"in this||(this.tableState={entryNum:0,streamPos:parser.lexer.stream.pos,parserBuf1:parser.buf1,parserBuf2:parser.buf2}),!isCmd(this.readXRefTable(parser),"trailer"))throw new FormatError("Invalid XRef table: could not find trailer dictionary");parser=parser.getObj();if((parser=parser instanceof Dict||!parser.dict?parser:parser.dict)instanceof Dict)return delete this.tableState,parser;throw new FormatError("Invalid XRef table: could not parse trailer dictionary")}readXRefTable(parser){var obj,stream=parser.lexer.stream,tableState=this.tableState;for(stream.pos=tableState.streamPos,parser.buf1=tableState.parserBuf1,parser.buf2=tableState.parserBuf2;;){if(!("firstEntryNum"in tableState&&"entryCount"in tableState)){if(isCmd(obj=parser.getObj(),"trailer"))break;tableState.firstEntryNum=obj,tableState.entryCount=parser.getObj()}var first=tableState.firstEntryNum,count=tableState.entryCount;if(!Number.isInteger(first)||!Number.isInteger(count))throw new FormatError("Invalid XRef table: wrong types in subsection header");for(var i=tableState.entryNum;i<count;i++){tableState.streamPos=stream.pos,tableState.entryNum=i,tableState.parserBuf1=parser.buf1,tableState.parserBuf2=parser.buf2;var entry={},type=(entry.offset=parser.getObj(),entry.gen=parser.getObj(),parser.getObj());if(type instanceof Cmd)switch(type.cmd){case"f":entry.free=!0;break;case"n":entry.uncompressed=!0}if(!Number.isInteger(entry.offset)||!Number.isInteger(entry.gen)||!entry.free&&!entry.uncompressed)throw new FormatError("Invalid entry in XRef subsection: ".concat(first,", ").concat(count));0===i&&entry.free&&1===first&&(first=0),this.entries[i+first]||(this.entries[i+first]=entry)}tableState.entryNum=0,tableState.streamPos=stream.pos,tableState.parserBuf1=parser.buf1,tableState.parserBuf2=parser.buf2,delete tableState.firstEntryNum,delete tableState.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new FormatError("Invalid XRef table: unexpected first object");return obj}processXRefStream(stream){var pos,byteWidths,dict;return"streamState"in this||({dict,pos}=stream,byteWidths=dict.get("W"),dict=dict.get("Index")||[0,dict.get("Size")],this.streamState={entryRanges:dict,byteWidths:byteWidths,entryNum:0,streamPos:pos}),this.readXRefStream(stream),delete this.streamState,stream.dict}readXRefStream(stream){for(var streamState=this.streamState,[typeFieldWidth,offsetFieldWidth,generationFieldWidth]=(stream.pos=streamState.streamPos,streamState.byteWidths),entryRanges=streamState.entryRanges;0<entryRanges.length;){var[first,n]=entryRanges;if(!Number.isInteger(first)||!Number.isInteger(n))throw new FormatError("Invalid XRef range fields: ".concat(first,", ").concat(n));if(!Number.isInteger(typeFieldWidth)||!Number.isInteger(offsetFieldWidth)||!Number.isInteger(generationFieldWidth))throw new FormatError("Invalid XRef entry fields length: ".concat(first,", ").concat(n));for(var i=streamState.entryNum;i<n;++i){streamState.entryNum=i,streamState.streamPos=stream.pos;for(var type=0,offset=0,generation=0,j=0;j<typeFieldWidth;++j){var typeByte=stream.getByte();if(-1===typeByte)throw new FormatError("Invalid XRef byteWidths 'type'.");type=type<<8|typeByte}0===typeFieldWidth&&(type=1);for(var _j19=0;_j19<offsetFieldWidth;++_j19){var offsetByte=stream.getByte();if(-1===offsetByte)throw new FormatError("Invalid XRef byteWidths 'offset'.");offset=offset<<8|offsetByte}for(var _j20=0;_j20<generationFieldWidth;++_j20){var generationByte=stream.getByte();if(-1===generationByte)throw new FormatError("Invalid XRef byteWidths 'generation'.");generation=generation<<8|generationByte}var entry={};switch(entry.offset=offset,entry.gen=generation,type){case 0:entry.free=!0;break;case 1:entry.uncompressed=!0;break;case 2:break;default:throw new FormatError("Invalid XRef entry type: ".concat(type))}this.entries[first+i]||(this.entries[first+i]=entry)}streamState.entryNum=0,streamState.streamPos=stream.pos,entryRanges.splice(0,2)}}indexObjects(){var LF=10,CR=13,LT=60;function skipUntil(data,offset,what){for(var length=what.length,dataLength=data.length,skipped=0;offset<dataLength;){for(var i=0;i<length&&data[offset+i]===what[i];)++i;if(length<=i)break;offset++,skipped++}return skipped}for(var xrefStm,gEndobjRegExp=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g,gStartxrefRegExp=/\b(startxref|\d+\s+\d+\s+obj)\b/g,objRegExp=/^(\d+)\s+(\d+)\s+obj\b/,trailerBytes=new Uint8Array([116,114,97,105,108,101,114]),startxrefBytes=new Uint8Array([115,116,97,114,116,120,114,101,102]),xrefBytes=new Uint8Array([47,88,82,101,102]),stream=(this.entries.length=0,this._cacheMap.clear(),this.stream),buffer=(stream.pos=0,stream.getBytes()),bufferStr=bytesToString(buffer),length=buffer.length,position=stream.start,trailers=[],xrefStms=[];position<length;){var _ch4=buffer[position];if(9===_ch4||_ch4===LF||_ch4===CR||32===_ch4)++position;else if(37===_ch4)for(;!(length<=++position)&&(_ch4=buffer[position])!==LF&&_ch4!==CR;);else{var token=function(data,offset){for(var token="",ch=data[offset];ch!==LF&&ch!==CR&&ch!==LT&&!(++offset>=data.length);)token+=String.fromCharCode(ch),ch=data[offset];return token}(buffer,position);if(token.startsWith("xref")&&(4===token.length||/\s/.test(token[4])))position+=skipUntil(buffer,position,trailerBytes),trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes);else if(m=objRegExp.exec(token)){var num=0|m[1],m=0|m[2],startPos=position+token.length,contentLength=void 0,updateEntries=!1;if(this.entries[num]){if(this.entries[num].gen===m)try{new Parser({lexer:new Lexer(stream.makeSubStream(startPos))}).getObj(),updateEntries=!0}catch(ex){ex instanceof ParserEOFException?warn("indexObjects -- checking object (".concat(token,'): "').concat(ex,'".')):updateEntries=!0}}else updateEntries=!0;updateEntries&&(this.entries[num]={offset:position-stream.start,gen:m,uncompressed:!0}),gEndobjRegExp.lastIndex=startPos;var updateEntries=gEndobjRegExp.exec(bufferStr),num=(updateEntries?(contentLength=gEndobjRegExp.lastIndex+1-position,"endobj"!==updateEntries[1]&&(warn('indexObjects: Found "'.concat(updateEntries[1],'" inside of another "obj", ')+'caused by missing "endobj" -- trying to recover.'),contentLength-=updateEntries[1].length+1)):contentLength=length-position,buffer.subarray(position,position+contentLength)),m=skipUntil(num,0,xrefBytes);m<contentLength&&num[m+5]<64&&(xrefStms.push(position-stream.start),this._xrefStms.add(position-stream.start)),position+=contentLength}else token.startsWith("trailer")&&(7===token.length||/\s/.test(token[7]))?(trailers.push(position),startPos=position+token.length,updateEntries=void 0,gStartxrefRegExp.lastIndex=startPos,(num=gStartxrefRegExp.exec(bufferStr))?(updateEntries=gStartxrefRegExp.lastIndex+1-position,"startxref"!==num[1]&&(warn('indexObjects: Found "'.concat(num[1],'" after "trailer", ')+'caused by missing "startxref" -- trying to recover.'),updateEntries-=num[1].length+1)):updateEntries=length-position,position+=updateEntries):position+=token.length+1}}for(xrefStm of xrefStms)this.startXRefQueue.push(xrefStm),this.readXRef(!0);var trailer,trailerDict,trailerError,_dict2,trailerDicts=[],isEncrypted=!1;for(trailer of trailers){stream.pos=trailer;var _parser=new Parser({lexer:new Lexer(stream),xref:this,allowStreams:!0,recoveryMode:!0});isCmd(_parser.getObj(),"trailer")&&(_parser=_parser.getObj())instanceof Dict&&(trailerDicts.push(_parser),_parser.has("Encrypt"))&&(isEncrypted=!0)}for(_dict2 of[...trailerDicts,"genFallback",...trailerDicts])if("genFallback"===_dict2){if(!trailerError)break;this._generationFallback=!0}else{var validPagesDict=!1;try{var rootDict=_dict2.get("Root");if(!(rootDict instanceof Dict))continue;var pagesDict=rootDict.get("Pages");if(!(pagesDict instanceof Dict))continue;var pagesCount=pagesDict.get("Count");Number.isInteger(pagesCount)&&(validPagesDict=!0)}catch(ex){trailerError=ex;continue}if(validPagesDict&&(!isEncrypted||_dict2.has("Encrypt"))&&_dict2.has("ID"))return _dict2;trailerDict=_dict2}if(trailerDict)return trailerDict;if(this.topDict)return this.topDict;if(!trailerDicts.length)for(var[_num2,entry]of this.entries.entries())if(entry){_num2=Ref.get(_num2,entry.gen),entry=void 0;try{entry=this.fetch(_num2)}catch(_unused13){continue}if((entry=entry instanceof BaseStream?entry.dict:entry)instanceof Dict&&entry.has("Root"))return entry}throw new InvalidPDFException("Invalid PDF structure.")}readXRef(){for(var recoveryMode=0<arguments.length&&void 0!==arguments[0]&&arguments[0],stream=this.stream,startXRefParsedCache=new Set;this.startXRefQueue.length;){try{var startXRef=this.startXRefQueue[0];if(startXRefParsedCache.has(startXRef)){warn("readXRef - skipping XRef table since it was already parsed."),this.startXRefQueue.shift();continue}startXRefParsedCache.add(startXRef),stream.pos=startXRef+stream.start;var parser=new Parser({lexer:new Lexer(stream),xref:this,allowStreams:!0}),obj=parser.getObj(),dict=void 0;if(isCmd(obj,"xref")){dict=this.processXRefTable(parser);this.topDict||(this.topDict=dict),obj=dict.get("XRefStm"),Number.isInteger(obj)&&!this._xrefStms.has(obj)&&(this._xrefStms.add(obj),this.startXRefQueue.push(obj),null==_classPrivateFieldGet(_firstXRefStmPos,this))&&_classPrivateFieldSet(_firstXRefStmPos,this,obj)}else{if(!Number.isInteger(obj))throw new FormatError("Invalid XRef stream header");if(!(Number.isInteger(parser.getObj())&&isCmd(parser.getObj(),"obj")&&(obj=parser.getObj())instanceof BaseStream))throw new FormatError("Invalid XRef stream");if(dict=this.processXRefStream(obj),this.topDict||(this.topDict=dict),!dict)throw new FormatError("Failed to read XRef stream")}obj=dict.get("Prev"),Number.isInteger(obj)?this.startXRefQueue.push(obj):obj instanceof Ref&&this.startXRefQueue.push(obj.num)}catch(e){if(e instanceof MissingDataException)throw e;info("(while reading XRef): "+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!recoveryMode)throw new XRefParseException}get lastXRefStreamPos(){var _classPrivateFieldGet5;return null!=(_classPrivateFieldGet5=_classPrivateFieldGet(_firstXRefStmPos,this))?_classPrivateFieldGet5:0<this._xrefStms.size?Math.max(...this._xrefStms):null}getEntry(i){i=this.entries[i];return i&&!i.free&&i.offset?i:null}fetchIfRef(obj){var suppressEncryption=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return obj instanceof Ref?this.fetch(obj,suppressEncryption):obj}fetch(ref){var suppressEncryption=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!(ref instanceof Ref))throw new Error("ref object is not a reference");var num=ref.num,cacheEntry=this._cacheMap.get(num);if(void 0!==cacheEntry)return cacheEntry instanceof Dict&&!cacheEntry.objId&&(cacheEntry.objId=ref.toString()),cacheEntry;cacheEntry=this.getEntry(num);if(null!==cacheEntry){if(this._pendingRefs.has(ref))return this._pendingRefs.remove(ref),warn("Ignoring circular reference: ".concat(ref,".")),CIRCULAR_REF;this._pendingRefs.put(ref);try{cacheEntry=cacheEntry.uncompressed?this.fetchUncompressed(ref,cacheEntry,suppressEncryption):this.fetchCompressed(ref,cacheEntry,suppressEncryption),this._pendingRefs.remove(ref)}catch(ex){throw this._pendingRefs.remove(ref),ex}cacheEntry instanceof Dict?cacheEntry.objId=ref.toString():cacheEntry instanceof BaseStream&&(cacheEntry.dict.objId=ref.toString())}return cacheEntry}fetchUncompressed(ref,xrefEntry){var suppressEncryption=2<arguments.length&&void 0!==arguments[2]&&arguments[2],gen=ref.gen,num=ref.num;if(xrefEntry.gen!==gen){var msg="Inconsistent generation in XRef: ".concat(ref);if(this._generationFallback&&xrefEntry.gen<gen)return warn(msg),this.fetchUncompressed(Ref.get(num,xrefEntry.gen),xrefEntry,suppressEncryption);throw new XRefEntryException(msg)}var msg=this.stream.makeSubStream(xrefEntry.offset+this.stream.start),msg=new Parser({lexer:new Lexer(msg),xref:this,allowStreams:!0}),obj1=msg.getObj(),obj2=msg.getObj(),obj3=msg.getObj();if(obj1===num&&obj2===gen&&obj3 instanceof Cmd){if("obj"===obj3.cmd)return(xrefEntry=this.encrypt&&!suppressEncryption?msg.getObj(this.encrypt.createCipherTransform(num,gen)):msg.getObj())instanceof BaseStream||this._cacheMap.set(num,xrefEntry),xrefEntry;if(obj3.cmd.startsWith("obj")&&(num=parseInt(obj3.cmd.substring(3),10),!Number.isNaN(num)))return num}throw new XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref))}fetchCompressed(ref,xrefEntry){var tableOffset=xrefEntry.offset,stream=this.fetch(Ref.get(tableOffset,0));if(!(stream instanceof BaseStream))throw new FormatError("bad ObjStm stream");var first=stream.dict.get("First"),n=stream.dict.get("N");if(!Number.isInteger(first)||!Number.isInteger(n))throw new FormatError("invalid first and n parameters for ObjStm stream");for(var parser=new Parser({lexer:new Lexer(stream),xref:this,allowStreams:!0}),nums=new Array(n),offsets=new Array(n),i=0;i<n;++i){var num=parser.getObj();if(!Number.isInteger(num))throw new FormatError("invalid object number in the ObjStm stream: ".concat(num));var offset=parser.getObj();if(!Number.isInteger(offset))throw new FormatError("invalid object offset in the ObjStm stream: ".concat(offset));nums[i]=num,offsets[i]=offset}for(var start=(stream.start||0)+first,entries=new Array(n),_i52=0;_i52<n;++_i52){var length=_i52<n-1?offsets[_i52+1]-offsets[_i52]:void 0;if(length<0)throw new FormatError("Invalid offset in the ObjStm stream.");var _num3,entry,length=(parser=new Parser({lexer:new Lexer(stream.makeSubStream(start+offsets[_i52],length,stream.dict)),xref:this,allowStreams:!0})).getObj();(entries[_i52]=length)instanceof BaseStream||(_num3=nums[_i52],(entry=this.entries[_num3])&&entry.offset===tableOffset&&entry.gen===_i52&&this._cacheMap.set(_num3,length))}if(void 0===(xrefEntry=entries[xrefEntry.gen]))throw new XRefEntryException("Bad (compressed) XRef entry: ".concat(ref));return xrefEntry}async fetchIfRefAsync(obj,suppressEncryption){return obj instanceof Ref?this.fetchAsync(obj,suppressEncryption):obj}async fetchAsync(ref,suppressEncryption){try{return this.fetch(ref,suppressEncryption)}catch(ex){if(ex instanceof MissingDataException)return await this.pdfManager.requestRange(ex.begin,ex.end),this.fetchAsync(ref,suppressEncryption);throw ex}}getCatalogObj(){return this.root}}var LETTER_SIZE_MEDIABOX=[0,0,612,792],_resourcesPromise=new WeakMap,_Page_brand=new WeakSet;class Page{constructor(_ref75){var{pdfManager:_ref75,xref,pageIndex,pageDict,ref:_ref74,globalIdFactory,fontCache,builtInCMapCache,standardFontDataCache,globalColorSpaceCache,globalImageCache,systemFontCache,nonBlendModesSet,xfaFactory}=_ref75,idCounters=(_classPrivateMethodInitSpec(this,_Page_brand),_classPrivateFieldInitSpec(this,_resourcesPromise,null),this.pdfManager=_ref75,this.pageIndex=pageIndex,this.pageDict=pageDict,this.xref=xref,this.ref=_ref74,this.fontCache=fontCache,this.builtInCMapCache=builtInCMapCache,this.standardFontDataCache=standardFontDataCache,this.globalColorSpaceCache=globalColorSpaceCache,this.globalImageCache=globalImageCache,this.systemFontCache=systemFontCache,this.nonBlendModesSet=nonBlendModesSet,this.evaluatorOptions=_ref75.evaluatorOptions,this.xfaFactory=xfaFactory,{obj:0});this._localIdFactory=class extends globalIdFactory{static createObjId(){return"p".concat(pageIndex,"_").concat(++idCounters.obj)}static getPageObjId(){return"p".concat(_ref74.toString())}}}get content(){return this.pageDict.getArray("Contents")}get resources(){var resources=_assertClassBrand(_Page_brand,this,_getInheritableProperty).call(this,"Resources");return shadow(this,"resources",resources instanceof Dict?resources:Dict.empty)}get mediaBox(){return shadow(this,"mediaBox",_assertClassBrand(_Page_brand,this,_getBoundingBox).call(this,"MediaBox")||LETTER_SIZE_MEDIABOX)}get cropBox(){return shadow(this,"cropBox",_assertClassBrand(_Page_brand,this,_getBoundingBox).call(this,"CropBox")||this.mediaBox)}get userUnit(){var obj=this.pageDict.get("UserUnit");return shadow(this,"userUnit","number"==typeof obj&&0<obj?obj:1)}get view(){var{cropBox,mediaBox}=this;if(cropBox!==mediaBox&&!isArrayEqual(cropBox,mediaBox)){cropBox=Util.intersect(cropBox,mediaBox);if(cropBox&&0<cropBox[2]-cropBox[0]&&0<cropBox[3]-cropBox[1])return shadow(this,"view",cropBox);warn("Empty /CropBox and /MediaBox intersection.")}return shadow(this,"view",mediaBox)}get rotate(){var rotate=_assertClassBrand(_Page_brand,this,_getInheritableProperty).call(this,"Rotate")||0;return rotate%90!=0?rotate=0:360<=rotate?rotate%=360:rotate<0&&(rotate=(rotate%360+360)%360),shadow(this,"rotate",rotate)}async getContentStream(){var content=await this.pdfManager.ensure(this,"content");return content instanceof BaseStream?content:Array.isArray(content)?new StreamsSequenceStream(content,_assertClassBrand(_Page_brand,this,_onSubStreamError).bind(this)):new NullStream}get xfaData(){return shadow(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async saveNewAnnotations(handler,task,annotations,imagePromises,changes){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");var ref,handler=_assertClassBrand(_Page_brand,this,_createPartialEvaluator).call(this,handler),deletedAnnotations=new RefSetCache,existingAnnotations=new RefSet,pageDict=(await _assertClassBrand(_Page_brand,this,_replaceIdByRef).call(this,annotations,deletedAnnotations,existingAnnotations),this.pageDict),annotationsArray=this.annotations.filter(a=>!(a instanceof Ref&&deletedAnnotations.has(a)));for({ref}of(await AnnotationFactory.saveNewAnnotations(handler,task,annotations,imagePromises,changes)).annotations)ref instanceof Ref&&!existingAnnotations.has(ref)&&annotationsArray.push(ref);var deletedRef,handler=pageDict.clone();handler.set("Annots",annotationsArray),changes.put(this.ref,{data:handler});for(deletedRef of deletedAnnotations)changes.put(deletedRef,{data:null})}async save(handler,task,annotationStorage,changes){var annotation,partialEvaluator=_assertClassBrand(_Page_brand,this,_createPartialEvaluator).call(this,handler),promises=[];for(annotation of await this._parsedAnnotations)promises.push(annotation.save(partialEvaluator,task,annotationStorage,changes).catch(function(reason){return warn("save - ignoring annotation data during "+'"'.concat(task.name,'" task: "').concat(reason,'".')),null}));return Promise.all(promises)}async loadResources(keys){var _classPrivateFieldGet6;await(null!=(_classPrivateFieldGet6=_classPrivateFieldGet(_resourcesPromise,this))?_classPrivateFieldGet6:_classPrivateFieldSet(_resourcesPromise,this,this.pdfManager.ensure(this,"resources"))),await ObjectLoader.load(this.resources,keys,this.xref)}async getOperatorList(_ref76){var{handler,sink,task,intent,cacheKey,annotationStorage=null,modifiedIds=null}=_ref76,_ref76=this.getContentStream(),resourcesPromise=this.loadResources(RESOURCES_KEYS_OPERATOR_LIST),partialEvaluator=_assertClassBrand(_Page_brand,this,_createPartialEvaluator).call(this,handler),newAnnotsByPage=this.xfaFactory?null:getNewAnnotationsMap(annotationStorage),newAnnots=null==newAnnotsByPage?void 0:newAnnotsByPage.get(this.pageIndex),newAnnotsByPage=Promise.resolve(null),deletedAnnotations=null;if(newAnnots){var imagePromises,bitmapId,bitmap,annotationGlobalsPromise=this.pdfManager.ensureDoc("annotationGlobals"),missingBitmaps=new Set;for({bitmapId,bitmap}of newAnnots)!bitmapId||bitmap||missingBitmaps.has(bitmapId)||missingBitmaps.add(bitmapId);var isOffscreenCanvasSupported=this.evaluatorOptions["isOffscreenCanvasSupported"];if(0<missingBitmaps.size){var key,annotation,annotationWithBitmaps=newAnnots.slice();for([key,annotation]of annotationStorage)key.startsWith(AnnotationEditorPrefix)&&annotation.bitmap&&missingBitmaps.has(annotation.bitmapId)&&annotationWithBitmaps.push(annotation);imagePromises=AnnotationFactory.generateImages(annotationWithBitmaps,this.xref,isOffscreenCanvasSupported)}else imagePromises=AnnotationFactory.generateImages(newAnnots,this.xref,isOffscreenCanvasSupported);deletedAnnotations=new RefSet,newAnnotsByPage=Promise.all([annotationGlobalsPromise,_assertClassBrand(_Page_brand,this,_replaceIdByRef).call(this,newAnnots,deletedAnnotations,null)]).then(_ref77=>{var[_ref77]=_ref77;return _ref77?AnnotationFactory.printNewAnnotations(_ref77,partialEvaluator,task,newAnnots,imagePromises):null})}var isOffscreenCanvasSupported=Promise.all([_ref76,resourcesPromise]).then(async _ref78=>{var[_ref78]=_ref78,resources=await _assertClassBrand(_Page_brand,this,_getMergedResources).call(this,_ref78.dict,RESOURCES_KEYS_OPERATOR_LIST),opList=new OperatorList(intent,sink);return handler.send("StartRenderPage",{transparency:partialEvaluator.hasBlendModes(resources,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:cacheKey}),await partialEvaluator.getOperatorList({stream:_ref78,task:task,resources:resources,operatorList:opList}),opList}),[pageOpList,annotations,newAnnotations]=await Promise.all([isOffscreenCanvasSupported,this._parsedAnnotations,newAnnotsByPage]);if(newAnnotations){for(var annotations=annotations.filter(a=>!(a.ref&&deletedAnnotations.has(a.ref))),i=0,ii=newAnnotations.length;i<ii;i++)await async function(_i53,_ii18){var j,newAnnotation=newAnnotations[_i53];newAnnotation.refToReplace&&0<=(j=annotations.findIndex(a=>a.ref&&isRefsEqual(a.ref,newAnnotation.refToReplace)))&&(annotations.splice(j,1,newAnnotation),newAnnotations.splice(_i53--,1),_ii18--),i=_i53,ii=_ii18}(i,ii);annotations=annotations.concat(newAnnotations)}if(0===annotations.length||intent&RenderingIntentFlag.ANNOTATIONS_DISABLE)pageOpList.flush(!0);else{var _annotation2,renderForms=!!(intent&RenderingIntentFlag.ANNOTATIONS_FORMS),isEditing=!!(intent&RenderingIntentFlag.IS_EDITING),intentAny=!!(intent&RenderingIntentFlag.ANY),intentDisplay=!!(intent&RenderingIntentFlag.DISPLAY),intentPrint=!!(intent&RenderingIntentFlag.PRINT),opListPromises=[];for(_annotation2 of annotations)(intentAny||intentDisplay&&_annotation2.mustBeViewed(annotationStorage,renderForms)&&_annotation2.mustBeViewedWhenEditing(isEditing,modifiedIds)||intentPrint&&_annotation2.mustBePrinted(annotationStorage))&&opListPromises.push(_annotation2.getOperatorList(partialEvaluator,task,intent,annotationStorage).catch(function(reason){return warn("getOperatorList - ignoring annotation data during "+'"'.concat(task.name,'" task: "').concat(reason,'".')),{opList:null,separateForm:!1,separateCanvas:!1}}));var opList,separateForm,separateCanvas,form=!1,canvas=!1;for({opList,separateForm,separateCanvas}of await Promise.all(opListPromises))pageOpList.addOpList(opList),form=form||separateForm,canvas=canvas||separateCanvas;pageOpList.flush(!0,{form:form,canvas:canvas})}return{length:pageOpList.totalLength}}async extractTextContent(_ref79){var{handler:_ref79,task,includeMarkedContent,disableNormalization,sink,intersector=null}=_ref79,contentStreamPromise=this.getContentStream(),resourcesPromise=this.loadResources(RESOURCES_KEYS_TEXT_CONTENT),langPromise=this.pdfManager.ensureCatalog("lang"),[contentStreamPromise,,resourcesPromise]=await Promise.all([contentStreamPromise,resourcesPromise,langPromise]),langPromise=await _assertClassBrand(_Page_brand,this,_getMergedResources).call(this,contentStreamPromise.dict,RESOURCES_KEYS_TEXT_CONTENT);return _assertClassBrand(_Page_brand,this,_createPartialEvaluator).call(this,_ref79).getTextContent({stream:contentStreamPromise,task:task,resources:langPromise,includeMarkedContent:includeMarkedContent,disableNormalization:disableNormalization,sink:sink,viewBox:this.view,lang:resourcesPromise,intersector:intersector})}async getStructTree(){var structTreeRoot=await this.pdfManager.ensureCatalog("structTreeRoot");if(!structTreeRoot)return null;await this._parsedAnnotations;try{var structTree=await this.pdfManager.ensure(this,"_parseStructTree",[structTreeRoot]);return await this.pdfManager.ensure(structTree,"serializable")}catch(ex){return warn('getStructTree: "'.concat(ex,'".')),null}}_parseStructTree(structTreeRoot){structTreeRoot=new StructTreePage(structTreeRoot,this.pageDict);return structTreeRoot.parse(this.ref),structTreeRoot}async getAnnotationsData(handler,task,intent){var annotations=await this._parsedAnnotations;if(0===annotations.length)return annotations;var partialEvaluator,annotation,intersector,annotationsData=[],textContentPromises=[],intentAny=!!(intent&RenderingIntentFlag.ANY),intentDisplay=!!(intent&RenderingIntentFlag.DISPLAY),intentPrint=!!(intent&RenderingIntentFlag.PRINT),highlightedAnnotations=[];for(annotation of annotations){var isVisible=intentAny||intentDisplay&&annotation.viewable;(isVisible||intentPrint&&annotation.printable)&&annotationsData.push(annotation.data),annotation.hasTextContent&&isVisible?(null==partialEvaluator&&(partialEvaluator=_assertClassBrand(_Page_brand,this,_createPartialEvaluator).call(this,handler)),textContentPromises.push(annotation.extractTextContent(partialEvaluator,task,[-1/0,-1/0,1/0,1/0]).catch(function(reason){warn('getAnnotationsData - ignoring textContent during "'.concat(task.name,'" task: "').concat(reason,'".'))}))):annotation.overlaysTextContent&&isVisible&&highlightedAnnotations.push(annotation)}return 0<highlightedAnnotations.length&&(intersector=new Intersector(highlightedAnnotations),textContentPromises.push(this.extractTextContent({handler:handler,task:task,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:intersector}).then(()=>{intersector.setText()}))),await Promise.all(textContentPromises),annotationsData}get annotations(){var annots=_assertClassBrand(_Page_brand,this,_getInheritableProperty).call(this,"Annots");return shadow(this,"annotations",Array.isArray(annots)?annots:[])}get _parsedAnnotations(){var promise=this.pdfManager.ensure(this,"annotations").then(async annots=>{if(0===annots.length)return annots;var[annotationGlobals,fieldObjects]=await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"),this.pdfManager.ensureDoc("fieldObjects")]);if(!annotationGlobals)return[];var annotationRef,orphanFields=null==fieldObjects?void 0:fieldObjects.orphanFields,annotationPromises=[];for(annotationRef of annots)annotationPromises.push(AnnotationFactory.create(this.xref,annotationRef,annotationGlobals,this._localIdFactory,!1,orphanFields,this.ref).catch(function(reason){return warn('_parsedAnnotations: "'.concat(reason,'".')),null}));var popupAnnotations,widgetAnnotations,annotation,sortedAnnotations=[];for(annotation of await Promise.all(annotationPromises))annotation&&(annotation instanceof WidgetAnnotation?widgetAnnotations=widgetAnnotations||[]:annotation instanceof PopupAnnotation?popupAnnotations=popupAnnotations||[]:sortedAnnotations).push(annotation);return widgetAnnotations&&sortedAnnotations.push(...widgetAnnotations),popupAnnotations&&sortedAnnotations.push(...popupAnnotations),sortedAnnotations});return shadow(this,"_parsedAnnotations",promise)}get jsActions(){return shadow(this,"jsActions",collectActions(this.xref,this.pageDict,PageActionEventType))}}function _createPartialEvaluator(handler){return new PartialEvaluator({xref:this.xref,handler:handler,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})}function _getInheritableProperty(key){var value=getInheritableProperty({dict:this.pageDict,key:key,getArray:1<arguments.length&&void 0!==arguments[1]&&arguments[1],stopWhenFound:!1});return Array.isArray(value)?1!==value.length&&value[0]instanceof Dict?Dict.merge({xref:this.xref,dictArray:value}):value[0]:value}function _getBoundingBox(name){if(this.xfaData)return this.xfaData.bbox;var box=lookupNormalRect(_assertClassBrand(_Page_brand,this,_getInheritableProperty).call(this,name,!0),null);if(box){if(0<box[2]-box[0]&&0<box[3]-box[1])return box;warn("Empty, or invalid, /".concat(name," entry."))}return null}function _onSubStreamError(reason,objId){if(!this.evaluatorOptions.ignoreErrors)throw reason;warn("getContentStream - ignoring sub-stream (".concat(objId,'): "').concat(reason,'".'))}async function _replaceIdByRef(annotations,deletedAnnotations,existingAnnotations){var annotation,_this7=this,promises=[];for(annotation of annotations)await async function(annotation){var ref,popupRef;if(annotation.id)(ref=Ref.fromString(annotation.id))?annotation.deleted?(deletedAnnotations.put(ref,ref),annotation.popupRef&&(popupRef=Ref.fromString(annotation.popupRef))&&deletedAnnotations.put(popupRef,popupRef)):(null!=existingAnnotations&&existingAnnotations.put(ref),annotation.ref=ref,promises.push(_this7.xref.fetchAsync(ref).then(obj=>{obj instanceof Dict&&(annotation.oldAnnotation=obj.clone())},()=>{warn("Cannot fetch `oldAnnotation` for: ".concat(ref,"."))})),delete annotation.id):warn("A non-linked annotation cannot be modified: ".concat(annotation.id))}(annotation);await Promise.all(promises)}async function _getMergedResources(streamDict,keys){streamDict=null==streamDict?void 0:streamDict.get("Resources");return streamDict instanceof Dict&&streamDict.size?(await ObjectLoader.load(streamDict,keys,this.xref),Dict.merge({xref:this.xref,dictArray:[streamDict,this.resources],mergeSubDicts:!0})):this.resources}var PDF_HEADER_SIGNATURE=new Uint8Array([37,80,68,70,45]),STARTXREF_SIGNATURE=new Uint8Array([115,116,97,114,116,120,114,101,102]),ENDOBJ_SIGNATURE=new Uint8Array([101,110,100,111,98,106]);function find(stream,signature){var limit=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1024,backwards=3<arguments.length&&void 0!==arguments[3]&&arguments[3],signatureLength=signature.length,scanBytes=stream.peekBytes(limit),scanLength=scanBytes.length-signatureLength;if(!(scanLength<=0))if(backwards)for(var signatureEnd=signatureLength-1,pos=scanBytes.length-1;signatureEnd<=pos;){for(var j=0;j<signatureLength&&scanBytes[pos-j]===signature[signatureEnd-j];)j++;if(signatureLength<=j)return stream.pos+=pos-signatureEnd,!0;pos--}else for(var _pos=0;_pos<=scanLength;){for(var _j21=0;_j21<signatureLength&&scanBytes[_pos+_j21]===signature[_j21];)_j21++;if(signatureLength<=_j21)return stream.pos+=_pos,!0;_pos++}return!1}var _pagePromises=new WeakMap,_version=new WeakMap,_PDFDocument_brand=new WeakSet;class PDFDocument{constructor(pdfManager,stream){if(_classPrivateMethodInitSpec(this,_PDFDocument_brand),_classPrivateFieldInitSpec(this,_pagePromises,new Map),_classPrivateFieldInitSpec(this,_version,null),stream.length<=0)throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=pdfManager,this.stream=stream,this.xref=new XRef(stream,pdfManager);var idCounters={font:0};this._globalIdFactory=class{static getDocId(){return"g_".concat(pdfManager.docId)}static createFontId(){return"f".concat(++idCounters.font)}static createObjId(){unreachable("Abstract method `createObjId` called.")}static getPageObjId(){unreachable("Abstract method `getPageObjId` called.")}}}parse(recoveryMode){this.xref.parse(recoveryMode),this.catalog=new Catalog(this.pdfManager,this.xref)}get linearization(){var linearization=null;try{linearization=Linearization.create(this.stream)}catch(err){if(err instanceof MissingDataException)throw err;info(err)}return shadow(this,"linearization",linearization)}get startXRef(){var stream=this.stream,startXRef=0;if(this.linearization){if(stream.reset(),find(stream,ENDOBJ_SIGNATURE)){stream.skip(6);for(var _ch5=stream.peekByte();isWhiteSpace(_ch5);)stream.pos++,_ch5=stream.peekByte();startXRef=stream.pos-stream.start}}else{for(var _ch6,startXRefLength=STARTXREF_SIGNATURE.length,found=!1,pos=stream.end;!found&&0<pos;)(pos-=1024-startXRefLength)<0&&(pos=0),stream.pos=pos,found=find(stream,STARTXREF_SIGNATURE,1024,!0);if(found){for(stream.skip(9);isWhiteSpace(_ch6=stream.getByte()););for(var str="";32<=_ch6&&_ch6<=57;)str+=String.fromCharCode(_ch6),_ch6=stream.getByte();startXRef=parseInt(str,10),isNaN(startXRef)&&(startXRef=0)}}return shadow(this,"startXRef",startXRef)}checkHeader(){var stream=this.stream;if(stream.reset(),find(stream,PDF_HEADER_SIGNATURE)){stream.moveStart(),stream.skip(PDF_HEADER_SIGNATURE.length);for(var ch,version="";32<(ch=stream.getByte())&&version.length<7;)version+=String.fromCharCode(ch);PDF_VERSION_REGEXP.test(version)?_classPrivateFieldSet(_version,this,version):warn("Invalid PDF header version: ".concat(version))}}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){var num=0,num=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():(this.linearization||this.catalog).numPages;return shadow(this,"numPages",num)}get _xfaStreams(){var acroForm=this.catalog["acroForm"];if(!acroForm)return null;var xfa=acroForm.get("XFA"),entries=new Map(["xdp:xdp","template","datasets","config","connectionSet","localeSet","stylesheet","/xdp:xdp"].map(e=>[e,null]));if(xfa instanceof BaseStream&&!xfa.isEmpty)entries.set("xdp:xdp",xfa);else{if(!Array.isArray(xfa)||0===xfa.length)return null;for(var i=0,ii=xfa.length;i<ii;i+=2){var data,name=void 0,name=0===i?"xdp:xdp":i===ii-2?"/xdp:xdp":xfa[i];entries.has(name)&&(data=this.xref.fetchIfRef(xfa[i+1]))instanceof BaseStream&&!data.isEmpty&&entries.set(name,data)}}return entries}get xfaDatasets(){var streams=this._xfaStreams;if(streams)for(var key of["datasets","xdp:xdp"]){var stream=streams.get(key);if(stream)try{var data={[key]:stringToUTF8String(stream.getString())};return shadow(this,"xfaDatasets",new DatasetReader(data))}catch(_unused14){warn("XFA - Invalid utf-8 string.");break}}return shadow(this,"xfaDatasets",null)}get xfaData(){var streams=this._xfaStreams;if(!streams)return null;var key,stream,data=Object.create(null);for([key,stream]of streams)if(stream)try{data[key]=stringToUTF8String(stream.getString())}catch(_unused15){return warn("XFA - Invalid utf-8 string."),null}return data}get xfaFactory(){var data;return shadow(this,"xfaFactory",(data=this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm?this.xfaData:data)?new XFAFactory(data):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}loadXfaResources(handler,task){return Promise.all([_assertClassBrand(_PDFDocument_brand,this,_loadXfaFonts).call(this,handler,task).catch(()=>{}),_assertClassBrand(_PDFDocument_brand,this,_loadXfaImages).call(this)])}serializeXfaData(annotationStorage){return this.xfaFactory?this.xfaFactory.serializeData(annotationStorage):null}get version(){return this.catalog.version||_classPrivateFieldGet(_version,this)}get formInfo(){var formInfo={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},acroForm=this.catalog["acroForm"];if(acroForm)try{var fields=acroForm.get("Fields"),hasFields=Array.isArray(fields)&&0<fields.length,xfa=(formInfo.hasFields=hasFields,acroForm.get("XFA"));formInfo.hasXfa=Array.isArray(xfa)&&0<xfa.length||xfa instanceof BaseStream&&!xfa.isEmpty;var hasSignatures=!!(1&acroForm.get("SigFlags")),hasOnlyDocumentSignatures=hasSignatures&&_assertClassBrand(_PDFDocument_brand,this,_hasOnlyDocumentSignatures).call(this,fields);formInfo.hasAcroForm=hasFields&&!hasOnlyDocumentSignatures,formInfo.hasSignatures=hasSignatures}catch(ex){if(ex instanceof MissingDataException)throw ex;warn('Cannot fetch form information: "'.concat(ex,'".'))}return shadow(this,"formInfo",formInfo)}get documentInfo(){var _xref$encrypt,infoDict,{catalog,formInfo,xref}=this,docInfo={PDFFormatVersion:this.version,Language:catalog.lang,EncryptFilterName:null!=(_xref$encrypt=null==(_xref$encrypt=xref.encrypt)?void 0:_xref$encrypt.filterName)?_xref$encrypt:null,IsLinearized:!!this.linearization,IsAcroFormPresent:formInfo.hasAcroForm,IsXFAPresent:formInfo.hasXfa,IsCollectionPresent:!!catalog.collection,IsSignaturesPresent:formInfo.hasSignatures};try{infoDict=xref.trailer.get("Info")}catch(err){if(err instanceof MissingDataException)throw err;info("The document information dictionary is invalid.")}if(infoDict instanceof Dict)for(var[key,value]of infoDict){switch(key){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"!=typeof value)break;docInfo[key]=stringToPDFString(value);continue;case"Trapped":if(value instanceof Name){docInfo[key]=value;continue}break;default:var customValue=void 0;switch(typeof value){case"string":customValue=stringToPDFString(value);break;case"number":case"boolean":customValue=value;break;default:value instanceof Name&&(customValue=value)}if(void 0===customValue){warn('Bad value, for custom key "'.concat(key,'", in Info: ').concat(value,"."));continue}null!=docInfo.Custom||(docInfo.Custom=Object.create(null)),docInfo.Custom[key]=customValue;continue}warn('Bad value, for key "'.concat(key,'", in Info: ').concat(value,"."))}return shadow(this,"documentInfo",docInfo)}get fingerprints(){var EMPTY_FINGERPRINT="\0".repeat(16);function validate(data){return"string"==typeof data&&16===data.length&&data!==EMPTY_FINGERPRINT}var hashOriginal,hashModified,id=this.xref.trailer.get("ID");return Array.isArray(id)&&validate(id[0])?(hashOriginal=stringToBytes(id[0]),id[1]!==id[0]&&validate(id[1])&&(hashModified=stringToBytes(id[1]))):hashOriginal=calculateMD5(this.stream.getByteRange(0,1024),0,1024),shadow(this,"fingerprints",[toHexUtil(hashOriginal),hashModified?toHexUtil(hashModified):null])}getPage(pageIndex){var catalog,xfaFactory,cachedPromise=_classPrivateFieldGet(_pagePromises,this).get(pageIndex);return cachedPromise||({catalog,linearization:cachedPromise,xfaFactory}=this,cachedPromise=(cachedPromise=xfaFactory?Promise.resolve([Dict.empty,null]):(null==cachedPromise?void 0:cachedPromise.pageFirst)===pageIndex?_assertClassBrand(_PDFDocument_brand,this,_getLinearizationPage).call(this,pageIndex):catalog.getPageDict(pageIndex)).then(_ref80=>{var[_ref80,ref]=_ref80;return new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:pageIndex,pageDict:_ref80,ref:ref,globalIdFactory:this._globalIdFactory,fontCache:catalog.fontCache,builtInCMapCache:catalog.builtInCMapCache,standardFontDataCache:catalog.standardFontDataCache,globalColorSpaceCache:catalog.globalColorSpaceCache,globalImageCache:catalog.globalImageCache,systemFontCache:catalog.systemFontCache,nonBlendModesSet:catalog.nonBlendModesSet,xfaFactory:xfaFactory})}),_classPrivateFieldGet(_pagePromises,this).set(pageIndex,cachedPromise),cachedPromise)}async checkFirstPage(){var recoveryMode=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!recoveryMode)try{await this.getPage(0)}catch(reason){if(reason instanceof XRefEntryException)throw _classPrivateFieldGet(_pagePromises,this).delete(0),await this.cleanup(),new XRefParseException}}async checkLastPage(){var numPages,pagesTree,pageIndex,pageDict,ref,recoveryMode=0<arguments.length&&void 0!==arguments[0]&&arguments[0],{catalog,pdfManager}=this;catalog.setActualNumPages();try{if(await Promise.all([pdfManager.ensureDoc("xfaFactory"),pdfManager.ensureDoc("linearization"),pdfManager.ensureCatalog("numPages")]),!this.xfaFactory){if(numPages=(this.linearization||catalog).numPages,!Number.isInteger(numPages))throw new FormatError("Page count is not an integer.");numPages<=1||await this.getPage(numPages-1)}}catch(reason){if(_classPrivateFieldGet(_pagePromises,this).delete(numPages-1),await this.cleanup(),reason instanceof XRefEntryException&&!recoveryMode)throw new XRefParseException;warn("checkLastPage - invalid /Pages tree /Count: ".concat(numPages,"."));try{pagesTree=await catalog.getAllPageDicts(recoveryMode)}catch(reasonAll){if(reasonAll instanceof XRefEntryException&&!recoveryMode)throw new XRefParseException;return void catalog.setActualNumPages(1)}for([pageIndex,[pageDict,ref]]of pagesTree){var promise=void 0;pageDict instanceof Error?(promise=Promise.reject(pageDict)).catch(()=>{}):promise=Promise.resolve(new Page({pdfManager:pdfManager,xref:this.xref,pageIndex:pageIndex,pageDict:pageDict,ref:ref,globalIdFactory:this._globalIdFactory,fontCache:catalog.fontCache,builtInCMapCache:catalog.builtInCMapCache,standardFontDataCache:catalog.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:catalog.globalImageCache,systemFontCache:catalog.systemFontCache,nonBlendModesSet:catalog.nonBlendModesSet,xfaFactory:null})),_classPrivateFieldGet(_pagePromises,this).set(pageIndex,promise)}catalog.setActualNumPages(pagesTree.size)}}async fontFallback(id,handler){var translatedFont,{catalog,pdfManager}=this;for(translatedFont of await Promise.all(catalog.fontCache))if(translatedFont.loadedName===id)return void translatedFont.fallback(handler,pdfManager.evaluatorOptions)}async cleanup(){return this.catalog?this.catalog.cleanup(0<arguments.length&&void 0!==arguments[0]&&arguments[0]):clearGlobalCaches()}get fieldObjects(){var promise=this.pdfManager.ensureDoc("formInfo").then(async formInfo=>{if(!formInfo.hasFields)return null;var annotationGlobals=await this.annotationGlobals;if(!annotationGlobals)return null;var fieldRef,formInfo=annotationGlobals["acroForm"],visitedRefs=new RefSet,allFields=Object.create(null),fieldPromises=new Map,orphanFields=new RefSetCache;for(fieldRef of formInfo.get("Fields"))await _assertClassBrand(_PDFDocument_brand,this,_collectFieldObjects).call(this,"",null,fieldRef,fieldPromises,annotationGlobals,visitedRefs,orphanFields);var name,promises,allPromises=[];for([name,promises]of fieldPromises)await async function(name){allPromises.push(Promise.all(promises).then(fields=>{0<(fields=fields.filter(field=>!!field)).length&&(allFields[name]=fields)}))}(name);return await Promise.all(allPromises),{allFields:0<objectSize(allFields)?allFields:null,orphanFields:orphanFields}});return shadow(this,"fieldObjects",promise)}get hasJSActions(){var promise=this.pdfManager.ensureDoc("_parseHasJSActions");return shadow(this,"hasJSActions",promise)}async _parseHasJSActions(){var[catalogJsActions,fieldObjects]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!catalogJsActions||!(null==fieldObjects||!fieldObjects.allFields)&&Object.values(fieldObjects.allFields).some(fieldObject=>fieldObject.some(object=>null!==object.actions))}get calculationOrderIds(){var _this$catalog$acroFor=null==(_this$catalog$acroFor=this.catalog.acroForm)?void 0:_this$catalog$acroFor.get("CO");if(!Array.isArray(_this$catalog$acroFor)||0===_this$catalog$acroFor.length)return shadow(this,"calculationOrderIds",null);var id,ids=[];for(id of _this$catalog$acroFor)id instanceof Ref&&ids.push(id.toString());return shadow(this,"calculationOrderIds",ids.length?ids:null)}get annotationGlobals(){return shadow(this,"annotationGlobals",AnnotationFactory.createGlobals(this.pdfManager))}}function _hasOnlyDocumentSignatures(fields){var recursionDepth=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return!!Array.isArray(fields)&&fields.every(field=>{var isSignature;return(field=this.xref.fetchIfRef(field))instanceof Dict&&(field.has("Kids")?10<++recursionDepth?(warn("#hasOnlyDocumentSignatures: maximum recursion depth reached"),!1):_assertClassBrand(_PDFDocument_brand,this,_hasOnlyDocumentSignatures).call(this,field.get("Kids"),recursionDepth):(isSignature=isName(field.get("FT"),"Sig"),field=field.get("Rect"),field=Array.isArray(field)&&field.every(value=>0===value),isSignature&&field))})}function _collectSignatureCertificates(fields,collectedSignatureCertificates){var visited=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new RefSet;if(Array.isArray(fields))for(var field of fields){if(field instanceof Ref){if(visited.has(field))continue;visited.put(field)}(field=this.xref.fetchIfRef(field))instanceof Dict&&(field.has("Kids")?_assertClassBrand(_PDFDocument_brand,this,_collectSignatureCertificates).call(this,field.get("Kids"),collectedSignatureCertificates,visited):isName(field.get("FT"),"Sig")&&(field=field.get("V"))instanceof Dict&&(field=field.get("SubFilter"))instanceof Name&&collectedSignatureCertificates.add(field.name))}}async function _loadXfaImages(){var xfaImages=await this.pdfManager.ensureCatalog("xfaImages");xfaImages&&this.xfaFactory.setImages(xfaImages)}async function _loadXfaFonts(handler,task){var acroForm=await this.pdfManager.ensureCatalog("acroForm");if(acroForm){var resources=await acroForm.getAsync("DR");if(resources instanceof Dict){await ObjectLoader.load(resources,["Font"],this.xref);acroForm=resources.get("Font");if(acroForm instanceof Dict){var fontName,font,options=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache,fontCache,standardFontDataCache}=this.catalog,partialEvaluator=new PartialEvaluator({xref:this.xref,handler:handler,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:fontCache,builtInCMapCache:builtInCMapCache,standardFontDataCache:standardFontDataCache,options:options}),operatorList=new OperatorList,pdfFonts=[],initialState={get font(){return pdfFonts.at(-1)},set font(font){pdfFonts.push(font)},clone(){return this}},parseFont=(fontName,fallbackFontDict,cssFontInfo)=>partialEvaluator.handleSetFont(resources,[Name.get(fontName),1],null,operatorList,task,initialState,fallbackFontDict,cssFontInfo).catch(reason=>(warn('loadXfaFonts: "'.concat(reason,'".')),null)),promises=[];for([fontName,font]of acroForm){var descriptor=font.get("FontDescriptor");descriptor instanceof Dict&&validateCSSFont(descriptor={fontFamily:descriptor.get("FontFamily").replaceAll(/[ ]+(\d)/g,"$1"),fontWeight:descriptor.get("FontWeight"),italicAngle:-descriptor.get("ItalicAngle")})&&promises.push(parseFont(fontName,null,descriptor))}await Promise.all(promises);handler=this.xfaFactory.setFonts(pdfFonts);if(handler){options.ignoreErrors=!0,pdfFonts.length=promises.length=0;var missing,_missing,reallyMissingFonts=new Set;for(missing of handler)getXfaFontName("".concat(missing,"-Regular"))||reallyMissingFonts.add(missing);reallyMissingFonts.size&&handler.push("PdfJS-Fallback");for(_missing of handler)if(!reallyMissingFonts.has(_missing))for(var fontInfo 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}]){var name="".concat(_missing,"-").concat(fontInfo.name);promises.push(parseFont(name,getXfaFontDict(name),{fontFamily:_missing,fontWeight:fontInfo.fontWeight,italicAngle:fontInfo.italicAngle}))}await Promise.all(promises),this.xfaFactory.appendFonts(pdfFonts,reallyMissingFonts)}}}}}async function _getLinearizationPage(pageIndex){var{catalog,linearization,xref}=this,linearization=Ref.get(linearization.objectNumberFirst,0);try{var obj=await xref.fetchAsync(linearization);if(obj instanceof Dict){var type=obj.getRaw("Type");if(isName(type=type instanceof Ref?await xref.fetchAsync(type):type,"Page")||!obj.has("Type")&&!obj.has("Kids")&&obj.has("Contents"))return catalog.pageKidsCountCache.has(linearization)||catalog.pageKidsCountCache.put(linearization,1),catalog.pageIndexCache.has(linearization)||catalog.pageIndexCache.put(linearization,0),[obj,linearization]}throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(reason){return warn('_getLinearizationPage: "'.concat(reason.message,'".')),catalog.getPageDict(pageIndex)}}async function _collectFieldObjects(name,parentRef,fieldRef,promises,annotationGlobals,visitedRefs,orphanFields){var xref=this["xref"];if(fieldRef instanceof Ref&&!visitedRefs.has(fieldRef)){visitedRefs.put(fieldRef);var field=await xref.fetchAsync(fieldRef);if(field instanceof Dict){var subtype=(subtype=await field.getAsync("Subtype"))instanceof Name?subtype.name:null;if("Link"!==subtype){if(field.has("T")){subtype=stringToPDFString(await field.getAsync("T"));name=""===name?subtype:"".concat(name,".").concat(subtype)}else for(var obj=field;;){if((obj=obj.getRaw("Parent")||parentRef)instanceof Ref){if(visitedRefs.has(obj))break;obj=await xref.fetchAsync(obj)}if(!(obj instanceof Dict))break;if(obj.has("T")){var _partName=stringToPDFString(await obj.getAsync("T"));name=""===name?_partName:"".concat(name,".").concat(_partName);break}}if(parentRef&&!field.has("Parent")&&isName(field.get("Subtype"),"Widget")&&orphanFields.put(fieldRef,parentRef),promises.has(name)||promises.set(name,[]),promises.get(name).push(AnnotationFactory.create(xref,fieldRef,annotationGlobals,null,!0,orphanFields,null).then(annotation=>null==annotation?void 0:annotation.getFieldObject()).catch(function(reason){return warn('#collectFieldObjects: "'.concat(reason,'".')),null})),field.has("Kids")){subtype=await field.getAsync("Kids");if(Array.isArray(subtype))for(var kid of subtype)await _assertClassBrand(_PDFDocument_brand,this,_collectFieldObjects).call(this,name,fieldRef,kid,promises,annotationGlobals,visitedRefs,orphanFields)}}}}}function parseDocBaseUrl(url){if(url){var absoluteUrl=createValidAbsoluteUrl(url);if(absoluteUrl)return absoluteUrl.href;warn('Invalid absolute docBaseUrl: "'.concat(url,'".'))}return null}class BasePdfManager{constructor(_ref81){var{docBaseUrl:_ref81,docId,enableXfa,evaluatorOptions,handler,password}=_ref81,_ref81=(this._docBaseUrl=parseDocBaseUrl(_ref81),this._docId=docId,this._password=password,this.enableXfa=enableXfa,evaluatorOptions.isOffscreenCanvasSupported&&(evaluatorOptions.isOffscreenCanvasSupported=FeatureTest.isOffscreenCanvasSupported),evaluatorOptions.isImageDecoderSupported&&(evaluatorOptions.isImageDecoderSupported=FeatureTest.isImageDecoderSupported),this.evaluatorOptions=Object.freeze(evaluatorOptions),ImageResizer.setOptions(evaluatorOptions),JpegStream.setOptions(evaluatorOptions),OperatorList.setOptions(evaluatorOptions),_objectSpread({},evaluatorOptions,{handler:handler}));JpxImage.setOptions(_ref81),IccColorSpace.setOptions(_ref81),CmykICCBasedCS.setOptions(_ref81)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(prop,args){return this.ensure(this.pdfDocument,prop,args)}ensureXRef(prop,args){return this.ensure(this.pdfDocument.xref,prop,args)}ensureCatalog(prop,args){return this.ensure(this.pdfDocument.catalog,prop,args)}getPage(pageIndex){return this.pdfDocument.getPage(pageIndex)}fontFallback(id,handler){return this.pdfDocument.fontFallback(id,handler)}cleanup(){return this.pdfDocument.cleanup(0<arguments.length&&void 0!==arguments[0]&&arguments[0])}async ensure(obj,prop,args){unreachable("Abstract method `ensure` called")}requestRange(begin,end){unreachable("Abstract method `requestRange` called")}requestLoadedStream(){unreachable("Abstract method `requestLoadedStream` called")}sendProgressiveData(chunk){unreachable("Abstract method `sendProgressiveData` called")}updatePassword(password){this._password=password}terminate(reason){unreachable("Abstract method `terminate` called")}}class LocalPdfManager extends BasePdfManager{constructor(args){super(args);args=new Stream(args.source);this.pdfDocument=new PDFDocument(this,args),this._loadedStreamPromise=Promise.resolve(args)}async ensure(obj,prop,args){prop=obj[prop];return"function"==typeof prop?prop.apply(obj,args):prop}requestRange(begin,end){return Promise.resolve()}requestLoadedStream(){return this._loadedStreamPromise}terminate(reason){}}class NetworkPdfManager extends BasePdfManager{constructor(args){super(args),this.streamManager=new ChunkedStreamManager(args.source,{msgHandler:args.handler,length:args.length,disableAutoFetch:args.disableAutoFetch,rangeChunkSize:args.rangeChunkSize}),this.pdfDocument=new PDFDocument(this,this.streamManager.getStream())}async ensure(obj,prop,args){try{var value=obj[prop];return"function"==typeof value?value.apply(obj,args):value}catch(ex){if(ex instanceof MissingDataException)return await this.requestRange(ex.begin,ex.end),this.ensure(obj,prop,args);throw ex}}requestRange(begin,end){return this.streamManager.requestRange(begin,end)}requestLoadedStream(){return this.streamManager.requestAllChunks(0<arguments.length&&void 0!==arguments[0]&&arguments[0])}sendProgressiveData(chunk){this.streamManager.onReceiveData({chunk:chunk})}terminate(reason){this.streamManager.abort(reason)}}var CallbackKind={DATA:1,ERROR:2},StreamKind={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function onFn(){}function wrapReason(ex){if(ex instanceof AbortException||ex instanceof InvalidPDFException||ex instanceof PasswordException||ex instanceof ResponseException||ex instanceof UnknownErrorException)return ex;switch(ex instanceof Error||"object"==typeof ex&&null!==ex||unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),ex.name){case"AbortException":return new AbortException(ex.message);case"InvalidPDFException":return new InvalidPDFException(ex.message);case"PasswordException":return new PasswordException(ex.message,ex.code);case"ResponseException":return new ResponseException(ex.message,ex.status,ex.missing);case"UnknownErrorException":return new UnknownErrorException(ex.message,ex.details)}return new UnknownErrorException(ex.message,ex.toString())}var _messageAC=new WeakMap,_MessageHandler_brand=new WeakSet;class MessageHandler{constructor(_sourceName,_targetName,_comObj){_classPrivateMethodInitSpec(this,_MessageHandler_brand),_classPrivateFieldInitSpec(this,_messageAC,new AbortController),this.sourceName=_sourceName,this.targetName=_targetName,this.comObj=_comObj,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),_comObj.addEventListener("message",_assertClassBrand(_MessageHandler_brand,this,_onMessage).bind(this),{signal:_classPrivateFieldGet(_messageAC,this).signal})}on(actionName,handler){var ah=this.actionHandler;if(ah[actionName])throw new Error('There is already an actionName called "'.concat(actionName,'"'));ah[actionName]=handler}send(actionName,data,transfers){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:actionName,data:data},transfers)}sendWithPromise(actionName,data,transfers){var callbackId=this.callbackId++,capability=Promise.withResolvers();this.callbackCapabilities[callbackId]=capability;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:actionName,callbackId:callbackId,data:data},transfers)}catch(ex){capability.reject(ex)}return capability.promise}sendWithStream(actionName,data,queueingStrategy,transfers){var streamId=this.streamId++,sourceName=this.sourceName,targetName=this.targetName,comObj=this.comObj;return new ReadableStream({start:controller=>{var startCapability=Promise.withResolvers();return this.streamControllers[streamId]={controller:controller,startCall:startCapability,pullCall:null,cancelCall:null,isClosed:!1},comObj.postMessage({sourceName:sourceName,targetName:targetName,action:actionName,streamId:streamId,data:data,desiredSize:controller.desiredSize},transfers),startCapability.promise},pull:controller=>{var pullCapability=Promise.withResolvers();return this.streamControllers[streamId].pullCall=pullCapability,comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.PULL,streamId:streamId,desiredSize:controller.desiredSize}),pullCapability.promise},cancel:reason=>{assert(reason instanceof Error,"cancel must have a valid reason");var cancelCapability=Promise.withResolvers();return this.streamControllers[streamId].cancelCall=cancelCapability,this.streamControllers[streamId].isClosed=!0,comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.CANCEL,streamId:streamId,reason:wrapReason(reason)}),cancelCapability.promise}},queueingStrategy)}destroy(){var _classPrivateFieldGet7;null!=(_classPrivateFieldGet7=_classPrivateFieldGet(_messageAC,this))&&_classPrivateFieldGet7.abort(),_classPrivateFieldSet(_messageAC,this,null)}}function _onMessage(_ref97){var data=_ref97["data"];if(data.targetName===this.sourceName)if(data.stream)_assertClassBrand(_MessageHandler_brand,this,_processStreamMessage).call(this,data);else if(data.callback){var _ref97=data.callbackId,capability=this.callbackCapabilities[_ref97];if(!capability)throw new Error("Cannot resolve callback ".concat(_ref97));if(delete this.callbackCapabilities[_ref97],data.callback===CallbackKind.DATA)capability.resolve(data.data);else{if(data.callback!==CallbackKind.ERROR)throw new Error("Unexpected callback case");capability.reject(wrapReason(data.reason))}}else{var sourceName,targetName,comObj,_ref97=this.actionHandler[data.action];if(!_ref97)throw new Error("Unknown action from worker: ".concat(data.action));data.callbackId?(sourceName=this.sourceName,targetName=data.sourceName,comObj=this.comObj,Promise.try(_ref97,data.data).then(function(result){comObj.postMessage({sourceName:sourceName,targetName:targetName,callback:CallbackKind.DATA,callbackId:data.callbackId,data:result})},function(reason){comObj.postMessage({sourceName:sourceName,targetName:targetName,callback:CallbackKind.ERROR,callbackId:data.callbackId,reason:wrapReason(reason)})})):data.streamId?_assertClassBrand(_MessageHandler_brand,this,_createStreamSink).call(this,data):_ref97(data.data)}}function _createStreamSink(data){var streamId=data.streamId,sourceName=this.sourceName,targetName=data.sourceName,comObj=this.comObj,self=this,action=this.actionHandler[data.action],streamSink={enqueue(chunk){var lastDesiredSize,size=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,transfers=2<arguments.length?arguments[2]:void 0;this.isCancelled||(lastDesiredSize=this.desiredSize,this.desiredSize-=size,0<lastDesiredSize&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.ENQUEUE,streamId:streamId,chunk:chunk},transfers))},close(){this.isCancelled||(this.isCancelled=!0,comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.CLOSE,streamId:streamId}),delete self.streamSinks[streamId])},error(reason){assert(reason instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.ERROR,streamId:streamId,reason:wrapReason(reason)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:data.desiredSize,ready:null};streamSink.sinkCapability.resolve(),streamSink.ready=streamSink.sinkCapability.promise,this.streamSinks[streamId]=streamSink,Promise.try(action,data.data,streamSink).then(function(){comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.START_COMPLETE,streamId:streamId,success:!0})},function(reason){comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.START_COMPLETE,streamId:streamId,reason:wrapReason(reason)})})}function _processStreamMessage(data){var dataReason,streamId=data.streamId,sourceName=this.sourceName,targetName=data.sourceName,comObj=this.comObj,streamController=this.streamControllers[streamId],streamSink=this.streamSinks[streamId];switch(data.stream){case StreamKind.START_COMPLETE:data.success?streamController.startCall.resolve():streamController.startCall.reject(wrapReason(data.reason));break;case StreamKind.PULL_COMPLETE:data.success?streamController.pullCall.resolve():streamController.pullCall.reject(wrapReason(data.reason));break;case StreamKind.PULL:streamSink?(streamSink.desiredSize<=0&&0<data.desiredSize&&streamSink.sinkCapability.resolve(),streamSink.desiredSize=data.desiredSize,Promise.try(streamSink.onPull||onFn).then(function(){comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.PULL_COMPLETE,streamId:streamId,success:!0})},function(reason){comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.PULL_COMPLETE,streamId:streamId,reason:wrapReason(reason)})})):comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.PULL_COMPLETE,streamId:streamId,success:!0});break;case StreamKind.ENQUEUE:assert(streamController,"enqueue should have stream controller"),streamController.isClosed||streamController.controller.enqueue(data.chunk);break;case StreamKind.CLOSE:assert(streamController,"close should have stream controller"),streamController.isClosed||(streamController.isClosed=!0,streamController.controller.close(),_assertClassBrand(_MessageHandler_brand,this,_deleteStreamController).call(this,streamController,streamId));break;case StreamKind.ERROR:assert(streamController,"error should have stream controller"),streamController.controller.error(wrapReason(data.reason)),_assertClassBrand(_MessageHandler_brand,this,_deleteStreamController).call(this,streamController,streamId);break;case StreamKind.CANCEL_COMPLETE:data.success?streamController.cancelCall.resolve():streamController.cancelCall.reject(wrapReason(data.reason)),_assertClassBrand(_MessageHandler_brand,this,_deleteStreamController).call(this,streamController,streamId);break;case StreamKind.CANCEL:streamSink&&(dataReason=wrapReason(data.reason),Promise.try(streamSink.onCancel||onFn,dataReason).then(function(){comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.CANCEL_COMPLETE,streamId:streamId,success:!0})},function(reason){comObj.postMessage({sourceName:sourceName,targetName:targetName,stream:StreamKind.CANCEL_COMPLETE,streamId:streamId,reason:wrapReason(reason)})}),streamSink.sinkCapability.reject(dataReason),streamSink.isCancelled=!0,delete this.streamSinks[streamId]);break;default:throw new Error("Unexpected stream case")}}async function _deleteStreamController(streamController,streamId){var _streamController$sta;await Promise.allSettled([null==(_streamController$sta=streamController.startCall)?void 0:_streamController$sta.promise,null==(_streamController$sta=streamController.pullCall)?void 0:_streamController$sta.promise,null==(_streamController$sta=streamController.cancelCall)?void 0:_streamController$sta.promise]),delete this.streamControllers[streamId]}async function writeObject(ref,obj,buffer,_ref82){var{encrypt:_ref82=null}=_ref82,_ref82=null==_ref82?void 0:_ref82.createCipherTransform(ref.num,ref.gen);buffer.push("".concat(ref.num," ").concat(ref.gen," obj\n")),obj instanceof Dict?await writeDict(obj,buffer,_ref82):obj instanceof BaseStream?await writeStream(obj,buffer,_ref82):(Array.isArray(obj)||ArrayBuffer.isView(obj))&&await writeArray(obj,buffer,_ref82),buffer.push("\nendobj\n")}async function writeDict(dict,buffer,transform){buffer.push("<<");for(var key of dict.getKeys())buffer.push(" /".concat(escapePDFName(key)," ")),await writeValue(dict.getRaw(key),buffer,transform);buffer.push(">>")}async function writeStream(stream,buffer,transform){var bytes=stream.getBytes(),stream=stream["dict"],[filter,params]=await Promise.all([stream.getAsync("Filter"),stream.getAsync("DecodeParms")]),isFilterZeroFlateDecode=isName(Array.isArray(filter)?await stream.xref.fetchIfRefAsync(filter[0]):filter,"FlateDecode");if(256<=bytes.length||isFilterZeroFlateDecode)try{var newFilter,newParams,cs=new CompressionStream("deflate"),writer=cs.writable.getWriter(),buf=(await writer.ready,writer.write(bytes).then(async()=>{await writer.ready,await writer.close()}).catch(()=>{}),await new Response(cs.readable).arrayBuffer()),bytes=new Uint8Array(buf);filter?isFilterZeroFlateDecode||(newFilter=Array.isArray(filter)?[Name.get("FlateDecode"),...filter]:[Name.get("FlateDecode"),filter],params&&(newParams=Array.isArray(params)?[null,...params]:[null,params])):newFilter=Name.get("FlateDecode"),newFilter&&stream.set("Filter",newFilter),newParams&&stream.set("DecodeParms",newParams)}catch(ex){info('writeStream - cannot compress data: "'.concat(ex,'".'))}cs=bytesToString(bytes);transform&&(cs=transform.encryptString(cs)),stream.set("Length",cs.length),await writeDict(stream,buffer,transform),buffer.push(" stream\n",cs,"\nendstream")}async function writeArray(array,buffer,transform){buffer.push("[");var val,first=!0;for(val of array)first?first=!1:buffer.push(" "),await writeValue(val,buffer,transform);buffer.push("]")}async function writeValue(value,buffer,transform){value instanceof Name?buffer.push("/".concat(escapePDFName(value.name))):value instanceof Ref?buffer.push("".concat(value.num," ").concat(value.gen," R")):Array.isArray(value)||ArrayBuffer.isView(value)?await writeArray(value,buffer,transform):"string"==typeof value?(transform&&(value=transform.encryptString(value)),buffer.push("(".concat(escapeString(value),")"))):"number"==typeof value?buffer.push(numberToString(value)):"boolean"==typeof value?buffer.push(value.toString()):value instanceof Dict?await writeDict(value,buffer,transform):value instanceof BaseStream?await writeStream(value,buffer,transform):null===value?buffer.push("null"):warn("Unhandled value in writer: ".concat(typeof value,", please file a bug."))}function writeInt(number,size,offset,buffer){for(var i=size+offset-1;offset-1<i;i--)buffer[i]=255&number,number>>=8;return offset+size}function writeString(string,offset,buffer){for(var ii=string.length,i=0;i<ii;i++)buffer[offset+i]=255&string.charCodeAt(i);return offset+ii}function computeMD5(filesize,xrefInfo){var str,time=Math.floor(Date.now()/1e3),filename=xrefInfo.filename||"",time=[time.toString(),filename,filesize.toString(),...xrefInfo.infoMap.values()],filename=Math.sumPrecise(time.map(str=>str.length)),array=new Uint8Array(filename),offset=0;for(str of time)offset=writeString(str,offset,array);return bytesToString(calculateMD5(array,0,array.length))}function writeXFADataForAcroform(str,changes){var xfa,path,value,nodePath,node,xml=new SimpleXMLParser({hasAttributes:!0}).parseFromString(str);for({xfa}of changes)xfa&&({path,value}=xfa,path)&&(nodePath=parseXFAPath(path),(node=!(node=xml.documentElement.searchNode(nodePath,0))&&1<nodePath.length?xml.documentElement.searchNode([nodePath.at(-1)],0):node)?node.childNodes=Array.isArray(value)?value.map(val=>new SimpleDOMNode("value",val)):[new SimpleDOMNode("#text",value)]:warn("Node not found for path: ".concat(path)));str=[];return xml.documentElement.dump(str),str.join("")}async function updateAcroform(_ref83){var dict,{acroForm:_ref83,acroFormRef,hasXfa,hasXfaDatasetsEntry,xfaDatasetsRef,needAppearances,changes}=_ref83;!hasXfa||hasXfaDatasetsEntry||xfaDatasetsRef||warn("XFA - Cannot save it"),(needAppearances||hasXfa&&xfaDatasetsRef&&!hasXfaDatasetsEntry)&&(dict=_ref83.clone(),hasXfa&&!hasXfaDatasetsEntry&&((hasXfa=_ref83.get("XFA").slice()).splice(2,0,"datasets"),hasXfa.splice(3,0,xfaDatasetsRef),dict.set("XFA",hasXfa)),needAppearances&&dict.set("NeedAppearances",!0),changes.put(acroFormRef,{data:dict}))}function updateXFA(_ref84){var{xfaData:_ref84,xfaDatasetsRef,changes,xref}=_ref84,_ref84=(null===_ref84&&(_ref84=writeXFADataForAcroform(xref.fetchIfRef(xfaDatasetsRef).getString(),changes)),new StringStream(_ref84));_ref84.dict=new Dict(xref),_ref84.dict.set("Type",Name.get("EmbeddedFile")),changes.put(xfaDatasetsRef,{data:_ref84})}async function getXRefTable(xrefInfo,baseOffset,newRefs,newXref,buffer){buffer.push("xref\n");var ref,data,indexes=getIndexes(newRefs),indexesPosition=0;for({ref,data}of newRefs)ref.num===indexes[indexesPosition]&&(buffer.push("".concat(indexes[indexesPosition]," ").concat(indexes[indexesPosition+1],"\n")),indexesPosition+=2),null!==data?(buffer.push("".concat(baseOffset.toString().padStart(10,"0")," ").concat(Math.min(ref.gen,65535).toString().padStart(5,"0")," n\r\n")),baseOffset+=data.length):buffer.push("0000000000 ".concat(Math.min(ref.gen+1,65535).toString().padStart(5,"0")," f\r\n"));computeIDs(baseOffset,xrefInfo,newXref),buffer.push("trailer\n"),await writeDict(newXref,buffer),buffer.push("\nstartxref\n",baseOffset.toString(),"\n%%EOF\n")}function getIndexes(newRefs){var ref,indexes=[];for({ref}of newRefs)ref.num===indexes.at(-2)+indexes.at(-1)?indexes[indexes.length-1]+=1:indexes.push(ref.num,1);return indexes}async function getXRefStreamTable(xrefInfo,baseOffset,newRefs,newXref,buffer){var ref,_data5,xrefTableData=[],maxOffset=0,maxGen=0;for({ref,data:_data5}of newRefs){var gen=void 0,maxOffset=Math.max(maxOffset,baseOffset);null!==_data5?(gen=Math.min(ref.gen,65535),xrefTableData.push([1,baseOffset,gen]),baseOffset+=_data5.length):(gen=Math.min(ref.gen+1,65535),xrefTableData.push([0,0,gen])),maxGen=Math.max(maxGen,gen)}newXref.set("Index",getIndexes(newRefs));var type,objOffset,_gen,sizes=[1,getSizeInBytes(maxOffset),getSizeInBytes(maxGen)],newRefs=(newXref.set("W",sizes),computeIDs(baseOffset,xrefInfo,newXref),Math.sumPrecise(sizes)),data=new Uint8Array(newRefs*xrefTableData.length),newRefs=new Stream(data),offset=(newRefs.dict=newXref,0);for([type,objOffset,_gen]of xrefTableData)offset=writeInt(type,sizes[0],offset,data),offset=writeInt(objOffset,sizes[1],offset,data),offset=writeInt(_gen,sizes[2],offset,data);await writeObject(xrefInfo.newRef,newRefs,buffer,{}),buffer.push("startxref\n",baseOffset.toString(),"\n%%EOF\n")}function computeIDs(baseOffset,xrefInfo,newXref){Array.isArray(xrefInfo.fileIds)&&0<xrefInfo.fileIds.length&&(baseOffset=computeMD5(baseOffset,xrefInfo),newXref.set("ID",[xrefInfo.fileIds[0],baseOffset]))}function getTrailerDict(xrefInfo,changes,useXrefStream){var newXref=new Dict(null),refForXrefTable=(newXref.set("Prev",xrefInfo.startXRef),xrefInfo.newRef);return useXrefStream?(changes.put(refForXrefTable,{data:""}),newXref.set("Size",refForXrefTable.num+1),newXref.set("Type",Name.get("XRef"))):newXref.set("Size",refForXrefTable.num),null!==xrefInfo.rootRef&&newXref.set("Root",xrefInfo.rootRef),null!==xrefInfo.infoRef&&newXref.set("Info",xrefInfo.infoRef),null!==xrefInfo.encryptRef&&newXref.set("Encrypt",xrefInfo.encryptRef),newXref}async function writeChanges(changes,xref){var ref,data,buffer=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[],newRefs=[];for([ref,{data}]of changes.items())null===data||"string"==typeof data?newRefs.push({ref:ref,data:data}):(await writeObject(ref,data,buffer,xref),newRefs.push({ref:ref,data:buffer.join("")}),buffer.length=0);return newRefs.sort((a,b)=>a.ref.num-b.ref.num)}async function incrementalUpdate(_ref85){var data,{originalData:_ref85,xrefInfo,changes,xref=null,hasXfa=!1,xfaDatasetsRef=null,hasXfaDatasetsEntry=!1,needAppearances,acroFormRef=null,acroForm=null,xfaData=null,useXrefStream=!1}=_ref85,acroForm=(await updateAcroform({xref:xref,acroForm:acroForm,acroFormRef:acroFormRef,hasXfa:hasXfa,hasXfaDatasetsEntry:hasXfaDatasetsEntry,xfaDatasetsRef:xfaDatasetsRef,needAppearances:needAppearances,changes:changes}),hasXfa&&updateXFA({xfaData:xfaData,xfaDatasetsRef:xfaDatasetsRef,changes:changes,xref:xref}),getTrailerDict(xrefInfo,changes,useXrefStream)),buffer=[],acroFormRef=await writeChanges(changes,xref,buffer),hasXfaDatasetsEntry=_ref85.length,needAppearances=_ref85.at(-1);10!==needAppearances&&13!==needAppearances&&(buffer.push("\n"),hasXfaDatasetsEntry+=1);for({data}of acroFormRef)null!==data&&buffer.push(data);await(useXrefStream?getXRefStreamTable:getXRefTable)(xrefInfo,hasXfaDatasetsEntry,acroFormRef,acroForm,buffer);var str,hasXfa=_ref85.length+Math.sumPrecise(buffer.map(str=>str.length)),array=new Uint8Array(hasXfa),offset=(array.set(_ref85),_ref85.length);for(str of buffer)offset=writeString(str,offset,array);return array}class PDFWorkerStream{constructor(msgHandler){this._msgHandler=msgHandler,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return assert(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler),this._fullRequestReader}getRangeReader(begin,end){begin=new PDFWorkerStreamRangeReader(begin,end,this._msgHandler);return this._rangeRequestReaders.push(begin),begin}cancelAllRequests(reason){var _this$_fullRequestRea,reader;null!=(_this$_fullRequestRea=this._fullRequestReader)&&_this$_fullRequestRea.cancel(reason);for(reader of this._rangeRequestReaders.slice(0))reader.cancel(reason)}}class PDFWorkerStreamReader{constructor(msgHandler){this._msgHandler=msgHandler,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;msgHandler=this._msgHandler.sendWithStream("GetReader");this._reader=msgHandler.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data=>{this._isStreamingSupported=data.isStreamingSupported,this._isRangeSupported=data.isRangeSupported,this._contentLength=data.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){var{value,done}=await this._reader.read();return done?{value:void 0,done:!0}:{value:value.buffer,done:!1}}cancel(reason){this._reader.cancel(reason)}}class PDFWorkerStreamRangeReader{constructor(begin,end,msgHandler){this._msgHandler=msgHandler,this.onProgress=null;msgHandler=this._msgHandler.sendWithStream("GetRangeReader",{begin:begin,end:end});this._reader=msgHandler.getReader()}get isStreamingSupported(){return!1}async read(){var{value,done}=await this._reader.read();return done?{value:void 0,done:!0}:{value:value.buffer,done:!1}}cancel(reason){this._reader.cancel(reason)}}class WorkerTask{constructor(name){this.name=name,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 setup(handler,port){var testMessageProcessed=!1;handler.on("test",data=>{testMessageProcessed||(testMessageProcessed=!0,handler.send("test",data instanceof Uint8Array))}),handler.on("configure",data=>{setVerbosityLevel(data.verbosity)}),handler.on("GetDocRequest",data=>this.createDocumentHandler(data,port))}static createDocumentHandler(docParams,port){var pdfManager,terminated=!1,cancelXHRs=null,WorkerTasks=new Set,verbosity=getVerbosityLevel(),{docId,apiVersion}=docParams;if("5.3.93"!==apiVersion)throw new Error('The API version "'.concat(apiVersion,'" does not match ')+'the Worker version "'.concat("5.3.93",'".'));var prop,_prop,buildMsg=(type,prop)=>"The `".concat(type,".prototype` contains unexpected enumerable property ")+'"'.concat(prop,'", thus breaking e.g. `for...in` iteration of ').concat(type,"s.");for(prop in{})throw new Error(buildMsg("Object",prop));for(_prop in[])throw new Error(buildMsg("Array",_prop));var apiVersion=docId+"_worker",handler=new MessageHandler(apiVersion,docId,port);function ensureNotTerminated(){if(terminated)throw new Error("Worker was terminated")}function startWorkerTask(task){WorkerTasks.add(task)}function finishWorkerTask(task){task.finish(),WorkerTasks.delete(task)}async function loadDocument(recoveryMode){await pdfManager.ensureDoc("checkHeader"),await pdfManager.ensureDoc("parseStartXRef"),await pdfManager.ensureDoc("parse",[recoveryMode]),await pdfManager.ensureDoc("checkFirstPage",[recoveryMode]),await pdfManager.ensureDoc("checkLastPage",[recoveryMode]);var recoveryMode=await pdfManager.ensureDoc("isPureXfa"),[task,fingerprints]=(recoveryMode&&(startWorkerTask(task=new WorkerTask("loadXfaResources")),await pdfManager.ensureDoc("loadXfaResources",[handler,task]),finishWorkerTask(task)),await Promise.all([pdfManager.ensureDoc("numPages"),pdfManager.ensureDoc("fingerprints")]));return{numPages:task,fingerprints:fingerprints,htmlForXfa:recoveryMode?await pdfManager.ensureDoc("htmlForXfa"):null}}function setupDoc(data){function onSuccess(doc){ensureNotTerminated(),handler.send("GetDoc",{pdfInfo:doc})}function onFailure(ex){var task;ensureNotTerminated(),ex instanceof PasswordException?(startWorkerTask(task=new WorkerTask("PasswordException: response ".concat(ex.code))),handler.sendWithPromise("PasswordRequest",ex).then(function(_ref88){_ref88=_ref88.password;finishWorkerTask(task),pdfManager.updatePassword(_ref88),pdfManagerReady()}).catch(function(){finishWorkerTask(task),handler.send("DocException",ex)})):handler.send("DocException",wrapReason(ex))}function pdfManagerReady(){ensureNotTerminated(),loadDocument(!1).then(onSuccess,function(reason){ensureNotTerminated(),reason instanceof XRefParseException?pdfManager.requestLoadedStream().then(function(){ensureNotTerminated(),loadDocument(!0).then(onSuccess,onFailure)}):onFailure(reason)})}ensureNotTerminated(),async function(_ref86){var pdfStream,fullRequest,pdfManagerCapability,newPdfManager,cachedChunks,loaded,{data:_ref86,password,disableAutoFetch,rangeChunkSize,length,docBaseUrl,enableXfa,evaluatorOptions}=_ref86,pdfManagerArgs={source:null,disableAutoFetch:disableAutoFetch,docBaseUrl:docBaseUrl,docId:docId,enableXfa:enableXfa,evaluatorOptions:evaluatorOptions,handler:handler,length:length,password:password,rangeChunkSize:rangeChunkSize};return _ref86?(pdfManagerArgs.source=_ref86,new LocalPdfManager(pdfManagerArgs)):(pdfStream=new PDFWorkerStream(handler),fullRequest=pdfStream.getFullReader(),pdfManagerCapability=Promise.withResolvers(),cachedChunks=[],loaded=0,fullRequest.headersReady.then(function(){if(fullRequest.isRangeSupported){pdfManagerArgs.source=pdfStream,pdfManagerArgs.length=fullRequest.contentLength,pdfManagerArgs.disableAutoFetch||(pdfManagerArgs.disableAutoFetch=fullRequest.isStreamingSupported),newPdfManager=new NetworkPdfManager(pdfManagerArgs);for(var chunk of cachedChunks)newPdfManager.sendProgressiveData(chunk);cachedChunks=[],pdfManagerCapability.resolve(newPdfManager),cancelXHRs=null}}).catch(function(reason){pdfManagerCapability.reject(reason),cancelXHRs=null}),new Promise(function(resolve,reject){var readChunk=function(_ref87){var pdfFile,{value:_ref87,done}=_ref87;try{ensureNotTerminated(),done?(newPdfManager||(pdfFile=arrayBuffersToBytes(cachedChunks),cachedChunks=[],length&&pdfFile.length!==length&&warn("reported HTTP length is different from actual"),pdfManagerArgs.source=pdfFile,newPdfManager=new LocalPdfManager(pdfManagerArgs),pdfManagerCapability.resolve(newPdfManager)),cancelXHRs=null):(loaded+=_ref87.byteLength,fullRequest.isStreamingSupported||handler.send("DocProgress",{loaded:loaded,total:Math.max(loaded,fullRequest.contentLength||0)}),newPdfManager?newPdfManager.sendProgressiveData(_ref87):cachedChunks.push(_ref87),fullRequest.read().then(readChunk,reject))}catch(e){reject(e)}};fullRequest.read().then(readChunk,reject)}).catch(function(e){pdfManagerCapability.reject(e),cancelXHRs=null}),cancelXHRs=reason=>{pdfStream.cancelAllRequests(reason)},pdfManagerCapability.promise)}(data).then(function(newPdfManager){if(terminated)throw newPdfManager.terminate(new AbortException("Worker was terminated.")),new Error("Worker was terminated");(pdfManager=newPdfManager).requestLoadedStream(!0).then(stream=>{handler.send("DataLoaded",{length:stream.bytes.byteLength})})}).then(pdfManagerReady,onFailure)}return handler.on("GetPage",function(data){return pdfManager.getPage(data.pageIndex).then(function(page){return Promise.all([pdfManager.ensure(page,"rotate"),pdfManager.ensure(page,"ref"),pdfManager.ensure(page,"userUnit"),pdfManager.ensure(page,"view")]).then(function(_ref89){var[_ref89,ref,userUnit,view]=_ref89;return{rotate:_ref89,ref:ref,refStr:null!=(_ref89=null==ref?void 0:ref.toString())?_ref89:null,userUnit:userUnit,view:view}})})}),handler.on("GetPageIndex",function(data){data=Ref.get(data.num,data.gen);return pdfManager.ensureCatalog("getPageIndex",[data])}),handler.on("GetDestinations",function(data){return pdfManager.ensureCatalog("destinations")}),handler.on("GetDestination",function(data){return pdfManager.ensureCatalog("getDestination",[data.id])}),handler.on("GetPageLabels",function(data){return pdfManager.ensureCatalog("pageLabels")}),handler.on("GetPageLayout",function(data){return pdfManager.ensureCatalog("pageLayout")}),handler.on("GetPageMode",function(data){return pdfManager.ensureCatalog("pageMode")}),handler.on("GetViewerPreferences",function(data){return pdfManager.ensureCatalog("viewerPreferences")}),handler.on("GetOpenAction",function(data){return pdfManager.ensureCatalog("openAction")}),handler.on("GetAttachments",function(data){return pdfManager.ensureCatalog("attachments")}),handler.on("GetDocJSActions",function(data){return pdfManager.ensureCatalog("jsActions")}),handler.on("GetPageJSActions",function(_ref90){_ref90=_ref90.pageIndex;return pdfManager.getPage(_ref90).then(page=>pdfManager.ensure(page,"jsActions"))}),handler.on("GetOutline",function(data){return pdfManager.ensureCatalog("documentOutline")}),handler.on("GetOptionalContentConfig",function(data){return pdfManager.ensureCatalog("optionalContentConfig")}),handler.on("GetPermissions",function(data){return pdfManager.ensureCatalog("permissions")}),handler.on("GetMetadata",function(data){return Promise.all([pdfManager.ensureDoc("documentInfo"),pdfManager.ensureCatalog("metadata")])}),handler.on("GetMarkInfo",function(data){return pdfManager.ensureCatalog("markInfo")}),handler.on("GetData",function(data){return pdfManager.requestLoadedStream().then(stream=>stream.bytes)}),handler.on("GetAnnotations",function(_ref91){var{pageIndex,intent}=_ref91;return pdfManager.getPage(pageIndex).then(function(page){var task=new WorkerTask("GetAnnotations: page ".concat(pageIndex));return startWorkerTask(task),page.getAnnotationsData(handler,task,intent).then(data=>(finishWorkerTask(task),data),reason=>{throw finishWorkerTask(task),reason})})}),handler.on("GetFieldObjects",function(data){return pdfManager.ensureDoc("fieldObjects").then(fieldObjects=>(null==fieldObjects?void 0:fieldObjects.allFields)||null)}),handler.on("HasJSActions",function(data){return pdfManager.ensureDoc("hasJSActions")}),handler.on("GetCalculationOrderIds",function(data){return pdfManager.ensureDoc("calculationOrderIds")}),handler.on("SaveDocument",async function(_ref92){var structTreeRoot,{isPureXfa:_ref92,numPages,annotationStorage,filename}=_ref92,globalPromises=[pdfManager.requestLoadedStream(),pdfManager.ensureCatalog("acroForm"),pdfManager.ensureCatalog("acroFormRef"),pdfManager.ensureDoc("startXRef"),pdfManager.ensureDoc("xref"),pdfManager.ensureDoc("linearization"),pdfManager.ensureCatalog("structTreeRoot")],changes=new RefSetCache,promises=[],newAnnotationsByPage=_ref92?null:getNewAnnotationsMap(annotationStorage),[globalPromises,acroForm,acroFormRef,startXRef,xref,linearization,_structTreeRoot]=await Promise.all(globalPromises),catalogRef=xref.trailer.getRaw("Root")||null;if(newAnnotationsByPage){_structTreeRoot?await _structTreeRoot.canUpdateStructTree({pdfManager:pdfManager,newAnnotationsByPage:newAnnotationsByPage})&&(structTreeRoot=_structTreeRoot):await StructTreeRoot.canCreateStructureTree({catalogRef:catalogRef,pdfManager:pdfManager,newAnnotationsByPage:newAnnotationsByPage})&&(structTreeRoot=null);var pageIndex,annotations,imagePromises=AnnotationFactory.generateImages(annotationStorage.values(),xref,pdfManager.evaluatorOptions.isOffscreenCanvasSupported),newAnnotationPromises=void 0===structTreeRoot?promises:[];for([pageIndex,annotations]of newAnnotationsByPage)await async function(pageIndex,annotations){newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page=>{var task=new WorkerTask("Save (editor): page ".concat(pageIndex));return startWorkerTask(task),page.saveNewAnnotations(handler,task,annotations,imagePromises,changes).finally(function(){finishWorkerTask(task)})}))}(pageIndex,annotations);null===structTreeRoot?promises.push(Promise.all(newAnnotationPromises).then(async()=>{await StructTreeRoot.createStructureTree({newAnnotationsByPage:newAnnotationsByPage,xref:xref,catalogRef:catalogRef,pdfManager:pdfManager,changes:changes})})):structTreeRoot&&promises.push(Promise.all(newAnnotationPromises).then(async()=>{await structTreeRoot.updateStructureTree({newAnnotationsByPage:newAnnotationsByPage,pdfManager:pdfManager,changes:changes})}))}if(_ref92)promises.push(pdfManager.ensureDoc("serializeXfaData",[annotationStorage]));else for(var _pageIndex3=0;_pageIndex3<numPages;_pageIndex3++)await async function(_pageIndex3){promises.push(pdfManager.getPage(_pageIndex3).then(function(page){var task=new WorkerTask("Save: page ".concat(_pageIndex3));return startWorkerTask(task),page.save(handler,task,annotationStorage,changes).finally(function(){finishWorkerTask(task)})}))}(_pageIndex3);var _structTreeRoot=await Promise.all(promises),xfaData=null;if(_ref92){if(!(xfaData=_structTreeRoot[0]))return globalPromises.bytes}else if(0===changes.size)return globalPromises.bytes;var _ref92=acroFormRef&&acroForm instanceof Dict&&changes.values().some(ref=>ref.needAppearances),xfa=acroForm instanceof Dict&&acroForm.get("XFA")||null,xfaDatasetsRef=null,hasXfaDatasetsEntry=!1;if(Array.isArray(xfa)){for(var i=0,ii=xfa.length;i<ii;i+=2)"datasets"===xfa[i]&&(xfaDatasetsRef=xfa[i+1],hasXfaDatasetsEntry=!0);null===xfaDatasetsRef&&(xfaDatasetsRef=xref.getNewTemporaryRef())}else xfa&&warn("Unsupported XFA type.");_structTreeRoot=Object.create(null);if(xref.trailer){var infoMap=new Map,xrefInfo=xref.trailer.get("Info")||null;if(xrefInfo instanceof Dict)for(var[key,value]of xrefInfo)"string"==typeof value&&infoMap.set(key,stringToPDFString(value));_structTreeRoot={rootRef:catalogRef,encryptRef:xref.trailer.getRaw("Encrypt")||null,newRef:xref.getNewTemporaryRef(),infoRef:xref.trailer.getRaw("Info")||null,infoMap:infoMap,fileIds:xref.trailer.get("ID")||null,startXRef:!linearization&&null!=(xrefInfo=xref.lastXRefStreamPos)?xrefInfo:startXRef,filename:filename}}return incrementalUpdate({originalData:globalPromises.bytes,xrefInfo:_structTreeRoot,changes:changes,xref:xref,hasXfa:!!xfa,xfaDatasetsRef:xfaDatasetsRef,hasXfaDatasetsEntry:hasXfaDatasetsEntry,needAppearances:_ref92,acroFormRef:acroFormRef,acroForm:acroForm,xfaData:xfaData,useXrefStream:isDict(xref.topDict,"XRef")}).finally(()=>{xref.resetNewTemporaryRef()})}),handler.on("GetOperatorList",function(data,sink){var pageIndex=data.pageIndex;pdfManager.getPage(pageIndex).then(function(page){var task=new WorkerTask("GetOperatorList: page ".concat(pageIndex)),start=(startWorkerTask(task),verbosity>=VerbosityLevel.INFOS?Date.now():0);page.getOperatorList({handler:handler,sink:sink,task:task,intent:data.intent,cacheKey:data.cacheKey,annotationStorage:data.annotationStorage,modifiedIds:data.modifiedIds}).then(function(operatorListInfo){finishWorkerTask(task),start&&info("page=".concat(pageIndex+1," - getOperatorList: time=")+"".concat(Date.now()-start,"ms, len=").concat(operatorListInfo.length)),sink.close()},function(reason){finishWorkerTask(task),task.terminated||sink.error(reason)})})}),handler.on("GetTextContent",function(data,sink){var{pageIndex,includeMarkedContent,disableNormalization}=data;pdfManager.getPage(pageIndex).then(function(page){var task=new WorkerTask("GetTextContent: page "+pageIndex),start=(startWorkerTask(task),verbosity>=VerbosityLevel.INFOS?Date.now():0);page.extractTextContent({handler:handler,task:task,sink:sink,includeMarkedContent:includeMarkedContent,disableNormalization:disableNormalization}).then(function(){finishWorkerTask(task),start&&info("page=".concat(pageIndex+1," - getTextContent: time=")+"".concat(Date.now()-start,"ms")),sink.close()},function(reason){finishWorkerTask(task),task.terminated||sink.error(reason)})})}),handler.on("GetStructTree",function(data){return pdfManager.getPage(data.pageIndex).then(page=>pdfManager.ensure(page,"getStructTree"))}),handler.on("FontFallback",function(data){return pdfManager.fontFallback(data.id,handler)}),handler.on("Cleanup",function(data){return pdfManager.cleanup(!0)}),handler.on("Terminate",function(data){terminated=!0;var cleanupPromise,task,waitOn=[];pdfManager?(pdfManager.terminate(new AbortException("Worker was terminated.")),cleanupPromise=pdfManager.cleanup(),waitOn.push(cleanupPromise),pdfManager=null):clearGlobalCaches(),null!=cancelXHRs&&cancelXHRs(new AbortException("Worker was terminated."));for(task of WorkerTasks)waitOn.push(task.finished),task.terminate();return Promise.all(waitOn).then(function(){handler.destroy(),handler=null})}),handler.on("Ready",function(data){setupDoc(docParams),docParams=null}),apiVersion}static initializeFromPort(port){var handler=new MessageHandler("worker","main",port);this.setup(handler,port),handler.send("ready",null)}}_WorkerMessageHandler=WorkerMessageHandler,"undefined"==typeof window&&!isNodeJS&&"undefined"!=typeof self&&"function"==typeof self.postMessage&&"onmessage"in self&&_WorkerMessageHandler.initializeFromPort(self),globalThis.pdfjsWorker={WorkerMessageHandler:WorkerMessageHandler};export{WorkerMessageHandler}; |