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tC,KAAI,SAAS,GACV,OAAO,EAAS,QAAO,SAAS,GAC5B,QAAS,CACb,GACJ,GACR,CAGA,SAAS,eAAe,GACpB,OAAO,MAAM,QAAQ,GAChB,KAAK,WAAW,MAChB,MAAK,SAAS,GACX,OAAO,EAAe,IAAI,wBAC9B,GACR,CAEA,SAAS,cAAc,EAAO,GAC1B,OAAO,MAAM,QAAQ,GAChB,KAAI,SAAS,GACV,OAAO,aAAa,cAAc,EAAU,EAChD,IACC,MAAK,SAAS,GACX,OAAO,EAAS,eACpB,IACC,MAAK,SAAS,GACX,MAAO,CACH,cAAe,WACX,OAAO,CACX,EACA,SAAU,WACN,OAAO,OAAO,KAAK,EACvB,EAER,GACR,CA/FA,QAAQ,cAAgB,cACxB,QAAQ,kBAAoB,kBAC5B,QAAQ,QAAU,QAClB,QAAQ,eAAiB,eACzB,QAAQ,OAAS,QAAQ,YACzB,QAAQ,WAAa,QAAQ,gBAC7B,QAAQ,UAAY,QAAQ,eAC5B,QAAQ,cAAgB,cACxB,QAAQ,qBAAuB,qBAyF/B,QAAQ,aAAe,WACnB,MAAM,IAAI,MAAM,yJACpB","file":"/npm/mammoth@1.7.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mammoth@1.7.0/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var _ = require(\"underscore\");\n\nvar docxReader = require(\"./docx/docx-reader\");\nvar docxStyleMap = require(\"./docx/style-map\");\nvar DocumentConverter = require(\"./document-to-html\").DocumentConverter;\nvar convertElementToRawText = require(\"./raw-text\").convertElementToRawText;\nvar readStyle = require(\"./style-reader\").readStyle;\nvar readOptions = require(\"./options-reader\").readOptions;\nvar unzip = require(\"./unzip\");\nvar Result = require(\"./results\").Result;\n\nexports.convertToHtml = convertToHtml;\nexports.convertToMarkdown = convertToMarkdown;\nexports.convert = convert;\nexports.extractRawText = extractRawText;\nexports.images = require(\"./images\");\nexports.transforms = require(\"./transforms\");\nexports.underline = require(\"./underline\");\nexports.embedStyleMap = embedStyleMap;\nexports.readEmbeddedStyleMap = readEmbeddedStyleMap;\n\nfunction convertToHtml(input, options) {\n    return convert(input, options);\n}\n\nfunction convertToMarkdown(input, options) {\n    var markdownOptions = Object.create(options || {});\n    markdownOptions.outputFormat = \"markdown\";\n    return convert(input, markdownOptions);\n}\n\nfunction convert(input, options) {\n    options = readOptions(options);\n\n    return unzip.openZip(input)\n        .tap(function(docxFile) {\n            return docxStyleMap.readStyleMap(docxFile).then(function(styleMap) {\n                options.embeddedStyleMap = styleMap;\n            });\n        })\n        .then(function(docxFile) {\n            return docxReader.read(docxFile, input)\n                .then(function(documentResult) {\n                    return documentResult.map(options.transformDocument);\n                })\n                .then(function(documentResult) {\n                    return convertDocumentToHtml(documentResult, options);\n                });\n        });\n}\n\nfunction readEmbeddedStyleMap(input) {\n    return unzip.openZip(input)\n        .then(docxStyleMap.readStyleMap);\n}\n\nfunction convertDocumentToHtml(documentResult, options) {\n    var styleMapResult = parseStyleMap(options.readStyleMap());\n    var parsedOptions = _.extend({}, options, {\n        styleMap: styleMapResult.value\n    });\n    var documentConverter = new DocumentConverter(parsedOptions);\n\n    return documentResult.flatMapThen(function(document) {\n        return styleMapResult.flatMapThen(function(styleMap) {\n            return documentConverter.convertToHtml(document);\n        });\n    });\n}\n\nfunction parseStyleMap(styleMap) {\n    return Result.combine((styleMap || []).map(readStyle))\n        .map(function(styleMap) {\n            return styleMap.filter(function(styleMapping) {\n                return !!styleMapping;\n            });\n        });\n}\n\n\nfunction extractRawText(input) {\n    return unzip.openZip(input)\n        .then(docxReader.read)\n        .then(function(documentResult) {\n            return documentResult.map(convertElementToRawText);\n        });\n}\n\nfunction embedStyleMap(input, styleMap) {\n    return unzip.openZip(input)\n        .tap(function(docxFile) {\n            return docxStyleMap.writeStyleMap(docxFile, styleMap);\n        })\n        .then(function(docxFile) {\n            return docxFile.toArrayBuffer();\n        })\n        .then(function(arrayBuffer) {\n            return {\n                toArrayBuffer: function() {\n                    return arrayBuffer;\n                },\n                toBuffer: function() {\n                    return Buffer.from(arrayBuffer);\n                }\n            };\n        });\n}\n\nexports.styleMapping = function() {\n    throw new Error('Use a raw string instead of mammoth.styleMapping e.g. \"p[style-name=\\'Title\\'] => h1\" instead of mammoth.styleMapping(\"p[style-name=\\'Title\\'] => h1\")');\n};\n"]}