/*!
 * EdGEL: The University of Edinburgh Design System v5.3.1 (https://design-system.ed.ac.uk/)
 * Copyright 2014-2025 The University of Edinburgh
 *
 * Bootstrap  v5.3.3 (https://getbootstrap.com/)
 * Copyright 2011-2024 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */
import{_ as t,i as e,a as i,x as s,c as o}from"./base-D29SVYIK.js";import{o as n}from"./if-defined-L9qFdEae.js";import"./edgel-icon.js";let r,l,a,b,u,d,p,c=t=>t;class h extends i{constructor(){super(),this.colour="dark",this.iconPosition="before"}render(){let t,e,i="btn w-100";i=this.outline?`${i} btn-outline-${this.colour}`:`${i} btn-${this.colour}`,!this.size||"lg"!==this.size&&"sm"!==this.size||(i=`${i} btn-${this.size}`),this.btnActive&&(this.role="button",i=`${i} active`,e="true"),this.btnDisabled&&(i=`${i} disabled`,t="true");const o=this.icon?s(r||(r=c`<edgel-icon name="${0}"></edgel-icon>`),this.icon):s(l||(l=c``)),n={url:this.url,prefix:"after"===this.iconPosition?s(a||(a=c``)):o,suffix:"after"===this.iconPosition?o:s(b||(b=c``)),classes:i,role:this.btnRole,type:this.btnType,disabled:t,pressed:e};return this.url?this._linkRender(n):this._buttonRender(n)}_buttonRender({prefix:t,suffix:e,classes:i,type:o,disabled:r,pressed:l}){return s(u||(u=c`
      <button
        class=${0}
        type=${0}
        aria-disabled=${0}
        aria-pressed=${0}
      >
        ${0}
        <slot></slot>
        ${0}
      </button>
    `),i,n(o||void 0),n(r),n(l),t,e)}_linkRender({url:t,prefix:e,suffix:i,classes:o,role:r,disabled:l,pressed:a}){return s(d||(d=c`
      <a
        href=${0}
        class=${0}
        role=${0}
        aria-disabled=${0}
        aria-pressed=${0}
      >
        ${0}
        <slot></slot>
        ${0}
      </a>
    `),t,o,n(r?"button":void 0),n(l),n(a),e,i)}}t(h,"properties",{url:{type:String},icon:{type:String},iconPosition:{type:String,attribute:"icon-position"},size:{type:String},outline:{type:Boolean},colour:{type:String},btnActive:{type:Boolean,attribute:"button-active"},btnDisabled:{type:Boolean,attribute:"button-disabled"},btnRole:{type:Boolean,attribute:"button-role"},btnType:{type:String,attribute:"button-type"}}),t(h,"styles",[e(p||(p=c`:host { display: inline-block; }`))]),o("edgel-button",h);
