{"version":3,"sources":["webpack:///./node_modules/lib-font/src/opentype/tables/simple/SVG.js"],"names":["SVG","constructor","dict","dataview","p","super","this","version","uint16","offsetToSVGDocumentList","Offset32","currentPosition","tableStart","documentList","SVGDocumentList","numEntries","documentRecords","Array","map","_","SVGDocumentRecord","getDocument","documentID","record","offset","start","svgDocOffset","parser","readBytes","svgDocLength","getDocumentForGlyph","glyphID","id","findIndex","d","startGlyphID","endGlyphID","uint32"],"mappings":"2FAAA,8DAQA,MAAMA,UAAY,IAChBC,YAAYC,EAAMC,GAChB,MACEC,EADaC,MAAMH,EAAMC,GACdC,EACbE,KAAKC,QAAUH,EAAEI,OACjBF,KAAKG,wBAA0BL,EAAEM,SAEjCN,EAAEO,gBAAkBL,KAAKM,WAAaN,KAAKG,wBAC3CH,KAAKO,aAAe,IAAIC,EAAgBV,EAC1C,EAMF,MAAMU,UAAwB,IAC5Bb,YAAYG,GACVC,MAAMD,GACNE,KAAKS,WAAaX,EAAEI,OACpBF,KAAKU,gBAAkB,IAAI,IAAIC,MAAMX,KAAKS,aAAaG,KAAIC,GAAK,IAAIC,EAAkBhB,IACxF,CAKAiB,YAAYC,GACV,IAAIC,EAASjB,KAAKU,gBAAgBM,GAClC,IAAKC,EAAQ,MAAO,GACpB,IAAIC,EAASlB,KAAKmB,MAAQF,EAAOG,aAEjC,OADApB,KAAKqB,OAAOhB,gBAAkBa,EACvBlB,KAAKqB,OAAOC,UAAUL,EAAOM,aACtC,CAKAC,oBAAoBC,GAClB,IAAIC,EAAK1B,KAAKU,gBAAgBiB,WAAUC,GAAKA,EAAEC,cAAgBJ,GAAWA,GAAWG,EAAEE,aACvF,OAAY,IAARJ,EAAkB,GACf1B,KAAKe,YAAYW,EAC1B,EAQF,MAAMZ,EACJnB,YAAYG,GACVE,KAAK6B,aAAe/B,EAAEI,OACtBF,KAAK8B,WAAahC,EAAEI,OACpBF,KAAKoB,aAAetB,EAAEM,SACtBJ,KAAKuB,aAAezB,EAAEiC,MACxB,E","file":"js/13-5252f6a8bbebb4821dd6.chunk.js","sourcesContent":["import { ParsedData } from \"../../../parser.js\";\nimport { SimpleTable } from \"../simple-table.js\";\n\n/**\n * The OpenType `SVG` table.\n *\n * See https://docs.microsoft.com/en-us/typography/opentype/spec/SVG\n */\nclass SVG extends SimpleTable {\n constructor(dict, dataview) {\n const _super = super(dict, dataview),\n p = _super.p;\n this.version = p.uint16;\n this.offsetToSVGDocumentList = p.Offset32; // from the start of the SVG table\n\n p.currentPosition = this.tableStart + this.offsetToSVGDocumentList;\n this.documentList = new SVGDocumentList(p);\n }\n}\n\n/**\n * The SVG document list.\n */\nclass SVGDocumentList extends ParsedData {\n constructor(p) {\n super(p);\n this.numEntries = p.uint16;\n this.documentRecords = [...new Array(this.numEntries)].map(_ => new SVGDocumentRecord(p));\n }\n\n /**\n * Get an SVG document by ID\n */\n getDocument(documentID) {\n let record = this.documentRecords[documentID];\n if (!record) return \"\";\n let offset = this.start + record.svgDocOffset;\n this.parser.currentPosition = offset;\n return this.parser.readBytes(record.svgDocLength);\n }\n\n /**\n * Get an SVG document given a glyphID\n */\n getDocumentForGlyph(glyphID) {\n let id = this.documentRecords.findIndex(d => d.startGlyphID <= glyphID && glyphID <= d.endGlyphID);\n if (id === -1) return \"\";\n return this.getDocument(id);\n }\n}\n\n/**\n * SVG document record, pointing to a specific SVG document encoding a\n * range of glyphs as ... where {NUM} is a number\n * in the range [startGlyphId, endGlyphId].\n */\nclass SVGDocumentRecord {\n constructor(p) {\n this.startGlyphID = p.uint16;\n this.endGlyphID = p.uint16;\n this.svgDocOffset = p.Offset32; // from the beginning of the SVGDocumentList\n this.svgDocLength = p.uint32;\n }\n}\nexport { SVG };"],"sourceRoot":""}