diff --git a/dist/7058.f66bee5fee6bbbcf.js b/dist/7058.4d96443277713c28.js similarity index 98% rename from dist/7058.f66bee5fee6bbbcf.js rename to dist/7058.4d96443277713c28.js index fdbc2ff8..d7ce986c 100644 --- a/dist/7058.f66bee5fee6bbbcf.js +++ b/dist/7058.4d96443277713c28.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdf_admin_interface=self.webpackChunkdf_admin_interface||[]).push([[7058],{67058:(q,v,c)=>{c.r(v),c.d(v,{DfManageAppsTableComponent:()=>L});var i=c(18724),R=c(21406),M=c(63956),h=c(75066),x=c(88236),A=c(97828),k=c(43015),G=c(17291),$=c(61417),u=c(18331),S=c(94093),B=c(86606),D=c(52483),s=c(73151),f=c(80972),p=c(66460),n=c(1843),g=c(16396),U=c(11863),nn=c(83607),K=c(31147),Y=c(62633),tn=c(10056),T=c(68660),V=c(54342),d=c(58497),y=c(87621),I=c(78227),W=c(1929),w=c(54688),z=c(453),j=c(82180),J=c(4965),H=c(91900),en=c(42250);function an(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",6),n.bIt("click",function(){n.eBV(t);const _=n.XpG();return n.Njj(_.createRow())}),n.nI1(1,"transloco"),n.nrm(2,"fa-icon",7),n.k0s()}if(2&e){const t=n.XpG();n.BMQ("aria-label",n.bMT(1,2,"newEntry")),n.R7$(2),n.Y8G("icon",t.faPlus)}}function on(e,o){if(1&e&&(n.j41(0,"mat-option",12),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e){const t=o.$implicit;n.Y8G("value",t.value),n.R7$(1),n.SpI(" ",n.bMT(2,2,t.label)," ")}}function cn(e,o){if(1&e&&(n.j41(0,"mat-form-field",9)(1,"mat-label"),n.EFF(2),n.nI1(3,"transloco"),n.k0s(),n.j41(4,"mat-select",10),n.DNE(5,on,3,4,"mat-option",11),n.k0s()()),2&e){const t=n.XpG().ngIf;n.R7$(2),n.JRh(n.bMT(3,3,"accessUsage.filter.label")),n.R7$(2),n.Y8G("formControl",t.filter),n.R7$(1),n.Y8G("ngForOf",t.filterOptions)}}function _n(e,o){if(1&e&&(n.qex(0),n.DNE(1,cn,6,5,"mat-form-field",8),n.bVm()),2&e){const t=o.ngIf;n.R7$(1),n.Y8G("ngIf",t.available)}}function rn(e,o){if(1&e&&(n.j41(0,"mat-form-field",13)(1,"mat-label"),n.EFF(2),n.nI1(3,"transloco"),n.k0s(),n.nrm(4,"input",14),n.k0s()),2&e){const t=n.XpG();n.R7$(2),n.JRh(n.bMT(3,2,"search")),n.R7$(2),n.Y8G("formControl",t.currentFilter)}}function ln(e,o){1&e&&n.nrm(0,"mat-progress-bar",25)}function sn(e,o){if(1&e){const t=n.RV6();n.j41(0,"div",26)(1,"div",27),n.nrm(2,"fa-icon",28),n.j41(3,"span"),n.EFF(4),n.nI1(5,"transloco"),n.k0s(),n.j41(6,"button",29),n.bIt("click",function(){n.eBV(t);const _=n.XpG(2);return n.Njj(_.retryLastFetch())}),n.EFF(7),n.nI1(8,"transloco"),n.k0s()(),n.nrm(9,"df-error-detail",30),n.k0s()}if(2&e){const t=n.XpG(2);n.R7$(2),n.Y8G("icon",t.faTriangleExclamation),n.R7$(2),n.JRh(n.bMT(5,4,t.tableError.message)),n.R7$(3),n.SpI(" ",n.bMT(8,6,"retry")," "),n.R7$(2),n.Y8G("error",t.tableError)}}function pn(e,o){if(1&e&&(n.j41(0,"th",36),n.nI1(1,"async"),n.EFF(2),n.nI1(3,"transloco"),n.k0s()),2&e){const t=n.XpG(2).$implicit,a=n.XpG(2);n.AVh("df-numeric",a.isNumericColumn(t.columnDef)||"tokens"===t.columnDef||"spend"===t.columnDef),n.BMQ("sortActionDescription",n.bMT(1,4,a.sortDescription(t.header))),n.R7$(2),n.SpI(" ",n.bMT(3,6,t.header)," ")}}function mn(e,o){if(1&e&&n.nrm(0,"fa-icon",28),2&e){const t=n.XpG().$implicit,a=n.XpG(2).$implicit,_=n.XpG(2);n.HbH(_.isCellActive(null==a?null:a.cell(t))?"active":"inactive"),n.Y8G("icon",_.activeIcon(_.isCellActive(null==a?null:a.cell(t))))}}function dn(e,o){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"number"),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.R7$(1),n.JRh(n.bMT(2,1,t.tokens))}}function gn(e,o){if(1&e&&(n.qex(0),n.DNE(1,dn,3,3,"span",40),n.bVm()),2&e){const t=n.XpG().$implicit;n.XpG(4);const a=n.sdS(9);n.R7$(1),n.Y8G("ngIf",null!==t.tokens)("ngIfElse",a)}}function fn(e,o){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"currency"),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.R7$(1),n.JRh(n.ii3(2,1,t.spendUsd,"USD","symbol","1.2-2"))}}function un(e,o){if(1&e&&(n.qex(0),n.DNE(1,fn,3,6,"span",40),n.bVm()),2&e){const t=n.XpG().$implicit;n.XpG(4);const a=n.sdS(9);n.R7$(1),n.Y8G("ngIf",null!==t.spendUsd)("ngIfElse",a)}}c(69099);const bn=function(e){return["/api-connections/role-based-access",e]},Mn=function(e){return{role:e}};function Dn(e,o){if(1&e&&(n.j41(0,"a",43),n.bIt("click",function(a){return a.stopPropagation()}),n.nI1(1,"transloco"),n.EFF(2),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.Y8G("routerLink",n.eq3(6,bn,t.roleId)),n.BMQ("aria-label",n.i5U(1,3,"apps.virtualKey.roleLink",n.eq3(8,Mn,t.role))),n.R7$(2),n.SpI(" ",t.role," ")}}function Cn(e,o){if(1&e&&n.EFF(0),2&e){const t=n.XpG(2).$implicit;n.JRh(t.role)}}function hn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Dn,3,10,"a",41),n.DNE(2,Cn,1,1,"ng-template",null,42,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG().$implicit;n.R7$(1),n.Y8G("ngIf",null!==a.roleId&&a.role)("ngIfElse",t)}}function En(e,o){if(1&e&&(n.qex(0),n.EFF(1),n.bVm()),2&e){const t=n.XpG().$implicit,a=n.XpG(2).$implicit;n.R7$(1),n.SpI(" ",null==a?null:a.cell(t)," ")}}function vn(e,o){if(1&e&&n.nrm(0,"df-access-usage-cell",44),2&e){const t=n.XpG().$implicit,a=n.XpG(4);let _,l;n.Y8G("usage",null==a.accessUsage?null:a.accessUsage.get(t.id))("staleDays",null!==(_=null==a.accessUsage?null:a.accessUsage.staleDays)&&void 0!==_?_:null)("trackingStartedAt",null!==(l=null==a.accessUsage?null:a.accessUsage.trackingStartedAt)&&void 0!==l?l:null)}}function Tn(e,o){if(1&e&&(n.j41(0,"td",37),n.DNE(1,mn,1,3,"fa-icon",38),n.DNE(2,gn,2,2,"ng-container",3),n.DNE(3,un,2,2,"ng-container",3),n.DNE(4,hn,4,2,"ng-container",3),n.DNE(5,En,2,1,"ng-container",3),n.DNE(6,vn,1,3,"df-access-usage-cell",39),n.k0s()),2&e){const t=n.XpG(2).$implicit,a=n.XpG(2);n.AVh("df-numeric",a.isNumericColumn(t.columnDef)||"tokens"===t.columnDef||"spend"===t.columnDef),n.R7$(1),n.Y8G("ngIf","active"===t.columnDef),n.R7$(1),n.Y8G("ngIf","tokens"===t.columnDef),n.R7$(1),n.Y8G("ngIf","spend"===t.columnDef),n.R7$(1),n.Y8G("ngIf","role"===t.columnDef),n.R7$(1),n.Y8G("ngIf","active"!==t.columnDef&&"tokens"!==t.columnDef&&"spend"!==t.columnDef&&"role"!==t.columnDef&&"lastUsed"!==t.columnDef),n.R7$(1),n.Y8G("ngIf","lastUsed"===t.columnDef)}}function yn(e,o){if(1&e&&(n.qex(0,33),n.DNE(1,pn,4,8,"th",34),n.DNE(2,Tn,7,8,"td",35),n.bVm()),2&e){const t=n.XpG().$implicit;n.Y8G("matColumnDef",t.columnDef)}}function In(e,o){if(1&e&&(n.j41(0,"th",47),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.R7$(1),n.SpI(" ",n.bMT(2,1,t.header)," ")}}const Pn=function(e,o,t){return{consumed:e,cap:o,period:t}};function On(e,o){if(1&e&&(n.qex(0),n.j41(1,"div",50),n.nI1(2,"transloco"),n.j41(3,"div",51),n.nrm(4,"div",52),n.k0s(),n.j41(5,"span",53),n.EFF(6),n.k0s()(),n.bVm()),2&e){const t=n.XpG().$implicit;n.R7$(1),n.HbH("df-meter--"+t.meter.variant),n.BMQ("aria-valuenow",t.meter.consumed)("aria-valuemax",t.meter.cap)("aria-label",n.i5U(2,8,"apps.virtualKey.meterAria",n.sMw(11,Pn,t.meter.consumed,t.meter.cap,t.meter.period))),n.R7$(3),n.xc7("width",100*t.meter.ratio,"%"),n.R7$(2),n.JRh(t.meter.label)}}function Rn(e,o){1&e&&(n.j41(0,"span",54),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e&&(n.R7$(1),n.JRh(n.bMT(2,1,"apps.virtualKey.noCap")))}function xn(e,o){if(1&e&&(n.j41(0,"td",48),n.DNE(1,On,7,15,"ng-container",40),n.DNE(2,Rn,3,3,"ng-template",null,49,n.C5r),n.k0s()),2&e){const t=o.$implicit,a=n.sdS(3);n.R7$(1),n.Y8G("ngIf",t.meter)("ngIfElse",a)}}function An(e,o){if(1&e&&(n.qex(0,33),n.DNE(1,In,3,3,"th",45),n.DNE(2,xn,4,2,"td",46),n.bVm()),2&e){const t=n.XpG().$implicit;n.Y8G("matColumnDef",t.columnDef)}}function kn(e,o){1&e&&n.nrm(0,"th",58)}const F=function(e){return{param:e}};function Gn(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",63),n.bIt("click",function(){n.eBV(t);const _=n.XpG(3).$implicit,l=n.XpG(4);return n.Njj(l.actions.additional[0].function(_))})("click",function(_){return _.stopPropagation()}),n.nI1(1,"transloco"),n.nrm(2,"fa-icon",64),n.k0s()}if(2&e){const t=n.XpG(7);n.BMQ("aria-label",n.i5U(1,2,t.actions.additional[0].ariaLabel.key,n.eq3(5,F,t.actions.additional[0].ariaLabel.param))),n.R7$(2),n.Y8G("icon",t.actions.additional[0].icon)}}function $n(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",65),n.bIt("click",function(){n.eBV(t);const _=n.XpG(3).$implicit,l=n.XpG(4);return n.Njj(l.actions.additional[0].function(_))})("click",function(_){return _.stopPropagation()}),n.nI1(1,"transloco"),n.EFF(2),n.nI1(3,"transloco"),n.k0s()}if(2&e){const t=n.XpG(7);n.BMQ("aria-label",n.i5U(1,2,t.actions.additional[0].ariaLabel.key,n.eq3(7,F,t.actions.additional[0].ariaLabel.param))),n.R7$(2),n.SpI(" ",n.bMT(3,5,t.actions.additional[0].label)," ")}}function Sn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Gn,3,7,"button",61),n.DNE(2,$n,4,9,"ng-template",null,62,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG(6);n.R7$(1),n.Y8G("ngIf",a.actions.additional[0].icon)("ngIfElse",t)}}function Bn(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",69),n.bIt("click",function(){const l=n.eBV(t).$implicit,m=n.XpG(3).$implicit;return n.Njj(l.function(m))}),n.nI1(1,"transloco"),n.EFF(2),n.nI1(3,"transloco"),n.k0s()}if(2&e){const t=o.$implicit,a=n.XpG(3).$implicit,_=n.XpG(4);n.Y8G("disabled",_.isActionDisabled(t,a)),n.BMQ("aria-label",n.i5U(1,3,t.ariaLabel.key,n.eq3(8,F,t.ariaLabel.param))),n.R7$(2),n.SpI(" ",n.bMT(3,6,t.label)," ")}}function Un(e,o){if(1&e&&(n.j41(0,"button",66),n.bIt("click",function(a){return a.stopPropagation()}),n.nrm(1,"fa-icon",64),n.k0s(),n.j41(2,"mat-menu",null,67),n.DNE(4,Bn,4,10,"button",68),n.k0s()),2&e){const t=n.sdS(3),a=n.XpG(6);n.Y8G("matMenuTriggerFor",t),n.R7$(1),n.Y8G("icon",a.faEllipsisV),n.R7$(3),n.Y8G("ngForOf",a.actions.additional)}}function wn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Sn,4,2,"ng-container",40),n.DNE(2,Un,5,3,"ng-template",null,60,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG(5);n.R7$(1),n.Y8G("ngIf",1===a.actions.additional.length)("ngIfElse",t)}}function jn(e,o){if(1&e&&(n.j41(0,"td",59),n.DNE(1,wn,4,2,"ng-container",3),n.k0s()),2&e){const t=n.XpG(4);n.R7$(1),n.Y8G("ngIf",t.actions.additional&&t.actions.additional.length>0)}}function Fn(e,o){if(1&e&&(n.qex(0,55),n.DNE(1,kn,1,0,"th",56),n.DNE(2,jn,2,1,"td",57),n.bVm()),2&e){const t=n.XpG().$implicit;n.Y8G("matColumnDef",t.columnDef)}}function Ln(e,o){if(1&e&&(n.qex(0),n.DNE(1,yn,3,1,"ng-container",31),n.DNE(2,An,3,1,"ng-container",31),n.DNE(3,Fn,3,1,"ng-container",32),n.bVm()),2&e){const t=o.$implicit;n.R7$(1),n.Y8G("ngIf","actions"!==t.columnDef&&"meter"!==t.columnDef),n.R7$(1),n.Y8G("ngIf","meter"===t.columnDef),n.R7$(1),n.Y8G("ngIf","actions"===t.columnDef)}}function Xn(e,o){1&e&&n.nrm(0,"tr",70)}function Nn(e,o){if(1&e){const t=n.RV6();n.j41(0,"tr",71),n.bIt("click",function(){const l=n.eBV(t).$implicit,m=n.XpG(2);return n.Njj(m.callDefaultAction(l))})("keydown",function(_){const m=n.eBV(t).$implicit,b=n.XpG(2);return n.Njj(b.handleKeyDown(_,m))}),n.k0s()}if(2&e){const t=o.$implicit,a=n.XpG(2);n.AVh("clickable",a.isClickable(t)),n.BMQ("tabindex",a.isClickable(t)?0:-1)}}function Kn(e,o){if(1&e){const t=n.RV6();n.qex(0),n.EFF(1),n.nI1(2,"transloco"),n.j41(3,"button",75),n.bIt("click",function(){n.eBV(t);const _=n.XpG(4);return n.Njj(_.clearFilter())}),n.EFF(4),n.nI1(5,"transloco"),n.k0s(),n.bVm()}2&e&&(n.R7$(1),n.SpI(" ",n.bMT(2,2,"noFilterResults")," "),n.R7$(3),n.SpI(" ",n.bMT(5,4,"clearFilter")," "))}function Yn(e,o){if(1&e){const t=n.RV6();n.j41(0,"df-empty-state",76),n.bIt("action",function(){n.eBV(t);const _=n.XpG(4);return n.Njj(_.createRow())}),n.nI1(1,"transloco"),n.nI1(2,"transloco"),n.nI1(3,"transloco"),n.k0s()}if(2&e){const t=n.XpG(4);n.Y8G("title",n.bMT(1,3,"apps.virtualKey.empty.title"))("description",n.bMT(2,5,"apps.virtualKey.empty.description"))("actionLabel",t.allowCreate?n.bMT(3,7,"apps.virtualKey.empty.action"):void 0)}}function Vn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Kn,6,6,"ng-container",40),n.DNE(2,Yn,4,9,"ng-template",null,74,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG(3);n.R7$(1),n.Y8G("ngIf",a.currentFilter.value||(null==a.accessUsage?null:a.accessUsage.filterActive))("ngIfElse",t)}}function Wn(e,o){if(1&e&&(n.j41(0,"tr",72)(1,"td",73),n.DNE(2,Vn,4,2,"ng-container",3),n.k0s()()),2&e){const t=n.XpG(2);n.R7$(1),n.BMQ("colspan",t.columns.length),n.R7$(1),n.Y8G("ngIf","loading"!==t.tableState&&"error"!==t.tableState)}}function zn(e,o){if(1&e){const t=n.RV6();n.qex(0),n.DNE(1,ln,1,0,"mat-progress-bar",15),n.DNE(2,sn,10,8,"div",16),n.j41(3,"div",17)(4,"table",18),n.bIt("matSortChange",function(_){n.eBV(t);const l=n.XpG();return n.Njj(l.announceSortChange(_))}),n.DNE(5,Ln,4,3,"ng-container",19),n.DNE(6,Xn,1,0,"tr",20),n.DNE(7,Nn,1,3,"tr",21),n.DNE(8,Wn,3,2,"tr",22),n.k0s(),n.j41(9,"div",23)(10,"mat-paginator",24),n.bIt("page",function(_){n.eBV(t);const l=n.XpG();return n.Njj(l.changePage(_))}),n.k0s()()(),n.bVm()}if(2&e){const t=o.ngIf,a=n.XpG();n.R7$(1),n.Y8G("ngIf","loading"===a.tableState),n.R7$(1),n.Y8G("ngIf","error"===a.tableState&&a.tableError),n.R7$(1),n.AVh("table-stale","loading"===a.tableState),n.R7$(1),n.Y8G("dataSource",a.dataSource),n.R7$(1),n.Y8G("ngForOf",a.columns),n.R7$(1),n.Y8G("matHeaderRowDef",a.displayedColumns),n.R7$(1),n.Y8G("matRowDefColumns",a.displayedColumns),n.R7$(3),n.Y8G("pageSize",t.currentPageSize)("pageSizeOptions",a.pageSizes)("length",a.tableLength)}}function Jn(e,o){1&e&&(n.j41(0,"span",54),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e&&(n.R7$(1),n.JRh(n.bMT(2,1,"apps.virtualKey.noUsage")))}const Hn=[[["","topActions",""]]],Qn=function(e){return{currentPageSize:e}},Zn=["[topActions]"];let L=class N extends M.Py{constructor(o,t,a,_,l,m,b,C,P,qn){var O;super(l,m,b,C,P),O=this,this.appsService=o,this.limitService=t,this.usageService=a,this.systemConfigDataService=_,this.snackbarService=qn,this.emptyStateMessage="emptyState.apps.message",this.emptyStateActionLabel="emptyState.apps.action",this.usageByApp=new Map,this.meterByRole=new Map,this.columns=[{columnDef:"active",cell:r=>r.active,header:"active"},{columnDef:"name",cell:r=>r.name,header:"name"},{columnDef:"role",cell:r=>r.role,header:"role"},{columnDef:"apiKey",cell:r=>r.apiKey,header:"apiKey"},{columnDef:"tokens",cell:r=>r.tokens,header:"apps.virtualKey.tokens"},{columnDef:"spend",cell:r=>r.spendUsd,header:"apps.virtualKey.spend"},{columnDef:"meter",cell:r=>r.meter,header:"apps.virtualKey.rateLimit"},{columnDef:"actions"}],this.filterQuery=(0,x.J)("apps"),this.snackbarService.setSnackbarLastEle("",!1);const Q=[{label:"apps.launchApp",function:r=>{window.open(r.launchUrl,"_blank")},ariaLabel:{key:"apps.launchApp"},disabled:r=>!r.launchUrl},{label:"apps.createApp.apiKey.copy",function:r=>{navigator.clipboard.writeText(r.apiKey)},ariaLabel:{key:"apps.createApp.apiKey.copy"}},{label:"apps.createApp.apiKey.refresh",function:(r=(0,i.A)(function*(E){const Z=yield(0,k.X)(O.systemConfigDataService.environment.server.host,E.name);O.appsService.update(E.id,{api_key:Z}).subscribe(()=>O.refreshTable())}),function(Z){return r.apply(this,arguments)}),ariaLabel:{key:"apps.createApp.apiKey.refresh"},disabled:r=>null===r.createdById}],X={label:"duplicate",function:r=>this.duplicateApp(r),ariaLabel:{key:"duplicateApp",param:"name"},icon:S.jPR};var r;if(this.actions.additional){const r=this.actions.additional.findIndex(E=>"delete"===E.label);-1!==r?this.actions.additional.splice(r,0,X):this.actions.additional.unshift(X),this.actions.additional.push(...Q)}else this.actions.additional=[X,...Q];this.loadMetrics(),this.enableAccessUsage("app",{header:"accessUsage.lastUsed",before:"tokens"})}mapDataToTable(o){return o.map(t=>this.enrich(this.baseRow(t)))}baseRow(o){return{id:o.id,name:o.name,role:o.roleByRoleId?.description||"",roleId:o.roleId??null,apiKey:o.apiKey,description:o.description,active:o.isActive,launchUrl:o.launchUrl,createdById:o.createdById,tokens:null,spendUsd:null,meter:null}}enrich(o){const t=this.usageByApp.get(o.id),a=null!=o.roleId?this.meterByRole.get(o.roleId):null;return{...o,tokens:t?t.tokens:null,spendUsd:t?t.spend:null,meter:a??null}}loadMetrics(){(0,B.p)({usage:this.usageService.loadAll("30d").pipe((0,D.W)(()=>(0,s.of)(null))),limits:this.limitService.getAll({limit:0,related:"limit_cache_by_limit_id"}).pipe((0,D.W)(()=>(0,s.of)(null)))}).subscribe(({usage:o,limits:t})=>{if(o){this.usageByApp.clear();for(const a of o.raw.by_app??[])null!=a.app_id&&this.usageByApp.set(a.app_id,{tokens:(0,p.n)(a.input_tokens)+(0,p.n)(a.output_tokens),spend:(0,p.n)(a.cost_usd)})}t&&(this.meterByRole=this.buildMeters(t.resource??[])),this.enrichExistingRows()})}buildMeters(o){const t=new Map;for(const a of o){if(!a.isActive||null==a.roleId)continue;const _=a.limitCacheByLimitId?.[0],l=_?.max??a.rate;if(!l||l<=0)continue;const b=this.toMeter(_?.attempts??0,l,a.period),C=t.get(a.roleId);(!C||b.ratio>C.ratio)&&t.set(a.roleId,b)}return t}toMeter(o,t,a){const _=Math.max(0,Math.min(1,t>0?o/t:0));let l="ok";return _>=.9?l="danger":_>=.75&&(l="warning"),{consumed:o,cap:t,ratio:_,period:a,variant:l,label:`${o} / ${t}`}}enrichExistingRows(){this.dataSource.data.length&&(this.dataSource.data=this.dataSource.data.map(o=>this.enrich(o)))}deleteRow(o){this.appsService.delete(o.id).subscribe(()=>{this.refreshTable()})}refreshTable(o,t,a){this.fetchTable(this.appsService,{limit:o,offset:t,filter:a})}duplicateApp(o){this.appsService.get(o.id).pipe((0,D.W)(t=>(console.error("Failed to fetch app details:",t),(0,f.$)(()=>t)))).subscribe(t=>{this.appsService.getAll({limit:1e3}).subscribe(a=>{const _=a.resource.map(m=>m.name);this.dialog.open(G.B,{width:"400px",data:{title:"apps.duplicate.title",message:"apps.duplicate.message",label:"apps.duplicate.nameLabel",originalName:t.name,existingNames:_}}).afterClosed().subscribe(m=>{m&&this.appsService.create({resource:[{name:m,description:`${t.description||""} (copy)`,is_active:t.isActive,type:t.type,role_id:t.roleId||null,url:t.url||null,storage_service_id:t.storageServiceId||null,storage_container:t.storageContainer||null,path:t.path||null,requires_fullscreen:t.requiresFullscreen,allow_fullscreen_toggle:t.allowFullscreenToggle,toggle_location:t.toggleLocation}]},{snackbarSuccess:"apps.alerts.duplicateSuccess",fields:"*",related:"role_by_role_id"}).pipe((0,D.W)(P=>(console.error("Failed to duplicate app:",P),(0,f.$)(()=>P)))).subscribe(()=>{this.refreshTable()})})})})}static{this.\u0275fac=function(t){return new(t||N)(n.rXU(h.u7),n.rXU(h.gu),n.rXU(p.D_),n.rXU(g.f),n.rXU(U.Ix),n.rXU(U.nX),n.rXU(nn.Ai),n.rXU(K.JO),n.rXU(Y.bZ),n.rXU(tn.L))}}static{this.\u0275cmp=n.VBU({type:N,selectors:[["df-manage-apps-table"]],standalone:!0,features:[n.Vt3,n.aNF],ngContentSelectors:Zn,decls:10,vars:8,consts:[[1,"top-action-bar"],["mat-mini-fab","","class","save-btn","data-testid","manage-table-create","type","button",3,"click",4,"ngIf"],[1,"spacer"],[4,"ngIf"],["class","search-input","appearance","outline","subscriptSizing","dynamic",4,"ngIf"],["noMetric",""],["mat-mini-fab","","data-testid","manage-table-create","type","button",1,"save-btn",3,"click"],["size","xl",3,"icon"],["class","df-usage-filter","data-testid","access-usage-filter","appearance","outline","subscriptSizing","dynamic",4,"ngIf"],["data-testid","access-usage-filter","appearance","outline","subscriptSizing","dynamic",1,"df-usage-filter"],[3,"formControl"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["appearance","outline","subscriptSizing","dynamic",1,"search-input"],["matInput","",3,"formControl"],["class","table-loading-bar","mode","indeterminate",4,"ngIf"],["class","table-error-panel",4,"ngIf"],[1,"table-container"],["mat-table","","matSort","",3,"dataSource","matSortChange"],[4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"clickable","click","keydown",4,"matRowDef","matRowDefColumns"],["class","mat-row no-data-row",4,"matNoDataRow"],[1,"bottom-action-bar"],["showFirstLastButtons","","aria-label","'selectPage' | transloco",3,"pageSize","pageSizeOptions","length","page"],["mode","indeterminate",1,"table-loading-bar"],[1,"table-error-panel"],[1,"table-error-headline"],["size","lg",3,"icon"],["mat-stroked-button","","type","button",3,"click"],[3,"error"],[3,"matColumnDef",4,"ngIf"],["stickyEnd","",3,"matColumnDef",4,"ngIf"],[3,"matColumnDef"],["mat-header-cell","","mat-sort-header","","class","df-eyebrow",3,"df-numeric",4,"matHeaderCellDef"],["mat-cell","",3,"df-numeric",4,"matCellDef"],["mat-header-cell","","mat-sort-header","",1,"df-eyebrow"],["mat-cell",""],["size","lg",3,"icon","class",4,"ngIf"],[3,"usage","staleDays","trackingStartedAt",4,"ngIf"],[4,"ngIf","ngIfElse"],["class","df-role-link",3,"routerLink","click",4,"ngIf","ngIfElse"],["plainRole",""],[1,"df-role-link",3,"routerLink","click"],[3,"usage","staleDays","trackingStartedAt"],["mat-header-cell","","class","df-eyebrow",4,"matHeaderCellDef"],["mat-cell","","class","df-meter-cell",4,"matCellDef"],["mat-header-cell","",1,"df-eyebrow"],["mat-cell","",1,"df-meter-cell"],["noCap",""],["role","meter",1,"df-meter"],[1,"df-meter-track"],[1,"df-meter-fill"],[1,"df-meter-label","df-numeric"],[1,"df-metric-empty"],["stickyEnd","",3,"matColumnDef"],["mat-header-cell","",4,"matHeaderCellDef"],["class","actions df-row-actions","mat-cell","",4,"matCellDef"],["mat-header-cell",""],["mat-cell","",1,"actions","df-row-actions"],["multiple",""],["class","action-btn","mat-icon-button","","type","button",3,"click",4,"ngIf","ngIfElse"],["regular",""],["mat-icon-button","","type","button",1,"action-btn",3,"click"],["size","xs",3,"icon"],["mat-flat-button","","color","primary","type","button",3,"click"],["mat-icon-button","","aria-label","Actions","type","button",3,"matMenuTriggerFor","click"],["actionsMenu","matMenu"],["type","button","mat-menu-item","",3,"disabled","click",4,"ngFor","ngForOf"],["type","button","mat-menu-item","",3,"disabled","click"],["mat-header-row",""],["mat-row","",3,"click","keydown"],[1,"mat-row","no-data-row"],[1,"mat-cell"],["noFilterActive",""],["mat-button","","color","primary","type","button",3,"click"],[3,"title","description","actionLabel","action"]],template:function(t,a){1&t&&(n.NAR(Hn),n.j41(0,"div",0),n.DNE(1,an,3,4,"button",1),n.SdG(2),n.nrm(3,"div",2),n.DNE(4,_n,2,1,"ng-container",3),n.DNE(5,rn,5,4,"mat-form-field",4),n.k0s(),n.DNE(6,zn,11,11,"ng-container",3),n.nI1(7,"async"),n.DNE(8,Jn,3,3,"ng-template",null,5,n.C5r)),2&t&&(n.R7$(1),n.Y8G("ngIf",a.allowCreate),n.R7$(3),n.Y8G("ngIf",a.accessUsage),n.R7$(1),n.Y8G("ngIf",a.allowFilter),n.R7$(1),n.Y8G("ngIf",n.eq3(6,Qn,n.bMT(7,4,a.currentPageSize$))))},dependencies:[u.bT,T.Hl,T.$z,T.iY,T.$0,V.dX,V.aY,d.tP,d.Zl,d.tL,d.ji,d.cC,d.YV,d.iL,d.KS,d.$R,d.YZ,d.NB,d.ky,u.Sq,y.Cn,y.kk,y.fb,y.Cp,I.X1,I.me,I.BC,I.l_,K.Kj,u.Jj,Y.hM,W.Ou,W.iy,w.RG,w.rl,w.nJ,z.fS,z.fg,j.NQ,j.B4,j.aE,J.PO,J.HM,M.R6,M.Zn,H.Ve,H.VO,en.wT,U.Wk,$.M,u.QX,u.oe],styles:[".df-health-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:0;margin:0;border:none;background:transparent;font:inherit;color:inherit;cursor:pointer}.active[_ngcontent-%COMP%]{color:var(--df-success)}.inactive[_ngcontent-%COMP%], .log-warning[_ngcontent-%COMP%]{color:var(--df-danger)}.top-action-bar[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;align-items:center;gap:var(--df-space-3);padding-bottom:var(--df-space-3)}.top-action-bar[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{height:80%!important;max-width:300px!important}.top-action-bar[_ngcontent-%COMP%] .df-usage-filter[_ngcontent-%COMP%]{width:160px}.bottom-action-bar[_ngcontent-%COMP%]{margin-top:var(--df-space-4);display:flex;flex-direction:row;justify-content:center}.table-container[_ngcontent-%COMP%]{width:100%;overflow-y:auto}.table-container.table-stale[_ngcontent-%COMP%]{opacity:.6;pointer-events:none}.table-loading-bar[_ngcontent-%COMP%]{margin-bottom:2px}.table-error-panel[_ngcontent-%COMP%]{margin-bottom:var(--df-space-3);padding:var(--df-space-3) var(--df-space-4);border:1px solid var(--df-danger-border);border-radius:var(--df-radius-sm);background-color:var(--df-danger-soft);color:var(--df-text)}.table-error-panel[_ngcontent-%COMP%] .table-error-headline[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--df-space-3);margin-bottom:var(--df-space-2)}.table-error-panel[_ngcontent-%COMP%] .table-error-headline[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{color:var(--df-danger)}.table-error-panel[_ngcontent-%COMP%] .table-error-headline[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;font-size:1.4rem}.no-data-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:var(--df-text-muted);font-size:1.35rem}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:var(--df-space-4);padding:var(--df-space-4);text-align:center}.empty-state[_ngcontent-%COMP%] .empty-state-message[_ngcontent-%COMP%]{margin:0;max-width:46rem;color:var(--df-text-muted);font-size:1.4rem;line-height:1.5}.mat-mdc-row[_ngcontent-%COMP%]{height:var(--df-row-height)!important}.mat-mdc-cell[_ngcontent-%COMP%], .mat-mdc-header-cell[_ngcontent-%COMP%]{border-bottom:1px solid var(--df-border-2)}.mat-mdc-cell.df-numeric[_ngcontent-%COMP%], .mat-mdc-header-cell.df-numeric[_ngcontent-%COMP%]{text-align:right}.mat-mdc-header-cell.df-numeric[_ngcontent-%COMP%] .mat-sort-header-container[_ngcontent-%COMP%]{justify-content:flex-end}.df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:0;transition:opacity var(--df-duration-fast) var(--df-ease-standard)}.mat-mdc-row[_ngcontent-%COMP%]:hover .df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .mat-mdc-row[_ngcontent-%COMP%]:focus-within .df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{opacity:1}.clickable.mat-mdc-row[_ngcontent-%COMP%]{outline:0}.clickable.mat-mdc-row[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{cursor:pointer}.clickable.mat-mdc-row[_ngcontent-%COMP%]:hover .mat-mdc-cell[_ngcontent-%COMP%]{background-color:var(--df-hover)}.clickable.mat-mdc-row[_ngcontent-%COMP%]:focus .mat-mdc-cell[_ngcontent-%COMP%], .clickable.mat-mdc-row[_ngcontent-%COMP%]:focus-within .mat-mdc-cell[_ngcontent-%COMP%]{background-color:var(--df-accent-soft)} [mat-sort-header].cdk-keyboard-focused .mat-sort-header-container, [mat-sort-header].cdk-program-focused[_ngcontent-%COMP%] .mat-sort-header-container[_ngcontent-%COMP%]{border-bottom:unset!important}",".mat-column-apiKey[_ngcontent-%COMP%]{max-width:300px;text-overflow:ellipsis}.mat-column-tokens[_ngcontent-%COMP%], .mat-column-spend[_ngcontent-%COMP%]{white-space:nowrap}.df-role-link[_ngcontent-%COMP%]{color:var(--df-accent);text-decoration:none;cursor:pointer}.df-role-link[_ngcontent-%COMP%]:hover, .df-role-link[_ngcontent-%COMP%]:focus-visible{text-decoration:underline}.df-role-link[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--df-accent);outline-offset:2px;border-radius:var(--df-radius-sm)}.df-metric-empty[_ngcontent-%COMP%]{color:var(--df-text-faint);font-size:1.2rem}.df-meter-cell[_ngcontent-%COMP%]{min-width:14rem}.df-meter[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--df-space-2)}.df-meter-track[_ngcontent-%COMP%]{position:relative;flex:1;height:.6rem;min-width:6rem;border-radius:var(--df-radius-sm);background:var(--df-surface-2);border:1px solid var(--df-border);overflow:hidden}.df-meter-fill[_ngcontent-%COMP%]{height:100%;border-radius:inherit;background:var(--df-accent);transition:width .24s ease}.df-meter--warning[_ngcontent-%COMP%] .df-meter-fill[_ngcontent-%COMP%]{background:var(--df-warning)}.df-meter--danger[_ngcontent-%COMP%] .df-meter-fill[_ngcontent-%COMP%]{background:var(--df-danger)}.df-meter-label[_ngcontent-%COMP%]{flex:none;font-size:1.2rem;color:var(--df-text-muted)}.df-meter--warning[_ngcontent-%COMP%] .df-meter-label[_ngcontent-%COMP%]{color:var(--df-warning)}.df-meter--danger[_ngcontent-%COMP%] .df-meter-label[_ngcontent-%COMP%]{color:var(--df-danger)}"]})}};L=(0,R.Cg)([(0,A.d)({checkProperties:!0})],L)},61417:(q,v,c)=>{c.d(v,{M:()=>D});var i=c(1843),R=c(18331),M=c(68660),h=c(7263);function x(s,f){if(1&s&&(i.j41(0,"div",5)(1,"mat-icon"),i.EFF(2),i.k0s()()),2&s){const p=i.XpG();i.R7$(2),i.JRh(p.icon)}}function A(s,f){if(1&s&&(i.j41(0,"p",6),i.EFF(1),i.k0s()),2&s){const p=i.XpG();i.R7$(1),i.JRh(p.description)}}function k(s,f){if(1&s&&(i.j41(0,"mat-icon"),i.EFF(1),i.k0s()),2&s){const p=i.XpG(3);i.R7$(1),i.JRh(p.actionIcon)}}function G(s,f){if(1&s){const p=i.RV6();i.j41(0,"button",10),i.bIt("click",function(){i.eBV(p);const g=i.XpG(2);return i.Njj(g.action.emit())}),i.DNE(1,k,2,1,"mat-icon",11),i.EFF(2),i.k0s()}if(2&s){const p=i.XpG(2);i.R7$(1),i.Y8G("ngIf",p.actionIcon),i.R7$(1),i.SpI(" ",p.actionLabel," ")}}function $(s,f){if(1&s){const p=i.RV6();i.j41(0,"button",12),i.bIt("click",function(){i.eBV(p);const g=i.XpG(2);return i.Njj(g.secondaryAction.emit())}),i.EFF(1),i.k0s()}if(2&s){const p=i.XpG(2);i.R7$(1),i.SpI(" ",p.secondaryLabel," ")}}function u(s,f){if(1&s&&(i.j41(0,"div",7),i.DNE(1,G,3,2,"button",8),i.DNE(2,$,2,1,"button",9),i.k0s()),2&s){const p=i.XpG();i.R7$(1),i.Y8G("ngIf",p.actionLabel),i.R7$(1),i.Y8G("ngIf",p.secondaryLabel)}}const S=[[["","emptyStateIcon",""]],[["","emptyStateSnippet",""]]],B=["[emptyStateIcon]","[emptyStateSnippet]"];let D=(()=>{class s{constructor(){this.title="",this.action=new i.bkB,this.secondaryAction=new i.bkB}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=i.VBU({type:s,selectors:[["df-empty-state"]],inputs:{icon:"icon",title:"title",description:"description",actionLabel:"actionLabel",actionIcon:"actionIcon",secondaryLabel:"secondaryLabel"},outputs:{action:"action",secondaryAction:"secondaryAction"},standalone:!0,features:[i.aNF],ngContentSelectors:B,decls:8,vars:4,consts:[["role","status",1,"empty-state"],["class","empty-state__icon","aria-hidden","true",4,"ngIf"],[1,"empty-state__title"],["class","empty-state__description",4,"ngIf"],["class","empty-state__actions",4,"ngIf"],["aria-hidden","true",1,"empty-state__icon"],[1,"empty-state__description"],[1,"empty-state__actions"],["mat-flat-button","","color","primary","type","button","data-testid","empty-state-action",3,"click",4,"ngIf"],["mat-stroked-button","","type","button","data-testid","empty-state-secondary",3,"click",4,"ngIf"],["mat-flat-button","","color","primary","type","button","data-testid","empty-state-action",3,"click"],[4,"ngIf"],["mat-stroked-button","","type","button","data-testid","empty-state-secondary",3,"click"]],template:function(n,g){1&n&&(i.NAR(S),i.j41(0,"div",0),i.DNE(1,x,3,1,"div",1),i.SdG(2),i.j41(3,"h3",2),i.EFF(4),i.k0s(),i.DNE(5,A,2,1,"p",3),i.DNE(6,u,3,2,"div",4),i.SdG(7,1),i.k0s()),2&n&&(i.R7$(1),i.Y8G("ngIf",g.icon),i.R7$(3),i.JRh(g.title),i.R7$(1),i.Y8G("ngIf",g.description),i.R7$(1),i.Y8G("ngIf",g.actionLabel||g.secondaryLabel))},dependencies:[R.bT,M.Hl,M.$z,h.m_,h.An],styles:[".empty-state[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:var(--df-space-3);margin:0 auto;max-width:44ch;padding:var(--df-space-8) var(--df-space-5);text-align:center}.empty-state__icon[_ngcontent-%COMP%]{align-items:center;background:var(--df-accent-soft);border-radius:var(--df-radius);color:var(--df-accent);display:inline-flex;height:var(--df-space-8);justify-content:center;width:var(--df-space-8)}.empty-state__icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:var(--df-font-size-2xl);height:var(--df-font-size-2xl);line-height:1;width:var(--df-font-size-2xl)}.empty-state__title[_ngcontent-%COMP%]{color:var(--df-text);font-size:var(--df-font-size-lg);font-weight:var(--df-font-weight-heading);letter-spacing:var(--df-tracking-tight);line-height:var(--df-lh-tight);margin:0}.empty-state__description[_ngcontent-%COMP%]{color:var(--df-text-2);font-size:var(--df-font-size-sm);line-height:var(--df-lh-base);margin:0}.empty-state__actions[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--df-space-2);justify-content:center;margin-top:var(--df-space-1)}"],changeDetection:0})}}return s})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkdf_admin_interface=self.webpackChunkdf_admin_interface||[]).push([[7058],{67058:(q,v,c)=>{c.r(v),c.d(v,{DfManageAppsTableComponent:()=>L});var i=c(18724),R=c(21406),M=c(63956),h=c(75066),x=c(88236),A=c(97828),k=c(43015),G=c(17291),$=c(61417),u=c(18331),S=c(94093),B=c(86606),D=c(52483),s=c(73151),f=c(80972),p=c(66460),n=c(1843),g=c(16396),U=c(11863),nn=c(83607),K=c(31147),Y=c(62633),tn=c(10056),T=c(68660),V=c(54342),d=c(58497),y=c(87621),I=c(78227),W=c(1929),j=c(54688),z=c(453),w=c(82180),J=c(4965),H=c(91900),en=c(42250);function an(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",6),n.bIt("click",function(){n.eBV(t);const _=n.XpG();return n.Njj(_.createRow())}),n.nI1(1,"transloco"),n.nrm(2,"fa-icon",7),n.k0s()}if(2&e){const t=n.XpG();n.BMQ("aria-label",n.bMT(1,2,"newEntry")),n.R7$(2),n.Y8G("icon",t.faPlus)}}function on(e,o){if(1&e&&(n.j41(0,"mat-option",12),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e){const t=o.$implicit;n.Y8G("value",t.value),n.R7$(1),n.SpI(" ",n.bMT(2,2,t.label)," ")}}function cn(e,o){if(1&e&&(n.j41(0,"mat-form-field",9)(1,"mat-label"),n.EFF(2),n.nI1(3,"transloco"),n.k0s(),n.j41(4,"mat-select",10),n.DNE(5,on,3,4,"mat-option",11),n.k0s()()),2&e){const t=n.XpG().ngIf;n.R7$(2),n.JRh(n.bMT(3,3,"accessUsage.filter.label")),n.R7$(2),n.Y8G("formControl",t.filter),n.R7$(1),n.Y8G("ngForOf",t.filterOptions)}}function _n(e,o){if(1&e&&(n.qex(0),n.DNE(1,cn,6,5,"mat-form-field",8),n.bVm()),2&e){const t=o.ngIf;n.R7$(1),n.Y8G("ngIf",t.available)}}function rn(e,o){if(1&e&&(n.j41(0,"mat-form-field",13)(1,"mat-label"),n.EFF(2),n.nI1(3,"transloco"),n.k0s(),n.nrm(4,"input",14),n.k0s()),2&e){const t=n.XpG();n.R7$(2),n.JRh(n.bMT(3,2,"search")),n.R7$(2),n.Y8G("formControl",t.currentFilter)}}function ln(e,o){1&e&&n.nrm(0,"mat-progress-bar",25)}function sn(e,o){if(1&e){const t=n.RV6();n.j41(0,"div",26)(1,"div",27),n.nrm(2,"fa-icon",28),n.j41(3,"span"),n.EFF(4),n.nI1(5,"transloco"),n.k0s(),n.j41(6,"button",29),n.bIt("click",function(){n.eBV(t);const _=n.XpG(2);return n.Njj(_.retryLastFetch())}),n.EFF(7),n.nI1(8,"transloco"),n.k0s()(),n.nrm(9,"df-error-detail",30),n.k0s()}if(2&e){const t=n.XpG(2);n.R7$(2),n.Y8G("icon",t.faTriangleExclamation),n.R7$(2),n.JRh(n.bMT(5,4,t.tableError.message)),n.R7$(3),n.SpI(" ",n.bMT(8,6,"retry")," "),n.R7$(2),n.Y8G("error",t.tableError)}}function pn(e,o){if(1&e&&(n.j41(0,"th",36),n.nI1(1,"async"),n.EFF(2),n.nI1(3,"transloco"),n.k0s()),2&e){const t=n.XpG(2).$implicit,a=n.XpG(2);n.AVh("df-numeric",a.isNumericColumn(t.columnDef)||"tokens"===t.columnDef||"spend"===t.columnDef),n.BMQ("sortActionDescription",n.bMT(1,4,a.sortDescription(t.header))),n.R7$(2),n.SpI(" ",n.bMT(3,6,t.header)," ")}}function mn(e,o){if(1&e&&n.nrm(0,"fa-icon",28),2&e){const t=n.XpG().$implicit,a=n.XpG(2).$implicit,_=n.XpG(2);n.HbH(_.isCellActive(null==a?null:a.cell(t))?"active":"inactive"),n.Y8G("icon",_.activeIcon(_.isCellActive(null==a?null:a.cell(t))))}}function dn(e,o){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"number"),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.R7$(1),n.JRh(n.bMT(2,1,t.tokens))}}function gn(e,o){if(1&e&&(n.qex(0),n.DNE(1,dn,3,3,"span",40),n.bVm()),2&e){const t=n.XpG().$implicit;n.XpG(4);const a=n.sdS(9);n.R7$(1),n.Y8G("ngIf",null!==t.tokens)("ngIfElse",a)}}function fn(e,o){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"currency"),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.R7$(1),n.JRh(n.ii3(2,1,t.spendUsd,"USD","symbol","1.2-2"))}}function un(e,o){if(1&e&&(n.qex(0),n.DNE(1,fn,3,6,"span",40),n.bVm()),2&e){const t=n.XpG().$implicit;n.XpG(4);const a=n.sdS(9);n.R7$(1),n.Y8G("ngIf",null!==t.spendUsd)("ngIfElse",a)}}c(69099);const bn=function(e){return["/api-connections/role-based-access",e]},Mn=function(e){return{role:e}};function Dn(e,o){if(1&e&&(n.j41(0,"a",43),n.bIt("click",function(a){return a.stopPropagation()}),n.nI1(1,"transloco"),n.EFF(2),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.Y8G("routerLink",n.eq3(6,bn,t.roleId)),n.BMQ("aria-label",n.i5U(1,3,"apps.virtualKey.roleLink",n.eq3(8,Mn,t.role))),n.R7$(2),n.SpI(" ",t.role," ")}}function Cn(e,o){if(1&e&&n.EFF(0),2&e){const t=n.XpG(2).$implicit;n.JRh(t.role)}}function hn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Dn,3,10,"a",41),n.DNE(2,Cn,1,1,"ng-template",null,42,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG().$implicit;n.R7$(1),n.Y8G("ngIf",null!==a.roleId&&a.role)("ngIfElse",t)}}function En(e,o){if(1&e&&(n.qex(0),n.EFF(1),n.bVm()),2&e){const t=n.XpG().$implicit,a=n.XpG(2).$implicit;n.R7$(1),n.SpI(" ",null==a?null:a.cell(t)," ")}}function vn(e,o){if(1&e&&n.nrm(0,"df-access-usage-cell",44),2&e){const t=n.XpG().$implicit,a=n.XpG(4);let _,l;n.Y8G("usage",null==a.accessUsage?null:a.accessUsage.get(t.id))("staleDays",null!==(_=null==a.accessUsage?null:a.accessUsage.staleDays)&&void 0!==_?_:null)("trackingStartedAt",null!==(l=null==a.accessUsage?null:a.accessUsage.trackingStartedAt)&&void 0!==l?l:null)}}function Tn(e,o){if(1&e&&(n.j41(0,"td",37),n.DNE(1,mn,1,3,"fa-icon",38),n.DNE(2,gn,2,2,"ng-container",3),n.DNE(3,un,2,2,"ng-container",3),n.DNE(4,hn,4,2,"ng-container",3),n.DNE(5,En,2,1,"ng-container",3),n.DNE(6,vn,1,3,"df-access-usage-cell",39),n.k0s()),2&e){const t=n.XpG(2).$implicit,a=n.XpG(2);n.AVh("df-numeric",a.isNumericColumn(t.columnDef)||"tokens"===t.columnDef||"spend"===t.columnDef),n.R7$(1),n.Y8G("ngIf","active"===t.columnDef),n.R7$(1),n.Y8G("ngIf","tokens"===t.columnDef),n.R7$(1),n.Y8G("ngIf","spend"===t.columnDef),n.R7$(1),n.Y8G("ngIf","role"===t.columnDef),n.R7$(1),n.Y8G("ngIf","active"!==t.columnDef&&"tokens"!==t.columnDef&&"spend"!==t.columnDef&&"role"!==t.columnDef&&"lastUsed"!==t.columnDef),n.R7$(1),n.Y8G("ngIf","lastUsed"===t.columnDef)}}function yn(e,o){if(1&e&&(n.qex(0,33),n.DNE(1,pn,4,8,"th",34),n.DNE(2,Tn,7,8,"td",35),n.bVm()),2&e){const t=n.XpG().$implicit;n.Y8G("matColumnDef",t.columnDef)}}function In(e,o){if(1&e&&(n.j41(0,"th",47),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e){const t=n.XpG(2).$implicit;n.R7$(1),n.SpI(" ",n.bMT(2,1,t.header)," ")}}const Pn=function(e,o,t){return{consumed:e,cap:o,period:t}};function On(e,o){if(1&e&&(n.qex(0),n.j41(1,"div",50),n.nI1(2,"transloco"),n.j41(3,"div",51),n.nrm(4,"div",52),n.k0s(),n.j41(5,"span",53),n.EFF(6),n.k0s()(),n.bVm()),2&e){const t=n.XpG().$implicit;n.R7$(1),n.HbH("df-meter--"+t.meter.variant),n.BMQ("aria-valuenow",t.meter.consumed)("aria-valuemax",t.meter.cap)("aria-label",n.i5U(2,8,"apps.virtualKey.meterAria",n.sMw(11,Pn,t.meter.consumed,t.meter.cap,t.meter.period))),n.R7$(3),n.xc7("width",100*t.meter.ratio,"%"),n.R7$(2),n.JRh(t.meter.label)}}function Rn(e,o){1&e&&(n.j41(0,"span",54),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e&&(n.R7$(1),n.JRh(n.bMT(2,1,"apps.virtualKey.noCap")))}function xn(e,o){if(1&e&&(n.j41(0,"td",48),n.DNE(1,On,7,15,"ng-container",40),n.DNE(2,Rn,3,3,"ng-template",null,49,n.C5r),n.k0s()),2&e){const t=o.$implicit,a=n.sdS(3);n.R7$(1),n.Y8G("ngIf",t.meter)("ngIfElse",a)}}function An(e,o){if(1&e&&(n.qex(0,33),n.DNE(1,In,3,3,"th",45),n.DNE(2,xn,4,2,"td",46),n.bVm()),2&e){const t=n.XpG().$implicit;n.Y8G("matColumnDef",t.columnDef)}}function kn(e,o){1&e&&n.nrm(0,"th",58)}const F=function(e){return{param:e}};function Gn(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",63),n.bIt("click",function(){n.eBV(t);const _=n.XpG(3).$implicit,l=n.XpG(4);return n.Njj(l.actions.additional[0].function(_))})("click",function(_){return _.stopPropagation()}),n.nI1(1,"transloco"),n.nrm(2,"fa-icon",64),n.k0s()}if(2&e){const t=n.XpG(7);n.BMQ("aria-label",n.i5U(1,2,t.actions.additional[0].ariaLabel.key,n.eq3(5,F,t.actions.additional[0].ariaLabel.param))),n.R7$(2),n.Y8G("icon",t.actions.additional[0].icon)}}function $n(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",65),n.bIt("click",function(){n.eBV(t);const _=n.XpG(3).$implicit,l=n.XpG(4);return n.Njj(l.actions.additional[0].function(_))})("click",function(_){return _.stopPropagation()}),n.nI1(1,"transloco"),n.EFF(2),n.nI1(3,"transloco"),n.k0s()}if(2&e){const t=n.XpG(7);n.BMQ("aria-label",n.i5U(1,2,t.actions.additional[0].ariaLabel.key,n.eq3(7,F,t.actions.additional[0].ariaLabel.param))),n.R7$(2),n.SpI(" ",n.bMT(3,5,t.actions.additional[0].label)," ")}}function Sn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Gn,3,7,"button",61),n.DNE(2,$n,4,9,"ng-template",null,62,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG(6);n.R7$(1),n.Y8G("ngIf",a.actions.additional[0].icon)("ngIfElse",t)}}function Bn(e,o){if(1&e){const t=n.RV6();n.j41(0,"button",69),n.bIt("click",function(){const l=n.eBV(t).$implicit,m=n.XpG(3).$implicit;return n.Njj(l.function(m))}),n.nI1(1,"transloco"),n.EFF(2),n.nI1(3,"transloco"),n.k0s()}if(2&e){const t=o.$implicit,a=n.XpG(3).$implicit,_=n.XpG(4);n.Y8G("disabled",_.isActionDisabled(t,a)),n.BMQ("aria-label",n.i5U(1,3,t.ariaLabel.key,n.eq3(8,F,t.ariaLabel.param))),n.R7$(2),n.SpI(" ",n.bMT(3,6,t.label)," ")}}function Un(e,o){if(1&e&&(n.j41(0,"button",66),n.bIt("click",function(a){return a.stopPropagation()}),n.nrm(1,"fa-icon",64),n.k0s(),n.j41(2,"mat-menu",null,67),n.DNE(4,Bn,4,10,"button",68),n.k0s()),2&e){const t=n.sdS(3),a=n.XpG(6);n.Y8G("matMenuTriggerFor",t),n.R7$(1),n.Y8G("icon",a.faEllipsisV),n.R7$(3),n.Y8G("ngForOf",a.actions.additional)}}function jn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Sn,4,2,"ng-container",40),n.DNE(2,Un,5,3,"ng-template",null,60,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG(5);n.R7$(1),n.Y8G("ngIf",1===a.actions.additional.length)("ngIfElse",t)}}function wn(e,o){if(1&e&&(n.j41(0,"td",59),n.DNE(1,jn,4,2,"ng-container",3),n.k0s()),2&e){const t=n.XpG(4);n.R7$(1),n.Y8G("ngIf",t.actions.additional&&t.actions.additional.length>0)}}function Fn(e,o){if(1&e&&(n.qex(0,55),n.DNE(1,kn,1,0,"th",56),n.DNE(2,wn,2,1,"td",57),n.bVm()),2&e){const t=n.XpG().$implicit;n.Y8G("matColumnDef",t.columnDef)}}function Ln(e,o){if(1&e&&(n.qex(0),n.DNE(1,yn,3,1,"ng-container",31),n.DNE(2,An,3,1,"ng-container",31),n.DNE(3,Fn,3,1,"ng-container",32),n.bVm()),2&e){const t=o.$implicit;n.R7$(1),n.Y8G("ngIf","actions"!==t.columnDef&&"meter"!==t.columnDef),n.R7$(1),n.Y8G("ngIf","meter"===t.columnDef),n.R7$(1),n.Y8G("ngIf","actions"===t.columnDef)}}function Xn(e,o){1&e&&n.nrm(0,"tr",70)}function Nn(e,o){if(1&e){const t=n.RV6();n.j41(0,"tr",71),n.bIt("click",function(){const l=n.eBV(t).$implicit,m=n.XpG(2);return n.Njj(m.callDefaultAction(l))})("keydown",function(_){const m=n.eBV(t).$implicit,b=n.XpG(2);return n.Njj(b.handleKeyDown(_,m))}),n.k0s()}if(2&e){const t=o.$implicit,a=n.XpG(2);n.AVh("clickable",a.isClickable(t)),n.BMQ("tabindex",a.isClickable(t)?0:-1)}}function Kn(e,o){if(1&e){const t=n.RV6();n.qex(0),n.EFF(1),n.nI1(2,"transloco"),n.j41(3,"button",75),n.bIt("click",function(){n.eBV(t);const _=n.XpG(4);return n.Njj(_.clearFilter())}),n.EFF(4),n.nI1(5,"transloco"),n.k0s(),n.bVm()}2&e&&(n.R7$(1),n.SpI(" ",n.bMT(2,2,"noFilterResults")," "),n.R7$(3),n.SpI(" ",n.bMT(5,4,"clearFilter")," "))}function Yn(e,o){if(1&e){const t=n.RV6();n.j41(0,"df-empty-state",76),n.bIt("action",function(){n.eBV(t);const _=n.XpG(4);return n.Njj(_.createRow())}),n.nI1(1,"transloco"),n.nI1(2,"transloco"),n.nI1(3,"transloco"),n.k0s()}if(2&e){const t=n.XpG(4);n.Y8G("title",n.bMT(1,3,"apps.virtualKey.empty.title"))("description",n.bMT(2,5,"apps.virtualKey.empty.description"))("actionLabel",t.allowCreate?n.bMT(3,7,"apps.virtualKey.empty.action"):void 0)}}function Vn(e,o){if(1&e&&(n.qex(0),n.DNE(1,Kn,6,6,"ng-container",40),n.DNE(2,Yn,4,9,"ng-template",null,74,n.C5r),n.bVm()),2&e){const t=n.sdS(3),a=n.XpG(3);n.R7$(1),n.Y8G("ngIf",a.currentFilter.value||(null==a.accessUsage?null:a.accessUsage.filterActive))("ngIfElse",t)}}function Wn(e,o){if(1&e&&(n.j41(0,"tr",72)(1,"td",73),n.DNE(2,Vn,4,2,"ng-container",3),n.k0s()()),2&e){const t=n.XpG(2);n.R7$(1),n.BMQ("colspan",t.columns.length),n.R7$(1),n.Y8G("ngIf","loading"!==t.tableState&&"error"!==t.tableState)}}function zn(e,o){if(1&e){const t=n.RV6();n.qex(0),n.DNE(1,ln,1,0,"mat-progress-bar",15),n.DNE(2,sn,10,8,"div",16),n.j41(3,"div",17)(4,"table",18),n.bIt("matSortChange",function(_){n.eBV(t);const l=n.XpG();return n.Njj(l.announceSortChange(_))}),n.DNE(5,Ln,4,3,"ng-container",19),n.DNE(6,Xn,1,0,"tr",20),n.DNE(7,Nn,1,3,"tr",21),n.DNE(8,Wn,3,2,"tr",22),n.k0s(),n.j41(9,"div",23)(10,"mat-paginator",24),n.bIt("page",function(_){n.eBV(t);const l=n.XpG();return n.Njj(l.changePage(_))}),n.k0s()()(),n.bVm()}if(2&e){const t=o.ngIf,a=n.XpG();n.R7$(1),n.Y8G("ngIf","loading"===a.tableState),n.R7$(1),n.Y8G("ngIf","error"===a.tableState&&a.tableError),n.R7$(1),n.AVh("table-stale","loading"===a.tableState),n.R7$(1),n.Y8G("dataSource",a.dataSource),n.R7$(1),n.Y8G("ngForOf",a.columns),n.R7$(1),n.Y8G("matHeaderRowDef",a.displayedColumns),n.R7$(1),n.Y8G("matRowDefColumns",a.displayedColumns),n.R7$(3),n.Y8G("pageSize",t.currentPageSize)("pageSizeOptions",a.pageSizes)("length",a.tableLength)}}function Jn(e,o){1&e&&(n.j41(0,"span",54),n.EFF(1),n.nI1(2,"transloco"),n.k0s()),2&e&&(n.R7$(1),n.JRh(n.bMT(2,1,"apps.virtualKey.noUsage")))}const Hn=[[["","topActions",""]]],Qn=function(e){return{currentPageSize:e}},Zn=["[topActions]"];let L=class N extends M.Py{constructor(o,t,a,_,l,m,b,C,P,qn){var O;super(l,m,b,C,P),O=this,this.appsService=o,this.limitService=t,this.usageService=a,this.systemConfigDataService=_,this.snackbarService=qn,this.emptyStateMessage="emptyState.apps.message",this.emptyStateActionLabel="emptyState.apps.action",this.usageByApp=new Map,this.meterByRole=new Map,this.columns=[{columnDef:"active",cell:r=>r.active,header:"active"},{columnDef:"name",cell:r=>r.name,header:"name"},{columnDef:"role",cell:r=>r.role,header:"role"},{columnDef:"apiKey",cell:r=>r.apiKey,header:"apiKey"},{columnDef:"tokens",cell:r=>r.tokens,header:"apps.virtualKey.tokens"},{columnDef:"spend",cell:r=>r.spendUsd,header:"apps.virtualKey.spend"},{columnDef:"meter",cell:r=>r.meter,header:"apps.virtualKey.rateLimit"},{columnDef:"actions"}],this.filterQuery=(0,x.J)("apps"),this.snackbarService.setSnackbarLastEle("",!1);const Q=[{label:"apps.launchApp",function:r=>{window.open(r.launchUrl,"_blank")},ariaLabel:{key:"apps.launchApp"},disabled:r=>!r.launchUrl},{label:"apps.createApp.apiKey.copy",function:r=>{navigator.clipboard.writeText(r.apiKey)},ariaLabel:{key:"apps.createApp.apiKey.copy"}},{label:"apps.createApp.apiKey.refresh",function:(r=(0,i.A)(function*(E){const Z=yield(0,k.X)(O.systemConfigDataService.environment.server.host,E.name);O.appsService.update(E.id,{api_key:Z}).subscribe(()=>O.refreshTable())}),function(Z){return r.apply(this,arguments)}),ariaLabel:{key:"apps.createApp.apiKey.refresh"},disabled:r=>null===r.createdById}],X={label:"duplicate",function:r=>this.duplicateApp(r),ariaLabel:{key:"duplicateApp",param:"name"},icon:S.jPR};var r;if(this.actions.additional){const r=this.actions.additional.findIndex(E=>"delete"===E.label);-1!==r?this.actions.additional.splice(r,0,X):this.actions.additional.unshift(X),this.actions.additional.push(...Q)}else this.actions.additional=[X,...Q];this.loadMetrics(),this.enableAccessUsage("app",{header:"accessUsage.lastUsed",before:"tokens"})}mapDataToTable(o){return o.map(t=>this.enrich(this.baseRow(t)))}baseRow(o){return{id:o.id,name:o.name,role:o.roleByRoleId?.description||"",roleId:o.roleId??null,apiKey:o.apiKey,description:o.description,active:o.isActive,launchUrl:o.launchUrl,createdById:o.createdById,tokens:null,spendUsd:null,meter:null}}enrich(o){const t=this.usageByApp.get(o.id),a=null!=o.roleId?this.meterByRole.get(o.roleId):null;return{...o,tokens:t?t.tokens:null,spendUsd:t?t.spend:null,meter:a??null}}loadMetrics(){(0,B.p)({usage:this.usageService.loadAll("30d").pipe((0,D.W)(()=>(0,s.of)(null))),limits:this.limitService.getAll({limit:0,related:"limit_cache_by_limit_id"}).pipe((0,D.W)(()=>(0,s.of)(null)))}).subscribe(({usage:o,limits:t})=>{if(o){this.usageByApp.clear();for(const a of o.raw.by_app??[])null!=a.app_id&&this.usageByApp.set(a.app_id,{tokens:(0,p.n)(a.input_tokens)+(0,p.n)(a.output_tokens),spend:(0,p.n)(a.cost_usd)})}t&&(this.meterByRole=this.buildMeters(t.resource??[])),this.enrichExistingRows()})}buildMeters(o){const t=new Map;for(const a of o){if(!a.isActive||null==a.roleId)continue;const _=a.limitCacheByLimitId?.[0],l=_?.max??a.rate;if(!l||l<=0)continue;const b=this.toMeter(_?.attempts??0,l,a.period),C=t.get(a.roleId);(!C||b.ratio>C.ratio)&&t.set(a.roleId,b)}return t}toMeter(o,t,a){const _=Math.max(0,Math.min(1,t>0?o/t:0));let l="ok";return _>=.9?l="danger":_>=.75&&(l="warning"),{consumed:o,cap:t,ratio:_,period:a,variant:l,label:`${o} / ${t}`}}enrichExistingRows(){this.dataSource.data.length&&(this.dataSource.data=this.dataSource.data.map(o=>this.enrich(o)))}deleteRow(o){this.appsService.delete(o.id).subscribe(()=>{this.refreshTable()})}refreshTable(o,t,a){this.fetchTable(this.appsService,{limit:o,offset:t,filter:a})}duplicateApp(o){this.appsService.get(o.id).pipe((0,D.W)(t=>(console.error("Failed to fetch app details:",t),(0,f.$)(()=>t)))).subscribe(t=>{this.appsService.getAll({limit:1e3}).subscribe(a=>{const _=a.resource.map(m=>m.name);this.dialog.open(G.B,{width:"400px",data:{title:"apps.duplicate.title",message:"apps.duplicate.message",label:"apps.duplicate.nameLabel",originalName:t.name,existingNames:_}}).afterClosed().subscribe(m=>{m&&this.appsService.create({resource:[{name:m,description:`${t.description||""} (copy)`,is_active:t.isActive,type:t.type,role_id:t.roleId||null,url:t.url||null,storage_service_id:t.storageServiceId||null,storage_container:t.storageContainer||null,path:t.path||null,requires_fullscreen:t.requiresFullscreen,allow_fullscreen_toggle:t.allowFullscreenToggle,toggle_location:t.toggleLocation}]},{snackbarSuccess:"apps.alerts.duplicateSuccess",fields:"*",related:"role_by_role_id"}).pipe((0,D.W)(P=>(console.error("Failed to duplicate app:",P),(0,f.$)(()=>P)))).subscribe(()=>{this.refreshTable()})})})})}static{this.\u0275fac=function(t){return new(t||N)(n.rXU(h.u7),n.rXU(h.gu),n.rXU(p.D_),n.rXU(g.f),n.rXU(U.Ix),n.rXU(U.nX),n.rXU(nn.Ai),n.rXU(K.JO),n.rXU(Y.bZ),n.rXU(tn.L))}}static{this.\u0275cmp=n.VBU({type:N,selectors:[["df-manage-apps-table"]],standalone:!0,features:[n.Vt3,n.aNF],ngContentSelectors:Zn,decls:10,vars:8,consts:[[1,"top-action-bar"],["mat-mini-fab","","class","save-btn","data-testid","manage-table-create","type","button",3,"click",4,"ngIf"],[1,"spacer"],[4,"ngIf"],["class","search-input","appearance","outline","subscriptSizing","dynamic",4,"ngIf"],["noMetric",""],["mat-mini-fab","","data-testid","manage-table-create","type","button",1,"save-btn",3,"click"],["size","xl",3,"icon"],["class","df-usage-filter","data-testid","access-usage-filter","appearance","outline","subscriptSizing","dynamic",4,"ngIf"],["data-testid","access-usage-filter","appearance","outline","subscriptSizing","dynamic",1,"df-usage-filter"],[3,"formControl"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["appearance","outline","subscriptSizing","dynamic",1,"search-input"],["matInput","",3,"formControl"],["class","table-loading-bar","mode","indeterminate",4,"ngIf"],["class","table-error-panel",4,"ngIf"],[1,"table-container"],["mat-table","","matSort","",3,"dataSource","matSortChange"],[4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"clickable","click","keydown",4,"matRowDef","matRowDefColumns"],["class","mat-row no-data-row",4,"matNoDataRow"],[1,"bottom-action-bar"],["showFirstLastButtons","","aria-label","'selectPage' | transloco",3,"pageSize","pageSizeOptions","length","page"],["mode","indeterminate",1,"table-loading-bar"],[1,"table-error-panel"],[1,"table-error-headline"],["size","lg",3,"icon"],["mat-stroked-button","","type","button",3,"click"],[3,"error"],[3,"matColumnDef",4,"ngIf"],["stickyEnd","",3,"matColumnDef",4,"ngIf"],[3,"matColumnDef"],["mat-header-cell","","mat-sort-header","","class","df-eyebrow",3,"df-numeric",4,"matHeaderCellDef"],["mat-cell","",3,"df-numeric",4,"matCellDef"],["mat-header-cell","","mat-sort-header","",1,"df-eyebrow"],["mat-cell",""],["size","lg",3,"icon","class",4,"ngIf"],[3,"usage","staleDays","trackingStartedAt",4,"ngIf"],[4,"ngIf","ngIfElse"],["class","df-role-link",3,"routerLink","click",4,"ngIf","ngIfElse"],["plainRole",""],[1,"df-role-link",3,"routerLink","click"],[3,"usage","staleDays","trackingStartedAt"],["mat-header-cell","","class","df-eyebrow",4,"matHeaderCellDef"],["mat-cell","","class","df-meter-cell",4,"matCellDef"],["mat-header-cell","",1,"df-eyebrow"],["mat-cell","",1,"df-meter-cell"],["noCap",""],["role","meter",1,"df-meter"],[1,"df-meter-track"],[1,"df-meter-fill"],[1,"df-meter-label","df-numeric"],[1,"df-metric-empty"],["stickyEnd","",3,"matColumnDef"],["mat-header-cell","",4,"matHeaderCellDef"],["class","actions df-row-actions","mat-cell","",4,"matCellDef"],["mat-header-cell",""],["mat-cell","",1,"actions","df-row-actions"],["multiple",""],["class","action-btn","mat-icon-button","","type","button",3,"click",4,"ngIf","ngIfElse"],["regular",""],["mat-icon-button","","type","button",1,"action-btn",3,"click"],["size","xs",3,"icon"],["mat-flat-button","","color","primary","type","button",3,"click"],["mat-icon-button","","aria-label","Actions","type","button",3,"matMenuTriggerFor","click"],["actionsMenu","matMenu"],["type","button","mat-menu-item","",3,"disabled","click",4,"ngFor","ngForOf"],["type","button","mat-menu-item","",3,"disabled","click"],["mat-header-row",""],["mat-row","",3,"click","keydown"],[1,"mat-row","no-data-row"],[1,"mat-cell"],["noFilterActive",""],["mat-button","","color","primary","type","button",3,"click"],[3,"title","description","actionLabel","action"]],template:function(t,a){1&t&&(n.NAR(Hn),n.j41(0,"div",0),n.DNE(1,an,3,4,"button",1),n.SdG(2),n.nrm(3,"div",2),n.DNE(4,_n,2,1,"ng-container",3),n.DNE(5,rn,5,4,"mat-form-field",4),n.k0s(),n.DNE(6,zn,11,11,"ng-container",3),n.nI1(7,"async"),n.DNE(8,Jn,3,3,"ng-template",null,5,n.C5r)),2&t&&(n.R7$(1),n.Y8G("ngIf",a.allowCreate),n.R7$(3),n.Y8G("ngIf",a.accessUsage),n.R7$(1),n.Y8G("ngIf",a.allowFilter),n.R7$(1),n.Y8G("ngIf",n.eq3(6,Qn,n.bMT(7,4,a.currentPageSize$))))},dependencies:[u.bT,T.Hl,T.$z,T.iY,T.$0,V.dX,V.aY,d.tP,d.Zl,d.tL,d.ji,d.cC,d.YV,d.iL,d.KS,d.$R,d.YZ,d.NB,d.ky,u.Sq,y.Cn,y.kk,y.fb,y.Cp,I.X1,I.me,I.BC,I.l_,K.Kj,u.Jj,Y.hM,W.Ou,W.iy,j.RG,j.rl,j.nJ,z.fS,z.fg,w.NQ,w.B4,w.aE,J.PO,J.HM,M.R6,M.Zn,H.Ve,H.VO,en.wT,U.Wk,$.M,u.QX,u.oe],styles:[".df-health-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:0;margin:0;border:none;background:transparent;font:inherit;color:inherit;cursor:pointer}.active[_ngcontent-%COMP%]{color:var(--df-success)}.inactive[_ngcontent-%COMP%], .log-warning[_ngcontent-%COMP%]{color:var(--df-danger)}.top-action-bar[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;align-items:center;gap:var(--df-space-3);padding-bottom:var(--df-space-3)}.top-action-bar[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{height:80%!important;max-width:300px!important}.top-action-bar[_ngcontent-%COMP%] .df-usage-filter[_ngcontent-%COMP%]{width:160px}.bottom-action-bar[_ngcontent-%COMP%]{margin-top:var(--df-space-4);display:flex;flex-direction:row;justify-content:center}.table-container[_ngcontent-%COMP%]{width:100%;overflow-y:auto}.table-container.table-stale[_ngcontent-%COMP%]{opacity:.6;pointer-events:none}.table-loading-bar[_ngcontent-%COMP%]{margin-bottom:2px}.table-error-panel[_ngcontent-%COMP%]{margin-bottom:var(--df-space-3);padding:var(--df-space-3) var(--df-space-4);border:1px solid var(--df-danger-border);border-radius:var(--df-radius-sm);background-color:var(--df-danger-soft);color:var(--df-text)}.table-error-panel[_ngcontent-%COMP%] .table-error-headline[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--df-space-3);margin-bottom:var(--df-space-2)}.table-error-panel[_ngcontent-%COMP%] .table-error-headline[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{color:var(--df-danger)}.table-error-panel[_ngcontent-%COMP%] .table-error-headline[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;font-size:1.4rem}.no-data-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:var(--df-text-muted);font-size:1.35rem}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:var(--df-space-4);padding:var(--df-space-4);text-align:center}.empty-state[_ngcontent-%COMP%] .empty-state-message[_ngcontent-%COMP%]{margin:0;max-width:46rem;color:var(--df-text-muted);font-size:1.4rem;line-height:1.5}.mat-mdc-row[_ngcontent-%COMP%]{height:var(--df-row-height)!important}.mat-mdc-cell[_ngcontent-%COMP%], .mat-mdc-header-cell[_ngcontent-%COMP%]{border-bottom:1px solid var(--df-border-2)}.mat-mdc-cell.df-numeric[_ngcontent-%COMP%], .mat-mdc-header-cell.df-numeric[_ngcontent-%COMP%]{text-align:right}.mat-mdc-header-cell.df-numeric[_ngcontent-%COMP%] .mat-sort-header-container[_ngcontent-%COMP%]{justify-content:flex-end}.df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:0;transition:opacity var(--df-duration-fast) var(--df-ease-standard)}.mat-mdc-row[_ngcontent-%COMP%]:hover .df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .mat-mdc-row[_ngcontent-%COMP%]:focus-within .df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .df-row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{opacity:1}.clickable.mat-mdc-row[_ngcontent-%COMP%]{outline:0}.clickable.mat-mdc-row[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{cursor:pointer}.clickable.mat-mdc-row[_ngcontent-%COMP%]:hover .mat-mdc-cell[_ngcontent-%COMP%]{background-color:var(--df-hover)}.clickable.mat-mdc-row[_ngcontent-%COMP%]:focus .mat-mdc-cell[_ngcontent-%COMP%], .clickable.mat-mdc-row[_ngcontent-%COMP%]:focus-within .mat-mdc-cell[_ngcontent-%COMP%]{background-color:var(--df-accent-soft)} [mat-sort-header].cdk-keyboard-focused .mat-sort-header-container, [mat-sort-header].cdk-program-focused[_ngcontent-%COMP%] .mat-sort-header-container[_ngcontent-%COMP%]{border-bottom:unset!important}",".mat-column-apiKey[_ngcontent-%COMP%]{max-width:300px;text-overflow:ellipsis}.mat-column-tokens[_ngcontent-%COMP%], .mat-column-spend[_ngcontent-%COMP%]{white-space:nowrap}.df-role-link[_ngcontent-%COMP%]{color:var(--df-accent);text-decoration:none;cursor:pointer}.df-role-link[_ngcontent-%COMP%]:hover, .df-role-link[_ngcontent-%COMP%]:focus-visible{text-decoration:underline}.df-role-link[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--df-accent);outline-offset:2px;border-radius:var(--df-radius-sm)}.df-metric-empty[_ngcontent-%COMP%]{color:var(--df-text-faint);font-size:1.2rem}.df-meter-cell[_ngcontent-%COMP%]{min-width:14rem}.df-meter[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--df-space-2)}.df-meter-track[_ngcontent-%COMP%]{position:relative;flex:1;height:.6rem;min-width:6rem;border-radius:var(--df-radius-sm);background:var(--df-surface-2);border:1px solid var(--df-border);overflow:hidden}.df-meter-fill[_ngcontent-%COMP%]{height:100%;border-radius:inherit;background:var(--df-accent);transition:width .24s ease}.df-meter--warning[_ngcontent-%COMP%] .df-meter-fill[_ngcontent-%COMP%]{background:var(--df-warning)}.df-meter--danger[_ngcontent-%COMP%] .df-meter-fill[_ngcontent-%COMP%]{background:var(--df-danger)}.df-meter-label[_ngcontent-%COMP%]{flex:none;font-size:1.2rem;color:var(--df-text-muted)}.df-meter--warning[_ngcontent-%COMP%] .df-meter-label[_ngcontent-%COMP%]{color:var(--df-warning)}.df-meter--danger[_ngcontent-%COMP%] .df-meter-label[_ngcontent-%COMP%]{color:var(--df-danger)}"]})}};L=(0,R.Cg)([(0,A.d)({checkProperties:!0})],L)},61417:(q,v,c)=>{c.d(v,{M:()=>D});var i=c(1843),R=c(18331),M=c(68660),h=c(7263);function x(s,f){if(1&s&&(i.j41(0,"div",5)(1,"mat-icon"),i.EFF(2),i.k0s()()),2&s){const p=i.XpG();i.R7$(2),i.JRh(p.icon)}}function A(s,f){if(1&s&&(i.j41(0,"p",6),i.EFF(1),i.k0s()),2&s){const p=i.XpG();i.R7$(1),i.JRh(p.description)}}function k(s,f){if(1&s&&(i.j41(0,"mat-icon"),i.EFF(1),i.k0s()),2&s){const p=i.XpG(3);i.R7$(1),i.JRh(p.actionIcon)}}function G(s,f){if(1&s){const p=i.RV6();i.j41(0,"button",10),i.bIt("click",function(){i.eBV(p);const g=i.XpG(2);return i.Njj(g.action.emit())}),i.DNE(1,k,2,1,"mat-icon",11),i.EFF(2),i.k0s()}if(2&s){const p=i.XpG(2);i.R7$(1),i.Y8G("ngIf",p.actionIcon),i.R7$(1),i.SpI(" ",p.actionLabel," ")}}function $(s,f){if(1&s){const p=i.RV6();i.j41(0,"button",12),i.bIt("click",function(){i.eBV(p);const g=i.XpG(2);return i.Njj(g.secondaryAction.emit())}),i.EFF(1),i.k0s()}if(2&s){const p=i.XpG(2);i.R7$(1),i.SpI(" ",p.secondaryLabel," ")}}function u(s,f){if(1&s&&(i.j41(0,"div",7),i.DNE(1,G,3,2,"button",8),i.DNE(2,$,2,1,"button",9),i.k0s()),2&s){const p=i.XpG();i.R7$(1),i.Y8G("ngIf",p.actionLabel),i.R7$(1),i.Y8G("ngIf",p.secondaryLabel)}}const S=[[["","emptyStateIcon",""]],[["","emptyStateSnippet",""]]],B=["[emptyStateIcon]","[emptyStateSnippet]"];let D=(()=>{class s{constructor(){this.title="",this.action=new i.bkB,this.secondaryAction=new i.bkB}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=i.VBU({type:s,selectors:[["df-empty-state"]],inputs:{icon:"icon",title:"title",description:"description",actionLabel:"actionLabel",actionIcon:"actionIcon",secondaryLabel:"secondaryLabel"},outputs:{action:"action",secondaryAction:"secondaryAction"},standalone:!0,features:[i.aNF],ngContentSelectors:B,decls:8,vars:4,consts:[["role","status",1,"empty-state"],["class","empty-state__icon","aria-hidden","true",4,"ngIf"],[1,"empty-state__title"],["class","empty-state__description",4,"ngIf"],["class","empty-state__actions",4,"ngIf"],["aria-hidden","true",1,"empty-state__icon"],[1,"empty-state__description"],[1,"empty-state__actions"],["mat-flat-button","","color","primary","type","button","data-testid","empty-state-action",3,"click",4,"ngIf"],["mat-stroked-button","","type","button","data-testid","empty-state-secondary",3,"click",4,"ngIf"],["mat-flat-button","","color","primary","type","button","data-testid","empty-state-action",3,"click"],[4,"ngIf"],["mat-stroked-button","","type","button","data-testid","empty-state-secondary",3,"click"]],template:function(n,g){1&n&&(i.NAR(S),i.j41(0,"div",0),i.DNE(1,x,3,1,"div",1),i.SdG(2),i.j41(3,"h3",2),i.EFF(4),i.k0s(),i.DNE(5,A,2,1,"p",3),i.DNE(6,u,3,2,"div",4),i.SdG(7,1),i.k0s()),2&n&&(i.R7$(1),i.Y8G("ngIf",g.icon),i.R7$(3),i.JRh(g.title),i.R7$(1),i.Y8G("ngIf",g.description),i.R7$(1),i.Y8G("ngIf",g.actionLabel||g.secondaryLabel))},dependencies:[R.bT,M.Hl,M.$z,h.m_,h.An],styles:[".empty-state[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:var(--df-space-3);margin:0 auto;max-width:44ch;padding:var(--df-space-8) var(--df-space-5);text-align:center}.empty-state__icon[_ngcontent-%COMP%]{align-items:center;background:var(--df-accent-soft);border-radius:var(--df-radius);color:var(--df-accent);display:inline-flex;height:var(--df-space-8);justify-content:center;width:var(--df-space-8)}.empty-state__icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:var(--df-font-size-2xl);height:var(--df-font-size-2xl);line-height:1;width:var(--df-font-size-2xl)}.empty-state__title[_ngcontent-%COMP%]{color:var(--df-text);font-size:var(--df-font-size-lg);font-weight:var(--df-font-weight-heading);letter-spacing:var(--df-tracking-tight);line-height:var(--df-lh-tight);margin:0}.empty-state__description[_ngcontent-%COMP%]{color:var(--df-text-2);font-size:var(--df-font-size-sm);line-height:var(--df-lh-base);margin:0}.empty-state__actions[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:var(--df-space-2);justify-content:center;margin-top:var(--df-space-1)}"],changeDetection:0})}}return s})()}}]); \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 48c65837..15933ad0 100644 --- a/dist/index.html +++ b/dist/index.html @@ -10,5 +10,5 @@