@seniorsistemas/platform-components 5.1.3 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/seniorsistemas-platform-components.umd.js +38 -10
- package/bundles/seniorsistemas-platform-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-platform-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-platform-components.umd.min.js.map +1 -1
- package/esm2015/modules/http-interceptor/http-interceptor.module.js +3 -2
- package/esm2015/modules/http-interceptor/http-interceptor.service.js +21 -11
- package/esm2015/modules/http-interceptor/index.js +2 -1
- package/esm2015/modules/http-interceptor/x-services-url.service.js +17 -0
- package/esm5/modules/http-interceptor/http-interceptor.module.js +3 -2
- package/esm5/modules/http-interceptor/http-interceptor.service.js +24 -11
- package/esm5/modules/http-interceptor/index.js +2 -1
- package/esm5/modules/http-interceptor/x-services-url.service.js +20 -0
- package/fesm2015/seniorsistemas-platform-components.js +33 -12
- package/fesm2015/seniorsistemas-platform-components.js.map +1 -1
- package/fesm5/seniorsistemas-platform-components.js +39 -12
- package/fesm5/seniorsistemas-platform-components.js.map +1 -1
- package/modules/http-interceptor/http-interceptor.service.d.ts +5 -2
- package/modules/http-interceptor/index.d.ts +1 -0
- package/modules/http-interceptor/x-services-url.service.d.ts +4 -0
- package/package.json +2 -2
- package/seniorsistemas-platform-components.metadata.json +1 -1
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var O=function(){return(O=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function w(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function E(t,e){return function(r,i){e(r,i,t)}}function x(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}function T(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function I(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function A(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I(arguments[e]));return t}var C=function(){function t(){}return t.prototype.transform=function(t,e){return void 0===e&&(e=null),Array.from(t.values())},t=w([e.Pipe({name:"mapValues",pure:!1})],t)}(),M=function(){function t(t){this.translationService=t}return t.prototype.transform=function(t,e){return this.translationService.instant(t)},t.ctorParameters=function(){return[{type:p.TranslateService}]},t=w([e.Pipe({name:"translate",pure:!1})],t)}(),N=new e.InjectionToken("translationConfig"),k=function(){function t(){}var r;return r=t,t.forRoot=function(t){return{ngModule:r,providers:[{provide:e.APP_INITIALIZER,useFactory:R,deps:[p.TranslateService,e.Injector,f.HttpClient,d.CookieService],multi:!0},{provide:N,useValue:t,multi:!0}]}},t.forChild=function(t){return{ngModule:r,providers:[{provide:N,useValue:t,multi:!0}]}},t=r=w([e.NgModule({imports:[f.HttpClientModule,p.TranslateModule.forChild()],providers:[d.CookieService]})],t)}();function R(t,e,i,n){var o=this;return function(){return new Promise((function(s){e.get(r.LOCATION_INITIALIZED,Promise.resolve(null)).then((function(){return x(o,void 0,void 0,(function(){var r,o,a,l,u,c,p,d,m,v;return T(this,(function(y){switch(y.label){case 0:r="pt-BR",y.label=1;case 1:y.trys.push([1,8,,9]),g=e.get(N,Promise.resolve(null)),o=g.reduce((function(t,e){return Array.isArray(e)?A(t,e):A(t,[e])}),[]),y.label=2;case 2:return y.trys.push([2,5,,6]),(a=JSON.parse(n.get("com.senior.token")))&&0!==Object.keys(a).length?[3,4]:[4,h.user.getUserData()];case 3:a=y.sent(),y.label=4;case 4:return r=a.locale||"pt-BR",[3,6];case 5:return y.sent(),console.warn("Unable to obtain user locale"),[3,6];case 6:return l=o.reduce((function(t,e){return O(O({},t),e.fallback)}),{}),u=o.reduce((function(t,e){return O(O({},t),e.defaultsLanguages)}),{}),t.setTranslation(r,l),t.setDefaultLang(r),c={},u&&(p=Object.keys(u).map((function(t){var e={};return e.locale=t.replace("_","-"),e.translation=u[t],e}),[]),(d=p.find((function(t){return t.locale===r})))||(d=p.find((function(t){return 2===t.locale.length&&t.locale===r.split("-")[0]}))),d&&(c=d.translation)),m=o.map((function(t){return function(t,e){var r=this,n=t.domain,o=t.service;return new Promise((function(t){return x(r,void 0,void 0,(function(){var r,s,a,l,u,c,p,d,m;return T(this,(function(v){switch(v.label){case 0:if(v.trys.push([0,4,,5]),!n&&!o)throw new Error("domain and service not found");return r=(new f.HttpParams).set("domainName",n).set("serviceName",o).set("format","FLAT_JSON"),l=(a=new f.HttpHeaders).set,u=["Authorization"],[4,h.user.getAuthHeader()];case 1:return s=l.apply(a,u.concat([v.sent()])),"platform/translation_hub/queries/getTranslationBundle",[4,i.get("platform/translation_hub/queries/getTranslationBundle",{headers:s,params:r}).toPromise().then((function(t){return t.bundleFiles}))];case 2:return c=v.sent(),p=e&&c.find((function(t){return t.language===e})),d=!1,p||(p=c.find((function(t){return"pt-BR"===t.language})),d=!0),p?[4,i.get(p.url).toPromise().then((function(e){t({overriden:d,content:e})}))]:[2,t({})];case 3:return v.sent(),[3,5];case 4:return m=v.sent(),console.warn("Error getting translation bundle for "+n+"/"+o+". Using local fallback.",m),t({}),[3,5];case 5:return[2]}}))}))}))}(t,r)})),[4,Promise.all(m).then((function(e){return e.forEach((function(e){t.overriden?(e.content&&t.setTranslation(r,e.content,!0),t.setTranslation(r,c,!0)):(t.setTranslation(r,c,!0),e.content&&t.setTranslation(r,e.content,!0))})),t.use(r).toPromise()}))];case 7:return y.sent(),s(),[3,9];case 8:return v=y.sent(),console.warn("Error setting translations. Using local fallback.",v),t.use(r).toPromise().then((function(){s()})),[3,9];case 9:return[2]}var g}))}))}))}))}}var D,j,P={"platform.filter_service.cancel":"Cancelar","platform.filter_service.try":"Tentar Novamente","platform.filter_service.actions":"Ações","platform.filter_service.save":"Salvar","platform.filter_service.filter":"Filtrar","platform.filter_service.error_state":"O serviço de filtro está indisponível no momento e as informações apresentadas não são as mais recentes. Tente novamente mais tarde.","platform.filter_service.saved_filters_success":'Filtros salvos com sucesso! Clique em "Filtrar" para visualizar o resultado.',"platform.filter_service.saved_filters_error":"Ocorreu um erro ao tentar salvar os filtros. Verifique os valores e tente novamente.","platform.filter_service.applied_filter_nochange":"Não houve alterações no filtro.","platform.filter_service.applied_filter_change":"Filtros aplicados com sucesso!","platform.filter_service.invalid_pattern":"O valor não atende ao padrão especificado.","platform.filter_service.error_max_value":"O valor excede o tamanho máximo especificado.","platform.filter_service.error_min_value":"O valor é menor que o minímo especificado.","platform.filter_service.applied_filters_message":"{{totalActiveFilters}} filtros aplicados","platform.filter_service.applied_filter_message":"{{totalActiveFilters}} filtro aplicado","platform.filter_service.find_suggestions_error":"Erro ao encontrar sugestões!","platform.filter_service.select":"Selecionar","platform.filter_service.filters":"Filtros","platform.filter_service.date_format":"dd/mm/yy","platform.filter_service.hour_format":"24","platform.filter_service.clear":"Limpar","platform.filter_service.today":"Hoje","platform.filter_service.name_january":"Janeiro","platform.filter_service.name_february":"Fevereiro","platform.filter_service.name_march":"Março","platform.filter_service.name_april":"Abril","platform.filter_service.name_may":"Maio","platform.filter_service.name_june":"Junho","platform.filter_service.name_july":"Julho","platform.filter_service.name_august":"Agosto","platform.filter_service.name_september":"Setembro","platform.filter_service.name_october":"Outubro","platform.filter_service.name_november":"Novembro","platform.filter_service.name_december":"Dezembro","platform.filter_service.short_january":"Jan","platform.filter_service.short_february":"Fev","platform.filter_service.short_march":"Mar","platform.filter_service.short_april":"Abr","platform.filter_service.short_may":"Mai","platform.filter_service.short_june":"Jun","platform.filter_service.short_july":"Jul","platform.filter_service.short_august":"Ago","platform.filter_service.short_september":"Set","platform.filter_service.short_october":"Out","platform.filter_service.short_november":"Nov","platform.filter_service.short_december":"Dez","platform.filter_service.name_sunday":"Domingo","platform.filter_service.name_monday":"Segunda","platform.filter_service.name_tuesday":"Terça","platform.filter_service.name_wednesday":"Quarta","platform.filter_service.name_thursday":"Quinta","platform.filter_service.name_friday":"Sexta","platform.filter_service.name_saturday":"Sábado","platform.filter_service.min_sunday":"D","platform.filter_service.min_monday":"S","platform.filter_service.min_tuesday":"T","platform.filter_service.min_wednesday":"Q","platform.filter_service.min_thursday":"Q","platform.filter_service.min_friday":"S","platform.filter_service.min_saturday":"S","platform.filter_service.short_sunday":"Dom","platform.filter_service.short_monday":"Seg","platform.filter_service.short_tuesday":"Ter","platform.filter_service.short_wednesday":"Qua","platform.filter_service.short_thursday":"Qui","platform.filter_service.short_friday":"Sex","platform.filter_service.short_saturday":"Sab","platform.filter_service.yes":"Sim","platform.filter_service.no":"Não","platform.filter_service.search_empty_message":"Nenhum resultado encontrado"},U=function(){function t(t){var e=this;this.http=t,this.filtersObservable=new v.Subject,this.contextsObservable=new m.BehaviorSubject([]),this.ticketFilterObservable=new v.Subject,this.destroy$=new v.Subject,this.contextsObserver=this.contextsObservable.asObservable(),this.filtersObserver=this.filtersObservable.asObservable(),this.ticketFilterObserver=this.ticketFilterObservable.asObservable(),this.contextsObservable.subscribe((function(t){return t.length&&e.getAndApplyFilters(t)}))}return t.prototype.saveTickedFilters=function(t){var e=this,r=this.ticketFilter?{filters:t,ticketFilter:this.ticketFilter}:{filters:t};this.http.post("platform/filter_service/actions/setTicketFilters",r).pipe(y.map((function(t){return t.ticket}))).subscribe((function(t){e.ticketFilter=t,e.ticketFilterObservable.next({ticketFilter:t}),window.parent.postMessage({message:"advanced-filter:success",payload:t},"*")}),(function(t){e.ticketFilterObservable.next({error:!0,message:t}),window.parent.postMessage({message:"advanced-filter:error",payload:t},"*")}))},t.prototype.addContexts=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=this.contextsObservable.getValue();return this.contextsObservable.next(A(i,e)),v.Observable.create((function(){return function(){return t.removeContexts(e)}}))},t.prototype.removeContexts=function(t){var e=this.contextsObservable.getValue().filter((function(e){return-1===t.indexOf(e)}));this.contextsObservable.next(e)},t.prototype.saveFilters=function(t){return this.http.post("platform/filter_service/actions/saveUserFilters",{filters:t})},t.prototype.searchFieldSuggestions=function(t,e,r){var i=new f.HttpHeaders({"Content-Type":"application/json; charset=utf-8"});return"ENTITY"===r?this.http.get(t,{headers:i}):this.http.post(t,e,{headers:i})},t.prototype.tryAgain=function(t){this.getFilters(t)},t.prototype.getAndApplyFilters=function(t){this.getFilters(t,!0)},t.prototype.getFilters=function(t,e){var r=this;this.http.post("platform/filter_service/queries/getFilters",{serviceContexts:t}).pipe(y.map((function(t){return r.mapFilters(t.filters)}))).subscribe((function(t){return r.filtersObservable.next({filters:t,applyFilter:e})}),(function(t){return r.filtersObservable.next({error:!0,message:t})}))},t.prototype.mapFilters=function(t){var e=this;return t.map((function(t){try{var r=t.value&&JSON.parse(t.value);if(r&&t.search&&t.search.basicSearch&&t.search.basicSearch.output?e.mapValues(r,t.search.basicSearch.output.keyFields,t.search.basicSearch.output.displayFields):r&&t.search&&t.search.entitySearch&&t.search.entitySearch.output&&e.mapValues(r,t.search.entitySearch.output.keyFields,t.search.entitySearch.output.displayFields),r)if(e.isMultiple(t)){var i=JSON.stringify(r);i.startsWith("[{")&&i.endsWith("}]")||i.length<=4?t.value=i:t.value=JSON.stringify("")}else t.value=JSON.stringify(r)}catch(e){console.error("Global: filter "+t.name+" has value error. ",e),t.value=JSON.stringify("")}return t}))},t.prototype.isMultiple=function(t){return"SEARCH"===t.type&&t.search&&(t.search.basicSearch&&t.search.basicSearch.output&&t.search.basicSearch.output.maxSelectedItems>1||t.search.entitySearch&&t.search.entitySearch.output&&t.search.entitySearch.output.maxSelectedItems>1)},t.prototype.mapValues=function(t,e,r){var i=this;Array.isArray(t)?t.forEach((function(t){i.mapValue(t,e,r)})):this.mapValue(t,e,r)},t.prototype.mapValue=function(t,e,r){if(t){var i=[],n=[];e.filter((function(e){return void 0!==t[e]})).forEach((function(e){return i.push(t[e])})),r.filter((function(e){return void 0!==t[e]})).forEach((function(e){return n.push(t[e])})),i.length>0&&n.length>0?(t.$$__keyValue__=i.join(", "),t.$$__displayValue__=n.join(", ")):t=[""]}},t.ctorParameters=function(){return[{type:f.HttpClient}]},t=w([e.Injectable()],t)}(),V=function(t,e,r,i,n,o,s,a,l,u,c,p,f,h,d,m,v,y){this.type=t,this.required=e,this.label=r,this.domain=i,this.scope=n,this.name=o,this.contexts=s,this.services=a,this.value=l,this.enumItems=u,this.defaultValue=c,this.search=p,this.tabIndex=f,this.minValue=h,this.maxValue=d,this.dependsOn=m,this.mask=v,this.regExp=y};(D=t.FilterType||(t.FilterType={})).STRING="STRING",D.BOOLEAN="BOOLEAN",D.INTEGER="INTEGER",D.DOUBLE="DOUBLE",D.DATE="DATE",D.DATETIME="DATETIME",D.TIME="TIME",D.MONEY="MONEY",D.ENUMERATION="ENUMERATION",D.SEARCH="SEARCH",(j=t.Scope||(t.Scope={})).DOMAIN="DOMAIN",j.SERVICE="SERVICE";var B,L=function(){function t(t){var e=t.value,r=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(t,["value"]);this._valueObserver=new v.Subject,this.valueChanges=this._valueObserver.asObservable(),this._value=e,Object.assign(this,r)}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this._valueObserver.next(t)},enumerable:!0,configurable:!0}),t}(),q=function(t){this.fields=[],this.form=new i.FormGroup({}),Object.assign(this,t)},$=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.activeFilters=0,e}return function(t,e){function r(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return this.name+" ("+this.activeFilters+")"},enumerable:!0,configurable:!0}),e}(q);function H(t,e){return t+":"+e}var G=t.FilterType.DATETIME,z=t.FilterType.TIME,J=((B={})[t.FilterType.DATE]=function(t){return W(t,"YYYY-MM-DD")},B[z]=function(t){return W(t,"HH:mm:ss")},B[G]=function(t){return W(t)},B);function Y(t,e){var r=J[e];return null!=t&&""!==t&&r?r(t):t}function W(t,e){var r=b(t);return e?r.format(e):r.format()}var K,Q={contains:function(t,e){return"containing("+t+", '"+e+"')"},"=":function(t,e){return t+" eq "+e},"!=":function(t,e){return t+" ne "+e},">":function(t,e){return t+" gt "+e},"<":function(t,e){return t+" lt "+e},">=":function(t,e){return t+" ge "+e}};function Z(e,r,i){var n=JSON.parse(e);return r!==t.FilterType.SEARCH||i?n[0]:n}function X(t){return t.basicSearch?t.basicSearch:t.entitySearch}var tt=t.FilterType.DATE,et=t.FilterType.DATETIME,rt=t.FilterType.TIME,it=((K={})[tt]=function(t){return ot(t)},K[et]=function(t){return ot(t)},K[rt]=function(t){return ot(t,"HH:mm:ss")},K);function nt(e){var r=e.minValue,n=e.maxValue,o=e.regExp,s=e.value,a=e.type,l=e.search,u=function(t,e,r){var n=i.Validators.pattern,o=i.Validators.min,s=i.Validators.max,a=[];return r&&a.push(n(r)),void 0!==t&&a.push(o(t)),void 0!==e&&a.push(s(e)),a}(r,n,o),c=function(e,r,i){var n,o=it[r],s=JSON.parse(e),a=i&&1===X(i).output.maxSelectedItems;return n=r!==t.FilterType.INTEGER&&r!==t.FilterType.DOUBLE&&r!==t.FilterType.MONEY||""!==s[0]?r!==t.FilterType.SEARCH||a?s[0]:s[0]?s:[]:null,o?o(n):n}(s,a,l);return new i.FormControl(c,{validators:u})}function ot(t,e){return null!==t&&""!==t?b(t,e).toDate():""}var st=[t.FilterType.STRING,t.FilterType.BOOLEAN,t.FilterType.INTEGER,t.FilterType.ENUMERATION,t.FilterType.TIME,t.FilterType.MONEY,t.FilterType.DATETIME,t.FilterType.DATE,t.FilterType.DOUBLE],at={">":function(t,e){return t>e},"<":function(t,e){return t<e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},contains:function(t,e){return _.contains(t,e)},"=":function(t,e){return"number"==typeof e?_.equals(Number(t),e):_.equals(t,e)},"!=":function(t,e){return"number"==typeof e?!_.equals(Number(t),e):!_.equals(t,e)}};function lt(t,e,r){return(0,at[t])(e,r)}function ut(t){return!!at[t]}function ct(t){return _.contains(t,st)}var pt="platform.filter_service",ft=function(){function t(t){this.translate=t}return t.prototype.getOptions=function(){return{clear:this.translate.instant(pt+".clear"),dateFormat:this.translate.instant(pt+".date_format"),dayNames:[this.translate.instant(pt+".name_sunday"),this.translate.instant(pt+".name_monday"),this.translate.instant(pt+".name_tuesday"),this.translate.instant(pt+".name_wednesday"),this.translate.instant(pt+".name_thursday"),this.translate.instant(pt+".name_friday"),this.translate.instant(pt+".name_saturday")],dayNamesMin:[this.translate.instant(pt+".min_sunday"),this.translate.instant(pt+".min_monday"),this.translate.instant(pt+".min_tuesday"),this.translate.instant(pt+".min_wednesday"),this.translate.instant(pt+".min_thursday"),this.translate.instant(pt+".min_friday"),this.translate.instant(pt+".min_saturday")],dayNamesShort:[this.translate.instant(pt+".short_sunday"),this.translate.instant(pt+".short_monday"),this.translate.instant(pt+".short_tuesday"),this.translate.instant(pt+".short_wednesday"),this.translate.instant(pt+".short_thursday"),this.translate.instant(pt+".short_friday"),this.translate.instant(pt+".short_saturday")],firstDayOfWeek:0,hourFormat:this.translate.instant(pt+".hour_format"),monthNames:[this.translate.instant(pt+".name_january"),this.translate.instant(pt+".name_february"),this.translate.instant(pt+".name_march"),this.translate.instant(pt+".name_april"),this.translate.instant(pt+".name_may"),this.translate.instant(pt+".name_june"),this.translate.instant(pt+".name_july"),this.translate.instant(pt+".name_august"),this.translate.instant(pt+".name_september"),this.translate.instant(pt+".name_october"),this.translate.instant(pt+".name_november"),this.translate.instant(pt+".name_december")],monthNamesShort:[this.translate.instant(pt+".short_january"),this.translate.instant(pt+".short_february"),this.translate.instant(pt+".short_march"),this.translate.instant(pt+".short_april"),this.translate.instant(pt+".short_may"),this.translate.instant(pt+".short_june"),this.translate.instant(pt+".short_july"),this.translate.instant(pt+".short_august"),this.translate.instant(pt+".short_september"),this.translate.instant(pt+".short_october"),this.translate.instant(pt+".short_november"),this.translate.instant(pt+".short_december")],today:this.translate.instant(pt+".today")}},t.ctorParameters=function(){return[{type:p.TranslateService}]},t=w([e.Injectable()],t)}(),ht="platform.filter_service",dt=function(){function r(t,r,i,n,o){this.filterService=t,this.translate=r,this.messageService=i,this.calendarOptionsService=n,this.changeDetectorRef=o,this.destroy$=new v.Subject,this.contexts=[],this.formFilters=[],this.oldFormFilters=[],this.actualFormFilters=[],this.general=new q({name:"Geral"}),this.totalFiltersActive=0,this.isMobile=!1,this.tabViewOrientation="left",this.error=!1,this.errorMessages={min:this.translate.instant(ht+".error_min_value"),max:this.translate.instant(ht+".error_max_value"),pattern:this.translate.instant(ht+".invalid_pattern")},this.showMessages=!0,this.isModal=!1,this.totalFiltersActiveOutput=new e.EventEmitter,this.errorOutput=new e.EventEmitter,this.showDialogOutput=new e.EventEmitter,this.closeModalOutput=new e.EventEmitter}return r.prototype.onResizeWindow=function(t){var e=t.target.innerWidth;this.isMobile=e<=640,this.tabViewOrientation=this.isMobile?"top":"left"},r.prototype.ngOnInit=function(){var t=this;this.isMobile=innerWidth<=640,this.tabViewOrientation=this.isMobile?"top":"left",this.subscribeContextsObservable(),this.subscribeFiltersObservable(),window.addEventListener("message",(function(e){var r,i=e.data;"addContext"===(i.message&&i.message.split(":")[1])&&(r=t.filterService).addContexts.apply(r,A(i.payload))}))},r.prototype.ngOnDestroy=function(){this.destroy$.next(!0)},r.prototype.hasChanges=function(){var t=this,e=Object.keys(this.formFilters);return!Object.keys(this.oldFormFilters).length||e.filter((function(e){var r=t.formFilters[e].value,i=t.oldFormFilters[e]&&t.oldFormFilters[e].value;return!_.equals(r,i)})).length>0},r.prototype.onApplyFilters=function(){this.hasChanges()&&this.closeModalOutput.emit()},r.prototype.getFilters=function(){this.hasChanges()&&this.filterService.tryAgain(this.contexts)},r.prototype.applyFilters=function(t){if(void 0===t&&(t=!1),this.hasChanges()){this.showDialogOutput.emit(!1),this.counterUpdate();var e=this.getFiltersValues(this.formFilters);this.filterService.saveTickedFilters(e)}else if(t){var r={key:"filterServiceToastKey",severity:"info",life:5e3,detail:this.translate.instant(ht+".applied_filter_nochange",{activeFilters:this.totalFiltersActive})};this.sendMessage(r)}this.oldFormFilters=_.clone(this.formFilters)},r.prototype.getDefaultValue=function(t,e){return void 0===t||e&&""===t[0]?[]:t},r.prototype.clearFilters=function(){var t=this;Object.keys(this.formFilters).forEach((function(e){return t.cleanFieldAndSetDefaultValue(e)}))},r.prototype.sendCloseMessage=function(){window.parent.postMessage({message:"dashboard:close-modal",payload:{modalName:"advanced-filter-1"}},"*")},r.prototype.sendMessage=function(t){this.showMessages?this.messageService.add(t):window.parent.postMessage({message:"dashboard:toastr",payload:{type:"success",message:t.detail}},"*")},r.prototype.saveFilters=function(){var t=this,e=this.parseToUserFilters(this.formFilters);this.filterService.saveFilters(e).subscribe((function(){var e={key:"filterServiceToastKey",severity:"info",life:5e3,detail:t.translate.instant(ht+".saved_filters_success",{activeFilters:t.totalFiltersActive})};t.sendMessage(e),t.counterUpdate()}),(function(){var e={key:"filterServiceToastKey",severity:"error",life:5e3,detail:t.translate.instant(ht+".saved_filters_error",{activeFilters:t.totalFiltersActive})};t.sendMessage(e)}))},r.prototype.counterUpdate=function(){this.totalFiltersActive=this.countActiveFilters(this.tabs),this.totalFiltersActiveOutput.emit(this.totalFiltersActive)},r.prototype.countActiveFilters=function(t){var e=0;return t.forEach((function(t){var r=t.form.value;t.activeFilters=Object.keys(r).reduce((function(t,e){var i=r[e],n=Array.isArray(i);return(n&&i.length>0||!n&&i)&&t++,t}),0),e+=t.activeFilters})),e},r.prototype.parseToUserFilters=function(e){return Object.keys(e).reduce((function(r,i){var n=e[i],o=n.type,s=n.services,a=n.name,l=n.value,u=n.domain,c=n.contexts,p=function(e,r){var i;return i=r===t.FilterType.SEARCH&&Array.isArray(e)?Array.isArray(e)?e.length?null===e[0]?[""]:e:[""]:e||[""]:[null==e?"":e],JSON.stringify(i)}(l,o);return A(r,s.map((function(t){return{name:a,service:t,value:p,domain:u,contexts:c}})))}),[])},r.prototype.getFiltersValues=function(e){return Object.keys(e).reduce((function(r,i){var n=e[i],o=n.type,s=n.services,a=n.name,l=n.value,u=n.domain,c=function(e,r){var i;return r!==t.FilterType.SEARCH?i=[null==e?"":e]:Array.isArray(e)?(i=[""],null!==e&&e.length>0&&""!==e[0]&&(i=e.map((function(t){return t.$$__keyValue__})))):i=[null===e?"":e.$$__keyValue__],JSON.stringify(i)}(l,o);return A(r,s.map((function(t){return{name:a,service:t,value:c,domain:u}})))}),[])},r.prototype.subscribeContextsObservable=function(){var t=this;this.filterService.contextsObserver.pipe(y.takeUntil(this.destroy$)).subscribe((function(e){return t.contexts=e}))},r.prototype.errorStateAction=function(){this.filterService.tryAgain(this.contexts)},r.prototype.subscribeFiltersObservable=function(){var t=this;this.filterService.filtersObserver.pipe(y.takeUntil(this.destroy$)).subscribe((function(e){var r=e.filters,i=e.applyFilter,n=e.error,o=e.message;t.errorOutput.emit(n),t.error=n,t.errorState=o,n||(t.tabs=t.createTabs(r),t.counterUpdate(),t.setDependencies(t.formFilters),t.createChildArray(),r.length>0&&i&&t.applyFilters())}))},r.prototype.setDependencies=function(t){var e=this,r=Object.keys(t);v.from(r).pipe(y.map((function(e){return t[e]})),y.filter((function(t){var e=t.dependsOn;return e&&e.length>0})),y.tap((function(e){var r=e.dependsOn,i=e.domain,n=e.filterControl;r.filter((function(t){return t.required})).filter((function(e){var r=H(i,e.filterName),n=t[r],o=n.value,s=n.type,a=e.comparator;if(a&&ut(a.operator)&&ct(s)){var l=Y(o,s);return!lt(a.operator,a.value,l)}return e.required?!n.value:n.value})).length>0&&n.disable()})),y.map((function(t){return{domain:t.domain,dependsOn:t.dependsOn,filterControl:t.filterControl}}))).subscribe((function(r){var i=r.dependsOn,n=r.domain,o=r.filterControl;return v.from(i).pipe(y.filter((function(t){return t.required})),y.map((function(t){var e=t.filterName;return H(n,e)})),y.map((function(e){return t[e]})),y.mergeMap((function(t){return v.from(t.valueChanges)})),y.map((function(t){var r=i.every((function(r){var i=H(n,r.filterName);if(e.formFilters[i]){var o=e.formFilters[i].type,s=r.comparator;if(s&&ut(s.operator)&&ct(o)){var a=Y(t,o);return lt(s.operator,s.value,a)}return!0}}));return!e.IsEmpty(t)&&r?"enable":"disable"}))).subscribe((function(t){return o[t]()}))}))},r.prototype.addGeneralField=function(t){var e=this,r=t.name,i=t.domain,n=t.type,o=H(i,r),s=nt(t);s.valueChanges.pipe(y.takeUntil(this.destroy$),y.map((function(t){return Y(t,n)})),y.tap((function(t){return e.formFilters[o].value=t}))).subscribe((function(t){return e.tabs.forEach((function(e){var n=e.form.controls[r];n&&e.domain===i&&n.setValue(t,{emitEvent:!1})}))}));var a=O(O({},t),{name:o}),l=this.createField(a);this.general.form.addControl(o,s),this.general.fields.push(l)},r.prototype.containsAllContexts=function(t){if(!t.length)return!0;var e=this.contexts.map((function(t){return t.contextId}));return _.equals(t.sort(),e.sort())},r.prototype.createTabs=function(e){var r=this;return e.reduce((function(e,i){var n=i.domain,o=i.services,s=i.name,a=i.type,l=i.scope,u=i.contexts,c=i.dependsOn,p=i.value,f=i.search,h=i.defaultValue,d=f&&1===X(f).output.maxSelectedItems,m=r.createField(i),v=H(n,s),g={domain:n,contexts:u,services:o,name:s,dependsOn:c,value:Z(p,a,d),type:a,isMultiple:!d,defaultValue:Z(h,a,d)};r.formFilters[v]=new L(g);var b=r.formFilters[v];return l===t.Scope.DOMAIN&&r.containsAllContexts(u)&&r.addGeneralField(i),u.forEach((function(t){var o=function(t,e){return t+":"+e}(n,t),l=nt(i);if(!e.has(o)){var u=r.contexts.find((function(e){return e.contextId===t})).contextLabel,c=new $({domain:n,name:u});e.set(o,c)}l.valueChanges.pipe(y.takeUntil(r.destroy$)).subscribe((function(t){return r.updateFilterValue(o,s,t,n,a)}));var p=e.get(o);p.fields.push(m),p.form.addControl(i.name,l),b.filterControl||(b.filterControl=l)})),e}),new Map)},r.prototype.updateFilterValue=function(t,e,r,i,n){var o=this,s={emitEvent:!1},a=Y(r,n),l=H(i,e),u=this.general.form.controls[l];this.tabs.forEach((function(i,n){var o=i.form.controls[e];t!==n&&o&&o.setValue(r,s)}));var c=this.formFilters[l].childs;c&&c.forEach((function(t){return o.cleanFieldAndSetDefaultValue(t.filter.key)})),u&&u.setValue(r,s),this.formFilters[l].value=a},r.prototype.cleanFieldAndSetDefaultValue=function(t){var e=this.formFilters[t],r=e.isMultiple,i=e.defaultValue,n=e.filterControl,o=e.type,s=this.getDefaultValue(i,r);n&&(("DATE"===o||"SEARCH"===o&&r)&&n.setValue(s),"INTEGER"===o||"DOUBLE"===o||"MONEY"===o?""===s?n.setValue(null):n.setValue(s):n.setValue(s,{onlySelf:!0}))},r.prototype.createChildArray=function(){var t=this;Object.keys(this.formFilters).forEach((function(e){var r=t.formFilters[e],i=r.dependsOn,n=r.domain;i.forEach((function(r){var i=H(n,r.filterName);t.formFilters[i]&&(t.formFilters[i].childs||(t.formFilters[i].childs=[]),t.formFilters[i].childs.push({filter:{key:e,required:r.required}}))}))}))},r.prototype.createField=function(e){var r,i=this,n=e.name,o=e.label,s=e.enumItems,a=e.type,l=e.mask,u=s&&s.map((function(t){return{label:i.translate.instant(t.label),value:t.value}})),p={name:n,label:this.translate.instant(o),placeholder:""};return((r={})[t.FilterType.STRING]=function(){return new c.TextField(O(O({},p),{mask:l?function(){return l}:null,type:c.FieldType.String}))},r[t.FilterType.MONEY]=function(){return new c.CurrencyField(O(O({},p),{type:c.FieldType.Money}))},r[t.FilterType.BOOLEAN]=function(){return i.createRadioButton(O({},p))},r[t.FilterType.DATE]=function(){return i.createCalendar(O(O({},p),{type:c.FieldType.Date}))},r[t.FilterType.DATETIME]=function(){return i.createCalendar(O(O({},p),{type:c.FieldType.DateTime}))},r[t.FilterType.TIME]=function(){return i.createCalendar(O(O({},p),{type:c.FieldType.Time}))},r[t.FilterType.ENUMERATION]=function(){return new c.SelectField(O(O({},p),{placeholder:i.translate.instant("platform.filter_service.select"),options:A(u),type:c.FieldType.Enum}))},r[t.FilterType.INTEGER]=function(){return new c.NumberField(O(O({},p),{numberLocaleOptions:i.optionsInteger(),mask:l?function(){return l}:null,type:c.FieldType.Integer}))},r[t.FilterType.DOUBLE]=function(){return new c.CurrencyField(O(O({},p),{type:c.FieldType.Double}))},r[t.FilterType.SEARCH]=function(){return i.createAutocompleteField(p,e)},r)[a]()},r.prototype.createRadioButton=function(t){var e=[{label:this.translate.instant(ht+".yes"),value:!0},{label:this.translate.instant(ht+".no"),value:!1}];return new c.RadioButtonField(O(O({},t),{type:c.FieldType.Radio,options:e}))},r.prototype.createCalendar=function(t){var e=new c.CalendarField(t);return e.calendarLocaleOptions=this.calendarOptionsService.getOptions(),this.isModal||(e.appendTo="body"),e},r.prototype.createAutocompleteField=function(t,e){var r=this,i=e.dependsOn,n=e.search,o=e.domain,s=e.name,a=new v.BehaviorSubject([]),l=X(n).input.queryParam,u=X(n).output,p=u.displayFields,f=u.keyFields,h=u.resultDataJsonPath,d=u.displayFieldConcatToken,m=u.maxSelectedItems,g=H(o,s);return new c.AutocompleteField(O(O({},t),{onSearch:function(t){var e,s=((e={})[l]=t,e);i&&Object.assign(s,r.getDependenciesValues(i,o));var u=n&&"ENTITY"===n.type?r.getEntitySearchUrl(n.entitySearch.input,t,i):X(n).input.url;r.filterService.searchFieldSuggestions(u,s,n.type).pipe(y.map((function(t){return function t(e,r){var i=(r=r.replace("$.","")).split("."),n=e[i[0]];return i.shift(),i.length?t(n,i.join(".")):n}(t,h)})),y.map((function(t){return r.addSuggestionFields(t,p,f,d,g)}))).subscribe((function(t){a.next(t),r.changeDetectorRef.detectChanges()}),(function(t){var e=void 0;t&&t.error.message&&(e=t.error.message),function(t){var e={key:"filterServiceToastKey",severity:"error",life:5e3,detail:t||r.translate.instant(ht+".find_suggestions_error",{activeFilters:r.totalFiltersActive})};r.sendMessage(e)}(e)}))},appendTo:"body",suggestionsObservable:a,displayField:"$$__displayValue__",dataKey:"$$__keyValue__",multiple:m>1,size:{lg:12,md:12,xl:12},emptyMessage:this.translate.instant(ht+".search_empty_message")}))},r.prototype.getEntitySearchUrl=function(t,e,r){var i=this,n=t.attributes,o=t.domainName,s=t.entityName,a=t.serviceName,l=o+"/"+a+"/entities/"+s+"/?filter=",u=n.map((function(t){return Q[t.comparator](t.name,e)}));return r&&r.forEach((function(t){var e=H(o,t.filterName),r=i.formFilters[e].value.$$__keyValue__;u.push(t.entityAttribute+" eq '"+r+"'")})),l.concat(u).replace(/[,]+(?![^(]*[)])/g," "+t.operator+" ")},r.prototype.addSuggestionFields=function(t,e,r,i,n){var o=this,s=function(t,e,r){return t?""+t+r+e:e},a=t.map((function(t){var n;return O(O({},t),((n={}).$$__displayValue__=e.reduce((function(e,r){return s(e,o.translate.instant(t[r]),i)}),""),n.$$__keyValue__=r.reduce((function(e,r){return s(e,t[r],", ")}),""),n))}));return this.formFilters[n].invalidValue=0===a.length,a.filter((function(t){var e=o.formFilters[n].value;return Array.isArray(e)?-1===e.findIndex((function(e){return e.$$__keyValue__===t.$$__keyValue__}))?t:void 0:t}))},r.prototype.getDependenciesValues=function(t,e){var r=this;return t.reduce((function(t,i){var n=i.filterName,o=H(e,n);if(r.formFilters[o]){var s=r.formFilters[o],a=s.value;return"ENUMERATION"===s.type?t[n]=a:Array.isArray(a)?t[n]=a.map((function(t){return t.$$__keyValue__})):t[n]=a?a.$$__keyValue__:[""],r.IsEmpty(t[n])&&delete t[n],t}}),{})},r.prototype.IsEmpty=function(t){return Array.isArray(t)?t.every((function(t){return!t})):!t},r.prototype.optionsInteger=function(){return{currencySymbol:"",decimalSeparator:"",thousandsSeparator:""}},r.ctorParameters=function(){return[{type:U},{type:p.TranslateService},{type:u.MessageService},{type:ft},{type:e.ChangeDetectorRef}]},w([e.Input()],r.prototype,"showMessages",void 0),w([e.Input()],r.prototype,"isModal",void 0),w([e.Output()],r.prototype,"totalFiltersActiveOutput",void 0),w([e.Output()],r.prototype,"errorOutput",void 0),w([e.Output()],r.prototype,"showDialogOutput",void 0),w([e.Output()],r.prototype,"closeModalOutput",void 0),w([e.HostListener("window:resize",["$event"])],r.prototype,"onResizeWindow",null),r=w([e.Component({selector:"s-app-form-filter",template:'<s-empty-state\n *ngIf="error"\n iconClass="fa fa-exclamation-triangle"\n title="{{ errorState?.status }} - {{ errorState?.statusText }}"\n (primaryAction)="errorStateAction()"\n [primaryActionLabel]="translate.instant(\'platform.filter_service.try\')"\n [description]="translate.instant(\'platform.filter_service.error_state\')"\n></s-empty-state>\n\n<div *ngIf="!error">\n <p-tabView *ngIf="tabs && tabs.size > 1" [orientation]="tabViewOrientation" selected="false">\n <p-tabPanel *ngIf="general.fields.length" [selected]="false" [header]="general.name">\n <s-dynamic-form [errorMessages]="errorMessages" [fields]="general.fields" [form]="general.form"></s-dynamic-form>\n </p-tabPanel>\n\n <p-tabPanel *ngFor="let tab of (tabs | mapValues); let i = index" [selected]="i === 0" [header]="tab.label">\n <s-dynamic-form [errorMessages]="errorMessages" [fields]="tab.fields" [form]="tab.form"></s-dynamic-form>\n </p-tabPanel>\n </p-tabView>\n\n <div *ngIf="tabs && tabs.size === 1">\n <s-dynamic-form\n *ngFor="let tab of (tabs | mapValues)"\n [errorMessages]="errorMessages"\n [fields]="tab.fields"\n [form]="tab.form"\n ></s-dynamic-form>\n </div>\n</div>\n',styles:[".filter-dialog{width:800px;top:100px}.filter-dialog>.ui-dialog-content{height:300px;padding:10px!important}@media (min-width:641px) and (max-width:1024px){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:300px}}@media only screen and (min-device-width:481px) and (max-device-width:1024px) and (orientation:portrait){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:90%}}@media (min-width:320px) and (max-width:640px){.filter-dialog{width:95%;left:0;top:0;opacity:1;margin:auto;height:93%}.filter-dialog>.ui-dialog-content{height:85%}}@media (min-width:320px) and (max-width:640px) and (max-width:360px){.filter-dialog button{padding:0!important}.filter-dialog>.ui-dialog-content{height:81%}}"]})],r)}(),mt=function(){function t(t,e){var r=this;this.translate=t,this.router=e,this.labelButton="Filters",this.onlyContent=!1,this.hideButtons=!1,this.canOpenFilter=!0,this.showActiveFiltersCountBadge=!0,this.filterAndSave=!1,this.subscriptions=[],this.isMobile=!1,this.tabViewOrientation="left",this.totalFiltersActive=0,this.showDialog=!1,this.error=!1,this.mobileButtonActions=[{id:"save",label:this.translate.instant("save"),command:function(){return r.modalComponent.saveFilters()}},{id:"clear",label:this.translate.instant("clear"),command:function(){return r.modalComponent.clearFilters()}}]}return t.prototype.ngOnInit=function(){var t=this;this.isMobile=innerWidth<=640,this.tabViewOrientation=this.isMobile?"top":"left";var e=this.router.events.subscribe((function(e){e instanceof g.NavigationEnd&&t.modalComponent.getFilters()}));this.subscriptions.push(e)},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.onResizeWindow=function(t){var e=t.target.innerWidth;this.isMobile=e<=640,this.tabViewOrientation=this.isMobile?"top":"left"},Object.defineProperty(t.prototype,"appliedFiltersTooltip",{get:function(){return this.totalFiltersActive>1?this.translate.instant("platform.filter_service.applied_filters_message",{totalActiveFilters:this.totalFiltersActive}):this.translate.instant("platform.filter_service.applied_filter_message",{totalActiveFilters:this.totalFiltersActive})},enumerable:!0,configurable:!0}),t.prototype.onError=function(t){this.error=t},t.prototype.saveFilters=function(){this.modalComponent.saveFilters()},t.prototype.clearFilters=function(){this.modalComponent.clearFilters()},t.prototype.close=function(){this.modalComponent.getFilters(),window.parent.postMessage({message:"dashboard:close-modal",payload:{modalName:"advanced-filter-1"}},"*")},t.prototype.applyFilters=function(){this.modalComponent.hasChanges()&&(this.showDialog=!1),this.filterAndSave&&this.modalComponent.saveFilters(),this.modalComponent.applyFilters(!0)},t.prototype.onApplyFilters=function(){this.filterAndSave&&this.modalComponent.saveFilters(),this.modalComponent.onApplyFilters()},t.prototype.toggleDialog=function(){this.showDialog=!this.showDialog},t.prototype.updateTotalFiltersActive=function(t){this.totalFiltersActive=t},t.ctorParameters=function(){return[{type:p.TranslateService},{type:g.Router}]},w([e.Input()],t.prototype,"labelButton",void 0),w([e.Input()],t.prototype,"onlyContent",void 0),w([e.Input()],t.prototype,"hideButtons",void 0),w([e.Input()],t.prototype,"canOpenFilter",void 0),w([e.Input()],t.prototype,"showActiveFiltersCountBadge",void 0),w([e.Input()],t.prototype,"filterAndSave",void 0),w([e.ViewChild(dt)],t.prototype,"modalComponent",void 0),w([e.HostListener("window:resize",["$event"])],t.prototype,"onResizeWindow",null),t=w([e.Component({selector:"s-advanced-filter",template:'<s-button\n *ngIf="!onlyContent"\n [id]="\'filterButton\'"\n [disabled]="!canOpenFilter"\n (click)="canOpenFilter ? toggleDialog() : \'\'"\n iconClass="fa fa-filter"\n priority="default"\n [label]="labelButton"\n [auxiliary]="true"\n [tooltip]="appliedFiltersTooltip"\n>\n <span *ngIf="totalFiltersActive && showActiveFiltersCountBadge" class="sds-badge-number sds-color-primary custom-badge">{{ totalFiltersActive }}</span>\n</s-button>\n\n<section *ngIf="onlyContent">\n <div class="only-content-wrapper">\n <div class="header">\n <h3>{{ \'platform.filter_service.filters\' | translate }}</h3>\n <span (click)="close()" class="close_btn pi pi-times"></span>\n </div>\n <div class="app-form-filter">\n <s-app-form-filter\n [showMessages]="false"\n (totalFiltersActiveOutput)="updateTotalFiltersActive($event)"\n (closeModalOutput)="close()"\n [isModal]="false"\n ></s-app-form-filter>\n </div>\n <div class="filter-footer" *ngIf="!error">\n <s-button priority="link" [label]="translate.instant(\'platform.filter_service.cancel\')" (click)="close()"></s-button>\n <s-button\n *ngIf="isMobile"\n priority="default"\n [label]="translate.instant(\'platform.filter_service.actions\')"\n [auxiliary]="true"\n [model]="mobileButtonActions"\n ></s-button>\n <ng-container *ngIf="!isMobile">\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.clear\')" (click)="clearFilters()"></s-button>\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.save\')" (click)="saveFilters()"></s-button>\n </ng-container>\n <s-button\n type="submit"\n priority="primary"\n [label]="translate.instant(\'platform.filter_service.filter\')"\n (click)="onApplyFilters()"\n ></s-button>\n </div>\n </div>\n</section>\n\n<p-dialog\n *ngIf="!onlyContent"\n appendTo="body"\n styleClass="filter-dialog"\n [draggable]="false"\n [modal]="true"\n [responsive]="true"\n [(visible)]="showDialog"\n blockScroll="true"\n [closable]="false"\n>\n <p-header>\n <div style="display: flex;">\n {{ \'platform.filter_service.filters\' | translate }}\n <span (click)="toggleDialog(); close()" class="close_btn pi pi-times"></span>\n </div>\n </p-header>\n\n <s-app-form-filter\n [showMessages]="true"\n (errorOutput)="onError($event)"\n (totalFiltersActiveOutput)="updateTotalFiltersActive($event)"\n [isModal]="true"\n ></s-app-form-filter>\n <p-footer *ngIf="!error && !hideButtons">\n <s-button\n type="submit"\n priority="primary"\n [label]="translate.instant(\'platform.filter_service.filter\')"\n (click)="applyFilters()"\n ></s-button>\n <ng-container *ngIf="!isMobile">\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.save\')" (click)="saveFilters()"></s-button>\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.clear\')" (click)="clearFilters()"></s-button>\n </ng-container>\n <s-button\n *ngIf="isMobile"\n priority="default"\n [label]="translate.instant(\'platform.filter_service.actions\')"\n [auxiliary]="true"\n [model]="mobileButtonActions"\n ></s-button>\n <s-button priority="link" [label]="translate.instant(\'platform.filter_service.cancel\')" (click)="toggleDialog(); close()"></s-button>\n </p-footer>\n</p-dialog>\n\n<p-toast key="filterServiceToastKey" [baseZIndex]="5000"></p-toast>\n',encapsulation:e.ViewEncapsulation.None,styles:[".custom-badge{position:absolute!important;right:-4px;top:-10px;height:20px;vertical-align:middle;display:table;min-width:22px}.filter-button{position:relative;border:1px solid #000;border-radius:1.5rem;background:0 0;padding:.5rem 1rem;cursor:pointer}.filter-dialog .ui-dialog-title{display:block!important;padding-right:0!important}.filter-footer{text-align:end;border-top:1px solid #e5eaea;padding:13px}.filter-dialog>.ui-dialog-content{height:300px;padding:10px!important}.app-form-filter{height:335px;max-height:335px;overflow:auto}.only-content-wrapper{background-color:#fff}.close_btn{-ms-flex-line-pack:center;align-content:center;-ms-grid-column-align:right;justify-self:right;margin-left:auto}.close_btn:hover{cursor:pointer}.header{text-transform:uppercase;display:-ms-flexbox;display:flex;width:100%;border-bottom:1px solid #e5eaea;padding:15px;margin-left:0}@media (min-width:641px) and (max-width:1024px){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:300px}}@media only screen and (min-device-width:481px) and (max-device-width:1024px) and (orientation:portrait){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:90%}}@media (min-width:320px) and (max-width:640px){.filter-dialog{width:95%;left:0;top:0;opacity:1;margin:auto;height:93%}.filter-dialog>.ui-dialog-content{height:85%}}@media (min-width:320px) and (max-width:640px) and (max-width:360px){.filter-dialog button{padding:0!important}.filter-dialog>.ui-dialog-content{height:81%}}"]})],t)}(),vt=function(){},yt=function(){function t(){}return t=w([e.NgModule({imports:[o.DialogModule,c.ButtonModule,n.ButtonModule,s.TabViewModule,r.CommonModule,i.FormsModule,i.ReactiveFormsModule,c.DynamicFormModule,a.ToastModule,c.EmptyStateModule,l.TooltipModule,k.forChild([{domain:"platform",service:"filter_service",fallback:P}])],providers:[U,c.LocaleService,u.MessageService,p.TranslateService,ft],declarations:[mt,dt,C,M],exports:[mt,dt]})],t)}(),gt=function(){function t(){}return t.prototype.intercept=function(t,e){return t.body instanceof Blob==!1&&t.body instanceof FormData==!1&&(t=t.clone({body:F.decycle(t.body)})),e.handle(t).pipe(y.map((function(t){return t instanceof f.HttpResponse&&(t=t.clone({body:F.retrocycle(t.body)})),t})))},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t=w([e.Injectable({providedIn:"root"})],t)}(),bt=function(){function t(){}return t=w([e.NgModule({imports:[f.HttpClientModule],providers:[{provide:f.HTTP_INTERCEPTORS,useClass:gt,multi:!0}]})],t)}(),_t=function(){function t(){}return t.prototype.get=function(){return v.defer((function(){return v.from(h.service.getRestUrl())}))},t=w([e.Injectable()],t)}(),Ft=function(){function t(t){this.restUrl=t}return t.prototype.intercept=function(t,e){if(!t.url.includes("://")){var r=this.restUrl.get(),i=v.defer((function(){return v.from(h.user.getAuthHeader())}));return v.forkJoin(r,i).pipe(y.flatMap((function(r){var i=I(r,2),n=i[0],o=i[1],s=t.clone({url:n+t.url,headers:t.headers.set("Authorization",o)});return e.handle(s)})))}return e.handle(t)},t.ctorParameters=function(){return[{type:_t}]},t=w([e.Injectable()],t)}(),St=function(){function t(){}return t=w([e.NgModule({imports:[f.HttpClientModule],providers:[_t,{provide:f.HTTP_INTERCEPTORS,useClass:Ft,multi:!0}]})],t)}(),Ot=new e.InjectionToken("RESOURCES"),wt=new e.InjectionToken("ENVIRONMENT"),Et=function(){},xt=function(){function r(t,e,r,i,n,o){this.resources=t,this.environment=e,this.http=r,this.router=i,this.messageService=n,this.translate=o,this.checkedPermissions=[],this.actionUrl="platform/authorization/queries"}return r.prototype.checkAccess=function(t){var e=this,r=[];return t.forEach((function(t){t.actions.forEach((function(i){if(!t.uri){var n=e.getUriByResourceName(t.name,t.entity);t.uri=n}r.push({action:i,resource:t.uri})}))})),this.http.post(this.actionUrl+"/checkAccess",{includeFilters:!0,permissions:r}).pipe(y.map((function(r){var i=r.permissions;e.checkedPermissions=A(e.checkedPermissions,i);var n={};return e.shouldRedirectToForbiddenPage(t,i)?(e.router.navigate(["error",403]),v.throwError("forbidden")):(i.forEach((function(e){var r=t.find((function(t){return t.uri===e.resource})).name;n[r]=n[r]||{},n[r][e.action]=e.authorized,n[r][e.action.toLowerCase()]=e.authorized,e.resourceFilters&&e.resourceFilters.length&&(n[r].resourceFilters||(n[r].resourceFilters=[]),e.resourceFilters.forEach((function(t){n[r].resourceFilters.push(t)})))})),n)})))},r.prototype.get=function(e){var r=this;return void 0===e&&(e=""),t.promise||(t.promise=this.getPermissions()),v.from(t.promise).pipe(y.map((function(t){return r.checkedPermissions=t,e?t[Object.keys(t).find((function(t){return t.toLowerCase()===e.toLowerCase()}))]:t})),y.catchError((function(e){return t.promise=void 0,r.messageService.add({severity:"error",summary:r.translate.instant("permission_error_summary"),detail:r.translate.instant("permission_error_detail")}),v.of(r.getPermissionObject(!1))})))},r.prototype.isAuthorized=function(t,e,r){this.checkedPermissions.length||v.throwError("'Permissions' are not defined. You should call 'get' or 'checkAccess' method first.");var i=this.getUriByResourceName(t,r),n=this.checkedPermissions.filter((function(t){return t.resource===i})).find((function(t){return t.action.toLowerCase()===e.toLowerCase()}));return n&&n.authorized},r.prototype.getUriByResourceName=function(t,e){var r=this.environment,i=r.domain,n=r.service;i&&n||v.throwError("You must inform domain and service name");var o="res://senior.com.br/"+i+"/"+n;return e?o+"/entities/"+t:o+"/"+t},r.prototype.shouldRedirectToForbiddenPage=function(t,e){void 0===t&&(t=[]);var r=e.filter((function(t){return!t.authorized}));if(r&&r.length){var i=t.filter((function(t){return t.redirectToError}));return!(!i||!i.length)&&i.every((function(t){return(t.actionsToCheck&&t.actionsToCheck.length?t.actionsToCheck:t.actions).every((function(e){return r.some((function(r){return r.resource===t.uri&&r.action===e}))}))}))}return!1},r.prototype.getFlatEnvironment=function(){return this.environment.ignorePermissions},r.prototype.getFlatResources=function(){return this.resources.reduce((function(t,e){return e?Array.isArray(e)?A(t,e):A(t,[e]):t}),[])},r.prototype.getPermissionObject=function(t){return this.getFlatResources().reduce((function(e,r){return e[r.name]=r.actions.reduce((function(e,r){return e[r]=t,e[r.toLowerCase()]=t,e}),{}),e}),{})},r.prototype.getPermissions=function(){return x(this,void 0,void 0,(function(){var t,e,r,i;return T(this,(function(n){switch(n.label){case 0:return this.getFlatEnvironment()?[2,this.getPermissionObject(!0)]:(t=this.getFlatResources(),e=t.map((function(t){return t.actions.map((function(e){return{action:e,resource:t.uri}}))})).reduce((function(t,e){return A(t,e)})),[4,this.http.post(this.actionUrl+"/checkAccess",{includeFilters:!1,permissions:e}).toPromise().then((function(t){return t.permissions}))]);case 1:return r=n.sent(),i={},r.forEach((function(e){var r=t.find((function(t){return t.uri===e.resource})).name;i[r]=i[r]?i[r]:{},i[r][e.action]=e.authorized,i[r][e.action.toLowerCase()]=e.authorized})),[2,i]}}))}))},r.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[Ot]}]},{type:Et,decorators:[{type:e.Inject,args:[wt]}]},{type:f.HttpClient},{type:g.Router},{type:u.MessageService},{type:p.TranslateService}]},r.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new r(e.ɵɵinject(Ot),e.ɵɵinject(wt),e.ɵɵinject(f.HttpClient),e.ɵɵinject(g.Router),e.ɵɵinject(u.MessageService),e.ɵɵinject(p.TranslateService))},token:r,providedIn:"root"}),r=w([e.Injectable({providedIn:"root"}),E(0,e.Inject(Ot)),E(1,e.Inject(wt))],r)}(),Tt=function(){function t(){}var r;return r=t,t.forRoot=function(t,e){return{ngModule:r,providers:[xt,{provide:Ot,multi:!0,useValue:t},{provide:wt,multi:!1,useValue:e}]}},t.forChild=function(t){return{ngModule:r,providers:[{provide:Ot,multi:!0,useValue:t}]}},t=r=w([e.NgModule()],t)}();function It(t,e){var r=function(r,i){return t+"/"+e+"/"+r+"/"+i};return{resource:function(r){return function(t){return"res://senior.com.br/"+t.domain+"/"+t.service+"/"+t.resource}({domain:t,service:e,resource:r})},query:r.bind(null,"queries"),action:r.bind(null,"actions"),signal:r.bind(null,"signals"),entity:function(t){var e=r("entities",t);return{create:function(){return e},update:function(t){return e+"/"+t},remove:function(t){return e+"/"+t}}}}}var At,Ct=It("platform","feature_toggle"),Mt=function(){function t(t){this.http=t,this.cache={}}return t.prototype.isEnabled=function(t,e){var r=this,i=t.domain,n=t.service,o=t.name;return(e?v.of(e):v.from(h.user.getUserData()).pipe(y.map((function(t){return t.tenantName})))).pipe(y.mergeMap((function(t){var e=JSON.stringify({tenant:t,domain:i,service:n});return r.cache[e]||(r.cache[e]=r.http.post(Ct.query("getEnabledFeatures"),{tenant:t,domain:i,service:n}).pipe(y.map((function(t){return t.features})),y.shareReplay(1),y.catchError((function(t){return console.error(t),delete r.cache[e],v.of([])})))),r.cache[e]})),y.map((function(t){return-1!==t.findIndex((function(t){return t.name===o}))})))},t.ctorParameters=function(){return[{type:f.HttpClient}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(f.HttpClient))},token:t,providedIn:"root"}),t=w([e.Injectable({providedIn:"root"})],t)}(),Nt=function(){function t(){}return t=w([e.NgModule({imports:[f.HttpClientModule,St],providers:[Mt]})],t)}();!function(t){t.CONFIRMED="CONFIRMED",t.POSTPONED="POSTPONED",t.REFUSED="REFUSED"}(At||(At={}));var kt,Rt=function(){function t(t){this.http=t,this.API_URL="platform/spotlight/"}return t.prototype.getUser=function(){return this.http.post("platform/user/queries/getUser",{}).toPromise()},t.prototype.listSpotlightScreen=function(){return this.http.get(this.API_URL+"queries/listSpotlightScreen")},t.prototype.listSpotlightUsers=function(){return this.http.get(this.API_URL+"queries/listSpotlightUsers").toPromise()},t.prototype.listSpotlightControl=function(){return this.http.get(this.API_URL+"queries/listSpotlightControl").toPromise()},t.prototype.saveSpotlightUser=function(t){return this.http.post(this.API_URL+"actions/saveSpotlightUsers",{content:t})},t.prototype.saveSpotlightControl=function(t){return this.http.post(this.API_URL+"actions/saveSpotlightControl",{content:t})},t.prototype.notificateSpotlight=function(t){return this.http.post(this.API_URL+"actions/notificateSpotlight",t)},t.ctorParameters=function(){return[{type:f.HttpClient}]},t=w([e.Injectable()],t)}();!function(t){t.ADVERSITING="ADVERSITING",t.INTEGRATION="INTEGRATION"}(kt||(kt={}));var Dt;!function(t){t.ACTIVE="ACTIVE",t.IN_PROGRESS="IN_PROGRESS",t.NO_STARTED="NO_STARTED",t.REFUSED="REFUSED"}(Dt||(Dt={}));var jt=function(){function t(t,r,i){this.spotlightService=t,this.cookieService=r,this.datePipe=i,this.canAppear=!1,this.visible=!1,this.fade=!1,this.visibleChange=new e.EventEmitter}return t.prototype.ngOnInit=function(){return x(this,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:return[4,this.setValues()];case 1:return t.sent(),this.fetchSpotlight(),[2]}}))}))},t.prototype.setValues=function(){return x(this,void 0,void 0,(function(){var t,e,r;return T(this,(function(i){switch(i.label){case 0:return t=JSON.parse(this.cookieService.get("com.senior.token")),this.currentUser=t.username,e=this,[4,this.spotlightService.listSpotlightUsers()];case 1:return e.spotlightUsersList=i.sent(),r=this,[4,this.spotlightService.listSpotlightControl()];case 2:return r.spotlightControlsList=i.sent(),[2]}}))}))},t.prototype.setValuesInSpotlight=function(t){this.header=t.spotlightTitle,this.imgUrl=t.bannerUrl,this.primaryButtonLabel=t.primaryButtonLabel,this.primaryButtonTooltip=t.primaryButtonHint},t.prototype.getShowDate=function(t){var e=new Date;return this.datePipe.transform(e.setDate(e.getDate()+t).toString(),"yyyy-MM-dd")},t.prototype.fetchSpotlight=function(){var t=this;this.spotlightService.listSpotlightScreen().subscribe((function(e){t.spotlightScreen=e.contents.filter((function(e){return e.screenMenuId===t.menuId}))[0],t.spotlightScreen&&t.showSpotlight(t.spotlightScreen.spotlight)}))},t.prototype.showSpotlight=function(t){if(this.validateDate(t.initialDate)&&this.validateFinalDate(t.finalDate)&&this.validateSpotlight(t)){this.setValuesInSpotlight(t),this.canAppear=!0;var e=this.getSpotlightControlFromList(this.spotlightScreen.spotlight.id);this.canEmitEvent=!e||this.currentUser!==e.firstUser}},t.prototype.validateDate=function(t){return!!t&&this.datePipe.transform((new Date).toString(),"yyyy-MM-dd")>=this.datePipe.transform(t,"yyyy-MM-dd")},t.prototype.validateFinalDate=function(t){return!t||this.datePipe.transform((new Date).toString(),"yyyy-MM-dd")<=this.datePipe.transform(t,"yyyy-MM-dd")},t.prototype.validateSpotlight=function(t){return!!this.validateControlsList(this.spotlightControlsList,t,this.currentUser)&&!!this.validateDisplayType(t,this.spotlightUsersList,this.spotlightControlsList,this.currentUser)},t.prototype.validateControlsList=function(t,e,r){if(t.totalElements&&t.contents.filter((function(t){return t.status===Dt.ACTIVE?t.spotlightId===e.id:t.status===Dt.IN_PROGRESS?t.spotlightId===e.id&&t.firstUser!==r:void 0})).length>0)return!1;return!0},t.prototype.validateDisplayType=function(t,e,r,i){var n=this;switch(t.displayType){case kt.ADVERSITING:return!e.totalElements||this.validateUser(e.contents,t);case kt.INTEGRATION:if(r.totalElements)if(0===r.contents.filter((function(r){switch(r.status){case Dt.NO_STARTED:return r.spotlightId===t.id;case Dt.REFUSED:return!e.totalElements||n.validateUser(e.contents,t);case Dt.IN_PROGRESS:return r.firstUser===i&&r.spotlightId===t.id}})).length)return!1;return!0}},t.prototype.validateUser=function(t,e){var r=this,i=t.filter((function(t){return t.spotlightId===e.id}));if(!i.length)return 0===(i=t.filter((function(t){return t.userOperation===r.currentUser}))).length;var n=i.filter((function(t){return t.userOperation===r.currentUser}))[0];return!n||this.validateDate(n.showDate)},t.prototype.saveSpotlightUser=function(t){var e=this,r=this.spotlightScreen.spotlight,i=this.spotlightUsersList.contents.filter((function(t){return t.spotlightId===r.id&&t.userOperation===e.currentUser}))[0],n={spotlightId:r.id,showDate:t?this.getShowDate(t):null,userOperation:this.currentUser};i&&(n=O({id:i.id},n)),this.spotlightService.saveSpotlightUser(n).subscribe()},t.prototype.onPrimary=function(){var t=this.spotlightScreen.spotlight,e=this.buildNotification(At.CONFIRMED);this.saveSpotlightControl(),this.saveSpotlightUser(),this.canEmitEvent&&this.spotlightService.notificateSpotlight(e).subscribe(),t.primaryButtonUrl&&window.open(t.primaryButtonUrl),this.close()},t.prototype.onSecondary=function(){var t=this.buildNotification(At.POSTPONED);this.saveSpotlightControl(Dt.REFUSED),this.saveSpotlightUser(this.spotlightScreen.spotlight.daysRememberLate),this.spotlightService.notificateSpotlight(t).subscribe(),this.close()},t.prototype.onTertiary=function(){var t=this.buildNotification(At.REFUSED);this.saveSpotlightControl(Dt.REFUSED),this.saveSpotlightUser(this.spotlightScreen.spotlight.daysNotInterested),this.spotlightService.notificateSpotlight(t).subscribe(),this.close()},t.prototype.hasThisRegister=function(t,e){return t.spotlightId===e.id&&t.userOperation===this.currentUser},t.prototype.hasAnotherRegister=function(t,e){return t.spotlightId!==e.id&&t.userOperation===this.currentUser},t.prototype.saveSpotlightControl=function(t){void 0===t&&(t=Dt.IN_PROGRESS);var e=this.spotlightScreen.spotlight,r=this.getSpotlightControlFromList(e.id);return r||(r={spotlightId:e.id,status:t,firstUser:this.currentUser}),(this.isNewControl(r)||r.status!==Dt.IN_PROGRESS)&&(r.status=t,r.firstUser=t===Dt.IN_PROGRESS?this.currentUser:"",this.spotlightService.saveSpotlightControl(r).subscribe()),r},t.prototype.getSpotlightControlFromList=function(t){return this.spotlightControlsList.contents.filter((function(e){return e.spotlightId===t}))[0]},t.prototype.isNewControl=function(t){return!this.spotlightControlsList.contents.includes(t)},t.prototype.buildNotification=function(t){var e=this.spotlightScreen.spotlight;return{clickedButton:t,spotlightControlId:e.id,primaryButtonUrl:e.primaryButtonUrl}},t.prototype.close=function(){this.visibleChange.emit(!1)},t.ctorParameters=function(){return[{type:Rt},{type:d.CookieService},{type:r.DatePipe}]},w([e.Input()],t.prototype,"visible",void 0),w([e.Input()],t.prototype,"menuId",void 0),w([e.Input()],t.prototype,"fade",void 0),w([e.Output()],t.prototype,"visibleChange",void 0),t=w([e.Component({selector:"s-spotlight",template:'<div class="s-spotlight-overlay" id="ol" *ngIf="canAppear && visible">\n <div class="s-spotlight" id="sl" [ngClass]="{\'s-effect-fadein\': fade}">\n <div class="s-spotlight-header">\n <span class="s-spotlight-title">{{header.toUpperCase()}}</span>\n <a role="button" class="s-spotlight-close" (click)="close()"><span class="fa fa-times" aria-hidden="true"></span></a>\n </div>\n <div class="s-img">\n <img src="{{imgUrl}}">\n </div>\n <div class="s-spotlight-footer">\n <div class="s-spotlight-footer-left">\n <button\n pButton\n type="submit"\n id="decline-button"\n label="{{\'platform.spotlight.no_interest\' | translate}}"\n (click)="onTertiary()"\n class="ui-button-link">\n </button>\n </div>\n <div class="s-spotlight-footer-right">\n <button\n pButton\n type="submit"\n id="remember-button"\n label="{{\'platform.spotlight.remember_late\' | translate}}"\n (click)="onSecondary()"\n class="ui-button-raised ui-button-secondary">\n </button>\n <button\n pButton\n label="{{primaryButtonLabel}}"\n type="submit"\n id="submit-button"\n (click)="onPrimary()"\n [pTooltip]="primaryButtonTooltip"\n tooltipPosition="top"\n showDelay="500"\n class="ui-button-raised">\n </button>\n </div>\n </div>\n</div>\n</div>',styles:['.s-spotlight-overlay{display:-ms-flexbox;display:flex;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,.4)}.s-spotlight{border-radius:3px;background:#fff;margin:auto;overflow:hidden;animation:.15s forwards move}.s-spotlight-footer,.s-spotlight-header{display:-ms-flexbox;display:flex;padding:15px}.s-spotlight-header{-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.s-spotlight-footer,.s-spotlight-footer-left,.s-spotlight-footer-right{display:-ms-flexbox;display:flex}.s-spotlight-footer-right{-ms-flex:2;flex:2;-ms-flex-pack:end;justify-content:flex-end}.s-spotlight-footer-left{-ms-flex:1;flex:1;-ms-flex-pack:start;justify-content:flex-start}.s-spotlight-title{font-family:"Open Sans",sans-serif;font-size:16px;font-weight:400;color:#333}.s-spotlight-close{display:block;margin-left:15px;color:#000}.s-img{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.s-img img{width:100%}.s-effect-fadein{animation:.15s forwards fade}@keyframes fade{0%{opacity:0}100%{opacity:1}}@media (max-width:595px){.s-spotlight-footer,.s-spotlight-footer-left,.s-spotlight-footer-right{-ms-flex-align:center;align-items:center;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.s-spotlight-footer button{margin:0 0 15px!important;width:100%!important}}@media (min-width:576px){.s-spotlight{width:100%}}@media (min-width:768px){.s-spotlight{width:720px}.s-spotlight-footer,.s-spotlight-footer-left,.s-spotlight-footer-right{-ms-flex-direction:row;flex-direction:row}}@media (min-width:992px){.s-spotlight{width:960px}}@media (min-width:1200px){.s-spotlight{width:50%}}']})],t)}(),Pt={"platform.spotlight.no_interest":"Não tenho interesse","platform.spotlight.remember_late":"Lembrar mais tarde"},Ut=function(){function t(t){this.translationService=t}return t.prototype.transform=function(t){return this.translationService.instant(t)},t.ctorParameters=function(){return[{type:p.TranslateService}]},t=w([e.Pipe({name:"translate",pure:!1})],t)}(),Vt=function(){function t(){}return t=w([e.NgModule({imports:[n.ButtonModule,l.TooltipModule,r.CommonModule,St,k.forChild([{domain:"platform",service:"spotlight",fallback:Pt}])],providers:[Rt,r.DatePipe,d.CookieService],declarations:[jt,Ut],exports:[jt]})],t)}();t.AdvancedFilterComponent=mt,t.AdvancedFilterModule=yt,t.AdvancedFilterService=U,t.AppRoutingModule=vt,t.CyclicJsonInterceptorModule=bt,t.FeatureToggleModule=Nt,t.FeatureToggleService=Mt,t.Filter=V,t.FormFilter=L,t.HttpInterceptorModule=St,t.PermissionsModule=Tt,t.PermissionsService=xt,t.RestUrl=_t,t.SpotlightComponent=jt,t.SpotlightModule=Vt,t.TranslationsConfig=N,t.TranslationsModule=k,t.USER_INFO="com.senior.token",t.factory=R,t.ɵa=P,t.ɵb=ft,t.ɵc=dt,t.ɵd=C,t.ɵe=M,t.ɵf=gt,t.ɵg=Ft,t.ɵh=Ot,t.ɵi=wt,t.ɵk=Et,t.ɵl=Pt,t.ɵm=Rt,t.ɵn=Ut,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
|
+
var S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var O=function(){return(O=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function x(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function w(t,e){return function(r,i){e(r,i,t)}}function E(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}function T(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function I(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function A(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I(arguments[e]));return t}var C=function(){function t(){}return t.prototype.transform=function(t,e){return void 0===e&&(e=null),Array.from(t.values())},t=x([e.Pipe({name:"mapValues",pure:!1})],t)}(),M=function(){function t(t){this.translationService=t}return t.prototype.transform=function(t,e){return this.translationService.instant(t)},t.ctorParameters=function(){return[{type:p.TranslateService}]},t=x([e.Pipe({name:"translate",pure:!1})],t)}(),k=new e.InjectionToken("translationConfig"),N=function(){function t(){}var r;return r=t,t.forRoot=function(t){return{ngModule:r,providers:[{provide:e.APP_INITIALIZER,useFactory:R,deps:[p.TranslateService,e.Injector,f.HttpClient,d.CookieService],multi:!0},{provide:k,useValue:t,multi:!0}]}},t.forChild=function(t){return{ngModule:r,providers:[{provide:k,useValue:t,multi:!0}]}},t=r=x([e.NgModule({imports:[f.HttpClientModule,p.TranslateModule.forChild()],providers:[d.CookieService]})],t)}();function R(t,e,i,n){var o=this;return function(){return new Promise((function(s){e.get(r.LOCATION_INITIALIZED,Promise.resolve(null)).then((function(){return E(o,void 0,void 0,(function(){var r,o,a,l,u,c,p,d,m,v;return T(this,(function(y){switch(y.label){case 0:r="pt-BR",y.label=1;case 1:y.trys.push([1,8,,9]),g=e.get(k,Promise.resolve(null)),o=g.reduce((function(t,e){return Array.isArray(e)?A(t,e):A(t,[e])}),[]),y.label=2;case 2:return y.trys.push([2,5,,6]),(a=JSON.parse(n.get("com.senior.token")))&&0!==Object.keys(a).length?[3,4]:[4,h.user.getUserData()];case 3:a=y.sent(),y.label=4;case 4:return r=a.locale||"pt-BR",[3,6];case 5:return y.sent(),console.warn("Unable to obtain user locale"),[3,6];case 6:return l=o.reduce((function(t,e){return O(O({},t),e.fallback)}),{}),u=o.reduce((function(t,e){return O(O({},t),e.defaultsLanguages)}),{}),t.setTranslation(r,l),t.setDefaultLang(r),c={},u&&(p=Object.keys(u).map((function(t){var e={};return e.locale=t.replace("_","-"),e.translation=u[t],e}),[]),(d=p.find((function(t){return t.locale===r})))||(d=p.find((function(t){return 2===t.locale.length&&t.locale===r.split("-")[0]}))),d&&(c=d.translation)),m=o.map((function(t){return function(t,e){var r=this,n=t.domain,o=t.service;return new Promise((function(t){return E(r,void 0,void 0,(function(){var r,s,a,l,u,c,p,d,m;return T(this,(function(v){switch(v.label){case 0:if(v.trys.push([0,4,,5]),!n&&!o)throw new Error("domain and service not found");return r=(new f.HttpParams).set("domainName",n).set("serviceName",o).set("format","FLAT_JSON"),l=(a=new f.HttpHeaders).set,u=["Authorization"],[4,h.user.getAuthHeader()];case 1:return s=l.apply(a,u.concat([v.sent()])),"platform/translation_hub/queries/getTranslationBundle",[4,i.get("platform/translation_hub/queries/getTranslationBundle",{headers:s,params:r}).toPromise().then((function(t){return t.bundleFiles}))];case 2:return c=v.sent(),p=e&&c.find((function(t){return t.language===e})),d=!1,p||(p=c.find((function(t){return"pt-BR"===t.language})),d=!0),p?[4,i.get(p.url).toPromise().then((function(e){t({overriden:d,content:e})}))]:[2,t({})];case 3:return v.sent(),[3,5];case 4:return m=v.sent(),console.warn("Error getting translation bundle for "+n+"/"+o+". Using local fallback.",m),t({}),[3,5];case 5:return[2]}}))}))}))}(t,r)})),[4,Promise.all(m).then((function(e){return e.forEach((function(e){t.overriden?(e.content&&t.setTranslation(r,e.content,!0),t.setTranslation(r,c,!0)):(t.setTranslation(r,c,!0),e.content&&t.setTranslation(r,e.content,!0))})),t.use(r).toPromise()}))];case 7:return y.sent(),s(),[3,9];case 8:return v=y.sent(),console.warn("Error setting translations. Using local fallback.",v),t.use(r).toPromise().then((function(){s()})),[3,9];case 9:return[2]}var g}))}))}))}))}}var D,j,U={"platform.filter_service.cancel":"Cancelar","platform.filter_service.try":"Tentar Novamente","platform.filter_service.actions":"Ações","platform.filter_service.save":"Salvar","platform.filter_service.filter":"Filtrar","platform.filter_service.error_state":"O serviço de filtro está indisponível no momento e as informações apresentadas não são as mais recentes. Tente novamente mais tarde.","platform.filter_service.saved_filters_success":'Filtros salvos com sucesso! Clique em "Filtrar" para visualizar o resultado.',"platform.filter_service.saved_filters_error":"Ocorreu um erro ao tentar salvar os filtros. Verifique os valores e tente novamente.","platform.filter_service.applied_filter_nochange":"Não houve alterações no filtro.","platform.filter_service.applied_filter_change":"Filtros aplicados com sucesso!","platform.filter_service.invalid_pattern":"O valor não atende ao padrão especificado.","platform.filter_service.error_max_value":"O valor excede o tamanho máximo especificado.","platform.filter_service.error_min_value":"O valor é menor que o minímo especificado.","platform.filter_service.applied_filters_message":"{{totalActiveFilters}} filtros aplicados","platform.filter_service.applied_filter_message":"{{totalActiveFilters}} filtro aplicado","platform.filter_service.find_suggestions_error":"Erro ao encontrar sugestões!","platform.filter_service.select":"Selecionar","platform.filter_service.filters":"Filtros","platform.filter_service.date_format":"dd/mm/yy","platform.filter_service.hour_format":"24","platform.filter_service.clear":"Limpar","platform.filter_service.today":"Hoje","platform.filter_service.name_january":"Janeiro","platform.filter_service.name_february":"Fevereiro","platform.filter_service.name_march":"Março","platform.filter_service.name_april":"Abril","platform.filter_service.name_may":"Maio","platform.filter_service.name_june":"Junho","platform.filter_service.name_july":"Julho","platform.filter_service.name_august":"Agosto","platform.filter_service.name_september":"Setembro","platform.filter_service.name_october":"Outubro","platform.filter_service.name_november":"Novembro","platform.filter_service.name_december":"Dezembro","platform.filter_service.short_january":"Jan","platform.filter_service.short_february":"Fev","platform.filter_service.short_march":"Mar","platform.filter_service.short_april":"Abr","platform.filter_service.short_may":"Mai","platform.filter_service.short_june":"Jun","platform.filter_service.short_july":"Jul","platform.filter_service.short_august":"Ago","platform.filter_service.short_september":"Set","platform.filter_service.short_october":"Out","platform.filter_service.short_november":"Nov","platform.filter_service.short_december":"Dez","platform.filter_service.name_sunday":"Domingo","platform.filter_service.name_monday":"Segunda","platform.filter_service.name_tuesday":"Terça","platform.filter_service.name_wednesday":"Quarta","platform.filter_service.name_thursday":"Quinta","platform.filter_service.name_friday":"Sexta","platform.filter_service.name_saturday":"Sábado","platform.filter_service.min_sunday":"D","platform.filter_service.min_monday":"S","platform.filter_service.min_tuesday":"T","platform.filter_service.min_wednesday":"Q","platform.filter_service.min_thursday":"Q","platform.filter_service.min_friday":"S","platform.filter_service.min_saturday":"S","platform.filter_service.short_sunday":"Dom","platform.filter_service.short_monday":"Seg","platform.filter_service.short_tuesday":"Ter","platform.filter_service.short_wednesday":"Qua","platform.filter_service.short_thursday":"Qui","platform.filter_service.short_friday":"Sex","platform.filter_service.short_saturday":"Sab","platform.filter_service.yes":"Sim","platform.filter_service.no":"Não","platform.filter_service.search_empty_message":"Nenhum resultado encontrado"},P=function(){function t(t){var e=this;this.http=t,this.filtersObservable=new v.Subject,this.contextsObservable=new m.BehaviorSubject([]),this.ticketFilterObservable=new v.Subject,this.destroy$=new v.Subject,this.contextsObserver=this.contextsObservable.asObservable(),this.filtersObserver=this.filtersObservable.asObservable(),this.ticketFilterObserver=this.ticketFilterObservable.asObservable(),this.contextsObservable.subscribe((function(t){return t.length&&e.getAndApplyFilters(t)}))}return t.prototype.saveTickedFilters=function(t){var e=this,r=this.ticketFilter?{filters:t,ticketFilter:this.ticketFilter}:{filters:t};this.http.post("platform/filter_service/actions/setTicketFilters",r).pipe(y.map((function(t){return t.ticket}))).subscribe((function(t){e.ticketFilter=t,e.ticketFilterObservable.next({ticketFilter:t}),window.parent.postMessage({message:"advanced-filter:success",payload:t},"*")}),(function(t){e.ticketFilterObservable.next({error:!0,message:t}),window.parent.postMessage({message:"advanced-filter:error",payload:t},"*")}))},t.prototype.addContexts=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=this.contextsObservable.getValue();return this.contextsObservable.next(A(i,e)),v.Observable.create((function(){return function(){return t.removeContexts(e)}}))},t.prototype.removeContexts=function(t){var e=this.contextsObservable.getValue().filter((function(e){return-1===t.indexOf(e)}));this.contextsObservable.next(e)},t.prototype.saveFilters=function(t){return this.http.post("platform/filter_service/actions/saveUserFilters",{filters:t})},t.prototype.searchFieldSuggestions=function(t,e,r){var i=new f.HttpHeaders({"Content-Type":"application/json; charset=utf-8"});return"ENTITY"===r?this.http.get(t,{headers:i}):this.http.post(t,e,{headers:i})},t.prototype.tryAgain=function(t){this.getFilters(t)},t.prototype.getAndApplyFilters=function(t){this.getFilters(t,!0)},t.prototype.getFilters=function(t,e){var r=this;this.http.post("platform/filter_service/queries/getFilters",{serviceContexts:t}).pipe(y.map((function(t){return r.mapFilters(t.filters)}))).subscribe((function(t){return r.filtersObservable.next({filters:t,applyFilter:e})}),(function(t){return r.filtersObservable.next({error:!0,message:t})}))},t.prototype.mapFilters=function(t){var e=this;return t.map((function(t){try{var r=t.value&&JSON.parse(t.value);if(r&&t.search&&t.search.basicSearch&&t.search.basicSearch.output?e.mapValues(r,t.search.basicSearch.output.keyFields,t.search.basicSearch.output.displayFields):r&&t.search&&t.search.entitySearch&&t.search.entitySearch.output&&e.mapValues(r,t.search.entitySearch.output.keyFields,t.search.entitySearch.output.displayFields),r)if(e.isMultiple(t)){var i=JSON.stringify(r);i.startsWith("[{")&&i.endsWith("}]")||i.length<=4?t.value=i:t.value=JSON.stringify("")}else t.value=JSON.stringify(r)}catch(e){console.error("Global: filter "+t.name+" has value error. ",e),t.value=JSON.stringify("")}return t}))},t.prototype.isMultiple=function(t){return"SEARCH"===t.type&&t.search&&(t.search.basicSearch&&t.search.basicSearch.output&&t.search.basicSearch.output.maxSelectedItems>1||t.search.entitySearch&&t.search.entitySearch.output&&t.search.entitySearch.output.maxSelectedItems>1)},t.prototype.mapValues=function(t,e,r){var i=this;Array.isArray(t)?t.forEach((function(t){i.mapValue(t,e,r)})):this.mapValue(t,e,r)},t.prototype.mapValue=function(t,e,r){if(t){var i=[],n=[];e.filter((function(e){return void 0!==t[e]})).forEach((function(e){return i.push(t[e])})),r.filter((function(e){return void 0!==t[e]})).forEach((function(e){return n.push(t[e])})),i.length>0&&n.length>0?(t.$$__keyValue__=i.join(", "),t.$$__displayValue__=n.join(", ")):t=[""]}},t.ctorParameters=function(){return[{type:f.HttpClient}]},t=x([e.Injectable()],t)}(),V=function(t,e,r,i,n,o,s,a,l,u,c,p,f,h,d,m,v,y){this.type=t,this.required=e,this.label=r,this.domain=i,this.scope=n,this.name=o,this.contexts=s,this.services=a,this.value=l,this.enumItems=u,this.defaultValue=c,this.search=p,this.tabIndex=f,this.minValue=h,this.maxValue=d,this.dependsOn=m,this.mask=v,this.regExp=y};(D=t.FilterType||(t.FilterType={})).STRING="STRING",D.BOOLEAN="BOOLEAN",D.INTEGER="INTEGER",D.DOUBLE="DOUBLE",D.DATE="DATE",D.DATETIME="DATETIME",D.TIME="TIME",D.MONEY="MONEY",D.ENUMERATION="ENUMERATION",D.SEARCH="SEARCH",(j=t.Scope||(t.Scope={})).DOMAIN="DOMAIN",j.SERVICE="SERVICE";var B,L=function(){function t(t){var e=t.value,r=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(t,["value"]);this._valueObserver=new v.Subject,this.valueChanges=this._valueObserver.asObservable(),this._value=e,Object.assign(this,r)}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this._valueObserver.next(t)},enumerable:!0,configurable:!0}),t}(),q=function(t){this.fields=[],this.form=new i.FormGroup({}),Object.assign(this,t)},H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.activeFilters=0,e}return function(t,e){function r(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return this.name+" ("+this.activeFilters+")"},enumerable:!0,configurable:!0}),e}(q);function $(t,e){return t+":"+e}var G=t.FilterType.DATETIME,z=t.FilterType.TIME,J=((B={})[t.FilterType.DATE]=function(t){return W(t,"YYYY-MM-DD")},B[z]=function(t){return W(t,"HH:mm:ss")},B[G]=function(t){return W(t)},B);function Y(t,e){var r=J[e];return null!=t&&""!==t&&r?r(t):t}function W(t,e){var r=b(t);return e?r.format(e):r.format()}var K,Q={contains:function(t,e){return"containing("+t+", '"+e+"')"},"=":function(t,e){return t+" eq "+e},"!=":function(t,e){return t+" ne "+e},">":function(t,e){return t+" gt "+e},"<":function(t,e){return t+" lt "+e},">=":function(t,e){return t+" ge "+e}};function Z(e,r,i){var n=JSON.parse(e);return r!==t.FilterType.SEARCH||i?n[0]:n}function X(t){return t.basicSearch?t.basicSearch:t.entitySearch}var tt=t.FilterType.DATE,et=t.FilterType.DATETIME,rt=t.FilterType.TIME,it=((K={})[tt]=function(t){return ot(t)},K[et]=function(t){return ot(t)},K[rt]=function(t){return ot(t,"HH:mm:ss")},K);function nt(e){var r=e.minValue,n=e.maxValue,o=e.regExp,s=e.value,a=e.type,l=e.search,u=function(t,e,r){var n=i.Validators.pattern,o=i.Validators.min,s=i.Validators.max,a=[];return r&&a.push(n(r)),void 0!==t&&a.push(o(t)),void 0!==e&&a.push(s(e)),a}(r,n,o),c=function(e,r,i){var n,o=it[r],s=JSON.parse(e),a=i&&1===X(i).output.maxSelectedItems;return n=r!==t.FilterType.INTEGER&&r!==t.FilterType.DOUBLE&&r!==t.FilterType.MONEY||""!==s[0]?r!==t.FilterType.SEARCH||a?s[0]:s[0]?s:[]:null,o?o(n):n}(s,a,l);return new i.FormControl(c,{validators:u})}function ot(t,e){return null!==t&&""!==t?b(t,e).toDate():""}var st=[t.FilterType.STRING,t.FilterType.BOOLEAN,t.FilterType.INTEGER,t.FilterType.ENUMERATION,t.FilterType.TIME,t.FilterType.MONEY,t.FilterType.DATETIME,t.FilterType.DATE,t.FilterType.DOUBLE],at={">":function(t,e){return t>e},"<":function(t,e){return t<e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},contains:function(t,e){return _.contains(t,e)},"=":function(t,e){return"number"==typeof e?_.equals(Number(t),e):_.equals(t,e)},"!=":function(t,e){return"number"==typeof e?!_.equals(Number(t),e):!_.equals(t,e)}};function lt(t,e,r){return(0,at[t])(e,r)}function ut(t){return!!at[t]}function ct(t){return _.contains(t,st)}var pt="platform.filter_service",ft=function(){function t(t){this.translate=t}return t.prototype.getOptions=function(){return{clear:this.translate.instant(pt+".clear"),dateFormat:this.translate.instant(pt+".date_format"),dayNames:[this.translate.instant(pt+".name_sunday"),this.translate.instant(pt+".name_monday"),this.translate.instant(pt+".name_tuesday"),this.translate.instant(pt+".name_wednesday"),this.translate.instant(pt+".name_thursday"),this.translate.instant(pt+".name_friday"),this.translate.instant(pt+".name_saturday")],dayNamesMin:[this.translate.instant(pt+".min_sunday"),this.translate.instant(pt+".min_monday"),this.translate.instant(pt+".min_tuesday"),this.translate.instant(pt+".min_wednesday"),this.translate.instant(pt+".min_thursday"),this.translate.instant(pt+".min_friday"),this.translate.instant(pt+".min_saturday")],dayNamesShort:[this.translate.instant(pt+".short_sunday"),this.translate.instant(pt+".short_monday"),this.translate.instant(pt+".short_tuesday"),this.translate.instant(pt+".short_wednesday"),this.translate.instant(pt+".short_thursday"),this.translate.instant(pt+".short_friday"),this.translate.instant(pt+".short_saturday")],firstDayOfWeek:0,hourFormat:this.translate.instant(pt+".hour_format"),monthNames:[this.translate.instant(pt+".name_january"),this.translate.instant(pt+".name_february"),this.translate.instant(pt+".name_march"),this.translate.instant(pt+".name_april"),this.translate.instant(pt+".name_may"),this.translate.instant(pt+".name_june"),this.translate.instant(pt+".name_july"),this.translate.instant(pt+".name_august"),this.translate.instant(pt+".name_september"),this.translate.instant(pt+".name_october"),this.translate.instant(pt+".name_november"),this.translate.instant(pt+".name_december")],monthNamesShort:[this.translate.instant(pt+".short_january"),this.translate.instant(pt+".short_february"),this.translate.instant(pt+".short_march"),this.translate.instant(pt+".short_april"),this.translate.instant(pt+".short_may"),this.translate.instant(pt+".short_june"),this.translate.instant(pt+".short_july"),this.translate.instant(pt+".short_august"),this.translate.instant(pt+".short_september"),this.translate.instant(pt+".short_october"),this.translate.instant(pt+".short_november"),this.translate.instant(pt+".short_december")],today:this.translate.instant(pt+".today")}},t.ctorParameters=function(){return[{type:p.TranslateService}]},t=x([e.Injectable()],t)}(),ht="platform.filter_service",dt=function(){function r(t,r,i,n,o){this.filterService=t,this.translate=r,this.messageService=i,this.calendarOptionsService=n,this.changeDetectorRef=o,this.destroy$=new v.Subject,this.contexts=[],this.formFilters=[],this.oldFormFilters=[],this.actualFormFilters=[],this.general=new q({name:"Geral"}),this.totalFiltersActive=0,this.isMobile=!1,this.tabViewOrientation="left",this.error=!1,this.errorMessages={min:this.translate.instant(ht+".error_min_value"),max:this.translate.instant(ht+".error_max_value"),pattern:this.translate.instant(ht+".invalid_pattern")},this.showMessages=!0,this.isModal=!1,this.totalFiltersActiveOutput=new e.EventEmitter,this.errorOutput=new e.EventEmitter,this.showDialogOutput=new e.EventEmitter,this.closeModalOutput=new e.EventEmitter}return r.prototype.onResizeWindow=function(t){var e=t.target.innerWidth;this.isMobile=e<=640,this.tabViewOrientation=this.isMobile?"top":"left"},r.prototype.ngOnInit=function(){var t=this;this.isMobile=innerWidth<=640,this.tabViewOrientation=this.isMobile?"top":"left",this.subscribeContextsObservable(),this.subscribeFiltersObservable(),window.addEventListener("message",(function(e){var r,i=e.data;"addContext"===(i.message&&i.message.split(":")[1])&&(r=t.filterService).addContexts.apply(r,A(i.payload))}))},r.prototype.ngOnDestroy=function(){this.destroy$.next(!0)},r.prototype.hasChanges=function(){var t=this,e=Object.keys(this.formFilters);return!Object.keys(this.oldFormFilters).length||e.filter((function(e){var r=t.formFilters[e].value,i=t.oldFormFilters[e]&&t.oldFormFilters[e].value;return!_.equals(r,i)})).length>0},r.prototype.onApplyFilters=function(){this.hasChanges()&&this.closeModalOutput.emit()},r.prototype.getFilters=function(){this.hasChanges()&&this.filterService.tryAgain(this.contexts)},r.prototype.applyFilters=function(t){if(void 0===t&&(t=!1),this.hasChanges()){this.showDialogOutput.emit(!1),this.counterUpdate();var e=this.getFiltersValues(this.formFilters);this.filterService.saveTickedFilters(e)}else if(t){var r={key:"filterServiceToastKey",severity:"info",life:5e3,detail:this.translate.instant(ht+".applied_filter_nochange",{activeFilters:this.totalFiltersActive})};this.sendMessage(r)}this.oldFormFilters=_.clone(this.formFilters)},r.prototype.getDefaultValue=function(t,e){return void 0===t||e&&""===t[0]?[]:t},r.prototype.clearFilters=function(){var t=this;Object.keys(this.formFilters).forEach((function(e){return t.cleanFieldAndSetDefaultValue(e)}))},r.prototype.sendCloseMessage=function(){window.parent.postMessage({message:"dashboard:close-modal",payload:{modalName:"advanced-filter-1"}},"*")},r.prototype.sendMessage=function(t){this.showMessages?this.messageService.add(t):window.parent.postMessage({message:"dashboard:toastr",payload:{type:"success",message:t.detail}},"*")},r.prototype.saveFilters=function(){var t=this,e=this.parseToUserFilters(this.formFilters);this.filterService.saveFilters(e).subscribe((function(){var e={key:"filterServiceToastKey",severity:"info",life:5e3,detail:t.translate.instant(ht+".saved_filters_success",{activeFilters:t.totalFiltersActive})};t.sendMessage(e),t.counterUpdate()}),(function(){var e={key:"filterServiceToastKey",severity:"error",life:5e3,detail:t.translate.instant(ht+".saved_filters_error",{activeFilters:t.totalFiltersActive})};t.sendMessage(e)}))},r.prototype.counterUpdate=function(){this.totalFiltersActive=this.countActiveFilters(this.tabs),this.totalFiltersActiveOutput.emit(this.totalFiltersActive)},r.prototype.countActiveFilters=function(t){var e=0;return t.forEach((function(t){var r=t.form.value;t.activeFilters=Object.keys(r).reduce((function(t,e){var i=r[e],n=Array.isArray(i);return(n&&i.length>0||!n&&i)&&t++,t}),0),e+=t.activeFilters})),e},r.prototype.parseToUserFilters=function(e){return Object.keys(e).reduce((function(r,i){var n=e[i],o=n.type,s=n.services,a=n.name,l=n.value,u=n.domain,c=n.contexts,p=function(e,r){var i;return i=r===t.FilterType.SEARCH&&Array.isArray(e)?Array.isArray(e)?e.length?null===e[0]?[""]:e:[""]:e||[""]:[null==e?"":e],JSON.stringify(i)}(l,o);return A(r,s.map((function(t){return{name:a,service:t,value:p,domain:u,contexts:c}})))}),[])},r.prototype.getFiltersValues=function(e){return Object.keys(e).reduce((function(r,i){var n=e[i],o=n.type,s=n.services,a=n.name,l=n.value,u=n.domain,c=function(e,r){var i;return r!==t.FilterType.SEARCH?i=[null==e?"":e]:Array.isArray(e)?(i=[""],null!==e&&e.length>0&&""!==e[0]&&(i=e.map((function(t){return t.$$__keyValue__})))):i=[null===e?"":e.$$__keyValue__],JSON.stringify(i)}(l,o);return A(r,s.map((function(t){return{name:a,service:t,value:c,domain:u}})))}),[])},r.prototype.subscribeContextsObservable=function(){var t=this;this.filterService.contextsObserver.pipe(y.takeUntil(this.destroy$)).subscribe((function(e){return t.contexts=e}))},r.prototype.errorStateAction=function(){this.filterService.tryAgain(this.contexts)},r.prototype.subscribeFiltersObservable=function(){var t=this;this.filterService.filtersObserver.pipe(y.takeUntil(this.destroy$)).subscribe((function(e){var r=e.filters,i=e.applyFilter,n=e.error,o=e.message;t.errorOutput.emit(n),t.error=n,t.errorState=o,n||(t.tabs=t.createTabs(r),t.counterUpdate(),t.setDependencies(t.formFilters),t.createChildArray(),r.length>0&&i&&t.applyFilters())}))},r.prototype.setDependencies=function(t){var e=this,r=Object.keys(t);v.from(r).pipe(y.map((function(e){return t[e]})),y.filter((function(t){var e=t.dependsOn;return e&&e.length>0})),y.tap((function(e){var r=e.dependsOn,i=e.domain,n=e.filterControl;r.filter((function(t){return t.required})).filter((function(e){var r=$(i,e.filterName),n=t[r],o=n.value,s=n.type,a=e.comparator;if(a&&ut(a.operator)&&ct(s)){var l=Y(o,s);return!lt(a.operator,a.value,l)}return e.required?!n.value:n.value})).length>0&&n.disable()})),y.map((function(t){return{domain:t.domain,dependsOn:t.dependsOn,filterControl:t.filterControl}}))).subscribe((function(r){var i=r.dependsOn,n=r.domain,o=r.filterControl;return v.from(i).pipe(y.filter((function(t){return t.required})),y.map((function(t){var e=t.filterName;return $(n,e)})),y.map((function(e){return t[e]})),y.mergeMap((function(t){return v.from(t.valueChanges)})),y.map((function(t){var r=i.every((function(r){var i=$(n,r.filterName);if(e.formFilters[i]){var o=e.formFilters[i].type,s=r.comparator;if(s&&ut(s.operator)&&ct(o)){var a=Y(t,o);return lt(s.operator,s.value,a)}return!0}}));return!e.IsEmpty(t)&&r?"enable":"disable"}))).subscribe((function(t){return o[t]()}))}))},r.prototype.addGeneralField=function(t){var e=this,r=t.name,i=t.domain,n=t.type,o=$(i,r),s=nt(t);s.valueChanges.pipe(y.takeUntil(this.destroy$),y.map((function(t){return Y(t,n)})),y.tap((function(t){return e.formFilters[o].value=t}))).subscribe((function(t){return e.tabs.forEach((function(e){var n=e.form.controls[r];n&&e.domain===i&&n.setValue(t,{emitEvent:!1})}))}));var a=O(O({},t),{name:o}),l=this.createField(a);this.general.form.addControl(o,s),this.general.fields.push(l)},r.prototype.containsAllContexts=function(t){if(!t.length)return!0;var e=this.contexts.map((function(t){return t.contextId}));return _.equals(t.sort(),e.sort())},r.prototype.createTabs=function(e){var r=this;return e.reduce((function(e,i){var n=i.domain,o=i.services,s=i.name,a=i.type,l=i.scope,u=i.contexts,c=i.dependsOn,p=i.value,f=i.search,h=i.defaultValue,d=f&&1===X(f).output.maxSelectedItems,m=r.createField(i),v=$(n,s),g={domain:n,contexts:u,services:o,name:s,dependsOn:c,value:Z(p,a,d),type:a,isMultiple:!d,defaultValue:Z(h,a,d)};r.formFilters[v]=new L(g);var b=r.formFilters[v];return l===t.Scope.DOMAIN&&r.containsAllContexts(u)&&r.addGeneralField(i),u.forEach((function(t){var o=function(t,e){return t+":"+e}(n,t),l=nt(i);if(!e.has(o)){var u=r.contexts.find((function(e){return e.contextId===t})).contextLabel,c=new H({domain:n,name:u});e.set(o,c)}l.valueChanges.pipe(y.takeUntil(r.destroy$)).subscribe((function(t){return r.updateFilterValue(o,s,t,n,a)}));var p=e.get(o);p.fields.push(m),p.form.addControl(i.name,l),b.filterControl||(b.filterControl=l)})),e}),new Map)},r.prototype.updateFilterValue=function(t,e,r,i,n){var o=this,s={emitEvent:!1},a=Y(r,n),l=$(i,e),u=this.general.form.controls[l];this.tabs.forEach((function(i,n){var o=i.form.controls[e];t!==n&&o&&o.setValue(r,s)}));var c=this.formFilters[l].childs;c&&c.forEach((function(t){return o.cleanFieldAndSetDefaultValue(t.filter.key)})),u&&u.setValue(r,s),this.formFilters[l].value=a},r.prototype.cleanFieldAndSetDefaultValue=function(t){var e=this.formFilters[t],r=e.isMultiple,i=e.defaultValue,n=e.filterControl,o=e.type,s=this.getDefaultValue(i,r);n&&(("DATE"===o||"SEARCH"===o&&r)&&n.setValue(s),"INTEGER"===o||"DOUBLE"===o||"MONEY"===o?""===s?n.setValue(null):n.setValue(s):n.setValue(s,{onlySelf:!0}))},r.prototype.createChildArray=function(){var t=this;Object.keys(this.formFilters).forEach((function(e){var r=t.formFilters[e],i=r.dependsOn,n=r.domain;i.forEach((function(r){var i=$(n,r.filterName);t.formFilters[i]&&(t.formFilters[i].childs||(t.formFilters[i].childs=[]),t.formFilters[i].childs.push({filter:{key:e,required:r.required}}))}))}))},r.prototype.createField=function(e){var r,i=this,n=e.name,o=e.label,s=e.enumItems,a=e.type,l=e.mask,u=s&&s.map((function(t){return{label:i.translate.instant(t.label),value:t.value}})),p={name:n,label:this.translate.instant(o),placeholder:""};return((r={})[t.FilterType.STRING]=function(){return new c.TextField(O(O({},p),{mask:l?function(){return l}:null,type:c.FieldType.String}))},r[t.FilterType.MONEY]=function(){return new c.CurrencyField(O(O({},p),{type:c.FieldType.Money}))},r[t.FilterType.BOOLEAN]=function(){return i.createRadioButton(O({},p))},r[t.FilterType.DATE]=function(){return i.createCalendar(O(O({},p),{type:c.FieldType.Date}))},r[t.FilterType.DATETIME]=function(){return i.createCalendar(O(O({},p),{type:c.FieldType.DateTime}))},r[t.FilterType.TIME]=function(){return i.createCalendar(O(O({},p),{type:c.FieldType.Time}))},r[t.FilterType.ENUMERATION]=function(){return new c.SelectField(O(O({},p),{placeholder:i.translate.instant("platform.filter_service.select"),options:A(u),type:c.FieldType.Enum}))},r[t.FilterType.INTEGER]=function(){return new c.NumberField(O(O({},p),{numberLocaleOptions:i.optionsInteger(),mask:l?function(){return l}:null,type:c.FieldType.Integer}))},r[t.FilterType.DOUBLE]=function(){return new c.CurrencyField(O(O({},p),{type:c.FieldType.Double}))},r[t.FilterType.SEARCH]=function(){return i.createAutocompleteField(p,e)},r)[a]()},r.prototype.createRadioButton=function(t){var e=[{label:this.translate.instant(ht+".yes"),value:!0},{label:this.translate.instant(ht+".no"),value:!1}];return new c.RadioButtonField(O(O({},t),{type:c.FieldType.Radio,options:e}))},r.prototype.createCalendar=function(t){var e=new c.CalendarField(t);return e.calendarLocaleOptions=this.calendarOptionsService.getOptions(),this.isModal||(e.appendTo="body"),e},r.prototype.createAutocompleteField=function(t,e){var r=this,i=e.dependsOn,n=e.search,o=e.domain,s=e.name,a=new v.BehaviorSubject([]),l=X(n).input.queryParam,u=X(n).output,p=u.displayFields,f=u.keyFields,h=u.resultDataJsonPath,d=u.displayFieldConcatToken,m=u.maxSelectedItems,g=$(o,s);return new c.AutocompleteField(O(O({},t),{onSearch:function(t){var e,s=((e={})[l]=t,e);i&&Object.assign(s,r.getDependenciesValues(i,o));var u=n&&"ENTITY"===n.type?r.getEntitySearchUrl(n.entitySearch.input,t,i):X(n).input.url;r.filterService.searchFieldSuggestions(u,s,n.type).pipe(y.map((function(t){return function t(e,r){var i=(r=r.replace("$.","")).split("."),n=e[i[0]];return i.shift(),i.length?t(n,i.join(".")):n}(t,h)})),y.map((function(t){return r.addSuggestionFields(t,p,f,d,g)}))).subscribe((function(t){a.next(t),r.changeDetectorRef.detectChanges()}),(function(t){var e=void 0;t&&t.error.message&&(e=t.error.message),function(t){var e={key:"filterServiceToastKey",severity:"error",life:5e3,detail:t||r.translate.instant(ht+".find_suggestions_error",{activeFilters:r.totalFiltersActive})};r.sendMessage(e)}(e)}))},appendTo:"body",suggestionsObservable:a,displayField:"$$__displayValue__",dataKey:"$$__keyValue__",multiple:m>1,size:{lg:12,md:12,xl:12},emptyMessage:this.translate.instant(ht+".search_empty_message")}))},r.prototype.getEntitySearchUrl=function(t,e,r){var i=this,n=t.attributes,o=t.domainName,s=t.entityName,a=t.serviceName,l=o+"/"+a+"/entities/"+s+"/?filter=",u=n.map((function(t){return Q[t.comparator](t.name,e)}));return r&&r.forEach((function(t){var e=$(o,t.filterName),r=i.formFilters[e].value.$$__keyValue__;u.push(t.entityAttribute+" eq '"+r+"'")})),l.concat(u).replace(/[,]+(?![^(]*[)])/g," "+t.operator+" ")},r.prototype.addSuggestionFields=function(t,e,r,i,n){var o=this,s=function(t,e,r){return t?""+t+r+e:e},a=t.map((function(t){var n;return O(O({},t),((n={}).$$__displayValue__=e.reduce((function(e,r){return s(e,o.translate.instant(t[r]),i)}),""),n.$$__keyValue__=r.reduce((function(e,r){return s(e,t[r],", ")}),""),n))}));return this.formFilters[n].invalidValue=0===a.length,a.filter((function(t){var e=o.formFilters[n].value;return Array.isArray(e)?-1===e.findIndex((function(e){return e.$$__keyValue__===t.$$__keyValue__}))?t:void 0:t}))},r.prototype.getDependenciesValues=function(t,e){var r=this;return t.reduce((function(t,i){var n=i.filterName,o=$(e,n);if(r.formFilters[o]){var s=r.formFilters[o],a=s.value;return"ENUMERATION"===s.type?t[n]=a:Array.isArray(a)?t[n]=a.map((function(t){return t.$$__keyValue__})):t[n]=a?a.$$__keyValue__:[""],r.IsEmpty(t[n])&&delete t[n],t}}),{})},r.prototype.IsEmpty=function(t){return Array.isArray(t)?t.every((function(t){return!t})):!t},r.prototype.optionsInteger=function(){return{currencySymbol:"",decimalSeparator:"",thousandsSeparator:""}},r.ctorParameters=function(){return[{type:P},{type:p.TranslateService},{type:u.MessageService},{type:ft},{type:e.ChangeDetectorRef}]},x([e.Input()],r.prototype,"showMessages",void 0),x([e.Input()],r.prototype,"isModal",void 0),x([e.Output()],r.prototype,"totalFiltersActiveOutput",void 0),x([e.Output()],r.prototype,"errorOutput",void 0),x([e.Output()],r.prototype,"showDialogOutput",void 0),x([e.Output()],r.prototype,"closeModalOutput",void 0),x([e.HostListener("window:resize",["$event"])],r.prototype,"onResizeWindow",null),r=x([e.Component({selector:"s-app-form-filter",template:'<s-empty-state\n *ngIf="error"\n iconClass="fa fa-exclamation-triangle"\n title="{{ errorState?.status }} - {{ errorState?.statusText }}"\n (primaryAction)="errorStateAction()"\n [primaryActionLabel]="translate.instant(\'platform.filter_service.try\')"\n [description]="translate.instant(\'platform.filter_service.error_state\')"\n></s-empty-state>\n\n<div *ngIf="!error">\n <p-tabView *ngIf="tabs && tabs.size > 1" [orientation]="tabViewOrientation" selected="false">\n <p-tabPanel *ngIf="general.fields.length" [selected]="false" [header]="general.name">\n <s-dynamic-form [errorMessages]="errorMessages" [fields]="general.fields" [form]="general.form"></s-dynamic-form>\n </p-tabPanel>\n\n <p-tabPanel *ngFor="let tab of (tabs | mapValues); let i = index" [selected]="i === 0" [header]="tab.label">\n <s-dynamic-form [errorMessages]="errorMessages" [fields]="tab.fields" [form]="tab.form"></s-dynamic-form>\n </p-tabPanel>\n </p-tabView>\n\n <div *ngIf="tabs && tabs.size === 1">\n <s-dynamic-form\n *ngFor="let tab of (tabs | mapValues)"\n [errorMessages]="errorMessages"\n [fields]="tab.fields"\n [form]="tab.form"\n ></s-dynamic-form>\n </div>\n</div>\n',styles:[".filter-dialog{width:800px;top:100px}.filter-dialog>.ui-dialog-content{height:300px;padding:10px!important}@media (min-width:641px) and (max-width:1024px){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:300px}}@media only screen and (min-device-width:481px) and (max-device-width:1024px) and (orientation:portrait){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:90%}}@media (min-width:320px) and (max-width:640px){.filter-dialog{width:95%;left:0;top:0;opacity:1;margin:auto;height:93%}.filter-dialog>.ui-dialog-content{height:85%}}@media (min-width:320px) and (max-width:640px) and (max-width:360px){.filter-dialog button{padding:0!important}.filter-dialog>.ui-dialog-content{height:81%}}"]})],r)}(),mt=function(){function t(t,e){var r=this;this.translate=t,this.router=e,this.labelButton="Filters",this.onlyContent=!1,this.hideButtons=!1,this.canOpenFilter=!0,this.showActiveFiltersCountBadge=!0,this.filterAndSave=!1,this.subscriptions=[],this.isMobile=!1,this.tabViewOrientation="left",this.totalFiltersActive=0,this.showDialog=!1,this.error=!1,this.mobileButtonActions=[{id:"save",label:this.translate.instant("save"),command:function(){return r.modalComponent.saveFilters()}},{id:"clear",label:this.translate.instant("clear"),command:function(){return r.modalComponent.clearFilters()}}]}return t.prototype.ngOnInit=function(){var t=this;this.isMobile=innerWidth<=640,this.tabViewOrientation=this.isMobile?"top":"left";var e=this.router.events.subscribe((function(e){e instanceof g.NavigationEnd&&t.modalComponent.getFilters()}));this.subscriptions.push(e)},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.onResizeWindow=function(t){var e=t.target.innerWidth;this.isMobile=e<=640,this.tabViewOrientation=this.isMobile?"top":"left"},Object.defineProperty(t.prototype,"appliedFiltersTooltip",{get:function(){return this.totalFiltersActive>1?this.translate.instant("platform.filter_service.applied_filters_message",{totalActiveFilters:this.totalFiltersActive}):this.translate.instant("platform.filter_service.applied_filter_message",{totalActiveFilters:this.totalFiltersActive})},enumerable:!0,configurable:!0}),t.prototype.onError=function(t){this.error=t},t.prototype.saveFilters=function(){this.modalComponent.saveFilters()},t.prototype.clearFilters=function(){this.modalComponent.clearFilters()},t.prototype.close=function(){this.modalComponent.getFilters(),window.parent.postMessage({message:"dashboard:close-modal",payload:{modalName:"advanced-filter-1"}},"*")},t.prototype.applyFilters=function(){this.modalComponent.hasChanges()&&(this.showDialog=!1),this.filterAndSave&&this.modalComponent.saveFilters(),this.modalComponent.applyFilters(!0)},t.prototype.onApplyFilters=function(){this.filterAndSave&&this.modalComponent.saveFilters(),this.modalComponent.onApplyFilters()},t.prototype.toggleDialog=function(){this.showDialog=!this.showDialog},t.prototype.updateTotalFiltersActive=function(t){this.totalFiltersActive=t},t.ctorParameters=function(){return[{type:p.TranslateService},{type:g.Router}]},x([e.Input()],t.prototype,"labelButton",void 0),x([e.Input()],t.prototype,"onlyContent",void 0),x([e.Input()],t.prototype,"hideButtons",void 0),x([e.Input()],t.prototype,"canOpenFilter",void 0),x([e.Input()],t.prototype,"showActiveFiltersCountBadge",void 0),x([e.Input()],t.prototype,"filterAndSave",void 0),x([e.ViewChild(dt)],t.prototype,"modalComponent",void 0),x([e.HostListener("window:resize",["$event"])],t.prototype,"onResizeWindow",null),t=x([e.Component({selector:"s-advanced-filter",template:'<s-button\n *ngIf="!onlyContent"\n [id]="\'filterButton\'"\n [disabled]="!canOpenFilter"\n (click)="canOpenFilter ? toggleDialog() : \'\'"\n iconClass="fa fa-filter"\n priority="default"\n [label]="labelButton"\n [auxiliary]="true"\n [tooltip]="appliedFiltersTooltip"\n>\n <span *ngIf="totalFiltersActive && showActiveFiltersCountBadge" class="sds-badge-number sds-color-primary custom-badge">{{ totalFiltersActive }}</span>\n</s-button>\n\n<section *ngIf="onlyContent">\n <div class="only-content-wrapper">\n <div class="header">\n <h3>{{ \'platform.filter_service.filters\' | translate }}</h3>\n <span (click)="close()" class="close_btn pi pi-times"></span>\n </div>\n <div class="app-form-filter">\n <s-app-form-filter\n [showMessages]="false"\n (totalFiltersActiveOutput)="updateTotalFiltersActive($event)"\n (closeModalOutput)="close()"\n [isModal]="false"\n ></s-app-form-filter>\n </div>\n <div class="filter-footer" *ngIf="!error">\n <s-button priority="link" [label]="translate.instant(\'platform.filter_service.cancel\')" (click)="close()"></s-button>\n <s-button\n *ngIf="isMobile"\n priority="default"\n [label]="translate.instant(\'platform.filter_service.actions\')"\n [auxiliary]="true"\n [model]="mobileButtonActions"\n ></s-button>\n <ng-container *ngIf="!isMobile">\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.clear\')" (click)="clearFilters()"></s-button>\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.save\')" (click)="saveFilters()"></s-button>\n </ng-container>\n <s-button\n type="submit"\n priority="primary"\n [label]="translate.instant(\'platform.filter_service.filter\')"\n (click)="onApplyFilters()"\n ></s-button>\n </div>\n </div>\n</section>\n\n<p-dialog\n *ngIf="!onlyContent"\n appendTo="body"\n styleClass="filter-dialog"\n [draggable]="false"\n [modal]="true"\n [responsive]="true"\n [(visible)]="showDialog"\n blockScroll="true"\n [closable]="false"\n>\n <p-header>\n <div style="display: flex;">\n {{ \'platform.filter_service.filters\' | translate }}\n <span (click)="toggleDialog(); close()" class="close_btn pi pi-times"></span>\n </div>\n </p-header>\n\n <s-app-form-filter\n [showMessages]="true"\n (errorOutput)="onError($event)"\n (totalFiltersActiveOutput)="updateTotalFiltersActive($event)"\n [isModal]="true"\n ></s-app-form-filter>\n <p-footer *ngIf="!error && !hideButtons">\n <s-button\n type="submit"\n priority="primary"\n [label]="translate.instant(\'platform.filter_service.filter\')"\n (click)="applyFilters()"\n ></s-button>\n <ng-container *ngIf="!isMobile">\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.save\')" (click)="saveFilters()"></s-button>\n <s-button priority="secondary" [label]="translate.instant(\'platform.filter_service.clear\')" (click)="clearFilters()"></s-button>\n </ng-container>\n <s-button\n *ngIf="isMobile"\n priority="default"\n [label]="translate.instant(\'platform.filter_service.actions\')"\n [auxiliary]="true"\n [model]="mobileButtonActions"\n ></s-button>\n <s-button priority="link" [label]="translate.instant(\'platform.filter_service.cancel\')" (click)="toggleDialog(); close()"></s-button>\n </p-footer>\n</p-dialog>\n\n<p-toast key="filterServiceToastKey" [baseZIndex]="5000"></p-toast>\n',encapsulation:e.ViewEncapsulation.None,styles:[".custom-badge{position:absolute!important;right:-4px;top:-10px;height:20px;vertical-align:middle;display:table;min-width:22px}.filter-button{position:relative;border:1px solid #000;border-radius:1.5rem;background:0 0;padding:.5rem 1rem;cursor:pointer}.filter-dialog .ui-dialog-title{display:block!important;padding-right:0!important}.filter-footer{text-align:end;border-top:1px solid #e5eaea;padding:13px}.filter-dialog>.ui-dialog-content{height:300px;padding:10px!important}.app-form-filter{height:335px;max-height:335px;overflow:auto}.only-content-wrapper{background-color:#fff}.close_btn{-ms-flex-line-pack:center;align-content:center;-ms-grid-column-align:right;justify-self:right;margin-left:auto}.close_btn:hover{cursor:pointer}.header{text-transform:uppercase;display:-ms-flexbox;display:flex;width:100%;border-bottom:1px solid #e5eaea;padding:15px;margin-left:0}@media (min-width:641px) and (max-width:1024px){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:300px}}@media only screen and (min-device-width:481px) and (max-device-width:1024px) and (orientation:portrait){.filter-dialog{width:75%}.filter-dialog>.ui-dialog-content{height:90%}}@media (min-width:320px) and (max-width:640px){.filter-dialog{width:95%;left:0;top:0;opacity:1;margin:auto;height:93%}.filter-dialog>.ui-dialog-content{height:85%}}@media (min-width:320px) and (max-width:640px) and (max-width:360px){.filter-dialog button{padding:0!important}.filter-dialog>.ui-dialog-content{height:81%}}"]})],t)}(),vt=function(){},yt=function(){function t(){}return t=x([e.NgModule({imports:[o.DialogModule,c.ButtonModule,n.ButtonModule,s.TabViewModule,r.CommonModule,i.FormsModule,i.ReactiveFormsModule,c.DynamicFormModule,a.ToastModule,c.EmptyStateModule,l.TooltipModule,N.forChild([{domain:"platform",service:"filter_service",fallback:U}])],providers:[P,c.LocaleService,u.MessageService,p.TranslateService,ft],declarations:[mt,dt,C,M],exports:[mt,dt]})],t)}(),gt=function(){function t(){}return t.prototype.intercept=function(t,e){return t.body instanceof Blob==!1&&t.body instanceof FormData==!1&&(t=t.clone({body:F.decycle(t.body)})),e.handle(t).pipe(y.map((function(t){return t instanceof f.HttpResponse&&(t=t.clone({body:F.retrocycle(t.body)})),t})))},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t=x([e.Injectable({providedIn:"root"})],t)}(),bt=function(){function t(){}return t=x([e.NgModule({imports:[f.HttpClientModule],providers:[{provide:f.HTTP_INTERCEPTORS,useClass:gt,multi:!0}]})],t)}(),_t=function(){function t(){}return t.prototype.get=function(){return v.defer((function(){return v.from(h.service.getRestUrl())}))},t=x([e.Injectable()],t)}(),Ft=function(){function t(){}return t.prototype.get=function(){return v.defer((function(){var t=h.service.getXServicesUrl();return v.from(t)}))},t=x([e.Injectable()],t)}(),St=function(){function t(t,e){this.restUrl=t,this.xServicesUrl=e}return t.prototype.intercept=function(t,e){var r=this;if(!t.url.includes("://")){var i=v.defer((function(){return v.from(h.user.getAuthHeader())}));if(/^\/?[^\/]+\/[^\/]+\/api\/(?:latest|v\d+)\/.+$/g.test(t.url)){var n=this.xServicesUrl.get();return v.forkJoin({xUrl:n,getAuthHeader:i}).pipe(y.mergeMap((function(i){return r.injectBaseUrl(t,e,i.xUrl,i.getAuthHeader)})))}var o=this.restUrl.get();return v.forkJoin({getRestUrl:o,getAuthHeader:i}).pipe(y.mergeMap((function(i){var n=I(i,2),o=n[0],s=n[1];return r.injectBaseUrl(t,e,o,s)})))}return e.handle(t)},t.prototype.injectBaseUrl=function(t,e,r,i){var n=t.clone({url:r+t.url,headers:t.headers.set("Authorization",i)});return e.handle(n)},t.ctorParameters=function(){return[{type:_t},{type:Ft}]},t=x([e.Injectable()],t)}(),Ot=function(){function t(){}return t=x([e.NgModule({imports:[f.HttpClientModule],providers:[_t,Ft,{provide:f.HTTP_INTERCEPTORS,useClass:St,multi:!0}]})],t)}(),xt=new e.InjectionToken("RESOURCES"),wt=new e.InjectionToken("ENVIRONMENT"),Et=function(){},Tt=function(){function r(t,e,r,i,n,o){this.resources=t,this.environment=e,this.http=r,this.router=i,this.messageService=n,this.translate=o,this.checkedPermissions=[],this.actionUrl="platform/authorization/queries"}return r.prototype.checkAccess=function(t){var e=this,r=[];return t.forEach((function(t){t.actions.forEach((function(i){if(!t.uri){var n=e.getUriByResourceName(t.name,t.entity);t.uri=n}r.push({action:i,resource:t.uri})}))})),this.http.post(this.actionUrl+"/checkAccess",{includeFilters:!0,permissions:r}).pipe(y.map((function(r){var i=r.permissions;e.checkedPermissions=A(e.checkedPermissions,i);var n={};return e.shouldRedirectToForbiddenPage(t,i)?(e.router.navigate(["error",403]),v.throwError("forbidden")):(i.forEach((function(e){var r=t.find((function(t){return t.uri===e.resource})).name;n[r]=n[r]||{},n[r][e.action]=e.authorized,n[r][e.action.toLowerCase()]=e.authorized,e.resourceFilters&&e.resourceFilters.length&&(n[r].resourceFilters||(n[r].resourceFilters=[]),e.resourceFilters.forEach((function(t){n[r].resourceFilters.push(t)})))})),n)})))},r.prototype.get=function(e){var r=this;return void 0===e&&(e=""),t.promise||(t.promise=this.getPermissions()),v.from(t.promise).pipe(y.map((function(t){return r.checkedPermissions=t,e?t[Object.keys(t).find((function(t){return t.toLowerCase()===e.toLowerCase()}))]:t})),y.catchError((function(e){return t.promise=void 0,r.messageService.add({severity:"error",summary:r.translate.instant("permission_error_summary"),detail:r.translate.instant("permission_error_detail")}),v.of(r.getPermissionObject(!1))})))},r.prototype.isAuthorized=function(t,e,r){this.checkedPermissions.length||v.throwError("'Permissions' are not defined. You should call 'get' or 'checkAccess' method first.");var i=this.getUriByResourceName(t,r),n=this.checkedPermissions.filter((function(t){return t.resource===i})).find((function(t){return t.action.toLowerCase()===e.toLowerCase()}));return n&&n.authorized},r.prototype.getUriByResourceName=function(t,e){var r=this.environment,i=r.domain,n=r.service;i&&n||v.throwError("You must inform domain and service name");var o="res://senior.com.br/"+i+"/"+n;return e?o+"/entities/"+t:o+"/"+t},r.prototype.shouldRedirectToForbiddenPage=function(t,e){void 0===t&&(t=[]);var r=e.filter((function(t){return!t.authorized}));if(r&&r.length){var i=t.filter((function(t){return t.redirectToError}));return!(!i||!i.length)&&i.every((function(t){return(t.actionsToCheck&&t.actionsToCheck.length?t.actionsToCheck:t.actions).every((function(e){return r.some((function(r){return r.resource===t.uri&&r.action===e}))}))}))}return!1},r.prototype.getFlatEnvironment=function(){return this.environment.ignorePermissions},r.prototype.getFlatResources=function(){return this.resources.reduce((function(t,e){return e?Array.isArray(e)?A(t,e):A(t,[e]):t}),[])},r.prototype.getPermissionObject=function(t){return this.getFlatResources().reduce((function(e,r){return e[r.name]=r.actions.reduce((function(e,r){return e[r]=t,e[r.toLowerCase()]=t,e}),{}),e}),{})},r.prototype.getPermissions=function(){return E(this,void 0,void 0,(function(){var t,e,r,i;return T(this,(function(n){switch(n.label){case 0:return this.getFlatEnvironment()?[2,this.getPermissionObject(!0)]:(t=this.getFlatResources(),e=t.map((function(t){return t.actions.map((function(e){return{action:e,resource:t.uri}}))})).reduce((function(t,e){return A(t,e)})),[4,this.http.post(this.actionUrl+"/checkAccess",{includeFilters:!1,permissions:e}).toPromise().then((function(t){return t.permissions}))]);case 1:return r=n.sent(),i={},r.forEach((function(e){var r=t.find((function(t){return t.uri===e.resource})).name;i[r]=i[r]?i[r]:{},i[r][e.action]=e.authorized,i[r][e.action.toLowerCase()]=e.authorized})),[2,i]}}))}))},r.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[xt]}]},{type:Et,decorators:[{type:e.Inject,args:[wt]}]},{type:f.HttpClient},{type:g.Router},{type:u.MessageService},{type:p.TranslateService}]},r.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new r(e.ɵɵinject(xt),e.ɵɵinject(wt),e.ɵɵinject(f.HttpClient),e.ɵɵinject(g.Router),e.ɵɵinject(u.MessageService),e.ɵɵinject(p.TranslateService))},token:r,providedIn:"root"}),r=x([e.Injectable({providedIn:"root"}),w(0,e.Inject(xt)),w(1,e.Inject(wt))],r)}(),It=function(){function t(){}var r;return r=t,t.forRoot=function(t,e){return{ngModule:r,providers:[Tt,{provide:xt,multi:!0,useValue:t},{provide:wt,multi:!1,useValue:e}]}},t.forChild=function(t){return{ngModule:r,providers:[{provide:xt,multi:!0,useValue:t}]}},t=r=x([e.NgModule()],t)}();function At(t,e){var r=function(r,i){return t+"/"+e+"/"+r+"/"+i};return{resource:function(r){return function(t){return"res://senior.com.br/"+t.domain+"/"+t.service+"/"+t.resource}({domain:t,service:e,resource:r})},query:r.bind(null,"queries"),action:r.bind(null,"actions"),signal:r.bind(null,"signals"),entity:function(t){var e=r("entities",t);return{create:function(){return e},update:function(t){return e+"/"+t},remove:function(t){return e+"/"+t}}}}}var Ct,Mt=At("platform","feature_toggle"),kt=function(){function t(t){this.http=t,this.cache={}}return t.prototype.isEnabled=function(t,e){var r=this,i=t.domain,n=t.service,o=t.name;return(e?v.of(e):v.from(h.user.getUserData()).pipe(y.map((function(t){return t.tenantName})))).pipe(y.mergeMap((function(t){var e=JSON.stringify({tenant:t,domain:i,service:n});return r.cache[e]||(r.cache[e]=r.http.post(Mt.query("getEnabledFeatures"),{tenant:t,domain:i,service:n}).pipe(y.map((function(t){return t.features})),y.shareReplay(1),y.catchError((function(t){return console.error(t),delete r.cache[e],v.of([])})))),r.cache[e]})),y.map((function(t){return-1!==t.findIndex((function(t){return t.name===o}))})))},t.ctorParameters=function(){return[{type:f.HttpClient}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(f.HttpClient))},token:t,providedIn:"root"}),t=x([e.Injectable({providedIn:"root"})],t)}(),Nt=function(){function t(){}return t=x([e.NgModule({imports:[f.HttpClientModule,Ot],providers:[kt]})],t)}();!function(t){t.CONFIRMED="CONFIRMED",t.POSTPONED="POSTPONED",t.REFUSED="REFUSED"}(Ct||(Ct={}));var Rt,Dt=function(){function t(t){this.http=t,this.API_URL="platform/spotlight/"}return t.prototype.getUser=function(){return this.http.post("platform/user/queries/getUser",{}).toPromise()},t.prototype.listSpotlightScreen=function(){return this.http.get(this.API_URL+"queries/listSpotlightScreen")},t.prototype.listSpotlightUsers=function(){return this.http.get(this.API_URL+"queries/listSpotlightUsers").toPromise()},t.prototype.listSpotlightControl=function(){return this.http.get(this.API_URL+"queries/listSpotlightControl").toPromise()},t.prototype.saveSpotlightUser=function(t){return this.http.post(this.API_URL+"actions/saveSpotlightUsers",{content:t})},t.prototype.saveSpotlightControl=function(t){return this.http.post(this.API_URL+"actions/saveSpotlightControl",{content:t})},t.prototype.notificateSpotlight=function(t){return this.http.post(this.API_URL+"actions/notificateSpotlight",t)},t.ctorParameters=function(){return[{type:f.HttpClient}]},t=x([e.Injectable()],t)}();!function(t){t.ADVERSITING="ADVERSITING",t.INTEGRATION="INTEGRATION"}(Rt||(Rt={}));var jt;!function(t){t.ACTIVE="ACTIVE",t.IN_PROGRESS="IN_PROGRESS",t.NO_STARTED="NO_STARTED",t.REFUSED="REFUSED"}(jt||(jt={}));var Ut=function(){function t(t,r,i){this.spotlightService=t,this.cookieService=r,this.datePipe=i,this.canAppear=!1,this.visible=!1,this.fade=!1,this.visibleChange=new e.EventEmitter}return t.prototype.ngOnInit=function(){return E(this,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:return[4,this.setValues()];case 1:return t.sent(),this.fetchSpotlight(),[2]}}))}))},t.prototype.setValues=function(){return E(this,void 0,void 0,(function(){var t,e,r;return T(this,(function(i){switch(i.label){case 0:return t=JSON.parse(this.cookieService.get("com.senior.token")),this.currentUser=t.username,e=this,[4,this.spotlightService.listSpotlightUsers()];case 1:return e.spotlightUsersList=i.sent(),r=this,[4,this.spotlightService.listSpotlightControl()];case 2:return r.spotlightControlsList=i.sent(),[2]}}))}))},t.prototype.setValuesInSpotlight=function(t){this.header=t.spotlightTitle,this.imgUrl=t.bannerUrl,this.primaryButtonLabel=t.primaryButtonLabel,this.primaryButtonTooltip=t.primaryButtonHint},t.prototype.getShowDate=function(t){var e=new Date;return this.datePipe.transform(e.setDate(e.getDate()+t).toString(),"yyyy-MM-dd")},t.prototype.fetchSpotlight=function(){var t=this;this.spotlightService.listSpotlightScreen().subscribe((function(e){t.spotlightScreen=e.contents.filter((function(e){return e.screenMenuId===t.menuId}))[0],t.spotlightScreen&&t.showSpotlight(t.spotlightScreen.spotlight)}))},t.prototype.showSpotlight=function(t){if(this.validateDate(t.initialDate)&&this.validateFinalDate(t.finalDate)&&this.validateSpotlight(t)){this.setValuesInSpotlight(t),this.canAppear=!0;var e=this.getSpotlightControlFromList(this.spotlightScreen.spotlight.id);this.canEmitEvent=!e||this.currentUser!==e.firstUser}},t.prototype.validateDate=function(t){return!!t&&this.datePipe.transform((new Date).toString(),"yyyy-MM-dd")>=this.datePipe.transform(t,"yyyy-MM-dd")},t.prototype.validateFinalDate=function(t){return!t||this.datePipe.transform((new Date).toString(),"yyyy-MM-dd")<=this.datePipe.transform(t,"yyyy-MM-dd")},t.prototype.validateSpotlight=function(t){return!!this.validateControlsList(this.spotlightControlsList,t,this.currentUser)&&!!this.validateDisplayType(t,this.spotlightUsersList,this.spotlightControlsList,this.currentUser)},t.prototype.validateControlsList=function(t,e,r){if(t.totalElements&&t.contents.filter((function(t){return t.status===jt.ACTIVE?t.spotlightId===e.id:t.status===jt.IN_PROGRESS?t.spotlightId===e.id&&t.firstUser!==r:void 0})).length>0)return!1;return!0},t.prototype.validateDisplayType=function(t,e,r,i){var n=this;switch(t.displayType){case Rt.ADVERSITING:return!e.totalElements||this.validateUser(e.contents,t);case Rt.INTEGRATION:if(r.totalElements)if(0===r.contents.filter((function(r){switch(r.status){case jt.NO_STARTED:return r.spotlightId===t.id;case jt.REFUSED:return!e.totalElements||n.validateUser(e.contents,t);case jt.IN_PROGRESS:return r.firstUser===i&&r.spotlightId===t.id}})).length)return!1;return!0}},t.prototype.validateUser=function(t,e){var r=this,i=t.filter((function(t){return t.spotlightId===e.id}));if(!i.length)return 0===(i=t.filter((function(t){return t.userOperation===r.currentUser}))).length;var n=i.filter((function(t){return t.userOperation===r.currentUser}))[0];return!n||this.validateDate(n.showDate)},t.prototype.saveSpotlightUser=function(t){var e=this,r=this.spotlightScreen.spotlight,i=this.spotlightUsersList.contents.filter((function(t){return t.spotlightId===r.id&&t.userOperation===e.currentUser}))[0],n={spotlightId:r.id,showDate:t?this.getShowDate(t):null,userOperation:this.currentUser};i&&(n=O({id:i.id},n)),this.spotlightService.saveSpotlightUser(n).subscribe()},t.prototype.onPrimary=function(){var t=this.spotlightScreen.spotlight,e=this.buildNotification(Ct.CONFIRMED);this.saveSpotlightControl(),this.saveSpotlightUser(),this.canEmitEvent&&this.spotlightService.notificateSpotlight(e).subscribe(),t.primaryButtonUrl&&window.open(t.primaryButtonUrl),this.close()},t.prototype.onSecondary=function(){var t=this.buildNotification(Ct.POSTPONED);this.saveSpotlightControl(jt.REFUSED),this.saveSpotlightUser(this.spotlightScreen.spotlight.daysRememberLate),this.spotlightService.notificateSpotlight(t).subscribe(),this.close()},t.prototype.onTertiary=function(){var t=this.buildNotification(Ct.REFUSED);this.saveSpotlightControl(jt.REFUSED),this.saveSpotlightUser(this.spotlightScreen.spotlight.daysNotInterested),this.spotlightService.notificateSpotlight(t).subscribe(),this.close()},t.prototype.hasThisRegister=function(t,e){return t.spotlightId===e.id&&t.userOperation===this.currentUser},t.prototype.hasAnotherRegister=function(t,e){return t.spotlightId!==e.id&&t.userOperation===this.currentUser},t.prototype.saveSpotlightControl=function(t){void 0===t&&(t=jt.IN_PROGRESS);var e=this.spotlightScreen.spotlight,r=this.getSpotlightControlFromList(e.id);return r||(r={spotlightId:e.id,status:t,firstUser:this.currentUser}),(this.isNewControl(r)||r.status!==jt.IN_PROGRESS)&&(r.status=t,r.firstUser=t===jt.IN_PROGRESS?this.currentUser:"",this.spotlightService.saveSpotlightControl(r).subscribe()),r},t.prototype.getSpotlightControlFromList=function(t){return this.spotlightControlsList.contents.filter((function(e){return e.spotlightId===t}))[0]},t.prototype.isNewControl=function(t){return!this.spotlightControlsList.contents.includes(t)},t.prototype.buildNotification=function(t){var e=this.spotlightScreen.spotlight;return{clickedButton:t,spotlightControlId:e.id,primaryButtonUrl:e.primaryButtonUrl}},t.prototype.close=function(){this.visibleChange.emit(!1)},t.ctorParameters=function(){return[{type:Dt},{type:d.CookieService},{type:r.DatePipe}]},x([e.Input()],t.prototype,"visible",void 0),x([e.Input()],t.prototype,"menuId",void 0),x([e.Input()],t.prototype,"fade",void 0),x([e.Output()],t.prototype,"visibleChange",void 0),t=x([e.Component({selector:"s-spotlight",template:'<div class="s-spotlight-overlay" id="ol" *ngIf="canAppear && visible">\n <div class="s-spotlight" id="sl" [ngClass]="{\'s-effect-fadein\': fade}">\n <div class="s-spotlight-header">\n <span class="s-spotlight-title">{{header.toUpperCase()}}</span>\n <a role="button" class="s-spotlight-close" (click)="close()"><span class="fa fa-times" aria-hidden="true"></span></a>\n </div>\n <div class="s-img">\n <img src="{{imgUrl}}">\n </div>\n <div class="s-spotlight-footer">\n <div class="s-spotlight-footer-left">\n <button\n pButton\n type="submit"\n id="decline-button"\n label="{{\'platform.spotlight.no_interest\' | translate}}"\n (click)="onTertiary()"\n class="ui-button-link">\n </button>\n </div>\n <div class="s-spotlight-footer-right">\n <button\n pButton\n type="submit"\n id="remember-button"\n label="{{\'platform.spotlight.remember_late\' | translate}}"\n (click)="onSecondary()"\n class="ui-button-raised ui-button-secondary">\n </button>\n <button\n pButton\n label="{{primaryButtonLabel}}"\n type="submit"\n id="submit-button"\n (click)="onPrimary()"\n [pTooltip]="primaryButtonTooltip"\n tooltipPosition="top"\n showDelay="500"\n class="ui-button-raised">\n </button>\n </div>\n </div>\n</div>\n</div>',styles:['.s-spotlight-overlay{display:-ms-flexbox;display:flex;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,.4)}.s-spotlight{border-radius:3px;background:#fff;margin:auto;overflow:hidden;animation:.15s forwards move}.s-spotlight-footer,.s-spotlight-header{display:-ms-flexbox;display:flex;padding:15px}.s-spotlight-header{-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.s-spotlight-footer,.s-spotlight-footer-left,.s-spotlight-footer-right{display:-ms-flexbox;display:flex}.s-spotlight-footer-right{-ms-flex:2;flex:2;-ms-flex-pack:end;justify-content:flex-end}.s-spotlight-footer-left{-ms-flex:1;flex:1;-ms-flex-pack:start;justify-content:flex-start}.s-spotlight-title{font-family:"Open Sans",sans-serif;font-size:16px;font-weight:400;color:#333}.s-spotlight-close{display:block;margin-left:15px;color:#000}.s-img{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.s-img img{width:100%}.s-effect-fadein{animation:.15s forwards fade}@keyframes fade{0%{opacity:0}100%{opacity:1}}@media (max-width:595px){.s-spotlight-footer,.s-spotlight-footer-left,.s-spotlight-footer-right{-ms-flex-align:center;align-items:center;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.s-spotlight-footer button{margin:0 0 15px!important;width:100%!important}}@media (min-width:576px){.s-spotlight{width:100%}}@media (min-width:768px){.s-spotlight{width:720px}.s-spotlight-footer,.s-spotlight-footer-left,.s-spotlight-footer-right{-ms-flex-direction:row;flex-direction:row}}@media (min-width:992px){.s-spotlight{width:960px}}@media (min-width:1200px){.s-spotlight{width:50%}}']})],t)}(),Pt={"platform.spotlight.no_interest":"Não tenho interesse","platform.spotlight.remember_late":"Lembrar mais tarde"},Vt=function(){function t(t){this.translationService=t}return t.prototype.transform=function(t){return this.translationService.instant(t)},t.ctorParameters=function(){return[{type:p.TranslateService}]},t=x([e.Pipe({name:"translate",pure:!1})],t)}(),Bt=function(){function t(){}return t=x([e.NgModule({imports:[n.ButtonModule,l.TooltipModule,r.CommonModule,Ot,N.forChild([{domain:"platform",service:"spotlight",fallback:Pt}])],providers:[Dt,r.DatePipe,d.CookieService],declarations:[Ut,Vt],exports:[Ut]})],t)}();t.AdvancedFilterComponent=mt,t.AdvancedFilterModule=yt,t.AdvancedFilterService=P,t.AppRoutingModule=vt,t.CyclicJsonInterceptorModule=bt,t.FeatureToggleModule=Nt,t.FeatureToggleService=kt,t.Filter=V,t.FormFilter=L,t.HttpInterceptorModule=Ot,t.PermissionsModule=It,t.PermissionsService=Tt,t.RestUrl=_t,t.SpotlightComponent=Ut,t.SpotlightModule=Bt,t.TranslationsConfig=k,t.TranslationsModule=N,t.USER_INFO="com.senior.token",t.XServicesUrl=Ft,t.factory=R,t.ɵa=U,t.ɵb=ft,t.ɵc=dt,t.ɵd=C,t.ɵe=M,t.ɵf=gt,t.ɵg=St,t.ɵh=xt,t.ɵi=wt,t.ɵk=Et,t.ɵl=Pt,t.ɵm=Dt,t.ɵn=Vt,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=seniorsistemas-platform-components.umd.min.js.map
|