import{b as s}from"./chunk-QABTHFNC.js";var T=class a extends s{constructor({description:t,key:n,example:l,label:p,type:h,options:r,validators:u,alternativeMatches:d,columnSize:m,isMultiSelection:y,allowCustomOptions:c,allowedCustomOptionTypes:o,creator:g,baseKey:C,baseKeyCounter:M,hidden:O,optionMappingConfiguration:b,...v}){super({description:t,key:n,example:l,label:p,type:h,validators:u,alternativeMatches:d,columnSize:m,creator:g,baseKey:C,baseKeyCounter:M,hidden:O,optionMappingConfiguration:b,...v}),this.optionTypeMap=null,this.getOptions=()=>this.options,this.getOptionTypeMap=()=>{if(!this.optionTypeMap){this.optionTypeMap=new Map;for(let e=0;e<this.options.length;e++){let i=this.options[e];this.optionTypeMap.set(i.value,i.type??"string")}}return this.optionTypeMap},this.setOptions=e=>{this.options=e,this.optionTypeMap=null},this.serialize=()=>{let e={description:this.getDescription(),example:this.getExample(),isRequired:this.getIsRequired(),key:this.getKey(),label:this.getLabel(),type:this.getType(),validators:this.getValidators().map(w=>w.serialize()),alternativeMatches:this.getAlternativeMatches(),columnSize:this.getColumnSize(),columnWidth:this.getColumnWidth(),outputFormat:this.getOutputFormat(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration()},i=this.getOptions();return{...e,options:i,isMultiSelection:this.isMultiSelection,allowCustomOptions:this.allowCustomOptions,allowedCustomOptionTypes:this.allowedCustomOptionTypes?[...this.allowedCustomOptionTypes]:void 0}},this.getIsMultiSelection=()=>this.isMultiSelection,this.getAllowCustomOptions=()=>this.allowCustomOptions,this.getAllowedCustomOptionTypes=()=>this.allowedCustomOptionTypes?[...this.allowedCustomOptionTypes]:void 0,this.options=r?.map(e=>({...e,baseKey:e?.baseKey||e.value,baseKeyCounter:e.baseKeyCounter||0,alternativeMatches:e.alternativeMatches.filter(i=>i!==e.label),validations:e.validations||[]})),this.isMultiSelection=y,this.allowCustomOptions=c,this.allowedCustomOptionTypes=o?[...o]:void 0}clone(){let t=this.serialize();return new a({description:t.description,example:t.example,key:t.key,label:t.label,type:t.type,options:t.options,validators:this.getValidators(),alternativeMatches:t.alternativeMatches,columnSize:t.columnSize,columnWidth:t.columnWidth,isMultiSelection:t.isMultiSelection,allowCustomOptions:t.allowCustomOptions,allowedCustomOptionTypes:t.allowedCustomOptionTypes,hidden:t.hidden,disabled:t.disabled,optionMappingConfiguration:t.optionMappingConfiguration})}},S=T;export{S as a};
