Files
rtf.js/dist/WMFJS.bundle.min.js
T

2 lines
58 KiB
JavaScript
Generated

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WMFJS=e():t.WMFJS=e()}(this,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=34)}([,,function(t,e,r){"use strict";r.r(e);var i=r(3);r.d(e,"SVG",(function(){return i.SVG}))},function(t,e,r){"use strict";r.r(e),r.d(e,"SVGFilters",(function(){return i})),r.d(e,"SVGPathBuilder",(function(){return n})),r.d(e,"SVG",(function(){return s}));var i=function(){function t(){}return t.prototype.flood=function(t,e,r,i,n){var s=document.createElementNS("http://www.w3.org/2000/svg","feFlood");e&&s.setAttribute("id",e),s.setAttribute("flood-color",r),s.setAttribute("flood-opacity",i.toString()),t.appendChild(s)},t.prototype.composite=function(t,e,r,i,n,s,o,l,a){var p=document.createElementNS("http://www.w3.org/2000/svg","feComposite");e&&p.setAttribute("id",e),p.setAttribute("in",r),p.setAttribute("in2",i),t.appendChild(p)},t}(),n=function(){function t(){this._path=""}return t.prototype.move=function(t,e){this._path+=" M "+t+" "+e},t.prototype.path=function(){return this._path.substr(1)},t.prototype.line=function(t){var e=this;t.forEach((function(t){e._path+=" L "+t[0]+" "+t[1]}))},t.prototype.curveC=function(t,e,r,i,n,s){this._path+=" C "+t+" "+e+", "+r+" "+i+", "+n+" "+s},t.prototype.close=function(){this._path+=" Z"},t}(),s=function(){function t(t){this.filters=new i,this._defs=void 0,this._svg=t}return t.prototype.svg=function(t,e,r,i,n,s){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.setAttribute("x",e.toString()),o.setAttribute("y",r.toString()),o.setAttribute("width",i.toString()),o.setAttribute("height",n.toString()),this._appendSettings(s,o),null!=t?t.appendChild(o):this._svg.appendChild(o),o},t.prototype.image=function(t,e,r,i,n,s,o){var l=document.createElementNS("http://www.w3.org/2000/svg","image");return l.setAttribute("x",e.toString()),l.setAttribute("y",r.toString()),l.setAttribute("width",i.toString()),l.setAttribute("height",n.toString()),l.setAttributeNS("http://www.w3.org/1999/xlink","href",s),this._appendSettings(o,l),t.appendChild(l),l},t.prototype.rect=function(t,e,r,i,n,s,o,l){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");return a.setAttribute("x",e.toString()),a.setAttribute("y",r.toString()),a.setAttribute("width",i.toString()),a.setAttribute("height",n.toString()),void 0!==s&&(s instanceof Number?a.setAttribute("rx",s.toString()):s instanceof Object&&this._appendSettings(s,a)),void 0!==o&&a.setAttribute("ry",o.toString()),this._appendSettings(l,a),t.appendChild(a),a},t.prototype.line=function(t,e,r,i,n,s){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",e.toString()),o.setAttribute("y1",r.toString()),o.setAttribute("x2",i.toString()),o.setAttribute("y2",n.toString()),this._appendSettings(s,o),t.appendChild(o),o},t.prototype.polygon=function(t,e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",e.map((function(t){return t.join(",")})).join(" ")),this._appendSettings(r,i),t.appendChild(i),i},t.prototype.polyline=function(t,e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","polyline");return i.setAttribute("points",e.map((function(t){return t.join(",")})).join(" ")),this._appendSettings(r,i),t.appendChild(i),i},t.prototype.ellipse=function(t,e,r,i,n,s){var o=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return o.setAttribute("cx",e.toString()),o.setAttribute("cy",r.toString()),o.setAttribute("rx",i.toString()),o.setAttribute("ry",n.toString()),this._appendSettings(s,o),t.appendChild(o),o},t.prototype.path=function(t,e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e.path()),this._appendSettings(r,i),t.appendChild(i),i},t.prototype.text=function(t,e,r,i,n){var s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("x",e.toString()),s.setAttribute("y",r.toString()),this._appendSettings(n,s);var o=document.createTextNode(i);return s.appendChild(o),t.appendChild(s),s},t.prototype.filter=function(t,e,r,i,n,s,o){var l=document.createElementNS("http://www.w3.org/2000/svg","filter");return l.setAttribute("x",r.toString()),l.setAttribute("y",i.toString()),l.setAttribute("width",n.toString()),l.setAttribute("height",s.toString()),this._appendSettings(o,l),t.appendChild(l),l},t.prototype.pattern=function(t,e,r,i,n,s,o){var l=document.createElementNS("http://www.w3.org/2000/svg","pattern");return e&&l.setAttribute("id",e),l.setAttribute("x",r.toString()),l.setAttribute("y",i.toString()),l.setAttribute("width",n.toString()),l.setAttribute("height",s.toString()),this._appendSettings(o,l),t.appendChild(l),l},t.prototype.defs=function(){if(void 0===this._defs){var t=document.createElementNS("http://www.w3.org/2000/svg","defs");this._svg.appendChild(t),this._defs=t}return this._defs},t.prototype.clipPath=function(t,e,r,i){var n=document.createElementNS("http://www.w3.org/2000/svg","clipPath");return e&&n.setAttribute("id",e),void 0===r&&(r="userSpaceOnUse"),n.setAttribute("clipPathUnits",r),this._appendSettings(i,n),t.appendChild(n),n},t.prototype.createPath=function(){return new n},t.prototype._appendSettings=function(t,e){void 0!==t&&Object.keys(t).forEach((function(r){e.setAttribute(r,t[r])}))},t}()},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";r.r(e);var i=r(35);r.d(e,"Renderer",(function(){return i.Renderer}));var n=r(37);r.d(e,"Error",(function(){return n.WMFJSError})),r.d(e,"loggingEnabled",(function(){return n.loggingEnabled}))},function(t,e,r){"use strict";r.r(e),r.d(e,"Renderer",(function(){return a})),r.d(e,"WMFRect16",(function(){return p})),r.d(e,"WMFPlacable",(function(){return h})),r.d(e,"WMF",(function(){return c}));var i=r(2),n=r(36),s=r(38),o=r(37),l=r(43),a=function(){function t(t){this.parse(t),o.Helper.log("WMFJS.Renderer instantiated")}return t.prototype.render=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return this._render(new i.SVG(e),t.mapMode,t.xExt,t.yExt),e.setAttribute("viewBox",[0,0,t.xExt,t.yExt].join(" ")),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("width",t.width),e.setAttribute("height",t.height),e},t.prototype.parse=function(t){this._img=null;var e,r,i,s,l=new n.Blob(t),a=l.readUint32();switch(2596720087===a?(i=new h(l),s=l.pos,e=l.readUint16(),r=l.readUint16()):(s=0,e=65535&a,r=a>>>16&65535),e){case o.Helper.GDI.MetafileType.MEMORYMETAFILE:case o.Helper.GDI.MetafileType.DISKMETAFILE:if(r===o.Helper.GDI.METAHEADER_SIZE/2){var p=l.readUint16();switch(p){case o.Helper.GDI.MetafileVersion.METAVERSION100:case o.Helper.GDI.MetafileVersion.METAVERSION300:this._img=new c(l,i,p,s+2*r)}}}if(null==this._img)throw new o.WMFJSError("Format not recognized")},t.prototype._render=function(t,e,r,i){var n=new s.GDIContext(t);n.setViewportExt(r,i),n.setMapMode(e),o.Helper.log("[WMF] BEGIN RENDERING ---\x3e"),this._img.render(n),o.Helper.log("[WMF] <--- DONE RENDERING")},t}(),p=function(){function t(t){this.left=t.readInt16(),this.top=t.readInt16(),this.right=t.readInt16(),this.bottom=t.readInt16()}return t.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},t}(),h=function(t){t.skip(2),this.boundingBox=new p(t),this.unitsPerInch=t.readInt16(),t.skip(4),t.skip(2),o.Helper.log("Got bounding box "+this.boundingBox+" and "+this.unitsPerInch+" units/inch")},c=function(){function t(t,e,r,i){this._version=r,this._hdrsize=i,this._placable=e,this._records=new l.WMFRecords(t,this._hdrsize)}return t.prototype.render=function(t){this._records.play(t)},t}()},function(t,e,r){"use strict";r.r(e),r.d(e,"Blob",(function(){return n}));var i=r(37),n=function(){function t(e,r){e instanceof t?(this.blob=e.blob,this.data=e.data,this.pos=r||e.pos):(this.blob=e,this.data=new Uint8Array(e),this.pos=r||0)}return t.prototype.eof=function(){return this.pos>=this.data.length},t.prototype.seek=function(t){if(t<0||t>this.data.length)throw new i.WMFJSError("Invalid seek position");this.pos=t},t.prototype.skip=function(t){var e=this.pos+t;if(e>this.data.length)throw new i.WMFJSError("Unexpected end of file");this.pos=e},t.prototype.readBinary=function(t){if(this.pos+t>this.data.length)throw new i.WMFJSError("Unexpected end of file");for(var e="";t-- >0;)e+=String.fromCharCode(this.data[this.pos++]);return e},t.prototype.readInt8=function(){if(this.pos+1>this.data.length)throw new i.WMFJSError("Unexpected end of file");return this.data[this.pos++]},t.prototype.readUint8=function(){return this.readInt8()>>>0},t.prototype.readInt32=function(){if(this.pos+4>this.data.length)throw new i.WMFJSError("Unexpected end of file");var t=this.data[this.pos++];return t|=this.data[this.pos++]<<8,t|=this.data[this.pos++]<<16,t|=this.data[this.pos++]<<24},t.prototype.readUint32=function(){return this.readInt32()>>>0},t.prototype.readUint16=function(){if(this.pos+2>this.data.length)throw new i.WMFJSError("Unexpected end of file");var t=this.data[this.pos++];return t|=this.data[this.pos++]<<8},t.prototype.readInt16=function(){var t=this.readUint16();return t>32767&&(t-=65536),t},t.prototype.readString=function(t){if(this.pos+t>this.data.length)throw new i.WMFJSError("Unexpected end of file");for(var e="",r=0;r<t;r++)e+=String.fromCharCode(this.data[this.pos++]>>>0);return e},t.prototype.readNullTermString=function(t){var e="";if(t>0){t--;for(var r=0;r<t;r++){if(this.pos+r+1>this.data.length)throw new i.WMFJSError("Unexpected end of file");var n=this.data[this.pos+r]>>>0;if(0===n)break;e+=String.fromCharCode(n)}}return e},t}()},function(t,e,r){"use strict";r.r(e),r.d(e,"WMFJSError",(function(){return s})),r.d(e,"loggingEnabled",(function(){return l})),r.d(e,"Helper",(function(){return a}));var i,n=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=function(t){function e(e){var r=this.constructor,i=t.call(this,e)||this;return Object.setPrototypeOf(i,r.prototype),i}return n(e,t),e}(Error),o=!0;function l(t){o=t}var a=function(){function t(){}return t.log=function(t){o&&console.log(t)},t._makeUniqueId=function(t){return"wmfjs_"+t+this._uniqueId++},t._writeUint32Val=function(t,e,r){t[e++]=255&r,t[e++]=r>>>8&255,t[e++]=r>>>16&255,t[e++]=r>>>24&255},t._blobToBinary=function(t){for(var e="",r=t.length,i=0;i<r;i++)e+=String.fromCharCode(t[i]);return e},t.GDI={METAHEADER_SIZE:18,BITMAPINFOHEADER_SIZE:40,BITMAPCOREHEADER_SIZE:12,MetafileType:{MEMORYMETAFILE:1,DISKMETAFILE:2},MetafileVersion:{METAVERSION100:256,METAVERSION300:768},RecordType:{META_EOF:0,META_REALIZEPALETTE:53,META_SETPALENTRIES:55,META_SETBKMODE:258,META_SETMAPMODE:259,META_SETROP2:260,META_SETRELABS:261,META_SETPOLYFILLMODE:262,META_SETSTRETCHBLTMODE:263,META_SETTEXTCHAREXTRA:264,META_RESTOREDC:295,META_RESIZEPALETTE:313,META_DIBCREATEPATTERNBRUSH:322,META_SETLAYOUT:329,META_SETBKCOLOR:513,META_SETTEXTCOLOR:521,META_OFFSETVIEWPORTORG:529,META_LINETO:531,META_MOVETO:532,META_OFFSETCLIPRGN:544,META_FILLREGION:552,META_SETMAPPERFLAGS:561,META_SELECTPALETTE:564,META_POLYGON:804,META_POLYLINE:805,META_SETTEXTJUSTIFICATION:522,META_SETWINDOWORG:523,META_SETWINDOWEXT:524,META_SETVIEWPORTORG:525,META_SETVIEWPORTEXT:526,META_OFFSETWINDOWORG:527,META_SCALEWINDOWEXT:1040,META_SCALEVIEWPORTEXT:1042,META_EXCLUDECLIPRECT:1045,META_INTERSECTCLIPRECT:1046,META_ELLIPSE:1048,META_FLOODFILL:1049,META_FRAMEREGION:1065,META_ANIMATEPALETTE:1078,META_TEXTOUT:1313,META_POLYPOLYGON:1336,META_EXTFLOODFILL:1352,META_RECTANGLE:1051,META_SETPIXEL:1055,META_ROUNDRECT:1564,META_PATBLT:1565,META_SAVEDC:30,META_PIE:2074,META_STRETCHBLT:2851,META_ESCAPE:1574,META_INVERTREGION:298,META_PAINTREGION:299,META_SELECTCLIPREGION:300,META_SELECTOBJECT:301,META_SETTEXTALIGN:302,META_ARC:2071,META_CHORD:2096,META_BITBLT:2338,META_EXTTEXTOUT:2610,META_SETDIBTODEV:3379,META_DIBBITBLT:2368,META_DIBSTRETCHBLT:2881,META_STRETCHDIB:3907,META_DELETEOBJECT:496,META_CREATEPALETTE:247,META_CREATEPATTERNBRUSH:505,META_CREATEPENINDIRECT:762,META_CREATEFONTINDIRECT:763,META_CREATEBRUSHINDIRECT:764,META_CREATEREGION:1791},MetafileEscapes:{NEWFRAME:1,ABORTDOC:2,NEXTBAND:3,SETCOLORTABLE:4,GETCOLORTABLE:5,FLUSHOUT:6,DRAFTMODE:7,QUERYESCSUPPORT:8,SETABORTPROC:9,STARTDOC:10,ENDDOC:11,GETPHYSPAGESIZE:12,GETPRINTINGOFFSET:13,GETSCALINGFACTOR:14,META_ESCAPE_ENHANCED_METAFILE:15,SETPENWIDTH:16,SETCOPYCOUNT:17,SETPAPERSOURCE:18,PASSTHROUGH:19,GETTECHNOLOGY:20,SETLINECAP:21,SETLINEJOIN:22,SETMITERLIMIT:23,BANDINFO:24,DRAWPATTERNRECT:25,GETVECTORPENSIZE:26,GETVECTORBRUSHSIZE:27,ENABLEDUPLEX:28,GETSETPAPERBINS:29,GETSETPRINTORIENT:30,ENUMPAPERBINS:31,SETDIBSCALING:32,EPSPRINTING:33,ENUMPAPERMETRICS:34,GETSETPAPERMETRICS:35,POSTSCRIPT_DATA:37,POSTSCRIPT_IGNORE:38,GETDEVICEUNITS:42,GETEXTENDEDTEXTMETRICS:256,GETPAIRKERNTABLE:258,EXTTEXTOUT:512,GETFACENAME:513,DOWNLOADFACE:514,METAFILE_DRIVER:2049,QUERYDIBSUPPORT:3073,BEGIN_PATH:4096,CLIP_TO_PATH:4097,END_PATH:4098,OPEN_CHANNEL:4110,DOWNLOADHEADER:4111,CLOSE_CHANNEL:4112,POSTSCRIPT_PASSTHROUGH:4115,ENCAPSULATED_POSTSCRIPT:4116,POSTSCRIPT_IDENTIFY:4117,POSTSCRIPT_INJECTION:4118,CHECKJPEGFORMAT:4119,CHECKPNGFORMAT:4120,GET_PS_FEATURESETTING:4121,MXDC_ESCAPE:4122,SPCLPASSTHROUGH2:4568},MapMode:{MM_TEXT:1,MM_LOMETRIC:2,MM_HIMETRIC:3,MM_LOENGLISH:4,MM_HIENGLISH:5,MM_TWIPS:6,MM_ISOTROPIC:7,MM_ANISOTROPIC:8},StretchMode:{BLACKONWHITE:1,WHITEONBLACK:2,COLORONCOLOR:3,HALFTONE:4},TextAlignmentMode:{TA_UPDATECP:1,TA_RIGHT:2,TA_CENTER:6,TA_BOTTOM:8,TA_BASELINE:24,TA_RTLREADING:256},MixMode:{TRANSPARENT:1,OPAQUE:2},VerticalTextAlignmentMode:{VTA_BOTTOM:2,VTA_CENTER:6,VTA_LEFT:8,VTA_BASELINE:24},BrushStyle:{BS_SOLID:0,BS_NULL:1,BS_HATCHED:2,BS_PATTERN:3,BS_INDEXED:4,BS_DIBPATTERN:5,BS_DIBPATTERNPT:6,BS_PATTERN8X8:7,BS_DIBPATTERN8X8:8,BS_MONOPATTERN:9},PenStyle:{PS_SOLID:0,PS_DASH:1,PS_DOT:2,PS_DASHDOT:3,PS_DASHDOTDOT:4,PS_NULL:5,PS_INSIDEFRAME:6,PS_USERSTYLE:7,PS_ALTERNATE:8,PS_ENDCAP_SQUARE:256,PS_ENDCAP_FLAT:512,PS_JOIN_BEVEL:4096,PS_JOIN_MITER:8192},PolyFillMode:{ALTERNATE:1,WINDING:2},ColorUsage:{DIB_RGB_COLORS:0,DIB_PAL_COLORS:1,DIB_PAL_INDICES:2},PaletteEntryFlag:{PC_RESERVED:1,PC_EXPLICIT:2,PC_NOCOLLAPSE:4},BitmapCompression:{BI_RGB:0,BI_RLE8:1,BI_RLE4:2,BI_BITFIELDS:3,BI_JPEG:4,BI_PNG:5}},t._uniqueId=0,t}()},function(t,e,r){"use strict";r.r(e),r.d(e,"GDIContextState",(function(){return l})),r.d(e,"GDIContext",(function(){return a}));var i=r(37),n=r(39),s=r(40),o=r(41),l=function(t,e){if(null!=t)for(var r in this._svggroup=t._svggroup,this._svgclipChanged=t._svgclipChanged,this._svgtextbkfilter=t._svgtextbkfilter,this.mapmode=t.mapmode,this.stretchmode=t.stretchmode,this.textalign=t.textalign,this.bkmode=t.bkmode,this.textcolor=t.textcolor.clone(),this.bkcolor=t.bkcolor.clone(),this.polyfillmode=t.polyfillmode,this.wx=t.wx,this.wy=t.wy,this.ww=t.ww,this.wh=t.wh,this.vx=t.vx,this.vy=t.vy,this.vw=t.vw,this.vh=t.vh,this.x=t.x,this.y=t.y,this.clip=t.clip,this.ownclip=!1,this.selected={},t.selected)this.selected[r]=t.selected[r];else for(var r in this._svggroup=null,this._svgclipChanged=!1,this._svgtextbkfilter=null,this.mapmode=i.Helper.GDI.MapMode.MM_ANISOTROPIC,this.stretchmode=i.Helper.GDI.StretchMode.COLORONCOLOR,this.textalign=0,this.bkmode=i.Helper.GDI.MixMode.OPAQUE,this.textcolor=new o.ColorRef(null,0,0,0),this.bkcolor=new o.ColorRef(null,255,255,255),this.polyfillmode=i.Helper.GDI.PolyFillMode.ALTERNATE,this.wx=0,this.wy=0,this.ww=0,this.wh=0,this.vx=0,this.vy=0,this.vw=0,this.vh=0,this.x=0,this.y=0,this.clip=null,this.ownclip=!1,this.selected={},e){var n=e[r];this.selected[r]=null!=n?n.clone():null}},a=function(){function t(t){this._svg=t,this._svgdefs=null,this._svgPatterns={},this._svgClipPaths={},this.defObjects={brush:new o.Brush(null,null),pen:new o.Pen(null,i.Helper.GDI.PenStyle.PS_SOLID,new n.PointS(null,1,1),new o.ColorRef(null,0,0,0),0,0),font:new o.Font(null,null),palette:null,region:null},this.state=new l(null,this.defObjects),this.statestack=[this.state],this.objects={}}return t.prototype.setMapMode=function(t){i.Helper.log("[gdi] setMapMode: mode="+t),this.state.mapmode=t,this.state._svggroup=null},t.prototype.setWindowOrg=function(t,e){i.Helper.log("[gdi] setWindowOrg: x="+t+" y="+e),this.state.wx=t,this.state.wy=e,this.state._svggroup=null},t.prototype.setWindowExt=function(t,e){i.Helper.log("[gdi] setWindowExt: x="+t+" y="+e),this.state.ww=t,this.state.wh=e,this.state._svggroup=null},t.prototype.offsetWindowOrg=function(t,e){i.Helper.log("[gdi] offsetWindowOrg: offX="+t+" offY="+e),this.state.wx+=t,this.state.wy+=e,this.state._svggroup=null},t.prototype.setViewportOrg=function(t,e){i.Helper.log("[gdi] setViewportOrg: x="+t+" y="+e),this.state.vx=t,this.state.vy=e,this.state._svggroup=null},t.prototype.setViewportExt=function(t,e){i.Helper.log("[gdi] setViewportExt: x="+t+" y="+e),this.state.vw=t,this.state.vh=e,this.state._svggroup=null},t.prototype.offsetViewportOrg=function(t,e){i.Helper.log("[gdi] offsetViewportOrg: offX="+t+" offY="+e),this.state.vx+=t,this.state.vy+=e,this.state._svggroup=null},t.prototype.saveDC=function(){i.Helper.log("[gdi] saveDC");var t=this.state;this.state=new l(this.state),this.statestack.push(t),this.state._svggroup=null},t.prototype.restoreDC=function(t){if(i.Helper.log("[gdi] restoreDC: saved="+t),!(this.statestack.length>1))throw new i.WMFJSError("No saved contexts");if(-1===t)this.state=this.statestack.pop();else{if(t<-1)throw new i.WMFJSError("restoreDC: relative restore not implemented");if(t>1)throw new i.WMFJSError("restoreDC: absolute restore not implemented")}this.state._svggroup=null},t.prototype.escape=function(t,e,r,n){i.Helper.log("[gdi] escape: func="+t+" offset="+r+" count="+n)},t.prototype.setStretchBltMode=function(t){i.Helper.log("[gdi] setStretchBltMode: stretchMode="+t)},t.prototype.stretchDib=function(t,e,r,n,s,o,l,a,p,h,c){i.Helper.log("[gdi] stretchDib: srcX="+t+" srcY="+e+" srcW="+r+" srcH="+n+" dstX="+s+" dstY="+o+" dstW="+l+" dstH="+a+" rasterOp=0x"+p.toString(16)),t=this._todevX(t),e=this._todevY(e),r=this._todevW(r),n=this._todevH(n),s=this._todevX(s),o=this._todevY(o),l=this._todevW(l),a=this._todevH(a),i.Helper.log("[gdi] stretchDib: TRANSLATED: srcX="+t+" srcY="+e+" srcW="+r+" srcH="+n+" dstX="+s+" dstY="+o+" dstW="+l+" dstH="+a+" rasterOp=0x"+p.toString(16)+" colorUsage=0x"+h.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,s,o,l,a,c.base64ref())},t.prototype.stretchDibBits=function(t,e,r,n,s,o,l,a,p,h){i.Helper.log("[gdi] stretchDibBits: srcX="+t+" srcY="+e+" srcW="+r+" srcH="+n+" dstX="+s+" dstY="+o+" dstW="+l+" dstH="+a+" rasterOp=0x"+p.toString(16)),t=this._todevX(t),e=this._todevY(e),r=this._todevW(r),n=this._todevH(n),s=this._todevX(s),o=this._todevY(o),l=this._todevW(l),a=this._todevH(a),i.Helper.log("[gdi] stretchDibBits: TRANSLATED: srcX="+t+" srcY="+e+" srcW="+r+" srcH="+n+" dstX="+s+" dstY="+o+" dstW="+l+" dstH="+a+" rasterOp=0x"+p.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,s,o,l,a,h.base64ref())},t.prototype.rectangle=function(t,e,r){i.Helper.log("[gdi] rectangle: rect="+t.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var n=this._todevY(t.bottom),s=this._todevX(t.right),o=this._todevY(t.top),l=this._todevX(t.left);e=this._todevH(e),r=this._todevH(r),i.Helper.log("[gdi] rectangle: TRANSLATED: bottom="+n+" right="+s+" top="+o+" left="+l+" rh="+r+" rw="+e),this._pushGroup();var a=this._applyOpts(null,!0,!0,!1);this._svg.rect(this.state._svggroup,l,o,s-l,n-o,e/2,r/2,a)},t.prototype.textOut=function(t,e,r){i.Helper.log("[gdi] textOut: x="+t+" y="+e+" text="+r+" with font "+this.state.selected.font.toString()),t=this._todevX(t),e=this._todevY(e),i.Helper.log("[gdi] textOut: TRANSLATED: x="+t+" y="+e),this._pushGroup();var n=this._applyOpts(null,!1,!1,!0);if(0!==this.state.selected.font.escapement&&(n.transform="rotate("+[-this.state.selected.font.escapement/10,t,e]+")",n.style="dominant-baseline: middle; text-anchor: start;"),this.state.bkmode===i.Helper.GDI.MixMode.OPAQUE){if(null==this.state._svgtextbkfilter){var s=i.Helper._makeUniqueId("f"),o=this._svg.filter(this._getSvgDef(),s,0,0,1,1);this._svg.filters.flood(o,null,"#"+this.state.bkcolor.toHex(),1),this._svg.filters.composite(o,null,null,"SourceGraphic"),this.state._svgtextbkfilter=o}n.filter="url(#"+this.state._svgtextbkfilter.id+")"}this._svg.text(this.state._svggroup,t,e,r,n)},t.prototype.extTextOut=function(t,e,r,n,s,o){i.Helper.log("[gdi] extTextOut: x="+t+" y="+e+" text="+r+" with font "+this.state.selected.font.toString()),t=this._todevX(t),e=this._todevY(e),i.Helper.log("[gdi] extTextOut: TRANSLATED: x="+t+" y="+e),this._pushGroup();var l=this._applyOpts(null,!1,!1,!0);if(0!==this.state.selected.font.escapement&&(l.transform="rotate("+[-this.state.selected.font.escapement/10,t,e]+")",l.style="dominant-baseline: middle; text-anchor: start;"),this.state.bkmode===i.Helper.GDI.MixMode.OPAQUE){if(null==this.state._svgtextbkfilter){var a=i.Helper._makeUniqueId("f"),p=this._svg.filter(this._getSvgDef(),a,0,0,1,1);this._svg.filters.flood(p,null,"#"+this.state.bkcolor.toHex(),1),this._svg.filters.composite(p,null,null,"SourceGraphic"),this.state._svgtextbkfilter=p}l.filter="url(#"+this.state._svgtextbkfilter.id+")"}this._svg.text(this.state._svggroup,t,e,r,l)},t.prototype.lineTo=function(t,e){i.Helper.log("[gdi] lineTo: x="+t+" y="+e+" with pen "+this.state.selected.pen.toString());var r=this._todevX(t),n=this._todevY(e),s=this._todevX(this.state.x),o=this._todevY(this.state.y);this.state.x=t,this.state.y=e,i.Helper.log("[gdi] lineTo: TRANSLATED: toX="+r+" toY="+n+" fromX="+s+" fromY="+o),this._pushGroup();var l=this._applyOpts(null,!0,!1,!1);this._svg.line(this.state._svggroup,s,o,r,n,l)},t.prototype.moveTo=function(t,e){i.Helper.log("[gdi] moveTo: x="+t+" y="+e),this.state.x=t,this.state.y=e},t.prototype.polygon=function(t,e){i.Helper.log("[gdi] polygon: points="+t+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var r=[],n=0;n<t.length;n++){var s=t[n];r.push([this._todevX(s.x),this._todevY(s.y)])}i.Helper.log("[gdi] polygon: TRANSLATED: pts="+r),e&&this._pushGroup();var o={"fill-rule":this.state.polyfillmode===i.Helper.GDI.PolyFillMode.ALTERNATE?"evenodd":"nonzero"};this._applyOpts(o,!0,!0,!1),this._svg.polygon(this.state._svggroup,r,o)},t.prototype.polyPolygon=function(t){i.Helper.log("[gdi] polyPolygon: polygons.length="+t.length+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var e=t.length,r=0;r<e;r++)this.polygon(t[r],0===r)},t.prototype.polyline=function(t){i.Helper.log("[gdi] polyline: points="+t+" with pen "+this.state.selected.pen.toString());for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push([this._todevX(n.x),this._todevY(n.y)])}i.Helper.log("[gdi] polyline: TRANSLATED: pts="+e),this._pushGroup();var s=this._applyOpts({fill:"none"},!0,!1,!1);this._svg.polyline(this.state._svggroup,e,s)},t.prototype.ellipse=function(t){i.Helper.log("[gdi] ellipse: rect="+t.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var e=this._todevY(t.bottom),r=this._todevX(t.right),n=this._todevY(t.top),s=this._todevX(t.left);i.Helper.log("[gdi] ellipse: TRANSLATED: bottom="+e+" right="+r+" top="+n+" left="+s),this._pushGroup();var o=(r-s)/2,l=(e-n)/2,a=this._applyOpts(null,!0,!0,!1);this._svg.ellipse(this.state._svggroup,s+o,n+l,o,l,a)},t.prototype.excludeClipRect=function(t){i.Helper.log("[gdi] excludeClipRect: rect="+t.toString()),this._getClipRgn().subtract(t)},t.prototype.intersectClipRect=function(t){i.Helper.log("[gdi] intersectClipRect: rect="+t.toString()),this._getClipRgn().intersect(t)},t.prototype.offsetClipRgn=function(t,e){i.Helper.log("[gdi] offsetClipRgn: offX="+t+" offY="+e),this._getClipRgn().offset(t,e)},t.prototype.setTextAlign=function(t){i.Helper.log("[gdi] setTextAlign: textAlignmentMode=0x"+t.toString(16)),this.state.textalign=t},t.prototype.setBkMode=function(t){i.Helper.log("[gdi] setBkMode: bkMode=0x"+t.toString(16)),this.state.bkmode=t},t.prototype.setTextColor=function(t){i.Helper.log("[gdi] setTextColor: textColor="+t.toString()),this.state.textcolor=t},t.prototype.setBkColor=function(t){i.Helper.log("[gdi] setBkColor: bkColor="+t.toString()),this.state.bkcolor=t,this.state._svgtextbkfilter=null},t.prototype.setPolyFillMode=function(t){i.Helper.log("[gdi] setPolyFillMode: polyFillMode="+t),this.state.polyfillmode=t},t.prototype.createBrush=function(t){var e=this._storeObject(t);i.Helper.log("[gdi] createBrush: brush="+t.toString()+" with handle "+e)},t.prototype.createFont=function(t){var e=this._storeObject(t);i.Helper.log("[gdi] createFont: font="+t.toString()+" with handle "+e)},t.prototype.createPen=function(t){var e=this._storeObject(t);i.Helper.log("[gdi] createPen: pen="+t.toString()+" width handle "+e)},t.prototype.createPalette=function(t){var e=this._storeObject(t);i.Helper.log("[gdi] createPalette: palette="+t.toString()+" width handle "+e)},t.prototype.createRegion=function(t){var e=this._storeObject(t);i.Helper.log("[gdi] createRegion: region="+t.toString()+" width handle "+e)},t.prototype.createPatternBrush=function(t){var e=this._storeObject(t);i.Helper.log("[gdi] createRegion: region="+t.toString()+" width handle "+e)},t.prototype.selectObject=function(t,e){var r=this._getObject(t);null==r||null!=e&&r.type!==e?i.Helper.log("[gdi] selectObject: objIdx="+t+(r?" invalid object type: "+r.type:"[invalid index]")):(this._selectObject(r),i.Helper.log("[gdi] selectObject: objIdx="+t+(r?" selected "+r.type+": "+r.toString():"[invalid index]")))},t.prototype.deleteObject=function(t){var e=this._deleteObject(t);i.Helper.log("[gdi] deleteObject: objIdx="+t+(e?" deleted object":"[invalid index]"))},t.prototype._pushGroup=function(){if(null==this.state._svggroup||this.state._svgclipChanged){this.state._svgclipChanged=!1,this.state._svgtextbkfilter=null;var t={viewBox:[this.state.vx,this.state.vy,this.state.vw,this.state.vh].join(" "),preserveAspectRatio:"none"};null!=this.state.clip?(i.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" with clipping"),t["clip-path"]="url(#"+this._getSvgClipPathForRegion(this.state.clip)+")"):i.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" without clipping"),this.state._svggroup=this._svg.svg(this.state._svggroup,this.state.vx,this.state.vy,this.state.vw,this.state.vh,t)}},t.prototype._storeObject=function(t){for(var e=0;null!=this.objects[e.toString()]&&e<=65535;)e++;return e>65535?(i.Helper.log("[gdi] Too many objects!"),-1):(this.objects[e.toString()]=t,e)},t.prototype._getObject=function(t){var e=this.objects[t.toString()];return null==e&&i.Helper.log("[gdi] No object with handle "+t),e},t.prototype._getSvgDef=function(){return null==this._svgdefs&&(this._svgdefs=this._svg.defs()),this._svgdefs},t.prototype._getSvgClipPathForRegion=function(t){for(var e in this._svgClipPaths){if(this._svgClipPaths[e]===t)return e}var r=i.Helper._makeUniqueId("c"),n=this._svg.clipPath(this._getSvgDef(),r,"userSpaceOnUse");switch(t.complexity){case 1:this._svg.rect(n,this._todevX(t.bounds.left),this._todevY(t.bounds.top),this._todevW(t.bounds.right-t.bounds.left),this._todevH(t.bounds.bottom-t.bounds.top),{fill:"black","stroke-width":0});break;case 2:for(var s=0;s<t.scans.length;s++)for(var o=t.scans[s],l=0;l<o.scanlines.length;l++){var a=o.scanlines[l];this._svg.rect(n,this._todevX(a.left),this._todevY(o.top),this._todevW(a.right-a.left),this._todevH(o.bottom-o.top),{fill:"black","stroke-width":0})}}return this._svgClipPaths[r]=t,r},t.prototype._getSvgPatternForBrush=function(t){for(var e in this._svgPatterns){if(this._svgPatterns[e]===t)return e}var r,n,s;switch(t.style){case i.Helper.GDI.BrushStyle.BS_PATTERN:r=t.pattern.getWidth(),n=t.pattern.getHeight();break;case i.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:r=t.dibpatternpt.getWidth(),n=t.dibpatternpt.getHeight(),s=t.dibpatternpt.base64ref();break;default:throw new i.WMFJSError("Invalid brush style")}var o=i.Helper._makeUniqueId("p"),l=this._svg.pattern(this._getSvgDef(),o,0,0,r,n,{patternUnits:"userSpaceOnUse"});return this._svg.image(l,0,0,r,n,s),this._svgPatterns[o]=t,o},t.prototype._selectObject=function(t){this.state.selected[t.type]=t,"region"===t.type&&(this.state._svgclipChanged=!0)},t.prototype._deleteObject=function(t){var e=this.objects[t.toString()];if(null!=e){for(var r=0;r<this.statestack.length;r++){var n=this.statestack[r];n.selected[e.type]===e&&(n.selected[e.type]=this.defObjects[e.type].clone())}return delete this.objects[t.toString()],!0}return i.Helper.log("[gdi] Cannot delete object with invalid handle "+t),!1},t.prototype._getClipRgn=function(){return null!=this.state.clip?this.state.ownclip||(this.state.clip=this.state.clip.clone()):null!=this.state.selected.region?this.state.clip=this.state.selected.region.clone():this.state.clip=Object(s.CreateSimpleRegion)(this.state.wx,this.state.wy,this.state.wx+this.state.ww,this.state.wy+this.state.wh),this.state.ownclip=!0,this.state.clip},t.prototype._todevX=function(t){return Math.floor((t-this.state.wx)*(this.state.vw/this.state.ww))+this.state.vx},t.prototype._todevY=function(t){return Math.floor((t-this.state.wy)*(this.state.vh/this.state.wh))+this.state.vy},t.prototype._todevW=function(t){return Math.floor(t*(this.state.vw/this.state.ww))+this.state.vx},t.prototype._todevH=function(t){return Math.floor(t*(this.state.vh/this.state.wh))+this.state.vy},t.prototype._tologicalX=function(t){return Math.floor((t-this.state.vx)/(this.state.vw/this.state.ww))+this.state.wx},t.prototype._tologicalY=function(t){return Math.floor((t-this.state.vy)/(this.state.vh/this.state.wh))+this.state.wy},t.prototype._tologicalW=function(t){return Math.floor(t/(this.state.vw/this.state.ww))+this.state.wx},t.prototype._tologicalH=function(t){return Math.floor(t/(this.state.vh/this.state.wh))+this.state.wy},t.prototype._applyOpts=function(t,e,r,n){if(null==t&&(t={}),e){var s=this.state.selected.pen;if(s.style!==i.Helper.GDI.PenStyle.PS_NULL){t.stroke="#"+s.color.toHex(),t["stroke-width"]=this._todevW(s.width.x);var o=void 0;0!=(s.linecap&i.Helper.GDI.PenStyle.PS_ENDCAP_SQUARE)?(t["stroke-linecap"]="square",o=1):0!=(s.linecap&i.Helper.GDI.PenStyle.PS_ENDCAP_FLAT)?(t["stroke-linecap"]="butt",o=t["stroke-width"]):(t["stroke-linecap"]="round",o=1),0!=(s.join&i.Helper.GDI.PenStyle.PS_JOIN_BEVEL)?t["stroke-linejoin"]="bevel":0!=(s.join&i.Helper.GDI.PenStyle.PS_JOIN_MITER)?t["stroke-linejoin"]="miter":t["stroke-linejoin"]="round";var l=4*t["stroke-width"],a=2*t["stroke-width"];switch(s.style){case i.Helper.GDI.PenStyle.PS_DASH:t["stroke-dasharray"]=[l,a].toString();break;case i.Helper.GDI.PenStyle.PS_DOT:t["stroke-dasharray"]=[o,a].toString();break;case i.Helper.GDI.PenStyle.PS_DASHDOT:t["stroke-dasharray"]=[l,a,o,a].toString();break;case i.Helper.GDI.PenStyle.PS_DASHDOTDOT:t["stroke-dasharray"]=[l,a,o,a,o,a].toString()}}}if(r){var p=this.state.selected.brush;switch(p.style){case i.Helper.GDI.BrushStyle.BS_SOLID:t.fill="#"+p.color.toHex();break;case i.Helper.GDI.BrushStyle.BS_PATTERN:case i.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:t.fill="url(#"+this._getSvgPatternForBrush(p)+")";break;case i.Helper.GDI.BrushStyle.BS_NULL:t.fill="none";break;default:i.Helper.log("[gdi] unsupported brush style: "+p.style),t.fill="none"}}if(n){var h=this.state.selected.font;t["font-family"]=h.facename,t["font-size"]=this._todevH(Math.abs(h.height)),t.fill="#"+this.state.textcolor.toHex()}return t},t}()},function(t,e,r){"use strict";r.r(e),r.d(e,"PointS",(function(){return n})),r.d(e,"Rect",(function(){return s})),r.d(e,"Obj",(function(){return o}));var i=r(37),n=function(){function t(t,e,r){null!=t?(this.x=t.readInt16(),this.y=t.readInt16()):(this.x=e,this.y=r)}return t.prototype.clone=function(){return new t(null,this.x,this.y)},t.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},t}(),s=function(){function t(t,e,r,i,n){null!=t?(this.bottom=t.readInt16(),this.right=t.readInt16(),this.top=t.readInt16(),this.left=t.readInt16()):(this.bottom=n,this.right=i,this.top=r,this.left=e)}return t.prototype.clone=function(){return new t(null,this.left,this.top,this.right,this.bottom)},t.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},t.prototype.empty=function(){return this.left>=this.right||this.top>=this.bottom},t.prototype.intersect=function(e){return this.empty()||e.empty()?null:this.left>=e.right||this.top>=e.bottom||this.right<=e.left||this.bottom<=e.top?null:new t(null,Math.max(this.left,e.left),Math.max(this.top,e.top),Math.min(this.right,e.right),Math.min(this.bottom,e.bottom))},t}(),o=function(){function t(t){this.type=t}return t.prototype.clone=function(){throw new i.WMFJSError("clone not implemented")},t.prototype.toString=function(){throw new i.WMFJSError("toString not implemented")},t}()},function(t,e,r){"use strict";r.r(e),r.d(e,"Region",(function(){return l})),r.d(e,"CreateSimpleRegion",(function(){return a})),r.d(e,"Scan",(function(){return p}));var i,n=r(37),s=r(39),o=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),l=function(t){function e(e,r){var i=t.call(this,"region")||this;if(null!=e){if(e.skip(2),6!==e.readInt16())throw new n.WMFJSError("Invalid region identifier");e.skip(2);e.readInt16();var o=e.readInt16();e.skip(2);var l=e.readInt16(),a=e.readInt16(),h=e.readInt16(),c=e.readInt16();i.bounds=new s.Rect(null,l,a,h,c),i.scans=[];for(var u=0;u<o;u++)i.scans.push(new p(e));i._updateComplexity()}else if(null!=r){if(i.bounds=null!=r.bounds?r.bounds.clone():null,null!=r.scans){i.scans=[];for(u=0;u<r.scans.length;u++)i.scans.push(r.scans[u].clone())}else i.scans=null;i.complexity=r.complexity}else i.bounds=null,i.scans=null,i.complexity=0;return i}return o(e,t),e.prototype.clone=function(){return new e(null,this)},e.prototype.toString=function(){return"{complexity: "+["null","simple","complex"][this.complexity]+" bounds: "+(null!=this.bounds?this.bounds.toString():"[none]")+" #scans: "+(null!=this.scans?this.scans.length:"[none]")+"}"},e.prototype._updateComplexity=function(){if(null==this.bounds)this.complexity=0,this.scans=null;else if(this.bounds.empty())this.complexity=0,this.scans=null,this.bounds=null;else if(null==this.scans)this.complexity=1;else if(this.complexity=2,1===this.scans.length){var t=this.scans[0];if(t.top===this.bounds.top&&t.bottom===this.bounds.bottom&&1===t.scanlines.length){var e=t.scanlines[0];e.left===this.bounds.left&&e.right===this.bounds.right&&(this.scans=null,this.complexity=1)}}},e.prototype.subtract=function(t){if((n.Helper.log("[wmf] Region "+this.toString()+" subtract "+t.toString()),null!=this.bounds)&&null!=this.bounds.intersect(t)){null==this.scans&&(this.scans=[],this.scans.push(new p(null,null,this.bounds.top,this.bounds.bottom,[{left:this.bounds.left,right:this.bounds.right}])),this.complexity=2);for(var e=0;e<this.scans.length;){if((f=this.scans[e]).bottom>=t.top){var r=f.clone();f.bottom=t.top-1,r.top=t.top,f.top>=f.bottom?this.scans[e]=r:(n.Helper.log("[wmf] Region split top scan "+e+" for substraction"),this.scans.splice(++e,0,r));break}e++}for(var i=e;e<this.scans.length;){if((f=this.scans[e]).top>t.bottom)break;if(f.bottom>t.bottom){r=f.clone();f.bottom=t.bottom,r.top=t.bottom+1,f.top>=f.bottom?this.scans[e]=r:(n.Helper.log("[wmf] Region split bottom scan "+e+" for substraction"),this.scans.splice(++e,0,r));break}e++}if(i<this.scans.length){var o=e;for(e=i;e<o;){(f=this.scans[e]).subtract(t.left,t.right)?e++:(n.Helper.log("[wmf] Region remove now empty scan "+e+" due to subtraction"),this.scans.splice(e,1),o--)}}if(null!=this.scans){for(var l,a=void 0,h=void 0,c=void 0,u=this.scans.length,d=0;d<u;d++){var f=this.scans[d];0===d&&(l=f.top),d===u-1&&(c=f.bottom);var E=f.scanlines.length;if(E>0){var T=f.scanlines[0];(null==a||T.left<a)&&(a=T.left),T=f.scanlines[E-1],(null==h||T.right>h)&&(h=T.right)}}null!=a&&null!=l&&null!=h&&null!=c?(this.bounds=new s.Rect(null,a,l,h,c),this._updateComplexity()):(this.bounds=null,this.scans=null,this.complexity=0)}else this._updateComplexity()}n.Helper.log("[wmf] Region subtraction -> "+this.toString())},e.prototype.intersect=function(t){if(n.Helper.log("[wmf] Region "+this.toString()+" intersect with "+t.toString()),null!=this.bounds)if(this.bounds=this.bounds.intersect(t),null!=this.bounds){if(null!=this.scans){for(var e=0;e<this.scans.length;){if(!((r=this.scans[e]).bottom<this.bounds.top))break;e++}for(e>0&&(n.Helper.log("[wmf] Region remove "+e+" scans from top"),this.scans.splice(0,e),this.scans.length>0&&(this.scans[0].top=this.bounds.top)),e=0;e<this.scans.length;){var r;if((r=this.scans[e]).top>this.bounds.bottom){n.Helper.log("[wmf] Region remove "+(this.scans.length-e)+" scans from bottom"),this.scans.splice(e,this.scans.length-e);break}r.intersect(this.bounds.left,this.bounds.right)?e++:(n.Helper.log("[wmf] Region remove now empty scan "+e+" due to intersection"),this.scans.splice(e,1))}this.scans.length>0&&(this.scans[this.scans.length-1].bottom=this.bounds.bottom),this._updateComplexity()}}else this.scans=null,this.complexity=0;n.Helper.log("[wmf] Region intersection -> "+this.toString())},e.prototype.offset=function(t,e){if(null!=this.bounds&&(this.bounds.left+=t,this.bounds.top+=e,this.bounds.right+=t,this.bounds.bottom+=e),null!=this.scans)for(var r=this.scans.length,i=0;i<r;i++){var n=this.scans[i];n.top+=e,n.bottom+=e;for(var s=n.scanlines.length,o=0;o<s;o++){var l=n.scanlines[o];l.left+=t,l.right+=t}}},e}(s.Obj);function a(t,e,r,i){var n=new l(null,null);return n.bounds=new s.Rect(null,t,e,r,i),n._updateComplexity(),n}var p=function(){function t(t,e,r,i,n){if(null!=t){var s=t.readUint16();this.top=t.readUint16(),this.bottom=t.readUint16(),this.scanlines=[];for(var o=0;o<s;o++){var l=t.readUint16(),a=t.readUint16();this.scanlines.push({left:l,right:a})}t.skip(2)}else if(null!=e){this.top=e.top,this.bottom=e.bottom,this.scanlines=[];for(o=0;o<e.scanlines.length;o++){var p=e.scanlines[o];this.scanlines.push({left:p.left,right:p.right})}}else this.top=r,this.bottom=i,this.scanlines=n}return t.prototype.clone=function(){return new t(null,this)},t.prototype.subtract=function(t,e){var r;for(r=0;r<this.scanlines.length;){if(!((s=this.scanlines[r]).left<=t))break;s.right>=t&&(s.right=t-1,s.left>=s.right)?this.scanlines.splice(r,1):r++}for(var i=r,n=0;r<this.scanlines.length;){var s;if((s=this.scanlines[r]).right>e){s.left=e,n=r-i,s.left>=s.right&&n++;break}r++}return n>0&&i<this.scanlines.length&&this.scanlines.splice(i,n),this.scanlines.length>0},t.prototype.intersect=function(t,e){for(var r=0;r<this.scanlines.length;r++){if((i=this.scanlines[r]).left>=t||i.right>=t){r>0&&this.scanlines.splice(0,r);break}}if(this.scanlines.length>0){var i;(i=this.scanlines[0]).left<t&&(i.left=t);for(r=0;r<this.scanlines.length;r++)if((i=this.scanlines[r]).left>e){this.scanlines.splice(r,this.scanlines.length-r);break}this.scanlines.length>0&&(i=this.scanlines[this.scanlines.length-1]).right>e&&(i.right=e)}return this.scanlines.length>0},t.prototype.toString=function(){return"{ #scanlines: "+this.scanlines.length+"}"},t}()},function(t,e,r){"use strict";r.r(e),r.d(e,"ColorRef",(function(){return a})),r.d(e,"Font",(function(){return p})),r.d(e,"Brush",(function(){return h})),r.d(e,"Pen",(function(){return c})),r.d(e,"PaletteEntry",(function(){return u})),r.d(e,"Palette",(function(){return d}));var i,n=r(42),s=r(37),o=r(39),l=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(){function t(t,e,r,i){null!=t?(this.r=t.readUint8(),this.g=t.readUint8(),this.b=t.readUint8(),t.skip(1)):(this.r=e,this.g=r,this.b=i)}return t.prototype.clone=function(){return new t(null,this.r,this.g,this.b)},t.prototype.toHex=function(){return(16777216+(this.r<<16|this.g<<8|this.b)).toString(16).slice(1)},t.prototype.toString=function(){return"{r: "+this.r+", g: "+this.g+", b: "+this.b+"}"},t}(),p=function(t){function e(e,r){var i=t.call(this,"font")||this;if(null!=e){i.height=e.readInt16(),i.width=e.readInt16(),i.escapement=e.readInt16(),i.orientation=e.readInt16(),i.weight=e.readInt16(),i.italic=e.readUint8(),i.underline=e.readUint8(),i.strikeout=e.readUint8(),i.charset=e.readUint8(),i.outprecision=e.readUint8(),i.clipprecision=e.readUint8(),i.quality=e.readUint8();var n=e.readUint8();i.pitch=15&n,i.family=n>>6&3;var s=r,o=e.pos;i.facename=e.readNullTermString(Math.min(s-(e.pos-o),32))}else null!=r?(r=r,i.height=r.height,i.width=r.width,i.escapement=r.escapement,i.orientation=r.orientation,i.weight=r.weight,i.italic=r.italic,i.underline=r.underline,i.strikeout=r.strikeout,i.charset=r.charset,i.outprecision=r.outprecision,i.clipprecision=r.clipprecision,i.quality=r.quality,i.pitch=r.pitch,i.family=r.family,i.facename=r.facename):(i.height=-80,i.width=0,i.escapement=0,i.orientation=0,i.weight=400,i.italic=0,i.underline=0,i.strikeout=0,i.charset=0,i.outprecision=0,i.clipprecision=0,i.quality=0,i.pitch=0,i.family=0,i.facename="Helvetica");return i}return l(e,t),e.prototype.clone=function(){return new e(null,this)},e.prototype.toString=function(){return JSON.stringify(this)},e}(o.Obj),h=function(t){function e(e,r,i){var o=t.call(this,"brush")||this;if(null!=e){var l=r,p=e.pos;if(!0===i||!1===i)switch(o.style=e.readUint16(),i&&o.style!==s.Helper.GDI.BrushStyle.BS_PATTERN&&(o.style=s.Helper.GDI.BrushStyle.BS_DIBPATTERNPT),o.style){case s.Helper.GDI.BrushStyle.BS_SOLID:o.color=new a(e);break;case s.Helper.GDI.BrushStyle.BS_PATTERN:e.skip(i?2:6),o.pattern=new n.Bitmap16(e,l-(e.pos-p));break;case s.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:o.colorusage=i?e.readUint16():e.readUint32(),i||e.skip(2),o.dibpatternpt=new n.DIBitmap(e,l-(e.pos-p));break;case s.Helper.GDI.BrushStyle.BS_HATCHED:o.color=new a(e),o.hatchstyle=e.readUint16()}else i instanceof n.PatternBitmap16&&(o.style=s.Helper.GDI.BrushStyle.BS_PATTERN,o.pattern=i)}else if(null!=r)switch(r=r,o.style=r.style,o.style){case s.Helper.GDI.BrushStyle.BS_SOLID:o.color=r.color.clone();break;case s.Helper.GDI.BrushStyle.BS_PATTERN:o.pattern=r.pattern.clone();break;case s.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:o.colorusage=r.colorusage,o.dibpatternpt=r.dibpatternpt;break;case s.Helper.GDI.BrushStyle.BS_HATCHED:o.color=r.color.clone(),o.hatchstyle=r.hatchstyle}return o}return l(e,t),e.prototype.clone=function(){return new e(null,this)},e.prototype.toString=function(){var t="{style: "+this.style;switch(this.style){case s.Helper.GDI.BrushStyle.BS_SOLID:t+=", color: "+this.color.toString();break;case s.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:t+=", colorusage: "+this.colorusage;break;case s.Helper.GDI.BrushStyle.BS_HATCHED:t+=", color: "+this.color.toString()+", hatchstyle: "+this.hatchstyle}return t+"}"},e}(o.Obj),c=function(t){function e(e,r,i,n,l,p){var h=t.call(this,"pen")||this;return null!=e?(r=e.readUint16(),h.style=255&r,h.width=new o.PointS(e),h.color=new a(e),h.linecap=r&(s.Helper.GDI.PenStyle.PS_ENDCAP_SQUARE|s.Helper.GDI.PenStyle.PS_ENDCAP_FLAT),h.join=r&(s.Helper.GDI.PenStyle.PS_JOIN_BEVEL|s.Helper.GDI.PenStyle.PS_JOIN_MITER)):(h.style=r,h.width=i,h.color=n,h.linecap=l,h.join=p),h}return l(e,t),e.prototype.clone=function(){return new e(null,this.style,this.width.clone(),this.color.clone(),this.linecap,this.join)},e.prototype.toString=function(){return"{style: "+this.style+", width: "+this.width.toString()+", color: "+this.color.toString()+", linecap: "+this.linecap+", join: "+this.join+"}"},e}(o.Obj),u=function(){function t(t,e){null!=t?(this.flag=t.readUint8(),this.b=t.readUint8(),this.g=t.readUint8(),this.r=t.readUint8()):(this.flag=e.flag,this.b=e.b,this.g=e.g,this.r=e.r)}return t.prototype.clone=function(){return new t(null,this)},t}(),d=function(t){function e(e,r){var i=t.call(this,"palette")||this;if(null!=e){i.start=e.readUint16();var n=e.readUint16();for(i.entries=[];n>0;)i.entries.push(new u(e)),n--}else{i.start=r.start,i.entries=[];for(var s=r.entries.length,o=0;o<s;o++)i.entries.push(r.entries[o])}return i}return l(e,t),e.prototype.clone=function(){return new e(null,this)},e.prototype.toString=function(){return"{ #entries: "+this.entries.length+"}"},e}(o.Obj)},function(t,e,r){"use strict";r.r(e),r.d(e,"BitmapBase",(function(){return o})),r.d(e,"BitmapCoreHeader",(function(){return l})),r.d(e,"BitmapInfoHeader",(function(){return a})),r.d(e,"BitmapInfo",(function(){return p})),r.d(e,"DIBitmap",(function(){return h})),r.d(e,"Bitmap16",(function(){return c})),r.d(e,"PatternBitmap16",(function(){return u}));var i,n=r(37),s=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=function(){function t(){}return t.prototype.getWidth=function(){throw new n.WMFJSError("getWidth not implemented")},t.prototype.getHeight=function(){throw new n.WMFJSError("getHeight not implemented")},t}(),l=function(){function t(t,e){e&&t.skip(4),this.width=t.readUint16(),this.height=t.readUint16(),this.planes=t.readUint16(),this.bitcount=t.readUint16()}return t.prototype.colors=function(){return this.bitcount<=8?1<<this.bitcount:0},t}(),a=function(){function t(t,e){e&&t.skip(4),this.width=t.readInt32(),this.height=t.readInt32(),this.planes=t.readUint16(),this.bitcount=t.readUint16(),this.compression=t.readUint32(),this.sizeimage=t.readUint32(),this.xpelspermeter=t.readInt32(),this.ypelspermeter=t.readInt32(),this.clrused=t.readUint32(),this.clrimportant=t.readUint32()}return t.prototype.colors=function(){return 0!==this.clrused?this.clrused<256?this.clrused:256:this.bitcount>8?0:1<<this.bitcount},t}(),p=function(t){function e(e,r){var i=t.call(this)||this;i._reader=e,i._offset=e.pos,i._usergb=r;var s=e.readUint32();if(i._infosize=s,s===n.Helper.GDI.BITMAPCOREHEADER_SIZE)i._header=new l(e,!1),i._infosize+=i._header.colors()*(r?3:2);else{i._header=new a(e,!1);var o=i._header.compression===n.Helper.GDI.BitmapCompression.BI_BITFIELDS?3:0;s<=n.Helper.GDI.BITMAPINFOHEADER_SIZE+4*o&&(i._infosize=n.Helper.GDI.BITMAPINFOHEADER_SIZE+4*o),i._infosize+=i._header.colors()*(r?4:2)}return i}return s(e,t),e.prototype.getWidth=function(){return this._header.width},e.prototype.getHeight=function(){return Math.abs(this._header.height)},e.prototype.infosize=function(){return this._infosize},e.prototype.header=function(){return this._header},e}(o),h=function(t){function e(e,r){var i=t.call(this)||this;return i._reader=e,i._offset=e.pos,i._size=r,i._info=new p(e,!0),i}return s(e,t),e.prototype.getWidth=function(){return this._info.getWidth()},e.prototype.getHeight=function(){return this._info.getHeight()},e.prototype.base64ref=function(){var t=this._reader.pos;this._reader.seek(this._offset);var e,r="image/bmp",i=this._info.header();if(i instanceof a&&null!=i.compression)switch(i.compression){case n.Helper.GDI.BitmapCompression.BI_JPEG:r="data:image/jpeg";break;case n.Helper.GDI.BitmapCompression.BI_PNG:r="data:image/png";break;default:e=this.makeBitmapFileHeader()}else e=this.makeBitmapFileHeader();null!=e?e+=this._reader.readBinary(this._size):e=this._reader.readBinary(this._size);var s="data:"+r+";base64,"+btoa(e);return this._reader.seek(t),s},e.prototype.makeBitmapFileHeader=function(){var t=new ArrayBuffer(14),e=new Uint8Array(t);return e[0]=66,e[1]=77,n.Helper._writeUint32Val(e,2,this._size+14),n.Helper._writeUint32Val(e,10,this._info.infosize()+14),n.Helper._blobToBinary(e)},e}(o),c=function(t){function e(e,r){var i=t.call(this)||this;if(null!=e){if(r=r,i._reader=e,i._offset=e.pos,i._size=r,i.type=e.readInt16(),i.width=e.readInt16(),i.height=e.readInt16(),i.widthBytes=e.readInt16(),i.planes=e.readUint8(),i.bitsPixel=e.readUint8(),i.bitsOffset=e.pos,i.bitsSize=(i.width*i.bitsPixel+15>>4<<1)*i.height,i.bitsSize>r-10)throw new n.WMFJSError("Bitmap should have "+i.bitsSize+" bytes, but has "+(r-10))}else{var s=r;i._reader=s._reader,i._offset=s._offset,i._size=s._size,i.type=s.type,i.width=s.width,i.height=s.height,i.widthBytes=s.widthBytes,i.planes=s.planes,i.bitsPixel=s.bitsPixel,i.bitsOffset=s.bitsOffset,i.bitsSize=s.bitsSize}return i}return s(e,t),e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.clone=function(){return new e(null,this)},e}(o),u=function(t){function e(e,r){var i=t.call(this,e,r)||this;return null!=e&&(i.bitsOffset+=22),i}return s(e,t),e.prototype.clone=function(){return new e(null,this)},e}(c)},function(t,e,r){"use strict";r.r(e),r.d(e,"WMFRecords",(function(){return p}));var i=r(42),n=r(36),s=r(37),o=r(39),l=r(40),a=r(41),p=function(){function t(t,e){this._records=[];var r=!1,p=e,h=function(){t.seek(p);var e=t.readUint32();if(e<3)throw new s.WMFJSError("Invalid record size");var h=t.readUint16();switch(h){case s.Helper.GDI.RecordType.META_EOF:return r=!0,"break-main_loop";case s.Helper.GDI.RecordType.META_SETMAPMODE:var u=t.readUint16();c._records.push((function(t){t.setMapMode(u)}));break;case s.Helper.GDI.RecordType.META_SETWINDOWORG:var d=t.readInt16(),f=t.readInt16();c._records.push((function(t){t.setWindowOrg(f,d)}));break;case s.Helper.GDI.RecordType.META_SETWINDOWEXT:var E=t.readInt16(),T=t.readInt16();c._records.push((function(t){t.setWindowExt(T,E)}));break;case s.Helper.GDI.RecordType.META_OFFSETWINDOWORG:var g=t.readInt16(),_=t.readInt16();c._records.push((function(t){t.offsetWindowOrg(_,g)}));break;case s.Helper.GDI.RecordType.META_SETVIEWPORTORG:var S=t.readInt16(),y=t.readInt16();c._records.push((function(t){t.setViewportOrg(y,S)}));break;case s.Helper.GDI.RecordType.META_SETVIEWPORTEXT:var I=t.readInt16(),v=t.readInt16();c._records.push((function(t){t.setViewportExt(v,I)}));break;case s.Helper.GDI.RecordType.META_OFFSETVIEWPORTORG:var A=t.readInt16(),b=t.readInt16();c._records.push((function(t){t.offsetViewportOrg(b,A)}));break;case s.Helper.GDI.RecordType.META_SAVEDC:c._records.push((function(t){t.saveDC()}));break;case s.Helper.GDI.RecordType.META_RESTOREDC:var R=t.readInt16();c._records.push((function(t){t.restoreDC(R)}));break;case s.Helper.GDI.RecordType.META_SETSTRETCHBLTMODE:var w=t.readUint16();c._records.push((function(t){t.setStretchBltMode(w)}));break;case s.Helper.GDI.RecordType.META_DIBSTRETCHBLT:var O=t.readUint16()|t.readUint16()<<16,M=t.readInt16(),H=t.readInt16(),D=t.readInt16(),P=t.readInt16(),m=t.readInt16(),C=t.readInt16(),N=t.readInt16(),G=t.readInt16(),B=2*e-(t.pos-p),x=new i.DIBitmap(t,B);c._records.push((function(t){t.stretchDibBits(P,D,H,M,G,N,C,m,O,x)}));break;case s.Helper.GDI.RecordType.META_STRETCHDIB:var L=t.readUint16()|t.readUint16()<<16,k=t.readInt16(),U=t.readInt16(),F=t.readInt16(),W=t.readInt16(),j=t.readInt16(),X=t.readInt16(),V=t.readInt16(),Y=t.readInt16(),J=t.readInt16(),z=(B=2*e-(t.pos-p),new i.DIBitmap(t,B));c._records.push((function(t){t.stretchDib(j,W,F,U,J,Y,V,X,L,k,z)}));break;case s.Helper.GDI.RecordType.META_ESCAPE:var Z=t.readUint16(),q=t.readUint16(),K=t.pos,Q=new n.Blob(t,K);c._records.push((function(t){t.escape(Z,Q,K,q)}));break;case s.Helper.GDI.RecordType.META_SETTEXTALIGN:var $=t.readUint16();c._records.push((function(t){t.setTextAlign($)}));break;case s.Helper.GDI.RecordType.META_SETBKMODE:var tt=t.readUint16();c._records.push((function(t){t.setBkMode(tt)}));break;case s.Helper.GDI.RecordType.META_SETTEXTCOLOR:var et=new a.ColorRef(t);c._records.push((function(t){t.setTextColor(et)}));break;case s.Helper.GDI.RecordType.META_SETBKCOLOR:var rt=new a.ColorRef(t);c._records.push((function(t){t.setBkColor(rt)}));break;case s.Helper.GDI.RecordType.META_CREATEBRUSHINDIRECT:B=2*e-(t.pos-p);var it=new a.Brush(t,B,!1);c._records.push((function(t){t.createBrush(it)}));break;case s.Helper.GDI.RecordType.META_DIBCREATEPATTERNBRUSH:B=2*e-(t.pos-p);var nt=new a.Brush(t,B,!0);c._records.push((function(t){t.createBrush(nt)}));break;case s.Helper.GDI.RecordType.META_CREATEPENINDIRECT:var st=new a.Pen(t);c._records.push((function(t){t.createPen(st)}));break;case s.Helper.GDI.RecordType.META_CREATEFONTINDIRECT:B=2*e-(t.pos-p);var ot=new a.Font(t,B);c._records.push((function(t){t.createFont(ot)}));break;case s.Helper.GDI.RecordType.META_SELECTOBJECT:var lt=t.readUint16();c._records.push((function(t){t.selectObject(lt,null)}));break;case s.Helper.GDI.RecordType.META_SELECTPALETTE:var at=t.readUint16();c._records.push((function(t){t.selectObject(at,"palette")}));break;case s.Helper.GDI.RecordType.META_SELECTCLIPREGION:var pt=t.readUint16();c._records.push((function(t){t.selectObject(pt,"region")}));break;case s.Helper.GDI.RecordType.META_DELETEOBJECT:var ht=t.readUint16();c._records.push((function(t){t.deleteObject(ht)}));break;case s.Helper.GDI.RecordType.META_RECTANGLE:var ct=new o.Rect(t);c._records.push((function(t){t.rectangle(ct,0,0)}));break;case s.Helper.GDI.RecordType.META_ROUNDRECT:var ut=t.readInt16(),dt=t.readInt16(),ft=new o.Rect(t);c._records.push((function(t){t.rectangle(ft,dt,ut)}));break;case s.Helper.GDI.RecordType.META_LINETO:var Et=t.readInt16(),Tt=t.readInt16();c._records.push((function(t){t.lineTo(Tt,Et)}));break;case s.Helper.GDI.RecordType.META_MOVETO:var gt=t.readInt16(),_t=t.readInt16();c._records.push((function(t){t.moveTo(_t,gt)}));break;case s.Helper.GDI.RecordType.META_TEXTOUT:if((bt=t.readInt16())>0){var St=t.readString(bt);t.skip(bt%2);var yt=t.readInt16(),It=t.readInt16();c._records.push((function(t){t.textOut(It,yt,St)}))}break;case s.Helper.GDI.RecordType.META_EXTTEXTOUT:var vt=t.readInt16(),At=t.readInt16(),bt=t.readInt16(),Rt=t.readUint16(),wt=null,Ot=null;2*e===14+bt+bt%2&&(wt=!1,Ot=!1),2*e===22+bt+bt%2&&(wt=!0,Ot=!1),2*e===14+bt+bt%2+2*bt&&(wt=!1,Ot=!0),2*e===22+bt+bt%2+2*bt&&(wt=!0,Ot=!0);var Mt=wt?new o.Rect(t):null;if(bt>0){var Ht=t.readString(bt);t.skip(bt%2);var Dt=[];if(Ot)for(var Pt=0;Pt<Ht.length;Pt++)Dt.push(t.readInt16());c._records.push((function(t){t.extTextOut(At,vt,Ht,Rt,Mt,Dt)}))}break;case s.Helper.GDI.RecordType.META_EXCLUDECLIPRECT:var mt=new o.Rect(t);c._records.push((function(t){t.excludeClipRect(mt)}));break;case s.Helper.GDI.RecordType.META_INTERSECTCLIPRECT:var Ct=new o.Rect(t);c._records.push((function(t){t.intersectClipRect(Ct)}));break;case s.Helper.GDI.RecordType.META_POLYGON:for(var Nt=t.readInt16(),Gt=[];Nt>0;)Gt.push(new o.PointS(t)),Nt--;c._records.push((function(t){t.polygon(Gt,!0)}));break;case s.Helper.GDI.RecordType.META_SETPOLYFILLMODE:var Bt=t.readUint16();c._records.push((function(t){t.setPolyFillMode(Bt)}));break;case s.Helper.GDI.RecordType.META_POLYPOLYGON:Nt=t.readUint16();var xt=[];for(Pt=0;Pt<Nt;Pt++)xt.push(t.readUint16());var Lt=[];for(Pt=0;Pt<Nt;Pt++){for(var kt=xt[Pt],Ut=[],Ft=0;Ft<kt;Ft++)Ut.push(new o.PointS(t));Lt.push(Ut)}c._records.push((function(t){t.polyPolygon(Lt)}));break;case s.Helper.GDI.RecordType.META_POLYLINE:Nt=t.readInt16();for(var Wt=[];Nt>0;)Wt.push(new o.PointS(t)),Nt--;c._records.push((function(t){t.polyline(Wt)}));break;case s.Helper.GDI.RecordType.META_ELLIPSE:var jt=new o.Rect(t);c._records.push((function(t){t.ellipse(jt)}));break;case s.Helper.GDI.RecordType.META_CREATEPALETTE:var Xt=new a.Palette(t);c._records.push((function(t){t.createPalette(Xt)}));break;case s.Helper.GDI.RecordType.META_CREATEREGION:var Vt=new l.Region(t);c._records.push((function(t){t.createRegion(Vt)}));break;case s.Helper.GDI.RecordType.META_CREATEPATTERNBRUSH:B=2*e-(t.pos-p);var Yt=new i.PatternBitmap16(t,B),Jt=new a.Brush(t,B,Yt);c._records.push((function(t){t.createPatternBrush(Jt)}));break;case s.Helper.GDI.RecordType.META_OFFSETCLIPRGN:var zt=t.readInt16(),Zt=t.readInt16();c._records.push((function(t){t.offsetClipRgn(Zt,zt)}));break;case s.Helper.GDI.RecordType.META_REALIZEPALETTE:case s.Helper.GDI.RecordType.META_SETPALENTRIES:case s.Helper.GDI.RecordType.META_SETROP2:case s.Helper.GDI.RecordType.META_SETRELABS:case s.Helper.GDI.RecordType.META_SETTEXTCHAREXTRA:case s.Helper.GDI.RecordType.META_RESIZEPALETTE:case s.Helper.GDI.RecordType.META_SETLAYOUT:case s.Helper.GDI.RecordType.META_FILLREGION:case s.Helper.GDI.RecordType.META_SETMAPPERFLAGS:case s.Helper.GDI.RecordType.META_SETTEXTJUSTIFICATION:case s.Helper.GDI.RecordType.META_SCALEWINDOWEXT:case s.Helper.GDI.RecordType.META_SCALEVIEWPORTEXT:case s.Helper.GDI.RecordType.META_FLOODFILL:case s.Helper.GDI.RecordType.META_FRAMEREGION:case s.Helper.GDI.RecordType.META_ANIMATEPALETTE:case s.Helper.GDI.RecordType.META_EXTFLOODFILL:case s.Helper.GDI.RecordType.META_SETPIXEL:case s.Helper.GDI.RecordType.META_PATBLT:case s.Helper.GDI.RecordType.META_PIE:case s.Helper.GDI.RecordType.META_STRETCHBLT:case s.Helper.GDI.RecordType.META_INVERTREGION:case s.Helper.GDI.RecordType.META_PAINTREGION:case s.Helper.GDI.RecordType.META_ARC:case s.Helper.GDI.RecordType.META_CHORD:case s.Helper.GDI.RecordType.META_BITBLT:case s.Helper.GDI.RecordType.META_SETDIBTODEV:case s.Helper.GDI.RecordType.META_DIBBITBLT:default:var qt="UNKNOWN";for(var Kt in s.Helper.GDI.RecordType){if(s.Helper.GDI.RecordType[Kt]===h){qt=Kt;break}}s.Helper.log("[WMF] "+qt+" record (0x"+h.toString(16)+") at offset 0x"+p.toString(16)+" with "+2*e+" bytes")}p+=2*e},c=this;t:for(;!r;){switch(h()){case"break-main_loop":break t}}if(!r)throw new s.WMFJSError("Could not read all records")}return t.prototype.play=function(t){for(var e=this._records.length,r=0;r<e;r++)this._records[r](t)},t}()}])}));
//# sourceMappingURL=WMFJS.bundle.min.js.map