var __awaiter=this&&this.__awaiter||function(t,e,i,a){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function r(t){try{s(a.next(t))}catch(t){o(t)}}function c(t){try{s(a["throw"](t))}catch(t){o(t)}}function s(t){t.done?i(t.value):n(t.value).then(r,c)}s((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,n,o,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(t){return function(e){return s([t,e])}}function s(r){if(a)throw new TypeError("Generator is already executing.");while(i)try{if(a=1,n&&(o=r[0]&2?n["return"]:r[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;if(n=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;n=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]1){var i=e[e.length-1];e.filter((function(t){return t!==i})).forEach((function(t){t.checked=false;t.emitCheckedChange()}))}};t.prototype.emitCheckedChange=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.calciteInternalRadioButtonCheckedChange.emit();return[2]}))}))};t.prototype.uncheckAllRadioButtonsInGroup=function(){var t=this.queryButtons();t.forEach((function(t){if(t.checked){t.checked=false;t.focused=false}}))};t.prototype.uncheckOtherRadioButtonsInGroup=function(){var t=this;var e=this.queryButtons();var i=e.filter((function(e){return e.guid!==t.guid}));i.forEach((function(t){if(t.checked){t.checked=false;t.focused=false}}))};t.prototype.getTabIndex=function(){if(this.disabled){return undefined}return this.checked||this.isDefaultSelectable()?0:-1};t.prototype.mouseenter=function(){this.hovered=true};t.prototype.mouseleave=function(){this.hovered=false};t.prototype.connectedCallback=function(){this.rootNode=this.el.getRootNode();this.guid=this.el.id||"calcite-radio-button-".concat(guid());if(this.name){this.checkLastRadioButton()}connectLabel(this);connectForm(this)};t.prototype.componentDidLoad=function(){if(this.focused&&!this.disabled){this.setFocus()}};t.prototype.disconnectedCallback=function(){disconnectLabel(this);disconnectForm(this)};t.prototype.componentDidRender=function(){updateHostInteraction(this)};t.prototype.render=function(){var t=this.getTabIndex();return h(Host,{onClick:this.clickHandler,onKeyDown:this.handleKeyDown},h("div",{"aria-checked":toAriaBoolean(this.checked),"aria-label":getLabelText(this),class:CSS.container,onBlur:this.onContainerBlur,onFocus:this.onContainerFocus,ref:this.setContainerEl,role:"radio",tabIndex:t},h("div",{class:"radio"})),h(HiddenFormInputSlot,{component:this}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checked:["checkedChanged"],name:["nameChanged"]}},enumerable:false,configurable:true});return t}();RadioButton.style=radioButtonCss;export{RadioButton as calcite_radio_button};