import{r as e,e as s,h as t,f as i}from"./p-15c07fa9.js";import{P as a}from"./p-68c1a093.js";import"@sankhyalabs/core";import"./p-ff1990ad.js";import"./p-84345e7a.js";const r=class{constructor(t){e(this,t),this.ezExpressionChange=s(this,"ezExpressionChange",7),this.filterAssistent=void 0,this.application=void 0}getMessage(e,s){return this.application.messagesBuilder.getMessage(e,s)}render(){var e;return t(i,null,t("span",{class:"ez-title ez-title--small ez-padding-bottom--small snk-filter-advanced-mode__title"},this.getMessage("snkPersonalizedFilter.info.applyExpression")),t("ez-text-area",{rows:9,label:this.getMessage("snkPersonalizedFilter.info.labelExpression"),value:null===(e=this.filterAssistent)||void 0===e?void 0:e.expression,onEzChange:e=>this.ezExpressionChange.emit(e.detail)}))}};r.style=".sc-snk-filter-advanced-mode-h{display:block;--snk-personalized-filter--title--color:var(--title--primary, #2B3A54)}.snk-filter-advanced-mode__title.sc-snk-filter-advanced-mode{color:var(--snk-personalized-filter--title--color)}";const n=class{constructor(t){e(this,t),this.ezChangeFilter=s(this,"ezChangeFilter",7),this.filterAssistent=void 0,this.messagesBuilder=void 0,this.filterId=void 0,this.entityUri=void 0,this.application=void 0,this.isDefaultFilter=!1}getMessage(e,s){return this.application.messagesBuilder.getMessage(e,s)}async handleFilterGroupChange(){const e=await this._mainExpressionGroup.getExpressionGroup();this.filterAssistent=Object.assign(Object.assign({},this.filterAssistent),{assistent:e}),this.filterAssistent.parameters=a.buildVariableParameters(this.filterAssistent.assistent),this.filterAssistent.expression=a.buildGroupExpression(this.filterAssistent.assistent),this.ezChangeFilter.emit(this.filterAssistent)}render(){var e,s;return t(i,null,t("div",{class:"ez-padding-top--small snk-personalized-filter__group"},t("snk-expression-group",{ref:e=>this._mainExpressionGroup=e,group:null===(e=this.filterAssistent)||void 0===e?void 0:e.assistent,messagesBuilder:this.messagesBuilder,onEzFilterGroupChange:this.handleFilterGroupChange.bind(this),filterId:this.filterId,entityURI:this.entityUri,isDefaultFilter:this.isDefaultFilter})),t("div",{class:"ez-margin-top--auto"},t("div",{class:"snk-personalized-filter__expression-input--line"}),t("ez-collapsible-box",{label:this.getMessage("snkPersonalizedFilter.info.titleCollapsible"),headerSize:"medium",value:!0},t("div",{class:"ez-box"},t("div",{class:"ez-box__container--external"},t("div",{class:"ez-box__container--internal"},t("span",{class:"ez-box__container--title"},this.getMessage("snkPersonalizedFilter.info.labelExpression")),t("span",{class:"ez-box__container--expression"},null===(s=this.filterAssistent)||void 0===s?void 0:s.expression)))))))}};n.style=".sc-snk-filter-assistent-mode-h{display:flex;flex-direction:column;height:100%;--text-area--font-family:var(--font-pattern, Arial);--text-area__label--floating--top:var(--space--small, 6px);--snk-filter-assistent-mode__container--border-radius:var(--border--radius-medium, 12px);--snk-filter-assistent-mode__container--background:var(--background--medium, #f0f3f7);--snk-filter-assistent-mode__container--margin:var(--space--small, 6px) var(--space--medium, 12px)}.ez-box__container--external.sc-snk-filter-assistent-mode{height:100px;width:100%;overflow-y:auto;background-color:var(--snk-filter-assistent-mode__container--background);border-radius:var(--snk-filter-assistent-mode__container--border-radius)}.ez-box__container--internal.sc-snk-filter-assistent-mode{margin:var(--snk-filter-assistent-mode__container--margin)}.ez-box__container--title.sc-snk-filter-assistent-mode{display:block;user-select:none;font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--title--primary);top:var(--text-area__label--floating--top)}.ez-box__container--expression.sc-snk-filter-assistent-mode{display:block;font-family:var(--text-area--font-family);font-size:var(--text--medium);color:var(--title--primary);top:var(--text-area__label--floating--top)}.snk-personalized-filter__expression-input--line.sc-snk-filter-assistent-mode{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}";export{r as snk_filter_advanced_mode,n as snk_filter_assistent_mode}