import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';import {Color,ScanditIconBuilder}from'@scandit/web-datacapture-core';var n="cubic-bezier(0.4, 0, 0.2, 1)",o=class o extends ScanditHTMLElement{constructor(){super();this._backgroundColor=Color.fromHex("#FFFFFF");this._icon=null;this._iconColor=Color.fromHex("#3D4852").withAlpha(.8);this._iconSize=20;let t=this.attachShadow({mode:"open"});t.innerHTML=html`
      <button>
        <slot></slot>
        <slot name="icon"></slot>
      </button>
    `,t.append(o.createStyleElement().cloneNode(true));}async connectedCallback(){if(this._icon){let i=await new ScanditIconBuilder().withIcon(this._icon).withIconColor(this._iconColor).withWidth(this._iconSize).withHeight(this._iconSize).withIconSize(this._iconSize).build();i.setAttribute("slot","icon"),this.append(i);}}static create(){return document.createElement(o.tag)}static register(){defineCustomElements({[o.tag]:o});}hide(){this.setAttribute("hide","");}show(){this.removeAttribute("hide");}set backgroundColor(t){this._backgroundColor=t,this.updateStyles();}set icon(t){this._icon=t;}set iconColor(t){this._iconColor=t;}set iconSize(t){this._iconSize=t;}updateStyles(){var i;let t=(i=this.shadowRoot)==null?void 0:i.querySelector("button");t&&(t.style.backgroundColor=`#${this._backgroundColor.toJSON()}`);}static createStyleElement(){return css`:host{display:inline-block}:host ::slotted([slot=icon]){display:block}:host([hidden]){display:none}:host button{align-items:center;border:none;border-radius:50%;display:flex;font-size:.875rem;font-weight:700;height:2.5rem;justify-content:center;width:2.5rem}:host button{opacity:1;transform:translateY(0);transition:opacity ${n} .5s,transform ${n} .5s}:host([hide]) button{opacity:0;transform:translateY(100%)}`}};o.tag="scandit-rounded-button";var c=o;export{c as a};