import{r as o,B as i,h as e}from"./p-03169580.js";import{s as t}from"./p-5fc6058c.js";import"./p-59c95c5f.js";const n="fireenjin-mx-page-template .tabs-bar{background-color:var(--ion-background-color, #fff) !important}fireenjin-mx-page-template floodteam-floating-button ion-fab{margin-top:20px}fireenjin-mx-page-template .ce-toolbar{background-color:var(--ion-background-color)}fireenjin-mx-page-template .ce-toolbox{background:var(--ion-background-color) !important}fireenjin-mx-page-template ion-item{--background:transparent}fireenjin-mx-page-template .gjs-editor-cont{top:50px}fireenjin-mx-page-template .sample-editor{display:block;height:300px;position:relative;--min-height:300px}fireenjin-mx-page-template ion-item.sample-editor ion-label{position:absolute;top:0;left:0;color:var(--ion-color-medium-shade) !important;font-size:12px !important;font-weight:bold;text-transform:uppercase;font-family:arial;display:block;background:transparent;text-align:left;padding:0 0 8px 0;font-family:var(--ion-font-family)}fireenjin-mx-page-template .preview-wrapper{margin:30px auto;max-width:650px}fireenjin-mx-page-template fireenjin-editor{margin:15px auto;--editor-background:var(--ion-color-base);--editor-color:var(--ion-text-color);--editor-color-shadow:var(--ion-color-base-dark);--editor-color-punctuation:rgba(var(--ion-color-secondary-rgb), 0.6);--editor-color-property:var(--ion-color-primary)}fireenjin-mx-page-template .pdf-wrapper{background-color:#fff;--ion-text-color:#000}";let r=class{constructor(i){o(this,i)}onSuccess(o){var i,e,t,n,r,a,l,d,p;if(((i=o===null||o===void 0?void 0:o.detail)===null||i===void 0?void 0:i.endpoint)==="findTemplate"){this.template=((t=(e=o.detail)===null||e===void 0?void 0:e.data)===null||t===void 0?void 0:t.template)||null}else if(((n=o===null||o===void 0?void 0:o.detail)===null||n===void 0?void 0:n.endpoint)==="addTemplate"&&this.templateId==="new"){const i=document.querySelector("ion-router");this.templateId=((l=(a=(r=o===null||o===void 0?void 0:o.detail)===null||r===void 0?void 0:r.data)===null||a===void 0?void 0:a.addTemplate)===null||l===void 0?void 0:l.id)||"new";if(i)i.push(`/templates/${this.templateId}`)}else if(((d=o===null||o===void 0?void 0:o.detail)===null||d===void 0?void 0:d.endpoint)==="editTemplate"){if((p=this.editorEl)===null||p===void 0?void 0:p.fetchData)this.editorEl.fetchData()}}async onTrigger(o){var i;if(((i=o===null||o===void 0?void 0:o.detail)===null||i===void 0?void 0:i.name)==="preview"){t.isPreviewing=!t.isPreviewing}}componentDidLoad(){if(!(i===null||i===void 0?void 0:i.isBrowser))return;this.db.watchDocument("templates",this.templateId,(()=>{this.editorEl.fetchData()}))}render(){return[e("ion-content",null,e("fireenjin-mx-editor",{ref:o=>this.editorEl=o,partials:t===null||t===void 0?void 0:t.partials,isPreviewing:t===null||t===void 0?void 0:t.isPreviewing,templateId:this.templateId})),e("ion-fab",{vertical:"bottom",horizontal:"end",slot:"fixed",onClick:()=>{var o,i;return(i=(o=this.editorEl)===null||o===void 0?void 0:o.openControls)===null||i===void 0?void 0:i.call(o)}},e("ion-fab-button",null,e("ion-icon",{name:"code-working-outline"}))),e("app-footer",null)]}};r.style=n;export{r as fireenjin_mx_page_template};
//# sourceMappingURL=p-f059eed6.entry.js.map