var __decorate=this&&this.__decorate||function(e,t,r,o){var i,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var m=e.length-1;m>=0;m--)(i=e[m])&&(a=(s<3?i(a):s>3?i(t,r,a):i(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a};import{html as e,LitElement as t,css as r}from"lit";import{customElement as o,property as i}from"lit/decorators.js";import{i18next as s,translate as a}from"@openremote/or-translate";import{InputType as m}from"@openremote/or-mwc-components/or-mwc-input";import{OrRulesJsonRuleChangedEvent as l}from"../or-rule-json-viewer";let OrRuleFormEmailMessage=class extends a(s)(t){static get styles(){return r`
            or-mwc-input {
                margin-bottom: 20px;
                min-width: 420px;
                width: 100%;
            }
        `}render(){return this.message?e`
            <form style="display:grid">
                <or-mwc-input value="${this.message.subject||""}" @or-mwc-input-changed="${e=>this.setActionNotificationName(e.detail.value,"subject")}" .label="${s.t("subject")}" type="${m.TEXT}" required placeholder=" "></or-mwc-input>
                <or-mwc-input value="${this.message.html||""}" @or-mwc-input-changed="${e=>this.setActionNotificationName(e.detail.value,"html")}" .label="${s.t("message")}" type="${m.TEXTAREA}" required placeholder=" " ></or-mwc-input>
            </form>
        `:e`<or-translate .value="${"errorOccurred"}"></or-translate>`}setActionNotificationName(e,t){t&&this.message&&(this.message[t]=e),this.dispatchEvent(new l),this.requestUpdate()}};__decorate([i({type:Object})],OrRuleFormEmailMessage.prototype,"message",void 0),OrRuleFormEmailMessage=__decorate([o("or-rule-form-email-message")],OrRuleFormEmailMessage);export{OrRuleFormEmailMessage};