{"version":3,"sources":["jsdelivr-header.js","/npm/netlify-plugin-cecil-cache@0.3.4/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,aAAe,CAAC,EAAW,IAAW,CAC1C,EAAO,UAAY,QAAQ,IAAI,iBAG3B,WAAc,IAClB,EAAM,SAAQ,CAAC,EAAM,KACnB,QAAQ,IAAI,GAAG,EAAQ,MAAM,IAAO,GACpC,EAGJ,OAAO,QAAU,CACf,gBAAM,EAAW,UAAC,EAAS,OAAE,EAAM,MAAE,IAC/B,QAAQ,QAAU,EAAU,aAC9B,EAAM,MAAM,UACV,wDAAwD,EAAU,kBAItE,MAAM,EAAY,aAAa,EAAW,GAE1C,SAAU,EAAM,MAAM,QAAQ,GAAY,CACxC,MAAM,QAAsB,EAAM,MAAM,OAExC,EAAM,OAAO,KAAK,CAChB,MAAO,EAAc,OAAS,0BAC9B,QAAS,+CAAiD,EAAc,OAAS,cAEnF,QAAQ,IAAI,mEAAoE,EAAc,OAAQ,EAAU,KAAK,QACjH,EAAO,OAAS,QAAQ,IAAI,cAAa,WAAW,EAC1D,MACE,QAAQ,IAAI,mBAEhB,EACA,iBAAM,EAAY,UAAC,EAAS,OAAE,EAAM,MAAE,IACpC,MAAM,EAAY,aAAa,EAAW,GAE1C,SAAU,EAAM,MAAM,KAAK,GAAY,CACrC,MAAM,QAAsB,EAAM,MAAM,OAExC,EAAM,OAAO,KAAK,CAChB,MAAO,EAAc,OAAS,wBAC9B,QAAS,iDAAmD,EAAc,OAAS,cAErF,QAAQ,IAAI,qEAAsE,EAAc,OAAQ,EAAU,KAAK,QACnH,EAAO,OAAS,QAAQ,IAAI,cAAa,WAAW,EAC1D,MACE,QAAQ,IAAI,2BAEhB","file":"/npm/netlify-plugin-cecil-cache@0.3.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/netlify-plugin-cecil-cache@0.3.4/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","const getCacheDirs = (constants, inputs) => [\n  inputs.cacheDir || process.env.CECIL_CACHE_DIR\n];\n\nconst printDebug = (items) => {\n  items.forEach((item, index) => {\n    console.log(`${index + 1}. ${item}`);\n  });\n}\n\nmodule.exports = {\n  async onPreBuild({constants, inputs, utils}) {\n    if (process.cwd() === constants.PUBLISH_DIR) {\n      utils.build.failBuild(\n        `Your site’s publish directory is not set correctly (“${constants.PUBLISH_DIR}”).`\n      );\n    }\n\n    const cacheDirs = getCacheDirs(constants, inputs);\n\n    if (await utils.cache.restore(cacheDirs)) {\n      const cachedFolders = await utils.cache.list();\n\n      utils.status.show({\n        title: cachedFolders.length + ' cache folders restored',\n        summary: 'Cecil’s cache restored from previous build. ' + cachedFolders.length + ' folders.'\n      })\n      console.log('%s folders from Cecil’s cache (%s) restored from previous build.', cachedFolders.length, cacheDirs.join(', '));\n      if (inputs.debug || process.env.CECIL_DEBUG) printDebug(cachedFolders);\n    } else {\n      console.log('Cache not found.');\n    }\n  },\n  async onPostBuild({constants, inputs, utils}) {\n    const cacheDirs = getCacheDirs(constants, inputs);\n\n    if (await utils.cache.save(cacheDirs)) {\n      const cachedFolders = await utils.cache.list();\n\n      utils.status.show({\n        title: cachedFolders.length + ' cache folders stored',\n        summary: 'Cecil’s cache stored to speed up next builds. ' + cachedFolders.length + ' folders.'\n      })\n      console.log('%s folders from Cecil’s cache (%s) stored to speed up next builds.', cachedFolders.length, cacheDirs.join(', '));\n      if (inputs.debug || process.env.CECIL_DEBUG) printDebug(cachedFolders);\n    } else {\n      console.log('Cecil’s cache not found.');\n    }\n  },\n};\n"]}