{"version":3,"file":"NcProgressBar-D7zYeXBH-Bj5rIFx5.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcProgressBar-D7zYeXBH.mjs"],"sourcesContent":["import '../assets/NcProgressBar-CU_ib_HL.css';\nimport { useCssVars } from \"vue\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst __default__ = {\n  name: \"NcProgressBar\",\n  props: {\n    /**\n     * An integer between 1 and 100\n     */\n    value: {\n      type: Number,\n      default: 0,\n      validator(value) {\n        return value >= 0 && value <= 100;\n      }\n    },\n    /**\n     * Determines the height of the progressbar.\n     * Possible values:\n     * - 'small' (default)\n     * - 'medium'\n     * - Number\n     *\n     * @type {'small'|'medium'|number}\n     */\n    size: {\n      type: [String, Number],\n      default: \"small\",\n      validator(value) {\n        return [\"small\", \"medium\"].includes(value) || typeof value === \"number\";\n      }\n    },\n    /**\n     * Applies an error color to the progressbar if true.\n     */\n    error: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * ProgressBar type\n     */\n    type: {\n      type: String,\n      default: \"linear\",\n      validator(value) {\n        return [\"linear\", \"circular\"].includes(value);\n      }\n    },\n    /**\n     * The color of the progress bar\n     */\n    color: {\n      type: String,\n      default: null\n    }\n  },\n  data() {\n    return {\n      stroke: 4\n    };\n  },\n  computed: {\n    height() {\n      if (this.type === \"circular\") {\n        if (Number.isInteger(this.size)) {\n          return this.size;\n        }\n        return 44;\n      }\n      if (this.size === \"small\") {\n        return 4;\n      } else if (this.size === \"medium\") {\n        return 6;\n      }\n      return this.size;\n    },\n    progress() {\n      return this.value / 100;\n    },\n    radius() {\n      return this.height / 2;\n    },\n    radiusNormalized() {\n      return this.radius - 3 * this.stroke;\n    },\n    circumference() {\n      return this.radiusNormalized * 2 * Math.PI;\n    }\n  }\n};\nconst __injectCSSVars__ = () => {\n  useCssVars((_vm, _setup) => ({\n    \"15a054de\": _vm.color\n  }));\n};\nconst __setup__ = __default__.setup;\n__default__.setup = __setup__ ? (props, ctx) => {\n  __injectCSSVars__();\n  return __setup__(props, ctx);\n} : __injectCSSVars__;\nconst _sfc_main = __default__;\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c;\n  return _vm.type === \"circular\" ? _c(\"span\", { staticClass: \"progress-bar progress-bar--circular\", class: { \"progress-bar--error\": _vm.error }, style: { \"--progress-bar-height\": _vm.height + \"px\" }, attrs: { \"role\": \"progressbar\", \"aria-valuenow\": _vm.value } }, [_c(\"svg\", { attrs: { \"height\": _vm.height, \"width\": _vm.height } }, [_c(\"circle\", { attrs: { \"stroke\": \"currentColor\", \"fill\": \"transparent\", \"stroke-dasharray\": `${_vm.progress * _vm.circumference} ${(1 - _vm.progress) * _vm.circumference}`, \"stroke-dashoffset\": 0.25 * _vm.circumference, \"stroke-width\": _vm.stroke, \"r\": _vm.radiusNormalized, \"cx\": _vm.radius, \"cy\": _vm.radius } }), _c(\"circle\", { attrs: { \"stroke\": \"var(--color-background-darker)\", \"fill\": \"transparent\", \"stroke-dasharray\": `${(1 - _vm.progress) * _vm.circumference} ${_vm.progress * _vm.circumference}`, \"stroke-dashoffset\": (0.25 - _vm.progress) * _vm.circumference, \"stroke-width\": _vm.stroke, \"r\": _vm.radiusNormalized, \"cx\": _vm.radius, \"cy\": _vm.radius } })])]) : _c(\"progress\", { staticClass: \"progress-bar progress-bar--linear vue\", class: { \"progress-bar--error\": _vm.error }, style: { \"--progress-bar-height\": _vm.height + \"px\" }, attrs: { \"max\": \"100\" }, domProps: { \"value\": _vm.value } });\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"06c9abdc\"\n);\nconst NcProgressBar = __component__.exports;\nexport {\n  NcProgressBar as N\n};\n//# sourceMappingURL=NcProgressBar-D7zYeXBH.mjs.map\n"],"names":["__default__","value","__injectCSSVars__","useCssVars","_vm","_setup","__setup__","props","ctx","_sfc_main","_sfc_render","_c","_sfc_staticRenderFns","__component__","normalizeComponent","NcProgressBar"],"mappings":"uGAGA,MAAMA,EAAc,CAClB,KAAM,gBACN,MAAO,CAIL,MAAO,CACL,KAAM,OACN,QAAS,EACT,UAAUC,EAAO,CACf,OAAOA,GAAS,GAAKA,GAAS,GAChC,CACN,EAUI,KAAM,CACJ,KAAM,CAAC,OAAQ,MAAM,EACrB,QAAS,QACT,UAAUA,EAAO,CACf,MAAO,CAAC,QAAS,QAAQ,EAAE,SAASA,CAAK,GAAK,OAAOA,GAAU,QACjE,CACN,EAII,MAAO,CACL,KAAM,QACN,QAAS,EACf,EAII,KAAM,CACJ,KAAM,OACN,QAAS,SACT,UAAUA,EAAO,CACf,MAAO,CAAC,SAAU,UAAU,EAAE,SAASA,CAAK,CAC9C,CACN,EAII,MAAO,CACL,KAAM,OACN,QAAS,IACf,CACA,EACE,MAAO,CACL,MAAO,CACL,OAAQ,CACd,CACE,EACA,SAAU,CACR,QAAS,CACP,OAAI,KAAK,OAAS,WACZ,OAAO,UAAU,KAAK,IAAI,EACrB,KAAK,KAEP,GAEL,KAAK,OAAS,QACT,EACE,KAAK,OAAS,SAChB,EAEF,KAAK,IACd,EACA,UAAW,CACT,OAAO,KAAK,MAAQ,GACtB,EACA,QAAS,CACP,OAAO,KAAK,OAAS,CACvB,EACA,kBAAmB,CACjB,OAAO,KAAK,OAAS,EAAI,KAAK,MAChC,EACA,eAAgB,CACd,OAAO,KAAK,iBAAmB,EAAI,KAAK,EAC1C,CACJ,CACA,EACMC,EAAoB,IAAM,CAC9BC,EAAW,CAACC,EAAKC,KAAY,CAC3B,WAAYD,EAAI,KACpB,EAAI,CACJ,EACME,EAAYN,EAAY,MAC9BA,EAAY,MAAQM,EAAY,CAACC,EAAOC,KACtCN,EAAiB,EACVI,EAAUC,EAAOC,CAAG,GACzBN,EACJ,MAAMO,EAAYT,EAClB,IAAIU,EAAc,UAAkB,CAClC,IAAIN,EAAM,KAAMO,EAAKP,E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