@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 60.9 kB
JavaScript
!function(t){"function"==typeof define&&define.amd?define(["kendo.core.min","kendo.drawing.min","kendo.color.min"],t):t()}((function(){var t;kendo.pdf=kendo.pdf||{},kendo.pdf.supportsDeflate=function(){return window.pako&&"function"==typeof window.pako.deflate},kendo.pdf.deflate=function(t){return window.pako.deflate(t)},function(t){window.kendo.pdf=window.kendo.pdf||{};var e,r=kendo.support.browser,o=kendo.drawing,n=o.util,i=n.extendStatic,a=kendo.pdf,s=kendo.geometry,c="undefined"!=typeof Uint8Array&&kendo.support.browser&&(!kendo.support.browser.msie||kendo.support.browser.version>9),h=(e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",{decode:function(t){for(var r=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),o=0,n=r.length,i=[];o<n;){var a=e.indexOf(r.charAt(o++)),s=e.indexOf(r.charAt(o++)),c=e.indexOf(r.charAt(o++)),h=e.indexOf(r.charAt(o++)),f=a<<2|s>>>4,u=(15&s)<<4|c>>>2,p=(3&c)<<6|h;i.push(f),64!=c&&i.push(u),64!=h&&i.push(p)}return i},encode:function(t){for(var r=0,o=t.length,n="";r<o;){var i=t[r++],a=t[r++],s=t[r++],c=(3&i)<<4|a>>>4,h=(15&a)<<2|s>>>6,f=63&s;r-o==2?h=f=64:r-o==1&&(f=64),n+=e.charAt(i>>>2)+e.charAt(c)+e.charAt(h)+e.charAt(f)}return n}});function f(t){var e=0,r=0;null==t?t=c?new Uint8Array(256):[]:r=t.length;var o=c?function(e){if(e>=t.length){var r=new Uint8Array(Math.max(e+256,2*t.length));r.set(t,0),t=r}}:function(){},n=c?function(){return new Uint8Array(t.buffer,0,r)}:function(){return t},i=c?function(n){if("string"==typeof n)return w(n);var i=n.length;o(e+i),t.set(n,e),(e+=i)>r&&(r=e)}:function(t){if("string"==typeof t)return w(t);for(var e=0;e<t.length;++e)f(t[e])},a=c?function(e,r){if(t.buffer.slice)return new Uint8Array(t.buffer.slice(e,e+r));var o=new Uint8Array(r);return o.set(new Uint8Array(t.buffer,e,r)),o}:function(e,r){return t.slice(e,e+r)};function s(){return e<r?t[e++]:0}function f(n){o(e),t[e++]=255&n,e>r&&(r=e)}function u(){return s()<<8|s()}function p(t){f(t>>8),f(t)}function l(){return 65536*u()+u()}function d(t){p(t>>>16&65535),p(65535&t)}function g(){var t=l();return t>=2147483648?t-4294967296:t}function y(t){d(t<0?t+4294967296:t)}function m(t){return v(t,s)}function w(t){for(var e=0;e<t.length;++e)f(t.charCodeAt(e))}function v(t,e){for(var r=new Array(t),o=0;o<t;++o)r[o]=e();return r}var S={eof:function(){return e>=r},readByte:s,writeByte:f,readShort:u,writeShort:p,readLong:l,writeLong:d,readFixed:function(){return l()/65536},writeFixed:function(t){d(Math.round(65536*t))},readShort_:function(){var t=u();return t>=32768?t-65536:t},writeShort_:function(t){p(t<0?t+65536:t)},readLong_:g,writeLong_:y,readFixed_:function(){return g()/65536},writeFixed_:function(t){y(Math.round(65536*t))},read:m,write:i,readString:function(t){return String.fromCharCode.apply(String,m(t))},writeString:w,times:v,get:n,slice:a,offset:function(t){return null!=t?(e=t,S):e},skip:function(t){e+=t},toString:function(){throw new Error("FIX CALLER. BinaryStream is no longer convertible to string!")},length:function(){return r},saveExcursion:function(t){var r=e;try{return t()}finally{e=r}},writeBase64:function(t){window.atob?w(window.atob(t)):i(h.decode(t))},base64:function(){return h.encode(n())}};return S}function u(t){return window.atob?function(t){for(var e=window.atob(t),r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r}(t):function(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}(h.decode(t))}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){return Object.keys(t).sort((function(t,e){return t-e})).map(parseFloat)}var d=function(t){this.raw=t,this.scalerType=t.readLong(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort();for(var e=this.tables={},r=0;r<this.tableCount;++r){var o={tag:t.readString(4),checksum:t.readLong(),offset:t.readLong(),length:t.readLong()};e[o.tag]=o}};d.prototype.readTable=function(t,e){var r=this.tables[t];if(!r)throw new Error("Table "+t+" not found in directory");return this[t]=r.table=new e(this,r)},d.prototype.render=function(t){var e=Object.keys(t).length,r=Math.pow(2,Math.floor(Math.log(e)/Math.LN2)),o=16*r,n=Math.floor(Math.log(r)/Math.LN2),i=16*e-o,a=f();a.writeLong(this.scalerType),a.writeShort(e),a.writeShort(o),a.writeShort(n),a.writeShort(i);var s=16*e,c=a.offset()+s,h=null,u=f();for(var l in t)if(p(t,l)){var d=t[l];for(a.writeString(l),a.writeLong(this.checksum(d)),a.writeLong(c),a.writeLong(d.length),u.write(d),"head"==l&&(h=c),c+=d.length;c%4;)u.writeByte(0),c++}a.write(u.get());var g=2981146554-this.checksum(a.get());return a.offset(h+8),a.writeLong(g),a.get()},d.prototype.checksum=function(t){t=f(t);for(var e=0;!t.eof();)e+=t.readLong();return 4294967295&e};var g=function(t,e){this.definition=e,this.length=e.length,this.offset=e.offset,this.file=t,this.rawData=t.raw,this.parse(t.raw)};g.prototype.raw=function(){return this.rawData.slice(this.offset,this.length)},g.prototype.parse=function(){};var y,m,w,v=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset),this.version=t.readLong(),this.revision=t.readLong(),this.checkSumAdjustment=t.readLong(),this.magicNumber=t.readLong(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.read(8),this.modified=t.read(8),this.xMin=t.readShort_(),this.yMin=t.readShort_(),this.xMax=t.readShort_(),this.yMax=t.readShort_(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort_(),this.indexToLocFormat=t.readShort_(),this.glyphDataFormat=t.readShort_()},e.prototype.render=function(t){var e=f();return e.writeLong(this.version),e.writeLong(this.revision),e.writeLong(0),e.writeLong(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.write(this.created),e.write(this.modified),e.writeShort_(this.xMin),e.writeShort_(this.yMin),e.writeShort_(this.xMax),e.writeShort_(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort_(this.fontDirectionHint),e.writeShort_(t),e.writeShort_(this.glyphDataFormat),e.get()},e}(g),S=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset);var e=this.file.head.indexToLocFormat;this.offsets=0===e?t.times(this.length/2,(function(){return 2*t.readShort()})):t.times(this.length/4,t.readLong)},e.prototype.offsetOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.render=function(t){for(var e=f(),r=t[t.length-1]>65535,o=0;o<t.length;++o)r?e.writeLong(t[o]):e.writeShort(t[o]/2);return{format:r?1:0,table:e.get()}},e}(g),b=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset),this.version=t.readLong(),this.ascent=t.readShort_(),this.descent=t.readShort_(),this.lineGap=t.readShort_(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort_(),this.minRightSideBearing=t.readShort_(),this.xMaxExtent=t.readShort_(),this.caretSlopeRise=t.readShort_(),this.caretSlopeRun=t.readShort_(),this.caretOffset=t.readShort_(),t.skip(8),this.metricDataFormat=t.readShort_(),this.numOfLongHorMetrics=t.readShort()},e.prototype.render=function(t){var e=f();return e.writeLong(this.version),e.writeShort_(this.ascent),e.writeShort_(this.descent),e.writeShort_(this.lineGap),e.writeShort(this.advanceWidthMax),e.writeShort_(this.minLeftSideBearing),e.writeShort_(this.minRightSideBearing),e.writeShort_(this.xMaxExtent),e.writeShort_(this.caretSlopeRise),e.writeShort_(this.caretSlopeRun),e.writeShort_(this.caretOffset),e.write([0,0,0,0,0,0,0,0]),e.writeShort_(this.metricDataFormat),e.writeShort(t.length),e.get()},e}(g),x=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset),this.version=t.readLong(),this.numGlyphs=t.readShort(),this.maxPoints=t.readShort(),this.maxContours=t.readShort(),this.maxComponentPoints=t.readShort(),this.maxComponentContours=t.readShort(),this.maxZones=t.readShort(),this.maxTwilightPoints=t.readShort(),this.maxStorage=t.readShort(),this.maxFunctionDefs=t.readShort(),this.maxInstructionDefs=t.readShort(),this.maxStackElements=t.readShort(),this.maxSizeOfInstructions=t.readShort(),this.maxComponentElements=t.readShort(),this.maxComponentDepth=t.readShort()},e.prototype.render=function(t){var e=f();return e.writeLong(this.version),e.writeShort(t.length),e.writeShort(this.maxPoints),e.writeShort(this.maxContours),e.writeShort(this.maxComponentPoints),e.writeShort(this.maxComponentContours),e.writeShort(this.maxZones),e.writeShort(this.maxTwilightPoints),e.writeShort(this.maxStorage),e.writeShort(this.maxFunctionDefs),e.writeShort(this.maxInstructionDefs),e.writeShort(this.maxStackElements),e.writeShort(this.maxSizeOfInstructions),e.writeShort(this.maxComponentElements),e.writeShort(this.maxComponentDepth),e.get()},e}(g),_=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset);var e=this.file,r=e.hhea;this.metrics=t.times(r.numOfLongHorMetrics,(function(){return{advance:t.readShort(),lsb:t.readShort_()}}));var o=e.maxp.numGlyphs-e.hhea.numOfLongHorMetrics;this.leftSideBearings=t.times(o,t.readShort_)},e.prototype.forGlyph=function(t){var e=this.metrics,r=e.length;return t<r?e[t]:{advance:e[r-1].advance,lsb:this.leftSideBearings[t-r]}},e.prototype.render=function(t){for(var e=f(),r=0;r<t.length;++r){var o=this.forGlyph(t[r]);e.writeShort(o.advance),e.writeShort_(o.lsb)}return e.get()},e}(g),C=function(){var t=function(t){this.raw=t},e={compound:{}};e.compound.get=function(){return!1},t.prototype.render=function(){return this.raw.get()},Object.defineProperties(t.prototype,e);var r=function(t){this.raw=t;for(var e=this.glyphIds=[],r=this.idOffsets=[];;){var o=t.readShort();if(r.push(t.offset()),e.push(t.readShort()),!(32&o))break;t.skip(1&o?4:2),128&o?t.skip(8):64&o?t.skip(4):8&o&&t.skip(2)}},o={compound:{}};return o.compound.get=function(){return!0},r.prototype.render=function(t){for(var e=f(this.raw.get()),r=0;r<this.glyphIds.length;++r){var o=this.glyphIds[r];e.offset(this.idOffsets[r]),e.writeShort(t[o])}return e.get()},Object.defineProperties(r.prototype,o),function(e){function o(){e.apply(this,arguments)}return i(o,e),o.prototype=Object.create(e&&e.prototype),o.prototype.constructor=o,o.fn=o.prototype,o.fn.init=o.fn.constructor,o.prototype.parse=function(){this.cache={}},o.prototype.glyphFor=function(e){var o=this.cache;if(p(o,e))return o[e];var n=this.file.loca,i=n.lengthOf(e);if(0===i)return o[e]=null;var a=this.rawData,s=this.offset+n.offsetOf(e),c=f(a.slice(s,i)),h=c.readShort_(),u=c.readShort_(),l=c.readShort_(),d=c.readShort_(),g=c.readShort_(),y=o[e]=h<0?new r(c):new t(c);return y.numberOfContours=h,y.xMin=u,y.yMin=l,y.xMax=d,y.yMax=g,y},o.prototype.render=function(t,e,r){for(var o=f(),n=[],i=0;i<e.length;++i){var a=t[e[i]];o.offset()%2&&o.writeByte(0),n.push(o.offset()),a&&o.write(a.render(r))}return o.offset()%2&&o.writeByte(0),n.push(o.offset()),{table:o.get(),offsets:n}},o}(g)}(),k=(y=function(t,e){this.text=t,this.length=t.length,this.platformID=e.platformID,this.platformSpecificID=e.platformSpecificID,this.languageID=e.languageID,this.nameID=e.nameID},function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset),t.readShort();for(var e=t.readShort(),r=this.offset+t.readShort(),o=t.times(e,(function(){return{platformID:t.readShort(),platformSpecificID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:t.readShort()+r}})),n=this.strings={},i=0;i<o.length;++i){var a=o[i];t.offset(a.offset);var s=t.readString(a.length);n[a.nameID]||(n[a.nameID]=[]),n[a.nameID].push(new y(s,a))}this.postscriptEntry=n[6][0],this.postscriptName=this.postscriptEntry.text.replace(/[^\x20-\x7F]/g,"")},e.prototype.render=function(t){var e=this.strings,r=0;for(var o in e)p(e,o)&&(r+=e[o].length);var n=f(),i=f();for(o in n.writeShort(0),n.writeShort(r),n.writeShort(6+12*r),e)if(p(e,o))for(var a=6==o?[new y(t,this.postscriptEntry)]:e[o],s=0;s<a.length;++s){var c=a[s];n.writeShort(c.platformID),n.writeShort(c.platformSpecificID),n.writeShort(c.languageID),n.writeShort(c.nameID),n.writeShort(c.length),n.writeShort(i.offset()),i.writeString(c.text)}return n.write(i.get()),n.get()},e}(g)),D=(m=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(/\s+/g),function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){var e;switch(t.offset(this.offset),this.format=t.readLong(),this.italicAngle=t.readFixed_(),this.underlinePosition=t.readShort_(),this.underlineThickness=t.readShort_(),this.isFixedPitch=t.readLong(),this.minMemType42=t.readLong(),this.maxMemType42=t.readLong(),this.minMemType1=t.readLong(),this.maxMemType1=t.readLong(),this.format){case 65536:case 196608:break;case 131072:e=t.readShort(),this.glyphNameIndex=t.times(e,t.readShort),this.names=[];for(var r=this.offset+this.length;t.offset()<r;)this.names.push(t.readString(t.readByte()));break;case 151552:e=t.readShort(),this.offsets=t.read(e);break;case 262144:this.map=t.times(this.file.maxp.numGlyphs,t.readShort)}},e.prototype.glyphFor=function(t){switch(this.format){case 65536:return m[t]||".notdef";case 131072:var e=this.glyphNameIndex[t];return e<m.length?m[e]:this.names[e-m.length]||".notdef";case 151552:case 196608:return".notdef";case 262144:return this.map[t]||65535}},e.prototype.render=function(t){if(196608==this.format)return this.raw();var e=f(this.rawData.slice(this.offset,32));e.writeLong(131072),e.offset(32);for(var r=[],o=[],n=0;n<t.length;++n){var i=t[n],a=this.glyphFor(i),s=m.indexOf(a);s>=0?r.push(s):(r.push(m.length+o.length),o.push(a))}for(e.writeShort(t.length),n=0;n<r.length;++n)e.writeShort(r[n]);for(n=0;n<o.length;++n)e.writeByte(o[n].length),e.writeString(o[n]);return e.get()},e}(g)),T=(w=function(t,e,r){var o=this;o.platformID=t.readShort(),o.platformSpecificID=t.readShort(),o.offset=e+t.readLong(),t.saveExcursion((function(){var e;switch(t.offset(o.offset),o.format=t.readShort(),o.format){case 0:o.length=t.readShort(),o.language=t.readShort();for(var n=0;n<256;++n)r[n]=t.readByte();break;case 4:o.length=t.readShort(),o.language=t.readShort();var i=t.readShort()/2;t.skip(6);var a=t.times(i,t.readShort);t.skip(2);var s=t.times(i,t.readShort),c=t.times(i,t.readShort_),h=t.times(i,t.readShort),f=(o.length+o.offset-t.offset())/2,u=t.times(f,t.readShort);for(n=0;n<i;++n){var p=s[n],l=a[n];for(e=p;e<=l;++e){var d;0===h[n]?d=e+c[n]:0!==(d=u[h[n]/2-(i-n)+(e-p)]||0)&&(d+=c[n]),r[e]=65535&d}}break;case 6:o.length=t.readShort(),o.language=t.readShort(),e=t.readShort();for(var g=t.readShort();g-- >0;)r[e++]=t.readShort();break;case 12:t.readShort(),o.length=t.readLong(),o.language=t.readLong();for(var y=t.readLong();y-- >0;){e=t.readLong();for(var m=t.readLong(),w=t.readLong();e<=m;)r[e++]=w++}break;default:window.console&&window.console.error("Unhandled CMAP format: "+o.format)}}))},function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){var e=this,r=e.offset;t.offset(r),e.codeMap={},e.version=t.readShort();var o=t.readShort();e.tables=t.times(o,(function(){return new w(t,r,e.codeMap)}))},e.render=function(t,e){var r=f();return r.writeShort(0),r.writeShort(1),r.write(function(t,e){var r=l(t),o=[],n=[],i=null,a=null;function s(r){return e[t[r]]}for(var c=0;c<r.length;++c){var h=r[c],u=s(h)-h;null!=i&&u===a||(i&&n.push(i),o.push(h),a=u),i=h}i&&n.push(i),n.push(65535),o.push(65535);var p=o.length,d=2*p,g=2*Math.pow(2,Math.floor(Math.log(p)/Math.LN2)),y=Math.log(g/2)/Math.LN2,m=d-g,w=[],v=[],S=[];for(c=0;c<p;++c){var b=o[c],x=n[c];if(65535==b){w.push(0),v.push(0);break}var _=s(b);if(b-_>=32768){w.push(0),v.push(2*(S.length+p-c));for(var C=b;C<=x;++C)S.push(s(C))}else w.push(_-b),v.push(0)}var k=f();return k.writeShort(3),k.writeShort(1),k.writeLong(12),k.writeShort(4),k.writeShort(16+8*p+2*S.length),k.writeShort(0),k.writeShort(d),k.writeShort(g),k.writeShort(y),k.writeShort(m),n.forEach(k.writeShort),k.writeShort(0),o.forEach(k.writeShort),w.forEach(k.writeShort_),v.forEach(k.writeShort),S.forEach(k.writeShort),k.get()}(t,e)),r.get()},e}(g)),O=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.parse=function(t){t.offset(this.offset),this.version=t.readShort(),this.averageCharWidth=t.readShort_(),this.weightClass=t.readShort(),this.widthClass=t.readShort(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort_(),this.ySubscriptYSize=t.readShort_(),this.ySubscriptXOffset=t.readShort_(),this.ySubscriptYOffset=t.readShort_(),this.ySuperscriptXSize=t.readShort_(),this.ySuperscriptYSize=t.readShort_(),this.ySuperscriptXOffset=t.readShort_(),this.ySuperscriptYOffset=t.readShort_(),this.yStrikeoutSize=t.readShort_(),this.yStrikeoutPosition=t.readShort_(),this.familyClass=t.readShort_(),this.panose=t.times(10,t.readByte),this.charRange=t.times(4,t.readLong),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort_(),this.descent=t.readShort_(),this.lineGap=t.readShort_(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=t.times(2,t.readLong),this.version>1&&(this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()))},e.prototype.render=function(){return this.raw()},e}(g),F=1e5;var L=function(t){this.font=t,this.subset={},this.unicodes={},this.ogid2ngid={0:0},this.ngid2ogid={0:0},this.ncid2ogid={},this.next=this.firstChar=1,this.nextGid=1,this.psName=function(){for(var t="",e=String(F),r=0;r<e.length;++r)t+=String.fromCharCode(e.charCodeAt(r)-48+65);return++F,t}()+"+"+this.font.psName};L.prototype.use=function(t){var e=this;if("string"==typeof t)return function(t){for(var e,r,o=[],n=0,i=t.length;n<i;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<i?56320==(64512&(r=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&r)+65536):(o.push(e),n--):o.push(e);return o}(t).reduce((function(t,r){return t+String.fromCharCode(e.use(r))}),"");var r=e.unicodes[t];if(!r){r=e.next++,e.subset[r]=t,e.unicodes[t]=r;var o=e.font.cmap.codeMap[t];if(o&&(e.ncid2ogid[r]=o,null==e.ogid2ngid[o])){var n=e.nextGid++;e.ogid2ngid[o]=n,e.ngid2ogid[n]=o}}return r},L.prototype.encodeText=function(t){return this.use(t)},L.prototype.glyphIds=function(){return l(this.ogid2ngid)},L.prototype.glyphsFor=function(t,e){e||(e={});for(var r=0;r<t.length;++r){var o=t[r];if(!e[o]){var n=e[o]=this.font.glyf.glyphFor(o);n&&n.compound&&this.glyphsFor(n.glyphIds,e)}}return e},L.prototype.render=function(){var t=this,e=this.glyphsFor(this.glyphIds());for(var r in e)if(p(e,r)&&(r=parseInt(r,10),null==t.ogid2ngid[r])){var o=t.nextGid++;t.ogid2ngid[r]=o,t.ngid2ogid[o]=r}var n=l(this.ngid2ogid).map((function(t){return this.ngid2ogid[t]}),this),i=this.font,a=i.glyf.render(e,n,this.ogid2ngid),s=i.loca.render(a.offsets);this.lastChar=this.next-1;var c={cmap:T.render(this.ncid2ogid,this.ogid2ngid),glyf:a.table,loca:s.table,hmtx:i.hmtx.render(n),hhea:i.hhea.render(n),maxp:i.maxp.render(n),post:i.post.render(n),name:i.name.render(this.psName),head:i.head.render(s.format),"OS/2":i.os2.render()};return this.font.directory.render(c)},L.prototype.cidToGidMap=function(){for(var t=f(),e=0,r=this.firstChar;r<this.next;++r){for(;e<r;)t.writeShort(0),e++;var o=this.ncid2ogid[r];if(o){var n=this.ogid2ngid[o];t.writeShort(n)}else t.writeShort(0);e++}return t.get()};var I=function(t,e){var r=this,o=r.contents=f(t);if("ttcf"==o.readString(4)){var n,i=function(){o.offset(n),r.parse()};if(!e)throw new Error("Must specify a name for TTC files");o.readLong();for(var a=o.readLong(),s=0;s<a;++s)if(n=o.readLong(),o.saveExcursion(i),r.psName==e)return;throw new Error("Font "+e+" not found in collection")}o.offset(0),r.parse()};I.prototype.parse=function(){var t=this.directory=new d(this.contents);this.head=t.readTable("head",v),this.loca=t.readTable("loca",S),this.hhea=t.readTable("hhea",b),this.maxp=t.readTable("maxp",x),this.hmtx=t.readTable("hmtx",_),this.glyf=t.readTable("glyf",C),this.name=t.readTable("name",k),this.post=t.readTable("post",D),this.cmap=t.readTable("cmap",T),this.os2=t.readTable("OS/2",O),this.psName=this.name.postscriptName,this.ascent=this.os2.ascent||this.hhea.ascent,this.descent=this.os2.descent||this.hhea.descent,this.lineGap=this.os2.lineGap||this.hhea.lineGap,this.scale=1e3/this.head.unitsPerEm},I.prototype.widthOfGlyph=function(t){return this.hmtx.forGlyph(t).advance*this.scale},I.prototype.makeSubset=function(){return new L(this)};var A=String.fromCharCode;function M(t){return A(t>>8)+A(255&t)}var R=kendo.support.browser,P="\n",G=0,E={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]};function N(){var t=0,e=f();function r(){for(var t=arguments,o=0;o<arguments.length;++o){var n=t[o];if(void 0===n)throw new Error("Cannot output undefined to PDF");if(n instanceof nt)n.beforeRender(r),n.render(r);else if(K(n))$(n,r);else if(Q(n))V(n,r);else if("number"==typeof n){if(isNaN(n))throw new Error("Cannot output NaN to PDF");var i=n.toFixed(7);i.indexOf(".")>=0&&(i=i.replace(/\.?0+$/,"")),"-0"==i&&(i="0"),e.writeString(i)}else/string|boolean/.test(typeof n)?e.writeString(String(n)):"function"==typeof n.get?e.write(n.get()):"object"==typeof n&&(n?r(new ft(n)):e.writeString("null"))}}return r.writeData=function(t){e.write(t)},r.withIndent=function(e){++t,e(r),--t},r.indent=function(){r(P,J("",2*t," ")),r.apply(null,arguments)},r.offset=function(){return e.offset()},r.toString=function(){throw new Error("FIX CALLER")},r.get=function(){return e.get()},r.stream=function(){return e},r}function B(t){if("function"!=typeof t){var e=t;t=function(t,r){return t in e?e[t]:r}}var r=t("paperSize",E.a4);if(!r)return{};if("string"==typeof r&&null==(r=E[r.toLowerCase()]))throw new Error("Unknown paper size");r[0]=ot(r[0]),r[1]=ot(r[1]),t("landscape",!1)&&(r=[Math.max(r[0],r[1]),Math.min(r[0],r[1])]);var o=t("margin");return o&&(o="string"==typeof o||"number"==typeof o?{left:o=ot(o,0),top:o,right:o,bottom:o}:{left:ot(o.left,0),top:ot(o.top,0),right:ot(o.right,0),bottom:ot(o.bottom,0)},t("addMargin")&&(r[0]+=o.left+o.right,r[1]+=o.top+o.bottom)),{paperSize:r,margin:o}}var j={"Times-Roman":!0,"Times-Bold":!0,"Times-Italic":!0,"Times-BoldItalic":!0,Helvetica:!0,"Helvetica-Bold":!0,"Helvetica-Oblique":!0,"Helvetica-BoldOblique":!0,Courier:!0,"Courier-Bold":!0,"Courier-Oblique":!0,"Courier-BoldOblique":!0,Symbol:!0,ZapfDingbats:!0};var U={};function z(){U={}}var q,H=(q=function(t,e){var r=j[t];r?e(r):function(t,e){var r;if(R.msie&&(r=/^data:.*?;base64,/i.exec(t)))e(u(t.substr(r[0].length)));else{var o=new XMLHttpRequest;o.open("GET",t,!0),c&&(o.responseType="arraybuffer"),o.onload=function(){200==o.status||304==o.status?e(c?new Uint8Array(o.response):new window.VBArray(o.responseBody).toArray()):n()},o.onerror=n,o.send(null)}function n(){window.console&&(window.console.error?window.console.error("Cannot load URL: %s",t):window.console.log("Cannot load URL: %s",t)),e(null)}}(t,(function(r){if(null==r)throw new Error("Cannot load font from "+t);var o=new I(r);j[t]=o,e(o)}))},function(t,e){var r=t.length,o=r;if(0===r)return e();function n(){0==--r&&e()}for(;o-- >0;)q(t[o],n)}),X=function(e,r,o){o=t.extend({jpegQuality:.92,keepPNG:!1},o);var i=Object.keys(e),a=i.length;if(0===a)return r();function s(){0==--a&&r()}i.forEach((function(t){!function(t,e,r,o){var i,a,s=U[t];if(s)r(s);else if(s=new Image,/^data:/i.test(t)||(s.crossOrigin="Anonymous"),c&&!/^data:/i.test(t)){var h=new XMLHttpRequest;h.onload=function(){if(a=h.response,R.mozilla&&"image/svg+xml"==a.type){var t=new FileReader;t.onload=function(){var t=(new window.DOMParser).parseFromString(this.result,"image/svg+xml").documentElement;if(t.getAttribute("width")&&t.getAttribute("height"))u(i=URL.createObjectURL(a));else{t.setAttribute("width",e.width),t.setAttribute("height",e.height);var r=(new window.XMLSerializer).serializeToString(t);u("data:image/svg+xml;base64,"+n.encodeBase64(r))}},t.readAsText(a)}else u(i=URL.createObjectURL(a))},h.onerror=l,h.open("GET",t,!0),h.responseType="blob",h.send()}else u(t);function u(t){s.src=t,s.complete&&!R.msie?d.call(s):(s.onload=d,s.onerror=l)}function p(){e||(e={width:s.width,height:s.height});var n=document.createElement("canvas");n.width=e.width,n.height=e.height;var a,c=n.getContext("2d");c.drawImage(s,0,0,e.width,e.height);try{a=c.getImageData(0,0,e.width,e.height)}catch(t){return void l()}finally{i&&URL.revokeObjectURL(i)}for(var h=!1,u=f(),p=f(),d=a.data,g=0;g<d.length;){u.writeByte(d[g++]),u.writeByte(d[g++]),u.writeByte(d[g++]);var y=d[g++];y<255&&(h=!0),p.writeByte(y)}if(h||o.keepPNG)s=new yt(e.width,e.height,u,p);else{var m=n.toDataURL("image/jpeg",o.jpegQuality);m=m.substr(m.indexOf(";base64,")+8);var w=f();w.writeBase64(m),s=new gt(w)}r(U[t]=s)}function l(){r(U[t]="ERROR")}function d(){if(e){var o=a&&"image/svg+xml"===a.type||/^data:image\/svg\+xml;/i.test(this.src.substring(0,19)),n=e.width>=s.width||e.height>=s.height;!o&&n&&(e=null)}if(!e&&a&&/^image\/jpe?g$/i.test(a.type)){var c=new FileReader;c.onload=function(){try{var e=new gt(f(new Uint8Array(this.result)));URL.revokeObjectURL(i),r(U[t]=e)}catch(t){p()}},c.readAsArrayBuffer(a)}else p()}}(t,e[t],s,o)}))},W=function(t){var e=this,r=N(),o=0,n=[];function i(e,r){return t&&null!=t[e]?t[e]:r}e.getOption=i,e.attach=function(t){return n.indexOf(t)<0&&(!function(t,e){var r=t.beforeRender,o=t.render;t.beforeRender=function(){},t.render=function(t){t(e," 0 R")},t.renderFull=function(n){t._offset=n.offset(),n(e," 0 obj "),r.call(t,n),o.call(t,n),n(" endobj")}}(t,++o),n.push(t)),t},e.pages=[],e.FONTS={},e.IMAGES={},e.GRAD_COL_FUNCTIONS={},e.GRAD_OPC_FUNCTIONS={},e.GRAD_COL={},e.GRAD_OPC={};var a=e.attach(new pt),s=e.attach(new lt);if(i("autoPrint")){var c={};c.JavaScript=new ft({Names:[new it("JS"),e.attach(new ft({S:ht("JavaScript"),JS:new it("print(true);")}))]}),a.props.Names=new ft(c)}a.setPages(s);var h=e.attach(new ft({Producer:new it(i("producer","Kendo UI PDF Generator"),!0),Title:new it(i("title",""),!0),Author:new it(i("author",""),!0),Subject:new it(i("subject",""),!0),Keywords:new it(i("keywords",""),!0),Creator:new it(i("creator","Kendo UI PDF Generator"),!0),CreationDate:i("date",new Date)}));e.addPage=function(t){var r=B((function(e,r){return t&&null!=t[e]?t[e]:r})),o=r.paperSize,n=r.margin,i=o[0],a=o[1];n&&(i-=n.left+n.right,a-=n.top+n.bottom);var c=new ut(N(),null,!0),h={Contents:e.attach(c),Parent:s,MediaBox:[0,0,o[0],o[1]]},f=new Ct(e,h);return f._content=c,s.addPage(e.attach(f)),f.transform(1,0,0,-1,0,o[1]),n&&(f.translate(n.left,n.top),f.rect(0,0,i,a),f.clip()),e.pages.push(f),f},e.render=function(){var t;for(r("%PDF-1.4",P,"%ÂÁÚÏÎ",P,P),t=0;t<n.length;++t)n[t].renderFull(r),r(P,P);var e=r.offset();for(r("xref",P,0," ",n.length+1,P),r("0000000000 65535 f ",P),t=0;t<n.length;++t)r(Z(n[t]._offset,10)," 00000 n ",P);return r(P),r("trailer",P),r(new ft({Size:n.length+1,Root:a,Info:h}),P,P),r("startxref",P,e,P),r("%%EOF",P),r.stream().offset(0)},e.loadFonts=H,e.loadImages=X};function J(t,e,r){for(;t.length<e;)t=r+t;return t}function Z(t,e){return J(String(t),e,"0")}function Y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}W.prototype.getFont=function(t){var e=this.FONTS[t];if(!e){if(!(e=j[t]))throw new Error("Font "+t+" has not been loaded");e=!0===e?this.attach(new mt(t)):this.attach(new wt(this,e)),this.FONTS[t]=e}return e},W.prototype.getImage=function(t){var e=this.IMAGES[t];if(!e){if(!(e=U[t]))throw new Error("Image "+t+" has not been loaded");if("ERROR"===e)return null;e=this.IMAGES[t]=this.attach(e.asStream(this))}return e},W.prototype.getOpacityGS=function(t,e){var r=parseFloat(t).toFixed(3);t=parseFloat(r),r+=e?"S":"F";var o=this._opacityGSCache||(this._opacityGSCache={}),n=o[r];if(!n){var i={Type:ht("ExtGState")};e?i.CA=t:i.ca=t,(n=this.attach(new ft(i)))._resourceName=ht("GS"+ ++G),o[r]=n}return n},W.prototype.dict=function(t){return new ft(t)},W.prototype.name=function(t){return ht(t)},W.prototype.stream=function(t,e){return new ut(e,t)};var K=Array.isArray||function(t){return t instanceof Array};function Q(t){return t instanceof Date}function $(t,e){e("["),t.length>0&&e.withIndent((function(){for(var r=0;r<t.length;++r)r>0&&r%8==0?e.indent(t[r]):e(" ",t[r])})),e(" ]")}function V(t,e){e("(D:",Z(t.getUTCFullYear(),4),Z(t.getUTCMonth()+1,2),Z(t.getUTCDate(),2),Z(t.getUTCHours(),2),Z(t.getUTCMinutes(),2),Z(t.getUTCSeconds(),2),"Z)")}function tt(t){return t*(72/25.4)}function et(t){return tt(10*t)}function rt(t){return 72*t}function ot(t,e){if("number"==typeof t)return t;var r;if("string"==typeof t&&(r=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(t))){var o=parseFloat(r[1]);if(!isNaN(o))return"pt"==r[2]?o:{mm:tt,cm:et,in:rt}[r[2]](o)}if(null!=e)return e;throw new Error("Can't parse unit: "+t)}var nt=function(){};nt.prototype.beforeRender=function(){};var it=function(t){function e(e,r){t.call(this),this.value=e,this.utf16be=Boolean(r)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.render=function(t){var e=this.value;if(this.utf16be)e="þÿ"+function(t){for(var e="",r=0;r<t.length;r++){var o=t.charCodeAt(r);if(o<65535)e+=M(o);else{var n=56320+(o-65536&1023);e+=M(55296+(o-65536>>10)),e+=M(n)}}return e}(e),t("(",e=e.replace(/([\(\)\\])/g,"\\$1"),")");else{for(var r=[40],o=0;o<e.length;++o){var n=255&e.charCodeAt(o);40!=n&&41!=n&&92!=n||r.push(92),r.push(n)}r.push(41),t.writeData(r)}},e.prototype.toString=function(){return this.value},e}(nt),at=function(t){function e(e){t.call(this,e),this.value=e}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.render=function(t){t("<");for(var e=0;e<this.value.length;++e)t(Z(this.value.charCodeAt(e).toString(16),4));t(">")},e}(it),st=function(t){function e(e){t.call(this),this.name=e}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.get=function(t){return ht(t)},e.prototype.render=function(t){t("/"+this.escape())},e.prototype.escape=function(){return this.name.replace(/[^\x21-\x7E]/g,(function(t){return"#"+Z(t.charCodeAt(0).toString(16),2)}))},e.prototype.toString=function(){return this.name},e}(nt),ct={};function ht(t){return Y(ct,t)?ct[t]:ct[t]=new st(t)}var ft=function(t){function e(e){t.call(this),this.props=e}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.render=function(t){var e=this.props,r=!0;t("<<"),t.withIndent((function(){for(var o in e)Y(e,o)&&!/^_/.test(o)&&(r=!1,t.indent(ht(o)," ",e[o]))})),r||t.indent(),t(">>")},e}(nt),ut=function(t){function e(e,r,o){if(t.call(this),"string"==typeof e){var n=f();n.write(e),e=n}this.data=e,this.props=r||{},this.compress=o}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.render=function(t){var e=this.data.get(),r=this.props;this.compress&&a.supportsDeflate()&&(r.Filter?r.Filter instanceof Array||(r.Filter=[r.Filter]):r.Filter=[],r.Filter.unshift(ht("FlateDecode")),e=a.deflate(e)),r.Length=e.length,t(new ft(r)," stream",P),t.writeData(e),t(P,"endstream")},e}(nt),pt=function(t){function e(){t.call(this,{Type:ht("Catalog")})}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.setPages=function(t){this.props.Pages=t},e}(ft),lt=function(t){function e(){t.call(this,{Type:ht("Pages"),Kids:[],Count:0})}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.addPage=function(t){this.props.Kids.push(t),this.props.Count++},e}(ft),dt=[192,193,194,195,197,198,199,201,202,203,205,206,207],gt=function(t){var e,r,o,n;if(t.offset(0),65496!=t.readShort())throw new Error("Invalid JPEG image");for(;!t.eof();){if(255!=t.readByte())throw new Error("Invalid JPEG image");var i=t.readByte(),a=t.readShort();if(dt.indexOf(i)>=0){n=t.readByte(),r=t.readShort(),e=t.readShort(),o=t.readByte();break}t.skip(a-2)}if(null==o)throw new Error("Invalid JPEG image");var s={Type:ht("XObject"),Subtype:ht("Image"),Width:e,Height:r,BitsPerComponent:n,Filter:ht("DCTDecode")};switch(o){case 1:s.ColorSpace=ht("DeviceGray");break;case 3:s.ColorSpace=ht("DeviceRGB");break;case 4:s.ColorSpace=ht("DeviceCMYK"),s.Decode=[1,0,1,0,1,0,1,0]}this.asStream=function(){t.offset(0);var e=new ut(t,s);return e._resourceName=ht("I"+ ++G),e}},yt=function(t,e,r,o){this.asStream=function(n){var i=new ut(o,{Type:ht("XObject"),Subtype:ht("Image"),Width:t,Height:e,BitsPerComponent:8,ColorSpace:ht("DeviceGray")},!0),a=new ut(r,{Type:ht("XObject"),Subtype:ht("Image"),Width:t,Height:e,BitsPerComponent:8,ColorSpace:ht("DeviceRGB"),SMask:n.attach(i)},!0);return a._resourceName=ht("I"+ ++G),a}},mt=function(t){function e(e){t.call(this,{Type:ht("Font"),Subtype:ht("Type1"),BaseFont:ht(e)}),this._resourceName=ht("F"+ ++G)}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.encodeText=function(t){return new it(String(t))},e}(ft),wt=function(t){function e(e,r,o){t.call(this,{}),(o=this.props).Type=ht("Font"),o.Subtype=ht("Type0"),o.Encoding=ht("Identity-H"),this._pdf=e,this._font=r,this._sub=r.makeSubset(),this._resourceName=ht("F"+ ++G);var n=r.head;this.name=r.psName;var i=this.scale=r.scale;this.bbox=[n.xMin*i,n.yMin*i,n.xMax*i,n.yMax*i],this.italicAngle=r.post.italicAngle,this.ascent=r.ascent*i,this.descent=r.descent*i,this.lineGap=r.lineGap*i,this.capHeight=r.os2.capHeight||this.ascent,this.xHeight=r.os2.xHeight||0,this.stemV=0,this.familyClass=(r.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&this.familyClass<=7,this.isScript=10==this.familyClass,this.flags=(r.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(0!==this.italicAngle?64:0)|32}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.encodeText=function(t){return new at(this._sub.encodeText(String(t)))},e.prototype.getTextWidth=function(t,e){for(var r=0,o=this._font.cmap.codeMap,n=0;n<e.length;++n){var i=o[e.charCodeAt(n)];r+=this._font.widthOfGlyph(i||0)}return r*t/1e3},e.prototype.beforeRender=function(){var e=this,r=e._sub,o=r.render(),n=new ut(f(o),{Length1:o.length},!0),i=e._pdf.attach(new t({Type:ht("FontDescriptor"),FontName:ht(e._sub.psName),FontBBox:e.bbox,Flags:e.flags,StemV:e.stemV,ItalicAngle:e.italicAngle,Ascent:e.ascent,Descent:e.descent,CapHeight:e.capHeight,XHeight:e.xHeight,FontFile2:e._pdf.attach(n)})),a=r.ncid2ogid,s=r.firstChar,c=r.lastChar,h=[];!function t(r,o){if(r<=c){var n=a[r];null==n?t(r+1):(o||h.push(r,o=[]),o.push(e._font.widthOfGlyph(n)),t(r+1,o))}}(s);var u=new t({Type:ht("Font"),Subtype:ht("CIDFontType2"),BaseFont:ht(e._sub.psName),CIDSystemInfo:new t({Registry:new it("Adobe"),Ordering:new it("Identity"),Supplement:0}),FontDescriptor:i,FirstChar:s,LastChar:c,DW:Math.round(e._font.widthOfGlyph(0)),W:h,CIDToGIDMap:e._pdf.attach(e._makeCidToGidMap())}),p=e.props;p.BaseFont=ht(e._sub.psName),p.DescendantFonts=[e._pdf.attach(u)];var l=new vt(s,c,r.subset),d=new ut(N(),null,!0);d.data(l),p.ToUnicode=e._pdf.attach(d)},e.prototype._makeCidToGidMap=function(){return new ut(f(this._sub.cidToGidMap()),null,!0)},e}(ft),vt=function(t){function e(e,r,o){t.call(this),this.firstChar=e,this.lastChar=r,this.map=o}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype.render=function(t){t.indent("/CIDInit /ProcSet findresource begin"),t.indent("12 dict begin"),t.indent("begincmap"),t.indent("/CIDSystemInfo <<"),t.indent(" /Registry (Adobe)"),t.indent(" /Ordering (UCS)"),t.indent(" /Supplement 0"),t.indent(">> def"),t.indent("/CMapName /Adobe-Identity-UCS def"),t.indent("/CMapType 2 def"),t.indent("1 begincodespacerange"),t.indent(" <0000><ffff>"),t.indent("endcodespacerange");var e=this;t.indent(e.lastChar-e.firstChar+1," beginbfchar"),t.withIndent((function(){for(var r=e.firstChar;r<=e.lastChar;++r){var o=e.map[r],n=[o].map((function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)})).join("");t.indent("<",Z(r.toString(16),4),">","<");for(var i=0;i<n.length;++i)t(Z(n.charCodeAt(i).toString(16),4));t(">")}})),t.indent("endbfchar"),t.indent("endcmap"),t.indent("CMapName currentdict /CMap defineresource pop"),t.indent("end"),t.indent("end")},e}(nt);function St(t){return t.map((function(t){return K(t)?St(t):"number"==typeof t?(Math.round(1e3*t)/1e3).toFixed(3):t})).join(" ")}function bt(t,e,r,o,n,i,a){var s=St([e,r,o,n,i,a]),c=t.GRAD_COL_FUNCTIONS[s];return c||(c=t.GRAD_COL_FUNCTIONS[s]=t.attach(new ft({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[e,r,o],C1:[n,i,a]}))),c}function xt(t,e,r){var o=St([e,r]),n=t.GRAD_OPC_FUNCTIONS[o];return n||(n=t.GRAD_OPC_FUNCTIONS[o]=t.attach(new ft({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[e],C1:[r]}))),n}function _t(t,e,r){var o="radial"==e.type,n=function(t,e){var r,o,n,i,a,s=!1,c=[],h=[],f=[],u=[];for(r=1;r<e.length;++r)o=e[r-1],n=e[r],i=o.color,a=n.color,h.push(bt(t,i.r,i.g,i.b,a.r,a.g,a.b)),(i.a<1||a.a<1)&&(s=!0),f.push(n.offset),u.push(0,1);if(s)for(r=1;r<e.length;++r)o=e[r-1],n=e[r],i=o.color,a=n.color,c.push(xt(t,i.a,a.a));return f.pop(),{hasAlpha:s,colors:p(h),opacities:s?p(c):null};function p(t){return 1==t.length?t[0]:{FunctionType:3,Functions:t,Domain:[0,1],Bounds:f,Encode:u}}}(t,e.stops),i=o?[e.start.x,e.start.y,e.start.r,e.end.x,e.end.y,e.end.r]:[e.start.x,e.start.y,e.end.x,e.end.y],a=function(t,e,r,o,n,i){var a,s;if(!i){var c=[e].concat(o);r.forEach((function(t){c.push(t.offset,t.color.r,t.color.g,t.color.b)})),s=St(c),a=t.GRAD_COL[s]}return a||(a=new ft({Type:ht("Shading"),ShadingType:e?3:2,ColorSpace:ht("DeviceRGB"),Coords:o,Domain:[0,1],Function:n,Extend:[!0,!0]}),t.attach(a),a._resourceName="S"+ ++G,s&&(t.GRAD_COL[s]=a)),a}(t,o,e.stops,i,n.colors,e.userSpace&&r),s=n.hasAlpha?function(t,e,r,o,n,i){var a,s;if(!i){var c=[e].concat(o);r.forEach((function(t){c.push(t.offset,t.color.a)})),s=St(c),a=t.GRAD_OPC[s]}return a||(a=new ft({Type:ht("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:ht("Mask"),S:ht("Luminosity"),G:t.attach(new ut("/a0 gs /s0 sh",{Type:ht("XObject"),Subtype:ht("Form"),FormType:1,BBox:i?[i.left,i.top+i.height,i.left+i.width,i.top]:[0,1,1,0],Group:{Type:ht("Group"),S:ht("Transparency"),CS:ht("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:ht("DeviceGray"),Coords:o,Domain:[0,1],ShadingType:e?3:2,Function:n,Extend:[!0,!0]}}}}))}}),t.attach(a),a._resourceName="O"+ ++G,s&&(t.GRAD_OPC[s]=a)),a}(t,o,e.stops,i,n.opacities,e.userSpace&&r):null;return{hasAlpha:n.hasAlpha,shading:a,opacity:s}}var Ct=function(t){function e(e,r){t.call(this,r),this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._annotations=[],this._font=null,this._fontSize=null,this._contextStack=[],(r=this.props).Type=ht("Page"),r.ProcSet=[ht("PDF"),ht("Text"),ht("ImageB"),ht("ImageC"),ht("ImageI")],r.Resources=new t({Font:new t(this._fontResources),ExtGState:new t(this._gsResources),XObject:new t(this._xResources),Pattern:new t(this._patResources),Shading:new t(this._shResources)}),r.Annots=this._annotations}return i(e,t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fn=e.prototype,e.fn.init=e.fn.constructor,e.prototype._out=function(){this._content.data.apply(null,arguments)},e.prototype.transform=function(t,e,r,o,n,i){It(arguments)||(this._matrix=Lt(arguments,this._matrix),this._out(t," ",e," ",r," ",o," ",n," ",i," cm"),this._out(P))},e.prototype.translate=function(t,e){this.transform(1,0,0,1,t,e)},e.prototype.scale=function(t,e){this.transform(t,0,0,e,0,0)},e.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t);this.transform(e,r,-r,e,0,0)},e.prototype.beginText=function(){this._textMode=!0,this._out("BT",P)},e.prototype.endText=function(){this._textMode=!1,this._out("ET",P)},e.prototype._requireTextMode=function(){if(!this._textMode)throw new Error("Text mode required; call page.beginText() first")},e.prototype._requireFont=function(){if(!this._font)throw new Error("No font selected; call page.setFont() first")},e.prototype.setFont=function(t,e){this._requireTextMode(),null==t?t=this._font:t instanceof wt||(t=this._pdf.getFont(t)),null==e&&(e=this._fontSize),this._fontResources[t._resourceName]=t,this._font=t,this._fontSize=e,this._out(t._resourceName," ",e," Tf",P)},e.prototype.setTextLeading=function(t){this._requireTextMode(),this._out(t," TL",P)},e.prototype.setTextRenderingMode=function(t){this._requireTextMode(),this._out(t," Tr",P)},e.prototype.showText=function(t,e){if(this._requireFont(),t.length>1&&e&&this._font instanceof wt){var r=e/this._font.getTextWidth(this._fontSize,t)*100;this._out(r," Tz ")}this._out(this._font.encodeText(t)," Tj",P)},e.prototype.showTextNL=function(t){this._requireFont(),this._out(this._font.encodeText(t)," '",P)},e.prototype.addLink=function(e,r){var o=this._toPage({x:r.left,y:r.bottom}),n=this._toPage({x:r.right,y:r.top});this._annotations.push(new t({Type:ht("Annot"),Subtype:ht("Link"),Rect:[o.x,o.y,n.x,n.y],Border:[0,0,0],A:new t({Type:ht("Action"),S:ht("URI"),URI:new it(e)})}))},e.prototype.setStrokeColor=function(t,e,r){this._out(t," ",e," ",r," RG",P)},e.prototype.setOpacity=function(t){this.setFillOpacity(t),this.setStrokeOpacity(t),this._opacity*=t},e.prototype.setStrokeOpacity=function(t){if(t<1){var e=this._pdf.getOpacityGS(this._opacity*t,!0);this._gsResources[e._resourceName]=e,this._out(e._resourceName," gs",P)}},e.prototype.setFillColor=function(t,e,r){this._out(t," ",e," ",r," rg",P)},e.prototype.setFillOpacity=function(t){if(t<1){var e=this._pdf.getOpacityGS(this._opacity*t,!1);this._gsResources[e._resourceName]=e,this._out(e._resourceName," gs",P)}},e.prototype.gradient=function(t,e){this.save(),this.rect(e.left,e.top,e.width,e.height),this.clip(),t.userSpace||this.transform(e.width,0,0,e.height,e.left,e.top);var r,o=_t(this._pdf,t,e),n=o.shading._resourceName;this._shResources[n]=o.shading,o.hasAlpha&&(r=o.opacity._resourceName,this._gsResources[r]=o.opacity,this._out("/"+r+" gs ")),this._out("/"+n+" sh",P),this.restore()},e.prototype.setDashPattern=function(t,e){this._out(t," ",e," d",P)},e.prototype.setLineWidth=function(t){this._out(t," w",P)},e.prototype.setLineCap=function(t){this._out(t," J",P)},e.prototype.setLineJoin=function(t){this._out(t," j",P)},e.prototype.setMitterLimit=function(t){this._out(t," M",P)},e.prototype.save=function(){this._contextStack.push(this._context()),this._out("q",P)},e.prototype.restore=function(){this._out("Q",P),this._context(this._contextStack.pop())},e.prototype.moveTo=function(t,e){this._out(t," ",e," m",P)},e.prototype.lineTo=function(t,e){this._out(t," ",e," l",P)},e.prototype.bezier=function(t,e,r,o,n,i){this._out(t," ",e," ",r," ",o," ",n," ",i," c",P)},e.prototype.bezier1=function(t,e,r,o){this._out(t," ",e," ",r," ",o," y",P)},e.prototype.bezier2=function(t,e,r,o){this._out(t," ",e," ",r," ",o," v",P)},e.prototype.close=function(){this._out("h",P)},e.prototype.rect=function(t,e,r,o){this._out(t," ",e," ",r," ",o," re",P)},e.prototype.ellipse=function(t,e,r,o){function n(e){return t+e}function i(t){return e+t}var a=.5522847498307936;this.moveTo(n(0),i(o)),this.bezier(n(r*a),i(o),n(r),i(o*a),n(r),i(0)),this.bezier(n(r),i(-o*a),n(r*a),i(-o),n(0),i(-o)),this.bezier(n(-r*a),i(-o),n(-r),i(-o*a),n(-r),i(0)),this.bezier(n(-r),i(o*a),n(-r*a),i(o),n(0),i(o))},e.prototype.circle=function(t,e,r){this.ellipse(t,e,r,r)},e.prototype.stroke=function(){this._out("S",P)},e.prototype.nop=function(){this._out("n",P)},e.prototype.clip=function(){this._out("W n",P)},e.prototype.clipStroke=function(){this._out("W S",P)},e.prototype.closeStroke=function(){this._out("s",P)},e.prototype.fill=function(){this._out("f",P)},e.prototype.fillStroke=function(){this._out("B",P)},e.prototype.drawImage=function(t){var e=this._pdf.getImage(t);e&&(this._xResources[e._resourceName]=e,this._out(e._resourceName," Do",P))},e.prototype.comment=function(t){var e=this;t.split(/\r?\n/g).forEach((function(t){e._out("% ",t,P)}))},e.prototype._context=function(t){if(null==t)return{opacity:this._opacity,matrix:this._matrix};this._opacity=t.opacity,this._matrix=t.matrix},e.prototype._toPage=function(t){var e=this._matrix,r=e[0],o=e[1],n=e[2],i=e[3],a=e[4],s=e[5];return{x:r*t.x+n*t.y+a,y:o*t.x+i*t.y+s}},e}(ft);function kt(t){return t.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function Dt(t){var e=/^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i.exec(t);if(!e)return{fontSize:12,fontFamily:"sans-serif"};var r=e[8]?parseInt(e[8],10):12;return{italic:e[2]&&"italic"==e[2].toLowerCase(),variant:e[4],bold:e[6]&&/bold|700/i.test(e[6]),fontSize:r,lineHeight:e[12]?"normal"==e[12]?r:parseInt(e[12],10):null,fontFamily:e[14].split(/\s*,\s*/g).map(kt)}}function Tt(t){function e(e){return t.bold&&(e+="|bold"),t.italic&&(e+="|italic"),e.toLowerCase()}var r,o,n=t.fontFamily;if(n instanceof Array)for(var i=0;i<n.length&&(r=e(n[i]),!(o=Ot[r]));++i);else o=Ot[n.toLowerCase()];for(;"function"==typeof o;)o=o();return o||(o="Times-Roman"),o}var Ot={serif:"Times-Roman","serif|bold":"Times-Bold","serif|italic":"Times-Italic","serif|bold|italic":"Times-BoldItalic","sans-serif":"Helvetica","sans-serif|bold":"Helvetica-Bold","sans-serif|italic":"Helvetica-Oblique","sans-serif|bold|italic":"Helvetica-BoldOblique",monospace:"Courier","monospace|bold":"Courier-Bold","monospace|italic":"Courier-Oblique","monospace|bold|italic":"Courier-BoldOblique",zapfdingbats:"ZapfDingbats","zapfdingbats|bold":"ZapfDingbats","zapfdingbats|italic":"ZapfDingbats","zapfdingbats|bold|italic":"ZapfDingbats"};function Ft(t,e){t=t.toLowerCase(),Ot[t]=function(){return Ot[e]},Ot[t