{"version":3,"sources":["jsdelivr-header.js","/npm/rollup-plugin-templatejs@3.1.4/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;8xCCIyB,SAAA,QAAqB,IAArB,EAAA,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAmB,GAC1C,EAA8B,EAAU,kBACtC,CACE,QAAS,CAAC,aACV,QAAS,mBAEX,GALM,EAAO,EAAP,QAAS,EAAO,EAAP,QAQX,EAAS,+BAAa,EAAS,GAIrC,MAAO,CACL,UAAS,SAAC,EAAa,GACrB,GAAK,EAAO,GAAZ,CAEA,EAAQ,QAAU,KAAK,SAAS,GAEhC,IAAM,EAAS,uBAAW,EAAG,8BAAA,GAAO,GAAO,IAAE,WAAY,cAIzD,MAAO,CACL,KAHY,8DAAA,OAAiE,GAI7E,IAAK,CAAE,SAAU,IAVF,CAYnB,EAEJ,C","file":"/npm/rollup-plugin-templatejs@3.1.4/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/rollup-plugin-templatejs@3.1.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","import path from 'path';\nimport { createFilter } from 'rollup-pluginutils';\nimport { extendDeep } from '@jsmini/extend';\nimport { precompile, PrecompileOption } from '@templatejs/precompiler';\n\nexport interface Options extends PrecompileOption {\n  include?: string[] | string;\n  exclude?: string[] | string;\n}\n\nexport default function (options: Options = {}): object {\n  const { include, exclude } = (options = extendDeep(\n    {\n      include: ['**/*.tmpl'],\n      exclude: 'node_modules/**',\n    },\n    options,\n  ) as Options);\n\n  const filter = createFilter(include, exclude);\n\n  // var sourceMap = options.sourceMap !== false;\n\n  return {\n    transform(tpl: string, id: string): object | undefined {\n      if (!filter(id)) return;\n\n      options.tplName = path.basename(id);\n\n      const source = precompile(tpl, { ...options, expression: 'template' });\n\n      const compiled = `import template from '@templatejs/runtime'; export default ${source}`;\n\n      return {\n        code: compiled,\n        map: { mappings: '' },\n      };\n    },\n  };\n}\n"]}