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W,KAGlC,CAEA,SAAS,UAAU,EAAU,GACzB,IAAK,SAAS,GAAW,OAAO,UAE5B,MAAO,IAA6C,EAAU,CAAC,GAQnE,IANA,IAAI,EAAiB,CACjB,UAAY,EAAQ,QAAU,EAAQ,OAAO,MAC7C,MAAM,EACN,QAAQ,GAGH,EAAI,EAAG,EAAO,OAAO,KAAK,GAAU,EAAI,EAAK,OAAQ,IAAK,CAC/D,IAAI,EAAM,EAAK,GAAI,EAAS,EAAQ,GAChC,MAAO,IACQ,UAAX,GAAiC,OAAX,GAA8B,MAAX,IACzC,GAAS,GAEb,EAAe,GAAO,EAE9B,CAEA,IAAI,EAAS,GAeb,OAAO,SAdP,SAAmB,EAAO,EAAU,GAChC,EAAO,KAAK,GACZ,GACJ,IAEA,SAAe,GACX,IAAI,EAAS,KACT,EAAS,OAAO,OAAO,GAAQ,WACnC,QAAQ,EAAU,EAAQ,GAAgB,SAAS,EAAO,GACjD,GAAO,EAAO,KAAK,GACxB,EAAS,EACb,GACJ,GAGJ,CA5EA,WAAW,UAAY,OAAO,OAAO,YAAY,WAEjD,WAAW,UAAU,SAAW,WAC5B,OAAO,KAAK,SAChB,EAEA,WAAW,UAAU,QAAU,WAC3B,OAAO,KAAK,SAChB,EAsEA,UAAU,QAAU,QACpB,UAAU,SAAW,SACrB,UAAU,WAAa,WAEvB,OAAO,QAAU","file":"/npm/coffeeify@3.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/coffeeify@3.0.1/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 coffee = require('coffeescript');\nvar convert = require('convert-source-map');\nvar path = require('path');\nvar through = require('through2');\n\nvar filePattern = /\\.((lit)?coffee|coffee\\.md)$/;\n\nfunction isCoffee (file) {\n    return filePattern.test(file);\n}\n\nfunction isLiterate (file) {\n    return (/\\.(litcoffee|coffee\\.md)$/).test(file);\n}\n\nfunction ParseError(error, src, file) {\n    /* Creates a ParseError from a CoffeeScript SyntaxError\n       modeled after substack's syntax-error module */\n    SyntaxError.call(this);\n\n    this.message = error.message;\n\n    this.line = error.location.first_line + 1; // cs linenums are 0-indexed\n    this.column = error.location.first_column + 1; // same with columns\n\n    var markerLen = 2;\n    if(error.location.first_line === error.location.last_line) {\n        markerLen += error.location.last_column - error.location.first_column;\n    }\n    this.annotated = [\n        file + ':' + this.line,\n        src.split('\\n')[this.line - 1],\n        Array(this.column).join(' ') + Array(markerLen).join('^'),\n        'ParseError: ' + this.message\n    ].join('\\n');\n}\n\nParseError.prototype = Object.create(SyntaxError.prototype);\n\nParseError.prototype.toString = function () {\n    return this.annotated;\n};\n\nParseError.prototype.inspect = function () {\n    return this.annotated;\n};\n\nfunction compile(filename, source, options, callback) {\n    var compiled;\n    try {\n        compiled = coffee.compile(source, Object.assign({\n          inline: true,\n          literate: isLiterate(filename)\n        }, options));\n    } catch (e) {\n        var error = e;\n        if (e.location) {\n            error = new ParseError(e, source, filename);\n        }\n        callback(error);\n        return;\n    }\n\n    if (options.sourceMap) {\n        var map = convert.fromJSON(compiled.v3SourceMap);\n        var basename = path.basename(filename);\n        map.setProperty('file', basename.replace(filePattern, '.js'));\n        map.setProperty('sources', [basename]);\n        map.setProperty('sourcesContent', [source]);\n        callback(null, compiled.js + '\\n' + map.toComment() + '\\n');\n    } else {\n        callback(null, compiled + '\\n');\n    }\n\n}\n\nfunction coffeeify(filename, options) {\n    if (!isCoffee(filename)) return through();\n\n    if (typeof options === 'undefined' || options === null) options = {};\n\n    var compileOptions = {\n        sourceMap: (options._flags && options._flags.debug),\n        bare: true,\n        header: false\n    };\n\n    for (var i = 0, keys = Object.keys(options); i < keys.length; i++) {\n        var key = keys[i], option = options[key];\n        if (typeof option !== 'undefined' && option !== null) {\n            if (option === 'false' || option === 'no' || option === '0') {\n                option = false;\n            }\n            compileOptions[key] = option;\n        }\n    }\n\n    var chunks = [];\n    function transform(chunk, encoding, callback) {\n        chunks.push(chunk);\n        callback();\n    }\n\n    function flush(callback) {\n        var stream = this;\n        var source = Buffer.concat(chunks).toString();\n        compile(filename, source, compileOptions, function(error, result) {\n            if (!error) stream.push(result);\n            callback(error);\n        });\n    }\n\n    return through(transform, flush);\n}\n\ncoffeeify.compile = compile;\ncoffeeify.isCoffee = isCoffee;\ncoffeeify.isLiterate = isLiterate;\n\nmodule.exports = coffeeify;\n"]}