{"version":3,"file":"NcListItem-DfaWGP5A-eZQtYwBb.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcCounterBubble-CDfRYl8B.mjs"],"sourcesContent":["import '../assets/NcCounterBubble-CI-DxLjL.css';\nimport { getCanonicalLocale } from \"@nextcloud/l10n\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcCounterBubble\",\n props: {\n type: {\n type: String,\n default: \"\",\n validator(value) {\n return [\"highlighted\", \"outlined\", \"\"].includes(value);\n }\n },\n /**\n * Specifies whether the component is used within a component that is\n * active and therefore has a primary background. Inverts the color of\n * this component when that is the case.\n */\n active: {\n type: Boolean,\n default: false\n },\n /**\n * The count to display in the counter bubble.\n * Alternatively, you can pass any value to the default slot.\n */\n count: {\n type: Number,\n required: false,\n default: void 0\n },\n /**\n * Disables humanization to display count or content as it is\n */\n raw: {\n type: Boolean,\n required: false,\n default: false\n }\n },\n computed: {\n counterClassObject() {\n return {\n \"counter-bubble__counter--highlighted\": this.type === \"highlighted\",\n \"counter-bubble__counter--outlined\": this.type === \"outlined\",\n active: this.active\n };\n },\n humanizedCount() {\n return this.humanizeCount(this.count);\n }\n },\n methods: {\n humanizeCount(count) {\n if (this.raw) {\n return count.toString();\n }\n const formatter = new Intl.NumberFormat(getCanonicalLocale(), {\n notation: \"compact\",\n compactDisplay: \"short\"\n });\n return formatter.format(count);\n },\n /**\n * Get the humanized count from `count` prop\n * @return {{ humanized: string, original: string} | undefined}\n */\n getHumanizedCount() {\n if (this.count !== void 0) {\n return {\n humanized: this.humanizedCount,\n original: this.count.toString()\n };\n }\n if (this.raw) {\n return void 0;\n }\n if (this.$slots.default?.length === 1) {\n const slotContent = this.$slots.default[0].text?.trim();\n if (slotContent && /^\\d+$/.test(slotContent)) {\n const count = parseInt(slotContent, 10);\n return {\n humanized: this.humanizeCount(count),\n original: slotContent\n };\n }\n }\n }\n },\n render(h) {\n const count = this.getHumanizedCount();\n return h(\"div\", {\n staticClass: \"counter-bubble__counter\",\n class: this.counterClassObject,\n attrs: {\n // Show original count in title if humanized\n title: count && count.original !== count.humanized ? count.original : void 0\n }\n }, [count?.humanized ?? this.$slots.default]);\n }\n};\nconst _sfc_render = null;\nconst _sfc_staticRenderFns = null;\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"f1abaa29\"\n);\nconst NcCounterBubble = __component__.exports;\nexport {\n NcCounterBubble as N\n};\n//# sourceMappingURL=NcCounterBubble-CDfRYl8B.mjs.map\n"],"names":["_sfc_main","value","count","getCanonicalLocale","slotContent","h","_sfc_render","_sfc_staticRenderFns","__component__","normalizeComponent","NcCounterBubble"],"mappings":"yGAGA,MAAMA,EAAY,CAChB,KAAM,kBACN,MAAO,CACL,KAAM,CACJ,KAAM,OACN,QAAS,GACT,UAAUC,EAAO,CACf,MAAO,CAAC,cAAe,WAAY,EAAE,EAAE,SAASA,CAAK,CAC7D,CACK,EAMD,OAAQ,CACN,KAAM,QACN,QAAS,EACV,EAKD,MAAO,CACL,KAAM,OACN,SAAU,GACV,QAAS,MACV,EAID,IAAK,CACH,KAAM,QACN,SAAU,GACV,QAAS,EACf,CACG,EACD,SAAU,CACR,oBAAqB,CACnB,MAAO,CACL,uCAAwC,KAAK,OAAS,cACtD,oCAAqC,KAAK,OAAS,WACnD,OAAQ,KAAK,MACd,CACF,EACD,gBAAiB,CACf,OAAO,KAAK,cAAc,KAAK,KAAK,CAC1C,CACG,EACD,QAAS,CACP,cAAcC,EAAO,CACnB,OAAI,KAAK,IACAA,EAAM,SAAU,EAEP,IAAI,KAAK,aAAaC,EAAkB,EAAI,CAC5D,SAAU,UACV,eAAgB,OACxB,CAAO,EACgB,OAAOD,CAAK,CAC9B,EAKD,mBAAoB,CAClB,GAAI,KAAK,QAAU,OACjB,MAAO,CACL,UAAW,KAAK,eAChB,SAAU,KAAK,MAAM,SAAQ,CAC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