Built files from Bizgaze WebServer
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910
  1. /*!
  2. * filename: ej2-pdf-export.min.js
  3. * version : 19.1.56
  4. * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
  5. * Use of this code is subject to the terms of our license.
  6. * A copy of the current license can be obtained at any time by e-mailing
  7. * licensing@syncfusion.com. Any infringement will be prosecuted under
  8. * applicable laws.
  9. */
  10. this.ej=this.ej||{},this.ej.pdfexport=function(t,e,i){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}var n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||r}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(void 0!==e)return e.value},t.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},t.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},t.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t}(),o=function(){function t(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&t.length>0?(e=t,this.internalValue=this.normalizeValue(e)):this.internalValue=e},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},t.prototype.clone=function(e){var i=new t;return i.value=this.internalValue,i},t.prototype.escapeString=function(e){for(var i="",r=0,n=e.length;r<n;r++){var o=e[r];t.delimiters.indexOf(o);i+=o}return i},t.prototype.normalizeValue=function(t,e){return t},t.delimiters="()<>[]{}/%}",t.replacements=[" ","\t","\n","\r"],t}(),s=function(){function t(){this.forTest="test",this.forTest=t.obj}return t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN",t}(),a=function(){function t(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep"}return t}(),h=function(){function t(t){if(this.position7=-1,this.primitiveItems=new n,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isFont=!1,void 0===t)this.primitiveItems=new n,this.encrypt=!0,this.dictionaryProperties=new a;else{this.primitiveItems=new n;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this),this.encrypt=!0,this.dictionaryProperties=new a}}return Object.defineProperty(t.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.getArchive=function(){return this.archive},t.prototype.setArchive=function(t){this.archive=t},t.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},t.prototype.getEncrypt=function(){return this.encrypt},t.prototype.freezeChanges=function(t){this.bChanged=!1},t.prototype.clone=function(e){return new t},t.prototype.modify=function(){this.bChanged=!0},t.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},t.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},t.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},t.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},t.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},t.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},t.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},t.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},t.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),this.Count>0&&this.saveItems(t),t.write(this.suffix),t.write(s.newLine))},t.prototype.saveItems=function(t){t.write(s.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(s.whiteSpace),i[r].save(t),t.write(s.newLine)}},t}(),l=function(){function t(t){this.sender=t}return t}(),u=function(){function t(t){this.sender=t}return t}(),c=function(){function t(t){this.sender=t}return t}(),p=function(){function t(t){this.sender=t}return t}(),d=function(){function t(t,e){this.sender=t,this.state=e}return t}(),f=function(){function t(t){this.sender=t}return t}(),g=function(){function t(t){this.position5=-1,this.value=t}return Object.defineProperty(t.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.intValue.toString())},t.prototype.clone=function(e){return new t(this.value)},t.floatToString=function(t){var e=t.toFixed(2);return"0.00"===e&&(e=".00"),e},t.min=function(t,e,i){var r=Math.min(t,e);return Math.min(i,r)},t}(),m=function(){function t(e){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===e)this.internalElements=[];else if(void 0===e||e instanceof t){var i=e;this.internalElements=[];for(n=0;n<i.elements.length;n++)this.internalElements.push(i.elements[n])}else for(var r=e,n=0;n<r.length;n++){var o=new g(r[n]);this.add(o)}}return t.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),t.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},t.prototype.markedChange=function(){this.bChanged=!0},t.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},t.prototype.getItems=function(t){return this.internalElements[t]},t.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(s.whiteSpace);t.write(this.endMark)},t.prototype.clone=function(e){this.clonedObject9=null;for(var i=new t,r=0;r<this.internalElements.length;r++){var n=this.internalElements[r];i.add(n.clone(e))}return i.pdfCrossTable=e,this.clonedObject9=i,i},t.fromRectangle=function(e){return new t([e.x,e.y,e.width,e.height])},t.prototype.insert=function(t,e){if(t<this.internalElements.length&&t>0){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},t.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},t.prototype.remove=function(t){var e=this.internalElements.indexOf(t);this.internalElements[e]=null,this.markChanged()},t.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},t.prototype.clear=function(){this.internalElements=[],this.markChanged()},t.prototype.markChanged=function(){this.bChanged=!0},t}(),y=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=function(t){function i(e,i){var r=t.call(this,e)||this;return r.dicPrefix="stream",r.dicSuffix="endstream",r.clonedObject2=null,r.bCompress=!0,r.isImageStream=!1,r.isFontStream=!1,void 0!==e||void 0!==i?(r.dataStream2=[],r.dataStream2=i,r.bCompress2=!1):(r.dataStream2=[],r.bCompress2=!0),r}return y(i,t),Object.defineProperty(i.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isImage",{get:function(){return this.isImageStream},set:function(t){this.isImageStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFont",{get:function(){return this.isFontStream},set:function(t){this.isFontStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),i.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},i.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},i.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},i.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},i.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},i.prototype.compressContent=function(t,i){if(this.bCompress){for(var r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n));var o=new Uint8Array(r),s=new e.CompressedStreamWriter;s.write(o,0,o.length),s.close(),t=s.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},i.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter);e instanceof C&&(e=e.object);var i=e,r=e;null!=r&&((i=new m).insert(0,r),this.items.setValue(this.dictionaryProperties.filter,i)),r=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,r):i.insert(0,r)},i.prototype.save=function(e){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var i="",r=0;r<this.data.length;r++)i+=this.data[r];i.length>1&&!this.isImage&&!this.isFont&&(i="q\r\n"+i+"Q\r\n");var n=(i=this.compressContent(i,e)).length;this.items.setValue(this.dictionaryProperties.length,new g(n)),t.prototype.save.call(this,e,!1),e.write(this.dicPrefix),e.write(s.newLine),i.length>0&&e.write(i),e.write(s.newLine),e.write(this.dicSuffix),e.write(s.newLine)},i.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},i}(h),w=function(){function t(t){this.sender=t}return t}(),S=function(){function t(t){this.sender=t}return t}();!function(t){!function(t){t[t.None=0]="None",t[t.Ascii=1]="Ascii",t[t.Unicode=2]="Unicode"}(t.ForceEncoding||(t.ForceEncoding={}));var e;!function(t){t[t.StringValue=0]="StringValue",t[t.ByteBuffer=1]="ByteBuffer"}(e||(e={}))}(t.InternalEnum||(t.InternalEnum={}));var P=function(){function e(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(t.length>0&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}return Object.defineProperty(e.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),e.bytesToHex=function(t){if(null==t)return"";return""},e.prototype.save=function(i){if(null===i)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii?i.write(this.pdfEncode()):i.write(e.stringMark[0]+this.value+e.stringMark[1])},e.prototype.pdfEncode=function(){var i="";if(void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii){for(var r=this.escapeSymbols(this.value),n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);i=e.stringMark[0]+i+e.stringMark[1]}else i=this.value;return i},e.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},e.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var i=new e(this.stringValue);return i.bHex=this.bHex,i.crossTable=t,i.isColorSpace=this.isColorSpace,this.clonedObject1=i,i},e.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},e.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},e.stringMark="()",e.hexStringMark="<>",e.hexFormatPattern="{0:X2}",e}(),v=function(){function t(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},t.prototype.clone=function(t){return null},t}(),C=function(){function t(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new a,this.initialize(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){if(t instanceof m||t instanceof h||t instanceof o||t instanceof g||t instanceof b||t instanceof v||t instanceof P)this.primitiveObject=t;else{var e=t;this.initialize(e.element)}},t.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},t.prototype.clone=function(t){return null},t}(),B=function(){function t(){this.action=null,this.dictionaryProperties=new a,this.initialize()}return Object.defineProperty(t.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new C(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new h),this.pdfDictionary},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),O=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),x=function(t){function e(e){var i=t.call(this)||this;return i.uniformResourceIdentifier="",i}return O(e,t),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new P(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))},e}(B);!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(t.PdfHorizontalAlignment||(t.PdfHorizontalAlignment={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(t.PdfVerticalAlignment||(t.PdfVerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify"}(t.PdfTextAlignment||(t.PdfTextAlignment={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.FillStroke=2]="FillStroke",t[t.None=3]="None",t[t.ClipFlag=4]="ClipFlag",t[t.ClipFill=4]="ClipFill",t[t.ClipStroke=5]="ClipStroke",t[t.ClipFillStroke=6]="ClipFillStroke",t[t.Clip=7]="Clip"}(t.TextRenderingMode||(t.TextRenderingMode={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(t.PdfLineJoin||(t.PdfLineJoin={})),function(t){t[t.Flat=0]="Flat",t[t.Round=1]="Round",t[t.Square=2]="Square"}(t.PdfLineCap||(t.PdfLineCap={})),function(t){t[t.Solid=0]="Solid",t[t.Dash=1]="Dash",t[t.Dot=2]="Dot",t[t.DashDot=3]="DashDot",t[t.DashDotDot=4]="DashDotDot",t[t.Custom=5]="Custom"}(t.PdfDashStyle||(t.PdfDashStyle={})),function(t){t[t.Winding=0]="Winding",t[t.Alternate=1]="Alternate"}(t.PdfFillMode||(t.PdfFillMode={})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.GrayScale=2]="GrayScale",t[t.Indexed=3]="Indexed"}(t.PdfColorSpace||(t.PdfColorSpace={})),function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity"}(t.PdfBlendMode||(t.PdfBlendMode={})),function(t){t[t.Centimeter=0]="Centimeter",t[t.Pica=1]="Pica",t[t.Pixel=2]="Pixel",t[t.Point=3]="Point",t[t.Inch=4]="Inch",t[t.Document=5]="Document",t[t.Millimeter=6]="Millimeter"}(t.PdfGraphicsUnit||(t.PdfGraphicsUnit={})),function(t){t[t.Fit=0]="Fit",t[t.Center=1]="Center",t[t.Stretch=2]="Stretch",t[t.Tile=3]="Tile"}(t.PdfGridImagePosition||(t.PdfGridImagePosition={})),function(t){t[t.None=0]="None",t[t.LeftToRight=1]="LeftToRight",t[t.RightToLeft=2]="RightToLeft"}(t.PdfTextDirection||(t.PdfTextDirection={}));var L=function(){function e(t,i,r,n){void 0===t?void 0!==i&&void 0!==r&&void 0!==n?this.assignRGB(i,r,n):this.filled=!1:t instanceof e?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===i&&void 0===r&&void 0===n?(t<0&&(t=0),t>1&&(t=1),this.redColor=t*e.maxColourChannelValue,this.greenColor=t*e.maxColourChannelValue,this.blueColor=t*e.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=e.maxColourChannelValue,this.filled=!0):void 0===n?this.assignRGB(t,i,r):this.assignRGB(i,r,n,t)}return e.prototype.assignRGB=function(t,i,r,n){void 0===t||void 0===i||void 0===r?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=i,this.blueColor=r,this.alpha=void 0===n?e.maxColourChannelValue:n,this.filled=!0,this.assignCMYK(t,i,r))},e.prototype.assignCMYK=function(t,i,r){var n=t/e.maxColourChannelValue,o=i/e.maxColourChannelValue,s=r/e.maxColourChannelValue,a=g.min(1-n,1-o,1-s),h=1===a?0:(1-n-a)/(1-a),l=1===a?0:(1-o-a)/(1-a),u=1===a?0:(1-s-a)/(1-a);this.blackColor=a,this.cyanColor=h,this.magentaColor=l,this.yellowColor=u},Object.defineProperty(e.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"red",{get:function(){return this.r/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this.b/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this.g/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*e.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:t>1?1:t,this.r=this.grayColor*e.maxColourChannelValue,this.g=this.grayColor*e.maxColourChannelValue,this.b=this.grayColor*e.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),e.prototype.toString=function(e,i){if(this.isEmpty)return"";var r="";switch(e){case t.PdfColorSpace.Rgb:r=this.rgbToString(i);break;case t.PdfColorSpace.GrayScale:r=this.grayScaleToString(i);break;case t.PdfColorSpace.Cmyk:r=this.cmykToString(i)}return r},e.prototype.grayScaleToString=function(t){var i=this.gray,r="",n=null;return n=t?e.grayStringsSroke.containsKey(i)?e.grayStringsSroke.getValue(i):null:e.grayStringsFill.containsKey(i)?e.grayStringsFill.getValue(i):null,null==n?t&&(r=i.toString()+" G",e.grayStringsSroke.setValue(i,r)):r=n.toString(),r+s.newLine},e.prototype.rgbToString=function(t){var i=this.r,r=this.g,n=this.b,o=(i<<16)+(r<<8)+n;t&&(o+=1<<24);var a="",h=null;if(e.rgbStrings.containsKey(o)&&(h=e.rgbStrings.getValue(o)),null==h){var l=i/e.maxColourChannelValue,u=r/e.maxColourChannelValue,c=n/e.maxColourChannelValue;a=t?l.toString()+" "+u.toString()+" "+c.toString()+" RG":l.toString()+" "+u.toString()+" "+c.toString()+" rg",e.rgbStrings.setValue(o,a)}else a=h.toString();return a+s.newLine},e.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+s.newLine},e.prototype.toArray=function(e){var i=new m;switch(e){case t.PdfColorSpace.Rgb:i.add(new g(this.red)),i.add(new g(this.green)),i.add(new g(this.blue))}return i},e.rgbStrings=new n,e.grayStringsSroke=new n,e.grayStringsFill=new n,e.maxColourChannelValue=255,e}(),T=function(){function t(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)}return t}(),j=function(){function t(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)}return t}(),k=function(){function t(t,e,i,r){if(typeof t==typeof t&&void 0===t)this.x=0,this.y=0,this.height=0,this.width=0;else if(t instanceof T&&e instanceof j&&void 0===i){var n=t;this.x=n.x,this.y=n.y;var o=e;this.height=o.height,this.width=o.width}else{var s=t,a=e,h=i,l=r;this.x=s,this.y=a,this.height=l,this.width=h}}return t}(),V=function(){function t(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return new T(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return new j(this.width,this.height)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.topLeft+"x"+this.size},t}(),R=function(){function t(){}return t.prototype.clone=function(){return this},t}(),N=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),A=function(e){function i(t){var i=e.call(this)||this;return i.pdfColor=t,i}return N(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return o=!0,e.setColorAndSpace(this.pdfColor,n,!1),o},i.prototype.resetChanges=function(e){e.setColorAndSpace(new L(0,0,0),t.PdfColorSpace.Rgb,!1)},i}(R);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.Underline=4]="Underline",t[t.Strikeout=8]="Strikeout"}(t.PdfFontStyle||(t.PdfFontStyle={})),function(t){t[t.Helvetica=0]="Helvetica",t[t.Courier=1]="Courier",t[t.TimesRoman=2]="TimesRoman",t[t.Symbol=3]="Symbol",t[t.ZapfDingbats=4]="ZapfDingbats"}(t.PdfFontFamily||(t.PdfFontFamily={})),function(t){t[t.Standard=0]="Standard",t[t.TrueType=1]="TrueType",t[t.TrueTypeEmbedded=2]="TrueTypeEmbedded"}(t.PdfFontType||(t.PdfFontType={})),function(t){t[t.None=0]="None",t[t.Word=1]="Word",t[t.WordOnly=2]="WordOnly",t[t.Character=3]="Character"}(t.PdfWordWrapType||(t.PdfWordWrapType={})),function(t){t[t.None=0]="None",t[t.SuperScript=1]="SuperScript",t[t.SubScript=2]="SubScript"}(t.PdfSubSuperScript||(t.PdfSubSuperScript={})),function(t){t[t.Unknown=0]="Unknown",t[t.StandardEncoding=1]="StandardEncoding",t[t.MacRomanEncoding=2]="MacRomanEncoding",t[t.MacExpertEncoding=3]="MacExpertEncoding",t[t.WinAnsiEncoding=4]="WinAnsiEncoding",t[t.PdfDocEncoding=5]="PdfDocEncoding",t[t.IdentityH=6]="IdentityH"}(t.FontEncoding||(t.FontEncoding={})),function(t){t[t.Apple=0]="Apple",t[t.Microsoft=4]="Microsoft",t[t.Trimmed=6]="Trimmed"}(t.TtfCmapFormat||(t.TtfCmapFormat={})),function(t){t[t.Unknown=0]="Unknown",t[t.Symbol=1]="Symbol",t[t.Unicode=2]="Unicode",t[t.Macintosh=3]="Macintosh"}(t.TtfCmapEncoding||(t.TtfCmapEncoding={})),function(t){t[t.AppleUnicode=0]="AppleUnicode",t[t.Macintosh=1]="Macintosh",t[t.Iso=2]="Iso",t[t.Microsoft=3]="Microsoft"}(t.TtfPlatformID||(t.TtfPlatformID={})),function(t){t[t.Undefined=0]="Undefined",t[t.Unicode=1]="Unicode"}(t.TtfMicrosoftEncodingID||(t.TtfMicrosoftEncodingID={})),function(t){t[t.Roman=0]="Roman",t[t.Japanese=1]="Japanese",t[t.Chinese=2]="Chinese"}(t.TtfMacintoshEncodingID||(t.TtfMacintoshEncodingID={})),function(t){t[t.FixedPitch=1]="FixedPitch",t[t.Serif=2]="Serif",t[t.Symbolic=4]="Symbolic",t[t.Script=8]="Script",t[t.Nonsymbolic=32]="Nonsymbolic",t[t.Italic=64]="Italic",t[t.ForceBold=262144]="ForceBold"}(t.FontDescriptorFlags||(t.FontDescriptorFlags={})),function(t){t[t.Arg1And2AreWords=1]="Arg1And2AreWords",t[t.ArgsAreXyValues=2]="ArgsAreXyValues",t[t.RoundXyToGrid=4]="RoundXyToGrid",t[t.WeHaveScale=8]="WeHaveScale",t[t.Reserved=16]="Reserved",t[t.MoreComponents=32]="MoreComponents",t[t.WeHaveAnXyScale=64]="WeHaveAnXyScale",t[t.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",t[t.WeHaveInstructions=256]="WeHaveInstructions",t[t.UseMyMetrics=512]="UseMyMetrics"}(t.TtfCompositeGlyphFlags||(t.TtfCompositeGlyphFlags={}));var D=function(){function e(e,i){this.scalingFactor=100,this.wordWrapType=t.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=t.PdfWordWrapType.Word,void 0!==e&&"string"!=typeof e&&(this.textAlignment=e),void 0!==i&&(this.verticalAlignment=i)}return Object.defineProperty(e.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?t.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?t.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e}(),M=function(){function t(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),t.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},t.prototype.readLine=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i}t++}if(t>this.currentPosition){var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}return null},t.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},t.prototype.readWord=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i;case" ":case"\t":t===this.currentPosition&&t++;var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}t++}if(t>this.currentPosition){var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,n}return null},t.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},t.prototype.read=function(t){if(void 0===t){var e="0";return this.end||(e=this.text[this.currentPosition],this.currentPosition++),e}for(var i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},t.prototype.peek=function(){var t="0";return this.end||(t=this.text[this.currentPosition]),t},t.prototype.close=function(){this.text=null},t.prototype.readToEnd=function(){var t;return t=0===this.currentPosition?this.text:this.text.substr(this.length,this.currentPosition),this.currentPosition=this.length,t},t.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},t.whiteSpace=" ",t.tab="\t",t.spaces=[t.whiteSpace,t.tab],t.whiteSpacePattern="^[ \t]+$",t}(),I=function(){function e(){this.isOverloadWithPosition=!1}return e.prototype.layout=function(t,e,i,r,n,o,s){if(r instanceof k){this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s;a=this.doLayout();return this.clear(),a}this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o;var a=this.doLayout();return this.clear(),a},e.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new j(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new M(t)}else this.initialize(t,e,i,new k(new T(0,0),r),0)},e.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},e.prototype.doLayout=function(){for(var t=new F,e=new F,i=[],r=this.reader.peekLine(),n=this.getLineIndent(!0);null!=r;){if(null!==(e=this.layoutLine(r,n))||void 0!==e){var o=0,s=this.copyToResult(t,e,i,o),a=s.success;if(o=s.numInserted,!a){this.reader.read(o);break}}this.reader.readLine(),r=this.reader.peekLine(),n=this.getLineIndent(!1)}return this.finalizeResult(t,i),t},e.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=this.size.width>0?Math.min(this.size.width,e):e),e},e.prototype.getLineHeight=function(){var t=this.font.height;return null!=this.format&&0!==this.format.lineSpacing&&(t=this.format.lineSpacing+this.font.height),t},e.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},e.prototype.layoutLine=function(e,i){var r=new F;r.layoutLineHeight=this.getLineHeight();var n=[],o=this.size.width,s=this.getLineWidth(e)+i,a=t.LineType.FirstParagraphLine,h=!0;if(o<=0||Math.round(s)<=Math.round(o))this.addToLineResult(r,n,e,s,t.LineType.NewLineBreak|a);else{var l="",u="";s=i;var c=i,p=new M(e),d=p.peekWord();for(d.length!==p.length&&" "===d&&(u+=d,l+=d,p.position+=1,d=p.peekWord());null!=d;){u+=d;var f=this.getLineWidth(u.toString())+c;if(" "===u.toString()&&(u="",f=0),f>o){if(this.getWrapType()===t.PdfWordWrapType.None)break;if(u.length===d.length){if(this.getWrapType()===t.PdfWordWrapType.WordOnly){r.textRemainder=e.substring(p.position);break}if(1===u.length){l+=d;break}h=!1,u="",d=p.peek().toString();continue}this.getLineWidth(d.toString())>o?this.format.wordWrap=t.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=t.PdfWordWrapType.Word),this.getWrapType()===t.PdfWordWrapType.Character&&h?(h=!1,u="",u+=l.toString(),d=p.peek().toString()):(" "!==(g=l.toString())&&this.addToLineResult(r,n,g,s,t.LineType.LayoutBreak|a),this.isOverloadWithPosition&&(o=this.clientSize.width),u="",l="",s=0,c=0,f=0,a=t.LineType.None,d=h?d:p.peekWord(),h=!0)}else l+=d,s=f,h?(p.readWord(),d=p.peekWord()):(p.read(),d=p.peek().toString())}if(l.length>0){var g=l.toString();this.addToLineResult(r,n,g,s,t.LineType.NewLineBreak|t.LineType.LastParagraphLine)}p.close()}r.layoutLines=[];for(var m=0;m<n.length;m++)r.layoutLines.push(n[m]);return n=[],r},e.prototype.addToLineResult=function(t,e,i,r,n){var o=new E;o.text=i,o.width=r,o.lineType=n,e.push(o);var s=t.actualSize;s.height+=this.getLineHeight(),s.width=Math.max(s.width,r),t.size=s},e.prototype.copyToResult=function(t,e,i,r){var n=!0,o=null!=this.format&&!this.format.lineLimit,s=t.actualSize.height,a=this.size.height;if(this.pageHeight>0&&a+this.rectangle.y>this.pageHeight&&(a=this.rectangle.y-this.pageHeight,a=Math.max(a,-a)),r=0,null!=e.lines)for(var h=0,l=e.lines.length;h<l;h++){var u=s+e.lineHeight;if(!(u<=a||a<=0||o)){n=!1;break}var c=e.lines[h];r+=c.text.length,c=this.trimLine(c,0===i.length),i.push(c);var p=t.actualSize;p.width=Math.max(p.width,c.width),t.size=p,s=u}if(s!=t.size.height){var d=t.actualSize;d.height=s,t.size=d}return{success:n,numInserted:r}},e.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd()),e=[]},e.prototype.trimLine=function(e,i){var r=e.text,n=e.width;e.lineType,t.LineType.FirstParagraphLine,null==this.format||this.format.rightToLeft;return(r=r.trim()).length!==e.text.length&&(n=this.getLineWidth(r),(e.lineType&t.LineType.FirstParagraphLine)>0&&(n+=this.getLineIndent(i))),e.text=r,e.width=n,e},e.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:t.PdfWordWrapType.Word},e}(),F=function(){function t(){}return Object.defineProperty(t.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new j(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0}),t}(),E=function(){function t(){}return Object.defineProperty(t.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0}),t}();!function(t){t[t.None=0]="None",t[t.NewLineBreak=1]="NewLineBreak",t[t.LayoutBreak=2]="LayoutBreak",t[t.FirstParagraphLine=4]="FirstParagraphLine",t[t.LastParagraphLine=8]="LastParagraphLine"}(t.LineType||(t.LineType={}));var G=function(){function e(e,i){this.fontStyle=t.PdfFontStyle.Regular,"number"==typeof e&&void 0===i?this.fontSize=e:(this.fontSize=e,this.setStyle(i))}return Object.defineProperty(e.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{get:function(){return(this.style&t.PdfFontStyle.Bold)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return(this.style&t.PdfFontStyle.Italic)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikeout",{get:function(){return(this.style&t.PdfFontStyle.Strikeout)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return(this.style&t.PdfFontStyle.Underline)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),e.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof D||null==e)&&void 0===i&&void 0===r){a=e;return this.measureString(t,a,0,0)}if("string"==typeof t&&(e instanceof D||null==e)&&"number"==typeof i&&"number"==typeof r){a=e;return this.measureString(t,0,a,i,r)}if("string"==typeof t&&"number"==typeof e&&(i instanceof D||null==i)&&"number"==typeof r&&"number"==typeof n){var o=new j(e,0),s=i;return this.measureString(t,o,s,r,n)}if(null==t)throw Error('ArgumentNullException("text")');var a=e,s=i,h=(new I).layout(t,this,s,a,!1,new j(0,0));return r=t.length,n=h.empty?0:h.lines.length,h.actualSize},e.prototype.equalsTo=function(t){return this.equalsToFont(t)},e.prototype.getInternals=function(){return this.pdfFontInternals},e.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},e.prototype.setStyle=function(t){this.fontStyle=t},e.prototype.applyFormatSettings=function(t,e,i){var r=i;if(null!=e&&i>0&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)){var n=M.spaces;r+=M.getCharsCount(t,n)*e.wordSpacing}return r},e.charSizeMultiplier=.001,e.syncObject=new Object,e}(),z=function(){function t(t){this.streamWriter=t}return Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),t.prototype.write=function(t){var e=t;this.streamWriter.write(e)},t}();!function(t){t[t.None=0]="None",t[t.Registered=1]="Registered"}(t.ObjectStatus||(t.ObjectStatus={}));var W=function(){function e(){this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n}return Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),e.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(e.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var i=new H(e);this.objectCollections.push(i),this.primitiveObjectCollection.containsKey(e)||this.primitiveObjectCollection.setValue(e,this.objectCollections.length-1),e.position=this.index=this.objectCollections.length-1,e.status=t.ObjectStatus.Registered},e.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;i>=0;i--)if(this.objectCollections[i].object===t){e=i;break}return e},e.prototype.getReference=function(t,e){this.index=this.lookFor(t);return this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:e}},e.prototype.trySetReference=function(t,e,i){return!0,this.index=this.lookFor(t),this.objectCollections[this.index].setReference(e),!0},e.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n},e}(),H=function(){function t(t,e){this.pdfObject=t,this.pdfReference=e}return Object.defineProperty(t.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),t.prototype.setReference=function(t){this.pdfReference=t},t}(),_=function(){function t(t){this.isStreamCopied=!1,t instanceof Ce&&(this.document=t)}return Object.defineProperty(t.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),t.prototype.setMainObjectCollection=function(t){this.objects=t},t.prototype.setCrossTable=function(t){this.pdfCrossTable=t},t.prototype.setCatalog=function(t){this.pdfCatalog=t},t.prototype.save=function(t){var e=this,r=new i.Encoding(!0),n=new i.StreamWriter(r);if(void 0===t){var o=new i.Encoding(!0),s=new i.StreamWriter(o);return new Promise(function(t,i){var r={};r.blobData=new Blob([e.document.docSave(s,!0)],{type:"application/pdf"}),t(r)})}this.document.docSave(n,t,!0)},t.prototype.clone=function(){return this.document},t}();!function(t){t[t.Free=0]="Free",t[t.Normal=1]="Normal",t[t.Packed=2]="Packed"}(t.ObjectType||(t.ObjectType={}));var K=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),U=function(t){function e(){var e=t.call(this)||this;return e.sections=null,e.tempDictionaryProperties=new a,e.items.setValue((new a).type,new o("Catalog")),e}return K(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new C(t))},enumerable:!0,configurable:!0}),e}(h),q=function(){function e(){this.objects=new n,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new a}return Object.defineProperty(e.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new b),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),e.prototype.save=function(t,e){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var i=this.count,r=t.position;this.registerObject(0,new v(0,-1),!0);t.write(s.xref),t.write(s.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,r),this.count=i;for(var n=0;n<this.objectCollection.count;++n)this.objectCollection.items(n).object.isSaving=!1;if(void 0===e)return t.stream.buffer;t.stream.save(e)},e.prototype.saveTheEndess=function(t,e){t.write(s.newLine+s.startxref+s.newLine),t.write(e.toString()+s.newLine),t.write(s.eof+s.newLine)},e.prototype.saveTrailer=function(t,e,i){t.write(s.trailer+s.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new g(this.objectCount+1)),(r=new h(r)).setEncrypt(!1),r.save(t)},e.prototype.saveSections=function(t){var e=0,i=0;do{i=this.prepareSubsection(e),this.saveSubsection(t,e,i),e+=i}while(0!==i)},e.prototype.saveSubsection=function(e,i,r){if(!(r<=0||i>=this.count)){e.write(i+" "+(r+1)+s.newLine);for(var n=i;n<=i+r;++n){var o=this.objects.getValue(n),a="";a=o.type===t.ObjectType.Free?this.getItem(o.offset,65535,!0):this.getItem(o.offset,o.generation,!1),e.write(a)}}},e.prototype.getItem=function(t,e,i){var r="",n=10-t.toString().length;e<=0&&(e=0);for(var o=5-e.toString().length<=0?0:5-e.toString().length,a=0;a<n;a++)r+="0";r=r+t.toString()+" ";for(a=0;a<o;a++)r+="0";return r=r+e.toString()+" ",r=r+(i?s.f:s.n)+s.newLine},e.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(t>=r)return i;for(e=t;e<r;++e)break;for(t=e;e<r;++e)++i;return i},e.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},e.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(s.newLine)},e.prototype.generateFileVersion=function(t){return"1."+4..toString()},e.prototype.getReference=function(t,e){if(void 0===e){return this.getReference(t,!1)}return this.getSubReference(t,e)},e.prototype.getSubReference=function(e,i){var r,n=!1,o=null;if(this.items.count>0&&e.objectCollectionIndex>0&&this.items.count>e.objectCollectionIndex-1){var s=this.document.pdfObjects.getReference(e,r);o=s.reference,r=s.wasNew}if(r=null==o&&e.status!==t.ObjectStatus.Registered,null==o){var a=this.nextObjNumber;o=new v(a,0);if(r){this.document.pdfObjects.add(e),this.document.pdfObjects.trySetReference(e,o,void 0);var h=this.document.pdfObjects.count-1,l=this.document.pdfObjects.objectCollections[h].reference.objNumber,u=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1];this.document.pdfObjects.mainObjectCollection.setValue(l,u),e.position=-1}else this.document.pdfObjects.trySetReference(e,o,void 0);e.objectCollectionIndex=o.objNumber,e.status=t.ObjectStatus.None,n=!0}return n||this.bForceNew,o},e.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},e.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof U&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i;t.getArchive(),this.registerObject(e.position,i),this.doSaveObject(t,i,e)},e.prototype.doSaveObject=function(t,e,i){i.length;i.write(e.objNumber.toString()),i.write(s.whiteSpace),i.write(e.genNumber.toString()),i.write(s.whiteSpace),i.write(s.obj),i.write(s.newLine),t.save(i);i.stream;i.write(s.endObj),i.write(s.newLine)},e.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new Y(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new Y(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},e.dereference=function(t){var e=t;return null!=e&&(t=e.object),t},e}(),Y=function(){function e(e,i,r){var n=e;this.offsetNumber=n;var o=i;this.generation=o.genNumber,this.object=o.objNumber,this.type=void 0===r?t.ObjectType.Normal:t.ObjectType.Free}return Object.defineProperty(e.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0}),e}(),X=function(){function t(){}return t.letter=new j(612,792),t.note=new j(540,720),t.legal=new j(612,1008),t.a0=new j(2380,3368),t.a1=new j(1684,2380),t.a2=new j(1190,1684),t.a3=new j(842,1190),t.a4=new j(595,842),t.a5=new j(421,595),t.a6=new j(297,421),t.a7=new j(210,297),t.a8=new j(148,210),t.a9=new j(105,148),t.a10=new j(74,105),t.b0=new j(2836,4008),t.b1=new j(2004,2836),t.b2=new j(1418,2004),t.b3=new j(1002,1418),t.b4=new j(709,1002),t.b5=new j(501,709),t.archE=new j(2592,3456),t.archD=new j(1728,2592),t.archC=new j(1296,1728),t.archB=new j(864,1296),t.archA=new j(648,864),t.flsa=new j(612,936),t.halfLetter=new j(396,612),t.letter11x17=new j(792,1224),t.ledger=new j(1224,792),t}();!function(t){t[t.Portrait=0]="Portrait",t[t.Landscape=1]="Landscape"}(t.PdfPageOrientation||(t.PdfPageOrientation={})),function(t){t[t.RotateAngle0=0]="RotateAngle0",t[t.RotateAngle90=1]="RotateAngle90",t[t.RotateAngle180=2]="RotateAngle180",t[t.RotateAngle270=3]="RotateAngle270"}(t.PdfPageRotateAngle||(t.PdfPageRotateAngle={})),function(t){t[t.None=0]="None",t[t.Numeric=1]="Numeric",t[t.LowerLatin=2]="LowerLatin",t[t.LowerRoman=3]="LowerRoman",t[t.UpperLatin=4]="UpperLatin",t[t.UpperRoman=5]="UpperRoman"}(t.PdfNumberStyle||(t.PdfNumberStyle={})),function(t){t[t.None=0]="None",t[t.Bottom=1]="Bottom",t[t.Top=2]="Top",t[t.Left=3]="Left",t[t.Right=4]="Right",t[t.Fill=5]="Fill"}(t.PdfDockStyle||(t.PdfDockStyle={})),function(t){t[t.None=0]="None",t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight"}(t.PdfAlignmentStyle||(t.PdfAlignmentStyle={})),function(t){t[t.None=0]="None",t[t.Top=1]="Top",t[t.Bottom=2]="Bottom",t[t.Left=3]="Left",t[t.Right=4]="Right"}(t.TemplateType||(t.TemplateType={}));var J=function(){function t(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),t.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},t.prototype.clone=function(){return this},t}(),Z=function(){function e(e){this.pageMargins=new J,this.pageSize=X.a4,this.rotateAngle=t.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=t.PdfPageOrientation.Portrait,this.pageOrigin=new T(0,0),this.isRotation=!1,"number"==typeof e&&this.pageMargins.setMargins(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),e.prototype.updateSize=function(e){var i=Math.min(this.pageSize.width,this.pageSize.height),r=Math.max(this.pageSize.width,this.pageSize.height);switch(e){case t.PdfPageOrientation.Portrait:this.pageSize=new j(i,r);break;case t.PdfPageOrientation.Landscape:this.pageSize=new j(r,i)}},e.prototype.clone=function(){var t=this;return t.pageMargins=this.pageMargins.clone(),t},e.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new j(t,e)},e.prototype.setSize=function(e){var i=Math.min(e.width,e.height),r=Math.max(e.width,e.height);this.orientation===t.PdfPageOrientation.Portrait?this.pageSize=new j(i,r):this.pageSize=new j(r,i)},e}(),$=function(){function t(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}return t.prototype.clear=function(){this.stream.clearStream()},t.prototype.setGraphicsState=function(t){t instanceof o?(this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState)):(this.stream.write(s.slash),this.stream.write(t),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState))},t.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.paintXObject),this.stream.write(s.newLine)},t.prototype.closePath=function(){this.writeOperator(s.closePath)},t.prototype.clipPath=function(t){this.stream.write(s.clipPath),t&&this.stream.write(s.evenOdd),this.stream.write(s.whiteSpace),this.stream.write(s.endPath),this.stream.write(s.newLine)},t.prototype.closeFillStrokePath=function(t){this.stream.write(s.closeFillStrokePath),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillStrokePath=function(t){this.stream.write(s.fillStroke),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillPath=function(t){this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.endPath=function(){this.writeOperator(s.n)},t.prototype.closeFillPath=function(t){this.writeOperator(s.closePath),this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.closeStrokePath=function(){this.writeOperator(s.closeStrokePath)},t.prototype.setTextScaling=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextScaling)},t.prototype.strokePath=function(){this.writeOperator(s.stroke)},t.prototype.restoreGraphicsState=function(){this.writeOperator(s.restoreState)},t.prototype.saveGraphicsState=function(){this.writeOperator(s.saveState)},t.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(s.goToNextLine):t instanceof T?(this.writePoint(t),this.writeOperator(s.setCoords)):(this.writePoint(t,e),this.writeOperator(s.setCoords))},t.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setText)},t.prototype.setLeading=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextLeading)},t.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(s.beginPath)},t.prototype.beginText=function(){this.writeOperator(s.beginText)},t.prototype.endText=function(){this.writeOperator(s.endText)},t.prototype.appendRectangle=function(t,e,i,r){t instanceof k?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(s.appendRectangle))},t.prototype.appendLineSegment=function(t,e){t instanceof T?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(s.appendLineSegment))},t.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setRenderingMode)},t.prototype.setCharacterSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.stream.write(s.setCharacterSpace),this.stream.write(s.newLine)},t.prototype.setWordSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setWordSpace)},t.prototype.showNextLineText=function(t,e){t instanceof P?(this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setTextOnNewLine)):(this.checkTextParam(t),this.writeText(t,e),this.writeOperator(s.setTextOnNewLine))},t.prototype.setColorSpace=function(t,e){if(t instanceof o&&"boolean"==typeof e){var i=t,r=(n=e)?s.selectcolorspaceforstroking:s.selectcolorspacefornonstroking;this.stream.write(i.toString()),this.stream.write(s.whiteSpace),this.stream.write(r),this.stream.write(s.newLine)}else{var i=t,n=e;this.setColorSpace(new o(i),n)}},t.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.modifyCtm)},t.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(s.whiteSpace),this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),this.writeOperator(s.setFont)}},t.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(s.newLine)},t.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},t.prototype.writeText=function(t,e){if(t instanceof P&&void 0===e)this.stream.write(t.pdfEncode());else{var i=void 0,r=void 0;e?(i=P.hexStringMark[0],r=P.hexStringMark[1]):(i=P.stringMark[0],r=P.stringMark[1]),this.stream.write(i),this.stream.write(t),this.stream.write(r)}},t.prototype.writePoint=function(t,e){if(t instanceof T&&void 0===e)this.writePoint(t.x,t.y);else{var i=t;this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),e=this.updateY(e),this.stream.write(g.floatToString(e)),this.stream.write(s.whiteSpace)}},t.prototype.updateY=function(t){return-t},t.prototype.write=function(t){var e="";e+=t,e+=s.newLine,this.writeOperator(e)},t.prototype.writeComment=function(t){if(!(null!=t&&t.length>0))throw new Error("Invalid comment");var e="";e+=s.comment,e+=s.whiteSpace,e+=t,this.writeOperator(e)},t.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(s.newLine))},t.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},t.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(t.length>1)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i+="] ",i+=e.toString(),i+=" "+s.setDashPattern,this.stream.write(i),this.stream.write(s.newLine)},t.prototype.setMiterLimit=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setMiterLimit)},t.prototype.setLineWidth=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineWidth)},t.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineCapStyle)},t.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineJoinStyle)},Object.defineProperty(t.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof T&&e instanceof T&&i instanceof T?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(s.appendbeziercurve)},t.prototype.setColourWithPattern=function(t,e,i){if(null!=t){var r=t.length,n=0;for(n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(s.whiteSpace)}null!=e&&(this.stream.write(e.toString()),this.stream.write(s.whiteSpace)),i?this.writeOperator(s.setColorAndPatternStroking):this.writeOperator(s.setColorAndPattern)},t}(),Q=function(){function e(e,i){this.pdfColor=new L(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=t.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=t.PdfColorSpace.Rgb,e instanceof R?this.setBrush(e):e instanceof L&&(this.color=e),"number"==typeof i&&(this.width=i)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(e){if(this.pdfDashStyle!==e)switch(this.pdfDashStyle=e,this.pdfDashStyle){case t.PdfDashStyle.Custom:break;case t.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case t.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case t.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case t.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case t.PdfDashStyle.Solid:break;default:this.pdfDashStyle=t.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e.prototype.setBrush=function(t){var e=t;null!=e&&e instanceof A&&(this.color=e.color,this.pdfBrush=e),this.color=e.color,this.pdfBrush=e},e.prototype.monitorChanges=function(t,e,i,r,n,o){r=!0,this.dashControl(t,r,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);var s=this.miterLimit;s>0&&e.setMiterLimit(s);this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},e.prototype.dashControl=function(t,e,i){e=!0;var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),e},e.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t},e}(),tt=function(){function t(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=void 0===t?new et(1,0,0,1,0,0):new et(1,0,0,-1,0,0)}return Object.defineProperty(t.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},t.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},t.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},t.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++){this.matrix.elements[e];t+=g.floatToString(this.transformationMatrix.elements[e]),t+=" "}return t},t.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},t.degreesToRadians=function(t){return this.degRadFactor*t},t.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},t.prototype.clone=function(){return this},t.degRadFactor=Math.PI/180,t}(),et=function(){function t(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},t.prototype.transform=function(t){var e=t.x,i=t.y,r=e*this.elements[0]+i*this.elements[2]+this.offsetX,n=e*this.elements[1]+i*this.elements[3]+this.offsetY;return new T(r,n)},t.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},t.prototype.dispose=function(){this.metrixElements=null},t.prototype.clone=function(){return new t(this.metrixElements)},t}(),it=function(){function t(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"}return t}(),rt=function(){function t(){this.mKeys=[],this.mValues=[]}return t.prototype.size=function(){return this.mKeys.length},t.prototype.add=function(t,e){if(void 0===t||null===t||void 0===e||null===e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},t.prototype.keys=function(){return this.mKeys},t.prototype.values=function(){return this.mValues},t.prototype.getValue=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},t.prototype.setValue=function(t,e){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},t.prototype.remove=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(e,1),this.mValues.splice(e,1),!0},t.prototype.containsKey=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},t.prototype.clear=function(){this.mKeys=[],this.mValues=[]},t}(),nt=function(){function t(t,e,i){this.dictionary=new h,this.dictionaryProperties=new a,this.dictionary.items.setValue(this.dictionaryProperties.CA,new g(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}return Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),ot=function(){function t(){this.automaticFieldsInformation=[]}return Object.defineProperty(t.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),t.prototype.add=function(t){return this.automaticFields.push(t)},t}(),st=function(){function t(){}return t.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},t}(),at=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ht=function(t){function e(){var e=t.call(this)||this;return e.internalBounds=new k(0,0,0,0),e.internalTemplateSize=new j(0,0),e}return at(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return new j(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return new T(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),e.prototype.performDrawHelper=function(t,e,i,r){if(0===this.bounds.height||0===this.bounds.width){var n=this.getValue(t);this.internalTemplateSize=this.getFont().measureString(n,this.size,this.stringFormat)}},e.prototype.draw=function(t,e,i){if(void 0===e){var r=new T(0,0);this.draw(t,r)}else if(e instanceof T)this.draw(t,e.x,e.y);else{this.drawHelper(t,e,i);var n=new lt(this,new T(e,i));t.automaticFields.add(n)}},e.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},e.prototype.drawInternal=function(t){},e.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new A(new L(0,0,0)):this.internalBrush},e.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Ce.defaultFont:this.internalFont},e.prototype.getPageFromGraphics=function(t){if(void 0!==t.page&&null!==t.page)return e=t.page;var e=t.currentPage;return e},e}(st),lt=function(){function t(e,i,r,n){this.pageNumberFieldLocation=new T,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===i&&e instanceof t?(this.pageNumberField=e.field,this.pageNumberFieldLocation=e.location,this.scaleX=e.scalingX,this.scaleY=e.scalingY):void 0===r&&i instanceof T&&e instanceof ht?(this.pageNumberField=e,this.pageNumberFieldLocation=i):(this.pageNumberField=e,this.pageNumberFieldLocation=i,this.scaleX=r,this.scaleY=n)}return Object.defineProperty(t.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0}),t}(),ut=function(){function t(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},t.prototype.getBuffer=function(t){return this.buffer[t]},t.prototype.writeFromBase64String=function(t){var e=this.encodedString(t);this.buffer=e},t.prototype.encodedString=function(t){var e,i,r,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,h=0,l=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;t.charAt(t.length-1)===s.charAt(64)&&l--;for(var u=new Uint8Array(0|l);a<t.length;)e=s.indexOf(t.charAt(a++))<<2|(n=s.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(o=s.indexOf(t.charAt(a++)))>>2,r=(3&o)<<6|s.indexOf(t.charAt(a++)),u[h++]=e,u[h++]=i,u[h++]=r;return u},t.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(t.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e<<=8,e|=t.readByte(this.position),this.position++,e},t}(),ct=function(){function t(t){this.currentPosition=-1,this.value=t}return Object.defineProperty(t.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.boolToStr(this.value))},t.prototype.clone=function(e){return new t(this.value)},t.prototype.boolToStr=function(t){return t?"true":"false"},t}();!function(t){t[t.Unknown=0]="Unknown",t[t.Bmp=1]="Bmp",t[t.Emf=2]="Emf",t[t.Gif=3]="Gif",t[t.Jpeg=4]="Jpeg",t[t.Png=5]="Png",t[t.Wmf=6]="Wmf",t[t.Icon=7]="Icon"}(t.ImageFormat||(t.ImageFormat={}));var pt=function(){function e(e){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=t.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new a,this.mStream=e,this.initialize()}return Object.defineProperty(e.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.mFormat===t.ImageFormat.Unknown&&this.checkIfJpeg()&&(this.mFormat=t.ImageFormat.Jpeg,this.parseJpegImage()),this.reset(),this.mImageData=new ut(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},e.prototype.reset=function(){this.mStream.position=0},e.prototype.parseJpegImage=function(){this.reset();var t=new ut(this.mStream.count);this.mStream.read(t,0,t.count);for(var e=4,i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(e.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),e.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<e.mJpegHeader.length;t++){if(e.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},e.prototype.getImageDictionary=function(){if(this.mFormat===t.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new b,this.imageStream.isImage=!0;for(var e="",i="",r=0;r<this.imageDataAsNumberArray.byteLength;r++)e+=String.fromCharCode(null,this.mStream.readByte(r));for(r=0;r<e.length;r++)r%2!=0&&(i+=e[r]);return this.imageStream.data=[i],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new g(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new g(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams()),this.imageStream}return this.imageStream},e.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},e.prototype.getDecodeParams=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.columns,new g(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new ct(!0)),t.items.setValue(this.dictionaryProperties.k,new g(-1)),t.items.setValue(this.dictionaryProperties.predictor,new g(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),t},e.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;)switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}},e.prototype.skip=function(t,e){this.mStream=t;var i=new ut(e);this.mStream.read(i,0,i.count)},e.prototype.getMarker=function(t){var e=32;for(e=t.readByte(this.mStream.position),t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;do{e=t.readByte(this.mStream.position),t.position++}while(255===e);return e},e.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;e>0&&(t.position+=e)},e.mPngHeader=[137,80,78,71,13,10,26,10],e.mJpegHeader=[255,216],e.GIF_HEADER="G,I,F,8",e.BMP_HEADER="B,M",e}(),dt=function(){function t(t){this.updateProportionsHelper(t)}return t.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},t.prototype.convertToPixels=function(t,e){var i=e;return t*this.proportions[i]},t.prototype.convertFromPixels=function(t,e){var i=e;return t/this.proportions[i]},t.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},t.horizontalResolution=96,t.verticalResolution=96,t}(),ft=function(){function e(){}return Object.defineProperty(e.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new j(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),e.prototype.getPointSize=function(e,i,r,n){if(void 0===r){var o=dt.horizontalResolution,s=dt.verticalResolution;return c=this.getPointSize(e,i,o,s)}var a=new dt(r),h=new dt(n),l=a.convertUnits(e,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),u=h.convertUnits(i,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),c=new j(l,u);return c},e}(),gt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mt=function(t){function e(e){var i=t.call(this)||this;return i.imageStatus=!0,i.dictionaryProperties=new a,i.loadImage(e),i}return gt(e,t),e.prototype.loadImage=function(t){this.initializeAsync(t)},e.prototype.initializeAsync=function(t){var e=new ut(t.length);e.writeFromBase64String(t),this.decoder=new pt(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},e.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()},e}(ft),yt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0}),t}(),bt=function(){function t(){}return t}(),wt=function(){function t(){}return t}(),St=function(){function t(){}return t}(),Pt=function(){function t(){}return Object.defineProperty(t.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),t}(),vt=function(){function t(){}return t}(),Ct=function(){function t(){}return t}(),Bt=function(){function t(){}return t}(),Ot=function(){function t(){}return t}(),xt=function(){function t(){}return t}(),Lt=function(){function t(){}return t}(),Tt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),t.prototype.compareTo=function(t){var e=t;return this.index-e.index},t}(),jt=function(){function t(){}return t}(),kt=function(){function t(){}return t}(),Vt=function(){function t(){}return t}(),Rt=function(){function t(){}return t}(),Nt=function(){function t(){}return t}(),At=function(){function t(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}return Object.defineProperty(t.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),t.prototype.writeShort=function(t){var e=[(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeUInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},t.prototype.writeBytes=function(t){this.flush(t)},t.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},t}(),Dt=function(){function e(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}return Object.defineProperty(e.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new n),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new n),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new n),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new n),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new Pt),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},e.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new n);for(var e=0;e<t;++e){var i=new yt,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},e.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(a=this.tableDirectory.getValue(e[i])).offset;if(t>r&&(t=r)<=this.lowestPosition)break}var o=t-this.lowestPosition;if(0!==o){for(var s=new n,i=0;i<e.length;i++){var a=this.tableDirectory.getValue(e[i]);a.offset-=o,s.setValue(e[i],a)}this.tableDirectory=s}},e.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){if(this.isTtcFont=!0,this.offset=0,"ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");if(this.offset+=4,this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},e.prototype.readNameTable=function(){var t=this.getTable("name");this.offset=t.offset;var e=new bt;e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[];for(var i=this.offset,r=0;r<e.recordsCount;r++){this.offset=i;var n=new wt;n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset;var o=0===n.platformID||3===n.platformID;n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},e.prototype.readHeadTable=function(){var t=this.getTable("head");this.offset=t.offset;var e=new St;return e.version=this.readFixed(this.offset),e.fontRevision=this.readFixed(this.offset),e.checkSumAdjustment=this.readUInt32(this.offset),e.magicNumber=this.readUInt32(this.offset),e.flags=this.readUInt16(this.offset),e.unitsPerEm=this.readUInt16(this.offset),e.created=this.readInt64(this.offset),e.modified=this.readInt64(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.macStyle=this.readUInt16(this.offset),e.lowestReadableSize=this.readUInt16(this.offset),e.fontDirectionHint=this.readInt16(this.offset),e.indexToLocalFormat=this.readInt16(this.offset),e.glyphDataFormat=this.readInt16(this.offset),e},e.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea");this.offset=t.offset;var e=new vt;return e.version=this.readFixed(this.offset),e.ascender=this.readInt16(this.offset),e.descender=this.readInt16(this.offset),e.lineGap=this.readInt16(this.offset),e.advanceWidthMax=this.readUInt16(this.offset),e.minLeftSideBearing=this.readInt16(this.offset),e.minRightSideBearing=this.readInt16(this.offset),e.xMaxExtent=this.readInt16(this.offset),e.caretSlopeRise=this.readInt16(this.offset),e.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,e.metricDataFormat=this.readInt16(this.offset),e.numberOfHMetrics=this.readUInt16(this.offset),e},e.prototype.readOS2Table=function(){var t=this.getTable("OS/2");this.offset=t.offset;var e=new Ct;return e.version=this.readUInt16(this.offset),e.xAvgCharWidth=this.readInt16(this.offset),e.usWeightClass=this.readUInt16(this.offset),e.usWidthClass=this.readUInt16(this.offset),e.fsType=this.readInt16(this.offset),e.ySubscriptXSize=this.readInt16(this.offset),e.ySubscriptYSize=this.readInt16(this.offset),e.ySubscriptXOffset=this.readInt16(this.offset),e.ySubscriptYOffset=this.readInt16(this.offset),e.ySuperscriptXSize=this.readInt16(this.offset),e.ySuperscriptYSize=this.readInt16(this.offset),e.ySuperscriptXOffset=this.readInt16(this.offset),e.ySuperscriptYOffset=this.readInt16(this.offset),e.yStrikeoutSize=this.readInt16(this.offset),e.yStrikeoutPosition=this.readInt16(this.offset),e.sFamilyClass=this.readInt16(this.offset),e.panose=this.readBytes(10),e.ulUnicodeRange1=this.readUInt32(this.offset),e.ulUnicodeRange2=this.readUInt32(this.offset),e.ulUnicodeRange3=this.readUInt32(this.offset),e.ulUnicodeRange4=this.readUInt32(this.offset),e.vendorIdentifier=this.readBytes(4),e.fsSelection=this.readUInt16(this.offset),e.usFirstCharIndex=this.readUInt16(this.offset),e.usLastCharIndex=this.readUInt16(this.offset),e.sTypoAscender=this.readInt16(this.offset),e.sTypoDescender=this.readInt16(this.offset),e.sTypoLineGap=this.readInt16(this.offset),e.usWinAscent=this.readUInt16(this.offset),e.usWinDescent=this.readUInt16(this.offset),e.ulCodePageRange1=this.readUInt32(this.offset),e.ulCodePageRange2=this.readUInt32(this.offset),e.version>1?(e.sxHeight=this.readInt16(this.offset),e.sCapHeight=this.readInt16(this.offset),e.usDefaultChar=this.readUInt16(this.offset),e.usBreakChar=this.readUInt16(this.offset),e.usMaxContext=this.readUInt16(this.offset)):(e.sxHeight=0,e.sCapHeight=0,e.usDefaultChar=0,e.usBreakChar=0,e.usMaxContext=0),e},e.prototype.readPostTable=function(){var t=this.getTable("post");this.offset=t.offset;var e=new Bt;return e.formatType=this.readFixed(this.offset),e.italicAngle=this.readFixed(this.offset),e.underlinePosition=this.readInt16(this.offset),e.underlineThickness=this.readInt16(this.offset),e.isFixedPitch=this.readUInt32(this.offset),e.minType42=this.readUInt32(this.offset),e.maxType42=this.readUInt32(this.offset),e.minType1=this.readUInt32(this.offset),e.maxType1=this.readUInt32(this.offset),e},e.prototype.readWidthTable=function(t,e){var i=this.getTable("hmtx");this.offset=i.offset;for(var r=[],n=0;n<t;n++){var o=new Ot;o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset);var s=1e3*o.advanceWidth/e;r.push(Math.floor(s))}return r},e.prototype.readCmapTable=function(){var t=this.getTable("cmap");this.offset=t.offset;var e=new Lt;e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset);for(var i=this.offset,r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new xt;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},e.prototype.readCmapSubTable=function(e){var i=this.getTable("cmap");this.offset=i.offset+e.offset;var r=this.readUInt16(this.offset),n=this.getCmapEncoding(e.platformID,e.encodingID);n===t.TtfCmapEncoding.Macintosh?t.TtfPlatformID.Macintosh:t.TtfPlatformID.Microsoft;if(n!==t.TtfCmapEncoding.Unknown)switch(r){case t.TtfCmapFormat.Apple:this.readAppleCmapTable(e,n);break;case t.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(e,n);break;case t.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(e,n)}},e.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new kt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var n=0;n<256;++n){var o=new Tt;o.index=this.readByte(this.offset),o.width=this.getWidth(o.index),o.charCode=n,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.readMicrosoftCmapTable=function(e,i){var r=this.getTable("cmap");this.offset=r.offset+e.offset;var n=i===t.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh,o=new Vt;o.format=this.readUInt16(this.offset),o.length=this.readUInt16(this.offset),o.version=this.readUInt16(this.offset),o.segCountX2=this.readUInt16(this.offset),o.searchRange=this.readUInt16(this.offset),o.entrySelector=this.readUInt16(this.offset),o.rangeShift=this.readUInt16(this.offset);var s=o.segCountX2/2;o.endCount=this.readUshortArray(s),o.reservedPad=this.readUInt16(this.offset),o.startCount=this.readUshortArray(s),o.idDelta=this.readUshortArray(s),o.idRangeOffset=this.readUshortArray(s);var a=o.length/2-8-4*s;o.glyphID=this.readUshortArray(a);for(var h=0,l=0,u=0;u<s;u++)for(var c=o.startCount[u];c<=o.endCount[u]&&65535!==c;c++){if(0===o.idRangeOffset[u])h=c+o.idDelta[u]&65535;else{if((l=u+o.idRangeOffset[u]/2-s+c-o.startCount[u])>=o.glyphID.length)continue;h=o.glyphID[l]+o.idDelta[u]&65535}var p=new Tt;p.index=h,p.width=this.getWidth(p.index);var d=i===t.TtfCmapEncoding.Symbol&&61440==(65280&c)?255&c:c;p.charCode=d,n.setValue(d,p),this.addGlyph(p,i)}},e.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new Rt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new Tt;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},e.prototype.getTable=function(t){var e,i=new yt;return this.tableDirectory.containsKey(t)&&(e=this.tableDirectory.getValue(t)),null!==e&&void 0!==e&&(i=e),i},e.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},e.prototype.getCmapEncoding=function(e,i){var r=t.TtfCmapEncoding.Unknown;return e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Undefined?r=t.TtfCmapEncoding.Symbol:e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Unicode?r=t.TtfCmapEncoding.Unicode:e==t.TtfPlatformID.Macintosh&&i==t.TtfMacintoshEncodingID.Roman&&(r=t.TtfCmapEncoding.Macintosh),r},e.prototype.addGlyph=function(e,i){var r=null;switch(i){case t.TtfCmapEncoding.Unicode:r=this.microsoftGlyphs;break;case t.TtfCmapEncoding.Macintosh:case t.TtfCmapEncoding.Symbol:r=this.macintoshGlyphs}r.setValue(e.index,e)},e.prototype.initializeMetrics=function(e,i,r,n,o,s){this.initializeFontName(e);for(var a=!1,h=0;h<s.length;h++){var l=s[h];if(this.getCmapEncoding(l.platformID,l.encodingID)===t.TtfCmapEncoding.Symbol){a=!0;break}}this.metrics.isSymbol=a,this.metrics.macStyle=i.macStyle,this.metrics.isFixedPitch=0!==o.isFixedPitch,this.metrics.italicAngle=o.italicAngle;var u=1e3/i.unitsPerEm;this.metrics.winAscent=n.sTypoAscender*u,this.metrics.macAscent=r.ascender*u,this.metrics.capHeight=0!==n.sCapHeight?n.sCapHeight:.7*i.unitsPerEm*u,this.metrics.winDescent=n.sTypoDescender*u,this.metrics.macDescent=r.descender*u,this.metrics.leading=(n.sTypoAscender-n.sTypoDescender+n.sTypoLineGap)*u,this.metrics.lineGap=Math.ceil(r.lineGap*u);var c=i.xMin*u,p=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),d=i.xMax*u,f=this.metrics.macDescent;this.metrics.fontBox=new V(c,p,d,f),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=i.unitsPerEm/n.ySubscriptYSize,this.metrics.superscriptSizeFactor=i.unitsPerEm/n.ySuperscriptYSize},e.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(n=0;n<256;n++){var e=this.getGlyph(String.fromCharCode(n));t[n]=e.empty?0:e.width}else for(var i=[],r=String.fromCharCode(32),n=0;n<256;n++){i[0]=n;var o=this.getString(i,0,i.length),s=o.length>0?o[0]:"?";(e=this.getGlyph(s)).empty?(e=this.getGlyph(r),t[n]=e.empty?0:e.width):t[n]=e.width}return t},e.prototype.getDefaultGlyph=function(){return this.getGlyph(M.whiteSpace)},e.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},e.prototype.readLocaTable=function(t){var e=this.getTable("loca");this.offset=e.offset;var i=new jt,r=null;if(t){n=e.length/2;r=[];for(o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset)}else{var n=e.length/4;r=[];for(var o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},e.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new n,r=t.keys(),o=0;o<r.length;o++)i.setValue(r[o],t.getValue(r[o]));for(o=0;o<r.length;o++){var s=r[o];this.processCompositeGlyph(t,s,e)}},e.prototype.processCompositeGlyph=function(e,i,r){if(i<r.offsets.length-1){var n=r.offsets[i];if(n!==r.offsets[i+1]){var o=this.getTable("glyf");this.offset=o.offset+n;var s=new Nt;if(s.numberOfContours=this.readInt16(this.offset),s.xMin=this.readInt16(this.offset),s.yMin=this.readInt16(this.offset),s.xMax=this.readInt16(this.offset),s.yMax=this.readInt16(this.offset),s.numberOfContours<0)for(var a=0;;){var h=this.readUInt16(this.offset),l=this.readUInt16(this.offset);if(e.containsKey(l)||e.setValue(l,0),0==(h&t.TtfCompositeGlyphFlags.MoreComponents))break;a=0!=(h&t.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(h&t.TtfCompositeGlyphFlags.WeHaveScale)?a+=2:0!=(h&t.TtfCompositeGlyphFlags.WeHaveAnXyScale)?a+=4:0!=(h&t.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(a+=8),this.offset+=a}}}},e.prototype.generateGlyphTable=function(t,e,i,r){i=[];var n=t.keys();n.sort(function(t,e){return t-e});for(var o=0,s=0;s<n.length;s++){var a=n[s];e.offsets.length>0&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);for(var l=0,u=0,c=this.getTable("glyf"),s=0;s<e.offsets.length;s++)if(i.push(l),u<n.length&&n[u]===s){++u,i[s]=l;var p=e.offsets[s],d=e.offsets[s+1]-p;d>0&&(this.offset=c.offset+p,r=this.read(r,l,d).buffer,l+=d)}return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},e.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new At(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},e.prototype.align=function(t){return t+3&-4},e.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,s=n.numTables,a=new At(o);a.writeInt(65536),a.writeShort(s);var h=this.entrySelectors[s];return a.writeShort(16*(1<<(31&h))),a.writeShort(h),a.writeShort(16*(s-(1<<(31&h)))),this.writeCheckSums(a,s,t,e,i,r),this.writeGlyphs(a,t,e),a.data},e.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];if("glyf"!==s&&"loca"!==s){var a=this.getTable(s);a.empty||(++i,n+=this.align(a.length))}}return n+=t.length,n+=e.length,n+=16*i+12,{fontProgramLength:n,numTables:i}},e.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u=s[l],c=this.getTable(u);if(!c.empty){if(t.writeString(u),"glyf"===u){p=this.calculateCheckSum(r);t.writeInt(p),h=n}else if("loca"===u){var p=this.calculateCheckSum(i);t.writeInt(p),h=o}else t.writeInt(c.checksum),h=c.length;t.writeUInt(a),t.writeUInt(h),a+=this.align(h)}}},e.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return a+=r<<8,a+=n<<16,a+=o<<24},e.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;var u=this.read(h,0,s.length);t.writeBytes(u.buffer)}}},e.prototype.setOffset=function(t){this.offset=t},e.prototype.createInternals=function(){this.metrics=new Pt;var t=this.readNameTable(),e=this.readHeadTable();this.bIsLocaShort=0===e.indexToLocalFormat;var i=this.readHorizontalHeaderTable(),r=this.readOS2Table(),n=this.readPostTable();this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm);var o=this.readCmapTable();this.initializeMetrics(t,e,i,r,n,o)},e.prototype.getGlyph=function(t){if("number"==typeof t){var e=null;return this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t)),n=null!=e?e:this.getDefaultGlyph()}var i=null,r=t.charCodeAt(0);this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?r%=this.maxMacIndex+1:r=61440==(65280&r)?255&r:r,this.macintosh.containsKey(r)&&(i=this.macintosh.getValue(r),this.isFontPresent=!0)):this.microsoft.containsKey(r)?(i=this.microsoft.getValue(r),r!==M.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):r!==M.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),t===M.whiteSpace&&null===i&&(i=new Tt);var n=null!==i?i:this.getDefaultGlyph();return n},e.prototype.getGlyphChars=function(t){if(null===t||void 0===t)throw new Error("Argument Null Exception : chars");for(var e=new n,i=t.keys(),r=0;r<i.length;r++){var o=i[r],s=this.getGlyph(o);s.empty||e.setValue(s.index,o.charCodeAt(0))}return e},e.prototype.getAllGlyphs=function(){for(var t=[],e=new Tt,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},e.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort);e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i);var r=this.generateGlyphTable(e,i,null,null),n=r.glyphTableSize,o=r.newLocaTable,s=r.newGlyphTable,a=this.updateLocaTable(o,this.bIsLocaShort,null),h=a.newLocaSize,l=a.newLocaUpdated;return this.getFontProgram(l,s,n,h)},e.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],n=this.getGlyph(r);n.empty||(e+=String.fromCharCode(n.index))}return e},e.prototype.getCharWidth=function(t){var e=this.getGlyph(t);return(e=e.empty?this.getDefaultGlyph():e).empty?0:e.width},e.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(var r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},e.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},e.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(n<<24)},e.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|n<<24},e.prototype.readInt16=function(t){var e=(this.fontData[t]<<8)+this.fontData[t+1];return e=32768&e?e-65536:e,this.offset+=2,e},e.prototype.readInt64=function(t){var e=this.readInt32(t+4),i=4294967296*this.readInt32(t)+e;return e<0&&(i+=4294967296),i},e.prototype.readUInt16=function(t){var e=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,e},e.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},e.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},e.prototype.readByte=function(t){var e=this.fontData[t];return this.offset+=1,e},e.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r=0,n=0;do{for(var o=0;o<i-r&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o];n=i-r,this.offset+=n,r+=n}while(r<i);return{buffer:t,written:r}},e}(),Mt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),It=function(){function e(){this.lineGap=0}return e.prototype.getAscent=function(t){return this.ascent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getDescent=function(t){return this.descent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getLineGap=function(t){return this.lineGap*G.charSizeMultiplier*this.getSize(t)},e.prototype.getHeight=function(t){for(var e=["cambria","candara","constantia","corbel","cariadings"],i=[],r=0;r<e.length;r++){var n=e[r];i.push(n)}return this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t)},e.prototype.getSize=function(e){var i=this.size;if(null!=e)switch(e.subSuperScript){case t.PdfSubSuperScript.SubScript:i/=this.subScriptSizeFactor;break;case t.PdfSubSuperScript.SuperScript:i/=this.superscriptSizeFactor}return i},e.prototype.clone=function(){var t=this;return t.widthTable=Ft.clone(),t},Object.defineProperty(e.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),e}(),Ft=function(){function t(){}return t.clone=function(){return null},t}(),Et=function(t){function e(e){var i=t.call(this)||this;if(null==e)throw new Error("ArgumentNullException:widths");return i.widths=e,i}return Mt(e,t),e.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(e.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this;return t.widths=this.widths,t},e.prototype.toArray=function(){return new m(this.widths)},e}(Ft),Gt=function(){function e(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new a,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+s.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+s.newLine,this.cmapEndCodespaceRange="endcodespacerange"+s.newLine,this.cmapBeginRange="beginbfrange"+s.newLine,this.cmapEndRange="endbfrange"+s.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+s.newLine,null===t||void 0===t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}return e.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},e.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},e.prototype.Initialize=function(){var t=new ut(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new Dt(this.fontData),this.ttfMetrics=this.ttfReader.metrics},e.prototype.createInternals=function(){this.fontDictionary=new h,this.fontProgram=new b,this.cmap=new b,this.descendantFont=new h,this.metrics=new It,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},e.prototype.getInternals=function(){return this.fontDictionary},e.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new Et(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},e.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return e+="+",e+=this.ttfReader.metrics.postScriptName,t=e.toString(),t=this.formatName(t)},e.prototype.formatName=function(t){var e=t.replace("(","#28");return e=e.replace(")","#29"),e=e.replace("[","#5B"),e=e.replace("]","#5D"),e=e.replace("<","#3C"),e=e.replace(">","#3E"),e=e.replace("{","#7B"),e=e.replace("}","#7D"),e=e.replace("/","#2F"),(e=e.replace("%","#25")).replace(" ","#20")},e.prototype.createDescendantFont=function(){this.descendantFont.isFont=!0,this.descendantFont.descendantFontBeginSave=new u(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new g(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new C(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},e.prototype.createFontDescriptor=function(){var t=new h,e=this.ttfReader.metrics;return t.isFont=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new g(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,m.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new g(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new g(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new g(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new g(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new g(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new g(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new C(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new g(0)),t.items.setValue(this.dictionaryProperties.stemH,new g(0)),t},e.prototype.createCmap=function(){this.cmap.cmapBeginSave=new w(this)},e.prototype.createFontDictionary=function(){this.fontDictionary.isFont=!0,this.fontDictionary.fontDictionaryBeginSave=new c(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new m,e=new C(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},e.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new S(this)},e.prototype.createSystemInfo=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.registry,new P("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new P(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new g(0)),t},e.prototype.descendantFontBeginSave=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.getDescendantWidth();null!==t&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)}},e.prototype.cmapBeginSave=function(){this.generateCmap()},e.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new C(this.cmap))},e.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},e.prototype.getDescendantWidth=function(){var t=new m;if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});for(var o=0,s=0,a=!1,h=new m,r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&e.length>1&&(t.add(new g(o)),0!==r&&t.add(h),o=l.index,h=new m),h.add(new g(l.width)),r+1===e.length&&(t.add(new g(o)),t.add(h)),s=l.index}}return t},e.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.ttfReader.getGlyphChars(this.usedChars);if(t.size()>0){var e=t.keys().sort(),i=e[0],r=e[e.length-1],n=this.toHexString(i,!1)+this.toHexString(r,!1)+s.newLine,o="";o+=this.cmapPrefix,o+=n,o+=this.cmapEndCodespaceRange;for(var a=0,h=0;h<e.length;h++){0===a&&(0!==h&&(o+=this.cmapEndRange),o+=a=Math.min(100,e.length-h),o+=s.whiteSpace,o+=this.cmapBeginRange),a-=1;var l=e[h];o+=this.toHexString(l,!0)+this.toHexString(l,!0)+this.toHexString(t.getValue(l),!0)+"\n"}o+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isFont=!0,this.cmap.write(o)}}},e.prototype.generateFontProgram=function(){var t=null;this.usedChars=null===this.usedChars||void 0===this.usedChars?new n:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isFont=!0,this.fontProgram.writeBytes(t)},e.prototype.getDescriptorFlags=function(){var e=0,i=this.ttfReader.metrics;return i.isFixedPitch&&(e|=t.FontDescriptorFlags.FixedPitch),i.isSymbol?e|=t.FontDescriptorFlags.Symbolic:e|=t.FontDescriptorFlags.Nonsymbolic,i.isItalic&&(e|=t.FontDescriptorFlags.Italic),i.isBold&&(e|=t.FontDescriptorFlags.ForceBold),e},e.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new k(t.left,t.bottom,e,i)},e.prototype.toHexString=function(t,e){var i=t.toString(16);return e&&(i=i.toUpperCase()),"<0000".substring(0,5-i.length)+i+">"},e.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new n);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()},e}(),zt=function(){function t(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="‍",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new n;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}return t.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa)return t;return t},t.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];o>="؀"&&o<="ۿ"?r+=o:(r.length>0&&(i+=s=this.doShape(r.toString(),0),r=""),i+=o)}if(r.length>0){var s=this.doShape(r.toString(),0);i+=s}return i.toString()},t.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o="",s=new Wt,a=new Wt;n<t.length;)if(o=t[n++],0===this.ligature(o,a)){var h=this.getShapeCount(o);r=1===h?0:2,s.Shapes>2&&(r+=1),r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),s=a,(a=new Wt).Value=o,a.Shapes=h,a.Ligature++}return r=s.Shapes>2?1:0,r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),(i=this.append(i,a,e)).toString()},t.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,e.Ligature-=1,""!==e.Type&&(0==(i&this.vowel)?(t+=e.Type,e.Ligature-=1):e.Ligature-=1),""!==e.vowel&&(0==(i&this.vowel)?(t+=e.vowel,e.Ligature-=1):e.Ligature-=1)),t},t.prototype.ligature=function(t,e){if(""!==e.Value){var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;return 1===i&&e.Ligature++,i}return""!==e.vowel?0:(e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3)),i)}return 0},t.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1},t}(),Wt=function(){function t(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}return Object.defineProperty(t.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0}),t}(),Ht=function(){function t(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new n,this.update()}return t.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},t.prototype.getLogicalToVisualString=function(t,e){var i=new _t;this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1);for(var r=this.doMirrorShaping(t),n="",o=0;o<this.indexes.length;o++)n+=r[this.indexes[o]];return n.toString()},t.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},t.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];a>i?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o)){if(1==(1&n))return void this.reArrange(t,e+1);for(r|=1;i>=r;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(h>e)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}i-=1}}},t.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},t.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)},t}(),_t=function(){function t(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}return t.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},t.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},t.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},t.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},t.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(var r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},t.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,s=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,s),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},t.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},t.prototype.checkEmbeddedCharacters=function(t){for(e=this.types.length-1;e>=0;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(t-=1,this.result[e]=this.result[t],this.levels[e]=this.levels[t]);for(var e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},t.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},t.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;s>=t;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},t.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},t.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o=t+1;o<e-1;++o)if(this.result[o]===this.ES||this.result[o]===this.CS){var s=this.result[o-1],a=this.result[o+1];s===this.EN&&a===this.EN?this.result[o]=this.EN:this.result[o]===this.CS&&s===this.AN&&a===this.AN&&(this.result[o]=this.AN)}this.checkEuropeanNumberTerminator(t,e,i,r,n)},t.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[];a.push(this.ET);var h=this.getLength(s,e,a),l=s===t?r:this.result[s-1];if(l!==this.EN&&(l=h===e?n:this.result[h]),l===this.EN)for(var u=s;u<h;++u)this.result[u]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},t.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},t.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;a>=t;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},t.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},t.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),l=0,u=0,c=0;s===t?l=r:(l=this.result[s-1])===this.AN?l=this.R:l===this.EN&&(l=this.R),h===e?u=n:(u=this.result[h])===this.AN?u=this.R:u===this.EN&&(u=this.R),c=l===u?l:0==(1&i)?this.L:this.R;for(var p=s;p<h;++p)this.result[p]=c;o=h}},t}(),Kt=function(){function e(){this.openBracket="(",this.closeBracket=")"}return e.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},e.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},e.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:r};var o=(new zt).shape(t,0),s=e.fontInternal.ttfReader;r=new Uint16Array(o.length);for(var a=0,h=0,l=o.length;h<l;h++){var u=o[h],c=s.getGlyph(u);null!==c&&void 0!==c&&(r[a++]=c.index)}return{success:!0,glyphs:r}},e.prototype.customLayout=function(e,i,r,n,o){if(null===o||void 0===o){if(null==e)throw new Error("ArgumentNullException : line");h=null;return null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None&&(h=(new Ht).getLogicalToVisualString(e,i)),h}if(null==e)throw new Error("ArgumentNullException : line");if(null==n)throw new Error("ArgumentNullException : font");var s=null;if(null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None){var a=(new zt).shape(e,0);s=this.customLayout(a,i,r)}var h=[];if(o){for(var l=s.split(""),u=l.length,c=0;c<u;c++)l[c]=this.addChars(n,l[c]);h=l}else(h=[])[0]=this.addChars(n,s);return h},e.prototype.addChars=function(t,e){var i=e;if(null==t)throw new Error("ArgumentNullException : font");if(null==i)throw new Error("ArgumentNullException : line");var r=i,n=t.fontInternal.ttfReader;t.setSymbols(r),r=n.convertString(r);var o=P.toUnicodeArray(r,!1);return r=P.byteToString(o)},e.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")},e}();!function(t){t[t.Paginate=0]="Paginate",t[t.OnePage=1]="OnePage"}(t.PdfLayoutType||(t.PdfLayoutType={})),function(t){t[t.FitPage=0]="FitPage",t[t.FitElement=1]="FitElement",t[t.FitColumnsToPage=2]="FitColumnsToPage"}(t.PdfLayoutBreakType||(t.PdfLayoutBreakType={})),function(t){t[t.Start=0]="Start",t[t.Line=1]="Line",t[t.Bezier3=3]="Bezier3",t[t.Bezier=3]="Bezier",t[t.PathTypeMask=7]="PathTypeMask",t[t.DashMode=16]="DashMode",t[t.PathMarker=32]="PathMarker",t[t.CloseSubpath=128]="CloseSubpath"}(t.PathPointType||(t.PathPointType={}));var Ut=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qt=function(e){function i(i){var r=e.call(this)||this;return r.mbackground=new L(255,255,255),r.mbStroking=!1,r.mfunction=null,r.dictionaryProperties=new a,r.mpatternDictionary=new h,r.mpatternDictionary.items.setValue(r.dictionaryProperties.type,new o(r.dictionaryProperties.pattern)),r.mpatternDictionary.items.setValue(r.dictionaryProperties.patternType,new g(2)),r.shading=i,r.colorSpace=t.PdfColorSpace.Rgb,r}return Ut(i,e),Object.defineProperty(i.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new ct(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"function",{get:function(){return this.mfunction},set:function(t){this.mfunction=t,null!=t&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new C(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);if(t!==this.mcolorSpace||null==e){this.mcolorSpace=t;var i=this.colorSpaceToDeviceName(t);this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(i))}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new h),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new C(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");if(t!==this.mmatrix){this.mmatrix=t.clone();var e=new m(this.mmatrix.matrix.elements);this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,e)}},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,r,n,o){var s=!1;if(t instanceof i){this.colorSpace!==o&&(this.colorSpace=o,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking);var a=r.getResources().getName(this);e.setColourWithPattern(null,a,this.mbStroking),s=!0}return s},i.prototype.resetChanges=function(t){},i.prototype.colorSpaceToDeviceName=function(e){var i;switch(e){case t.PdfColorSpace.Rgb:i="DeviceRGB"}return i},i.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},i.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new ct(e.value))},i.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(i.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0}),i}(R),Yt=function(){function t(t,e){if(this.dictionaryProperties=new a,this.writeTransformation=!0,void 0===t);else if(t instanceof j&&void 0===e){this.content=new b;var i=new j(t.width,t.height);this.setSize(i),this.initialize()}else this.content=new b,this.setSize(new j(t,e)),this.initialize()}return Object.defineProperty(t.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){if(null==this.pdfGraphics||void 0===this.pdfGraphics){var t=new ee(this),e=new te(this.size,t,this.content);this.pdfGraphics=e,this.pdfGraphics.initializeCoordinates()}return this.pdfGraphics},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Jt,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},t.prototype.initialize=function(){this.addType(),this.addSubType()},t.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},t.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},t.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},t.prototype.setSize=function(t){var e=new k(new T(0,0),t),i=m.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,i),this.templateSize=t},Object.defineProperty(t.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),t}(),Xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jt=function(t){function e(e){var i=t.call(this,e)||this;return i.properties=new h,i}return Xt(e,t),Object.defineProperty(e.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),e.prototype.getName=function(t){var e=t.element,i=null;if(this.names.containsKey(e)&&(i=this.names.getValue(e)),null==i){var r=this.generateName();i=new o(r),this.names.setValue(e,i),t instanceof G?this.add(t,i):t instanceof Yt?this.add(t,i):t instanceof qt||t instanceof Qt?this.add(t,i):t instanceof nt?this.add(t,i):(t instanceof ft||t instanceof mt)&&this.add(t,i)}return i},e.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new rt);var t=this.items.getValue(this.dictionaryProperties.font);if(null!=t){q.dereference(t)}return this.pdfNames},e.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset);null==e&&(e=new m,this.items.setValue(this.dictionaryProperties.procset,e));var i=new o(t);e.contains(i)||e.add(i)},e.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},e.prototype.generateName=function(){return Zt.getNewGuidString()},e.prototype.add=function(t,e){if(t instanceof G){var i=null,r=this.items.getValue(this.dictionaryProperties.font);if(null!=r){f=r;i=r,i=r}else i=new h,this.items.setValue(this.dictionaryProperties.font,i);i.items.setValue(e.value,new C(t.element))}else if(t instanceof Yt){a=void 0;null==(a=this.items.getValue(this.dictionaryProperties.xObject))&&(a=new h,this.items.setValue(this.dictionaryProperties.xObject,a)),a.items.setValue(e.value,new C(t.element))}else if(t instanceof R){if((t instanceof qt||t instanceof Qt)&&null!=(o=t.element)){var n=this.items.getValue(this.dictionaryProperties.pattern);null==n&&(n=new h,this.items.setValue(this.dictionaryProperties.pattern,n)),n.items.setValue(e.value,new C(o))}}else if(t instanceof nt){var o=t.element,s=null;null==(s=this.items.getValue(this.dictionaryProperties.extGState))&&(s=new h,this.items.setValue(this.dictionaryProperties.extGState,s)),s.items.setValue(e.value,new C(o))}else{var a=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),l=void 0;void 0!==this.pdfDocument&&(l=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject));this.Dictionary.items.values();var u=!1,c=void 0;if(void 0===this.pdfDocument||void 0!==typeof l&&null!=l){if(void 0!==this.pdfDocument)for(var p=l.items.values(),d=0;d<p.length;d++)void 0!==p[d]&&void 0!==p[d].element&&p[d].element.data[0]===t.element.data[0]&&(c=p[d],u=!0)}else l=new h,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,l);if(null==a&&(a=new h,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,a)),u&&void 0!==c)a.items.setValue(e.value,c);else{var f=new C(t.element);a.items.setValue(e.value,f),void 0!==this.pdfDocument&&l.items.setValue(e.value,f)}}},e}(h),Zt=function(){function t(){}return t.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})},t}(),$t=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qt=function(t){function e(e,i){var r=t.call(this)||this;r.mStroking=!1,r.mLocation=new T(0,0),r.mDictionaryProperties=new a;var n=null;return e instanceof V?n=e:e instanceof j&&(n=new V(0,0,e.width,e.height)),null!==i&&i instanceof ce&&(r.mPage=i),r.brushStream=new b,r.mResources=new Jt,r.brushStream.items.setValue(r.mDictionaryProperties.resources,r.mResources),r.setBox(n),r.setObligatoryFields(),null!==i&&i instanceof ce&&(r.mPage=i,r.graphics.colorSpace=i.document.colorSpace),r}return $t(e,t),e.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new b;var n=new Jt;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,n),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(e.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),e.prototype.setObligatoryFields=function(){if(this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new g(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new g(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation)if(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix){t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y;this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([1,0,0,1,this.mLocation.x,t]))}else{var t=0,e=this.mTransformationMatrix.matrix.elements;t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([e[0],e[1],e[2],e[3],e[4],t]))}},e.prototype.setBox=function(t){this.mBox=t;var e=new k(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,m.fromRectangle(e))},Object.defineProperty(e.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){if(null==this.mGraphics&&void 0===this.mGraphics){var t=new ee(this),e=new te(this.size,t,this.brushStream);this.mGraphics=e,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()}return this.mGraphics},enumerable:!0,configurable:!0}),e.prototype.getResources=function(){return this.mResources},Object.defineProperty(e.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Jt(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},e.prototype.monitorChanges=function(t,i,r,n,o){var s=!1;if(t!==this){i.setColorSpace("Pattern",this.mStroking);var a=r.getResources().getName(this);i.setColourWithPattern(null,a,this.mStroking),s=!0}else if(t instanceof e){i.setColorSpace("Pattern",this.mStroking);var h=r.getResources().getName(this);i.setColourWithPattern(null,h,this.mStroking),s=!0}return s},e.prototype.resetChanges=function(t){},Object.defineProperty(e.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0}),e}(R),te=function(){function e(e,i,r){this.currentColorSpace=t.PdfColorSpace.Rgb,this.previousTextRenderingMode=t.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new it,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new j(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new a,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=i,this.canvasSize=e,this.pdfStreamWriter=r instanceof $?r:new $(r),this.initialize()}return Object.defineProperty(e.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientSize",{get:function(){return new j(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new tt),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new ot),this.internalAutomaticFields},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=t.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new k(new T(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},e.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=t.width>0?i.width/t.width:1,n=t.height>0?i.height/t.height:1,o=!(1===r&&1===n),s=this.save(),a=new tt;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var h=this.getResources.getResources().getName(t);this.pdfStreamWriter.executeObject(h),this.restore(s);var l=t.graphics;if(null!=l)for(var u=0;u<l.automaticFields.automaticFields.length;u++){var c=l.automaticFields.automaticFields[u],p=new T(c.location.x+e.x,c.location.y+e.y),d=0==t.size.width?0:i.width/t.size.width,f=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new lt(c.field,p,d,f)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},e.prototype.drawString=function(t,e,i,r,n,o,s,a,h){if("string"==typeof t&&e instanceof G&&(i instanceof Q||null===i)&&(r instanceof R||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof D||null===s)&&void 0===a)this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s);else{var l=i,u=r,c=n,p=o,d=s,f=a,g=h,m=(new I).layout(t,e,g,new j(d,f),this.isOverloadWithPosition,this.clientSize);if(!m.empty){var y=this.checkCorrectLayoutRectangle(m.actualSize,c,p,g);d<=0&&(c=y.x,d=y.width),f<=0&&(p=y.y,f=y.height),this.drawStringLayoutResult(m,e,l,u,new k(c,p,d,f),g),this.isEmfTextScaled=!1,this.emfScalingFactor=new j(0,0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=m,this.isUseFontSize=!1}},e.prototype.drawLine=function(t,e,i,r,n){if(e instanceof T){var o=e,s=i;this.drawLine(t,o.x,o.y,s.x,s.y)}else{var o=e,s=i,a=r,h=n;this.stateControl(t,null,null);var l=this.streamWriter;l.beginPath(o,s),l.appendLineSegment(a,h),l.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)}},e.prototype.drawRectangle=function(t,e,i,r,n,o){if(t instanceof Q&&"number"==typeof e){s=i;this.drawRectangle(t,null,e,s,r,n)}else if(t instanceof R&&"number"==typeof e){s=i;this.drawRectangle(null,t,e,s,r,n)}else{var s=i,a=r,h=n,l=o;if(e instanceof Qt){this.bCSInitialized=!1;var u=this.matrix.matrix.offsetX+s,c=void 0;c=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+a:this.clientSize.height-this.matrix.matrix.offsetY+a,e.location=new T(u,c),e.graphics.colorSpace=this.colorSpace}else e instanceof qt&&(e.colorSpace=this.colorSpace);e instanceof A&&e.color.isEmpty&&(e=null);var p=t,d=e;this.stateControl(p,d,null),this.streamWriter.appendRectangle(s,a,h,l),this.drawPathHelper(p,d,!1)}},e.prototype.drawPathHelper=function(e,i,r,n){if("boolean"==typeof r){var o=r;this.drawPathHelper(e,i,t.PdfFillMode.Winding,o)}else{var s=null!=e,a=null!=i,h=(o=r)===t.PdfFillMode.Alternate;s&&a?this.streamWriter.fillStrokePath(h):s||a?s?this.streamWriter.strokePath():this.streamWriter.fillPath(h):this.streamWriter.endPath()}},e.prototype.drawImage=function(t,e,i,r,n){if("number"==typeof e&&"number"==typeof i&&void 0===r){var o=t.physicalDimension;this.drawImage(t,e,i,o.width,o.height)}else{var a=e,h=i,l=n;t.save();var u=new tt;this.getTranslateTransform(a,h+l,u),this.getScaleTransform(r,n,u),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(u);var c=this.getResources.getResources();void 0!==this.pageLayer&&null!=this.page&&(c.document=this.page.document);var p=c.getName(t);void 0!==this.pageLayer&&this.page.setResources(c),this.pdfStreamWriter.executeObject(p),this.pdfStreamWriter.write(s.restoreState),this.pdfStreamWriter.write(s.newLine);var d=this.getResources.getResources();d.requireProcedureSet(this.procedureSets.imageB),d.requireProcedureSet(this.procedureSets.imageC),d.requireProcedureSet(this.procedureSets.imageI),d.requireProcedureSet(this.procedureSets.text)}},e.prototype.getLineBounds=function(t,e,i,r,n){var o;if(!e.empty&&t<e.lineCount&&t>=0){var s=e.lines[t],a=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,h=s.width,l=this.getHorizontalAlignShift(h,r.width,n),u=this.getLineIndent(s,n,r,0===t);l+=this.rightToLeft(n)?0:u;var c=r.x+l,p=this.shouldJustify(s,r.width,n)?r.width-u:h-u,d=e.lineHeight;o=new k(c,a,p,d)}else o=new k(0,0,0,0);return o},e.prototype.checkCorrectLayoutRectangle=function(e,i,r,n){var o=new k(i,r,e.width,e.width);if(null!=n){switch(n.alignment){case t.PdfTextAlignment.Center:o.x-=o.width/2;break;case t.PdfTextAlignment.Right:o.x-=o.width}switch(n.lineAlignment){case t.PdfVerticalAlignment.Middle:o.y-=o.height/2;break;case t.PdfVerticalAlignment.Bottom:o.y-=o.height}}return o},e.prototype.setLayer=function(t){this.pageLayer=t;var e=t.page;null!=e&&void 0!==e&&(e.beginSave=this.pageSave)},e.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},e.prototype.drawStringLayoutResult=function(e,i,r,n,o,s){if(e.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(i,r,n,s,o);var a=null!=s?s.horizontalScalingFactor:100;a===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(a),this.previousTextScaling=a);var h=null==s||0===s.lineSpacing?i.height:s.lineSpacing+i.height,l=0;l=null!=s&&s.subSuperScript===t.PdfSubSuperScript.SubScript?h-(i.height+i.metrics.getDescent(s)):h-i.metrics.getAscent(s),this.shift=l,this.pdfStreamWriter.startNextLine(o.x,o.y-l),this.pdfStreamWriter.setLeading(+h);for(var u=0,c="",p=0;p<e.lines.length;p++)if(u+=e.lineHeight,o.y+u>this.clientSize.height){this.startCutIndex=p;break}for(var d=this.startCutIndex;d<e.lines.length&&d>=0;d++)c+=e.lines[d].text;var f=new k(o.x,o.y,o.width,o.height);this.drawLayoutResult(e,i,s,o),this.underlineStrikeoutText(r,n,e,i,f,s),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(c,i,r,n,o.x,0,o.width,0,s)},e.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},e.prototype.setClip=function(e,i){void 0===i?this.setClip(e,t.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(e),this.pdfStreamWriter.clipPath(i===t.PdfFillMode.Alternate))},e.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof Qt?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof qt&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r);this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o);var s=null!=r?r.characterSpacing:0;s===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(s),this.previousCharacterSpacing=s);var a=null!=r?r.wordSpacing:0;a!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(a),this.previousWordSpacing=a)},e.prototype.getTextVerticalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.lineAlignment!==t.PdfVerticalAlignment.Top)switch(r.lineAlignment){case t.PdfVerticalAlignment.Middle:n=(i-e)/2;break;case t.PdfVerticalAlignment.Bottom:n=i-e}return n},e.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=e,s=null!=o&&o.isUnicode,a=(null!=o&&o.isEmbedFont,t.lines),h=0,l=a.length;h<l&&h!==this.startCutIndex;h++){var u=a[h],c=(u.text,u.width),p=this.getHorizontalAlignShift(c,r.width,i),d=this.getLineIndent(u,i,r,0===h);0===(p+=this.rightToLeft(i)?0:d)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(p,0),s?this.drawUnicodeLine(u,r,e,i):this.drawAsciiLine(u,r,e,i),0===p||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-p,0),this.isOverloadWithPosition&&a.length>1&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},e.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text);var s="("+n+")";this.pdfStreamWriter.showNextLineText(new P(s))},e.prototype.drawUnicodeLine=function(e,i,r,n){var o=e.text,s=(e.width,null!==n&&void 0!==n&&n.rightToLeft),a=null!==n&&void 0!==n&&(0!==n.wordSpacing||n.alignment===t.PdfTextAlignment.Justify),h=r,l=this.justifyLine(e,i.width,n),u=new Kt;if(s||null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None){var c=null,p=null!==n&&void 0!==n&&n.alignment===t.PdfTextAlignment.Right,d=null;d=(c=null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.layout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.layout(o,h,p,a,n)).length>1?null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.splitLayout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.splitLayout(o,h,p,a,n):[o],this.drawUnicodeBlocks(c,d,h,n,l)}else if(a){var f=this.breakUnicodeLine(o,h,null),c=f.tokens,d=f.words;this.drawUnicodeBlocks(c,d,h,n,l)}else{var g=this.convertToUnicode(o,h),m=this.getUnicodeString(g);this.streamWriter.showNextLineText(m)}},e.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!==r&&void 0!==r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(M.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!==r&&void 0!==r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p=t[c],d=e[c],f=0;if(0!==o&&this.streamWriter.startNextLine(o,0),d.length>0){f+=i.measureString(d,r).width,f+=u;var g=this.getUnicodeString(p);this.streamWriter.showText(g)}c!==t.length-1&&(s+=o=f+l)}s>0&&this.streamWriter.startNextLine(-s,0)}finally{null!==r&&void 0!==r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},e.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],s=this.convertToUnicode(o,e);r[n]=s}return{tokens:r,words:i}},e.prototype.getUnicodeString=function(e){if(null===e)throw new Error("Argument Null Exception : token");var i=new P(e);return i.converted=!0,i.encode=t.InternalEnum.ForceEncoding.Ascii,i},e.prototype.convertToUnicode=function(t,e){var i=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");if(e.fontInternal instanceof Gt){var r=e.fontInternal.ttfReader;e.setSymbols(t),i=r.convertString(t);var n=P.toUnicodeArray(i,!1);i=P.byteToString(n)}return i},e.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,o=this.shouldJustify(t,e,i),s=null!=i&&0!==i.wordSpacing,a=M.spaces,h=M.getCharsCount(r,a),l=0;return o?(s&&(n-=h*i.wordSpacing),l=(e-n)/h,this.pdfStreamWriter.setWordSpacing(l)):s?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),l},e.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},e.prototype.shouldJustify=function(e,i,r){var n=e.text,o=e.width,s=null!=r&&r.alignment===t.PdfTextAlignment.Justify,a=i>=0&&o<i,h=M.spaces,l=M.getCharsCount(n,h)>0&&n[0]!==M.whiteSpace,u=(e.lineType&t.LineType.LayoutBreak)>0;return s&&a&&l&&(u||r.alignment===t.PdfTextAlignment.Justify)},e.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){var a=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),h=0;h=n.y+a+r.metrics.getAscent(o)+1.5*s.width;for(var l=n.y+a+r.metrics.getHeight(o)/2+1.5*s.width,u=i.lines,c=0,p=i.lineCount;c<p;c++){var d=u[c],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===c);g+=this.rightToLeft(o)?0:m;var y=n.x+g,b=this.shouldJustify(d,n.width,o)?y+n.width-m:y+f-m;if(r.underline){w=h;this.drawLine(s,y,w,b,w),h+=i.lineHeight}if(r.strikeout){var w=l;this.drawLine(s,y,w,b,w),l+=i.lineHeight}this.isPointOverload&&u.length>1&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},e.prototype.createUnderlineStikeoutPen=function(t,e,i,r){var n=i.metrics.getSize(r)/20,o=null;return null!=t?o=new Q(t.color,n):null!=e&&(o=new Q(e,n)),o},e.prototype.getTextRenderingMode=function(e,i,r){var n=t.TextRenderingMode.None;return n=null!=e&&null!=i?t.TextRenderingMode.FillStroke:null!=e?t.TextRenderingMode.Stroke:t.TextRenderingMode.Fill,null!=r&&r.clipPath&&(n|=t.TextRenderingMode.ClipFlag),n},e.prototype.getLineIndent=function(e,i,r,n){var o=0,s=(e.lineType&t.LineType.FirstParagraphLine)>0;return null!=i&&s&&(o=n?i.firstLineIndent:i.paragraphIndent,o=r.width>0?Math.min(r.width,o):o),o},e.prototype.getHorizontalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.alignment!==t.PdfTextAlignment.Left)switch(r.alignment){case t.PdfTextAlignment.Center:n=(i-e)/2;break;case t.PdfTextAlignment.Right:n=i-e}return n},e.prototype.rightToLeft=function(e){var i=null!==e&&void 0!==e&&e.rightToLeft;return null!==e&&void 0!==e&&e.textDirection!==t.PdfTextDirection.None&&void 0!==e.textDirection&&(i=!0),i},e.prototype.stateControl=function(t,e,i,r){if(void 0===r)this.stateControl(t,e,i,null);else{e instanceof qt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof Qt&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace);null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1)}},e.prototype.initCurrentColorSpace=function(e){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=t.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1),this.bCSInitialized=!0):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1),this.bCSInitialized=!0))},e.prototype.penControl=function(t,e){null!=t&&(this.currentPen=t,t.monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},e.prototype.brushControl=function(t,e){if(null!=t&&void 0!==t){var i=t.clone(),r=i;if(!(null===r||void 0===r||t instanceof A||t instanceof Qt)){var n=r.matrix,o=this.matrix.clone();null!=n&&(n.multiply(o),o=n),r.matrix=o}this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t,t=null}},e.prototype.fontControl=function(e,i,r){if(null!=e){var n=null!=i?i.subSuperScript:t.PdfSubSuperScript.None,o=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:t.PdfSubSuperScript.None;if(r||e!==this.currentFont||n!==o){var s=this.getResources.getResources();this.currentFont=e,this.currentStringFormat=i;var a=e.metrics.getSize(i);this.isEmfTextScaled=!1;var h=s.getName(e);this.pdfStreamWriter.setFont(e,h,a)}}},e.prototype.setTransparency=function(e,i,r){if(void 0===i)this.istransparencySet=!0,this.setTransparency(e,e,t.PdfBlendMode.Normal);else if("number"==typeof i&&void 0===r)this.setTransparency(e,i,t.PdfBlendMode.Normal);else{null==this.trasparencies&&(this.trasparencies=new rt);var n=null,o=new re(e,i,r);this.trasparencies.containsKey(o)&&(n=this.trasparencies.getValue(o)),null==n&&(n=new nt(e,i,r),this.trasparencies.setValue(o,n));var s=this.getResources.getResources().getName(n);this.streamWriter.setGraphicsState(s)}},e.prototype.clipTranslateMargins=function(t,e,i,r,n,o){if(t instanceof k&&void 0===e)this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y);else if("number"==typeof t){var s=new k(i,r,this.size.width-i-n,this.size.height-r-o);this.clipBounds=s,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(s),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e)}},e.prototype.updateY=function(t){return-t},e.prototype.translateTransform=function(t,e){var i=new tt;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},e.prototype.scaleTransform=function(t,e){var i=new tt;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getScaleTransform=function(t,e,i){return null==i&&(i=new tt),i.scale(t,e),i},e.prototype.rotateTransform=function(t){var e=new tt;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},e.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},e.prototype.getRotateTransform=function(t,e){return null!=e&&void 0!==e||(e=new tt),e.rotate(this.updateY(t)),e},e.prototype.save=function(){var t=new ie(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},e.prototype.restore=function(t){if(void 0===t)this.graphicsState.length>0&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length&&this.doRestoreState()!==t;);},e.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},e.prototype.drawPath=function(t,e,i){e instanceof Qt?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof qt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i.pathPoints,i.pathTypes),this.drawPathHelper(t,e,i.fillMode,!1)},e.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof k?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},e.prototype.buildUpPath=function(i,r){for(var n=i.length,o=0;o<n;++o){var s=0,a=i[o];switch(r[o]&e.pathTypesValuesMask){case t.PathPointType.Start:this.pdfStreamWriter.beginPath(a.x,a.y);break;case t.PathPointType.Bezier3:var h=new T(0,0),l=new T(0,0),u=this.getBezierPoints(i,r,o,h,l);this.pdfStreamWriter.appendBezierSegment(a,u.p2,u.p3),o=u.i;break;case t.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(a);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}s=r[o],this.checkFlags(s)}},e.prototype.getBezierPoints=function(i,r,n,o,s){if(++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(o=i[n],++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return s=i[n],{i:n,p2:o,p3:s}},e.prototype.checkFlags=function(e){(e&t.PathPointType.CloseSubpath)===t.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},e.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length){var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];this.pdfStreamWriter.beginPath(a[0],a[1]);var h=0;for(h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])}},e.prototype.getBezierArc=function(t,e,i,r,n,o){if(t>i){s=void 0;s=t,t=i,i=s}if(r>e){var s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),S=Math.cos(b),P=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*P,l+c*(w-f*P),u-p*(P+f*w),l+c*(S+f*v),u-p*(v-f*S),l+c*S,u-p*v):g.push(l+c*w,u-p*P,l+c*(w+f*P),u-p*(P-f*w),l+c*(S-f*v),u-p*(v+f*S),l+c*S,u-p*v)}return g},e.pathTypesValuesMask=15,e.transparencyObject=!1,e}(),ee=function(){function t(t){this.sender=t}return t.prototype.getResources=function(){return this.sender.getResources()},t}(),ie=function(){function e(e,i){this.internalTextRenderingMode=t.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=t.PdfColorSpace.Rgb,void 0!==e&&(this.pdfGraphics=e,this.transformationMatrix=i)}return Object.defineProperty(e.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0}),e}(),re=function(){function t(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i}return t}(),ne=function(){function e(e,i){if(this.pdfColorSpace=t.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new a,null===e)throw new Error("ArgumentNullException:page");if(this.pdfPage=e,this.clipPageTemplates=!0,void 0===i)this.content=new b;else if(i instanceof b||null===i){if(null===i)throw new Error("ArgumentNullException:stream");this.content=i}else this.content=new b,this.clipPageTemplates=i}return Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layers",{get:function(){return null==this.layer?(this.layer=new ae(this.page),this.layer.sublayer=!0,this.layer):this.layer},enumerable:!0,configurable:!0}),e.prototype.add=function(){var t=new e(this.pdfPage);return t.name="",t},e.prototype.sign=function(t){return 0===t?0:t>0?1:-1},e.prototype.initializeGraphics=function(t){var e=t,i=new ee(this.page);if(this.pdfGraphics=new te(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e){var r=e.section.parent;null!=r&&(this.pdfGraphics.colorSpace=r.document.colorSpace,this.colorSpace=r.document.colorSpace)}var n=this.sign(t.origin.y)===this.sign(t.origin.x);(t.origin.x>=0&&t.origin.y>=0||!n)&&this.pdfGraphics.initializeCoordinates();var o=e.section.getActualBounds(e,!0),s=e.section.pageSettings.margins;this.clipPageTemplates?t.origin.x>=0&&t.origin.y>=0&&this.pdfGraphics.clipTranslateMargins(o):this.graphics.clipTranslateMargins(o.x,o.y,s.left,s.top,s.right,s.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(e.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),e}(),oe=function(){function t(){}return Object.defineProperty(t.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0}),t}(),se=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ae=function(t){function e(e){var i=t.call(this)||this;if(i.parentLayerCount=0,i.sublayer=!1,i.optionalContent=new h,e instanceof he){i.page=e;var r=e;i.parseLayers(r)}return i}return se(e,t),e.prototype.items=function(t,e){if("number"==typeof t&&void 0===e)return this.list[t];if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},e.prototype.add=function(t,e){if(void 0===t){var i=new ne(this.page);return i.name="",this.add(i),i}if(t instanceof ne){var r=this.list.push(t);return this.addLayer(r,t),r}return 0},e.prototype.addLayer=function(t,e){var i=new C(e);this.page.contents.add(i)},e.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},e.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");var i=new C(e);this.page.contents.insert(t,i)},e.prototype.parseLayers=function(t){var e=this.page.contents;this.page.getResources();t.crossTable;var i=new b,r=new b,n=[];n.push("q"),i.data=n,e.insert(0,new C(i)),(n=[]).push("Q"),r.data=n,e.insert(e.count,new C(r))},e.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)},e}(oe),he=function(){function t(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new a,this.pageDictionary=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayerIndex",{get:function(){if(0===this.layerCollection.count||-1===this.defLayerIndex){var t=this.layerCollection.add();this.defLayerIndex=this.layerCollection.indexOf(t)}return this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new ae(this)),this.layerCollection},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Jt,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(t.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new m,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),t.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0},t}(),le=function(){function e(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new a,this.internalAnnotations=new m,this.lists=[],void 0!==t&&(this.page=t)}return Object.defineProperty(e.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),e.prototype.add=function(t){this.doAdd(t)},e.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new C(t)),this.lists.push(t);var e=(new I).layout(t.text,t.font,t.stringFormat,new j(t.bounds.width,0),!1,new j(0,0)),i=t.bounds.y;if(1===e.lines.length){n=t.font.measureString(e.lines[0].text);t.bounds=new k(new T(t.bounds.x,i),n),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t)}else for(var r=0;r<e.lines.length;r++){var n=t.font.measureString(e.lines[r].text);if(0===r)t.bounds=new k(t.bounds.x,i,n.width,n.height),t.text=e.lines[r].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,n.width,n.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t),i+=t.bounds.height;else{var o=t.clone();o.bounds=new k(new T(t.bounds.x,i),n),o.text=e.lines[r].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new C(o)),this.lists.push(o),i+=o.bounds.height}}},e.prototype.setColor=function(e){var i=t.PdfColorSpace.Rgb,r=e.color.toArray(i);e.dictionary.items.setValue(this.dictionaryProperties.c,r)},Object.defineProperty(e.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0}),e}(),ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ce=function(t){function e(){var e=t.call(this,new h)||this;return e.annotationCollection=null,e.beginSave=null,e.initialize(),e}return ue(e,t),Object.defineProperty(e.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return null===this.section.parent?this.section.parentDocument.crossTable:this.section.parent.document.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new le(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new f(this)},e.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new C(t))},e.prototype.resetProgress=function(){this.isProgressOn=!1},e.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new j(t.width,t.height)},e.prototype.pageBeginSave=function(){var t=this.document;void 0!==typeof t&&null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},e.prototype.drawPageTemplates=function(t){if(this.section.containsTemplates(t,this,!1)){var e=new ne(this,!1);if(this.layers.insert(0,e),this.section.drawTemplates(this,e,t,!1),null!==e.graphics&&void 0!==e.graphics)for(var i=0;i<e.graphics.automaticFields.automaticFields.length;i++){var r=e.graphics.automaticFields.automaticFields[i];r.field.performDraw(e.graphics,r.location,r.scalingX,r.scalingY)}}if(this.section.containsTemplates(t,this,!0)){var n=new ne(this,!1);this.layers.add(n),this.section.drawTemplates(this,n,t,!0)}},e}(he),pe=function(){function t(t){this.pdfPage=void 0!==t?t:null}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),t}(),de=function(){function t(t){if(this.pdfSection=null,null==t)throw Error('ArgumentNullException("section")');this.section=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),t.prototype.contains=function(t){return this.section.contains(t)},t.prototype.remove=function(t){this.section.remove(t)},t.prototype.add=function(){return this.section.add()},t}(),fe=function(){function e(){}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftTemplate},set:function(e){this.leftTemplate=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topTemplate},set:function(e){this.topTemplate=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightTemplate},set:function(e){this.rightTemplate=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(e){this.bottomTemplate=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(e){this.evenLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(e){this.evenTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(e){this.evenRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(e){this.evenBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(e){this.oddLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddTop",{get:function(){return this.oddTop},set:function(e){this.oddTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddRight",{get:function(){return this.oddRight},set:function(e){this.oddRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(e){this.oddBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),e.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},e.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},e.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},e.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},e.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},e.prototype.checkElement=function(e,i){if(null!=e){if(void 0!==e.type&&e.type!==t.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");e.type=i}return e},e}(),ge=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),me=function(t){function e(){var e=t.call(this)||this;return e.leftValue=e.topValue=e.rightValue=e.bottomValue=e.stampValue=!0,e}return ge(e,t),Object.defineProperty(e.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0}),e}(fe),ye=function(){function t(t,e){this.pageAdded=new pe,this.pdfPages=[],this.dictionaryProperties=new a,this.pdfDocument=t,void 0===e?(this.settings=t.pageSettings.clone(),this.initialSettings=this.settings.clone()):(this.settings=e.clone(),this.initialSettings=this.settings.clone()),this.initialize()}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new C(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new me),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new de(this)),this.pagesCollection},enumerable:!0,configurable:!0}),t.prototype.getPages=function(){return this.pdfPages},t.prototype.pointToNativePdf=function(t,e){var i=this.getActualBounds(t,!0);return e.x+=i.x,e.y=this.pageSettings.height-e.y,e},t.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},t.prototype.initialize=function(){this.pagesReferences=new m,this.section=new h,this.state=new be(this.pdfDocument),this.section.sectionBeginSave=new d(this,this.state),this.pageCount=new g(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},t.prototype.containsTemplates=function(t,e,i){var r=this.getDocumentTemplates(t,e,i),n=this.getSectionTemplates(e,i);return r.length>0||n.length>0},t.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},t.prototype.getSectionTemplates=function(t,e){var i=[];if(null!=this.template.getTop(t)&&(!(r=this.template.getTop(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getBottom(t)&&(!(r=this.template.getBottom(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getLeft(t)&&(!(r=this.template.getLeft(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getRight(t)){var r=this.template.getRight(t);(!r.foreground&&!e||r.foreground&&e)&&i.push(r)}return i},t.prototype.add=function(t){if(void 0===t){var e=new ce;return this.add(e),e}var i=this.checkPresence(t);this.pdfPages.push(t),this.pagesReferences.add(i),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},t.prototype.checkPresence=function(t){for(var e=new C(t),i=!1,r=this.parent,n=0;n<r.section.length;n++){var o=r.section[n];i=i||o.contains(t)}return e},t.prototype.contains=function(t){return 0<=this.indexOf(t)},t.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new C(t);return this.pagesReferences.indexOf(i)},t.prototype.pageAddedMethod=function(t){var e=new pe(t);this.onPageAdded(e),this.parent.document.pages.onPageAdded(e),this.pageCount.intValue=this.count},t.prototype.onPageAdded=function(t){},t.prototype.getActualBounds=function(t,e,i){if(t instanceof ce&&"boolean"==typeof e){var r=this.parent.document;return this.getActualBounds(r,t,e)}t=t,e=e,i=i;var n=new k(0,0,0,0);n.height=i?this.pageSettings.size.height:this.pageSettings.getActualSize().height,n.width=i?this.pageSettings.size.width:this.pageSettings.getActualSize().width;var o=this.getLeftIndentWidth(t,e,i),s=this.getTopIndentHeight(t,e,i),a=this.getRightIndentWidth(t,e,i),h=this.getBottomIndentHeight(t,e,i);return n.x+=o,n.y+=s,n.width-=o+a,n.height-=s+h,n},t.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.left:0,n=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,o=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return r+=this.template.applyDocumentLeftTemplate?Math.max(n,o):n},t.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.top:0,n=null!=this.template.getTop(e)?this.template.getTop(e).height:0,o=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return r+=this.template.applyDocumentTopTemplate?Math.max(n,o):n},t.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.right:0,n=null!=this.template.getRight(e)?this.template.getRight(e).width:0,o=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return r+=this.template.applyDocumentRightTemplate?Math.max(n,o):n},t.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.bottom:0,n=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,o=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return r+=this.template.applyDocumentBottomTemplate?Math.max(n,o):n},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');var e=this.pdfPages.indexOf(t);this.pagesReferences.removeAt(e);for(var i=[],r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},t.prototype.applyPageSettings=function(t,e,i){var r=new k(i.origin,i.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(r));var n=0;n=we.rotateFactor*i.rotate;var o=new g(n);t.items.setValue(this.dictionaryProperties.rotate,o)},t.prototype.beginSave=function(t,e){var i=e.document;this.applyPageSettings(this.section,i.pageSettings,t)},t.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),o=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,o)},t.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&i.length>0)for(var r=i.length,n=0;n<r;n++)i[n].draw(t,e)},t}(),be=function(){function t(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}return Object.defineProperty(t.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),t}(),we=function(){function t(t){this.sections=[],this.dictionaryProperties=new a,this.pdfDocument=t.clone(),this.initialize()}return Object.defineProperty(t.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.sectionCount=new g(0),this.sectionCollection=new m,this.pages=new h,this.pages.beginSave=new l(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new h),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},t.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},t.prototype.setPageSettings=function(t,e){var i=new k(new T,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(i))},t.prototype.add=function(t){if(void 0===t){var e=new ye(this.pdfDocument);return this.add(e),e}var i=this.checkSection(t);return this.sections.push(t),t.parent=this,this.sectionCollection.add(i),this.sections.indexOf(t)},t.prototype.checkSection=function(t){var e=new C(t);this.sectionCollection.contains(e);return e},t.prototype.countPages=function(){var t=0;return this.sections.forEach(function(e){return t+=e.count}),t},t.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},t.rotateFactor=90,t}(),Se=function(){function t(t){this.pdfPageCollectionIndex=new n,this.document=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new ce;return this.add(e),e}this.getLastSection().add(t)},t.prototype.getLastSection=function(){var t=this.document.sections;return 0===t.section.length&&t.add(),t.section[t.section.length-1]},t.prototype.onPageAdded=function(t){},t.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},t.prototype.getPageByIndex=function(t){return this.getPage(t)},t.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=0,n=0,o=this.document.sections.count,s=0;s<o;s++){var a=this.document.sections.section[s];if(r=a.count,n=t-i,t>=i&&n<r){e=a.getPages()[n];break}i+=r}return e},t.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if((e=o.indexOf(t))>=0){e+=i;break}e=-1,i+=o.count}return e},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e},t}(),Pe=function(){function t(){this.referenceObjects=[],this.pdfFontCollection=new n}return t.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():i.length>0&&(e=i[0]),i.push(t),e},t.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},t.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(this.referenceObjects.length>0){var n=this.referenceObjects[r];if(n.length>0){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},t.prototype.removeGroup=function(t){if(null!==t){var e=this.referenceObjects.indexOf(t);this.referenceObjects.slice(e,e+1)}},t.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0},t}(),ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ce=function(e){function i(t){var r=e.call(this)||this;r.defaultMargin=40,r.streamWriter=null,r.document=r;var n=!1;void 0===t?(i.cacheCollection=new Pe,n=!1):n=t;var o=new W;r.setMainObjectCollection(o);var s=new q;s.isMerging=n,s.document=r,r.setCrossTable(s);var a=new U;return r.setCatalog(a),o.add(a),a.position=-1,r.sectionCollection=new we(r),r.documentPageCollection=new Se(r),a.pages=r.sectionCollection,r}return ve(i,e),Object.defineProperty(i,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new xe(t.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new Z(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i,"cache",{get:function(){return void 0===i.cacheCollection||null==i.cacheCollection?new Pe:i.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(i,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===t.PdfColorSpace.Rgb||this.pdfColorSpace===t.PdfColorSpace.Cmyk||this.pdfColorSpace===t.PdfColorSpace.GrayScale?this.pdfColorSpace:t.PdfColorSpace.Rgb},set:function(e){e===t.PdfColorSpace.Rgb||e===t.PdfColorSpace.Cmyk||e===t.PdfColorSpace.GrayScale?this.pdfColorSpace=e:this.pdfColorSpace=t.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new fe),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),i.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;var r=new z(t);if(r.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(r);this.crossTable.save(r,e)},i.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},i.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,i.cache.destroy(),this.crossTable.pdfObjects.destroy(),i.cache=void 0,this.streamWriter.destroy()},i.defaultStandardFont=null,i.isCacheEnabled=!0,i}(_),Be=function(){function e(){}return e.getMetrics=function(e,i,r){var n=null;switch(e){case t.PdfFontFamily.Helvetica:n=this.getHelveticaMetrics(e,i,r);break;case t.PdfFontFamily.Courier:n=this.getCourierMetrics(e,i,r);break;case t.PdfFontFamily.TimesRoman:n=this.getTimesMetrics(e,i,r);break;case t.PdfFontFamily.Symbol:n=this.getSymbolMetrics(e,i,r);break;case t.PdfFontFamily.ZapfDingbats:n=this.getZapfDingbatsMetrics(e,i,r);break;default:n=this.getHelveticaMetrics(t.PdfFontFamily.Helvetica,i,r)}return n.name=e.toString(),n.subScriptSizeFactor=this.subSuperScriptFactor,n.superscriptSizeFactor=this.subSuperScriptFactor,n},e.getHelveticaMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaBoldItalicAscent,n.descent=this.helveticaBoldItalicDescent,n.postScriptName=this.helveticaBoldItalicName,n.size=r,n.widthTable=new Et(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.helveticaBoldAscent,n.descent=this.helveticaBoldDescent,n.postScriptName=this.helveticaBoldName,n.size=r,n.widthTable=new Et(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaItalicAscent,n.descent=this.helveticaItalicDescent,n.postScriptName=this.helveticaItalicName,n.size=r,n.widthTable=new Et(this.arialWidth),n.height=n.ascent-n.descent):(n.ascent=this.helveticaAscent,n.descent=this.helveticaDescent,n.postScriptName=this.helveticaName,n.size=r,n.widthTable=new Et(this.arialWidth),n.height=n.ascent-n.descent),n},e.getCourierMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierBoldItalicAscent,n.descent=this.courierBoldItalicDescent,n.postScriptName=this.courierBoldItalicName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.courierBoldAscent,n.descent=this.courierBoldDescent,n.postScriptName=this.courierBoldName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierItalicAscent,n.descent=this.courierItalicDescent,n.postScriptName=this.courierItalicName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(n.ascent=this.courierAscent,n.descent=this.courierDescent,n.postScriptName=this.courierName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent),n},e.getTimesMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesBoldItalicAscent,n.descent=this.timesBoldItalicDescent,n.postScriptName=this.timesBoldItalicName,n.size=r,n.widthTable=new Et(this.timesRomanBoldItalicWidths),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.timesBoldAscent,n.descent=this.timesBoldDescent,n.postScriptName=this.timesBoldName,n.size=r,n.widthTable=new Et(this.timesRomanBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesItalicAscent,n.descent=this.timesItalicDescent,n.postScriptName=this.timesItalicName,n.size=r,n.widthTable=new Et(this.timesRomanItalicWidth),n.height=n.ascent-n.descent):(n.ascent=this.timesAscent,n.descent=this.timesDescent,n.postScriptName=this.timesName,n.size=r,n.widthTable=new Et(this.timesRomanWidth),n.height=n.ascent-n.descent),n},e.getSymbolMetrics=function(t,e,i){var r=new It;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new Et(this.symbolWidth),r.height=r.ascent-r.descent,r},e.getZapfDingbatsMetrics=function(t,e,i){var r=new It;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new Et(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},e.subSuperScriptFactor=1.52,e.helveticaAscent=931,e.helveticaDescent=-225,e.helveticaName="Helvetica",e.helveticaBoldAscent=962,e.helveticaBoldDescent=-228,e.helveticaBoldName="Helvetica-Bold",e.helveticaItalicAscent=931,e.helveticaItalicDescent=-225,e.helveticaItalicName="Helvetica-Oblique",e.helveticaBoldItalicAscent=962,e.helveticaBoldItalicDescent=-228,e.helveticaBoldItalicName="Helvetica-BoldOblique",e.courierAscent=805,e.courierDescent=-250,e.courierName="Courier",e.courierBoldAscent=801,e.courierBoldDescent=-250,e.courierBoldName="Courier-Bold",e.courierItalicAscent=805,e.courierItalicDescent=-250,e.courierItalicName="Courier-Oblique",e.courierBoldItalicAscent=801,e.courierBoldItalicDescent=-250,e.courierBoldItalicName="Courier-BoldOblique",e.timesAscent=898,e.timesDescent=-218,e.timesName="Times-Roman",e.timesBoldAscent=935,e.timesBoldDescent=-218,e.timesBoldName="Times-Bold",e.timesItalicAscent=883,e.timesItalicDescent=-217,e.timesItalicName="Times-Italic",e.timesBoldItalicAscent=921,e.timesBoldItalicDescent=-218,e.timesBoldItalicName="Times-BoldItalic",e.symbolAscent=1010,e.symbolDescent=-293,e.symbolName="Symbol",e.zapfDingbatsAscent=820,e.zapfDingbatsDescent=-143,e.zapfDingbatsName="ZapfDingbats",e.arialWidth=[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,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,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,584,611,556,556,556,556,500,556,500],e.arialBoldWidth=[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,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,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,584,611,611,611,611,611,556,611,556],e.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],e.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],e.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],e.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],e.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],e.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],e.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918],e}(),Oe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xe=function(e){function i(r,n,o){var s=e.call(this,n,void 0===o?r instanceof i?r.style:t.PdfFontStyle.Regular:o)||this;return s.dictionaryProperties=new a,s.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],s.pdfFontFamily=void 0===r?t.PdfFontFamily.Helvetica:r instanceof i?r.fontFamily:r,s.checkStyle(),s.initializeInternals(),s}return Oe(i,e),Object.defineProperty(i.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),i.prototype.checkStyle=function(){if(this.fontFamily===t.PdfFontFamily.Symbol||this.fontFamily===t.PdfFontFamily.ZapfDingbats){var e=this.style;e&=~(t.PdfFontStyle.Bold|t.PdfFontStyle.Italic),this.setStyle(e)}},i.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var r=0,n=(this.name,0),o=(t=i.convert(t)).length;n<o;n++){var s=t[n];r+=this.getCharWidthInternal(s,e)}var a=this.metrics.getSize(e);return r*=G.charSizeMultiplier*a,r=this.applyFormatSettings(t,e,r)},i.prototype.equalsToFont=function(e){var i=!1,r=e;if(null!=r){var n=this.fontFamily===r.fontFamily,o=~(t.PdfFontStyle.Underline|t.PdfFontStyle.Strikeout),s=(this.style&o)==(r.style&o);i=n&&s}return i},i.prototype.initializeInternals=function(){Ce.cache.search(this);var t=null,e=Be.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=e,t=this.createInternals(),this.setInternals(t)},i.prototype.createInternals=function(){var e=new h;if(e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==t.PdfFontFamily.Symbol&&this.fontFamily!==t.PdfFontFamily.ZapfDingbats){var i=this.encodings[t.FontEncoding.WinAnsiEncoding];e.items.setValue(this.dictionaryProperties.encoding,new o(i))}return e},i.prototype.getCharWidthInternal=function(t,e){var r=0;return r=t.charCodeAt(0),"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(r-=i.charOffset),r=r>=0&&128!==r?r:0,this.metrics.widthTable.items(r)},i.convert=function(t){return t},i.charOffset=32,i}(G),Le=function(){function e(e){this.dictionaryProperties=new a,this.pdfColor=new L(255,255,255),this.rectangle=new k(0,0,0,0),this.pdfPage=null,this.textBrush=new A(new L(0,0,0)),this.textFont=new xe(t.PdfFontFamily.TimesRoman,10),this.format=new D(t.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new h,this.internalColor=new L,this.darkness=1,void 0===e?this.initialize():(this.initialize(),this.bounds=e)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new P(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new p(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},e.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new C(this.pdfPage))},e.prototype.beginSave=function(){this.save()},e.prototype.save=function(){var t=new k(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,r=e.pointToNativePdf(this.page,new T(t.x,t.y));t.x=r.x,t.width=r.x+t.width,t.y=r.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,m.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(this.darkness))},Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0}),e}(),Te=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),je=function(t){function e(e){return t.call(this,e)||this}return Te(e,t),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))},e}(Le),ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ve=function(t){function e(e){var i=t.call(this,e)||this;return i.pdfAction=null,i}return ke(e,t),e.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t},e}(je),Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ne=function(t){function e(e,i){var r=t.call(this,e)||this;return r.pdfDestination=null,void 0!==i&&(r.destination=i),r}return Re(e,t),Object.defineProperty(e.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),e.prototype.save=function(){t.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},e.prototype.clone=function(){var t=new e(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t},e}(je),Ae=function(){function t(t){this.layoutElement=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),t.prototype.getElement=function(){return this.layoutElement},t.prototype.layout=function(t){return this.layoutInternal(t)},t.prototype.Layouter=function(t){return this.layoutInternal(t)},t.prototype.getNextPage=function(t){return t.section.add()},t.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new k(t.bounds.x,0,t.bounds.width,t.bounds.height)},t}(),De=function(){function t(t){void 0===t||(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}return Object.defineProperty(t.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new k(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0}),t}(),Me=function(){function t(){}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return new k(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0}),t}(),Ie=function(){function t(t,e){this.pdfPage=t,this.layoutBounds=e}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0}),t}(),Fe=function(){function e(){var e=new Q(new L(0,0,0));e.dashStyle=t.PdfDashStyle.Solid;var i=new Q(new L(0,0,0));i.dashStyle=t.PdfDashStyle.Solid;var r=new Q(new L(0,0,0));r.dashStyle=t.PdfDashStyle.Solid;var n=new Q(new L(0,0,0));n.dashStyle=t.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=i,this.topPen=r,this.bottomPen=n}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(e,"default",{get:function(){return new e},enumerable:!0,configurable:!0}),e}(),Ee=function(){function t(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),t}(),Ge=function(){function t(){}return Object.defineProperty(t.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),t.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},t.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},t.prototype.drawHelper=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.bEmbedFonts=i,this.drawHelper(t,e,null);var s=new Me,a=e,h=i;if(s.page=t,s.bounds=a,null!=s){var l=s.bounds.x,u=s.bounds.y;0===s.bounds.x&&(l=Fe.default.right.width/2),0===s.bounds.y&&(u=Fe.default.top.width/2);var c=new k(l,u,s.bounds.width,s.bounds.height);s.bounds=c}return s.format=null!=h?h:new De,this.layout(s)},t}(),ze=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),We=function(e){function i(t){return e.call(this,t)||this}return ze(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return e.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new He;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},i.prototype.getLayoutResult=function(t){return new _e(t.page,t.bounds,t.remainder,t.lastLineBounds)},i.prototype.layoutOnPage=function(e,i,r,n){var o=new He;o.remainder=e,o.page=i,r=this.checkCorrectBounds(i,r);var s=(new I).layout(e,this.element.font,this.format,r,i.getClientSize().height,!1,new j(0,0)),a=null==s.remainder,h=(n.format.break===t.PdfLayoutBreakType.FitElement||s.empty,i.graphics),l=this.element.getBrush();this.element instanceof Je&&(l.color=new L(0,0,255)),h.drawStringLayoutResult(s,this.element.font,this.element.pen,l,r,this.format);s.lines[s.lineCount-1];return o.lastLineBounds=h.getLineBounds(s.lineCount-1,s,this.element.font,r,this.format),o.bounds=this.getTextPageBounds(i,r,s),o.remainder=s.remainder,o.end=a,o},i.prototype.checkCorrectBounds=function(t,e){var i=t.graphics.clientSize;return e.height=e.height>0?e.height:i.height-e.y,e},i.prototype.getTextPageBounds=function(t,e,i){var r=i.actualSize,n=e.x,o=e.y,s=e.width>0?e.width:r.width,a=r.height;n=t.graphics.checkCorrectLayoutRectangle(r,e.x,e.y,this.format).x;var h=t.graphics.getTextVerticalAlignShift(r.height,e.height,this.format);return new k(n,o+=h,s,a)},i}(Ae),He=function(){function t(){}return t}(),_e=function(t){function e(e,i,r,n){var o=t.call(this,e,i)||this;return o.remainderText=r,o.lastLineTextBounds=n,o}return ze(e,t),Object.defineProperty(e.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),e}(Ie),Ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ue=function(e){function i(t,i,r,n,o){var s=e.call(this)||this;return s.content="",s.elementValue="",s.hasPointOverload=!1,s.isPdfTextElement=!1,void 0===t||("string"==typeof t&&void 0===i?(s.content=t,s.elementValue=t):"string"==typeof t&&i instanceof G&&void 0===r?(s.content=t,s.elementValue=t,s.pdfFont=i):"string"==typeof t&&i instanceof G&&r instanceof Q&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r):"string"==typeof t&&i instanceof G&&r instanceof R&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfBrush=r):(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r,s.pdfBrush=n,s.format=o)),s}return Ke(i,e),Object.defineProperty(i.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof xe&&null!=this.content?this.elementValue=xe.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),i.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new A(new L(0,0,0)):this.pdfBrush},i.prototype.layout=function(t){return new We(this).layout(t)},i.prototype.drawText=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){this.hasPointOverload=!0;var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawText(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var s=new I;if(this.hasPointOverload){var a=s.layout(this.value,this.font,this.stringFormat,new j(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),h=void 0,l=e,u=i;if((f=new Me).page=t,f.bounds=l,f.format=null!=u?u:new De,a.lines.length>1){if(this.text=a.layoutLines[0].text,f.bounds.y<=f.page.graphics.clientSize.height){g=new T(f.bounds.x,f.bounds.y);h=this.layout(f);for(var c=new k(0,h.bounds.y+a.lineHeight,t.graphics.clientSize.width,a.lineHeight),p=1;p<a.lines.length;p++)if(f.page=h.page,f.bounds=new k(new T(c.x,c.y),new j(c.width,c.height)),this.text=a.layoutLines[p].text,c.y+a.lineHeight>h.page.graphics.clientSize.height&&(f.page=f.page.graphics.getNextPage(),c=g.y>h.page.graphics.clientSize.height-h.bounds.height?new k(0,h.bounds.height,h.page.graphics.clientSize.width,a.lineHeight):new k(0,0,h.page.graphics.clientSize.width,a.lineHeight),f.bounds=c),h=this.layout(f),p!==a.lines.length-1)c=new k(0,h.bounds.y+a.lineHeight,h.page.graphics.clientSize.width,a.lineHeight);else{m=this.font.measureString(this.text,this.format).width;h=this.calculateResultBounds(h,m,h.page.graphics.clientSize.width,0)}}return h}y=this.font.measureString(this.text,this.format);return f.bounds.y<=f.page.graphics.clientSize.height&&(h=this.layout(f),h=this.calculateResultBounds(h,y.width,h.page.graphics.clientSize.width,0)),h}var h=s.layout(this.value,this.font,this.stringFormat,new j(e.width,0),!1,t.graphics.clientSize),d=void 0,f=new Me,l=e,u=i;if(f.page=t,f.bounds=l,f.format=null!=u?u:new De,h.lines.length>1){if(this.text=h.layoutLines[0].text,f.bounds.y<=f.page.graphics.clientSize.height){var g=new T(f.bounds.x,f.bounds.y);d=this.layout(f);for(var c=new k(l.x,d.bounds.y+h.lineHeight,l.width,h.lineHeight),p=1;p<h.lines.length;p++)if(f.page=d.page,f.bounds=new k(c.x,c.y,c.width,c.height),this.text=h.layoutLines[p].text,c.y+h.lineHeight>d.page.graphics.clientSize.height&&(f.page=f.page.graphics.getNextPage(),c=g.y>d.page.graphics.clientSize.height-d.bounds.height?new k(l.x,h.lineHeight,l.width,h.lineHeight):new k(l.x,0,l.width,h.lineHeight),f.bounds=c),d=this.layout(f),p!==h.lines.length-1)c=new k(l.x,d.bounds.y+h.lineHeight,l.width,h.lineHeight);else{var m=this.font.measureString(this.text,this.format).width;d=this.calculateResultBounds(d,m,l.width,l.x)}}return d}var y=this.font.measureString(this.text,this.format);return f.bounds.y<=f.page.graphics.clientSize.height&&(d=this.layout(f),d=this.calculateResultBounds(d,y.width,l.width,l.x)),d},i.prototype.calculateResultBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.bounds.x=n+(r-i)/2,e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.bounds.x=n+(r-i),e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.bounds.x=n,e.bounds.width=r):(e.bounds.width=n,e.bounds.width=i),e},i}(Ge),qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ye=function(t){function e(e,i){var r=t.call(this,e)||this;return void 0!==i&&(r.uri=i),r}return qe(e,t),Object.defineProperty(e.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new x),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)},e}(Ve),Xe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Je=function(e){function i(){var t=e.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new m;for(var i=0;i<3;i++)t.defaultBorder.add(new g(0));return t}return Xe(i,e),Object.defineProperty(i.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),i.prototype.draw=function(e,i){if(e instanceof ce){var r=new I,n=this.font.style;if(i instanceof T){if(this.recalculateBounds=!0,this.font.style=t.PdfFontStyle.Underline,1===(h=r.layout(this.value,this.font,this.stringFormat,new j(e.graphics.clientSize.width-i.x,0),!0,e.graphics.clientSize)).lines.length){var o=this.font.measureString(this.value),s=new k(i,o);s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,i.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);a=this.drawText(e,i);return this.font.style=n,a}var a=this.drawMultipleLineWithPoint(h,e,i);return this.font.style=n,a}var h=r.layout(this.value,this.font,this.stringFormat,new j(i.width,0),!1,new j(0,0));if(this.font.style=t.PdfFontStyle.Underline,1===h.lines.length){var o=this.font.measureString(this.value),s=new k(new T(i.x,i.y),o);s=this.calculateBounds(s,o.width,i.width,i.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);l=this.drawText(e,i);return this.font.style=n,l}var l=this.drawMultipleLineWithBounds(h,e,i);return this.font.style=n,l}var u=new ce;return u=e.page,this.draw(u,i)},i.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(i,o);if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new k(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new T(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},i.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(new T(i.x,i.y),o);if(s=this.calculateBounds(s,o.width,i.width,i.x),this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new k(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},i.prototype.calculateBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.x=n+(r-i)/2,e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.x=n+(r-i),e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.x=n,e.width=r):(e.width=n,e.width=i),e},i}(Ue),Ze=function(){function e(){}return e.convert=function(e,i){var r="";switch(i){case t.PdfNumberStyle.None:r="";break;case t.PdfNumberStyle.Numeric:r=e.toString();break;case t.PdfNumberStyle.LowerLatin:r=this.arabicToLetter(e).toLowerCase();break;case t.PdfNumberStyle.LowerRoman:r=this.arabicToRoman(e).toLowerCase();break;case t.PdfNumberStyle.UpperLatin:r=this.arabicToLetter(e);break;case t.PdfNumberStyle.UpperRoman:r=this.arabicToRoman(e)}return r},e.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M");e+=i.returnValue,t=i.intArabic;var r=this.generateNumber(t,900,"CM");e+=r.returnValue,t=r.intArabic;var n=this.generateNumber(t,500,"D");e+=n.returnValue,t=n.intArabic;var o=this.generateNumber(t,400,"CD");e+=o.returnValue,t=o.intArabic;var s=this.generateNumber(t,100,"C");e+=s.returnValue,t=s.intArabic;var a=this.generateNumber(t,90,"XC");e+=a.returnValue,t=a.intArabic;var h=this.generateNumber(t,50,"L");e+=h.returnValue,t=h.intArabic;var l=this.generateNumber(t,40,"XL");e+=l.returnValue,t=l.intArabic;var u=this.generateNumber(t,10,"X");e+=u.returnValue,t=u.intArabic;var c=this.generateNumber(t,9,"IX");e+=c.returnValue,t=c.intArabic;var p=this.generateNumber(t,5,"V");e+=p.returnValue,t=p.intArabic;var d=this.generateNumber(t,4,"IV");e+=d.returnValue,t=d.intArabic;var f=this.generateNumber(t,1,"I");return e+=f.returnValue,t=f.intArabic,e.toString()},e.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";e.length>0;){var r=e.pop();i=this.appendChar(i,r)}return i.toString()},e.generateNumber=function(t,e,i){for(var r="";t>=e;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},e.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},e.appendChar=function(t,i){return t+=String.fromCharCode(e.acsiiStartIndex+i)},e.letterLimit=26,e.acsiiStartIndex=64,e}(),$e=function(){function t(t,e){this.pdfTemplate=null,this.content="",void 0===t||(this.template=t,this.value=e)}return Object.defineProperty(t.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),t}(),Qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ti=function(t){function e(){var e=t.call(this)||this;return e.list=new rt,e}return Qe(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getValue(e),s=new Yt(this.getSize());this.list.setValue(e,new $e(s,o));var a=this.getSize();s.graphics.drawString(o,this.getFont(),this.pen,this.getBrush(),0,0,a.width,a.height,this.stringFormat);var h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(s,h,new j(s.width*r,s.height*n))},e}(ht),ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ii=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ei(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t);return this.internalGetValue(e)},i.prototype.internalGetValue=function(t){var e=t.document.pages.indexOf(t)+1;return Ze.convert(e,this.numberStyle)},i}(ti),ri=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ni=function(t){function e(e,i,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var s=t.call(this)||this;return s.internalAutomaticFields=null,s.internalText="",s.font=e,s.brush=i,s.text=r,s.automaticFields=n,s}return ri(e,t),Object.defineProperty(e.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&this.automaticFields.length>0)for(var i=0;i<this.automaticFields.length;i++){var r=this.automaticFields[i];e=e.replace("{"+i+"}",r.getValue(t))}return e},e}(ti),oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),si=function(t){function e(){var e=t.call(this)||this;return e.list=new rt,e.painterGraphics=[],e}return oi(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getPageFromGraphics(e).document,s=this.getValue(e);if(this.list.containsKey(o)){var a=this.list.getValue(o),h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(a.template,h,new j(a.template.width*r,a.template.height*n)),this.painterGraphics.push(e)}else{var l=this.getSize(),u=new Yt(l);this.list.setValue(o,new $e(u,s)),u.graphics.drawString(s,this.getFont(),this.pen,this.getBrush(),0,0,l.width,l.height,this.stringFormat);h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(u,h,new j(u.width*r,u.height*n)),this.painterGraphics.push(e)}},e}(ht),ai=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hi=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ai(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t).section.parent.document.pages.count;return Ze.convert(e,this.numberStyle)},i}(si);!function(t){t[t.Location=0]="Location",t[t.FitToPage=1]="FitToPage",t[t.FitR=2]="FitR"}(t.PdfDestinationMode||(t.PdfDestinationMode={}));var li,ui=function(){function e(e,i){this.dictionaryProperties=new a,this.destinationMode=t.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new T(0,0),this.bounds=new k,this.array=new m;t.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new T(0,this.destinationLocation.y),this.pdfPage=e,i instanceof T?this.destinationLocation=i:this.bounds=i}return Object.defineProperty(e.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),e.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},e.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new C(this.pdfPage)),this.destinationMode){case t.PdfDestinationMode.Location:var e=this.pdfPage,i=new T;i=this.pointToNativePdf(e,this.destinationLocation),this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new g(i.x)),this.array.add(new g(i.y)),this.array.add(new g(this.zoomFactor));break;case t.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(e.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0}),e}(),ci=function(){function t(t){this.mDictionary=null,this.mDictionaryProperties=new a,this.mDictionary=t}return Object.defineProperty(t.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),t}(),pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),di=function(t){function e(e,i,r,n){var o=t.call(this,new b)||this;return void 0===e?o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)):(o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)),o.checkParams(e,i,r,n),o.setDomainAndRange(e,i),o.setSizeAndValues(r,n)),o}return pi(e,t),e.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},e.prototype.setDomainAndRange=function(t,e){this.domain=new m(t),this.range=new m(e)},e.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;this.dictionary.items.setValue(this.mDictionaryProperties.size,new m(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new g(8)),i.writeBytes(e)},e}(ci);!function(t){t[t.None=0]="None",t[t.Start=1]="Start",t[t.End=2]="End",t[t.Both=3]="Both"}(li||(li={}));var fi;!function(t){t[t.BackwardDiagonal=0]="BackwardDiagonal",t[t.ForwardDiagonal=1]="ForwardDiagonal",t[t.Horizontal=2]="Horizontal",t[t.Vertical=3]="Vertical"}(fi||(fi={}));var gi;!function(t){t[t.Function=1]="Function",t[t.Axial=2]="Axial",t[t.Radial=3]="Radial"}(gi||(gi={}));var mi;!function(t){t[t.ActiveBorder=1]="ActiveBorder",t[t.ActiveCaption=2]="ActiveCaption",t[t.ActiveCaptionText=3]="ActiveCaptionText",t[t.AppWorkspace=4]="AppWorkspace",t[t.Control=5]="Control",t[t.ControlDark=6]="ControlDark",t[t.ControlDarkDark=7]="ControlDarkDark",t[t.ControlLight=8]="ControlLight",t[t.ControlLightLight=9]="ControlLightLight",t[t.ControlText=10]="ControlText",t[t.Desktop=11]="Desktop",t[t.GrayText=12]="GrayText",t[t.Highlight=13]="Highlight",t[t.HighlightText=14]="HighlightText",t[t.HotTrack=15]="HotTrack",t[t.InactiveBorder=16]="InactiveBorder",t[t.InactiveCaption=17]="InactiveCaption",t[t.InactiveCaptionText=18]="InactiveCaptionText",t[t.Info=19]="Info",t[t.InfoText=20]="InfoText",t[t.Menu=21]="Menu",t[t.MenuText=22]="MenuText",t[t.ScrollBar=23]="ScrollBar",t[t.Window=24]="Window",t[t.WindowFrame=25]="WindowFrame",t[t.WindowText=26]="WindowText",t[t.Transparent=27]="Transparent",t[t.AliceBlue=28]="AliceBlue",t[t.AntiqueWhite=29]="AntiqueWhite",t[t.Aqua=30]="Aqua",t[t.Aquamarine=31]="Aquamarine",t[t.Azure=32]="Azure",t[t.Beige=33]="Beige",t[t.Bisque=34]="Bisque",t[t.Black=35]="Black",t[t.BlanchedAlmond=36]="BlanchedAlmond",t[t.Blue=37]="Blue",t[t.BlueViolet=38]="BlueViolet",t[t.Brown=39]="Brown",t[t.BurlyWood=40]="BurlyWood",t[t.CadetBlue=41]="CadetBlue",t[t.Chartreuse=42]="Chartreuse",t[t.Chocolate=43]="Chocolate",t[t.Coral=44]="Coral",t[t.CornflowerBlue=45]="CornflowerBlue",t[t.Cornsilk=46]="Cornsilk",t[t.Crimson=47]="Crimson",t[t.Cyan=48]="Cyan",t[t.DarkBlue=49]="DarkBlue",t[t.DarkCyan=50]="DarkCyan",t[t.DarkGoldenrod=51]="DarkGoldenrod",t[t.DarkGray=52]="DarkGray",t[t.DarkGreen=53]="DarkGreen",t[t.DarkKhaki=54]="DarkKhaki",t[t.DarkMagenta=55]="DarkMagenta",t[t.DarkOliveGreen=56]="DarkOliveGreen",t[t.DarkOrange=57]="DarkOrange",t[t.DarkOrchid=58]="DarkOrchid",t[t.DarkRed=59]="DarkRed",t[t.DarkSalmon=60]="DarkSalmon",t[t.DarkSeaGreen=61]="DarkSeaGreen",t[t.DarkSlateBlue=62]="DarkSlateBlue",t[t.DarkSlateGray=63]="DarkSlateGray",t[t.DarkTurquoise=64]="DarkTurquoise",t[t.DarkViolet=65]="DarkViolet",t[t.DeepPink=66]="DeepPink",t[t.DeepSkyBlue=67]="DeepSkyBlue",t[t.DimGray=68]="DimGray",t[t.DodgerBlue=69]="DodgerBlue",t[t.Firebrick=70]="Firebrick",t[t.FloralWhite=71]="FloralWhite",t[t.ForestGreen=72]="ForestGreen",t[t.Fuchsia=73]="Fuchsia",t[t.Gainsboro=74]="Gainsboro",t[t.GhostWhite=75]="GhostWhite",t[t.Gold=76]="Gold",t[t.Goldenrod=77]="Goldenrod",t[t.Gray=78]="Gray",t[t.Green=79]="Green",t[t.GreenYellow=80]="GreenYellow",t[t.Honeydew=81]="Honeydew",t[t.HotPink=82]="HotPink",t[t.IndianRed=83]="IndianRed",t[t.Indigo=84]="Indigo",t[t.Ivory=85]="Ivory",t[t.Khaki=86]="Khaki",t[t.Lavender=87]="Lavender",t[t.LavenderBlush=88]="LavenderBlush",t[t.LawnGreen=89]="LawnGreen",t[t.LemonChiffon=90]="LemonChiffon",t[t.LightBlue=91]="LightBlue",t[t.LightCoral=92]="LightCoral",t[t.LightCyan=93]="LightCyan",t[t.LightGoldenrodYellow=94]="LightGoldenrodYellow",t[t.LightGray=95]="LightGray",t[t.LightGreen=96]="LightGreen",t[t.LightPink=97]="LightPink",t[t.LightSalmon=98]="LightSalmon",t[t.LightSeaGreen=99]="LightSeaGreen",t[t.LightSkyBlue=100]="LightSkyBlue",t[t.LightSlateGray=101]="LightSlateGray",t[t.LightSteelBlue=102]="LightSteelBlue",t[t.LightYellow=103]="LightYellow",t[t.Lime=104]="Lime",t[t.LimeGreen=105]="LimeGreen",t[t.Linen=106]="Linen",t[t.Magenta=107]="Magenta",t[t.Maroon=108]="Maroon",t[t.MediumAquamarine=109]="MediumAquamarine",t[t.MediumBlue=110]="MediumBlue",t[t.MediumOrchid=111]="MediumOrchid",t[t.MediumPurple=112]="MediumPurple",t[t.MediumSeaGreen=113]="MediumSeaGreen",t[t.MediumSlateBlue=114]="MediumSlateBlue",t[t.MediumSpringGreen=115]="MediumSpringGreen",t[t.MediumTurquoise=116]="MediumTurquoise",t[t.MediumVioletRed=117]="MediumVioletRed",t[t.MidnightBlue=118]="MidnightBlue",t[t.MintCream=119]="MintCream",t[t.MistyRose=120]="MistyRose",t[t.Moccasin=121]="Moccasin",t[t.NavajoWhite=122]="NavajoWhite",t[t.Navy=123]="Navy",t[t.OldLace=124]="OldLace",t[t.Olive=125]="Olive",t[t.OliveDrab=126]="OliveDrab",t[t.Orange=127]="Orange",t[t.OrangeRed=128]="OrangeRed",t[t.Orchid=129]="Orchid",t[t.PaleGoldenrod=130]="PaleGoldenrod",t[t.PaleGreen=131]="PaleGreen",t[t.PaleTurquoise=132]="PaleTurquoise",t[t.PaleVioletRed=133]="PaleVioletRed",t[t.PapayaWhip=134]="PapayaWhip",t[t.PeachPuff=135]="PeachPuff",t[t.Peru=136]="Peru",t[t.Pink=137]="Pink",t[t.Plum=138]="Plum",t[t.PowderBlue=139]="PowderBlue",t[t.Purple=140]="Purple",t[t.Red=141]="Red",t[t.RosyBrown=142]="RosyBrown",t[t.RoyalBlue=143]="RoyalBlue",t[t.SaddleBrown=144]="SaddleBrown",t[t.Salmon=145]="Salmon",t[t.SandyBrown=146]="SandyBrown",t[t.SeaGreen=147]="SeaGreen",t[t.SeaShell=148]="SeaShell",t[t.Sienna=149]="Sienna",t[t.Silver=150]="Silver",t[t.SkyBlue=151]="SkyBlue",t[t.SlateBlue=152]="SlateBlue",t[t.SlateGray=153]="SlateGray",t[t.Snow=154]="Snow",t[t.SpringGreen=155]="SpringGreen",t[t.SteelBlue=156]="SteelBlue",t[t.Tan=157]="Tan",t[t.Teal=158]="Teal",t[t.Thistle=159]="Thistle",t[t.Tomato=160]="Tomato",t[t.Turquoise=161]="Turquoise",t[t.Violet=162]="Violet",t[t.Wheat=163]="Wheat",t[t.White=164]="White",t[t.WhiteSmoke=165]="WhiteSmoke",t[t.Yellow=166]="Yellow",t[t.YellowGreen=167]="YellowGreen",t[t.ButtonFace=168]="ButtonFace",t[t.ButtonHighlight=169]="ButtonHighlight",t[t.ButtonShadow=170]="ButtonShadow",t[t.GradientActiveCaption=171]="GradientActiveCaption",t[t.GradientInactiveCaption=172]="GradientInactiveCaption",t[t.MenuBar=173]="MenuBar",t[t.MenuHighlight=174]="MenuHighlight"}(mi||(mi={}));var yi=function(){function t(){}return Object.defineProperty(t,"AliceBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.AliceBlue)&&(t=this.sBrushes.getValue(mi.AliceBlue)),null==t&&(t=this.getBrush(mi.AliceBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AntiqueWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.AntiqueWhite)&&(t=this.sBrushes.getValue(mi.AntiqueWhite)),null==t&&(t=this.getBrush(mi.AntiqueWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aqua",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Aqua)&&(t=this.sBrushes.getValue(mi.Aqua)),null==t&&(t=this.getBrush(mi.Aqua)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Aquamarine)&&(t=this.sBrushes.getValue(mi.Aquamarine)),null==t&&(t=this.getBrush(mi.Aquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Azure",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Azure)&&(t=this.sBrushes.getValue(mi.Azure)),null==t&&(t=this.getBrush(mi.Azure)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Beige",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Beige)&&(t=this.sBrushes.getValue(mi.Beige)),null==t&&(t=this.getBrush(mi.Beige)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Bisque",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Bisque)&&(t=this.sBrushes.getValue(mi.Bisque)),null==t&&(t=this.getBrush(mi.Bisque)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Black",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Black)&&(t=this.sBrushes.getValue(mi.Black)),null==t&&(t=this.getBrush(mi.Black)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlanchedAlmond",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BlanchedAlmond)&&(t=this.sBrushes.getValue(mi.BlanchedAlmond)),null==t&&(t=this.getBrush(mi.BlanchedAlmond)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Blue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Blue)&&(t=this.sBrushes.getValue(mi.Blue)),null==t&&(t=this.getBrush(mi.Blue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlueViolet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BlueViolet)&&(t=this.sBrushes.getValue(mi.BlueViolet)),null==t&&(t=this.getBrush(mi.BlueViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Brown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Brown)&&(t=this.sBrushes.getValue(mi.Brown)),null==t&&(t=this.getBrush(mi.Brown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BurlyWood",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BurlyWood)&&(t=this.sBrushes.getValue(mi.BurlyWood)),null==t&&(t=this.getBrush(mi.BurlyWood)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CadetBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.CadetBlue)&&(t=this.sBrushes.getValue(mi.CadetBlue)),null==t&&(t=this.getBrush(mi.CadetBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chartreuse",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Chartreuse)&&(t=this.sBrushes.getValue(mi.Chartreuse)),null==t&&(t=this.getBrush(mi.Chartreuse)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chocolate",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Chocolate)&&(t=this.sBrushes.getValue(mi.Chocolate)),null==t&&(t=this.getBrush(mi.Chocolate)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Coral",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Coral)&&(t=this.sBrushes.getValue(mi.Coral)),null==t&&(t=this.getBrush(mi.Coral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CornflowerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.CornflowerBlue)&&(t=this.sBrushes.getValue(mi.CornflowerBlue)),null==t&&(t=this.getBrush(mi.CornflowerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cornsilk",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Cornsilk)&&(t=this.sBrushes.getValue(mi.Cornsilk)),null==t&&(t=this.getBrush(mi.Cornsilk)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Crimson",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Crimson)&&(t=this.sBrushes.getValue(mi.Crimson)),null==t&&(t=this.getBrush(mi.Crimson)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Cyan)&&(t=this.sBrushes.getValue(mi.Cyan)),null==t&&(t=this.getBrush(mi.Cyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkBlue)&&(t=this.sBrushes.getValue(mi.DarkBlue)),null==t&&(t=this.getBrush(mi.DarkBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkCyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkCyan)&&(t=this.sBrushes.getValue(mi.DarkCyan)),null==t&&(t=this.getBrush(mi.DarkCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGoldenrod)&&(t=this.sBrushes.getValue(mi.DarkGoldenrod)),null==t&&(t=this.getBrush(mi.DarkGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGray)&&(t=this.sBrushes.getValue(mi.DarkGray)),null==t&&(t=this.getBrush(mi.DarkGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGreen)&&(t=this.sBrushes.getValue(mi.DarkGreen)),null==t&&(t=this.getBrush(mi.DarkGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkKhaki",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkKhaki)&&(t=this.sBrushes.getValue(mi.DarkKhaki)),null==t&&(t=this.getBrush(mi.DarkKhaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkMagenta",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkMagenta)&&(t=this.sBrushes.getValue(mi.DarkMagenta)),null==t&&(t=this.getBrush(mi.DarkMagenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOliveGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOliveGreen)&&(t=this.sBrushes.getValue(mi.DarkOliveGreen)),null==t&&(t=this.getBrush(mi.DarkOliveGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrange",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOrange)&&(t=this.sBrushes.getValue(mi.DarkOrange)),null==t&&(t=this.getBrush(mi.DarkOrange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOrchid)&&(t=this.sBrushes.getValue(mi.DarkOrchid)),null==t&&(t=this.getBrush(mi.DarkOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkRed)&&(t=this.sBrushes.getValue(mi.DarkRed)),null==t&&(t=this.getBrush(mi.DarkRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSalmon)&&(t=this.sBrushes.getValue(mi.DarkSalmon)),null==t&&(t=this.getBrush(mi.DarkSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSeaGreen)&&(t=this.sBrushes.getValue(mi.DarkSeaGreen)),null==t&&(t=this.getBrush(mi.DarkSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSlateBlue)&&(t=this.sBrushes.getValue(mi.DarkSlateBlue)),null==t&&(t=this.getBrush(mi.DarkSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSlateGray)&&(t=this.sBrushes.getValue(mi.DarkSlateGray)),null==t&&(t=this.getBrush(mi.DarkSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkTurquoise)&&(t=this.sBrushes.getValue(mi.DarkTurquoise)),null==t&&(t=this.getBrush(mi.DarkTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkViolet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkViolet)&&(t=this.sBrushes.getValue(mi.DarkViolet)),null==t&&(t=this.getBrush(mi.DarkViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DeepPink)&&(t=this.sBrushes.getValue(mi.DeepPink)),null==t&&(t=this.getBrush(mi.DeepPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DeepSkyBlue)&&(t=this.sBrushes.getValue(mi.DeepSkyBlue)),null==t&&(t=this.getBrush(mi.DeepSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DimGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DimGray)&&(t=this.sBrushes.getValue(mi.DimGray)),null==t&&(t=this.getBrush(mi.DimGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DodgerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DodgerBlue)&&(t=this.sBrushes.getValue(mi.DodgerBlue)),null==t&&(t=this.getBrush(mi.DodgerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Firebrick",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Firebrick)&&(t=this.sBrushes.getValue(mi.Firebrick)),null==t&&(t=this.getBrush(mi.Firebrick)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FloralWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.FloralWhite)&&(t=this.sBrushes.getValue(mi.FloralWhite)),null==t&&(t=this.getBrush(mi.FloralWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ForestGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.ForestGreen)&&(t=this.sBrushes.getValue(mi.ForestGreen)),null==t&&(t=this.getBrush(mi.ForestGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Fuchsia",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Fuchsia)&&(t=this.sBrushes.getValue(mi.Fuchsia)),null==t&&(t=this.getBrush(mi.Fuchsia)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gainsboro",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gainsboro)&&(t=this.sBrushes.getValue(mi.Gainsboro)),null==t&&(t=this.getBrush(mi.Gainsboro)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GhostWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.GhostWhite)&&(t=this.sBrushes.getValue(mi.GhostWhite)),null==t&&(t=this.getBrush(mi.GhostWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gold",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gold)&&(t=this.sBrushes.getValue(mi.Gold)),null==t&&(t=this.getBrush(mi.Gold)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Goldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Goldenrod)&&(t=this.sBrushes.getValue(mi.Goldenrod)),null==t&&(t=this.getBrush(mi.Goldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gray)&&(t=this.sBrushes.getValue(mi.Gray)),null==t&&(t=this.getBrush(mi.Gray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Green",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Green)&&(t=this.sBrushes.getValue(mi.Green)),null==t&&(t=this.getBrush(mi.Green)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GreenYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.GreenYellow)&&(t=this.sBrushes.getValue(mi.GreenYellow)),null==t&&(t=this.getBrush(mi.GreenYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Honeydew",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Honeydew)&&(t=this.sBrushes.getValue(mi.Honeydew)),null==t&&(t=this.getBrush(mi.Honeydew)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"HotPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.HotPink)&&(t=this.sBrushes.getValue(mi.HotPink)),null==t&&(t=this.getBrush(mi.HotPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IndianRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.IndianRed)&&(t=this.sBrushes.getValue(mi.IndianRed)),null==t&&(t=this.getBrush(mi.IndianRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Indigo",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Indigo)&&(t=this.sBrushes.getValue(mi.Indigo)),null==t&&(t=this.getBrush(mi.Indigo)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Ivory",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Ivory)&&(t=this.sBrushes.getValue(mi.Ivory)),null==t&&(t=this.getBrush(mi.Ivory)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Khaki",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Khaki)&&(t=this.sBrushes.getValue(mi.Khaki)),null==t&&(t=this.getBrush(mi.Khaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lavender",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Lavender)&&(t=this.sBrushes.getValue(mi.Lavender)),null==t&&(t=this.getBrush(mi.Lavender)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LavenderBlush",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LavenderBlush)&&(t=this.sBrushes.getValue(mi.LavenderBlush)),null==t&&(t=this.getBrush(mi.LavenderBlush)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LawnGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LawnGreen)&&(t=this.sBrushes.getValue(mi.LawnGreen)),null==t&&(t=this.getBrush(mi.LawnGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LemonChiffon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LemonChiffon)&&(t=this.sBrushes.getValue(mi.LemonChiffon)),null==t&&(t=this.getBrush(mi.LemonChiffon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightBlue)&&(t=this.sBrushes.getValue(mi.LightBlue)),null==t&&(t=this.getBrush(mi.LightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCoral",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightCoral)&&(t=this.sBrushes.getValue(mi.LightCoral)),null==t&&(t=this.getBrush(mi.LightCoral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightCyan)&&(t=this.sBrushes.getValue(mi.LightCyan)),null==t&&(t=this.getBrush(mi.LightCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGoldenrodYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGoldenrodYellow)&&(t=this.sBrushes.getValue(mi.LightGoldenrodYellow)),null==t&&(t=this.getBrush(mi.LightGoldenrodYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGray)&&(t=this.sBrushes.getValue(mi.LightGray)),null==t&&(t=this.getBrush(mi.LightGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGreen)&&(t=this.sBrushes.getValue(mi.LightGreen)),null==t&&(t=this.getBrush(mi.LightGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightPink)&&(t=this.sBrushes.getValue(mi.LightPink)),null==t&&(t=this.getBrush(mi.LightPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSalmon)&&(t=this.sBrushes.getValue(mi.LightSalmon)),null==t&&(t=this.getBrush(mi.LightSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSeaGreen)&&(t=this.sBrushes.getValue(mi.LightSeaGreen)),null==t&&(t=this.getBrush(mi.LightSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSkyBlue)&&(t=this.sBrushes.getValue(mi.LightSkyBlue)),null==t&&(t=this.getBrush(mi.LightSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSlateGray)&&(t=this.sBrushes.getValue(mi.LightSlateGray)),null==t&&(t=this.getBrush(mi.LightSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSteelBlue)&&(t=this.sBrushes.getValue(mi.LightSteelBlue)),null==t&&(t=this.getBrush(mi.LightSteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightYellow)&&(t=this.sBrushes.getValue(mi.LightYellow)),null==t&&(t=this.getBrush(mi.LightYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lime",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Lime)&&(t=this.sBrushes.getValue(mi.Lime)),null==t&&(t=this.getBrush(mi.Lime)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LimeGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LimeGreen)&&(t=this.sBrushes.getValue(mi.LimeGreen)),null==t&&(t=this.getBrush(mi.LimeGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Linen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Linen)&&(t=this.sBrushes.getValue(mi.Linen)),null==t&&(t=this.getBrush(mi.Linen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Magenta",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Magenta)&&(t=this.sBrushes.getValue(mi.Magenta)),null==t&&(t=this.getBrush(mi.Magenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Maroon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Maroon)&&(t=this.sBrushes.getValue(mi.Maroon)),null==t&&(t=this.getBrush(mi.Maroon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumAquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumAquamarine)&&(t=this.sBrushes.getValue(mi.MediumAquamarine)),null==t&&(t=this.getBrush(mi.MediumAquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumBlue)&&(t=this.sBrushes.getValue(mi.MediumBlue)),null==t&&(t=this.getBrush(mi.MediumBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumOrchid)&&(t=this.sBrushes.getValue(mi.MediumOrchid)),null==t&&(t=this.getBrush(mi.MediumOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumPurple",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumPurple)&&(t=this.sBrushes.getValue(mi.MediumPurple)),null==t&&(t=this.getBrush(mi.MediumPurple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSeaGreen)&&(t=this.sBrushes.getValue(mi.MediumSeaGreen)),null==t&&(t=this.getBrush(mi.MediumSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSlateBlue)&&(t=this.sBrushes.getValue(mi.MediumSlateBlue)),null==t&&(t=this.getBrush(mi.MediumSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSpringGreen)&&(t=this.sBrushes.getValue(mi.MediumSpringGreen)),null==t&&(t=this.getBrush(mi.MediumSpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumTurquoise)&&(t=this.sBrushes.getValue(mi.MediumTurquoise)),null==t&&(t=this.getBrush(mi.MediumTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumVioletRed)&&(t=this.sBrushes.getValue(mi.MediumVioletRed)),null==t&&(t=this.getBrush(mi.MediumVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MidnightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MidnightBlue)&&(t=this.sBrushes.getValue(mi.MidnightBlue)),null==t&&(t=this.getBrush(mi.MidnightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MintCream",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MintCream)&&(t=this.sBrushes.getValue(mi.MintCream)),null==t&&(t=this.getBrush(mi.MintCream)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MistyRose",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MistyRose)&&(t=this.sBrushes.getValue(mi.MistyRose)),null==t&&(t=this.getBrush(mi.MistyRose)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Moccasin",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Moccasin)&&(t=this.sBrushes.getValue(mi.Moccasin)),null==t&&(t=this.getBrush(mi.Moccasin)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"NavajoWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.NavajoWhite)&&(t=this.sBrushes.getValue(mi.NavajoWhite)),null==t&&(t=this.getBrush(mi.NavajoWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Navy",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Navy)&&(t=this.sBrushes.getValue(mi.Navy)),null==t&&(t=this.getBrush(mi.Navy)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OldLace",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OldLace)&&(t=this.sBrushes.getValue(mi.OldLace)),null==t&&(t=this.getBrush(mi.OldLace)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Olive",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Olive)&&(t=this.sBrushes.getValue(mi.Olive)),null==t&&(t=this.getBrush(mi.Olive)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OliveDrab",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OliveDrab)&&(t=this.sBrushes.getValue(mi.OliveDrab)),null==t&&(t=this.getBrush(mi.OliveDrab)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orange",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Orange)&&(t=this.sBrushes.getValue(mi.Orange)),null==t&&(t=this.getBrush(mi.Orange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OrangeRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OrangeRed)&&(t=this.sBrushes.getValue(mi.OrangeRed)),null==t&&(t=this.getBrush(mi.OrangeRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Orchid)&&(t=this.sBrushes.getValue(mi.Orchid)),null==t&&(t=this.getBrush(mi.Orchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleGoldenrod)&&(t=this.sBrushes.getValue(mi.PaleGoldenrod)),null==t&&(t=this.getBrush(mi.PaleGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleGreen)&&(t=this.sBrushes.getValue(mi.PaleGreen)),null==t&&(t=this.getBrush(mi.PaleGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleTurquoise)&&(t=this.sBrushes.getValue(mi.PaleTurquoise)),null==t&&(t=this.getBrush(mi.PaleTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleVioletRed)&&(t=this.sBrushes.getValue(mi.PaleVioletRed)),null==t&&(t=this.getBrush(mi.PaleVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PapayaWhip",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PapayaWhip)&&(t=this.sBrushes.getValue(mi.PapayaWhip)),null==t&&(t=this.getBrush(mi.PapayaWhip)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PeachPuff",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PeachPuff)&&(t=this.sBrushes.getValue(mi.PeachPuff)),null==t&&(t=this.getBrush(mi.PeachPuff)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Peru",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Peru)&&(t=this.sBrushes.getValue(mi.Peru)),null==t&&(t=this.getBrush(mi.Peru)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Pink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Pink)&&(t=this.sBrushes.getValue(mi.Pink)),null==t&&(t=this.getBrush(mi.Pink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Plum",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Plum)&&(t=this.sBrushes.getValue(mi.Plum)),null==t&&(t=this.getBrush(mi.Plum)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PowderBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PowderBlue)&&(t=this.sBrushes.getValue(mi.PowderBlue)),null==t&&(t=this.getBrush(mi.PowderBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Purple",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Purple)&&(t=this.sBrushes.getValue(mi.Purple)),null==t&&(t=this.getBrush(mi.Purple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Red",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Red)&&(t=this.sBrushes.getValue(mi.Red)),null==t&&(t=this.getBrush(mi.Red)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RosyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.RosyBrown)&&(t=this.sBrushes.getValue(mi.RosyBrown)),null==t&&(t=this.getBrush(mi.RosyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RoyalBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.RoyalBlue)&&(t=this.sBrushes.getValue(mi.RoyalBlue)),null==t&&(t=this.getBrush(mi.RoyalBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SaddleBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SaddleBrown)&&(t=this.sBrushes.getValue(mi.SaddleBrown)),null==t&&(t=this.getBrush(mi.SaddleBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Salmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Salmon)&&(t=this.sBrushes.getValue(mi.Salmon)),null==t&&(t=this.getBrush(mi.Salmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SandyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SandyBrown)&&(t=this.sBrushes.getValue(mi.SandyBrown)),null==t&&(t=this.getBrush(mi.SandyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SeaGreen)&&(t=this.sBrushes.getValue(mi.SeaGreen)),null==t&&(t=this.getBrush(mi.SeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaShell",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SeaShell)&&(t=this.sBrushes.getValue(mi.SeaShell)),null==t&&(t=this.getBrush(mi.SeaShell)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Sienna",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Sienna)&&(t=this.sBrushes.getValue(mi.Sienna)),null==t&&(t=this.getBrush(mi.Sienna)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Silver",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Silver)&&(t=this.sBrushes.getValue(mi.Silver)),null==t&&(t=this.getBrush(mi.Silver)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SkyBlue)&&(t=this.sBrushes.getValue(mi.SkyBlue)),null==t&&(t=this.getBrush(mi.SkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SlateBlue)&&(t=this.sBrushes.getValue(mi.SlateBlue)),null==t&&(t=this.getBrush(mi.SlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SlateGray)&&(t=this.sBrushes.getValue(mi.SlateGray)),null==t&&(t=this.getBrush(mi.SlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Snow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Snow)&&(t=this.sBrushes.getValue(mi.Snow)),null==t&&(t=this.getBrush(mi.Snow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SpringGreen)&&(t=this.sBrushes.getValue(mi.SpringGreen)),null==t&&(t=this.getBrush(mi.SpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SteelBlue)&&(t=this.sBrushes.getValue(mi.SteelBlue)),null==t&&(t=this.getBrush(mi.SteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Tan)&&(t=this.sBrushes.getValue(mi.Tan)),null==t&&(t=this.getBrush(mi.Tan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Teal",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Teal)&&(t=this.sBrushes.getValue(mi.Teal)),null==t&&(t=this.getBrush(mi.Teal)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Thistle",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Thistle)&&(t=this.sBrushes.getValue(mi.Thistle)),null==t&&(t=this.getBrush(mi.Thistle)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tomato",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Tomato)&&(t=this.sBrushes.getValue(mi.Tomato)),null==t&&(t=this.getBrush(mi.Tomato)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Transparent",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Transparent)&&(t=this.sBrushes.getValue(mi.Transparent)),null==t&&(t=this.getBrush(mi.Transparent)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Turquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Turquoise)&&(t=this.sBrushes.getValue(mi.Turquoise)),null==t&&(t=this.getBrush(mi.Turquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Violet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Violet)&&(t=this.sBrushes.getValue(mi.Violet)),null==t&&(t=this.getBrush(mi.Violet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Wheat",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Wheat)&&(t=this.sBrushes.getValue(mi.Wheat)),null==t&&(t=this.getBrush(mi.Wheat)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"White",{get:function(){var t=null;return this.sBrushes.containsKey(mi.White)&&(t=this.sBrushes.getValue(mi.White)),null==t&&(t=this.getBrush(mi.White)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WhiteSmoke",{get:function(){var t=null;return this.sBrushes.containsKey(mi.WhiteSmoke)&&(t=this.sBrushes.getValue(mi.WhiteSmoke)),null==t&&(t=this.getBrush(mi.WhiteSmoke)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Yellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Yellow)&&(t=this.sBrushes.getValue(mi.Yellow)),null==t&&(t=this.getBrush(mi.Yellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"YellowGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.YellowGreen)&&(t=this.sBrushes.getValue(mi.YellowGreen)),null==t&&(t=this.getBrush(mi.YellowGreen)),t},enumerable:!0,configurable:!0}),t.getBrush=function(t){var e=this.getColorValue(t),i=new A(e);return this.sBrushes.setValue(t,i),i},t.getColorValue=function(t){var e=new L;switch(t){case mi.Transparent:e=new L(0,255,255,255);break;case mi.AliceBlue:e=new L(255,240,248,255);break;case mi.AntiqueWhite:e=new L(255,250,235,215);break;case mi.Aqua:e=new L(255,0,255,255);break;case mi.Aquamarine:e=new L(255,127,255,212);break;case mi.Azure:e=new L(255,240,255,255);break;case mi.Beige:e=new L(255,245,245,220);break;case mi.Bisque:e=new L(255,255,228,196);break;case mi.Black:e=new L(255,0,0,0);break;case mi.BlanchedAlmond:e=new L(255,255,235,205);break;case mi.Blue:e=new L(255,0,0,255);break;case mi.BlueViolet:e=new L(255,138,43,226);break;case mi.Brown:e=new L(255,165,42,42);break;case mi.BurlyWood:e=new L(255,222,184,135);break;case mi.CadetBlue:e=new L(255,95,158,160);break;case mi.Chartreuse:e=new L(255,127,255,0);break;case mi.Chocolate:e=new L(255,210,105,30);break;case mi.Coral:e=new L(255,255,127,80);break;case mi.CornflowerBlue:e=new L(255,100,149,237);break;case mi.Cornsilk:e=new L(255,255,248,220);break;case mi.Crimson:e=new L(255,220,20,60);break;case mi.Cyan:e=new L(255,0,255,255);break;case mi.DarkBlue:e=new L(255,0,0,139);break;case mi.DarkCyan:e=new L(255,0,139,139);break;case mi.DarkGoldenrod:e=new L(255,184,134,11);break;case mi.DarkGray:e=new L(255,169,169,169);break;case mi.DarkGreen:e=new L(255,0,100,0);break;case mi.DarkKhaki:e=new L(255,189,183,107);break;case mi.DarkMagenta:e=new L(255,139,0,139);break;case mi.DarkOliveGreen:e=new L(255,85,107,47);break;case mi.DarkOrange:e=new L(255,255,140,0);break;case mi.DarkOrchid:e=new L(255,153,50,204);break;case mi.DarkRed:e=new L(255,139,0,0);break;case mi.DarkSalmon:e=new L(255,233,150,122);break;case mi.DarkSeaGreen:e=new L(255,143,188,139);break;case mi.DarkSlateBlue:e=new L(255,72,61,139);break;case mi.DarkSlateGray:e=new L(255,47,79,79);break;case mi.DarkTurquoise:e=new L(255,0,206,209);break;case mi.DarkViolet:e=new L(255,148,0,211);break;case mi.DeepPink:e=new L(255,255,20,147);break;case mi.DeepSkyBlue:e=new L(255,0,191,255);break;case mi.DimGray:e=new L(255,105,105,105);break;case mi.DodgerBlue:e=new L(255,30,144,255);break;case mi.Firebrick:e=new L(255,178,34,34);break;case mi.FloralWhite:e=new L(255,255,250,240);break;case mi.ForestGreen:e=new L(255,34,139,34);break;case mi.Fuchsia:e=new L(255,255,0,255);break;case mi.Gainsboro:e=new L(255,220,220,220);break;case mi.GhostWhite:e=new L(255,248,248,255);break;case mi.Gold:e=new L(255,255,215,0);break;case mi.Goldenrod:e=new L(255,218,165,32);break;case mi.Gray:e=new L(255,128,128,128);break;case mi.Green:e=new L(255,0,128,0);break;case mi.GreenYellow:e=new L(255,173,255,47);break;case mi.Honeydew:e=new L(255,240,255,240);break;case mi.HotPink:e=new L(255,255,105,180);break;case mi.IndianRed:e=new L(255,205,92,92);break;case mi.Indigo:e=new L(255,75,0,130);break;case mi.Ivory:e=new L(255,255,255,240);break;case mi.Khaki:e=new L(255,240,230,140);break;case mi.Lavender:e=new L(255,230,230,250);break;case mi.LavenderBlush:e=new L(255,255,240,245);break;case mi.LawnGreen:e=new L(255,124,252,0);break;case mi.LemonChiffon:e=new L(255,255,250,205);break;case mi.LightBlue:e=new L(255,173,216,230);break;case mi.LightCoral:e=new L(255,240,128,128);break;case mi.LightCyan:e=new L(255,224,255,255);break;case mi.LightGoldenrodYellow:e=new L(255,250,250,210);break;case mi.LightGreen:e=new L(255,144,238,144);break;case mi.LightGray:e=new L(255,211,211,211);break;case mi.LightPink:e=new L(255,255,182,193);break;case mi.LightSalmon:e=new L(255,255,160,122);break;case mi.LightSeaGreen:e=new L(255,32,178,170);break;case mi.LightSkyBlue:e=new L(255,135,206,250);break;case mi.LightSlateGray:e=new L(255,119,136,153);break;case mi.LightSteelBlue:e=new L(255,176,196,222);break;case mi.LightYellow:e=new L(255,255,255,224);break;case mi.Lime:e=new L(255,0,255,0);break;case mi.LimeGreen:e=new L(255,50,205,50);break;case mi.Linen:e=new L(255,250,240,230);break;case mi.Magenta:e=new L(255,255,0,255);break;case mi.Maroon:e=new L(255,128,0,0);break;case mi.MediumAquamarine:e=new L(255,102,205,170);break;case mi.MediumBlue:e=new L(255,0,0,205);break;case mi.MediumOrchid:e=new L(255,186,85,211);break;case mi.MediumPurple:e=new L(255,147,112,219);break;case mi.MediumSeaGreen:e=new L(255,60,179,113);break;case mi.MediumSlateBlue:e=new L(255,123,104,238);break;case mi.MediumSpringGreen:e=new L(255,0,250,154);break;case mi.MediumTurquoise:e=new L(255,72,209,204);break;case mi.MediumVioletRed:e=new L(255,199,21,133);break;case mi.MidnightBlue:e=new L(255,25,25,112);break;case mi.MintCream:e=new L(255,245,255,250);break;case mi.MistyRose:e=new L(255,255,228,225);break;case mi.Moccasin:e=new L(255,255,228,181);break;case mi.NavajoWhite:e=new L(255,255,222,173);break;case mi.Navy:e=new L(255,0,0,128);break;case mi.OldLace:e=new L(255,253,245,230);break;case mi.Olive:e=new L(255,128,128,0);break;case mi.OliveDrab:e=new L(255,107,142,35);break;case mi.Orange:e=new L(255,255,165,0);break;case mi.OrangeRed:e=new L(255,255,69,0);break;case mi.Orchid:e=new L(255,218,112,214);break;case mi.PaleGoldenrod:e=new L(255,238,232,170);break;case mi.PaleGreen:e=new L(255,152,251,152);break;case mi.PaleTurquoise:e=new L(255,175,238,238);break;case mi.PaleVioletRed:e=new L(255,219,112,147);break;case mi.PapayaWhip:e=new L(255,255,239,213);break;case mi.PeachPuff:e=new L(255,255,218,185);break;case mi.Peru:e=new L(255,205,133,63);break;case mi.Pink:e=new L(255,255,192,203);break;case mi.Plum:e=new L(255,221,160,221);break;case mi.PowderBlue:e=new L(255,176,224,230);break;case mi.Purple:e=new L(255,128,0,128);break;case mi.Red:e=new L(255,255,0,0);break;case mi.RosyBrown:e=new L(255,188,143,143);break;case mi.RoyalBlue:e=new L(255,65,105,225);break;case mi.SaddleBrown:e=new L(255,139,69,19);break;case mi.Salmon:e=new L(255,250,128,114);break;case mi.SandyBrown:e=new L(255,244,164,96);break;case mi.SeaGreen:e=new L(255,46,139,87);break;case mi.SeaShell:e=new L(255,255,245,238);break;case mi.Sienna:e=new L(255,160,82,45);break;case mi.Silver:e=new L(255,192,192,192);break;case mi.SkyBlue:e=new L(255,135,206,235);break;case mi.SlateBlue:e=new L(255,106,90,205);break;case mi.SlateGray:e=new L(255,112,128,144);break;case mi.Snow:e=new L(255,255,250,250);break;case mi.SpringGreen:e=new L(255,0,255,127);break;case mi.SteelBlue:e=new L(255,70,130,180);break;case mi.Tan:e=new L(255,210,180,140);break;case mi.Teal:e=new L(255,0,128,128);break;case mi.Thistle:e=new L(255,216,191,216);break;case mi.Tomato:e=new L(255,255,99,71);break;case mi.Turquoise:e=new L(255,64,224,208);break;case mi.Violet:e=new L(255,238,130,238);break;case mi.Wheat:e=new L(255,245,222,179);break;case mi.White:e=new L(255,255,255,255);break;case mi.WhiteSmoke:e=new L(255,245,245,245);break;case mi.Yellow:e=new L(255,255,255,0);break;case mi.YellowGreen:e=new L(255,154,205,50)}return e},t.sBrushes=new n,t}(),bi=function(){function e(t){this.precision=1e3}return Object.defineProperty(e.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||e[i]>1)&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),e.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new Si(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else{var o=t[0],s=t[1];n=new Array(this.count);var a=0,h=this.count;for(a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e)}return i.positions=r,i.colors=n,i},e.prototype.clonePdfBlend=function(){var t=this;return null!=this.mFactors&&(t.factors=this.mFactors),null!=this.positions&&(t.positions=this.positions),t},e.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||t>1)throw new Error("ArgumentOutOfRangeException : u");if(e<0||e>1)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),r=Math.max(1,e*this.precision);return this.gcdInt(i,r)/this.precision}var n=t;if(null==n)throw new Error("ArgumentNullException : values");if(n.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var o=n[0];if(n.length>1)for(var s=n.length,a=1;a<s&&(o=this.gcd(n[a],o))!==1/this.precision;++a);return o},e.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i=0;this.isEven(t,e);)++i,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1;if(t>e){var r=e;e=t,t=r}e-=t}while(0!==e);return t<<i},e.prototype.isEven=function(t,e){if("number"==typeof e&&void 0!==e){var i=!0;return i=i&&(1&t)<=0,i=i&&(1&e)<=0}return(1&t)<=0},e.prototype.interpolate=function(e,i,r,n){if(i instanceof L){var o=new L;switch(n){case t.PdfColorSpace.Rgb:var s=this.interpolate(e,i.red,r.red),a=this.interpolate(e,i.green,r.green),h=this.interpolate(e,i.blue,r.blue);o=new L(s,a,h);break;case t.PdfColorSpace.GrayScale:var l=this.interpolate(e,i.gray,r.gray);o=new L(l);break;case t.PdfColorSpace.Cmyk:var u=this.interpolate(e,i.c,r.c),c=this.interpolate(e,i.m,r.m),p=this.interpolate(e,i.y,r.y),d=this.interpolate(e,i.k,r.k);o=new L(u,c,p,d)}return o}return 0===e?i:1===e?r:i+(r-i)/1*(e-0)},e}(),wi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Si=function(e){function i(t){var i=e.call(this)||this;return"number"==typeof t&&(i=e.call(this,t)||this),i}return wi(i,e),Object.defineProperty(i.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),i.prototype.getFunction=function(t){var e=[0,1],i=this.getColorComponentsCount(t),r=this.getMaxComponentValue(t),n=this.setRange(i,r),o=null;if(null==this.mbrush&&void 0===this.mbrush){var s=[1],a=void 0,h=1;if(2===this.positions.length)a=2;else{var l=this.positions,u=this.getIntervals(l),c=this.gcd(u);h=c,a=1/c+1}s[0]=a;var p=this.getSamplesValues(t,a,r,h);return o=new di(e,n,s,p)}return o},i.prototype.cloneColorBlend=function(){var t=this;return null!=this.mcolors&&void 0!==this.mcolors&&(t.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(t.positions=this.positions),t},i.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},i.prototype.getColorComponentsCount=function(e){var i=0;switch(e){case t.PdfColorSpace.Rgb:i=3;break;case t.PdfColorSpace.Cmyk:i=4;break;case t.PdfColorSpace.GrayScale:i=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return i},i.prototype.getSamplesValues=function(e,i,r,n){var o;switch(e){case t.PdfColorSpace.GrayScale:o=this.getGrayscaleSamples(i,r,n);break;case t.PdfColorSpace.Cmyk:o=this.getCmykSamples(i,r,n);break;case t.PdfColorSpace.Rgb:o=this.getRgbSamples(i,r,n);break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return o},i.prototype.getGrayscaleSamples=function(e,i,r){for(var n=[2*e],o=0;o<e;++o)this.getNextColor(o,r,t.PdfColorSpace.GrayScale);return n},i.prototype.getRgbSamples=function(e,i,r){for(var n=[3*e],o=0;o<e;++o){var s=this.getNextColor(o,r,t.PdfColorSpace.Rgb),a=3*o;n[a]=s.r,n[a+1]=s.g,n[a+2]=s.b}return n},i.prototype.getCmykSamples=function(e,i,r){for(var n=[4*e],o=0;o<e;o++){var s=this.getNextColor(o,r,t.PdfColorSpace.Cmyk),a=4*o;n[a]=s.c*i,n[a+1]=s.m*i,n[a+2]=s.y*i,n[a+3]=s.k*i}return n},i.prototype.getNextColor=function(t,e,i){var r,n,o,s=e*t,a=this.getIndices(s,n,r);if((n=a.indexLow)===(r=a.indexHi))o=this.mcolors[n];else{var h=this.positions[n],l=this.positions[r],u=this.mcolors[n],c=this.mcolors[r],p=(s-h)/(l-h);o=this.interpolate(p,u,c,i)}return o},i.prototype.getIndices=function(t,e,i){var r=this.positions;e=0,i=0;for(var n=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){i=n,e=n;break}if(o>t){i=n;break}e=n,i=n}return{indexLow:e,indexHi:i}},i.prototype.getMaxComponentValue=function(e){var i=0;switch(e){case t.PdfColorSpace.Cmyk:case t.PdfColorSpace.Rgb:i=255;break;case t.PdfColorSpace.GrayScale:i=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+"colorSpace")}return i},i.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i},i}(bi),Pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vi=function(e){function i(t,i,r,n){var o=e.call(this,new h)||this;if(o.mDictionaryProperties=new a,t instanceof T&&i instanceof T&&r instanceof L&&n instanceof L)o.initialize(r,n),o.mPointStart=t,o.mPointEnd=i,o.setPoints(o.mPointStart,o.mPointEnd);else if(t instanceof V)if(o.initialize(i,r),n===fi.BackwardDiagonal||n===fi.ForwardDiagonal||n===fi.Horizontal||n===fi.Vertical){switch(o.mBoundaries=t,n){case fi.BackwardDiagonal:o.mPointStart=new T(t.right,t.top),o.mPointEnd=new T(t.left,t.bottom);break;case fi.ForwardDiagonal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.bottom);break;case fi.Horizontal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);break;case fi.Vertical:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+n+" mode")}o.setPoints(o.mPointStart,o.mPointEnd)}else if("number"==typeof n&&void 0!==n){if(o.mBoundaries=t,0===(n%=360))o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);else if(90===n)o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);else if(180===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.right,t.top);else if(270===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.left,t.bottom);else{var s=n*(Math.PI/180),l=Math.tan(s),u=o.mBoundaries.left+(o.mBoundaries.right-o.mBoundaries.left)/2,c=o.mBoundaries.top+(o.mBoundaries.bottom-o.mBoundaries.top)/2,p=new T(u,c);c=l*(u=o.mBoundaries.width/(2*Math.cos(s))),u+=p.x,c+=p.y;var d=new T(u,c),f=o.subPoints(d,p),g=o.choosePoint(n),m=o.mulPoints(o.subPoints(g,p),f)/o.mulPoints(f,f);o.mPointEnd=o.addPoints(p,o.mulPoint(f,m)),o.mPointStart=o.addPoints(p,o.mulPoint(f,-1*m))}o.setPoints(o.mPointEnd,o.mPointStart)}return o}return Pi(i,e),i.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new Si(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new Si(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=li.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!=e){var i=e.items(0),r=e.items(1);i.value&&(t|=li.Start),r.value&&(t|=li.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new ct(!1),i=new ct(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.addPoints=function(t,e){var i=t.x+e.x,r=t.y+e.y;return new T(i,r)},i.prototype.subPoints=function(t,e){var i=t.x-e.x,r=t.y-e.y;return new T(i,r)},i.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},i.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},i.prototype.choosePoint=function(t){var e=new T(0,0);if(t<90&&t>0)e=new T(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&t>90)e=new T(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&t>180)e=new T(this.mBoundaries.left,this.mBoundaries.top);else{if(!(t>270))throw new Error("PdfException - Internal error.");e=new T(this.mBoundaries.right,this.mBoundaries.top)}return e},i.prototype.setPoints=function(t,e){var i=new m;i.add(new g(t.x)),i.add(new g(this.updateY(t.y))),i.add(new g(e.x)),i.add(new g(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(gi.Axial))},i.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new h(this.patternDictionary)),t.shading=new h,t.initShading(),t.setPoints(t.mPointStart,t.mPointEnd),null!==t&&t instanceof i&&null!=this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(t.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},i.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)},i}(qt),Ci=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bi=function(e){function i(t,i,r,n,o,s){var l=e.call(this,new h)||this;if(l.mDictionaryProperties=new a,l.initialize(o,s),i<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(n<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return l.mPointEnd=r,l.mPointStart=t,l.mRadiusStart=i,l.mRadiusEnd=n,l.setPoints(l.mPointStart,l.mPointEnd,l.mRadiusStart,l.mRadiusEnd),l}return Ci(i,e),i.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new Si(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new Si(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=m.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=li.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!==e&&void 0!==e){var i=e.items(0),r=e.items(1);i.value&&(t|=li.Start),r.value&&(t|=li.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new ct(!1),i=new ct(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t,e,i,r){var n=new m;n.add(new g(t.x)),n.add(new g(this.updateY(t.y))),n.add(new g(i)),n.add(new g(e.x)),n.add(new g(this.updateY(e.y))),i!==r?n.add(new g(r)):n.add(new g(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(gi.Radial))},i.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new h(this.patternDictionary)),t.shading=new h,t.initShading(),t.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),t instanceof i&&null!==this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(t.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},i.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)},i}(qt);!function(t){t[t.Overlap=0]="Overlap",t[t.Inside=1]="Inside"}(t.PdfBorderOverlapStyle||(t.PdfBorderOverlapStyle={}));var Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xi=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),t}(),Li=function(e){function i(){var i=e.call(this)||this;return i.gridBorderOverlapStyle=t.PdfBorderOverlapStyle.Overlap,i.bAllowHorizontalOverflow=!1,i.gridHorizontalOverflowType=t.PdfHorizontalOverflowType.LastPage,i}return Oi(i,e),Object.defineProperty(i.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new Ee),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding?(this.gridCellPadding=new Ee,this.gridCellPadding=t):this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0}),i}(xi),Ti=function(t){function e(){var e=t.call(this)||this;return e.gridCellBorders=Fe.default,e}return Oi(e,t),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new Ee),this.gridCellPadding=t},enumerable:!0,configurable:!0}),e}(xi),ji=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),t.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),t.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),t.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(t.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),t.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(t.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new Fe),this.gridRowBorder},enumerable:!0,configurable:!0}),t.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},t.prototype.setParent=function(t){this.parent=t},Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),t}();!function(t){t[t.NextPage=0]="NextPage",t[t.LastPage=1]="LastPage"}(t.PdfHorizontalOverflowType||(t.PdfHorizontalOverflowType={}));var ki=function(){function e(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}return Object.defineProperty(e.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new D),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Fi){this.row.grid.isSingleGrid=!1,this.objectValue.ParentCell=this,this.objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++)r.cells.getCell(o).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new Ti),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return(0===this.cellWidth||this.row.grid.isComplete)&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var t=0,e=new I;if("string"==typeof this.objectValue)t+=e.layout(this.objectValue,this.getTextFont(),this.stringFormat,new j(Number.MAX_VALUE,Number.MAX_VALUE),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width);else if(this.objectValue instanceof Fi)t=this.objectValue.size.width;else if(this.objectValue instanceof ft||this.objectValue instanceof mt)t+=this.objectValue.width;else if(this.objectValue instanceof Je){var i=this.objectValue;t+=e.layout(i.text,i.font,i.stringFormat,new j(0,0),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width)}return this.objectValue instanceof Fi?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(t+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(t+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?t+=this.style.cellPadding.left+this.style.cellPadding.right:t+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,t+=this.row.grid.style.cellSpacing},e.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();if(null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage){this.getBackgroundImage();t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height)}},e.prototype.adjustContentLayoutArea=function(t){var e=new k(t.x,t.y,t.width,t.height);return this.objectValue instanceof Fi?(null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.gridRow.grid.style.cellPadding.left&&this.gridRow.grid.style.cellPadding.hasLeftPad&&(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&this.gridRow.grid.style.cellPadding.hasTopPad&&(e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&this.gridRow.grid.style.cellPadding.hasRightPad&&(e.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&this.gridRow.grid.style.cellPadding.hasBottomPad&&(e.height-=this.gridRow.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e.height-=this.style.cellPadding.bottom)),e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):void 0===this.style.cellPadding||null==this.style.cellPadding?(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,e.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.style.cellPadding.right+this.style.cellPadding.left,e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width,1===this.rowSpan&&(e.width-=this.style.borders.left.width)),e},e.prototype.draw=function(e,i,r){var n=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return n;if(this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return n}i=this.adjustOuterLayoutArea(i,e),this.drawCellBackground(e,i);var o=this.getTextPen(),s=this.getTextBrush();void 0===o&&void 0===s&&(s=new A(new L(0,0,0)));var a=this.getTextFont(),h=this.getStringFormat(),l=i;if(l.height>=e.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(l.height-=l.y),l=this.adjustContentLayoutArea(l),"string"==typeof this.objectValue||"string"==typeof this.remaining){var u=void 0,c=void 0;if(c=l.height<a.height?new k(l.x,l.y,l.width,a.height):l,l.height<a.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell){var p=c.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom;-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),p>0&&p<a.height&&(c.height=p)}0!=this.gridRow.grid.style.cellSpacing&&(c.width-=this.gridRow.grid.style.cellSpacing,i.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(u=""===this.remaining?this.remaining:this.objectValue,e.drawString(u,a,o,s,c.x,c.y,c.width,c.height,h),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&e.drawString(this.remaining,a,o,s,c.x,c.y,c.width,c.height,h),this.isFinish=!0),n=e.stringLayoutResult}else if(this.objectValue instanceof Fi){var d=this.objectValue;d.isChildGrid=!0,d.ParentCell=this;var f=void 0;f=l,0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing);var g=new Gi(d),m=new Wi;null!=this.row.grid.LayoutFormat?m=this.row.grid.LayoutFormat:m.layout=t.PdfLayoutType.Paginate;var y=new Me;if(null!=e.layer){y.page=e.page,y.bounds=f,y.format=m,d.setSpan(),d.checkSpan();var b=g.Layouter(y);this.value=d,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),y.page!=b.page&&(b.bounds.height=this.row.rowBreakHeightValue,0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=b:this.row.rowBreakHeight=this.row.rowBreakHeightValue)}}else if(this.objectValue instanceof ft||this.objectValue instanceof mt){var w=void 0;w=this.objectValue.width<=l.width?new k(l.x,l.y,this.objectValue.width,l.height):l,e.drawImage(this.objectValue,w.x,w.y,w.width,w.height)}else this.objectValue instanceof Je?this.objectValue.draw(e.currentPage,l):void 0===this.objectValue&&(this.objectValue="",e.drawString(this.objectValue,a,o,s,l.x,l.y,l.width,l.height,h),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(i.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing));return null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(e,i)):this.drawCellBorders(e,i)),n},e.prototype.drawCellBorders=function(e,i){this.row.grid.style.borderOverlapStyle===t.PdfBorderOverlapStyle.Inside&&(i.x+=this.style.borders.left.width,i.y+=this.style.borders.top.width,i.width-=this.style.borders.right.width,i.height-=this.style.borders.bottom.width);var r=new T(i.x,i.y+i.height),n=new T(i.x,i.y),o=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y),n=new T(i.x+i.width,i.y+i.height),o=this.cellStyle.borders.right,i.x+i.width>e.clientSize.width-o.width/2&&(r=new T(e.clientSize.width-o.width/2,i.y),n=new T(e.clientSize.width-o.width/2,i.y+i.height)),this.cellStyle.borders.right.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x,i.y),n=new T(i.x+i.width,i.y),o=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y+i.height),n=new T(i.x,i.y+i.height),o=this.cellStyle.borders.bottom,i.y+i.height>e.clientSize.height-o.width/2&&(r=new T(i.x+i.width,e.clientSize.height-o.width/2),n=new T(i.x,e.clientSize.height-o.width/2)),this.cellStyle.borders.bottom.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n)},e.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing;r>0&&(t=new k(t.x+r,t.y+r,t.width-r,t.height-r));var n=this.row.cells.indexOf(this);if(this.columnSpan>1||this.row.rowOverflowIndex>0&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(l=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)l++;for(var s=0,a=n;a<n+l;a++){if(this.row.grid.style.allowHorizontalOverflow){var h=this.row.grid.size.width<e.clientSize.width?this.row.grid.size.width:e.clientSize.width;if((this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width)>h)break}s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(this.rowSpan>1||this.row.rowSpanExists){var l=this.rowSpan,u=this.row.grid.rows.rowCollection.indexOf(this.row);-1==u&&-1!=(u=this.row.grid.headers.indexOf(this.row))&&(i=!0);for(var c=0,a=u;a<u+l;a++){c+=i?this.row.grid.headers.getHeader(a).height:this.row.grid.rows.getRow(a).height;var p=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(p)}this.row.cells.indexOf(this);c-=this.row.grid.style.cellSpacing,t.height=c,this.row.rowMergeComplete||(t.height=c)}return t},e.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Ce.defaultFont},e.prototype.getTextBrush=function(){return void 0!==this.style.textBrush&&null!=this.style.textBrush?this.style.textBrush:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row.style.textBrush:this.row.grid.style.textBrush},e.prototype.getTextPen=function(){return void 0!==this.style.textPen&&null!=this.style.textPen?this.style.textPen:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row.style.textPen:this.row.grid.style.textPen},e.prototype.getBackgroundBrush=function(){return void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this.style.backgroundBrush:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row.style.backgroundBrush:this.row.grid.style.backgroundBrush},e.prototype.getBackgroundImage=function(){return void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this.style.backgroundImage:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row.style.backgroundImage:this.row.grid.style.backgroundImage},e.prototype.getStringFormat=function(){return void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style.stringFormat:this.stringFormat},e.prototype.measureHeight=function(){var t=this.calculateWidth();null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width);var e=0,i=new I;if("string"==typeof this.objectValue||"string"==typeof this.remaining){var r=this.objectValue;this.isFinish||(r=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue);n=this.row.cells.indexOf(this);0!=this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan||(this.gridRow.grid.isChildGrid?(t<0?(this.tempval=t,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=t,e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(this.tempval,0),!1,new j(0,0)).actualSize.height):e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else if(this.objectValue instanceof Fi){var n=this.row.cells.indexOf(this),o=0;null!=this.style.cellPadding||void 0!==this.style.cellPadding?(o=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(o-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(o-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(o=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(o-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(o-=this.row.grid.style.cellPadding.right)):o=this.calculateWidth(),this.objectValue.tempWidth=o,this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan?e+=2*(this.style.borders.top.width+this.style.borders.bottom.width):e=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(e+=this.row.grid.style.cellPadding.bottom)),e+=this.objectValue.style.cellSpacing}else if(this.objectValue instanceof ft||this.objectValue instanceof mt)e+=this.objectValue.height;else if(this.objectValue instanceof Je){var s=this.objectValue;e+=i.layout(s.text,s.font,s.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height,e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width));return this.objectValue instanceof Fi?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(e+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?e+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:e+=this.style.cellPadding.top+this.style.cellPadding.bottom,e+=this.row.grid.style.cellSpacing},e.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(e>1)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&this.parent.row.width>0&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){i=0;for(var n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i},e}(),Vi=function(){function t(t){this.cells=[],this.gridRow=t}return t.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new ki;return this.add(e),t}t.row=this.gridRow,this.cells.push(t)},t.prototype.indexOf=function(t){return this.cells.indexOf(t)},t}(),Ri=function(){function t(t){this.columnWidth=0,this.grid=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new D),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0}),t}(),Ni=function(){function t(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}return t.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Ri(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new ki;n.value="",r.cells.add(n)}}},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),t.prototype.getColumn=function(t){if(t>=0&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},t.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},t.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&t>=0&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,this.internalColumns[r].width>0&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++){var n=t/i;e[r]<=0&&(e[r]=n)}return e},t}(),Ai=function(){function t(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.pdfGrid=t}return Object.defineProperty(t.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new Vi(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new ji,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),t.prototype.measureHeight=function(){var t,e=0,i=0;t=this.cells.getCell(0).rowSpan>1?0:this.cells.getCell(0).height;for(var r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>e&&(e=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,n.rowSpan>1){for(var o=r,s=this.grid.rows.rowCollection.indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&(this.grid.rows.getRow(s+a+1).cells.getCell(o).hasRowSpan=!0);i<n.height&&(i=n.height)}else t=Math.max(t,n.height)}return i>t&&(t=i),0===t?t=i:e>0&&(t+=e),t},t.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++)t+=this.grid.columns.getColumn(e).width;return t},t}(),Di=function(){function t(t){this.rows=[],this.grid=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),t.prototype.addRow=function(t){if(void 0===t){var e=new Ai(this.grid);return this.addRow(e),e}if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new ki);this.rows.push(t)},t.prototype.getRow=function(t){return this.rows[t]},t}(),Mi=function(){function t(t){this.rows=[],this.grid=t,this.rows=[]}return t.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){e=new Ai(this.grid);for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new ki);this.rows.push(e)}return this.rows}this.rows.push(t)},t.prototype.indexOf=function(t){return this.rows.indexOf(t)},t}(),Ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fi=function(t){function e(){var e=t.call(this)||this;return e.gridSize=new j(0,0),e.isGridSplit=!1,e.isRearranged=!1,e.pageBounds=new k,e.listOfNavigatePages=[],e.parentCellIndex=0,e.tempWidth=0,e.breakRow=!0,e.splitChildRowIndex=-1,e.hasRowSpanSpan=!1,e.hasColumnSpan=!1,e.isSingleGrid=!0,e}return Ii(e,t),Object.defineProperty(e.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Ni(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Di(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Mi(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new Li),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return e instanceof k&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},e.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++)t+=(r=this.headers.getHeader(i)).height;for(i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);t+=r.height}return new j(e,t)},e.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},e.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},e.prototype.layout=function(t){if(0!==this.rows.count){var e=this.rows.getRow(0).cells.getCell(0).style;if(null!=e.borders&&(null!=e.borders.left&&1!==e.borders.left.width||null!=e.borders.top&&1!==e.borders.top.width)){var i=e.borders.left.width/2,r=e.borders.top.width/2;if(t.bounds.x===Fe.default.right.width/2&&t.bounds.y===Fe.default.right.width/2){var n=new k(i,r,this.gridSize.width,this.gridSize.height);t.bounds=n}}}return this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds,new Gi(this).Layouter(t)},e.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){var a=this.headers.getHeader(s);n=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(n=Math.max(n,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;e>1;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;t>1;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(e=u.rowSpan,r=s;e>1;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},e.prototype.checkSpan=function(){var t,e,i=1,r=0,n=0;if(t=i=1,e=n=0,this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){var a=this.rows.getRow(s);r=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(r=Math.max(r,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,i=u.rowSpan,e=l,n=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,a.cells.getCell(e).isRowMergeContinue=!0,t--;for(e=l,t=u.columnSpan;i>1;){for(n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,i--;t>1;)e++,this.rows.getRow(n).cells.getCell(e).isCellMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,t--;t=u.columnSpan,e=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,e=l,u.isCellMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(i=u.rowSpan,n=s;i>1;)n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,i--}}a.maximumRowSpan=r}},e.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n=0,o=0,s=this.columns.count,a=0;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(n+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(n+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)o+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(d=0;d<this.columns.count;d++)this.gridColumns.getColumn(d).width>0&&this.gridColumns.getColumn(d).isCustomWidth&&(o-=this.gridColumns.getColumn(d).width,s--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(n+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(n+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(o-=2*this.ParentCell.row.grid.style.cellSpacing),o>n&&(a=(o-n)/s,this.tempWidth=a,null!=this.ParentCell))for(d=0;d<this.columns.count;d++)this.columns.getColumn(d).isCustomWidth||(this.columns.getColumn(d).columnWidth=a)}}else{for(var e=[this.columns.count],h=0;h<this.columns.count;h++)e[h]=0;var l=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),this.headers.count>0)for(var u=this.headers.getHeader(0).cells.count,c=this.headers.count,i=0;i<u;i++){l=0;for(d=0;d<c;d++){f=Math.min(this.initialWidth,this.headers.getHeader(d).cells.getCell(i).width);l=Math.max(l,f)}e[i]=l}l=0;for(var i=0,p=this.columns.count;i<p;i++){for(var d=0,c=this.rows.count;d<c;d++)if(1==this.rows.getRow(d).cells.getCell(i).columnSpan&&!this.rows.getRow(d).cells.getCell(i).isCellMergeContinue||null!=this.rows.getRow(d).cells.getCell(i).value){if(null!=this.rows.getRow(d).cells.getCell(i).value&&!this.rows.getRow(d).grid.style.allowHorizontalOverflow)this.rows.getRow(d).grid.style.cellPadding.right,this.rows.getRow(d).grid.style.cellPadding.left,this.rows.getRow(d).cells.getCell(i).style.borders.left.width;var f=0;f=this.initialWidth>0?Math.min(this.initialWidth,this.rows.getRow(d).cells.getCell(i).width):this.rows.getRow(d).cells.getCell(i).width,l=Math.max(e[i],Math.max(l,f)),l=Math.max(this.columns.getColumn(i).width,l)}0!=this.rows.count&&(e[i]=l),l=0}for(var i=0,g=this.rows.count;i<g;i++)for(var d=0,m=this.columns.count;d<m;d++)if(this.rows.getRow(i).cells.getCell(d).columnSpan>1)for(var y=e[d],b=1;b<this.rows.getRow(i).cells.getCell(d).columnSpan;b++)y+=e[d+b];for(var i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).width<=0?this.columns.getColumn(i).columnWidth=e[i]:this.columns.getColumn(i).width>0&&!this.columns.getColumn(i).isCustomWidth&&(this.columns.getColumn(i).columnWidth=e[i]);var n=0,w=0,S=this.columns.count,P=0;w=this.tempWidth;for(d=0;d<this.columns.count;d++)this.gridColumns.getColumn(d).width>0&&this.gridColumns.getColumn(d).isCustomWidth&&(w-=this.gridColumns.getColumn(d).width,S--);if(w>0&&0!=this.ParentCell.row.grid.style.cellSpacing&&(w-=2*this.ParentCell.row.grid.style.cellSpacing),w>n&&(P=w/S,null!=this.ParentCell))for(d=0;d<this.columns.count;d++)this.columns.getColumn(d).isCustomWidth||(this.columns.getColumn(d).columnWidth=P)}},e}(Ge),Ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gi=function(e){function i(t){var i=e.call(this,t)||this;return i.gridInitialWidth=0,i.gridSize=new j(0,0),i.parentCellIndex=0,i.tempWidth=0,i.childheight=0,i.isChildGrid=!1,i.hasRowSpanSpan=!1,i.isRearranged=!1,i.pageBounds=new k,i.listOfNavigatePages=[],i.flag=!0,i.columnRanges=[],i.currentLocation=new T(0,0),i.breakRow=!0,i.isOverloadWithPosition=!1,i}return Ei(i,e),Object.defineProperty(i.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.getFormat=function(t){return t},i.prototype.layoutInternal=function(e){var i=this.getFormat(e.format);if(this.gridLayoutFormat=this.getFormat(e.format),this.currentPage=e.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width;this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var r=0;if(r=this.currentGraphics.page.section.indexOf(this.currentGraphics.page),this.listOfNavigatePages.push(r),null!=i&&i.break===t.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),new j(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=e.bounds.width>0?e.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=e.bounds.width}if(this.startLocation=new T(e.bounds.x,e.bounds.y),e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],this.Grid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var n=0;n<this.Grid.rows.count;n++)-1===this.Grid.rows.getRow(n).height||this.Grid.rows.getRow(n).isRowHeightSet||(this.Grid.rows.getRow(n).isRowHeightSet=!0);return this.layoutOnPage(e)},i.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if((i+=this.Grid.columns.getColumn(n).width)>=r){for(var o=0,s=t;s<=n&&!((o+=this.Grid.columns.getColumn(s).width)>r);s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},i.prototype.layoutOnPage=function(e){this.pageBounds.x=e.bounds.x,this.pageBounds.y=e.bounds.y,this.pageBounds.height=e.bounds.height;for(var r=this.getFormat(e.format),n=null,o=new rt,s=e.page,a=[],h=0;h<this.columnRanges.length;h++){var l=this.columnRanges[h];this.cellStartIndex=l[0],this.cellEndIndex=l[1];var u=this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex);this.currentBounds=u.currentBounds,this.currentRowIndex=u.currentRowIndex;for(var c=0;c<this.Grid.headers.count;c++)m=this.Grid.headers.getHeader(c),this.currentBounds.y,this.drawRow(m);var p=0,d=(this.Grid.rows.count,void 0),f=!0;a=[];for(var g=0;g<this.Grid.rows.count;g++){var m=this.Grid.rows.getRow(g);p++,this.currentRowIndex=p-1;var y=this.currentBounds.y;s=this.currentPage,i.repeatRowIndex=-1,f&&m.grid.isChildGrid&&(f=!1);var b=null;if(-1==this.Grid.splitChildRowIndex)b=this.drawRow(m),m.isrowFinish=!0;else{if(!(m.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=m.rowIndex)){if(m.isrowFinish)continue;break}b=this.drawRow(m),m.isrowFinish=!0}for(a.push(b.bounds.width),y===this.currentBounds.y?(d=!0,i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(m)):(d=!1,i.repeatRowIndex=-1);!b.isFinish&&null!=s;){var w=this.getLayoutResult();if(this.raisePageLayouted(w).cancel||d)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(r),y=this.currentBounds.y;var S=new T(Fe.default.right.width/2,Fe.default.top.width/2);if(0===r.paginateBounds.x&&0===r.paginateBounds.y&&0===r.paginateBounds.width&&0===r.paginateBounds.height&&this.startLocation.x===S.x&&this.startLocation.y===S.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.Grid.isChildGrid&&null!=m.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&m.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=m.grid.ParentCell){m.grid.ParentCell.row.isRowBreaksNextPage=!0,m.grid.ParentCell.row.rowBreakHeightValue=m.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var P=m.rowIndex+1;P<m.grid.rows.count;P++)m.grid.ParentCell.row.rowBreakHeightValue+=m.grid.rows.getRow(P).height}if(m.grid.isChildGrid){m.isrowFinish=!1,m.grid.splitChildRowIndex=m.rowIndex,m.grid.ParentCell.row.grid.splitChildRowIndex=m.grid.ParentCell.row.rowIndex,m.grid.ParentCell.row.grid.isGridSplit&&(m.grid.ParentCell.row.noOfPageCount+=1,m.grid.ParentCell.row.grid.isGridSplit=!1);break}if(m.noOfPageCount<1){if(-1!=m.grid.splitChildRowIndex&&(m.grid.isGridSplit=!0),null!=m.style.border&&(null!=m.style.border.left&&1!==m.style.border.left.width||null!=m.style.border.top&&1!==m.style.border.top.width)){var v=m.style.border.left.width/2,C=m.style.border.top.width/2;if(this.currentBounds.x===Fe.default.right.width/2&&this.currentBounds.y===Fe.default.right.width/2){var B=new k(v,C,this.currentBounds.width,this.currentBounds.height);this.currentBounds=B}}if(this.Grid.repeatHeader)for(var O=0;O<this.Grid.headers.count;O++){var x=this.Grid.headers.getHeader(O);this.drawRow(x)}if(b=this.drawRow(m),m.noOfPageCount>=1){m.rowBreakHeightValue;for(var L=0;L<m.noOfPageCount;L++){var V=this.getLayoutResult();if(this.raisePageLayouted(V),this.currentPage=this.getNextPageformat(r),y=this.currentBounds.y,-1!=m.grid.splitChildRowIndex&&(m.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var R=0;R<this.Grid.headers.count;R++){D=this.Grid.headers.getHeader(R);this.drawRow(D)}this.drawRow(m)}}m.grid.splitChildRowIndex=-1,m.grid.isGridSplit=!1,b.isFinish=!0;for(var N=0;N<m.cells.count;N++)m.cells.getCell(N).value instanceof Fi&&(m.cells.getCell(N).value.splitChildRowIndex=-1)}}}if(!b.isFinish&&null!==s&&r.layout!==t.PdfLayoutType.OnePage&&d){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(r),null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.y>0&&!this.Grid.isChildGrid&&(this.currentBounds.y=e.bounds.y),this.startLocation.y=this.currentBounds.y,r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Fe.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var A=0;A<this.Grid.headers.count;A++){var D=this.Grid.headers.getHeader(A);this.drawRow(D)}this.drawRow(m),null===this.currentPage||o.containsKey(this.currentPage)||o.add(this.currentPage,l)}if(null!=m.NestedGridLayoutResult){this.currentPage=m.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new T(m.NestedGridLayoutResult.bounds.x,m.NestedGridLayoutResult.bounds.y);var M=this.ReCalculateHeight(m,m.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=M,s!=this.currentPage){for(var I=this.currentPage.section,F=I.indexOf(s)+1,E=I.indexOf(this.currentPage),G=F;G<E+1;G++){var z=this.currentPage.graphics,W=new T(r.paginateBounds.x,r.paginateBounds.y),H=G==E?m.NestedGridLayoutResult.bounds.height-e.bounds.y:this.currentBounds.height-W.y;H<=z.clientSize.height&&(H+=e.bounds.y),W.y=null==r?.5:r.paginateBounds.y;for(Z=0;Z<m.cells.count;Z++){var _=m.cells.getCell(Z),K=0,U=0;if(_.value instanceof Fi)for(var q=0;q<_.value.columns.count;q++)U+=_.value.columns.getColumn(q).columnWidth;else U=_.width;K=Math.max(U,m.grid.columns.getColumn(Z).width),_.drawCellBorders(z,new k(W,new j(K,H))),W.x+=K,Z+=_.columnSpan-1}}s=this.currentPage}}}var Y=!1,X=0;a.length>0&&(X=a[0]);for(var J=[[1,2]],Z=0;Z<this.Grid.rows.count;Z++)if(-1!=this.cellEndIndex&&this.Grid.rows.getRow(Z).cells.getCell(this.cellEndIndex).value instanceof Fi){var $=this.Grid.rows.getRow(Z).cells.getCell(this.cellEndIndex).value;this.rowLayoutBoundsWidth=$.rowLayoutBoundsWidth,Y=!0}if(!Y&&a.length>0){for(Z=0;Z<p-1;Z++)X<a[Z]&&(X=a[Z]);this.rowLayoutBoundsWidth=X}else this.rowLayoutBoundsWidth=J[0][1];if(this.columnRanges.indexOf(l)<this.columnRanges.length-1&&null!=s&&r.layout!=t.PdfLayoutType.OnePage)if(this.Grid.isChildGrid,0!=J[0][0]){this.currentPage.section.indexOf(this.currentPage);this.currentGraphics=this.currentPage.graphics,this.currentBounds=new k(new T(0,0),this.currentPage.getClientSize());this.currentGraphics.page.section.indexOf(this.currentGraphics.page)}else this.currentPage=this.getNextPageformat(r);this.columnRanges.length-1!==h&&this.columnRanges.length>1&&r.layout!==t.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(r),r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y))}return n=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==t.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(o),this.raisePageLayouted(n),n},i.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage);this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics;var n=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);return-1===this.listOfNavigatePages.indexOf(n)&&this.listOfNavigatePages.push(n),this.currentBounds=new k(new T(0,0),i.getClientSize()),i},i.prototype.CheckIfDefaultFormat=function(t){var e=new D;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},i.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){var s=null;return this.Grid.raiseBeginCellDraw&&(s=new _i(t,e,i,r,n,o),this.Grid.onBeginCellDraw(s),o=s.style),o},i.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){var s=null;this.Grid.raiseEndCellDraw&&(s=new Ki(t,e,i,r,n,o),this.Grid.onEndCellDraw(s))},i.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++)(a=r[n]).section=null,i.push(a),e.pages.remove(a);for(n=0;n<t.size();n++)for(var o=n,s=t.size()/this.columnRanges.length;o<t.size();o+=s){var a=i[o];-1===e.pages.indexOf(a)&&e.pages.add(a)}},i.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);e.rowBreakHeight>0&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new k(this.startLocation,new j(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new zi(this.currentPage,i)},i.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},i.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;if(this.Grid.raiseBeginPageLayout){var n=new Xi(e,t,i);this.Grid.onBeginPageLayout(n),r=n.cancel,e=n.bounds,i=n.startRowIndex}return{returnValue:r,currentBounds:e,currentRowIndex:i}},i.prototype.raisePageLayouted=function(t){var e=new Ji(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(e),e},i.prototype.drawRow=function(e,r,n){if(void 0===r){var o=new Zi,s=0,a=new j(0,0),h=!1;if(e.rowSpanExists){var l=0,u=this.Grid.rows.rowCollection.indexOf(e);-1===u&&-1!==(u=this.Grid.headers.indexOf(e))&&(h=!0);for(f=0;f<e.cells.count;f++){var c=e.cells.getCell(f);l=Math.max(l,c.rowSpan)}for(f=u;f<u+l;f++)s+=h?this.Grid.headers.getHeader(f).height:this.Grid.rows.getRow(f).height}var p=e.rowBreakHeight>0?e.rowBreakHeight:e.height;return this.Grid.isChildGrid&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+s>this.currentPageBounds.height?(this.Grid.ParentCell.row.grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,o.bounds=this.currentBounds,this.drawRowWithBreak(o,e,p),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex)):(o.isFinish=!0,e.grid.ParentCell.row.rowBreakHeightValue>0?e.repeatFlag=!0:(e.repeatFlag=!1,p=e.height),this.Grid.isChildGrid&&e.rowBreakHeight>0&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(p+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(e,o,p)):p>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,p),e.isrowFinish=!0,e.repeatFlag=!0,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):this.currentBounds.y+p>this.currentPageBounds.height||this.currentBounds.y+p>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+s>this.currentPageBounds.height?(this.Grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex?this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,p),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):o.isFinish=!1):(o.isFinish=!0,this.drawRow(e,o,p),e.repeatFlag=!1),o}var d=new T(this.currentBounds.x,this.currentBounds.y);r.bounds=new k(d,new j(0,0)),n=this.ReCalculateHeight(e,n);for(var f=this.cellStartIndex;f<=this.cellEndIndex;f++){var g=f>this.cellEndIndex+1&&e.cells.getCell(f).columnSpan>1;if(!g)for(var m=1;m<e.cells.getCell(f).columnSpan;m++)e.cells.getCell(f+m).isCellMergeContinue=!0;a=new j(this.Grid.columns.getColumn(f).width,n);!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(f).format)&&this.CheckIfDefaultFormat(e.cells.getCell(f).stringFormat)&&(e.cells.getCell(f).stringFormat=this.Grid.columns.getColumn(f).format);var y=e.cells.getCell(f).style,b="string"==typeof e.cells.getCell(f).value&&null!==e.cells.getCell(f).value?e.cells.getCell(f).value:"";e.cells.getCell(f).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,f,new k(d,a),b,y),e.cells.getCell(f).value instanceof Fi&&((S=e.cells.getCell(f).value).parentCellIndex=f);var w=e.cells.getCell(f).draw(this.currentGraphics,new k(d,a),g);if(e.grid.style.allowHorizontalOverflow&&(e.cells.getCell(f).columnSpan>this.cellEndIndex||f+e.cells.getCell(f).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),e.grid.style.allowHorizontalOverflow&&e.rowOverflowIndex>0&&(e.cells.getCell(f).columnSpan>this.cellEndIndex||f+e.cells.getCell(f).columnSpan>this.cellEndIndex+1)&&e.cells.getCell(f).columnSpan-this.cellEndIndex+f-1>0&&(e.cells.getCell(e.rowOverflowIndex+1).value=null!==w&&void 0!==w.remainder?w.remainder:"",e.cells.getCell(e.rowOverflowIndex+1).stringFormat=e.cells.getCell(f).stringFormat,e.cells.getCell(e.rowOverflowIndex+1).style=e.cells.getCell(f).style,e.cells.getCell(e.rowOverflowIndex+1).columnSpan=e.cells.getCell(f).columnSpan-this.cellEndIndex+f-1),b="string"==typeof e.cells.getCell(f).value&&null!==e.cells.getCell(f).value?e.cells.getCell(f).value:"",g||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,f,new k(d,a),b,e.cells.getCell(f).style),e.cells.getCell(f).value instanceof Fi){var S=e.cells.getCell(f).value;this.Grid.columns.getColumn(f).width>=this.currentGraphics.clientSize.width?(d.x=S.rowLayoutBoundsWidth,d.x+=S.style.cellSpacing):d.x+=this.Grid.columns.getColumn(f).width}else d.x+=this.Grid.columns.getColumn(f).width}e.rowMergeComplete&&!e.isRowHeightSet||(this.currentBounds.y+=n),r.bounds=new k(new T(r.bounds.x,r.bounds.y),new j(d.x,d.y))},i.prototype.drawRowWithBreak=function(t,e,i){var r=new T(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new k(r,new j(0,0)),this.gridHeight=e.rowBreakHeight>0?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(o=0;o<e.cells.count;o++){var n=e.cells.getCell(o);n.measureHeight()===i&&n.value instanceof Fi&&(e.rowBreakHeight=0)}for(var o=this.cellStartIndex;o<=this.cellEndIndex;o++){var s=e.cells.getCell(o).columnSpan+o>this.cellEndIndex+1&&e.cells.getCell(o).columnSpan>1,a=new j(this.Grid.columns.getColumn(o).width,this.gridHeight>0?this.gridHeight:this.currentPageBounds.height),h=e.cells.getCell(o).style;e.cells.getCell(o).style=h;var l=null;if(l=e.cells.getCell(o).draw(this.currentGraphics,new k(r,a),s),e.rowBreakHeight>0&&null!=l&&(e.cells.getCell(o).FinishedDrawingCell=!1,e.cells.getCell(o).remainingString=null==l.remainder?" ":l.remainder,e.grid.isChildGrid&&(e.rowBreakHeight=i-l.actualSize.height)),t.isFinish=t.isFinish?e.cells.getCell(o).FinishedDrawingCell:t.isFinish,e.cells.getCell(o).value instanceof Fi){var u=e.cells.getCell(o).value;this.rowBreakPageHeightCellIndex=o,this.Grid.columns.getColumn(o).width>=this.currentGraphics.clientSize.width?(r.x=this.rowLayoutBoundsWidth,r.x+=u.style.cellSpacing):r.x+=this.Grid.columns.getColumn(o).width}else r.x+=this.Grid.columns.getColumn(o).width}this.currentBounds.y+=this.gridHeight>0?this.gridHeight:i,t.bounds=new k(new T(t.bounds.x,t.bounds.y),new j(r.x,r.y))},i.repeatRowIndex=-1,i}(Ae),zi=function(t){function e(e,i){return t.call(this,e,i)||this}return Ei(e,t),e}(Ie),Wi=function(t){function e(e){return t.call(this,e)||this}return Ei(e,t),e}(De),Hi=function(){function t(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}return Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),t}(),_i=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.style=s,a}return Ei(e,t),Object.defineProperty(e.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),e}(Hi),Ki=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.cellStyle=s,a}return Ei(e,t),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0}),e}(Hi),Ui=function(){function t(){}return Object.defineProperty(t.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0}),t}(),qi=function(t){function e(e,i){var r=t.call(this)||this;return r.bounds=e,r.pdfPage=i,r}return Ei(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),e}(Ui),Yi=function(t){function e(e){var i=t.call(this)||this;return i.layoutResult=e,i}return Ei(e,t),Object.defineProperty(e.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0}),e}(Ui),Xi=function(t){function e(e,i,r){var n=t.call(this,e,i)||this;return n.startRow=r,n}return Ei(e,t),Object.defineProperty(e.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0}),e}(qi),Ji=function(t){function e(e){return t.call(this,e)||this}return Ei(e,t),e}(Yi),Zi=function(){function t(){this.layoutedBounds=new k(0,0,0,0)}return Object.defineProperty(t.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0}),t}(),$i=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qi=function(e){function i(t){var i=e.call(this,t)||this;return i.olderPdfForm=0,i.shapeBounds=new k,i.totalPageSize=0,i}return $i(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds();r.x=0,r.y=0;var n=this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height;this.isPdfGrid&&!n&&(r=this.shapeBounds);var o=null,s=new tr;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i);i=a.currentBounds;var h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},i.prototype.raiseBeforePageLayout=function(t,e){var i=!1;if(this.element.raiseBeginPageLayout){var r=new qi(e,t);this.element.onBeginPageLayout(r),i=r.cancel,e=r.bounds}return{currentBounds:e,cancel:i}},i.prototype.raiseEndPageLayout=function(t){var e=null;if(this.element.raiseEndPageLayout){var i=this.getLayoutResult(t);e=new Yi(i),this.element.onEndPageLayout(e)}return e},i.prototype.getLayoutResult=function(t){return new Ie(t.page,t.bounds)},i.prototype.getNextShapeBounds=function(t,e){var i=e.bounds;return t.y=t.y+i.height,t.height=t.height-i.height,t},i.prototype.layoutOnPage=function(e,i,r,n){var o=new tr;i=this.checkCorrectCurrentBounds(e,i,n);var s=this.fitsToBounds(i,r),a=!1;if(!(n.format.break===t.PdfLayoutBreakType.FitElement&&!s&&e===n.page)){var h=this.getDrawBounds(i,r);this.drawShape(e.graphics,i,h),o.bounds=this.getPageResultBounds(i,r),a=i.height>=r.height}return o.end=a||n.format.layout===t.PdfLayoutType.OnePage,o.page=e,o},i.prototype.getDrawBounds=function(t,e){var i=t;return i.y=i.y-e.y,i.height=i.height+e.y,i},i.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new T(i.x,i.y))}finally{t.restore(r)}},i.prototype.checkCorrectCurrentBounds=function(t,e,i){var r=t.graphics.clientSize;return e.width=e.width>0?e.width:r.width-e.x,e.height=e.height>0?e.height:r.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},i.prototype.getPageResultBounds=function(t,e){var i=t;return i.height=Math.min(i.height,e.height),i},i.prototype.fitsToBounds=function(t,e){return e.height<=t.height},i.index=0,i.splitDiff=0,i.last=!1,i.borderWidth=0,i}(Ae),tr=function(){function t(){}return t}(),er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return er(e,t),e.prototype.getBounds=function(){return this.getBoundsInternal()},e.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},e.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},e.prototype.layout=function(t){return new Qi(this).layout(t)},e}(Ge),rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nr=function(t){function e(e){var i=t.call(this)||this;return void 0!==e&&(i.mpen=e),i}return rr(e,t),Object.defineProperty(e.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0}),e}(ir),or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sr=function(t){function e(e,i){var r=t.call(this)||this;return r.mbrush=null,void 0===e||(e instanceof Q?r=t.call(this,e)||this:r.mbrush=i),r}return or(e,t),Object.defineProperty(e.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),e.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new Q(new L(0,0,0)):this.pen},e}(nr),ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hr=function(e){function i(i,r,n,o){var s=e.call(this)||this;return s.mpoints=null,s.mpathTypes=null,s.mStartFigure=!0,s.mfillMode=t.PdfFillMode.Alternate,s.isBeziers3=!1,s.isXps=!1,void 0===i||(i instanceof Q?(s=e.call(this,i)||this,r instanceof R?(s=e.call(this,i,r)||this).fillMode=n:null!==r&&void 0!==r&&null!==n&&void 0!==n&&s.addPath(r,n)):i instanceof R?(s=e.call(this,i)||this,null!==r&&void 0!==r&&(s.fillMode=r),null!==n&&void 0!==n&&null!==o&&void 0!==o&&s.addPath(n,o)):s.addPath(i,r)),s}return ar(i,e),Object.defineProperty(i.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pointCount",{get:function(){var t=0;return null!=this.mpoints&&(t=this.mpoints.length),t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),i.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof De||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},i.prototype.addArc=function(e,i,r,n,o,s){if(e instanceof k)this.addArc(e.x,e.y,e.width,e.height,i,r);else for(var a=this.getBezierArcPoints(e,i,i+r,i+n,o,s),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addBezier=function(e,i,r,n,o,s,a,h){if(e instanceof T&&i instanceof T&&r instanceof T&&n instanceof T)this.addBezier(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y);else{var l=[];l.push(e),l.push(i),l.push(r),l.push(n),l.push(o),l.push(s),l.push(a),l.push(h),this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addEllipse=function(t,e,i,r){t instanceof k?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},i.prototype.addLine=function(e,i,r,n){if(e instanceof T&&i instanceof T)this.addLine(e.x,e.y,i.x,i.y);else{var o=[];o.push(e),o.push(i),o.push(r),o.push(n),this.addPoints(o,t.PathPointType.Line)}},i.prototype.addPath=function(t,e){if(t instanceof i)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},i.prototype.addPie=function(e,i,r,n,o,s){e instanceof k?this.addPie(e.x,e.y,e.width,e.height,i,r):(this.startFigure(),this.addArc(e,i,r,n,o,s),this.addPoint(new T(e+r/2,i+n/2),t.PathPointType.Line),this.closeFigure())},i.prototype.addPolygon=function(e){e.length;var i=[];this.startFigure();for(var r=0;r<e.length;r++)i.push(e[r].x),i.push(e[r].y);this.addPoints(i,t.PathPointType.Line),this.closeFigure()},i.prototype.addRectangle=function(e,i,r,n){if(e instanceof k)this.addRectangle(e.x,e.y,e.width,e.height);else{var o=[];this.startFigure(),o.push(e),o.push(i),o.push(e+r),o.push(i),o.push(e+r),o.push(i+n),o.push(e),o.push(i+n),this.addPoints(o,t.PathPointType.Line),this.closeFigure()}},i.prototype.startFigure=function(){this.mStartFigure=!0},i.prototype.closeAllFigures=function(){for(var e=this.pathPoints[0],i=0;i<this.mpathTypes.length;i++){var r=this.types[i],n=!1;0!==i&&r===t.PathPointType.Start?(this.closeFigure(i-1),n=!0):i===this.mpathTypes.length-1&&!n&&this.isXps&&e.x===this.pathPoints[i].y&&this.closeFigure(i)}},i.prototype.getLastPoint=function(){var t=new T(0,0),e=this.pointCount;return e>0&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},i.prototype.getBezierArcPoints=function(t,e,i,r,n,o){if(t>i){s=void 0;s=t,t=i,i=s}if(r>e){var s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),S=Math.cos(b),P=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*P,l+c*(w-f*P),u-p*(P+f*w),l+c*(S+f*v),u-p*(v-f*S),l+c*S,u-p*v):g.push(l+c*w,u-p*P,l+c*(w+f*P),u-p*(P-f*w),l+c*(S-f*v),u-p*(v+f*S),l+c*S,u-p*v)}return g},i.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new k(0,0,0,0);if(t.length>0){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++){var a=t[s];i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o)}e=new k(i,n,r-i,o-n)}return e},i.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},i.prototype.addPoints=function(e,i,r,n){if(void 0===r&&void 0===n)this.addPoints(e,i,0,e.length);else for(var o=r;o<n;o++){var s=new T(e[o],e[o+1]);o===r?this.pointCount<=0||this.mStartFigure?(this.addPoint(s,t.PathPointType.Start),this.mStartFigure=!1):s.x===this.lastPoint.x||s.y===this.lastPoint.y||this.isBeziers3?s.x!==this.lastPoint.x&&s.y!==this.lastPoint.y&&this.addPoint(s,t.PathPointType.Bezier3):this.addPoint(s,t.PathPointType.Line):this.addPoint(s,i),o++}},i.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},i.prototype.closeFigure=function(e){if(void 0===e)this.pointCount>0&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(e<0)throw new Error("IndexOutOfRangeException()");var i=this.types[e];i|=t.PathPointType.CloseSubpath,this.types[e]=i}},i}(sr),lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ur=function(t){function e(e,i,r,n,o,s){var a=t.call(this)||this;return a.bounds=new k(0,0,0,0),void 0===e||(e instanceof Q?(a=t.call(this,e,i)||this).bounds=r instanceof k?r:new k(r,n,o,s):a.bounds=e instanceof k?e:new k(e,i,r,n)),a}return lr(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),e.prototype.getBoundsInternal=function(){return this.bounds},e}(sr),cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pr=function(t){function e(e,i,r,n,o,s,a,h){var l=t.call(this)||this;return l.startAngle=0,l.sweepAngle=0,void 0===e||(e instanceof k&&void 0!==i&&void 0!==r?((l=t.call(this,e)||this).startAngle=i,l.sweepAngle=r):e instanceof Q?r instanceof k?((l=t.call(this,e,i,r)||this).startAngle=n,l.sweepAngle=o):((l=t.call(this,e,i,r,n,o,s)||this).startAngle=a,l.sweepAngle=h):((l=t.call(this,e,i,r,n)||this).startAngle=o,l.sweepAngle=s)),l}return cr(e,t),e}(ur),dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fr=function(t){function e(e,i,r,n,o,s,a){var h=this;return void 0===e?h=t.call(this)||this:e instanceof k?h=t.call(this,e,i,r)||this:e instanceof Q?i instanceof k?h=t.call(this,e,null,i,r,n)||this:void 0===s&&void 0===a?h=t.call(this,e,null,0,0,i,r,n,o)||this:void 0!==s&&void 0!==a&&(h=t.call(this,e,null,i,r,n,o,s,a)||this):void 0!==e&&void 0===o&&void 0===s?h=t.call(this,0,0,e,i,r,n)||this:void 0!==e&&void 0!==o&&void 0!==s&&(h=t.call(this,e,i,r,n,o,s)||this),h}return dr(e,t),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof De||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},e.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)},e}(pr),gr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mr=function(e){function i(i,r,n){var o=e.call(this,r)||this;return o.isEmbedFont=!1,o.isUnicode=!0,void 0!==n?o.createFontInternal(i,n):o.createFontInternal(i,t.PdfFontStyle.Regular),o}return gr(i,e),i.prototype.equalsToFont=function(t){return!1},i.prototype.getLineWidth=function(e,i){var r=0;r=null!==i&&void 0!==i&&i.textDirection!==t.PdfTextDirection.None?this.getUnicodeLineWidth(e,r,i).width:this.fontInternal.getLineWidth(e);var n=this.metrics.getSize(i);return r*=G.charSizeMultiplier*n,r=this.applyFormatSettings(e,i,r)},i.prototype.getCharWidth=function(t,e){var i=this.fontInternal.getCharWidth(t);return i*=.001*this.metrics.getSize(e)},i.prototype.createFontInternal=function(t,e){this.fontInternal=new Gt(t,this.size),this.calculateStyle(e),this.initializeInternals()},i.prototype.calculateStyle=function(e){var i=this.fontInternal.ttfMetrics.macStyle;0!=(e&t.PdfFontStyle.Underline)&&(i|=t.PdfFontStyle.Underline),0!=(e&t.PdfFontStyle.Strikeout)&&(i|=t.PdfFontStyle.Strikeout),this.setStyle(i)},i.prototype.initializeInternals=function(){var t=null;Ce.enableCache&&(t=Ce.cache.search(this));var e=null;if(null!==t&&void 0!==t){e=t.getInternals();var i=t.metrics;(i=i.clone()).size=this.size,this.metrics=i,this.fontInternal=t.fontInternal}else null==t&&(this.fontInternal instanceof Gt&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),e=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics);this.metrics.isUnicodeFont=!0,this.setInternals(e)},i.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(i.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),i.prototype.getUnicodeLineWidth=function(e,i,r){i=0;var n=null,o=(new Kt).getGlyphIndex(e,this,r.textDirection===t.PdfTextDirection.RightToLeft,n,!0),s=o.success;if(n=o.glyphs,s&&null!==n)for(var a=this.fontInternal.ttfReader,h=0,l=n.length;h<l;h++){var u=n[h],c=a.getGlyph(u);null!==c&&void 0!==c&&(i+=c.width)}return{success:s,width:i}},i}(G),yr=function(){function e(t,e,i,r,n){t instanceof k&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof k&&e instanceof ce&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof T&&e instanceof j&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof T&&e instanceof j&&i instanceof ce&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof j&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof ce&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}return Object.defineProperty(e.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.currentLocation},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.x=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.y=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.template.size},set:function(e){this.type===t.TemplateType.None&&this.template.reset(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.template.width},set:function(e){if(this.template.width!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.width=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.template.height},set:function(e){if(this.template.height!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.height=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new k(new T(this.x,this.y),this.size)},set:function(e){this.type===t.TemplateType.None&&(this.location=new T(e.x,e.y),this.size=new j(e.width,e.height))},enumerable:!0,configurable:!0}),e.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Yt(i,r)},e.prototype.updateDocking=function(e){if(e!==t.TemplateType.None){switch(e){case t.TemplateType.Top:this.dock=t.PdfDockStyle.Top;break;case t.TemplateType.Bottom:this.dock=t.PdfDockStyle.Bottom;break;case t.TemplateType.Left:this.dock=t.PdfDockStyle.Left;break;case t.TemplateType.Right:this.dock=t.PdfDockStyle.Right}this.resetAlignment()}},e.prototype.resetAlignment=function(){this.alignment=t.PdfAlignmentStyle.None},e.prototype.setAlignment=function(e){if(this.dock===t.PdfDockStyle.None)this.alignmentStyle=e;else{var i=!1;switch(this.dock){case t.PdfDockStyle.Left:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.MiddleLeft||e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Top:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.TopCenter||e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Right:i=e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.MiddleRight||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Bottom:i=e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.BottomCenter||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Fill:i=e===t.PdfAlignmentStyle.MiddleCenter||e===t.PdfAlignmentStyle.None}i&&(this.alignmentStyle=e)}},e.prototype.draw=function(t,e){var i=t.page,r=this.calculateBounds(i,e);-0===r.x&&(r.x=0),t.graphics.drawPdfTemplate(this.template,new T(r.x,r.y),new j(r.width,r.height))},e.prototype.calculateBounds=function(e,i){var r=this.bounds;return this.alignmentStyle!==t.PdfAlignmentStyle.None?r=this.getAlignmentBounds(e,i):this.dockStyle!==t.PdfDockStyle.None&&(r=this.getDockBounds(e,i)),r},e.prototype.getAlignmentBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleAlignmentBounds(e,i):this.getTemplateAlignmentBounds(e,i)},e.prototype.getSimpleAlignmentBounds=function(e,i){var r=this.bounds,n=e.section.getActualBounds(i,e,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:o=0,s=0;break;case t.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=0;break;case t.PdfAlignmentStyle.TopRight:o=n.width-this.width,s=0;break;case t.PdfAlignmentStyle.MiddleLeft:o=0,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:o=n.width-this.width,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:o=0,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomRight:o=n.width-this.width,s=n.height-this.height}return r.x=o,r.y=s,r},e.prototype.getTemplateAlignmentBounds=function(e,i){var r=this.bounds,n=e.section,o=n.getActualBounds(i,e,!1),s=this.x,a=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:this.type===t.TemplateType.Left?(s=-o.x,a=0):this.type===t.TemplateType.Top&&(s=-o.x,a=-o.y);break;case t.PdfAlignmentStyle.TopCenter:s=(o.width-this.width)/2,a=-o.y;break;case t.PdfAlignmentStyle.TopRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=0):this.type===t.TemplateType.Top&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=-o.y);break;case t.PdfAlignmentStyle.MiddleLeft:s=-o.x,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:s=(o.width-this.width)/2,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:this.type===t.TemplateType.Left?(s=-o.x,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=-o.x,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height);break;case t.PdfAlignmentStyle.BottomCenter:s=(o.width-this.width)/2,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height;break;case t.PdfAlignmentStyle.BottomRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height)}return r.x=s,r.y=a,r},e.prototype.getDockBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleDockBounds(e,i):this.getTemplateDockBounds(e,i)},e.prototype.getSimpleDockBounds=function(e,i){this.bounds;var r=e.section.getActualBounds(i,e,!1),n=this.x,o=this.y,s=this.width,a=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:n=0,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Top:n=0,o=0,s=r.width,a=this.height;break;case t.PdfDockStyle.Right:n=r.width-this.width,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Bottom:n=0,o=r.height-this.height,s=r.width,a=this.height;break;case t.PdfDockStyle.Fill:n=0,n=0,s=r.width,a=r.height}return new k(n,o,s,a)},e.prototype.getTemplateDockBounds=function(e,i){this.bounds;var r=e.section,n=r.getActualBounds(i,e,!1),o=r.pageSettings.getActualSize(),s=this.x,a=this.y,h=this.width,l=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:s=-n.x,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Top:s=-n.x,a=-n.y,h=o.width,l=this.height,n.height<0&&(a=-n.y+o.height);break;case t.PdfDockStyle.Right:s=n.width+r.getRightIndentWidth(i,e,!1)-this.width,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Bottom:s=-n.x,a=n.height+r.getBottomIndentHeight(i,e,!1)-this.height,h=o.width,l=this.height,n.height<0&&(a-=o.height);break;case t.PdfDockStyle.Fill:s=0,s=0,h=n.width,l=n.height}return new k(s,a,h,l)},e}();return t.PdfAction=B,t.PdfUriAction=x,t.PdfActionLinkAnnotation=Ve,t.PdfAnnotation=Le,t.PdfAnnotationCollection=le,t.PdfDocumentLinkAnnotation=Ne,t.PdfLinkAnnotation=je,t.PdfTextWebLink=Je,t.PdfUriAnnotation=Ye,t.Dictionary=n,t.defaultToString=r,t.PdfCatalog=U,t.PdfDocument=Ce,t.PdfDocumentBase=_,t.PdfDocumentTemplate=fe,t.PdfPageNumberField=ii,t.PdfCompositeField=ni,t.PdfPageCountField=hi,t.PointF=T,t.SizeF=j,t.RectangleF=k,t.Rectangle=V,t.PdfCacheCollection=Pe,t.PdfCollection=oe,t.PdfDestination=ui,t.PdfFunction=ci,t.PdfSampledFunction=di,t.ProcedureSets=it,t.PdfColor=L,t.PdfGraphics=te,t.GetResourceEventHandler=ee,t.PdfGraphicsState=ie,t.PdfMargins=J,t.PdfPen=Q,t.PdfResources=Jt,t.Guid=Zt,t.PdfTransformationMatrix=tt,t.Matrix=et,t.PdfBrush=R,t.PdfBrushes=yi,t.PdfSolidBrush=A,t.PdfLinearGradientBrush=vi,t.PdfRadialGradientBrush=Bi,t.PdfTilingBrush=Qt,t.PdfGradientBrush=qt,t.PdfColorBlend=Si,t.PdfBlend=bi,t.PdfTemplate=Yt,t.PdfLayoutElement=Ge,t.PdfPath=hr,t.PdfArc=fr,t.PdfTextElement=Ue,t.ElementLayouter=Ae,t.PdfLayoutFormat=De,t.PdfLayoutParams=Me,t.PdfLayoutResult=Ie,t.TextLayouter=We,t.TextPageLayoutResult=He,t.PdfTextLayoutResult=_e,t.PdfFont=G,t.PdfFontMetrics=It,t.WidthTable=Ft,t.StandardWidthTable=Et,t.PdfStandardFont=xe,t.PdfStandardFontMetricsFactory=Be,t.PdfStringFormat=D,t.PdfStringLayouter=I,t.PdfStringLayoutResult=F,t.LineInfo=E,t.StringTokenizer=M,t.PdfTrueTypeFont=mr,t.RtlRenderer=Kt,t.ArabicShapeRenderer=zt,t.ArabicShape=Wt,t.Bidi=Ht,t.RtlCharacters=_t,t.ByteArray=ut,t.ImageDecoder=pt,t.PdfBitmap=mt,t.PdfImage=ft,t.PdfTransparency=nt,t.PdfCrossTable=q,t.RegisteredObject=Y,t.DictionaryProperties=a,t.PdfMainObjectCollection=W,t.ObjectInfo=H,t.Operators=s,t.PdfStreamWriter=$,t.PdfWriter=z,t.PageAddedEventArgs=pe,t.PdfDocumentPageCollection=Se,t.PdfPage=ce,t.PdfPageBase=he,t.PdfPageLayer=ne,t.PdfPageLayerCollection=ae,t.PdfPageSettings=Z,t.PdfPageSize=X,t.PdfPageTemplateElement=yr,t.PdfSection=ye,t.PageSettingsState=be,t.PdfSectionCollection=we,t.PdfSectionPageCollection=de,t.PdfSectionTemplate=me,t.PdfArray=m,t.PdfDictionary=h,t.SaveSectionCollectionEventHandler=l,t.SaveDescendantFontEventHandler=u,t.SaveFontDictionaryEventHandler=c,t.SaveAnnotationEventHandler=p,t.SaveSectionEventHandler=d,t.SaveTemplateEventHandler=f,t.PdfName=o,t.PdfNumber=g,t.PdfReference=v,t.PdfReferenceHolder=C,t.PdfStream=b,t.SaveCmapEventHandler=w,t.SaveFontProgramEventHandler=S,t.PdfString=P,t.PdfGridStyleBase=xi,t.PdfGridStyle=Li,t.PdfGridCellStyle=Ti,t.PdfGridRowStyle=ji,t.PdfBorders=Fe,t.PdfPaddings=Ee,t.PdfGridLayouter=Gi,t.PdfGridLayoutResult=zi,t.PdfGridLayoutFormat=Wi,t.GridCellEventArgs=Hi,t.PdfGridBeginCellDrawEventArgs=_i,t.PdfGridEndCellDrawEventArgs=Ki,t.PdfCancelEventArgs=Ui,t.BeginPageLayoutEventArgs=qi,t.EndPageLayoutEventArgs=Yi,t.PdfGridBeginPageLayoutEventArgs=Xi,t.PdfGridEndPageLayoutEventArgs=Ji,t.RowLayoutResult=Zi,t.PdfGrid=Fi,t.PdfGridColumn=Ri,t.PdfGridColumnCollection=Ni,t.PdfGridRow=Ai,t.PdfGridRowCollection=Di,t.PdfGridHeaderCollection=Mi,t.PdfGridCell=ki,t.PdfGridCellCollection=Vi,t}({},ej.compression,ej.fileutils),this.ejs=ej;