var e,t,s={8358(e,t,s){s.d(t,{z:()=>i});var i,r=s(2900),o=s(7704),d=s(9609),a=s(4084),l=s(2927),n=s(8899),c=s(7231),h=function(e,t,s,i){var r,o=arguments.length,d=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(d=(o<3?r(d):o>3?r(t,s,d):r(t,s))||d);return o>3&&d&&Object.defineProperty(t,s,d),d};!function(e){let t=class extends((0,o.Io)(l.LitElement)){constructor(){super(...arguments),this.label="group",this.checked=-1,this.alignment="vertical",this._disabled=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.requestUpdate("disabled",t)}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","radiogroup"),this.setAttribute("aria-label",this.label)}willUpdate(e){var t;null===(t=super.willUpdate)||void 0===t||t.call(this,e),(e.has("slotted")||e.has("checked"))&&this.setFirstChecked()}get selectedRadioValue(){return this.slotted[this.selected].value}notifySelectedChange(){this.dispatchEvent(new CustomEvent("radio-change",{detail:{selected:this.selectedRadioValue},bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}setFirstChecked(){-1!==this.checked&&(this.selected=this.checked,this.setChecked(this.checked))}findRadioIndex(e){const t=e.composedPath();return this.slotted.findIndex(e=>t.includes(e))}findCheckedRadioIndex(){return this.slotted.findIndex(e=>e.checked)}setChecked(e){const t=this.findCheckedRadioIndex();-1!==t&&t!==e&&this.slotted[t]&&(this.slotted[t].checked=!1),this.slotted[e]&&(this.slotted[e].checked=!0)}switchRadioOnArrowPress(e,t=1){const s=super.getAvailableSelectedIndex(e,t);-1!==s&&(this.selected=s,this.setChecked(s),this.notifySelectedChange())}isRadioDisabled(e){return this.slotted[e].disabled}handleClick(e){if(this.disabled)return!1;const t=this.findRadioIndex(e);-1!==t&&(this.isRadioDisabled(t)||(this.selected=t,this.setChecked(t),this.notifySelectedChange()))}handleKeyDown(e){if(this.disabled)return!1;const{code:t}=e;switch(t){case r.Uz.Enter:case r.Uz.Space:this.isRadioDisabled(this.selected)||(this.setChecked(this.selected),this.notifySelectedChange(),e.stopPropagation(),e.preventDefault());break;case r.Uz.ArrowUp:case r.Uz.ArrowLeft:0===this.selected?this.switchRadioOnArrowPress(this.slotted.length-1,-1):this.switchRadioOnArrowPress(this.selected-1,-1),e.stopPropagation(),e.preventDefault();break;case r.Uz.ArrowDown:case r.Uz.ArrowRight:this.selected===this.slotted.length-1?this.switchRadioOnArrowPress(0):this.switchRadioOnArrowPress(this.selected+1),e.stopPropagation(),e.preventDefault()}}get slotElement(){return this.radioSlot}static get styles(){return[a.A,c.A]}clearSelection(){const e=this.findCheckedRadioIndex();-1!=e&&(this.checked=-1,this.slotted[e].checked=!1)}render(){return l.html`
        <div class="radio-group-container" part="radio-group-container">
          <slot name="radio"></slot>
        </div>
      `}};h([(0,n.property)({type:String,attribute:"group-label"})],t.prototype,"label",void 0),h([(0,n.property)({type:Number,reflect:!0})],t.prototype,"checked",void 0),h([(0,n.property)({type:String,reflect:!0})],t.prototype,"alignment",void 0),h([(0,n.query)("slot[name='radio']")],t.prototype,"radioSlot",void 0),h([(0,n.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),t=h([(0,d.w)("md-radiogroup")],t),e.ELEMENT=t}(i||(i={}))}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return s[e](o,o.exports,r),o.exports}r.m=s,e=[],r.O=(t,s,i,o)=>{if(!s){var d=1/0;for(c=0;c<e.length;c++){for(var[s,i,o]=e[c],a=!0,l=0;l<s.length;l++)(!1&o||d>=o)&&Object.keys(r.O).every(e=>r.O[e](s[l]))?s.splice(l--,1):(a=!1,o<d&&(d=o));if(a){e.splice(c--,1);var n=i();void 0!==n&&(t=n)}}return t}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[s,i,o]},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{r as __webpack_require__};t={8334:0},r.C=e=>{var s,i,{__webpack_esm_ids__:o,__webpack_esm_modules__:d,__webpack_esm_runtime__:a}=e,l=0;for(s in d)r.o(d,s)&&(r.m[s]=d[s]);for(a&&a(r);l<o.length;l++)i=o[l],r.o(t,i)&&t[i]&&t[i][0](),t[o[l]]=0;r.O()},r.O.j=e=>0===t[e];import*as o from"../9609.js";r.C(o);import*as d from"../4084.js";r.C(d);import*as a from"../2364.js";r.C(a);import*as l from"../9938.js";r.C(l);import*as n from"../5201.js";r.C(n);import*as c from"../2900.js";r.C(c);import*as h from"../2927.js";r.C(h);import*as p from"../608.js";r.C(p);import*as f from"../8899.js";r.C(f);import*as u from"../3203.js";r.C(u);import*as m from"../7162.js";r.C(m);import*as b from"../7231.js";r.C(b);import*as v from"../2942.js";r.C(v);var k=r.O(void 0,[9609,4084,2364,9938,5201,2900,2927,608,8899,3203,7162,7231,2942],()=>r(8358));const C=(k=r.O(k)).z;export{C as RadioGroup};