{"version":3,"sources":["webpack:///./node_modules/lib-font/src/opentype/tables/simple/color/CPAL.js"],"names":["CPAL","constructor","dict","dataview","p","super","this","version","uint16","numPaletteEntries","numPalettes","numColorRecords","offsetFirstColorRecord","Offset32","colorRecordIndices","Array","map","_","currentPosition","tableStart","ColorRecord","offsetPaletteTypeArray","offsetPaletteLabelArray","offsetPaletteEntryLabelArray","PaletteTypeArray","PaletteLabelsArray","PaletteEntryLabelArray","blue","uint8","green","red","alpha","paletteTypes","uint32","paletteLabels","paletteEntryLabels"],"mappings":"2FAAA,8DAQA,MAAMA,UAAa,IACjBC,YAAYC,EAAMC,GAChB,MACEC,EADaC,MAAMH,EAAMC,GACdC,EACbE,KAAKC,QAAUH,EAAEI,OACjBF,KAAKG,kBAAoBL,EAAEI,OAC3B,MAAME,EAAcJ,KAAKI,YAAcN,EAAEI,OACzCF,KAAKK,gBAAkBP,EAAEI,OACzBF,KAAKM,uBAAyBR,EAAES,SAChCP,KAAKQ,mBAAqB,IAAI,IAAIC,MAAMT,KAAKI,cAAcM,KAAIC,GAAKb,EAAEI,SACtE,YAAKF,KAAM,gBAAgB,KACzBF,EAAEc,gBAAkBZ,KAAKa,WAAab,KAAKM,uBACpC,IAAI,IAAIG,MAAMT,KAAKK,kBAAkBK,KAAIC,GAAK,IAAIG,EAAYhB,QAKlD,IAAjBE,KAAKC,UACPD,KAAKe,uBAAyBjB,EAAES,SAChCP,KAAKgB,wBAA0BlB,EAAES,SACjCP,KAAKiB,6BAA+BnB,EAAES,SAEtC,YAAKP,KAAM,oBAAoB,KAC7BF,EAAEc,gBAAkBZ,KAAKa,WAAab,KAAKe,uBACpC,IAAIG,EAAiBpB,EAAGM,MAEjC,YAAKJ,KAAM,qBAAqB,KAC9BF,EAAEc,gBAAkBZ,KAAKa,WAAab,KAAKgB,wBACpC,IAAIG,EAAmBrB,EAAGM,MAEnC,YAAKJ,KAAM,0BAA0B,KACnCF,EAAEc,gBAAkBZ,KAAKa,WAAab,KAAKiB,6BACpC,IAAIG,EAAuBtB,EAAGM,MAG3C,EAEF,MAAMU,EACJnB,YAAYG,GACVE,KAAKqB,KAAOvB,EAAEwB,MACdtB,KAAKuB,MAAQzB,EAAEwB,MACftB,KAAKwB,IAAM1B,EAAEwB,MACbtB,KAAKyB,MAAQ3B,EAAEwB,KACjB,EAEF,MAAMJ,EACJvB,YAAYG,EAAGM,GAEbJ,KAAK0B,aAAe,IAAI,IAAIjB,MAAML,IAAcM,KAAIC,GAAKb,EAAE6B,QAC7D,EAEF,MAAMR,EACJxB,YAAYG,EAAGM,GAEbJ,KAAK4B,cAAgB,IAAI,IAAInB,MAAML,IAAcM,KAAIC,GAAKb,EAAEI,QAC9D,EAEF,MAAMkB,EACJzB,YAAYG,EAAGM,GAEbJ,KAAK6B,mBAAqB,IAAI,IAAIpB,MAAML,IAAcM,KAAIC,GAAKb,EAAEI,QACnE,E","file":"js/22-62f49d15db7b323876b8.chunk.js","sourcesContent":["import { SimpleTable } from \"../../simple-table.js\";\nimport lazy from \"../../../../lazy.js\";\n\n/**\n * The OpenType `CPAL` table.\n *\n * See https://docs.microsoft.com/en-us/typography/opentype/spec/CPAL\n */\nclass CPAL extends SimpleTable {\n constructor(dict, dataview) {\n const _super = super(dict, dataview),\n p = _super.p;\n this.version = p.uint16;\n this.numPaletteEntries = p.uint16;\n const numPalettes = this.numPalettes = p.uint16;\n this.numColorRecords = p.uint16;\n this.offsetFirstColorRecord = p.Offset32;\n this.colorRecordIndices = [...new Array(this.numPalettes)].map(_ => p.uint16);\n lazy(this, `colorRecords`, () => {\n p.currentPosition = this.tableStart + this.offsetFirstColorRecord;\n return [...new Array(this.numColorRecords)].map(_ => new ColorRecord(p));\n });\n\n // Index of each paletteā€™s first color record in the combined color record array.\n\n if (this.version === 1) {\n this.offsetPaletteTypeArray = p.Offset32; // from the beginning of CPAL table to the Palette Type Array.\n this.offsetPaletteLabelArray = p.Offset32; // from the beginning of CPAL table to the Palette Labels Array.\n this.offsetPaletteEntryLabelArray = p.Offset32; // from the beginning of CPAL table to the Palette Entry Label Array.\n\n lazy(this, `paletteTypeArray`, () => {\n p.currentPosition = this.tableStart + this.offsetPaletteTypeArray;\n return new PaletteTypeArray(p, numPalettes);\n });\n lazy(this, `paletteLabelArray`, () => {\n p.currentPosition = this.tableStart + this.offsetPaletteLabelArray;\n return new PaletteLabelsArray(p, numPalettes);\n });\n lazy(this, `paletteEntryLabelArray`, () => {\n p.currentPosition = this.tableStart + this.offsetPaletteEntryLabelArray;\n return new PaletteEntryLabelArray(p, numPalettes);\n });\n }\n }\n}\nclass ColorRecord {\n constructor(p) {\n this.blue = p.uint8;\n this.green = p.uint8;\n this.red = p.uint8;\n this.alpha = p.uint8;\n }\n}\nclass PaletteTypeArray {\n constructor(p, numPalettes) {\n // see https://docs.microsoft.com/en-us/typography/opentype/spec/cpal#palette-type-array\n this.paletteTypes = [...new Array(numPalettes)].map(_ => p.uint32);\n }\n}\nclass PaletteLabelsArray {\n constructor(p, numPalettes) {\n // see https://docs.microsoft.com/en-us/typography/opentype/spec/cpal#palette-labels-array\n this.paletteLabels = [...new Array(numPalettes)].map(_ => p.uint16);\n }\n}\nclass PaletteEntryLabelArray {\n constructor(p, numPalettes) {\n // see https://docs.microsoft.com/en-us/typography/opentype/spec/cpal#palette-entry-label-array\n this.paletteEntryLabels = [...new Array(numPalettes)].map(_ => p.uint16);\n }\n}\nexport { CPAL };"],"sourceRoot":""}