import { d as attr_class, f as stringify, o as attr, q as bind_props, t as derived } from './index-DwaY1cAm.js';

/* empty css                                    */
function html(value) {
  var html2 = String(value ?? "");
  var open = "<!---->";
  return open + html2 + "<!---->";
}
function Loader($$renderer, $$props) {
  let { classes } = $$props;
  $$renderer.push(`<div${attr_class(`loader ${stringify(classes ?? "")}`, "svelte-hqcd8x")}></div>`);
}
function Button($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    let {
      text,
      enable = true,
      disabled = false,
      showLoader = false,
      loaderType,
      type = "button",
      testId,
      ariaLabel,
      ariaExpanded,
      onclick,
      onkeyup = () => {
      },
      showProgressBar = false,
      icon,
      children,
      classes
    } = $$props;
    let isDisabled = derived(() => !enable || disabled || showLoader);
    $$renderer2.push(`<div${attr_class(`button-container ${stringify(classes ?? "")}`, "svelte-lbj48f")}>`);
    if (showProgressBar) {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-progress-bar svelte-lbj48f"></div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> <button${attr("disabled", isDisabled(), true)}${attr("type", type)}${attr("data-pw", testId)}${attr("aria-label", ariaLabel)}${attr("aria-expanded", ariaExpanded)}${attr_class("svelte-lbj48f", void 0, { "disabled": isDisabled() })}>`);
    if (showLoader && loaderType === "Circular") {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-loader svelte-lbj48f">`);
      Loader($$renderer2, {});
      $$renderer2.push(`<!----></div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> `);
    if (typeof icon === "function") {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-icon svelte-lbj48f">`);
      icon($$renderer2);
      $$renderer2.push(`<!----></div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> `);
    if (typeof text === "string" && text.length > 0) {
      $$renderer2.push("<!--[0-->");
      $$renderer2.push(`<div class="button-text svelte-lbj48f">${html(text)}</div>`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--> `);
    if (typeof children === "function") {
      $$renderer2.push("<!--[0-->");
      children($$renderer2);
      $$renderer2.push(`<!---->`);
    } else {
      $$renderer2.push("<!--[-1-->");
    }
    $$renderer2.push(`<!--]--></button></div>`);
    bind_props($$props, { showProgressBar });
  });
}

export { Button as B, html as h };
//# sourceMappingURL=Button-Cs1aE6ka.js.map
