{"version":3,"sources":["jsdelivr-header.js","/npm/free-flag-icons@0.1.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,UAAW,oBACX,YAAa,iBACb,cAAe,4BACf,SAAU,cACR,OAAQ,uBAA0B,aAE1C,WACG,IAAK,MAAM,KAAS,OAAQ,CACxB,MAAM,EAAM,oCAAoC,KAC1C,QAAiB,MAAM,GACvB,QAAa,EAAS,OAEtB,EADI,QAAQ,KAAK,EACR,CAAE,sBAAsB,UAEvC,IAAK,MAAM,KAAS,EAAQ,CACxB,MAAM,EAAM,EAAM,QAAQ,IAAI,QAAQ,KAAM,OACtC,EAAU,EAAM,QAAQ,IAAI,OAC5B,EAAO,mBAAmB,IAAY,EACtC,EAAO,UAAU,cAAc,EAAM,MAE3C,GAAI,EAAM,CACN,MAAM,QAAc,KAAK,KAAK,GACxB,EAAW,KAAK,KAAS,EAAK,0BAEpC,EAAM,QAAQ,IAAI,MAAM,GACxB,QAAQ,IAAI,aAAa,EAAK,uBAAuB,IACzD,CACJ,CACJ,CACH,EAvBA","file":"/npm/free-flag-icons@0.1.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/free-flag-icons@0.1.2/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","import fetch from 'node-fetch'\nimport cheerio from 'cheerio'\nimport countries from 'i18n-iso-countries'\nimport jimp from 'jimp'\nimport { styles, rawToOfficialNames } from './utils.js'\n\n;(async () => {\n    for (const style of styles) {\n        const url = `http://www.freeflagicons.com/buy/${style}/`\n        const response = await fetch(url)\n        const html = await response.text()\n        const $ = cheerio.load(html)\n        const images = $('.span-2.center img').toArray()\n    \n        for (const image of images) {\n            const url = image.attribs.src.replace('64', '640')\n            const rawName = image.attribs.alt.trim()\n            const name = rawToOfficialNames[rawName] || rawName\n            const code = countries.getAlpha2Code(name, 'en')\n\n            if (code) {\n                const image = await jimp.read(url)\n                const filename = `./${style}/${code.toLocaleLowerCase()}.jpg`\n                \n                image.quality(60).write(filename)\n                console.log(`collected ${name.toLocaleLowerCase()} ${style}`)\n            }\n        }\n    }\n})()"]}