import{r as t,h as e,H as o,g as r}from"./p-add854e8.js";import{a}from"./p-479b8fc9.js";const i=class{constructor(e){t(this,e),this.hasLabelSlot=!1,this.hasHelpSlot=!1,this.hasErrorSlot=!1,this.label=void 0,this.helpText=void 0,this.errorText=void 0,this.invalid=!1,this.required=!1}connectedCallback(){this._handleSlotChange=this._handleSlotChange.bind(this)}disconnectedCallback(){this.el.shadowRoot.removeEventListener("slotchange",this._handleSlotChange)}componentWillLoad(){this._handleSlotChange()}get hasLabel(){return!!this.label||this.hasLabelSlot}_handleSlotChange(){this.hasLabelSlot=a(this.el,"label"),this.hasErrorSlot=a(this.el,"error-text"),this.hasHelpSlot=a(this.el,"help-text")}render(){const{errorText:t,helpText:r,hasHelpSlot:a,hasErrorSlot:i,_handleSlotChange:l}=this;return e(o,null,e("div",{class:"rux-form-field",part:"form-field"},e("div",{class:{"rux-label":!0,hidden:!this.hasLabel},part:"label"},e("slot",{onSlotchange:this._handleSlotChange,name:"label"},this.label,this.required&&e("span",{part:"required",class:"rux-label__asterisk"},"*"))),e("div",{class:{"rux-checkbox-group":!0,"rux-checkbox-group--invalid":this.invalid},part:"container"},e("slot",null))),e("div",{class:{"rux-error-text":!!t||i,hidden:!t&&!i},part:"error-text"},e("svg",{fill:"none",width:"14",height:"14",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.393 12.25c.898 0 1.458-.974 1.009-1.75L8.009 2.91a1.166 1.166 0 0 0-2.018 0L1.598 10.5c-.449.776.111 1.75 1.01 1.75h8.784ZM7 8.167a.585.585 0 0 1-.583-.584V6.417c0-.321.262-.584.583-.584.32 0 .583.263.583.584v1.166c0 .321-.262.584-.583.584Zm-.583 1.166V10.5h1.166V9.333H6.417Z",fill:"currentColor"})),e("slot",{name:"error-text",onSlotchange:l},t)),e("div",{class:{"rux-help-text":(!!r||a)&&(!t||!i),hidden:!r&&!a||!!t||i},part:"help-text"},e("slot",{name:"help-text",onSlotchange:l},r)))}get el(){return r(this)}};i.style=".rux-help-text{margin-top:var(--spacing-2, 0.5rem);color:var(--color-text-secondary, #d4d8dd);font-size:var(--font-body-2-font-size, 0.875rem);font-family:var(--font-body-2-font-family, 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);font-weight:var(--font-body-2-font-weight, 400);letter-spacing:var(--font-body-2-letter-spacing, 0.005em);line-height:var(--font-body-2-line-height, calc(20 / 14));text-align:left}.rux-error-text{display:flex;align-items:center;text-align:left;width:fit-content;-webkit-order:3;order:3;display:flex;margin-top:var(--spacing-2, 0.5rem);color:var(--color-text-error, #ff3838);font-size:var(--font-body-2-bold-font-size, 0.875rem);font-family:var(--font-body-2-bold-font-family, 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);font-weight:var(--font-body-2-bold-font-weight, 700);letter-spacing:var(--font-body-2-bold-letter-spacing, 0.005em);line-height:var(--font-body-2-bold-line-height, calc(20 / 14));text-align:left}.rux-error-text svg{width:calc(var(--spacing-4, 1rem) + var(--spacing-1, 0.25rem));height:calc(var(--spacing-4, 1rem) + var(--spacing-1, 0.25rem));color:var(--color-text-error, #ff3838);margin-right:var(--spacing-2, 0.5rem);cursor:default}:host{display:block}.hidden,:host([hidden]){display:none}::slotted(rux-checkbox){display:block;margin-bottom:var(--spacing-2, 0.5rem)}::slotted(rux-checkbox:last-of-type){margin-bottom:0}.rux-label{color:var(--color-text-primary, #ffffff);font-family:var(--font-body-1-font-family, 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);font-size:var(--font-body-1-font-size, 1rem);font-weight:var(--font-body-1-font-weight, 400);letter-spacing:var(--font-body-1-letter-spacing, 0.005em);line-height:var(--font-body-1-line-height, calc(24 / 16));margin-bottom:var(--spacing-2, 0.5rem);text-align:left}.rux-label__asterisk{margin-left:4px}.rux-checkbox-group{display:flex;flex-direction:column;padding:1rem;width:fit-content;box-shadow:var(--color-border-interactive-muted, #2b659b) 0 0 0 1px inset;border-radius:var(--radius-base, 3px)}.rux-checkbox-group--invalid{box-shadow:var(--color-text-error, #ff3838) 0 0 0 1px inset}";export{i as rux_checkbox_group}