UNPKG

202 kBSource Map (JSON)View Raw
1{"version":3,"file":"react-pdf.cjs.min.js","sources":["../src/elements/Root.js","../src/utils/upperFirst.js","../src/utils/matchPercent.js","../src/elements/Node.js","../src/stylesheet/yogaValue.js","../src/stylesheet/transformUnits.js","../src/stylesheet/borders.js","../src/stylesheet/boxModel.js","../src/stylesheet/transformFontWeight.js","../src/stylesheet/objectPosition.js","../src/stylesheet/transformOrigin.js","../src/stylesheet/transformStyles.js","../src/stylesheet/index.js","../src/mixins/debug.js","../src/mixins/borders.js","../src/mixins/clipping.js","../src/mixins/transform.js","../src/utils/warning.js","../src/utils/deepMerge.js","../src/utils/isFunction.js","../src/stylesheet/inherit.js","../src/elements/Base.js","../src/mixins/ruler.js","../src/elements/TextInstance.js","../src/utils/pageSizes.js","../src/elements/Page.js","../src/elements/View.js","../src/font/font.js","../src/font/emoji.js","../src/font/standard.js","../src/font/hyphenation.js","../src/font/index.js","../src/layout/fontSubstitution/standardFont.js","../src/layout/fontSubstitution/index.js","../src/layout/index.js","../src/utils/url.js","../src/utils/png.js","../src/utils/jpeg.js","../src/utils/cache.js","../src/utils/image.js","../src/utils/emoji.js","../src/utils/ignorableChars.js","../src/utils/attributedString.js","../src/elements/Text.js","../src/elements/Link.js","../src/elements/Note.js","../src/utils/objectFit.js","../src/elements/Image.js","../src/elements/Document.js","../src/utils/painter.js","../src/elements/Canvas.js","../src/elements/index.js","../src/utils/propsEqual.js","../src/renderer.js","../src/index.js","../src/node.js"],"sourcesContent":["import PDFDocument from '@react-pdf/pdfkit';\n\nclass Root {\n constructor() {\n this.isDirty = false;\n this.document = null;\n this.instance = null;\n }\n\n get name() {\n return 'Root';\n }\n\n appendChild(child) {\n this.document = child;\n }\n\n removeChild() {\n this.document.cleanup();\n this.document = null;\n }\n\n markDirty() {\n this.isDirty = true;\n }\n\n cleanup() {\n this.document.cleanup();\n }\n\n finish() {\n this.document.finish();\n }\n\n async render() {\n this.instance = new PDFDocument({ autoFirstPage: false });\n await this.document.render();\n this.cleanup();\n this.isDirty = false;\n }\n}\n\nexport default Root;\n","const upperFirst = value => value.charAt(0).toUpperCase() + value.slice(1);\n\nexport default upperFirst;\n","const isPercent = value => /((-)?\\d+\\.?\\d*)%/g.exec(value);\n\nconst matchPercent = value => {\n const match = isPercent(value);\n\n if (match) {\n const value = parseFloat(match[1], 10);\n const percent = value / 100;\n\n return {\n value,\n percent,\n absValue: Math.abs(value),\n absPercent: Math.abs(percent),\n };\n }\n\n return null;\n};\n\nexport default matchPercent;\n","import Yoga from 'yoga-layout';\n\nimport upperFirst from '../utils/upperFirst';\nimport matchPercent from '../utils/matchPercent';\n\nclass Node {\n constructor() {\n this.parent = null;\n this.children = [];\n this.computed = false;\n this.layout = Yoga.Node.createDefault();\n }\n\n appendChild(child) {\n if (child) {\n child.parent = this;\n this.children.push(child);\n this.layout.insertChild(child.layout, this.layout.getChildCount());\n }\n }\n\n appendChildBefore(child, beforeChild) {\n const index = this.children.indexOf(beforeChild);\n\n if (index !== -1 && child) {\n child.parent = this;\n this.children.splice(index, 0, child);\n this.layout.insertChild(child.layout, index);\n }\n }\n\n removeChild(child) {\n const index = this.children.indexOf(child);\n\n if (index !== -1) {\n child.parent = null;\n this.children.splice(index, 1);\n this.layout.removeChild(child.layout);\n }\n\n child.cleanup();\n }\n\n removeAllChilds() {\n const children = [...this.children];\n for (let i = 0; i < children.length; i++) {\n children[i].remove();\n }\n }\n\n remove() {\n this.parent.removeChild(this);\n }\n\n setDimension(attr, value) {\n const fixedMethod = `set${upperFirst(attr)}`;\n const percentMethod = `${fixedMethod}Percent`;\n const percent = matchPercent(value);\n\n if (percent) {\n this.layout[percentMethod](percent.value);\n } else {\n this.layout[fixedMethod](value);\n }\n }\n\n setPosition(edge, value) {\n const percent = matchPercent(value);\n\n if (percent) {\n this.layout.setPositionPercent(edge, percent.value);\n } else {\n this.layout.setPosition(edge, value);\n }\n }\n\n setPadding(edge, value) {\n const percent = matchPercent(value);\n\n if (percent) {\n this.layout.setPaddingPercent(edge, percent.value);\n } else {\n this.layout.setPadding(edge, value);\n }\n }\n\n setMargin(edge, value) {\n const percent = matchPercent(value);\n\n if (percent) {\n this.layout.setMarginPercent(edge, percent.value);\n } else {\n this.layout.setMargin(edge, value);\n }\n }\n\n setBorder(edge, value) {\n if (matchPercent(value)) {\n throw new Error('Node: You cannot set percentage border widths');\n }\n this.layout.setBorder(edge, value);\n }\n\n getAbsoluteLayout() {\n const parent = this.parent;\n const parentLayout =\n parent && parent.getAbsoluteLayout\n ? parent.getAbsoluteLayout()\n : { left: 0, top: 0 };\n\n return {\n left: this.left + parentLayout.left,\n top: this.top + parentLayout.top,\n height: this.height,\n width: this.width,\n };\n }\n\n copyStyle(node) {\n this.layout.copyStyle(node.layout);\n }\n\n calculateLayout() {\n this.layout.calculateLayout();\n this.computed = true;\n }\n\n isEmpty() {\n return this.children.length === 0;\n }\n\n markDirty() {\n return this.layout.markDirty();\n }\n\n onAppendDynamically() {}\n\n cleanup() {\n this.children.forEach(c => c.cleanup());\n this.layout.unsetMeasureFunc();\n Yoga.Node.destroy(this.layout);\n }\n\n get position() {\n return this.layout.getPositionType() === Yoga.POSITION_TYPE_ABSOLUTE\n ? 'absolute'\n : 'relative';\n }\n\n get top() {\n return this.layout.getComputedTop() || 0;\n }\n\n get left() {\n return this.layout.getComputedLeft() || 0;\n }\n\n get right() {\n return this.layout.getComputedRight() || 0;\n }\n\n get bottom() {\n return this.layout.getComputedBottom() || 0;\n }\n\n get width() {\n return this.layout.getComputedWidth();\n }\n\n get minWidth() {\n return this.layout.getMinWidth().value;\n }\n\n get maxWidth() {\n return this.layout.getMaxWidth().value;\n }\n\n get height() {\n return this.layout.getComputedHeight();\n }\n\n get minHeight() {\n return this.layout.getMinHeight().value;\n }\n\n get maxHeight() {\n return this.layout.getMaxHeight().value;\n }\n\n get paddingTop() {\n return this.layout.getComputedPadding(Yoga.EDGE_TOP) || 0;\n }\n\n get paddingRight() {\n return this.layout.getComputedPadding(Yoga.EDGE_RIGHT) || 0;\n }\n\n get paddingBottom() {\n return this.layout.getComputedPadding(Yoga.EDGE_BOTTOM) || 0;\n }\n\n get paddingLeft() {\n return this.layout.getComputedPadding(Yoga.EDGE_LEFT) || 0;\n }\n\n get marginTop() {\n return this.layout.getComputedMargin(Yoga.EDGE_TOP) || 0;\n }\n\n get marginRight() {\n return this.layout.getComputedMargin(Yoga.EDGE_RIGHT) || 0;\n }\n\n get marginBottom() {\n return this.layout.getComputedMargin(Yoga.EDGE_BOTTOM) || 0;\n }\n\n get marginLeft() {\n return this.layout.getComputedMargin(Yoga.EDGE_LEFT) || 0;\n }\n\n get borderTopWidth() {\n return this.layout.getComputedBorder(Yoga.EDGE_TOP) || 0;\n }\n\n get borderRightWidth() {\n return this.layout.getComputedBorder(Yoga.EDGE_RIGHT) || 0;\n }\n\n get borderBottomWidth() {\n return this.layout.getComputedBorder(Yoga.EDGE_BOTTOM) || 0;\n }\n\n get borderLeftWidth() {\n return this.layout.getComputedBorder(Yoga.EDGE_LEFT) || 0;\n }\n\n get padding() {\n return {\n top: this.paddingTop,\n right: this.paddingRight,\n bottom: this.paddingBottom,\n left: this.paddingLeft,\n };\n }\n\n get margin() {\n return {\n top: this.marginTop,\n right: this.marginRight,\n bottom: this.marginBottom,\n left: this.marginLeft,\n };\n }\n\n set position(value) {\n this.layout.setPositionType(\n value === 'absolute'\n ? Yoga.POSITION_TYPE_ABSOLUTE\n : Yoga.POSITION_TYPE_RELATIVE,\n );\n }\n\n set top(value) {\n this.setPosition(Yoga.EDGE_TOP, value);\n }\n\n set left(value) {\n this.setPosition(Yoga.EDGE_LEFT, value);\n }\n\n set right(value) {\n this.setPosition(Yoga.EDGE_RIGHT, value);\n }\n\n set bottom(value) {\n this.setPosition(Yoga.EDGE_BOTTOM, value);\n }\n\n set width(value) {\n this.setDimension('width', value);\n }\n\n set minWidth(value) {\n this.setDimension('minWidth', value);\n }\n\n set maxWidth(value) {\n this.setDimension('maxWidth', value);\n }\n\n set height(value) {\n this.setDimension('height', value);\n }\n\n set minHeight(value) {\n this.setDimension('minHeight', value);\n }\n\n set maxHeight(value) {\n this.setDimension('maxHeight', value);\n }\n\n set paddingTop(value) {\n this.setPadding(Yoga.EDGE_TOP, value);\n }\n\n set paddingRight(value) {\n this.setPadding(Yoga.EDGE_RIGHT, value);\n }\n\n set paddingBottom(value) {\n this.setPadding(Yoga.EDGE_BOTTOM, value);\n }\n\n set paddingLeft(value) {\n this.setPadding(Yoga.EDGE_LEFT, value);\n }\n\n set marginTop(value) {\n this.setMargin(Yoga.EDGE_TOP, value);\n }\n\n set marginRight(value) {\n this.setMargin(Yoga.EDGE_RIGHT, value);\n }\n\n set marginBottom(value) {\n this.setMargin(Yoga.EDGE_BOTTOM, value);\n }\n\n set marginLeft(value) {\n this.setMargin(Yoga.EDGE_LEFT, value);\n }\n\n set padding(value) {\n this.paddingTop = value;\n this.paddingRight = value;\n this.paddingBottom = value;\n this.paddingLeft = value;\n }\n\n set margin(value) {\n this.marginTop = value;\n this.marginRight = value;\n this.marginBottom = value;\n this.marginLeft = value;\n }\n\n set borderTopWidth(value) {\n this.setBorder(Yoga.EDGE_TOP, value);\n }\n\n set borderRightWidth(value) {\n this.setBorder(Yoga.EDGE_RIGHT, value);\n }\n\n set borderBottomWidth(value) {\n this.setBorder(Yoga.EDGE_BOTTOM, value);\n }\n\n set borderLeftWidth(value) {\n this.setBorder(Yoga.EDGE_LEFT, value);\n }\n}\n\nexport default Node;\n","import Yoga from 'yoga-layout';\n\nconst yogaValue = (prop, value) => {\n const isAlignType = prop =>\n prop === 'alignItems' || prop === 'alignContent' || prop === 'alignSelf';\n\n switch (value) {\n case 'auto':\n if (prop === 'alignSelf') {\n return Yoga.ALIGN_AUTO;\n }\n break;\n case 'flex':\n return Yoga.DISPLAY_FLEX;\n case 'none':\n return Yoga.DISPLAY_NONE;\n case 'row':\n return Yoga.FLEX_DIRECTION_ROW;\n case 'row-reverse':\n return Yoga.FLEX_DIRECTION_ROW_REVERSE;\n case 'column':\n return Yoga.FLEX_DIRECTION_COLUMN;\n case 'column-reverse':\n return Yoga.FLEX_DIRECTION_COLUMN_REVERSE;\n case 'stretch':\n return Yoga.ALIGN_STRETCH;\n case 'baseline':\n return Yoga.ALIGN_BASELINE;\n case 'space-around':\n if (prop === 'justifyContent') {\n return Yoga.JUSTIFY_SPACE_AROUND;\n } else if (isAlignType(prop)) {\n return Yoga.ALIGN_SPACE_AROUND;\n }\n break;\n case 'space-between':\n if (prop === 'justifyContent') {\n return Yoga.JUSTIFY_SPACE_BETWEEN;\n } else if (isAlignType(prop)) {\n return Yoga.ALIGN_SPACE_BETWEEN;\n }\n break;\n case 'around':\n return Yoga.JUSTIFY_SPACE_AROUND;\n case 'between':\n return Yoga.JUSTIFY_SPACE_BETWEEN;\n case 'wrap':\n return Yoga.WRAP_WRAP;\n case 'wrap-reverse':\n return Yoga.WRAP_WRAP_REVERSE;\n case 'nowrap':\n return Yoga.WRAP_NO_WRAP;\n case 'flex-start':\n if (prop === 'justifyContent') {\n return Yoga.JUSTIFY_FLEX_START;\n } else if (isAlignType(prop)) {\n return Yoga.ALIGN_FLEX_START;\n }\n break;\n case 'flex-end':\n if (prop === 'justifyContent') {\n return Yoga.JUSTIFY_FLEX_END;\n } else if (isAlignType(prop)) {\n return Yoga.ALIGN_FLEX_END;\n }\n break;\n case 'center':\n if (prop === 'justifyContent') {\n return Yoga.JUSTIFY_CENTER;\n } else if (isAlignType(prop)) {\n return Yoga.ALIGN_CENTER;\n }\n break;\n default:\n return value;\n }\n};\n\n// These are not supported yet\n\n// ALIGN_AUTO: 0,\n// DIMENSION_WIDTH: 0,\n// DIMENSION_HEIGHT: 1,\n// DIRECTION_INHERIT: 0,\n// DIRECTION_LTR: 1,\n// DIRECTION_RTL: 2,\n// EDGE_LEFT: 0,\n// EDGE_TOP: 1,\n// EDGE_RIGHT: 2,\n// EDGE_BOTTOM: 3,\n// EDGE_START: 4,\n// EDGE_END: 5,\n// EDGE_HORIZONTAL: 6,\n// EDGE_VERTICAL: 7,\n// EDGE_ALL: 8,\n// MEASURE_MODE_UNDEFINED: 0,\n// MEASURE_MODE_EXACTLY: 1,\n// MEASURE_MODE_AT_MOST: 2,\n// NODE_TYPE_DEFAULT: 0,\n// NODE_TYPE_TEXT: 1,\n// OVERFLOW_VISIBLE: 0,\n// OVERFLOW_HIDDEN: 1,\n// OVERFLOW_SCROLL: 2,\n// POSITION_TYPE_RELATIVE: 0,\n// POSITION_TYPE_ABSOLUTE: 1,\n// PRINT_OPTIONS_LAYOUT: 1,\n// PRINT_OPTIONS_STYLE: 2,\n// PRINT_OPTIONS_CHILDREN: 4,\n// UNIT_UNDEFINED: 0,\n// UNIT_POINT: 1,\n// UNIT_PERCENT: 2,\n// UNIT_AUTO: 3,\n\nexport default yogaValue;\n","const DPI = 72; // 72pt per inch.\n\nconst parseValue = value => {\n const match = /^(-?\\d*\\.?\\d+)(in|mm|cm|pt|vh|vw)?$/g.exec(value);\n\n if (match) {\n return { value: parseFloat(match[1], 10), unit: match[2] || 'pt' };\n }\n\n return { value, unit: undefined };\n};\n\nconst parseScalar = (value, container) => {\n const scalar = parseValue(value);\n switch (scalar.unit) {\n case 'in':\n return scalar.value * DPI;\n case 'mm':\n return scalar.value * (1 / 25.4) * DPI;\n case 'cm':\n return scalar.value * (1 / 2.54) * DPI;\n case 'vh':\n if (container.isAutoHeight) {\n throw new Error(\n 'vh unit not supported in auto-height pages. Please specify page height if you want to use vh.',\n );\n }\n\n return scalar.value * (container.height / 100);\n case 'vw':\n return scalar.value * (container.width / 100);\n default:\n return scalar.value;\n }\n};\n\nexport default parseScalar;\n","export const isBorderStyle = (key, value) =>\n key.match(/^border/) && typeof value === 'string';\n\nconst matchBorderShorthand = value =>\n value.match(/(\\d+(px|in|mm|cm|pt|vw|vh)?)\\s(\\S+)\\s(\\S+)/);\n\n// Transforms shorthand border values\nexport const processBorders = (key, value) => {\n const match = matchBorderShorthand(value);\n\n if (match) {\n if (key.match(/.Color/)) {\n return match[4];\n } else if (key.match(/.Style/)) {\n return match[3];\n } else if (key.match(/.Width/)) {\n return match[1];\n } else {\n throw new Error(`StyleSheet: Invalid '${value}' for '${key}'`);\n }\n }\n\n return value;\n};\n","export const isBoxModelStyle = (key, value) =>\n key.match(/^(margin)|(padding)/) && typeof value === 'string';\n\nconst matchBoxModel = value => value.match(/\\d+(px|in|mm|cm|pt|%|vw|vh)?/g);\n\n// Transforms shorthand margin and padding values\nexport const processBoxModel = (key, value) => {\n const match = matchBoxModel(value);\n\n if (match) {\n if (key.match(/.Top/)) {\n return match[0];\n } else if (key.match(/.Right/)) {\n return match[1] || match[0];\n } else if (key.match(/.Bottom/)) {\n return match[2] || match[0];\n } else if (key.match(/.Left/)) {\n return match[3] || match[1] || match[0];\n } else {\n throw new Error(`StyleSheet: Invalid '${value}' for '${key}'`);\n }\n }\n\n return value;\n};\n","// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Common_weight_name_mapping\nconst FONT_WEIGHTS = {\n thin: 100,\n hairline: 100,\n ultralight: 200,\n extralight: 200,\n light: 300,\n normal: 400,\n medium: 500,\n semibold: 600,\n demibold: 600,\n bold: 700,\n ultrabold: 800,\n extrabold: 800,\n heavy: 900,\n black: 900,\n};\n\nexport const isFontWeightStyle = key => key.match(/^fontWeight/);\n\nexport const processFontWeight = value => {\n if (!value) return FONT_WEIGHTS.normal;\n if (typeof value === 'number') return value;\n return FONT_WEIGHTS[value.toLowerCase()];\n};\n","export const isObjectPositionStyle = (key, value) =>\n key.match(/^objectPosition/) && typeof value === 'string';\n\nconst matchObjectPosition = value =>\n value.match(/\\d+(px|in|mm|cm|pt|%|vw|vh)?/g);\n\n// Transforms shorthand objectPosition values\nexport const processObjectPosition = (key, value) => {\n const match = matchObjectPosition(value);\n\n if (match) {\n if (key.match(/.X/)) {\n return match[0];\n } else if (key.match(/.Y/)) {\n return match[1];\n } else {\n throw new Error(`StyleSheet: Invalid '${value}' for '${key}'`);\n }\n }\n\n return value;\n};\n","export const isTransformOriginStyle = (key, value) =>\n key.match(/^transformOrigin/) && typeof value === 'string';\n\nconst matchTransformOrigin = value =>\n value.match(/(-?\\d+(px|in|mm|cm|pt|%|vw|vh)?)|top|right|bottom|left|center/g);\n\nconst transformOffsetKeywords = value => {\n switch (value) {\n case 'top':\n case 'left':\n return '0%';\n case 'right':\n case 'bottom':\n return '100%';\n case 'center':\n return '50%';\n default:\n return value;\n }\n};\n\n// Transforms shorthand transformOrigin values\nexport const processTransformOrigin = (key, value) => {\n const match = matchTransformOrigin(value);\n\n if (match) {\n let result;\n\n if (key.match(/.X/)) {\n result = match[0];\n } else if (key.match(/.Y/)) {\n result = match[1] || match[0];\n } else {\n throw new Error(`StyleSheet: Invalid '${value}' for '${key}'`);\n }\n\n return transformOffsetKeywords(result);\n }\n\n return value;\n};\n","import yogaValue from './yogaValue';\nimport parseScalar from './transformUnits';\nimport { isBorderStyle, processBorders } from './borders';\nimport { isBoxModelStyle, processBoxModel } from './boxModel';\nimport { isFontWeightStyle, processFontWeight } from './transformFontWeight';\nimport { isObjectPositionStyle, processObjectPosition } from './objectPosition';\nimport {\n isTransformOriginStyle,\n processTransformOrigin,\n} from './transformOrigin';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\nconst styleShorthands = {\n margin: {\n marginTop: true,\n marginRight: true,\n marginBottom: true,\n marginLeft: true,\n },\n marginHorizontal: {\n marginLeft: true,\n marginRight: true,\n },\n marginVertical: {\n marginTop: true,\n marginBottom: true,\n },\n padding: {\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n },\n paddingHorizontal: {\n paddingLeft: true,\n paddingRight: true,\n },\n paddingVertical: {\n paddingTop: true,\n paddingBottom: true,\n },\n border: {\n borderTopColor: true,\n borderTopStyle: true,\n borderTopWidth: true,\n borderRightColor: true,\n borderRightStyle: true,\n borderRightWidth: true,\n borderBottomColor: true,\n borderBottomStyle: true,\n borderBottomWidth: true,\n borderLeftColor: true,\n borderLeftStyle: true,\n borderLeftWidth: true,\n },\n borderTop: {\n borderTopColor: true,\n borderTopStyle: true,\n borderTopWidth: true,\n },\n borderRight: {\n borderRightColor: true,\n borderRightStyle: true,\n borderRightWidth: true,\n },\n borderBottom: {\n borderBottomColor: true,\n borderBottomStyle: true,\n borderBottomWidth: true,\n },\n borderLeft: {\n borderLeftColor: true,\n borderLeftStyle: true,\n borderLeftWidth: true,\n },\n borderColor: {\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n },\n borderRadius: {\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomRightRadius: true,\n borderBottomLeftRadius: true,\n },\n borderStyle: {\n borderTopStyle: true,\n borderRightStyle: true,\n borderBottomStyle: true,\n borderLeftStyle: true,\n },\n borderWidth: {\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n },\n objectPosition: {\n objectPositionX: true,\n objectPositionY: true,\n },\n transformOrigin: {\n transformOriginX: true,\n transformOriginY: true,\n },\n};\n\n// Expand the shorthand properties to isolate every declaration from the others.\nconst expandStyles = style => {\n if (!style) return style;\n\n const propsArray = Object.keys(style);\n const resolvedStyle = {};\n\n for (let i = 0; i < propsArray.length; i++) {\n const key = propsArray[i];\n const value = style[key];\n\n switch (key) {\n case 'display':\n case 'flex':\n case 'flexDirection':\n case 'flexWrap':\n case 'flexFlow':\n case 'flexGrow':\n case 'flexShrink':\n case 'flexBasis':\n case 'justifyContent':\n case 'alignSelf':\n case 'alignItems':\n case 'alignContent':\n case 'order':\n resolvedStyle[key] = yogaValue(key, value);\n break;\n case 'textAlignVertical':\n resolvedStyle.verticalAlign = value === 'center' ? 'middle' : value;\n break;\n case 'margin':\n case 'marginHorizontal':\n case 'marginVertical':\n case 'padding':\n case 'paddingHorizontal':\n case 'paddingVertical':\n case 'border':\n case 'borderTop':\n case 'borderRight':\n case 'borderBottom':\n case 'borderLeft':\n case 'borderColor':\n case 'borderRadius':\n case 'borderStyle':\n case 'borderWidth':\n case 'objectPosition':\n case 'transformOrigin':\n {\n const expandedProps = styleShorthands[key];\n for (const propName in expandedProps) {\n if (hasOwnProperty.call(expandedProps, propName)) {\n resolvedStyle[propName] = value;\n }\n }\n }\n break;\n default:\n resolvedStyle[key] = value;\n break;\n }\n }\n\n return resolvedStyle;\n};\n\nconst transformStyles = (style, container) => {\n const expandedStyles = expandStyles(style);\n const propsArray = Object.keys(expandedStyles);\n const resolvedStyle = {};\n\n for (let i = 0; i < propsArray.length; i++) {\n const key = propsArray[i];\n const value = expandedStyles[key];\n\n let resolved;\n if (isBorderStyle(key, value)) {\n resolved = processBorders(key, value);\n } else if (isBoxModelStyle(key, value)) {\n resolved = processBoxModel(key, value);\n } else if (isObjectPositionStyle(key, value)) {\n resolved = processObjectPosition(key, value);\n } else if (isTransformOriginStyle(key, value)) {\n resolved = processTransformOrigin(key, value);\n } else if (isFontWeightStyle(key, value)) {\n resolved = processFontWeight(value);\n } else {\n resolved = value;\n }\n\n resolvedStyle[key] = parseScalar(resolved, container);\n }\n\n return resolvedStyle;\n};\n\nexport default transformStyles;\n","import matchMedia from 'media-engine';\nimport transformStyles from './transformStyles';\n\nconst create = styles => styles;\n\nconst flatten = input => {\n if (!Array.isArray(input)) {\n input = [input];\n }\n\n const result = input.reduce((acc, style) => {\n if (style) {\n const s = Array.isArray(style) ? flatten(style) : style;\n\n Object.keys(s).forEach(key => {\n if (s[key] !== null && s[key] !== undefined) {\n acc[key] = s[key];\n }\n });\n }\n\n return acc;\n }, {});\n\n return result;\n};\n\nconst resolveMediaQueries = (input, container) => {\n const result = Object.keys(input).reduce((acc, key) => {\n if (/@media/.test(key)) {\n return {\n ...acc,\n ...matchMedia({ [key]: input[key] }, container),\n };\n }\n\n return { ...acc, [key]: input[key] };\n }, {});\n\n return result;\n};\n\nconst resolve = (styles, container) => {\n if (!styles) return null;\n\n styles = flatten(styles);\n styles = resolveMediaQueries(styles, container);\n styles = transformStyles(styles, container);\n\n return styles;\n};\n\nconst absoluteFillObject = {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n};\n\nexport default {\n hairlineWidth: 1,\n create,\n resolve,\n flatten,\n absoluteFillObject,\n};\n","const Debug = {\n debug() {\n const layout = this.getAbsoluteLayout();\n const padding = this.padding;\n const margin = this.margin;\n\n this.root.instance.save();\n\n this.debugContent(layout, margin, padding);\n this.debugPadding(layout, margin, padding);\n this.debugMargin(layout, margin);\n this.debugText(layout, margin);\n this.debugOrigin();\n\n this.root.instance.restore();\n },\n debugOrigin() {\n if (this.style.transform) {\n const origin = this.origin;\n this.root.instance\n .circle(origin[0], origin[1], 3)\n .fill('red')\n .circle(origin[0], origin[1], 5)\n .stroke('red');\n }\n },\n debugText(layout, margin) {\n const roundedWidth = Math.round(this.width + margin.left + margin.right);\n const roundedHeight = Math.round(this.height + margin.top + margin.bottom);\n\n this.root.instance\n .fontSize(4)\n .opacity(1)\n .fillColor('black')\n .text(\n `${roundedWidth} x ${roundedHeight}`,\n layout.left - margin.left,\n Math.max(layout.top - margin.top - 4, 1),\n );\n },\n debugContent(layout, margin, padding) {\n this.root.instance\n .fillColor('#a1c6e7')\n .opacity(0.5)\n .rect(\n layout.left + padding.left,\n layout.top + padding.top,\n layout.width - padding.left - padding.right,\n layout.height - padding.top - padding.bottom,\n )\n .fill();\n },\n debugPadding(layout, margin, padding) {\n this.root.instance.fillColor('#c4deb9').opacity(0.5);\n\n // Padding top\n this.root.instance\n .rect(\n layout.left + padding.left,\n layout.top,\n layout.width - padding.right - padding.left,\n padding.top,\n )\n .fill();\n\n // Padding left\n this.root.instance\n .rect(layout.left, layout.top, padding.left, layout.height)\n .fill();\n\n // Padding right\n this.root.instance\n .rect(\n layout.left + layout.width - padding.right,\n layout.top,\n padding.right,\n layout.height,\n )\n .fill();\n\n // Padding bottom\n this.root.instance\n .rect(\n layout.left + padding.left,\n layout.top + layout.height - padding.bottom,\n layout.width - padding.right - padding.left,\n padding.bottom,\n )\n .fill();\n },\n debugMargin(layout, margin) {\n this.root.instance.fillColor('#f8cca1').opacity(0.5);\n\n // Margin top\n this.root.instance\n .rect(layout.left, layout.top - margin.top, layout.width, margin.top)\n .fill();\n\n // Margin left\n this.root.instance\n .rect(\n layout.left - margin.left,\n layout.top - margin.top,\n margin.left,\n layout.height + margin.top + margin.bottom,\n )\n .fill();\n\n // Margin right\n this.root.instance\n .rect(\n layout.left + layout.width,\n layout.top - margin.top,\n margin.right,\n layout.height + margin.top + margin.bottom,\n )\n .fill();\n\n // Margin bottom\n this.root.instance\n .rect(\n layout.left,\n layout.top + layout.height,\n layout.width,\n margin.bottom,\n )\n .fill();\n },\n};\n\nexport default Debug;\n","// Ref: https://www.w3.org/TR/css-backgrounds-3/#borders\n\n// This constant is used to approximate a symmetrical arc using a cubic Bezier curve.\nconst KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);\n\nfunction drawBorders() {\n const { instance } = this.root;\n const layout = this.getAbsoluteLayout();\n\n const {\n borderTopWidth,\n borderLeftWidth,\n borderRightWidth,\n borderBottomWidth,\n } = this;\n\n const {\n opacity,\n borderTopLeftRadius = 0,\n borderTopRightRadius = 0,\n borderBottomLeftRadius = 0,\n borderBottomRightRadius = 0,\n borderTopColor = 'black',\n borderTopStyle = 'solid',\n borderLeftColor = 'black',\n borderLeftStyle = 'solid',\n borderRightColor = 'black',\n borderRightStyle = 'solid',\n borderBottomColor = 'black',\n borderBottomStyle = 'solid',\n } = this.style;\n\n const style = {\n borderTopColor,\n borderTopWidth,\n borderTopStyle,\n borderLeftColor,\n borderLeftWidth,\n borderLeftStyle,\n borderRightColor,\n borderRightWidth,\n borderRightStyle,\n borderBottomColor,\n borderBottomWidth,\n borderBottomStyle,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n };\n\n const { width, height } = layout;\n const rtr = Math.min(borderTopRightRadius, 0.5 * width, 0.5 * height);\n const rtl = Math.min(borderTopLeftRadius, 0.5 * width, 0.5 * height);\n const rbr = Math.min(borderBottomRightRadius, 0.5 * width, 0.5 * height);\n const rbl = Math.min(borderBottomLeftRadius, 0.5 * width, 0.5 * height);\n\n instance.save();\n instance.strokeOpacity(opacity);\n\n if (borderTopWidth) {\n instance.save();\n clipBorderTop(instance, layout, style, rtr, rtl);\n fillBorderTop(instance, layout, style, rtr, rtl);\n instance.restore();\n }\n\n if (borderRightWidth) {\n instance.save();\n clipBorderRight(instance, layout, style, rtr, rbr);\n fillBorderRight(instance, layout, style, rtr, rbr);\n instance.restore();\n }\n\n if (borderBottomWidth) {\n instance.save();\n clipBorderBottom(instance, layout, style, rbl, rbr);\n fillBorderBottom(instance, layout, style, rbl, rbr);\n instance.restore();\n }\n\n if (borderLeftWidth) {\n instance.save();\n clipBorderLeft(instance, layout, style, rbl, rtl);\n fillBorderLeft(instance, layout, style, rbl, rtl);\n instance.restore();\n }\n\n instance.restore();\n}\n\nconst clipBorderTop = (ctx, layout, style, rtr, rtl) => {\n const { top, left, width, height } = layout;\n const { borderTopWidth, borderRightWidth, borderLeftWidth } = style;\n\n // Clip outer top border edge\n ctx.moveTo(left + rtl, top);\n ctx.lineTo(left + width - rtr, top);\n\n // Ellipse coefficients outer top right cap\n const c0 = rtr * (1.0 - KAPPA);\n\n // Clip outer top right cap\n ctx.bezierCurveTo(\n left + width - c0,\n top,\n left + width,\n top + c0,\n left + width,\n top + rtr,\n );\n\n // Move down in case the margin exceedes the radius\n const topRightYCoord = top + Math.max(borderTopWidth, rtr);\n ctx.lineTo(left + width, topRightYCoord);\n\n // Clip inner top right cap\n ctx.lineTo(left + width - borderRightWidth, topRightYCoord);\n\n // Ellipse coefficients inner top right cap\n const innerTopRightRadiusX = Math.max(rtr - borderRightWidth, 0);\n const innerTopRightRadiusY = Math.max(rtr - borderTopWidth, 0);\n const c1 = innerTopRightRadiusX * (1.0 - KAPPA);\n const c2 = innerTopRightRadiusY * (1.0 - KAPPA);\n\n // Clip inner top right cap\n ctx.bezierCurveTo(\n left + width - borderRightWidth,\n top + borderTopWidth + c2,\n left + width - borderRightWidth - c1,\n top + borderTopWidth,\n left + width - borderRightWidth - innerTopRightRadiusX,\n top + borderTopWidth,\n );\n\n // Clip inner top border edge\n ctx.lineTo(left + Math.max(rtl, borderLeftWidth), top + borderTopWidth);\n\n // Ellipse coefficients inner top left cap\n const innerTopLeftRadiusX = Math.max(rtl - borderLeftWidth, 0);\n const innerTopLeftRadiusY = Math.max(rtl - borderTopWidth, 0);\n const c3 = innerTopLeftRadiusX * (1.0 - KAPPA);\n const c4 = innerTopLeftRadiusY * (1.0 - KAPPA);\n const topLeftYCoord = top + Math.max(borderTopWidth, rtl);\n\n // Clip inner top left cap\n ctx.bezierCurveTo(\n left + borderLeftWidth + c3,\n top + borderTopWidth,\n left + borderLeftWidth,\n top + borderTopWidth + c4,\n left + borderLeftWidth,\n topLeftYCoord,\n );\n ctx.lineTo(left, topLeftYCoord);\n\n // Move down in case the margin exceedes the radius\n ctx.lineTo(left, top + rtl);\n\n // Ellipse coefficients outer top left cap\n const c5 = rtl * (1.0 - KAPPA);\n\n // Clip outer top left cap\n ctx.bezierCurveTo(left, top + c5, left + c5, top, left + rtl, top);\n ctx.closePath();\n ctx.clip();\n\n // Clip border top cap joins\n if (borderRightWidth) {\n const trSlope = -borderTopWidth / borderRightWidth;\n ctx.moveTo(left + width / 2, trSlope * (-width / 2) + top);\n ctx.lineTo(left + width, top);\n ctx.lineTo(left, top);\n ctx.lineTo(left, top + height);\n ctx.closePath();\n ctx.clip();\n }\n\n if (borderLeftWidth) {\n const trSlope = -borderTopWidth / borderLeftWidth;\n ctx.moveTo(left + width / 2, trSlope * (-width / 2) + top);\n ctx.lineTo(left, top);\n ctx.lineTo(left + width, top);\n ctx.lineTo(left + width, top + height);\n ctx.closePath();\n ctx.clip();\n }\n};\n\nconst fillBorderTop = (ctx, layout, style, rtr, rtl) => {\n const { top, left, width } = layout;\n const {\n borderTopColor,\n borderTopWidth,\n borderTopStyle,\n borderRightWidth,\n borderLeftWidth,\n } = style;\n\n const c0 = rtl * (1.0 - KAPPA);\n const c1 = rtr * (1.0 - KAPPA);\n\n ctx.moveTo(left, top + Math.max(rtl, borderTopWidth));\n ctx.bezierCurveTo(left, top + c0, left + c0, top, left + rtl, top);\n ctx.lineTo(left + width - rtr, top);\n ctx.bezierCurveTo(\n left + width - c1,\n top,\n left + width,\n top + c1,\n left + width,\n top + rtr,\n );\n\n ctx.strokeColor(borderTopColor);\n ctx.lineWidth(\n Math.max(borderRightWidth, borderTopWidth, borderLeftWidth) * 2,\n );\n\n if (borderTopStyle === 'dashed') {\n ctx.dash(borderTopWidth * 2, { space: borderTopWidth * 1.2 });\n } else if (borderTopStyle === 'dotted') {\n ctx.dash(borderTopWidth, { space: borderTopWidth * 1.2 });\n }\n\n ctx.stroke();\n ctx.undash();\n};\n\nconst clipBorderRight = (ctx, layout, style, rtr, rbr) => {\n const { top, left, width, height } = layout;\n const { borderTopWidth, borderRightWidth, borderBottomWidth } = style;\n\n // Clip outer right border edge\n ctx.moveTo(left + width, top + rtr);\n ctx.lineTo(left + width, top + height - rbr);\n\n // Ellipse coefficients outer bottom right cap\n const c0 = rbr * (1.0 - KAPPA);\n\n // Clip outer top right cap\n ctx.bezierCurveTo(\n left + width,\n top + height - c0,\n left + width - c0,\n top + height,\n left + width - rbr,\n top + height,\n );\n\n // Move left in case the margin exceedes the radius\n const topBottomXCoord = left + width - Math.max(borderRightWidth, rbr);\n ctx.lineTo(topBottomXCoord, top + height);\n\n // Clip inner bottom right cap\n ctx.lineTo(topBottomXCoord, top + height - borderBottomWidth);\n\n // Ellipse coefficients inner bottom right cap\n const innerBottomRightRadiusX = Math.max(rbr - borderRightWidth, 0);\n const innerBottomRightRadiusY = Math.max(rbr - borderBottomWidth, 0);\n const c1 = innerBottomRightRadiusX * (1.0 - KAPPA);\n const c2 = innerBottomRightRadiusY * (1.0 - KAPPA);\n\n // Clip inner top right cap\n ctx.bezierCurveTo(\n left + width - borderRightWidth - c1,\n top + height - borderBottomWidth,\n left + width - borderRightWidth,\n top + height - borderBottomWidth - c2,\n left + width - borderRightWidth,\n top + height - Math.max(rbr, borderBottomWidth),\n );\n\n // Clip inner right border edge\n ctx.lineTo(\n left + width - borderRightWidth,\n top + Math.max(rtr, borderTopWidth),\n );\n\n // Ellipse coefficients inner top right cap\n const innerTopRightRadiusX = Math.max(rtr - borderRightWidth, 0);\n const innerTopRightRadiusY = Math.max(rtr - borderTopWidth, 0);\n const c3 = innerTopRightRadiusX * (1.0 - KAPPA);\n const c4 = innerTopRightRadiusY * (1.0 - KAPPA);\n const topRightXCoord = left + width - Math.max(rtr, borderRightWidth);\n\n // Clip inner top left cap\n ctx.bezierCurveTo(\n left + width - borderRightWidth,\n top + borderTopWidth + c4,\n left + width - borderRightWidth - c3,\n top + borderTopWidth,\n topRightXCoord,\n top + borderTopWidth,\n );\n ctx.lineTo(topRightXCoord, top);\n\n // Move right in case the margin exceedes the radius\n ctx.lineTo(left + width - rtr, top);\n\n // Ellipse coefficients outer top right cap\n const c5 = rtr * (1.0 - KAPPA);\n\n // Clip outer top right cap\n ctx.bezierCurveTo(\n left + width - c5,\n top,\n left + width,\n top + c5,\n left + width,\n top + rtr,\n );\n\n ctx.closePath();\n ctx.clip();\n\n // Clip border right cap joins\n if (borderTopWidth) {\n const trSlope = -borderTopWidth / borderRightWidth;\n ctx.moveTo(left + width / 2, trSlope * (-width / 2) + top);\n ctx.lineTo(left + width, top);\n ctx.lineTo(left + width, top + height);\n ctx.lineTo(left, top + height);\n ctx.closePath();\n ctx.clip();\n }\n\n if (borderBottomWidth) {\n const brSlope = borderBottomWidth / borderRightWidth;\n ctx.moveTo(left + width / 2, brSlope * (-width / 2) + top + height);\n ctx.lineTo(left + width, top + height);\n ctx.lineTo(left + width, top);\n ctx.lineTo(left, top);\n ctx.closePath();\n ctx.clip();\n }\n};\n\nconst fillBorderRight = (ctx, layout, style, rtr, rbr) => {\n const { top, left, width, height } = layout;\n const {\n borderRightColor,\n borderRightStyle,\n borderRightWidth,\n borderTopWidth,\n borderBottomWidth,\n } = style;\n\n const c0 = rbr * (1.0 - KAPPA);\n const c1 = rtr * (1.0 - KAPPA);\n\n ctx.moveTo(left + width - rtr, top);\n ctx.bezierCurveTo(\n left + width - c1,\n top,\n left + width,\n top + c1,\n left + width,\n top + rtr,\n );\n ctx.lineTo(left + width, top + height - rbr);\n ctx.bezierCurveTo(\n left + width,\n top + height - c0,\n left + width - c0,\n top + height,\n left + width - rbr,\n top + height,\n );\n\n ctx.strokeColor(borderRightColor);\n ctx.lineWidth(\n Math.max(borderRightWidth, borderTopWidth, borderBottomWidth) * 2,\n );\n\n if (borderRightStyle === 'dashed') {\n ctx.dash(borderRightWidth * 2, { space: borderRightWidth * 1.2 });\n } else if (borderRightStyle === 'dotted') {\n ctx.dash(borderRightWidth, { space: borderRightWidth * 1.2 });\n }\n\n ctx.stroke();\n ctx.undash();\n};\n\nconst clipBorderBottom = (ctx, layout, style, rbl, rbr) => {\n const { top, left, width, height } = layout;\n const { borderBottomWidth, borderRightWidth, borderLeftWidth } = style;\n\n // Clip outer top border edge\n ctx.moveTo(left + width - rbr, top + height);\n ctx.lineTo(left + rbl, top + height);\n\n // Ellipse coefficients outer top right cap\n const c0 = rbl * (1.0 - KAPPA);\n\n // Clip outer top right cap\n ctx.bezierCurveTo(\n left + c0,\n top + height,\n left,\n top + height - c0,\n left,\n top + height - rbl,\n );\n\n // Move up in case the margin exceedes the radius\n const bottomLeftYCoord = top + height - Math.max(borderBottomWidth, rbl);\n ctx.lineTo(left, bottomLeftYCoord);\n\n // Clip inner bottom left cap\n ctx.lineTo(left + borderLeftWidth, bottomLeftYCoord);\n\n // Ellipse coefficients inner top right cap\n const innerBottomLeftRadiusX = Math.max(rbl - borderLeftWidth, 0);\n const innerBottomLeftRadiusY = Math.max(rbl - borderBottomWidth, 0);\n const c1 = innerBottomLeftRadiusX * (1.0 - KAPPA);\n const c2 = innerBottomLeftRadiusY * (1.0 - KAPPA);\n\n // Clip inner bottom left cap\n ctx.bezierCurveTo(\n left + borderLeftWidth,\n top + height - borderBottomWidth - c2,\n left + borderLeftWidth + c1,\n top + height - borderBottomWidth,\n left + borderLeftWidth + innerBottomLeftRadiusX,\n top + height - borderBottomWidth,\n );\n\n // Clip inner bottom border edge\n ctx.lineTo(\n left + width - Math.max(rbr, borderRightWidth),\n top + height - borderBottomWidth,\n );\n\n // Ellipse coefficients inner top left cap\n const innerBottomRightRadiusX = Math.max(rbr - borderRightWidth, 0);\n const innerBottomRightRadiusY = Math.max(rbr - borderBottomWidth, 0);\n const c3 = innerBottomRightRadiusX * (1.0 - KAPPA);\n const c4 = innerBottomRightRadiusY * (1.0 - KAPPA);\n const bottomRightYCoord = top + height - Math.max(borderBottomWidth, rbr);\n\n // Clip inner top left cap\n ctx.bezierCurveTo(\n left + width - borderRightWidth - c3,\n top + height - borderBottomWidth,\n left + width - borderRightWidth,\n top + height - borderBottomWidth - c4,\n left + width - borderRightWidth,\n bottomRightYCoord,\n );\n ctx.lineTo(left + width, bottomRightYCoord);\n\n // Move down in case the margin exceedes the radius\n ctx.lineTo(left + width, top + height - rbr);\n\n // Ellipse coefficients outer top left cap\n const c5 = rbr * (1.0 - KAPPA);\n\n // Clip outer top left cap\n ctx.bezierCurveTo(\n left + width,\n top + height - c5,\n left + width - c5,\n top + height,\n left + width - rbr,\n top + height,\n );\n ctx.closePath();\n ctx.clip();\n\n // Clip border bottom cap joins\n if (borderRightWidth) {\n const brSlope = borderBottomWidth / borderRightWidth;\n ctx.moveTo(left + width / 2, brSlope * (-width / 2) + top + height);\n ctx.lineTo(left + width, top + height);\n ctx.lineTo(left, top + height);\n ctx.lineTo(left, top);\n ctx.closePath();\n ctx.clip();\n }\n\n if (borderLeftWidth) {\n const trSlope = -borderBottomWidth / borderLeftWidth;\n ctx.moveTo(left + width / 2, trSlope * (width / 2) + top + height);\n ctx.lineTo(left, top + height);\n ctx.lineTo(left + width, top + height);\n ctx.lineTo(left + width, top);\n ctx.closePath();\n ctx.clip();\n }\n};\n\nconst fillBorderBottom = (ctx, layout, style, rbl, rbr) => {\n const { top, left, width, height } = layout;\n const {\n borderBottomColor,\n borderBottomStyle,\n borderBottomWidth,\n borderRightWidth,\n borderLeftWidth,\n } = style;\n\n const c0 = rbl * (1.0 - KAPPA);\n const c1 = rbr * (1.0 - KAPPA);\n\n ctx.moveTo(left + width, top + height - rbr);\n ctx.bezierCurveTo(\n left + width,\n top + height - c1,\n left + width - c1,\n top + height,\n left + width - rbr,\n top + height,\n );\n ctx.lineTo(left + rbl, top + height);\n ctx.bezierCurveTo(\n left + c0,\n top + height,\n left,\n top + height - c0,\n left,\n top + height - rbl,\n );\n\n ctx.strokeColor(borderBottomColor);\n ctx.lineWidth(\n Math.max(borderBottomWidth, borderRightWidth, borderLeftWidth) * 2,\n );\n\n if (borderBottomStyle === 'dashed') {\n ctx.dash(borderBottomWidth * 2, { space: borderBottomWidth * 1.2 });\n } else if (borderBottomStyle === 'dotted') {\n ctx.dash(borderBottomWidth, { space: borderBottomWidth * 1.2 });\n }\n\n ctx.stroke();\n ctx.undash();\n};\n\nconst clipBorderLeft = (ctx, layout, style, rbl, rtl) => {\n const { top, left, width, height } = layout;\n const { borderTopWidth, borderLeftWidth, borderBottomWidth } = style;\n\n // Clip outer left border edge\n ctx.moveTo(left, top + height - rbl);\n ctx.lineTo(left, top + rtl);\n\n // Ellipse coefficients outer top left cap\n const c0 = rtl * (1.0 - KAPPA);\n\n // Clip outer top left cap\n ctx.bezierCurveTo(left, top + c0, left + c0, top, left + rtl, top);\n\n // Move right in case the margin exceedes the radius\n const topLeftCoordX = left + Math.max(borderLeftWidth, rtl);\n ctx.lineTo(topLeftCoordX, top);\n\n // Clip inner top left cap\n ctx.lineTo(topLeftCoordX, top + borderTopWidth);\n\n // Ellipse coefficients inner top left cap\n const innerTopLeftRadiusX = Math.max(rtl - borderLeftWidth, 0);\n const innerTopLeftRadiusY = Math.max(rtl - borderTopWidth, 0);\n const c1 = innerTopLeftRadiusX * (1.0 - KAPPA);\n const c2 = innerTopLeftRadiusY * (1.0 - KAPPA);\n\n // Clip inner top right cap\n ctx.bezierCurveTo(\n left + borderLeftWidth + c1,\n top + borderTopWidth,\n left + borderLeftWidth,\n top + borderTopWidth + c2,\n left + borderLeftWidth,\n top + Math.max(rtl, borderTopWidth),\n );\n\n // Clip inner left border edge\n ctx.lineTo(\n left + borderLeftWidth,\n top + height - Math.max(rbl, borderBottomWidth),\n );\n\n // Ellipse coefficients inner bottom left cap\n const innerBottomLeftRadiusX = Math.max(rbl - borderLeftWidth, 0);\n const innerBottomLeftRadiusY = Math.max(rbl - borderBottomWidth, 0);\n const c3 = innerBottomLeftRadiusX * (1.0 - KAPPA);\n const c4 = innerBottomLeftRadiusY * (1.0 - KAPPA);\n const bottomLeftXCoord = left + Math.max(rbl, borderLeftWidth);\n\n // Clip inner top left cap\n ctx.bezierCurveTo(\n left + borderLeftWidth,\n top + height - borderBottomWidth - c4,\n left + borderLeftWidth + c3,\n top + height - borderBottomWidth,\n bottomLeftXCoord,\n top + height - borderBottomWidth,\n );\n ctx.lineTo(bottomLeftXCoord, top + height);\n\n // Move left in case the margin exceedes the radius\n ctx.lineTo(left + rbl, top + height);\n\n // Ellipse coefficients outer top right cap\n const c5 = rbl * (1.0 - KAPPA);\n\n // Clip outer top right cap\n ctx.bezierCurveTo(\n left + c5,\n top + height,\n left,\n top + height - c5,\n left,\n top + height - rbl,\n );\n\n ctx.closePath();\n ctx.clip();\n\n // Clip border right cap joins\n if (borderBottomWidth) {\n const trSlope = -borderBottomWidth / borderLeftWidth;\n ctx.moveTo(left + width / 2, trSlope * (width / 2) + top + height);\n ctx.lineTo(left, top + height);\n ctx.lineTo(left, top);\n ctx.lineTo(left + width, top);\n ctx.closePath();\n ctx.clip();\n }\n\n if (borderBottomWidth) {\n const trSlope = -borderTopWidth / borderLeftWidth;\n ctx.moveTo(left + width / 2, trSlope * (-width / 2) + top);\n ctx.lineTo(left, top);\n ctx.lineTo(left, top + height);\n ctx.lineTo(left + width, top + height);\n ctx.closePath();\n ctx.clip();\n }\n};\n\nconst fillBorderLeft = (ctx, layout, style, rbl, rtl) => {\n const { top, left, height } = layout;\n const {\n borderLeftColor,\n borderLeftStyle,\n borderLeftWidth,\n borderTopWidth,\n borderBottomWidth,\n } = style;\n\n const c0 = rbl * (1.0 - KAPPA);\n const c1 = rtl * (1.0 - KAPPA);\n\n ctx.moveTo(left + rbl, top + height);\n ctx.bezierCurveTo(\n left + c0,\n top + height,\n left,\n top + height - c0,\n left,\n top + height - rbl,\n );\n ctx.lineTo(left, top + rtl);\n ctx.bezierCurveTo(left, top + c1, left + c1, top, left + rtl, top);\n\n ctx.strokeColor(borderLeftColor);\n ctx.lineWidth(\n Math.max(borderLeftWidth, borderTopWidth, borderBottomWidth) * 2,\n );\n\n if (borderLeftStyle === 'dashed') {\n ctx.dash(borderLeftWidth * 2, { space: borderLeftWidth * 1.2 });\n } else if (borderLeftStyle === 'dotted') {\n ctx.dash(borderLeftWidth, { space: borderLeftWidth * 1.2 });\n }\n\n ctx.stroke();\n ctx.undash();\n};\n\nexport default { drawBorders };\n","// This constant is used to approximate a symmetrical arc using a cubic\n// Bezier curve.\nconst KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);\n\nconst Clipping = {\n clip() {\n const { top, left, width, height } = this.getAbsoluteLayout();\n\n const {\n borderTopLeftRadius = 0,\n borderTopRightRadius = 0,\n borderBottomRightRadius = 0,\n borderBottomLeftRadius = 0,\n } = this.style;\n\n // Border top\n const rtr = Math.min(borderTopRightRadius, 0.5 * width, 0.5 * height);\n const ctr = rtr * (1.0 - KAPPA);\n\n this.root.instance.moveTo(left + rtr, top);\n this.root.instance.lineTo(left + width - rtr, top);\n this.root.instance.bezierCurveTo(\n left + width - ctr,\n top,\n left + width,\n top + ctr,\n left + width,\n top + rtr,\n );\n\n // Border right\n const rbr = Math.min(borderBottomRightRadius, 0.5 * width, 0.5 * height);\n const cbr = rbr * (1.0 - KAPPA);\n\n this.root.instance.lineTo(left + width, top + height - rbr);\n this.root.instance.bezierCurveTo(\n left + width,\n top + height - cbr,\n left + width - cbr,\n top + height,\n left + width - rbr,\n top + height,\n );\n\n // Border bottom\n const rbl = Math.min(borderBottomLeftRadius, 0.5 * width, 0.5 * height);\n const cbl = rbl * (1.0 - KAPPA);\n\n this.root.instance.lineTo(left + rbl, top + height);\n this.root.instance.bezierCurveTo(\n left + cbl,\n top + height,\n left,\n top + height - cbl,\n left,\n top + height - rbl,\n );\n\n // Border left\n const rtl = Math.min(borderTopLeftRadius, 0.5 * width, 0.5 * height);\n const ctl = rtl * (1.0 - KAPPA);\n\n this.root.instance.lineTo(left, top + rtl);\n this.root.instance.bezierCurveTo(\n left,\n top + ctl,\n left + ctl,\n top,\n left + rtl,\n top,\n );\n this.root.instance.closePath();\n this.root.instance.clip();\n },\n};\n\nexport default Clipping;\n","const getRotation = transform => {\n const match = /rotate\\((-?\\d+.?\\d+)(.+)\\)/g.exec(transform);\n\n if (match && match[1] && match[2]) {\n const value = match[1];\n return match[2] === 'rad' ? (value * 180) / Math.PI : value;\n }\n\n return 0;\n};\n\nconst getTranslateX = transform => {\n const matchX = /translateX\\((-?\\d+\\.?d*)\\)/g.exec(transform);\n const matchGeneric = /translate\\((-?\\d+\\.?d*).*,\\s*(-?\\d+\\.?d*).*\\)/g.exec(\n transform,\n );\n\n if (matchX && matchX[1]) return matchX[1];\n if (matchGeneric && matchGeneric[1]) return matchGeneric[1];\n\n return 0;\n};\n\nconst getTranslateY = transform => {\n const matchY = /translateY\\((-?\\d+\\.?\\d*)\\)/g.exec(transform);\n const matchGeneric = /translate\\((-?\\d+\\.?\\d*).*,\\s*(-?\\d+\\.?\\d*).*\\)/g.exec(\n transform,\n );\n\n if (matchY && matchY[1]) return matchY[1];\n if (matchGeneric && matchGeneric[2]) return matchGeneric[2];\n\n return 0;\n};\n\nconst getScaleX = transform => {\n const matchX = /scaleX\\((-?\\d+\\.?\\d*)\\)/g.exec(transform);\n const matchGeneric = /scale\\((-?\\d+\\.?\\d*).*,\\s*(-?\\d+\\.?\\d*).*\\)/g.exec(\n transform,\n );\n\n if (matchX && matchX[1]) return matchX[1];\n if (matchGeneric && matchGeneric[1]) return matchGeneric[1];\n\n return 1;\n};\n\nconst getScaleY = transform => {\n const matchY = /scaleY\\((-?\\d+\\.?\\d*)\\)/g.exec(transform);\n const matchGeneric = /scale\\((-?\\d+\\.?\\d*).*,\\s*(-?\\d+\\.?\\d*).*\\)/g.exec(\n transform,\n );\n\n if (matchY && matchY[1]) return matchY[1];\n if (matchGeneric && matchGeneric[2]) return matchGeneric[2];\n\n return 1;\n};\n\nconst getMatrix = transform => {\n const match = /matrix\\(([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)\\)/g.exec(\n transform,\n );\n if (match) return match.slice(1, 7);\n return null;\n};\n\nconst applySingleTransformation = (element, transform, origin) => {\n if (/rotate/g.test(transform)) {\n element.root.instance.rotate(getRotation(transform), { origin });\n } else if (/scaleX/g.test(transform)) {\n element.root.instance.scale(getScaleX(transform), 1, { origin });\n } else if (/scaleY/g.test(transform)) {\n element.root.instance.scale(1, getScaleY(transform), { origin });\n } else if (/scale/g.test(transform)) {\n element.root.instance.scale(getScaleX(transform), getScaleY(transform), {\n origin,\n });\n } else if (/translateX/g.test(transform)) {\n element.root.instance.translate(getTranslateX(transform), 1, { origin });\n } else if (/translateY/g.test(transform)) {\n element.root.instance.translate(1, getTranslateY(transform), { origin });\n } else if (/translate/g.test(transform)) {\n element.root.instance.translate(\n getTranslateX(transform),\n getTranslateY(transform),\n { origin },\n );\n } else if (/matrix/g.test(transform)) {\n element.root.instance.transform(...getMatrix(transform));\n }\n};\n\nconst Transformations = {\n applyTransformations() {\n let match;\n const re = /[a-zA-Z]+\\([^)]+\\)/g;\n const origin = this.origin;\n const transform = (this.style && this.style.transform) || '';\n\n while ((match = re.exec(transform)) != null) {\n applySingleTransformation(this, match[0], origin);\n }\n },\n};\n\nexport default Transformations;\n","function printWarning(format, ...args) {\n let argIndex = 0;\n const message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n throw new Error(message);\n } catch (x) {}\n}\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\nconst warning = __DEV__\n ? (condition, format, ...args) => {\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument',\n );\n }\n if (!condition) {\n printWarning(format, ...args);\n }\n }\n : () => {};\n\nexport default warning;\n","import { isNil, mergeDeepWith } from 'ramda';\n\nconst merge = (a, b) => {\n return isNil(b) ? a : b;\n};\n\nconst deepMerge = objs =>\n objs.reduce((acc, obj) => {\n return mergeDeepWith(merge, acc, obj);\n }, {});\n\nexport default deepMerge;\n","import { compose, equals, type } from 'ramda';\n\nconst isFunction = compose(\n equals('Function'),\n type,\n);\n\nexport default isFunction;\n","export const inheritedProperties = [\n 'color',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'opacity',\n 'textDecoration',\n 'lineHeight',\n 'textAlign',\n 'visibility',\n 'wordSpacing',\n];\n","import { pick, toPairsIn } from 'ramda';\n\nimport Node from './Node';\nimport StyleSheet from '../stylesheet';\nimport Debug from '../mixins/debug';\nimport Borders from '../mixins/borders';\nimport Clipping from '../mixins/clipping';\nimport Transform from '../mixins/transform';\nimport warning from '../utils/warning';\nimport deepMerge from '../utils/deepMerge';\nimport upperFirst from '../utils/upperFirst';\nimport isFunction from '../utils/isFunction';\nimport matchPercent from '../utils/matchPercent';\nimport { inheritedProperties } from '../stylesheet/inherit';\n\nclass Base extends Node {\n constructor(root, props) {\n super();\n\n this.root = root;\n this.style = {};\n this.props = deepMerge([\n this.constructor.defaultProps,\n Base.defaultProps,\n props,\n ]);\n\n warning(!this.props.styles, '\"styles\" prop passed instead of \"style\" prop');\n }\n\n get page() {\n return this.parent.page;\n }\n\n get wrap() {\n return this.props.wrap;\n }\n\n get break() {\n return this.props.break;\n }\n\n get fixed() {\n return this.props.fixed;\n }\n\n get minPresenceAhead() {\n return this.props.minPresenceAhead;\n }\n\n get absolute() {\n return this.props.style.position === 'absolute';\n }\n\n get origin() {\n const { transformOriginX, transformOriginY } = this.style;\n const { left, top, width, height } = this.getAbsoluteLayout();\n\n const percentX = matchPercent(transformOriginX);\n const percentY = matchPercent(transformOriginY);\n\n const offsetX = percentX ? width * percentX.percent : transformOriginX;\n const offsetY = percentY ? height * percentY.percent : transformOriginY;\n\n return [left + offsetX, top + offsetY];\n }\n\n set break(value) {\n this.props.break = value;\n }\n\n appendChild(child) {\n super.appendChild(child);\n this.root.markDirty();\n }\n\n appendChildBefore(child, beforeChild) {\n super.appendChildBefore(child, beforeChild);\n this.root.markDirty();\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.root.markDirty();\n }\n\n update(newProps) {\n this.props = deepMerge([\n this.constructor.defaultProps,\n Base.defaultProps,\n newProps,\n ]);\n this.root.markDirty();\n }\n\n applyProps() {\n this.style = this.resolveStyles();\n\n toPairsIn(this.style).map(([attribute, value]) => {\n this.applyStyle(attribute, value);\n });\n\n this.children.forEach(child => {\n if (child.applyProps) child.applyProps();\n });\n }\n\n resolveStyles() {\n const { size, orientation, isAutoHeight } = this.page;\n const container = {\n orientation,\n isAutoHeight,\n width: size.width,\n height: size.height,\n };\n\n const ownStyles = StyleSheet.resolve(this.props.style, container);\n\n const inheritedStyles = this.parent\n ? pick(inheritedProperties, this.parent.style)\n : {};\n\n return { ...inheritedStyles, ...ownStyles };\n }\n\n applyStyle(attribute, value) {\n if (value === undefined) return;\n\n const setter = `set${upperFirst(attribute)}`;\n\n switch (attribute) {\n case 'marginTop':\n case 'marginRight':\n case 'marginBottom':\n case 'marginLeft':\n case 'paddingTop':\n case 'paddingRight':\n case 'paddingBottom':\n case 'paddingLeft':\n case 'borderTopWidth':\n case 'borderRightWidth':\n case 'borderBottomWidth':\n case 'borderLeftWidth':\n case 'position':\n case 'top':\n case 'right':\n case 'bottom':\n case 'left':\n case 'width':\n case 'height':\n case 'minHeight':\n case 'maxHeight':\n case 'minWidth':\n case 'maxWidth':\n this[attribute] = value;\n break;\n default:\n if (isFunction(this.layout[setter])) {\n this.layout[setter](value);\n }\n }\n }\n\n getLayoutData() {\n const layout = this.getAbsoluteLayout();\n\n return {\n type: this.name,\n top: layout.top,\n left: layout.left,\n width: layout.width,\n style: this.style,\n height: layout.height,\n children: this.children.map(c => {\n return c.getLayoutData();\n }),\n };\n }\n\n drawBackgroundColor() {\n const { backgroundColor, opacity = 1 } = this.style;\n const { left, top, width, height } = this.getAbsoluteLayout();\n\n if (backgroundColor) {\n this.root.instance.save();\n\n this.clip();\n\n this.root.instance\n .fillOpacity(opacity)\n .fillColor(backgroundColor)\n .rect(left, top, width, height)\n .fill()\n .restore();\n }\n }\n\n clone() {\n const clone = new this.constructor(this.root, this.props);\n\n clone.copyStyle(this);\n clone.style = this.style;\n\n return clone;\n }\n\n onNodeSplit(height, clone) {\n this.calculateLayout();\n\n clone.marginTop = 0;\n clone.paddingTop = 0;\n\n // If a height was given to the element, we need to substract the remaining wrapping height\n // If not, we just let Yoga calculate the appropiate height when layout get's calculated.\n if (clone.style.height) {\n clone.height = this.height - height;\n }\n\n this.height = height;\n this.marginBottom = 0;\n this.paddingBottom = 0;\n }\n\n async renderChildren() {\n for (let i = 0; i < this.children.length; i++) {\n await this.children[i].render();\n }\n }\n}\n\nBase.defaultProps = {\n style: {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n transformOriginX: '50%',\n transformOriginY: '50%',\n },\n minPresenceAhead: 0,\n};\n\nObject.assign(Base.prototype, Debug);\nObject.assign(Base.prototype, Borders);\nObject.assign(Base.prototype, Clipping);\nObject.assign(Base.prototype, Transform);\n\nexport default Base;\n","import matchPercent from '../utils/matchPercent';\n\nconst RULER_WIDTH = 13;\nconst RULER_COLOR = 'white';\nconst RULER_FONT_SIZE = 5;\nconst DEFAULT_RULER_STEPS = 50;\nconst LINE_WIDTH = 0.5;\nconst LINE_COLOR = 'gray';\nconst GRID_COLOR = '#ababab';\n\nconst range = (max, steps) =>\n Array.from({ length: Math.ceil(max / steps) }, (_, i) => i * steps);\n\nconst matchPercentage = value => {\n const match = matchPercent(value);\n return match ? 100 / match.value : null;\n};\n\nconst Ruler = {\n getRulerWidth() {\n return RULER_WIDTH;\n },\n hasHorizontalRuler() {\n return this.props.ruler || this.props.horizontalRuler;\n },\n hasVerticalRuler() {\n return this.props.ruler || this.props.verticalRuler;\n },\n getHorizontalSteps() {\n const value =\n this.props.horizontalRulerSteps ||\n this.props.rulerSteps ||\n DEFAULT_RULER_STEPS;\n\n if (typeof value === 'string') {\n const percentage = matchPercentage(value);\n if (percentage) {\n const width = this.width - (this.hasVerticalRuler() ? RULER_WIDTH : 0);\n return width / percentage;\n }\n throw new Error('Page: Invalid horizontal steps value');\n }\n\n return value;\n },\n getVerticalSteps() {\n const value =\n this.props.verticalRulerSteps ||\n this.props.rulerSteps ||\n DEFAULT_RULER_STEPS;\n\n if (typeof value === 'string') {\n const percentage = matchPercentage(value);\n if (percentage) {\n const height =\n this.height - (this.hasHorizontalRuler() ? RULER_WIDTH : 0);\n return height / percentage;\n }\n throw new Error('Page: Invalid horizontal steps value');\n }\n\n return value;\n },\n renderRuler() {\n const hasHorizontalRuler = this.hasHorizontalRuler();\n const hasVerticalRuler = this.hasVerticalRuler();\n\n if (hasHorizontalRuler || hasVerticalRuler) {\n this.root.instance\n .save()\n .lineWidth(LINE_WIDTH)\n .fontSize(RULER_FONT_SIZE)\n .opacity(1);\n\n if (hasHorizontalRuler) this.drawHorizontalRuler();\n\n if (hasVerticalRuler) this.drawVerticalRuler();\n\n if (hasHorizontalRuler && hasVerticalRuler) {\n this.root.instance\n .rect(0, 0, RULER_WIDTH - LINE_WIDTH, RULER_WIDTH - LINE_WIDTH)\n .fill(RULER_COLOR);\n }\n\n this.root.instance.restore();\n }\n },\n drawHorizontalRuler() {\n const offset = this.hasVerticalRuler() ? RULER_WIDTH : 0;\n\n this.root.instance\n .rect(offset, 0, this.width, RULER_WIDTH)\n .fill(RULER_COLOR)\n .moveTo(this.hasVerticalRuler() ? RULER_WIDTH : 0, RULER_WIDTH)\n .lineTo(this.width, RULER_WIDTH)\n .stroke(LINE_COLOR);\n\n const hRange = range(this.width, this.getHorizontalSteps());\n\n hRange.map(step => {\n this.root.instance\n .moveTo(offset + step, 0)\n .lineTo(offset + step, RULER_WIDTH)\n .stroke(LINE_COLOR)\n .fillColor('black')\n .text(`${Math.round(step)}`, offset + step + 1, 1);\n });\n\n hRange.map(step => {\n if (step !== 0) {\n this.root.instance\n .moveTo(offset + step, RULER_WIDTH)\n .lineTo(offset + step, this.height)\n .stroke(GRID_COLOR);\n }\n });\n },\n drawVerticalRuler() {\n const offset = this.hasHorizontalRuler() ? RULER_WIDTH : 0;\n\n this.root.instance\n .rect(0, offset, RULER_WIDTH, this.height)\n .fill(RULER_COLOR)\n .moveTo(RULER_WIDTH, this.hasHorizontalRuler() ? RULER_WIDTH : 0)\n .lineTo(RULER_WIDTH, this.height)\n .stroke(LINE_COLOR);\n\n const vRange = range(this.height, this.getVerticalSteps());\n\n vRange.map(step => {\n this.root.instance\n .moveTo(0, offset + step)\n .lineTo(RULER_WIDTH, offset + step)\n .stroke(LINE_COLOR)\n .fillColor('black')\n .text(`${Math.round(step)}`, 1, offset + step + 1);\n });\n\n vRange.map(step => {\n if (step !== 0) {\n this.root.instance\n .moveTo(RULER_WIDTH, offset + step)\n .lineTo(this.width, offset + step)\n .stroke(GRID_COLOR);\n }\n });\n },\n};\n\nexport default Ruler;\n","class TextInstance {\n constructor(root, value) {\n this.root = root;\n this.value = value;\n this.parent = null;\n this.props = {};\n }\n\n get name() {\n return 'TextInstance';\n }\n\n getLayoutData() {\n return this.value;\n }\n\n remove() {\n this.parent.removeChild(this);\n }\n\n clone() {\n return new this.constructor(this.root, this.value);\n }\n\n cleanup() {}\n\n update(value) {\n this.value = value;\n this.parent.computed = false;\n this.parent.container = null;\n this.root.markDirty();\n }\n}\n\nexport default TextInstance;\n","const PAGE_SIZES = {\n '4A0': [4767.87, 6740.79],\n '2A0': [3370.39, 4767.87],\n A0: [2383.94, 3370.39],\n A1: [1683.78, 2383.94],\n A2: [1190.55, 1683.78],\n A3: [841.89, 1190.55],\n A4: [595.28, 841.89],\n A5: [419.53, 595.28],\n A6: [297.64, 419.53],\n A7: [209.76, 297.64],\n A8: [147.4, 209.76],\n A9: [104.88, 147.4],\n A10: [73.7, 104.88],\n B0: [2834.65, 4008.19],\n B1: [2004.09, 2834.65],\n B2: [1417.32, 2004.09],\n B3: [1000.63, 1417.32],\n B4: [708.66, 1000.63],\n B5: [498.9, 708.66],\n B6: [354.33, 498.9],\n B7: [249.45, 354.33],\n B8: [175.75, 249.45],\n B9: [124.72, 175.75],\n B10: [87.87, 124.72],\n C0: [2599.37, 3676.54],\n C1: [1836.85, 2599.37],\n C2: [1298.27, 1836.85],\n C3: [918.43, 1298.27],\n C4: [649.13, 918.43],\n C5: [459.21, 649.13],\n C6: [323.15, 459.21],\n C7: [229.61, 323.15],\n C8: [161.57, 229.61],\n C9: [113.39, 161.57],\n C10: [79.37, 113.39],\n RA0: [2437.8, 3458.27],\n RA1: [1729.13, 2437.8],\n RA2: [1218.9, 1729.13],\n RA3: [864.57, 1218.9],\n RA4: [609.45, 864.57],\n SRA0: [2551.18, 3628.35],\n SRA1: [1814.17, 2551.18],\n SRA2: [1275.59, 1814.17],\n SRA3: [907.09, 1275.59],\n SRA4: [637.8, 907.09],\n EXECUTIVE: [521.86, 756.0],\n FOLIO: [612.0, 936.0],\n LEGAL: [612.0, 1008.0],\n LETTER: [612.0, 792.0],\n TABLOID: [792.0, 1224.0],\n};\n\n// Return page size in an object { width, height } given the passed size and orientation\n// Accepts page type string, number, array or object as parameter\nconst getPageSize = (size, orientation = 'portrait') => {\n let result;\n\n if (typeof size === 'string') {\n result = PAGE_SIZES[size.toUpperCase()];\n } else if (Array.isArray(size)) {\n result = size;\n } else if (typeof size === 'number') {\n result = [size];\n } else if (typeof size === 'object' && size.width) {\n result = [size.width, size.height];\n } else {\n throw new Error(`Invalid Page size: ${size}`);\n }\n\n return orientation === 'portrait'\n ? { width: result[0], height: result[1] }\n : { width: result[1], height: result[0] };\n};\n\nexport default getPageSize;\n","import { Fragment } from 'react';\nimport Yoga from 'yoga-layout';\n\nimport Base from './Base';\nimport Ruler from '../mixins/ruler';\nimport warning from '../utils/warning';\nimport { createInstance } from './index';\nimport TextInstance from './TextInstance';\nimport getPageSize from '../utils/pageSizes';\nimport matchPercent from '../utils/matchPercent';\n\nclass Page extends Base {\n static defaultProps = {\n size: 'A4',\n wrap: true,\n orientation: 'portrait',\n };\n\n constructor(root, props) {\n super(root, props);\n\n this._size = null;\n }\n\n get name() {\n return 'Page';\n }\n\n get document() {\n return this.parent;\n }\n\n get page() {\n return this;\n }\n\n get orientation() {\n return this.props.orientation;\n }\n\n get size() {\n if (this._size) return this._size;\n\n this._size = getPageSize(this.props.size, this.orientation);\n\n // Adjust size for ruler\n if (this.hasHorizontalRuler()) {\n this._size.width += this.getRulerWidth();\n }\n\n if (this.hasVerticalRuler()) {\n this._size.height += this.getRulerWidth();\n }\n\n return this._size;\n }\n\n get isAutoHeight() {\n return typeof this.size.height === 'undefined';\n }\n\n resetMargins() {\n if (\n !!this.marginTop ||\n !!this.marginBottom ||\n !!this.marginLeft ||\n !!this.marginRight\n ) {\n warning(\n false,\n 'Margin values are not allowed on Page element. Use padding instead.',\n );\n\n this.marginTop = 0;\n this.marginBottom = 0;\n this.marginLeft = 0;\n this.marginRight = 0;\n }\n }\n\n applyProps() {\n super.applyProps();\n\n this.top = 0;\n this.left = 0;\n this.width = this.size.width;\n\n this.resetMargins();\n\n // Add some padding if ruler present, so we can see the whole page inside it\n const rulerWidth = this.getRulerWidth();\n\n if (this.hasHorizontalRuler()) {\n this.paddingTop = this.paddingTop + rulerWidth;\n }\n\n if (this.hasVerticalRuler()) {\n this.paddingLeft = this.paddingLeft + rulerWidth;\n }\n }\n\n setPadding(edge, value) {\n const dimension =\n edge === Yoga.EDGE_TOP || edge === Yoga.EDGE_BOTTOM\n ? this.size.height\n : this.size.width;\n\n const match = matchPercent(value);\n\n if (match) {\n this.layout.setPadding(edge, dimension * match.percent);\n } else {\n this.layout.setPadding(edge, value);\n }\n }\n\n async addDynamicChild(parent, elements) {\n if (!elements) return;\n const children = Array.isArray(elements) ? elements : [elements];\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const { type, props } = child;\n\n if (typeof child === 'string') {\n const instance = new TextInstance(this.root, child);\n parent.appendChild(instance);\n } else if (type !== Fragment) {\n const instance = createInstance(child, this.root);\n await instance.onAppendDynamically();\n parent.appendChild(instance);\n instance.applyProps();\n await this.addDynamicChild(instance, props.children);\n } else {\n await this.addDynamicChild(parent, props.children);\n }\n }\n }\n\n async renderDynamicNodes(props, cb) {\n const listToExplore = this.children.slice(0);\n\n while (listToExplore.length > 0) {\n const node = listToExplore.shift();\n const condition = cb ? cb(node) : true;\n\n if (condition && node.props.render) {\n node.removeAllChilds();\n const elements = node.props.render(props);\n await this.addDynamicChild(node, elements);\n if (!node.fixed) node.props.render = null;\n continue;\n }\n\n if (node.children) {\n listToExplore.push(...node.children);\n }\n }\n }\n\n async nodeWillWrap(props) {\n await this.renderDynamicNodes(props);\n this.calculateLayout();\n }\n\n onNodeSplit(height, clone) {\n clone.marginTop = 0;\n this.marginBottom = 0;\n this.calculateLayout();\n }\n\n clone() {\n const clone = super.clone();\n clone._size = this.size;\n return clone;\n }\n\n update(newProps) {\n super.update(newProps);\n this._size = null;\n }\n\n async render() {\n const { instance } = this.root;\n\n if (!this.isAutoHeight) {\n this.height = this.size.height;\n }\n\n this.calculateLayout();\n\n const height = this.isAutoHeight ? this.height : this.size.height;\n\n instance.addPage({\n size: [this.size.width, height],\n margin: 0,\n });\n\n if (this.style.backgroundColor) {\n instance\n .fillColor(this.style.backgroundColor)\n .rect(0, 0, this.size.width, height)\n .fill();\n }\n\n await this.renderChildren();\n\n if (this.props.debug) {\n this.debug();\n }\n\n this.renderRuler();\n }\n}\n\nObject.assign(Page.prototype, Ruler);\n\nexport default Page;\n","import Base from './Base';\n\nclass View extends Base {\n static defaultProps = {\n wrap: true,\n };\n\n get name() {\n return 'View';\n }\n\n async render() {\n this.root.instance.save();\n this.applyTransformations();\n this.drawBackgroundColor();\n this.drawBorders();\n await this.renderChildren();\n if (this.props.debug) this.debug();\n this.root.instance.restore();\n }\n}\n\nexport default View;\n","import isUrl from 'is-url';\nimport fontkit from '@react-pdf/fontkit';\nimport fetch from 'cross-fetch';\n\nimport { processFontWeight } from '../stylesheet/transformFontWeight';\n\nconst fetchFont = async (src, options) => {\n const response = await fetch(src, options);\n\n const buffer = await (response.buffer\n ? response.buffer()\n : response.arrayBuffer());\n\n return buffer.constructor.name === 'Buffer' ? buffer : Buffer.from(buffer);\n};\n\nclass FontSource {\n constructor(src, fontFamily, fontStyle, fontWeight, options) {\n this.src = src;\n this.fontFamily = fontFamily;\n this.fontStyle = fontStyle || 'normal';\n this.fontWeight = processFontWeight(fontWeight) || 400;\n\n this.data = null;\n this.loading = false;\n this.options = options;\n }\n\n async load() {\n this.loading = true;\n\n if (BROWSER || isUrl(this.src)) {\n const { headers, body, method = 'GET' } = this.options;\n const data = await fetchFont(this.src, { method, body, headers });\n this.data = fontkit.create(data);\n } else {\n this.data = await new Promise((resolve, reject) =>\n fontkit.open(this.src, (err, data) =>\n err ? reject(err) : resolve(data),\n ),\n );\n }\n\n this.loading = false;\n }\n}\n\nclass Font {\n static create(family) {\n return new Font(family);\n }\n\n constructor(family) {\n this.family = family;\n this.sources = [];\n }\n\n register({ src, fontWeight, fontStyle, ...options }) {\n this.sources.push(\n new FontSource(src, this.fontFamily, fontStyle, fontWeight, options),\n );\n }\n\n resolve(descriptor) {\n const { fontWeight = 400, fontStyle = 'normal' } = descriptor;\n const styleSources = this.sources.filter(s => s.fontStyle === fontStyle);\n\n // Weight resolution. https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Fallback_weights\n const exactFit = styleSources.find(s => s.fontWeight === fontWeight);\n\n if (exactFit) return exactFit;\n\n let res;\n\n if (fontWeight >= 400 && fontWeight <= 500) {\n const leftOffset = styleSources.filter(s => s.fontWeight <= fontWeight);\n const rightOffset = styleSources.filter(s => s.fontWeight > 500);\n const fit = styleSources.filter(\n s => s.fontWeight >= fontWeight && s.fontWeight < 500,\n );\n\n res = fit[0] || leftOffset[leftOffset.length - 1] || rightOffset[0];\n }\n\n const lt = styleSources.filter(s => s.fontWeight < fontWeight);\n const gt = styleSources.filter(s => s.fontWeight > fontWeight);\n\n if (fontWeight < 400) {\n res = lt[lt.length - 1] || gt[0];\n }\n\n if (fontWeight > 500) {\n res = gt[0] || lt[lt.length - 1];\n }\n\n if (!res) {\n throw new Error(\n `Could not resolve font for ${\n this.fontFamily\n }, fontWeight ${fontWeight}`,\n );\n }\n\n return res;\n }\n}\n\nexport default Font;\n","let emojiSource;\n\nexport const registerEmojiSource = ({ url, format = 'png' }) => {\n emojiSource = { url, format };\n};\n\nexport const getEmojiSource = () => emojiSource;\n\nexport default {\n registerEmojiSource,\n getEmojiSource,\n};\n","export default [\n 'Courier',\n 'Courier-Bold',\n 'Courier-Oblique',\n 'Helvetica',\n 'Helvetica-Bold',\n 'Helvetica-Oblique',\n 'Times-Roman',\n 'Times-Bold',\n 'Times-Italic',\n];\n","let hyphenationCallback;\n\nexport const registerHyphenationCallback = callback => {\n hyphenationCallback = callback;\n};\n\nexport const getHyphenationCallback = () => hyphenationCallback;\n\nexport default {\n registerHyphenationCallback,\n getHyphenationCallback,\n};\n","import font from './font';\nimport emoji from './emoji';\nimport standardFonts from './standard';\nimport hyphenation from './hyphenation';\nimport warning from '../utils/warning';\n\nlet fonts = {};\n\nconst register = (src, data) => {\n if (typeof src === 'object') {\n data = src;\n } else {\n warning(\n false,\n 'Font.register will not longer accept the font source as first argument. Please move it into the data object. For more info refer to https://react-pdf.org/fonts',\n );\n\n data.src = src;\n }\n\n const { family } = data;\n\n if (!fonts[family]) {\n fonts[family] = font.create(family);\n }\n\n // Bulk loading\n if (data.fonts) {\n for (let i = 0; i < data.fonts.length; i++) {\n fonts[family].register({ family, ...data.fonts[i] });\n }\n } else {\n fonts[family].register(data);\n }\n};\n\nconst getRegisteredFonts = () => fonts;\n\nconst getRegisteredFontFamilies = () => Object.keys(fonts);\n\nconst getFont = descriptor => {\n const { fontFamily } = descriptor;\n const isStandard = standardFonts.includes(fontFamily);\n\n if (isStandard) return null;\n\n if (!fonts[fontFamily]) {\n throw new Error(\n `Font family not registered: ${fontFamily}. Please register it calling Font.register() method.`,\n );\n }\n\n return fonts[fontFamily].resolve(descriptor);\n};\n\nconst load = async function(descriptor, doc) {\n const { fontFamily } = descriptor;\n const isStandard = standardFonts.includes(fontFamily);\n\n if (isStandard) return;\n\n const font = getFont(descriptor);\n\n // We cache the font to avoid fetching it many times\n if (!font.data && !font.loading) {\n await font.load();\n }\n};\n\nconst reset = function() {\n for (const font in fonts) {\n if (fonts.hasOwnProperty(font)) {\n fonts[font].data = null;\n }\n }\n};\n\nconst clear = function() {\n fonts = {};\n};\n\nexport default {\n register,\n getRegisteredFonts,\n getRegisteredFontFamilies,\n getFont,\n load,\n clear,\n reset,\n ...emoji,\n ...hyphenation,\n};\n","import { PDFFont } from '@react-pdf/pdfkit';\n\nclass StandardFont {\n constructor(src) {\n this.name = src;\n this.src = PDFFont.open(null, src);\n }\n\n layout(str) {\n const [encoded, positions] = this.src.encode(str);\n\n return {\n positions,\n stringIndices: positions.map((_, i) => i),\n glyphs: encoded.map((g, i) => {\n const glyph = this.getGlyph(parseInt(g, 16));\n glyph.advanceWidth = positions[i].advanceWidth;\n return glyph;\n }),\n };\n }\n\n glyphForCodePoint(codePoint) {\n const glyph = this.getGlyph(codePoint);\n glyph.advanceWidth = 400;\n return glyph;\n }\n\n getGlyph(id) {\n return {\n id,\n _font: this.src,\n codePoints: [id],\n isLigature: false,\n name: this.src.font.characterToGlyph(id),\n };\n }\n\n hasGlyphForCodePoint(codePoint) {\n return this.src.font.characterToGlyph(codePoint) !== '.notdef';\n }\n\n // Based on empirical observation\n get ascent() {\n return 900;\n }\n\n // Based on empirical observation\n get descent() {\n switch (this.name) {\n case 'Times-Roman':\n case 'Times-Bold':\n case 'Times-Italic':\n return -220;\n case 'Courier':\n case 'Courier-Bold':\n case 'Courier-Oblique':\n return -230;\n default:\n return -200;\n }\n }\n\n get lineGap() {\n return 0;\n }\n\n get unitsPerEm() {\n return 1000;\n }\n}\n\nexport default StandardFont;\n","import { pathOr, last } from 'ramda';\n\nimport StandardFont from './standardFont';\n\nconst fontCache = {};\n\nconst IGNORED_CODE_POINTS = [173];\n\nconst getFontSize = pathOr(12, ['attributes', 'fontSize']);\n\nconst getFallbackFont = () => {\n return getOrCreateFont('Helvetica');\n};\n\nconst getOrCreateFont = name => {\n if (fontCache[name]) return fontCache[name];\n\n const font = new StandardFont(name);\n fontCache[name] = font;\n\n return font;\n};\n\nconst shouldFallbackToFont = (codePoint, font) => {\n return (\n !IGNORED_CODE_POINTS.includes(codePoint) &&\n !font.hasGlyphForCodePoint(codePoint) &&\n getFallbackFont().hasGlyphForCodePoint(codePoint)\n );\n};\n\nconst fontSubstitution = () => ({ string, runs }) => {\n let lastFont = null;\n let lastIndex = 0;\n let index = 0;\n\n const res = [];\n\n for (const run of runs) {\n const fontSize = getFontSize(run);\n const defaultFont =\n typeof run.attributes.font === 'string'\n ? getOrCreateFont(run.attributes.font)\n : run.attributes.font;\n\n if (string.length === 0) {\n res.push({ start: 0, end: 0, attributes: { font: defaultFont } });\n break;\n }\n\n for (const char of string.slice(run.start, run.end)) {\n const codePoint = char.codePointAt();\n const shouldFallback = shouldFallbackToFont(codePoint, defaultFont);\n const font = shouldFallback ? getFallbackFont() : defaultFont;\n\n // If the default font does not have a glyph and the fallback font does, we use it\n if (font !== lastFont) {\n if (lastFont) {\n res.push({\n start: lastIndex,\n end: index,\n attributes: {\n font: lastFont,\n scale: lastFont ? fontSize / lastFont.unitsPerEm : 0,\n },\n });\n }\n\n lastFont = font;\n lastIndex = index;\n }\n\n index += char.length;\n }\n }\n\n if (lastIndex < string.length) {\n const fontSize = getFontSize(last(runs));\n\n res.push({\n start: lastIndex,\n end: string.length,\n attributes: {\n font: lastFont,\n scale: lastFont ? fontSize / lastFont.unitsPerEm : 0,\n },\n });\n }\n\n return { string, runs: res };\n};\n\nexport default fontSubstitution;\n","import layoutEngine from '@react-pdf/textkit/layout';\nimport linebreaker from '@react-pdf/textkit/engines/linebreaker';\nimport justification from '@react-pdf/textkit/engines/justification';\nimport textDecoration from '@react-pdf/textkit/engines/textDecoration';\nimport scriptItemizer from '@react-pdf/textkit/engines/scriptItemizer';\nimport wordHyphenation from '@react-pdf/textkit/engines/wordHyphenation';\n\nimport fontSubstitution from './fontSubstitution';\n\nconst engines = {\n linebreaker,\n justification,\n textDecoration,\n scriptItemizer,\n wordHyphenation,\n fontSubstitution,\n};\n\nconst engine = layoutEngine(engines);\n\nexport default engine;\n","const PROTOCOL_REGEXP = /^([a-z]+\\:(\\/\\/)?)/i;\n\nexport const getURL = value => {\n if (!value) return '';\n\n if (typeof value === 'string' && !value.match(PROTOCOL_REGEXP)) {\n return `http://${value}`;\n }\n\n return value;\n};\n","import PNG from '@react-pdf/png-js';\n\nPNG.isValid = function(data) {\n try {\n return !!new PNG(data);\n } catch (e) {\n return false;\n }\n};\n\nexport default PNG;\n","// Extracted from https://github.com/devongovett/pdfkit/blob/master/lib/image/jpeg.coffee\n\nconst MARKERS = [\n 0xffc0,\n 0xffc1,\n 0xffc2,\n 0xffc3,\n 0xffc5,\n 0xffc6,\n 0xffc7,\n 0xffc8,\n 0xffc9,\n 0xffca,\n 0xffcb,\n 0xffcc,\n 0xffcd,\n 0xffce,\n 0xffcf,\n];\n\nclass JPEG {\n data = null;\n width = null;\n height = null;\n\n constructor(data) {\n this.data = data;\n\n if (data.readUInt16BE(0) !== 0xffd8) {\n throw new Error('SOI not found in JPEG');\n }\n\n let marker;\n let pos = 2;\n\n while (pos < data.length) {\n marker = data.readUInt16BE(pos);\n pos += 2;\n if (MARKERS.includes(marker)) {\n break;\n }\n pos += data.readUInt16BE(pos);\n }\n\n if (!MARKERS.includes(marker)) {\n throw new Error('Invalid JPEG.');\n }\n\n pos += 3;\n this.height = data.readUInt16BE(pos);\n\n pos += 2;\n this.width = data.readUInt16BE(pos);\n }\n}\n\nJPEG.isValid = function(data) {\n if (!data || !Buffer.isBuffer(data) || data.readUInt16BE(0) !== 0xffd8) {\n return false;\n }\n\n let marker;\n let pos = 2;\n\n while (pos < data.length) {\n marker = data.readUInt16BE(pos);\n pos += 2;\n if (MARKERS.includes(marker)) {\n break;\n }\n pos += data.readUInt16BE(pos);\n }\n\n if (!MARKERS.includes(marker)) {\n return false;\n }\n\n return true;\n};\n\nexport default JPEG;\n","const createCache = ({ limit = 100 } = {}) => {\n let cache = {};\n let keys = [];\n\n return {\n get: key => cache[key],\n set: (key, value) => {\n keys.push(key);\n if (keys.length > limit) {\n delete cache[keys.shift()];\n }\n cache[key] = value;\n },\n reset: () => {\n cache = {};\n keys = [];\n },\n length: () => keys.length,\n };\n};\n\nexport default createCache;\n","import fs from 'fs';\nimport url from 'url';\nimport path from 'path';\nimport fetch from 'cross-fetch';\n\nimport PNG from './png';\nimport JPEG from './jpeg';\nimport createCache from './cache';\n\nexport const IMAGE_CACHE = createCache({ limit: 30 });\n\nexport const getAbsoluteLocalPath = src => {\n if (BROWSER) {\n throw new Error('Cannot check local paths in client-side environment');\n }\n\n const { protocol, auth, host, port, hostname, path: pathname } = url.parse(\n src,\n );\n const absolutePath = path.resolve(pathname);\n if ((protocol && protocol !== 'file:') || auth || host || port || hostname) {\n return undefined;\n }\n return absolutePath;\n};\n\nexport const isDangerousLocalPath = (\n filename,\n { safePath = './public' } = {},\n) => {\n if (BROWSER) {\n throw new Error(\n 'Cannot check dangerous local path in client-side environemnt',\n );\n }\n const absoluteSafePath = path.resolve(safePath);\n const absoluteFilePath = path.resolve(filename);\n return !absoluteFilePath.startsWith(absoluteSafePath);\n};\n\nconst fetchLocalFile = (src, { safePath, allowDangerousPaths = false } = {}) =>\n new Promise((resolve, reject) => {\n try {\n if (BROWSER) {\n return reject(new Error('Cannot fetch local file in this environemnt'));\n }\n const absolutePath = getAbsoluteLocalPath(src);\n if (!absolutePath) {\n return reject(new Error(`Cannot fetch non-local path: ${src}`));\n }\n if (\n !allowDangerousPaths &&\n isDangerousLocalPath(absolutePath, { safePath })\n ) {\n return reject(new Error(`Cannot fetch dangerous local path: ${src}`));\n }\n fs.readFile(absolutePath, (err, data) =>\n err ? reject(err) : resolve(data),\n );\n } catch (err) {\n reject(err);\n }\n });\n\nconst fetchRemoteFile = async (uri, options) => {\n const response = await fetch(uri, options);\n\n const buffer = await (response.buffer\n ? response.buffer()\n : response.arrayBuffer());\n\n return buffer.constructor.name === 'Buffer' ? buffer : Buffer.from(buffer);\n};\n\nconst isValidFormat = format => {\n const lower = format.toLowerCase();\n return lower === 'jpg' || lower === 'jpeg' || lower === 'png';\n};\n\nconst guessFormat = buffer => {\n let format;\n\n if (JPEG.isValid(buffer)) {\n format = 'jpg';\n } else if (PNG.isValid(buffer)) {\n format = 'png';\n }\n\n return format;\n};\n\nconst isCompatibleBase64 = ({ uri }) =>\n /^data:image\\/[a-zA-Z]*;base64,[^\"]*/g.test(uri);\n\nfunction getImage(body, extension) {\n switch (extension.toLowerCase()) {\n case 'jpg':\n case 'jpeg':\n return new JPEG(body);\n case 'png':\n return new PNG(body);\n default:\n return null;\n }\n}\n\nconst resolveBase64Image = ({ uri }) => {\n const match = /^data:image\\/([a-zA-Z]*);base64,([^\"]*)/g.exec(uri);\n const format = match[1];\n const data = match[2];\n\n if (!isValidFormat(format)) {\n throw new Error(`Base64 image invalid format: ${format}`);\n }\n\n return new Promise(resolve => {\n return resolve(getImage(Buffer.from(data, 'base64'), format));\n });\n};\n\nconst resolveImageFromData = src => {\n if (src.data && src.format) {\n return new Promise(resolve => resolve(getImage(src.data, src.format)));\n }\n\n throw new Error(`Invalid data given for local file: ${JSON.stringify(src)}`);\n};\n\nconst resolveBufferImage = buffer => {\n const format = guessFormat(buffer);\n\n if (format) {\n return new Promise(resolve => resolve(getImage(buffer, format)));\n }\n};\n\nconst getImageFormat = body => {\n const isPng =\n body[0] === 137 &&\n body[1] === 80 &&\n body[2] === 78 &&\n body[3] === 71 &&\n body[4] === 13 &&\n body[5] === 10 &&\n body[6] === 26 &&\n body[7] === 10;\n\n const isJpg = body[0] === 255 && body[1] === 216 && body[2] === 255;\n\n let extension = '';\n if (isPng) {\n extension = 'png';\n } else if (isJpg) {\n extension = 'jpg';\n } else {\n throw new Error('Not valid image extension');\n }\n\n return extension;\n};\n\nconst resolveImageFromUrl = async (src, options) => {\n const { uri, body, headers, method = 'GET' } = src;\n\n const data =\n !BROWSER && getAbsoluteLocalPath(uri)\n ? await fetchLocalFile(uri, options)\n : await fetchRemoteFile(uri, { body, headers, method });\n\n const extension = getImageFormat(data);\n\n return getImage(data, extension);\n};\n\nexport const resolveImage = (src, { cache = true, ...options } = {}) => {\n const cacheKey = src.data ? src.data.toString() : src.uri;\n\n if (cache && IMAGE_CACHE.get(cacheKey)) {\n return IMAGE_CACHE.get(cacheKey);\n }\n\n let image;\n if (isCompatibleBase64(src)) {\n image = resolveBase64Image(src);\n } else if (Buffer.isBuffer(src)) {\n image = resolveBufferImage(src);\n } else if (typeof src === 'object' && src.data) {\n image = resolveImageFromData(src);\n } else {\n image = resolveImageFromUrl(src, options);\n }\n\n if (!image) {\n throw new Error('Cannot resolve image');\n }\n\n if (cache) {\n IMAGE_CACHE.set(cacheKey, image);\n }\n\n return image;\n};\n","/* eslint-disable no-cond-assign */\nimport emojiRegex from 'emoji-regex';\nimport Font from '../font';\nimport { resolveImage } from '../utils/image';\n\n// Caches emoji images data\nconst emojis = {};\nconst regex = emojiRegex();\n\nconst reflect = promise => (...args) => promise(...args).then(v => v, e => e);\n\n// Returns a function to be able to mock resolveImage.\nconst makeFetchEmojiImage = () => reflect(resolveImage);\n\n/**\n * When an emoji as no color, it might still have 2 parts,\n * the canonical emoji and an empty string.\n * ex.\n * (no color) Array.from('❤️') => [\"❤\", \"️\"]\n * (w/ color) Array.from('👍🏿') => [\"👍\", \"🏿\"]\n *\n * The empty string needs to be removed otherwise the generated\n * url will be incorect.\n */\nconst _removeNoColor = x => x !== '️';\n\nconst getCodePoints = string =>\n Array.from(string)\n .filter(_removeNoColor)\n .map(char => char.codePointAt(0).toString(16))\n .join('-');\n\nconst buildEmojiUrl = emoji => {\n const { url, format } = Font.getEmojiSource();\n return `${url}${getCodePoints(emoji)}.${format}`;\n};\n\nexport const fetchEmojis = string => {\n const emojiSource = Font.getEmojiSource();\n\n if (!emojiSource || !emojiSource.url) return [];\n\n const promises = [];\n\n let match;\n while ((match = regex.exec(string))) {\n const emoji = match[0];\n\n if (!emojis[emoji] || emojis[emoji].loading) {\n const emojiUrl = buildEmojiUrl(emoji);\n\n emojis[emoji] = { loading: true };\n const fetchEmojiImage = makeFetchEmojiImage();\n promises.push(\n fetchEmojiImage({ uri: emojiUrl }).then(image => {\n emojis[emoji].loading = false;\n emojis[emoji].data = image.data;\n }),\n );\n }\n }\n\n return promises;\n};\n\nexport const embedEmojis = fragments => {\n const result = [];\n\n for (let i = 0; i < fragments.length; i++) {\n const fragment = fragments[i];\n\n let match;\n let lastIndex = 0;\n\n while ((match = regex.exec(fragment.string))) {\n const index = match.index;\n const emoji = match[0];\n const emojiSize = fragment.attributes.fontSize;\n const chunk = fragment.string.slice(lastIndex, index + match[0].length);\n\n // If emoji image was found, we create a new fragment with the\n // correct attachment and object substitution character;\n if (emojis[emoji] && emojis[emoji].data) {\n result.push({\n string: chunk.replace(match, String.fromCharCode(0xfffc)),\n attributes: {\n ...fragment.attributes,\n attachment: {\n width: emojiSize,\n height: emojiSize,\n yOffset: Math.floor(emojiSize * 0.1),\n image: emojis[emoji].data,\n },\n },\n });\n } else {\n // If no emoji data, we just replace the emoji with a nodef char\n result.push({\n string: chunk.replace(match, String.fromCharCode(0)),\n attributes: fragment.attributes,\n });\n }\n\n lastIndex = index + emoji.length;\n }\n\n if (lastIndex < fragment.string.length) {\n result.push({\n string: fragment.string.slice(lastIndex),\n attributes: fragment.attributes,\n });\n }\n }\n\n return result;\n};\n","const IGNORABLE_CODEPOINTS = [\n 8232, // LINE_SEPARATOR\n 8233, // PARAGRAPH_SEPARATOR\n];\n\nconst buildSubsetForFont = font =>\n IGNORABLE_CODEPOINTS.reduce((acc, codePoint) => {\n if (font.hasGlyphForCodePoint && font.hasGlyphForCodePoint(codePoint)) {\n return acc;\n }\n return [...acc, String.fromCharCode(codePoint)];\n }, []);\n\nexport const ignoreChars = fragments =>\n fragments.map(fragment => {\n const charSubset = buildSubsetForFont(fragment.attributes.font);\n const subsetRegex = new RegExp(charSubset.join('|'));\n\n return {\n string: fragment.string.replace(subsetRegex, ''),\n attributes: fragment.attributes,\n };\n });\n","import { isNil, propEq, prop, complement, compose } from 'ramda';\nimport AttributedString from '@react-pdf/textkit/attributedString';\n\nimport Font from '../font';\nimport { embedEmojis } from './emoji';\nimport { ignoreChars } from './ignorableChars';\n\nconst PREPROCESSORS = [ignoreChars, embedEmojis];\n\nconst capitalize = value => value.replace(/(^|\\s)\\S/g, l => l.toUpperCase());\n\nconst isImage = propEq('name', 'Image');\n\nconst isTextInstance = compose(\n complement(isNil),\n prop('value'),\n);\n\nconst transformText = (text, transformation) => {\n switch (transformation) {\n case 'uppercase':\n return text.toUpperCase();\n case 'lowercase':\n return text.toLowerCase();\n case 'capitalize':\n return capitalize(text);\n default:\n return text;\n }\n};\n\nexport const getFragments = instance => {\n if (!instance) return [{ string: '' }];\n\n let fragments = [];\n const {\n color = 'black',\n backgroundColor,\n fontFamily = 'Helvetica',\n fontWeight,\n fontStyle,\n fontSize = 18,\n textAlign = 'left',\n lineHeight,\n textDecoration,\n textDecorationColor,\n textDecorationStyle,\n textTransform,\n letterSpacing,\n textIndent,\n opacity,\n } = instance.style;\n\n const obj = Font.getFont({ fontFamily, fontWeight, fontStyle });\n const font = obj ? obj.data : fontFamily;\n const attributes = {\n font,\n color,\n opacity,\n fontSize,\n backgroundColor,\n align: textAlign,\n indent: textIndent,\n link: instance.src,\n characterSpacing: letterSpacing,\n underlineStyle: textDecorationStyle,\n underline: textDecoration === 'underline',\n underlineColor: textDecorationColor || color,\n strike: textDecoration === 'line-through',\n strikeStyle: textDecorationStyle,\n strikeColor: textDecorationColor || color,\n lineHeight: lineHeight ? lineHeight * fontSize : null,\n };\n\n instance.children.forEach(child => {\n if (isImage(child)) {\n fragments.push({\n string: String.fromCharCode(0xfffc),\n attributes: {\n ...attributes,\n attachment: {\n width: child.style.width || fontSize,\n height: child.style.height || fontSize,\n image: child.image.data,\n },\n },\n });\n } else if (isTextInstance(child)) {\n fragments.push({\n string: transformText(child.value, textTransform),\n attributes,\n });\n } else {\n if (child) {\n fragments.push(...getFragments(child));\n }\n }\n });\n\n for (const preprocessor of PREPROCESSORS) {\n fragments = preprocessor(fragments);\n }\n\n return fragments;\n};\n\nexport const getAttributedString = instance => {\n return AttributedString.fromFragments(getFragments(instance));\n};\n","import Yoga from 'yoga-layout';\nimport PDFRenderer from '@react-pdf/textkit/renderers/pdf';\nimport AttributedString from '@react-pdf/textkit/attributedString';\n\nimport Base from './Base';\nimport Font from '../font';\nimport layout from '../layout';\nimport { getURL } from '../utils/url';\nimport { getAttributedString } from '../utils/attributedString';\n\nclass Text extends Base {\n static defaultProps = {\n wrap: true,\n widows: 2,\n orphans: 2,\n };\n\n constructor(root, props) {\n super(root, props);\n\n this.start = 0;\n this.end = 0;\n\n this.blocks = null;\n this.computed = false;\n this.attributedString = null;\n this.layoutOptions = {\n hyphenationPenalty: props.hyphenationPenalty,\n hyphenationCallback: Font.getHyphenationCallback(),\n shrinkWhitespaceFactor: { before: -0.5, after: -0.5 },\n };\n\n this.layout.setMeasureFunc(this.measureText.bind(this));\n }\n\n get name() {\n return 'Text';\n }\n\n get src() {\n return getURL(this.props.src || this.props.href);\n }\n\n get lines() {\n if (!this.blocks) return [];\n\n return this.blocks\n .reduce((acc, block) => [...acc, ...block], [])\n .splice(this.start, this.end);\n }\n\n get linesHeight() {\n if (!this.blocks) return -1;\n return this.lines.reduce((acc, line) => acc + line.box.height, 0);\n }\n\n get linesWidth() {\n if (!this.blocks) return -1;\n return Math.max(\n ...this.lines.map(line => AttributedString.advanceWidth(line)),\n );\n }\n\n appendChild(child) {\n if (child) {\n child.parent = this;\n this.children.push(child);\n this.computed = false;\n this.attributedString = null;\n this.markDirty();\n }\n }\n\n removeChild(child) {\n const index = this.children.indexOf(child);\n\n if (index !== -1) {\n child.parent = null;\n this.children.splice(index, 1);\n this.computed = false;\n this.attributedString = null;\n this.markDirty();\n\n child.cleanup();\n }\n }\n\n lineIndexAtHeight(height) {\n let counter = 0;\n\n for (let i = 0; i < this.lines.length; i++) {\n const line = this.lines[i];\n if (counter + line.box.height > height) return i;\n counter += line.box.height;\n }\n\n return this.lines.length;\n }\n\n heightAtLineIndex(index) {\n let counter = 0;\n\n for (let i = 0; i < index; i++) {\n const line = this.lines[i];\n counter += line.box.height;\n }\n\n return counter;\n }\n\n layoutText(width, height) {\n this.attributedString = getAttributedString(this);\n\n // Text layout is expensive. That's why we ensure to only do it once\n // (except dynamic nodes. Those change content and needs to relayout every time)\n if (!this.blocks || this.props.render) {\n // Do the actual text layout.\n /// If height null or NaN, we take some liberty on layout height\n const container = {\n x: 0,\n y: 0,\n width,\n height: height || Infinity,\n maxLines: this.style.maxLines,\n truncateMode: this.style.textOverflow,\n };\n this.blocks = layout(\n this.attributedString,\n container,\n this.layoutOptions,\n );\n }\n\n // Get the total amount of rendered lines\n const linesCount = this.blocks.reduce((acc, b) => acc + b.length, 0);\n\n this.end = linesCount + 1;\n this.computed = true;\n }\n\n measureText(width, widthMode, height, heightMode) {\n if (widthMode === Yoga.MEASURE_MODE_EXACTLY) {\n this.layoutText(width, height);\n\n return { height: this.linesHeight };\n }\n\n if (widthMode === Yoga.MEASURE_MODE_AT_MOST) {\n this.layoutText(width, height);\n\n return {\n height: this.linesHeight,\n width: Math.min(width, this.linesWidth),\n };\n }\n\n return {};\n }\n\n resolveStyles() {\n const styles = super.resolveStyles();\n\n // Inherit relative positioning for inline childs\n if (\n this.parent &&\n this.parent.name === 'Text' &&\n this.parent.style.position === 'relative'\n ) {\n styles.top = styles.top || this.parent.style.top;\n styles.bottom = styles.bottom || this.parent.style.bottom;\n styles.position = styles.position || 'relative';\n }\n\n // Apply default link styles\n if (this.src) {\n styles.color = styles.color || 'blue';\n styles.textDecoration = styles.textDecoration || 'underline';\n }\n\n return styles;\n }\n\n wrapHeight(height) {\n const { orphans, widows } = this.props;\n const linesQuantity = this.lines.length;\n const sliceHeight = height - this.paddingTop;\n const slicedLine = this.lineIndexAtHeight(sliceHeight);\n\n if (linesQuantity < orphans) {\n return height;\n } else if (slicedLine < orphans || linesQuantity < orphans + widows) {\n return 0;\n } else if (linesQuantity === orphans + widows) {\n return this.heightAtLineIndex(orphans);\n } else if (linesQuantity - slicedLine < widows) {\n return height - this.heightAtLineIndex(widows - 1);\n }\n\n return height;\n }\n\n onNodeSplit(height, clone) {\n const wrapHeight = this.wrapHeight(height);\n const slicedLineIndex = this.lineIndexAtHeight(wrapHeight);\n\n clone.marginTop = 0;\n clone.paddingTop = 0;\n clone.start = slicedLineIndex;\n clone.attributedString = this.attributedString;\n\n this.height = wrapHeight;\n this.marginBottom = 0;\n this.paddingBottom = 0;\n this.end = slicedLineIndex;\n }\n\n clone() {\n const text = super.clone();\n\n text.layoutEngine = this.layoutEngine;\n\n // Save calculated layout for non-dynamic clone elements\n if (this.blocks && !this.props.render) {\n text.blocks = [...this.blocks];\n }\n\n return text;\n }\n\n renderText() {\n const { top, left } = this.getAbsoluteLayout();\n const initialY = this.lines[0] ? this.lines[0].box.y : 0;\n\n // We translate lines based on Yoga container\n this.root.instance.save();\n this.root.instance.translate(\n left + this.padding.left,\n top + this.padding.top - initialY,\n );\n\n // Perform actual text rendering on document\n PDFRenderer.render(this.root.instance, [this.lines]);\n\n this.root.instance.restore();\n }\n\n async render() {\n this.root.instance.save();\n this.applyTransformations();\n this.drawBackgroundColor();\n this.drawBorders();\n\n // Calculate text layout if needed\n // This can happen if measureText was not called by Yoga\n if (!this.computed) {\n this.layoutText(\n this.width - this.padding.left - this.padding.right,\n this.height - this.padding.top - this.padding.bottom,\n );\n }\n\n this.renderText();\n\n if (this.props.debug) {\n this.debug();\n }\n\n this.root.instance.restore();\n }\n}\n\nexport default Text;\n","import Base from './Base';\nimport { getURL } from '../utils/url';\n\nclass Link extends Base {\n get name() {\n return 'Link';\n }\n\n get src() {\n return getURL(this.props.src || this.props.href);\n }\n\n async render() {\n const { top, left, width, height } = this.getAbsoluteLayout();\n this.root.instance.link(left, top, width, height, this.src);\n await this.renderChildren();\n if (this.props.debug) this.debug();\n }\n}\n\nexport default Link;\n","import Base from './Base';\n\nclass Note extends Base {\n static defaultProps = {};\n\n get name() {\n return 'Note';\n }\n\n appendChild(child) {\n if (child.name !== 'TextInstance') {\n throw new Error('Note only accepts string children');\n }\n\n if (child) {\n child.parent = this;\n this.children.push(child);\n }\n }\n\n removeChild(child) {\n const index = this.children.indexOf(child);\n\n if (index !== -1) {\n child.parent = null;\n this.children.splice(index, 1);\n }\n\n child.cleanup();\n }\n\n applyProps() {\n super.applyProps();\n this.height = 0;\n this.width = 0;\n }\n\n async render() {\n const { top, left } = this.getAbsoluteLayout();\n const value = this.children[0] ? this.children[0].value : '';\n\n this.root.instance.note(left, top, 0, 0, value);\n }\n}\n\nexport default Note;\n","import matchPercent from './matchPercent';\n\nconst isNumeric = n => {\n return !isNaN(parseFloat(n)) && isFinite(n);\n};\n\nconst applyContainObjectFit = (cw, ch, iw, ih, px, py) => {\n const cr = cw / ch;\n const ir = iw / ih;\n\n const pxp = matchPercent(px);\n const pyp = matchPercent(py);\n const pxv = pxp ? pxp.percent : 0.5;\n const pyv = pyp ? pyp.percent : 0.5;\n\n if (cr > ir) {\n const height = ch;\n const width = height * ir;\n const yOffset = isNumeric(py) ? py : 0;\n const xOffset = isNumeric(px) ? px : (cw - width) * pxv;\n\n return { width, height, xOffset, yOffset };\n } else {\n const width = cw;\n const height = width / ir;\n const xOffset = isNumeric(px) ? px : 0;\n const yOffset = isNumeric(py) ? py : (ch - height) * pyv;\n\n return { width, height, yOffset, xOffset };\n }\n};\n\nconst applyNoneObjectFit = (cw, ch, iw, ih, px, py) => {\n const width = iw;\n const height = ih;\n const pxp = matchPercent(px);\n const pyp = matchPercent(py);\n const pxv = pxp ? pxp.percent : 0.5;\n const pyv = pyp ? pyp.percent : 0.5;\n const xOffset = isNumeric(px) ? px : (cw - width) * pxv;\n const yOffset = isNumeric(py) ? py : (ch - height) * pyv;\n\n return { width, height, xOffset, yOffset };\n};\n\nconst applyCoverObjectFit = (cw, ch, iw, ih, px, py) => {\n const ir = iw / ih;\n const cr = cw / ch;\n\n const pxp = matchPercent(px);\n const pyp = matchPercent(py);\n const pxv = pxp ? pxp.percent : 0.5;\n const pyv = pyp ? pyp.percent : 0.5;\n\n if (cr > ir) {\n const width = cw;\n const height = width / ir;\n const xOffset = isNumeric(px) ? px : 0;\n const yOffset = isNumeric(py) ? py : (ch - height) * pyv;\n return { width, height, yOffset, xOffset };\n } else {\n const height = ch;\n const width = height * ir;\n const xOffset = isNumeric(px) ? px : (cw - width) * pxv;\n const yOffset = isNumeric(py) ? py : 0;\n return { width, height, xOffset, yOffset };\n }\n};\n\nconst applyScaleDownObjectFit = (cw, ch, iw, ih, px, py) => {\n const containDimension = applyContainObjectFit(cw, ch, iw, ih, px, py);\n const noneDimension = applyNoneObjectFit(cw, ch, iw, ih, px, py);\n\n return containDimension.width < noneDimension.width\n ? containDimension\n : noneDimension;\n};\n\nconst applyFillObjectFit = (cw, ch, px, py) => {\n return {\n width: cw,\n height: ch,\n xOffset: matchPercent(px) ? 0 : px || 0,\n yOffset: matchPercent(py) ? 0 : py || 0,\n };\n};\n\nexport const resolveObjectFit = (type = 'fill', cw, ch, iw, ih, px, py) => {\n switch (type) {\n case 'contain':\n return applyContainObjectFit(cw, ch, iw, ih, px, py);\n case 'cover':\n return applyCoverObjectFit(cw, ch, iw, ih, px, py);\n case 'none':\n return applyNoneObjectFit(cw, ch, iw, ih, px, py);\n case 'scale-down':\n return applyScaleDownObjectFit(cw, ch, iw, ih, px, py);\n default:\n return applyFillObjectFit(cw, ch, px, py);\n }\n};\n","import Yoga from 'yoga-layout';\n\nimport Base from './Base';\nimport warning from '../utils/warning';\nimport { resolveImage } from '../utils/image';\nimport { resolveObjectFit } from '../utils/objectFit';\n\nconst SAFETY_HEIGHT = 10;\n\nclass Image extends Base {\n static defaultProps = {\n wrap: false,\n cache: true,\n style: {},\n };\n\n constructor(root, props) {\n super(root, props);\n\n this.image = null;\n this.layout.setMeasureFunc(this.measureImage.bind(this));\n }\n\n get name() {\n return 'Image';\n }\n\n shouldGrow() {\n return !!this.style.flexGrow;\n }\n\n measureImage(width, widthMode, height, heightMode) {\n const imageMargin = this.margin;\n const pagePadding = this.page.padding;\n const pageArea = this.page.isAutoHeight\n ? Infinity\n : this.page.size.height -\n pagePadding.top -\n pagePadding.bottom -\n imageMargin.top -\n imageMargin.bottom -\n SAFETY_HEIGHT;\n\n // Skip measure if image data not present yet\n if (!this.image) return { width: 0, height: 0 };\n\n if (\n widthMode === Yoga.MEASURE_MODE_EXACTLY &&\n heightMode === Yoga.MEASURE_MODE_UNDEFINED\n ) {\n const scaledHeight = width / this.ratio;\n return { height: Math.min(pageArea, scaledHeight) };\n }\n\n if (\n heightMode === Yoga.MEASURE_MODE_EXACTLY &&\n (widthMode === Yoga.MEASURE_MODE_AT_MOST ||\n widthMode === Yoga.MEASURE_MODE_UNDEFINED)\n ) {\n return { width: Math.min(height * this.ratio, width) };\n }\n\n if (\n widthMode === Yoga.MEASURE_MODE_EXACTLY &&\n heightMode === Yoga.MEASURE_MODE_AT_MOST\n ) {\n const scaledHeight = width / this.ratio;\n return { height: Math.min(height, pageArea, scaledHeight) };\n }\n\n if (\n widthMode === Yoga.MEASURE_MODE_AT_MOST &&\n heightMode === Yoga.MEASURE_MODE_AT_MOST\n ) {\n if (this.ratio > 1) {\n return {\n width: width,\n height: Math.min(width / this.ratio, height),\n };\n } else {\n return {\n width: Math.min(height * this.ratio, width),\n height: height,\n };\n }\n }\n\n return { height, width };\n }\n\n get ratio() {\n return this.image.data ? this.image.width / this.image.height : 1;\n }\n\n get src() {\n const src = this.props.src || this.props.source;\n return typeof src === 'string' ? { uri: src } : src;\n }\n\n async fetch() {\n const { cache, safePath, allowDangerousPaths } = this.props;\n\n if (!this.src) {\n warning(false, 'Image should receive either a \"src\" or \"source\" prop');\n return;\n }\n\n try {\n this.image = await resolveImage(this.src, {\n cache,\n safePath,\n allowDangerousPaths,\n });\n } catch (e) {\n this.image = { width: 0, height: 0 };\n console.warn(e.message);\n }\n }\n\n clone() {\n const clone = super.clone();\n clone.image = this.image;\n return clone;\n }\n\n async onAppendDynamically() {\n await this.fetch();\n }\n\n renderImage() {\n const padding = this.padding;\n const { left, top } = this.getAbsoluteLayout();\n const { opacity, objectPositionX, objectPositionY } = this.style;\n\n this.root.instance.save();\n\n // Clip path to keep image inside border radius\n this.clip();\n\n if (this.image.data) {\n const { width, height, xOffset, yOffset } = resolveObjectFit(\n this.style.objectFit,\n this.width - padding.left - padding.right,\n this.height - padding.top - padding.bottom,\n this.image.width,\n this.image.height,\n objectPositionX,\n objectPositionY,\n );\n\n if (width !== 0 && height !== 0) {\n this.root.instance\n .fillOpacity(opacity)\n .image(\n this.image.data,\n left + padding.left + xOffset,\n top + padding.top + yOffset,\n { width, height },\n );\n } else {\n warning(\n false,\n `Image with src '${\n this.props.src\n }' skipped due to invalid dimensions`,\n );\n }\n }\n\n this.root.instance.restore();\n }\n\n async render() {\n this.root.instance.save();\n this.applyTransformations();\n this.drawBackgroundColor();\n this.renderImage();\n this.drawBorders();\n\n if (this.props.debug) {\n this.debug();\n }\n\n this.root.instance.restore();\n }\n}\n\nexport default Image;\n","import wrapPages from 'page-wrapping';\n\nimport Font from '../font';\nimport { fetchEmojis } from '../utils/emoji';\n\nclass Document {\n static defaultProps = {\n author: null,\n keywords: null,\n subject: null,\n title: null,\n };\n\n constructor(root, props) {\n this.root = root;\n this.style = {};\n this.props = props;\n this.children = [];\n this.subpages = [];\n }\n\n get name() {\n return 'Document';\n }\n\n appendChild(child) {\n child.parent = this;\n this.children.push(child);\n }\n\n removeChild(child) {\n const index = this.children.indexOf(child);\n\n if (index !== -1) {\n child.parent = null;\n this.children.splice(index, 1);\n }\n\n child.cleanup();\n }\n\n addMetaData() {\n const { title, author, subject, keywords, creator, producer } = this.props;\n\n // The object keys need to start with a capital letter by the PDF spec\n if (title) this.root.instance.info.Title = title;\n if (author) this.root.instance.info.Author = author;\n if (subject) this.root.instance.info.Subject = subject;\n if (keywords) this.root.instance.info.Keywords = keywords;\n\n this.root.instance.info.Creator = creator || 'react-pdf';\n this.root.instance.info.Producer = producer || 'react-pdf';\n }\n\n async loadFonts() {\n const promises = [];\n const listToExplore = this.children.slice(0);\n\n while (listToExplore.length > 0) {\n const node = listToExplore.shift();\n\n if (node.style && node.style.fontFamily) {\n promises.push(Font.load(node.style, this.root.instance));\n }\n\n if (node.children) {\n node.children.forEach(childNode => {\n listToExplore.push(childNode);\n });\n }\n }\n\n await Promise.all(promises);\n }\n\n async loadEmojis() {\n const promises = [];\n const listToExplore = this.children.slice(0);\n\n while (listToExplore.length > 0) {\n const node = listToExplore.shift();\n\n if (typeof node === 'string') {\n promises.push(...fetchEmojis(node));\n } else if (typeof node.value === 'string') {\n promises.push(...fetchEmojis(node.value));\n } else if (node.children) {\n node.children.forEach(childNode => {\n listToExplore.push(childNode);\n });\n }\n }\n\n await Promise.all(promises);\n }\n\n async loadImages() {\n const promises = [];\n const listToExplore = this.children.slice(0);\n\n while (listToExplore.length > 0) {\n const node = listToExplore.shift();\n\n if (node.name === 'Image') {\n promises.push(node.fetch());\n }\n\n if (node.children) {\n node.children.forEach(childNode => {\n listToExplore.push(childNode);\n });\n }\n }\n\n await Promise.all(promises);\n }\n\n async loadAssets() {\n await Promise.all([this.loadFonts(), this.loadImages(), this.loadEmojis()]);\n }\n\n applyProps() {\n this.children.forEach(child => child.applyProps());\n }\n\n update(newProps) {\n this.props = newProps;\n }\n\n cleanup() {\n this.subpages.forEach(p => p.cleanup());\n }\n\n finish() {\n this.children.forEach(c => c.cleanup());\n }\n\n getLayoutData() {\n return {\n type: this.name,\n children: this.subpages.map(c => c.getLayoutData()),\n };\n }\n\n async wrapPages() {\n let pageCount = 1;\n const pages = [];\n\n for (const page of this.children) {\n if (page.wrap) {\n const wrapArea = page.isAutoHeight\n ? Infinity\n : page.size.height - (page.style.paddingBottom || 0);\n\n const subpages = await wrapPages(page, wrapArea, pageCount);\n\n pageCount += subpages.length;\n\n pages.push(...subpages);\n } else {\n pages.push(page);\n }\n }\n\n return pages;\n }\n\n async renderPages() {\n this.subpages = await this.wrapPages();\n\n for (let j = 0; j < this.subpages.length; j++) {\n // Update dynamic text nodes with total pages info\n this.subpages[j].renderDynamicNodes(\n {\n pageNumber: j + 1,\n totalPages: this.subpages.length,\n },\n node => node.name === 'Text',\n );\n await this.subpages[j].render();\n }\n\n return this.subpages;\n }\n\n async render() {\n try {\n this.addMetaData();\n this.applyProps();\n await this.loadAssets();\n await this.renderPages();\n this.root.instance.end();\n Font.reset();\n } catch (e) {\n throw e;\n }\n }\n}\n\nexport default Document;\n","export const availableMethods = [\n 'dash',\n 'clip',\n 'save',\n 'path',\n 'fill',\n 'font',\n 'text',\n 'rect',\n 'scale',\n 'moveTo',\n 'lineTo',\n 'stroke',\n 'rotate',\n 'circle',\n 'lineCap',\n 'opacity',\n 'ellipse',\n 'polygon',\n 'restore',\n 'lineJoin',\n 'fontSize',\n 'fillColor',\n 'lineWidth',\n 'translate',\n 'miterLimit',\n 'strokeColor',\n 'fillOpacity',\n 'roundedRect',\n 'strokeOpacity',\n 'bezierCurveTo',\n 'quadraticCurveTo',\n 'linearGradient',\n 'radialGradient',\n 'closePath',\n 'transform',\n 'fillAndStroke',\n '_registeredFonts',\n];\n\nconst painter = function(instance) {\n // just pass through...\n return instance;\n};\n\nexport default painter;\n","import Base from './Base';\n\nimport painter from '../utils/painter';\nimport warning from '../utils/warning';\n\nclass Canvas extends Base {\n static defaultProps = {\n style: {},\n wrap: false,\n };\n\n get name() {\n return 'Canvas';\n }\n\n async render() {\n const { left, top, width, height } = this.getAbsoluteLayout();\n\n const availableWidth = width - this.paddingLeft - this.paddingRight;\n const availableHeight = height - this.paddingTop - this.paddingBottom;\n\n warning(\n availableWidth && availableHeight,\n 'Canvas element has null width or height. Please provide valid values via the `style` prop in order to correctly render it.',\n );\n\n this.root.instance.save();\n this.applyTransformations();\n this.drawBackgroundColor();\n this.drawBorders();\n this.clip();\n\n this.root.instance.translate(\n left + this.paddingLeft,\n top + this.paddingTop,\n );\n\n if (this.props.paint) {\n this.props.paint(\n painter(this.root.instance),\n availableWidth,\n availableHeight,\n );\n }\n\n this.root.instance.restore();\n\n if (this.props.debug) {\n this.debug();\n }\n }\n}\n\nexport default Canvas;\n","import Root from './Root';\nimport Page from './Page';\nimport View from './View';\nimport Text from './Text';\nimport Link from './Link';\nimport Note from './Note';\nimport Image from './Image';\nimport Document from './Document';\nimport Canvas from './Canvas';\nimport TextInstance from './TextInstance';\n\nconst constructors = {\n ROOT: Root,\n PAGE: Page,\n TEXT: Text,\n LINK: Link,\n VIEW: View,\n NOTE: Note,\n IMAGE: Image,\n CANVAS: Canvas,\n DOCUMENT: Document,\n TEXT_INSTANCE: TextInstance,\n};\n\nfunction createInstance(element, root) {\n const { type, props = {} } = element;\n\n if (constructors[type]) {\n return new constructors[type](root, props);\n }\n\n throw new Error(`Invalid element of type ${type} passed to PDF renderer`);\n}\n\nexport { createInstance };\n","const propsEqual = (a, b) => {\n const oldPropsKeys = Object.keys(a);\n const newPropsKeys = Object.keys(b);\n\n if (oldPropsKeys.length !== newPropsKeys.length) {\n return false;\n }\n\n for (let i = 0; i < oldPropsKeys.length; i++) {\n const propName = oldPropsKeys[i];\n\n if (propName === 'render') {\n if (!a[propName] !== !b[propName]) {\n return false;\n }\n continue;\n }\n\n if (propName !== 'children' && a[propName] !== b[propName]) {\n if (\n typeof a[propName] === 'object' &&\n typeof b[propName] === 'object' &&\n propsEqual(a[propName], b[propName])\n ) {\n continue;\n }\n\n return false;\n }\n\n if (\n propName === 'children' &&\n (typeof a[propName] === 'string' || typeof b[propName] === 'string')\n ) {\n return a[propName] === b[propName];\n }\n }\n\n return true;\n};\n\nexport default propsEqual;\n","'use strict';\n\nimport ReactFiberReconciler from 'react-reconciler';\nimport {\n unstable_scheduleCallback as schedulePassiveEffects,\n unstable_cancelCallback as cancelPassiveEffects\n} from 'scheduler';\n\nimport { createInstance } from './elements';\nimport propsEqual from './utils/propsEqual';\n\nconst emptyObject = {};\n\n// If the Link has a strign child or render prop, substitute the instance by a Text,\n// that will ultimately render the inline Link via the textkit PDF renderer.\nconst shouldReplaceLink = (type, props) =>\n type === 'LINK' &&\n (typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n Array.isArray(props.children) ||\n props.render);\n\nconst PDFRenderer = ReactFiberReconciler({\n schedulePassiveEffects,\n cancelPassiveEffects,\n supportsMutation: true,\n appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n },\n\n createInstance(type, props, internalInstanceHandle) {\n const instanceType = shouldReplaceLink(type, props) ? 'TEXT' : type;\n return createInstance(\n { type: instanceType, props },\n internalInstanceHandle,\n );\n },\n\n createTextInstance(text, rootContainerInstance) {\n return createInstance(\n { type: 'TEXT_INSTANCE', props: text },\n rootContainerInstance,\n );\n },\n\n finalizeInitialChildren(element, type, props) {\n return false;\n },\n\n getPublicInstance(instance) {\n return instance;\n },\n\n prepareForCommit() {\n // Noop\n },\n\n prepareUpdate(element, type, oldProps, newProps) {\n return !propsEqual(oldProps, newProps);\n },\n\n resetAfterCommit() {\n // Noop\n },\n\n resetTextContent(element) {\n // Noop\n },\n\n getRootHostContext() {\n return emptyObject;\n },\n\n getChildHostContext() {\n return emptyObject;\n },\n\n shouldSetTextContent(type, props) {\n return false;\n },\n\n now: Date.now,\n\n useSyncScheduling: true,\n\n appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n },\n\n appendChildToContainer(parentInstance, child) {\n parentInstance.appendChild(child);\n },\n\n insertBefore(parentInstance, child, beforeChild) {\n parentInstance.appendChildBefore(child, beforeChild);\n },\n\n removeChild(parentInstance, child) {\n parentInstance.removeChild(child);\n },\n\n removeChildFromContainer(parentInstance, child) {\n parentInstance.removeChild(child);\n },\n\n commitTextUpdate(textInstance, oldText, newText) {\n textInstance.update(newText);\n },\n\n commitUpdate(instance, updatePayload, type, oldProps, newProps) {\n instance.update(newProps);\n },\n});\n\nexport default PDFRenderer;\n","import BlobStream from 'blob-stream';\nimport PDFRenderer from './renderer';\nimport StyleSheet from './stylesheet';\nimport { createInstance } from './elements';\nimport Font from './font';\nimport { version } from '../package.json';\n\nconst View = 'VIEW';\nconst Text = 'TEXT';\nconst Link = 'LINK';\nconst Page = 'PAGE';\nconst Note = 'NOTE';\nconst Image = 'IMAGE';\nconst Document = 'DOCUMENT';\nconst Canvas = 'CANVAS';\n\nconst pdf = input => {\n const container = createInstance({ type: 'ROOT' });\n const mountNode = PDFRenderer.createContainer(container);\n\n if (input) updateContainer(input);\n\n function callOnRender(params = {}) {\n if (container.document.props.onRender) {\n const layoutData = container.document.getLayoutData();\n container.document.props.onRender({ ...params, layoutData });\n }\n }\n\n function isDirty() {\n return container.isDirty;\n }\n\n function updateContainer(doc) {\n PDFRenderer.updateContainer(doc, mountNode, null);\n }\n\n async function toBlob() {\n await container.render();\n\n const stream = container.instance.pipe(BlobStream());\n\n return new Promise((resolve, reject) => {\n stream.on('finish', () => {\n try {\n const blob = stream.toBlob('application/pdf');\n\n callOnRender({ blob });\n\n resolve(blob);\n } catch (error) {\n reject(error);\n }\n });\n\n stream.on('error', reject);\n });\n }\n\n async function toBuffer() {\n await container.render();\n\n callOnRender();\n\n return container.instance;\n }\n\n function toString() {\n let result = '';\n container.render();\n\n return new Promise((resolve, reject) => {\n try {\n container.instance.on('data', function(buffer) {\n result += buffer;\n });\n\n container.instance.on('end', function() {\n callOnRender({ string: result });\n resolve(result);\n });\n } catch (error) {\n reject(error);\n }\n });\n }\n\n return {\n isDirty,\n container,\n updateContainer,\n toBuffer,\n toBlob,\n toString,\n };\n};\n\nexport {\n version,\n PDFRenderer,\n View,\n Text,\n Link,\n Page,\n Font,\n Note,\n Image,\n Document,\n Canvas,\n StyleSheet,\n createInstance,\n pdf,\n};\n","import fs from 'fs';\nimport {\n pdf,\n View,\n Text,\n Link,\n Page,\n Font,\n Note,\n Image,\n Canvas,\n version,\n Document,\n StyleSheet,\n PDFRenderer,\n createInstance,\n} from './index';\n\nexport const renderToStream = async function(element) {\n const instance = pdf(element);\n const buffer = await instance.toBuffer();\n instance.container.finish();\n return buffer;\n};\n\nexport const renderToFile = async function(element, filePath, callback) {\n const output = await renderToStream(element);\n const stream = fs.createWriteStream(filePath);\n\n output.pipe(stream);\n\n return new Promise((resolve, reject) => {\n stream.on('finish', () => {\n if (callback) callback(output, filePath);\n resolve(output);\n });\n stream.on('error', reject);\n });\n};\n\nconst throwEnvironmentError = name => {\n throw new Error(\n `${name} is a web specific API. Or you're either using this component on Node, or your bundler is not loading react-pdf from the appropiate web build.`,\n );\n};\n\nexport const PDFViewer = () => {\n throwEnvironmentError('PDFViewer');\n};\n\nexport const PDFDownloadLink = () => {\n throwEnvironmentError('PDFDownloadLink');\n};\n\nexport const BlobProvider = () => {\n throwEnvironmentError('BlobProvider');\n};\n\nexport const render = renderToFile;\n\nexport {\n pdf,\n View,\n Text,\n Link,\n Page,\n Font,\n Note,\n Image,\n Canvas,\n version,\n Document,\n StyleSheet,\n PDFRenderer,\n createInstance,\n} from './index';\n\nexport default {\n pdf,\n View,\n Text,\n Link,\n Page,\n Font,\n Note,\n Image,\n Canvas,\n version,\n Document,\n StyleSheet,\n PDFRenderer,\n PDFViewer,\n BlobProvider,\n PDFDownloadLink,\n createInstance,\n renderToStream,\n renderToFile,\n render,\n};\n"],"names":["Root","constructor","isDirty","document","instance","appendChild","child","removeChild","cleanup","markDirty","finish","PDFDocument","autoFirstPage","this","render","upperFirst","value","charAt","toUpperCase","slice","isPercent","exec","matchPercent","match","parseFloat","percent","absValue","Math","abs","absPercent","Node","parent","children","computed","layout","Yoga","createDefault","push","insertChild","getChildCount","appendChildBefore","beforeChild","index","indexOf","splice","removeAllChilds","i","length","remove","setDimension","attr","fixedMethod","percentMethod","setPosition","edge","setPositionPercent","setPadding","setPaddingPercent","setMargin","setMarginPercent","setBorder","Error","getAbsoluteLayout","parentLayout","left","top","height","width","copyStyle","node","calculateLayout","isEmpty","onAppendDynamically","forEach","c","unsetMeasureFunc","destroy","getPositionType","POSITION_TYPE_ABSOLUTE","getComputedTop","getComputedLeft","getComputedRight","getComputedBottom","getComputedWidth","getMinWidth","getMaxWidth","getComputedHeight","getMinHeight","getMaxHeight","getComputedPadding","EDGE_TOP","EDGE_RIGHT","EDGE_BOTTOM","EDGE_LEFT","getComputedMargin","getComputedBorder","paddingTop","right","paddingRight","bottom","paddingBottom","paddingLeft","marginTop","marginRight","marginBottom","marginLeft","setPositionType","POSITION_TYPE_RELATIVE","yogaValue","prop","isAlignType","ALIGN_AUTO","DISPLAY_FLEX","DISPLAY_NONE","FLEX_DIRECTION_ROW","FLEX_DIRECTION_ROW_REVERSE","FLEX_DIRECTION_COLUMN","FLEX_DIRECTION_COLUMN_REVERSE","ALIGN_STRETCH","ALIGN_BASELINE","JUSTIFY_SPACE_AROUND","ALIGN_SPACE_AROUND","JUSTIFY_SPACE_BETWEEN","ALIGN_SPACE_BETWEEN","WRAP_WRAP","WRAP_WRAP_REVERSE","WRAP_NO_WRAP","JUSTIFY_FLEX_START","ALIGN_FLEX_START","JUSTIFY_FLEX_END","ALIGN_FLEX_END","JUSTIFY_CENTER","ALIGN_CENTER","DPI","parseValue","unit","undefined","parseScalar","container","scalar","isAutoHeight","isBorderStyle","key","matchBorderShorthand","processBorders","isBoxModelStyle","matchBoxModel","processBoxModel","FONT_WEIGHTS","thin","hairline","ultralight","extralight","light","normal","medium","semibold","demibold","bold","ultrabold","extrabold","heavy","black","isFontWeightStyle","processFontWeight","toLowerCase","isObjectPositionStyle","matchObjectPosition","processObjectPosition","isTransformOriginStyle","matchTransformOrigin","transformOffsetKeywords","processTransformOrigin","result","hasOwnProperty","Object","prototype","styleShorthands","margin","marginHorizontal","marginVertical","padding","paddingHorizontal","paddingVertical","border","borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderStyle","borderWidth","objectPosition","objectPositionX","objectPositionY","transformOrigin","transformOriginX","transformOriginY","expandStyles","style","propsArray","keys","resolvedStyle","verticalAlign","expandedProps","propName","call","transformStyles","expandedStyles","resolved","create","styles","flatten","input","Array","isArray","reduce","acc","s","resolveMediaQueries","test","matchMedia","resolve","absoluteFillObject","position","hairlineWidth","Debug","debug","root","save","debugContent","debugPadding","debugMargin","debugText","debugOrigin","restore","transform","origin","circle","fill","stroke","roundedWidth","round","roundedHeight","fontSize","opacity","fillColor","text","max","rect","KAPPA","sqrt","drawBorders","rtr","min","rtl","rbr","rbl","strokeOpacity","clipBorderTop","fillBorderTop","clipBorderRight","fillBorderRight","clipBorderBottom","fillBorderBottom","clipBorderLeft","fillBorderLeft","ctx","moveTo","lineTo","c0","bezierCurveTo","topRightYCoord","innerTopRightRadiusX","innerTopRightRadiusY","c1","c2","innerTopLeftRadiusX","innerTopLeftRadiusY","c3","c4","topLeftYCoord","c5","closePath","clip","trSlope","strokeColor","lineWidth","dash","space","undash","topBottomXCoord","innerBottomRightRadiusX","innerBottomRightRadiusY","topRightXCoord","brSlope","bottomLeftYCoord","innerBottomLeftRadiusX","innerBottomLeftRadiusY","bottomRightYCoord","topLeftCoordX","bottomLeftXCoord","Clipping","ctr","cbr","cbl","ctl","getRotation","PI","getTranslateX","matchX","matchGeneric","getTranslateY","matchY","getScaleX","getScaleY","getMatrix","applySingleTransformation","element","rotate","scale","translate","Transformations","applyTransformations","re","printWarning","format","args","argIndex","message","replace","console","error","x","__DEV__","process","env","NODE_ENV","warning","condition","merge","a","b","isNil","deepMerge","objs","obj","mergeDeepWith","isFunction","compose","equals","type","inheritedProperties","Base","props","defaultProps","page","wrap","break","fixed","minPresenceAhead","percentX","percentY","update","newProps","applyProps","resolveStyles","toPairsIn","map","attribute","applyStyle","size","orientation","ownStyles","StyleSheet","pick","setter","getLayoutData","name","drawBackgroundColor","backgroundColor","fillOpacity","clone","onNodeSplit","assign","Borders","Transform","RULER_WIDTH","RULER_COLOR","RULER_FONT_SIZE","DEFAULT_RULER_STEPS","LINE_WIDTH","LINE_COLOR","GRID_COLOR","range","steps","from","ceil","_","matchPercentage","Ruler","getRulerWidth","hasHorizontalRuler","ruler","horizontalRuler","hasVerticalRuler","verticalRuler","getHorizontalSteps","horizontalRulerSteps","rulerSteps","percentage","getVerticalSteps","verticalRulerSteps","renderRuler","drawHorizontalRuler","drawVerticalRuler","offset","hRange","step","vRange","TextInstance","PAGE_SIZES","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","EXECUTIVE","FOLIO","LEGAL","LETTER","TABLOID","getPageSize","Page","_size","resetMargins","rulerWidth","dimension","elements","Fragment","createInstance","addDynamicChild","cb","listToExplore","shift","renderDynamicNodes","super","addPage","renderChildren","View","fetchFont","async","src","options","response","fetch","buffer","arrayBuffer","Buffer","FontSource","fontFamily","fontStyle","fontWeight","data","loading","BROWSER","headers","body","method","fontkit","Promise","reject","open","err","Font","family","sources","register","descriptor","styleSources","filter","exactFit","find","res","leftOffset","rightOffset","lt","gt","emojiSource","registerEmojiSource","url","getEmojiSource","hyphenationCallback","registerHyphenationCallback","callback","getHyphenationCallback","fonts","font","getRegisteredFonts","getRegisteredFontFamilies","getFont","standardFonts","includes","load","doc","reset","clear","emoji","hyphenation","StandardFont","PDFFont","str","encoded","positions","encode","stringIndices","glyphs","g","glyph","getGlyph","parseInt","advanceWidth","glyphForCodePoint","codePoint","id","_font","codePoints","isLigature","characterToGlyph","hasGlyphForCodePoint","fontCache","IGNORED_CODE_POINTS","getFontSize","pathOr","getFallbackFont","getOrCreateFont","shouldFallbackToFont","fontSubstitution","string","runs","lastFont","lastIndex","run","defaultFont","attributes","start","end","char","codePointAt","unitsPerEm","last","engines","linebreaker","justification","textDecoration","scriptItemizer","wordHyphenation","engine","layoutEngine","PROTOCOL_REGEXP","getURL","PNG","isValid","e","MARKERS","JPEG","readUInt16BE","marker","pos","isBuffer","createCache","limit","cache","get","set","IMAGE_CACHE","getAbsoluteLocalPath","protocol","auth","host","port","hostname","path","pathname","parse","absolutePath","isDangerousLocalPath","filename","safePath","absoluteSafePath","startsWith","fetchLocalFile","allowDangerousPaths","fs","readFile","fetchRemoteFile","uri","isValidFormat","lower","guessFormat","isCompatibleBase64","getImage","extension","resolveBase64Image","resolveImageFromData","JSON","stringify","resolveBufferImage","getImageFormat","isPng","isJpg","resolveImageFromUrl","resolveImage","cacheKey","toString","image","emojis","regex","emojiRegex","reflect","promise","then","v","makeFetchEmojiImage","_removeNoColor","getCodePoints","join","buildEmojiUrl","fetchEmojis","promises","emojiUrl","fetchEmojiImage","embedEmojis","fragments","fragment","emojiSize","chunk","String","fromCharCode","attachment","yOffset","floor","IGNORABLE_CODEPOINTS","buildSubsetForFont","ignoreChars","charSubset","subsetRegex","RegExp","PREPROCESSORS","capitalize","l","isImage","propEq","isTextInstance","complement","transformText","transformation","getFragments","color","textAlign","lineHeight","textDecorationColor","textDecorationStyle","textTransform","letterSpacing","textIndent","align","indent","link","characterSpacing","underlineStyle","underline","underlineColor","strike","strikeStyle","strikeColor","preprocessor","getAttributedString","AttributedString","fromFragments","Text","blocks","attributedString","layoutOptions","hyphenationPenalty","shrinkWhitespaceFactor","before","after","setMeasureFunc","measureText","bind","href","block","lines","line","box","lineIndexAtHeight","counter","heightAtLineIndex","layoutText","y","Infinity","maxLines","truncateMode","textOverflow","linesCount","widthMode","heightMode","MEASURE_MODE_EXACTLY","linesHeight","MEASURE_MODE_AT_MOST","linesWidth","wrapHeight","orphans","widows","linesQuantity","sliceHeight","slicedLine","slicedLineIndex","renderText","initialY","PDFRenderer","Link","Note","note","isNumeric","n","isNaN","isFinite","applyContainObjectFit","cw","ch","iw","ih","px","py","cr","ir","pxp","pyp","pxv","pyv","xOffset","applyNoneObjectFit","applyCoverObjectFit","applyScaleDownObjectFit","containDimension","noneDimension","applyFillObjectFit","resolveObjectFit","SAFETY_HEIGHT","Image","measureImage","shouldGrow","flexGrow","imageMargin","pagePadding","pageArea","MEASURE_MODE_UNDEFINED","scaledHeight","ratio","source","warn","renderImage","objectFit","Document","subpages","addMetaData","title","author","subject","keywords","creator","producer","info","Title","Author","Subject","Keywords","Creator","Producer","childNode","all","loadFonts","loadImages","loadEmojis","p","pageCount","pages","wrapArea","wrapPages","j","pageNumber","totalPages","loadAssets","renderPages","painter","Canvas","availableWidth","availableHeight","paint","constructors","ROOT","PAGE","TEXT","LINK","VIEW","NOTE","IMAGE","CANVAS","DOCUMENT","TEXT_INSTANCE","propsEqual","oldPropsKeys","newPropsKeys","emptyObject","shouldReplaceLink","ReactFiberReconciler","schedulePassiveEffects","cancelPassiveEffects","supportsMutation","appendInitialChild","parentInstance","internalInstanceHandle","createTextInstance","rootContainerInstance","finalizeInitialChildren","getPublicInstance","prepareForCommit","prepareUpdate","oldProps","resetAfterCommit","resetTextContent","getRootHostContext","getChildHostContext","shouldSetTextContent","now","Date","useSyncScheduling","appendChildToContainer","insertBefore","removeChildFromContainer","commitTextUpdate","textInstance","oldText","newText","commitUpdate","updatePayload","pdf","mountNode","createContainer","callOnRender","params","onRender","layoutData","updateContainer","toBuffer","toBlob","stream","pipe","BlobStream","on","blob","renderToStream","renderToFile","filePath","output","createWriteStream","throwEnvironmentError","PDFViewer","PDFDownloadLink","BlobProvider","version"],"mappings":"wjDAEA,MAAMA,KACJC,mBACOC,SAAU,OACVC,SAAW,UACXC,SAAW,sBAIT,OAGTC,YAAYC,QACLH,SAAWG,EAGlBC,mBACOJ,SAASK,eACTL,SAAW,KAGlBM,iBACOP,SAAU,EAGjBM,eACOL,SAASK,UAGhBE,cACOP,SAASO,6BAITN,SAAW,IAAIO,qBAAY,CAAEC,eAAe,UAC3CC,KAAKV,SAASW,cACfN,eACAN,SAAU,GCtCnB,MAAMa,WAAaC,GAASA,EAAMC,OAAO,GAAGC,cAAgBF,EAAMG,MAAM,GCAlEC,UAAYJ,GAAS,oBAAoBK,KAAKL,GAE9CM,aAAeN,UACbO,EAAQH,UAAUJ,MAEpBO,EAAO,OACHP,EAAQQ,WAAWD,EAAM,GAAI,IAC7BE,EAAUT,EAAQ,UAEjB,CACLA,MAAAA,EACAS,QAAAA,EACAC,SAAUC,KAAKC,IAAIZ,GACnBa,WAAYF,KAAKC,IAAIH,WAIlB,MCZT,MAAMK,KACJ7B,mBACO8B,OAAS,UACTC,SAAW,QACXC,UAAW,OACXC,OAASC,KAAKL,KAAKM,gBAG1B/B,YAAYC,GACNA,IACFA,EAAMyB,OAASlB,UACVmB,SAASK,KAAK/B,QACd4B,OAAOI,YAAYhC,EAAM4B,OAAQrB,KAAKqB,OAAOK,kBAItDC,kBAAkBlC,EAAOmC,SACjBC,EAAQ7B,KAAKmB,SAASW,QAAQF,IAErB,IAAXC,GAAgBpC,IAClBA,EAAMyB,OAASlB,UACVmB,SAASY,OAAOF,EAAO,EAAGpC,QAC1B4B,OAA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