{"version":3,"file":"index.cjs","sources":["../../src/vite/utils.ts","../../src/vite/index.ts"],"sourcesContent":["import type { Buffer } from 'node:buffer'\n\nimport { subtle } from 'uncrypto'\n\n/**\n * @see https://stackoverflow.com/a/12101012\n */\nexport function toArrayBuffer(buffer: Buffer) {\n  const arrayBuffer = new ArrayBuffer(buffer.length)\n  const view = new Uint8Array(arrayBuffer)\n  for (let i = 0; i < buffer.length; ++i) {\n    view[i] = buffer[i]\n  }\n  return arrayBuffer\n}\n\n// https://github.com/evanw/thumbhash/blob/main/examples/browser/index.html\nexport function binaryToBase64(binary: Uint8Array) {\n  return btoa(String.fromCharCode(...binary))\n}\n\n/**\n * Hashes the given data using SHA-256 algorithm.\n *\n * Official example by MDN: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest\n * @param {BufferSource} data - The data to be hashed\n * @returns {Promise<string>} - The SHA-256 hash of the message\n */\nasync function digestUint8ArrayDataSha256(data: BufferSource) {\n  const hashBuffer = await subtle.digest('SHA-256', data) // hash the message\n  return Array.from(new Uint8Array(hashBuffer)) // convert buffer to byte array\n}\n\n/**\n * Simulate hash function of rollup.\n *\n * About hashing, please read the documentation of rollup:\n * https://rollupjs.org/configuration-options/#output-hashcharacters\n * https://github.com/rollup/rollup/blob/1b85663fde96d84fceaa2360dba246d3cb92789b/docs/configuration-options/index.md?plain=1#L628\n *\n * For implementation details, please read the source code of rollup:\n * https://github.com/rollup/rollup/blob/1b85663fde96d84fceaa2360dba246d3cb92789b/src/utils/FileEmitter.ts#L259\n * https://github.com/rollup/rollup/blob/1b85663fde96d84fceaa2360dba246d3cb92789b/src/utils/crypto.ts#L12\n *\n * @param {BufferSource} data - The data to be hashed\n * @param {number} length - The length of the hash\n * @returns {Promise<string>} - The first 10 characters of the SHA-256 hash of the message\n */\nexport async function hash(data: BufferSource, length = 10) {\n  const hashResult = await digestUint8ArrayDataSha256(data)\n  const hashBase64 = binaryToBase64(new Uint8Array(hashResult)) // convert bytes to base64 encoded string\n  if (length > 0)\n    return hashBase64.substring(0, length)\n\n  return hashBase64\n}\n\n/**\n * Normalize the base64 string to be used in the URL.\n *\n * @param {string} base64 - The base64 string to be normalized\n * @returns {string} - The normalized base64 string\n */\nexport function normalizeBase64(base64: string) {\n  return base64.replace('/', '_').replace('+', '-').replace('=', '-')\n}\n","import type { EmulatedCanvas2DContext } from 'canvaskit-wasm'\nimport type { Plugin } from 'vite'\nimport type { SiteConfig } from 'vitepress'\n\nimport type { ThumbHash, ThumbHashCalculated } from '../types'\n\nimport { mkdir, readFile, stat, writeFile } from 'node:fs/promises'\nimport { join, relative } from 'node:path'\n\nimport CanvasKitInit from 'canvaskit-wasm'\nimport ora from 'ora'\n\nimport { cyan, gray } from 'colorette'\nimport { rgbaToThumbHash, thumbHashToDataURL } from 'thumbhash'\nimport { glob } from 'tinyglobby'\nimport { normalizePath } from 'vite'\n\nimport { binaryToBase64, hash, normalizeBase64, toArrayBuffer } from './utils'\n\ninterface VitePressConfig {\n  vitepress: SiteConfig\n}\n\n/**\n * Calculate the thumbhash data for the image.\n *\n * Referenced the following implementations:\n * thumbhash/examples/browser/index.html at main · evanw/thumbhash\n * https://github.com/evanw/thumbhash/blob/main/examples/browser/index.html\n *\n * And the following implementations:\n * vite-plugin-thumbhash/packages/core/index.ts at main · cijiugechu/vite-plugin-thumbhash\n * https://github.com/cijiugechu/vite-plugin-thumbhash/blob/main/packages/core/index.ts\n *\n * @param {Uint8Array} imageData - The image data to be calculated\n * @returns {Promise<Omit<ThumbHash, 'fileName' | 'assetUrl' | 'assetUrlWithBase'>>} - The thumbhash data of the image\n */\nasync function calculateThumbHashForFile(imageData: Uint8Array): Promise<ThumbHashCalculated> {\n  const canvasKit = await CanvasKitInit()\n  const image = canvasKit.MakeImageFromEncoded(imageData)\n  if (!image)\n    throw new Error('Failed to make image from encoded data.')\n\n  const width = image.width()\n  const height = image.height()\n\n  const scale = 100 / Math.max(width, height)\n  const resizedWidth = Math.round(width * scale)\n  const resizedHeight = Math.round(height * scale)\n\n  // Paint the image to the canvas.\n  const canvas = canvasKit.MakeCanvas(resizedWidth, resizedHeight)\n  const context = canvas.getContext('2d')! as EmulatedCanvas2DContext\n  context.drawImage(image as unknown as CanvasImageSource, 0, 0, resizedWidth, resizedHeight)\n  // Retrieve back the image data for thumbhash calculation as the\n  // form of RGBA matrix.\n  const pixels = context.getImageData(0, 0, resizedWidth, resizedHeight)\n\n  // Easy calculation of thumbhash data.\n  const thumbHashBinary = rgbaToThumbHash(pixels.width, pixels.height, pixels.data)\n  // Encode the thumbhash data to base64 and data URL.\n  const thumbHashBase64 = binaryToBase64(thumbHashBinary)\n  const thumbHashDataURL = await thumbHashToDataURL(thumbHashBinary)\n\n  return {\n    dataBase64: thumbHashBase64,\n    dataUrl: thumbHashDataURL,\n    width: resizedWidth,\n    height: resizedHeight,\n    originalWidth: width,\n    originalHeight: height,\n  }\n}\n\nfunction createThumbHashDataFromThumbHash(\n  rootDir: string,\n  assetDir: string,\n  baseUrl: string,\n  imageFileName: string,\n  imageFullFileName: string,\n  imageFullHash: string,\n  imageFileHash: string,\n  thumbHash: ThumbHashCalculated,\n): ThumbHash {\n  const fileName = relative(rootDir, imageFileName)\n\n  const thumbhashData: ThumbHash = {\n    ...thumbHash,\n    assetFileName: normalizePath(relative(rootDir, imageFullFileName)),\n    assetFullFileName: normalizePath(imageFullFileName),\n    assetFullHash: imageFullHash,\n    assetFileHash: imageFileHash,\n    assetUrl: normalizePath(join(assetDir, fileName)),\n    assetUrlWithBase: normalizePath(join(baseUrl, assetDir, fileName)),\n  }\n\n  // Since assets url is used to refer to the image when rendered\n  // in the HTML, we need to ensure that the asset URL starts with a slash\n  // where base is not included.\n  if (!thumbhashData.assetUrlWithBase.startsWith('/'))\n    thumbhashData.assetUrlWithBase = `/${thumbhashData.assetUrlWithBase}`\n\n  return thumbhashData\n}\n\nfunction getCacheDir(vitePressCacheDir: string) {\n  return join(vitePressCacheDir, '@nolebase', 'vitepress-plugin-thumbnail-hash', 'thumbhashes')\n}\n\nfunction getMapFilename(cacheDir: string) {\n  return join(cacheDir, 'map.json')\n}\n\nasync function exists(path: string) {\n  try {\n    await stat(path)\n    return true\n  }\n  catch (error) {\n    if (!(error instanceof Error))\n      throw error\n    if (!('code' in error))\n      throw error\n    if (error.code !== 'ENOENT')\n      throw error\n\n    return false\n  }\n}\n\nasync function mkdirIfNotExist(dir: string) {\n  const targetDirExists = await exists(dir)\n  if (targetDirExists)\n    return\n\n  await mkdir(dir, { recursive: true })\n}\n\nasync function readCachedMapFile(path: string): Promise<Record<string, ThumbHash>> {\n  const targetPathExists = await exists(path)\n  if (!targetPathExists)\n    return {}\n\n  const content = await readFile(path)\n  return JSON.parse(content.toString('utf-8'))\n}\n\n/**\n * The Vite plugin to pre-process images and generate thumbhash data for them.\n *\n * @returns {Plugin} - The Vite plugin instance\n */\nexport function ThumbnailHashImages(): Plugin {\n  return {\n    name: '@nolebase/vitepress-plugin-thumbnail-hash/images',\n    enforce: 'pre',\n    config() {\n      return {\n        optimizeDeps: {\n          exclude: [\n            '@nolebase/vitepress-plugin-thumbnail-hash/client',\n          ],\n        },\n        ssr: {\n          noExternal: [\n            '@nolebase/vitepress-plugin-thumbnail-hash',\n          ],\n        },\n      }\n    },\n    async configResolved(config) {\n      const root = config.root\n      const vitepressConfig = (config as unknown as VitePressConfig).vitepress\n\n      const startsAt = Date.now()\n\n      const moduleNamePrefix = cyan('@nolebase/vitepress-plugin-thumbnail-hash/images')\n      const grayPrefix = gray(':')\n      const spinnerPrefix = `${moduleNamePrefix}${grayPrefix}`\n\n      const spinner = ora({ discardStdin: false, isEnabled: config.command === 'serve' })\n\n      spinner.start(`${spinnerPrefix} Prepare to generate hashes for images...`)\n\n      const cacheDir = getCacheDir(vitepressConfig.cacheDir)\n      await mkdirIfNotExist(cacheDir)\n      const thumbhashMap = await readCachedMapFile(getMapFilename(cacheDir))\n\n      spinner.text = `${spinnerPrefix} Searching for images...`\n\n      const files = await glob(`${root}/**/*.+(jpg|jpeg|png)`, { onlyFiles: true })\n\n      spinner.text = `${spinnerPrefix} Calculating thumbhashes for images...`\n\n      const thumbhashes = await Promise.all(files.map(async (file) => {\n        const cacheHit: ThumbHash | undefined = thumbhashMap[normalizePath(relative(root, file))]\n        if (cacheHit)\n          return cacheHit\n\n        const readImageRawData = await readFile(file)\n\n        // The hash implementation is mirrored and simulated from the rollup.\n        // But it's never guaranteed to be the same as the rollup's hash.\n        const imageFullHash = await hash(toArrayBuffer(readImageRawData), -1)\n        const imageFileHash = normalizeBase64(imageFullHash.substring(0, 10))\n\n        // Calculate the thumbhash data for the image as thumbhash demonstrates.\n        const calculatedThumbhashData = await calculateThumbHashForFile(readImageRawData)\n\n        // Construct the thumbhash data for the image.\n        return createThumbHashDataFromThumbHash(\n          root,\n          vitepressConfig.assetsDir,\n          vitepressConfig.site.base,\n          file,\n          file,\n          imageFullHash,\n          imageFileHash,\n          calculatedThumbhashData,\n        )\n      }))\n\n      spinner.text = `${spinnerPrefix} Aggregating calculated thumbhash data...`\n\n      for (const thumbhash of thumbhashes)\n        thumbhashMap[thumbhash.assetFileName] = thumbhash\n\n      spinner.text = `${spinnerPrefix} Writing thumbhash data to cache...`\n\n      await writeFile(getMapFilename(cacheDir), JSON.stringify(thumbhashMap, null, 2))\n\n      const elapsed = Date.now() - startsAt\n      spinner.succeed(`${spinnerPrefix} Done. ${gray(`(${elapsed}ms)`)}`)\n    },\n  }\n}\n"],"names":["subtle","CanvasKitInit","rgbaToThumbHash","thumbHashToDataURL","relative","normalizePath","join","stat","mkdir","readFile","cyan","gray","ora","glob","writeFile"],"mappings":";;;;;;;;;;;;;;;;;AAOO,SAAS,cAAc,MAAA,EAAgB;AAC5C,EAAA,MAAM,WAAA,GAAc,IAAI,WAAA,CAAY,MAAA,CAAO,MAAM,CAAA;AACjD,EAAA,MAAM,IAAA,GAAO,IAAI,UAAA,CAAW,WAAW,CAAA;AACvC,EAAA,KAAA,IAAS,IAAI,CAAA,EAAG,CAAA,GAAI,MAAA,CAAO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