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;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;ACNA;;;;;;;;;;;;;;;;;;;;;;;;;EAyBE;AAEuD;AACM","sources":["webpack://rtfjs/webpack/universalModuleDefinition","webpack://rtfjs/./src/emfjs/Bitmap.ts","webpack://rtfjs/./src/emfjs/Blob.ts","webpack://rtfjs/./src/emfjs/EMFRecords.ts","webpack://rtfjs/./src/emfjs/GDIContext.ts","webpack://rtfjs/./src/emfjs/Helper.ts","webpack://rtfjs/./src/emfjs/Primitives.ts","webpack://rtfjs/./src/emfjs/Region.ts","webpack://rtfjs/./src/emfjs/Renderer.ts","webpack://rtfjs/./src/emfjs/Style.ts","webpack://rtfjs/./src/util/SVG.ts","webpack://rtfjs/./src/util/index.ts","webpack://rtfjs/webpack/bootstrap","webpack://rtfjs/webpack/runtime/define property getters","webpack://rtfjs/webpack/runtime/hasOwnProperty shorthand","webpack://rtfjs/webpack/runtime/make namespace object","webpack://rtfjs/./src/emfjs/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"EMFJS\"] = factory();\n\telse\n\t\troot[\"EMFJS\"] = factory();\n})(this, () => {\nreturn ","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { Helper } from \"./Helper\";\n\ninterface Bitmap {\n getWidth(): number\n\n getHeight(): number\n}\n\nclass BitmapCoreHeader {\n public width: number;\n public height: number;\n public planes: number;\n public bitcount: number;\n\n constructor(reader: Blob, skipsize: boolean) {\n if (skipsize) {\n reader.skip(4);\n }\n this.width = reader.readUint16();\n this.height = reader.readUint16();\n this.planes = reader.readUint16();\n this.bitcount = reader.readUint16();\n }\n\n public colors(): number {\n return this.bitcount <= 8 ? 1 << this.bitcount : 0;\n }\n}\n\nclass BitmapInfoHeader {\n public width: number;\n public height: number;\n public planes: number;\n public bitcount: number;\n public compression: number;\n public sizeimage: number;\n public xpelspermeter: number;\n public ypelspermeter: number;\n public clrused: number;\n public clrimportant: number;\n\n constructor(reader: Blob, skipsize: boolean) {\n if (skipsize) {\n reader.skip(4);\n }\n this.width = reader.readInt32();\n this.height = reader.readInt32();\n this.planes = reader.readUint16();\n this.bitcount = reader.readUint16();\n this.compression = reader.readUint32();\n this.sizeimage = reader.readUint32();\n this.xpelspermeter = reader.readInt32();\n this.ypelspermeter = reader.readInt32();\n this.clrused = reader.readUint32();\n this.clrimportant = reader.readUint32();\n }\n\n public colors(): number {\n if (this.clrused !== 0) {\n return this.clrused < 256 ? this.clrused : 256;\n } else {\n return this.bitcount > 8 ? 0 : 1 << this.bitcount;\n }\n }\n}\n\nexport class BitmapInfo implements Bitmap {\n private _usergb: boolean;\n private _infosize: number;\n private _header: BitmapCoreHeader | BitmapInfoHeader;\n\n constructor(reader: Blob, usergb: boolean) {\n this._usergb = usergb;\n const hdrsize = reader.readUint32();\n this._infosize = hdrsize;\n if (hdrsize === Helper.GDI.BITMAPCOREHEADER_SIZE) {\n this._header = new BitmapCoreHeader(reader, false);\n this._infosize += this._header.colors() * (usergb ? 3 : 2);\n } else {\n this._header = new BitmapInfoHeader(reader, false);\n const masks = (this._header as BitmapInfoHeader).compression\n === Helper.GDI.BitmapCompression.BI_BITFIELDS ? 3 : 0;\n if (hdrsize <= Helper.GDI.BITMAPINFOHEADER_SIZE + (masks * 4)) {\n this._infosize = Helper.GDI.BITMAPINFOHEADER_SIZE + (masks * 4);\n }\n this._infosize += this._header.colors() * (usergb ? 4 : 2);\n }\n }\n\n public getWidth(): number {\n return this._header.width;\n }\n\n public getHeight(): number {\n return Math.abs(this._header.height);\n }\n\n public infosize(): number {\n return this._infosize;\n }\n\n public header(): BitmapCoreHeader | BitmapInfoHeader {\n return this._header;\n }\n}\n\nexport class DIBitmap implements Bitmap {\n private _reader: Blob;\n private _offset: number;\n private _location: any;\n private _info: BitmapInfo;\n\n constructor(reader: Blob, bitmapInfo?: any) {\n this._reader = reader;\n this._offset = reader.pos;\n this._location = bitmapInfo;\n this._info = new BitmapInfo(reader, true);\n }\n\n public getWidth(): number {\n return this._info.getWidth();\n }\n\n public getHeight(): number {\n return this._info.getHeight();\n }\n\n public totalSize(): number {\n return this._location.header.size + this._location.data.size;\n }\n\n public makeBitmapFileHeader(): string {\n const buf = new ArrayBuffer(14);\n const view = new Uint8Array(buf);\n view[0] = 0x42;\n view[1] = 0x4d;\n Helper._writeUint32Val(view, 2, this.totalSize() + 14);\n Helper._writeUint32Val(view, 10, this._info.infosize() + 14);\n return Helper._blobToBinary(view);\n }\n\n public base64ref(): string {\n const prevpos = this._reader.pos;\n this._reader.seek(this._offset);\n let mime = \"image/bmp\";\n const header = this._info.header();\n let data;\n if (header instanceof BitmapInfoHeader && header.compression != null) {\n switch (header.compression) {\n case Helper.GDI.BitmapCompression.BI_JPEG:\n mime = \"data:image/jpeg\";\n break;\n case Helper.GDI.BitmapCompression.BI_PNG:\n mime = \"data:image/png\";\n break;\n default:\n data = this.makeBitmapFileHeader();\n break;\n }\n } else {\n data = this.makeBitmapFileHeader();\n }\n\n this._reader.seek(this._location.header.offset);\n if (data != null) {\n data += this._reader.readBinary(this._location.header.size);\n } else {\n data = this._reader.readBinary(this._location.header.size);\n }\n\n this._reader.seek(this._location.data.offset);\n data += this._reader.readBinary(this._location.data.size);\n\n const ref = \"data:\" + mime + \";base64,\" + btoa(data);\n this._reader.seek(prevpos);\n return ref;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { EMFJSError } from \"./Helper\";\n\nexport class Blob {\n public pos: number;\n private blob: Blob | ArrayBuffer;\n private data: Uint8Array;\n\n constructor(blob: Blob | ArrayBuffer, offset?: number) {\n if (blob instanceof Blob) {\n this.blob = blob.blob;\n this.data = blob.data;\n this.pos = offset || blob.pos;\n } else {\n this.blob = blob;\n this.data = new Uint8Array(blob);\n this.pos = offset || 0;\n }\n }\n\n public eof(): boolean {\n return this.pos >= this.data.length;\n }\n\n public seek(newpos: number): void {\n if (newpos < 0 || newpos > this.data.length) {\n throw new EMFJSError(\"Invalid seek position\");\n }\n this.pos = newpos;\n }\n\n public skip(cnt: number): void {\n const newPos = this.pos + cnt;\n if (newPos > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n this.pos = newPos;\n }\n\n public readBinary(cnt: number): string {\n const end = this.pos + cnt;\n if (end > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let ret = \"\";\n while (cnt-- > 0) {\n ret += String.fromCharCode(this.data[this.pos++]);\n }\n return ret;\n }\n\n public readInt8(): number {\n if (this.pos + 1 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n return this.data[this.pos++];\n }\n\n public readUint8(): number {\n return this.readInt8() >>> 0;\n }\n\n public readInt32(): number {\n if (this.pos + 4 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let val = this.data[this.pos++];\n val |= this.data[this.pos++] << 8;\n val |= this.data[this.pos++] << 16;\n val |= this.data[this.pos++] << 24;\n return val;\n }\n\n public readUint32(): number {\n return this.readInt32() >>> 0;\n }\n\n public readUint16(): number {\n if (this.pos + 2 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let val = this.data[this.pos++];\n val |= this.data[this.pos++] << 8;\n return val;\n }\n\n public readInt16(): number {\n let val = this.readUint16();\n if (val > 32767) {\n val -= 65536;\n }\n return val;\n }\n\n public readString(length: number): string {\n if (this.pos + length > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let ret = \"\";\n for (let i = 0; i < length; i++) {\n ret += String.fromCharCode(this.data[this.pos++] >>> 0);\n }\n return ret;\n }\n\n public readNullTermString(maxSize: number): string {\n let ret = \"\";\n if (maxSize > 0) {\n maxSize--;\n for (let i = 0; i < maxSize; i++) {\n if (this.pos + i + 1 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n const byte = this.data[this.pos + i] >>> 0;\n if (byte === 0) {\n break;\n }\n ret += String.fromCharCode(byte);\n }\n }\n return ret;\n }\n\n public readFixedSizeUnicodeString(fixedSizeChars: number): string {\n let ret = \"\";\n for (let i = 0; i < fixedSizeChars; i++) {\n const charCode = this.readUint16();\n if (charCode === 0) {\n if (++i < fixedSizeChars) {\n this.skip((fixedSizeChars - i) * 2);\n }\n break;\n }\n ret += String.fromCharCode(charCode);\n }\n return ret;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { GDIContext } from \"./GDIContext\";\nimport { EMFJSError, Helper } from \"./Helper\";\nimport { PointL, PointS, RectL, SizeL } from \"./Primitives\";\nimport { Region } from \"./Region\";\nimport { Brush, ColorRef, Pen } from \"./Style\";\n\nclass EmfHeader {\n private size: number;\n private bounds: RectL;\n private frame: RectL;\n private nPalEntries: number;\n private refDevCx: number;\n private refDevCy: number;\n private refDevCxMm: number;\n private refDevCyMm: number;\n private description: string;\n private displayDevCxUm: number;\n private displayDevCyUm: number;\n\n constructor(reader: Blob, headerSize: number) {\n const recordStart = reader.pos - 8;\n\n this.size = headerSize;\n this.bounds = new RectL(reader);\n this.frame = new RectL(reader);\n if (reader.readUint32() !== Helper.GDI.FormatSignature.ENHMETA_SIGNATURE) {\n throw new EMFJSError(\"Invalid header signature\");\n }\n reader.skip(4); // version\n reader.skip(4); // bytes (size of metafile)\n reader.skip(4); // number of records\n reader.skip(2); // number of handles\n reader.skip(2); // reserved\n const descriptionLen = reader.readUint32();\n const descriptionOff = reader.readUint32();\n this.nPalEntries = reader.readUint32();\n this.refDevCx = reader.readUint32();\n this.refDevCy = reader.readUint32();\n this.refDevCxMm = reader.readUint32();\n this.refDevCyMm = reader.readUint32();\n\n let hdrSize = headerSize;\n if (descriptionLen > 0) {\n if (descriptionOff < 88) {\n throw new EMFJSError(\"Invalid header description offset\");\n }\n\n hdrSize = descriptionOff + (descriptionLen * 2);\n if (hdrSize > headerSize) {\n throw new EMFJSError(\"Invalid header description length\");\n }\n\n const prevPos = reader.pos;\n reader.seek(recordStart + descriptionOff);\n this.description = reader.readFixedSizeUnicodeString(descriptionLen);\n reader.seek(prevPos);\n } else {\n this.description = \"\";\n }\n\n if (hdrSize >= 100) {\n // We have a EmfMetafileHeaderExtension1 record\n const pixelFormatSize = reader.readUint32();\n const pixelFormatOff = reader.readUint32();\n const haveOpenGl = reader.readUint32();\n if (haveOpenGl !== 0) {\n throw new EMFJSError(\"OpenGL records are not yet supported\");\n }\n\n if (pixelFormatOff !== 0) {\n if (pixelFormatOff < 100 || pixelFormatOff < hdrSize) {\n throw new EMFJSError(\"Invalid pixel format offset\");\n }\n\n hdrSize = pixelFormatOff + pixelFormatSize;\n if (hdrSize > headerSize) {\n throw new EMFJSError(\"Invalid pixel format size\");\n }\n\n // TODO: read pixel format blob\n }\n\n if (hdrSize >= 108) {\n // We have a EmfMetafileHeaderExtension2 record\n this.displayDevCxUm = reader.readUint32(); // in micrometers\n this.displayDevCyUm = reader.readUint32(); // in micrometers\n }\n }\n }\n\n public toString(): string {\n return \"{bounds: \" + this.bounds.toString() + \", frame: \" + this.frame.toString()\n + \", description: \" + this.description + \"}\";\n }\n}\n\nexport class EMFRecords {\n private _records: ((gdi: GDIContext) => void)[];\n private _header: EmfHeader;\n\n constructor(reader: Blob, first: number) {\n this._records = [];\n\n this._header = new EmfHeader(reader, first);\n\n let all = false;\n let curpos = first;\n main_loop: while (!all) {\n reader.seek(curpos);\n const type = reader.readUint32();\n const size = reader.readUint32();\n if (size < 8) {\n throw new EMFJSError(\"Invalid record size\");\n }\n switch (type) {\n case Helper.GDI.RecordType.EMR_EOF:\n all = true;\n break main_loop;\n case Helper.GDI.RecordType.EMR_SETMAPMODE: {\n const mapMode = reader.readInt32();\n this._records.push((gdi) => {\n gdi.setMapMode(mapMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETWINDOWORGEX: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.setWindowOrgEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETWINDOWEXTEX: {\n const x = reader.readUint32();\n const y = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setWindowExtEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETVIEWPORTORGEX: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.setViewportOrgEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETVIEWPORTEXTEX: {\n const x = reader.readUint32();\n const y = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setViewportExtEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SAVEDC: {\n this._records.push((gdi) => {\n gdi.saveDC();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_RESTOREDC: {\n const saved = reader.readInt32();\n this._records.push((gdi) => {\n gdi.restoreDC(saved);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETBKMODE: {\n const bkMode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setBkMode(bkMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETBKCOLOR: {\n const bkColor = new ColorRef(reader);\n this._records.push((gdi) => {\n gdi.setBkColor(bkColor);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_CREATEBRUSHINDIRECT: {\n const index = reader.readUint32();\n const brush = new Brush(reader);\n this._records.push((gdi) => {\n gdi.createBrush(index, brush);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_CREATEPEN: {\n const index = reader.readUint32();\n const pen = new Pen(reader, null);\n this._records.push((gdi) => {\n gdi.createPen(index, pen);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_EXTCREATEPEN: {\n const index = reader.readUint32();\n const offBmi = reader.readUint32();\n const cbBmi = reader.readUint32();\n const offBits = reader.readUint32();\n const cbBits = reader.readUint32();\n const pen = new Pen(reader, {\n header: {\n off: offBmi,\n size: cbBmi,\n },\n data: {\n off: offBits,\n size: cbBits,\n },\n });\n this._records.push((gdi) => {\n gdi.createPen(index, pen);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SELECTOBJECT: {\n const idx = reader.readUint32();\n this._records.push((gdi) => {\n gdi.selectObject(idx, null);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_DELETEOBJECT: {\n const idx = reader.readUint32();\n this._records.push((gdi) => {\n gdi.deleteObject(idx);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_RECTANGLE: {\n const rect = new RectL(reader);\n this._records.push((gdi) => {\n gdi.rectangle(rect, 0, 0);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_ROUNDRECT: {\n const rect = new RectL(reader);\n const corner = new SizeL(reader);\n this._records.push((gdi) => {\n gdi.rectangle(rect, corner.cx, corner.cy);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_LINETO: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.lineTo(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_MOVETOEX: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.moveToEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYGON:\n case Helper.GDI.RecordType.EMR_POLYGON16: {\n const isSmall = (type === Helper.GDI.RecordType.EMR_POLYGON16);\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointS[] | PointL[] = [];\n while (cnt > 0) {\n points.push(isSmall ? new PointS(reader) : new PointL(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polygon(points, bounds, true);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYPOLYGON:\n case Helper.GDI.RecordType.EMR_POLYPOLYGON16: {\n const isSmall = (type === Helper.GDI.RecordType.EMR_POLYPOLYGON16);\n const bounds = new RectL(reader);\n const polyCnt = reader.readUint32();\n reader.skip(4); // count\n const polygonsPtCnts = [];\n for (let i = 0; i < polyCnt; i++) {\n polygonsPtCnts.push(reader.readUint32());\n }\n\n const polygons: PointS[][] | PointL[][] = [];\n for (let i = 0; i < polyCnt; i++) {\n const ptCnt = polygonsPtCnts[i];\n\n const p = [];\n for (let ip = 0; ip < ptCnt; ip++) {\n p.push(isSmall ? new PointS(reader) : new PointL(reader));\n }\n polygons.push(p);\n }\n this._records.push((gdi) => {\n gdi.polyPolygon(polygons, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETPOLYFILLMODE: {\n const polyfillmode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setPolyFillMode(polyfillmode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYLINE16:\n case Helper.GDI.RecordType.EMR_POLYLINETO16: {\n const isLineTo = (type === Helper.GDI.RecordType.EMR_POLYLINETO16);\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointS[] = [];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polyline(isLineTo, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYBEZIER:\n case Helper.GDI.RecordType.EMR_POLYBEZIERTO: {\n const isPolyBezierTo = (type === Helper.GDI.RecordType.EMR_POLYBEZIERTO);\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointL[] = [];\n while (cnt > 0) {\n points.push(new PointL(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polybezier(isPolyBezierTo, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYBEZIER16: {\n const bounds = new RectL(reader);\n const start = new PointL(reader);\n let cnt = reader.readUint32();\n const points = [start];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polybezier(false, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYBEZIERTO16: {\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointS[] = [];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polybezier(true, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETTEXTALIGN: {\n const textAlign = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setTextAlign(textAlign);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETSTRETCHBLTMODE: {\n const stretchMode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setStretchBltMode(stretchMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETBRUSHORGEX: {\n const origin = new PointL(reader);\n this._records.push((gdi) => {\n gdi.setBrushOrgEx(origin);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_BEGINPATH: {\n this._records.push((gdi) => {\n gdi.beginPath();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_ENDPATH: {\n this._records.push((gdi) => {\n gdi.endPath();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_ABORTPATH: {\n this._records.push((gdi) => {\n gdi.abortPath();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_CLOSEFIGURE: {\n this._records.push((gdi) => {\n gdi.closeFigure();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_FILLPATH: {\n const bounds = new RectL(reader);\n this._records.push((gdi) => {\n gdi.fillPath(bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_STROKEPATH: {\n const bounds = new RectL(reader);\n this._records.push((gdi) => {\n gdi.strokePath(bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SELECTCLIPPATH: {\n const rgnMode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.selectClipPath(rgnMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_EXTSELECTCLIPRGN: {\n reader.skip(4);\n const rgnMode = reader.readUint32();\n const region = rgnMode !== Helper.GDI.RegionMode.RGN_COPY ? new Region(reader) : null;\n this._records.push((gdi) => {\n gdi.selectClipRgn(rgnMode, region);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_OFFSETCLIPRGN: {\n const offset = new PointL(reader);\n this._records.push((gdi) => {\n gdi.offsetClipRgn(offset);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETMITERLIMIT: {\n const miterLimit = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setMiterLimit(miterLimit);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYLINE:\n case Helper.GDI.RecordType.EMR_POLYLINETO:\n case Helper.GDI.RecordType.EMR_POLYPOLYLINE:\n case Helper.GDI.RecordType.EMR_SETPIXELV:\n case Helper.GDI.RecordType.EMR_SETMAPPERFLAGS:\n case Helper.GDI.RecordType.EMR_SETROP2:\n case Helper.GDI.RecordType.EMR_SETCOLORADJUSTMENT:\n case Helper.GDI.RecordType.EMR_SETTEXTCOLOR:\n case Helper.GDI.RecordType.EMR_SETMETARGN:\n case Helper.GDI.RecordType.EMR_EXCLUDECLIPRECT:\n case Helper.GDI.RecordType.EMR_INTERSECTCLIPRECT:\n case Helper.GDI.RecordType.EMR_SCALEVIEWPORTEXTEX:\n case Helper.GDI.RecordType.EMR_SCALEWINDOWEXTEX:\n case Helper.GDI.RecordType.EMR_SETWORLDTRANSFORM:\n case Helper.GDI.RecordType.EMR_MODIFYWORLDTRANSFORM:\n case Helper.GDI.RecordType.EMR_ANGLEARC:\n case Helper.GDI.RecordType.EMR_ELLIPSE:\n case Helper.GDI.RecordType.EMR_ARC:\n case Helper.GDI.RecordType.EMR_CHORD:\n case Helper.GDI.RecordType.EMR_PIE:\n case Helper.GDI.RecordType.EMR_SELECTPALETTE:\n case Helper.GDI.RecordType.EMR_CREATEPALETTE:\n case Helper.GDI.RecordType.EMR_SETPALETTEENTRIES:\n case Helper.GDI.RecordType.EMR_RESIZEPALETTE:\n case Helper.GDI.RecordType.EMR_REALIZEPALETTE:\n case Helper.GDI.RecordType.EMR_EXTFLOODFILL:\n case Helper.GDI.RecordType.EMR_ARCTO:\n case Helper.GDI.RecordType.EMR_POLYDRAW:\n case Helper.GDI.RecordType.EMR_SETARCDIRECTION:\n case Helper.GDI.RecordType.EMR_STROKEANDFILLPATH:\n case Helper.GDI.RecordType.EMR_FLATTENPATH:\n case Helper.GDI.RecordType.EMR_WIDENPATH:\n case Helper.GDI.RecordType.EMR_COMMENT:\n case Helper.GDI.RecordType.EMR_FILLRGN:\n case Helper.GDI.RecordType.EMR_FRAMERGN:\n case Helper.GDI.RecordType.EMR_INVERTRGN:\n case Helper.GDI.RecordType.EMR_PAINTRGN:\n case Helper.GDI.RecordType.EMR_BITBLT:\n case Helper.GDI.RecordType.EMR_STRETCHBLT:\n case Helper.GDI.RecordType.EMR_MASKBLT:\n case Helper.GDI.RecordType.EMR_PLGBLT:\n case Helper.GDI.RecordType.EMR_SETDIBITSTODEVICE:\n case Helper.GDI.RecordType.EMR_STRETCHDIBITS:\n case Helper.GDI.RecordType.EMR_EXTCREATEFONTINDIRECTW:\n case Helper.GDI.RecordType.EMR_EXTTEXTOUTA:\n case Helper.GDI.RecordType.EMR_EXTTEXTOUTW:\n case Helper.GDI.RecordType.EMR_POLYPOLYLINE16:\n case Helper.GDI.RecordType.EMR_POLYDRAW16:\n case Helper.GDI.RecordType.EMR_CREATEMONOBRUSH:\n case Helper.GDI.RecordType.EMR_CREATEDIBPATTERNBRUSHPT:\n case Helper.GDI.RecordType.EMR_POLYTEXTOUTA:\n case Helper.GDI.RecordType.EMR_POLYTEXTOUTW:\n case Helper.GDI.RecordType.EMR_SETICMMODE:\n case Helper.GDI.RecordType.EMR_CREATECOLORSPACE:\n case Helper.GDI.RecordType.EMR_SETCOLORSPACE:\n case Helper.GDI.RecordType.EMR_DELETECOLORSPACE:\n case Helper.GDI.RecordType.EMR_GLSRECORD:\n case Helper.GDI.RecordType.EMR_GLSBOUNDEDRECORD:\n case Helper.GDI.RecordType.EMR_PIXELFORMAT:\n case Helper.GDI.RecordType.EMR_DRAWESCAPE:\n case Helper.GDI.RecordType.EMR_EXTESCAPE:\n case Helper.GDI.RecordType.EMR_SMALLTEXTOUT:\n case Helper.GDI.RecordType.EMR_FORCEUFIMAPPING:\n case Helper.GDI.RecordType.EMR_NAMEDESCAPE:\n case Helper.GDI.RecordType.EMR_COLORCORRECTPALETTE:\n case Helper.GDI.RecordType.EMR_SETICMPROFILEA:\n case Helper.GDI.RecordType.EMR_SETICMPROFILEW:\n case Helper.GDI.RecordType.EMR_ALPHABLEND:\n case Helper.GDI.RecordType.EMR_SETLAYOUT:\n case Helper.GDI.RecordType.EMR_TRANSPARENTBLT:\n case Helper.GDI.RecordType.EMR_GRADIENTFILL:\n case Helper.GDI.RecordType.EMR_SETLINKEDUFIS:\n case Helper.GDI.RecordType.EMR_SETTEXTJUSTIFICATION:\n case Helper.GDI.RecordType.EMR_COLORMATCHTOTARGETW:\n case Helper.GDI.RecordType.EMR_CREATECOLORSPACEW:\n default: {\n let recordName = \"UNKNOWN\";\n for (const name in Helper.GDI.RecordType) {\n const recordTypes: any = Helper.GDI.RecordType;\n if (recordTypes[name] === type) {\n recordName = name;\n break;\n }\n }\n Helper.log(\"[EMF] \" + recordName + \" record (0x\" + type.toString(16) + \") at offset 0x\"\n + curpos.toString(16) + \" with \" + size + \" bytes\");\n break;\n }\n }\n\n curpos += size;\n }\n\n if (!all) {\n throw new EMFJSError(\"Could not read all records\");\n }\n }\n\n public play(gdi: GDIContext): void {\n const len = this._records.length;\n for (let i = 0; i < len; i++) {\n this._records[i](gdi);\n }\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { SVG } from \"../util\";\nimport { SVGPathBuilder } from \"../util/SVG\";\nimport { EMFJSError, Helper } from \"./Helper\";\nimport { Obj, PointL, PointS, RectL } from \"./Primitives\";\nimport { CreateSimpleRegion, Region } from \"./Region\";\nimport { Brush, ColorRef, Font, Pen } from \"./Style\";\n\ninterface ISelectedStyle {\n brush?: Brush;\n pen?: Pen;\n font?: Font;\n region?: Region;\n path?: Path;\n\n [key: string]: Obj | undefined;\n}\n\nclass Path extends Obj {\n public svgPath: SVGPathBuilder;\n\n constructor(svgPath: SVGPathBuilder, copy?: Path) {\n super(\"path\");\n if (svgPath != null) {\n this.svgPath = svgPath;\n } else {\n this.svgPath = copy.svgPath;\n }\n }\n\n public clone(): Path {\n return new Path(null, this);\n }\n\n public toString(): string {\n return \"{[path]}\";\n }\n}\n\nfunction createStockObjects(): { [key: string]: Obj } {\n // Create global stock objects\n const createSolidBrush = (r: number, g: number, b: number) => {\n return new Brush(null, {\n style: Helper.GDI.BrushStyle.BS_SOLID,\n color: new ColorRef(null, r, g, b),\n });\n };\n const createSolidPen = (r: number, g: number, b: number) => {\n return new Pen(null, Helper.GDI.PenStyle.PS_SOLID, 1, new ColorRef(null, r, g, b), null);\n };\n const stockObjs: { [key: string]: Obj } = {\n WHITE_BRUSH: createSolidBrush(255, 255, 255),\n LTGRAY_BRUSH: createSolidBrush(212, 208, 200),\n GRAY_BRUSH: createSolidBrush(128, 128, 128),\n DKGRAY_BRUSH: createSolidBrush(64, 64, 64),\n BLACK_BRUSH: createSolidBrush(0, 0, 0),\n NULL_BRUSH: new Brush(null, {\n style: Helper.GDI.BrushStyle.BS_NULL,\n }),\n WHITE_PEN: createSolidPen(255, 255, 255),\n BLACK_PEN: createSolidPen(0, 0, 0),\n NULL_PEN: new Pen(null, Helper.GDI.PenStyle.PS_NULL, 0, null, null),\n OEM_FIXED_FONT: null, // TODO\n ANSI_FIXED_FONT: null, // TODO\n ANSI_VAR_FONT: null, // TODO\n SYSTEM_FONT: null, // TODO\n DEVICE_DEFAULT_FONT: null, // TODO\n DEFAULT_PALETTE: null, // TODO\n SYSTEM_FIXED_FONT: null, // TODO\n DEFAULT_GUI_FONT: null, // TODO\n };\n\n const objs: { [key: string]: Obj } = {};\n for (const t in stockObjs) {\n const stockObjects: { [key: string]: number } = Helper.GDI.StockObject as { [key: string]: number };\n const idx = stockObjects[t] - 0x80000000;\n objs[idx.toString()] = stockObjs[t];\n }\n return objs;\n}\n\nconst _StockObjects = createStockObjects();\n\nclass GDIContextState {\n public _svggroup: SVGElement;\n public _svgclipChanged: boolean;\n public _svgtextbkfilter: SVGFilterElement;\n public mapmode: number;\n public stretchmode: number;\n public textalign: number;\n public bkmode: number;\n public textcolor: ColorRef;\n public bkcolor: ColorRef;\n public polyfillmode: number;\n public miterlimit: number;\n public wx: number;\n public wy: number;\n public ww: number;\n public wh: number;\n public vx: number;\n public vy: number;\n public vw: number;\n public vh: number;\n public x: number;\n public y: number;\n public nextbrx: number;\n public nextbry: number;\n public brx: number;\n public bry: number;\n public clip: Region;\n public ownclip: boolean;\n public selected: ISelectedStyle;\n\n constructor(copy: GDIContextState, defObjects?: ISelectedStyle) {\n if (copy != null) {\n this._svggroup = copy._svggroup;\n this._svgclipChanged = copy._svgclipChanged;\n this._svgtextbkfilter = copy._svgtextbkfilter;\n this.mapmode = copy.mapmode;\n this.stretchmode = copy.stretchmode;\n this.textalign = copy.textalign;\n this.bkmode = copy.bkmode;\n this.textcolor = copy.textcolor.clone();\n this.bkcolor = copy.bkcolor.clone();\n this.polyfillmode = copy.polyfillmode;\n this.miterlimit = copy.miterlimit;\n this.wx = copy.wx;\n this.wy = copy.wy;\n this.ww = copy.ww;\n this.wh = copy.wh;\n this.vx = copy.vx;\n this.vy = copy.vy;\n this.vw = copy.vw;\n this.vh = copy.vh;\n this.x = copy.x;\n this.y = copy.y;\n this.nextbrx = copy.nextbrx;\n this.nextbry = copy.nextbry;\n this.brx = copy.brx;\n this.bry = copy.bry;\n\n this.clip = copy.clip;\n this.ownclip = false;\n\n this.selected = {};\n for (const type in copy.selected) {\n this.selected[type] = copy.selected[type];\n }\n } else {\n this._svggroup = null;\n this._svgclipChanged = false;\n this._svgtextbkfilter = null;\n this.mapmode = Helper.GDI.MapMode.MM_ANISOTROPIC;\n this.stretchmode = Helper.GDI.StretchMode.COLORONCOLOR;\n this.textalign = 0; // TA_LEFT | TA_TOP | TA_NOUPDATECP\n this.bkmode = Helper.GDI.MixMode.OPAQUE;\n this.textcolor = new ColorRef(null, 0, 0, 0);\n this.bkcolor = new ColorRef(null, 255, 255, 255);\n this.polyfillmode = Helper.GDI.PolygonFillMode.ALTERNATE;\n this.miterlimit = 10;\n this.wx = 0;\n this.wy = 0;\n this.ww = 0;\n this.wh = 0;\n this.vx = 0;\n this.vy = 0;\n this.vw = 0;\n this.vh = 0;\n this.x = 0;\n this.y = 0;\n this.nextbrx = 0;\n this.nextbry = 0;\n this.brx = 0;\n this.bry = 0;\n\n this.clip = null;\n this.ownclip = false;\n\n this.selected = {};\n for (const type in defObjects) {\n const defObj = defObjects[type];\n this.selected[type] = defObj != null ? defObj.clone() : null;\n }\n }\n }\n}\n\nexport class GDIContext {\n private _svg: SVG;\n private _svgdefs: SVGDefsElement;\n private _svgPatterns: { [key: string]: Brush };\n private _svgClipPaths: { [key: string]: Region };\n private _svgPath: SVGPathBuilder;\n private defObjects: ISelectedStyle;\n private state: GDIContextState;\n private statestack: GDIContextState[];\n private objects: { [key: string]: Obj };\n\n constructor(svg: SVG) {\n this._svg = svg;\n this._svgdefs = null;\n this._svgPatterns = {};\n this._svgClipPaths = {};\n this._svgPath = null;\n\n this.defObjects = {\n brush: new Brush(null, {\n style: Helper.GDI.BrushStyle.BS_SOLID,\n color: new ColorRef(null, 0, 0, 0),\n }),\n pen: new Pen(null, Helper.GDI.PenStyle.PS_SOLID, 1, new ColorRef(null, 0, 0, 0), null),\n font: new Font(null, null),\n palette: null,\n region: null,\n };\n\n this.state = new GDIContextState(null, this.defObjects);\n this.statestack = [this.state];\n this.objects = {};\n }\n\n public setMapMode(mode: number): void {\n Helper.log(\"[gdi] setMapMode: mode=\" + mode);\n this.state.mapmode = mode;\n this.state._svggroup = null;\n }\n\n public setWindowOrgEx(x: number, y: number): void {\n Helper.log(\"[gdi] setWindowOrgEx: x=\" + x + \" y=\" + y);\n this.state.wx = x;\n this.state.wy = y;\n this.state._svggroup = null;\n }\n\n public setWindowExtEx(x: number, y: number): void {\n Helper.log(\"[gdi] setWindowExtEx: x=\" + x + \" y=\" + y);\n this.state.ww = x;\n this.state.wh = y;\n this.state._svggroup = null;\n }\n\n public setViewportOrgEx(x: number, y: number): void {\n Helper.log(\"[gdi] setViewportOrgEx: x=\" + x + \" y=\" + y);\n this.state.vx = x;\n this.state.vy = y;\n this.state._svggroup = null;\n }\n\n public setViewportExtEx(x: number, y: number): void {\n Helper.log(\"[gdi] setViewportExtEx: x=\" + x + \" y=\" + y);\n this.state.vw = x;\n this.state.vh = y;\n this.state._svggroup = null;\n }\n\n public setBrushOrgEx(origin: PointL): void {\n Helper.log(\"[gdi] setBrushOrgEx: x=\" + origin.x + \" y=\" + origin.y);\n this.state.nextbrx = origin.x;\n this.state.nextbry = origin.y;\n }\n\n public saveDC(): void {\n Helper.log(\"[gdi] saveDC\");\n const prevstate = this.state;\n this.state = new GDIContextState(this.state);\n this.statestack.push(prevstate);\n this.state._svggroup = null;\n }\n\n public restoreDC(saved: number): void {\n Helper.log(\"[gdi] restoreDC: saved=\" + saved);\n if (this.statestack.length > 1) {\n if (saved === -1) {\n this.state = this.statestack.pop();\n } else if (saved < -1) {\n throw new EMFJSError(\"restoreDC: relative restore not implemented\");\n } else if (saved > 1) {\n throw new EMFJSError(\"restoreDC: absolute restore not implemented\");\n }\n } else {\n throw new EMFJSError(\"No saved contexts\");\n }\n\n this.state._svggroup = null;\n }\n\n public setStretchBltMode(stretchMode: number): void {\n Helper.log(\"[gdi] setStretchBltMode: stretchMode=\" + stretchMode);\n }\n\n public rectangle(rect: RectL, rw: number, rh: number): void {\n Helper.log(\"[gdi] rectangle: rect=\" + rect.toString() + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const bottom = this._todevY(rect.bottom);\n const right = this._todevX(rect.right);\n const top = this._todevY(rect.top);\n const left = this._todevX(rect.left);\n rw = this._todevH(rw);\n rh = this._todevH(rh);\n Helper.log(\"[gdi] rectangle: TRANSLATED: bottom=\" + bottom + \" right=\" + right + \" top=\" + top\n + \" left=\" + left + \" rh=\" + rh + \" rw=\" + rw);\n this._pushGroup();\n\n const opts = this._applyOpts(null, true, true, false);\n this._svg.rect(this.state._svggroup, left, top, right - left, bottom - top, rw / 2, rh / 2, opts);\n }\n\n public lineTo(x: number, y: number): void {\n Helper.log(\"[gdi] lineTo: x=\" + x + \" y=\" + y + \" with pen \" + this.state.selected.pen.toString());\n const toX = this._todevX(x);\n const toY = this._todevY(y);\n const fromX = this._todevX(this.state.x);\n const fromY = this._todevY(this.state.y);\n\n // Update position\n this.state.x = x;\n this.state.y = y;\n\n Helper.log(\"[gdi] lineTo: TRANSLATED: toX=\" + toX + \" toY=\" + toY + \" fromX=\" + fromX + \" fromY=\" + fromY);\n this._pushGroup();\n\n const opts = this._applyOpts(null, true, false, false);\n this._svg.line(this.state._svggroup, fromX, fromY, toX, toY, opts);\n }\n\n public moveToEx(x: number, y: number): void {\n Helper.log(\"[gdi] moveToEx: x=\" + x + \" y=\" + y);\n this.state.x = x;\n this.state.y = y;\n if (this._svgPath != null) {\n this._svgPath.move(this.state.x, this.state.y);\n Helper.log(\"[gdi] new path: \" + this._svgPath.path());\n }\n }\n\n public polygon(points: PointS[] | PointL[], bounds: RectL, first: boolean): void {\n Helper.log(\"[gdi] polygon: points=\" + points + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const pts = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push([this._todevX(point.x), this._todevY(point.y)]);\n }\n if (first) {\n this._pushGroup();\n }\n const opts = {\n \"fill-rule\": this.state.polyfillmode === Helper.GDI.PolygonFillMode.ALTERNATE ? \"evenodd\" : \"nonzero\",\n };\n this._applyOpts(opts, true, true, false);\n this._svg.polygon(this.state._svggroup, pts, opts);\n }\n\n public polyPolygon(polygons: PointS[][] | PointL[][], bounds: RectL): void {\n Helper.log(\"[gdi] polyPolygon: polygons.length=\" + polygons.length\n + \" with pen \" + this.state.selected.pen.toString() + \" and brush \" + this.state.selected.brush.toString());\n\n const cnt = polygons.length;\n for (let i = 0; i < cnt; i++) {\n this.polygon(polygons[i], bounds, i === 0);\n }\n }\n\n public polyline(isLineTo: boolean, points: PointS[], bounds: RectL): void {\n Helper.log(\"[gdi] polyline: isLineTo=\" + isLineTo.toString() + \", points=\" + points\n + \", bounds=\" + bounds.toString() + \" with pen \" + this.state.selected.pen.toString());\n const pts: number[][] = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push([this._todevX(point.x), this._todevY(point.y)]);\n }\n\n if (this._svgPath != null) {\n if (!isLineTo || pts.length === 0) {\n this._svgPath.move(this._todevX(this.state.x), this._todevY(this.state.y));\n } else {\n const firstPts = pts[0];\n this._svgPath.move(firstPts[0], firstPts[1]);\n }\n this._svgPath.line(pts);\n Helper.log(\"[gdi] new path: \" + this._svgPath.path());\n } else {\n this._pushGroup();\n const opts = this._applyOpts(null, true, false, false);\n if (isLineTo && points.length > 0) {\n const firstPt = points[0];\n if (firstPt.x !== this.state.x || firstPt.y !== this.state.y) {\n pts.unshift([this._todevX(this.state.x), this._todevY(this.state.y)]);\n }\n }\n this._svg.polyline(this.state._svggroup, pts, opts);\n }\n\n if (points.length > 0) {\n const lastPt = points[points.length - 1];\n this.state.x = lastPt.x;\n this.state.y = lastPt.y;\n }\n }\n\n public polybezier(isPolyBezierTo: boolean, points: PointS[], bounds: RectL): void {\n Helper.log(\"[gdi] polybezier: isPolyBezierTo=\" + isPolyBezierTo.toString() + \", points=\" + points\n + \", bounds=\" + bounds.toString() + \" with pen \" + this.state.selected.pen.toString());\n const pts = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push({x: this._todevX(point.x), y: this._todevY(point.y)});\n }\n\n if (this._svgPath != null) {\n if (isPolyBezierTo && pts.length > 0) {\n const firstPts = pts[0];\n this._svgPath.move(firstPts.x, firstPts.y);\n } else {\n this._svgPath.move(this._todevX(this.state.x), this._todevY(this.state.y));\n }\n\n if (pts.length < (isPolyBezierTo ? 3 : 4)) {\n throw new EMFJSError(\"Not enough points to draw bezier\");\n }\n\n for (let i = isPolyBezierTo ? 1 : 0; i + 3 <= pts.length; i += 3) {\n const cp1 = pts[i];\n const cp2 = pts[i + 1];\n const ep = pts[i + 2];\n this._svgPath.curveC(cp1.x, cp1.y, cp2.x, cp2.y, ep.x, ep.y);\n }\n\n Helper.log(\"[gdi] new path: \" + this._svgPath.path());\n } else {\n throw new EMFJSError(\"polybezier not implemented (not a path)\");\n }\n\n if (points.length > 0) {\n const lastPt = points[points.length - 1];\n this.state.x = lastPt.x;\n this.state.y = lastPt.y;\n }\n }\n\n public selectClipPath(rgnMode: number): void {\n Helper.log(\"[gdi] selectClipPath: rgnMode=0x\" + rgnMode.toString(16));\n }\n\n public selectClipRgn(rgnMode: number, region: Region): void {\n Helper.log(\"[gdi] selectClipRgn: rgnMode=0x\" + rgnMode.toString(16));\n if (rgnMode === Helper.GDI.RegionMode.RGN_COPY) {\n this.state.selected.region = region;\n this.state.clip = null;\n this.state.ownclip = false;\n } else {\n if (region == null) {\n throw new EMFJSError(\"No clip region to select\");\n }\n\n throw new EMFJSError(\"Not implemented: rgnMode=0x\" + rgnMode.toString(16));\n }\n this.state._svgclipChanged = true;\n }\n\n public offsetClipRgn(offset: PointL): void {\n Helper.log(\"[gdi] offsetClipRgn: offset=\" + offset.toString());\n this._getClipRgn().offset(offset.x, offset.y);\n }\n\n public setTextAlign(textAlignmentMode: number): void {\n Helper.log(\"[gdi] setTextAlign: textAlignmentMode=0x\" + textAlignmentMode.toString(16));\n this.state.textalign = textAlignmentMode;\n }\n\n public setMiterLimit(miterLimit: number): void {\n Helper.log(\"[gdi] setMiterLimit: miterLimit=\" + miterLimit);\n this.state.miterlimit = miterLimit;\n }\n\n public setBkMode(bkMode: number): void {\n Helper.log(\"[gdi] setBkMode: bkMode=0x\" + bkMode.toString(16));\n this.state.bkmode = bkMode;\n }\n\n public setBkColor(bkColor: ColorRef): void {\n Helper.log(\"[gdi] setBkColor: bkColor=\" + bkColor.toString());\n this.state.bkcolor = bkColor;\n this.state._svgtextbkfilter = null;\n }\n\n public setPolyFillMode(polyFillMode: number): void {\n Helper.log(\"[gdi] setPolyFillMode: polyFillMode=\" + polyFillMode);\n this.state.polyfillmode = polyFillMode;\n }\n\n public createBrush(index: number, brush: Brush): void {\n const idx = this._storeObject(brush, index);\n Helper.log(\"[gdi] createBrush: brush=\" + brush.toString() + \" with handle \" + idx);\n }\n\n public createPen(index: number, pen: Pen): void {\n const idx = this._storeObject(pen, index);\n Helper.log(\"[gdi] createPen: pen=\" + pen.toString() + \" width handle \" + idx);\n }\n\n public createPenEx(index: number, pen: Pen): void {\n const idx = this._storeObject(pen, index);\n Helper.log(\"[gdi] createPenEx: pen=\" + pen.toString() + \" width handle \" + idx);\n }\n\n public selectObject(objIdx: number, checkType: string): void {\n const obj = this._getObject(objIdx);\n if (obj != null && (checkType == null || obj.type === checkType)) {\n this._selectObject(obj);\n Helper.log(\"[gdi] selectObject: objIdx=\" + objIdx\n + (obj ? \" selected \" + obj.type + \": \" + obj.toString() : \"[invalid index]\"));\n } else {\n Helper.log(\"[gdi] selectObject: objIdx=\" + objIdx\n + (obj ? \" invalid object type: \" + obj.type : \"[invalid index]\"));\n }\n }\n\n public abortPath(): void {\n Helper.log(\"[gdi] abortPath\");\n if (this._svgPath != null) {\n this._svgPath = null;\n }\n }\n\n public beginPath(): void {\n Helper.log(\"[gdi] beginPath\");\n\n if (this._svgPath != null) {\n this._svgPath = null;\n }\n\n this._svgPath = this._svg.createPath();\n }\n\n public closeFigure(): void {\n Helper.log(\"[gdi] closeFigure\");\n if (this._svgPath == null) {\n throw new EMFJSError(\"No path bracket: cannot close figure\");\n }\n\n this._svgPath.close();\n }\n\n public fillPath(bounds: RectL): void {\n Helper.log(\"[gdi] fillPath\");\n if (this.state.selected.path == null) {\n throw new EMFJSError(\"No path selected\");\n }\n\n const selPath = this.state.selected.path;\n const opts = this._applyOpts(null, true, true, false);\n this._svg.path(this.state._svggroup, selPath.svgPath, opts);\n\n this._pushGroup();\n this.state.selected.path = null;\n }\n\n public strokePath(bounds: RectL): void {\n Helper.log(\"[gdi] strokePath\");\n if (this.state.selected.path == null) {\n throw new EMFJSError(\"No path selected\");\n }\n\n const selPath = this.state.selected.path;\n const opts = this._applyOpts({fill: \"none\"}, true, false, false);\n this._svg.path(this.state._svggroup, selPath.svgPath, opts);\n\n this._pushGroup();\n this.state.selected.path = null;\n }\n\n public endPath(): void {\n Helper.log(\"[gdi] endPath\");\n if (this._svgPath == null) {\n throw new EMFJSError(\"No path bracket: cannot end path\");\n }\n\n this._pushGroup();\n this._selectObject(new Path(this._svgPath));\n this._svgPath = null;\n }\n\n public deleteObject(objIdx: number): void {\n const ret = this._deleteObject(objIdx);\n Helper.log(\"[gdi] deleteObject: objIdx=\" + objIdx + (ret ? \" deleted object\" : \"[invalid index]\"));\n }\n\n private _pushGroup(): void {\n if (this.state._svggroup == null || this.state._svgclipChanged) {\n this.state._svgclipChanged = false;\n this.state._svgtextbkfilter = null;\n\n const settings: any = {\n viewBox: [this.state.vx, this.state.vy, this.state.vw, this.state.vh].join(\" \"),\n preserveAspectRatio: \"none\",\n };\n if (this.state.clip != null) {\n Helper.log(\"[gdi] new svg x=\" + this.state.vx + \" y=\" + this.state.vy + \" width=\" + this.state.vw\n + \" height=\" + this.state.vh + \" with clipping\");\n settings[\"clip-path\"] = \"url(#\" + this._getSvgClipPathForRegion(this.state.clip) + \")\";\n } else {\n Helper.log(\"[gdi] new svg x=\" + this.state.vx + \" y=\" + this.state.vy + \" width=\" + this.state.vw\n + \" height=\" + this.state.vh + \" without clipping\");\n }\n this.state._svggroup = this._svg.svg(this.state._svggroup,\n this.state.vx, this.state.vy, this.state.vw, this.state.vh, settings);\n }\n }\n\n private _getStockObject(idx: number) {\n if (idx >= 0x80000000 && idx <= 0x80000011) {\n return _StockObjects[(idx - 0x80000000).toString()];\n } else if (idx === Helper.GDI.StockObject.DC_BRUSH) {\n return this.state.selected.brush;\n } else if (idx === Helper.GDI.StockObject.DC_PEN) {\n return this.state.selected.pen;\n }\n return null;\n }\n\n private _storeObject(obj: Obj, idx: number) {\n if (!idx) {\n idx = 0;\n while (this.objects[idx.toString()] != null && idx <= 65535) {\n idx++;\n }\n if (idx > 65535) {\n Helper.log(\"[gdi] Too many objects!\");\n return -1;\n }\n }\n\n this.objects[idx.toString()] = obj;\n return idx;\n }\n\n private _getObject(objIdx: number) {\n let obj = this.objects[objIdx.toString()];\n if (obj == null) {\n obj = this._getStockObject(objIdx);\n if (obj == null) {\n Helper.log(\"[gdi] No object with handle \" + objIdx);\n }\n }\n return obj;\n }\n\n private _getSvgDef() {\n if (this._svgdefs == null) {\n this._svgdefs = this._svg.defs();\n }\n return this._svgdefs;\n }\n\n private _getSvgClipPathForRegion(region: Region) {\n for (const existingId in this._svgClipPaths) {\n const rgn = this._svgClipPaths[existingId];\n if (rgn === region) {\n return existingId;\n }\n }\n\n const id = Helper._makeUniqueId(\"c\");\n const sclip = this._svg.clipPath(this._getSvgDef(), id, \"userSpaceOnUse\");\n switch (region.complexity) {\n case 1:\n this._svg.rect(sclip,\n this._todevX(region.bounds.left),\n this._todevY(region.bounds.top),\n this._todevW(region.bounds.right - region.bounds.left),\n this._todevH(region.bounds.bottom - region.bounds.top),\n {\"fill\": \"black\", \"stroke-width\": 0});\n break;\n case 2:\n for (let i = 0; i < region.scans.length; i++) {\n const scan = region.scans[i];\n for (let j = 0; j < scan.scanlines.length; j++) {\n const scanline = scan.scanlines[j];\n this._svg.rect(sclip, this._todevX(scanline.left), this._todevY(scan.top),\n this._todevW(scanline.right - scanline.left), this._todevH(scan.bottom - scan.top),\n {\"fill\": \"black\", \"stroke-width\": 0});\n }\n }\n break;\n }\n this._svgClipPaths[id] = region;\n return id;\n }\n\n private _getSvgPatternForBrush(brush: Brush) {\n for (const existingId in this._svgPatterns) {\n const pat = this._svgPatterns[existingId];\n if (pat === brush) {\n return existingId;\n }\n }\n\n let width;\n let height;\n let img;\n switch (brush.style) {\n case Helper.GDI.BrushStyle.BS_PATTERN:\n width = brush.pattern.getWidth();\n height = brush.pattern.getHeight();\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n width = brush.dibpatternpt.getWidth();\n height = brush.dibpatternpt.getHeight();\n img = brush.dibpatternpt.base64ref();\n break;\n default:\n throw new EMFJSError(\"Invalid brush style\");\n }\n\n const id = Helper._makeUniqueId(\"p\");\n const spat = this._svg.pattern(this._getSvgDef(), id, this.state.brx, this.state.bry, width, height,\n {patternUnits: \"userSpaceOnUse\"});\n this._svg.image(spat, 0, 0, width, height, img);\n this._svgPatterns[id] = brush;\n return id;\n }\n\n private _selectObject(obj: Obj) {\n this.state.selected[obj.type] = obj;\n switch (obj.type) {\n case \"region\":\n this.state._svgclipChanged = true;\n break;\n case \"brush\":\n this.state.brx = this.state.nextbrx;\n this.state.bry = this.state.nextbry;\n break;\n }\n }\n\n private _deleteObject(objIdx: number) {\n const obj = this.objects[objIdx.toString()];\n if (obj != null) {\n for (let i = 0; i < this.statestack.length; i++) {\n const state = this.statestack[i];\n if (state.selected[obj.type] === obj) {\n state.selected[obj.type] = this.defObjects[obj.type].clone();\n }\n }\n delete this.objects[objIdx.toString()];\n return true;\n }\n\n Helper.log(\"[gdi] Cannot delete object with invalid handle \" + objIdx);\n return false;\n }\n\n private _getClipRgn() {\n if (this.state.clip != null) {\n if (!this.state.ownclip) {\n this.state.clip = this.state.clip.clone();\n }\n } else {\n if (this.state.selected.region != null) {\n this.state.clip = this.state.selected.region.clone();\n } else {\n this.state.clip = CreateSimpleRegion(this.state.wx, this.state.wy, this.state.wx + this.state.ww,\n this.state.wy + this.state.wh);\n }\n }\n this.state.ownclip = true;\n return this.state.clip;\n }\n\n private _todevX(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.wx) * (this.state.vw / this.state.ww)) + this.state.vx;\n }\n\n private _todevY(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.wy) * (this.state.vh / this.state.wh)) + this.state.vy;\n }\n\n private _todevW(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val * (this.state.vw / this.state.ww)) + this.state.vx;\n }\n\n private _todevH(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val * (this.state.vh / this.state.wh)) + this.state.vy;\n }\n\n private _tologicalX(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.vx) / (this.state.vw / this.state.ww)) + this.state.wx;\n }\n\n private _tologicalY(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.vy) / (this.state.vh / this.state.wh)) + this.state.wy;\n }\n\n private _tologicalW(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val / (this.state.vw / this.state.ww)) + this.state.wx;\n }\n\n private _tologicalH(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val / (this.state.vh / this.state.wh)) + this.state.wy;\n }\n\n private _applyOpts(opts: any, usePen: boolean, useBrush: boolean, useFont: boolean) {\n if (opts == null) {\n opts = {};\n }\n if (usePen) {\n const pen = this.state.selected.pen;\n if (pen.style !== Helper.GDI.PenStyle.PS_NULL) {\n opts.stroke = \"#\" + pen.color.toHex(); // TODO: pen style\n opts[\"stroke-width\"] = pen.width;\n\n opts[\"stroke-miterlimit\"] = this.state.miterlimit;\n\n opts[\"stroke-linecap\"] = \"round\";\n const dotWidth = 1;\n\n opts[\"stroke-linejoin\"] = \"round\";\n\n const dashWidth = opts[\"stroke-width\"] * 4;\n const dotSpacing = opts[\"stroke-width\"] * 2;\n switch (pen.style) {\n case Helper.GDI.PenStyle.PS_DASH:\n opts[\"stroke-dasharray\"] = [dashWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DOT:\n opts[\"stroke-dasharray\"] = [dotWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DASHDOT:\n opts[\"stroke-dasharray\"] = [dashWidth, dotSpacing, dotWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DASHDOTDOT:\n opts[\"stroke-dasharray\"] =\n [dashWidth, dotSpacing, dotWidth, dotSpacing, dotWidth, dotSpacing].toString();\n break;\n }\n }\n }\n if (useBrush) {\n const brush = this.state.selected.brush;\n switch (brush.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n opts.fill = \"#\" + brush.color.toHex();\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n opts.fill = \"url(#\" + this._getSvgPatternForBrush(brush) + \")\";\n break;\n case Helper.GDI.BrushStyle.BS_NULL:\n opts.fill = \"none\";\n break;\n default:\n Helper.log(\"[gdi] unsupported brush style: \" + brush.style);\n opts.fill = \"none\";\n break;\n }\n }\n if (useFont) {\n const font = this.state.selected.font;\n opts[\"font-family\"] = font.facename;\n opts[\"font-size\"] = Math.abs(font.height);\n opts.fill = \"#\" + this.state.textcolor.toHex();\n }\n return opts;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport class EMFJSError extends Error {\n constructor(message: string) {\n super(message); // 'Error' breaks prototype chain here\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n }\n}\n\nlet isLoggingEnabled = true;\n\nexport function loggingEnabled(enabled: boolean): void {\n isLoggingEnabled = enabled;\n}\n\nexport class Helper {\n public static GDI = {\n FormatSignature: {\n ENHMETA_SIGNATURE: 0x464D4520,\n EPS_SIGNATURE: 0x46535045,\n },\n BITMAPINFOHEADER_SIZE: 40,\n BITMAPCOREHEADER_SIZE: 12,\n RecordType: {\n EMR_POLYBEZIER: 0x00000002,\n EMR_POLYGON: 0x00000003,\n EMR_POLYLINE: 0x00000004,\n EMR_POLYBEZIERTO: 0x00000005,\n EMR_POLYLINETO: 0x00000006,\n EMR_POLYPOLYLINE: 0x00000007,\n EMR_POLYPOLYGON: 0x00000008,\n EMR_SETWINDOWEXTEX: 0x00000009,\n EMR_SETWINDOWORGEX: 0x0000000A,\n EMR_SETVIEWPORTEXTEX: 0x0000000B,\n EMR_SETVIEWPORTORGEX: 0x0000000C,\n EMR_SETBRUSHORGEX: 0x0000000D,\n EMR_EOF: 0x0000000E,\n EMR_SETPIXELV: 0x0000000F,\n EMR_SETMAPPERFLAGS: 0x00000010,\n EMR_SETMAPMODE: 0x00000011,\n EMR_SETBKMODE: 0x00000012,\n EMR_SETPOLYFILLMODE: 0x00000013,\n EMR_SETROP2: 0x00000014,\n EMR_SETSTRETCHBLTMODE: 0x00000015,\n EMR_SETTEXTALIGN: 0x00000016,\n EMR_SETCOLORADJUSTMENT: 0x00000017,\n EMR_SETTEXTCOLOR: 0x00000018,\n EMR_SETBKCOLOR: 0x00000019,\n EMR_OFFSETCLIPRGN: 0x0000001A,\n EMR_MOVETOEX: 0x0000001B,\n EMR_SETMETARGN: 0x0000001C,\n EMR_EXCLUDECLIPRECT: 0x0000001D,\n EMR_INTERSECTCLIPRECT: 0x0000001E,\n EMR_SCALEVIEWPORTEXTEX: 0x0000001F,\n EMR_SCALEWINDOWEXTEX: 0x00000020,\n EMR_SAVEDC: 0x00000021,\n EMR_RESTOREDC: 0x00000022,\n EMR_SETWORLDTRANSFORM: 0x00000023,\n EMR_MODIFYWORLDTRANSFORM: 0x00000024,\n EMR_SELECTOBJECT: 0x00000025,\n EMR_CREATEPEN: 0x00000026,\n EMR_CREATEBRUSHINDIRECT: 0x00000027,\n EMR_DELETEOBJECT: 0x00000028,\n EMR_ANGLEARC: 0x00000029,\n EMR_ELLIPSE: 0x0000002A,\n EMR_RECTANGLE: 0x0000002B,\n EMR_ROUNDRECT: 0x0000002C,\n EMR_ARC: 0x0000002D,\n EMR_CHORD: 0x0000002E,\n EMR_PIE: 0x0000002F,\n EMR_SELECTPALETTE: 0x00000030,\n EMR_CREATEPALETTE: 0x00000031,\n EMR_SETPALETTEENTRIES: 0x00000032,\n EMR_RESIZEPALETTE: 0x00000033,\n EMR_REALIZEPALETTE: 0x00000034,\n EMR_EXTFLOODFILL: 0x00000035,\n EMR_LINETO: 0x00000036,\n EMR_ARCTO: 0x00000037,\n EMR_POLYDRAW: 0x00000038,\n EMR_SETARCDIRECTION: 0x00000039,\n EMR_SETMITERLIMIT: 0x0000003A,\n EMR_BEGINPATH: 0x0000003B,\n EMR_ENDPATH: 0x0000003C,\n EMR_CLOSEFIGURE: 0x0000003D,\n EMR_FILLPATH: 0x0000003E,\n EMR_STROKEANDFILLPATH: 0x0000003F,\n EMR_STROKEPATH: 0x00000040,\n EMR_FLATTENPATH: 0x00000041,\n EMR_WIDENPATH: 0x00000042,\n EMR_SELECTCLIPPATH: 0x00000043,\n EMR_ABORTPATH: 0x00000044,\n EMR_COMMENT: 0x00000046,\n EMR_FILLRGN: 0x00000047,\n EMR_FRAMERGN: 0x00000048,\n EMR_INVERTRGN: 0x00000049,\n EMR_PAINTRGN: 0x0000004A,\n EMR_EXTSELECTCLIPRGN: 0x0000004B,\n EMR_BITBLT: 0x0000004C,\n EMR_STRETCHBLT: 0x0000004D,\n EMR_MASKBLT: 0x0000004E,\n EMR_PLGBLT: 0x0000004F,\n EMR_SETDIBITSTODEVICE: 0x00000050,\n EMR_STRETCHDIBITS: 0x00000051,\n EMR_EXTCREATEFONTINDIRECTW: 0x00000052,\n EMR_EXTTEXTOUTA: 0x00000053,\n EMR_EXTTEXTOUTW: 0x00000054,\n EMR_POLYBEZIER16: 0x00000055,\n EMR_POLYGON16: 0x00000056,\n EMR_POLYLINE16: 0x00000057,\n EMR_POLYBEZIERTO16: 0x00000058,\n EMR_POLYLINETO16: 0x00000059,\n EMR_POLYPOLYLINE16: 0x0000005A,\n EMR_POLYPOLYGON16: 0x0000005B,\n EMR_POLYDRAW16: 0x0000005C,\n EMR_CREATEMONOBRUSH: 0x0000005D,\n EMR_CREATEDIBPATTERNBRUSHPT: 0x0000005E,\n EMR_EXTCREATEPEN: 0x0000005F,\n EMR_POLYTEXTOUTA: 0x00000060,\n EMR_POLYTEXTOUTW: 0x00000061,\n EMR_SETICMMODE: 0x00000062,\n EMR_CREATECOLORSPACE: 0x00000063,\n EMR_SETCOLORSPACE: 0x00000064,\n EMR_DELETECOLORSPACE: 0x00000065,\n EMR_GLSRECORD: 0x00000066,\n EMR_GLSBOUNDEDRECORD: 0x00000067,\n EMR_PIXELFORMAT: 0x00000068,\n EMR_DRAWESCAPE: 0x00000069,\n EMR_EXTESCAPE: 0x0000006A,\n EMR_SMALLTEXTOUT: 0x0000006C,\n EMR_FORCEUFIMAPPING: 0x0000006D,\n EMR_NAMEDESCAPE: 0x0000006E,\n EMR_COLORCORRECTPALETTE: 0x0000006F,\n EMR_SETICMPROFILEA: 0x00000070,\n EMR_SETICMPROFILEW: 0x00000071,\n EMR_ALPHABLEND: 0x00000072,\n EMR_SETLAYOUT: 0x00000073,\n EMR_TRANSPARENTBLT: 0x00000074,\n EMR_GRADIENTFILL: 0x00000076,\n EMR_SETLINKEDUFIS: 0x00000077,\n EMR_SETTEXTJUSTIFICATION: 0x00000078,\n EMR_COLORMATCHTOTARGETW: 0x00000079,\n EMR_CREATECOLORSPACEW: 0x0000007A,\n },\n MetafileEscapes: {\n NEWFRAME: 0x0001,\n ABORTDOC: 0x0002,\n NEXTBAND: 0x0003,\n SETCOLORTABLE: 0x0004,\n GETCOLORTABLE: 0x0005,\n FLUSHOUT: 0x0006,\n DRAFTMODE: 0x0007,\n QUERYESCSUPPORT: 0x0008,\n SETABORTPROC: 0x0009,\n STARTDOC: 0x000a,\n ENDDOC: 0x000b,\n GETPHYSPAGESIZE: 0x000c,\n GETPRINTINGOFFSET: 0x000d,\n GETSCALINGFACTOR: 0x000e,\n META_ESCAPE_ENHANCED_METAFILE: 0x000f,\n SETPENWIDTH: 0x0010,\n SETCOPYCOUNT: 0x0011,\n SETPAPERSOURCE: 0x0012,\n PASSTHROUGH: 0x0013,\n GETTECHNOLOGY: 0x0014,\n SETLINECAP: 0x0015,\n SETLINEJOIN: 0x0016,\n SETMITERLIMIT: 0x0017,\n BANDINFO: 0x0018,\n DRAWPATTERNRECT: 0x0019,\n GETVECTORPENSIZE: 0x001a,\n GETVECTORBRUSHSIZE: 0x001b,\n ENABLEDUPLEX: 0x001c,\n GETSETPAPERBINS: 0x001d,\n GETSETPRINTORIENT: 0x001e,\n ENUMPAPERBINS: 0x001f,\n SETDIBSCALING: 0x0020,\n EPSPRINTING: 0x0021,\n ENUMPAPERMETRICS: 0x0022,\n GETSETPAPERMETRICS: 0x0023,\n POSTSCRIPT_DATA: 0x0025,\n POSTSCRIPT_IGNORE: 0x0026,\n GETDEVICEUNITS: 0x002a,\n GETEXTENDEDTEXTMETRICS: 0x0100,\n GETPAIRKERNTABLE: 0x0102,\n EXTTEXTOUT: 0x0200,\n GETFACENAME: 0x0201,\n DOWNLOADFACE: 0x0202,\n METAFILE_DRIVER: 0x0801,\n QUERYDIBSUPPORT: 0x0c01,\n BEGIN_PATH: 0x1000,\n CLIP_TO_PATH: 0x1001,\n END_PATH: 0x1002,\n OPEN_CHANNEL: 0x100e,\n DOWNLOADHEADER: 0x100f,\n CLOSE_CHANNEL: 0x1010,\n POSTSCRIPT_PASSTHROUGH: 0x1013,\n ENCAPSULATED_POSTSCRIPT: 0x1014,\n POSTSCRIPT_IDENTIFY: 0x1015,\n POSTSCRIPT_INJECTION: 0x1016,\n CHECKJPEGFORMAT: 0x1017,\n CHECKPNGFORMAT: 0x1018,\n GET_PS_FEATURESETTING: 0x1019,\n MXDC_ESCAPE: 0x101a,\n SPCLPASSTHROUGH2: 0x11d8,\n },\n MapMode: {\n MM_TEXT: 1,\n MM_LOMETRIC: 2,\n MM_HIMETRIC: 3,\n MM_LOENGLISH: 4,\n MM_HIENGLISH: 5,\n MM_TWIPS: 6,\n MM_ISOTROPIC: 7,\n MM_ANISOTROPIC: 8,\n },\n StretchMode: {\n BLACKONWHITE: 1,\n WHITEONBLACK: 2,\n COLORONCOLOR: 3,\n HALFTONE: 4,\n },\n MixMode: {\n TRANSPARENT: 1,\n OPAQUE: 2,\n },\n BrushStyle: {\n BS_SOLID: 0,\n BS_NULL: 1,\n BS_HATCHED: 2,\n BS_PATTERN: 3,\n BS_INDEXED: 4,\n BS_DIBPATTERN: 5,\n BS_DIBPATTERNPT: 6,\n BS_PATTERN8X8: 7,\n BS_DIBPATTERN8X8: 8,\n BS_MONOPATTERN: 9,\n },\n PenStyle: {\n PS_COSMETIC: 0x00000000,\n PS_ENDCAP_ROUND: 0x00000000,\n PS_JOIN_ROUND: 0x00000000,\n PS_SOLID: 0x00000000,\n PS_DASH: 0x00000001,\n PS_DOT: 0x00000002,\n PS_DASHDOT: 0x00000003,\n PS_DASHDOTDOT: 0x00000004,\n PS_NULL: 0x00000005,\n PS_INSIDEFRAME: 0x00000006,\n PS_USERSTYLE: 0x00000007,\n PS_ALTERNATE: 0x00000008,\n PS_ENDCAP_SQUARE: 0x00000100,\n PS_ENDCAP_FLAT: 0x00000200,\n PS_JOIN_BEVEL: 0x00001000,\n PS_JOIN_MITER: 0x00002000,\n PS_GEOMETRIC: 0x00010000,\n },\n PolygonFillMode: {\n ALTERNATE: 1,\n WINDING: 2,\n },\n BitmapCompression: {\n BI_RGB: 0,\n BI_RLE8: 1,\n BI_RLE4: 2,\n BI_BITFIELDS: 3,\n BI_JPEG: 4,\n BI_PNG: 5,\n },\n RegionMode: {\n RGN_AND: 1,\n RGN_OR: 2,\n RGN_XOR: 3,\n RGN_DIFF: 4,\n RGN_COPY: 5,\n },\n StockObject: {\n WHITE_BRUSH: 0x80000000,\n LTGRAY_BRUSH: 0x80000001,\n GRAY_BRUSH: 0x80000002,\n DKGRAY_BRUSH: 0x80000003,\n BLACK_BRUSH: 0x80000004,\n NULL_BRUSH: 0x80000005,\n WHITE_PEN: 0x80000006,\n BLACK_PEN: 0x80000007,\n NULL_PEN: 0x80000008,\n OEM_FIXED_FONT: 0x8000000A,\n ANSI_FIXED_FONT: 0x8000000B,\n ANSI_VAR_FONT: 0x8000000C,\n SYSTEM_FONT: 0x8000000D,\n DEVICE_DEFAULT_FONT: 0x8000000E,\n DEFAULT_PALETTE: 0x8000000F,\n SYSTEM_FIXED_FONT: 0x80000010,\n DEFAULT_GUI_FONT: 0x80000011,\n DC_BRUSH: 0x80000012,\n DC_PEN: 0x80000013,\n },\n };\n\n public static _uniqueId = 0;\n\n public static log(message: string): void {\n if (isLoggingEnabled) {\n console.log(message);\n }\n }\n\n public static _makeUniqueId(prefix: string): string {\n return \"EMFJS_\" + prefix + (this._uniqueId++);\n }\n\n public static _writeUint32Val(uint8arr: Uint8Array, pos: number, val: number): void {\n uint8arr[pos++] = val & 0xff;\n uint8arr[pos++] = (val >>> 8) & 0xff;\n uint8arr[pos++] = (val >>> 16) & 0xff;\n uint8arr[pos++] = (val >>> 24) & 0xff;\n }\n\n public static _blobToBinary(blob: Uint8Array): string {\n let ret = \"\";\n const len = blob.length;\n for (let i = 0; i < len; i++) {\n ret += String.fromCharCode(blob[i]);\n }\n return ret;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { EMFJSError } from \"./Helper\";\n\nexport class PointS {\n public x: number;\n public y: number;\n\n constructor(reader: Blob, x?: number, y?: number) {\n if (reader != null) {\n this.x = reader.readInt16();\n this.y = reader.readInt16();\n } else {\n this.x = x;\n this.y = y;\n }\n }\n\n public clone(): PointS {\n return new PointS(null, this.x, this.y);\n }\n\n public toString(): string {\n return \"{x: \" + this.x + \", y: \" + this.y + \"}\";\n }\n}\n\nexport class PointL {\n public x: number;\n public y: number;\n\n constructor(reader: Blob, x?: number, y?: number) {\n if (reader != null) {\n this.x = reader.readInt32();\n this.y = reader.readInt32();\n } else {\n this.x = x;\n this.y = y;\n }\n }\n\n public clone(): PointL {\n return new PointL(null, this.x, this.y);\n }\n\n public toString(): string {\n return \"{x: \" + this.x + \", y: \" + this.y + \"}\";\n }\n}\n\nexport class RectL {\n public left: number;\n public top: number;\n public right: number;\n public bottom: number;\n\n constructor(reader: Blob, left?: number, top?: number, right?: number, bottom?: number) {\n if (reader != null) {\n this.left = reader.readInt32();\n this.top = reader.readInt32();\n this.right = reader.readInt32();\n this.bottom = reader.readInt32();\n } else {\n this.bottom = bottom;\n this.right = right;\n this.top = top;\n this.left = left;\n }\n }\n\n public clone(): RectL {\n return new RectL(null, this.left, this.top, this.right, this.bottom);\n }\n\n public toString(): string {\n return \"{left: \" + this.left + \", top: \" + this.top + \", right: \" + this.right\n + \", bottom: \" + this.bottom + \"}\";\n }\n\n public empty(): boolean {\n return this.left >= this.right || this.top >= this.bottom;\n }\n\n public intersect(rectL: RectL): null | RectL {\n if (this.empty() || rectL.empty()) {\n return null;\n }\n if (this.left >= rectL.right || this.top >= rectL.bottom ||\n this.right <= rectL.left || this.bottom <= rectL.top) {\n return null;\n }\n return new RectL(null, Math.max(this.left, rectL.left), Math.max(this.top, rectL.top),\n Math.min(this.right, rectL.right), Math.min(this.bottom, rectL.bottom));\n }\n}\n\nexport class SizeL {\n public cx: number;\n public cy: number;\n\n constructor(reader: Blob, cx?: number, cy?: number) {\n if (reader != null) {\n this.cx = reader.readUint32();\n this.cy = reader.readUint32();\n } else {\n this.cx = cx;\n this.cy = cy;\n }\n }\n\n public clone(): SizeL {\n return new SizeL(null, this.cx, this.cy);\n }\n\n public toString(): string {\n return \"{cx: \" + this.cx + \", cy: \" + this.cy + \"}\";\n }\n}\n\nexport class Obj {\n public type: string;\n\n constructor(type: string) {\n this.type = type;\n }\n\n public clone(): Obj {\n throw new EMFJSError(\"clone not implemented\");\n }\n\n public toString(): string {\n throw new EMFJSError(\"toString not implemented\");\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { EMFJSError, Helper } from \"./Helper\";\nimport { Obj, RectL } from \"./Primitives\";\n\nexport class Region extends Obj {\n public bounds: RectL;\n public scans: Scan[];\n public complexity: number;\n\n constructor(reader: Blob, copy?: Region) {\n super(\"region\");\n if (reader != null) {\n const hdrSize = reader.readUint32();\n if (hdrSize !== 32) {\n throw new EMFJSError(\"Invalid region header\");\n }\n reader.skip(4);\n const rectCnt = reader.readUint32();\n const rgnSize = reader.readUint32();\n if (rectCnt * 16 !== rgnSize) {\n throw new EMFJSError(\"Invalid region data\");\n }\n\n this.bounds = new RectL(reader);\n this.scans = [];\n let scanLine;\n for (let i = 0; i < rectCnt; i++) {\n const r = new RectL(reader);\n if (!!scanLine || scanLine.top !== r.top || scanLine.bottom !== r.bottom) {\n scanLine = new Scan(r);\n this.scans.push(scanLine);\n } else {\n scanLine.append(r);\n }\n }\n this._updateComplexity();\n } else if (copy != null) {\n this.bounds = copy.bounds != null ? copy.bounds.clone() : null;\n if (copy.scans != null) {\n this.scans = [];\n for (let i = 0; i < copy.scans.length; i++) {\n this.scans.push(copy.scans[i].clone());\n }\n } else {\n this.scans = null;\n }\n this.complexity = copy.complexity;\n } else {\n this.bounds = null;\n this.scans = null;\n this.complexity = 0;\n }\n }\n\n public clone(): Region {\n return new Region(null, this);\n }\n\n public toString(): string {\n const _complexity = [\"null\", \"simple\", \"complex\"];\n return \"{complexity: \" + _complexity[this.complexity]\n + \" bounds: \" + (this.bounds != null ? this.bounds.toString() : \"[none]\")\n + \" #scans: \" + (this.scans != null ? this.scans.length : \"[none]\") + \"}\";\n }\n\n public _updateComplexity(): void {\n if (this.bounds == null) {\n this.complexity = 0;\n this.scans = null;\n } else if (this.bounds.empty()) {\n this.complexity = 0;\n this.scans = null;\n this.bounds = null;\n } else if (this.scans == null) {\n this.complexity = 1;\n } else {\n this.complexity = 2;\n if (this.scans.length === 1) {\n const scan = this.scans[0];\n if (scan.top === this.bounds.top && scan.bottom === this.bounds.bottom && scan.scanlines.length === 1) {\n const scanline = scan.scanlines[0];\n if (scanline.left === this.bounds.left && scanline.right === this.bounds.right) {\n this.scans = null;\n this.complexity = 1;\n }\n }\n }\n }\n }\n\n public subtract(rect: RectL): void {\n Helper.log(\"[emf] Region \" + this.toString() + \" subtract \" + rect.toString());\n\n if (this.bounds != null) {\n const isect = this.bounds.intersect(rect);\n if (isect != null) { // Only need to do anything if there is any chance of an overlap\n if (this.scans == null) {\n // We currently have a simple region and there is some kind of an overlap.\n // We need to create scanlines now. Simplest method is to fake one scan line\n // that equals the simple region and re-use the same logic as for complex regions\n this.scans = [];\n this.scans.push(new Scan(new RectL(null, this.bounds.left, this.bounds.top,\n this.bounds.right, this.bounds.bottom)));\n this.complexity = 2;\n }\n\n // We (now) have a complex region. First we skip any scans that are entirely above rect.top\n // The first scan that falls partially below rect.top needs to be split into two scans.\n let si = 0;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.bottom >= rect.top) {\n // We need to clone this scan into two so that we can subtract from the second one\n const cloned = scan.clone();\n scan.bottom = rect.top - 1;\n cloned.top = rect.top;\n if (scan.top >= scan.bottom) {\n this.scans[si] = cloned;\n } else {\n Helper.log(\"[emf] Region split top scan \" + si + \" for substraction\");\n this.scans.splice(++si, 0, cloned);\n }\n break;\n }\n si++;\n }\n\n // Now find the first one that falls at least partially below rect.bottom, which needs to be\n // split if it is only partially below rect.bottom\n const first = si;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.top > rect.bottom) {\n break;\n }\n if (scan.bottom > rect.bottom) {\n // We need to clone this scan into two so that we can subtract from the first one\n const cloned = scan.clone();\n scan.bottom = rect.bottom;\n cloned.top = rect.bottom + 1;\n if (scan.top >= scan.bottom) {\n this.scans[si] = cloned;\n } else {\n Helper.log(\"[emf] Region split bottom scan \" + si + \" for substraction\");\n this.scans.splice(++si, 0, cloned);\n }\n break;\n }\n si++;\n }\n\n // Now perform a subtraction on each scan in between rect.top and rect.bottom. Because we\n // cloned scans that partially overlapped rect.top and rect.bottom, we don't have to\n // account for this anymore.\n if (first < this.scans.length) {\n let last = si;\n si = first;\n while (si < last) {\n const scan = this.scans[si];\n if (!scan.subtract(rect.left, rect.right)) {\n Helper.log(\"[emf] Region remove now empty scan \" + si + \" due to subtraction\");\n this.scans.splice(si, 1);\n last--;\n continue;\n }\n\n si++;\n }\n }\n\n // Update bounds\n if (this.scans != null) {\n let left;\n let top;\n let right;\n let bottom;\n const len = this.scans.length;\n for (let i = 0; i < len; i++) {\n const scan = this.scans[i];\n if (i === 0) {\n top = scan.top;\n }\n if (i === len - 1) {\n bottom = scan.bottom;\n }\n\n const slen = scan.scanlines.length;\n if (slen > 0) {\n let scanline = scan.scanlines[0];\n if (left == null || scanline.left < left) {\n left = scanline.left;\n }\n scanline = scan.scanlines[slen - 1];\n if (right == null || scanline.right > right) {\n right = scanline.right;\n }\n }\n }\n\n if (left != null && top != null && right != null && bottom != null) {\n this.bounds = new RectL(null, left, top, right, bottom);\n this._updateComplexity();\n } else {\n // This has to be a null region now\n this.bounds = null;\n this.scans = null;\n this.complexity = 0;\n }\n } else {\n this._updateComplexity();\n }\n }\n }\n\n Helper.log(\"[emf] Region subtraction -> \" + this.toString());\n }\n\n public intersect(rect: RectL): void {\n Helper.log(\"[emf] Region \" + this.toString() + \" intersect with \" + rect.toString());\n if (this.bounds != null) {\n this.bounds = this.bounds.intersect(rect);\n if (this.bounds != null) {\n if (this.scans != null) {\n let si = 0;\n // Remove any scans that are entirely above the new bounds.top\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.bottom < this.bounds.top) {\n si++;\n } else {\n break;\n }\n }\n if (si > 0) {\n Helper.log(\"[emf] Region remove \" + si + \" scans from top\");\n this.scans.splice(0, si);\n\n // Adjust the first scan's top to match the new bounds.top\n if (this.scans.length > 0) {\n this.scans[0].top = this.bounds.top;\n }\n }\n\n // Get rid of anything that falls outside the new bounds.left/bounds.right\n si = 0;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.top > this.bounds.bottom) {\n // Remove this and all remaining scans that fall entirely below the new bounds.bottom\n Helper.log(\"[emf] Region remove \" + (this.scans.length - si) + \" scans from bottom\");\n this.scans.splice(si, this.scans.length - si);\n break;\n }\n if (!scan.intersect(this.bounds.left, this.bounds.right)) {\n // Remove now empty scan\n Helper.log(\"[emf] Region remove now empty scan \" + si + \" due to intersection\");\n this.scans.splice(si, 1);\n continue;\n }\n si++;\n }\n\n // If there are any scans left, adjust the last one's bottom to the new bounds.bottom\n if (this.scans.length > 0) {\n this.scans[this.scans.length - 1].bottom = this.bounds.bottom;\n }\n\n this._updateComplexity();\n }\n } else {\n this.scans = null;\n this.complexity = 0;\n }\n }\n Helper.log(\"[emf] Region intersection -> \" + this.toString());\n }\n\n public offset(offX: number, offY: number): void {\n if (this.bounds != null) {\n this.bounds.left += offX;\n this.bounds.top += offY;\n this.bounds.right += offX;\n this.bounds.bottom += offY;\n }\n\n if (this.scans != null) {\n const slen = this.scans.length;\n for (let si = 0; si < slen; si++) {\n const scan = this.scans[si];\n scan.top += offY;\n scan.bottom += offY;\n\n const len = scan.scanlines.length;\n for (let i = 0; i < len; i++) {\n const scanline = scan.scanlines[i];\n scanline.left += offX;\n scanline.right += offX;\n }\n }\n }\n }\n}\n\nexport function CreateSimpleRegion(left: number, top: number, right: number, bottom: number): Region {\n const rgn = new Region(null, null);\n rgn.bounds = new RectL(null, left, top, right, bottom);\n rgn._updateComplexity();\n return rgn;\n}\n\nexport class Scan {\n public top: number;\n public bottom: number;\n public scanlines: { left: number, right: number }[];\n\n constructor(r: RectL, copy?: Scan) {\n if (r != null) {\n this.top = r.top;\n this.bottom = r.bottom;\n this.scanlines = [{left: r.left, right: r.right}];\n } else if (copy != null) {\n this.top = copy.top;\n this.bottom = copy.bottom;\n this.scanlines = [];\n for (let i = 0; i < copy.scanlines.length; i++) {\n const scanline = copy.scanlines[i];\n this.scanlines.push({left: scanline.left, right: scanline.right});\n }\n }\n }\n\n public clone(): Scan {\n return new Scan(null, this);\n }\n\n public append(r: RectL): void {\n this.scanlines.push({left: r.left, right: r.right});\n }\n\n public subtract(left: number, right: number): boolean {\n let i;\n\n // Keep everything on the left side\n i = 0;\n while (i < this.scanlines.length) {\n const scanline = this.scanlines[i];\n if (scanline.left <= left) {\n if (scanline.right >= left) {\n scanline.right = left - 1;\n if (scanline.left >= scanline.right) {\n this.scanlines.splice(i, 1);\n continue;\n }\n }\n i++;\n } else {\n break;\n }\n }\n\n // Find the first one that may exceed to the right side\n const first = i;\n let cnt = 0;\n while (i < this.scanlines.length) {\n const scanline = this.scanlines[i];\n if (scanline.right > right) {\n scanline.left = right;\n cnt = i - first;\n if (scanline.left >= scanline.right) {\n cnt++;\n }\n break;\n }\n i++;\n }\n\n // Delete everything we're subtracting\n if (cnt > 0 && first < this.scanlines.length) {\n this.scanlines.splice(first, cnt);\n }\n\n return this.scanlines.length > 0;\n }\n\n public intersect(left: number, right: number): boolean {\n // Get rid of anything that falls entirely outside to the left\n for (let i = 0; i < this.scanlines.length; i++) {\n const scanline = this.scanlines[i];\n if (scanline.left >= left || scanline.right >= left) {\n if (i > 0) {\n this.scanlines.splice(0, i);\n }\n break;\n }\n }\n\n if (this.scanlines.length > 0) {\n // Adjust the first to match the left, if needed\n let scanline = this.scanlines[0];\n if (scanline.left < left) {\n scanline.left = left;\n }\n\n // Get rid of anything that falls entirely outside to the right\n for (let i = 0; i < this.scanlines.length; i++) {\n scanline = this.scanlines[i];\n if (scanline.left > right) {\n this.scanlines.splice(i, this.scanlines.length - i);\n break;\n }\n }\n\n if (this.scanlines.length > 0) {\n // Adjust the last to match the right, if needed\n scanline = this.scanlines[this.scanlines.length - 1];\n if (scanline.right > right) {\n scanline.right = right;\n }\n }\n }\n return this.scanlines.length > 0;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { SVG } from \"../util\";\nimport { Blob } from \"./Blob\";\nimport { EMFRecords } from \"./EMFRecords\";\nimport { GDIContext } from \"./GDIContext\";\nimport { EMFJSError, Helper } from \"./Helper\";\n\nexport interface IRendererSettings {\n width: string;\n height: string;\n wExt: number;\n hExt: number;\n xExt: number;\n yExt: number;\n mapMode: number;\n}\n\nexport class Renderer {\n private _img: EMF;\n\n constructor(blob: ArrayBuffer) {\n this.parse(blob);\n Helper.log(\"EMFJS.Renderer instantiated\");\n }\n\n public render(info: IRendererSettings): SVGElement {\n const svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n this._render(\n new SVG(svgElement),\n info.mapMode,\n info.wExt,\n info.hExt,\n info.xExt,\n info.yExt);\n svgElement.setAttribute(\"viewBox\", [0, 0, info.xExt, info.yExt].join(\" \"));\n svgElement.setAttribute(\"preserveAspectRatio\", \"none\"); // TODO: MM_ISOTROPIC vs MM_ANISOTROPIC\n svgElement.setAttribute(\"width\", info.width);\n svgElement.setAttribute(\"height\", info.height);\n return svgElement;\n }\n\n private parse(blob: ArrayBuffer) {\n this._img = null;\n\n const reader = new Blob(blob);\n\n const type = reader.readUint32();\n if (type !== 0x00000001) {\n throw new EMFJSError(\"Not an EMF file\");\n }\n const size = reader.readUint32();\n if (size % 4 !== 0) {\n throw new EMFJSError(\"Not an EMF file\");\n }\n\n this._img = new EMF(reader, size);\n\n if (this._img == null) {\n throw new EMFJSError(\"Format not recognized\");\n }\n }\n\n private _render(svg: SVG, mapMode: number, w: number, h: number, xExt: number, yExt: number) {\n const gdi = new GDIContext(svg);\n gdi.setWindowExtEx(w, h);\n gdi.setViewportExtEx(xExt, yExt);\n gdi.setMapMode(mapMode);\n Helper.log(\"[EMF] BEGIN RENDERING --->\");\n this._img.render(gdi);\n Helper.log(\"[EMF] <--- DONE RENDERING\");\n }\n}\n\nclass EMF {\n private _hdrsize: number;\n private _records: EMFRecords;\n\n constructor(reader: Blob, hdrsize: number) {\n this._hdrsize = hdrsize;\n this._records = new EMFRecords(reader, this._hdrsize);\n }\n\n public render(gdi: GDIContext): void {\n this._records.play(gdi);\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { DIBitmap } from \"./Bitmap\";\nimport { Blob } from \"./Blob\";\nimport { Helper } from \"./Helper\";\nimport { Obj, PointL } from \"./Primitives\";\n\nexport class ColorRef {\n public r: number;\n public g: number;\n public b: number;\n\n constructor(reader: Blob, r?: number, g?: number, b?: number) {\n if (reader != null) {\n this.r = reader.readUint8();\n this.g = reader.readUint8();\n this.b = reader.readUint8();\n reader.skip(1);\n } else {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n }\n\n public clone(): ColorRef {\n return new ColorRef(null, this.r, this.g, this.b);\n }\n\n public toHex(): string {\n const rgb = (this.r << 16) | (this.g << 8) | this.b;\n return (0x1000000 + rgb).toString(16).slice(1);\n }\n\n public toString(): string {\n return \"{r: \" + this.r + \", g: \" + this.g + \", b: \" + this.b + \"}\";\n }\n}\n\nexport class Font extends Obj {\n public height: number;\n public width: number;\n public escapement: number;\n public orientation: number;\n public weight: number;\n public italic: number;\n public underline: number;\n public strikeout: number;\n public charset: number;\n public outprecision: number;\n public clipprecision: number;\n public quality: number;\n public pitch: number;\n public family: number;\n public facename: string;\n\n constructor(reader: Blob, copy: Font | number) {\n super(\"font\");\n if (reader != null) {\n this.height = reader.readInt32();\n this.width = reader.readInt32();\n this.escapement = reader.readInt32();\n this.orientation = reader.readInt32();\n this.weight = reader.readInt32();\n this.italic = reader.readUint8();\n this.underline = reader.readUint8();\n this.strikeout = reader.readUint8();\n this.charset = reader.readUint8();\n this.outprecision = reader.readUint8();\n this.clipprecision = reader.readUint8();\n this.quality = reader.readUint8();\n const pitchAndFamily = reader.readUint8();\n this.pitch = pitchAndFamily & 0xf; // TODO: double check\n this.family = (pitchAndFamily >> 6) & 0x3; // TODO: double check\n\n const dataLength = copy as number;\n const start = reader.pos;\n this.facename = reader.readFixedSizeUnicodeString(Math.min(dataLength - (reader.pos - start), 32));\n } else if (copy != null) {\n copy = copy as Font;\n this.height = copy.height;\n this.width = copy.width;\n this.escapement = copy.escapement;\n this.orientation = copy.orientation;\n this.weight = copy.weight;\n this.italic = copy.italic;\n this.underline = copy.underline;\n this.strikeout = copy.strikeout;\n this.charset = copy.charset;\n this.outprecision = copy.outprecision;\n this.clipprecision = copy.clipprecision;\n this.quality = copy.quality;\n this.pitch = copy.pitch;\n this.family = copy.family;\n this.facename = copy.facename;\n } else {\n // TODO: Values for a default font?\n this.height = -80;\n this.width = 0;\n this.escapement = 0;\n this.orientation = 0;\n this.weight = 400;\n this.italic = 0;\n this.underline = 0;\n this.strikeout = 0;\n this.charset = 0;\n this.outprecision = 0;\n this.clipprecision = 0;\n this.quality = 0;\n this.pitch = 0;\n this.family = 0;\n this.facename = \"Helvetica\";\n }\n }\n\n public clone(): Font {\n return new Font(null, this);\n }\n\n public toString(): string {\n return JSON.stringify(this);\n }\n}\n\nexport class Brush extends Obj {\n public style: number;\n public color: ColorRef;\n public pattern: DIBitmap;\n public dibpatternpt: DIBitmap;\n public hatchstyle: number;\n\n constructor(reader: Blob, copy?: {\n style?: number, color?: ColorRef, pattern?: DIBitmap,\n dibpatternpt?: DIBitmap, hatchstyle?: number\n }) {\n super(\"brush\");\n if (reader != null) {\n const start = reader.pos;\n\n this.style = reader.readUint32();\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n this.color = new ColorRef(reader);\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n this.pattern = new DIBitmap(reader);\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n this.dibpatternpt = new DIBitmap(reader);\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n this.color = new ColorRef(reader);\n this.hatchstyle = reader.readUint32();\n break;\n }\n\n reader.seek(start + 12);\n } else {\n this.style = copy.style;\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n this.color = copy.color.clone();\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n this.pattern = copy.pattern;\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n this.dibpatternpt = copy.dibpatternpt;\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n this.color = copy.color.clone();\n this.hatchstyle = copy.hatchstyle;\n break;\n }\n }\n }\n\n public clone(): Brush {\n return new Brush(null, this);\n }\n\n public toString(): string {\n let ret = \"{style: \" + this.style;\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n ret += \", color: \" + this.color.toString();\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n ret += \", color: \" + this.color.toString() + \", hatchstyle: \" + this.hatchstyle;\n break;\n }\n return ret + \"}\";\n }\n}\n\nexport class Pen extends Obj {\n public style: number | { header: { off: number, size: number }, data: { off: number, size: number } };\n public width: number;\n public brush: Brush;\n public color: ColorRef;\n\n constructor(reader: Blob, style?: number | { header: { off: number, size: number }, data: { off: number, size: number } },\n width?: number, color?: ColorRef, brush?: Brush) {\n super(\"pen\");\n if (reader != null) {\n if (style != null) {\n // LogPenEx\n this.style = reader.readUint32() & 0xFF;\n this.width = reader.readUint32();\n this.brush = new Brush(reader);\n this.color = this.brush.color != null ? this.brush.color.clone() : new ColorRef(null, 0, 0, 0);\n // TODO: NumStyleEntries, StyleEntry\n } else {\n // LogPen\n this.style = reader.readUint32() & 0xFF;\n this.width = (new PointL(reader)).x;\n this.color = new ColorRef(reader);\n }\n } else {\n this.style = style;\n this.width = width;\n if (color != null) {\n this.color = color;\n }\n if (brush != null) {\n this.brush = brush;\n }\n }\n }\n\n public clone(): Pen {\n return new Pen(null, this.style, this.width, this.color != null ? this.color.clone() : null,\n this.brush != null ? this.brush.clone() : null);\n }\n\n public toString(): string {\n return \"{style: \" + this.style + \", width: \" + this.width\n + \", color: \" + (this.color != null ? this.color.toString() : \"none\") + \"}\";\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Ynse Hoornenborg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport class SVGFilters {\n\n public flood(filter: SVGFilterElement, resultId: string, color: string, opacity: number, _settings?: any): void {\n const floodElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"feFlood\");\n if (resultId) {\n floodElement.setAttribute(\"id\", resultId);\n }\n floodElement.setAttribute(\"flood-color\", color);\n floodElement.setAttribute(\"flood-opacity\", opacity.toString());\n filter.appendChild(floodElement);\n }\n\n public composite(filter: SVGFilterElement,\n resultId: string,\n in1: string,\n in2: string,\n k1?: number,\n k2?: number,\n k3?: number,\n k4?: number,\n _settings?: any): void {\n const compositeElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"feComposite\");\n if (resultId) {\n compositeElement.setAttribute(\"id\", resultId);\n }\n compositeElement.setAttribute(\"in\", in1);\n compositeElement.setAttribute(\"in2\", in2);\n filter.appendChild(compositeElement);\n }\n}\n\nexport class SVGPathBuilder {\n private _path = \"\";\n\n public move(x: number, y: number): void {\n this._path += ` M ${x} ${y}`;\n }\n\n public path(): string {\n return this._path.substr(1);\n }\n\n public line(pts: number[][]): void {\n pts.forEach((point) => {\n this._path += ` L ${point[0]} ${point[1]}`;\n });\n }\n\n public curveC(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this._path += ` C ${x1} ${y1}, ${x2} ${y2}, ${x} ${y}`;\n }\n\n public close(): void {\n this._path += ` Z`;\n }\n}\n\nexport class SVG {\n public filters = new SVGFilters();\n private _svg: SVGElement;\n private _defs: SVGDefsElement | undefined = undefined;\n\n constructor(svg: SVGElement) {\n this._svg = svg;\n }\n\n public svg(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGElement {\n const svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svgElement.setAttribute(\"x\", x.toString());\n svgElement.setAttribute(\"y\", y.toString());\n svgElement.setAttribute(\"width\", width.toString());\n svgElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, svgElement);\n\n if (parent != null) {\n parent.appendChild(svgElement);\n } else {\n this._svg.appendChild(svgElement);\n }\n\n return svgElement;\n }\n\n public image(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n url: string,\n settings?: any): SVGImageElement {\n const imageElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"image\");\n imageElement.setAttribute(\"x\", x.toString());\n imageElement.setAttribute(\"y\", y.toString());\n imageElement.setAttribute(\"width\", width.toString());\n imageElement.setAttribute(\"height\", height.toString());\n imageElement.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"href\", url);\n this._appendSettings(settings, imageElement);\n parent.appendChild(imageElement);\n return imageElement;\n }\n\n public rect(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n rx?: number,\n ry?: number,\n settings?: any): SVGRectElement;\n public rect(parent: Element, x: number, y: number, width: number, height: number, settings?: any): SVGRectElement;\n public rect(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n rx?: number | any,\n ry?: number,\n settings?: any): SVGRectElement {\n const rectElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n rectElement.setAttribute(\"x\", x.toString());\n rectElement.setAttribute(\"y\", y.toString());\n rectElement.setAttribute(\"width\", width.toString());\n rectElement.setAttribute(\"height\", height.toString());\n if (rx !== undefined) {\n if (rx instanceof Number) {\n rectElement.setAttribute(\"rx\", rx.toString());\n } else if (rx instanceof Object) {\n this._appendSettings(rx, rectElement);\n }\n }\n if (ry !== undefined) {\n rectElement.setAttribute(\"ry\", ry.toString());\n }\n this._appendSettings(settings, rectElement);\n parent.appendChild(rectElement);\n return rectElement;\n }\n\n public line(parent: Element, x1: number, y1: number, x2: number, y2: number, settings?: any): SVGLineElement {\n const lineElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"line\");\n lineElement.setAttribute(\"x1\", x1.toString());\n lineElement.setAttribute(\"y1\", y1.toString());\n lineElement.setAttribute(\"x2\", x2.toString());\n lineElement.setAttribute(\"y2\", y2.toString());\n this._appendSettings(settings, lineElement);\n parent.appendChild(lineElement);\n return lineElement;\n }\n\n public polygon(parent: Element, points: number[][], settings?: any): SVGPolygonElement {\n const polygonElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polygon\");\n polygonElement.setAttribute(\"points\", points.map((point) => point.join(\",\")).join(\" \"));\n this._appendSettings(settings, polygonElement);\n parent.appendChild(polygonElement);\n return polygonElement;\n }\n\n public polyline(parent: Element, points: number[][], settings?: any): SVGPolylineElement {\n const polylineElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polyline\");\n polylineElement.setAttribute(\"points\", points.map((point) => point.join(\",\")).join(\" \"));\n this._appendSettings(settings, polylineElement);\n parent.appendChild(polylineElement);\n return polylineElement;\n }\n\n public ellipse(parent: Element, cx: number, cy: number, rx: number, ry: number, settings?: any): SVGEllipseElement {\n const ellipseElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"ellipse\");\n ellipseElement.setAttribute(\"cx\", cx.toString());\n ellipseElement.setAttribute(\"cy\", cy.toString());\n ellipseElement.setAttribute(\"rx\", rx.toString());\n ellipseElement.setAttribute(\"ry\", ry.toString());\n this._appendSettings(settings, ellipseElement);\n parent.appendChild(ellipseElement);\n return ellipseElement;\n }\n\n public path(parent: SVGElement, builder: SVGPathBuilder, settings?: any): SVGPathElement {\n const pathElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\");\n pathElement.setAttribute(\"d\", builder.path());\n this._appendSettings(settings, pathElement);\n parent.appendChild(pathElement);\n return pathElement;\n }\n\n public text(parent: Element, x: number, y: number, value: string, settings?: any): SVGTextElement {\n const textElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n textElement.setAttribute(\"x\", x.toString());\n textElement.setAttribute(\"y\", y.toString());\n this._appendSettings(settings, textElement);\n const textNode = document.createTextNode(value);\n textElement.appendChild(textNode);\n parent.appendChild(textElement);\n return textElement;\n }\n\n public filter(parent: Element,\n id: string,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGFilterElement {\n const filterElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"filter\");\n filterElement.setAttribute(\"x\", x.toString());\n filterElement.setAttribute(\"y\", y.toString());\n filterElement.setAttribute(\"width\", width.toString());\n filterElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, filterElement);\n parent.appendChild(filterElement);\n return filterElement;\n }\n\n public pattern(parent: Element,\n resultId: string,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGPatternElement {\n const patternElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"pattern\");\n if (resultId) {\n patternElement.setAttribute(\"id\", resultId);\n }\n patternElement.setAttribute(\"x\", x.toString());\n patternElement.setAttribute(\"y\", y.toString());\n patternElement.setAttribute(\"width\", width.toString());\n patternElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, patternElement);\n parent.appendChild(patternElement);\n return patternElement;\n }\n\n public defs(): SVGDefsElement {\n if (this._defs === undefined) {\n const defsElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n this._svg.appendChild(defsElement);\n this._defs = defsElement;\n }\n return this._defs;\n }\n\n public clipPath(parent: Element, resultId: string, units?: string, settings?: any): SVGClipPathElement {\n const clipElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"clipPath\");\n if (resultId) {\n clipElement.setAttribute(\"id\", resultId);\n }\n if (units === undefined) {\n units = \"userSpaceOnUse\";\n }\n clipElement.setAttribute(\"clipPathUnits\", units);\n this._appendSettings(settings, clipElement);\n parent.appendChild(clipElement);\n return clipElement;\n }\n\n public createPath(): SVGPathBuilder {\n return new SVGPathBuilder();\n }\n\n private _appendSettings(settings: any | undefined, element: Element): void {\n if (settings !== undefined) {\n Object.keys(settings).forEach((key) => {\n element.setAttribute(key, settings[key]);\n });\n }\n }\n\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Tom Zoehner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport { SVG } from \"./SVG\";\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport { Renderer, IRendererSettings } from \"./Renderer\";\nexport { EMFJSError as Error, loggingEnabled } from \"./Helper\";\n"],"names":[],"sourceRoot":""}