@sync-in/server 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/static/{chunk-NCIAR3N4.js → chunk-2LIE3SKB.js} +1 -1
- package/static/{chunk-2CQOSX2Q.js → chunk-3BKYCF53.js} +1 -1
- package/static/{chunk-HQC3W7BS.js → chunk-6CFIZHYI.js} +1 -1
- package/static/{chunk-HDDBV3QQ.js → chunk-7FVU676A.js} +1 -1
- package/static/{chunk-2QEYCCHN.js → chunk-7RNZNYVF.js} +1 -1
- package/static/{chunk-TFBTBTPR.js → chunk-7SJOQRBE.js} +1 -1
- package/static/{chunk-CTWOQLAR.js → chunk-BS5LXHXU.js} +1 -1
- package/static/{chunk-Y6IYSEKU.js → chunk-CPHC7U34.js} +1 -1
- package/static/{chunk-7U66TR6P.js → chunk-DYRV5R67.js} +1 -1
- package/static/{chunk-3RLZPQMJ.js → chunk-EWJD5G76.js} +1 -1
- package/static/{chunk-AXITQYVN.js → chunk-EYXC4W63.js} +1 -1
- package/static/{chunk-VIL6L67B.js → chunk-GSVMWC5N.js} +1 -1
- package/static/{chunk-EWY4ALVF.js → chunk-HNWPHW2W.js} +1 -1
- package/static/{chunk-FBG4NUDE.js → chunk-IPGNGPWY.js} +1 -1
- package/static/{chunk-5OIPLRAE.js → chunk-J5O3CY2H.js} +1 -1
- package/static/{chunk-R4USKWW6.js → chunk-JRVJIJB5.js} +1 -1
- package/static/{chunk-AYEOHGUD.js → chunk-MAWDGVNC.js} +1 -1
- package/static/{chunk-2SX3MVH3.js → chunk-N3QPDPBV.js} +1 -1
- package/static/{chunk-WA3LPP4G.js → chunk-NSXFB3SX.js} +1 -1
- package/static/{chunk-2XXS272C.js → chunk-OVO4W2GF.js} +1 -1
- package/static/{chunk-LHKO5Y4A.js → chunk-SOLCSMU7.js} +1 -1
- package/static/{chunk-RGONEEJE.js → chunk-SY5HMUMM.js} +1 -1
- package/static/{chunk-GI2LXVWQ.js → chunk-SZKZH4MJ.js} +1 -1
- package/static/{chunk-ZSMTUPAP.js → chunk-ULTPIQL3.js} +1 -1
- package/static/{chunk-AA6ZTGRW.js → chunk-VFSSL4TI.js} +1 -1
- package/static/{chunk-WQPVP63E.js → chunk-WGSPBZVN.js} +1 -1
- package/static/{chunk-ZZGFGD5E.js → chunk-X6UFHF4Q.js} +1 -1
- package/static/{chunk-ZS5YIDNI.js → chunk-XBHT4AH5.js} +1 -1
- package/static/{chunk-5JDPARJT.js → chunk-ZYB4TLJM.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-7IVUWYWM.js → main-EDITZWHO.js} +3 -3
- package/sync-in-server.js +17 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as z,C as Ie}from"./chunk-AXITQYVN.js";import"./chunk-3RLZPQMJ.js";import{a as U}from"./chunk-AA6ZTGRW.js";import"./chunk-JXZCNFW7.js";import"./chunk-VIL6L67B.js";import{a as Ee}from"./chunk-VBWPPICY.js";import{d as Me}from"./chunk-HQC3W7BS.js";import"./chunk-5JDPARJT.js";import{a as O,b as N,c as Te,d as Ve}from"./chunk-WA3LPP4G.js";import{a as Fe,b as De}from"./chunk-WQPVP63E.js";import{b as Ae}from"./chunk-2SX3MVH3.js";import"./chunk-2CQOSX2Q.js";import"./chunk-Y6IYSEKU.js";import"./chunk-ZZGFGD5E.js";import{$a as xe,Cb as Se,Da as he,Db as we,Ea as fe,Eb as ye,Fa as Ce,Qb as ve,Sb as be,Ua as H,f as ee,gb as ge,v as te,w as ie}from"./chunk-HDDBV3QQ.js";import{m as ke}from"./chunk-ZZ3LHYOY.js";import{b as J}from"./chunk-UGSGMP2I.js";import{Ad as Y,Bb as g,Bd as Z,Bf as me,Dd as ne,Eb as u,Ec as G,Fb as a,Ff as ue,L as P,Ma as $,Mb as V,Me as oe,Nb as M,Ne as re,Ob as E,Oe as ae,Qb as f,Rb as v,Sa as r,Sb as B,Tb as K,Ve as le,Xa as T,Yb as W,Ye as se,ab as Q,bc as S,dc as w,fb as C,kb as L,lb as d,mb as b,mf as ce,nb as k,ob as j,of as pe,pa as p,pf as _e,qa as _,qb as q,rb as y,tb as A,ub as D,ud as X,vb as l,wb as c,wf as de,xb as h}from"./chunk-FPEGN42P.js";import{a as R}from"./chunk-GAL4ENT6.js";var I=class{constructor(s){this.syncs=[],this.newly=0,Object.assign(this,s),Ae(this),this.hTimeAgo=(0,ee.default)(this.createdAt).fromNow(!0),this.newly=xe(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=ke}};var Be=["MainContextMenu"],He=["TargetContextMenu"],Oe=()=>["shares"],Re=(i,s)=>s.id,Pe=(i,s)=>s.key;function Ne(i,s){if(i&1&&(l(0,"span",31),f(1),c()),i&2){let e=a().$implicit,n=a(2);b("font-size",n.galleryMode.textSize,"px"),r(),v(e.hTimeAgo)}}function Ue(i,s){if(i&1){let e=g();l(0,"div",32),u("click",function(){p(e);let t=a().$implicit,o=a(2);return _(o.openChildShareDialog(t))}),h(1,"fa-icon",33),l(2,"span"),f(3),c()()}if(i&2){let e=a().$implicit,n=a(2);b("font-size",n.galleryMode.textSize,"px"),r(),d("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function ze(i,s){if(i&1){let e=g();l(0,"div",21),u("click",function(){let t=p(e).$implicit,o=a(2);return _(o.onSelect(t))})("contextmenu",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("pressup",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("tap",function(){p(e);let t=a(2);return _(t.openShareDialog())}),l(1,"div",22)(2,"img",23),u("error",function(){let t=p(e).$implicit;return _(t.fallBackMimeUrl())}),c(),l(3,"span",24),C(4,Ne,2,3,"span",25),c(),C(5,Ue,4,4,"div",26),l(6,"span",27),h(7,"app-share-repository",28),c()(),l(8,"div",29)(9,"span",30),f(10),c()()()}if(i&2){let e=s.$implicit,n=s.$index,t=a(2);b("height",t.galleryMode.dimensions,"px")("width",t.galleryMode.dimensions,"px"),k("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),r(),L("rowIndex",n),r(),d("src",e.mimeUrl,$)("height",t.galleryMode.image)("width",t.galleryMode.image),r(2),y(e.newly?4:-1),r(),y(e.counts.shares?5:-1),r(2),d("share",e)("galleryMode",t.galleryMode),r(2),b("font-size",t.galleryMode.textSize,"px"),r(),v(e.name)}}function Qe(i,s){if(i&1){let e=g();l(0,"div",12)(1,"app-virtual-scroll",18),S(2,"searchFilter"),u("contextmenu",function(t){p(e);let o=a();return _(o.onContextMenu(t))}),l(3,"div",19),A(4,ze,11,19,"div",20,Re),c()()()}if(i&2){let e=a();r(),d("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",w(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),D(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Le(i,s){if(i&1&&h(0,"fa-icon",6),i&2){let e=a(4);d("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function je(i,s){if(i&1){let e=g();l(0,"th",39),u("click",function(){p(e);let t=a().$implicit,o=a(2);return _(o.sortBy(t.key))}),f(1),C(2,Le,1,1,"fa-icon",6),c()}if(i&2){let e=a().$implicit,n=a(2);j(e.value.class),b("width",e.value.width,"%"),k("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),B(" ",e.value.label," "),r(),y(n.sortTable.sortParam.column===e.key?2:-1)}}function qe(i,s){if(i&1&&C(0,je,3,11,"th",38),i&2){let e=s.$implicit;y(e.value.show?0:-1)}}function Ke(i,s){if(i&1){let e=g();l(0,"div",42)(1,"img",44),u("error",function(){p(e);let t=a(3).$implicit;return _(t.fallBackMimeUrl())}),c(),l(2,"div",45)(3,"span",30),f(4),c(),l(5,"span",46),f(6),c()()()}if(i&2){let e=a(3).$implicit;r(),d("src",e.mimeUrl,$),r(3),v(e.name),r(2),v(e.description)}}function We(i,s){if(i&1&&h(0,"app-share-repository",43),i&2){let e=a(3).$implicit;d("share",e)}}function Ge(i,s){if(i&1&&(l(0,"span"),f(1),S(2,"joinCounts"),c()),i&2){let e=a(3).$implicit;r(),v(w(2,1,e.counts,W(4,Oe)))}}function Je(i,s){if(i&1){let e=g();l(0,"span",49),u("click",function(){p(e);let t=a(4).$implicit,o=a(2);return _(o.openChildShareDialog(t))}),h(1,"fa-icon",33),l(2,"span"),f(3),c()()}if(i&2){let e=a(4).$implicit,n=a(2);r(),d("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function Xe(i,s){if(i&1){let e=g();l(0,"span",50),u("click",function(){p(e);let t=a(4).$implicit,o=a(2);return _(o.goToComments(t))}),h(1,"fa-icon",6),c()}if(i&2){let e=a(6);r(),d("icon",e.icons.faCommentDots)}}function Ye(i,s){if(i&1&&C(0,Je,4,2,"span",47)(1,Xe,2,1,"span",48),i&2){let e=a(3).$implicit;y(e.counts.shares?0:-1),r(),y(e.hasComments?1:-1)}}function Ze(i,s){if(i&1&&f(0),i&2){let e=a(3).$implicit;B(" ",e.hTimeAgo," ")}}function et(i,s){if(i&1&&(l(0,"td"),C(1,Ke,7,3,"div",42)(2,We,1,1,"app-share-repository",43)(3,Ge,3,5,"span")(4,Ye,2,2)(5,Ze,1,1),c()),i&2){let e,n=a().$implicit,t=a().$implicit;q("",n.value.class," ",n.value.newly?"prop-newly-"+t[n.value.newly]:"",""),b("width",n.value.width,"%"),k("text-align-center",n.value.textCenter),r(),y((e=n.key)==="name"?1:e==="from"?2:e==="members"?3:e==="infos"?4:e==="created"?5:-1)}}function tt(i,s){if(i&1&&C(0,et,6,9,"td",41),i&2){let e=s.$implicit;y(e.value.show?0:-1)}}function it(i,s){if(i&1){let e=g();l(0,"tr",40),u("click",function(){let t=p(e).$implicit,o=a(2);return _(o.onSelect(t))})("contextmenu",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("pressup",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("tap",function(){p(e);let t=a(2);return _(t.openShareDialog())}),A(1,tt,1,1,null,null,Pe),S(3,"keyvalue"),c()}if(i&2){let e=s.$implicit,n=a(2);k("disabled",!e.enabled)("selected",e.id===(n.selected==null?null:n.selected.id)),r(),D(w(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function nt(i,s){if(i&1){let e=g();l(0,"table",34)(1,"thead")(2,"tr"),A(3,qe,1,1,null,null,Pe),S(5,"keyvalue"),c()()(),l(6,"app-virtual-scroll",35),S(7,"searchFilter"),u("contextmenu",function(t){p(e);let o=a();return _(o.onContextMenu(t))}),l(8,"table",34)(9,"tbody",36),A(10,it,4,7,"tr",37,Re),c()()()}if(i&2){let e=a();r(3),D(w(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),d("bufferAmount",5)("items",w(7,5,e.shares,e.inputFilter.search())),r(4),D(e.scrollView==null?null:e.scrollView.viewPortItems)}}function ot(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"New share"),c()),i&2){let e=a();r(),d("icon",e.icons.faPlus)}}function rt(i,s){}function at(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Refresh"),c()),i&2){let e=a();r(),d("icon",e.icons.faArrowRotateRight)}}function lt(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Go to"),c()),i&2){let e=a();r(),d("icon",e.icons.faMapMarkerAlt)}}function st(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Edit"),c()),i&2){let e=a();r(),d("icon",e.icons.faPen)}}function ct(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Edit children shares"),c()),i&2){let e=a(2);r(),d("icon",e.icons.SHARED)}}function pt(i,s){if(i&1){let e=g();C(0,ct,3,1,"ng-template",15),u("execute",function(){p(e);let t=a();return _(t.openChildShareDialog())})}}function _t(i,s){}function dt(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Informations"),c()),i&2){let e=a();r(),d("icon",e.icons.faCircleInfo)}}var qt=(()=>{class i{constructor(e,n,t,o,m){this.locale=e,this.layout=n,this.activatedRoute=t,this.store=o,this.sharesService=m,this.icons={SHARED:fe.SHARED_WITH_OTHERS,faArrowRotateRight:ae,faArrowDown:_e,faArrowUp:de,faRotate:ue,faPlus:me,faMinus:se,faPen:oe,faEllipsisH:ce,faMapMarkerAlt:pe,faCircleInfo:le,faCommentDots:re},this.originalOrderKeyValue=ge,this.TAB_MENU=H,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},infos:{label:"Infos",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Ve(this.constructor.name,this.sortSettings),this.btnSortFields={name:"Name",created:"Created"},this.loadShares(),this.activatedRoute.queryParams.subscribe(x=>this.focusOnSelect=x.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${Ce.SHARED}/${he.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:e=>{this.sortBy(this.sortTable.sortParam.column,!1,e.map(n=>new I(n))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:e=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",e.error.message)}})}sortBy(e,n=!0,t){this.shares=this.sortTable.sortBy(e,n,t||this.shares)}onSelect(e=null){this.selected=e,this.store.shareSelection.set(this.selected)}openShareDialog(e=!1){e?this.layout.openDialog(z,"lg").content.shareChange.pipe(P(1)).subscribe(t=>{let[o,m]=t;o==="add"&&(this.focusOnSelect=m.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:n=>{this.layout.openDialog(z,"lg",{initialState:{share:n}}).content.shareChange.pipe(P(1)).subscribe(o=>{let[m,x]=o;if(m==="update"){this.selected.name=x.name,this.selected.alias=x.alias,this.selected.description=x.description,this.selected.modifiedAt=x.modifiedAt,this.selected.enabled=x.enabled;let F={users:0,groups:0,links:x.links.length};for(let $e of x.members)$e.isUser?F.users++:F.groups++;this.selected.counts=R(R({},this.selected.counts),F)}else m==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(F=>F.id!==x.id)))})},error:n=>this.layout.sendNotification("error","Edit share",this.selected.name,n)})}openChildShareDialog(e){e&&this.onSelect(e),this.layout.openDialog(Ie,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(t=>this.selected.counts.shares=t)}onContextMenu(e){e.preventDefault(),e.stopPropagation(),this.layout.openContextMenu(e,this.mainContextMenu)}onTargetContextMenu(e,n){e.preventDefault(),e.type==="contextmenu"&&e.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(e,this.targetContextMenu)}focusOn(e){let n=this.shares.find(t=>t.name===e);n&&(setTimeout(()=>this.scrollView.scrollInto(n),100),this.onSelect(n))}goTo(e){e=e||this.selected,this.sharesService.goTo(e).catch(n=>console.error(n))}goToComments(e){this.sharesService.goTo(e).then(()=>this.layout.showRSideBarTab(H.COMMENTS,!0))}static{this.\u0275fac=function(n){return new(n||i)(T(X),T(be),T(J),T(ve),T(De))}}static{this.\u0275cmp=Q({type:i,selectors:[["app-shared"]],viewQuery:function(n,t){if(n&1&&(V(N,5),V(O,7),V(U,7),V(Be,7),V(He,7)),n&2){let o;M(o=E())&&(t.scrollView=o.first),M(o=E())&&(t.inputFilter=o.first),M(o=E())&&(t.btnNavigationView=o.first),M(o=E())&&(t.mainContextMenu=o.first),M(o=E())&&(t.targetContextMenu=o.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],["l10nTranslate",""]],template:function(n,t){if(n&1){let o=g();l(0,"div",2)(1,"button",3),S(2,"translate"),u("click",function(){return p(o),_(t.loadShares())}),h(3,"fa-icon",4),c(),l(4,"button",5),S(5,"translate"),u("click",function(){return p(o),_(t.openShareDialog(!0))}),h(6,"fa-icon",6),c(),l(7,"button",7),S(8,"translate"),u("click",function(){return p(o),_(t.openShareDialog())}),h(9,"fa-icon",6),c(),l(10,"button",7),S(11,"translate"),u("click",function(){return p(o),_(t.openChildShareDialog())}),h(12,"fa-icon",6),c(),l(13,"button",7),S(14,"translate"),u("click",function(){return p(o),_(t.goTo())}),h(15,"fa-icon",6),c(),l(16,"div",8)(17,"div",9),h(18,"app-input-filter",10),c(),l(19,"app-navigation-view",11),u("sortBy",function(x){return p(o),_(t.sortBy(x))})("switchView",function(x){return p(o),_(t.galleryMode=x)}),c()()(),C(20,Qe,6,8,"div",12)(21,nt,12,8),l(22,"div",13)(23,"span",14),f(24),S(25,"translate"),c()(),l(26,"context-menu",null,0),C(28,ot,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.openShareDialog(!0))}),C(29,rt,0,0,"ng-template",16)(30,at,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.loadShares())}),c(),l(31,"context-menu",null,1),C(33,lt,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.goTo())}),C(34,st,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.openShareDialog())}),C(35,pt,1,0,null,17)(36,_t,0,0,"ng-template",16)(37,dt,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.layout.showRSideBarTab(t.TAB_MENU.SELECTION))}),c()}n&2&&(r(),d("tooltip",w(2,22,"Refresh",t.locale.language)),r(2),d("icon",t.icons.faArrowRotateRight)("animation",t.loading?"spin":null),r(),d("tooltip",w(5,25,"New share",t.locale.language)),r(2),d("icon",t.icons.faPlus),r(),d("disabled",!t.selected)("tooltip",w(8,28,"Edit share",t.locale.language)),r(2),d("icon",t.icons.faPen),r(),d("disabled",!(t.selected!=null&&t.selected.counts.shares))("tooltip",w(11,31,"Edit children shares",t.locale.language)),r(2),d("icon",t.icons.SHARED),r(),d("disabled",!t.selected)("tooltip",w(14,34,"Go to",t.locale.language)),r(2),d("icon",t.icons.faMapMarkerAlt),r(4),d("sortParams",t.sortTable.sortParam)("sortFields",t.btnSortFields),r(),y(t.galleryMode!=null&&t.galleryMode.enabled?20:21),r(4),K("",t.shares.length," ",w(25,37,"shares",t.locale.language),""),r(5),d("divider",!0),r(6),y(t.selected!=null&&t.selected.counts.shares?35:-1),r(),d("divider",!0))},dependencies:[ne,G,Z,Y,U,O,Te,ie,te,N,Ee,Me,ye,we,Se,Fe],encapsulation:2})}}return i})();export{qt as SharedComponent};
|
|
1
|
+
import{B as z,C as Ie}from"./chunk-EYXC4W63.js";import"./chunk-EWJD5G76.js";import{a as U}from"./chunk-VFSSL4TI.js";import"./chunk-JXZCNFW7.js";import"./chunk-GSVMWC5N.js";import{a as Ee}from"./chunk-VBWPPICY.js";import{d as Me}from"./chunk-6CFIZHYI.js";import"./chunk-ZYB4TLJM.js";import{a as O,b as N,c as Te,d as Ve}from"./chunk-NSXFB3SX.js";import{a as Fe,b as De}from"./chunk-WGSPBZVN.js";import{b as Ae}from"./chunk-N3QPDPBV.js";import"./chunk-3BKYCF53.js";import"./chunk-CPHC7U34.js";import"./chunk-X6UFHF4Q.js";import{$a as xe,Cb as Se,Da as he,Db as we,Ea as fe,Eb as ye,Fa as Ce,Qb as ve,Sb as be,Ua as H,f as ee,gb as ge,v as te,w as ie}from"./chunk-7FVU676A.js";import{m as ke}from"./chunk-ZZ3LHYOY.js";import{b as J}from"./chunk-UGSGMP2I.js";import{Ad as Y,Bb as g,Bd as Z,Bf as me,Dd as ne,Eb as u,Ec as G,Fb as a,Ff as ue,L as P,Ma as $,Mb as V,Me as oe,Nb as M,Ne as re,Ob as E,Oe as ae,Qb as f,Rb as v,Sa as r,Sb as B,Tb as K,Ve as le,Xa as T,Yb as W,Ye as se,ab as Q,bc as S,dc as w,fb as C,kb as L,lb as d,mb as b,mf as ce,nb as k,ob as j,of as pe,pa as p,pf as _e,qa as _,qb as q,rb as y,tb as A,ub as D,ud as X,vb as l,wb as c,wf as de,xb as h}from"./chunk-FPEGN42P.js";import{a as R}from"./chunk-GAL4ENT6.js";var I=class{constructor(s){this.syncs=[],this.newly=0,Object.assign(this,s),Ae(this),this.hTimeAgo=(0,ee.default)(this.createdAt).fromNow(!0),this.newly=xe(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=ke}};var Be=["MainContextMenu"],He=["TargetContextMenu"],Oe=()=>["shares"],Re=(i,s)=>s.id,Pe=(i,s)=>s.key;function Ne(i,s){if(i&1&&(l(0,"span",31),f(1),c()),i&2){let e=a().$implicit,n=a(2);b("font-size",n.galleryMode.textSize,"px"),r(),v(e.hTimeAgo)}}function Ue(i,s){if(i&1){let e=g();l(0,"div",32),u("click",function(){p(e);let t=a().$implicit,o=a(2);return _(o.openChildShareDialog(t))}),h(1,"fa-icon",33),l(2,"span"),f(3),c()()}if(i&2){let e=a().$implicit,n=a(2);b("font-size",n.galleryMode.textSize,"px"),r(),d("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function ze(i,s){if(i&1){let e=g();l(0,"div",21),u("click",function(){let t=p(e).$implicit,o=a(2);return _(o.onSelect(t))})("contextmenu",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("pressup",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("tap",function(){p(e);let t=a(2);return _(t.openShareDialog())}),l(1,"div",22)(2,"img",23),u("error",function(){let t=p(e).$implicit;return _(t.fallBackMimeUrl())}),c(),l(3,"span",24),C(4,Ne,2,3,"span",25),c(),C(5,Ue,4,4,"div",26),l(6,"span",27),h(7,"app-share-repository",28),c()(),l(8,"div",29)(9,"span",30),f(10),c()()()}if(i&2){let e=s.$implicit,n=s.$index,t=a(2);b("height",t.galleryMode.dimensions,"px")("width",t.galleryMode.dimensions,"px"),k("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),r(),L("rowIndex",n),r(),d("src",e.mimeUrl,$)("height",t.galleryMode.image)("width",t.galleryMode.image),r(2),y(e.newly?4:-1),r(),y(e.counts.shares?5:-1),r(2),d("share",e)("galleryMode",t.galleryMode),r(2),b("font-size",t.galleryMode.textSize,"px"),r(),v(e.name)}}function Qe(i,s){if(i&1){let e=g();l(0,"div",12)(1,"app-virtual-scroll",18),S(2,"searchFilter"),u("contextmenu",function(t){p(e);let o=a();return _(o.onContextMenu(t))}),l(3,"div",19),A(4,ze,11,19,"div",20,Re),c()()()}if(i&2){let e=a();r(),d("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",w(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),D(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Le(i,s){if(i&1&&h(0,"fa-icon",6),i&2){let e=a(4);d("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function je(i,s){if(i&1){let e=g();l(0,"th",39),u("click",function(){p(e);let t=a().$implicit,o=a(2);return _(o.sortBy(t.key))}),f(1),C(2,Le,1,1,"fa-icon",6),c()}if(i&2){let e=a().$implicit,n=a(2);j(e.value.class),b("width",e.value.width,"%"),k("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),B(" ",e.value.label," "),r(),y(n.sortTable.sortParam.column===e.key?2:-1)}}function qe(i,s){if(i&1&&C(0,je,3,11,"th",38),i&2){let e=s.$implicit;y(e.value.show?0:-1)}}function Ke(i,s){if(i&1){let e=g();l(0,"div",42)(1,"img",44),u("error",function(){p(e);let t=a(3).$implicit;return _(t.fallBackMimeUrl())}),c(),l(2,"div",45)(3,"span",30),f(4),c(),l(5,"span",46),f(6),c()()()}if(i&2){let e=a(3).$implicit;r(),d("src",e.mimeUrl,$),r(3),v(e.name),r(2),v(e.description)}}function We(i,s){if(i&1&&h(0,"app-share-repository",43),i&2){let e=a(3).$implicit;d("share",e)}}function Ge(i,s){if(i&1&&(l(0,"span"),f(1),S(2,"joinCounts"),c()),i&2){let e=a(3).$implicit;r(),v(w(2,1,e.counts,W(4,Oe)))}}function Je(i,s){if(i&1){let e=g();l(0,"span",49),u("click",function(){p(e);let t=a(4).$implicit,o=a(2);return _(o.openChildShareDialog(t))}),h(1,"fa-icon",33),l(2,"span"),f(3),c()()}if(i&2){let e=a(4).$implicit,n=a(2);r(),d("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function Xe(i,s){if(i&1){let e=g();l(0,"span",50),u("click",function(){p(e);let t=a(4).$implicit,o=a(2);return _(o.goToComments(t))}),h(1,"fa-icon",6),c()}if(i&2){let e=a(6);r(),d("icon",e.icons.faCommentDots)}}function Ye(i,s){if(i&1&&C(0,Je,4,2,"span",47)(1,Xe,2,1,"span",48),i&2){let e=a(3).$implicit;y(e.counts.shares?0:-1),r(),y(e.hasComments?1:-1)}}function Ze(i,s){if(i&1&&f(0),i&2){let e=a(3).$implicit;B(" ",e.hTimeAgo," ")}}function et(i,s){if(i&1&&(l(0,"td"),C(1,Ke,7,3,"div",42)(2,We,1,1,"app-share-repository",43)(3,Ge,3,5,"span")(4,Ye,2,2)(5,Ze,1,1),c()),i&2){let e,n=a().$implicit,t=a().$implicit;q("",n.value.class," ",n.value.newly?"prop-newly-"+t[n.value.newly]:"",""),b("width",n.value.width,"%"),k("text-align-center",n.value.textCenter),r(),y((e=n.key)==="name"?1:e==="from"?2:e==="members"?3:e==="infos"?4:e==="created"?5:-1)}}function tt(i,s){if(i&1&&C(0,et,6,9,"td",41),i&2){let e=s.$implicit;y(e.value.show?0:-1)}}function it(i,s){if(i&1){let e=g();l(0,"tr",40),u("click",function(){let t=p(e).$implicit,o=a(2);return _(o.onSelect(t))})("contextmenu",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("pressup",function(t){let o=p(e).$implicit,m=a(2);return _(m.onTargetContextMenu(t,o))})("tap",function(){p(e);let t=a(2);return _(t.openShareDialog())}),A(1,tt,1,1,null,null,Pe),S(3,"keyvalue"),c()}if(i&2){let e=s.$implicit,n=a(2);k("disabled",!e.enabled)("selected",e.id===(n.selected==null?null:n.selected.id)),r(),D(w(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function nt(i,s){if(i&1){let e=g();l(0,"table",34)(1,"thead")(2,"tr"),A(3,qe,1,1,null,null,Pe),S(5,"keyvalue"),c()()(),l(6,"app-virtual-scroll",35),S(7,"searchFilter"),u("contextmenu",function(t){p(e);let o=a();return _(o.onContextMenu(t))}),l(8,"table",34)(9,"tbody",36),A(10,it,4,7,"tr",37,Re),c()()()}if(i&2){let e=a();r(3),D(w(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),d("bufferAmount",5)("items",w(7,5,e.shares,e.inputFilter.search())),r(4),D(e.scrollView==null?null:e.scrollView.viewPortItems)}}function ot(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"New share"),c()),i&2){let e=a();r(),d("icon",e.icons.faPlus)}}function rt(i,s){}function at(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Refresh"),c()),i&2){let e=a();r(),d("icon",e.icons.faArrowRotateRight)}}function lt(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Go to"),c()),i&2){let e=a();r(),d("icon",e.icons.faMapMarkerAlt)}}function st(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Edit"),c()),i&2){let e=a();r(),d("icon",e.icons.faPen)}}function ct(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Edit children shares"),c()),i&2){let e=a(2);r(),d("icon",e.icons.SHARED)}}function pt(i,s){if(i&1){let e=g();C(0,ct,3,1,"ng-template",15),u("execute",function(){p(e);let t=a();return _(t.openChildShareDialog())})}}function _t(i,s){}function dt(i,s){if(i&1&&(l(0,"span",51),h(1,"fa-icon",6),f(2,"Informations"),c()),i&2){let e=a();r(),d("icon",e.icons.faCircleInfo)}}var qt=(()=>{class i{constructor(e,n,t,o,m){this.locale=e,this.layout=n,this.activatedRoute=t,this.store=o,this.sharesService=m,this.icons={SHARED:fe.SHARED_WITH_OTHERS,faArrowRotateRight:ae,faArrowDown:_e,faArrowUp:de,faRotate:ue,faPlus:me,faMinus:se,faPen:oe,faEllipsisH:ce,faMapMarkerAlt:pe,faCircleInfo:le,faCommentDots:re},this.originalOrderKeyValue=ge,this.TAB_MENU=H,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},infos:{label:"Infos",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Ve(this.constructor.name,this.sortSettings),this.btnSortFields={name:"Name",created:"Created"},this.loadShares(),this.activatedRoute.queryParams.subscribe(x=>this.focusOnSelect=x.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${Ce.SHARED}/${he.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:e=>{this.sortBy(this.sortTable.sortParam.column,!1,e.map(n=>new I(n))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:e=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",e.error.message)}})}sortBy(e,n=!0,t){this.shares=this.sortTable.sortBy(e,n,t||this.shares)}onSelect(e=null){this.selected=e,this.store.shareSelection.set(this.selected)}openShareDialog(e=!1){e?this.layout.openDialog(z,"lg").content.shareChange.pipe(P(1)).subscribe(t=>{let[o,m]=t;o==="add"&&(this.focusOnSelect=m.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:n=>{this.layout.openDialog(z,"lg",{initialState:{share:n}}).content.shareChange.pipe(P(1)).subscribe(o=>{let[m,x]=o;if(m==="update"){this.selected.name=x.name,this.selected.alias=x.alias,this.selected.description=x.description,this.selected.modifiedAt=x.modifiedAt,this.selected.enabled=x.enabled;let F={users:0,groups:0,links:x.links.length};for(let $e of x.members)$e.isUser?F.users++:F.groups++;this.selected.counts=R(R({},this.selected.counts),F)}else m==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(F=>F.id!==x.id)))})},error:n=>this.layout.sendNotification("error","Edit share",this.selected.name,n)})}openChildShareDialog(e){e&&this.onSelect(e),this.layout.openDialog(Ie,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(t=>this.selected.counts.shares=t)}onContextMenu(e){e.preventDefault(),e.stopPropagation(),this.layout.openContextMenu(e,this.mainContextMenu)}onTargetContextMenu(e,n){e.preventDefault(),e.type==="contextmenu"&&e.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(e,this.targetContextMenu)}focusOn(e){let n=this.shares.find(t=>t.name===e);n&&(setTimeout(()=>this.scrollView.scrollInto(n),100),this.onSelect(n))}goTo(e){e=e||this.selected,this.sharesService.goTo(e).catch(n=>console.error(n))}goToComments(e){this.sharesService.goTo(e).then(()=>this.layout.showRSideBarTab(H.COMMENTS,!0))}static{this.\u0275fac=function(n){return new(n||i)(T(X),T(be),T(J),T(ve),T(De))}}static{this.\u0275cmp=Q({type:i,selectors:[["app-shared"]],viewQuery:function(n,t){if(n&1&&(V(N,5),V(O,7),V(U,7),V(Be,7),V(He,7)),n&2){let o;M(o=E())&&(t.scrollView=o.first),M(o=E())&&(t.inputFilter=o.first),M(o=E())&&(t.btnNavigationView=o.first),M(o=E())&&(t.mainContextMenu=o.first),M(o=E())&&(t.targetContextMenu=o.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],["l10nTranslate",""]],template:function(n,t){if(n&1){let o=g();l(0,"div",2)(1,"button",3),S(2,"translate"),u("click",function(){return p(o),_(t.loadShares())}),h(3,"fa-icon",4),c(),l(4,"button",5),S(5,"translate"),u("click",function(){return p(o),_(t.openShareDialog(!0))}),h(6,"fa-icon",6),c(),l(7,"button",7),S(8,"translate"),u("click",function(){return p(o),_(t.openShareDialog())}),h(9,"fa-icon",6),c(),l(10,"button",7),S(11,"translate"),u("click",function(){return p(o),_(t.openChildShareDialog())}),h(12,"fa-icon",6),c(),l(13,"button",7),S(14,"translate"),u("click",function(){return p(o),_(t.goTo())}),h(15,"fa-icon",6),c(),l(16,"div",8)(17,"div",9),h(18,"app-input-filter",10),c(),l(19,"app-navigation-view",11),u("sortBy",function(x){return p(o),_(t.sortBy(x))})("switchView",function(x){return p(o),_(t.galleryMode=x)}),c()()(),C(20,Qe,6,8,"div",12)(21,nt,12,8),l(22,"div",13)(23,"span",14),f(24),S(25,"translate"),c()(),l(26,"context-menu",null,0),C(28,ot,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.openShareDialog(!0))}),C(29,rt,0,0,"ng-template",16)(30,at,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.loadShares())}),c(),l(31,"context-menu",null,1),C(33,lt,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.goTo())}),C(34,st,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.openShareDialog())}),C(35,pt,1,0,null,17)(36,_t,0,0,"ng-template",16)(37,dt,3,1,"ng-template",15),u("execute",function(){return p(o),_(t.layout.showRSideBarTab(t.TAB_MENU.SELECTION))}),c()}n&2&&(r(),d("tooltip",w(2,22,"Refresh",t.locale.language)),r(2),d("icon",t.icons.faArrowRotateRight)("animation",t.loading?"spin":null),r(),d("tooltip",w(5,25,"New share",t.locale.language)),r(2),d("icon",t.icons.faPlus),r(),d("disabled",!t.selected)("tooltip",w(8,28,"Edit share",t.locale.language)),r(2),d("icon",t.icons.faPen),r(),d("disabled",!(t.selected!=null&&t.selected.counts.shares))("tooltip",w(11,31,"Edit children shares",t.locale.language)),r(2),d("icon",t.icons.SHARED),r(),d("disabled",!t.selected)("tooltip",w(14,34,"Go to",t.locale.language)),r(2),d("icon",t.icons.faMapMarkerAlt),r(4),d("sortParams",t.sortTable.sortParam)("sortFields",t.btnSortFields),r(),y(t.galleryMode!=null&&t.galleryMode.enabled?20:21),r(4),K("",t.shares.length," ",w(25,37,"shares",t.locale.language),""),r(5),d("divider",!0),r(6),y(t.selected!=null&&t.selected.counts.shares?35:-1),r(),d("divider",!0))},dependencies:[ne,G,Z,Y,U,O,Te,ie,te,N,Ee,Me,ye,we,Se,Fe],encapsulation:2})}}return i})();export{qt as SharedComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ht}from"./chunk-2QEYCCHN.js";import{a as Ct,b as G,c as bt}from"./chunk-CTWOQLAR.js";import{a as q,b as Fe,c as ot,e as te}from"./chunk-GI2LXVWQ.js";import{a as vt}from"./chunk-5OIPLRAE.js";import{d as Ce}from"./chunk-EWY4ALVF.js";import"./chunk-JXZCNFW7.js";import{a as gt}from"./chunk-VIL6L67B.js";import{a as ee,b as he,c as ve,d as be,f as Se,i as ye}from"./chunk-5JDPARJT.js";import{a as Ie,b as ke,c as _t,d as ft}from"./chunk-WA3LPP4G.js";import{a as H,b as xe}from"./chunk-2CQOSX2Q.js";import"./chunk-Y6IYSEKU.js";import{f as dt,g as ut}from"./chunk-ZZGFGD5E.js";import{Cb as mt,Db as pt,Eb as ct,J as it,K as z,M as nt,Q as ge,Sb as M,gb as at,v as je,xb as rt,yb as st,zb as lt}from"./chunk-HDDBV3QQ.js";import{b as Re,d as Le}from"./chunk-UGSGMP2I.js";import{Ad as Z,Bb as R,Bd as V,Dc as le,Dd as P,Eb as u,Ec as Ge,Fb as c,Ff as et,Gf as tt,L as Q,Ma as K,Mb as ne,Nb as oe,Nf as fe,Ob as ae,Oe as Xe,Qb as s,Qd as qe,Rb as h,Sa as a,Sb as T,Tb as L,Te as _e,Xa as v,Xc as J,Yc as me,_c as D,_d as He,ab as I,ad as O,bc as C,bd as B,cc as y,cd as X,db as se,dc as U,eb as Pe,ed as w,fb as f,fd as Oe,fe as Qe,jd as $,kd as Y,lb as m,ld as pe,mb as De,md as ce,nb as A,nd as de,ne as ze,ob as Ee,oe as Ke,pa as b,pb as k,pf as Ye,qa as x,qb as Me,rb as g,re as ue,sb as W,sd as Be,tb as E,td as j,ub as F,ud as N,vb as n,ve as We,wa as re,wb as o,wd as $e,wf as Ze,xb as d,xe as Je}from"./chunk-FPEGN42P.js";import"./chunk-GAL4ENT6.js";function At(t,l){if(t&1&&(d(0,"fa-icon",42),n(1,"span"),s(2),o()),t&2){let e=c();m("icon",e.icons.faPen),a(2),h(e.guest.fullName)}}function Ut(t,l){if(t&1&&(d(0,"fa-icon",42),n(1,"span",43),s(2,"New guest"),o()),t&2){let e=c();m("icon",e.icons.faPlus)}}function Dt(t,l){if(t&1&&d(0,"fa-icon",2),t&2){let e=c();m("icon",e.icons.faSpinner)}}function Et(t,l){t&1&&(n(0,"h4",3)(1,"span",43),s(2,"Edit guest"),o()())}function Ft(t,l){if(t&1&&(d(0,"fa-icon",44),n(1,"span",45),s(2,"Account"),o()),t&2){let e=c();m("icon",e.icons.faAddressCard)}}function It(t,l){if(t&1&&d(0,"app-password-strength-bar",22),t&2){let e=c();m("passwordToCheck",e.guestForm.value.password)}}function kt(t,l){if(t&1&&(n(0,"option",26),s(1),o()),t&2){let e=l.$implicit;m("ngValue",e),a(),h(e)}}function Nt(t,l){if(t&1&&(n(0,"option",34),s(1),o()),t&2){let e=l.$implicit,r=c();m("ngValue",r.allNotifications.indexOf(e)),a(),h(e)}}function Vt(t,l){if(t&1&&(n(0,"div"),s(1),C(2,"amDateFormat"),o(),n(3,"div"),s(4),C(5,"amDateFormat"),o()),t&2){let e=c(2);a(),L("",y(2,4,e.guest.currentAccess)," - ",e.guest.currentIp,""),a(3),L("",y(5,6,e.guest.lastAccess)," - ",e.guest.lastIp,"")}}function Pt(t,l){t&1&&(n(0,"span",37),s(1,"never"),o())}function Mt(t,l){if(t&1&&(n(0,"div",11)(1,"div",12)(2,"label",46),s(3,"Creation date"),o(),n(4,"div",47),s(5),C(6,"amDateFormat"),o()(),n(7,"div",48)(8,"label",49),s(9,"Last accesses"),o(),n(10,"div",50),f(11,Vt,6,8)(12,Pt,2,0,"span",37),o()()()),t&2){let e=c();a(5),h(y(6,2,e.guest.createdAt)),a(6),g(e.guest.lastAccess?11:12)}}function Gt(t,l){if(t&1&&(d(0,"fa-icon",44),n(1,"span",51),s(2,"Managers"),o(),n(3,"span"),s(4),o()),t&2){let e=c();m("icon",e.icons.faUsersGear),a(4),T("(",e.guestForm.value.managers.length||0,")")}}function Rt(t,l){t&1&&(n(0,"small",37),s(1,"At least one manager is required"),o())}function Lt(t,l){if(t&1){let e=R();n(0,"button",52),u("click",function(){b(e);let i=c();return x(i.confirmDeletion=!0)}),s(1," Remove "),o()}if(t&2){let e=c();m("disabled",e.confirmDeletion)}}var Ne=(()=>{class t extends ht{constructor(e,r,i,p){super(e,r,i),this.adminService=p}searchMembers(e){let r={search:e,ignoreUserIds:this.guestForm.value.managers.map(i=>i.id),usersRole:z.USER,onlyUsers:!0};return this.adminService.searchMembers(r)}onSubmit(){if(this.submitted=!0,this.confirmDeletion)this.adminService.deleteUser(this.guest.id,null,!0).subscribe({next:()=>{this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest deleted",this.guest.login),this.layout.closeDialog()},error:e=>this.onError(e)});else if(!this.guest)this.adminService.createUser(this.makeDto(!0),!0).subscribe({next:e=>{this.guestChange.emit(["add",e]),this.layout.sendNotification("success","Guest created",this.guestForm.value.login),this.layout.closeDialog()},error:e=>this.onError(e)});else{let e=this.makeDto();if(!Object.keys(e).length){this.loading=!1,this.submitted=!1;return}this.adminService.updateUser(this.guest.id,e,!0).subscribe({next:r=>{r?this.guestChange.emit(["update",r]):this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest updated",this.guestForm.value.login),this.layout.closeDialog()},error:r=>this.onError(r)})}}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(dt),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-guest-dialog"]],features:[Pe],decls:70,vars:40,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[1,"d-flex","flex-column","col-6","pe-4"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],["l10nTranslate","",1,"text-danger"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],["l10nTranslate",""],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),f(2,At,3,2)(3,Ut,3,1)(4,Dt,1,1,"fa-icon",2),o(),f(5,Et,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.layout.closeDialog()}),o()(),n(7,"div",5)(8,"tabset",6),d(9,"hr",7),n(10,"tab",8),u("selectTab",function(){return i.tabView=null}),f(11,Ft,3,1,"ng-template",9),n(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),s(16,"Login"),o(),d(17,"input",14),o(),n(18,"div",15)(19,"label",16),s(20,"Email"),o(),d(21,"input",17),o()(),n(22,"div",11)(23,"div",12)(24,"label",18),s(25,"First name"),o(),d(26,"input",19),o(),n(27,"div",15)(28,"label",20),s(29,"Last name"),o(),d(30,"input",21),o()(),n(31,"div",11)(32,"div",12),f(33,It,1,1,"app-password-strength-bar",22),n(34,"app-input-password",23),u("passwordChange",function(_){return i.updatePassword(_)}),o()(),n(35,"div",15)(36,"label",24),s(37,"Language"),o(),n(38,"select",25),E(39,kt,2,2,"option",26,W),o()()(),n(41,"div",11)(42,"div",27)(43,"label",28),s(44,"Account status"),o(),n(45,"div",29)(46,"label",30),d(47,"input",31),n(48,"span"),s(49),C(50,"translate"),C(51,"titlecase"),o()()()(),n(52,"div",15)(53,"label",32),s(54,"Notification"),o(),n(55,"select",33),E(56,Nt,2,2,"option",34,W),o()()(),f(58,Mt,13,4,"div",11),o()(),n(59,"tab",35),u("selectTab",function(){return i.tabView="managers"}),f(60,Gt,5,2,"ng-template",9),n(61,"div",7)(62,"app-user-search",36),u("membersChange",function(_){return i.updateManagers(_)}),o(),f(63,Rt,2,0,"small",37),o()()()(),n(64,"div",38),f(65,Lt,2,1,"button",39),n(66,"button",40),u("click",function(){return i.onCancel()}),s(67,"Cancel"),o(),n(68,"button",41),u("click",function(){return i.onSubmit()}),s(69),o()()),r&2&&(a(2),g(i.guest?2:3),a(2),g(i.loading?4:-1),a(),g(i.guest?5:-1),a(),k("btn-close btn-close-white ",i.guest?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.guestForm),a(),m("justified",!0),a(9),A("is-invalid",i.guestForm.controls.login.invalid),m("autoSelect",!1),a(4),A("is-invalid",i.guestForm.controls.email.invalid),a(5),A("is-invalid",i.guestForm.controls.firstName.invalid),a(7),g(i.guestForm.value.password!==i.defaultPassword?33:-1),a(),m("password",i.guestForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),a(5),F(i.languages),a(9),A("text-danger",!i.guestForm.value.isActive),a(),T(" ",y(51,38,U(50,35,i.guestForm.value.isActive?"active":"suspended",i.locale.language))," "),a(7),F(i.allNotifications),a(2),g(i.guest?58:-1),a(4),m("members",i.guestForm.value.managers)("withPermissions",!1)("customPlaceholder","Type to search for managers to add")("searchFunction",i.searchMembers.bind(i)),a(),g(i.guestForm.value.managers.length?-1:63),a(2),g(i.guest!=null&&i.guest.id?65:-1),a(3),k("btn btn-sm ",i.confirmDeletion?"btn-danger":"btn-primary",""),m("disabled",i.guestForm.invalid||i.submitted),a(),T(" ",i.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[P,V,ee,j,ce,de,me,J,pe,O,B,$,Y,H,xe,Se,Z,le,ye,he,ve,be],encapsulation:2})}}return t})();function Bt(t,l){t&1&&(n(0,"h4",3)(1,"span",13),s(2,"Impersonate identity"),o()())}var xt=(()=>{class t{constructor(e,r,i){this.locale=e,this.layout=r,this.adminService=i,this.submitted=!1,this.icons={faUserSecret:_e},this.passwordMinLength=8,this.impersonateUserForm=new X({password:new w("",D.required)})}onSubmit(){this.submitted=!0,this.adminService.impersonateUser(this.user.id,{password:this.impersonateUserForm.value.password}).subscribe({next:e=>{this.layout.closeDialog(),setTimeout(()=>this.adminService.initImpersonateUser(e),500)},error:e=>{this.submitted=!1,this.layout.sendNotification("error","Impersonate identity",this.user.login,e)}})}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-impersonate-user-dialog"]],inputs:{user:"user"},decls:19,vars:16,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],[1,"d-flex","align-items-center","avatar","mb-3"],["alt","",1,"avatar-img",3,"src"],[1,"fw-bold","mx-2"],["id","password","placeholder","Enter your password to confirm",3,"passwordChange","password","passwordMinLength","isRequired","focus"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["l10nTranslate",""]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),n(3,"span"),s(4),o()(),f(5,Bt,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.layout.closeDialog()}),o()(),n(7,"div",5)(8,"div",6),d(9,"img",7),n(10,"span",8),s(11),C(12,"capitalize"),o()(),n(13,"app-input-password",9),u("passwordChange",function(_){return i.impersonateUserForm.controls.password.setValue(_)}),o()(),n(14,"div",10)(15,"button",11),u("click",function(){return i.layout.closeDialog()}),s(16,"Cancel"),o(),n(17,"button",12),u("click",function(){return i.onSubmit()}),s(18," Confirm "),o()()),r&2&&(a(2),m("icon",i.icons.faUserSecret),a(2),h(i.user.fullName),a(),g(i.user?5:-1),a(),k("btn-close btn-close-white ",i.user?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.impersonateUserForm),a(2),m("src",i.user.avatarUrl,K),a(2),h(y(12,14,i.user.login)),a(2),m("password",i.impersonateUserForm.value.password)("passwordMinLength",i.passwordMinLength)("isRequired",!0)("focus",!0),a(4),m("disabled",i.impersonateUserForm.invalid||i.submitted))},dependencies:[P,V,j,B,$,te,H],encapsulation:2})}}return t})();var St=(()=>{class t{constructor(e){this.translate=e}transform(e,r=!1,i=null,p=", "){return e.length?(i?e.map(S=>S[i]):e.concat()).sort().map(S=>new te().transform(r?this.translate.translate(S):S)).join(p):""}static{this.\u0275fac=function(r){return new(r||t)(v($e,16))}}static{this.\u0275pipe=se({name:"join",type:t,pure:!0})}}return t})();var yt=(()=>{class t{transform(e,r=","){return e?.length?e.split(r):[]}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275pipe=se({name:"split",type:t,pure:!0})}}return t})();function $t(t,l){t&1&&(n(0,"h4",3)(1,"span",9),s(2,"Delete user"),o()())}var wt=(()=>{class t{constructor(e,r,i){this.locale=e,this.layout=r,this.adminService=i,this.wasDeleted=new re,this.submitted=!1,this.icons={faUserMinus:Ke},this.deleteUserForm=new X({adminPassword:new w("",D.required),deleteSpace:new w(!1)})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.adminService.deleteUser(this.user.id,{adminPassword:this.deleteUserForm.value.adminPassword,deleteSpace:this.deleteUserForm.value.deleteSpace}).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success","Delete user",this.user.login),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error","Delete user",this.user.login,e)}})}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-user-delete-dialog"]],inputs:{user:"user"},outputs:{wasDeleted:"wasDeleted"},decls:27,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],[1,"d-flex","align-items-center","avatar","mb-3"],["alt","",1,"avatar-img",3,"src"],[1,"fw-bold","mx-2"],["l10nTranslate",""],["id","password","placeholder","Enter your password to confirm",3,"passwordChange","password","isRequired","focus"],[1,"form-check","form-check-inline","mt-3"],[1,"d-flex"],["for","deleteSpace",1,"form-check-label"],["formControlName","deleteSpace","id","deleteSpace","type","checkbox",1,"form-check-input"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),n(3,"span"),s(4),o()(),f(5,$t,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.onClose()}),o()(),n(7,"div",5)(8,"div",6),d(9,"img",7),n(10,"span",8),s(11),C(12,"capitalize"),o(),n(13,"span",9),s(14,"will be permanently removed"),o()(),n(15,"app-input-password",10),u("passwordChange",function(_){return i.deleteUserForm.controls.adminPassword.setValue(_)}),o(),n(16,"div",11)(17,"div",12)(18,"label",13),d(19,"input",14),n(20,"span",9),s(21,"Delete all user files"),o()()()()(),n(22,"div",15)(23,"button",16),u("click",function(){return i.onClose()}),s(24,"Cancel"),o(),n(25,"button",17),u("click",function(){return i.onSubmit()}),s(26," Confirm "),o()()),r&2&&(a(2),m("icon",i.icons.faUserMinus),a(2),h(i.user.fullName),a(),g(i.user?5:-1),a(),k("btn-close btn-close-white ",i.user?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.deleteUserForm),a(2),m("src",i.user.avatarUrl,K),a(2),h(y(12,13,i.user.login)),a(4),m("password",i.deleteUserForm.value.adminPassword)("isRequired",!0)("focus",!0),a(10),m("disabled",i.deleteUserForm.invalid||i.submitted))},dependencies:[P,V,j,J,O,B,$,Y,te,H],encapsulation:2})}}return t})();var jt=(t,l)=>l.id;function qt(t,l){if(t&1&&(d(0,"fa-icon",47),n(1,"span"),s(2),o()),t&2){let e=c();m("icon",e.icons.faUserPen),a(2),h(e.user.fullName)}}function Ht(t,l){if(t&1&&(d(0,"fa-icon",47),n(1,"span",40),s(2,"New user"),o()),t&2){let e=c();m("icon",e.icons.faUserPlus)}}function Qt(t,l){if(t&1&&d(0,"fa-icon",2),t&2){let e=c();m("icon",e.icons.faSpinner)}}function zt(t,l){t&1&&(n(0,"h4",3)(1,"span",40),s(2,"Edit user"),o()())}function Kt(t,l){if(t&1&&(d(0,"fa-icon",48),n(1,"span",49),s(2,"Account"),o()),t&2){let e=c();m("icon",e.icons.faAddressCard)}}function Wt(t,l){if(t&1&&d(0,"app-password-strength-bar",22),t&2){let e=c();m("passwordToCheck",e.userForm.value.password)}}function Jt(t,l){if(t&1&&(n(0,"option",26),s(1),o()),t&2){let e=l.$implicit;m("ngValue",e),a(),h(e)}}function Xt(t,l){if(t&1&&(n(0,"option",30),s(1),o()),t&2){let e=l.$implicit,r=c();m("ngValue",r.allNotifications.indexOf(e)),a(),h(e)}}function Yt(t,l){if(t&1&&(n(0,"div",11)(1,"div",12)(2,"label",50),s(3,"Storage Usage"),o(),d(4,"app-storage-usage",51),o(),d(5,"div",15),o()),t&2){let e=c();a(4),m("item",e.user)}}function Zt(t,l){if(t&1&&(n(0,"div"),s(1),C(2,"amDateFormat"),o(),n(3,"div"),s(4),C(5,"amDateFormat"),o()),t&2){let e=c(2);a(),L("",y(2,4,e.user.currentAccess)," - ",e.user.currentIp,""),a(3),L("",y(5,6,e.user.lastAccess)," - ",e.user.lastIp,"")}}function ei(t,l){t&1&&(n(0,"span",57),s(1,"never"),o())}function ti(t,l){if(t&1&&(n(0,"div",11)(1,"div",12)(2,"label",52),s(3,"Creation date"),o(),n(4,"div",53),s(5),C(6,"amDateFormat"),o()(),n(7,"div",54)(8,"label",55),s(9,"Last accesses"),o(),n(10,"div",56),f(11,Zt,6,8)(12,ei,2,0,"span",57),o()()()),t&2){let e=c();a(5),h(y(6,2,e.user.createdAt)),a(6),g(e.user.lastAccess?11:12)}}function ii(t,l){if(t&1&&(d(0,"fa-icon",48),n(1,"span",49),s(2,"Permissions"),o()),t&2){let e=c();m("icon",e.icons.faShieldHalved)}}function ni(t,l){if(t&1&&(n(0,"div",60)(1,"div",61),d(2,"fa-icon",62),n(3,"span"),s(4),o()(),n(5,"div",63),s(6),C(7,"split"),C(8,"join"),o()()),t&2){let e=c().$implicit,r=c(2);a(2),m("icon",r.icons.GROUPS),a(2),h(e.name),a(2),h(U(8,5,y(7,3,e.permissions),!0))}}function oi(t,l){if(t&1&&f(0,ni,9,8,"div",60),t&2){let e=l.$implicit;g(e.permissions?0:-1)}}function ai(t,l){if(t&1&&(n(0,"div",32)(1,"label",58),s(2,"Permissions inherited from groups"),o(),n(3,"div",59),E(4,oi,1,1,null,null,jt),o()()),t&2){let e=c();a(4),F(e.userForm.value.groups)}}function ri(t,l){if(t&1&&(d(0,"fa-icon",48),n(1,"span",64),s(2,"Groups"),o(),n(3,"span"),s(4),o()),t&2){let e=c();m("icon",e.icons.faUsers),a(4),T("(",e.userForm.value.groups.length||0,")")}}function si(t,l){if(t&1){let e=R();n(0,"button",65),u("click",function(){b(e);let i=c();return x(i.confirmDeletion=!0)}),s(1," Remove "),o()}if(t&2){let e=c();m("disabled",e.confirmDeletion)}}var Ve=(()=>{class t{constructor(e,r,i){this.locale=e,this.layout=r,this.adminService=i,this.user=null,this.userChange=new re,this.submitted=!1,this.loading=!1,this.confirmDeletion=!1,this.icons={GROUPS:rt.GROUPS,faUserPlus:fe,faUserPen:ue,faSpinner:tt,faAddressCard:We,faUsers:He,faShieldHalved:Je},this.allNotifications=Object.values(ge),this.defaultPassword=this.layout.translateString(st),this.languages=this.layout.getLanguages(!0)}ngOnInit(){this.userForm=new X({login:new w(this.user?.login||"",[D.required,D.pattern(it)]),email:new w(this.user?.email||"",[D.required,D.maxLength(255),D.email]),firstName:new w(this.user?.firstName||"",[D.required,D.maxLength(255)]),lastName:new w(this.user?.lastName||"",D.maxLength(255)),password:new w(this.user?this.defaultPassword:"",D.maxLength(255)),language:new w(this.user?.language||null),notification:new w(this.user?.notification||Object.values(ge).indexOf(ge.APPLICATION_EMAIL)),isActive:new w(this.user?this.user.isActive:!0),isAdmin:new w(this.user?this.user.isAdmin:!1),storageQuota:new w(this.user?.storageQuota||null),groups:new w(this.user?.groups||[]),applications:new w(this.user?.applications||[])})}searchMembers(e){let r={search:e,onlyGroups:!0,excludePersonalGroups:!0,withPermissions:!0,ignoreGroupIds:this.userForm.value.groups.map(i=>i.id)};return this.adminService.searchMembers(r)}updateApplications(e){this.userForm.controls.applications.setValue(e),this.userForm.controls.applications.markAsDirty()}updatePassword(e){this.userForm.controls.password.setValue(e),this.userForm.controls.password.markAsDirty()}updateMembers(e){this.userForm.controls.groups.setValue(e),this.userForm.controls.groups.markAsDirty()}updateQuota(e){this.userForm.controls.storageQuota.setValue(e),this.userForm.controls.storageQuota.markAsDirty()}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.confirmDeletion?this.layout.openDialog(wt,"sm",{initialState:{user:this.user}}).content.wasDeleted.pipe(Q(1)).subscribe(r=>{r?(this.userChange.emit(["delete",this.user]),this.layout.closeDialog()):(this.confirmDeletion=!1,this.submitted=!1)}):this.user?this.adminService.updateUser(this.user.id,this.makeDto()).subscribe({next:e=>{this.userChange.emit(["update",e]),this.layout.sendNotification("success","User updated",this.userForm.value.login),this.layout.closeDialog()},error:e=>this.onError(e)}):this.adminService.createUser(this.makeDto(!0)).subscribe({next:e=>{this.userChange.emit(["add",e]),this.layout.sendNotification("success","User created",this.userForm.value.login),this.layout.closeDialog()},error:e=>this.onError(e)})}makeDto(e=!1){let r={};if(e)r=this.userForm.value;else for(let i in this.userForm.controls)this.userForm.controls[i].dirty&&(r[i]=this.userForm.controls[i].value);for(let i in r)switch(i){case"language":r[i]=r[i]===lt?null:r[i];break;case"isAdmin":r.role=r[i]?z.ADMINISTRATOR:z.USER;break;case"applications":r.permissions=r[i].join(nt);break;case"groups":r[i]=r[i].map(p=>p.id);break}return r}onError(e){this.layout.sendNotification("error","Group error",this.userForm.value.login,e),this.submitted=!1}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-user-dialog"]],inputs:{user:"user"},outputs:{userChange:"userChange"},decls:82,vars:44,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[3,"quotaChange","quota","fullWidth"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[1,"d-flex","flex-column","col-12","pb-3"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","isAdmin",1,"form-check-label"],["formControlName","isAdmin","id","isAdmin","type","checkbox",1,"form-check-input"],["l10nTranslate",""],[3,"permissionsChange","permissions"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"text-danger"],["for","groups_permissions","l10nTranslate",""],["id","groups_permissions"],[1,"d-flex","align-items-center","mb-1"],[1,"d-flex","align-items-center","me-5"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","fs-xxs","ms-auto"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),f(2,qt,3,2)(3,Ht,3,1)(4,Qt,1,1,"fa-icon",2),o(),f(5,zt,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.layout.closeDialog()}),o()(),n(7,"div",5)(8,"tabset",6),d(9,"hr",7),n(10,"tab",8),u("selectTab",function(){return i.tabView=null}),f(11,Kt,3,1,"ng-template",9),n(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),s(16,"Login"),o(),d(17,"input",14),o(),n(18,"div",15)(19,"label",16),s(20,"Email"),o(),d(21,"input",17),o()(),n(22,"div",11)(23,"div",12)(24,"label",18),s(25,"First name"),o(),d(26,"input",19),o(),n(27,"div",15)(28,"label",20),s(29,"Last name"),o(),d(30,"input",21),o()(),n(31,"div",11)(32,"div",12),f(33,Wt,1,1,"app-password-strength-bar",22),n(34,"app-input-password",23),u("passwordChange",function(_){return i.updatePassword(_)}),o()(),n(35,"div",15)(36,"label",24),s(37,"Language"),o(),n(38,"select",25),E(39,Jt,2,2,"option",26,W),o()()(),n(41,"div",11)(42,"div",12)(43,"app-storage-quota",27),u("quotaChange",function(_){return i.updateQuota(_)}),o()(),n(44,"div",15)(45,"label",28),s(46,"Notification"),o(),n(47,"select",29),E(48,Xt,2,2,"option",30,W),o()()(),f(50,Yt,6,1,"div",11),o(),f(51,ti,13,4,"div",11),o(),n(52,"tab",31),u("selectTab",function(){return i.tabView="permissions"}),f(53,ii,3,1,"ng-template",9),n(54,"div",32)(55,"label",33),s(56,"Account status"),o(),n(57,"div",34)(58,"div",35)(59,"label",36),d(60,"input",37),n(61,"span"),s(62),C(63,"translate"),C(64,"titlecase"),o()()(),n(65,"div",35)(66,"label",38),d(67,"input",39),n(68,"span",40),s(69,"Administrator"),o()()()()(),n(70,"app-admin-permissions",41),u("permissionsChange",function(_){return i.updateApplications(_)}),o(),f(71,ai,6,0,"div",32),o(),n(72,"tab",31),u("selectTab",function(){return i.tabView="groups"}),f(73,ri,5,2,"ng-template",9),n(74,"div",7)(75,"app-user-search",42),u("membersChange",function(_){return i.updateMembers(_)}),o()()()()(),n(76,"div",43),f(77,si,2,1,"button",44),n(78,"button",45),u("click",function(){return i.onCancel()}),s(79,"Cancel"),o(),n(80,"button",46),u("click",function(){return i.onSubmit()}),s(81),o()()),r&2&&(a(2),g(i.user?2:3),a(2),g(i.loading?4:-1),a(),g(i.user?5:-1),a(),k("btn-close btn-close-white ",i.user?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.userForm),a(),m("justified",!0),a(9),A("is-invalid",i.userForm.controls.login.invalid),m("autoSelect",!1),a(4),A("is-invalid",i.userForm.controls.email.invalid),a(5),A("is-invalid",i.userForm.controls.firstName.invalid),a(7),g(i.userForm.value.password!==i.defaultPassword?33:-1),a(),m("password",i.userForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),a(5),F(i.languages),a(4),m("quota",i.userForm.value.storageQuota)("fullWidth",!0),a(5),F(i.allNotifications),a(2),g(i.user&&i.user.storageUsage?50:-1),a(),g(i.user?51:-1),a(10),A("text-danger",!i.userForm.value.isActive),a(),T(" ",y(64,42,U(63,39,i.userForm.value.isActive?"active":"suspended",i.locale.language))," "),a(8),m("permissions",i.userForm.value.applications),a(),g(i.userForm.value.groups.length?71:-1),a(4),m("members",i.userForm.value.groups)("withPermissions",!1)("customPlaceholder","Type to search for groups to add")("searchFunction",i.searchMembers.bind(i)),a(2),g(i.user!=null&&i.user.id?77:-1),a(3),k("btn btn-sm ",i.confirmDeletion?"btn-danger":"btn-primary",""),m("disabled",i.userForm.invalid||i.submitted),a(),T(" ",i.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[P,V,ve,be,he,j,ce,de,me,J,pe,O,B,$,Y,H,xe,le,Z,Ce,vt,yt,St,ye,Se,bt,ee],encapsulation:2})}}return t})();var li=["MainContextMenu"],mi=["TargetContextMenu"],Tt=(t,l)=>l.key,pi=(t,l)=>l.id,ci=(t,l)=>l.mid;function di(t,l){if(t&1&&d(0,"fa-icon",24),t&2){let e=c(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function ui(t,l){if(t&1){let e=R();n(0,"th",23),u("click",function(){b(e);let i=c().$implicit,p=c();return x(p.sortBy(i.key))}),s(1),f(2,di,1,2,"fa-icon",24),o()}if(t&2){let e=c().$implicit,r=c();Ee(e.value.class),De("width",e.value.width,"%"),A("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),T(" ",e.value.label," "),a(),g(r.sortTable.sortParam.column===e.key?2:-1)}}function _i(t,l){if(t&1&&f(0,ui,3,11,"th",22),t&2){let e=l.$implicit;g(e.value.show?0:-1)}}function fi(t,l){if(t&1&&d(0,"fa-icon",32),t&2){let e=c(5);m("icon",e.icons.faKey)}}function gi(t,l){if(t&1&&(n(0,"div",27),d(1,"img",30),n(2,"div",28)(3,"span",31),s(4),f(5,fi,1,1,"fa-icon",32),o(),n(6,"span",33),s(7),o()()()),t&2){let e=c(3).$implicit;a(),m("src",e.avatarUrl,K),a(3),T(" ",e.login," "),a(),g(e.isAdmin?5:-1),a(2),h(e.email)}}function Ci(t,l){if(t&1&&(n(0,"span",34),s(1),o()),t&2){let e=c(4).$implicit;a(),h(e.userRoleText)}}function hi(t,l){if(t&1&&(n(0,"div",28)(1,"span",31),s(2),o(),f(3,Ci,2,1,"span",34),o()),t&2){let e=c(3).$implicit;a(2),h(e.fullName),a(),g(e.isAdmin?3:-1)}}function vi(t,l){if(t&1&&d(0,"app-user-avatar",35),t&2){let e=l.$implicit;m("user",e)("isMember",!0)}}function bi(t,l){if(t&1&&E(0,vi,1,2,"app-user-avatar",35,ci),t&2){let e=c(3).$implicit;F(e.managers)}}function xi(t,l){if(t&1&&d(0,"app-storage-usage",36),t&2){let e=c(4).$implicit;m("item",e)}}function Si(t,l){if(t&1&&f(0,xi,1,1,"app-storage-usage",36),t&2){let e=c(3).$implicit;g(e.storageUsage?0:-1)}}function yi(t,l){if(t&1&&(n(0,"div",28)(1,"div"),s(2),o(),n(3,"div"),s(4),o()()),t&2){let e=c(3).$implicit;a(2),h(e.currentIp),a(2),h(e.lastIp)}}function wi(t,l){t&1&&s(0," too many login attempts ")}function Ti(t,l){if(t&1&&s(0),t&2){let e=c(4).$implicit;T(" ",e.userIsActiveText," ")}}function Ai(t,l){if(t&1&&(n(0,"span",11),f(1,wi,1,0)(2,Ti,1,1),o()),t&2){let e=c(3).$implicit;Ee(e.isActive?"text-success":"text-danger"),a(),g(!e.isActive&&e.passwordAttempts?1:2)}}function Ui(t,l){if(t&1&&(n(0,"div",28)(1,"div"),s(2),C(3,"amDateFormat"),o(),n(4,"div"),s(5),C(6,"amDateFormat"),o()()),t&2){let e=c(5).$implicit;a(2),h(y(3,2,e.currentAccess)),a(3),h(y(6,4,e.lastAccess))}}function Di(t,l){if(t&1&&s(0),t&2){let e=c(5).$implicit;T(" ",e.hTimeAgo," ")}}function Ei(t,l){if(t&1){let e=R();n(0,"div",38),u("mouseover",function(){b(e);let i=c(4).$implicit;return x(i.currentAccessHover=!0)})("focus",function(){b(e);let i=c(4).$implicit;return x(i.currentAccessHover=!0)})("mouseleave",function(){b(e);let i=c(4).$implicit;return x(i.currentAccessHover=!1)}),f(1,Ui,7,6,"div",28)(2,Di,1,1),o()}if(t&2){let e=c(4).$implicit;a(),g(e.currentAccessHover?1:2)}}function Fi(t,l){t&1&&(n(0,"span",11),s(1,"never"),o())}function Ii(t,l){if(t&1&&f(0,Ei,3,1,"div",37)(1,Fi,2,0,"span",11),t&2){let e=c(3).$implicit;g(e.currentAccess?0:1)}}function ki(t,l){if(t&1&&(n(0,"td"),f(1,gi,8,4,"div",27)(2,hi,4,2,"div",28)(3,bi,2,0)(4,Si,1,1)(5,yi,5,2,"div",28)(6,Ai,3,4,"span",29)(7,Ii,2,1),o()),t&2){let e,r=c().$implicit,i=c().$implicit;Me("",r.value.class," ",r.value.newly?"prop-newly-"+i[r.value.newly]:"",""),De("width",r.value.width,"%"),A("text-align-center",r.value.textCenter),a(),g((e=r.key)==="login"?1:e==="fullName"?2:e==="managers"?3:e==="storage"?4:e==="currentIp"?5:e==="isActive"?6:e==="currentAccess"?7:-1)}}function Ni(t,l){if(t&1&&f(0,ki,8,9,"td",26),t&2){let e=l.$implicit;g(e.value.show?0:-1)}}function Vi(t,l){if(t&1){let e=R();n(0,"tr",25),u("click",function(){let i=b(e).$implicit,p=c();return x(p.onSelect(i))})("contextmenu",function(i){let p=b(e).$implicit,_=c();return x(_.onTargetContextMenu(i,p))})("pressup",function(i){let p=b(e).$implicit,_=c();return x(_.onTargetContextMenu(i,p))})("tap",function(){b(e);let i=c();return x(i.openDialog())}),E(1,Ni,1,1,null,null,Tt),C(3,"keyvalue"),o()}if(t&2){let e=l.$implicit,r=c();A("disabled",!e.isActive)("selected",e.id===(r.selected==null?null:r.selected.id)),a(),F(U(3,4,r.tableHeaders,r.originalOrderKeyValue))}}function Pi(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2),o()),t&2){let e=c();a(),m("icon",e.icons.faUserPlus),a(),T("New ",e.guestsView?"guest":"user","")}}function Mi(t,l){}function Gi(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2,"Refresh"),o()),t&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function Ri(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2),o()),t&2){let e=c();a(),m("icon",e.icons.faUserPen),a(),T("Edit ",e.guestsView?"guest":"user","")}}function Li(t,l){}function Oi(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2,"Impersonate identity"),o()),t&2){let e=c();a(),m("icon",e.icons.faUserSecret)}}var wo=(()=>{class t{constructor(e,r,i,p,_){this.locale=e,this.router=r,this.activatedRoute=i,this.layout=p,this.adminService=_,this.originalOrderKeyValue=at,this.icons={faRotate:et,faUserPlus:fe,faUserPen:ue,faArrowDown:Ye,faArrowUp:Ze,faKey:Qe,faUserSecret:_e,faArrowRotateRight:Xe,faToggleOn:ze,faToggleOff:qe},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!1,sortable:!0},storage:{label:"Storage Space",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentIp:{label:"IP",width:10,textCenter:!1,class:"d-none d-lg-table-cell",show:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new ft(this.constructor.name,this.sortSettings),this.guestsView=!1,this.loading=!1,this.selected=null,this.users=[],this.layout.setBreadcrumbIcon(ot.USERS),this.activatedRoute.data.subscribe(S=>{this.guestsView=S.type===z.GUEST,this.setEnv()})}setEnv(){this.tableHeaders.managers.show=this.guestsView,this.tableHeaders.storage.show=!this.guestsView,this.loadUsersOrGuests(),this.layout.setBreadcrumbNav({url:this.guestsView?`/${q.BASE}/${q.GUESTS}/${Fe.GUESTS}`:`/${q.BASE}/${q.USERS}/${Fe.USERS}`,splicing:2,translating:!0,sameLink:!0})}loadUsersOrGuests(){this.loading=!0,this.onSelect(),this.adminService.listUsers(this.guestsView).subscribe({next:e=>{this.sortBy(this.sortTable.sortParam.column,!1,e),this.scrollView.scrollInto(-1),this.loading=!1},error:e=>{this.users=[],this.layout.sendNotification("error",this.guestsView?"Guests":"Users","Unable to load",e),this.loading=!1}})}onSelect(e=null){this.selected=e}onGuestsView(e){this.guestsView=e,this.router.navigate([q.BASE,e?q.GUESTS:q.USERS]).catch(r=>console.error(r))}onContextMenu(e){e.preventDefault(),e.stopPropagation(),this.layout.openContextMenu(e,this.mainContextMenu)}onTargetContextMenu(e,r){e.preventDefault(),e.type==="contextmenu"&&e.stopPropagation(),this.onSelect(r),this.layout.openContextMenu(e,this.targetContextMenu)}sortBy(e,r=!0,i){this.users=this.sortTable.sortBy(e,r,i||this.users)}openDialog(e=!1){this.guestsView?this.openGuestDialog(e):this.openUserDialog(e)}openUserDialog(e=!1){e?this.layout.openDialog(Ve,"md").content.userChange.pipe(Q(1)).subscribe(i=>{let[p,_]=i;p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.users,_]),this.onSelect(_))}):this.adminService.getUser(this.selected.id).subscribe({next:r=>{this.layout.openDialog(Ve,"md",{initialState:{user:r}}).content.userChange.pipe(Q(1)).subscribe(p=>{let[_,S]=p;_==="update"?this.selected=Object.assign(this.selected,S):_==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.users.filter(Ue=>Ue.id!==S.id)))})},error:r=>this.layout.sendNotification("error","Edit group",this.selected.login,r)})}openGuestDialog(e=!1){e?this.layout.openDialog(Ne,"md").content.guestChange.pipe(Q(1)).subscribe(i=>{let[p,_]=i,S=new Ct(_);p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.users,S]),this.onSelect(S))}):this.adminService.getUser(this.selected.id,!0).subscribe({next:r=>{this.layout.openDialog(Ne,"md",{initialState:{guest:r}}).content.guestChange.pipe(Q(1)).subscribe(p=>{let[_,S]=p;_==="update"?this.selected=Object.assign(this.selected,S):_==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.users.filter(Ue=>Ue.id!==S.id)))})},error:r=>this.layout.sendNotification("error","Guest error",this.selected.fullName,r)})}impersonateIdentity(){this.layout.openDialog(xt,"sm",{initialState:{user:this.selected}})}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(Le),v(Re),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-users"]],viewQuery:function(r,i){if(r&1&&(ne(ke,5),ne(Ie,7),ne(li,7),ne(mi,7)),r&2){let p;oe(p=ae())&&(i.scrollView=p.first),oe(p=ae())&&(i.inputFilter=p.first),oe(p=ae())&&(i.mainContextMenu=p.first),oe(p=ae())&&(i.targetContextMenu=p.first)}},decls:47,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],["draggable","false","l10nTranslate","",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[3,"item"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(r,i){if(r&1){let p=R();n(0,"div",2)(1,"button",3),C(2,"translate"),u("click",function(){return b(p),x(i.loadUsersOrGuests())}),d(3,"fa-icon",4),o(),n(4,"button",3),C(5,"translate"),u("click",function(){return b(p),x(i.openDialog(!0))}),d(6,"fa-icon",5),o(),n(7,"button",6),C(8,"translate"),u("click",function(){return b(p),x(i.openDialog())}),d(9,"fa-icon",5),o(),n(10,"button",6),C(11,"translate"),u("click",function(){return b(p),x(i.impersonateIdentity())}),d(12,"fa-icon",5),o(),n(13,"div",7)(14,"button",8),u("ngModelChange",function(S){return b(p),x(i.onGuestsView(S))}),n(15,"div",9),d(16,"fa-icon",10),n(17,"span",11),s(18,"Guests"),o()()(),n(19,"div",12),d(20,"app-input-filter",13),o()()(),n(21,"table",14)(22,"thead")(23,"tr"),E(24,_i,1,1,null,null,Tt),C(26,"keyvalue"),o()()(),n(27,"app-virtual-scroll",15),C(28,"searchFilter"),u("contextmenu",function(S){return b(p),x(i.onContextMenu(S))}),n(29,"table",14)(30,"tbody",16),E(31,Vi,4,7,"tr",17,pi),o()()(),n(33,"div",18)(34,"span",19),s(35),C(36,"translate"),o()(),n(37,"context-menu",null,0),f(39,Pi,3,2,"ng-template",20),u("execute",function(){return b(p),x(i.openDialog(!0))}),f(40,Mi,0,0,"ng-template",21)(41,Gi,3,1,"ng-template",20),u("execute",function(){return b(p),x(i.loadUsersOrGuests())}),o(),n(42,"context-menu",null,1),f(44,Ri,3,2,"ng-template",20),u("execute",function(){return b(p),x(i.openDialog())}),f(45,Li,0,0,"ng-template",21)(46,Oi,3,1,"ng-template",20),u("execute",function(){return b(p),x(i.impersonateIdentity())}),o()}r&2&&(a(),m("tooltip",U(2,19,"Refresh",i.locale.language)),a(2),m("icon",i.icons.faRotate)("animation",i.loading?"spin":null),a(),m("tooltip",U(5,22,i.guestsView?"New guest":"New user",i.locale.language)),a(2),m("icon",i.icons.faUserPlus),a(),m("disabled",!i.selected)("tooltip",U(8,25,i.guestsView?"Edit guest":"Edit user",i.locale.language)),a(2),m("icon",i.icons.faUserPen),a(),m("disabled",!i.selected)("tooltip",U(11,28,"Impersonate identity",i.locale.language)),a(2),m("icon",i.icons.faUserSecret),a(2),m("ngModel",i.guestsView),a(2),m("icon",i.guestsView?i.icons.faToggleOn:i.icons.faToggleOff),a(8),F(U(26,31,i.tableHeaders,i.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",U(28,34,i.users,i.inputFilter.search())),a(4),F(i.scrollView==null?null:i.scrollView.viewPortItems),a(4),L("",i.users.length," ",U(36,37,i.guestsView?"guests":"users",i.locale.language),""),a(5),m("divider",!0),a(5),m("divider",!0))},dependencies:[P,Z,Ie,je,Ge,V,ke,_t,Ce,ee,ct,pt,mt,ut,Be,O,Oe,gt],encapsulation:2})}}return t})();export{wo as AdminUsersComponent};
|
|
1
|
+
import{a as ht}from"./chunk-7RNZNYVF.js";import{a as Ct,b as G,c as bt}from"./chunk-BS5LXHXU.js";import{a as q,b as Fe,c as ot,e as te}from"./chunk-SZKZH4MJ.js";import{a as vt}from"./chunk-J5O3CY2H.js";import{d as Ce}from"./chunk-HNWPHW2W.js";import"./chunk-JXZCNFW7.js";import{a as gt}from"./chunk-GSVMWC5N.js";import{a as ee,b as he,c as ve,d as be,f as Se,i as ye}from"./chunk-ZYB4TLJM.js";import{a as Ie,b as ke,c as _t,d as ft}from"./chunk-NSXFB3SX.js";import{a as H,b as xe}from"./chunk-3BKYCF53.js";import"./chunk-CPHC7U34.js";import{f as dt,g as ut}from"./chunk-X6UFHF4Q.js";import{Cb as mt,Db as pt,Eb as ct,J as it,K as z,M as nt,Q as ge,Sb as M,gb as at,v as je,xb as rt,yb as st,zb as lt}from"./chunk-7FVU676A.js";import{b as Re,d as Le}from"./chunk-UGSGMP2I.js";import{Ad as Z,Bb as R,Bd as V,Dc as le,Dd as P,Eb as u,Ec as Ge,Fb as c,Ff as et,Gf as tt,L as Q,Ma as K,Mb as ne,Nb as oe,Nf as fe,Ob as ae,Oe as Xe,Qb as s,Qd as qe,Rb as h,Sa as a,Sb as T,Tb as L,Te as _e,Xa as v,Xc as J,Yc as me,_c as D,_d as He,ab as I,ad as O,bc as C,bd as B,cc as y,cd as X,db as se,dc as U,eb as Pe,ed as w,fb as f,fd as Oe,fe as Qe,jd as $,kd as Y,lb as m,ld as pe,mb as De,md as ce,nb as A,nd as de,ne as ze,ob as Ee,oe as Ke,pa as b,pb as k,pf as Ye,qa as x,qb as Me,rb as g,re as ue,sb as W,sd as Be,tb as E,td as j,ub as F,ud as N,vb as n,ve as We,wa as re,wb as o,wd as $e,wf as Ze,xb as d,xe as Je}from"./chunk-FPEGN42P.js";import"./chunk-GAL4ENT6.js";function At(t,l){if(t&1&&(d(0,"fa-icon",42),n(1,"span"),s(2),o()),t&2){let e=c();m("icon",e.icons.faPen),a(2),h(e.guest.fullName)}}function Ut(t,l){if(t&1&&(d(0,"fa-icon",42),n(1,"span",43),s(2,"New guest"),o()),t&2){let e=c();m("icon",e.icons.faPlus)}}function Dt(t,l){if(t&1&&d(0,"fa-icon",2),t&2){let e=c();m("icon",e.icons.faSpinner)}}function Et(t,l){t&1&&(n(0,"h4",3)(1,"span",43),s(2,"Edit guest"),o()())}function Ft(t,l){if(t&1&&(d(0,"fa-icon",44),n(1,"span",45),s(2,"Account"),o()),t&2){let e=c();m("icon",e.icons.faAddressCard)}}function It(t,l){if(t&1&&d(0,"app-password-strength-bar",22),t&2){let e=c();m("passwordToCheck",e.guestForm.value.password)}}function kt(t,l){if(t&1&&(n(0,"option",26),s(1),o()),t&2){let e=l.$implicit;m("ngValue",e),a(),h(e)}}function Nt(t,l){if(t&1&&(n(0,"option",34),s(1),o()),t&2){let e=l.$implicit,r=c();m("ngValue",r.allNotifications.indexOf(e)),a(),h(e)}}function Vt(t,l){if(t&1&&(n(0,"div"),s(1),C(2,"amDateFormat"),o(),n(3,"div"),s(4),C(5,"amDateFormat"),o()),t&2){let e=c(2);a(),L("",y(2,4,e.guest.currentAccess)," - ",e.guest.currentIp,""),a(3),L("",y(5,6,e.guest.lastAccess)," - ",e.guest.lastIp,"")}}function Pt(t,l){t&1&&(n(0,"span",37),s(1,"never"),o())}function Mt(t,l){if(t&1&&(n(0,"div",11)(1,"div",12)(2,"label",46),s(3,"Creation date"),o(),n(4,"div",47),s(5),C(6,"amDateFormat"),o()(),n(7,"div",48)(8,"label",49),s(9,"Last accesses"),o(),n(10,"div",50),f(11,Vt,6,8)(12,Pt,2,0,"span",37),o()()()),t&2){let e=c();a(5),h(y(6,2,e.guest.createdAt)),a(6),g(e.guest.lastAccess?11:12)}}function Gt(t,l){if(t&1&&(d(0,"fa-icon",44),n(1,"span",51),s(2,"Managers"),o(),n(3,"span"),s(4),o()),t&2){let e=c();m("icon",e.icons.faUsersGear),a(4),T("(",e.guestForm.value.managers.length||0,")")}}function Rt(t,l){t&1&&(n(0,"small",37),s(1,"At least one manager is required"),o())}function Lt(t,l){if(t&1){let e=R();n(0,"button",52),u("click",function(){b(e);let i=c();return x(i.confirmDeletion=!0)}),s(1," Remove "),o()}if(t&2){let e=c();m("disabled",e.confirmDeletion)}}var Ne=(()=>{class t extends ht{constructor(e,r,i,p){super(e,r,i),this.adminService=p}searchMembers(e){let r={search:e,ignoreUserIds:this.guestForm.value.managers.map(i=>i.id),usersRole:z.USER,onlyUsers:!0};return this.adminService.searchMembers(r)}onSubmit(){if(this.submitted=!0,this.confirmDeletion)this.adminService.deleteUser(this.guest.id,null,!0).subscribe({next:()=>{this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest deleted",this.guest.login),this.layout.closeDialog()},error:e=>this.onError(e)});else if(!this.guest)this.adminService.createUser(this.makeDto(!0),!0).subscribe({next:e=>{this.guestChange.emit(["add",e]),this.layout.sendNotification("success","Guest created",this.guestForm.value.login),this.layout.closeDialog()},error:e=>this.onError(e)});else{let e=this.makeDto();if(!Object.keys(e).length){this.loading=!1,this.submitted=!1;return}this.adminService.updateUser(this.guest.id,e,!0).subscribe({next:r=>{r?this.guestChange.emit(["update",r]):this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest updated",this.guestForm.value.login),this.layout.closeDialog()},error:r=>this.onError(r)})}}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(dt),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-guest-dialog"]],features:[Pe],decls:70,vars:40,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[1,"d-flex","flex-column","col-6","pe-4"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],["l10nTranslate","",1,"text-danger"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],["l10nTranslate",""],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),f(2,At,3,2)(3,Ut,3,1)(4,Dt,1,1,"fa-icon",2),o(),f(5,Et,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.layout.closeDialog()}),o()(),n(7,"div",5)(8,"tabset",6),d(9,"hr",7),n(10,"tab",8),u("selectTab",function(){return i.tabView=null}),f(11,Ft,3,1,"ng-template",9),n(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),s(16,"Login"),o(),d(17,"input",14),o(),n(18,"div",15)(19,"label",16),s(20,"Email"),o(),d(21,"input",17),o()(),n(22,"div",11)(23,"div",12)(24,"label",18),s(25,"First name"),o(),d(26,"input",19),o(),n(27,"div",15)(28,"label",20),s(29,"Last name"),o(),d(30,"input",21),o()(),n(31,"div",11)(32,"div",12),f(33,It,1,1,"app-password-strength-bar",22),n(34,"app-input-password",23),u("passwordChange",function(_){return i.updatePassword(_)}),o()(),n(35,"div",15)(36,"label",24),s(37,"Language"),o(),n(38,"select",25),E(39,kt,2,2,"option",26,W),o()()(),n(41,"div",11)(42,"div",27)(43,"label",28),s(44,"Account status"),o(),n(45,"div",29)(46,"label",30),d(47,"input",31),n(48,"span"),s(49),C(50,"translate"),C(51,"titlecase"),o()()()(),n(52,"div",15)(53,"label",32),s(54,"Notification"),o(),n(55,"select",33),E(56,Nt,2,2,"option",34,W),o()()(),f(58,Mt,13,4,"div",11),o()(),n(59,"tab",35),u("selectTab",function(){return i.tabView="managers"}),f(60,Gt,5,2,"ng-template",9),n(61,"div",7)(62,"app-user-search",36),u("membersChange",function(_){return i.updateManagers(_)}),o(),f(63,Rt,2,0,"small",37),o()()()(),n(64,"div",38),f(65,Lt,2,1,"button",39),n(66,"button",40),u("click",function(){return i.onCancel()}),s(67,"Cancel"),o(),n(68,"button",41),u("click",function(){return i.onSubmit()}),s(69),o()()),r&2&&(a(2),g(i.guest?2:3),a(2),g(i.loading?4:-1),a(),g(i.guest?5:-1),a(),k("btn-close btn-close-white ",i.guest?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.guestForm),a(),m("justified",!0),a(9),A("is-invalid",i.guestForm.controls.login.invalid),m("autoSelect",!1),a(4),A("is-invalid",i.guestForm.controls.email.invalid),a(5),A("is-invalid",i.guestForm.controls.firstName.invalid),a(7),g(i.guestForm.value.password!==i.defaultPassword?33:-1),a(),m("password",i.guestForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),a(5),F(i.languages),a(9),A("text-danger",!i.guestForm.value.isActive),a(),T(" ",y(51,38,U(50,35,i.guestForm.value.isActive?"active":"suspended",i.locale.language))," "),a(7),F(i.allNotifications),a(2),g(i.guest?58:-1),a(4),m("members",i.guestForm.value.managers)("withPermissions",!1)("customPlaceholder","Type to search for managers to add")("searchFunction",i.searchMembers.bind(i)),a(),g(i.guestForm.value.managers.length?-1:63),a(2),g(i.guest!=null&&i.guest.id?65:-1),a(3),k("btn btn-sm ",i.confirmDeletion?"btn-danger":"btn-primary",""),m("disabled",i.guestForm.invalid||i.submitted),a(),T(" ",i.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[P,V,ee,j,ce,de,me,J,pe,O,B,$,Y,H,xe,Se,Z,le,ye,he,ve,be],encapsulation:2})}}return t})();function Bt(t,l){t&1&&(n(0,"h4",3)(1,"span",13),s(2,"Impersonate identity"),o()())}var xt=(()=>{class t{constructor(e,r,i){this.locale=e,this.layout=r,this.adminService=i,this.submitted=!1,this.icons={faUserSecret:_e},this.passwordMinLength=8,this.impersonateUserForm=new X({password:new w("",D.required)})}onSubmit(){this.submitted=!0,this.adminService.impersonateUser(this.user.id,{password:this.impersonateUserForm.value.password}).subscribe({next:e=>{this.layout.closeDialog(),setTimeout(()=>this.adminService.initImpersonateUser(e),500)},error:e=>{this.submitted=!1,this.layout.sendNotification("error","Impersonate identity",this.user.login,e)}})}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-impersonate-user-dialog"]],inputs:{user:"user"},decls:19,vars:16,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],[1,"d-flex","align-items-center","avatar","mb-3"],["alt","",1,"avatar-img",3,"src"],[1,"fw-bold","mx-2"],["id","password","placeholder","Enter your password to confirm",3,"passwordChange","password","passwordMinLength","isRequired","focus"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["l10nTranslate",""]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),n(3,"span"),s(4),o()(),f(5,Bt,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.layout.closeDialog()}),o()(),n(7,"div",5)(8,"div",6),d(9,"img",7),n(10,"span",8),s(11),C(12,"capitalize"),o()(),n(13,"app-input-password",9),u("passwordChange",function(_){return i.impersonateUserForm.controls.password.setValue(_)}),o()(),n(14,"div",10)(15,"button",11),u("click",function(){return i.layout.closeDialog()}),s(16,"Cancel"),o(),n(17,"button",12),u("click",function(){return i.onSubmit()}),s(18," Confirm "),o()()),r&2&&(a(2),m("icon",i.icons.faUserSecret),a(2),h(i.user.fullName),a(),g(i.user?5:-1),a(),k("btn-close btn-close-white ",i.user?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.impersonateUserForm),a(2),m("src",i.user.avatarUrl,K),a(2),h(y(12,14,i.user.login)),a(2),m("password",i.impersonateUserForm.value.password)("passwordMinLength",i.passwordMinLength)("isRequired",!0)("focus",!0),a(4),m("disabled",i.impersonateUserForm.invalid||i.submitted))},dependencies:[P,V,j,B,$,te,H],encapsulation:2})}}return t})();var St=(()=>{class t{constructor(e){this.translate=e}transform(e,r=!1,i=null,p=", "){return e.length?(i?e.map(S=>S[i]):e.concat()).sort().map(S=>new te().transform(r?this.translate.translate(S):S)).join(p):""}static{this.\u0275fac=function(r){return new(r||t)(v($e,16))}}static{this.\u0275pipe=se({name:"join",type:t,pure:!0})}}return t})();var yt=(()=>{class t{transform(e,r=","){return e?.length?e.split(r):[]}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275pipe=se({name:"split",type:t,pure:!0})}}return t})();function $t(t,l){t&1&&(n(0,"h4",3)(1,"span",9),s(2,"Delete user"),o()())}var wt=(()=>{class t{constructor(e,r,i){this.locale=e,this.layout=r,this.adminService=i,this.wasDeleted=new re,this.submitted=!1,this.icons={faUserMinus:Ke},this.deleteUserForm=new X({adminPassword:new w("",D.required),deleteSpace:new w(!1)})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.adminService.deleteUser(this.user.id,{adminPassword:this.deleteUserForm.value.adminPassword,deleteSpace:this.deleteUserForm.value.deleteSpace}).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success","Delete user",this.user.login),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error","Delete user",this.user.login,e)}})}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-user-delete-dialog"]],inputs:{user:"user"},outputs:{wasDeleted:"wasDeleted"},decls:27,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],[1,"d-flex","align-items-center","avatar","mb-3"],["alt","",1,"avatar-img",3,"src"],[1,"fw-bold","mx-2"],["l10nTranslate",""],["id","password","placeholder","Enter your password to confirm",3,"passwordChange","password","isRequired","focus"],[1,"form-check","form-check-inline","mt-3"],[1,"d-flex"],["for","deleteSpace",1,"form-check-label"],["formControlName","deleteSpace","id","deleteSpace","type","checkbox",1,"form-check-input"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),n(3,"span"),s(4),o()(),f(5,$t,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.onClose()}),o()(),n(7,"div",5)(8,"div",6),d(9,"img",7),n(10,"span",8),s(11),C(12,"capitalize"),o(),n(13,"span",9),s(14,"will be permanently removed"),o()(),n(15,"app-input-password",10),u("passwordChange",function(_){return i.deleteUserForm.controls.adminPassword.setValue(_)}),o(),n(16,"div",11)(17,"div",12)(18,"label",13),d(19,"input",14),n(20,"span",9),s(21,"Delete all user files"),o()()()()(),n(22,"div",15)(23,"button",16),u("click",function(){return i.onClose()}),s(24,"Cancel"),o(),n(25,"button",17),u("click",function(){return i.onSubmit()}),s(26," Confirm "),o()()),r&2&&(a(2),m("icon",i.icons.faUserMinus),a(2),h(i.user.fullName),a(),g(i.user?5:-1),a(),k("btn-close btn-close-white ",i.user?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.deleteUserForm),a(2),m("src",i.user.avatarUrl,K),a(2),h(y(12,13,i.user.login)),a(4),m("password",i.deleteUserForm.value.adminPassword)("isRequired",!0)("focus",!0),a(10),m("disabled",i.deleteUserForm.invalid||i.submitted))},dependencies:[P,V,j,J,O,B,$,Y,te,H],encapsulation:2})}}return t})();var jt=(t,l)=>l.id;function qt(t,l){if(t&1&&(d(0,"fa-icon",47),n(1,"span"),s(2),o()),t&2){let e=c();m("icon",e.icons.faUserPen),a(2),h(e.user.fullName)}}function Ht(t,l){if(t&1&&(d(0,"fa-icon",47),n(1,"span",40),s(2,"New user"),o()),t&2){let e=c();m("icon",e.icons.faUserPlus)}}function Qt(t,l){if(t&1&&d(0,"fa-icon",2),t&2){let e=c();m("icon",e.icons.faSpinner)}}function zt(t,l){t&1&&(n(0,"h4",3)(1,"span",40),s(2,"Edit user"),o()())}function Kt(t,l){if(t&1&&(d(0,"fa-icon",48),n(1,"span",49),s(2,"Account"),o()),t&2){let e=c();m("icon",e.icons.faAddressCard)}}function Wt(t,l){if(t&1&&d(0,"app-password-strength-bar",22),t&2){let e=c();m("passwordToCheck",e.userForm.value.password)}}function Jt(t,l){if(t&1&&(n(0,"option",26),s(1),o()),t&2){let e=l.$implicit;m("ngValue",e),a(),h(e)}}function Xt(t,l){if(t&1&&(n(0,"option",30),s(1),o()),t&2){let e=l.$implicit,r=c();m("ngValue",r.allNotifications.indexOf(e)),a(),h(e)}}function Yt(t,l){if(t&1&&(n(0,"div",11)(1,"div",12)(2,"label",50),s(3,"Storage Usage"),o(),d(4,"app-storage-usage",51),o(),d(5,"div",15),o()),t&2){let e=c();a(4),m("item",e.user)}}function Zt(t,l){if(t&1&&(n(0,"div"),s(1),C(2,"amDateFormat"),o(),n(3,"div"),s(4),C(5,"amDateFormat"),o()),t&2){let e=c(2);a(),L("",y(2,4,e.user.currentAccess)," - ",e.user.currentIp,""),a(3),L("",y(5,6,e.user.lastAccess)," - ",e.user.lastIp,"")}}function ei(t,l){t&1&&(n(0,"span",57),s(1,"never"),o())}function ti(t,l){if(t&1&&(n(0,"div",11)(1,"div",12)(2,"label",52),s(3,"Creation date"),o(),n(4,"div",53),s(5),C(6,"amDateFormat"),o()(),n(7,"div",54)(8,"label",55),s(9,"Last accesses"),o(),n(10,"div",56),f(11,Zt,6,8)(12,ei,2,0,"span",57),o()()()),t&2){let e=c();a(5),h(y(6,2,e.user.createdAt)),a(6),g(e.user.lastAccess?11:12)}}function ii(t,l){if(t&1&&(d(0,"fa-icon",48),n(1,"span",49),s(2,"Permissions"),o()),t&2){let e=c();m("icon",e.icons.faShieldHalved)}}function ni(t,l){if(t&1&&(n(0,"div",60)(1,"div",61),d(2,"fa-icon",62),n(3,"span"),s(4),o()(),n(5,"div",63),s(6),C(7,"split"),C(8,"join"),o()()),t&2){let e=c().$implicit,r=c(2);a(2),m("icon",r.icons.GROUPS),a(2),h(e.name),a(2),h(U(8,5,y(7,3,e.permissions),!0))}}function oi(t,l){if(t&1&&f(0,ni,9,8,"div",60),t&2){let e=l.$implicit;g(e.permissions?0:-1)}}function ai(t,l){if(t&1&&(n(0,"div",32)(1,"label",58),s(2,"Permissions inherited from groups"),o(),n(3,"div",59),E(4,oi,1,1,null,null,jt),o()()),t&2){let e=c();a(4),F(e.userForm.value.groups)}}function ri(t,l){if(t&1&&(d(0,"fa-icon",48),n(1,"span",64),s(2,"Groups"),o(),n(3,"span"),s(4),o()),t&2){let e=c();m("icon",e.icons.faUsers),a(4),T("(",e.userForm.value.groups.length||0,")")}}function si(t,l){if(t&1){let e=R();n(0,"button",65),u("click",function(){b(e);let i=c();return x(i.confirmDeletion=!0)}),s(1," Remove "),o()}if(t&2){let e=c();m("disabled",e.confirmDeletion)}}var Ve=(()=>{class t{constructor(e,r,i){this.locale=e,this.layout=r,this.adminService=i,this.user=null,this.userChange=new re,this.submitted=!1,this.loading=!1,this.confirmDeletion=!1,this.icons={GROUPS:rt.GROUPS,faUserPlus:fe,faUserPen:ue,faSpinner:tt,faAddressCard:We,faUsers:He,faShieldHalved:Je},this.allNotifications=Object.values(ge),this.defaultPassword=this.layout.translateString(st),this.languages=this.layout.getLanguages(!0)}ngOnInit(){this.userForm=new X({login:new w(this.user?.login||"",[D.required,D.pattern(it)]),email:new w(this.user?.email||"",[D.required,D.maxLength(255),D.email]),firstName:new w(this.user?.firstName||"",[D.required,D.maxLength(255)]),lastName:new w(this.user?.lastName||"",D.maxLength(255)),password:new w(this.user?this.defaultPassword:"",D.maxLength(255)),language:new w(this.user?.language||null),notification:new w(this.user?.notification||Object.values(ge).indexOf(ge.APPLICATION_EMAIL)),isActive:new w(this.user?this.user.isActive:!0),isAdmin:new w(this.user?this.user.isAdmin:!1),storageQuota:new w(this.user?.storageQuota||null),groups:new w(this.user?.groups||[]),applications:new w(this.user?.applications||[])})}searchMembers(e){let r={search:e,onlyGroups:!0,excludePersonalGroups:!0,withPermissions:!0,ignoreGroupIds:this.userForm.value.groups.map(i=>i.id)};return this.adminService.searchMembers(r)}updateApplications(e){this.userForm.controls.applications.setValue(e),this.userForm.controls.applications.markAsDirty()}updatePassword(e){this.userForm.controls.password.setValue(e),this.userForm.controls.password.markAsDirty()}updateMembers(e){this.userForm.controls.groups.setValue(e),this.userForm.controls.groups.markAsDirty()}updateQuota(e){this.userForm.controls.storageQuota.setValue(e),this.userForm.controls.storageQuota.markAsDirty()}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.confirmDeletion?this.layout.openDialog(wt,"sm",{initialState:{user:this.user}}).content.wasDeleted.pipe(Q(1)).subscribe(r=>{r?(this.userChange.emit(["delete",this.user]),this.layout.closeDialog()):(this.confirmDeletion=!1,this.submitted=!1)}):this.user?this.adminService.updateUser(this.user.id,this.makeDto()).subscribe({next:e=>{this.userChange.emit(["update",e]),this.layout.sendNotification("success","User updated",this.userForm.value.login),this.layout.closeDialog()},error:e=>this.onError(e)}):this.adminService.createUser(this.makeDto(!0)).subscribe({next:e=>{this.userChange.emit(["add",e]),this.layout.sendNotification("success","User created",this.userForm.value.login),this.layout.closeDialog()},error:e=>this.onError(e)})}makeDto(e=!1){let r={};if(e)r=this.userForm.value;else for(let i in this.userForm.controls)this.userForm.controls[i].dirty&&(r[i]=this.userForm.controls[i].value);for(let i in r)switch(i){case"language":r[i]=r[i]===lt?null:r[i];break;case"isAdmin":r.role=r[i]?z.ADMINISTRATOR:z.USER;break;case"applications":r.permissions=r[i].join(nt);break;case"groups":r[i]=r[i].map(p=>p.id);break}return r}onError(e){this.layout.sendNotification("error","Group error",this.userForm.value.login,e),this.submitted=!1}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-user-dialog"]],inputs:{user:"user"},outputs:{userChange:"userChange"},decls:82,vars:44,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[3,"quotaChange","quota","fullWidth"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[1,"d-flex","flex-column","col-12","pb-3"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","isAdmin",1,"form-check-label"],["formControlName","isAdmin","id","isAdmin","type","checkbox",1,"form-check-input"],["l10nTranslate",""],[3,"permissionsChange","permissions"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"text-danger"],["for","groups_permissions","l10nTranslate",""],["id","groups_permissions"],[1,"d-flex","align-items-center","mb-1"],[1,"d-flex","align-items-center","me-5"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","fs-xxs","ms-auto"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(r,i){r&1&&(n(0,"div",0)(1,"h4",1),f(2,qt,3,2)(3,Ht,3,1)(4,Qt,1,1,"fa-icon",2),o(),f(5,zt,3,0,"h4",3),n(6,"button",4),u("click",function(){return i.layout.closeDialog()}),o()(),n(7,"div",5)(8,"tabset",6),d(9,"hr",7),n(10,"tab",8),u("selectTab",function(){return i.tabView=null}),f(11,Kt,3,1,"ng-template",9),n(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),s(16,"Login"),o(),d(17,"input",14),o(),n(18,"div",15)(19,"label",16),s(20,"Email"),o(),d(21,"input",17),o()(),n(22,"div",11)(23,"div",12)(24,"label",18),s(25,"First name"),o(),d(26,"input",19),o(),n(27,"div",15)(28,"label",20),s(29,"Last name"),o(),d(30,"input",21),o()(),n(31,"div",11)(32,"div",12),f(33,Wt,1,1,"app-password-strength-bar",22),n(34,"app-input-password",23),u("passwordChange",function(_){return i.updatePassword(_)}),o()(),n(35,"div",15)(36,"label",24),s(37,"Language"),o(),n(38,"select",25),E(39,Jt,2,2,"option",26,W),o()()(),n(41,"div",11)(42,"div",12)(43,"app-storage-quota",27),u("quotaChange",function(_){return i.updateQuota(_)}),o()(),n(44,"div",15)(45,"label",28),s(46,"Notification"),o(),n(47,"select",29),E(48,Xt,2,2,"option",30,W),o()()(),f(50,Yt,6,1,"div",11),o(),f(51,ti,13,4,"div",11),o(),n(52,"tab",31),u("selectTab",function(){return i.tabView="permissions"}),f(53,ii,3,1,"ng-template",9),n(54,"div",32)(55,"label",33),s(56,"Account status"),o(),n(57,"div",34)(58,"div",35)(59,"label",36),d(60,"input",37),n(61,"span"),s(62),C(63,"translate"),C(64,"titlecase"),o()()(),n(65,"div",35)(66,"label",38),d(67,"input",39),n(68,"span",40),s(69,"Administrator"),o()()()()(),n(70,"app-admin-permissions",41),u("permissionsChange",function(_){return i.updateApplications(_)}),o(),f(71,ai,6,0,"div",32),o(),n(72,"tab",31),u("selectTab",function(){return i.tabView="groups"}),f(73,ri,5,2,"ng-template",9),n(74,"div",7)(75,"app-user-search",42),u("membersChange",function(_){return i.updateMembers(_)}),o()()()()(),n(76,"div",43),f(77,si,2,1,"button",44),n(78,"button",45),u("click",function(){return i.onCancel()}),s(79,"Cancel"),o(),n(80,"button",46),u("click",function(){return i.onSubmit()}),s(81),o()()),r&2&&(a(2),g(i.user?2:3),a(2),g(i.loading?4:-1),a(),g(i.user?5:-1),a(),k("btn-close btn-close-white ",i.user?"ms-2":"ms-auto"," ms-2"),a(),m("formGroup",i.userForm),a(),m("justified",!0),a(9),A("is-invalid",i.userForm.controls.login.invalid),m("autoSelect",!1),a(4),A("is-invalid",i.userForm.controls.email.invalid),a(5),A("is-invalid",i.userForm.controls.firstName.invalid),a(7),g(i.userForm.value.password!==i.defaultPassword?33:-1),a(),m("password",i.userForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),a(5),F(i.languages),a(4),m("quota",i.userForm.value.storageQuota)("fullWidth",!0),a(5),F(i.allNotifications),a(2),g(i.user&&i.user.storageUsage?50:-1),a(),g(i.user?51:-1),a(10),A("text-danger",!i.userForm.value.isActive),a(),T(" ",y(64,42,U(63,39,i.userForm.value.isActive?"active":"suspended",i.locale.language))," "),a(8),m("permissions",i.userForm.value.applications),a(),g(i.userForm.value.groups.length?71:-1),a(4),m("members",i.userForm.value.groups)("withPermissions",!1)("customPlaceholder","Type to search for groups to add")("searchFunction",i.searchMembers.bind(i)),a(2),g(i.user!=null&&i.user.id?77:-1),a(3),k("btn btn-sm ",i.confirmDeletion?"btn-danger":"btn-primary",""),m("disabled",i.userForm.invalid||i.submitted),a(),T(" ",i.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[P,V,ve,be,he,j,ce,de,me,J,pe,O,B,$,Y,H,xe,le,Z,Ce,vt,yt,St,ye,Se,bt,ee],encapsulation:2})}}return t})();var li=["MainContextMenu"],mi=["TargetContextMenu"],Tt=(t,l)=>l.key,pi=(t,l)=>l.id,ci=(t,l)=>l.mid;function di(t,l){if(t&1&&d(0,"fa-icon",24),t&2){let e=c(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function ui(t,l){if(t&1){let e=R();n(0,"th",23),u("click",function(){b(e);let i=c().$implicit,p=c();return x(p.sortBy(i.key))}),s(1),f(2,di,1,2,"fa-icon",24),o()}if(t&2){let e=c().$implicit,r=c();Ee(e.value.class),De("width",e.value.width,"%"),A("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),T(" ",e.value.label," "),a(),g(r.sortTable.sortParam.column===e.key?2:-1)}}function _i(t,l){if(t&1&&f(0,ui,3,11,"th",22),t&2){let e=l.$implicit;g(e.value.show?0:-1)}}function fi(t,l){if(t&1&&d(0,"fa-icon",32),t&2){let e=c(5);m("icon",e.icons.faKey)}}function gi(t,l){if(t&1&&(n(0,"div",27),d(1,"img",30),n(2,"div",28)(3,"span",31),s(4),f(5,fi,1,1,"fa-icon",32),o(),n(6,"span",33),s(7),o()()()),t&2){let e=c(3).$implicit;a(),m("src",e.avatarUrl,K),a(3),T(" ",e.login," "),a(),g(e.isAdmin?5:-1),a(2),h(e.email)}}function Ci(t,l){if(t&1&&(n(0,"span",34),s(1),o()),t&2){let e=c(4).$implicit;a(),h(e.userRoleText)}}function hi(t,l){if(t&1&&(n(0,"div",28)(1,"span",31),s(2),o(),f(3,Ci,2,1,"span",34),o()),t&2){let e=c(3).$implicit;a(2),h(e.fullName),a(),g(e.isAdmin?3:-1)}}function vi(t,l){if(t&1&&d(0,"app-user-avatar",35),t&2){let e=l.$implicit;m("user",e)("isMember",!0)}}function bi(t,l){if(t&1&&E(0,vi,1,2,"app-user-avatar",35,ci),t&2){let e=c(3).$implicit;F(e.managers)}}function xi(t,l){if(t&1&&d(0,"app-storage-usage",36),t&2){let e=c(4).$implicit;m("item",e)}}function Si(t,l){if(t&1&&f(0,xi,1,1,"app-storage-usage",36),t&2){let e=c(3).$implicit;g(e.storageUsage?0:-1)}}function yi(t,l){if(t&1&&(n(0,"div",28)(1,"div"),s(2),o(),n(3,"div"),s(4),o()()),t&2){let e=c(3).$implicit;a(2),h(e.currentIp),a(2),h(e.lastIp)}}function wi(t,l){t&1&&s(0," too many login attempts ")}function Ti(t,l){if(t&1&&s(0),t&2){let e=c(4).$implicit;T(" ",e.userIsActiveText," ")}}function Ai(t,l){if(t&1&&(n(0,"span",11),f(1,wi,1,0)(2,Ti,1,1),o()),t&2){let e=c(3).$implicit;Ee(e.isActive?"text-success":"text-danger"),a(),g(!e.isActive&&e.passwordAttempts?1:2)}}function Ui(t,l){if(t&1&&(n(0,"div",28)(1,"div"),s(2),C(3,"amDateFormat"),o(),n(4,"div"),s(5),C(6,"amDateFormat"),o()()),t&2){let e=c(5).$implicit;a(2),h(y(3,2,e.currentAccess)),a(3),h(y(6,4,e.lastAccess))}}function Di(t,l){if(t&1&&s(0),t&2){let e=c(5).$implicit;T(" ",e.hTimeAgo," ")}}function Ei(t,l){if(t&1){let e=R();n(0,"div",38),u("mouseover",function(){b(e);let i=c(4).$implicit;return x(i.currentAccessHover=!0)})("focus",function(){b(e);let i=c(4).$implicit;return x(i.currentAccessHover=!0)})("mouseleave",function(){b(e);let i=c(4).$implicit;return x(i.currentAccessHover=!1)}),f(1,Ui,7,6,"div",28)(2,Di,1,1),o()}if(t&2){let e=c(4).$implicit;a(),g(e.currentAccessHover?1:2)}}function Fi(t,l){t&1&&(n(0,"span",11),s(1,"never"),o())}function Ii(t,l){if(t&1&&f(0,Ei,3,1,"div",37)(1,Fi,2,0,"span",11),t&2){let e=c(3).$implicit;g(e.currentAccess?0:1)}}function ki(t,l){if(t&1&&(n(0,"td"),f(1,gi,8,4,"div",27)(2,hi,4,2,"div",28)(3,bi,2,0)(4,Si,1,1)(5,yi,5,2,"div",28)(6,Ai,3,4,"span",29)(7,Ii,2,1),o()),t&2){let e,r=c().$implicit,i=c().$implicit;Me("",r.value.class," ",r.value.newly?"prop-newly-"+i[r.value.newly]:"",""),De("width",r.value.width,"%"),A("text-align-center",r.value.textCenter),a(),g((e=r.key)==="login"?1:e==="fullName"?2:e==="managers"?3:e==="storage"?4:e==="currentIp"?5:e==="isActive"?6:e==="currentAccess"?7:-1)}}function Ni(t,l){if(t&1&&f(0,ki,8,9,"td",26),t&2){let e=l.$implicit;g(e.value.show?0:-1)}}function Vi(t,l){if(t&1){let e=R();n(0,"tr",25),u("click",function(){let i=b(e).$implicit,p=c();return x(p.onSelect(i))})("contextmenu",function(i){let p=b(e).$implicit,_=c();return x(_.onTargetContextMenu(i,p))})("pressup",function(i){let p=b(e).$implicit,_=c();return x(_.onTargetContextMenu(i,p))})("tap",function(){b(e);let i=c();return x(i.openDialog())}),E(1,Ni,1,1,null,null,Tt),C(3,"keyvalue"),o()}if(t&2){let e=l.$implicit,r=c();A("disabled",!e.isActive)("selected",e.id===(r.selected==null?null:r.selected.id)),a(),F(U(3,4,r.tableHeaders,r.originalOrderKeyValue))}}function Pi(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2),o()),t&2){let e=c();a(),m("icon",e.icons.faUserPlus),a(),T("New ",e.guestsView?"guest":"user","")}}function Mi(t,l){}function Gi(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2,"Refresh"),o()),t&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function Ri(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2),o()),t&2){let e=c();a(),m("icon",e.icons.faUserPen),a(),T("Edit ",e.guestsView?"guest":"user","")}}function Li(t,l){}function Oi(t,l){if(t&1&&(n(0,"span",11),d(1,"fa-icon",5),s(2,"Impersonate identity"),o()),t&2){let e=c();a(),m("icon",e.icons.faUserSecret)}}var wo=(()=>{class t{constructor(e,r,i,p,_){this.locale=e,this.router=r,this.activatedRoute=i,this.layout=p,this.adminService=_,this.originalOrderKeyValue=at,this.icons={faRotate:et,faUserPlus:fe,faUserPen:ue,faArrowDown:Ye,faArrowUp:Ze,faKey:Qe,faUserSecret:_e,faArrowRotateRight:Xe,faToggleOn:ze,faToggleOff:qe},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!1,sortable:!0},storage:{label:"Storage Space",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentIp:{label:"IP",width:10,textCenter:!1,class:"d-none d-lg-table-cell",show:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new ft(this.constructor.name,this.sortSettings),this.guestsView=!1,this.loading=!1,this.selected=null,this.users=[],this.layout.setBreadcrumbIcon(ot.USERS),this.activatedRoute.data.subscribe(S=>{this.guestsView=S.type===z.GUEST,this.setEnv()})}setEnv(){this.tableHeaders.managers.show=this.guestsView,this.tableHeaders.storage.show=!this.guestsView,this.loadUsersOrGuests(),this.layout.setBreadcrumbNav({url:this.guestsView?`/${q.BASE}/${q.GUESTS}/${Fe.GUESTS}`:`/${q.BASE}/${q.USERS}/${Fe.USERS}`,splicing:2,translating:!0,sameLink:!0})}loadUsersOrGuests(){this.loading=!0,this.onSelect(),this.adminService.listUsers(this.guestsView).subscribe({next:e=>{this.sortBy(this.sortTable.sortParam.column,!1,e),this.scrollView.scrollInto(-1),this.loading=!1},error:e=>{this.users=[],this.layout.sendNotification("error",this.guestsView?"Guests":"Users","Unable to load",e),this.loading=!1}})}onSelect(e=null){this.selected=e}onGuestsView(e){this.guestsView=e,this.router.navigate([q.BASE,e?q.GUESTS:q.USERS]).catch(r=>console.error(r))}onContextMenu(e){e.preventDefault(),e.stopPropagation(),this.layout.openContextMenu(e,this.mainContextMenu)}onTargetContextMenu(e,r){e.preventDefault(),e.type==="contextmenu"&&e.stopPropagation(),this.onSelect(r),this.layout.openContextMenu(e,this.targetContextMenu)}sortBy(e,r=!0,i){this.users=this.sortTable.sortBy(e,r,i||this.users)}openDialog(e=!1){this.guestsView?this.openGuestDialog(e):this.openUserDialog(e)}openUserDialog(e=!1){e?this.layout.openDialog(Ve,"md").content.userChange.pipe(Q(1)).subscribe(i=>{let[p,_]=i;p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.users,_]),this.onSelect(_))}):this.adminService.getUser(this.selected.id).subscribe({next:r=>{this.layout.openDialog(Ve,"md",{initialState:{user:r}}).content.userChange.pipe(Q(1)).subscribe(p=>{let[_,S]=p;_==="update"?this.selected=Object.assign(this.selected,S):_==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.users.filter(Ue=>Ue.id!==S.id)))})},error:r=>this.layout.sendNotification("error","Edit group",this.selected.login,r)})}openGuestDialog(e=!1){e?this.layout.openDialog(Ne,"md").content.guestChange.pipe(Q(1)).subscribe(i=>{let[p,_]=i,S=new Ct(_);p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.users,S]),this.onSelect(S))}):this.adminService.getUser(this.selected.id,!0).subscribe({next:r=>{this.layout.openDialog(Ne,"md",{initialState:{guest:r}}).content.guestChange.pipe(Q(1)).subscribe(p=>{let[_,S]=p;_==="update"?this.selected=Object.assign(this.selected,S):_==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.users.filter(Ue=>Ue.id!==S.id)))})},error:r=>this.layout.sendNotification("error","Guest error",this.selected.fullName,r)})}impersonateIdentity(){this.layout.openDialog(xt,"sm",{initialState:{user:this.selected}})}static{this.\u0275fac=function(r){return new(r||t)(v(N),v(Le),v(Re),v(M),v(G))}}static{this.\u0275cmp=I({type:t,selectors:[["app-admin-users"]],viewQuery:function(r,i){if(r&1&&(ne(ke,5),ne(Ie,7),ne(li,7),ne(mi,7)),r&2){let p;oe(p=ae())&&(i.scrollView=p.first),oe(p=ae())&&(i.inputFilter=p.first),oe(p=ae())&&(i.mainContextMenu=p.first),oe(p=ae())&&(i.targetContextMenu=p.first)}},decls:47,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],["draggable","false","l10nTranslate","",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[3,"item"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(r,i){if(r&1){let p=R();n(0,"div",2)(1,"button",3),C(2,"translate"),u("click",function(){return b(p),x(i.loadUsersOrGuests())}),d(3,"fa-icon",4),o(),n(4,"button",3),C(5,"translate"),u("click",function(){return b(p),x(i.openDialog(!0))}),d(6,"fa-icon",5),o(),n(7,"button",6),C(8,"translate"),u("click",function(){return b(p),x(i.openDialog())}),d(9,"fa-icon",5),o(),n(10,"button",6),C(11,"translate"),u("click",function(){return b(p),x(i.impersonateIdentity())}),d(12,"fa-icon",5),o(),n(13,"div",7)(14,"button",8),u("ngModelChange",function(S){return b(p),x(i.onGuestsView(S))}),n(15,"div",9),d(16,"fa-icon",10),n(17,"span",11),s(18,"Guests"),o()()(),n(19,"div",12),d(20,"app-input-filter",13),o()()(),n(21,"table",14)(22,"thead")(23,"tr"),E(24,_i,1,1,null,null,Tt),C(26,"keyvalue"),o()()(),n(27,"app-virtual-scroll",15),C(28,"searchFilter"),u("contextmenu",function(S){return b(p),x(i.onContextMenu(S))}),n(29,"table",14)(30,"tbody",16),E(31,Vi,4,7,"tr",17,pi),o()()(),n(33,"div",18)(34,"span",19),s(35),C(36,"translate"),o()(),n(37,"context-menu",null,0),f(39,Pi,3,2,"ng-template",20),u("execute",function(){return b(p),x(i.openDialog(!0))}),f(40,Mi,0,0,"ng-template",21)(41,Gi,3,1,"ng-template",20),u("execute",function(){return b(p),x(i.loadUsersOrGuests())}),o(),n(42,"context-menu",null,1),f(44,Ri,3,2,"ng-template",20),u("execute",function(){return b(p),x(i.openDialog())}),f(45,Li,0,0,"ng-template",21)(46,Oi,3,1,"ng-template",20),u("execute",function(){return b(p),x(i.impersonateIdentity())}),o()}r&2&&(a(),m("tooltip",U(2,19,"Refresh",i.locale.language)),a(2),m("icon",i.icons.faRotate)("animation",i.loading?"spin":null),a(),m("tooltip",U(5,22,i.guestsView?"New guest":"New user",i.locale.language)),a(2),m("icon",i.icons.faUserPlus),a(),m("disabled",!i.selected)("tooltip",U(8,25,i.guestsView?"Edit guest":"Edit user",i.locale.language)),a(2),m("icon",i.icons.faUserPen),a(),m("disabled",!i.selected)("tooltip",U(11,28,"Impersonate identity",i.locale.language)),a(2),m("icon",i.icons.faUserSecret),a(2),m("ngModel",i.guestsView),a(2),m("icon",i.guestsView?i.icons.faToggleOn:i.icons.faToggleOff),a(8),F(U(26,31,i.tableHeaders,i.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",U(28,34,i.users,i.inputFilter.search())),a(4),F(i.scrollView==null?null:i.scrollView.viewPortItems),a(4),L("",i.users.length," ",U(36,37,i.guestsView?"guests":"users",i.locale.language),""),a(5),m("divider",!0),a(5),m("divider",!0))},dependencies:[P,Z,Ie,je,Ge,V,ke,_t,Ce,ee,ct,pt,mt,ut,Be,O,Oe,gt],encapsulation:2})}}return t})();export{wo as AdminUsersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$a as d,Fa as p,Pa as c,Ub as u,f as l,nb as C,oa as S,pa as o,pb as h,rb as k,sa as M,ta as w,tb as A,ua as r,xa as x,ya as b,za as N}from"./chunk-
|
|
1
|
+
import{$a as d,Fa as p,Pa as c,Ub as u,f as l,nb as C,oa as S,pa as o,pb as h,rb as k,sa as M,ta as w,tb as A,ua as r,xa as x,ya as b,za as N}from"./chunk-7FVU676A.js";import{c as a,d as O,h as E,m as $}from"./chunk-ZZ3LHYOY.js";import{Mc as T,ca as I,ha as _,v as n}from"./chunk-FPEGN42P.js";function R(i){i.file?.id?(i.file.isDir&&(i.file.mime=i.parent?.alias?O:a),i.mimeUrl=E(i.file.mime)):i.mimeUrl=E(i.parent?.alias?O:a)}function H(i){let e,t=i.file.path?i.file.path.split("/").filter(m=>m&&m!=="."):[];if(i.parent?.id){if(!t.length)return[p.SPACES_SHARES,i.parent.alias];e=`${p.SPACES_SHARES}/${i.parent.alias}`}else i.file.space?.alias?i.file.inTrash?e=`${p.SPACES_TRASH}/${i.file.space.alias}`:(e=`${p.SPACES_FILES}/${i.file.space.alias}`,i.file.space?.root?.alias&&(t.length?e=`${e}/${i.file.space.root.alias}`:t.push(i.file.space.root.name))):i.file?.ownerId?e=`${i.file.inTrash?p.PERSONAL_TRASH:p.PERSONAL_FILES}`:console.warn("unable to find the right file path",i);let s=t.pop();return e&&t.length&&(e=`${e}/${t.join("/")}`),[e,s]}var g=class{constructor(e){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,e),R(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=$}updatePermission(){this.hPerms=h(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=(0,l.default)(this.link.currentAccess).fromNow(!0),this.newly=d(this.link.currentAccess),this.link.expiresAt){this.link.expiresAt=new Date((0,l.default)(this.link.expiresAt).local().format("YYYY-MM-DD"));let e=Math.max(0,(0,l.default)(this.link.expiresAt).diff((0,l.default)(),"hours"));e===0?this.hTimeExpirationAgo=0:e<=24?this.hTimeExpirationAgo=1:this.hTimeExpirationAgo=Math.round(e/24)+1}else this.hTimeExpirationAgo=0}};var D=function(i){return i[i.COMMON=0]="COMMON",i[i.LINK=1]="LINK",i}(D||{}),U=Object.values(o).filter(i=>i!==o.SHARE_INSIDE).sort().join(S);var P=class{constructor(e){this.members=[],this.links=[],this.hPerms={},this.setMembers(c("members",e),e.externalPath||e.file?.isDir?[o.SHARE_INSIDE]:[]),Object.assign(this,e),R(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=$}setMembers(e,t){if(e)for(let s of e)s.linkId?this.links.push(new A(s,[...t,o.SHARE_OUTSIDE])):this.members.push(new A(s,t))}checkFile(){this.file&&(!this.file.path&&this.file.space.root?.name&&(this.file.path=this.file.space.root.name,this.file.name=this.file.space.root.name),this.file.permissions&&(this.file.permissions=this.file.permissions.split(S).filter(e=>e===o.SHARE_INSIDE||e===o.ADD&&this.file.id&&!this.file.isDir?!1:!(e===o.DELETE&&this.file.id&&!this.file.isDir)).join(S)))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=h(this.file.permissions):this.externalPath&&(this.hPerms=h(U))}};var f=class{constructor(e){this.roots=[],this.managers=[],this.members=[],this.links=[],this.hPerms={},this.newly=0,this.hPerms=h(e.permissions),this.setMembers(c("members",e)),this.setRoots(c("roots",e)),Object.assign(this,e),this.hTimeAgo=(0,l.default)(this.modifiedAt).fromNow(!0),this.newly=d(this.modifiedAt),this.sort()}addRoot(e,t=!1){e.hPerms=C(e.permissions,[o.SHARE_INSIDE]),e.owner?.login&&(e.owner.avatarUrl=k(e.owner.login)),e.file.mimeUrl=E(e.file?.mime?e.file.mime:a),t?this.roots.unshift(e):this.roots.push(e),e.isDir=e.file.mime===a||!!e.externalPath}havePermission(e){return this.permissions.indexOf(e)>-1}setMembers(e){if(e)for(let t of e){let s=new A(t);s.isLink?this.links.push(s):s.spaceRole===M.IS_MANAGER?this.managers.push(s):this.members.push(s)}}setRoots(e){if(e)for(let t of e)this.addRoot(t)}sort(){u(this.roots,"createdAt",!1),u(this.managers,"createdAt",!1),u(this.members,"createdAt",!1),u(this.links,"createdAt",!1)}};var $e=(()=>{class i{constructor(t){this.http=t}listSpaces(){return this.http.get(x).pipe(n(t=>t.map(s=>new f(s))))}getSpace(t){return this.http.get(`${r.BASE}/${t}`).pipe(n(s=>new f(s)))}getUserSpaceRoots(t){return this.http.get(`${r.BASE}/${t}/${r.ROOTS}`)}createUserSpaceRoots(t,s){return this.http.post(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateUserSpaceRoots(t,s){return this.http.put(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateSpace(t){return this.http.put(`${r.BASE}/${t.id}`,t).pipe(n(s=>s?new f(s):null))}createSpace(t){return this.http.post(r.BASE,t).pipe(n(s=>(s.permissions=w,new f(s))))}deleteSpace(t,s){return this.http.request("delete",`${r.BASE}/${t}`,{body:s})}searchSpaces(t){return this.http.request("search",r.BASE,{body:t})}listSpaceShares(t){return this.http.get(`${r.BASE}/${t}/${r.SHARES}`)}getSpaceShare(t,s){return this.http.get(`${r.BASE}/${t}/${r.SHARES}/${s}`).pipe(n(m=>new P(m)))}updateSpaceShare(t,s){return this.http.put(`${r.BASE}/${t}/${r.SHARES}/${s.id}`,s).pipe(n(m=>new P(m)))}deleteSpaceShare(t,s){return this.http.delete(`${r.BASE}/${t}/${r.SHARES}/${s}`)}getSpaceShareLink(t,s){return this.http.get(`${r.BASE}/${t}/${r.LINKS}/${s}`).pipe(n(m=>new g(m)))}listTrashBins(){return this.http.get(b)}checkSpaceRootPath(t){return this.http.post(N,{path:t})}static{this.\u0275fac=function(s){return new(s||i)(_(T))}}static{this.\u0275prov=I({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{D as a,R as b,H as c,P as d,g as e,f,$e as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Sb as ae,Tb as ce,hb as he}from"./chunk-HDDBV3QQ.js";import{Ad as ne,Ba as j,Bb as I,Dd as re,Df as le,Eb as H,Fb as O,Gb as J,Hb as Y,J as T,Mb as S,N as W,Nb as y,Ob as b,Qa as N,Sa as P,T as k,Wa as Q,X as V,Xa as c,Yc as X,Z as L,ab as w,ad as ee,bc as U,db as Z,dc as G,f as F,fb as $,id as te,lb as R,oa as z,p as B,pa as _,qa as M,qd as ie,rb as q,td as se,ud as oe,vb as C,wa as x,wb as p,xa as A,xb as K,za as v}from"./chunk-FPEGN42P.js";var ue=["iFilter"];function pe(o,r){if(o&1){let t=I();C(0,"span",3)(1,"fa-icon",4),H("click",function(){_(t);let i=O();return M(i.clear())}),p()()}if(o&2){let t=O();P(),R("icon",t.faTimes)}}var Re=(()=>{class o{constructor(t,e){this.locale=t,this.fb=e,this.search=j(""),this.faTimes=le,this.searchControl=this.fb.control(""),this.subscription=this.searchControl.valueChanges.pipe(T(300),W()).subscribe(i=>this.onType(i))}ngOnDestroy(){this.subscription.unsubscribe()}onKeyPress(t){(t.ctrlKey||t.metaKey)&&t.keyCode===70?(t.preventDefault(),t.stopPropagation(),this.iFilter.nativeElement.focus()):t.keyCode===27&&(t.preventDefault(),t.stopPropagation())}clear(){this.searchControl&&(this.searchControl.reset(),this.iFilter.nativeElement.value="")}onType(t){this.search.set(t)}static{this.\u0275fac=function(e){return new(e||o)(c(oe),c(ie))}}static{this.\u0275cmp=w({type:o,selectors:[["app-input-filter"]],viewQuery:function(e,i){if(e&1&&S(ue,7),e&2){let s;y(s=b())&&(i.iFilter=s.first)}},hostBindings:function(e,i){e&1&&H("keydown",function(h){return i.onKeyPress(h)},!1,N)},decls:5,vars:6,consts:[["iFilter",""],[1,"btn-group",2,"height","30px","max-width","150px"],["type","text",1,"form-control","form-control-sm",2,"padding-right","24px",3,"keyup.escape","placeholder","formControl"],[1,"cursor-pointer",2,"position","absolute","right","5px","top","3px","z-index","1001","font-size","1rem"],["role","button",3,"click","icon"]],template:function(e,i){if(e&1){let s=I();C(0,"div",1)(1,"input",2,0),U(3,"translate"),H("keyup.escape",function(){return _(s),M(i.clear())}),p(),$(4,pe,2,1,"span",3),p()}e&2&&(P(),R("placeholder",G(3,3,"Filter",i.locale.language))("formControl",i.searchControl),P(3),q(i.search()?4:-1))},dependencies:[se,X,ee,te,ne,re],encapsulation:2})}}return o})();var ge=["content"],ve=["shim"],Ce=["*"],Ae=(()=>{class o{constructor(t,e,i,s){this.element=t,this.renderer=e,this.ngZone=i,this.layout=s,this.viewPortItems=[],this.isScrollBottom=new x,this.isScrollTop=new x,this.resizeOffset=130,this.galleryMode=!1,this.selectedChat=null,this.items=[],this.childHeight=35,this.bufferAmount=0,this.subscriptions=[],this.scrollbarWidth=0,this._scrollChat=new F,this.scrollChat=this._scrollChat.asObservable().pipe(T(50)),this.startupLoop=!0,this.scrollTimer=null,this.lastScrollHeight=-1,this.lastTopPadding=-1,this.toggleLeftSidebar=this.layout.toggleLeftSideBar.pipe(V(1),L(h=>B(h).pipe(k({count:30,delay:10})))),this.tableScrollHovering=()=>{clearTimeout(this.scrollTimer),this.contentElementRef.nativeElement.classList.contains("table-disable-hover")||this.renderer.addClass(this.contentElementRef.nativeElement,"table-disable-hover"),this.scrollTimer=setTimeout(()=>{this.renderer.removeClass(this.contentElementRef.nativeElement,"table-disable-hover")},200),this.refresh()},this.refreshWithDimensions=()=>{this.resizeOffsetHeight(),this.refresh(!0)},this.refreshWithoutDimensions=()=>{this.refresh()},this.refreshChatWithoutDimensions=()=>{this.chatIsScrolledToTop()&&!this.selectedChat.allHistoryLoaded?this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollTop,behavior:"auto"}):(this.refreshWithoutDimensions(),this._scrollChat.next())},this.refreshChatWithDimensions=()=>{this.resizeOffsetHeight(),this.refresh(!0),this.selectedChat.isScrolledToBottom?this.scrollInto(-2):this._scrollChat.next()}}ngOnInit(){this.resizeOffsetHeight(!0),this.addParentEventHandlers(),this.selectedChat?(this.childHeight=1,this.subscriptions.push(this.scrollChat.subscribe(()=>this.checkScrollChat()))):this.galleryMode||this.subscriptions.push(this.toggleLeftSidebar.subscribe(()=>this.resizeTableHeader()))}ngOnDestroy(){this.eventScrollHandler&&(this.eventScrollHandler(),this.eventScrollHandler=void 0),this.subscriptions.forEach(t=>t.unsubscribe())}ngOnChanges(t){if(this.previousStart=void 0,this.previousEnd=void 0,this.galleryMode)this.startupLoop=!0;else{let e=t.items||void 0;(t.items!==void 0&&e.previousValue===void 0||e.previousValue!==void 0&&e.previousValue.length===0)&&(this.startupLoop=!0)}this.refresh(!0),this.checkChangesOnChat(t)}refresh(t=!1){this.ngZone.runOutsideAngular(()=>{(t||!this.dimensionsView)&&this.calculateDimensions(),requestAnimationFrame(()=>this.calculateItems())}),this.resizeTableHeader()}scrollInto(t){if(t===-1){this.element.nativeElement.scrollTo({left:0,top:0,behavior:"auto"});return}else if(t===-2){this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollHeight,behavior:"smooth"});return}else if(t===0){this.refresh();return}let e=(this.items||[]).indexOf(t);if(e<0||e>=(this.items||[]).length)return;let i=this.dimensionsView,s=Math.floor(e/i.itemsPerRow)*i.childHeight-i.childHeight*Math.min(e,this.bufferAmount);this.element.nativeElement.scrollTo({left:0,top:s,behavior:"smooth"}),this.refresh()}checkChangesOnChat(t){this.selectedChat&&(t.selectedChat?(this.renderer.setStyle(this.element.nativeElement,"visibility","hidden"),setTimeout(()=>{this.selectedChat.lastScrollPosition===null&&this.saveChatScrollPosition(this.element.nativeElement.scrollHeight),this.element.nativeElement.scrollTo({left:0,top:this.selectedChat.lastScrollPosition,behavior:"auto"}),this.checkScrollChat(),this.renderer.setStyle(this.element.nativeElement,"visibility","visible")},50)):this.chatIsScrolledToBottom()?this.restoreBottomScrollChat():this.chatIsScrolledToTop()&&this.restoreTopScrollChat())}checkScrollChat(){let t=this.chatIsScrolledToBottom(),e=this.chatIsScrolledToTop();e?this.saveChatScrollPosition(this.element.nativeElement.scrollHeight-this.element.nativeElement.scrollTop):t?this.saveChatScrollPosition(this.element.nativeElement.scrollHeight):this.saveChatScrollPosition(),this.ngZone.run(()=>{this.isScrollBottom.next(t),this.isScrollTop.next(e)})}saveChatScrollPosition(t=null){this.selectedChat.lastScrollPosition=t||this.element.nativeElement.scrollTop}chatIsScrolledToBottom(){return Math.ceil(this.element.nativeElement.clientHeight/10)*10===Math.ceil((this.element.nativeElement.scrollHeight-this.element.nativeElement.scrollTop)/10)*10}chatIsScrolledToTop(){return this.element.nativeElement.scrollTop<=300}restoreBottomScrollChat(){setTimeout(()=>{this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollHeight,behavior:"smooth"})},50)}restoreTopScrollChat(){setTimeout(()=>{this.element.nativeElement.scrollTop=this.element.nativeElement.scrollHeight-this.selectedChat.lastScrollPosition},50)}resizeOffsetHeight(t=!1){let e=window.innerHeight-this.resizeOffset;(t||this.element.nativeElement.offsetHeight!==e)&&this.renderer.setStyle(this.element.nativeElement,"height",`${e-1}px`)}resizeTableHeader(){!this.selectedChat&&!this.galleryMode&&this.element.nativeElement.previousElementSibling&&this.element.nativeElement.previousElementSibling.classList.contains("app-table")&&setTimeout(()=>this.renderer.setStyle(this.element.nativeElement.previousElementSibling,"width",`${this.element.nativeElement.clientWidth}px`),50)}addParentEventHandlers(){this.ngZone.runOutsideAngular(()=>{this.galleryMode?this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.refreshWithoutDimensions):this.selectedChat?this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.refreshChatWithoutDimensions):this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.tableScrollHovering),this.selectedChat?this.subscriptions.push(this.layout.resizeEvent.subscribe(()=>this.refreshChatWithDimensions())):this.subscriptions.push(this.layout.resizeEvent.subscribe(()=>this.refreshWithDimensions()))})}countItemsPerRow(){if(this.galleryMode){let t,e,i=this.contentElementRef.nativeElement.children;for(i[0]&&(i=i[0].children),e=0;e<i.length&&!(t!==void 0&&t!==i[e].offsetTop);e++)t=i[e].offsetTop;return e}else return 1}calculateDimensions(){let t=this.element.nativeElement,e=t.offsetWidth-t.clientWidth;this.scrollbarWidth!=e&&(this.resizeTableHeader(),this.scrollbarWidth=e);let s=(this.items||[]).length,h=t.clientWidth-this.scrollbarWidth,E=t.clientHeight,m;if(this.childWidth===void 0||this.childHeight===void 0){let D=this.contentElementRef.nativeElement;m=D.children[0]?D.children[0].getBoundingClientRect():{width:h,height:E}}let n=this.childWidth||m.width,f=this.childHeight||m.height,a=this.countItemsPerRow(),d=Math.max(1,Math.floor(h/n));this.galleryMode&&a===0?a=d:a=Math.max(1,a);let l=Math.max(1,Math.floor(E/f)),u=t.scrollTop,de=Math.max(0,u),g=f*Math.ceil(s/a);l===1&&Math.floor(de/g*s)+d>=s&&(a=d),g!==this.lastScrollHeight&&(this.renderer.setStyle(this.shimElementRef.nativeElement,"height",`${g}px`),this.lastScrollHeight=g),this.dimensionsView={itemCount:s,viewWidth:h,viewHeight:E,childWidth:n,childHeight:f,itemsPerRow:a,itemsPerCol:l,itemsPerRowByCalc:d,scrollHeight:g}}calculateItems(){let t=this.element.nativeElement,e=this.dimensionsView,i=this.items||[],s=this.galleryMode?this.bufferAmount*e.itemsPerRowByCalc:this.bufferAmount,h=t.scrollTop;h>e.scrollHeight&&(h=e.scrollHeight);let m=Math.max(0,h)/e.scrollHeight*e.itemCount/e.itemsPerRow,n=Math.min(e.itemCount,Math.ceil(m)*e.itemsPerRow+e.itemsPerRow*(e.itemsPerCol+1)),f=n,a=n%e.itemsPerRow;a&&(f=n+e.itemsPerRow-a);let d=Math.max(0,f-e.itemsPerCol*e.itemsPerRow-e.itemsPerRow),l=Math.min(d,Math.floor(m)*e.itemsPerRow),u=i==null||i.length===0?0:e.childHeight*Math.ceil(l/e.itemsPerRow)-e.childHeight*Math.min(l,this.bufferAmount);u!==this.lastTopPadding&&(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform",`translateY(${u}px)`),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform",`translateY(${u}px)`),this.lastTopPadding=u),l=isNaN(l)?-1:l,n=isNaN(n)?-1:n,l-=s,l=Math.max(0,l),n+=s,n=Math.min(i.length,n),l!==this.previousStart||n!==this.previousEnd?(this.ngZone.run(()=>{this.viewPortItems=i.slice(l,n>=0?n:0)}),this.previousStart=l,this.previousEnd=n,this.startupLoop===!0&&this.refresh()):this.startupLoop===!0&&(this.startupLoop=!1,this.refresh(!0))}static{this.\u0275fac=function(e){return new(e||o)(c(v),c(Q),c(A),c(ae))}}static{this.\u0275cmp=w({type:o,selectors:[["app-virtual-scroll"]],viewQuery:function(e,i){if(e&1&&(S(ge,7,v),S(ve,7,v)),e&2){let s;y(s=b())&&(i.contentElementRef=s.first),y(s=b())&&(i.shimElementRef=s.first)}},inputs:{resizeOffset:"resizeOffset",galleryMode:"galleryMode",selectedChat:"selectedChat",items:"items",childHeight:"childHeight",childWidth:"childWidth",bufferAmount:"bufferAmount"},outputs:{isScrollBottom:"isScrollBottom",isScrollTop:"isScrollTop"},features:[z],ngContentSelectors:Ce,decls:5,vars:0,consts:[["shim",""],["content",""],[1,"total-padding"],[1,"scrollable-content"]],template:function(e,i){e&1&&(J(),K(0,"div",2,0),C(2,"div",3,1),Y(4),p())},styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto;position:relative;scrollbar-width:thin}.scrollable-content[_ngcontent-%COMP%]{top:0;left:0;width:100%;position:absolute;will-change:transform}.total-padding[_ngcontent-%COMP%]{width:1px;opacity:0}"],changeDetection:0})}}return o})();var Qe=(()=>{class o{transform(t,e,i){return!t?.length||!e?t:he(e,t,i)}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275pipe=Z({name:"searchFilter",type:o,pure:!0})}}return o})();var fe=class{constructor(r,t){this.defaultId="default",this.keyStore=`sortBy${r}`,this.sortSettings=t,this._sortParam=this.sort}get sortParam(){return this._sortParam||this.sort}get sort(){let r=localStorage.getItem(this.keyStore);return r?JSON.parse(r):{column:this.defaultId,asc:!1}}set sort(r){this._sortParam=r,localStorage.setItem(this.keyStore,JSON.stringify(r))}sortBy(r,t=!0,e){if(!(r in this.sortSettings))return e;t&&(this.sortParam.asc?(this.sortParam.column=this.defaultId,this.sortParam.asc=!1,r=this.defaultId):this.sortParam.column===r?this.sortParam.asc=!this.sortParam.asc:(this.sortParam.column=r,this.sortParam.asc=!1),this.sort=this.sortParam);for(let i of this.sortSettings[r])ce(i.type,e,i.prop,r===this.defaultId?!1:this.sortParam.asc);return[...e]}};export{Re as a,Ae as b,Qe as c,fe as d};
|
|
1
|
+
import{Sb as ae,Tb as ce,hb as he}from"./chunk-7FVU676A.js";import{Ad as ne,Ba as j,Bb as I,Dd as re,Df as le,Eb as H,Fb as O,Gb as J,Hb as Y,J as T,Mb as S,N as W,Nb as y,Ob as b,Qa as N,Sa as P,T as k,Wa as Q,X as V,Xa as c,Yc as X,Z as L,ab as w,ad as ee,bc as U,db as Z,dc as G,f as F,fb as $,id as te,lb as R,oa as z,p as B,pa as _,qa as M,qd as ie,rb as q,td as se,ud as oe,vb as C,wa as x,wb as p,xa as A,xb as K,za as v}from"./chunk-FPEGN42P.js";var ue=["iFilter"];function pe(o,r){if(o&1){let t=I();C(0,"span",3)(1,"fa-icon",4),H("click",function(){_(t);let i=O();return M(i.clear())}),p()()}if(o&2){let t=O();P(),R("icon",t.faTimes)}}var Re=(()=>{class o{constructor(t,e){this.locale=t,this.fb=e,this.search=j(""),this.faTimes=le,this.searchControl=this.fb.control(""),this.subscription=this.searchControl.valueChanges.pipe(T(300),W()).subscribe(i=>this.onType(i))}ngOnDestroy(){this.subscription.unsubscribe()}onKeyPress(t){(t.ctrlKey||t.metaKey)&&t.keyCode===70?(t.preventDefault(),t.stopPropagation(),this.iFilter.nativeElement.focus()):t.keyCode===27&&(t.preventDefault(),t.stopPropagation())}clear(){this.searchControl&&(this.searchControl.reset(),this.iFilter.nativeElement.value="")}onType(t){this.search.set(t)}static{this.\u0275fac=function(e){return new(e||o)(c(oe),c(ie))}}static{this.\u0275cmp=w({type:o,selectors:[["app-input-filter"]],viewQuery:function(e,i){if(e&1&&S(ue,7),e&2){let s;y(s=b())&&(i.iFilter=s.first)}},hostBindings:function(e,i){e&1&&H("keydown",function(h){return i.onKeyPress(h)},!1,N)},decls:5,vars:6,consts:[["iFilter",""],[1,"btn-group",2,"height","30px","max-width","150px"],["type","text",1,"form-control","form-control-sm",2,"padding-right","24px",3,"keyup.escape","placeholder","formControl"],[1,"cursor-pointer",2,"position","absolute","right","5px","top","3px","z-index","1001","font-size","1rem"],["role","button",3,"click","icon"]],template:function(e,i){if(e&1){let s=I();C(0,"div",1)(1,"input",2,0),U(3,"translate"),H("keyup.escape",function(){return _(s),M(i.clear())}),p(),$(4,pe,2,1,"span",3),p()}e&2&&(P(),R("placeholder",G(3,3,"Filter",i.locale.language))("formControl",i.searchControl),P(3),q(i.search()?4:-1))},dependencies:[se,X,ee,te,ne,re],encapsulation:2})}}return o})();var ge=["content"],ve=["shim"],Ce=["*"],Ae=(()=>{class o{constructor(t,e,i,s){this.element=t,this.renderer=e,this.ngZone=i,this.layout=s,this.viewPortItems=[],this.isScrollBottom=new x,this.isScrollTop=new x,this.resizeOffset=130,this.galleryMode=!1,this.selectedChat=null,this.items=[],this.childHeight=35,this.bufferAmount=0,this.subscriptions=[],this.scrollbarWidth=0,this._scrollChat=new F,this.scrollChat=this._scrollChat.asObservable().pipe(T(50)),this.startupLoop=!0,this.scrollTimer=null,this.lastScrollHeight=-1,this.lastTopPadding=-1,this.toggleLeftSidebar=this.layout.toggleLeftSideBar.pipe(V(1),L(h=>B(h).pipe(k({count:30,delay:10})))),this.tableScrollHovering=()=>{clearTimeout(this.scrollTimer),this.contentElementRef.nativeElement.classList.contains("table-disable-hover")||this.renderer.addClass(this.contentElementRef.nativeElement,"table-disable-hover"),this.scrollTimer=setTimeout(()=>{this.renderer.removeClass(this.contentElementRef.nativeElement,"table-disable-hover")},200),this.refresh()},this.refreshWithDimensions=()=>{this.resizeOffsetHeight(),this.refresh(!0)},this.refreshWithoutDimensions=()=>{this.refresh()},this.refreshChatWithoutDimensions=()=>{this.chatIsScrolledToTop()&&!this.selectedChat.allHistoryLoaded?this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollTop,behavior:"auto"}):(this.refreshWithoutDimensions(),this._scrollChat.next())},this.refreshChatWithDimensions=()=>{this.resizeOffsetHeight(),this.refresh(!0),this.selectedChat.isScrolledToBottom?this.scrollInto(-2):this._scrollChat.next()}}ngOnInit(){this.resizeOffsetHeight(!0),this.addParentEventHandlers(),this.selectedChat?(this.childHeight=1,this.subscriptions.push(this.scrollChat.subscribe(()=>this.checkScrollChat()))):this.galleryMode||this.subscriptions.push(this.toggleLeftSidebar.subscribe(()=>this.resizeTableHeader()))}ngOnDestroy(){this.eventScrollHandler&&(this.eventScrollHandler(),this.eventScrollHandler=void 0),this.subscriptions.forEach(t=>t.unsubscribe())}ngOnChanges(t){if(this.previousStart=void 0,this.previousEnd=void 0,this.galleryMode)this.startupLoop=!0;else{let e=t.items||void 0;(t.items!==void 0&&e.previousValue===void 0||e.previousValue!==void 0&&e.previousValue.length===0)&&(this.startupLoop=!0)}this.refresh(!0),this.checkChangesOnChat(t)}refresh(t=!1){this.ngZone.runOutsideAngular(()=>{(t||!this.dimensionsView)&&this.calculateDimensions(),requestAnimationFrame(()=>this.calculateItems())}),this.resizeTableHeader()}scrollInto(t){if(t===-1){this.element.nativeElement.scrollTo({left:0,top:0,behavior:"auto"});return}else if(t===-2){this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollHeight,behavior:"smooth"});return}else if(t===0){this.refresh();return}let e=(this.items||[]).indexOf(t);if(e<0||e>=(this.items||[]).length)return;let i=this.dimensionsView,s=Math.floor(e/i.itemsPerRow)*i.childHeight-i.childHeight*Math.min(e,this.bufferAmount);this.element.nativeElement.scrollTo({left:0,top:s,behavior:"smooth"}),this.refresh()}checkChangesOnChat(t){this.selectedChat&&(t.selectedChat?(this.renderer.setStyle(this.element.nativeElement,"visibility","hidden"),setTimeout(()=>{this.selectedChat.lastScrollPosition===null&&this.saveChatScrollPosition(this.element.nativeElement.scrollHeight),this.element.nativeElement.scrollTo({left:0,top:this.selectedChat.lastScrollPosition,behavior:"auto"}),this.checkScrollChat(),this.renderer.setStyle(this.element.nativeElement,"visibility","visible")},50)):this.chatIsScrolledToBottom()?this.restoreBottomScrollChat():this.chatIsScrolledToTop()&&this.restoreTopScrollChat())}checkScrollChat(){let t=this.chatIsScrolledToBottom(),e=this.chatIsScrolledToTop();e?this.saveChatScrollPosition(this.element.nativeElement.scrollHeight-this.element.nativeElement.scrollTop):t?this.saveChatScrollPosition(this.element.nativeElement.scrollHeight):this.saveChatScrollPosition(),this.ngZone.run(()=>{this.isScrollBottom.next(t),this.isScrollTop.next(e)})}saveChatScrollPosition(t=null){this.selectedChat.lastScrollPosition=t||this.element.nativeElement.scrollTop}chatIsScrolledToBottom(){return Math.ceil(this.element.nativeElement.clientHeight/10)*10===Math.ceil((this.element.nativeElement.scrollHeight-this.element.nativeElement.scrollTop)/10)*10}chatIsScrolledToTop(){return this.element.nativeElement.scrollTop<=300}restoreBottomScrollChat(){setTimeout(()=>{this.element.nativeElement.scrollTo({left:0,top:this.element.nativeElement.scrollHeight,behavior:"smooth"})},50)}restoreTopScrollChat(){setTimeout(()=>{this.element.nativeElement.scrollTop=this.element.nativeElement.scrollHeight-this.selectedChat.lastScrollPosition},50)}resizeOffsetHeight(t=!1){let e=window.innerHeight-this.resizeOffset;(t||this.element.nativeElement.offsetHeight!==e)&&this.renderer.setStyle(this.element.nativeElement,"height",`${e-1}px`)}resizeTableHeader(){!this.selectedChat&&!this.galleryMode&&this.element.nativeElement.previousElementSibling&&this.element.nativeElement.previousElementSibling.classList.contains("app-table")&&setTimeout(()=>this.renderer.setStyle(this.element.nativeElement.previousElementSibling,"width",`${this.element.nativeElement.clientWidth}px`),50)}addParentEventHandlers(){this.ngZone.runOutsideAngular(()=>{this.galleryMode?this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.refreshWithoutDimensions):this.selectedChat?this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.refreshChatWithoutDimensions):this.eventScrollHandler=this.renderer.listen(this.element.nativeElement,"scroll",this.tableScrollHovering),this.selectedChat?this.subscriptions.push(this.layout.resizeEvent.subscribe(()=>this.refreshChatWithDimensions())):this.subscriptions.push(this.layout.resizeEvent.subscribe(()=>this.refreshWithDimensions()))})}countItemsPerRow(){if(this.galleryMode){let t,e,i=this.contentElementRef.nativeElement.children;for(i[0]&&(i=i[0].children),e=0;e<i.length&&!(t!==void 0&&t!==i[e].offsetTop);e++)t=i[e].offsetTop;return e}else return 1}calculateDimensions(){let t=this.element.nativeElement,e=t.offsetWidth-t.clientWidth;this.scrollbarWidth!=e&&(this.resizeTableHeader(),this.scrollbarWidth=e);let s=(this.items||[]).length,h=t.clientWidth-this.scrollbarWidth,E=t.clientHeight,m;if(this.childWidth===void 0||this.childHeight===void 0){let D=this.contentElementRef.nativeElement;m=D.children[0]?D.children[0].getBoundingClientRect():{width:h,height:E}}let n=this.childWidth||m.width,f=this.childHeight||m.height,a=this.countItemsPerRow(),d=Math.max(1,Math.floor(h/n));this.galleryMode&&a===0?a=d:a=Math.max(1,a);let l=Math.max(1,Math.floor(E/f)),u=t.scrollTop,de=Math.max(0,u),g=f*Math.ceil(s/a);l===1&&Math.floor(de/g*s)+d>=s&&(a=d),g!==this.lastScrollHeight&&(this.renderer.setStyle(this.shimElementRef.nativeElement,"height",`${g}px`),this.lastScrollHeight=g),this.dimensionsView={itemCount:s,viewWidth:h,viewHeight:E,childWidth:n,childHeight:f,itemsPerRow:a,itemsPerCol:l,itemsPerRowByCalc:d,scrollHeight:g}}calculateItems(){let t=this.element.nativeElement,e=this.dimensionsView,i=this.items||[],s=this.galleryMode?this.bufferAmount*e.itemsPerRowByCalc:this.bufferAmount,h=t.scrollTop;h>e.scrollHeight&&(h=e.scrollHeight);let m=Math.max(0,h)/e.scrollHeight*e.itemCount/e.itemsPerRow,n=Math.min(e.itemCount,Math.ceil(m)*e.itemsPerRow+e.itemsPerRow*(e.itemsPerCol+1)),f=n,a=n%e.itemsPerRow;a&&(f=n+e.itemsPerRow-a);let d=Math.max(0,f-e.itemsPerCol*e.itemsPerRow-e.itemsPerRow),l=Math.min(d,Math.floor(m)*e.itemsPerRow),u=i==null||i.length===0?0:e.childHeight*Math.ceil(l/e.itemsPerRow)-e.childHeight*Math.min(l,this.bufferAmount);u!==this.lastTopPadding&&(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform",`translateY(${u}px)`),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform",`translateY(${u}px)`),this.lastTopPadding=u),l=isNaN(l)?-1:l,n=isNaN(n)?-1:n,l-=s,l=Math.max(0,l),n+=s,n=Math.min(i.length,n),l!==this.previousStart||n!==this.previousEnd?(this.ngZone.run(()=>{this.viewPortItems=i.slice(l,n>=0?n:0)}),this.previousStart=l,this.previousEnd=n,this.startupLoop===!0&&this.refresh()):this.startupLoop===!0&&(this.startupLoop=!1,this.refresh(!0))}static{this.\u0275fac=function(e){return new(e||o)(c(v),c(Q),c(A),c(ae))}}static{this.\u0275cmp=w({type:o,selectors:[["app-virtual-scroll"]],viewQuery:function(e,i){if(e&1&&(S(ge,7,v),S(ve,7,v)),e&2){let s;y(s=b())&&(i.contentElementRef=s.first),y(s=b())&&(i.shimElementRef=s.first)}},inputs:{resizeOffset:"resizeOffset",galleryMode:"galleryMode",selectedChat:"selectedChat",items:"items",childHeight:"childHeight",childWidth:"childWidth",bufferAmount:"bufferAmount"},outputs:{isScrollBottom:"isScrollBottom",isScrollTop:"isScrollTop"},features:[z],ngContentSelectors:Ce,decls:5,vars:0,consts:[["shim",""],["content",""],[1,"total-padding"],[1,"scrollable-content"]],template:function(e,i){e&1&&(J(),K(0,"div",2,0),C(2,"div",3,1),Y(4),p())},styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto;position:relative;scrollbar-width:thin}.scrollable-content[_ngcontent-%COMP%]{top:0;left:0;width:100%;position:absolute;will-change:transform}.total-padding[_ngcontent-%COMP%]{width:1px;opacity:0}"],changeDetection:0})}}return o})();var Qe=(()=>{class o{transform(t,e,i){return!t?.length||!e?t:he(e,t,i)}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275pipe=Z({name:"searchFilter",type:o,pure:!0})}}return o})();var fe=class{constructor(r,t){this.defaultId="default",this.keyStore=`sortBy${r}`,this.sortSettings=t,this._sortParam=this.sort}get sortParam(){return this._sortParam||this.sort}get sort(){let r=localStorage.getItem(this.keyStore);return r?JSON.parse(r):{column:this.defaultId,asc:!1}}set sort(r){this._sortParam=r,localStorage.setItem(this.keyStore,JSON.stringify(r))}sortBy(r,t=!0,e){if(!(r in this.sortSettings))return e;t&&(this.sortParam.asc?(this.sortParam.column=this.defaultId,this.sortParam.asc=!1,r=this.defaultId):this.sortParam.column===r?this.sortParam.asc=!this.sortParam.asc:(this.sortParam.column=r,this.sortParam.asc=!1),this.sort=this.sortParam);for(let i of this.sortSettings[r])ce(i.type,e,i.prop,r===this.defaultId?!1:this.sortParam.asc);return[...e]}};export{Re as a,Ae as b,Qe as c,fe as d};
|