@c8y/ngx-components 1011.0.32 → 1011.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var b;function S(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))}function w(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function C(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}!function(t){t.Device="deviceId",t.Group="groupId",t.User="userId",t.Application="applicationId",t.SubscribedApplications="applicationId",t.Tenant="tenantId"}(b||(b={}));var x=function(){function t(t,e,r,o,i,a){this.injector=t,this.appState=e,this.router=r,this.ngZone=o,this.routerService=i,this.actionService=a,this.$liveTabs=new n.BehaviorSubject([]),this.fixE2eIssues(),this.$ng1RouteChangeSuccess=this.fromNg1Event(this.injector.get("$rootScope"),"$routeChangeSuccess"),this.$ng1RouteChangeStart=this.fromNg1Event(this.injector.get("$rootScope"),"$routeChangeStart"),this.hookLanguage(),this.hookTabs(),this.hookNavigator(),this.hookUserMenu(),this.hookViewProvider(),this.router.initialNavigation(),this.ng1Routes()}return t.prototype.hookViewProvider=function(){var t=this,e=this.injector.get("c8yViews");e.when("/device/:id",{template:""}),e.when("/group/:id",{template:""}),e.contextViews.subscribe((function(e){return t.addRoute(e)}))},t.prototype.addRoute=function(t){var n=this;this.routerService.addRoute({label:t.label||t.name,path:t.path,icon:t.icon,context:e.ViewContext[t.contextKey],priority:t.priority,component:e.EmptyComponent,data:{showIf:t.showIf?function(e){var r,o=Object.assign(Object.assign({},e.params),((r={})[b[t.contextKey]]=e.params.id,r)),i=n.injector.invoke(t.showIf,void 0,{$routeParams:o});return n.injector.get("$q").when(i).then(Boolean)}:void 0}}),t.runPhase&&this.routerService.refresh()},t.prototype.ng1Routes=function(){var t=[];for(var n in e.ViewContext){var o=e.ViewContext[n].match(/(\w+)\//)[1],a=new RegExp("^/"+o+"/(?:([^/]+)).*$");t.push({keys:[{name:b[n],optional:!1}],regexp:a,template:""})}var c=this.injector.get("$route");Object.defineProperty(c.routes,"forEach",{value:function(e,n){for(var r in this)e.call(n,this[r],r,this);t.forEach((function(t){return e.call(n,t)}))}});var s=this.injector.get("c8yUiUtil"),u=s.getContext;this.router.events.pipe(r.filter((function(t){return t instanceof i.ActivationEnd}))).subscribe((function(t){"**"===t.snapshot.routeConfig.path?s.getContext=u:t.snapshot.data&&t.snapshot.data.context?s.getContext=function(){return{context:t.snapshot.data.context.replace("/:id",""),id:t.snapshot.data.contextData.id}}:s.getContext=function(){return{context:null,id:null}}}))},t.prototype.fixE2eIssues=function(){try{var t=this.ngZone,e=window.org.cometd.Utils,n=e.setTimeout;e.setTimeout=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t.runOutsideAngular((function(){return n.apply(e,r)}))}}catch(t){}try{var r=window.ace,o=r.edit,i=this.ngZone;r.edit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.runOutsideAngular((function(){return o.apply(r,t)}))}}catch(t){}},t.prototype.hookLanguage=function(){var t=this,e=!0;this.appState.map((function(t){return t.lang})).subscribe((function(n){t.injector.get("c8yLocales").switchToLanguage(n),e||t.injector.get("$rootScope").$apply(),e=!1}))},t.prototype.hookTabs=function(){var t=this;this.injector.get("c8yActions");var e=this.injector.get("$location"),o=this.injector.get("c8yTabs"),i=[];o.addTab=function(e){i.push(Object.assign(Object.assign({},e),{label:e.label||e.name,path:decodeURIComponent(e.path)})),t.$liveTabs.next(i)},this.$ng1RouteChangeStart.subscribe((function(e){i=[],t.$liveTabs.next(i)})),this.$ng1RouteChangeSuccess.subscribe((function(n){var r=e.path();t.router.url!==r&&t.router.navigate("/"===r?"":r.split("/"),{queryParams:e.search(),skipLocationChange:!0}),t.actionService&&t.actionService.refresh()})),this.$routeChanges=this.$ng1RouteChangeSuccess.pipe(r.merge(this.fromNg1Event(o,o.EVENT_UPDATE),n.of(1)),r.debounceTime(100))},t.prototype.hookNavigator=function(){this.navigationNodes$=this.injector.get("c8yNavigator").rootNodes$},t.prototype.getTabs=function(){var t=this,e=function(t){return t.show},o=function(t){return Object.assign(Object.assign({},t),{label:t.label||t.name,path:decodeURIComponent(t.path)})},i=this.$routeChanges.pipe(r.switchMap((function(){var n=t.injector.get("c8yTabs").routeTabs;return Promise.all(n.map((function(t){return t.checkingVisibility}))).then((function(){return n.filter(e).map(o)}))})),r.startWith([]));return n.combineLatest(i,this.$liveTabs).pipe(r.map((function(t){var e=j(t,2),n=e[0],r=e[1];return n.concat(r)})))},t.prototype.getQuickLinks=function(){return this.injector.get("c8yQuickLinks").list()},t.prototype.getActionBarItems=function(){var t=this.injector.get("c8yActionBar"),e=this.injector.get("$rootScope");return this.fromNg1Event(e,"c8yActionBarChanged").pipe(r.startWith(1),r.map((function(){return t.elements.map((function(t){return{priority:t.getAttribute("action-bar-priority")||0,template:t,placement:t.getAttribute("action-bar-position")||"right"}}))})))},t.prototype.getBreadcrumbs=function(){var t=this.injector.get("$location").path(),e=this.injector.get("c8yBreadcrumbs"),o=e.get(t)||{},i=this.resolveBreadcrumbsData(o.data);return n.from(i).pipe(r.map((function(t){var n=e.getLiveBreadcrumbs();return(t=t.concat(n)).map((function(t){return{items:t}}))})))},t.prototype.resolveBreadcrumbsData=function(t){try{return this.injector.invoke(t)}catch(t){}return o.isArray(t)?n.of([t]):n.of([])},t.prototype.getSearch=function(){var t=this.injector.get("c8ySearch");return t.list().map((function(e){return{icon:"search",name:e.name,term:"",onSearch:function(){this.term&&t.search(this.term)}}}))},t.prototype.getActions=function(){var t=this,e=this.injector.get("c8yActions").registeredActions;return n.of(e.filter((function(t){return!t.hidden})).map((function(e){return{priority:-1*(e.priority||0),label:e.text,icon:e.icon,disabled:e.disabled,action:function(){t.injector.invoke(e.action,e)}}})))},t.prototype.fromNg1Event=function(t,e){var r;return n.fromEventPattern((function(n){r=t.$on(e,n)}),(function(){return r()}))},t.prototype.hookUserMenu=function(){var t=this.injector.get("c8yUserMenuService"),n=this.injector.get("c8yAccessDenied");t.add({icon:"access",priority:10,label:e.gettext("Access denied requests"),click:n.showAccessDeniedRequestsList})},t}();function T(t,e,n,r,o,i){return new x(t,e,n,r,o,i)}var A={provide:x,useFactory:T,deps:["$injector",e.AppStateService,i.Router,a.NgZone,e.RouterService,e.ActionService]},O=function(){function t(t){this.bridge=t,this.routeChanges$=t.$routeChanges}return t.prototype.get=function(){return this.bridge.getActionBarItems()},t}();O.decorators=[{type:a.Injectable}],O.ctorParameters=function(){return[{type:x}]};var D=function(){function t(t,e){var n=this;this.bridge=t,this.tabs=e,this.routeChanges$=t.$routeChanges,this.$location=t.injector.get("$location"),this.tabs.items$.subscribe((function(t){return n.handleTabsRedirect(t)}))}return t.prototype.handleTabsRedirect=function(t){var e=t.find((function(t){return t.redirectedTo})),n=j(t,1)[0];e&&!n.redirectedTo&&(this.$location.replace(),this.$location.path(n.path),n.redirectedTo=!0,e.redirectedTo=!1)},t.prototype.get=function(){return this.bridge.getActions()},t}();D.decorators=[{type:a.Injectable}],D.ctorParameters=function(){return[{type:x},{type:e.TabsService}]};var I=function(){function t(t){var e=this;this.bridge=t,this.trigger=new n.ReplaySubject(1),this.breadcrumbs=this.trigger.pipe(r.debounceTime(100),r.switchMap((function(){return e.bridge.getBreadcrumbs()})))}return t.prototype.get=function(){return this.trigger.next(),this.breadcrumbs},t}();I.decorators=[{type:a.Injectable}],I.ctorParameters=function(){return[{type:x}]};var N=function(){function t(t){this.bridge=t}return t.prototype.get=function(){return this.bridge.navigationNodes$},t}();N.decorators=[{type:a.Injectable}],N.ctorParameters=function(){return[{type:x}]};var $=function(){function t(t){this.bridge=t,this.tabsObservable=t.getTabs()}return t.prototype.get=function(){return this.tabsObservable},t}();$.decorators=[{type:a.Injectable}],$.ctorParameters=function(){return[{type:x}]};var k=function(){function t(t){this.bridge=t,this.links=this.bridge.getQuickLinks(),this.links.then((function(t){t.map((function(t){return t.type=t.type||"quicklink",t}))}))}return t.prototype.get=function(){return this.links},t}();k.decorators=[{type:a.Injectable}],k.ctorParameters=function(){return[{type:x}]};var P=function(){function t(t,e,n,r){this.injector=t,this.basicAuth=e,this.fetchClient=n,this.appState=r,this.hookAuth()}return t.prototype.updateBasicAuth=function(t){var e=this.fetchClient.getFetchOptions({}).headers;e.Authorization&&(e.Authorization.match(/basic\s(.*)$/i)[1]&&(this.basicAuth.updateCredentials(t),this.fetchClient.setAuth(this.basicAuth)))},t.prototype.hookAuth=function(){var t=this;this.appState.currentUser.subscribe((function(e){if(e){t.injector.get("c8yAuth").headers=function(){return t.fetchClient.getFetchOptions({}).headers};var n=t.fetchClient.getFetchOptions({}).headers;if(n.Authorization){var r=n.Authorization.match(/basic\s(.*)$/i)[1];r&&t.setToken(r,n.tfatoken)}else t.setToken(void 0,n.tfatoken,"Oauth");t.injector.get("$rootScope").$emit("authStateChange",{hasAuth:!0})}else t.injector.get("$rootScope").$emit("authStateChange",{hasAuth:!1})}))},t.prototype.setToken=function(t,e,n){void 0===n&&(n="Basic");var r=this.injector.get("c8yAuth");"Basic"===n?(r.onSetToken({token:t,type:n}),e&&r.setTFAToken(e)):r.authReady()},t}();function R(t,e,n,r){return new P(t,e,n,r)}var B={provide:P,useFactory:R,deps:["$injector",c.BasicAuth,c.FetchClient,e.AppStateService]},E=function(){function t(t){this.datePipe=t}return t.prototype.getFilter=function(){var t=this;return function(e){return t.datePipe.transform(e)}},t}();function U(t){return new E(t).getFilter()}var _={provide:E,useFactory:U,deps:[e.DatePipe]},V=function(){};V.decorators=[{type:a.NgModule,args:[{imports:[e.RouterModule],exports:[],providers:[_,A,B,{provide:e.HOOK_NAVIGATOR_NODES,useClass:N,multi:!0},{provide:e.HOOK_TABS,useClass:$,multi:!0},{provide:e.HOOK_ACTION_BAR,useClass:O,multi:!0},{provide:e.HOOK_ACTION,useClass:D,multi:!0},{provide:e.HOOK_BREADCRUMB,useClass:I,multi:!0},{provide:e.HOOK_DOCS,useClass:k,multi:!0}]}]}];var M=s.downgradeComponent({component:e.BootstrapComponent}),F=s.downgradeComponent({component:e.UserTotpRevokeComponent}),q=s.downgradeComponent({component:p.AppLogsAutoRefreshComponent}),L=s.downgradeComponent({component:e.DataGridComponent}),H=s.downgradeComponent({component:e.LoadingComponent}),z=s.downgradeComponent({component:e.RangeDisplayComponent}),W=s.downgradeComponent({component:e.HelpComponent}),K=function(){function t(t,e){this.translateService=t,this.MESSAGE_PATTERNS=e}return t.prototype.translate=function(t){return this.translateService.instant(t)},t}();K.decorators=[{type:a.Injectable}],K.ctorParameters=function(){return[{type:l.TranslateService},{type:void 0,decorators:[{type:a.Inject,args:[e.HOOK_PATTERN_MESSAGES]}]}]};var G=s.downgradeInjectable(E),Z=s.downgradeInjectable(x),Q=s.downgradeInjectable(P),J=s.downgradeInjectable(e.AppStateService),X=s.downgradeInjectable(e.HeaderService),Y=s.downgradeInjectable(e.AlertService),tt=s.downgradeInjectable(e.UserMenuService),et=s.downgradeInjectable(d.ApiService),nt=s.downgradeInjectable(e.DocsService),rt=s.downgradeInjectable(e.PasswordService),ot=s.downgradeInjectable(l.TranslateService),it=s.downgradeInjectable(e.CachedLocaleDictionaryService),at=s.downgradeInjectable(K),ct=s.downgradeInjectable(h.BulkOperationDetailsService);function st(t,e,n){function r(t){var e=t.config,r=e.url,o=e.method;n.onFinish({url:r,method:o,response:t,options:t.config})}return{request:function(t){var e=t.url,r=t.method;return n.onStart({url:e,method:r,options:t}),t},requestError:function(e){return r(e),t.reject(e)},response:function(t){return r(t),t},responseError:function(n){return r(n),e.responseError(n),t.reject(n)}}}var ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.addRoot=function(e){var n;return""===e.path&&(e.path="/"),e.label=e.name,"object"==typeof e.parent&&(e.parent.label=e.parent.name),e.preventDuplicates&&(n=this.find((function(t){var n=t.path,r=t.parents,o=t.label;return n===e.path&&o===e.label&&r.some((function(t){return t.label===e.parent}))})))&&(n.routerLinkExact=!1),n||t.prototype.addRoot.call(this,e)},e.prototype.createNode=function(e){var n=t.prototype.createNode.call(this,e),r=n.update.bind(n),i=this;return Object.defineProperties(o.assign(n,{realName:n.name||n.label,_parent:!0,update:function(t){void 0===this._parent&&(i.addRoot(this),this._parent=!0),r(t)},addChild:function(t){this.add(i.createNode(t))}}),{label:{get:function(){return this.realName||""},set:function(t){this.realName=t}},name:{get:function(){return this.realName||""},set:function(t){this.realName=t}},show:{get:function(){return!this.hidden},set:function(t){this.hidden=!t}}})},e}(e.NavigatorNodeRoot);var pt={template:'\n <c8y-bootstrap>\n <div id="c8y-legacy-view">\n <div ng-view ng-if="vm.widthSet && vm.authState.hasAuth"></div>\n </div>\n </c8y-bootstrap>',controller:function(t,e,n,r,o,i){var a=this;function c(t,e){a.authState=e}function s(){a.tabsHorizontal=n.appOption("tabsHorizontal")}function u(){var t=document.querySelector("#c8y-legacy-view");t&&t.clientWidth?a.widthSet=!0:e(u)}Object.assign(a,{$onInit:function(){i.map((function(t){return t.nav.open})).subscribe((function(t){a.navOpen=t})),i.configNavigator({canToggle:!0}),t.$on("authStateChange",c),a.rootNodes=r.rootNodes,o.currentAppCached().then(s),a.navHiddenOnStartup=n.appOption("hide_navigator"),u()},navOpen:!1})},controllerAs:"vm"};var dt="c8y.upgrade";window.preventNg1Bootstrap=!0,y.module(dt,[]).config((function(t){var e=t.interceptors.indexOf("c8yLoadingIndicator");e>-1&&t.interceptors.splice(e,1),t.interceptors.push(st)})).component("c8yUiRoot",pt).directive("c8yBootstrap",M).factory("c8yBridgeService",Z).factory("c8yAuthBridgeService",Q).factory("c8yAppStateService",J).factory("c8yHeaderService",X).factory("c8yUserMenuService",tt).service("c8yQueriesUtil",(function(){return new c.QueriesUtil})).decorator("c8yTitle",(function(t,e,n,r,o,i,a,c){function s(e,n){void 0===n&&(n={skipTitleTranslation:!1,skipSubtitleTranslation:!1}),t.when(e).then((function(t){return p(u(t,n))}))}function u(t,e){var n=t.title,o=void 0===n?"":n,i=t.subtitle,c=void 0===i?"":i,s=e.skipTitleTranslation,u=void 0!==s&&s,p=e.skipSubtitleTranslation,d='\n <h1 class="text-truncate">'+(u?"{{ title }}":"{{ title | translate }}")+"\n <small>"+(void 0!==p&&p?"{{ subtitle }}":"{{ subtitle | translate }}")+"</small></h1>\n ",h=r.$new(!0);return h.title=o,h.subtitle=c,a(y.element(d))(h)[0]}function p(t){c.changeTitle(t)}function d(t){t.show(),p(t[0])}return e.changeTitle=s,e.setTitleElement=d,r.$on("$routeChangeStart",(function(){s({})})),r.$on("$routeChangeSuccess",(function(r){var c=e.get(o.path());c&&t.when(c.data?n.invoke(c.data):{}).then((function(t){var e=t.templateUrl;if(e){var n=i.get(e);d(a(n)(r.targetScope))}else s(t)}))})),e})).factory("c8yAlert",Y).decorator("c8yAlert",(function(t,e,n){var r,o;t.add=function(e){t.addAlert(p(e))},e.$on("alert",(function(e,n){t.addAlert(p(n))})),e.$on("message",(function(e,n){t.addAlert(p(n))}));for(var i=new Set,a=t;a!==Object.prototype;a=Object.getPrototypeOf(a))try{for(var c=(r=void 0,C(Object.getOwnPropertyNames(a))),s=c.next();!s.done;s=c.next()){var u=s.value;i.add(u)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}function p(t){var e=Object.assign({},t);return t.onClose&&(e.onClose=function(){n.invoke(t.onClose)}),t.onDetail&&(e.onDetail=function(){n.invoke(t.onDetail)}),e}return Array.from(i).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))})),t})).decorator("groupTypesHierarchyNavigator",(function(t,e){return t.loadAll=function(){return e.when()},t.addGroupNavigation=function(){return e.when()},t})).factory("c8yApiService",et).factory("c8yDocs",nt).service("c8yPasswordConfirm",rt),y.module("c8y.ui").filter("absoluteDate",G).directive("c8yLoading",H).provider("c8yNavigator",(function(){var t=new ut,e=new n.Subject,i=[],a=e.pipe(r.merge(n.defer((function(){return n.of(t.children)}))));function c(n){(Array.isArray(n)?n:[n]).forEach((function(e){(function(t){return t.showIf||t.showIfPermissions||t.showIfContainsVisibleViews})(e)&&(e.hidden=void 0,i.push(e)),e.navNode=t.addRoot(e)})),e.next(t.children)}function s(n){var r=t.find((function(t){return t===n}));r&&(r.parents.forEach((function(t){return t.remove(r)})),e.next(t.children))}function u(e){return t.find(e)}return{$get:function(e,n){function r(t){var r=n.get("c8yUiUtil"),i=[],a=t.showIf,c=t.showIfPermissions,s=t.showIfContainsVisibleViews;a&&i.push(n.invoke(a)),s&&i.push(function(t){var r=n.get("c8yUiUtil"),i=n.get("c8yViews").getByPath(t.path);return e.all(o.map(i,(function(t){return r.configureVisibility(o.pick(t,["showIf","showIfPermissions"]),"show",!1).then(o.property("show"))}))).then(o.some)}(t)),r.configureVisibility({showIf:function(){return e.all(i).then(o.every)},showIfPermissions:c},"visible").then((function(e){e.visible?t.navNode.update({hidden:!1,showIf:null,showIfPermission:null,showIfContainsVisibleViews:null}):t.navNode.update({hidden:!0})}))}return setTimeout((function(){return i.forEach(r)})),{rootNodes:function(){return t.children},findNode:u,addNavigation:c,removeNavigation:s,rootNodes$:a}},addNavigation:c,removeNavigation:s}})).provider("c8yViews",(function(t,r,i){var a={},c=new n.ReplaySubject;return{when:s,$get:function(){return{contextViews:c,when:function(t,e){return s(t,e,!0)},getByPath:u,prefixWithSlash:d}}};function s(n,s,u){var h=d(n);s.resolve=s.resolve||{},s.resolve.__c8y_locales=["c8yLocales",function(t){return t.initDone}];var l=a[h],f=h;s.name,l||(a[h]=[],l=a[h]);var g=Object.keys(e.ViewContext).map((function(t){return{key:t,isUpgrade:d(e.ViewContext[t].replace("id",b[t]))===n}})).find((function(t){return t.isUpgrade}));if(g){l.push(s),s.path=h;var v=i.appendSegment(f.replace(n,""),s.name);c.next(Object.assign(Object.assign({},s),{path:s.name?v.substring(1):"",contextKey:g.key,runPhase:u})),s.showIf=void 0,s.name&&(s.path=i.appendSegment(f,s.name))}else{if(1===l.length){var y=j(l,1)[0];y.path=i.appendSegment(f,y.name),y.tab=p(f,y),t.when(y.path,y)}l.push(s),s.path=h,l.length>1&&(s.path=i.appendSegment(f,s.name),p(f,s),t.when(d(f),{resolveRedirectTo:function(t,e,n,i,a){var c=r.sortTabsViews(l,a),s=t.current.pathParams;return e.all(o.map(c,o.unary(n.configureVisibility))).then((function(t){var e=o.find(t,"show").path;return o.forEach(s,(function(t,n){e=e.replace(":"+n,t)})),i.redirectedViewPath=e,e}))}}))}return t.when(d(s.path),s)}function u(t){return a[d(t)]}function p(t,e){r.addTab(t,e)}function d(t){return(o.startsWith(t,"/")?"":"/")+t}})).directive("c8yUserTotpRevoke",F).directive("c8yAppLogsAutoRefresh",q).directive("c8yDataGrid",L).directive("c8yRangeDisplay",z).directive("c8yHelp",W).factory("c8yTranslate",ot).factory("c8yCachedLocaleDictionaryService",it).factory("c8yBulkOperationDetailsService",ct).decorator("gettextCatalog",(function(t,e,n){var r=t,o=y.bind(r,r.getString);return r.getString=function(t,r,i){if("string"==typeof t){var a=o(t,r,i),c=r?e(t)(r):t,s=a;if(a&&a===c)s=n.instant(c);return s}return t},r})).factory("c8yServerMessages",at).factory("ngZone",s.downgradeInjectable(a.NgZone));var ht=["app",dt],lt=function(){function t(){this.ng1Modules=ht}return t.prototype.ngDoBootstrap=function(){window.bootstrap(),this.upgrade.bootstrap(document.getElementById("app"),this.ng1Modules,{strictDi:!1})},t}(),ft=[{path:"**",component:e.EmptyComponent}],gt=function(){function t(t,e,n,r,o){this.ng1Injector=t,this.zone=e,this.router=n,this.contextDashboardService=r,this.actionBarService=o,this.dashboardSvc=t.get("dashboardSvc"),this.compile=t.get("$compile")}return Object.defineProperty(t.prototype,"ng1Components",{get:function(){return this.ng1Injector.get("c8yComponents")},enumerable:!1,configurable:!0}),t.prototype.instantiateComponent=function(t,e){return S(this,void 0,void 0,(function(){var n,r,o,i,a=this;return w(this,(function(c){switch(c.label){case 0:return n=t.dashboard,r=t.context,o=t.child,n?[4,this.dashboardSvc.transformChildWithContext(this.dashboardSvc.forcedContext||r,n,o)]:[3,4];case 1:return i=c.sent(),this.dashboardSvc.forcedContext||n.deviceType?[4,this.dashboardSvc.updateConfigTargetsWithContext(this.dashboardSvc.forcedContext||r,i.config)]:[3,3];case 2:c.sent(),c.label=3;case 3:return[2,this.zone.runOutsideAngular((function(){return a.loadTemplate(i,o,e,r)}))];case 4:return[2,this.loadConfigTemplate(e,t)]}}))}))},t.prototype.editDashboard=function(t){return S(this,void 0,void 0,(function(){return w(this,(function(e){return[2,this.dashboardSvc.editCurrentDashboard({dashboardId:t.id})]}))}))},t.prototype.copyDashboard=function(){var t=this.getDashboard();if(this.dashboardSvc.copyDashboard(t.c8y_Dashboard))return this.dashboardClipboard=t,this.actionBarService.refresh(),t},t.prototype.pasteDashboard=function(){return S(this,void 0,void 0,(function(){var t;return w(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.dashboardSvc.pasteDashboard()];case 1:return t=e.sent(),this.navigateToDashboard(t),this.dashboardClipboard=void 0,[3,3];case 2:return e.sent(),[3,3];case 3:return this.actionBarService.refresh(),[2]}}))}))},t.prototype.instantiateDeviceSelector=function(t,e){return this.loadConfigTemplate(t,e,!0)},t.prototype.loadTemplate=function(t,e,n,r){var o=this.ng1Injector.get("$rootScope").$new(!0);return o.child=t,o.dashboardContext=r,e.widgetComponent?n.innerHTML="<c8y-ui-component component-name=\"'"+e.widgetComponent+'\'" config="child.config" context="dashboardContext"></c8y-ui-component>':e.templateUrl&&(n.innerHTML="<ng-include src=\"'"+e.templateUrl+"'\"></ng-include>"),this.compile(n)(o),o},t.prototype.navigateToDashboard=function(t){/dashboard/.test(this.router.url)?this.router.navigate(["..",t.id],{relativeTo:e.getActivatedRoute(this.router)}):this.router.navigate(["..","dashboard",t.id],{relativeTo:e.getActivatedRoute(this.router)})},t.prototype.getDashboard=function(){return e.getActivatedRoute(this.router).snapshot.data.dashboard},t.prototype.loadConfigTemplate=function(t,n,r){var i=this;void 0===r&&(r=!1);var a=n.settings,c=this.ng1Injector.get("$rootScope").$new(!0);c.settings=Object.assign(Object.assign({},a),a.ng1),c.options=n.options,c.config=n,c.forms={},c.rootId=a.context.id,c.dashboard=o.get(n,"settings.dashboardMo");var s="";return r||(n.settings.configComponent?s="<c8y-ui-component component-name=\"'"+n.settings.configComponent+'\'" config="config"></c8y-ui-component>':n.settings.configTemplateUrl&&(s="<ng-include src=\"'"+n.settings.configTemplateUrl+"'\"></ng-include>")),t.innerHTML='\n <ng-form name="forms.componentForm">\n <div class="form-group"\n ng-if="!settings.noDeviceTarget"\n ng-style="{height: settings.hideTarget && \'0\', overflow: \'hidden\'}"\n >\n <label translate>'+e.gettext("Target assets or devices")+'</label>\n <c8y-device-selector-combo parent="rootId"\n selected-child-device="config.device"\n groups-selectable="settings.groupsSelectable"\n select-required="!settings.deviceTargetNotRequired"\n ></c8y-device-selector-combo>\n </div>\n '+s+"\n </ng-form>",c.$watch("forms.componentForm.$invalid",(function(t){i.contextDashboardService.formDisabled=t})),this.compile(t)(c),this.contextDashboardService.formDisabled=c.forms.componentForm.$invalid,c},t}();gt.decorators=[{type:a.Injectable}],gt.ctorParameters=function(){return[{type:void 0},{type:a.NgZone},{type:i.Router},{type:f.ContextDashboardService},{type:e.ActionBarService}]};var vt=function(){function t(t,e,n){this.dashboard=t,this.dashboardBridgeService=e,this.el=n}return t.prototype.ngOnInit=function(){return S(this,void 0,void 0,(function(){var t,e=this;return w(this,(function(n){switch(n.label){case 0:return t=this,[4,this.dashboardBridgeService.instantiateComponent(this.config,this.el.nativeElement)];case 1:return t.ng1Scope=n.sent(),this.dashboard&&(this.resizeSubscription=this.dashboard.onChangeDashboard.subscribe((function(){e.ng1Scope.$broadcast("dashboardResize")}))),[2]}}))}))},t.prototype.ngOnDestroy=function(){this.ng1Scope&&this.ng1Scope.$destroy(),this.resizeSubscription&&this.resizeSubscription.unsubscribe()},t}();vt.decorators=[{type:a.Component,args:[{selector:"c8y-widget-legacy",template:"",changeDetection:a.ChangeDetectionStrategy.OnPush}]}],vt.ctorParameters=function(){return[{type:e.WidgetsDashboardComponent,decorators:[{type:a.Optional}]},{type:gt},{type:a.ElementRef}]};var yt=function(){function t(t,e){this.dashboardBridgeService=t,this.el=e}return t.prototype.ngOnInit=function(){return S(this,void 0,void 0,(function(){return w(this,(function(t){return this.ng1Scope=this.dashboardBridgeService.instantiateDeviceSelector(this.el.nativeElement,this.config),[2]}))}))},t.prototype.ngOnDestroy=function(){this.ng1Scope&&this.ng1Scope.$destroy()},t}();yt.decorators=[{type:a.Component,args:[{selector:"c8y-device-selector-legacy",template:"",changeDetection:a.ChangeDetectionStrategy.OnPush}]}],yt.ctorParameters=function(){return[{type:gt},{type:a.ElementRef}]};var mt=function(){function t(t){this.bridge=t}return t.prototype.get=function(){return S(this,void 0,void 0,(function(){var t;return w(this,(function(e){switch(e.label){case 0:return[4,this.bridge.ng1Components.list()];case 1:return(t=e.sent().map((function(t){var e={settings:Object.assign(Object.assign({},t.options),{configTemplateUrl:t.configTemplateUrl,widgetComponent:t.widgetComponent,configComponent:t.configComponent,transformConfigWithContext:t.transformConfigWithContext||t.componentTransformConfigWithContext,upgrade:!0})};return e.settings.templateUrl=t.templateUrl,{id:t.name,label:t.nameDisplay||t.name,description:t.description,component:vt,configComponent:vt,previewImage:t.previewImage,data:e}}))).push({id:"device.selector.legacy",label:"Device selector",description:"",data:{settings:{noNewWidgets:!0,upgrade:!0}},component:yt}),[2,t]}}))}))},t}();mt.decorators=[{type:a.Injectable}],mt.ctorParameters=function(){return[{type:gt}]};var bt=function(){function t(t,e){this.vcRef=t,this.dashboardBridgeService=e}return t.prototype.ngOnInit=function(){this.vcRef.createEmbeddedView(this.templateCopy)},t.prototype.copyDashboard=function(){this.dashboardBridgeService.copyDashboard()},t}();bt.decorators=[{type:a.Component,args:[{selector:"c8y-copy-action-legacy",template:'\n <ng-template #templateCopy>\n <li>\n <button title="{{\'Copy dashboard\' | translate}}" (click)="copyDashboard()">\n <i class="dlt-c8y-icon-copy m-r-4"></i><span translate>Copy dashboard</span>\n </button>\n </li>\n </ng-template>\n '}]}],bt.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:gt}]},bt.propDecorators={templateCopy:[{type:a.ViewChild,args:["templateCopy",{read:a.TemplateRef,static:!0}]}]};var St=function(){function t(t,e){this.vcRef=t,this.dashboardBridgeService=e,this.dashboardName=""}return t.prototype.ngOnInit=function(){this.vcRef.createEmbeddedView(this.templatePaste),this.dashboardName=this.dashboardBridgeService.dashboardClipboard.c8y_Dashboard.name},t.prototype.pasteDashboard=function(){this.dashboardBridgeService.pasteDashboard()},t}();St.decorators=[{type:a.Component,args:[{selector:"c8y-paste-action-legacy",template:'\n <ng-template #templatePaste>\n <li>\n <button title="{{\'Paste dashboard\' | translate}}" (click)="pasteDashboard()">\n <i class="m-r-4" c8yIcon="clipboard"></i><span translate>Paste dashboard</span>&nbsp;<span\n >"{{ dashboardName }}"</span\n >\n </button>\n </li>\n </ng-template>\n '}]}],St.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:gt}]},St.propDecorators={templatePaste:[{type:a.ViewChild,args:["templatePaste",{read:a.TemplateRef,static:!0}]}]};var wt=function(){function t(t){this.dashboardBridgeService=t}return t.prototype.get=function(t){var n=[],r=!t.parent||t.snapshot.data.context?t.snapshot.data:t.parent.snapshot.data,o=r.contextData,i=o&&t.snapshot.data.dashboard&&[e.ViewContext.Device,e.ViewContext.Group].includes(r.context),a=o&&[e.ViewContext.Device,e.ViewContext.Group].includes(r.context)&&this.dashboardBridgeService.dashboardClipboard;return i&&n.push({priority:-20,placement:"more",template:bt}),a&&n.push({priority:-10,placement:"more",template:St}),n},t}();wt.decorators=[{type:a.Injectable}],wt.ctorParameters=function(){return[{type:gt}]};var Ct=function(){};function jt(t,e,n,r,o){return new gt(t,e,n,r,o)}Ct.decorators=[{type:a.NgModule,args:[{declarations:[yt,vt,bt,St],entryComponents:[yt,vt,bt,St],imports:[g.CommonModule,e.C8yTranslateModule],providers:[{provide:gt,useFactory:jt,deps:["$injector",a.NgZone,i.Router,[new a.Optional,f.ContextDashboardService],e.ActionBarService]},{provide:e.HOOK_COMPONENTS,useClass:mt,multi:!0},{provide:e.HOOK_ACTION_BAR,useClass:wt,multi:!0}]}]}],t.AuthBridgeService=P,t.BridgeService=x,t.CopyActionComponent=bt,t.DashboardBridgeService=gt,t.DashboardUpgradeModule=Ct,t.DeviceSelectorComponent=yt,t.HybridAppModule=lt,t.Ng1ActionBarFactoryService=O,t.Ng1ActionFactoryService=D,t.Ng1BreadcrumbFactoryService=I,t.Ng1ComponentFactoryService=mt,t.Ng1DashboardActionFactoryService=wt,t.Ng1DocsFactoryService=k,t.Ng1NodesFactoryService=N,t.Ng1TabsFactoryService=$,t.PasteActionComponent=St,t.UPGRADE_ROUTES=ft,t.UpgradeModule=V,t.WidgetComponent=vt,t.authBridgeServiceFactory=R,t.authBridgeServiceProvider=B,t.bridgeServiceFactory=T,t.bridgeServiceProvider=A,t.dashboardBridgeFactory=jt,t.ng1Modules=ht,t.ɵa=E,t.ɵb=U,t.ɵc=_,Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var b;function S(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))}function C(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function w(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}!function(t){t.Device="deviceId",t.Group="groupId",t.User="userId",t.Application="applicationId",t.SubscribedApplications="applicationId",t.Tenant="tenantId"}(b||(b={}));var x=function(){function t(t,e,r,o,i,a){this.injector=t,this.appState=e,this.router=r,this.ngZone=o,this.routerService=i,this.actionService=a,this.$liveTabs=new n.BehaviorSubject([]),this.fixE2eIssues(),this.$ng1RouteChangeSuccess=this.fromNg1Event(this.injector.get("$rootScope"),"$routeChangeSuccess"),this.$ng1RouteChangeStart=this.fromNg1Event(this.injector.get("$rootScope"),"$routeChangeStart"),this.hookLanguage(),this.hookTabs(),this.hookNavigator(),this.hookUserMenu(),this.hookViewProvider(),this.router.initialNavigation(),this.ng1Routes()}return t.prototype.hookViewProvider=function(){var t=this,e=this.injector.get("c8yViews");e.when("/device/:id",{template:""}),e.when("/group/:id",{template:""}),e.contextViews.subscribe((function(e){return t.addRoute(e)}))},t.prototype.addRoute=function(t){var n=this;this.routerService.addRoute({label:t.label||t.name,path:t.path,icon:t.icon,context:e.ViewContext[t.contextKey],priority:t.priority,component:e.EmptyComponent,data:{showIf:t.showIf?function(e){var r,o=Object.assign(Object.assign({},e.params),((r={})[b[t.contextKey]]=e.params.id,r)),i=n.injector.invoke(t.showIf,void 0,{$routeParams:o});return n.injector.get("$q").when(i).then(Boolean)}:void 0}}),t.runPhase&&this.routerService.refresh()},t.prototype.ng1Routes=function(){var t=[];for(var n in e.ViewContext){var o=e.ViewContext[n].match(/(\w+)\//)[1],a=new RegExp("^/"+o+"/(?:([^/]+)).*$");t.push({keys:[{name:b[n],optional:!1}],regexp:a,template:""})}var c=this.injector.get("$route");Object.defineProperty(c.routes,"forEach",{value:function(e,n){for(var r in this)e.call(n,this[r],r,this);t.forEach((function(t){return e.call(n,t)}))}});var s=this.injector.get("c8yUiUtil"),u=s.getContext;this.router.events.pipe(r.filter((function(t){return t instanceof i.ActivationEnd}))).subscribe((function(t){"**"===t.snapshot.routeConfig.path?s.getContext=u:t.snapshot.data&&t.snapshot.data.context?s.getContext=function(){return{context:t.snapshot.data.context.replace("/:id",""),id:t.snapshot.data.contextData.id}}:s.getContext=function(){return{context:null,id:null}}}))},t.prototype.fixE2eIssues=function(){try{var t=this.ngZone,e=window.org.cometd.Utils,n=e.setTimeout;e.setTimeout=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t.runOutsideAngular((function(){return n.apply(e,r)}))}}catch(t){}try{var r=window.ace,o=r.edit,i=this.ngZone;r.edit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.runOutsideAngular((function(){return o.apply(r,t)}))}}catch(t){}},t.prototype.hookLanguage=function(){var t=this,e=!0;this.appState.map((function(t){return t.lang})).subscribe((function(n){t.injector.get("c8yLocales").switchToLanguage(n),e||t.injector.get("$rootScope").$apply(),e=!1}))},t.prototype.hookTabs=function(){var t=this;this.injector.get("c8yActions");var e=this.injector.get("$location"),o=this.injector.get("c8yTabs"),i=[];o.addTab=function(e){i.push(Object.assign(Object.assign({},e),{label:e.label||e.name,path:decodeURIComponent(e.path)})),t.$liveTabs.next(i)},this.$ng1RouteChangeStart.subscribe((function(e){i=[],t.$liveTabs.next(i)})),this.$ng1RouteChangeSuccess.subscribe((function(n){var r=e.path();t.router.url!==r&&t.router.navigate("/"===r?"":r.split("/"),{queryParams:e.search(),skipLocationChange:!0}),t.actionService&&t.actionService.refresh()})),this.$routeChanges=this.$ng1RouteChangeSuccess.pipe(r.merge(this.fromNg1Event(o,o.EVENT_UPDATE),n.of(1)),r.debounceTime(100))},t.prototype.hookNavigator=function(){this.navigationNodes$=this.injector.get("c8yNavigator").rootNodes$},t.prototype.getTabs=function(){var t=this,e=function(t){return t.show},o=function(t){return Object.assign(Object.assign({},t),{label:t.label||t.name,path:decodeURIComponent(t.path)})},i=this.$routeChanges.pipe(r.switchMap((function(){var n=t.injector.get("c8yTabs").routeTabs;return Promise.all(n.map((function(t){return t.checkingVisibility}))).then((function(){return n.filter(e).map(o)}))})),r.startWith([]));return n.combineLatest(i,this.$liveTabs).pipe(r.map((function(t){var e=j(t,2),n=e[0],r=e[1];return n.concat(r)})))},t.prototype.getQuickLinks=function(){return this.injector.get("c8yQuickLinks").list()},t.prototype.getActionBarItems=function(){var t=this.injector.get("c8yActionBar"),e=this.injector.get("$rootScope");return this.fromNg1Event(e,"c8yActionBarChanged").pipe(r.startWith(1),r.map((function(){return t.elements.map((function(t){return{priority:t.getAttribute("action-bar-priority")||0,template:t,placement:t.getAttribute("action-bar-position")||"right"}}))})))},t.prototype.getBreadcrumbs=function(){var t=this.injector.get("$location").path(),e=this.injector.get("c8yBreadcrumbs"),o=e.get(t)||{},i=this.resolveBreadcrumbsData(o.data);return n.from(i).pipe(r.map((function(t){var n=e.getLiveBreadcrumbs();return(t=t.concat(n)).map((function(t){return{items:t}}))})))},t.prototype.resolveBreadcrumbsData=function(t){try{return this.injector.invoke(t)}catch(t){}return o.isArray(t)?n.of([t]):n.of([])},t.prototype.getSearch=function(){var t=this.injector.get("c8ySearch");return t.list().map((function(e){return{icon:"search",name:e.name,term:"",onSearch:function(){this.term&&t.search(this.term)}}}))},t.prototype.getActions=function(){var t=this,e=this.injector.get("c8yActions").registeredActions;return n.of(e.filter((function(t){return!t.hidden})).map((function(e){return{priority:-1*(e.priority||0),label:e.text,icon:e.icon,disabled:e.disabled,action:function(){t.injector.invoke(e.action,e)}}})))},t.prototype.fromNg1Event=function(t,e){var r;return n.fromEventPattern((function(n){r=t.$on(e,n)}),(function(){return r()}))},t.prototype.hookUserMenu=function(){var t=this.injector.get("c8yUserMenuService"),n=this.injector.get("c8yAccessDenied");t.add({icon:"access",priority:10,label:e.gettext("Access denied requests"),click:n.showAccessDeniedRequestsList})},t}();function T(t,e,n,r,o,i){return new x(t,e,n,r,o,i)}var A={provide:x,useFactory:T,deps:["$injector",e.AppStateService,i.Router,a.NgZone,e.RouterService,e.ActionService]},O=function(){function t(t){this.bridge=t,this.routeChanges$=t.$routeChanges,this.$ng1RouteChangeSuccess=t.$ng1RouteChangeSuccess}return t.prototype.get=function(){var t=this;return this.routeChanges$.pipe(r.switchMap((function(e){return t.bridge.getActionBarItems()})))},t}();O.decorators=[{type:a.Injectable}],O.ctorParameters=function(){return[{type:x}]};var D=function(){function t(t,e){var n=this;this.bridge=t,this.tabs=e,this.routeChanges$=t.$routeChanges,this.$location=t.injector.get("$location"),this.tabs.items$.subscribe((function(t){return n.handleTabsRedirect(t)}))}return t.prototype.handleTabsRedirect=function(t){var e=t.find((function(t){return t.redirectedTo})),n=j(t,1)[0];e&&!n.redirectedTo&&(this.$location.replace(),this.$location.path(n.path),n.redirectedTo=!0,e.redirectedTo=!1)},t.prototype.get=function(){return this.bridge.getActions()},t}();D.decorators=[{type:a.Injectable}],D.ctorParameters=function(){return[{type:x},{type:e.TabsService}]};var I=function(){function t(t){var e=this;this.bridge=t,this.trigger=new n.ReplaySubject(1),this.breadcrumbs=this.trigger.pipe(r.debounceTime(100),r.switchMap((function(){return e.bridge.getBreadcrumbs()})))}return t.prototype.get=function(){return this.trigger.next(),this.breadcrumbs},t}();I.decorators=[{type:a.Injectable}],I.ctorParameters=function(){return[{type:x}]};var $=function(){function t(t){this.bridge=t}return t.prototype.get=function(){return this.bridge.navigationNodes$},t}();$.decorators=[{type:a.Injectable}],$.ctorParameters=function(){return[{type:x}]};var N=function(){function t(t){this.bridge=t,this.tabsObservable=t.getTabs()}return t.prototype.get=function(){return this.tabsObservable},t}();N.decorators=[{type:a.Injectable}],N.ctorParameters=function(){return[{type:x}]};var k=function(){function t(t){this.bridge=t,this.links=this.bridge.getQuickLinks(),this.links.then((function(t){t.map((function(t){return t.type=t.type||"quicklink",t}))}))}return t.prototype.get=function(){return this.links},t}();k.decorators=[{type:a.Injectable}],k.ctorParameters=function(){return[{type:x}]};var P=function(){function t(t,e,n,r){this.injector=t,this.basicAuth=e,this.fetchClient=n,this.appState=r,this.hookAuth()}return t.prototype.updateBasicAuth=function(t){var e=this.fetchClient.getFetchOptions({}).headers;e.Authorization&&(e.Authorization.match(/basic\s(.*)$/i)[1]&&(this.basicAuth.updateCredentials(t),this.fetchClient.setAuth(this.basicAuth)))},t.prototype.hookAuth=function(){var t=this;this.appState.currentUser.subscribe((function(e){if(e){t.injector.get("c8yAuth").headers=function(){return t.fetchClient.getFetchOptions({}).headers};var n=t.fetchClient.getFetchOptions({}).headers;if(n.Authorization){var r=n.Authorization.match(/basic\s(.*)$/i)[1];r&&t.setToken(r,n.tfatoken)}else t.setToken(void 0,n.tfatoken,"Oauth");t.injector.get("$rootScope").$emit("authStateChange",{hasAuth:!0})}else t.injector.get("$rootScope").$emit("authStateChange",{hasAuth:!1})}))},t.prototype.setToken=function(t,e,n){void 0===n&&(n="Basic");var r=this.injector.get("c8yAuth");"Basic"===n?(r.onSetToken({token:t,type:n}),e&&r.setTFAToken(e)):r.authReady()},t}();function R(t,e,n,r){return new P(t,e,n,r)}var B={provide:P,useFactory:R,deps:["$injector",c.BasicAuth,c.FetchClient,e.AppStateService]},E=function(){function t(t){this.datePipe=t}return t.prototype.getFilter=function(){var t=this;return function(e){return t.datePipe.transform(e)}},t}();function U(t){return new E(t).getFilter()}var _={provide:E,useFactory:U,deps:[e.DatePipe]},V=function(){};V.decorators=[{type:a.NgModule,args:[{imports:[e.RouterModule],exports:[],providers:[_,A,B,{provide:e.HOOK_NAVIGATOR_NODES,useClass:$,multi:!0},{provide:e.HOOK_TABS,useClass:N,multi:!0},{provide:e.HOOK_ACTION_BAR,useClass:O,multi:!0},{provide:e.HOOK_ACTION,useClass:D,multi:!0},{provide:e.HOOK_BREADCRUMB,useClass:I,multi:!0},{provide:e.HOOK_DOCS,useClass:k,multi:!0}]}]}];var M=s.downgradeComponent({component:e.BootstrapComponent}),F=s.downgradeComponent({component:e.UserTotpRevokeComponent}),q=s.downgradeComponent({component:p.AppLogsAutoRefreshComponent}),L=s.downgradeComponent({component:e.DataGridComponent}),H=s.downgradeComponent({component:e.LoadingComponent}),z=s.downgradeComponent({component:e.RangeDisplayComponent}),W=s.downgradeComponent({component:e.HelpComponent}),K=function(){function t(t,e){this.translateService=t,this.MESSAGE_PATTERNS=e}return t.prototype.translate=function(t){return this.translateService.instant(t)},t}();K.decorators=[{type:a.Injectable}],K.ctorParameters=function(){return[{type:l.TranslateService},{type:void 0,decorators:[{type:a.Inject,args:[e.HOOK_PATTERN_MESSAGES]}]}]};var G=s.downgradeInjectable(E),Z=s.downgradeInjectable(x),Q=s.downgradeInjectable(P),J=s.downgradeInjectable(e.AppStateService),X=s.downgradeInjectable(e.HeaderService),Y=s.downgradeInjectable(e.AlertService),tt=s.downgradeInjectable(e.UserMenuService),et=s.downgradeInjectable(d.ApiService),nt=s.downgradeInjectable(e.DocsService),rt=s.downgradeInjectable(e.PasswordService),ot=s.downgradeInjectable(l.TranslateService),it=s.downgradeInjectable(e.CachedLocaleDictionaryService),at=s.downgradeInjectable(K),ct=s.downgradeInjectable(h.BulkOperationDetailsService);function st(t,e,n){function r(t){var e=t.config,r=e.url,o=e.method;n.onFinish({url:r,method:o,response:t,options:t.config})}return{request:function(t){var e=t.url,r=t.method;return n.onStart({url:e,method:r,options:t}),t},requestError:function(e){return r(e),t.reject(e)},response:function(t){return r(t),t},responseError:function(n){return r(n),e.responseError(n),t.reject(n)}}}var ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.addRoot=function(e){var n;return""===e.path&&(e.path="/"),e.label=e.name,"object"==typeof e.parent&&(e.parent.label=e.parent.name),e.preventDuplicates&&(n=this.find((function(t){var n=t.path,r=t.parents,o=t.label;return n===e.path&&o===e.label&&r.some((function(t){return t.label===e.parent}))})))&&(n.routerLinkExact=!1),n||t.prototype.addRoot.call(this,e)},e.prototype.createNode=function(e){var n=t.prototype.createNode.call(this,e),r=n.update.bind(n),i=this;return Object.defineProperties(o.assign(n,{realName:n.name||n.label,_parent:!0,update:function(t){void 0===this._parent&&(i.addRoot(this),this._parent=!0),r(t)},addChild:function(t){this.add(i.createNode(t))}}),{label:{get:function(){return this.realName||""},set:function(t){this.realName=t}},name:{get:function(){return this.realName||""},set:function(t){this.realName=t}},show:{get:function(){return!this.hidden},set:function(t){this.hidden=!t}}})},e}(e.NavigatorNodeRoot);var pt={template:'\n <c8y-bootstrap>\n <div id="c8y-legacy-view">\n <div ng-view ng-if="vm.widthSet && vm.authState.hasAuth"></div>\n </div>\n </c8y-bootstrap>',controller:function(t,e,n,r,o,i){var a=this;function c(t,e){a.authState=e}function s(){a.tabsHorizontal=n.appOption("tabsHorizontal")}function u(){var t=document.querySelector("#c8y-legacy-view");t&&t.clientWidth?a.widthSet=!0:e(u)}Object.assign(a,{$onInit:function(){i.map((function(t){return t.nav.open})).subscribe((function(t){a.navOpen=t})),i.configNavigator({canToggle:!0}),t.$on("authStateChange",c),a.rootNodes=r.rootNodes,o.currentAppCached().then(s),a.navHiddenOnStartup=n.appOption("hide_navigator"),u()},navOpen:!1})},controllerAs:"vm"};var dt="c8y.upgrade";window.preventNg1Bootstrap=!0,y.module(dt,[]).config((function(t){var e=t.interceptors.indexOf("c8yLoadingIndicator");e>-1&&t.interceptors.splice(e,1),t.interceptors.push(st)})).component("c8yUiRoot",pt).directive("c8yBootstrap",M).factory("c8yBridgeService",Z).factory("c8yAuthBridgeService",Q).factory("c8yAppStateService",J).factory("c8yHeaderService",X).factory("c8yUserMenuService",tt).service("c8yQueriesUtil",(function(){return new c.QueriesUtil})).decorator("c8yTitle",(function(t,e,n,r,o,i,a,c){function s(e,n){void 0===n&&(n={skipTitleTranslation:!1,skipSubtitleTranslation:!1}),t.when(e).then((function(t){return p(u(t,n))}))}function u(t,e){var n=t.title,o=void 0===n?"":n,i=t.subtitle,c=void 0===i?"":i,s=e.skipTitleTranslation,u=void 0!==s&&s,p=e.skipSubtitleTranslation,d='\n <h1 class="text-truncate">'+(u?"{{ title }}":"{{ title | translate }}")+"\n <small>"+(void 0!==p&&p?"{{ subtitle }}":"{{ subtitle | translate }}")+"</small></h1>\n ",h=r.$new(!0);return h.title=o,h.subtitle=c,a(y.element(d))(h)[0]}function p(t){c.changeTitle(t)}function d(t){t.show(),p(t[0])}return e.changeTitle=s,e.setTitleElement=d,r.$on("$routeChangeStart",(function(){s({})})),r.$on("$routeChangeSuccess",(function(r){var c=e.get(o.path());c&&t.when(c.data?n.invoke(c.data):{}).then((function(t){var e=t.templateUrl;if(e){var n=i.get(e);d(a(n)(r.targetScope))}else s(t)}))})),e})).factory("c8yAlert",Y).decorator("c8yAlert",(function(t,e,n){var r,o;t.add=function(e){t.addAlert(p(e))},e.$on("alert",(function(e,n){t.addAlert(p(n))})),e.$on("message",(function(e,n){t.addAlert(p(n))}));for(var i=new Set,a=t;a!==Object.prototype;a=Object.getPrototypeOf(a))try{for(var c=(r=void 0,w(Object.getOwnPropertyNames(a))),s=c.next();!s.done;s=c.next()){var u=s.value;i.add(u)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}function p(t){var e=Object.assign({},t);return t.onClose&&(e.onClose=function(){n.invoke(t.onClose)}),t.onDetail&&(e.onDetail=function(){n.invoke(t.onDetail)}),e}return Array.from(i).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))})),t})).decorator("groupTypesHierarchyNavigator",(function(t,e){return t.loadAll=function(){return e.when()},t.addGroupNavigation=function(){return e.when()},t})).factory("c8yApiService",et).factory("c8yDocs",nt).service("c8yPasswordConfirm",rt),y.module("c8y.ui").filter("absoluteDate",G).directive("c8yLoading",H).provider("c8yNavigator",(function(){var t=new ut,e=new n.Subject,i=[],a=e.pipe(r.merge(n.defer((function(){return n.of(t.children)}))));function c(n){(Array.isArray(n)?n:[n]).forEach((function(e){(function(t){return t.showIf||t.showIfPermissions||t.showIfContainsVisibleViews})(e)&&(e.hidden=void 0,i.push(e)),e.navNode=t.addRoot(e)})),e.next(t.children)}function s(n){var r=t.find((function(t){return t===n}));r&&(r.parents.forEach((function(t){return t.remove(r)})),e.next(t.children))}function u(e){return t.find(e)}return{$get:function(e,n){function r(t){var r=n.get("c8yUiUtil"),i=[],a=t.showIf,c=t.showIfPermissions,s=t.showIfContainsVisibleViews;a&&i.push(n.invoke(a)),s&&i.push(function(t){var r=n.get("c8yUiUtil"),i=n.get("c8yViews").getByPath(t.path);return e.all(o.map(i,(function(t){return r.configureVisibility(o.pick(t,["showIf","showIfPermissions"]),"show",!1).then(o.property("show"))}))).then(o.some)}(t)),r.configureVisibility({showIf:function(){return e.all(i).then(o.every)},showIfPermissions:c},"visible").then((function(e){e.visible?t.navNode.update({hidden:!1,showIf:null,showIfPermission:null,showIfContainsVisibleViews:null}):t.navNode.update({hidden:!0})}))}return setTimeout((function(){return i.forEach(r)})),{rootNodes:function(){return t.children},findNode:u,addNavigation:c,removeNavigation:s,rootNodes$:a}},addNavigation:c,removeNavigation:s}})).provider("c8yViews",(function(t,r,i){var a={},c=new n.ReplaySubject;return{when:s,$get:function(){return{contextViews:c,when:function(t,e){return s(t,e,!0)},getByPath:u,prefixWithSlash:d}}};function s(n,s,u){var h=d(n);s.resolve=s.resolve||{},s.resolve.__c8y_locales=["c8yLocales",function(t){return t.initDone}];var l=a[h],f=h;s.name,l||(a[h]=[],l=a[h]);var g=Object.keys(e.ViewContext).map((function(t){return{key:t,isUpgrade:d(e.ViewContext[t].replace("id",b[t]))===n}})).find((function(t){return t.isUpgrade}));if(g){l.push(s),s.path=h;var v=i.appendSegment(f.replace(n,""),s.name);c.next(Object.assign(Object.assign({},s),{path:s.name?v.substring(1):"",contextKey:g.key,runPhase:u})),s.showIf=void 0,s.name&&(s.path=i.appendSegment(f,s.name))}else{if(1===l.length){var y=j(l,1)[0];y.path=i.appendSegment(f,y.name),y.tab=p(f,y),t.when(y.path,y)}l.push(s),s.path=h,l.length>1&&(s.path=i.appendSegment(f,s.name),p(f,s),t.when(d(f),{resolveRedirectTo:function(t,e,n,i,a){var c=r.sortTabsViews(l,a),s=t.current.pathParams;return e.all(o.map(c,o.unary(n.configureVisibility))).then((function(t){var e=o.find(t,"show").path;return o.forEach(s,(function(t,n){e=e.replace(":"+n,t)})),i.redirectedViewPath=e,e}))}}))}return t.when(d(s.path),s)}function u(t){return a[d(t)]}function p(t,e){r.addTab(t,e)}function d(t){return(o.startsWith(t,"/")?"":"/")+t}})).directive("c8yUserTotpRevoke",F).directive("c8yAppLogsAutoRefresh",q).directive("c8yDataGrid",L).directive("c8yRangeDisplay",z).directive("c8yHelp",W).factory("c8yTranslate",ot).factory("c8yCachedLocaleDictionaryService",it).factory("c8yBulkOperationDetailsService",ct).decorator("gettextCatalog",(function(t,e,n){var r=t,o=y.bind(r,r.getString);return r.getString=function(t,r,i){if("string"==typeof t){var a=o(t,r,i),c=r?e(t)(r):t,s=a;if(a&&a===c)s=n.instant(c);return s}return t},r})).factory("c8yServerMessages",at).factory("ngZone",s.downgradeInjectable(a.NgZone));var ht=["app",dt],lt=function(){function t(){this.ng1Modules=ht}return t.prototype.ngDoBootstrap=function(){window.bootstrap(),this.upgrade.bootstrap(document.getElementById("app"),this.ng1Modules,{strictDi:!1})},t}(),ft=[{path:"**",component:e.EmptyComponent}],gt=function(){function t(t,e,n,r,o){this.ng1Injector=t,this.zone=e,this.router=n,this.contextDashboardService=r,this.actionBarService=o,this.dashboardSvc=t.get("dashboardSvc"),this.compile=t.get("$compile")}return Object.defineProperty(t.prototype,"ng1Components",{get:function(){return this.ng1Injector.get("c8yComponents")},enumerable:!1,configurable:!0}),t.prototype.instantiateComponent=function(t,e){return S(this,void 0,void 0,(function(){var n,r,o,i,a=this;return C(this,(function(c){switch(c.label){case 0:return n=t.dashboard,r=t.context,o=t.child,n?[4,this.dashboardSvc.transformChildWithContext(this.dashboardSvc.forcedContext||r,n,o)]:[3,4];case 1:return i=c.sent(),this.dashboardSvc.forcedContext||n.deviceType?[4,this.dashboardSvc.updateConfigTargetsWithContext(this.dashboardSvc.forcedContext||r,i.config)]:[3,3];case 2:c.sent(),c.label=3;case 3:return[2,this.zone.runOutsideAngular((function(){return a.loadTemplate(i,o,e,r)}))];case 4:return[2,this.loadConfigTemplate(e,t)]}}))}))},t.prototype.editDashboard=function(t){return S(this,void 0,void 0,(function(){return C(this,(function(e){return[2,this.dashboardSvc.editCurrentDashboard({dashboardId:t.id})]}))}))},t.prototype.copyDashboard=function(){var t=this.getDashboard();if(this.dashboardSvc.copyDashboard(t.c8y_Dashboard))return this.dashboardClipboard=t,this.actionBarService.refresh(),t},t.prototype.pasteDashboard=function(){return S(this,void 0,void 0,(function(){var t;return C(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.dashboardSvc.pasteDashboard()];case 1:return t=e.sent(),this.navigateToDashboard(t),this.dashboardClipboard=void 0,[3,3];case 2:return e.sent(),[3,3];case 3:return this.actionBarService.refresh(),[2]}}))}))},t.prototype.instantiateDeviceSelector=function(t,e){return this.loadConfigTemplate(t,e,!0)},t.prototype.loadTemplate=function(t,e,n,r){var o=this.ng1Injector.get("$rootScope").$new(!0);return o.child=t,o.dashboardContext=r,e.widgetComponent?n.innerHTML="<c8y-ui-component component-name=\"'"+e.widgetComponent+'\'" config="child.config" context="dashboardContext"></c8y-ui-component>':e.templateUrl&&(n.innerHTML="<ng-include src=\"'"+e.templateUrl+"'\"></ng-include>"),this.compile(n)(o),o},t.prototype.navigateToDashboard=function(t){/dashboard/.test(this.router.url)?this.router.navigate(["..",t.id],{relativeTo:e.getActivatedRoute(this.router)}):this.router.navigate(["..","dashboard",t.id],{relativeTo:e.getActivatedRoute(this.router)})},t.prototype.getDashboard=function(){return e.getActivatedRoute(this.router).snapshot.data.dashboard},t.prototype.loadConfigTemplate=function(t,n,r){var i=this;void 0===r&&(r=!1);var a=n.settings,c=this.ng1Injector.get("$rootScope").$new(!0);c.settings=Object.assign(Object.assign({},a),a.ng1),c.options=n.options,c.config=n,c.forms={},c.rootId=a.context.id,c.dashboard=o.get(n,"settings.dashboardMo");var s="";return r||(n.settings.configComponent?s="<c8y-ui-component component-name=\"'"+n.settings.configComponent+'\'" config="config"></c8y-ui-component>':n.settings.configTemplateUrl&&(s="<ng-include src=\"'"+n.settings.configTemplateUrl+"'\"></ng-include>")),t.innerHTML='\n <ng-form name="forms.componentForm">\n <div class="form-group"\n ng-if="!settings.noDeviceTarget"\n ng-style="{height: settings.hideTarget && \'0\', overflow: \'hidden\'}"\n >\n <label translate>'+e.gettext("Target assets or devices")+'</label>\n <c8y-device-selector-combo parent="rootId"\n selected-child-device="config.device"\n groups-selectable="settings.groupsSelectable"\n select-required="!settings.deviceTargetNotRequired"\n ></c8y-device-selector-combo>\n </div>\n '+s+"\n </ng-form>",c.$watch("forms.componentForm.$invalid",(function(t){i.contextDashboardService.formDisabled=t})),this.compile(t)(c),this.contextDashboardService.formDisabled=c.forms.componentForm.$invalid,c},t}();gt.decorators=[{type:a.Injectable}],gt.ctorParameters=function(){return[{type:void 0},{type:a.NgZone},{type:i.Router},{type:f.ContextDashboardService},{type:e.ActionBarService}]};var vt=function(){function t(t,e,n){this.dashboard=t,this.dashboardBridgeService=e,this.el=n}return t.prototype.ngOnInit=function(){return S(this,void 0,void 0,(function(){var t,e=this;return C(this,(function(n){switch(n.label){case 0:return t=this,[4,this.dashboardBridgeService.instantiateComponent(this.config,this.el.nativeElement)];case 1:return t.ng1Scope=n.sent(),this.dashboard&&(this.resizeSubscription=this.dashboard.onChangeDashboard.subscribe((function(){e.ng1Scope.$broadcast("dashboardResize")}))),[2]}}))}))},t.prototype.ngOnDestroy=function(){this.ng1Scope&&this.ng1Scope.$destroy(),this.resizeSubscription&&this.resizeSubscription.unsubscribe()},t}();vt.decorators=[{type:a.Component,args:[{selector:"c8y-widget-legacy",template:"",changeDetection:a.ChangeDetectionStrategy.OnPush}]}],vt.ctorParameters=function(){return[{type:e.WidgetsDashboardComponent,decorators:[{type:a.Optional}]},{type:gt},{type:a.ElementRef}]};var yt=function(){function t(t,e){this.dashboardBridgeService=t,this.el=e}return t.prototype.ngOnInit=function(){return S(this,void 0,void 0,(function(){return C(this,(function(t){return this.ng1Scope=this.dashboardBridgeService.instantiateDeviceSelector(this.el.nativeElement,this.config),[2]}))}))},t.prototype.ngOnDestroy=function(){this.ng1Scope&&this.ng1Scope.$destroy()},t}();yt.decorators=[{type:a.Component,args:[{selector:"c8y-device-selector-legacy",template:"",changeDetection:a.ChangeDetectionStrategy.OnPush}]}],yt.ctorParameters=function(){return[{type:gt},{type:a.ElementRef}]};var mt=function(){function t(t){this.bridge=t}return t.prototype.get=function(){return S(this,void 0,void 0,(function(){var t;return C(this,(function(e){switch(e.label){case 0:return[4,this.bridge.ng1Components.list()];case 1:return(t=e.sent().map((function(t){var e={settings:Object.assign(Object.assign({},t.options),{configTemplateUrl:t.configTemplateUrl,widgetComponent:t.widgetComponent,configComponent:t.configComponent,transformConfigWithContext:t.transformConfigWithContext||t.componentTransformConfigWithContext,upgrade:!0})};return e.settings.templateUrl=t.templateUrl,{id:t.name,label:t.nameDisplay||t.name,description:t.description,component:vt,configComponent:vt,previewImage:t.previewImage,data:e}}))).push({id:"device.selector.legacy",label:"Device selector",description:"",data:{settings:{noNewWidgets:!0,upgrade:!0}},component:yt}),[2,t]}}))}))},t}();mt.decorators=[{type:a.Injectable}],mt.ctorParameters=function(){return[{type:gt}]};var bt=function(){function t(t,e){this.vcRef=t,this.dashboardBridgeService=e}return t.prototype.ngOnInit=function(){this.vcRef.createEmbeddedView(this.templateCopy)},t.prototype.copyDashboard=function(){this.dashboardBridgeService.copyDashboard()},t}();bt.decorators=[{type:a.Component,args:[{selector:"c8y-copy-action-legacy",template:'\n <ng-template #templateCopy>\n <li>\n <button title="{{\'Copy dashboard\' | translate}}" (click)="copyDashboard()">\n <i class="dlt-c8y-icon-copy m-r-4"></i><span translate>Copy dashboard</span>\n </button>\n </li>\n </ng-template>\n '}]}],bt.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:gt}]},bt.propDecorators={templateCopy:[{type:a.ViewChild,args:["templateCopy",{read:a.TemplateRef,static:!0}]}]};var St=function(){function t(t,e){this.vcRef=t,this.dashboardBridgeService=e,this.dashboardName=""}return t.prototype.ngOnInit=function(){this.vcRef.createEmbeddedView(this.templatePaste),this.dashboardName=this.dashboardBridgeService.dashboardClipboard.c8y_Dashboard.name},t.prototype.pasteDashboard=function(){this.dashboardBridgeService.pasteDashboard()},t}();St.decorators=[{type:a.Component,args:[{selector:"c8y-paste-action-legacy",template:'\n <ng-template #templatePaste>\n <li>\n <button title="{{\'Paste dashboard\' | translate}}" (click)="pasteDashboard()">\n <i class="m-r-4" c8yIcon="clipboard"></i><span translate>Paste dashboard</span>&nbsp;<span\n >"{{ dashboardName }}"</span\n >\n </button>\n </li>\n </ng-template>\n '}]}],St.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:gt}]},St.propDecorators={templatePaste:[{type:a.ViewChild,args:["templatePaste",{read:a.TemplateRef,static:!0}]}]};var Ct=function(){function t(t){this.dashboardBridgeService=t}return t.prototype.get=function(t){var n=[],r=!t.parent||t.snapshot.data.context?t.snapshot.data:t.parent.snapshot.data,o=r.contextData,i=o&&t.snapshot.data.dashboard&&[e.ViewContext.Device,e.ViewContext.Group].includes(r.context),a=o&&[e.ViewContext.Device,e.ViewContext.Group].includes(r.context)&&this.dashboardBridgeService.dashboardClipboard;return i&&n.push({priority:-20,placement:"more",template:bt}),a&&n.push({priority:-10,placement:"more",template:St}),n},t}();Ct.decorators=[{type:a.Injectable}],Ct.ctorParameters=function(){return[{type:gt}]};var wt=function(){};function jt(t,e,n,r,o){return new gt(t,e,n,r,o)}wt.decorators=[{type:a.NgModule,args:[{declarations:[yt,vt,bt,St],entryComponents:[yt,vt,bt,St],imports:[g.CommonModule,e.C8yTranslateModule],providers:[{provide:gt,useFactory:jt,deps:["$injector",a.NgZone,i.Router,[new a.Optional,f.ContextDashboardService],e.ActionBarService]},{provide:e.HOOK_COMPONENTS,useClass:mt,multi:!0},{provide:e.HOOK_ACTION_BAR,useClass:Ct,multi:!0}]}]}],t.AuthBridgeService=P,t.BridgeService=x,t.CopyActionComponent=bt,t.DashboardBridgeService=gt,t.DashboardUpgradeModule=wt,t.DeviceSelectorComponent=yt,t.HybridAppModule=lt,t.Ng1ActionBarFactoryService=O,t.Ng1ActionFactoryService=D,t.Ng1BreadcrumbFactoryService=I,t.Ng1ComponentFactoryService=mt,t.Ng1DashboardActionFactoryService=Ct,t.Ng1DocsFactoryService=k,t.Ng1NodesFactoryService=$,t.Ng1TabsFactoryService=N,t.PasteActionComponent=St,t.UPGRADE_ROUTES=ft,t.UpgradeModule=V,t.WidgetComponent=vt,t.authBridgeServiceFactory=R,t.authBridgeServiceProvider=B,t.bridgeServiceFactory=T,t.bridgeServiceProvider=A,t.dashboardBridgeFactory=jt,t.ng1Modules=ht,t.ɵa=E,t.ɵb=U,t.ɵc=_,Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=c8y-ngx-components-upgrade.umd.min.js.map