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KAAK,UAGjB,KAAK,SACP,KAAK,eAEL,KAAK,gBAET,CACA,cAAA,GACE,KAAK,SAAW,aAAY,KAC1B,MAAM,EAAI,SAAU,KAAK,MAAQ,KAAK,SAAY,KAAK,WACvD,QAAQ,OAAO,MACb,KAAK,MAAM,GACZ,GACA,KAAK,aACV,CACA,KAAA,CAAM,GACJ,MAAM,EAAM,KAAK,MAAM,GAAG,GACxB,KAAK,UACL,KAAK,MAAM,GACP,EAAK,KAAK,aAAe,KAAK,aAAe,EAC7C,EAAU,KAAK,IAAI,KAAK,OAAS,EAAI,OAAS,KAAK,YAAY,OAAS,GAAK,GAEnF,MAAO,IAAI,OAAO,GAAW,EAAM,KAAK,YAAc,IAAI,OAAO,KAAK,cAAgB,IACxF,CACA,YAAA,GACE,IAAI,EAAW,EACf,KAAK,SAAW,aAAY,KAC1B,MAAM,EAAI,EAAW,KAAK,UAC1B,QAAQ,OAAO,MACb,KAAK,MAAM,IAEb,GAAU,GACT,KAAK,aACV,CAEA,QAAA,GACE,YAAW,KACL,KAAK,WACP,cAAc,KAAK,UACnB,QAAQ,OAAO,MACb,MAEJ,GACC,KAAK,aACV,CAEA,SAAA,GACE,OAAQ,KAAK,UAET,GADA,GAAG,KAAK,aAAa,KAAK,YAAY,KAAK,YAAY,KAAK,MAElE,CACA,KAAA,CAAM,EAAG,GACP,OAAK,IAAU,KAAK,UAAc,GAAS,KAAK,QACvC,KAAK,QAAQ,EAAG,KAAK,YAEvB,KAAK,QAAQ,KAAK,UAAY,EAAI,EAAG,KAAK,YACnD,CACA,OAAA,CAAQ,EAAO,GACb,OAAI,EAAQ,GAAK,EAAO,OAAS,EACxB,EAAO,OAAO,KAAK,IAAI,SAAS,EAAQ,EAAO,QAAS,IAE1D,EACT,EAGF,OAAO,QAAU","file":"/npm/load-emoji@0.1.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/load-emoji@0.1.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","class EmojiBar {\n  constructor(config) {\n    //TODO check if int\n    //TODO rename state to indo\n    this.startValue = config && config.start ? config.start : 0;\n    this.endValue = config && config.end ? config.end : 100;\n    this.isLoader = config && config.isLoader ? config.isLoader : false;\n    this.hideState = config && config.hideState ? config.hideState : false;\n    this.autostart = config && config.autostart ? config.autostart : false;\n    this.reverse = config && config.reverse ? config.reverse : false;\n    this.indicator = config && config.indicator ? config.indicator : '❤️';\n    this.unit = config && config.unit ? config.unit : '🍌';\n    this.separator = config && config.separator ? config.separator : '|';\n    this.paddingRight = config && config.paddingRight ? config.paddingRight : 0;\n    this.fillerLeft = config && config.fillerLeft ? config.fillerLeft : '-';\n    this.fillerRight = config && config.fillerRight ? config.fillerRight : ' ';\n    this.intervalTime =\n      config && config.intervalTime ? config.intervalTime : 200;\n\n    this.value = this.startValue;\n    this.interval = null;\n    this.width = process.stdout.columns;\n    this.drawSpace = this._getDrawSpace();\n    this._handleResize();\n    if (this.autostart);\n    {\n      this.start();\n    }\n  }\n  increase(v) {\n    if (parseInt(v)) {\n      this.value += v;\n      if (this.value >= this.endValue) {\n        this.value = this.endValue;\n        this.complete();\n      }\n    }\n  }\n  _handleResize() {\n    process.stdout.on('resize', () => {\n      this.width = process.stdout.columns;\n      this.drawSpace = this._getDrawSpace();\n      console.clear();\n    });\n  }\n  _getDrawSpace() {\n    return this.width - this._getState().length - this.paddingRight - this.indicator.length;\n  }\n  start() {\n    if (this.interval) {\n      clearInterval(this.interval)\n    }\n    //console.clear();\n    if (this.isLoader) {\n      this._printLoader();\n    } else {\n      this._printProgress();\n    }\n  }\n  _printProgress() {\n    this.interval = setInterval(() => {\n      const i = parseInt((this.value / this.endValue) * this.drawSpace);\n      process.stdout.write(\n        this._line(i)\n      );\n    }, this.intervalTime);\n  }\n  _line(i) {\n    const bar = this._fill(i, true) +\n      this.indicator +\n      this._fill(i)\n    const pr = this.paddingRight ? this.paddingRight : 0\n    const spacing = Math.max(this.width - (bar.length + this._getState().length + pr), 0)\n    //return bar + ' '.repeat(spacing) + this._getState() + ' '.repeat(this.paddingRight) + '\\r'\n    return ' '.repeat(spacing) + bar + this._getState() + ' '.repeat(this.paddingRight) + '\\r'\n  }\n  _printLoader() {\n    let position = 0;\n    this.interval = setInterval(() => {\n      const i = position % this.drawSpace;\n      process.stdout.write(\n        this._line(i)\n      );\n      position++;\n    }, this.intervalTime);\n  }\n\n  complete() {\n    setTimeout(() => {\n      if (this.interval) {\n        clearInterval(this.interval);\n        process.stdout.write(\n          '\\n'\n        );\n      }\n    }, this.intervalTime);\n  }\n\n  _getState() {\n    return !this.hideState\n      ? `${this.separator} ${this.value} of ${this.endValue} ${this.unit}`\n      : '';\n  }\n  _fill(i, first) {\n    if ((first && !this.reverse) || (!first && this.reverse)) {\n      return this._repeat(i, this.fillerLeft)\n    }\n    return this._repeat(this.drawSpace - i - 1, this.fillerRight)\n  }\n  _repeat(space, filler) {\n    if (space > 0 && filler.length > 0) {\n      return filler.repeat(Math.max(parseInt(space / filler.length), 0))\n    }\n    return ''\n  }\n}\n\nmodule.exports = EmojiBar;\n"]}