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T,MAAM,EAAQ,SACR,EAAe,EAAa,GAC/B,QAAQ,MAAO,IACf,QAAQ,SAAU,KAGf,EAAY,EAGlB,GAAI,UAAY,SAAS,IAAI,GAC3B,OAAO,SAAS,IAAI,GAItB,MAAM,EAAS,eAAe,GAa9B,OAPA,cAAc,oBAAqB,EAHb,EAAa,MAAM,GAAO,KAAK,IAMjD,UACF,SAAS,IAAI,EAAW,GAGnB,CACT,CAQA,SAAS,cAAc,GACrB,MAAM,EAAU,GAEhB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CACpC,MAAM,EAAM,EAAK,GACjB,IAAK,EAAK,SAEV,MAAM,SAAiB,EAGvB,GAAgB,WAAZ,GAAoC,WAAZ,GAS5B,GAAI,MAAM,QAAQ,GAAlB,CACE,MAAM,EAAQ,cAAc,GACxB,GACF,EAAQ,KAAK,EAGjB,MAGA,GAAgB,WAAZ,EACF,IAAK,MAAM,KAAO,EAChB,GAAI,OAAO,UAAU,eAAe,KAAK,EAAK,IAAQ,EAAI,GAAM,CAC9D,MAAM,EAAU,EAAI,OAChB,GACF,EAAQ,KAAK,EAEjB,MAzBJ,CACE,MAAM,EAAU,OAAO,GAAK,OACxB,GACF,EAAQ,KAAK,EAGjB,CAsBF,CAEA,OAAO,EAAQ,KAAK,IACtB,CAQA,SAAS,gBACH,UACF,SAAS,OAEb,CAGsB,oBAAX,QAA0B,OAAO,QAC1C,OAAO,QAAU,CACf,gBACA,sBACA,6BAIwB,oBAAZ,UACd,QAAQ,QAAU,QAClB,QAAQ,WAAa,WACrB,QAAQ,cAAgB","file":"/npm/css-hash@2.0.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/css-hash@2.0.0/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","'use strict';\n\n/**\r\n * Calculates a hash from a string using djb2 algorithm\r\n * @param {number} h - Hash seed\r\n * @param {string} x - String to hash\r\n * @returns {number} The calculated hash\r\n * @private\r\n */\r\nfunction phash(h, x) {\r\n  let i = x.length;\r\n  while (i) {\r\n    h = (h * 33) ^ x.charCodeAt(--i);\r\n  }\r\n  return h;\r\n}\r\n\r\n/**\r\n * Generates a hash from a string\r\n * @param {string} x - String to hash\r\n * @returns {number} The calculated hash\r\n * @private\r\n */\r\nfunction hash(x) {\r\n  return phash(5381, x);\r\n}\r\n\r\n/**\r\n * Gets an alphabetic character from a code\r\n * @param {number} code - The character code\r\n * @returns {string} The alphabetic character\r\n * @private\r\n */\r\nfunction getAlphabeticChar(code) {\r\n  return String.fromCharCode(code + (code > 25 ? 39 : 97));\r\n}\r\n\r\n/**\r\n * Generates an alphabetic name from a code\r\n * @param {number} code - The code to convert\r\n * @returns {string} The generated name\r\n * @private\r\n */\r\nfunction generateAlphabeticName(code) {\r\n  const charsLength = 52;\r\n  let name = \"\";\r\n  let x;\r\n  for (x = Math.abs(code); x > charsLength; x = (x / charsLength) | 0) {\r\n    name = getAlphabeticChar(x % charsLength) + name;\r\n  }\r\n  return (getAlphabeticChar(x % charsLength) + name).replace(\r\n    /(a)(d)/gi,\r\n    \"$1-$2\"\r\n  );\r\n}\r\n\r\n/**\r\n * Generates a random ID\r\n * @returns {string} A random ID\r\n * @private\r\n */\r\nfunction generateId() {\r\n  return Math.random().toString(36).slice(2).slice(0, 9);\r\n}\r\n\r\n/**\r\n * Generates a hash ID from a string\r\n * @param {string} str - The string to hash\r\n * @returns {string} The generated hash ID\r\n * @private\r\n */\r\nfunction generateHashId(str) {\r\n  return generateAlphabeticName(hash(str) >>> 0);\r\n}\r\n\r\n/**\r\n * Adds a stylesheet to the document\r\n * @param {string} attributeId - The attribute ID for the style tag\r\n * @param {string} attributeValue - The attribute value for the style tag\r\n * @param {string} cssString - The CSS content\r\n * @private\r\n */\r\nfunction addStyleSheet(attributeId, attributeValue, cssString) {\r\n  // Check if we're in a browser environment\r\n  if (typeof document === 'undefined') return;\r\n  \r\n  try {\r\n    // Make the selector safe for querySelector by escaping any special characters\r\n    const safeAttributeValue = attributeValue.replace(/\"/g, '\\\\\"');\r\n    const isElementExist = document.querySelector(\r\n      `style[${attributeId}=\"${safeAttributeValue}\"]`\r\n    );\r\n    \r\n    if (!isElementExist) {\r\n      const head = document.head || document.getElementsByTagName(\"head\")[0];\r\n      if (!head) return; // Safety check\r\n      \r\n      const style = document.createElement(\"style\");\r\n      style.setAttribute(\"type\", \"text/css\");\r\n      style.setAttribute(attributeId, attributeValue);\r\n      \r\n      // Handle IE style sheets\r\n      if ('styleSheet' in style) {\r\n        // @ts-ignore - styleSheet is supported in IE\r\n        style.styleSheet.cssText = cssString;\r\n      } else {\r\n        style.appendChild(document.createTextNode(cssString));\r\n      }\r\n      \r\n      head.appendChild(style);\r\n    }\r\n  } catch (error) {\r\n    // Silent fail - don't break the application if style injection fails\r\n    console.warn('CSS-Hash: Error injecting stylesheet', error);\r\n  }\r\n}\r\n\r\n// Cache for storing previously generated CSS\r\nconst cssCache = typeof Map !== 'undefined' ? new Map() : null;\r\n\r\n/**\r\n * Creates a CSS class with a unique hash ID based on the provided CSS string\r\n * @param {function(string):string} getCssString - Function that receives a substitute class name and returns a CSS string\r\n * @returns {string} The generated hash ID to use as a CSS class name\r\n */\r\nfunction cssHash(getCssString) {\r\n  if (typeof getCssString !== \"function\") {\r\n    return \"\";\r\n  }\r\n\r\n  // Use a temporary ID to compute the raw CSS\r\n  const tmpId = \"TMP_ID\";  // Using a consistent placeholder for hashing\r\n  const rawCssString = getCssString(tmpId)\r\n    .replace(/\\n/g, \"\")\r\n    .replace(/\\s\\s+/g, \" \");\r\n  \r\n  // Create a signature for caching\r\n  const signature = rawCssString;\r\n\r\n  // Check cache first if available\r\n  if (cssCache && cssCache.has(signature)) {\r\n    return cssCache.get(signature);\r\n  }\r\n  \r\n  // Generate a deterministic hash ID based on the CSS content\r\n  const hashId = generateHashId(signature);\r\n  \r\n  // Replace the temporary ID with the actual hash ID\r\n  const hashCssString = rawCssString.split(tmpId).join(hashId);\r\n  \r\n  // Add the style to the document\r\n  addStyleSheet(\"data-inline-style\", hashId, hashCssString);\r\n  \r\n  // Store in cache if available\r\n  if (cssCache) {\r\n    cssCache.set(signature, hashId);\r\n  }\r\n  \r\n  return hashId;\r\n}\r\n\r\n/**\r\n * Combines multiple class names into a single string, filtering out falsy values\r\n * Supports strings, numbers, arrays, and objects with boolean values\r\n * @param {...any} args - Class names to combine\r\n * @returns {string} Combined class names as a string\r\n */\r\nfunction classNames(...args) {\r\n  const classes = [];\r\n  \r\n  for (let i = 0; i < args.length; i++) {\r\n    const arg = args[i];\r\n    if (!arg) continue; // Skip falsy values: null, undefined, false, 0, \"\"\r\n    \r\n    const argType = typeof arg;\r\n    \r\n    // Handle strings and numbers\r\n    if (argType === 'string' || argType === 'number') {\r\n      const trimmed = String(arg).trim();\r\n      if (trimmed) {\r\n        classes.push(trimmed);\r\n      }\r\n      continue;\r\n    }\r\n    \r\n    // Handle arrays recursively\r\n    if (Array.isArray(arg)) {\r\n      const inner = classNames(...arg); // Recursive call\r\n      if (inner) {\r\n        classes.push(inner);\r\n      }\r\n      continue;\r\n    }\r\n    \r\n    // Handle objects - include keys where the value is truthy\r\n    if (argType === 'object') {\r\n      for (const key in arg) {\r\n        if (Object.prototype.hasOwnProperty.call(arg, key) && arg[key]) {\r\n          const trimmed = key.trim();\r\n          if (trimmed) {\r\n            classes.push(trimmed);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  \r\n  return classes.join(' ');\r\n}\r\n\r\n\r\n\r\n/**\r\n * Clears the internal CSS cache\r\n * Useful for testing or when you need to reset the styling\r\n */\r\nfunction clearCssCache() {\r\n  if (cssCache) {\r\n    cssCache.clear();\r\n  }\r\n}\r\n\r\n// For CommonJS environments\r\nif (typeof module !== 'undefined' && module.exports) {\r\n  module.exports = {\r\n    cssHash,\r\n    classNames,\r\n    clearCssCache\r\n  };\r\n}\r\n// For ESM environments\r\nelse if (typeof exports !== 'undefined') {\r\n  exports.cssHash = cssHash;\r\n  exports.classNames = classNames;\r\n  exports.clearCssCache = clearCssCache;\r\n}\r\n\r\n\r\n"]}