import{b as y,c as f}from"./chunk.LZRL7OLU.js";import{a as i}from"./chunk.LHSR56PH.js";import{a as k}from"./chunk.CGQ2BPPZ.js";import{a as c,b as u}from"./chunk.NL7YFV4O.js";import{a as s}from"./chunk.UFTAQNZB.js";import{a as g}from"./chunk.NYKJXI3Q.js";import{a as v,b as o,c as h,d as m,g as p,h as l}from"./chunk.XJAJO727.js";import{b}from"./chunk.OBAEIKIV.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends l{constructor(){super(...arguments);this.formControlController=new y(this,{form:r=>{if(r.hasAttribute("form")){let a=r.getRootNode(),n=r.getAttribute("form");return a.getElementById(n)}return r.closest("form")}});this.hasSlotController=new k(this,"[default]","icon-left","icon-right");this.invalid=!1;this.title="";this.variant="primary";this.inverted=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.loading=!1;this.type="button";this.name="";this.value="";this.href=""}get validity(){return this.isButton()?this.button.validity:f}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(r){if(this.disabled||this.loading||this.visuallyDisabled){r.preventDefault(),r.stopPropagation();return}this.type==="submit"&&this.formControlController.submit(this),this.type==="reset"&&this.formControlController.reset(this)}handleInvalid(r){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(r)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(r){this.button.focus(r)}blur(){this.button.blur()}checkValidity(){return this.isButton()?this.button.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.isButton()?this.button.reportValidity():!0}setCustomValidity(r){this.isButton()&&(this.button.setCustomValidity(r),this.formControlController.updateValidity())}render(){let r=this.isLink(),a=r?c`a`:c`button`,n={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0},d=this.variant==="secondary";return u`<${a} part="base" class="${s(`group relative z-10 font-md no-underline
        w-full align-middle inline-flex items-stretch justify-center
        transition-colors duration-fast ease-in-out
        select-none cursor-[inherit]`,this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.loading&&"relative cursor-wait",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed",{sm:"varspacing-8 min-h-8 sd-button--size-sm-font-size sd-button-font-weight sd-button--secondary--size-sm-padding-block sd-button--size-sm-border-radius",md:"varspacing-10 sd-button--size-md-height sd-button--size-md-font-size sd-button--secondary--size-md-padding-block sd-button-font-weight sd-button--size-md-border-radius",lg:"varspacing-12 sd-button--size-lg-height sd-button--size-lg-font-size sd-button--secondary--size-lg-padding-block sd-button-font-weight sd-button--size-lg-border-radius"}[this.size],!n["icon-only"]&&{sm:`${d?"sd-button--secondary-padding-inline":"sd-button--size-sm-padding-block sd-button-padding-inline"}`,md:`${d?"sd-button--secondary-padding-inline":"sd-button--size-md-padding-block sd-button-padding-inline"}`,lg:`${d?"sd-button--secondary-padding-inline":"sd-button--size-lg-padding-block sd-button-padding-inline"}`}[this.size],n["icon-only"]&&{sm:"px-1 aspect-square",md:"sd-button--size-md--icon-only-padding-inline aspect-square",lg:"px-[12px] aspect-square"}[this.size],{primary:this.inverted?`${this.visuallyDisabled?"sd-button--inverted--disabled-color-background text-white border-neutral-500":"sd-button--primary--inverted--default-color-text sd-button--primary--inverted--default-color-background border-white hover:sd-button--primary--inverted--hover-color-text active:sd-button--primary--inverted--active-color-text active:sd-button--primary--inverted--active-color-background"}
          disabled:sd-button--inverted--disabled-color-background disabled:text-white`:`${this.visuallyDisabled?"sd-button--primary--disabled-color-background border-neutral-500 text-white":"sd-button--primary--default-color-background border-transparent sd-button--primary--default-color-text hover:sd-button--primary--hover-color-text active:sd-button--primary--active-color-text active:sd-button--primary--active-color-background"}
          disabled:sd-button--primary--disabled-color-background disabled:text-white`,secondary:this.inverted?`border sd-button-border-width ${this.visuallyDisabled?"text-neutral-600 border-neutral-600":"sd-button--secondary--inverted-color-text sd-button--secondary--inverted-color-border hover:sd-button--secondary--inverted-color-border hover:sd-button--secondary--inverted--hover-color-text hover:sd-button--secondary--inverted--hover-color-background active:sd-button--secondary--inverted--active-color-text active:border-primary-200 active:sd-button--secondary--inverted--active-color-background"}
          disabled:sd-button--inverted--disabled-color-border disabled:sd-button--inverted--disabled-color-text`:`border sd-button-border-width ${this.visuallyDisabled?"sd-button--secondary--disabled-color-text sd-button--secondary--disabled-color-border":"sd-button--secondary--default-color-text sd-button--secondary--default-color-border hover:sd-button--secondary--hover-color-text hover:sd-button--secondary--hover-color-border active:sd-button--secondary--active-color-text active:sd-button--secondary--active-color-border"}
          disabled:sd-button--secondary--disabled-color-text disabled:sd-button--secondary--disabled-color-border`,tertiary:this.inverted?`border-transparent  ${this.visuallyDisabled?"text-neutral-600":"sd-button--tertiary--inverted-color-text hover:sd-button--tertiary--inverted--hover-color-text hover:sd-button--tertiary--inverted--hover-color-background active:sd-button--tertiary--inverted--active-color-background active:sd-button--tertiary--inverted--active-color-text"}
          disabled:sd-button--inverted--disabled-color-text`:`border-transparent ${this.visuallyDisabled?"sd-button--tertiary--disabled-color-text":"sd-button--tertiary--default-color-text hover:sd-button--tertiary--hover-color-text active:sd-button--tertiary--active-color-text"}
          disabled:sd-button--tertiary--disabled-color-text`,cta:`${this.visuallyDisabled?"sd-button--primary--disabled-color-background border-neutral-500":"bg-accent border-transparent hover:bg-accent-500"}
          ${this.inverted?"sd-button--cta--inverted--default-color-background sd-button--cta--inverted--default-color-text hover:sd-button--cta--inverted--hover-color-text active:sd-button--cta--inverted--active-color-text disabled:sd-button--inverted--disabled-color-background disabled:text-white":"text-white bg-accent disabled:sd-button--primary--disabled-color-background hover:bg-accent-500 disabled:border-neutral-500 disabled:text-white"}`}[this.variant])}" ?disabled="${i(r?void 0:this.disabled)}" type="${i(r?void 0:this.type)}" title="${this.title}" name="${i(r?void 0:this.name)}" value="${i(r?void 0:this.value)}" href="${i(r?this.href:void 0)}" target="${i(r?this.target:void 0)}" download="${i(r?this.download:void 0)}" rel="${i(r&&this.target?"noreferrer noopener":void 0)}" role="${i(r?void 0:"button")}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-labelledby="content" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><div part="motion-wrapper" class="${s("absolute inset-0 -z-10 overflow-hidden pointer-events-none ",(this.disabled||this.visuallyDisabled)&&"hidden",{sm:"sd-button-border-radius",md:"sd-button-border-radius",lg:"sd-button-border-radius"}[this.size])}"><div class="absolute inset-0 w-full h-full transition-all duration-fast translate-y-full group-hover:translate-y-0 group-hover:mt-[-22%] mt-[11%]"><div class="${s("absolute right-0 min-w-full min-h-full aspect-square skew-y-[-11deg] mt-[11%]",{primary:this.inverted?"sd-button--primary--inverted--hover-color-background group-active:sd-button--primary--inverted--active-color-background":"sd-button--primary--hover-color-background group-active:sd-button--primary--active-color-background",secondary:this.inverted?"sd-button--secondary--inverted--hover-color-background group-active:sd-button--secondary--inverted--active-color-background group-active:sd-button--secondary--inverted--active-color-text":"sd-button--secondary--hover-color-background group-active:sd-button--secondary--active-color-background",tertiary:this.inverted?"sd-button--tertiary--inverted--hover-color-background group-active:sd-button--tertiary--inverted--active-color-background group-active:sd-button--tertiary--inverted--active-color-text":"sd-button--tertiary--hover-color-background group-active:sd-button--tertiary--active-color-background",cta:this.inverted?"sd-button--cta--inverted--hover-color-background group-active:sd-button--cta--inverted--active-color-background":"bg-accent-500 group-active:bg-accent-700"}[this.variant])}"></div><div class="${s("absolute w-full h-full mt-[22%]",{primary:this.inverted?"sd-button--primary--inverted--hover-color-background group-active:sd-button--primary--inverted--active-color-background":"sd-button--primary--hover-color-background group-active:sd-button--primary--active-color-background",secondary:this.inverted?"sd-button--secondary--inverted--hover-color-background group-active:sd-button--secondary--inverted--active-color-background group-active:sd-button--secondary--inverted--active-color-text group-active:sd-button--secondary--active-color-border":"sd-button--secondary--hover-color-background group-active:sd-button--secondary--active-color-background",tertiary:this.inverted?"sd-button--tertiary--inverted--hover-color-background group-active:sd-button--tertiary--inverted--active-color-background group-active:sd-button--tertiary--inverted--active-color-text":"sd-button--tertiary--hover-color-background group-active:sd-button--tertiary--active-color-background",cta:this.inverted?"sd-button--cta--inverted--hover-color-background group-active:sd-button--cta--inverted--active-color-background":"bg-accent-500 group-active:bg-accent-700"}[this.variant])}"></div></div></div><slot name="icon-left" part="icon-left" class="${s("flex flex-auto items-center justify-end pointer-events-none",n["icon-only"]&&"hidden",this.loading&&"invisible",n["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${s("inline-flex items-center justify-center",{sm:"leading-5",md:"leading-6",lg:"leading-6"}[this.size],n["icon-only"]&&"pointer-events-none",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${s("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",n["icon-only"]&&"hidden",n["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?u`<sd-loader class="${s("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-loader>`:""}</${a}>`}};t.styles=[...l.styles,b`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;
:host{position:relative;z-index:0;display:inline-block;width:auto;cursor:pointer}::slotted(sd-badge){pointer-events:none;position:absolute;top:calc(var(--sd-spacing-1) * 0);right:calc(var(--sd-spacing-1) * 0);--tw-translate-x:calc(1 / 2 * 100%)!important;--tw-translate-y:calc(calc(1 / 2 * 100%) * -1)!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}::slotted(sd-icon),sd-loader{font-size:calc(var(--tw-varspacing)/ 2)}:host([size=lg]) ::slotted(sd-icon){font-size:var(--sd-button--size-lg-icon-height,var(--sd-spacing-6))}:host([size=sm]) .sd-button--size-sm-border-radius{border-radius:var(--sd-button--size-sm-border-radius,var(--sd-button-border-radius))}:host([size=md]) .sd-button--size-md-border-radius{border-radius:var(--sd-button--size-md-border-radius,var(--sd-button-border-radius))}:host([size=lg]) .sd-button--size-lg-border-radius{border-radius:var(--sd-button--size-lg-border-radius,var(--sd-button-border-radius))}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}`],e([m("a, button")],t.prototype,"button",2),e([p({selector:"sd-icon"})],t.prototype,"_iconsInDefaultSlot",2),e([h()],t.prototype,"invalid",2),e([o({type:String,reflect:!0})],t.prototype,"title",2),e([o({type:String,reflect:!0})],t.prototype,"variant",2),e([o({type:Boolean,reflect:!0})],t.prototype,"inverted",2),e([o({type:String,reflect:!0})],t.prototype,"size",2),e([o({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([o({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),e([o({type:Boolean,reflect:!0})],t.prototype,"loading",2),e([o({type:String,reflect:!0})],t.prototype,"type",2),e([o({type:String,reflect:!0})],t.prototype,"name",2),e([o()],t.prototype,"value",2),e([o({type:String,reflect:!0})],t.prototype,"href",2),e([o({type:String,reflect:!0})],t.prototype,"target",2),e([o({reflect:!0})],t.prototype,"download",2),e([o({reflect:!0})],t.prototype,"form",2),e([o({attribute:"formaction"})],t.prototype,"formAction",2),e([o({attribute:"formenctype"})],t.prototype,"formEnctype",2),e([o({attribute:"formmethod"})],t.prototype,"formMethod",2),e([o({attribute:"formnovalidate",type:Boolean})],t.prototype,"formNoValidate",2),e([o({attribute:"formtarget"})],t.prototype,"formTarget",2),e([g("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t=e([v("sd-button")],t);export{t as a};
