System.register(["./p-3c39d395.system.js"],function(e){"use strict";var t,n,r,i;return{setters:[function(e){t=e.r;n=e.h;r=e.H;i=e.g}],execute:function(){var u=e("bce_element_radio",function(){function e(e){var n=this;t(this,e);this.handleFocus=function(e){var t=e.target;n.value={index:n.template.options.length-1,text:t.value};n.el.dispatchEvent(new Event("input",{bubbles:true}))};this.handleOption=function(e){if(!n.template)return;e.cancelBubble=true;var t=e.target;var r=parseInt(t.value,10);var i=n.template.options[r].text;n.value={index:r,text:i};if(n.template.other&&r===n.template.options.length-1){var u=n.el.querySelector("bce-option bce-input");var o=u;n.value.text=o.value;o.querySelector("input").focus()}n.el.dispatchEvent(new Event("input",{bubbles:true}))};this.handleInput=function(e){e.cancelBubble=true;n.value={index:n.template.options.length-1,text:e.target.value};n.el.dispatchEvent(new Event("input",{bubbles:true}))}}e.prototype.renderOther=function(e){return n("bce-input",{placeholder:e.text,onFocus:this.handleFocus,onInput:this.handleInput})};e.prototype.renderOption=function(e,t){if(!this.template)return null;var r=this.template.other&&t===this.template.options.length-1;return n("bce-option",{value:""+t},r?this.renderOther(e):e.text)};e.prototype.render=function(){var e=this;if(!this.template)return null;return n(r,{orientation:this.template.orientation},n("p",null,this.template.question),n("bce-input",{type:"radio",validation:this.template.required?"required":"",value:""+(this.value?this.value.index:-1),onInput:this.handleOption},this.template.options.map(function(t,n){return e.renderOption(t,n)})))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:true,configurable:true});Object.defineProperty(e,"style",{get:function(){return"bce-element-radio p{font-weight:500;text-align:center}\@media screen and (min-width:1024px){bce-element-radio p{text-align:left}}bce-element-radio[orientation=horizontal] bce-input>[data-input]{display:-ms-flexbox;display:flex}bce-element-radio[orientation=horizontal] bce-input>[data-input] bce-option{margin-right:1.5rem}bce-element-radio bce-option[type=radio][checked] bce-input[focus] input{border-color:var(--bce-color-n)}bce-element-radio bce-option[type=radio][checked] bce-input input{border:1px solid var(--bce-color-light-d)}bce-element-radio bce-option[type=radio] bce-input{margin:0;width:auto;min-width:200px}bce-element-radio bce-option[type=radio] bce-input input{margin:0;min-width:200px;border-radius:4px}"},enumerable:true,configurable:true});return e}())}}});