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AC1C,MAAO,SAAS,EAAQ,EAAM,IAC9B,OAAQ,SAAS,EAAS,EAAM,MAElC,IAAI,GAAO,EAAA,UAAA,SAAE,SAKb,OAJA,EAAK,KAAK,QAAS,GACnB,EAAK,KAAK,SAAU,GACpB,EAAK,KAAK,MAAV,yBAA0C,EAAI,SAAS,WACvD,EAAO,gBAAgB,EAAM,GACtB,kBAAE,KAAK,EACf,CAEM,SAAS,MAAM,EAAM,EAAO,EAAO,EAAQ,GAChD,OAAO,IAAI,EAAM,EAAO,EAAO,EAAQ,EAAO,EAC/C,CAEM,SAAS,MAAM,EAAM,EAAO,EAAO,EAAQ,GAChD,OAAO,IAAI,EAAM,EAAO,EAAO,EAAQ,EAAO,EAC/C,C,gBAEc,CACb,gBACA,YACA,oCACA,QACA,QACA,QACA,YACA","file":"/npm/font-awesome-assets-updated@1.0.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/font-awesome-assets-updated@1.0.1/lib/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","\nimport $ from 'cheerio';\nimport svg2png from 'svg2png';\nimport _ from 'lodash';\nimport svgfont2js from 'svgfont2js';\nimport fs from 'fs';\n\nfunction applyAttributes($el, attrs) {\n  // [ [ attr, val ], ... ]\n  if (!_.isArray(attrs) || attrs.length === 0)\n    return $el;\n  const hasMissing = _.some(attrs, pair => {\n    return !_.isArray(pair) || pair.length !== 2;\n  });\n  if (hasMissing) throw new Error('attribute pairs must be arrays with two keys [ attr, val ]');\n  _.each(attrs, pair => {\n    $el.attr(pair[0], pair[1]);\n  });\n  return $el;\n}\n\n// inspired by <https://github.com/riobard/font-awesome-svg/blob/master/extract.js>\n\nfunction loadAliases(less) {\n\n  const pairs = _.compact(_.map(less.split('\\n'), line => {\n\n    // line is `@fa-var-dropbox: \"\\f16b\";`\n    if (line.indexOf('@fa-var-') !== 0) return;\n\n    // now it is `dropbox: \"\\f16b\";`\n    line = line.split('@fa-var-', 2)[1];\n\n    // split the line by the `: ` delimiter\n    line = line.split(': ');\n\n    // now we have a line array that looks like:\n    // [0] = `dropbox`\n    // [1] = \"\\f16b\";`\n\n    // clean up the first key\n    line[1] = line[1].split('\"')[1].substring(1);\n\n    return { name: line[0], unicode: line[1] };\n\n  }));\n\n  return _.zipObject(\n    _.map(pairs, 'name'),\n    _.map(pairs, 'unicode')\n  );\n\n}\n\nexport const aliases = loadAliases(\n  fs.readFileSync(\n    require.resolve('@fortawesome/fontawesome-free/less/_variables.less'),\n    'utf8'\n  )\n);\n\nexport const icons = svgfont2js(\n  fs.readFileSync(\n    require.resolve('@fortawesome/fontawesome-free/webfonts/fa-solid-900.svg'),\n    'utf8'\n  )\n);\n\nexport const iconsByUnicodeHex = _.zipObject(\n  _.map(icons, 'unicode_hex'),\n  icons\n);\n\nexport function svg(name, color, width, height, attrs) {\n\n  // set defaults\n  name = name || 'smile-o';\n  color = color || '#000';\n  width = (width || '100%').toString();\n  height = (height || '100%').toString();\n\n  // check variable types\n  if (!_.isString(name)) throw new Error('fa.svg `name` must be a String');\n  if (!_.isString(color)) throw new Error('fa.svg `color` must be a String');\n\n  // convert name to lowercase\n  name = name.toLowerCase();\n\n  // remove \"fa-\" prefix from name if it exists\n  if (name.indexOf('fa-') === 0)\n    name = name.substring(3);\n\n  // ensure that the font exists, otherwise throw an error\n  if (!_.isString(aliases[name]))\n    throw new Error(`fa.svg name \"${name}\" must be a valid FontAwesome icon name`);\n\n  // get the icon svg information\n  const icon = iconsByUnicodeHex[aliases[name]];\n\n  // ensure that the font svg exists, otherwise throw an error\n  if (!_.isObject(icon))\n    throw new Error(`fa.svg name \"${name}\" was missing its font SVG value parsed`);\n\n  // return the svg\n  let $svg = $('<svg>', {\n    xmlMode: true\n  });\n  $svg.attr('xmlns', 'http://www.w3.org/2000/svg');\n  $svg.attr('width', width);\n  $svg.attr('height', height);\n  $svg.attr('viewBox', `0 0 ${icon.width} ${icon.height}`);\n  $svg = applyAttributes($svg, attrs);\n  $svg.append(`<path fill=\"${color}\" d=\"${icon.path}\" />`);\n  return $.html($svg);\n\n}\n\nexport function img(name, color, width, height, attrs) {\n  const str = svg(name, color);\n  let $img = $('<img>');\n  $img.attr('width', width);\n  $img.attr('height', height);\n  $img.attr('src', `data:image/svg+xml;base64,${new Buffer(str, 'binary').toString('base64')}`);\n  $img = applyAttributes($img, attrs);\n  return $.html($img);\n}\n\nexport function png(name, color, width, height, attrs, size) {\n  let str = svg(name, color);\n  width = parseInt(width, 10) || 16;\n  height = parseInt(height, 10) || 16;\n  size = parseInt(size, 10) || 1;\n  if (!_.isNumber(width)) throw new Error('fa.png width must be a number');\n  if (!_.isNumber(height)) throw new Error('fa.png height must be a number');\n  str = svg2png.sync(new Buffer(str, 'utf8'), {\n    width: parseInt(width * size, 10),\n    height: parseInt(height * size, 10)\n  });\n  let $img = $('<img>');\n  $img.attr('width', width);\n  $img.attr('height', height);\n  $img.attr('src', `data:image/png;base64,${str.toString('base64')}`);\n  $img = applyAttributes($img, attrs);\n  return $.html($img);\n}\n\nexport function png2x(name, color, width, height, attrs) {\n  return png(name, color, width, height, attrs, 2);\n}\n\nexport function png3x(name, color, width, height, attrs) {\n  return png(name, color, width, height, attrs, 3);\n}\n\nexport default {\n  aliases,\n  icons,\n  iconsByUnicodeHex,\n  img,\n  svg,\n  png,\n  png2x,\n  png3x\n};\n"]}