var __extends=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(t,i)};return function(t,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(t,i);function o(){this.constructor=t}t.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}();import{h}from"./index-ecdfb761.js";import{r as registerField}from"./FieldGenerator-3ae403b2.js";import{B as BaseField}from"./BaseField-0b01dc2c.js";var MultipleChoiceFieldOption=function(){function e(e,t){this.label=e;this.value=t}return e}();var MultipleChoiceField=function(e){__extends(t,e);function t(t,i,o,n,r,l){if(r===void 0){r="checkbox"}var u=e.call(this,t,"multiple-choice")||this;u.title=i;u.description=n;u.options=o;u.inputType=r;u.placeholder=l;return u}t.prototype.showPreview=function(){this.preview=true;return this};t.prototype.getOptionOfValue=function(e){if(!this.optionsByValue){this.optionsByValue={};for(var t=0;t<this.options.length;t+=1){this.optionsByValue[this.options[t].value]=this.options[t]}}return this.optionsByValue[e]||{label:e,value:e}};return t}(BaseField);MultipleChoiceField.type="multiple-choice";var render=function(e,t,i,o,n,r){return h("dvn-field-input-multiple-choice",{disabled:o,errors:i,field:e,onChange:function(t){return n(e,t.detail)},onBlur:function(){return r(e)},value:t})};registerField("multiple-choice",render);export{MultipleChoiceField as M,MultipleChoiceFieldOption as a};