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","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/dedupe-string-plugin@1.1.0/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","'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Dedupe = _interopDefault(require('de-dupe'));\nvar webpackSources = require('webpack-sources');\n\nvar pluginName = 'dedupe-string-plugin';\nvar StripWhitespacePlugin = /** @class */ (function () {\n    function StripWhitespacePlugin(options) {\n        options = options || {};\n        options.type = 'gzip';\n        options.includeReplacements = true;\n        this.dedupe = new Dedupe(options);\n    }\n    StripWhitespacePlugin.prototype.apply = function (compiler) {\n        var dedupe = this.dedupe.dedupe.bind(this.dedupe);\n        compiler.plugin('compilation', function (compilation) {\n            compilation.plugin('optimize-chunk-assets', function (chunks, callback) {\n                chunks.forEach(function (chunk) {\n                    chunk.files\n                        .forEach(function (file) {\n                        var asset = compilation.assets[file];\n                        var code = asset.source();\n                        var result = dedupe(code);\n                        if (!result.replacements) {\n                            return;\n                        }\n                        if (result.replacements.length === 0) {\n                            // nothing to do here\n                            return;\n                        }\n                        if (!compiler.options.devtool) {\n                            compilation.assets[file] = new webpackSources.RawSource(result.code);\n                        }\n                        else {\n                            var replaceSource = new webpackSources.ReplaceSource(compilation.assets[file], pluginName);\n                            // perform the replacements\n                            for (var _i = 0, _a = result.replacements; _i < _a.length; _i++) {\n                                var replacement = _a[_i];\n                                replaceSource.replace(replacement.start, replacement.end, replacement.text);\n                            }\n                            // generate the new sourcemap\n                            var sourceAndMap = replaceSource.sourceAndMap();\n                            var source = sourceAndMap.source, map = sourceAndMap.map;\n                            // replace the asset with the new sourcemap\n                            compilation.assets[file] = new webpackSources.SourceMapSource(result.code, pluginName, map, code);\n                        }\n                    });\n                });\n                callback();\n            });\n        });\n    };\n    return StripWhitespacePlugin;\n}());\n\nmodule.exports = StripWhitespacePlugin;\n"]}