import{r as i,d as t,h as o}from"./p-03169580.js";const n="fireenjin-mx-modal-code-editor fireenjin-code-editor{position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;min-height:100%;min-width:100%}";let e=class{constructor(o){i(this,o);this.fireenjinTrigger=t(this,"fireenjinTrigger",7);this.pageTitle="Sample Data";this.name="sampleData";this.endpoint="editTemplate"}async onSubmit(){this.fireenjinTrigger.emit({name:"closeModal"})}onCodeChange(i){var t;if(!((t=i===null||i===void 0?void 0:i.detail)===null||t===void 0?void 0:t.value))return;this.value=i.detail.value}render(){return[o("ion-header",null,o("ion-toolbar",null,o("ion-title",null,this.pageTitle||"Sample Data"),o("ion-buttons",{slot:"end"},this.documentId&&o("ion-button",{onClick:()=>this.formEl.submit()},o("ion-icon",{slot:"icon-only",name:"save"})),o("ion-button",{onClick:()=>this.fireenjinTrigger.emit({name:"closeModal",el:this.modalEl,component:"mx-modal-send-email"})},o("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),o("ion-content",{style:{"--background":"var(--ion-color-base)"}},o("fireenjin-form",{ref:i=>this.formEl=i,endpoint:this.endpoint,documentId:this.documentId,hideControls:true,beforeSubmit:async()=>({[this.name]:typeof this.value==="string"&&this.language==="json"?JSON.parse(this.value):this.value||null})},o("fireenjin-code-editor",{name:this.name||"sampleData",language:this.language||"json",value:this.value})))]}};e.style=n;export{e as fireenjin_mx_modal_code_editor};
//# sourceMappingURL=p-681a0537.entry.js.map