import t from"../lib/scaleD.js";import e from"../lib/LdrsBaseElement.js";var s=":host{align-items:center;display:inline-flex;flex-shrink:0;height:calc(var(--uib-size)*.625);justify-content:center;width:var(--uib-size)}:host([hidden]){display:none}.container{height:calc(var(--uib-size)*.625);overflow:visible;transform-origin:center;width:var(--uib-size)}.car{stroke:var(--uib-color);stroke-dasharray:100;stroke-dashoffset:0;animation:travel var(--uib-speed) ease-in-out infinite,fade var(--uib-speed) ease-out infinite;transition:stroke .5s ease;will-change:stroke-dasharray,stroke-dashoffset}.car,.track{stroke-linecap:round;stroke-linejoin:round}.track{stroke:var(--uib-color);opacity:var(--uib-bg-opacity)}@keyframes travel{0%{stroke-dashoffset:100}75%{stroke-dashoffset:0}}@keyframes fade{0%{opacity:0}20%,55%{opacity:1}to{opacity:0}}";class i extends e{_attributes=["size","color","speed","stroke","bg-opacity"];size;color;speed;stroke;"bg-opacity";d;static get observedAttributes(){return["size","color","speed","stroke","bg-opacity"]}constructor(){super(),this.storePropsToUpgrade(this._attributes),this.reflect(this._attributes),this.d="M0.5,17.2h8.2l3-4.7l5.9,12l7.8-24l5.9,16.7v0h8.2"}connectedCallback(){this.upgradeStoredProps(),this.applyDefaultProps({size:50,color:"black",speed:1.5,stroke:4,"bg-opacity":.1});const e=parseInt(this.size),i=t(e/40,this.d);this.template.innerHTML=`\n      <svg\n        class="container" \n        x="0px" \n        y="0px"\n        viewBox="0 0 ${this.size} ${.625*e}"\n        height="${.625*e}"\n        width="${this.size}"\n        preserveAspectRatio='xMidYMid meet'\n      >\n        <path \n          class="track"\n          stroke-width="${this.stroke}" \n          fill="none" \n          pathlength="100"\n          d="${i}"\n        />\n        <path \n          class="car"\n          stroke-width="${this.stroke}" \n          fill="none" \n          pathlength="100"\n          d="${i}"\n        />\n      </svg>\n      <style>\n        :host{\n          --uib-size: ${this.size}px;\n          --uib-color: ${this.color};\n          --uib-speed: ${this.speed}s;\n          --uib-bg-opacity: ${this["bg-opacity"]};\n        }\n        ${s}\n      </style>\n    `,this.shadow.replaceChildren(this.template.content.cloneNode(!0))}attributeChangedCallback(){const e=parseInt(this.size),i=this.shadow.querySelector("style"),r=this.shadow.querySelector("svg"),o=this.shadow.querySelectorAll("path");i&&(r.setAttribute("height",String(.625*e)),r.setAttribute("width",this.size),r.setAttribute("viewBox",`0 0 ${this.size} ${.625*e}`),o.forEach((s=>{s.setAttribute("stroke-width",this.stroke),s.setAttribute("d",t(e/40,this.d))})),i.innerHTML=`\n      :host{\n        --uib-size: ${this.size}px;\n        --uib-color: ${this.color};\n        --uib-speed: ${this.speed}s;\n        --uib-bg-opacity: ${this["bg-opacity"]};\n      }\n      ${s}\n    `)}}var r={register:(t="l-cardio")=>{customElements.get(t)||customElements.define(t,class extends i{})},element:i};export{r as default};
//# sourceMappingURL=cardio.js.map
