import{p as t,H as i,h as e,t as r}from"./p-BHHBMN0G.js";class n{static autoInit(t,{INDICATOR:i={}}={}){const e=new n(t,i);return e.init(),t.ECLIndicator=e,e}constructor(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");this.element=t,this.value=0,this.increment=this.increment.bind(this),this.decrement=this.decrement.bind(this),this.getValue=this.getValue.bind(this),this.setValue=this.setValue.bind(this),this.clearValue=this.clearValue.bind(this)}init(){if(!ECL)throw new TypeError("Called init but ECL is not present");ECL.components=ECL.components||new Map,this.getValue(),this.element.setAttribute("data-ecl-auto-initialized","true"),ECL.components.set(this.element,this)}destroy(){this.element.removeAttribute("data-ecl-auto-initialized"),ECL.components.delete(this.element)}getValue(){this.value=""===this.element.innerHTML.trim()?"":parseInt(this.element.innerHTML,10)}increment(t=1){return""!==this.value&&!Number.isNaN(this.value)&&(this.value+=t,this.element.innerHTML=this.value,!0)}decrement(t=1){return""!==this.value&&!Number.isNaN(this.value)&&(this.value-=t,this.element.innerHTML=this.value,!0)}setValue(t){return!Number.isNaN(t)&&(this.value=t,this.element.innerHTML=this.value,!0)}clearValue(){this.value="",this.element.innerHTML=this.value}}const a=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.value="",this.noScript=!1,this.srLabel="",this.styleClass=""}getClass(){return["ecl-indicator",this.styleClass].join(" ").trim()}componentDidRender(){this.noScript||(window.ECL=window.ECL||{},ECL.Indicator=n,new n(this.el.firstElementChild).init())}render(){return e("span",{key:"79473f3934e0282e54c85f563640f71969083258",class:this.getClass(),"data-ecl-indicator":!0},e("span",{key:"2fc97601ef02f3895c85292e8ac62550e1526bbd",class:"ecl-indicator__value"},this.value),this.srLabel&&e("span",{key:"e9f96e6fa81280713b67c25c0a272852d5d65f52",class:"ecl-indicator__label"},this.srLabel))}static get assetsDirs(){return["build"]}get el(){return this}static get style(){return{ec:'.ecl-u-sr-only.sc-ecl-indicator-ec{border:0!important;clip-path:rect(0,0,0,0)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.ecl-indicator.sc-ecl-indicator-ec{align-items:center;background-color:var(--cm-surface-status-error,var(--c-er));border-radius:50%;color:#fff;content:"";display:flex;font:var(--f-xs);height:22px;justify-content:center;overflow:hidden;position:absolute;right:-18px;top:-16px;width:22px}.ecl-indicator.sc-ecl-indicator-ec:not(:has(.ecl-indicator__value)){height:12px;right:-8px;top:-10px;width:12px}.ecl-indicator__label.sc-ecl-indicator-ec{border:0!important;clip-path:rect(0,0,0,0)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}',eu:'.ecl-u-sr-only.sc-ecl-indicator-eu{border:0!important;clip-path:rect(0,0,0,0)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.ecl-indicator.sc-ecl-indicator-eu{align-items:center;background-color:var(--cm-surface-status-error,var(--c-er));border-radius:50%;color:#fff;content:"";display:flex;font:var(--f-xs);height:22px;justify-content:center;overflow:hidden;position:absolute;right:-18px;top:-16px;width:22px}.ecl-indicator.sc-ecl-indicator-eu:not(:has(.ecl-indicator__value)){height:12px;right:-8px;top:-10px;width:12px}.ecl-indicator__label.sc-ecl-indicator-eu{border:0!important;clip-path:rect(0,0,0,0)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}'}}},[34,"ecl-indicator",{value:[1],noScript:[4,"no-script"],srLabel:[1,"sr-label"],styleClass:[1,"style-class"]}]);function o(){"undefined"!=typeof customElements&&["ecl-indicator"].forEach((t=>{"ecl-indicator"===t&&(customElements.get(r(t))||customElements.define(r(t),a))}))}export{a as E,o as d}