{"version":3,"file":"draftjs-to-html-CdLqFAeH.js","sources":["../../node_modules/draftjs-to-html/lib/draftjs-to-html.js"],"sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.draftjsToHtml = factory());\n}(this, (function () { 'use strict';\n\n /**\n * Utility function to execute callback for eack key->value pair.\n */\n function forEach(obj, callback) {\n if (obj) {\n for (var key in obj) {\n // eslint-disable-line no-restricted-syntax\n if ({}.hasOwnProperty.call(obj, key)) {\n callback(key, obj[key]);\n }\n }\n }\n }\n /**\n * The function returns true if the string passed to it has no content.\n */\n\n function isEmptyString(str) {\n if (str === undefined || str === null || str.length === 0 || str.trim().length === 0) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Mapping block-type to corresponding html tag.\n */\n\n var blockTypesMapping = {\n unstyled: 'p',\n 'header-one': 'h1',\n 'header-two': 'h2',\n 'header-three': 'h3',\n 'header-four': 'h4',\n 'header-five': 'h5',\n 'header-six': 'h6',\n 'unordered-list-item': 'ul',\n 'ordered-list-item': 'ol',\n blockquote: 'blockquote',\n code: 'pre'\n };\n /**\n * Function will return HTML tag for a block.\n */\n\n function getBlockTag(type) {\n return type && blockTypesMapping[type];\n }\n /**\n * Function will return style string for a block.\n */\n\n function getBlockStyle(data) {\n var styles = '';\n forEach(data, function (key, value) {\n if (value) {\n styles += \"\".concat(key, \":\").concat(value, \";\");\n }\n });\n return styles;\n }\n /**\n * The function returns an array of hashtag-sections in blocks.\n * These will be areas in block which have hashtags applicable to them.\n */\n\n function getHashtagRanges(blockText, hashtagConfig) {\n var sections = [];\n\n if (hashtagConfig) {\n var counter = 0;\n var startIndex = 0;\n var text = blockText;\n var trigger = hashtagConfig.trigger || '#';\n var separator = hashtagConfig.separator || ' ';\n\n for (; text.length > 0 && startIndex >= 0;) {\n if (text[0] === trigger) {\n startIndex = 0;\n counter = 0;\n text = text.substr(trigger.length);\n } else {\n startIndex = text.indexOf(separator + trigger);\n\n if (startIndex >= 0) {\n text = text.substr(startIndex + (separator + trigger).length);\n counter += startIndex + separator.length;\n }\n }\n\n if (startIndex >= 0) {\n var endIndex = text.indexOf(separator) >= 0 ? text.indexOf(separator) : text.length;\n var hashtag = text.substr(0, endIndex);\n\n if (hashtag && hashtag.length > 0) {\n sections.push({\n offset: counter,\n length: hashtag.length + trigger.length,\n type: 'HASHTAG'\n });\n }\n\n counter += trigger.length;\n }\n }\n }\n\n return sections;\n }\n /**\n * The function returns an array of entity-sections in blocks.\n * These will be areas in block which have same entity or no entity applicable to them.\n */\n\n\n function getSections(block, hashtagConfig) {\n var sections = [];\n var lastOffset = 0;\n var sectionRanges = block.entityRanges.map(function (range) {\n var offset = range.offset,\n length = range.length,\n key = range.key;\n return {\n offset: offset,\n length: length,\n key: key,\n type: 'ENTITY'\n };\n });\n sectionRanges = sectionRanges.concat(getHashtagRanges(block.text, hashtagConfig));\n sectionRanges = sectionRanges.sort(function (s1, s2) {\n return s1.offset - s2.offset;\n });\n sectionRanges.forEach(function (r) {\n if (r.offset > lastOffset) {\n sections.push({\n start: lastOffset,\n end: r.offset\n });\n }\n\n sections.push({\n start: r.offset,\n end: r.offset + r.length,\n entityKey: r.key,\n type: r.type\n });\n lastOffset = r.offset + r.length;\n });\n\n if (lastOffset < block.text.length) {\n sections.push({\n start: lastOffset,\n end: block.text.length\n });\n }\n\n return sections;\n }\n /**\n * Function to check if the block is an atomic entity block.\n */\n\n\n function isAtomicEntityBlock(block) {\n if (block.entityRanges.length > 0 && (isEmptyString(block.text) || block.type === 'atomic')) {\n return true;\n }\n\n return false;\n }\n /**\n * The function will return array of inline styles applicable to the block.\n */\n\n\n function getStyleArrayForBlock(block) {\n var text = block.text,\n inlineStyleRanges = block.inlineStyleRanges;\n var inlineStyles = {\n BOLD: new Array(text.length),\n ITALIC: new Array(text.length),\n UNDERLINE: new Array(text.length),\n STRIKETHROUGH: new Array(text.length),\n CODE: new Array(text.length),\n SUPERSCRIPT: new Array(text.length),\n SUBSCRIPT: new Array(text.length),\n COLOR: new Array(text.length),\n BGCOLOR: new Array(text.length),\n FONTSIZE: new Array(text.length),\n FONTFAMILY: new Array(text.length),\n length: text.length\n };\n\n if (inlineStyleRanges && inlineStyleRanges.length > 0) {\n inlineStyleRanges.forEach(function (range) {\n var offset = range.offset;\n var length = offset + range.length;\n\n for (var i = offset; i < length; i += 1) {\n if (range.style.indexOf('color-') === 0) {\n inlineStyles.COLOR[i] = range.style.substring(6);\n } else if (range.style.indexOf('bgcolor-') === 0) {\n inlineStyles.BGCOLOR[i] = range.style.substring(8);\n } else if (range.style.indexOf('fontsize-') === 0) {\n inlineStyles.FONTSIZE[i] = range.style.substring(9);\n } else if (range.style.indexOf('fontfamily-') === 0) {\n inlineStyles.FONTFAMILY[i] = range.style.substring(11);\n } else if (inlineStyles[range.style]) {\n inlineStyles[range.style][i] = true;\n }\n }\n });\n }\n\n return inlineStyles;\n }\n /**\n * The function will return inline style applicable at some offset within a block.\n */\n\n\n function getStylesAtOffset(inlineStyles, offset) {\n var styles = {};\n\n if (inlineStyles.COLOR[offset]) {\n styles.COLOR = inlineStyles.COLOR[offset];\n }\n\n if (inlineStyles.BGCOLOR[offset]) {\n styles.BGCOLOR = inlineStyles.BGCOLOR[offset];\n }\n\n if (inlineStyles.FONTSIZE[offset]) {\n styles.FONTSIZE = inlineStyles.FONTSIZE[offset];\n }\n\n if (inlineStyles.FONTFAMILY[offset]) {\n styles.FONTFAMILY = inlineStyles.FONTFAMILY[offset];\n }\n\n if (inlineStyles.UNDERLINE[offset]) {\n styles.UNDERLINE = true;\n }\n\n if (inlineStyles.ITALIC[offset]) {\n styles.ITALIC = true;\n }\n\n if (inlineStyles.BOLD[offset]) {\n styles.BOLD = true;\n }\n\n if (inlineStyles.STRIKETHROUGH[offset]) {\n styles.STRIKETHROUGH = true;\n }\n\n if (inlineStyles.CODE[offset]) {\n styles.CODE = true;\n }\n\n if (inlineStyles.SUBSCRIPT[offset]) {\n styles.SUBSCRIPT = true;\n }\n\n if (inlineStyles.SUPERSCRIPT[offset]) {\n styles.SUPERSCRIPT = true;\n }\n\n return styles;\n }\n /**\n * Function returns true for a set of styles if the value of these styles at an offset\n * are same as that on the previous offset.\n */\n\n function sameStyleAsPrevious(inlineStyles, styles, index) {\n var sameStyled = true;\n\n if (index > 0 && index < inlineStyles.length) {\n styles.forEach(function (style) {\n sameStyled = sameStyled && inlineStyles[style][index] === inlineStyles[style][index - 1];\n });\n } else {\n sameStyled = false;\n }\n\n return sameStyled;\n }\n /**\n * Function returns html for text depending on inline style tags applicable to it.\n */\n\n function addInlineStyleMarkup(style, content) {\n if (style === 'BOLD') {\n return \"\".concat(content, \"\");\n }\n\n if (style === 'ITALIC') {\n return \"\".concat(content, \"\");\n }\n\n if (style === 'UNDERLINE') {\n return \"\".concat(content, \"\");\n }\n\n if (style === 'STRIKETHROUGH') {\n return \"\".concat(content, \"\");\n }\n\n if (style === 'CODE') {\n return \"\".concat(content, \"\");\n }\n\n if (style === 'SUPERSCRIPT') {\n return \"\".concat(content, \"\");\n }\n\n if (style === 'SUBSCRIPT') {\n return \"\".concat(content, \"\");\n }\n\n return content;\n }\n /**\n * The function returns text for given section of block after doing required character replacements.\n */\n\n function getSectionText(text) {\n if (text && text.length > 0) {\n var chars = text.map(function (ch) {\n switch (ch) {\n case '\\n':\n return '
';\n\n case '&':\n return '&';\n\n case '<':\n return '<';\n\n case '>':\n return '>';\n\n default:\n return ch;\n }\n });\n return chars.join('');\n }\n\n return '';\n }\n /**\n * Function returns html for text depending on inline style tags applicable to it.\n */\n\n\n function addStylePropertyMarkup(styles, text) {\n if (styles && (styles.COLOR || styles.BGCOLOR || styles.FONTSIZE || styles.FONTFAMILY)) {\n var styleString = 'style=\"';\n\n if (styles.COLOR) {\n styleString += \"color: \".concat(styles.COLOR, \";\");\n }\n\n if (styles.BGCOLOR) {\n styleString += \"background-color: \".concat(styles.BGCOLOR, \";\");\n }\n\n if (styles.FONTSIZE) {\n styleString += \"font-size: \".concat(styles.FONTSIZE).concat(/^\\d+$/.test(styles.FONTSIZE) ? 'px' : '', \";\");\n }\n\n if (styles.FONTFAMILY) {\n styleString += \"font-family: \".concat(styles.FONTFAMILY, \";\");\n }\n\n styleString += '\"';\n return \"\").concat(text, \"\");\n }\n\n return text;\n }\n /**\n * Function will return markup for Entity.\n */\n\n function getEntityMarkup(entityMap, entityKey, text, customEntityTransform) {\n var entity = entityMap[entityKey];\n\n if (typeof customEntityTransform === 'function') {\n var html = customEntityTransform(entity, text);\n\n if (html) {\n return html;\n }\n }\n\n if (entity.type === 'MENTION') {\n return \"\").concat(text, \"\");\n }\n\n if (entity.type === 'LINK') {\n var targetOption = entity.data.targetOption || '_self';\n return \"\").concat(text, \"\");\n }\n\n if (entity.type === 'IMAGE') {\n var alignment = entity.data.alignment;\n\n if (alignment && alignment.length) {\n return \"
\\\"\").concat(entity.data.alt,
\");\n }\n\n return \"\\\"\").concat(entity.data.alt,\");\n }\n\n if (entity.type === 'EMBEDDED_LINK') {\n return \"\");\n }\n\n return text;\n }\n /**\n * For a given section in a block the function will return a further list of sections,\n * with similar inline styles applicable to them.\n */\n\n\n function getInlineStyleSections(block, styles, start, end) {\n var styleSections = [];\n var text = Array.from(block.text);\n\n if (text.length > 0) {\n var inlineStyles = getStyleArrayForBlock(block);\n var section;\n\n for (var i = start; i < end; i += 1) {\n if (i !== start && sameStyleAsPrevious(inlineStyles, styles, i)) {\n section.text.push(text[i]);\n section.end = i + 1;\n } else {\n section = {\n styles: getStylesAtOffset(inlineStyles, i),\n text: [text[i]],\n start: i,\n end: i + 1\n };\n styleSections.push(section);\n }\n }\n }\n\n return styleSections;\n }\n /**\n * Replace leading blank spaces by  \n */\n\n\n function trimLeadingZeros(sectionText) {\n if (sectionText) {\n var replacedText = sectionText;\n\n for (var i = 0; i < replacedText.length; i += 1) {\n if (sectionText[i] === ' ') {\n replacedText = replacedText.replace(' ', ' ');\n } else {\n break;\n }\n }\n\n return replacedText;\n }\n\n return sectionText;\n }\n /**\n * Replace trailing blank spaces by  \n */\n\n function trimTrailingZeros(sectionText) {\n if (sectionText) {\n var replacedText = sectionText;\n\n for (var i = replacedText.length - 1; i >= 0; i -= 1) {\n if (replacedText[i] === ' ') {\n replacedText = \"\".concat(replacedText.substring(0, i), \" \").concat(replacedText.substring(i + 1));\n } else {\n break;\n }\n }\n\n return replacedText;\n }\n\n return sectionText;\n }\n /**\n * The method returns markup for section to which inline styles\n * like BOLD, ITALIC, UNDERLINE, STRIKETHROUGH, CODE, SUPERSCRIPT, SUBSCRIPT are applicable.\n */\n\n function getStyleTagSectionMarkup(styleSection) {\n var styles = styleSection.styles,\n text = styleSection.text;\n var content = getSectionText(text);\n forEach(styles, function (style, value) {\n content = addInlineStyleMarkup(style, content);\n });\n return content;\n }\n /**\n * The method returns markup for section to which inline styles\n like color, background-color, font-size are applicable.\n */\n\n\n function getInlineStyleSectionMarkup(block, styleSection) {\n var styleTagSections = getInlineStyleSections(block, ['BOLD', 'ITALIC', 'UNDERLINE', 'STRIKETHROUGH', 'CODE', 'SUPERSCRIPT', 'SUBSCRIPT'], styleSection.start, styleSection.end);\n var styleSectionText = '';\n styleTagSections.forEach(function (stylePropertySection) {\n styleSectionText += getStyleTagSectionMarkup(stylePropertySection);\n });\n styleSectionText = addStylePropertyMarkup(styleSection.styles, styleSectionText);\n return styleSectionText;\n }\n /*\n * The method returns markup for an entity section.\n * An entity section is a continuous section in a block\n * to which same entity or no entity is applicable.\n */\n\n\n function getSectionMarkup(block, entityMap, section, customEntityTransform) {\n var entityInlineMarkup = [];\n var inlineStyleSections = getInlineStyleSections(block, ['COLOR', 'BGCOLOR', 'FONTSIZE', 'FONTFAMILY'], section.start, section.end);\n inlineStyleSections.forEach(function (styleSection) {\n entityInlineMarkup.push(getInlineStyleSectionMarkup(block, styleSection));\n });\n var sectionText = entityInlineMarkup.join('');\n\n if (section.type === 'ENTITY') {\n if (section.entityKey !== undefined && section.entityKey !== null) {\n sectionText = getEntityMarkup(entityMap, section.entityKey, sectionText, customEntityTransform); // eslint-disable-line max-len\n }\n } else if (section.type === 'HASHTAG') {\n sectionText = \"\").concat(sectionText, \"\");\n }\n\n return sectionText;\n }\n /**\n * Function will return the markup for block preserving the inline styles and\n * special characters like newlines or blank spaces.\n */\n\n\n function getBlockInnerMarkup(block, entityMap, hashtagConfig, customEntityTransform) {\n var blockMarkup = [];\n var sections = getSections(block, hashtagConfig);\n sections.forEach(function (section, index) {\n var sectionText = getSectionMarkup(block, entityMap, section, customEntityTransform);\n\n if (index === 0) {\n sectionText = trimLeadingZeros(sectionText);\n }\n\n if (index === sections.length - 1) {\n sectionText = trimTrailingZeros(sectionText);\n }\n\n blockMarkup.push(sectionText);\n });\n return blockMarkup.join('');\n }\n /**\n * Function will return html for the block.\n */\n\n function getBlockMarkup(block, entityMap, hashtagConfig, directional, customEntityTransform) {\n var blockHtml = [];\n\n if (isAtomicEntityBlock(block)) {\n blockHtml.push(getEntityMarkup(entityMap, block.entityRanges[0].key, undefined, customEntityTransform));\n } else {\n var blockTag = getBlockTag(block.type);\n\n if (blockTag) {\n blockHtml.push(\"<\".concat(blockTag));\n var blockStyle = getBlockStyle(block.data);\n\n if (blockStyle) {\n blockHtml.push(\" style=\\\"\".concat(blockStyle, \"\\\"\"));\n }\n\n if (directional) {\n blockHtml.push(' dir = \"auto\"');\n }\n\n blockHtml.push('>');\n blockHtml.push(getBlockInnerMarkup(block, entityMap, hashtagConfig, customEntityTransform));\n blockHtml.push(\"\"));\n }\n }\n\n blockHtml.push('\\n');\n return blockHtml.join('');\n }\n\n /**\n * Function to check if a block is of type list.\n */\n\n function isList(blockType) {\n return blockType === 'unordered-list-item' || blockType === 'ordered-list-item';\n }\n /**\n * Function will return html markup for a list block.\n */\n\n function getListMarkup(listBlocks, entityMap, hashtagConfig, directional, customEntityTransform) {\n var listHtml = [];\n var nestedListBlock = [];\n var previousBlock;\n listBlocks.forEach(function (block) {\n var nestedBlock = false;\n\n if (!previousBlock) {\n listHtml.push(\"<\".concat(getBlockTag(block.type), \">\\n\"));\n } else if (previousBlock.type !== block.type) {\n listHtml.push(\"\\n\"));\n listHtml.push(\"<\".concat(getBlockTag(block.type), \">\\n\"));\n } else if (previousBlock.depth === block.depth) {\n if (nestedListBlock && nestedListBlock.length > 0) {\n listHtml.push(getListMarkup(nestedListBlock, entityMap, hashtagConfig, directional, customEntityTransform));\n nestedListBlock = [];\n }\n } else {\n nestedBlock = true;\n nestedListBlock.push(block);\n }\n\n if (!nestedBlock) {\n listHtml.push('');\n listHtml.push(getBlockInnerMarkup(block, entityMap, hashtagConfig, customEntityTransform));\n listHtml.push('\\n');\n previousBlock = block;\n }\n });\n\n if (nestedListBlock && nestedListBlock.length > 0) {\n listHtml.push(getListMarkup(nestedListBlock, entityMap, hashtagConfig, directional, customEntityTransform));\n }\n\n listHtml.push(\"\\n\"));\n return listHtml.join('');\n }\n\n /**\n * The function will generate html markup for given draftjs editorContent.\n */\n\n function draftToHtml(editorContent, hashtagConfig, directional, customEntityTransform) {\n var html = [];\n\n if (editorContent) {\n var blocks = editorContent.blocks,\n entityMap = editorContent.entityMap;\n\n if (blocks && blocks.length > 0) {\n var listBlocks = [];\n blocks.forEach(function (block) {\n if (isList(block.type)) {\n listBlocks.push(block);\n } else {\n if (listBlocks.length > 0) {\n var listHtml = getListMarkup(listBlocks, entityMap, hashtagConfig, customEntityTransform); // eslint-disable-line max-len\n\n html.push(listHtml);\n listBlocks = [];\n }\n\n var blockHtml = getBlockMarkup(block, entityMap, hashtagConfig, directional, customEntityTransform);\n html.push(blockHtml);\n }\n });\n\n if (listBlocks.length > 0) {\n var listHtml = getListMarkup(listBlocks, entityMap, hashtagConfig, directional, customEntityTransform); // eslint-disable-line max-len\n\n html.push(listHtml);\n listBlocks = [];\n }\n }\n }\n\n return html.join('');\n }\n\n return draftToHtml;\n\n})));\n"],"names":["global","factory","module","this","forEach","obj","callback","key","isEmptyString","str","blockTypesMapping","getBlockTag","type","getBlockStyle","data","styles","value","getHashtagRanges","blockText","hashtagConfig","sections","counter","startIndex","text","trigger","separator","endIndex","hashtag","getSections","block","lastOffset","sectionRanges","range","offset","length","s1","s2","r","isAtomicEntityBlock","getStyleArrayForBlock","inlineStyleRanges","inlineStyles","i","getStylesAtOffset","sameStyleAsPrevious","index","sameStyled","style","addInlineStyleMarkup","content","getSectionText","chars","ch","addStylePropertyMarkup","styleString","getEntityMarkup","entityMap","entityKey","customEntityTransform","entity","html","targetOption","alignment","getInlineStyleSections","start","end","styleSections","section","trimLeadingZeros","sectionText","replacedText","trimTrailingZeros","getStyleTagSectionMarkup","styleSection","getInlineStyleSectionMarkup","styleTagSections","styleSectionText","stylePropertySection","getSectionMarkup","entityInlineMarkup","inlineStyleSections","getBlockInnerMarkup","blockMarkup","getBlockMarkup","directional","blockHtml","blockTag","blockStyle","isList","blockType","getListMarkup","listBlocks","listHtml","nestedListBlock","previousBlock","nestedBlock","draftToHtml","editorContent","blocks"],"mappings":"4ZAAC,SAAUA,EAAQC,EAAS,CACqCC,EAAiB,QAAAD,GAGjF,GAACE,EAAO,UAAY,CAKnB,SAASC,EAAQC,EAAKC,EAAU,CAC9B,GAAID,EACF,QAASE,KAAOF,GAEV,CAAE,GAAC,eAAe,KAAKA,EAAKE,CAAG,GACjCD,EAASC,EAAKF,EAAIE,CAAG,CAAC,EAS9B,SAASC,EAAcC,EAAK,CAC1B,OAAyBA,GAAQ,MAAQA,EAAI,SAAW,GAAKA,EAAI,OAAO,SAAW,EAWrF,IAAIC,EAAoB,CACtB,SAAU,IACV,aAAc,KACd,aAAc,KACd,eAAgB,KAChB,cAAe,KACf,cAAe,KACf,aAAc,KACd,sBAAuB,KACvB,oBAAqB,KACrB,WAAY,aACZ,KAAM,KACP,EAKD,SAASC,EAAYC,EAAM,CACzB,OAAOA,GAAQF,EAAkBE,CAAI,EAMvC,SAASC,EAAcC,EAAM,CAC3B,IAAIC,EAAS,GACb,OAAAX,EAAQU,EAAM,SAAUP,EAAKS,EAAO,CAC9BA,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