import{h as e}from"./p-ec7718e6.js";import{r as t,T as s}from"./p-2d511d0e.js";import{B as r}from"./p-d66fb38c.js";import{D as i}from"./p-552063c3.js";import{S as n}from"./p-9c626387.js";class u extends r{constructor(e,t,s,r,i,n,u=!1){super(e,"reference"),this.title=t,this.titleField=s,this.imageField=r,this.otherCollection=i,this.fields=n,this.isSingle=u}static decode(e){return Object.assign(Object.create(u.prototype),e)}showPreview(){return this.preview=!0,this}getDisplayValue(e){return e}}u.type="reference",t("date",((t,s,r,i,n,u)=>e("dvn-field-input-date",{disabled:i,field:t,errors:r,onChange:e=>n(t,e),onBlur:()=>u(t),value:s})));class c extends r{constructor(e,t,s,r,i="checkbox",n){super(e,"multipleChoice"),this.title=t,this.description=r,this.options=s,this.inputType=i,this.placeholder=n}showPreview(){return this.preview=!0,this}getOptionOfValue(e){if(!this.optionsByValue){this.optionsByValue={};for(let e=0;e<this.options.length;e+=1)this.optionsByValue[this.options[e].value]=this.options[e]}return this.optionsByValue[e]||{label:e,value:e}}}c.type="multipleChoice",t("multipleChoice",((t,s,r,i,n,u)=>e("dvn-field-input-multiple-choice",{disabled:i,errors:r,field:t,onChange:e=>n(t,e.detail),onBlur:()=>u(t),value:s})));class h extends r{constructor(e,t,s,r,i=1,n=-1/0,u=1/0){super(e,"number"),this.title=t,this.placeholder=s,this.description=r,this.step=i,this.min=n,this.max=u}showPreview(){return this.preview=!0,this}getDisplayValue(e){return e}}h.type="number",t("number",((t,s,r,i,n,u)=>e("dvn-field-input-number",{disabled:i,field:t,errors:r,onChange:e=>n(t,Number(e.detail)),onBlur:()=>u(t),value:s})));class a extends r{constructor(e,t,s,r=1,i=0,n=5){super(e,"range"),this.title=t,this.description=s,this.step=r,this.min=i,this.max=n}showPreview(){return this.preview=!0,this}getDisplayValue(e){return e}setInputType(e){return this.inputType=e,this}}a.type="range",t("range",((t,s,r,i,n,u)=>e("dvn-field-input-range",{disabled:i,field:t,errors:r,onChange:e=>n(t,Number(e.detail)),onBlur:()=>u(t),value:s})));class o extends r{constructor(e,t,s){super(e,"sectionHeader"),this.id=e,this.header=t,this.sectionDescription=s}}o.type="sectionHeader",t("sectionHeader",((t,s,r,i,n,u)=>e("dvn-field-input-section-header",{disabled:i,field:t,onChange:e=>n(t,e),onBlur:()=>u(t)})));class l extends r{constructor(e,t,s,r,i,n,u){super(e,"subForm"),this.id=e,this.title=t,this.description=r,this.fields=s,this.language=u,this.layout=i,this.showFieldOrder=n,this.value={}}}function d(e){if(e)switch(e.type){case i.type:return Object.assign(Object.create(i.prototype),e);case c.type:return Object.assign(Object.create(c.prototype),e);case h.type:return Object.assign(Object.create(h.prototype),e);case a.type:return Object.assign(Object.create(a.prototype),e);case o.type:return Object.assign(Object.create(o.prototype),e);case n.type:return Object.assign(Object.create(n.prototype),e);case l.type:return Object.assign(Object.create(l.prototype),e);case s.type:return Object.assign(Object.create(s.prototype),e);case u.type:return Object.assign(Object.create(u.prototype),e);default:return Object.assign(Object.create(r.prototype),e)}}l.type="subForm",t("subForm",((t,s,r,i,n,u)=>e("dlm-input-sub-form",{disabled:i,errors:r,field:t,onChange:e=>n(t,e),onBlur:()=>u(t),value:s})));export{c as M,h as N,u as R,a,d as g}