import{r as t,h as e}from"./p-aee8b1df.js";import{E as i}from"./p-433f8f9a.js";const s=class{constructor(e){t(this,e),this.onAnswer=t=>{t||this.handler.set("hasAnswer",!1)},this.onHasAnswer=t=>{t||this.handler.set("answer","",{localize:!0})},this.onMultiline=()=>{this.handler.set("hasAnswer",!1),this.handler.set("answer","",{localize:!0})}}prop(t,e={}){return this.handler.prop(t,Object.assign({},e))}render(){const{hasAnswer:t,multiline:s}=this.value;return e(i,{t:this.t,question:this.prop("question",{localize:!0}),required:this.prop("required")},e("bce-switch",Object.assign({},this.prop("multiline",{on:this.onMultiline}),{label:this.t("me-element-input-multiline")})),e("bce-input",Object.assign({},this.prop("min"),{label:this.t("min"),type:"number"})),e("bce-input",Object.assign({},this.prop("max"),{label:this.t("max"),type:"number"})),e("bce-switch",Object.assign({},this.prop("hasAnswer",{on:this.onHasAnswer}),{label:this.t("answer")})),t&&e("bce-input",Object.assign({},this.prop("answer",{on:this.onAnswer,localize:!0}),{type:s?"textarea":"text",validation:"required"})),e("slot",null))}};export{s as bce_element_input_editor};