{"version":3,"sources":["jsdelivr-header.js","/npm/mermaid_md-to-pdf@5.2.4/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;ACLA,aACA,IAAI,gBAAmB,MAAQ,KAAK,iBAAoB,SAAU,GAC9D,OAAQ,GAAO,EAAI,WAAc,EAAM,CAAE,QAAW,EACxD,EACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,aAAU,EAClB,MAAM,WAAa,gBAAgB,QAAQ,aACrC,YAAc,gBAAgB,QAAQ,cACtC,SAAW,QAAQ,gBACnB,UAAY,QAAQ,iBACpB,YAAc,QAAQ,mBACtB,YAAc,QAAQ,mBACtB,WAAc,GAAU,YAAa,EACrC,QAAW,GAAU,SAAU,EACrC,eAAe,QAAQ,EAAO,EAAS,CAAC,GACpC,IAAK,WAAW,KAAW,QAAQ,GAC/B,MAAM,IAAI,MAAM,mEAEf,EAAO,OACR,EAAO,WAAa,EAAI,WAAW,YAElC,EAAO,UACR,EAAO,QAAU,SAAU,GAAQ,EAAI,UAAU,QAAQ,EAAM,MAAQ,QAAQ,OAE9E,EAAO,OACR,EAAO,KAAO,IAElB,MAAM,EAAe,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,CAAC,EAAG,SAAS,eAAgB,GAAS,CAAE,YAAa,OAAO,OAAO,OAAO,OAAO,CAAC,EAAG,SAAS,cAAc,aAAc,EAAO,eAC1L,QAAe,EAAI,YAAY,gBAAgB,GAC/C,QAAgB,YAAY,QAAQ,OAAO,OAAO,OAAO,CAAE,SAAU,EAAO,UAAY,EAAO,iBAC/F,QAAY,EAAI,YAAY,gBAAgB,EAAO,EAAc,CAAE,YAGzE,aAFM,EAAQ,cACR,EAAI,YAAY,aAAa,GAC5B,CACX,CACA,QAAQ,QAAU,QAClB,QAAQ,QAAU","file":"/npm/mermaid_md-to-pdf@5.2.4/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mermaid_md-to-pdf@5.2.4/dist/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","#!/usr/bin/env node\n\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mdToPdf = void 0;\nconst get_port_1 = __importDefault(require(\"get-port\"));\nconst puppeteer_1 = __importDefault(require(\"puppeteer\"));\nconst config_1 = require(\"./lib/config\");\nconst helpers_1 = require(\"./lib/helpers\");\nconst md_to_pdf_1 = require(\"./lib/md-to-pdf\");\nconst serve_dir_1 = require(\"./lib/serve-dir\");\nconst hasContent = (input) => 'content' in input;\nconst hasPath = (input) => 'path' in input;\nasync function mdToPdf(input, config = {}) {\n    if (!hasContent(input) && !hasPath(input)) {\n        throw new Error('The input is missing one of the properties \"content\" or \"path\".');\n    }\n    if (!config.port) {\n        config.port = await (0, get_port_1.default)();\n    }\n    if (!config.basedir) {\n        config.basedir = 'path' in input ? (0, helpers_1.getDir)(input.path) : process.cwd();\n    }\n    if (!config.dest) {\n        config.dest = '';\n    }\n    const mergedConfig = Object.assign(Object.assign(Object.assign({}, config_1.defaultConfig), config), { pdf_options: Object.assign(Object.assign({}, config_1.defaultConfig.pdf_options), config.pdf_options) });\n    const server = await (0, serve_dir_1.serveDirectory)(mergedConfig);\n    const browser = await puppeteer_1.default.launch(Object.assign({ devtools: config.devtools }, config.launch_options));\n    const pdf = await (0, md_to_pdf_1.convertMdToPdf)(input, mergedConfig, { browser });\n    await browser.close();\n    await (0, serve_dir_1.closeServer)(server);\n    return pdf;\n}\nexports.mdToPdf = mdToPdf;\nexports.default = mdToPdf;\n"]}