!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("angular-2-local-storage/dist/local-storage.service"),require("@angular/platform-browser"),require("ngx-moment"),require("pip-webui2-controls"),require("@angular/animations"),require("moment"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("@angular/material"),require("@angular/flex-layout"),require("pip-webui2-buttons"),require("pip-webui2-pictures"),require("@angular/common/http"),require("@ngx-translate/core"),require("angular-2-local-storage"),require("lodash"),require("ngx-cookie-service"),require("pip-webui2-layouts"),require("pip-webui2-nav"),require("pip-webui2-themes"),require("@angular/router"),require("@angular/core"),require("@angular/common"),require("@ngrx/store"),require("@ngrx/effects"),require("immutable")):"function"==typeof define&&define.amd?define("iqs-libs-clientshell2-angular",["exports","angular-2-local-storage/dist/local-storage.service","@angular/platform-browser","ngx-moment","pip-webui2-controls","@angular/animations","moment","rxjs","rxjs/operators","@angular/forms","@angular/material","@angular/flex-layout","pip-webui2-buttons","pip-webui2-pictures","@angular/common/http","@ngx-translate/core","angular-2-local-storage","lodash","ngx-cookie-service","pip-webui2-layouts","pip-webui2-nav","pip-webui2-themes","@angular/router","@angular/core","@angular/common","@ngrx/store","@ngrx/effects","immutable"],e):e(t["iqs-libs-clientshell2-angular"]={},t.i2,t.ng.platformBrowser,t["^3"][3][0],t["^1"][1][13],t.ng.animations,t["^2"][23][0],t.rxjs,t.rxjs.operators,t.ng.forms,t.ng.material,t.ng["flex-layout"],t["^1"][1][6],t["^1"][1][12],t.ng.common.http,t["^11"][0][1],t["^2"][0][0],t["^4"][17][11],t["^2"][1][0],t["^1"][1][21],t["^1"][1][15],t["^1"][1][24],t.ng.router,t.ng.core,t.ng.common,t["^7"][0][0],t["^7"][0][0],t["^4"][0]["0-rc"][12])}(this,function(t,e,n,r,i,o,s,O,C,a,c,p,l,u,h,g,f,I,d,m,y,S,b,v,E,_,A,w){"use strict";var N=function(t,e){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function z(t,e){function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var T=function(){return(T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function j(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;0<=a;a--)(i=t[a])&&(s=(o<3?i(s):3<o?i(e,n,s):i(e,n))||s);return 3<o&&s&&Object.defineProperty(e,n,s),s}function k(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function P(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function $(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s}function R(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat($(arguments[e]));return t}var x=(M.prototype.buildUrl=function(t,e){var n,r,i=t;if(e&&0<Object.keys(e).length)try{for(var o=P(Object.keys(e)),s=o.next();!s.done;s=o.next()){var a=s.value;e.hasOwnProperty(a)&&(i=i.replace(":"+a,e[a]))}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o["return"])&&r.call(o)}finally{if(n)throw n.error}}return i},M);function M(){}var F=function Ca(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.total=e,this.data=t},q=function Ia(){},U=new v.InjectionToken("WindowToken"),L=(Object.defineProperty(D.prototype,"nativeWindow",{get:function(){throw new Error("Not implemented.")},enumerable:!0,configurable:!0}),D);function D(){}var G,J=(z(B,G=L),Object.defineProperty(B.prototype,"nativeWindow",{get:function(){return window},enumerable:!0,configurable:!0}),B);function B(){return G.call(this)||this}var H,Z=(z(Y,H=Window),Y.decorators=[{type:v.Injectable}],Y);function Y(){return null!==H&&H.apply(this,arguments)||this}function V(t,e){return E.isPlatformBrowser(e)?t.nativeWindow:new Object}var W={provide:L,useClass:J},K={provide:U,useFactory:V,deps:[L,v.PLATFORM_ID]},Q=[W,K];function X(e){return O.interval(1e4).pipe(C.filter(function(t){return!e()}),C.scan(function(t,e){return t+1}))}function tt(){var t=new Uint32Array(8);window.crypto.getRandomValues(t);for(var e="",n=0;n<t.length;n++)e+=(n<2||5<n?"":"-")+t[n].toString(16).slice(-4);return e}var et=function _a(){},nt=function Aa(){},rt={id:"unknown",productName:"iQuipsys Positron",favoritesGroupName:"favourites",defaultFavoritesIds:["iqs_positron_monitoring","iqs_positron_retrospective","iqs_positron_schedule","iqs_positron_incidents"]},it=(ot.prototype.findApplicationById=function(t){return this.applications?I.find(this.applications,["id",t]):null},ot.prototype.findApplicationIndexById=function(t){return this.applications?I.findIndex(this.applications,["id",t]):null},ot);function ot(){}var st,at=(z(ct,st=et),ct);function ct(){return null!==st&&st.apply(this,arguments)||this}var pt=function wa(){},lt={shadows:{top:!0,left:!0,right:!0}},ut=function Na(){},ht={autorizedUrl:"/home/index.html",unautorizedUrl:"/entry/index.html#/signin",serverUrl:"/",lsKeys:{session:"session",serverUrl:"serverUrl"}},gt={application:rt,mock:!1,session:ht,shell:lt},ft={mock:!0,session:ht,shell:lt},dt=new v.InjectionToken("Shell config (runtime)"),mt=new v.InjectionToken("Shell config (function)"),yt=new v.InjectionToken("Shell config (merged)"),St=(Object.defineProperty(bt.prototype,"config",{get:function(){return I.defaultsDeep(this._config,gt)},enumerable:!0,configurable:!0}),bt.prototype.get=function(t,e){return I.get(this.config,t,e)},bt.decorators=[{type:v.Injectable}],bt.ctorParameters=function(){return[{type:undefined,decorators:[{type:v.Inject,args:[yt]}]}]},bt);function bt(t){this._config=t}var vt=(Object.defineProperty(Et.prototype,"config",{get:function(){return this.configService.config.application},enumerable:!0,configurable:!0}),Object.defineProperty(Et.prototype,"id",{get:function(){return I.get(this.config,"id")},set:function(t){this.configService.config.application.id=t},enumerable:!0,configurable:!0}),Object.defineProperty(Et.prototype,"favoritesGroupName",{get:function(){return I.get(this.config,"favoritesGroupName")},set:function(t){this.configService.config.application.favoritesGroupName=t},enumerable:!0,configurable:!0}),Et.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Et.ctorParameters=function(){return[{type:St}]},Et.ngInjectableDef=v.defineInjectable({factory:function(){return new Et(v.inject(St))},token:Et,providedIn:"root"}),Et);function Et(t){this.configService=t}var Ot,Ct,It=function za(){},_t=function Ta(){},At=(z(wt,Ot=_t),wt);function wt(){return null!==Ot&&Ot.apply(this,arguments)||this}var Nt={user:"user",manager:"manager",admin:"admin",org_admin:"org_admin",unknown:"unknown"},zt=((Ct={})[Nt.user]=1,Ct[Nt.manager]=2,Ct[Nt.org_admin]=3,Ct[Nt.admin]=4,Ct[Nt.unknown]=0,Ct),Tt=(jt.prototype.getConfig=function(){return this.iqsConfig.config.session},Object.defineProperty(jt.prototype,"autorizedUrl",{get:function(){return this.iqsConfig.get("session.autorizedUrl")},set:function(t){this.iqsConfig.config.session.autorizedUrl=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"unautorizedUrl",{get:function(){return this.iqsConfig.get("session.unautorizedUrl")},set:function(t){this.iqsConfig.config.session.unautorizedUrl=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"serverUrl",{get:function(){return this.iqsConfig.get("session.serverUrl")},set:function(t){this.iqsConfig.config.session.serverUrl=t},enumerable:!0,configurable:!0}),Object.defineProperty(jt.prototype,"lsKeys",{get:function(){return this.iqsConfig.get("session.lsKeys")},enumerable:!0,configurable:!0}),jt.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],jt.ctorParameters=function(){return[{type:St},{type:f.LocalStorageService},{type:d.CookieService}]},jt.ngInjectableDef=v.defineInjectable({factory:function(){return new jt(v.inject(St),v.inject(e.LocalStorageService),v.inject(d.CookieService))},token:jt,providedIn:"root"}),jt);function jt(t,e,n){this.iqsConfig=t,this.localStorage=e,this.cookies=n;var r=this.iqsConfig.get("session.lsKeys.serverUrl",ht.lsKeys);this.iqsConfig.config.session.serverUrl=this.localStorage.get(r)||this.cookies.get(r)||this.iqsConfig.config.session.serverUrl,this.localStorage.set(r,this.iqsConfig.get("session.serverUrl"))}var kt=(Pt.prototype.handleError=function(t){return O.throwError(t)},Pt.prototype.readApplications=function(){var t=this.sessionConfig.serverUrl+this.RESOURCE,e=new h.HttpParams;return e=e.set("product",this.applicationsConfig.config.productName),this.http.get(t,{params:e}).pipe(C.map(function(t){return t.data}),C.map(function(t){var e,n;try{for(var r=P(t),i=r.next();!i.done;i=r.next()){var o=i.value;if(0<=o.icon.indexOf(":")){var s=o.icon.split(":");"clock-back"===s[1]&&(s[0]="webui"),"iqs"===s[0]&&(s[0]="iqt"),"icons"!==s[0]&&"webui-icons"!==s[0]||(s[0]="webui"),o.icon=s.join("-")}}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(e)throw e.error}}return t}),C.catchError(this.handleError))},Pt.prototype.updateApplication=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE+"/"+t.id,n=new h.HttpParams;return n=n.set("product",this.applicationsConfig.config.productName),this.http.put(e,t,{params:n}).pipe(C.catchError(this.handleError))},Pt.prototype.createApplication=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE,n=new h.HttpParams;return n=n.set("product",this.applicationsConfig.config.productName),this.http.post(e,t,{params:n}).pipe(C.catchError(this.handleError))},Pt.prototype.deleteApplication=function(t){var e="string"==typeof t?t:t.id,n=this.sessionConfig.serverUrl+this.RESOURCE+"/"+e,r=new h.HttpParams;return r=r.set("product",this.applicationsConfig.config.productName),this.http["delete"](n,{params:r}).pipe(C.map(function(){return e}),C.catchError(this.handleError))},Pt.decorators=[{type:v.Injectable}],Pt.ctorParameters=function(){return[{type:vt},{type:Tt},{type:h.HttpClient}]},Pt);function Pt(t,e,n){this.applicationsConfig=t,this.sessionConfig=e,this.http=n,this.RESOURCE="/api/v1/applications"}var $t={ApplicationsInit:"[Applications] Init",ApplicationsAbort:"[Applications] Abort",ApplicationsSuccess:"[Applications] Success",ApplicationsFailure:"[Applications] Failure",ApplicationsEmpty:"[Applications] Empty",ApplicationsData:"[Applications] Data",ApplicationsToggleFavorite:"[Applications] ToggleFavorite",ApplicationsToggleFavoriteSuccess:"[Applications] ToggleFavoriteSuccess",ApplicationsToggleFavoriteFailure:"[Applications] ToggleFavoriteFailure"},Rt=function ja(t){this.favorites=t,this.type=$t.ApplicationsInit},xt=function ka(){this.type=$t.ApplicationsAbort},Mt=function Pa(t){this.payload=t,this.type=$t.ApplicationsSuccess},Ft=function $a(t){this.payload=t,this.type=$t.ApplicationsFailure},qt=function Ra(){this.type=$t.ApplicationsEmpty},Ut=function xa(t){this.payload=t,this.type=$t.ApplicationsData},Lt=function Ma(t){this.payload=t,this.type=$t.ApplicationsToggleFavorite},Dt=function Fa(){this.type=$t.ApplicationsToggleFavoriteSuccess},Gt=function qa(t){this.payload=t,this.type=$t.ApplicationsToggleFavoriteFailure},Jt={SettingsInit:"[Settings] Init",SettingsAbort:"[Settings] Abort",SettingsSuccess:"[Settings] Success",SettingsFailure:"[Settings] Failure",SettingsData:"[Settings] Data",SettingsEmpty:"[Settings] Empty",SettingsCreate:"[Settings] Create",SettingsCreateSuccess:"[Settings] CreateSuccess",SettingsCreateFailure:"[Settings] CreateFailure",SettingsUpdate:"[Settings] Update",SettingsUpdateSuccess:"[Settings] UpdateSuccess",SettingsUpdateFailure:"[Settings] UpdateFailure",SettingsChangeCancel:"[Settings] ChangeCancel"},Bt=function Ua(){this.type=Jt.SettingsInit},Ht=function La(){this.type=Jt.SettingsAbort},Zt=function Da(t){this.payload=t,this.type=Jt.SettingsSuccess},Yt=function Ga(t){this.payload=t,this.type=Jt.SettingsFailure},Vt=function Ja(t){this.payload=t,this.type=Jt.SettingsData},Wt=function Ba(){this.type=Jt.SettingsEmpty},Kt=function Ha(t){this.payload=t,this.type=Jt.SettingsCreate},Qt=function Za(t){this.payload=t,this.type=Jt.SettingsCreateSuccess},Xt=function Ya(t){this.payload=t,this.type=Jt.SettingsCreateFailure},te=function Va(t){this.payload=t,this.type=Jt.SettingsUpdate},ee=function Wa(t){this.payload=t,this.type=Jt.SettingsUpdateSuccess},ne=function Ka(t){this.payload=t,this.type=Jt.SettingsUpdateFailure},re=function Qa(){this.type=Jt.SettingsChangeCancel},ie={SessionSigninInit:"[Session] SigninInit",SessionSigninAbort:"[Session] SigninAbort",SessionSigninSuccess:"[Session] SigninSuccess",SessionSigninFailure:"[Session] SigninFailure",SessionSignoutInit:"[Session] SignoutInit",SessionSignoutAbort:"[Session] SignoutAbort",SessionSignoutSuccess:"[Session] SignoutSuccess",SessionSignoutFailure:"[Session] SignoutFailure",SessionRestoreInit:"[Session] RestoreInit",SessionRestoreSuccess:"[Session] RestoreSuccess",SessionRestoreFailure:"[Session] RestoreFailure",SessionCloseAllInit:"[Session] CloseAllInit",SessionCloseAllSuccess:"[Session] CloseAllSuccess",SessionCloseAllFailure:"[Session] CloseAllFailure"},oe=function Xa(t,e){this.login=t,this.password=e,this.type=ie.SessionSigninInit},se=function tc(){this.type=ie.SessionSigninAbort},ae=function ec(t){this.payload=t,this.type=ie.SessionSigninSuccess},ce=function nc(t){this.payload=t,this.type=ie.SessionSigninFailure},pe=function rc(){this.type=ie.SessionSignoutInit},le=function ic(){this.type=ie.SessionSignoutAbort},ue=function oc(){this.type=ie.SessionSignoutSuccess},he=function sc(t){this.payload=t,this.type=ie.SessionSignoutFailure},ge=function ac(t){this.payload=t,this.type=ie.SessionRestoreInit},fe=function cc(t){this.payload=t,this.type=ie.SessionRestoreSuccess},de=function pc(t){this.payload=t,this.type=ie.SessionRestoreFailure},me=function lc(){this.type=ie.SessionCloseAllInit},ye=function uc(){this.type=ie.SessionCloseAllSuccess},Se=function hc(t){this.payload=t,this.type=ie.SessionCloseAllFailure},be=(ve.prototype.handleError=function(t){return O.throwError(t)},Object.defineProperty(ve.prototype,"serverUrl",{get:function(){return this.iqsConfig.get("session.serverUrl")},enumerable:!0,configurable:!0}),ve.prototype.signin=function(t,e){var n=this.serverUrl+this.RESOURCE_SIGNIN,r={login:t,email:t,password:e};return this.http.post(n,r,{}).pipe(C.catchError(this.handleError))},ve.prototype.signout=function(){var t=this.serverUrl+this.RESOURCE_SIGNOUT;return this.http.post(t,{}).pipe(C.catchError(this.handleError))},ve.prototype.signup=function(t){var e=this.serverUrl+this.RESOURCE_SIGNUP,n={name:t.name,login:t.login||t.email,email:t.email,password:t.password,time_zone:t.time_zone||null,language:t.language||null,theme:t.theme||null};return this.httpBackend.post(e,n).pipe(C.catchError(this.handleError))},ve.prototype.restore=function(t){var e=this.serverUrl+this.RESOURCE_RESTORE,n={session_id:t},r={headers:new h.HttpHeaders({"content-type":"application/json","x-session-id":t})};return this.httpBackend.post(e,n,r).pipe(C.catchError(this.handleError))},ve.prototype.readHistory=function(){var t=this.serverUrl+this.RESOURCE_HISTORY;return this.http.get(t).pipe(C.catchError(this.handleError))},ve.prototype.closeAll=function(){var t=this.serverUrl+this.RESOURCE_CLOSE_ALL;return this.http.post(t,null).pipe(C.catchError(this.handleError))},ve.decorators=[{type:v.Injectable}],ve.ctorParameters=function(){return[{type:h.HttpClient},{type:St},{type:h.HttpBackend}]},ve);function ve(t,e,n){this.http=t,this.iqsConfig=e,this.RESOURCE_RESTORE="/api/v1/sessions/restore",this.RESOURCE_SIGNIN="/api/v1/signin",this.RESOURCE_SIGNOUT="/api/v1/signout",this.RESOURCE_SIGNUP="/api/v1/signup",this.RESOURCE_HISTORY="/api/v1/sessions/history",this.RESOURCE_CLOSE_ALL="/api/v1/sessions/close_all",this.httpBackend=e.config.mock?t:new h.HttpClient(n)}var Ee=(Oe.prototype.saveSession=function(t){this.localStorageService.set(this.sessionConfigService.lsKeys.session,t)},Oe.prototype.closeSession=function(){this.localStorageService.remove(this.sessionConfigService.lsKeys.session)},Oe.decorators=[{type:v.Injectable}],Oe.ctorParameters=function(){return[{type:A.Actions},{type:Z,decorators:[{type:v.Inject,args:[U]}]},{type:b.Router},{type:Tt},{type:be},{type:f.LocalStorageService}]},j([A.Effect(),k("design:type",O.Observable)],Oe.prototype,"SessionSigninInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],Oe.prototype,"SessionSignoutInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],Oe.prototype,"SessionRestoreInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],Oe.prototype,"SessionCloseAllInit$",void 0),j([A.Effect({dispatch:!1}),k("design:type",O.Observable)],Oe.prototype,"SessionSaveSession$",void 0),j([A.Effect({dispatch:!1}),k("design:type",O.Observable)],Oe.prototype,"SessionCloseSession$",void 0),j([A.Effect({dispatch:!1}),k("design:type",O.Observable)],Oe.prototype,"SessionToAuthorizedUrl$",void 0),j([A.Effect({dispatch:!1}),k("design:type",O.Observable)],Oe.prototype,"SessionToUnauthorizedUrl$",void 0),Oe);function Oe(t,e,n,r,i,o){var s=this;this.actions$=t,this.window=e,this.router=n,this.sessionConfigService=r,this.sessionDataService=i,this.localStorageService=o,this.SessionSigninInit$=this.actions$.pipe(A.ofType(ie.SessionSigninInit,ie.SessionSigninAbort),C.switchMap(function(t){return t.type===ie.SessionSigninInit?s.sessionDataService.signin(t.login,t.password).pipe(C.map(function(t){return new ae(t)}),C.catchError(function(t){return O.of(new ce(t))})):O.of()})),this.SessionSignoutInit$=this.actions$.pipe(A.ofType(ie.SessionSignoutInit,ie.SessionSignoutAbort),C.switchMap(function(t){return t.type===ie.SessionSignoutInit?s.sessionDataService.signout().pipe(C.map(function(){return new ue}),C.catchError(function(t){return O.of(new he(t))})):O.of()})),this.SessionRestoreInit$=this.actions$.pipe(A.ofType(ie.SessionRestoreInit),C.switchMap(function(t){return s.sessionDataService.restore(t.payload.session_id).pipe(C.map(function(t){return new fe({session:t})}),C.catchError(function(t){return O.of(new de({error:t}))}))})),this.SessionCloseAllInit$=this.actions$.pipe(A.ofType(ie.SessionCloseAllInit),C.switchMap(function(t){return s.sessionDataService.closeAll().pipe(C.map(function(){return new ye}),C.catchError(function(t){return O.of(new Se(t))}))})),this.SessionSaveSession$=this.actions$.pipe(A.ofType(ie.SessionSigninSuccess,ie.SessionRestoreSuccess),C.map(function(t){t.type===ie.SessionRestoreSuccess?s.saveSession(t.payload.session):s.saveSession(t.payload)})),this.SessionCloseSession$=this.actions$.pipe(A.ofType(ie.SessionSignoutSuccess,ie.SessionRestoreFailure,ie.SessionCloseAllSuccess),C.map(function(t){s.closeSession()})),this.SessionToAuthorizedUrl$=this.actions$.pipe(A.ofType(ie.SessionSigninSuccess),C.map(function(){s.window.location.href=s.window.location.origin+s.sessionConfigService.autorizedUrl})),this.SessionToUnauthorizedUrl$=this.actions$.pipe(A.ofType(ie.SessionSignoutSuccess,ie.SessionRestoreFailure,ie.SessionCloseAllSuccess),C.map(function(t){var e=s.window.location.origin+s.sessionConfigService.unautorizedUrl;t.type===ie.SessionRestoreFailure&&(e+="?from="+s.router.url),s.window.location.href=e}))}var Ce={session:null,state:"empty",error:null};function Ie(t,e){switch(void 0===t&&(t=Ce),e.type){case ie.SessionSigninInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case ie.SessionSigninAbort:return w.fromJS(t).set("state",t.error?"error":t.session?"data":"empty").toJS();case ie.SessionSigninSuccess:return w.fromJS(t).set("session",e.payload).set("state","data").set("error",null).toJS();case ie.SessionSigninFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();case ie.SessionSignoutInit:return w.fromJS(t).set("state","progress").toJS();case ie.SessionSignoutAbort:return w.fromJS(t).set("state",t.error?"error":t.session?"data":"empty").toJS();case ie.SessionSignoutSuccess:return w.fromJS(t).set("session",null).set("state","empty").set("error",null).toJS();case ie.SessionSignoutFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();case ie.SessionRestoreInit:return w.fromJS(t).set("session",{id:e.payload.session_id,user_id:e.payload.user_id}).set("state","progress").set("error",null).toJS();case ie.SessionRestoreSuccess:return w.fromJS(t).set("session",e.payload.session).set("state","data").set("error",null).toJS();case ie.SessionRestoreFailure:return w.fromJS(t).set("session",null).set("state","error").set("error",e.payload.error).toJS();case ie.SessionCloseAllInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case ie.SessionCloseAllSuccess:return w.fromJS(t).set("session",null).set("state","empty").set("error",null).toJS();case ie.SessionCloseAllFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();default:return t}}var _e=_.createFeatureSelector("auth"),Ae=_.createSelector(_e,function(t){return t.session}),we=_.createSelector(_e,function(t){return t.state}),Ne=_.createSelector(_e,function(t){return t.error}),ze=(Object.defineProperty(Te.prototype,"session$",{get:function(){return this.store.select(Ae)},enumerable:!0,configurable:!0}),Object.defineProperty(Te.prototype,"state$",{get:function(){return this.store.select(we)},enumerable:!0,configurable:!0}),Object.defineProperty(Te.prototype,"error$",{get:function(){return this.store.select(Ne)},enumerable:!0,configurable:!0}),Object.defineProperty(Te.prototype,"session",{get:function(){var e;return this.session$.pipe(C.first()).subscribe(function(t){return e=t}),e},enumerable:!0,configurable:!0}),Object.defineProperty(Te.prototype,"isAuthorized$",{get:function(){return this.state$.pipe(C.map(function(t){return"data"===t}))},enumerable:!0,configurable:!0}),Te.prototype.signin=function(t,e){this.store.dispatch(new oe(t,e))},Te.prototype.abortSignin=function(){this.store.dispatch(new se)},Te.prototype.signout=function(){this.store.dispatch(new pe)},Te.prototype.restore=function(){var t=this.localStorageService.get(this.sessionConfig.lsKeys.session),e=t?t.id:this.cookies.get("sessionId"),n=t?t.user_id:this.cookies.get("userId");e&&n&&this.sessionConfig.lsKeys.serverUrl?this.store.dispatch(new ge({session_id:e,user_id:n})):this.window.location.href=this.window.location.origin+this.sessionConfig.unautorizedUrl+"?from="+this.router.url},Te.prototype.closeAll=function(){this.store.dispatch(new me)},Te.decorators=[{type:v.Injectable}],Te.ctorParameters=function(){return[{type:Z,decorators:[{type:v.Inject,args:[U]}]},{type:d.CookieService},{type:f.LocalStorageService},{type:b.Router},{type:Tt},{type:_.Store}]},Te);function Te(t,e,n,r,i,o){this.window=t,this.cookies=e,this.localStorageService=n,this.router=r,this.sessionConfig=i,this.store=o}var je=(ke.prototype.handleError=function(t){return O.throwError(t)},ke.prototype.readSettings=function(){var t=this.sessionService.session&&this.sessionService.session.user_id||null,e=this.sessionConfig.serverUrl+this.RESOURCE+"/"+(t||"");return this.http.get(e,{}).pipe(C.catchError(this.handleError))},ke.prototype.createSettings=function(t){var e=this.sessionService.session&&this.sessionService.session.user_id||null,n=this.sessionConfig.serverUrl+this.RESOURCE+"/"+(e||"");return this.http.post(n,t,{}).pipe(C.catchError(this.handleError))},ke.decorators=[{type:v.Injectable}],ke.ctorParameters=function(){return[{type:h.HttpClient},{type:Tt},{type:ze}]},ke);function ke(t,e,n){this.http=t,this.sessionConfig=e,this.sessionService=n,this.RESOURCE="/api/v1/settings"}var Pe=($e.decorators=[{type:v.Injectable}],$e.ctorParameters=function(){return[{type:A.Actions},{type:je}]},j([A.Effect(),k("design:type",O.Observable)],$e.prototype,"settingsInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],$e.prototype,"settingsSuccess$",void 0),j([A.Effect(),k("design:type",O.Observable)],$e.prototype,"settingsCreate$",void 0),j([A.Effect(),k("design:type",O.Observable)],$e.prototype,"settingsUpdate$",void 0),$e);function $e(t,e){var n=this;this.actions$=t,this.settingsDataService=e,this.settingsInit$=this.actions$.pipe(A.ofType(Jt.SettingsInit,Jt.SettingsAbort),C.switchMap(function(t){return t.type===Jt.SettingsInit?n.settingsDataService.readSettings().pipe(C.map(function(t){return new Zt(t)}),C.catchError(function(t){return O.of(new Yt(t))})):O.of()})),this.settingsSuccess$=this.actions$.pipe(A.ofType(Jt.SettingsSuccess),C.map(function(t){return t.payload}),C.map(function(t){return Object.keys(t).length<=0?new Wt:new Vt(t)})),this.settingsCreate$=this.actions$.pipe(A.ofType(Jt.SettingsCreate),C.concatMap(function(e){return n.settingsDataService.createSettings(e.payload.settings).pipe(C.map(function(t){return new Qt({rid:e.payload.rid,settings:t})}),C.catchError(function(t){return O.of(new Xt({rid:e.payload.rid,error:t}))}))})),this.settingsUpdate$=this.actions$.pipe(A.ofType(Jt.SettingsUpdate),C.concatMap(function(e){return n.settingsDataService.createSettings(e.payload.settings).pipe(C.map(function(t){return new ee({rid:e.payload.rid,settings:t})}),C.catchError(function(t){return O.of(new ne({rid:e.payload.rid,error:t}))}))}))}var Re={settings:{},state:"empty",error:null};function xe(t,e){switch(void 0===t&&(t=Re),e.type){case Jt.SettingsInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case Jt.SettingsAbort:return w.fromJS(t).set("state",t.error?"error":t.settings&&0<Object.keys(t.settings).length?"data":"empty").toJS();case Jt.SettingsSuccess:return w.fromJS(t).set("error",null).toJS();case Jt.SettingsFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();case Jt.SettingsData:return w.fromJS(t).set("settings",e.payload).set("state","data").set("error",null).toJS();case Jt.SettingsEmpty:return w.fromJS(t).set("settings",{}).set("state","empty").set("error",null).toJS();case Jt.SettingsCreate:return w.fromJS(t).set("settings",e.payload.settings).set("state","progress").set("error",null).toJS();case Jt.SettingsCreateSuccess:return w.fromJS(t).set("state","data").set("error",null).toJS();case Jt.SettingsCreateFailure:return w.fromJS(t).set("state","error").set("error",e.payload.error).toJS();case Jt.SettingsUpdate:return w.fromJS(t).set("settings",e.payload.settings).set("state","progress").set("error",null).toJS();case Jt.SettingsUpdateSuccess:return w.fromJS(t).set("state","data").set("error",null).toJS();case Jt.SettingsUpdateFailure:return w.fromJS(t).set("state","error").set("error",e.payload.error).toJS();default:return t}}var Me=_.createFeatureSelector("settings"),Fe=_.createSelector(Me,function(t){return t.settings}),qe=_.createSelector(Me,function(t){return t.state}),Ue=_.createSelector(Me,function(t){return t.error}),Le=(De.prototype.init=function(){this.state&&"empty"!==this.state&&"error"!==this.state||this.store.dispatch(new Bt)},De.prototype.read=function(){this.store.dispatch(new Bt)},Object.defineProperty(De.prototype,"settings$",{get:function(){return this.store.select(Fe)},enumerable:!0,configurable:!0}),Object.defineProperty(De.prototype,"state$",{get:function(){return this.store.select(qe)},enumerable:!0,configurable:!0}),Object.defineProperty(De.prototype,"error$",{get:function(){return this.store.select(Ue)},enumerable:!0,configurable:!0}),De.prototype.createSettings=function(t){this.store.dispatch(new Kt({settings:t}))},De.prototype.getSetting$=function(e){return this.settings$.pipe(C.filter(function(t){return t&&0<Object.keys(t).length}),C.map(function(t){return t[e]}))},De.prototype.updateSettings=function(e,t,n){var r=this;void 0===t&&(t=!1),this.state&&"empty"!==this.state&&(t?this.settings$.pipe(C.first()).subscribe(function(t){r.store.dispatch(new te({rid:n,settings:I.merge({},I.cloneDeep(t),e)}))}):this.store.dispatch(new te({rid:n,settings:e})))},De.prototype.updateKey=function(n,r,i){var o=this;this.state&&"empty"!==this.state&&this.settings$.pipe(C.filter(function(t){return!!t}),C.first()).subscribe(function(t){var e=I.cloneDeep(t);e[n]=r,o.store.dispatch(new te({rid:i,settings:e}))})},De.prototype.deleteKey=function(p,l){var u=this;this.state&&"empty"!==this.state&&this.settings$.pipe(C.filter(function(t){return!!t}),C.first()).subscribe(function(t){var e,n,r=p,i=I.cloneDeep(t);Array.isArray(r)||(r=[r]);try{for(var o=P(r),s=o.next();!s.done;s=o.next()){var a=s.value;i.hasOwnProperty(a)&&delete i[a]}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=o["return"])&&n.call(o)}finally{if(e)throw e.error}}u.store.dispatch(new te({rid:l,settings:i}))})},De.decorators=[{type:v.Injectable}],De.ctorParameters=function(){return[{type:_.Store}]},De);function De(t){var e=this;this.store=t,this.state$.subscribe(function(t){e.state=t})}var Ge={OrganizationsInit:"[Organizations] Init",OrganizationsAbort:"[Organizations] Abort",OrganizationsSuccess:"[Organizations] Success",OrganizationsFailure:"[Organizations] Failure",OrganizationsData:"[Organizations] Data",OrganizationsEmpty:"[Organizations] Empty",OrganizationsCurrent:"[Organizations] Current",OrganizationsCurrentChangeInit:"[Organizations] CurrentChangeInit",OrganizationsCurrentChangeAbort:"[Organizations] CurrentChangeAbort",OrganizationsCurrentChangeSettings:"[Organizations] CurrentChangeSettings",OrganizationsCurrentChangeSuccess:"[Organizations] CurrentChangeSuccess",OrganizationsCurrentChangeFailure:"[Organizations] CurrentChangeFailure",OrganizationsCreateInit:"[Organizations] CreateInit",OrganizationsCreateAbort:"[Organizations] CreateAbort",OrganizationsCreateSuccess:"[Organizations] CreateSuccess",OrganizationsCreateFailure:"[Organizations] CreateFailure",OrganizationsConnectInit:"[Organizations] ConnectInit",OrganizationsConnectSuccess:"[Organizations] ConnectSuccess",OrganizationsConnectFailure:"[Organizations] ConnectFailure",OrganizationsDisconnectInit:"[Organizations] DisconnectInit",OrganizationsDisconnectSuccess:"[Organizations] DisconnectSuccess",OrganizationsDisconnectFailure:"[Organizations] DisconnectFailure"},Je=function gc(){this.type=Ge.OrganizationsInit},Be=function fc(){this.type=Ge.OrganizationsAbort},He=function dc(t){this.payload=t,this.type=Ge.OrganizationsSuccess},Ze=function mc(t){this.payload=t,this.type=Ge.OrganizationsFailure},Ye=function yc(t){this.payload=t,this.type=Ge.OrganizationsData},Ve=function Sc(){this.type=Ge.OrganizationsEmpty},We=function bc(t){this.payload=t,this.type=Ge.OrganizationsCurrent},Ke=function vc(t){this.payload=t,this.type=Ge.OrganizationsCurrentChangeInit},Qe=function Ec(){this.type=Ge.OrganizationsCurrentChangeAbort},Xe=function Oc(t){this.payload=t,this.type=Ge.OrganizationsCurrentChangeSettings},tn=function Cc(t){this.payload=t,this.type=Ge.OrganizationsCurrentChangeSuccess},en=function Ic(t){this.payload=t,this.type=Ge.OrganizationsCurrentChangeFailure},nn=function _c(t){this.payload=t,this.type=Ge.OrganizationsCreateInit},rn=function Ac(){this.type=Ge.OrganizationsCreateAbort},on=function wc(t){this.payload=t,this.type=Ge.OrganizationsCreateSuccess},sn=function Nc(t){this.payload=t,this.type=Ge.OrganizationsCreateFailure},an=function zc(t){this.payload=t,this.type=Ge.OrganizationsConnectInit},cn=function Tc(t){this.payload=t,this.type=Ge.OrganizationsConnectSuccess},pn=function jc(t){this.payload=t,this.type=Ge.OrganizationsConnectFailure},ln=function kc(t){this.payload=t,this.type=Ge.OrganizationsDisconnectInit},un=function Pc(t){this.payload=t,this.type=Ge.OrganizationsDisconnectSuccess},hn=function $c(t){this.payload=t,this.type=Ge.OrganizationsDisconnectFailure},gn=(fn.prototype.handleError=function(t){return O.throwError(t)},fn.prototype.readOrganizations=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE,n=new h.HttpParams;return t&&(n=n.set("filter",t)),this.http.get(e,{params:n}).pipe(C.catchError(this.handleError))},fn.prototype.readOrganization=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE+"/"+t;return this.http.get(e).pipe(C.catchError(this.handleError))},fn.prototype.createOrganization=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE;return this.http.post(e,t).pipe(C.catchError(this.handleError))},fn.prototype.connectToOrganization=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE+"/"+t+"/connect";return this.http.post(e,{}).pipe(C.catchError(this.handleError))},fn.prototype.disconnectFromOrganization=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE+"/"+t+"/disconnect";return this.http.post(e,{}).pipe(C.catchError(this.handleError))},fn.decorators=[{type:v.Injectable}],fn.ctorParameters=function(){return[{type:h.HttpClient},{type:Tt}]},fn);function fn(t,e){this.http=t,this.sessionConfig=e,this.RESOURCE="/api/v1/organizations"}var dn=(mn.decorators=[{type:v.Injectable}],mn.ctorParameters=function(){return[{type:A.Actions},{type:gn},{type:Le}]},j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsSuccess$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsCurrent$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsCurrentChangeInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsCurrentChangeSettings$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsCreateInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsConnectInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],mn.prototype,"organizationsDisconnectInit$",void 0),mn);function mn(t,e,n){var r=this;this.actions$=t,this.ds=e,this.settings=n,this.organizationsInit$=this.actions$.pipe(A.ofType(Ge.OrganizationsInit,Ge.OrganizationsAbort),C.switchMap(function(t){return t.type===Ge.OrganizationsInit?r.ds.readOrganizations().pipe(C.map(function(t){return new He(t.data)}),C.catchError(function(t){return O.of(new Ze(t))})):O.of()})),this.organizationsSuccess$=this.actions$.pipe(A.ofType(Ge.OrganizationsSuccess),C.map(function(t){return t.payload}),C.map(function(t){return 0<t.length?new Ye(t):new Ve})),this.organizationsCurrent$=O.combineLatest(this.actions$.pipe(A.ofType(Ge.OrganizationsData)),this.actions$.pipe(A.ofType(Jt.SettingsData))).pipe(C.switchMap(function(t){var e=$(t,2),n=e[0],r=e[1];if(r.payload.hasOwnProperty("org_id")){var i=r.payload.org_id,o=I.findIndex(n.payload||[],["id",i]);if(0<=o)return O.of(new We(n.payload[o]))}if(n.payload&&n.payload.length){var s=Object.assign({},r.payload,{org_id:n.payload[0].id});return O.of(new te({settings:s}))}return O.empty()})),this.organizationsCurrentChangeInit$=this.actions$.pipe(A.ofType(Ge.OrganizationsCurrentChangeInit,Ge.OrganizationsCurrentChangeAbort),C.switchMap(function(t){return t.type===Ge.OrganizationsCurrentChangeInit?(r.settings.updateKey("org_id",t.payload.id),O.of(new Xe(t.payload))):O.of()})),this.organizationsCurrentChangeSettings$=this.actions$.pipe(A.ofType(Ge.OrganizationsCurrentChangeSettings),C.exhaustMap(function(e){return r.actions$.pipe(A.ofType(Jt.SettingsUpdateSuccess),C.take(1),C.map(function(t){return(t.payload.settings.hasOwnProperty("org_id")?t.payload.settings.org_id:null)!==e.payload.id?new en(new Error("Organization wasn't changed")):new tn(e.payload)}))})),this.organizationsCreateInit$=this.actions$.pipe(A.ofType(Ge.OrganizationsCreateInit,Ge.OrganizationsCreateFailure),C.switchMap(function(t){return t.type===Ge.OrganizationsCreateInit?r.ds.createOrganization(t.payload).pipe(C.map(function(t){return new on(t)}),C.catchError(function(t){return O.of(new sn(t))})):O.of()})),this.organizationsConnectInit$=this.actions$.pipe(A.ofType(Ge.OrganizationsConnectInit),C.switchMap(function(t){return r.ds.connectToOrganization(t.payload.id).pipe(C.map(function(t){return new cn(t)}),C.catchError(function(t){return O.of(new pn(t))}))})),this.organizationsDisconnectInit$=this.actions$.pipe(A.ofType(Ge.OrganizationsDisconnectInit),C.switchMap(function(t){return r.ds.disconnectFromOrganization(t.payload.id).pipe(C.map(function(t){return new un(t)}),C.catchError(function(t){return O.of(new hn(t))}))}))}var yn=_.createFeatureSelector("organizations"),Sn=_.createSelector(yn,function(t){return t.organizations}),bn=_.createSelector(yn,function(t){return t.current}),vn=_.createSelector(yn,function(t){return t.state}),En=_.createSelector(yn,function(t){return t.error}),On=(Cn.prototype.init=function(){var e=this;this.settingsService.init(),this.state$.pipe(C.first()).subscribe(function(t){"empty"!==t&&"error"!==t||e.store.dispatch(new Je)})},Cn.prototype.read=function(){return this.store.dispatch(new Je)},Object.defineProperty(Cn.prototype,"organizations$",{get:function(){return this.store.select(Sn)},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"current$",{get:function(){return this.store.select(bn)},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"current",{get:function(){var e;return this.current$.pipe(C.take(1)).subscribe(function(t){return e=t}),e},set:function(t){this.store.dispatch(new Ke(t))},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"currentRole$",{get:function(){return this.current$.pipe(C.filter(function(t){return!!t}),C.withLatestFrom(this.sessionService.session$),C.map(function(t){var e=$(t,2),n=e[0],r=e[1].user.roles;if(r.includes("admin"))return Nt.admin;var i=r.find(function(t){return t.startsWith(n.id)});if(!i)return Nt.unknown;var o=i.substr(n.id.length+1);return o===Nt.admin&&(o=Nt.org_admin),Object.values(Nt).includes(o)?o:Nt.unknown}))},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"currentRole",{get:function(){var e;return this.currentRole$.pipe(C.take(1)).subscribe(function(t){return e=t}),e},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"state$",{get:function(){return this.store.select(vn)},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"error$",{get:function(){return this.store.select(En)},enumerable:!0,configurable:!0}),Cn.prototype.createOrganization=function(t){return this.store.dispatch(new nn(t))},Cn.prototype.connectToOrganization=function(t){return this.store.dispatch(new an(t))},Cn.prototype.disconnectFromOrganization=function(t){return this.store.dispatch(new ln(t))},Cn.decorators=[{type:v.Injectable}],Cn.ctorParameters=function(){return[{type:_.Store},{type:Le},{type:ze}]},Cn);function Cn(t,e,n){this.store=t,this.settingsService=e,this.sessionService=n}var In=(_n.decorators=[{type:v.Injectable}],_n.ctorParameters=function(){return[{type:A.Actions},{type:vt},{type:kt},{type:On},{type:Le}]},j([A.Effect(),k("design:type",O.Observable)],_n.prototype,"applicationsInit$",void 0),j([A.Effect(),k("design:type",O.Observable)],_n.prototype,"applications$",void 0),j([A.Effect(),k("design:type",O.Observable)],_n.prototype,"applicationsSuccess$",void 0),j([A.Effect(),k("design:type",O.Observable)],_n.prototype,"applicationToggleFavoutite$",void 0),_n);function _n(t,e,n,r,i){var s=this;this.actions$=t,this.applicationsConfig=e,this.applicationsDataService=n,this.organizationsService=r,this.settingsService=i,this.applicationsInit$=this.organizationsService.current$.pipe(C.filter(function(t){return!!t}),C.distinctUntilKeyChanged("id"),C.withLatestFrom(this.settingsService.settings$),C.map(function(t){var e=$(t,2),n=e[0],r=e[1],i=s.applicationsConfig.favoritesGroupName+"_"+n.id,o=r.hasOwnProperty(i)?JSON.parse(r[i]):[];return new Rt(o)})),this.applications$=this.actions$.pipe(A.ofType($t.ApplicationsInit,$t.ApplicationsAbort),C.switchMap(function(a){return a.type!==$t.ApplicationsAbort?s.applicationsDataService.readApplications().pipe(C.map(function(t){var e,n;try{for(var r=P(t),i=r.next();!i.done;i=r.next()){var o=i.value;o.isFavorite=a.favorites.includes(o.id),o.isHidden=!1}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(e)throw e.error}}return new Mt(t)}),C.catchError(function(t){return O.of(new Ft(t))})):O.of()})),this.applicationsSuccess$=this.actions$.pipe(A.ofType($t.ApplicationsSuccess),C.map(function(t){return t.payload&&0<t.payload.length?new Ut(t.payload):new qt})),this.applicationToggleFavoutite$=this.actions$.pipe(A.ofType($t.ApplicationsToggleFavorite),C.concatMap(function(e){return s.actions$.pipe(A.ofType(Jt.SettingsUpdateSuccess,Jt.SettingsUpdateFailure),C.filter(function(t){return e.payload.rid===t.payload.rid}),C.take(1),C.map(function(t){return t.type===Jt.SettingsUpdateSuccess?new Dt:new Gt(T({error:t.payload.error},e.payload))}))}))}var An={applications:[],state:"empty",toggling:!1,error:null};function wn(t,e){switch(void 0===t&&(t=An),e.type){case $t.ApplicationsInit:return(i=(i=(i=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case $t.ApplicationsAbort:return(i=(i=w.fromJS(t)).set("state",t.error?"error":t.applications&&t.applications.length?"data":"empty")).toJS();case $t.ApplicationsSuccess:return(i=(i=w.fromJS(t)).set("error",null)).toJS();case $t.ApplicationsFailure:return(i=(i=(i=w.fromJS(t)).set("state","error")).set("error",e.payload)).toJS();case $t.ApplicationsData:return(i=(i=(i=w.fromJS(t)).set("applications",e.payload)).set("state","data")).toJS();case $t.ApplicationsEmpty:return(i=(i=(i=w.fromJS(t)).set("applications",[])).set("state","empty")).toJS();case $t.ApplicationsToggleFavorite:var n=I.findIndex(t.applications,["id",e.payload.application_id]),r=(i=w.fromJS(t)).get("applications").toJS();return 0<=n&&(r[n].isFavorite=e.payload.state),(i=(i=(i=(i=i.set("applications",r)).set("state","data")).set("toggling",!0)).set("error",null)).toJS();case $t.ApplicationsToggleFavoriteSuccess:return(i=(i=(i=(i=w.fromJS(t)).set("state","data")).set("toggling",!1)).set("error",null)).toJS();case $t.ApplicationsToggleFavoriteFailure:var i;return(i=(i=(i=(i=w.fromJS(t)).set("state","data")).set("toggling",!1)).set("error",e.payload.error)).toJS();default:return t}}var Nn=_.createFeatureSelector("applications"),zn=_.createSelector(Nn,function(t){return t.applications}),Tn=_.createSelector(Nn,function(t){return t.state}),jn=_.createSelector(Nn,function(t){return t.toggling}),kn=_.createSelector(Nn,function(t){return t.error}),Pn=($n.prototype.init=function(){console.warn("this method is deprecated. Applications will update automaticaly")},Object.defineProperty($n.prototype,"applications$",{get:function(){return this.store.select(zn).pipe(C.withLatestFrom(this.organizationsService.currentRole$),C.map(function(t){var e=$(t,2),n=e[0],r=e[1],i=zt[r];return n.filter(function(t){return zt[t.role||Nt.unknown]<=i})}),C.shareReplay())},enumerable:!0,configurable:!0}),Object.defineProperty($n.prototype,"groups$",{get:function(){var m=this;return this.applications$.pipe(C.map(function(t){var e,n,r,i,o,s=m.applicationsConfig.favoritesGroupName,a=((e={})[s]={name:s,applications:[],isHidden:!1},e);try{for(var c=P(t),p=c.next();!p.done;p=c.next()){var l=p.value;a.hasOwnProperty(l.group)||(a[l.group]={name:l.group,applications:[]}),a[l.group].applications.push(l),l.isFavorite&&a[s].applications.push(l)}}catch(f){n={error:f}}finally{try{p&&!p.done&&(r=c["return"])&&r.call(c)}finally{if(n)throw n.error}}try{for(var u=P(Object.keys(a)),h=u.next();!h.done;h=u.next()){var g=h.value;a[g].isHidden=0===a[g].applications.length}}catch(d){i={error:d}}finally{try{h&&!h.done&&(o=u["return"])&&o.call(u)}finally{if(i)throw i.error}}return Object.keys(a).map(function(t){return a[t]})}))},enumerable:!0,configurable:!0}),Object.defineProperty($n.prototype,"favorites$",{get:function(){var n=this;return this.groups$.pipe(C.filter(function(t){return Array.isArray(t)&&0<t.length}),C.map(function(t){var e=I.findIndex(t,["name",n.applicationsConfig.favoritesGroupName]);return 0<=e?t[e].applications:[]}))},enumerable:!0,configurable:!0}),Object.defineProperty($n.prototype,"state$",{get:function(){return this.store.select(Tn)},enumerable:!0,configurable:!0}),Object.defineProperty($n.prototype,"toggling$",{get:function(){return this.store.select(jn)},enumerable:!0,configurable:!0}),Object.defineProperty($n.prototype,"error$",{get:function(){return this.store.select(kn)},enumerable:!0,configurable:!0}),$n.prototype.toggleFavorite=function(u,h){var g=this;this.organizationsService.current$.pipe(C.filter(function(t){return null!==t}),C.withLatestFrom(this.settingsService.settings$,this.applications$),C.first()).subscribe(function(t){var e=$(t,3),n=e[0],r=e[1],i=e[2].find(function(t){return t.id===u.id});if(i){var o=void 0===h?!u.isFavorite:h,s=g.applicationsConfig.favoritesGroupName+"_"+n.id,a=I.cloneDeep(r.hasOwnProperty(s)?JSON.parse(r[s]):[]),c=a.indexOf(u.id),p=0<=c;if(p!==o){p?a.splice(c,1):a.push(u.id);var l=tt();g.store.dispatch(new Lt({rid:l,application_id:i.id,state:o})),g.settingsService.updateKey(s,JSON.stringify(a),l)}}})},$n.appUpdateSub=null,$n.decorators=[{type:v.Injectable}],$n.ctorParameters=function(){return[{type:vt},{type:_.Store},{type:Le},{type:On}]},$n);function $n(t,e,n,r){this.applicationsConfig=t,this.store=e,this.settingsService=n,this.organizationsService=r}var Rn=(xn.decorators=[{type:v.NgModule,args:[{imports:[E.CommonModule,_.StoreModule.forFeature("settings",xe),A.EffectsModule.forFeature([Pe])],declarations:[],providers:[je,Le]}]}],xn);function xn(){}var Mn=(Fn.decorators=[{type:v.NgModule,args:[{imports:[E.CommonModule,_.StoreModule.forFeature("applications",wn),A.EffectsModule.forFeature([In]),Rn],declarations:[],providers:[kt,Pn]}]}],Fn);function Fn(){}var qn={List:"List",Details:"Details"},Un=function Rc(){},Ln=function xc(){},Dn=function Mc(){},Gn={Emergency:"Emergency",Help:"Help",Notifications:"Notifications"},Jn={Favorites:"favorites",All:"all"},Bn=(Object.defineProperty(Hn.prototype,"config$",{get:function(){return this._config$.asObservable()},enumerable:!0,configurable:!0}),Hn.prototype.getConfig=function(){return this._config$.getValue()},Hn.prototype.setConfig=function(t){var e=I.merge(this.getConfig(),t);this._config$.next(e)},Hn.prototype.setShadows=function(t){var e=I.merge(this.getConfig(),{shadows:t});this._config$.next(e)},Object.defineProperty(Hn.prototype,"rightnavState$",{get:function(){return this._rightnavState$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"rightnavState",{get:function(){return this._rightnavState$.getValue()},set:function(t){this._rightnavState$.next(t)},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"rightnavTitle$",{get:function(){return this._rightnavTitle$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"rightnavTitle",{get:function(){return this._rightnavTitle$.getValue()},set:function(t){this._rightnavTitle$.next(t)},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"rightnavShowBack$",{get:function(){return this._rightnavShowBack$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Hn.prototype,"rightnavShowBack",{get:function(){return this._rightnavShowBack$.getValue()},set:function(t){this._rightnavShowBack$.next(t)},enumerable:!0,configurable:!0}),Hn.prototype.showSendSignal=function(){this._showSendSignal.emit()},Object.defineProperty(Hn.prototype,"onSendSignal",{get:function(){return this._showSendSignal},enumerable:!0,configurable:!0}),Hn.decorators=[{type:v.Injectable}],Hn.ctorParameters=function(){return[{type:St}]},Hn);function Hn(t){this.iqsConfig=t,this._rightnavTitle$=new O.BehaviorSubject(null),this._rightnavShowBack$=new O.BehaviorSubject(!1),this._config$=new O.BehaviorSubject(this.iqsConfig.config.shell),this._rightnavState$=new O.BehaviorSubject(Gn.Help),this._showSendSignal=new v.EventEmitter}var Zn=(Yn.prototype.setDefaultTitle=function(){this.shell.rightnavTitle=this._defaultTitle},Yn.prototype.goBack=function(){switch(this.state){case qn.Details:this.state=qn.List}},Object.defineProperty(Yn.prototype,"state$",{get:function(){return this._state$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Yn.prototype,"state",{get:function(){return this._state$.getValue()},set:function(t){switch(this._state$.next(t),t){case qn.List:this.setDefaultTitle(),this.shell.rightnavShowBack=!1;break;case qn.Details:this.shell.rightnavTitle=this.currentPlan&&this.currentPlan.name?this.currentPlan.name:this._defaultTitle,this.shell.rightnavShowBack=!0}},enumerable:!0,configurable:!0}),Object.defineProperty(Yn.prototype,"currentPlan$",{get:function(){return this._currentPlan$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Yn.prototype,"currentPlan",{get:function(){return this._currentPlan$.getValue()},set:function(t){this._currentPlan$.next(t),this.state=t?qn.Details:qn.List},enumerable:!0,configurable:!0}),Yn.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Yn.ctorParameters=function(){return[{type:Bn}]},Yn.ngInjectableDef=v.defineInjectable({factory:function(){return new Yn(v.inject(Bn))},token:Yn,providedIn:"root"}),Yn);function Yn(t){this.shell=t,this._defaultTitle="EMERGENCY_PANEL_TITLE",this._state$=new O.BehaviorSubject(qn.List),this._currentPlan$=new O.BehaviorSubject(null)}var Vn,Wn=(z(Kn,Vn=x),Kn.prototype.handleError=function(t){return O.throwError(t)},Kn.prototype.readEmergencyPlans=function(t){return(t=t||{}).organization_id=t.organization_id?t.organization_id:this.organizationsService.current&&this.organizationsService.current.id,this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,t)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},Kn.prototype.readEmergencyPlan=function(t){var e={plan_id:t};return this.organizationsService.current&&(e.organization_id=this.organizationsService.current.id),this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.catchError(this.handleError))},Kn.prototype.createEmergencyPlan=function(t){var e={};return this.organizationsService.current&&(e.organization_id=this.organizationsService.current.id),this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,e),t).pipe(C.catchError(this.handleError))},Kn.prototype.updateEmergencyPlan=function(t,e){var n={plan_id:t};return this.organizationsService.current&&(n.organization_id=this.organizationsService.current.id),this.http.put(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,n),e).pipe(C.catchError(this.handleError))},Kn.prototype.deleteEmergencyPlan=function(t){var e={plan_id:t};return this.organizationsService.current&&(e.organization_id=this.organizationsService.current.id),this.http["delete"](this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.map(function(t){return t.id}),C.catchError(this.handleError))},Kn.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Kn.ctorParameters=function(){return[{type:h.HttpClient},{type:Tt},{type:On}]},Kn.ngInjectableDef=v.defineInjectable({factory:function(){return new Kn(v.inject(h.HttpClient),v.inject(Tt),v.inject(On))},token:Kn,providedIn:"root"}),Kn);function Kn(t,e,n){var r=Vn.call(this)||this;return r.http=t,r.sessionConfig=e,r.organizationsService=n,r.RESOURCE="/api/v1/organizations/:organization_id/emergency_plans",r.RESOURCE_SINGLE="/api/v1/organizations/:organization_id/emergency_plans/:plan_id",r}var Qn={EmergencyInit:"[Emergency] Init",EmergencySuccess:"[Emergency] Success",EmergencyFailure:"[Emergency] Failure",EmergencyCreateInit:"[Emergency] CreateInit",EmergencyCreateSuccess:"[Emergency] CreateSuccess",EmergencyCreateFailure:"[Emergency] CreateFailure",EmergencyUpdateInit:"[Emergency] UpdateInit",EmergencyUpdateSuccess:"[Emergency] UpdateSuccess",EmergencyUpdateFailure:"[Emergency] UpdateFailure",EmergencyDeleteInit:"[Emergency] DeleteInit",EmergencyDeleteSuccess:"[Emergency] DeleteSuccess",EmergencyDeleteFailure:"[Emergency] DeleteFailure"},Xn=function Fc(){this.type=Qn.EmergencyInit},tr=function qc(t){this.payload=t,this.type=Qn.EmergencySuccess},er=function Uc(t){this.payload=t,this.type=Qn.EmergencyFailure},nr=function Lc(t){this.payload=t,this.type=Qn.EmergencyCreateInit},rr=function Dc(t){this.payload=t,this.type=Qn.EmergencyCreateSuccess},ir=function Gc(t){this.payload=t,this.type=Qn.EmergencyCreateFailure},or=function Jc(t){this.payload=t,this.type=Qn.EmergencyUpdateInit},sr=function Bc(t){this.payload=t,this.type=Qn.EmergencyUpdateSuccess},ar=function Hc(t){this.payload=t,this.type=Qn.EmergencyUpdateFailure},cr=function Zc(t){this.payload=t,this.type=Qn.EmergencyDeleteInit},pr=function Yc(t){this.payload=t,this.type=Qn.EmergencyDeleteSuccess},lr=function Vc(t){this.payload=t,this.type=Qn.EmergencyDeleteFailure},ur=(hr.decorators=[{type:v.Injectable}],hr.ctorParameters=function(){return[{type:A.Actions},{type:Wn}]},j([A.Effect(),k("design:type",O.Observable)],hr.prototype,"read$",void 0),j([A.Effect(),k("design:type",O.Observable)],hr.prototype,"create$",void 0),j([A.Effect(),k("design:type",O.Observable)],hr.prototype,"update$",void 0),j([A.Effect(),k("design:type",O.Observable)],hr.prototype,"delete$",void 0),hr);function hr(t,e){var n=this;this.actions$=t,this.emergencyData=e,this.read$=this.actions$.pipe(A.ofType(Qn.EmergencyInit),C.switchMap(function(t){return n.emergencyData.readEmergencyPlans().pipe(C.map(function(t){return new tr({plans:t})}),C.catchError(function(t){return O.of(new er({error:t}))}))})),this.create$=this.actions$.pipe(A.ofType(Qn.EmergencyCreateInit),C.switchMap(function(t){return n.emergencyData.createEmergencyPlan(t.payload.plan).pipe(C.map(function(t){return new rr({plan:t})}),C.catchError(function(t){return O.of(new ir({error:t}))}))})),this.update$=this.actions$.pipe(A.ofType(Qn.EmergencyUpdateInit),C.switchMap(function(t){return n.emergencyData.updateEmergencyPlan(t.payload.plan.id,t.payload.plan).pipe(C.map(function(t){return new sr({plan:t})}),C.catchError(function(t){return O.of(new ar({error:t}))}))})),this.delete$=this.actions$.pipe(A.ofType(Qn.EmergencyDeleteInit),C.switchMap(function(t){return n.emergencyData.deleteEmergencyPlan(t.payload.planId).pipe(C.map(function(t){return new pr({planId:t})}),C.catchError(function(t){return O.of(new lr({error:t}))}))}))}var gr={plans:[],state:"empty",error:null};function fr(t,e){switch(void 0===t&&(t=gr),e.type){case Qn.EmergencyInit:return(i=(i=(i=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case Qn.EmergencySuccess:return(i=(i=(i=(i=w.fromJS(t)).set("plans",e.payload.plans)).set("state",e.payload.plans&&e.payload.plans.length?"data":"empty")).set("error",null)).toJS();case Qn.EmergencyFailure:return(i=(i=(i=w.fromJS(t)).set("state","error")).set("error",e.payload.error)).toJS();case Qn.EmergencyCreateInit:return(i=(i=(i=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case Qn.EmergencyCreateSuccess:return(n=(i=w.fromJS(t)).get("plans").toJS()).push(e.payload.plan),(i=(i=(i=i.set("plans",n)).set("state","data")).set("error",null)).toJS();case Qn.EmergencyCreateFailure:return(i=(i=(i=w.fromJS(t)).set("state","error")).set("error",e.payload.error)).toJS();case Qn.EmergencyUpdateInit:return(i=(i=(i=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case Qn.EmergencyUpdateSuccess:var n=(i=w.fromJS(t)).get("plans").toJS();return 0<=(r=I.findIndex(n,["id",e.payload.plan.id]))&&(n[r]=e.payload.plan),(i=(i=(i=i.set("plans",n)).set("state","data")).set("error",null)).toJS();case Qn.EmergencyUpdateFailure:return(i=(i=(i=w.fromJS(t)).set("state","error")).set("error",e.payload.error)).toJS();case Qn.EmergencyDeleteInit:return(i=(i=(i=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case Qn.EmergencyDeleteSuccess:var r;n=(i=w.fromJS(t)).get("plans").toJS();return 0<=(r=I.findIndex(n,["id",e.payload.planId]))&&n.splice(r,1),(i=(i=(i=i.set("plans",n)).set("state",n.length?"data":"empty")).set("error",null)).toJS();case Qn.EmergencyDeleteFailure:var i;return(i=(i=(i=w.fromJS(t)).set("state","error")).set("error",e.payload.error)).toJS();default:return t}}var dr=_.createFeatureSelector("emergency_plans"),mr=_.createSelector(dr,function(t){return t.plans}),yr=_.createSelector(dr,function(t){return t.state}),Sr=_.createSelector(dr,function(t){return t.error}),br=(vr.prototype.init=function(){var e=this;vr.epUpdateSub||(this.organizationsService.init(),vr.epUpdateSub=this.organizationsService.current$.pipe(C.filter(function(t){return null!==t}),C.distinctUntilKeyChanged("id")).subscribe(function(t){e.store.dispatch(new Xn)}))},Object.defineProperty(vr.prototype,"plans$",{get:function(){return this.store.select(mr)},enumerable:!0,configurable:!0}),Object.defineProperty(vr.prototype,"state$",{get:function(){return this.store.select(yr)},enumerable:!0,configurable:!0}),Object.defineProperty(vr.prototype,"error$",{get:function(){return this.store.select(Sr)},enumerable:!0,configurable:!0}),vr.epUpdateSub=null,vr.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],vr.ctorParameters=function(){return[{type:_.Store},{type:On}]},vr.ngInjectableDef=v.defineInjectable({factory:function(){return new vr(v.inject(_.Store),v.inject(On))},token:vr,providedIn:"root"}),vr);function vr(t,e){this.store=t,this.organizationsService=e}var Er={EMERGENCY_COMPLETE:"Complete actions",EP_ACTION_PAGE_MAP:"Map",EP_ACTION_PAGE_OBJECT:"Find objects on the map",EP_ACTION_PAGE_LAST_EVENTS:"Last events",EP_ACTION_PAGE_PEOPLE:"Find people on the map",EP_ACTION_PAGE_SEND_SIGNALS:"Send signal",OBJECT_CATEGORY_PERSON:"Person",OBJECT_CATEGORY_EQUIPMENT:"Equipment"},Or={EMERGENCY_COMPLETE:"Завершить действия",EP_ACTION_PAGE_MAP:"Карта",EP_ACTION_PAGE_OBJECT:"Найти объекты на карте",EP_ACTION_PAGE_LAST_EVENTS:"Последние события",EP_ACTION_PAGE_PEOPLE:"Найти людей на карте",EP_ACTION_PAGE_SEND_SIGNALS:"Послать сигнал",OBJECT_CATEGORY_PERSON:"люди",OBJECT_CATEGORY_EQUIPMENT:"машины"},Cr=(Object.defineProperty(Ir.prototype,"plan",{set:function(t){this._plan=I.cloneDeep(t),this._stepComplete$.next(0)},enumerable:!0,configurable:!0}),Ir.prototype.getPlan=function(){return this._plan},Ir.prototype.onLocalLinkClick=function(t){var i=this,e=I.find(this._stepActions,["id",t.params.page]);if(e&&e.uri){var n="";e.params&&(n+="?",e.params.asIs&&(n+=Object.entries(e.params.asIs).map(function(t){var e=$(t,2);return e[0]+"="+e[1]}).join("&")),e.params.translate&&(1<n.length&&(n+="&"),n+=Object.entries(e.params.translate).map(function(t){var e=$(t,2),n=e[0],r=e[1];return n+"="+i.translate.instant(r)}).join("&"))),this.window.location.href=this.window.location.origin+e.uri+n}else e&&"ep_action_page_signals"===e.id&&this.shell.showSendSignal()},Ir.prototype.onToggleStep=function(t){t.checked=!t.checked,t.checked?this._stepComplete$.next(this._stepComplete$.getValue()+1):this._stepComplete$.next(this._stepComplete$.getValue()-1)},Ir.prototype.onFinish=function(){this.emergencyPanelService.currentPlan=null},Ir.decorators=[{type:v.Component,args:[{selector:"iqs-emergency-plan",template:'<mat-list class="iqs-emergency-plan-list">\r\n    <mat-list-item class="iqs-emergency-step" [ngClass]="{\'iqs-emergency-step-complete\': step?.checked}" *ngFor="let step of getPlan().steps">\r\n        <div fxLayout="row">\r\n            <div class="iqs-emergency-plan-counter" (click)="onToggleStep(step)"></div>\r\n            <div fxFlex="grow">\r\n                <div (click)="onToggleStep(step)">{{ step?.name }}</div>\r\n                \x3c!-- actions --\x3e\r\n                <ng-container *ngIf="step?.actions && step?.actions.length > 0">\r\n                    <div class="iqs-emergency-plan-action" *ngFor="let action of step?.actions">\r\n                        \x3c!-- note --\x3e\r\n                        <ng-container *ngIf="action?.type === \'note\'">\r\n                            {{ action?.params[\'text\'] }}\r\n                        </ng-container>\r\n                        \x3c!-- call phone --\x3e\r\n                        <ng-container *ngIf="action?.type === \'call phone\'">\r\n                            {{ action.params[\'phone\'] }}\r\n                        </ng-container>\r\n                        \x3c!-- local link --\x3e\r\n                        <ng-container *ngIf="action?.type === \'local link\'">\r\n                            <button *ngIf="action?.params[\'pageTitle\']" mat-button color="primary" (click)="onLocalLinkClick(action)">\r\n                                {{ action?.params[\'pageTitle\'] | translate }}\r\n                            </button>\r\n                            <div *ngIf="action?.params[\'text\']">\r\n                                {{ action.params[\'text\'] }}\r\n                            </div>\r\n                        </ng-container>\r\n                        \x3c!-- global link --\x3e\r\n                        <ng-container *ngIf="action?.type === \'global link\' && action?.params[\'uri\']">\r\n                            <a [href]="action?.params[\'uri\']" mat-button color="primary" target="_blank">\r\n                                {{ action?.params[\'uri\'] }}\r\n                            </a>\r\n                        </ng-container>\r\n                    </div>\r\n                </ng-container>\r\n            </div>\r\n        </div>\r\n    </mat-list-item>\r\n</mat-list>\r\n<div class="iqs-emergency-plan-actions">\r\n    <button mat-flat-button *ngIf="isComplete$ | async" color="primary" (click)="onFinish()">\r\n        {{ \'EMERGENCY_COMPLETE\' | translate }}\r\n    </button>\r\n</div>',styles:[".iqs-emergency-plan-list{counter-reset:emergency}.iqs-emergency-plan-list mat-list-item.iqs-emergency-step{display:flex;counter-increment:emergency;min-height:48px;height:auto;cursor:pointer}.iqs-emergency-plan-list mat-list-item.iqs-emergency-step .iqs-emergency-plan-action button+div,.iqs-emergency-plan-list mat-list-item.iqs-emergency-step .iqs-emergency-plan-action:not(:last-child),.iqs-emergency-plan-list mat-list-item.iqs-emergency-step:not(:first-of-type){margin-top:8px}.iqs-emergency-plan-list mat-list-item.iqs-emergency-step .iqs-emergency-plan-counter{margin-right:8px;width:24px;height:24px;line-height:24px;text-align:center;border-radius:50%;min-width:24px}.iqs-emergency-plan-list mat-list-item.iqs-emergency-step .iqs-emergency-plan-counter::before{content:counter(emergency)}.iqs-emergency-plan-actions{text-align:center;margin-top:8px}button[mat-button]{text-transform:uppercase}.bootbarn-cool-theme :host .iqs-emergency-plan-counter{background-color:#455a64;color:#fff}.bootbarn-cool-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.bootbarn-cool-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.bootbarn-mono-theme :host .iqs-emergency-plan-counter{background-color:#263238;color:#fff}.bootbarn-mono-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.bootbarn-mono-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.bootbarn-warm-theme :host .iqs-emergency-plan-counter{background-color:#b13722;color:#fff}.bootbarn-warm-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.bootbarn-warm-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-amber-theme :host .iqs-emergency-plan-counter{background-color:#ff9800;color:#fff}.pip-amber-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-amber-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-black-theme :host .iqs-emergency-plan-counter{background-color:#263238;color:#fff}.pip-black-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-black-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(255,255,255,.12);color:rgba(255,255,255,.5)}.pip-blue-theme :host .iqs-emergency-plan-counter{background-color:#2196f3;color:#fff}.pip-blue-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-blue-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.candy-theme :host .iqs-emergency-plan-counter{background-color:#3f51b5;color:#fff}.candy-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.candy-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-dark-theme :host .iqs-emergency-plan-counter{background-color:#212121;color:#fff}.pip-dark-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-dark-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(255,255,255,.12);color:rgba(255,255,255,.5)}.pip-green-theme :host .iqs-emergency-plan-counter{background-color:#4caf50;color:#fff}.pip-green-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-green-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-grey-theme :host .iqs-emergency-plan-counter{background-color:#607d8b;color:#fff}.pip-grey-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-grey-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-navy-theme :host .iqs-emergency-plan-counter{background-color:#56617d;color:#fff}.pip-navy-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-navy-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-orange-theme :host .iqs-emergency-plan-counter{background-color:#ff7043;color:#fff}.pip-orange-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-orange-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.pip-pink-theme :host .iqs-emergency-plan-counter{background-color:#bc5679;color:#fff}.pip-pink-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.pip-pink-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.unicorn-dark-theme :host .iqs-emergency-plan-counter{background-color:#607d8b;color:#fff}.unicorn-dark-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.unicorn-dark-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(255,255,255,.12);color:rgba(255,255,255,.5)}.mst-black-theme :host .iqs-emergency-plan-counter{background-color:#1e1e1e;color:#fff}.mst-black-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.mst-black-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.mst-black-dark-theme :host .iqs-emergency-plan-counter{background-color:#1e1e1e;color:#fff}.mst-black-dark-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.mst-black-dark-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(255,255,255,.12);color:rgba(255,255,255,.5)}.mst-mono-theme :host .iqs-emergency-plan-counter{background-color:#1e1e1e;color:#fff}.mst-mono-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.mst-mono-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.mst-orange-theme :host .iqs-emergency-plan-counter{background-color:#e17100;color:#fff}.mst-orange-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.mst-orange-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(0,0,0,.12);color:rgba(0,0,0,.38)}.mst-orange-dark-theme :host .iqs-emergency-plan-counter{background-color:#e17100;color:#fff}.mst-orange-dark-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.mst-orange-dark-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(255,255,255,.12);color:rgba(255,255,255,.5)}.mst-elegant-theme :host .iqs-emergency-plan-counter{background-color:#007681;color:#fff}.mst-elegant-theme :host .iqs-emergency-step-complete{text-decoration:line-through}.mst-elegant-theme :host .iqs-emergency-step-complete .iqs-emergency-plan-counter{background-color:rgba(250,250,250,.12);color:rgba(255,255,255,.5)}"]}]}],Ir.ctorParameters=function(){return[{type:Zn},{type:Bn},{type:g.TranslateService},{type:Z,decorators:[{type:v.Inject,args:[U]}]}]},Ir.propDecorators={plan:[{type:v.Input}]},Ir);function Ir(t,e,n,r){var i=this;this.emergencyPanelService=t,this.shell=e,this.translate=n,this.window=r,this._stepActions=[{id:"ep_action_page_map",title:"EP_ACTION_PAGE_MAP",uri:"/monitoring/index.html#/app/map"},{id:"ep_action_page_map_people",title:"EP_ACTION_PAGE_PEOPLE",uri:"/monitoring/index.html#/app/objects",params:{translate:{type:"OBJECT_CATEGORY_PERSON"}}},{id:"ep_action_page_map_object",title:"EP_ACTION_PAGE_OBJECT",uri:"/monitoring/index.html#/app/objects",params:{translate:{type:"OBJECT_CATEGORY_EQUIPMENT"}}},{id:"ep_action_page_events",title:"EP_ACTION_PAGE_LAST_EVENTS",uri:"/monitoring/index.html#/app/map/events"},{id:"ep_action_page_signals",title:"EP_ACTION_PAGE_SEND_SIGNALS"}],this._stepComplete$=new O.BehaviorSubject(0),this.isComplete$=this._stepComplete$.pipe(C.map(function(t){return i._plan&&i._plan.steps&&Array.isArray(i._plan.steps)&&t===i._plan.steps.length})),this.translate.setTranslation("ru",Or,!0),this.translate.setTranslation("en",Er,!0)}var _r=(Ar.decorators=[{type:v.NgModule,args:[{declarations:[Cr],exports:[Cr],imports:[E.CommonModule,p.FlexLayoutModule,c.MatButtonModule,c.MatIconModule,c.MatListModule,g.TranslateModule]}]}],Ar);function Ar(){}var wr=(Nr.decorators=[{type:v.NgModule,args:[{imports:[_r],exports:[_r]}]}],Nr);function Nr(){}var zr={EMERGENCY_PANEL_TITLE:"Emergency response",EMERGENCY_EMPTY:"There's no emergency plans",EMERGENCY_SETTINGS:"Setting emergency plans"},Tr={EMERGENCY_PANEL_TITLE:"Действия при ЧС",EMERGENCY_EMPTY:"Планы действий отсутствуют",EMERGENCY_SETTINGS:"Настройки планов ЧС"},jr=(kr.prototype.ngOnDestroy=function(){this.subs.unsubscribe()},kr.prototype.selectPlan=function(t){this.emergencyPanelService.currentPlan=t},kr.decorators=[{type:v.Component,args:[{selector:"iqs-emergency-panel",template:'<ng-container [ngSwitch]="state$ | async">\r\n    <pip-empty-state *ngSwitchCase="\'empty\'">\r\n        <pip-empty-state-title [text]="\'EMERGENCY_EMPTY\' | translate" imageUrl="./assets/empty.svg"></pip-empty-state-title>\r\n    </pip-empty-state>\r\n    <pip-empty-state *ngSwitchCase="\'progress\'">\r\n        <div class="loader"> <img src="./assets/pre-loading.svg"> </div>\r\n    </pip-empty-state>\r\n    <ng-container *ngSwitchCase="\'data\'">\r\n        <ng-container [ngSwitch]="panelState$ | async">\r\n            <ng-container *ngSwitchCase="\'List\'">\r\n                <pip-scrollable fxFlex="grow">\r\n                    <mat-nav-list fxFlex="grow">\r\n                        <ng-container *ngFor="let plan of plans$ | async">\r\n                            <mat-list-item (click)="selectPlan(plan)">\r\n                                <h2 matLine>{{ plan.name }}</h2>\r\n                                <mat-icon matSuffix>chevron_right</mat-icon>\r\n                            </mat-list-item>\r\n                            <mat-divider></mat-divider>\r\n                        </ng-container>\r\n                    </mat-nav-list>\r\n                </pip-scrollable>\r\n                <mat-nav-list>\r\n                    <mat-list-item class="iqs-emergency-settings-item">\r\n                        <span matLine>{{ \'EMERGENCY_SETTINGS\' | translate }}</span>\r\n                        <mat-icon matSuffix>chevron_right</mat-icon>\r\n                    </mat-list-item>\r\n                </mat-nav-list>\r\n            </ng-container>\r\n            <div *ngSwitchCase="\'Details\'" fxFlex="grow" fxLayout="column">\r\n                <ng-container *ngIf="currentPlan$ | async as plan">\r\n                    <iqs-emergency-plan [plan]="currentPlan$ | async"></iqs-emergency-plan>\r\n                </ng-container>\r\n            </div>\r\n        </ng-container>\r\n    </ng-container>\r\n</ng-container>',styles:[":host{display:flex;flex-direction:column;flex:1 1 100%}:host pip-scrollable{overflow-y:auto}.bootbarn-cool-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.bootbarn-mono-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.bootbarn-warm-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-amber-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-black-theme :host .iqs-emergency-settings-item{background-color:#212121}.pip-blue-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.candy-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-dark-theme :host .iqs-emergency-settings-item{background-color:#212121}.pip-green-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-grey-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-navy-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-orange-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.pip-pink-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.unicorn-dark-theme :host .iqs-emergency-settings-item{background-color:#212121}.mst-black-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.mst-black-dark-theme :host .iqs-emergency-settings-item{background-color:#212121}.mst-mono-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.mst-orange-theme :host .iqs-emergency-settings-item{background-color:#e0e0e0}.mst-orange-dark-theme :host .iqs-emergency-settings-item{background-color:#212121}.mst-elegant-theme :host .iqs-emergency-settings-item{background-color:#606274}"]}]}],kr.ctorParameters=function(){return[{type:g.TranslateService},{type:br},{type:Zn}]},kr);function kr(t,e,n){this.translate=t,this.emergencyService=e,this.emergencyPanelService=n,this.subs=new O.Subscription,this.currentPlan$=this.emergencyPanelService.currentPlan$,this.panelState$=this.emergencyPanelService.state$,this.emergencyPanelService.currentPlan=null,this.plans$=this.emergencyService.plans$,this.state$=this.emergencyService.state$,this.translate.setTranslation("ru",Tr,!0),this.translate.setTranslation("en",zr,!0),this.emergencyPanelService.state=qn.List}var Pr=($r.decorators=[{type:v.NgModule,args:[{declarations:[jr],exports:[jr],imports:[E.CommonModule,p.FlexLayoutModule,c.MatButtonModule,c.MatIconModule,c.MatInputModule,c.MatListModule,g.TranslateModule,i.PipEmptyStateModule,m.PipScrollableModule,_r]}]}],$r);function $r(){}var Rr=(xr.decorators=[{type:v.NgModule,args:[{imports:[Pr],exports:[Pr]}]}],xr);function xr(){}var Mr=(Fr.forRoot=function(){return{ngModule:Fr,providers:[Zn]}},Fr.decorators=[{type:v.NgModule,args:[{imports:[wr,Rr,_.StoreModule.forFeature("emergency_plans",fr),A.EffectsModule.forFeature([ur])],exports:[wr,Rr],providers:[Wn,br]}]}],Fr);function Fr(){}var qr=function Wc(){},Ur={Topics:"Topics",Search:"Search",Articles:"Articles",Article:"Article"},Lr=function Kc(){},Dr=(Gr.prototype.onSelect=function(t){this.select.emit(t)},Gr.decorators=[{type:v.Component,args:[{selector:"iqs-help-list",template:'<mat-nav-list>\r\n    <mat-list-item *ngFor="let item of items" (click)="onSelect(item)">\r\n        <div fxFlex fxLayoutAlign="space-between center">\r\n            <div fxFlex="grow">{{ item.title[language] }}</div>\r\n            <mat-icon>chevron_right</mat-icon>\r\n        </div>\r\n    </mat-list-item>\r\n</mat-nav-list>',styles:[".bootbarn-cool-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.bootbarn-mono-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.bootbarn-warm-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-amber-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-black-theme :host mat-list-item{border-bottom:1px solid rgba(255,255,255,.12)}.pip-blue-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.candy-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-dark-theme :host mat-list-item{border-bottom:1px solid rgba(255,255,255,.12)}.pip-green-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-grey-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-navy-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-orange-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.pip-pink-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.unicorn-dark-theme :host mat-list-item{border-bottom:1px solid rgba(255,255,255,.12)}.mst-black-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.mst-black-dark-theme :host mat-list-item{border-bottom:1px solid rgba(255,255,255,.12)}.mst-mono-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.mst-orange-theme :host mat-list-item{border-bottom:1px solid rgba(0,0,0,.12)}.mst-orange-dark-theme :host mat-list-item{border-bottom:1px solid rgba(255,255,255,.12)}.mst-elegant-theme :host mat-list-item{border-bottom:1px solid rgba(255,255,255,.12)}"]}]}],Gr.ctorParameters=function(){return[]},Gr.propDecorators={items:[{type:v.Input}],language:[{type:v.Input}],select:[{type:v.Output}]},Gr);function Gr(){this.select=new v.EventEmitter}var Jr=(Br.decorators=[{type:v.NgModule,args:[{declarations:[Dr],exports:[Dr],imports:[E.CommonModule,p.FlexLayoutModule,c.MatIconModule,c.MatListModule]}]}],Br);function Br(){}var Hr=(Zr.decorators=[{type:v.NgModule,args:[{imports:[Jr],exports:[Jr]}]}],Zr);function Zr(){}var Yr={HELP_PANEL_TITLE:"Help",HELP_PANEL_TITLE_SEARCH:"Search help",HELP_PANEL_NOT_FOUND:"Articles not found, try another expression",SEARCH_PLACEHOLDER:"Search"},Vr={HELP_PANEL_TITLE:"Справка",HELP_PANEL_TITLE_SEARCH:"Поиск по справке",HELP_PANEL_NOT_FOUND:"По данному запросу ничего не найдено",SEARCH_PLACEHOLDER:"Поиск"},Wr=(Kr.prototype.setDefaultTitle=function(){this.shell.rightnavTitle=this._defaultTitle},Kr.prototype.setSearchTitle=function(){this.shell.rightnavTitle=this._searchTitle},Kr.prototype.goBack=function(){switch(this.state){case Ur.Article:null===this.currentTopic?this.state=Ur.Search:this.currentArticle=null;break;case Ur.Articles:this.currentTopic=null;break;case Ur.Search:this.state=Ur.Topics}},Object.defineProperty(Kr.prototype,"state$",{get:function(){return this._state$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Kr.prototype,"state",{get:function(){return this._state$.getValue()},set:function(t){switch(this._state$.next(t),t){case Ur.Topics:this.setDefaultTitle(),this.shell.rightnavShowBack=!1;break;case Ur.Articles:this.shell.rightnavTitle=this.currentTopic?this.currentTopic.title[this.translate.currentLang]:this._defaultTitle,this.shell.rightnavShowBack=!0;break;case Ur.Article:this.shell.rightnavTitle=this.currentArticle?this.currentArticle.title[this.translate.currentLang]:this._defaultTitle,this.shell.rightnavShowBack=!0;break;case Ur.Search:this.shell.rightnavTitle=this._searchTitle,this.shell.rightnavShowBack=!0}},enumerable:!0,configurable:!0}),Object.defineProperty(Kr.prototype,"currentTopic$",{get:function(){return this._currentTopic$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Kr.prototype,"currentTopic",{get:function(){return this._currentTopic$.getValue()},set:function(t){this._currentTopic$.next(t),this._currentArticle$.next(null),this.state=t?Ur.Articles:Ur.Topics},enumerable:!0,configurable:!0}),Object.defineProperty(Kr.prototype,"currentArticle$",{get:function(){return this._currentArticle$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(Kr.prototype,"currentArticle",{get:function(){return this._currentArticle$.getValue()},set:function(t){this._currentArticle$.next(t),this.state=t?Ur.Article:Ur.Articles},enumerable:!0,configurable:!0}),Kr.decorators=[{type:v.Injectable}],Kr.ctorParameters=function(){return[{type:Bn},{type:g.TranslateService}]},Kr);function Kr(t,e){this.shell=t,this.translate=e,this._defaultTitle="HELP_PANEL_TITLE",this._searchTitle="HELP_PANEL_TITLE_SEARCH",this._state$=new O.BehaviorSubject(Ur.Topics),this._currentTopic$=new O.BehaviorSubject(null),this._currentArticle$=new O.BehaviorSubject(null)}var Qr=(Xr.prototype.ngOnDestroy=function(){this.subs.unsubscribe()},Xr.prototype.selectTopic=function(t){this.helpPanelService.currentTopic=t},Xr.prototype.selectArticle=function(t){this.helpPanelService.currentArticle=t},Xr.decorators=[{type:v.Component,args:[{selector:"iqs-help-panel",template:'<pip-search-input *ngIf="(helpPanelService.state$ | async) === \'Topics\' || (helpPanelService.state$ | async) === \'Search\'">\r\n    <mat-form-field class="search-field" floatLabel="never" appearance="fill">\r\n        <mat-icon matPrefix fontIcon="webui-search"></mat-icon>\r\n        <input matInput placeholder="{{ \'SEARCH_PLACEHOLDER\' | translate }}" name="search" [formControl]="searchControl">\r\n    </mat-form-field>\r\n</pip-search-input>\r\n<pip-scrollable>\r\n    <pip-scrollable-content [ngSwitch]="helpPanelService.state$ | async">\r\n        <ng-container *ngSwitchCase="\'Search\'">\r\n            <div class="iqs-help-panel-article" *ngIf="!filteredArticles || !filteredArticles?.length">\r\n                {{ \'HELP_PANEL_NOT_FOUND\' | translate }}\r\n            </div>\r\n            <iqs-help-list *ngIf="filteredArticles && filteredArticles.length" [language]="language" [items]="filteredArticles" (select)="selectArticle($event)"></iqs-help-list>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase="\'Topics\'">\r\n            <iqs-help-list [items]="topics" [language]="language" (select)="selectTopic($event)"></iqs-help-list>\r\n        </ng-container>\r\n        <ng-container *ngSwitchCase="\'Articles\'">\r\n            <iqs-help-list [items]="helpPanelService.currentTopic.articles" [language]="language" (select)="selectArticle($event)"></iqs-help-list>\r\n        </ng-container>\r\n        <div class="iqs-help-panel-article" *ngSwitchCase="\'Article\'" [innerHtml]="helpPanelService.currentArticle.content[language]">\r\n        </div>\r\n    </pip-scrollable-content>\r\n</pip-scrollable>',styles:[":host{display:flex;flex-direction:column;flex:1 1 100%;font-family:Roboto,'Helvetica Neue',sans-serif}:host pip-search-input{min-height:40px;width:auto;margin:0 12px}:host pip-search-input mat-form-field{max-width:100%;width:100%}:host pip-search-input mat-form-field /deep/ .mat-form-field-wrapper{height:40px}:host pip-search-input mat-form-field /deep/ .mat-form-field-wrapper .mat-form-field-flex{border-radius:40px;font-size:14px;line-height:14px}:host .iqs-help-panel-article{padding:12px}"]}]}],Xr.ctorParameters=function(){return[{type:n.DomSanitizer},{type:g.TranslateService},{type:Wr}]},Xr.propDecorators={language:[{type:v.Input}]},Xr);function Xr(t,e,n){var f=this;for(var r in this.sanitizer=t,this.translate=e,this.helpPanelService=n,this.subs=new O.Subscription,this.topics=[{title:{ru:"Наблюдение",en:"Monitoring"},articles:[{title:{ru:"Общие сведения",en:"Common information"},content:{ru:'<iframe width="278" height="156" frameborder="0" allowfullscreen src="https://www.youtube.com/embed/Uu1WW0v8LGo?rel=0" style="margin: 0 auto;"></iframe>\n                        <p>При входе в систему, после того как мы ввели свой логин и пароль, мы видим первый экран: карту предприятия с объектами на ней, панель инструментов слева и панель происшествий cправа.</p>\n                        <p>На панели инструментов системы мы видим 7 разделов, "Наблюдение" активный по умолчанию.</p>\n                        <p>Главным элементом этого экрана служит карта. она занимает центральное место, на ней м мы видим точки объектов и геозоны разной конфигурации. В углах карты расположены вспомогательные инструменты.</p>\n                        ',en:'<iframe width="278" height="156" frameborder="0" allowfullscreen src="https://www.youtube.com/embed/hSVQOt2ooRk?rel=0" style="margin: 0 auto;"></iframe>\n                        <p>After successfully logging into the system, the first thing you will see is the screen with the map in the middle, the Tools Panel on the left side, and the Incident Panel on the right side. Looking at the Tools Panel, we see 7 tools, and one of them, Monitoring, is currently active.</p>\n                        <p>In Monitoring, we see the map of the work organization, objects and zones on the map. In the corners are additional instruments: a search box, object panel, fab tool, and zoom buttons.</p>\n                        <p>Using these buttons we can zoom in and out of the map.</p>\n                        <p>Map controls here are the same as in other online map applications, and gestures are supported on touch screen devices.</p>\n                        <p>You can have several locations defined on your map and quickly move between them using the Locations tool. Click \'Locations\' in the Fab tool, and select a location and see the map move to it.</p>\n                        '}}]},{title:{ru:"Объекты на карте",en:"Objects"},articles:[{title:{ru:"Общие сведения",en:"Common information"},content:{ru:'<iframe width="278" height="156" frameborder="0" allowfullscreen src="https://www.youtube.com/embed/AYnGtY-mlgI?rel=0" style="margin: 0 auto;"></iframe>\n                        <p>На карте отображаются 3 типа объектов: машины, люди и механизмы. Они отображаются квадратами, треугольниками и кружочками, а при уменьшении массштаба, в виде иконок машин, людей и механизмов.</p>\n                        <p>Клик на иконке объекта, позволяет выделить его. Для выделенного объекта отображается путь его движения в виде узловых точек, соединенных ломаной линией. Клик на уже выделенном объекте, переводит его в состояние автоматического слежения. Выделенный объект всегда будет отображатся посредине карты.</p>\n                        <p>Для отмены режима слежения, можно выбрать другой объект, или просто кликнуть мышкой в любой свободной точке карты.</p>\n                        ',en:'<iframe width="278" height="156" frameborder="0" allowfullscreen src="https://www.youtube.com/embed/IFgHpNiYD9Y?rel=0" style="margin: 0 auto;"></iframe>\n                        <p>Currently on the map we see three types of objects: people, vehicles and assets. When zoomed out, we see them as small triangles, squares, and circles. When we zoom in, these icons become more informative. Their icons become more distinct and below each icon we now see the objects’ names and descriptions.</p>\n                        <p>We can select an object by clicking on its icon. The object becomes highlighted and there appears a \'trace\' of dots behind it. The trace shows where the object has been in the near past. The trace follows the object as it move.</p>\n                        <p>To avoid highlighted objects from moving out of our view, we can use the system’s Autofocus mode. If you click the selected object once more, the object’s icon will change again and the map will center on the object and move automatically as the object moves. This can come in handy when you need to monitor an object over a long period of time. To cancel autofocus, simple click on outside of the object.</p>\n                        '}}]},{title:{ru:"Панель Объектов",en:"Object Tool"},articles:[{title:{ru:"Общие сведения",en:"Common information"},content:{ru:"<p>Панель объектов находится в левом нижнем углу карты. Верхний ряд цифр на панели показывает количество людей, машин и механизмов, которые отслеживаются в текущий момент. Красные цифры в нижнем ряду, обозначают количество объектов, которые должны быть на карте (по расписанию), но их по каким-то причинам сейчас нет.</p>\n                        <p>Посмотреть список нужных нам объектов и их свойства можно кликнув на соответствующую иконку (человека, машины или механизма) на панели объектов.</p>\n                        <p>Для каждого объекта, мы можем посмотреть его свойства, текуще местоположение на карте, координаты и статус.</p>\n                        ",en:"<p>Lets use the Object Tool located at the lower left of the screen to have a closer look at our objects.</p>\n                        <p>Here we see how many people, vehicles and assets we’re currently tracking. The red numbers below tell us how many objects need to be there, (by the shift roster, we'll talk about it later) but there's no current data from them on the server. Zeros means all good.</p>\n                        <p>If we click on the human icon, we will see all the people there. For every person, we can see the Category, Type, Groups it belongs to, hours online (or offline), which tracking device is associated with him or her.</p>\n                        <p>We can also see the person’s position on the map right from this tool, and this is real-time picture, it will move with object movements. We can switch to a different person and see their movements from here.</p>\n                        <p>We can go back to Monitoring tool by clicking the link in the Tools Panel.</p>\n                        <p>If we now click on the vehicle icon in the Object Tool, we will again go to the list, but now there will be only vehicles. Each of them also has a Category and Type, and we can see which groups they belong to. We can also monitor their movements from here, and monitor different equipment from the same place.</p>\n                        <p>Here we can see Events and Incidents involving our vehicles. We will talk about Events and Incidents in a separate topic later.</p>\n                        <p>And finally, we can we current status of this object: it’s coordinates, speed, direction, and so on.</p>\n                        "}}]},{title:{ru:"Правила для событий и зоны",en:"Event rules and zones"},articles:[{title:{ru:"Общие сведения",en:"Common information"},content:{ru:'<iframe width="278" height="156" frameborder="0" allowfullscreen src="https://www.youtube.com/embed/xA2DoLQSarI?rel=0" style="margin: 0 auto;"></iframe>',en:'<iframe width="278" height="156" frameborder="0" allowfullscreen src="https://www.youtube.com/embed/xA2DoLQSarI?rel=0" style="margin: 0 auto;"></iframe>'}}]}],this.searchControl=new a.FormControl,this.translate.setTranslation("ru",Vr,!0),this.translate.setTranslation("en",Yr,!0),this.topics)if(this.topics[r])for(var i in this.topics[r].articles)this.topics[r].articles[i]&&(this.topics[r].articles[i].content.en=this.sanitizer.bypassSecurityTrustHtml(this.topics[r].articles[i].content.en),this.topics[r].articles[i].content.ru=this.sanitizer.bypassSecurityTrustHtml(this.topics[r].articles[i].content.ru));this.subs.add(this.helpPanelService.state$.subscribe(function(t){t!==Ur.Search&&f.searchControl.setValue("")})),this.helpPanelService.currentTopic=null,this.helpPanelService.state=Ur.Topics,this.subs.add(this.searchControl.valueChanges.pipe(C.debounceTime(200),C.distinctUntilChanged()).subscribe(function(t){var e,n,r,i;if(t&&f.helpPanelService.state!==Ur.Search?f.helpPanelService.state=Ur.Search:t||f.helpPanelService.state!==Ur.Search||(f.helpPanelService.state=Ur.Topics),t){var o=[];try{for(var s=P(f.topics),a=s.next();!a.done;a=s.next()){var c=a.value;try{for(var p=P(c.articles),l=p.next();!l.done;l=p.next()){var u=l.value;u.content[f.language].changingThisBreaksApplicationSecurity.match(t)&&o.push(u)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=p["return"])&&i.call(p)}finally{if(r)throw r.error}}}}catch(g){e={error:g}}finally{try{a&&!a.done&&(n=s["return"])&&n.call(s)}finally{if(e)throw e.error}}f.filteredArticles=o}else f.filteredArticles=[]}))}var ti=(ei.decorators=[{type:v.NgModule,args:[{declarations:[Qr],exports:[Qr],imports:[E.CommonModule,a.ReactiveFormsModule,c.MatIconModule,c.MatInputModule,g.TranslateModule,m.PipScrollableModule,i.PipSearchInputModule,Jr]}]}],ei);function ei(){}var ni=(ri.decorators=[{type:v.NgModule,args:[{imports:[ti],exports:[ti]}]}],ri);function ri(){}var ii=(oi.forRoot=function(){return{ngModule:oi,providers:[Wr]}},oi.decorators=[{type:v.NgModule,args:[{imports:[Hr,ni],exports:[Hr,ni]}]}],oi);function oi(){}var si=function Qc(){},ai={Notifications:"Notifications",Details:"Details"},ci=(pi.prototype.setDefaultTitle=function(){this.shell.rightnavTitle=this._defaultTitle},pi.prototype.goBack=function(){switch(this.state){case ai.Details:this.state=ai.Notifications}},Object.defineProperty(pi.prototype,"state$",{get:function(){return this._state$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"state",{get:function(){return this._state$.getValue()},set:function(t){switch(this._state$.next(t),t){case ai.Notifications:this.setDefaultTitle(),this.shell.rightnavShowBack=!1;break;case ai.Details:this.shell.rightnavTitle=this.currentNotification?this.currentNotification.label:this._defaultTitle,this.shell.rightnavShowBack=!0}},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"currentNotification$",{get:function(){return this._currentNotification$.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"currentNotification",{get:function(){return this._currentNotification$.getValue()},set:function(t){this._currentNotification$.next(t),this.state=t?ai.Details:ai.Notifications},enumerable:!0,configurable:!0}),pi.decorators=[{type:v.Injectable}],pi.ctorParameters=function(){return[{type:Bn}]},pi);function pi(t){this.shell=t,this._defaultTitle="NOTIFICATIONS_PANEL_TITLE",this._state$=new O.BehaviorSubject(ai.Notifications),this._currentNotification$=new O.BehaviorSubject(null)}var li=(ui.prototype.handleError=function(t){return O.throwError(t)},ui.prototype.readNotificationsCount=function(){var t=this.sessionConfig.serverUrl+this.RESOURCE_COUNT;return this.http.get(t).pipe(C.catchError(this.handleError))},ui.prototype.readNotifications=function(){var t=this.sessionConfig.serverUrl+this.RESOURCE;return this.http.get(t).pipe(C.catchError(this.handleError))},ui.decorators=[{type:v.Injectable}],ui.ctorParameters=function(){return[{type:h.HttpClient},{type:Tt}]},ui);function ui(t,e){this.http=t,this.sessionConfig=e,this.RESOURCE="/api/v1/notifications",this.RESOURCE_COUNT="/api/v1/notifications/count"}var hi={NotificationsInit:"[Notification] Init",NotificationsAbort:"[Notification] Abort",NotificationsSuccess:"[Notification] Success",NotificationsFailure:"[Notification] Failure",NotificationsEmpty:"[Notification] Empty",NotificationsData:"[Notification] Data",NotificationsCountInit:"[Notifications] CountInit",NotificationsCountAbort:"[Notifications] CountAbort",NotificationsCountSuccess:"[Notifications] CountSuccess",NotificationsCountFailure:"[Notifications] CountFailure"},gi=function Xc(){this.type=hi.NotificationsInit},fi=function tp(){this.type=hi.NotificationsAbort},di=function ep(t){this.payload=t,this.type=hi.NotificationsSuccess},mi=function np(t){this.payload=t,this.type=hi.NotificationsFailure},yi=function rp(){this.type=hi.NotificationsEmpty},Si=function ip(t){this.payload=t,this.type=hi.NotificationsData},bi=function op(){this.type=hi.NotificationsCountInit},vi=function sp(){this.type=hi.NotificationsCountAbort},Ei=function ap(t){this.payload=t,this.type=hi.NotificationsCountSuccess},Oi=function cp(t){this.payload=t,this.type=hi.NotificationsCountFailure},Ci=(Ii.decorators=[{type:v.Injectable}],Ii.ctorParameters=function(){return[{type:A.Actions},{type:y.PipNavService},{type:li}]},j([A.Effect(),k("design:type",O.Observable)],Ii.prototype,"notifications$",void 0),j([A.Effect(),k("design:type",O.Observable)],Ii.prototype,"notificationsSuccess$",void 0),j([A.Effect(),k("design:type",O.Observable)],Ii.prototype,"notificationsCount$",void 0),j([A.Effect({dispatch:!1}),k("design:type",O.Observable)],Ii.prototype,"notificationsCountSuccess$",void 0),Ii);function Ii(t,e,n){var i=this;this.actions$=t,this.navService=e,this.notificationsDataService=n,this.notifications$=this.actions$.pipe(A.ofType(hi.NotificationsInit,hi.NotificationsAbort),C.switchMap(function(t){return t.type!==hi.NotificationsAbort?i.notificationsDataService.readNotifications().pipe(C.map(function(t){return new di(t)}),C.catchError(function(t){return O.of(new mi(t))})):O.of()})),this.notificationsSuccess$=this.actions$.pipe(A.ofType(hi.NotificationsSuccess),C.map(function(t){return t.payload&&0<t.payload.total?new Si(t.payload):new yi})),this.notificationsCount$=this.actions$.pipe(A.ofType(hi.NotificationsCountInit,hi.NotificationsCountAbort),C.switchMap(function(t){return t.type!==hi.NotificationsCountAbort?i.notificationsDataService.readNotificationsCount().pipe(C.map(function(t){return new Ei(t)}),C.catchError(function(t){return O.of(new Oi(t))})):O.of()})),this.notificationsCountSuccess$=this.actions$.pipe(A.ofType(hi.NotificationsCountSuccess),C.map(function(t){var e=i.navService.getItem("primary-actions");if(e){var n=e.properties.getValue().actions,r=I.find(n,["icon","notifications"]);r&&(r.count=t.payload,i.navService.updateItemByName("primary-actions",{actions:n}))}}))}var _i={notifications:[],count:0,state:"empty",error:null};function Ai(t,e){switch(void 0===t&&(t=_i),e.type){case hi.NotificationsInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case hi.NotificationsAbort:return w.fromJS(t).set("state",t.error?"error":t.notifications&&t.notifications.length?"data":"empty").toJS();case hi.NotificationsSuccess:return w.fromJS(t).set("error",null).toJS();case hi.NotificationsFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();case hi.NotificationsData:return w.fromJS(t).set("notifications",e.payload.data).set("count",e.payload.total).set("state","data").toJS();case hi.NotificationsEmpty:return w.fromJS(t).set("notifications",[]).set("count",0).set("state","empty").toJS();case hi.NotificationsCountSuccess:return w.fromJS(t).set("count",e.payload).set("error",null).toJS();case hi.NotificationsCountFailure:return w.fromJS(t).set("error",e.payload).toJS();default:return t}}var wi=_.createFeatureSelector("notifications"),Ni=_.createSelector(wi,function(t){return t.notifications}),zi=_.createSelector(wi,function(t){return t.count}),Ti=_.createSelector(wi,function(t){return t.state}),ji=_.createSelector(wi,function(t){return t.error}),ki=(Pi.prototype.init=function(){this.store.dispatch(new bi)},Pi.prototype.read=function(){this.store.dispatch(new gi)},Object.defineProperty(Pi.prototype,"notifications$",{get:function(){return this.store.select(Ni)},enumerable:!0,configurable:!0}),Object.defineProperty(Pi.prototype,"count$",{get:function(){return this.store.select(zi)},enumerable:!0,configurable:!0}),Object.defineProperty(Pi.prototype,"state$",{get:function(){return this.store.select(Ti)},enumerable:!0,configurable:!0}),Object.defineProperty(Pi.prototype,"error$",{get:function(){return this.store.select(ji)},enumerable:!0,configurable:!0}),Pi.decorators=[{type:v.Injectable}],Pi.ctorParameters=function(){return[{type:_.Store}]},Pi);function Pi(t){this.store=t}var $i={NOTIFICATIONS_PANEL_TITLE:"Notifications",NOTIFICATIONS_EMPTY:"No notifications",NOTIFICATIONS_EMPTY_SUB:"There's no notifications now",NOTIFICATIONS_CLOSE:"Close",NOTIFICATIONS_CLOSE_ALL:"Close all",NOTIFICATIONS_SHOW_MORE:"Show more"},Ri={NOTIFICATIONS_PANEL_TITLE:"Оповещения",NOTIFICATIONS_EMPTY:"Нет оповещений",NOTIFICATIONS_EMPTY_SUB:"На данный момент оповещений нет",NOTIFICATIONS_CLOSE:"Закрыть",NOTIFICATIONS_CLOSE_ALL:"Закрыть все",NOTIFICATIONS_SHOW_MORE:"Показать еще"},xi=(Mi.prototype.ngOnInit=function(){this.notificationsService.read()},Mi.prototype.selectNotification=function(t){this.notificationsPanelService.currentNotification=t},Mi.decorators=[{type:v.Component,args:[{selector:"iqs-notifications-panel",template:'<ng-container [ngSwitch]="state$ | async">\r\n    <pip-empty-state *ngSwitchCase="\'empty\'">\r\n        <pip-empty-state-title [text]="\'NOTIFICATIONS_EMPTY\' | translate" [subText]="\'NOTIFICATIONS_EMPTY_SUB\' | translate"\r\n                               imageUrl="./assets/empty.svg"></pip-empty-state-title>\r\n    </pip-empty-state>\r\n    <pip-empty-state *ngSwitchCase="\'progress\'">\r\n        <div class="loader"> <img src="./assets/pre-loading.svg"> </div>\r\n    </pip-empty-state>\r\n    <ng-container *ngSwitchCase="\'data\'">\r\n        <ng-container [ngSwitch]="panelState$ | async">\r\n            <ng-container *ngSwitchCase="\'Notifications\'">\r\n                <mat-nav-list dense fxFlex="grow">\r\n                    <ng-container *ngFor="let n of notifications$ | async">\r\n                        <mat-list-item (click)="selectNotification(n)">\r\n                            <div class="iqs-notification-item" fxFlex="grow" fxLayout="row" fxLayoutAlign=" center">\r\n                                <img matListAvatar src="https://via.placeholder.com/48" />\r\n                                <div class="iqs-notification-title">\r\n                                    <h3 matLine class="pip-link-title">{{ n?.label }}</h3>\r\n                                    <p mat-line>{{ n?.object?.name }}</p>\r\n                                </div>\r\n                                <div fxFlex="0 0 20%">\r\n                                    <mat-icon *ngIf="n.icon && n.icon.name" [color]="n.icon && n.icon.color || \'primary\'">{{\r\n                                        n.icon.name }}</mat-icon>\r\n                                    <div>{{ n.date | amTimeAgo:true }}</div>\r\n                                </div>\r\n                            </div>\r\n                        </mat-list-item>\r\n                        <mat-divider></mat-divider>\r\n                    </ng-container>\r\n                </mat-nav-list>\r\n                <div class="iqs-notifications-actions" fxLayout="row" fxLayoutAlign="space-around center">\r\n                    <button mat-button disableRipple>{{ \'NOTIFICATIONS_CLOSE_ALL\' | translate }}</button>\r\n                    <button mat-button disableRipple>{{ \'NOTIFICATIONS_SHOW_MORE\' | translate }}</button>\r\n                </div>\r\n            </ng-container>\r\n            <div *ngSwitchCase="\'Details\'" fxFlex="grow" fxLayout="column">\r\n                <ng-container *ngIf="currentNotification$ | async as n">\r\n                    <mat-list dense fxFlex="grow">\r\n                        <mat-list-item>\r\n                            <img matListAvatar src="https://via.placeholder.com/48" />\r\n                            <h3 matLine class="pip-link-title">{{ n.label }}</h3>\r\n                            <p mat-line>{{ n?.object?.name }}</p>\r\n                        </mat-list-item>\r\n                        <mat-list-item>\r\n                            <mat-icon matListIcon>access_time</mat-icon>\r\n                            <h3 matLine class="pip-link-title">{{ n.date | amTimeAgo }}</h3>\r\n                        </mat-list-item>\r\n                        <mat-list-item>\r\n                            <mat-icon matListIcon>info</mat-icon>\r\n                            <h3 matLine class="pip-link-title">{{ n.info }}</h3>\r\n                        </mat-list-item>\r\n                    </mat-list>\r\n                    <div class="iqs-notifications-actions" fxLayout="row" fxLayoutAlign="space-around center">\r\n                        <button mat-button disableRipple>{{ \'NOTIFICATIONS_CLOSE\' | translate }}</button>\r\n                    </div>\r\n                </ng-container>\r\n            </div>\r\n        </ng-container>\r\n    </ng-container>\r\n\r\n</ng-container>',styles:[":host{display:flex;flex-direction:column;height:calc(100% - 50px);max-height:calc(100% - 50px)}:host mat-nav-list{overflow-y:auto}:host mat-nav-list mat-list-item{height:auto!important}:host mat-nav-list mat-list-item .iqs-notification-item{margin:8px 0}:host mat-nav-list mat-list-item .iqs-notification-title{padding:0 8px;box-sizing:border-box;max-width:calc(80% - 36px);width:calc(80% - 36px)}:host mat-nav-list mat-list-item .iqs-notification-title h3{text-overflow:ellipsis}:host mat-nav-list mat-list-item .iqs-notification-title h3,:host mat-nav-list mat-list-item .iqs-notification-title p{margin:8px 0 0}.iqs-notifications-actions button{text-transform:uppercase}"]}]}],Mi.ctorParameters=function(){return[{type:ci},{type:ki},{type:g.TranslateService}]},Mi);function Mi(t,e,n){this.notificationsPanelService=t,this.notificationsService=e,this.translate=n,this.currentNotification$=this.notificationsPanelService.currentNotification$,this.panelState$=this.notificationsPanelService.state$,this.notifications$=this.notificationsService.notifications$,this.state$=this.notificationsService.state$,this.translate.setTranslation("ru",Ri,!0),this.translate.setTranslation("en",$i,!0),this.notificationsPanelService.state=ai.Notifications}var Fi=(qi.decorators=[{type:v.NgModule,args:[{declarations:[xi],exports:[xi],imports:[E.CommonModule,p.FlexLayoutModule,c.MatButtonModule,c.MatListModule,c.MatIconModule,r.MomentModule,g.TranslateModule,i.PipEmptyStateModule]}]}],qi);function qi(){}var Ui=(Li.decorators=[{type:v.NgModule,args:[{imports:[Fi],exports:[Fi]}]}],Li);function Li(){}var Di=(Gi.forRoot=function(){return{ngModule:Gi,providers:[ci]}},Gi.decorators=[{type:v.NgModule,args:[{imports:[_.StoreModule.forFeature("notifications",Ai),A.EffectsModule.forFeature([Ci]),Ui],exports:[Ui],providers:[li,ki]}]}],Gi);function Gi(){}var Ji,Bi=function pp(){},Hi=function lp(){},Zi=function up(){},Yi=(z(Vi,Ji=x),Vi.prototype.handleError=function(t){return O.throwError(t)},Vi.prototype.readObjects=function(t){return(t=t||{}).organization_id=t.organization_id?t.organization_id:this.organizationsService.current&&this.organizationsService.current.id,this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,t)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},Vi.prototype.updateObject=function(t,e){var n={organization_id:this.organizationsService.current&&this.organizationsService.current.id,object_id:t};return this.http.put(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,n),e).pipe(C.catchError(this.handleError))},Vi.prototype.createObject=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id};return this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,e),t).pipe(C.catchError(this.handleError))},Vi.prototype.deleteObject=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id,object_id:t};return this.http["delete"](this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.catchError(this.handleError))},Vi.decorators=[{type:v.Injectable}],Vi.ctorParameters=function(){return[{type:Tt},{type:On},{type:h.HttpClient}]},Vi);function Vi(t,e,n){var r=Ji.call(this)||this;return r.sessionConfig=t,r.organizationsService=e,r.http=n,r.RESOURCE="/api/v1/organizations/:organization_id/control_objects",r.RESOURCE_SINGLE="/api/v1/organizations/:organization_id/control_objects/:object_id",r}var Wi,Ki={CurrentObjectStatesInit:"[CurrentObjectStates] Init",CurrentObjectStatesAbort:"[CurrentObjectStates] Abort",CurrentObjectStatesSuccess:"[CurrentObjectStates] Success",CurrentObjectStatesFailure:"[CurrentObjectStates] Failure"},Qi=function hp(){this.type=Ki.CurrentObjectStatesInit},Xi=function gp(){this.type=Ki.CurrentObjectStatesAbort},to=function fp(t){this.payload=t,this.type=Ki.CurrentObjectStatesSuccess},eo=function dp(t){this.payload=t,this.type=Ki.CurrentObjectStatesFailure},no=(z(ro,Wi=x),ro.prototype.handleError=function(t){return O.throwError(t)},ro.prototype.readCurrentObjectStates=function(t){return(t=t||{}).organization_id=t.organization_id?t.organization_id:this.organizationsService.current&&this.organizationsService.current.id,this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,t)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},ro.prototype.readCurrentObjectState=function(t){var e={side_id:this.organizationsService.current&&this.organizationsService.current.id,object_id:t};return this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},ro.decorators=[{type:v.Injectable}],ro.ctorParameters=function(){return[{type:Tt},{type:On},{type:h.HttpClient}]},ro);function ro(t,e,n){var r=Wi.call(this)||this;return r.sessionConfig=t,r.organizationsService=e,r.http=n,r.RESOURCE="/api/v1/organizations/:organization_id/curr_object_states",r.RESOURCE_SINGLE="/api/v1/organizations/:organization_id/curr_object_states/:object_id",r}var io=(oo.decorators=[{type:v.Injectable}],oo.ctorParameters=function(){return[{type:A.Actions},{type:no}]},j([A.Effect(),k("design:type",O.Observable)],oo.prototype,"currentObjectStates$",void 0),oo);function oo(t,e){var n=this;this.actions$=t,this.ds=e,this.currentObjectStates$=this.actions$.pipe(A.ofType(Ki.CurrentObjectStatesInit,Ki.CurrentObjectStatesAbort),C.switchMap(function(t){return t.type!==Ki.CurrentObjectStatesAbort?n.ds.readCurrentObjectStates().pipe(C.map(function(t){return new to({states:t})}),C.catchError(function(t){return O.of(new eo({error:t}))})):O.of()}))}var so={states:[],state:"empty",error:null};function ao(t,e){switch(void 0===t&&(t=so),e.type){case Ki.CurrentObjectStatesInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case Ki.CurrentObjectStatesAbort:return w.fromJS(t).set("state",t.error?"error":t.states&&t.states.length?"data":"empty").toJS();case Ki.CurrentObjectStatesSuccess:return w.fromJS(t).set("states",e.payload.states).set("state",e.payload.states&&e.payload.states.length?"data":"empty").set("error",null).toJS();case Ki.CurrentObjectStatesFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();default:return t}}var co=_.createFeatureSelector("current_object_states"),po=_.createSelector(co,function(t){return t.states}),lo=_.createSelector(co,function(t,e){return e&&e.hasOwnProperty("id")&&t&&t.states&&t.states.length&&t.states.find(function(t){return t.object_id===e.id})||null}),uo=_.createSelector(co,function(t){return t.state}),ho=_.createSelector(co,function(t){return t.error}),go={ControlObjectsInit:"[ControlObject] Init",ControlObjectsAbort:"[ControlObject] Abort",ControlObjectsSuccess:"[ControlObject] Success",ControlObjectsFailure:"[ControlObject] Failure"},fo=function mp(){this.type=go.ControlObjectsInit},mo=function yp(){this.type=go.ControlObjectsAbort},yo=function Sp(t){this.payload=t,this.type=go.ControlObjectsSuccess},So=function bp(t){this.payload=t,this.type=go.ControlObjectsFailure},bo=(vo.decorators=[{type:v.Injectable}],vo.ctorParameters=function(){return[{type:A.Actions},{type:Yi}]},j([A.Effect(),k("design:type",O.Observable)],vo.prototype,"controlObjects$",void 0),vo);function vo(t,e){var n=this;this.actions$=t,this.ds=e,this.controlObjects$=this.actions$.pipe(A.ofType(go.ControlObjectsInit,go.ControlObjectsAbort),C.switchMap(function(t){return t.type!==go.ControlObjectsAbort?n.ds.readObjects().pipe(C.map(function(t){return new yo({objects:t})}),C.catchError(function(t){return O.of(new So({error:t}))})):O.of()}))}var Eo={objects:[],state:"empty",error:null};function Oo(t,e){switch(void 0===t&&(t=Eo),e.type){case go.ControlObjectsInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case go.ControlObjectsAbort:return w.fromJS(t).set("state",t.error?"error":t.objects&&t.objects.length?"data":"empty").toJS();case go.ControlObjectsSuccess:return w.fromJS(t).set("objects",e.payload.objects).set("state",e.payload.objects&&e.payload.objects.length?"data":"empty").set("error",null).toJS();case go.ControlObjectsFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();default:return t}}var Co,Io=_.createFeatureSelector("objects"),_o=_.createSelector(Io,function(t){return t.objects}),Ao=_.createSelector(Io,function(t,e){return e&&e.id&&t&&t.objects&&t.objects.length&&t.objects.find(function(t){return t.id===e.id})||null}),wo=_.createSelector(Io,function(t){return t.state}),No=_.createSelector(Io,function(t){return t.error}),zo={ObjectGroupsInit:"[ObjectGroups] Init",ObjectGroupsAbort:"[ObjectGroups] Abort",ObjectGroupsSuccess:"[ObjectGroups] Success",ObjectGroupsFailure:"[ObjectGroups] Failure"},To=function vp(){this.type=zo.ObjectGroupsInit},jo=function Ep(){this.type=zo.ObjectGroupsAbort},ko=function Op(t){this.payload=t,this.type=zo.ObjectGroupsSuccess},Po=function Cp(t){this.payload=t,this.type=zo.ObjectGroupsFailure},$o=(z(Ro,Co=x),Ro.prototype.handleError=function(t){return O.throwError(t)},Ro.prototype.readObjectGroups=function(t){return(t=t||{}).organization_id=t.organization_id?t.organization_id:this.organizationsService.current&&this.organizationsService.current.id,this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,t)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},Ro.prototype.updateObjectGroup=function(t,e){var n={organization_id:this.organizationsService.current&&this.organizationsService.current.id,group_id:t};return this.http.put(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,n),e).pipe(C.catchError(this.handleError))},Ro.prototype.createObjectGroup=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id};return this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,e),t).pipe(C.catchError(this.handleError))},Ro.prototype.deleteObjectGroup=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id,group_id:t};return this.http["delete"](this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.catchError(this.handleError))},Ro.decorators=[{type:v.Injectable}],Ro.ctorParameters=function(){return[{type:Tt},{type:On},{type:h.HttpClient}]},Ro);function Ro(t,e,n){var r=Co.call(this)||this;return r.sessionConfig=t,r.organizationsService=e,r.http=n,r.RESOURCE="/api/v1/organizations/:organization_id/object_groups",r.RESOURCE_SINGLE="/api/v1/organizations/:organization_id/object_groups/:group_id",r}var xo=(Mo.decorators=[{type:v.Injectable}],Mo.ctorParameters=function(){return[{type:A.Actions},{type:$o}]},j([A.Effect(),k("design:type",O.Observable)],Mo.prototype,"objectGroups$",void 0),Mo);function Mo(t,e){var n=this;this.actions$=t,this.ds=e,this.objectGroups$=this.actions$.pipe(A.ofType(zo.ObjectGroupsInit,zo.ObjectGroupsAbort),C.switchMap(function(t){return t.type!==zo.ObjectGroupsAbort?n.ds.readObjectGroups().pipe(C.map(function(t){return new ko({groups:t})}),C.catchError(function(t){return O.of(new Po({error:t}))})):O.of()}))}var Fo={groups:[],state:"empty",error:null};function qo(t,e){switch(void 0===t&&(t=Fo),e.type){case zo.ObjectGroupsInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case zo.ObjectGroupsAbort:return w.fromJS(t).set("state",t.error?"error":t.groups&&t.groups.length?"data":"empty").toJS();case zo.ObjectGroupsSuccess:return w.fromJS(t).set("groups",e.payload.groups).set("state",e.payload.groups&&e.payload.groups.length?"data":"empty").set("error",null).toJS();case zo.ObjectGroupsFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();default:return t}}var Uo=_.createFeatureSelector("object_groups"),Lo=_.createSelector(Uo,function(t){return t.groups}),Do=_.createSelector(Uo,function(t){return t.state}),Go=_.createSelector(Uo,function(t){return t.error}),Jo=(Bo.prototype.init=function(){var n=this;Bo.updateSub||(this.organizationsService.init(),Bo.updateSub=O.combineLatest(this.organizationsService.current$.pipe(C.filter(function(t){return null!==t}),C.distinctUntilKeyChanged("id")),X(function(){return n._isPaused}).pipe(C.startWith(0))).subscribe(function(t){var e=$(t,2);e[0],e[1],n.store.dispatch(new fo)}))},Bo.prototype.read=function(){this.store.dispatch(new fo)},Object.defineProperty(Bo.prototype,"objects$",{get:function(){return this.store.select(_o)},enumerable:!0,configurable:!0}),Object.defineProperty(Bo.prototype,"state$",{get:function(){return this.store.select(wo)},enumerable:!0,configurable:!0}),Object.defineProperty(Bo.prototype,"error$",{get:function(){return this.store.select(No)},enumerable:!0,configurable:!0}),Bo.prototype.findById$=function(t){return this.store.select(Ao,{id:t}).pipe(C.distinctUntilChanged(function(t,e){return JSON.stringify(t)===JSON.stringify(e)}))},Bo.prototype.findById=function(t){var e;return this.findById$(t).pipe(C.take(1)).subscribe(function(t){return e=t}),e},Bo.prototype.startLive=function(){this._isPaused=!1},Bo.prototype.stopLive=function(){this._isPaused=!0},Bo.updateSub=null,Bo.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Bo.ctorParameters=function(){return[{type:_.Store},{type:On}]},Bo.ngInjectableDef=v.defineInjectable({factory:function(){return new Bo(v.inject(_.Store),v.inject(On))},token:Bo,providedIn:"root"}),Bo);function Bo(t,e){this.store=t,this.organizationsService=e,this._isPaused=!0}var Ho=(Zo.prototype.init=function(){var n=this;Zo.updateSub||(this.organizationsService.init(),Zo.updateSub=O.combineLatest(this.organizationsService.current$.pipe(C.filter(function(t){return null!==t}),C.distinctUntilKeyChanged("id")),X(function(){return n._isPaused}).pipe(C.startWith(0))).subscribe(function(t){var e=$(t,2);e[0],e[1],n.store.dispatch(new Qi)}))},Zo.prototype.read=function(){this.store.dispatch(new Qi)},Object.defineProperty(Zo.prototype,"states$",{get:function(){return this.store.select(po)},enumerable:!0,configurable:!0}),Zo.prototype.findByObjectId$=function(t){return this.store.select(lo,{id:t})},Object.defineProperty(Zo.prototype,"state$",{get:function(){return this.store.select(uo)},enumerable:!0,configurable:!0}),Object.defineProperty(Zo.prototype,"error$",{get:function(){return this.store.select(ho)},enumerable:!0,configurable:!0}),Zo.prototype.startLive=function(){this._isPaused=!1},Zo.prototype.stopLive=function(){this._isPaused=!0},Zo.updateSub=null,Zo.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Zo.ctorParameters=function(){return[{type:_.Store},{type:On}]},Zo.ngInjectableDef=v.defineInjectable({factory:function(){return new Zo(v.inject(_.Store),v.inject(On))},token:Zo,providedIn:"root"}),Zo);function Zo(t,e){this.store=t,this.organizationsService=e,this._isPaused=!0}var Yo=(Vo.prototype.init=function(){var n=this;Vo.updateSub||(this.organizationsService.init(),Vo.updateSub=O.combineLatest(this.organizationsService.current$.pipe(C.filter(function(t){return null!==t}),C.distinctUntilKeyChanged("id")),X(function(){return n._isPaused}).pipe(C.startWith(0))).subscribe(function(t){var e=$(t,2);e[0],e[1],n.store.dispatch(new To)}))},Object.defineProperty(Vo.prototype,"groups$",{get:function(){return this.store.select(Lo)},enumerable:!0,configurable:!0}),Object.defineProperty(Vo.prototype,"state$",{get:function(){return this.store.select(Do)},enumerable:!0,configurable:!0}),Object.defineProperty(Vo.prototype,"error$",{get:function(){return this.store.select(Go)},enumerable:!0,configurable:!0}),Vo.prototype.startLive=function(){this._isPaused=!1},Vo.prototype.stopLive=function(){this._isPaused=!0},Vo.updateSub=null,Vo.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Vo.ctorParameters=function(){return[{type:_.Store},{type:On}]},Vo.ngInjectableDef=v.defineInjectable({factory:function(){return new Vo(v.inject(_.Store),v.inject(On))},token:Vo,providedIn:"root"}),Vo);function Vo(t,e){this.store=t,this.organizationsService=e,this._isPaused=!0}var Wo=(Ko.decorators=[{type:v.NgModule,args:[{imports:[_.StoreModule.forFeature("objects",Oo),_.StoreModule.forFeature("object_groups",qo),_.StoreModule.forFeature("current_object_states",ao),A.EffectsModule.forFeature([bo]),A.EffectsModule.forFeature([xo]),A.EffectsModule.forFeature([io])],providers:[Yi,no,$o,Jo,Ho,Yo]}]}],Ko);function Ko(){}var Qo=(Xo.prototype.canActivate=function(t,e){return this.verifySession(e.url)},Xo.prototype.verifySession=function(t){return!(!this.sessionService.session||!this.sessionService.session.id)||(this.window.location.href=this.window.location.origin+this.sessionConfig.unautorizedUrl+"?from="+this.router.url,!1)},Xo.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Xo.ctorParameters=function(){return[{type:Z,decorators:[{type:v.Inject,args:[U]}]},{type:b.Router},{type:Tt},{type:ze}]},Xo.ngInjectableDef=v.defineInjectable({factory:function(){return new Xo(v.inject(U),v.inject(b.Router),v.inject(Tt),v.inject(ze))},token:Xo,providedIn:"root"}),Xo);function Xo(t,e,n,r){this.window=t,this.router=e,this.sessionConfig=n,this.sessionService=r}var ts=(es.prototype.intercept=function(t,e){var n,r=this,i=this.sessionService.session?this.sessionService.session.id:null;t.body&&t.body.constructor&&"FormData"===t.body.constructor.name||(n=t.headers.set("content-type","application/json")),i&&!t.headers.get("x-session-id")&&(n=t.headers.set("x-session-id",i));var o=t.clone({headers:n});return e.handle(o).pipe(C.catchError(function(t){return t instanceof h.HttpErrorResponse&&401===t.status&&r.router.navigate([r.sessionConfig.unautorizedUrl]),O.throwError(t)}))},es.decorators=[{type:v.Injectable}],es.ctorParameters=function(){return[{type:b.Router},{type:Tt},{type:ze}]},es);function es(t,e,n){this.router=t,this.sessionConfig=e,this.sessionService=n}var ns={provide:h.HTTP_INTERCEPTORS,useClass:ts,multi:!0},rs=(is.prototype.handleError=function(t){return O.throwError(t)},is.prototype.readUser=function(t){var e=this.iqsSessionConfig.serverUrl+this.RESOURCE+"/"+t;return this.http.get(e).pipe(C.catchError(this.handleError))},is.prototype.updateUser=function(t){var e=this.iqsSessionConfig.serverUrl+this.RESOURCE+"/"+t.id;return this.http.put(e,t).pipe(C.catchError(this.handleError))},is.prototype.deleteUser=function(t){var e="string"==typeof t?t:t.id,n=this.iqsSessionConfig.serverUrl+this.RESOURCE+"/"+e;return this.http["delete"](n,{}).pipe(C.map(function(){return e}),C.catchError(this.handleError))},is.prototype.changePassword=function(t,e,n){var r="string"==typeof t?t:t.id,i=this.iqsSessionConfig.serverUrl+this.RESOURCE+"/"+r+"/change_password",o={oldPassword:e,newPassword:n};return this.http.post(i,o).pipe(C.catchError(this.handleError))},is.decorators=[{type:v.Injectable}],is.ctorParameters=function(){return[{type:h.HttpClient},{type:Tt}]},is);function is(t,e){this.http=t,this.iqsSessionConfig=e,this.RESOURCE="/api/v1/users"}var os=(ss.decorators=[{type:v.NgModule,args:[{imports:[E.CommonModule,_.StoreModule.forFeature("auth",Ie),A.EffectsModule.forFeature([Ee])],declarations:[],providers:[be,ze]}]}],ss);function ss(){}var as=function Ip(){},cs={None:0,Attention:1,Confirmation:2,Warning:3,Emergency:4};cs[cs.None]="None",cs[cs.Attention]="Attention",cs[cs.Confirmation]="Confirmation",cs[cs.Warning]="Warning",cs[cs.Emergency]="Emergency";var ps,ls=(z(us,ps=x),us.prototype.handleError=function(t){return O.throwError(t)},us.prototype.readSignals=function(t){return(t=t||{}).organization_id=t.organization_id?t.organization_id:this.organizationsService.current&&this.organizationsService.current.id,this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,t)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},us.prototype.createSignal=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id};return this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,e),t).pipe(C.catchError(this.handleError))},us.prototype.deleteSignal=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id,signal_id:t};return this.http["delete"](this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.catchError(this.handleError))},us.prototype.lockSignal=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id,signal_id:t};return this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE_LOCK,e),e).pipe(C.catchError(this.handleError))},us.prototype.closeSignal=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id,signal_id:t};return this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE_CLOSE,e),e).pipe(C.catchError(this.handleError))},us.decorators=[{type:v.Injectable}],us.ctorParameters=function(){return[{type:Tt},{type:On},{type:h.HttpClient}]},us);function us(t,e,n){var r=ps.call(this)||this;return r.sessionConfig=t,r.organizationsService=e,r.http=n,r.RESOURCE="/api/v1/organizations/:organization_id/signals",r.RESOURCE_SINGLE="/api/v1/organizations/:organization_id/signals/:signal_id",r.RESOURCE_SINGLE_LOCK="/api/v1/organizations/:organization_id/signals/:signal_id/lock",r.RESOURCE_SINGLE_CLOSE="/api/v1/organizations/:organization_id/signals/:signal_id/close",r}var hs=(gs.prototype.sendById=function(t,e){return this.signalsData.createSignal({organization_id:this.organizationsService.current&&this.organizationsService.current.id,device_id:t,type:e})},gs.prototype.sendBatch=function(t,e){var n,r,i=[],o=this.organizationsService.current&&this.organizationsService.current.id;try{for(var s=P(t),a=s.next();!a.done;a=s.next()){var c=a.value;i.push(this.signalsData.createSignal({organization_id:o,device_id:c,type:e}))}}catch(p){n={error:p}}finally{try{a&&!a.done&&(r=s["return"])&&r.call(s)}finally{if(n)throw n.error}}return O.forkJoin(i)},gs.decorators=[{type:v.Injectable}],gs.ctorParameters=function(){return[{type:Tt},{type:ls},{type:On},{type:h.HttpClient}]},gs);function gs(t,e,n,r){this.sessionConfig=t,this.signalsData=e,this.organizationsService=n,this.http=r}var fs=(ds.decorators=[{type:v.NgModule,args:[{imports:[],exports:[],providers:[ls,hs]}]}],ds);function ds(){}var ms=(ys.prototype.onClose=function(t){this.dialogRef.close(this.data.actions[t].returnValue)},ys.decorators=[{type:v.Component,args:[{selector:"iqs-ask-dialog",template:'<h1 mat-dialog-title class="pip-header">{{ data.title | translate }}</h1>\r\n<div mat-dialog-content class="pip-content">\r\n    <p *ngFor="let text of data.content">{{ text | translate }}</p>\r\n</div>\r\n<div mat-dialog-actions align="end">\r\n    <ng-container *ngFor="let key of keys">\r\n        <button mat-button *ngIf="key !== initFocusKey" (click)="onClose(key)" [color]="data.actions[key]?.color">\r\n            {{ data.actions[key]?.text | translate }}\r\n        </button>\r\n        <button mat-button *ngIf="key === initFocusKey" (click)="onClose(key)" [color]="data.actions[key]?.color"\r\n                cdkFocusInitial>\r\n            {{ data.actions[key]?.text | translate }}\r\n        </button>\r\n    </ng-container>\r\n</div>',styles:[":host{font-family:Roboto,'Helvetica Neue',sans-serif}:host [mat-dialog-actions] button{text-transform:uppercase}"]}]}],ys.ctorParameters=function(){return[{type:undefined,decorators:[{type:v.Inject,args:[c.MAT_DIALOG_DATA]}]},{type:c.MatDialogRef}]},ys);function ys(t,e){var n=this;this.data=t,this.dialogRef=e,this.keys=Object.keys(this.data.actions).filter(function(t){return n.data.actions.hasOwnProperty(t)}),this.keys.length&&(this.data.initFocusActionKey&&this.data.actions.hasOwnProperty(this.data.initFocusActionKey)?this.initFocusKey=this.data.initFocusActionKey:this.initFocusKey=this.keys[this.keys.length-1])}var Ss=(bs.decorators=[{type:v.NgModule,args:[{declarations:[ms],exports:[ms],imports:[E.CommonModule,c.MatButtonModule,c.MatDialogModule,g.TranslateModule]}]}],bs);function bs(){}var vs={NOT_FOUND_PAGE_TITLE:"Error",NOT_FOUND_PAGE_TEXT:"Page not found",NOT_FOUND_PAGE_GO_BACK:"Go back",NOT_FOUND_PAGE_GO_HOME:"Go home"},Es={NOT_FOUND_PAGE_TITLE:"Ошибка",NOT_FOUND_PAGE_TEXT:"Страница не найдена",NOT_FOUND_PAGE_GO_BACK:"Назад",NOT_FOUND_PAGE_GO_HOME:"На главную"},Os=(Cs.prototype.ngOnInit=function(){},Cs.prototype.onBack=function(){this.location.back()},Cs.prototype.onHome=function(){this.window.location.href=this.window.location.origin+this.sessionConfig.autorizedUrl},Cs.decorators=[{type:v.Component,args:[{selector:"iqs-404-page",template:'<pip-empty-state>\r\n    <pip-empty-state-title [text]="\'NOT_FOUND_PAGE_TEXT\' | translate" imageUrl="./assets/404_page.svg"></pip-empty-state-title>\r\n    <pip-empty-state-actions [actions]="notFoundActions"></pip-empty-state-actions>\r\n</pip-empty-state>',styles:[":host{flex:1 1 100%}/deep/ pip-empty-state-actions button:not(:first-child){margin-top:8px!important}"]}]}],Cs.ctorParameters=function(){return[{type:Z,decorators:[{type:v.Inject,args:[U]}]},{type:E.Location},{type:y.PipNavService},{type:Tt},{type:g.TranslateService}]},Cs);function Cs(t,e,n,r,i){var o=this;this.window=t,this.location=e,this.navService=n,this.sessionConfig=r,this.translate=i,this.navService.showTitle("NOT_FOUND_PAGE_TITLE"),this.translate.setTranslation("en",vs,!0),this.translate.setTranslation("ru",Es,!0),this.notFoundActions=[{title:this.translate.instant("NOT_FOUND_PAGE_GO_BACK"),action:function(){o.onBack()}},{title:this.translate.instant("NOT_FOUND_PAGE_GO_HOME"),action:function(){o.onHome()}}]}var Is=(_s.decorators=[{type:v.NgModule,args:[{declarations:[Os],exports:[Os],imports:[E.CommonModule,p.FlexLayoutModule,b.RouterModule,g.TranslateModule,i.PipEmptyStateModule]}]}],_s);function _s(){}var As,ws={SEND_SIGNAL_DIALOG_TITLE:"Send a signal to trackers",SEND_SIGNAL_TYPE:"Signal type",SIGNAL_TYPE_NONE:"None",SIGNAL_TYPE_ATTENTION:"Attention",SIGNAL_TYPE_CONFIRMATION:"Confirmation",SIGNAL_TYPE_WARNING:"Warning",SIGNAL_TYPE_EMERGENCY:"Emergency",SEND_SIGNAL_OBJECTS:"Objects",SEND_SIGNAL_ZONES:"Zones",SEND_SIGNAL_OBJECTS_OR_GROUPS:"Objects or groups",SEND_SIGNAL_CANCEL:"Cancel",SEND_SIGNAL_SEND:"Send",SEND_SIGNAL_SUCCESS:"Signal sent",SEND_SIGNAL_ERROR_EMPTY:"There's no devices to send signal to.",SEND_SIGNAL_ERROR_UNKNOWN:"Error happened during sending signal, please try again"},Ns={SEND_SIGNAL_DIALOG_TITLE:"Послать сигнал на трекеры",SEND_SIGNAL_TYPE:"Тип сигнала",SIGNAL_TYPE_NONE:"Не задан",SIGNAL_TYPE_ATTENTION:"Внимание",SIGNAL_TYPE_CONFIRMATION:"Подтверждение",SIGNAL_TYPE_WARNING:"Предупреждение",SIGNAL_TYPE_EMERGENCY:"Тревога",SEND_SIGNAL_OBJECTS:"Объекты",SEND_SIGNAL_ZONES:"Зоны",SEND_SIGNAL_OBJECTS_OR_GROUPS:"Объекты или группы",SEND_SIGNAL_CANCEL:"Отмена",SEND_SIGNAL_SEND:"Послать",SEND_SIGNAL_SUCCESS:"Сигнал отправлен",SEND_SIGNAL_ERROR_EMPTY:"Отсутствуют устройства на которые будет отправлен сигнал.",SEND_SIGNAL_ERROR_UNKNOWN:"При отправке сигнала произошла ошибка, попробуйте еще раз"},zs={ZonesInit:"[Zones] Init",ZonesAbort:"[Zones] Abort",ZonesSuccess:"[Zones] Success",ZonesFailure:"[Zones] Failure"},Ts=function _p(){this.type=zs.ZonesInit},js=function Ap(){this.type=zs.ZonesAbort},ks=function wp(t){this.payload=t,this.type=zs.ZonesSuccess},Ps=function Np(t){this.payload=t,this.type=zs.ZonesFailure},$s=(z(Rs,As=x),Rs.prototype.handleError=function(t){return O.throwError(t)},Rs.prototype.readZones=function(t){return(t=t||{}).organization_id=t.organization_id?t.organization_id:this.organizationsService.current&&this.organizationsService.current.id,this.http.get(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,t)).pipe(C.map(function(t){return t.data}),C.catchError(this.handleError))},Rs.prototype.updateZone=function(t,e){var n={organization_id:this.organizationsService.current&&this.organizationsService.current.id,zone_id:t};return this.http.put(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,n),e).pipe(C.catchError(this.handleError))},Rs.prototype.createZone=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id};return this.http.post(this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE,e),t).pipe(C.catchError(this.handleError))},Rs.prototype.deleteObject=function(t){var e={organization_id:this.organizationsService.current&&this.organizationsService.current.id,zone_id:t};return this.http["delete"](this.buildUrl(this.sessionConfig.serverUrl+this.RESOURCE_SINGLE,e)).pipe(C.catchError(this.handleError))},Rs.decorators=[{type:v.Injectable}],Rs.ctorParameters=function(){return[{type:Tt},{type:On},{type:h.HttpClient}]},Rs);function Rs(t,e,n){var r=As.call(this)||this;return r.sessionConfig=t,r.organizationsService=e,r.http=n,r.RESOURCE="/api/v1/organizations/:organization_id/zones",r.RESOURCE_SINGLE="/api/v1/organizations/:organization_id/zones/:zone_id",r}var xs=(Ms.decorators=[{type:v.Injectable}],Ms.ctorParameters=function(){return[{type:A.Actions},{type:$s}]},j([A.Effect(),k("design:type",O.Observable)],Ms.prototype,"Zones$",void 0),Ms);function Ms(t,e){var n=this;this.actions$=t,this.ds=e,this.Zones$=this.actions$.pipe(A.ofType(zs.ZonesInit,zs.ZonesAbort),C.switchMap(function(t){return t.type!==zs.ZonesAbort?n.ds.readZones().pipe(C.map(function(t){return new ks({zones:t})}),C.catchError(function(t){return O.of(new Ps({error:t}))})):O.of()}))}var Fs={zones:[],state:"empty",error:null};function qs(t,e){switch(void 0===t&&(t=Fs),e.type){case zs.ZonesInit:return w.fromJS(t).set("state","progress").set("error",null).toJS();case zs.ZonesAbort:return w.fromJS(t).set("state",t.error?"error":t.zones&&t.zones.length?"data":"empty").toJS();case zs.ZonesSuccess:return w.fromJS(t).set("zones",e.payload.zones).set("state",e.payload.zones&&e.payload.zones.length?"data":"empty").set("error",null).toJS();case zs.ZonesFailure:return w.fromJS(t).set("state","error").set("error",e.payload).toJS();default:return t}}var Us=_.createFeatureSelector("zones"),Ls=_.createSelector(Us,function(t){return t.zones}),Ds=_.createSelector(Us,function(t){return t.state}),Gs=_.createSelector(Us,function(t){return t.error}),Js=(Bs.prototype.init=function(){var n=this;Bs.updateSub||(this.organizationsService.init(),Bs.updateSub=O.combineLatest(this.organizationsService.current$.pipe(C.filter(function(t){return null!==t}),C.distinctUntilKeyChanged("id")),X(function(){return n._isPaused}).pipe(C.startWith(0))).subscribe(function(t){var e=$(t,2);e[0],e[1],n.store.dispatch(new Ts)}))},Object.defineProperty(Bs.prototype,"zones$",{get:function(){return this.store.select(Ls)},enumerable:!0,configurable:!0}),Object.defineProperty(Bs.prototype,"state$",{get:function(){return this.store.select(Ds)},enumerable:!0,configurable:!0}),Object.defineProperty(Bs.prototype,"error$",{get:function(){return this.store.select(Gs)},enumerable:!0,configurable:!0}),Bs.prototype.startLive=function(){this._isPaused=!1},Bs.prototype.stopLive=function(){this._isPaused=!0},Bs.updateSub=null,Bs.decorators=[{type:v.Injectable,args:[{providedIn:"root"}]}],Bs.ctorParameters=function(){return[{type:_.Store},{type:On}]},Bs.ngInjectableDef=v.defineInjectable({factory:function(){return new Bs(v.inject(_.Store),v.inject(On))},token:Bs,providedIn:"root"}),Bs);function Bs(t,e){this.store=t,this.organizationsService=e,this._isPaused=!0}var Hs=(Zs.prototype.ngOnInit=function(){this.objectsService.init(),this.objectGroupsService.init(),this.zonesService.init(),this.currentObjectStatesService.init(),this.currentObjectStatesService.startLive()},Zs.prototype.ngOnDestroy=function(){this.subs.unsubscribe(),this.currentObjectStatesService.stopLive()},Zs.prototype.remove=function(t,e){var n;switch(t){case"object":n=this.objects;break;case"zone":n=this.zones}var r=n.indexOf(e);0<=r&&n.splice(r,1)},Zs.prototype.selected=function(t){var e=$(t.option.value,2),n=e[0],r=e[1];switch(n){case"object":this.objects.push(r),this.objectInput.nativeElement.value="",this.form.get("object").setValue(null);break;case"group":this.groups.push(r),this.objectInput.nativeElement.value="",this.form.get("object").setValue(null);break;case"zone":this.zones.push(r),this.zoneInput.nativeElement.value="",this.form.get("zone").setValue(null)}},Zs.prototype.onSubmit=function(){var t,e,n,r,i,o,g=this,f=this.zones.map(function(t){return t.id}),s=R(this.objects),d=[];this.loading$.next(!0),this.form.disable();try{for(var a=P(this.groups),c=a.next();!c.done;c=a.next()){var p=c.value;try{for(var l=P(p.object_ids),u=l.next();!u.done;u=l.next()){var h=u.value;(S=I.find(this.allObjects,["id",h]))&&s.push(S)}}catch(b){n={error:b}}finally{try{u&&!u.done&&(r=l["return"])&&r.call(l)}finally{if(n)throw n.error}}}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=a["return"])&&e.call(a)}finally{if(t)throw t.error}}try{for(var m=P(s),y=m.next();!y.done;y=m.next()){var S;(S=y.value).device_id&&d.push(S.device_id)}}catch(E){i={error:E}}finally{try{y&&!y.done&&(o=m["return"])&&o.call(m)}finally{if(i)throw i.error}}this.currentObjectStatesService.states$.pipe(C.switchMap(function(t){var e,n,r,i;try{for(var o=P(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(a.zones&&a.zones.length&&a.device_id)try{for(var c=P(a.zones),p=c.next();!p.done;p=c.next()){var l=p.value;f.includes(l.zone_id)&&d.push(a.device_id)}}catch(u){r={error:u}}finally{try{p&&!p.done&&(i=c["return"])&&i.call(c)}finally{if(r)throw r.error}}}}catch(h){e={error:h}}finally{try{s&&!s.done&&(n=o["return"])&&n.call(o)}finally{if(e)throw e.error}}return(d=I.uniq(d)).length?g.signalsSend.sendBatch(d,g.form.get("type").value):O.throwError(g.translate.instant("SEND_SIGNAL_ERROR_EMPTY"))})).subscribe(function(){g.loading$.next(!1),g.snackBar.open(g.translate.instant("SEND_SIGNAL_SUCCESS"),"OK",{horizontalPosition:"left",verticalPosition:"bottom",duration:2e3}),g.dialogRef.close()},function(t){var e;g.loading$.next(!1),g.form.enable(),t.code?"UNKNOWN"===t.code&&(e=g.translate.instant("SEND_SIGNAL_ERROR_UNKNOWN")):e=t,g.snackBar.open(e,undefined,{horizontalPosition:"left",verticalPosition:"bottom",duration:2e3,panelClass:"pip-error-snackbar"})})},Object.defineProperty(Zs.prototype,"disableSendButton",{get:function(){return!this.objects.length&&!this.groups.length&&!this.zones.length||this.loading$.getValue()},enumerable:!0,configurable:!0}),Zs.prototype._filterObjects=function(t){var e=t.toLowerCase();return this.allObjects.filter(function(t){return 0<=t.name.toLowerCase().indexOf(e)})},Zs.prototype._filterGroups=function(t){var e=t.toLowerCase();return this.allGroups.filter(function(t){return 0<=t.name.toLowerCase().indexOf(e)})},Zs.prototype._filterZones=function(t){var e=t.toLowerCase();return this.allZones.filter(function(t){return 0<=t.name.toLowerCase().indexOf(e)})},Zs.decorators=[{type:v.Component,args:[{selector:"iqs-send-signal-dialog",template:'<h1 mat-dialog-title class="pip-header">{{ \'SEND_SIGNAL_DIALOG_TITLE\' | translate }}</h1>\r\n<div mat-dialog-content class="pip-content">\r\n  <mat-progress-bar mode="indeterminate" class="pip-loading" *ngIf="loading$ | async"></mat-progress-bar>\r\n  <form fxLayout="column" [formGroup]="form">\r\n    <mat-form-field>\r\n      <mat-select [placeholder]="\'SEND_SIGNAL_TYPE\' | translate" formControlName="type">\r\n        <mat-option *ngFor="let type of signalTypes" [value]="type.value">\r\n          {{ type.title | translate }}\r\n        </mat-option>\r\n      </mat-select>\r\n    </mat-form-field>\r\n    <pip-button-toggle-group>\r\n      <mat-button-toggle-group [value]="listType">\r\n        <mat-button-toggle fxFlex="fill" value="objects" (change)="listType = $event.value" [disabled]="loading$ | async">\r\n          {{ \'SEND_SIGNAL_OBJECTS\' | translate }}\r\n        </mat-button-toggle>\r\n        <mat-button-toggle fxFlex="fill" value="zones" (change)="listType = $event.value" [disabled]="loading$ | async">\r\n          {{ \'SEND_SIGNAL_ZONES\' | translate }}\r\n        </mat-button-toggle>\r\n      </mat-button-toggle-group>\r\n    </pip-button-toggle-group>\r\n    <mat-form-field *ngIf="listType === \'objects\'" style="margin-top: 16px;">\r\n      <mat-chip-list #chipObjectsList>\r\n        <mat-chip *ngFor="let object of objects" removable (removed)="remove(\'object\', object)" [disabled]="loading$ | async">\r\n          <pip-picture resize="false" [src]="serverUrl + \'/api/v1/blobs/\' + object.id" [letterIcon]="object.name"></pip-picture>\r\n          {{ object.name }}\r\n          <mat-icon matChipRemove>cancel</mat-icon>\r\n        </mat-chip>\r\n        <mat-chip *ngFor="let group of groups" removable (removed)="remove(\'group\', group)" [disabled]="loading$ | async">\r\n          <pip-picture resize="false" [src]="serverUrl + \'/api/v1/blobs/\' + group.id" [letterIcon]="group.name"></pip-picture>\r\n          {{ group.name }}\r\n          <mat-icon matChipRemove>cancel</mat-icon>\r\n        </mat-chip>\r\n        <input [placeholder]="\'SEND_SIGNAL_OBJECTS_OR_GROUPS\' | translate" #objectInput formControlName="object"\r\n               [matAutocomplete]="autoObjects" [matChipInputFor]="chipObjectsList" cdkFocusInitial>\r\n      </mat-chip-list>\r\n      <mat-autocomplete #autoObjects="matAutocomplete" (optionSelected)="selected($event)">\r\n        <mat-option *ngFor="let obj of filteredObjects$ | async" [value]="[\'object\', obj]">\r\n          {{ obj.name }}\r\n        </mat-option>\r\n        <mat-option *ngFor="let group of filteredGroups$ | async" [value]="[\'group\', group]">\r\n          {{ group.name }}\r\n        </mat-option>\r\n      </mat-autocomplete>\r\n    </mat-form-field>\r\n    <mat-form-field *ngIf="listType === \'zones\'" style="margin-top: 16px;">\r\n      <mat-chip-list #chipZonesList>\r\n        <mat-chip *ngFor="let zone of zones" removable (removed)="remove(\'zone\', zone)" [disabled]="loading$ | async">\r\n          <pip-picture resize="false" [src]="serverUrl + \'/api/v1/blobs/\' + zone.id" [letterIcon]="zone.name"></pip-picture>\r\n          {{ zone.name }}\r\n          <mat-icon matChipRemove>cancel</mat-icon>\r\n        </mat-chip>\r\n        <input [placeholder]="\'SEND_SIGNAL_ZONES\' | translate" #zoneInput formControlName="zone" [matAutocomplete]="autoZones"\r\n               [matChipInputFor]="chipZonesList">\r\n      </mat-chip-list>\r\n      <mat-autocomplete #autoZones="matAutocomplete" (optionSelected)="selected($event)">\r\n        <mat-option *ngFor="let zone of filteredZones$ | async" [value]="[\'zone\', zone]">\r\n          {{ zone.name }}\r\n        </mat-option>\r\n      </mat-autocomplete>\r\n    </mat-form-field>\r\n  </form>\r\n</div>\r\n<div mat-dialog-actions align="end">\r\n  <button mat-button matDialogClose [disabled]="loading$ | async">{{ \'SEND_SIGNAL_CANCEL\' | translate }}</button>\r\n  <button mat-button (click)="onSubmit()" [disabled]="disableSendButton">\r\n    {{ \'SEND_SIGNAL_SEND\' | translate }}\r\n  </button>\r\n</div>',styles:[":host mat-chip pip-picture{width:32px;height:32px;border-radius:16px;margin-left:-12px;margin-right:12px}:host mat-chip pip-picture img{height:32px!important;width:32px!important}:host button[mat-button]{text-transform:uppercase}:host /deep/ .mat-button-toggle-appearance-standard .mat-button-toggle-label-content{line-height:36px}/deep/ .mat-dialog-container{position:relative}/deep/ .mat-dialog-container .pip-loading{position:absolute;left:0;top:0}/deep/ .bootbarn-cool-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .bootbarn-cool-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .bootbarn-mono-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .bootbarn-mono-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .bootbarn-warm-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .bootbarn-warm-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-amber-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .pip-amber-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-black-theme .pip-error-snackbar{background-color:#d50000;min-width:0;font-weight:800}/deep/ .pip-black-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-blue-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .pip-blue-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .candy-theme .pip-error-snackbar{background-color:#f44336;min-width:0;font-weight:800}/deep/ .candy-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-dark-theme .pip-error-snackbar{background-color:#d50000;min-width:0;font-weight:800}/deep/ .pip-dark-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-green-theme .pip-error-snackbar{background-color:#d50000;min-width:0;font-weight:800}/deep/ .pip-green-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-grey-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .pip-grey-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-navy-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .pip-navy-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-orange-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .pip-orange-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .pip-pink-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .pip-pink-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .unicorn-dark-theme .pip-error-snackbar{background-color:#ff5722;min-width:0;font-weight:800}/deep/ .unicorn-dark-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .mst-black-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .mst-black-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .mst-black-dark-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .mst-black-dark-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .mst-mono-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .mst-mono-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .mst-orange-theme .pip-error-snackbar{background-color:#d32f2f;min-width:0;font-weight:800}/deep/ .mst-orange-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .mst-orange-dark-theme .pip-error-snackbar{background-color:#d32f2f;min-width:0;font-weight:800}/deep/ .mst-orange-dark-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}/deep/ .mst-elegant-theme .pip-error-snackbar{background-color:#ff5252;min-width:0;font-weight:800}/deep/ .mst-elegant-theme .pip-error-snackbar .mat-simple-snackbar-action{display:none}"]}]}],Zs.ctorParameters=function(){return[{type:a.FormBuilder},{type:c.MatDialogRef},{type:Ho},{type:Jo},{type:Yo},{type:Tt},{type:c.MatSnackBar},{type:hs},{type:g.TranslateService},{type:Js}]},Zs.propDecorators={objectInput:[{type:v.ViewChild,args:["objectInput"]}],zoneInput:[{type:v.ViewChild,args:["zoneInput"]}]},Zs);function Zs(t,e,n,r,i,o,s,a,c,p){var l=this;this.fb=t,this.dialogRef=e,this.currentObjectStatesService=n,this.objectsService=r,this.objectGroupsService=i,this.sessionConfigService=o,this.snackBar=s,this.signalsSend=a,this.translate=c,this.zonesService=p,this.listType="objects",this.objects=[],this.allObjects=[],this.groups=[],this.allGroups=[],this.zones=[],this.allZones=[],this.subs=new O.Subscription,this.loading$=new O.BehaviorSubject(!1),this.translate.setTranslation("en",ws,!0),this.translate.setTranslation("ru",Ns,!0),this.signalTypes=Object.entries(cs).filter(function(t){return Number.isNaN(parseInt(t[0],10))&&0<parseInt(t[1],10)}).map(function(t){return{title:"SIGNAL_TYPE_"+t[0].toUpperCase(),value:t[1]}}),this.form=this.fb.group({type:[cs.Attention],object:[""],zone:[""]}),this.subs.add(this.objectsService.objects$.subscribe(function(t){l.allObjects=t})),this.subs.add(this.objectGroupsService.groups$.subscribe(function(t){l.allGroups=t})),this.subs.add(this.zonesService.zones$.subscribe(function(t){l.allZones=t})),this.filteredObjects$=this.form.get("object").valueChanges.pipe(C.startWith(null),C.map(function(t){return"string"==typeof t?l._filterObjects(t):l.allObjects.slice()})),this.filteredGroups$=this.form.get("object").valueChanges.pipe(C.startWith(null),C.map(function(t){return"string"==typeof t?l._filterGroups(t):l.allGroups.slice()})),this.filteredZones$=this.form.get("zone").valueChanges.pipe(C.startWith(null),C.map(function(t){return"string"==typeof t?l._filterZones(t):l.allZones.slice()})),this.serverUrl=this.sessionConfigService.serverUrl}var Ys=(Vs.prototype.ngOnInit=function(){this.navService.showNavMenu({sections:[this.sections.home,this.sections.signout]})},Vs.prototype.ngOnDestroy=function(){this.subs.unsubscribe()},Vs.prototype.ngOnChanges=function(t){(t.hasOwnProperty("language")||t.hasOwnProperty("groups"))&&(this.language=t.hasOwnProperty("language")?t.language.currentValue:this.language,this.groups=t.hasOwnProperty("groups")?t.groups.currentValue:this.groups,this.changeMenuItems())},Vs.prototype.createDefaultFavorites=function(){var t,e,n,r,i=[];try{for(var o=P(this.groups),s=o.next();!s.done;s=o.next()){var a=s.value;a.name!==this.applicationsConfigService.favoritesGroupName&&i.push.apply(i,R(a.applications))}}catch(g){t={error:g}}finally{try{s&&!s.done&&(e=o["return"])&&e.call(o)}finally{if(t)throw t.error}}var c={name:this.applicationsConfigService.favoritesGroupName,icon:"star_rate",links:[]};try{for(var p=P(this.applicationsConfigService.config.defaultFavoritesIds),l=p.next();!l.done;l=p.next()){var u=l.value,h=I.find(i,["id",u]);h&&c.links.push(this.convertApplicationTileToLink(h))}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=p["return"])&&r.call(p)}finally{if(n)throw n.error}}return c},Vs.prototype.convertApplicationTileToLink=function(t){var e={name:t.id,title:t.name[this.language],href:t.url};return t.icon&&t.icon.includes("-")&&(e.fontSet=t.icon.split("-")[0]),e.icon=t.icon,e},Vs.prototype.convertApplicationGroupToSection=function(t,e){var n,r;void 0===e&&(e=!1);var i={name:t.name,icon:t.name===this.applicationsConfigService.favoritesGroupName?"star_rate":"menu",links:[]};e&&(i.title=t.name,i.isCollapsable=e);try{for(var o=P(t.applications),s=o.next();!s.done;s=o.next()){var a=s.value;i.links.push(this.convertApplicationTileToLink(a))}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o["return"])&&r.call(o)}finally{if(n)throw n.error}}return i},Vs.prototype.changeMenuItems=function(){var t,e;if(this.groups&&this.language){var n=[];if(this.menuMode===Jn.Favorites){var r=I.find(this.groups,["name",this.applicationsConfigService.favoritesGroupName]);r&&r.applications.length?n.push(this.convertApplicationGroupToSection(r)):n.push(this.createDefaultFavorites())}else try{for(var i=P(this.groups),o=i.next();!o.done;o=i.next()){var s=o.value;s&&s.applications.length&&n.push(this.convertApplicationGroupToSection(s,!0))}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=i["return"])&&e.call(i)}finally{if(t)throw t.error}}this.navService.showNavMenu({sections:R([this.sections.home],n,[this.sections.signout])})}},Vs.prototype.toggleOrganizationsView=function(){this.organizationsOpened$.next(!this.organizationsOpened$.getValue())},Vs.prototype.changeOrganization=function(t){this.organizationsOpened$.next(!1),this.changeCurrentOrganization.emit(t)},Vs.decorators=[{type:v.Component,args:[{selector:"iqs-sidenav",template:'<div fxHide fxShow.lt-md>\r\n  <div class="iqs-organization-picker" (click)="toggleOrganizationsView()" fxLayout="row" fxLayoutAlign=" center">\r\n    <img src="https://via.placeholder.com/48" />\r\n    <div fxFlex="grow">{{ currentOrganization?.name }}</div>\r\n    <mat-icon [ngClass]="{\'rotated\': (organizationsOpened$ | async)}">arrow_drop_down</mat-icon>\r\n  </div>\r\n</div>\r\n<pip-nav-menu *ngIf="!(organizationsMode$ | async)"></pip-nav-menu>\r\n<div *ngIf="(organizationsMode$ | async) && organizations && organizations.length">\r\n  <div fxFlex="grow">\r\n    <mat-nav-list dense>\r\n      <ng-container *ngFor="let organization of organizations">\r\n        <mat-list-item (click)="changeOrganization(organization)" *ngIf="organization?.id !== currentOrganization?.id">\r\n          <img matListAvatar src="https://via.placeholder.com/48" />\r\n          <h3 matLine class="pip-link-title">{{ organization.name }}</h3>\r\n        </mat-list-item>\r\n      </ng-container>\r\n      <mat-divider></mat-divider>\r\n      <mat-list-item>\r\n        <mat-icon matListIcon>add_box</mat-icon>\r\n        <h3 matLine class="pip-link-title">{{ \'SiDENAV.ORGANIZATION.CONNECT\' | translate }}</h3>\r\n      </mat-list-item>\r\n      <mat-list-item>\r\n        <mat-icon matListIcon>remove_circle</mat-icon>\r\n        <h3 matLine class="pip-link-title">{{ \'SiDENAV.ORGANIZATION.DISCONNECT\' | translate }}</h3>\r\n      </mat-list-item>\r\n    </mat-nav-list>\r\n  </div>\r\n</div>',animations:[o.trigger("slideInOut",[o.state("in",o.style({opacity:"1",visibility:"visible"})),o.state("void",o.style({"max-height":"0px",opacity:"0",visibility:"hidden"})),o.transition("in => void",[o.group([o.animate("80ms ease-in-out",o.style({opacity:"0"})),o.animate("100ms ease-in-out",o.style({"max-height":"0px"})),o.animate("150ms ease-in-out",o.style({visibility:"hidden"}))])]),o.transition("void => in",[o.group([o.animate("1ms 150ms ease-in-out",o.style({visibility:"visible"})),o.animate("100ms 150ms ease-in-out",o.style({"max-height":"*"})),o.animate("150ms 150ms ease-in-out",o.style({opacity:"1"}))])])]),o.trigger("zoomInOut",[o.state("in",o.style({opacity:"1",visibility:"visible",display:"inline"})),o.state("void",o.style({"max-height":"0px",opacity:"0",visibility:"hidden"})),o.transition("in => void",[o.group([o.animate("80ms ease-in-out",o.style({opacity:"0"})),o.animate("100ms ease-in-out",o.style({"max-height":"0px",transform:"scale(0.7)"})),o.animate("150ms ease-in-out",o.style({visibility:"hidden"}))])]),o.transition("void => in",[o.group([o.animate("1ms 150ms ease-in-out",o.style({visibility:"visible"})),o.animate("100ms 150ms ease-in-out",o.style({"max-height":"*"})),o.animate("150ms 150ms ease-in-out",o.style({opacity:"1"}))])])])],styles:[".iqs-organization-picker{padding:16px 16px 16px 0;font-family:Roboto,'Helvetica Neue',sans-serif}.iqs-organization-picker img{margin:0 16px;border-radius:50%;max-width:48px}.iqs-organization-picker mat-icon{transition:.3s ease-in-out}.iqs-organization-picker mat-icon.rotated{transform:rotate(180deg)}.bootbarn-cool-theme :host .iqs-organization-picker{background-color:#455a64;color:#fff}.bootbarn-mono-theme :host .iqs-organization-picker{background-color:#263238;color:#fff}.bootbarn-warm-theme :host .iqs-organization-picker{background-color:#b13722;color:#fff}.pip-amber-theme :host .iqs-organization-picker{background-color:#ff9800;color:#fff}.pip-black-theme :host .iqs-organization-picker{background-color:#263238;color:#fff}.pip-blue-theme :host .iqs-organization-picker{background-color:#2196f3;color:#fff}.candy-theme :host .iqs-organization-picker{background-color:#3f51b5;color:#fff}.pip-dark-theme :host .iqs-organization-picker{background-color:#212121;color:#fff}.pip-green-theme :host .iqs-organization-picker{background-color:#4caf50;color:#fff}.pip-grey-theme :host .iqs-organization-picker{background-color:#607d8b;color:#fff}.pip-navy-theme :host .iqs-organization-picker{background-color:#56617d;color:#fff}.pip-orange-theme :host .iqs-organization-picker{background-color:#ff7043;color:#fff}.pip-pink-theme :host .iqs-organization-picker{background-color:#bc5679;color:#fff}.unicorn-dark-theme :host .iqs-organization-picker{background-color:#607d8b;color:#fff}.mst-black-theme :host .iqs-organization-picker{background-color:#1e1e1e;color:#fff}.mst-black-dark-theme :host .iqs-organization-picker{background-color:#1e1e1e;color:#fff}.mst-mono-theme :host .iqs-organization-picker{background-color:#1e1e1e;color:#fff}.mst-orange-theme :host .iqs-organization-picker{background-color:#e17100;color:#fff}.mst-orange-dark-theme :host .iqs-organization-picker{background-color:#e17100;color:#fff}.mst-elegant-theme :host .iqs-organization-picker{background-color:#007681;color:#fff}"]}]}],Vs.ctorParameters=function(){return[{type:vt},{type:m.PipMediaService},{type:y.PipNavService},{type:ze},{type:Le},{type:g.TranslateService}]},Vs.propDecorators={groups:[{type:v.Input}],language:[{type:v.Input}],organizations:[{type:v.Input}],currentOrganization:[{type:v.Input}],changeCurrentOrganization:[{type:v.Output}]},Vs);function Vs(t,e,n,r,i,o){var s=this;this.applicationsConfigService=t,this.media=e,this.navService=n,this.sessionService=r,this.settingsService=i,this.translate=o,this.organizationsOpened$=new O.BehaviorSubject(!1),this.sections={home:{name:"home",links:[{name:"SIDEBAR_HOME",title:"SIDEBAR_HOME",icon:"home",tooltipText:"SIDEBAR_HOME_TOOLTIP",href:"/home/index.html"}]}},this.changeCurrentOrganization=new v.EventEmitter,this.subs=new O.Subscription,this.sections.signout={name:"so",links:[{name:"SIDEBAR_SIGNOUT",title:"SIDEBAR_SIGNOUT",fontSet:"webui",icon:"webui-exit",tooltipText:"SIDEBAR_SIGNOUT_TOOLTIP",click:function(){s.sessionService.signout()}}]};var a=function c(t){var e,n;return{en:((e={"SiDENAV.ORGANIZATION.CONNECT":"Connect to organization","SiDENAV.ORGANIZATION.DISCONNECT":"Disconnect from organization"})[t]="Favorite",e.apps="Applications",e.analytics="Analytics",e.administration="Administration",e.config="Configuration",e.management="Management",e),ru:((n={"SiDENAV.ORGANIZATION.CONNECT":"Подключиться к сайту","SiDENAV.ORGANIZATION.DISCONNECT":"Отключиться от сайта"})[t]="Избранное",n.apps="Приложения",n.analytics="Аналитика",n.administration="Администрирование",n.config="Конфигурации",n.management="Управление",n)}}(this.applicationsConfigService.favoritesGroupName);this.translate.setTranslation("en",a.en,!0),this.translate.setTranslation("ru",a.ru,!0),this.organizationsMode$=O.combineLatest(this.organizationsOpened$,this.media.asObservableMain()).pipe(C.map(function(t){var e=$(t,2),n=e[0],r=e[1];return n&&r.aliases.includes("lt-md")})),this.menuMode$=this.settingsService.settings$.pipe(C.filter(function(t){return null!==t}),C.switchMap(function(t){return O.of(t.menu_mode||Jn.Favorites)})),this.subs.add(this.menuMode$.subscribe(function(t){s.menuMode=t,s.changeMenuItems()}))}var Ws=(Ks.decorators=[{type:v.NgModule,args:[{declarations:[Ys],exports:[Ys],imports:[E.CommonModule,p.FlexLayoutModule,c.MatListModule,c.MatIconModule,g.TranslateModule,y.PipNavMenuModule],schemas:[v.CUSTOM_ELEMENTS_SCHEMA]}]}],Ks);function Ks(){}var Qs=[Ss,Ws,Is],Xs=(ta.decorators=[{type:v.NgModule,args:[{imports:R([E.CommonModule],Qs),exports:Qs}]}],ta);function ta(){}var ea={en:"English",ru:"Русский",HOME_TITLE:"Home",APPBAR_SEND_SIGNAL:"Send signal",APPBAR_USERSETTINGS:"User settings",APPBAR_HELP:"Help",APPBAR_SIGNOUT:"Sign Out",RIGHTNAV_NOTIFICATIONS:"Notifications",SIDEBAR_SIGNOUT:"Sign Out",SIDEBAR_SIGNOUT_TOOLTIP:"Sign Out",SIDEBAR_HOME:"Home",SIDEBAR_HOME_TOOLTIP:"Home"},na={en:"English",ru:"Русский",HOME_TITLE:"Главная",APPBAR_SEND_SIGNAL:"Послать сигнал",APPBAR_USERSETTINGS:"Настройки пользователя",APPBAR_HELP:"Помощь",APPBAR_SIGNOUT:"Выйти",RIGHTNAV_NOTIFICATIONS:"Оповещения",SIDEBAR_SIGNOUT:"Выйти",SIDEBAR_SIGNOUT_TOOLTIP:"Выйти",SIDEBAR_HOME:"Главная",SIDEBAR_HOME_TOOLTIP:"Главная"},ra=s,ia=(oa.prototype.ngOnInit=function(){this.emergencyService.init()},oa.prototype.ngOnDestroy=function(){this.subs.unsubscribe()},oa.prototype.changeCurrentOrganization=function(t){this.organizationsService.current=t,this.sidenavService.opened&&this.sidenavService.closeNav()},oa.prototype.closeRightnav=function(){this.rightnavService.closeFloatingRightnav()},oa.decorators=[{type:v.Component,args:[{selector:"app-root",template:'<pip-root-layout>\r\n    <pip-rightnav-floating fxLayout="column">\r\n        <div class="pip-rightnav-header" fxLayout="row" fxLayoutAlign=" center">\r\n            <mat-icon [ngStyle]="{\'opacity\': (rightnav.showBack$ | async) ? \'1\' : \'0\'}" [disabled]="!(rightnav.showBack$ | async)"\r\n                      (click)="rightnav.goBackHandler()">arrow_back</mat-icon>\r\n            <div class="pip-rigntnav-title" fxFlex="grow">{{ rightnav.title$ | async | translate }}</div>\r\n            <mat-icon (click)="closeRightnav()">close</mat-icon>\r\n        </div>\r\n        <ng-container [ngSwitch]="rightnav.state$ | async">\r\n            <iqs-emergency-panel *ngSwitchCase="\'Emergency\'"></iqs-emergency-panel>\r\n            <iqs-help-panel *ngSwitchCase="\'Help\'" [language]="language$ | async"></iqs-help-panel>\r\n            <iqs-notifications-panel *ngSwitchCase="\'Notifications\'"></iqs-notifications-panel>\r\n        </ng-container>\r\n    </pip-rightnav-floating>\r\n    \x3c!-- Content --\x3e\r\n    <pip-root-content>\r\n        \x3c!-- Appbar --\x3e\r\n        <pip-appbar>\r\n            <pip-nav-icon> </pip-nav-icon>\r\n            <pip-breadcrumb> </pip-breadcrumb>\r\n            <div fxFlex></div>\r\n            <div fxHide.lt-md *ngIf="isAuthorized$ | async">\r\n                <button class="iqs-shell-organizations-button" mat-button [matMenuTriggerFor]="organizations" #organizationsTrigger="matMenuTrigger"\r\n                        *ngIf="currentOrganization$ | async" [disabled]="(organizationsState$ | async) !== \'data\'">\r\n                    <mat-icon fontSet="iqt" fontIcon="iqt-organization"></mat-icon>\r\n                    <span>{{ (currentOrganization$ | async).name }}</span>\r\n                    <mat-icon>{{ organizationsTrigger.menuOpen ? \'arrow_drop_up\' : \'arrow_drop_down\' }}</mat-icon>\r\n                </button>\r\n                <mat-menu #organizations>\r\n                    <ng-container *ngFor="let organization of organizations$ | async">\r\n                        <button mat-menu-item *ngIf="organization.id !== (currentOrganization$ | async)?.id" (click)="changeCurrentOrganization(organization)">{{\r\n                            organization.name }}</button>\r\n                    </ng-container>\r\n                </mat-menu>\r\n            </div>\r\n            <pip-primary-actions></pip-primary-actions>\r\n            <pip-secondary-actions></pip-secondary-actions>\r\n        </pip-appbar>\r\n        \x3c!-- Main --\x3e\r\n        <pip-main-layout-alt fxFlex="grow">\r\n            \x3c!-- Sidenav --\x3e\r\n            <pip-sidenav *ngIf="isAuthorized$ | async">\r\n                <iqs-sidenav [groups]="applicationsGroups$ | async" [organizations]="organizations$ | async" [currentOrganization]="currentOrganization$ | async"\r\n                             [language]="language$ | async" (changeCurrentOrganization)="changeCurrentOrganization($event)"></iqs-sidenav>\r\n            </pip-sidenav>\r\n            \x3c!-- Content --\x3e\r\n            <pip-main-content>\r\n                <pip-shadow [visible]="(config$ | async).shadows.top" attachmentSide="top"> </pip-shadow>\r\n                <pip-shadow [visible]="(config$ | async).shadows.left" attachmentSide="left"></pip-shadow>\r\n                <pip-shadow [visible]="(config$ | async).shadows.right" attachmentSide="right"></pip-shadow>\r\n                <router-outlet></router-outlet>\r\n            </pip-main-content>\r\n        </pip-main-layout-alt>\r\n    </pip-root-content>\r\n</pip-root-layout>',styles:[".iqs-shell-organizations-button mat-icon.iqt{line-height:28px}.pip-rightnav-header{padding:12px;cursor:pointer;font-family:Roboto,'Helvetica Neue',sans-serif;min-height:56px}.pip-rightnav-header .pip-rigntnav-title{margin-left:.5em;font-size:1.2em;font-weight:500;overflow:hidden;text-overflow:ellipsis}/deep/ mat-sidenav.pip-rightnav{width:320px!important;max-width:320px!important}"]}]}],oa.ctorParameters=function(){return[{type:S.PipThemesService},{type:Pn},{type:v.ChangeDetectorRef},{type:c.MatDialog},{type:br},{type:ze},{type:f.LocalStorageService},{type:y.PipNavService},{type:m.PipRightnavService},{type:m.PipSidenavService},{type:Bn},{type:On},{type:g.TranslateService},{type:Z,decorators:[{type:v.Inject,args:[U]}]},{type:Zn},{type:Wr}]},oa);function oa(t,e,n,r,i,o,s,a,c,p,l,u,h,g,f,d){var m=this;this.themeService=t,this.applicationsService=e,this.cd=n,this.dialog=r,this.emergencyService=i,this.sessionService=o,this.localStorageService=s,this.navService=a,this.rightnavService=c,this.sidenavService=p,this.shell=l,this.organizationsService=u,this.translate=h,this.window=g,this.emergencyPanelService=f,this.helpPanelService=d,this.subs=new O.Subscription,this.sidenavService.active=!0,this.config$=this.shell.config$,this.rightnav={state$:this.shell.rightnavState$,title$:this.shell.rightnavTitle$,showBack$:this.shell.rightnavShowBack$,goBackHandler:function(){}},this.currentOrganization$=this.organizationsService.current$,this.isAuthorized$=this.sessionService.isAuthorized$,this.organizations$=this.organizationsService.organizations$,this.organizationsState$=this.organizationsService.state$,this.sessionService.restore();var y=this.localStorageService.get("language");y=(y=y||localStorage.getItem("language"))||(this.sessionService.session&&this.sessionService.session.user&&this.sessionService.session.user.language?this.sessionService.session.user.language:"en"),this.language$=new O.BehaviorSubject(y),this.translate.setTranslation("en",ea,!0),this.translate.setTranslation("ru",na,!0),this.subs.add(this.translate.onLangChange.subscribe(function(t){m.localStorageService.set("language",t.lang),ra.locale(t.lang),m.language$.next(t.lang);var e=m.sessionService.session;e&&e.user&&(e.user.language=t.lang,m.localStorageService.set("session",e))})),this.translate.use(this.language$.getValue());var S=!0;this.subs.add(this.sessionService.session$.pipe(C.distinct()).subscribe(function(t){if(t&&t.user&&t.user.language){if(S)return void(S=!0);m.language$.next(t.user.language),m.translate.use(m.language$.getValue())}S=!1})),this.navService.showNavIcon({icon:"menu",action:function(){m.sidenavService.toggleOpened()}}),this.navService.showPrimaryActions({actions:[{name:"emergency",icon:"iqt-emergency",fontSet:"iqt",click:function(){m.shell.rightnavState=Gn.Emergency,m.rightnav.goBackHandler=m.emergencyPanelService.goBack.bind(m.emergencyPanelService),m.cd.detectChanges(),m.rightnavService.openFloatingRightnav()}},{name:"help",icon:"help",click:function(){m.shell.rightnavState=Gn.Help,m.rightnav.goBackHandler=m.helpPanelService.goBack.bind(m.helpPanelService),m.cd.detectChanges(),m.rightnavService.openFloatingRightnav()}}]}),this.navService.showSecondaryActions({actions:[{name:"send_signal",title:"APPBAR_SEND_SIGNAL",click:function(){m.shell.showSendSignal()}},{name:"usersettings",title:"APPBAR_USERSETTINGS",click:function(){m.window.location.href=m.window.location.origin+"/settings/index.html#"}},{name:"signout",title:"APPBAR_SIGNOUT",click:function(){m.sessionService.signout()}}]}),this.applicationsGroups$=this.applicationsService.groups$,this.subs.add(this.shell.onSendSignal.subscribe(function(){m.dialog.open(Hs)}))}var sa=function zp(){},aa=function Tp(){},ca=(pa.decorators=[{type:v.NgModule,args:[{imports:[_.StoreModule.forFeature("zones",qs),A.EffectsModule.forFeature([xs])],exports:[],providers:[$s,Js]}]}],pa);function pa(){}var la=(ua.decorators=[{type:v.NgModule,args:[{declarations:[ia,Hs],entryComponents:[Hs],exports:[ia],imports:[E.CommonModule,p.FlexLayoutModule,c.MatAutocompleteModule,c.MatButtonModule,c.MatButtonToggleModule,c.MatChipsModule,c.MatDialogModule,c.MatFormFieldModule,c.MatIconModule,c.MatInputModule,c.MatMenuModule,c.MatProgressBarModule,c.MatSelectModule,c.MatSnackBarModule,a.ReactiveFormsModule,b.RouterModule,g.TranslateModule,m.PipAppbarModule.forRoot(),y.PipBreadcrumbModule,l.PipButtonToggleGroupModule,m.PipMainLayoutAltModule,y.PipNavIconModule,u.PipPictureModule,y.PipPrimaryActionsModule,m.PipRootLayoutModule,m.PipShadowModule,y.PipSecondaryActionsModule,Mn,Mr.forRoot(),ii.forRoot(),Ws,Wo,fs,ca],schemas:[v.CUSTOM_ELEMENTS_SCHEMA]}]}],ua);function ua(){}var ha=[{path:"404",component:Os}],ga=(fa.decorators=[{type:v.NgModule,args:[{imports:[b.RouterModule.forRoot(ha)],exports:[b.RouterModule]}]}],fa);function fa(){}var da=function jp(){},ma={organizations:[],current:null,state:"empty",error:null};function ya(t,e){switch(void 0===t&&(t=ma),e.type){case Ge.OrganizationsInit:return(r=(r=(r=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case Ge.OrganizationsAbort:return(r=(r=w.fromJS(t)).set("state",t.error?"error":t.organizations&&t.organizations.length?"data":"empty")).toJS();case Ge.OrganizationsSuccess:return(r=(r=w.fromJS(t)).set("error",null)).toJS();case Ge.OrganizationsFailure:return(r=(r=(r=w.fromJS(t)).set("state","error")).set("error",e.payload)).toJS();case Ge.OrganizationsData:return(r=(r=(r=(r=w.fromJS(t)).set("organizations",e.payload)).set("state","data")).set("error",null)).toJS();case Ge.OrganizationsEmpty:return(r=(r=(r=(r=w.fromJS(t)).set("organizations",[])).set("state","empty")).set("error",null)).toJS();case Ge.OrganizationsCurrent:return(r=(r=w.fromJS(t)).set("current",e.payload)).toJS();case Ge.OrganizationsCurrentChangeInit:return(r=(r=w.fromJS(t)).set("state","progress")).toJS();case Ge.OrganizationsCurrentChangeAbort:return(r=(r=w.fromJS(t)).set("state",t.error||!t.current?"error":"data")).toJS();case Ge.OrganizationsCurrentChangeSuccess:return(r=(r=(r=(r=w.fromJS(t)).set("current",e.payload)).set("state","data")).set("error",null)).toJS();case Ge.OrganizationsCurrentChangeFailure:return(r=(r=(r=w.fromJS(t)).set("state","error")).set("error",e.payload)).toJS();case Ge.OrganizationsCreateInit:return(r=(r=(r=w.fromJS(t)).set("state","progress")).set("error",null)).toJS();case Ge.OrganizationsCreateAbort:return(r=(r=w.fromJS(t)).set("state",t.error?"error":t.organizations&&t.organizations.length?"data":"empty")).toJS();case Ge.OrganizationsCreateSuccess:return(n=(r=w.fromJS(t)).get("organizations").toJS()).push(e.payload),(r=(r=(r=r.set("organizations",n)).set("state","data")).set("error",null)).toJS();case Ge.OrganizationsCreateFailure:return(r=(r=(r=w.fromJS(t)).set("state","error")).set("error",e.payload)).toJS();case Ge.OrganizationsConnectInit:return(r=(r=w.fromJS(t)).set("state","progress")).toJS();case Ge.OrganizationsConnectSuccess:return(n=(r=w.fromJS(t)).get("organizations").toJS()).push(e.payload),(r=(r=(r=r.set("organizations",n)).set("state","data")).set("error",null)).toJS();case Ge.OrganizationsConnectFailure:return(r=(r=(r=w.fromJS(t)).set("state","error")).set("error",e.payload)).toJS();case Ge.OrganizationsDisconnectInit:return(r=(r=w.fromJS(t)).set("state","progress")).toJS();case Ge.OrganizationsDisconnectSuccess:var n=(r=w.fromJS(t)).get("organizations").toJS().filter(function(t){return t.id!==e.payload.id});return(r=(r=(r=r.set("organizations",n)).set("state","data")).set("error",null)).toJS();case Ge.OrganizationsDisconnectFailure:var r;return(r=(r=(r=w.fromJS(t)).set("state","error")).set("error",e.payload)).toJS();default:return t}}var Sa=(ba.decorators=[{type:v.NgModule,args:[{imports:[E.CommonModule,_.StoreModule.forFeature("organizations",ya),A.EffectsModule.forFeature([dn])],providers:[gn,On]}]}],ba);function ba(){}function va(t,e){var n=e.get(dt,{});return I.merge({},n,t)}var Ea=(Oa.forRoot=function(t){return{ngModule:Oa,providers:[Qo,d.CookieService,{provide:mt,useValue:t||{}},{provide:yt,useFactory:va,deps:[mt,v.Injector]},{provide:S.THEMES_CONFIG,useValue:{defaultThemeName:S.DEFAULT_THEMES_CONFIG.defaultThemeName,themes:S.DEFAULT_THEMES_CONFIG.themes,lsKey:"ngx-theme"}},Tt,ns,St,vt,Bn,Q]}},Oa.decorators=[{type:v.NgModule,args:[{imports:[A.EffectsModule.forRoot([]),h.HttpClientModule,f.LocalStorageModule.withConfig({prefix:"iqs-clients2",storageType:"localStorage"}),_.StoreModule.forRoot({}),g.TranslateModule.forRoot(),y.PipNavModule.forRoot(),m.PipMediaModule.forRoot(),m.PipRightnavModule.forRoot(),m.PipSidenavModule.forRoot(),S.PipThemesModule.forRoot(),ga,Xs,la,os,Rn,Sa]}]}],Oa);function Oa(){}t.CommonDataService=x,t.DataPage=F,t.MultiString=q,t.windowFactory=V,t.WINDOW=U,t.WindowRef=L,t.BrowserWindowRef=J,t.WindowWrapper=Z,t.windowProvider=K,t.WINDOW_PROVIDERS=Q,t.pausableInterval=X,t.generateUUID=tt,t.Application=et,t.ApplicationConfig=nt,t.applicationConfigDefault=rt,t.ApplicationGroup=it,t.ApplicationTile=at,t.IqsApplicationsConfigService=vt,t.IqsApplicationsDataService=kt,t.IqsApplicationsService=Pn,t.ApplicationsActionType=$t,t.ApplicationsInitAction=Rt,t.ApplicationsAbortAction=xt,t.ApplicationsSuccessAction=Mt,t.ApplicationsFailureAction=Ft,t.ApplicationsEmptyAction=qt,t.ApplicationsDataAction=Ut,t.ApplicationsToggleFavoriteAction=Lt,t.ApplicationsToggleFavoriteSuccessAction=Dt,t.ApplicationsToggleFavoriteFailureAction=Gt,t.ApplicationsEffects=In,t.applicationsReducer=wn,t.applicationsInitialState=An,t.getApplicationsStoreState=Nn,t.getApplicationsData=zn,t.getApplicationsState=Tn,t.getApplicationsToggling=jn,t.getApplicationsError=kn,t.IqsApplicationsModule=Mn,t.IqsEmergencyModule=Mr,t.EmergencyPanelState=qn,t.EmergencyPlan=Un,t.EmergencyPlanAction=Ln,t.EmergencyPlanActionParam={Text:"text",Name:"name",Phone:"phone",Page:"page",Location:"locaton",Position:"pos",Uri:"uri"},t.EmergencyPlanActionType={Note:"note",CallPhone:"call phone",LocalLink:"local link",GlobalLink:"global link"},t.EmergencyStep=Dn,t.IqsEmergencyPanelService=Zn,t.IqsEmergencyDataService=Wn,t.IqsEmergencyService=br,t.EmergencyActionType=Qn,t.EmergencyInitAction=Xn,t.EmergencySuccessAction=tr,t.EmergencyFailureAction=er,t.EmergencyCreateInitAction=nr,t.EmergencyCreateSuccessAction=rr,t.EmergencyCreateFailureAction=ir,t.EmergencyUpdateInitAction=or,t.EmergencyUpdateSuccessAction=sr,t.EmergencyUpdateFailureAction=ar,t.EmergencyDeleteInitAction=cr,t.EmergencyDeleteSuccessAction=pr,t.EmergencyDeleteFailureAction=lr,t.EmergencyEffects=ur,t.emergencyReducer=fr,t.emergencyInitialState=gr,t.getEmergencyStoreState=dr,t.getEmergencyData=mr,t.getEmergencyState=yr,t.getEmergencyError=Sr,t.IqsHelpModule=ii,t.HelpArticle=qr,t.HelpPanelState=Ur,t.HelpTopic=Lr,t.IqsNotificationsModule=Di,t.Notification=si,t.NotificationsPanelState=ai,t.IqsNotificationsPanelService=ci,t.IqsNotificationsDataService=li,t.IqsNotificationsService=ki,t.NotificationsActionType=hi,t.NotificationsInitAction=gi,t.NotificationsAbortAction=fi,t.NotificationsSuccessAction=di,t.NotificationsFailureAction=mi,t.NotificationsEmptyAction=yi,t.NotificationsDataAction=Si,t.NotificationsCountInitAction=bi,t.NotificationsCountAbortAction=vi,t.NotificationsCountSuccessAction=Ei,t.NotificationsCountFailureAction=Oi,t.NotificationsEffects=Ci,t.notificationsReducer=Ai,t.notificationsInitialState=_i,t.getNotificationsStoreState=wi,t.getNotificationsData=Ni,t.getNotificationsCount=zi,t.getNotificationsState=Ti,t.getNotificationsError=ji,t.ControlObject=Bi,t.ControlObjectCategory={People:"person",Equipment:"equipment",Asset:"asset"},t.ControlObjectType={Employee:"employee",Contractor:"contractor",Visitor:"visitor",Excavator:"excavator",HaulTruck:"haul",Drill:"drill",Dozer:"dozer",Grader:"grader",Bus:"bus",WaterTruck:"water",BlastTruck:"blast",SpecialVehicle:"special",LightVehicle:"light",Locomotive:"locomotive",Dumpcar:"dumpcar",VacuumTruck:"vacuum",Pump:"pump",Generator:"generator",Crane:"crane",ForkLift:"fork lift",AccessPoint:"access point",Welding:"welding",Other:"other"},t.ObjectGroup=Hi,t.ObjectState=Zi,t.IqsControlObjectsDataService=Yi,t.IqsControlObjectsService=Jo,t.IqsCurrentObjectStatesDataService=no,t.IqsCurrentObjectStatesService=Ho,t.IqsObjectGroupsDataService=$o,t.IqsObjectGroupsService=Yo,t.CurrentObjectStatesActionType=Ki,t.CurrentObjectStatesInitAction=Qi,t.CurrentObjectStatesAbortAction=Xi,t.CurrentObjectStatesSuccessAction=to,t.CurrentObjectStatesFailureAction=eo,t.CurrentObjectStatesEffects=io,t.currentObjectStatesReducer=ao,t.currentObjectStatesInitialState=so,t.getCurrentObjectStatesStoreState=co,t.getCurrentObjectStatesData=po,t.getCurrentObjectStatesDataByObjectId=lo,t.getCurrentObjectStatesState=uo,t.getCurrentObjectStatesError=ho,t.ControlObjectsActionType=go,t.ControlObjectsInitAction=fo,t.ControlObjectsAbortAction=mo,t.ControlObjectsSuccessAction=yo,t.ControlObjectsFailureAction=So,t.ControlObjectsEffects=bo,t.controlObjectsReducer=Oo,t.controlObjectsInitialState=Eo,t.getControlObjectsStoreState=Io,t.getControlObjectsData=_o,t.getControlObjectById=Ao,t.getControlObjectsState=wo,t.getControlObjectsError=No,t.ObjectGroupsActionType=zo,t.ObjectGroupsInitAction=To,t.ObjectGroupsAbortAction=jo,t.ObjectGroupsSuccessAction=ko,t.ObjectGroupsFailureAction=Po,t.ObjectGroupsEffects=xo,t.objectGroupsReducer=qo,t.objectGroupsInitialState=Fo,t.getObjectGroupsStoreState=Uo,t.getObjectGroupsData=Lo,t.getObjectGroupsState=Do,t.getObjectGroupsError=Go,t.IqsObjectsModule=Wo,t.AuthGuard=Qo,t.IqsSessionAuthInterceptor=ts,t.SessionAuthInterceptorProvider=ns,t.SessionConfig=ut,t.defaultSessionConfig=ht,t.Session=It,t.SignupUser=_t,t.User=At,t.UserRole=Nt,t.userRoleValue=zt,t.IqsSessionConfigService=Tt,t.IqsSessionDataService=be,t.IqsSessionService=ze,t.IqsUsersDataService=rs,t.SessionActionType=ie,t.SessionSigninInitAction=oe,t.SessionSigninAbortAction=se,t.SessionSigninSuccessAction=ae,t.SessionSigninFailureAction=ce,t.SessionSignoutInitAction=pe,t.SessionSignoutAbortAction=le,t.SessionSignoutSuccessAction=ue,t.SessionSignoutFailureAction=he,t.SessionRestoreInitAction=ge,t.SessionRestoreSuccessAction=fe,t.SessionRestoreFailureAction=de,t.SessionCloseAllInitAction=me,t.SessionCloseAllSuccessAction=ye,t.SessionCloseAllFailureAction=Se,t.SessionEffects=Ee,t.sessionReducer=Ie,t.sessionInitialState=Ce,t.getSessionStoreState=_e,t.getSessionSession=Ae,t.getSessionState=we,t.getSessionError=Ne,t.IqsSessionModule=os,t.IqsSettingsDataService=je,t.IqsSettingsService=Le,t.SettingsActionType=Jt,t.SettingsInitAction=Bt,t.SettingsAbortAction=Ht,t.SettingsSuccessAction=Zt,t.SettingsFailureAction=Yt,t.SettingsDataAction=Vt,t.SettingsEmptyAction=Wt,t.SettingsCreateAction=Kt,t.SettingsCreateSuccessAction=Qt,t.SettingsCreateFailureAction=Xt,t.SettingsUpdateAction=te,t.SettingsUpdateSuccessAction=ee,t.SettingsUpdateFailureAction=ne,t.SettingsChangeCancelAction=re,t.SettingsEffects=Pe,t.settingsReducer=xe,t.settingsInitialState=Re,t.getSettingsState=Me,t.getSettingsData=Fe,t.getSettingsEntityState=qe,t.getSettingsError=Ue,t.IqsSettingsModule=Rn,t.Signal=as,t.SignalType=cs,t.IqsSignalsSendService=hs,t.IqsSignalsModule=fs,t.IqsShellModule=Ea,t.SHELL_MODULE_CONFIG=mt,t.defaultShellModuleConfig=gt,t.mockShellModuleConfig=ft,t.SHELL_RUNTIME_CONFIG=dt,t.SHELL_MERGED_CONFIG=yt,t.IqsNotFoundPageModule=Is,t.IqsSendSignalDialogComponent=Hs,t.IqsSidenavModule=Ws,t.IqsShellComponentsModule=Xs,t.IqsAskDialogComponent=ms,t.IqsAskDialogModule=Ss,t.IqsShellContainerComponent=ia,t.IqsShellContainerModule=la,t.RightnavState=Gn,t.ShellConfig=pt,t.defaultShellConfig=lt,t.SidenavMenuMode=Jn,t.IqsConfigService=St,t.IqsShellService=Bn,t.Organization=da,t.IqsOrganizationsDataService=gn,t.IqsOrganizationsService=On,t.OrganizationsActionType=Ge,t.OrganizationsInitAction=Je,t.OrganizationsAbortAction=Be,t.OrganizationsSuccessAction=He,t.OrganizationsFailureAction=Ze,t.OrganizationsDataAction=Ye,t.OrganizationsEmptyAction=Ve,t.OrganizationsCurrentAction=We,t.OrganizationsCurrentChangeInitAction=Ke,t.OrganizationsCurrentChangeAbortAction=Qe,t.OrganizationsCurrentChangeSettingsAction=Xe,t.OrganizationsCurrentChangeSuccessAction=tn,t.OrganizationsCurrentChangeFailureAction=en,t.OrganizationsCreateInitAction=nn,t.OrganizationsCreateAbortAction=rn,t.OrganizationsCreateSuccessAction=on,t.OrganizationsCreateFailureAction=sn,t.OrganizationsConnectInitAction=an,t.OrganizationsConnectSuccessAction=cn,t.OrganizationsConnectFailureAction=pn,t.OrganizationsDisconnectInitAction=ln,t.OrganizationsDisconnectSuccessAction=un,t.OrganizationsDisconnectFailureAction=hn,t.OrganizationsEffects=dn,t.getOrganizationsStoreState=yn,t.getOrganizationsOrganizations=Sn,t.getOrganizationsCurrent=bn,t.getOrganizationsState=vn,t.getOrganizationsError=En,t.IqsOrganizationsModule=Sa,t.Zone=sa,t.ZonePresence=aa,t.IqsZonesDataService=$s,t.IqsZonesService=Js,t.ZonesActionType=zs,t.ZonesInitAction=Ts,t.ZonesAbortAction=js,t.ZonesSuccessAction=ks,t.ZonesFailureAction=Ps,t.ZonesEffects=xs,t.zonesReducer=qs,t.zonesInitialState=Fs,t.getZonesStoreState=Us,t.getZonesData=Ls,t.getZonesState=Ds,t.getZonesError=Gs,t.IqsZonesModule=ca,t.ɵb=wr,t.ɵd=Cr,t.ɵc=_r,t.ɵe=Rr,t.ɵg=jr,t.ɵf=Pr,t.ɵh=Hr,t.ɵj=Dr,t.ɵi=Jr,t.ɵk=ni,t.ɵm=Qr,t.ɵl=ti,t.ɵn=Wr,t.ɵo=Ui,t.ɵq=xi,t.ɵp=Fi,t.ɵv=ya,t.ɵw=ts,t.ɵx=ns,t.ɵs=Os,t.ɵt=Ys,t.ɵu=ga,t.ɵa=va,t.ɵr=ls,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=iqs-libs-clientshell2-angular.umd.min.js.map