{ "version": 3, "sources": ["../src/progress-bar.js"], "sourcesContent": ["class ProgressBar extends HTMLElement {\n static get observedAttributes() {\n return [\"total\", \"current\"];\n }\n\n constructor() {\n super();\n this.attachShadow({ mode: \"open\" });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n this[name] = newValue;\n this.shadowRoot.innerHTML = this.render();\n }\n\n style() {\n return `\n :host {\n display: grid;\n align-items: center;\n justify-content: center;\n width: 100%;\n grid-template-columns: 1fr;\n position: relative;\n font-family: \"Arial\";\n }\n\n h3 {\n text-align: center;\n }\n\n #bar {\n display: flex;\n flex-direction: row;\n width: 100%;\n gap: 0 15px;\n align-content: center;\n justify-items: center;\n align-items: center;\n }\n\n .meter {\n height: 20px;\n position: relative;\n background: #ecf0f1;\n border-radius: 5px;\n padding: 5px;\n display:grid;\n align-items:center;\n width: 100%;\n }\n\n span {\n font-size: clamp(10px, 4vw, 18px);\n }\n\n .current-fill {\n display: block;\n height: 100%;\n background: #1abc9c;\n }\n\n .current-value {\n position: absolute;\n color: #fff;\n left: 0;\n }\n `;\n }\n\n connectedCallback() {\n this.title = this.getAttribute(\"title\") || \"\";\n this.shadowRoot.innerHTML = this.render();\n }\n\n render() {\n const percentage = (this.current / this.total) * 100;\n const fillWidth = Math.max(10, percentage);\n const valueLeft = Math.max(4, Math.abs(percentage / 2));\n return `\n \n ${(this.title !== \"\" && `