/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/codeblock@0.4.0-pre.3/codeblock.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const PATH=require("path"),FS=require("fs"),JSONLINT=require("jsonlint");exports.DEBUG=/(^|\s)codeblock(\s|$)/.test(process.env.DEBUG||"")||!1,exports.DEBUG&&require("colors");const CODEBLOCK_BROWSER=require("./codeblock.browser");Object.keys(CODEBLOCK_BROWSER).forEach((function(e){exports[e]=CODEBLOCK_BROWSER[e]})),CODEBLOCK_BROWSER.DEBUG=exports.DEBUG,CODEBLOCK_BROWSER.VM=require("vm"),CODEBLOCK_BROWSER.JSONLINT=JSONLINT,exports.purifySync=function(e,r){void 0===(r=r||{}).cacheCompiled&&(r.cacheCompiled=!0);var o=PATH.join(PATH.dirname(e),".~"+PATH.basename(e)+"~codeblock-purified.js");if(r.cacheCompiled&&FS.existsSync(o)&&FS.statSync(o).mtime.getTime()>=FS.statSync(e).mtime.getTime()&&!process.env.CODEBLOCK_FORCE_COMPILE)return{sourcePath:e,code:FS.readFileSync(o,"utf8"),purifiedPath:o};var t=e;return/^\//.test(t)&&(t=FS.readFileSync(e,"utf8")),(t=exports.purifyCode(t,r))._foundBlocks?(r.cacheCompiled&&FS.writeFileSync(o,t,"utf8"),{sourcePath:e,code:t,purifiedPath:o}):{sourcePath:e,code:t}};var originalRequire=null;exports.unpatchGlobalRequire=function(){if(!originalRequire)throw new Error("Global require not patched");require("module").prototype.require=originalRequire,originalRequire=null},exports.patchGlobalRequire=function(){const e=require("module");originalRequire=e.prototype.require,e.prototype.require=function(r){var o=e._resolveFilename(r,this);if(FS.existsSync(o)){var t=exports.purifySync(o);if(t.purifiedPath){exports.DEBUG&&console.log("RUN CODE >>>>".yellow),exports.DEBUG&&process.stdout.write(t.code+"\n"),exports.DEBUG&&console.log("<<<< RUN CODE".yellow);var i=new e(t.sourcePath,this);return i.parent=this,i.filename=t.sourcePath,i.paths=e._nodeModulePaths(PATH.dirname(t.sourcePath)),i.loaded=!0,i._compile(t.code.toString(),t.sourcePath),e._cache[t.sourcePath]=i,i.exports}}try{return originalRequire.call(this,r)}catch(e){throw console.error("ERROR require(uri)",r),console.error(e.stack),e}}},exports.makeRequire=function(e,r){r=r||{};const o=require("module");return function(t){var i=e.resolve(t),s=exports.purifySync(i,r);if(!s.purifiedPath)return e(i);exports.DEBUG&&console.log("RUN CODE >>>>".yellow),exports.DEBUG&&process.stdout.write(s.code+"\n"),exports.DEBUG&&console.log("<<<< RUN CODE".yellow);var c=new o(s.sourcePath,this);return c.parent=this,c.filename=s.sourcePath,c.paths=o._nodeModulePaths(PATH.dirname(s.sourcePath)),c.loaded=!0,c._compile(s.code.toString(),s.sourcePath),o._cache[s.sourcePath]=c,c.exports}};
//# sourceMappingURL=/sm/b2b194b1552bf219d01bd1930770851228e156b660a1cf5c6517ded3c25a2555.map