@sync-in/server 1.3.3 → 1.3.6

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +2 -2
  3. package/static/{chunk-67ENNMPZ.js → chunk-3VDXS56K.js} +1 -1
  4. package/static/{chunk-SDYSHQI5.js → chunk-5SCHYI7K.js} +1 -1
  5. package/static/{chunk-WA2KMN23.js → chunk-ASH3CAYZ.js} +1 -1
  6. package/static/{chunk-TECWTVNM.js → chunk-D5NRQM6S.js} +1 -1
  7. package/static/{chunk-ZGLYEYWA.js → chunk-DMN6JV3X.js} +1 -1
  8. package/static/{chunk-X7LCJ4LA.js → chunk-DOKA2WHJ.js} +1 -1
  9. package/static/{chunk-3SC36MTD.js → chunk-FSDIOBH6.js} +1 -1
  10. package/static/{chunk-XCIDAKI5.js → chunk-HSRWUGKT.js} +1 -1
  11. package/static/{chunk-2AC4RLMK.js → chunk-IKNQ6PPM.js} +1 -1
  12. package/static/{chunk-MWMJMTGE.js → chunk-IMAJPTLO.js} +1 -1
  13. package/static/{chunk-DZNKFVGE.js → chunk-LK3ILZP5.js} +1 -1
  14. package/static/{chunk-OR75MKSH.js → chunk-LNKKXNNU.js} +1 -1
  15. package/static/{chunk-HX6BM5E5.js → chunk-MFZROUQ3.js} +1 -1
  16. package/static/{chunk-JOPTBE35.js → chunk-MPVQM2PL.js} +1 -1
  17. package/static/{chunk-6WROUPVQ.js → chunk-OU6PE6E7.js} +1 -1
  18. package/static/{chunk-QNGY6EWB.js → chunk-PB76NZ6O.js} +1 -1
  19. package/static/{chunk-LHULGE6M.js → chunk-QBFAWJVK.js} +1 -1
  20. package/static/{chunk-4GYSKJJC.js → chunk-SGDMUCQ7.js} +1 -1
  21. package/static/{chunk-UILGGLKW.js → chunk-SQFLVUCW.js} +1 -1
  22. package/static/{chunk-2FUMMTEK.js → chunk-T5R64VS4.js} +1 -1
  23. package/static/{chunk-QVWBPQWU.js → chunk-TMXIUOP5.js} +1 -1
  24. package/static/{chunk-NJVHZKGK.js → chunk-U5B5KGFX.js} +1 -1
  25. package/static/{chunk-W37K2YDS.js → chunk-V5OITZAT.js} +1 -1
  26. package/static/{chunk-JEF7STYA.js → chunk-VLZ5YMY7.js} +1 -1
  27. package/static/{chunk-6QJL2YDQ.js → chunk-VWP6UNTY.js} +1 -1
  28. package/static/{chunk-Q2UU32ST.js → chunk-XXVSRYSO.js} +1 -1
  29. package/static/{chunk-MGWQFMQF.js → chunk-YDFPRKKR.js} +1 -1
  30. package/static/{chunk-TJICEVPI.js → chunk-ZMI2J4TP.js} +1 -1
  31. package/static/{chunk-RTHDK2Z7.js → chunk-ZYXAII5S.js} +1 -1
  32. package/static/index.html +1 -1
  33. package/static/{main-64E5RI2M.js → main-NUCIT7MV.js} +3 -3
@@ -1 +1 @@
1
- import{Tb as de,Ya as me,xb as fe}from"./chunk-4GYSKJJC.js";import{Cb as H,Eb as I,Ed as ae,Fb as G,Gb as X,Ib as v,J as b,Jb as C,Ka as Q,Kb as y,Ma as T,N as F,Qa as Z,T as L,X as V,Xa as w,Z as z,Zc as ie,_a as $,ad as se,bb as _,cb as j,dc as ee,ed as oe,f as W,fc as te,ha as c,jb as q,kb as K,kf as ce,ma as M,md as ne,na as x,p as k,pb as R,qb as O,rb as P,ta as A,tb as J,ub as Y,ud as re,va as N,vb as U,xd as le,ya as E,yd as he,zb as D}from"./chunk-JQOMI5VI.js";var ve=["iFilter"];function Ce(r,i){if(r&1){let m=D();O(0,"span",3)(1,"fa-icon",4),H("click",function(){M(m);let e=I();return x(e.clear())}),P()()}if(r&2){let m=I();T(),R("icon",m.faTimes)}}var De=(()=>{let i=class i{constructor(){this.search=A(""),this.locale=c(he),this.faTimes=ce,this.fb=c(re),this.searchControl=this.fb.control(""),this.subscription=this.searchControl.valueChanges.pipe(b(300),F()).subscribe(t=>this.onType(t))}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)}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=w({type:i,selectors:[["app-input-filter"]],viewQuery:function(e,s){if(e&1&&v(ve,7),e&2){let o;C(o=y())&&(s.iFilter=o.first)}},hostBindings:function(e,s){e&1&&H("keydown",function(h){return s.onKeyPress(h)},Q)},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,s){if(e&1){let o=D();O(0,"div",1)(1,"input",2,0),ee(3,"translate"),H("keyup.escape",function(){return M(o),x(s.clear())}),P(),q(4,Ce,2,1,"span",3),P()}e&2&&(T(),R("placeholder",te(3,3,"Filter",s.locale.language))("formControl",s.searchControl),T(3),K(s.search()?4:-1))},dependencies:[le,se,oe,ne,ie,ae],encapsulation:2});let r=i;return r})();var ye=["content"],Se=["shim"],be=["*"],Qe=(()=>{let i=class i{constructor(){this.isScrollBottom=new _,this.isScrollTop=new _,this.resizeOffset=130,this.galleryMode=!1,this.selectedChat=null,this.items=[],this.childHeight=35,this.bufferAmount=0,this.viewPortItems=[],this.element=c(E),this.renderer=c(Z),this.ngZone=c(j),this.layout=c(fe),this.subscriptions=[],this.scrollbarWidth=0,this._scrollChat=new W,this.scrollChat=this._scrollChat.asObservable().pipe(b(50)),this.startupLoop=!0,this.scrollTimer=null,this.lastScrollHeight=-1,this.lastTopPadding=-1,this.toggleLeftSidebar=this.layout.toggleLeftSideBar.pipe(V(1),z(t=>k(t).pipe(L({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 s=this.dimensionsView,o=Math.floor(e/s.itemsPerRow)*s.childHeight-s.childHeight*Math.min(e,this.bufferAmount);this.element.nativeElement.scrollTo({left:0,top:o,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,s=this.contentElementRef.nativeElement.children;for(s[0]&&(s=s[0].children),e=0;e<s.length&&!(t!==void 0&&t!==s[e].offsetTop);e++)t=s[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 o=(this.items||[]).length,h=t.clientWidth-this.scrollbarWidth,S=t.clientHeight,f;if(this.childWidth===void 0||this.childHeight===void 0){let B=this.contentElementRef.nativeElement;f=B.children[0]?B.children[0].getBoundingClientRect():{width:h,height:S}}let n=this.childWidth||f.width,d=this.childHeight||f.height,a=this.countItemsPerRow(),u=Math.max(1,Math.floor(h/n));this.galleryMode&&a===0?a=u:a=Math.max(1,a);let l=Math.max(1,Math.floor(S/d)),p=t.scrollTop,ge=Math.max(0,p),g=d*Math.ceil(o/a);l===1&&Math.floor(ge/g*o)+u>=o&&(a=u),g!==this.lastScrollHeight&&(this.renderer.setStyle(this.shimElementRef.nativeElement,"height",`${g}px`),this.lastScrollHeight=g),this.dimensionsView={itemCount:o,viewWidth:h,viewHeight:S,childWidth:n,childHeight:d,itemsPerRow:a,itemsPerCol:l,itemsPerRowByCalc:u,scrollHeight:g}}calculateItems(){let t=this.element.nativeElement,e=this.dimensionsView,s=this.items||[],o=this.galleryMode?this.bufferAmount*e.itemsPerRowByCalc:this.bufferAmount,h=t.scrollTop;h>e.scrollHeight&&(h=e.scrollHeight);let f=Math.max(0,h)/e.scrollHeight*e.itemCount/e.itemsPerRow,n=Math.min(e.itemCount,Math.ceil(f)*e.itemsPerRow+e.itemsPerRow*(e.itemsPerCol+1)),d=n,a=n%e.itemsPerRow;a&&(d=n+e.itemsPerRow-a);let u=Math.max(0,d-e.itemsPerCol*e.itemsPerRow-e.itemsPerRow),l=Math.min(u,Math.floor(f)*e.itemsPerRow),p=s==null||s.length===0?0:e.childHeight*Math.ceil(l/e.itemsPerRow)-e.childHeight*Math.min(l,this.bufferAmount);p!==this.lastTopPadding&&(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform",`translateY(${p}px)`),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform",`translateY(${p}px)`),this.lastTopPadding=p),l=isNaN(l)?-1:l,n=isNaN(n)?-1:n,l-=o,l=Math.max(0,l),n+=o,n=Math.min(s.length,n),l!==this.previousStart||n!==this.previousEnd?(this.ngZone.run(()=>{this.viewPortItems=s.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))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=w({type:i,selectors:[["app-virtual-scroll"]],viewQuery:function(e,s){if(e&1&&(v(ye,7,E),v(Se,7,E)),e&2){let o;C(o=y())&&(s.contentElementRef=o.first),C(o=y())&&(s.shimElementRef=o.first)}},inputs:{resizeOffset:"resizeOffset",galleryMode:"galleryMode",selectedChat:"selectedChat",items:"items",childHeight:"childHeight",childWidth:"childWidth",bufferAmount:"bufferAmount"},outputs:{isScrollBottom:"isScrollBottom",isScrollTop:"isScrollTop"},features:[N],ngContentSelectors:be,decls:5,vars:0,consts:[["shim",""],["content",""],[1,"total-padding"],[1,"scrollable-content"]],template:function(e,s){e&1&&(G(),U(0,"div",2,0),J(2,"div",3,1),X(4),Y())},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});let r=i;return r})();var je=(()=>{let i=class i{transform(t,e,s){return!t?.length||!e?t:me(e,t,s)}};i.\u0275fac=function(e){return new(e||i)},i.\u0275pipe=$({name:"searchFilter",type:i,pure:!0});let r=i;return r})();var pe=class{constructor(i,m){this.defaultId="default",this.keyStore=`sortBy${i}`,this.sortSettings=m,this._sortParam=this.sort}get sortParam(){return this._sortParam||this.sort}get sort(){let i=localStorage.getItem(this.keyStore);return i?JSON.parse(i):{column:this.defaultId,asc:!1}}set sort(i){this._sortParam=i,localStorage.setItem(this.keyStore,JSON.stringify(i))}sortBy(i,m=!0,t){if(!(i in this.sortSettings))return t;m&&(this.sortParam.asc?(this.sortParam.column=this.defaultId,this.sortParam.asc=!1,i=this.defaultId):this.sortParam.column===i?this.sortParam.asc=!this.sortParam.asc:(this.sortParam.column=i,this.sortParam.asc=!1),this.sort=this.sortParam);for(let e of this.sortSettings[i])de(e.type,t,e.prop,i===this.defaultId?!1:this.sortParam.asc);return[...t]}};export{De as a,Qe as b,je as c,pe as d};
1
+ import{Tb as de,Ya as me,xb as fe}from"./chunk-SGDMUCQ7.js";import{Cb as H,Eb as I,Ed as ae,Fb as G,Gb as X,Ib as v,J as b,Jb as C,Ka as Q,Kb as y,Ma as T,N as F,Qa as Z,T as L,X as V,Xa as w,Z as z,Zc as ie,_a as $,ad as se,bb as _,cb as j,dc as ee,ed as oe,f as W,fc as te,ha as c,jb as q,kb as K,kf as ce,ma as M,md as ne,na as x,p as k,pb as R,qb as O,rb as P,ta as A,tb as J,ub as Y,ud as re,va as N,vb as U,xd as le,ya as E,yd as he,zb as D}from"./chunk-JQOMI5VI.js";var ve=["iFilter"];function Ce(r,i){if(r&1){let m=D();O(0,"span",3)(1,"fa-icon",4),H("click",function(){M(m);let e=I();return x(e.clear())}),P()()}if(r&2){let m=I();T(),R("icon",m.faTimes)}}var De=(()=>{let i=class i{constructor(){this.search=A(""),this.locale=c(he),this.faTimes=ce,this.fb=c(re),this.searchControl=this.fb.control(""),this.subscription=this.searchControl.valueChanges.pipe(b(300),F()).subscribe(t=>this.onType(t))}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)}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=w({type:i,selectors:[["app-input-filter"]],viewQuery:function(e,s){if(e&1&&v(ve,7),e&2){let o;C(o=y())&&(s.iFilter=o.first)}},hostBindings:function(e,s){e&1&&H("keydown",function(h){return s.onKeyPress(h)},Q)},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,s){if(e&1){let o=D();O(0,"div",1)(1,"input",2,0),ee(3,"translate"),H("keyup.escape",function(){return M(o),x(s.clear())}),P(),q(4,Ce,2,1,"span",3),P()}e&2&&(T(),R("placeholder",te(3,3,"Filter",s.locale.language))("formControl",s.searchControl),T(3),K(s.search()?4:-1))},dependencies:[le,se,oe,ne,ie,ae],encapsulation:2});let r=i;return r})();var ye=["content"],Se=["shim"],be=["*"],Qe=(()=>{let i=class i{constructor(){this.isScrollBottom=new _,this.isScrollTop=new _,this.resizeOffset=130,this.galleryMode=!1,this.selectedChat=null,this.items=[],this.childHeight=35,this.bufferAmount=0,this.viewPortItems=[],this.element=c(E),this.renderer=c(Z),this.ngZone=c(j),this.layout=c(fe),this.subscriptions=[],this.scrollbarWidth=0,this._scrollChat=new W,this.scrollChat=this._scrollChat.asObservable().pipe(b(50)),this.startupLoop=!0,this.scrollTimer=null,this.lastScrollHeight=-1,this.lastTopPadding=-1,this.toggleLeftSidebar=this.layout.toggleLeftSideBar.pipe(V(1),z(t=>k(t).pipe(L({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 s=this.dimensionsView,o=Math.floor(e/s.itemsPerRow)*s.childHeight-s.childHeight*Math.min(e,this.bufferAmount);this.element.nativeElement.scrollTo({left:0,top:o,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,s=this.contentElementRef.nativeElement.children;for(s[0]&&(s=s[0].children),e=0;e<s.length&&!(t!==void 0&&t!==s[e].offsetTop);e++)t=s[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 o=(this.items||[]).length,h=t.clientWidth-this.scrollbarWidth,S=t.clientHeight,f;if(this.childWidth===void 0||this.childHeight===void 0){let B=this.contentElementRef.nativeElement;f=B.children[0]?B.children[0].getBoundingClientRect():{width:h,height:S}}let n=this.childWidth||f.width,d=this.childHeight||f.height,a=this.countItemsPerRow(),u=Math.max(1,Math.floor(h/n));this.galleryMode&&a===0?a=u:a=Math.max(1,a);let l=Math.max(1,Math.floor(S/d)),p=t.scrollTop,ge=Math.max(0,p),g=d*Math.ceil(o/a);l===1&&Math.floor(ge/g*o)+u>=o&&(a=u),g!==this.lastScrollHeight&&(this.renderer.setStyle(this.shimElementRef.nativeElement,"height",`${g}px`),this.lastScrollHeight=g),this.dimensionsView={itemCount:o,viewWidth:h,viewHeight:S,childWidth:n,childHeight:d,itemsPerRow:a,itemsPerCol:l,itemsPerRowByCalc:u,scrollHeight:g}}calculateItems(){let t=this.element.nativeElement,e=this.dimensionsView,s=this.items||[],o=this.galleryMode?this.bufferAmount*e.itemsPerRowByCalc:this.bufferAmount,h=t.scrollTop;h>e.scrollHeight&&(h=e.scrollHeight);let f=Math.max(0,h)/e.scrollHeight*e.itemCount/e.itemsPerRow,n=Math.min(e.itemCount,Math.ceil(f)*e.itemsPerRow+e.itemsPerRow*(e.itemsPerCol+1)),d=n,a=n%e.itemsPerRow;a&&(d=n+e.itemsPerRow-a);let u=Math.max(0,d-e.itemsPerCol*e.itemsPerRow-e.itemsPerRow),l=Math.min(u,Math.floor(f)*e.itemsPerRow),p=s==null||s.length===0?0:e.childHeight*Math.ceil(l/e.itemsPerRow)-e.childHeight*Math.min(l,this.bufferAmount);p!==this.lastTopPadding&&(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform",`translateY(${p}px)`),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform",`translateY(${p}px)`),this.lastTopPadding=p),l=isNaN(l)?-1:l,n=isNaN(n)?-1:n,l-=o,l=Math.max(0,l),n+=o,n=Math.min(s.length,n),l!==this.previousStart||n!==this.previousEnd?(this.ngZone.run(()=>{this.viewPortItems=s.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))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=w({type:i,selectors:[["app-virtual-scroll"]],viewQuery:function(e,s){if(e&1&&(v(ye,7,E),v(Se,7,E)),e&2){let o;C(o=y())&&(s.contentElementRef=o.first),C(o=y())&&(s.shimElementRef=o.first)}},inputs:{resizeOffset:"resizeOffset",galleryMode:"galleryMode",selectedChat:"selectedChat",items:"items",childHeight:"childHeight",childWidth:"childWidth",bufferAmount:"bufferAmount"},outputs:{isScrollBottom:"isScrollBottom",isScrollTop:"isScrollTop"},features:[N],ngContentSelectors:be,decls:5,vars:0,consts:[["shim",""],["content",""],[1,"total-padding"],[1,"scrollable-content"]],template:function(e,s){e&1&&(G(),U(0,"div",2,0),J(2,"div",3,1),X(4),Y())},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});let r=i;return r})();var je=(()=>{let i=class i{transform(t,e,s){return!t?.length||!e?t:me(e,t,s)}};i.\u0275fac=function(e){return new(e||i)},i.\u0275pipe=$({name:"searchFilter",type:i,pure:!0});let r=i;return r})();var pe=class{constructor(i,m){this.defaultId="default",this.keyStore=`sortBy${i}`,this.sortSettings=m,this._sortParam=this.sort}get sortParam(){return this._sortParam||this.sort}get sort(){let i=localStorage.getItem(this.keyStore);return i?JSON.parse(i):{column:this.defaultId,asc:!1}}set sort(i){this._sortParam=i,localStorage.setItem(this.keyStore,JSON.stringify(i))}sortBy(i,m=!0,t){if(!(i in this.sortSettings))return t;m&&(this.sortParam.asc?(this.sortParam.column=this.defaultId,this.sortParam.asc=!1,i=this.defaultId):this.sortParam.column===i?this.sortParam.asc=!this.sortParam.asc:(this.sortParam.column=i,this.sortParam.asc=!1),this.sort=this.sortParam);for(let e of this.sortSettings[i])de(e.type,t,e.prop,i===this.defaultId?!1:this.sortParam.asc);return[...t]}};export{De as a,Qe as b,je as c,pe as d};
@@ -1 +1 @@
1
- import{a as yt,c as bt,d as T,e as te,g as Et}from"./chunk-W37K2YDS.js";import{a as Ct,b as vt}from"./chunk-Q2UU32ST.js";import{f as kt}from"./chunk-WA2KMN23.js";import{f as St,g as gt,h as _t}from"./chunk-3SC36MTD.js";import{A as ze,Ca as he,Ea as de,Hb as fe,Ib as R,Jb as H,Kb as mt,La as st,Mb as ht,Ob as dt,Qb as ut,Rb as ft,S as ee,Xa as at,Za as lt,mb as L,pb as ct,v as Ge,va as rt,w as Ze,xb as B,y as Ye,z as Xe}from"./chunk-4GYSKJJC.js";import{d as Y}from"./chunk-J6YSVODR.js";import{$b as Le,$c as De,Cb as w,Eb as u,Ed as J,Fd as We,G as oe,Gc as Te,Jd as Qe,L as ve,Lf as ot,Ma as l,Mb as we,Nb as K,Ob as x,Oc as Z,Pb as p,Qb as $,Rb as D,Sb as xe,Tb as le,Ub as ce,Vb as pe,Xa as W,Xb as O,Zc as X,ad as Ne,bb as re,be as Je,bg as ue,ca as P,cb as Ae,cd as z,ce as et,cg as pt,dc as C,dg as N,ed as Re,f as ke,fa as ye,fc as v,fd as Pe,ga as j,gd as me,ha as S,id as f,jb as _,jd as Fe,kb as k,kd as Me,lb as Ie,ld as $e,lf as it,ma as F,na as M,nb as se,nd as Oe,ob as ae,od as Be,p as V,pa as be,pb as m,pd as He,qb as s,qd as Ue,rb as a,rd as Ve,sb as d,sd as Ke,t as Ce,te as tt,tf as nt,v as b,va as Ee,wd as qe,xd as je,yd as Q,zb as G}from"./chunk-JQOMI5VI.js";import{a as y,b as I,c as _e}from"./chunk-RTRJ3KFH.js";function Ft(o,r){if(o&1&&d(0,"fa-icon",2),o&2){let i=u();x(i.repository.class),we("min-width",i.galleryMode.dimensions/3,"px")("min-height",i.galleryMode.dimensions/3,"px")("font-size",i.galleryMode.faSize/1.8,"px"),m("icon",i.repository.icon)}}function Mt(o,r){if(o&1&&d(0,"fa-icon",5),o&2){let i=u(2);x(i.repository.class),m("icon",i.repository.icon)}}function $t(o,r){if(o&1&&(p(0),C(1,"translate")),o&2){let i=u(2);D(" ",v(1,1,i.repository.label,i.locale.language)," ")}}function Ot(o,r){if(o&1&&p(0),o&2){let i=u(2);D(" ",i.repository.label," ")}}function Bt(o,r){if(o&1&&(s(0,"div",1),_(1,Mt,1,3,"fa-icon",3),s(2,"span",4),_(3,$t,2,4)(4,Ot,1,1),a()()),o&2){let i=u();l(),k(i.showIcon?1:-1),l(2),k(i.repository.translate?3:4)}}var At=(()=>{let r=class r{constructor(){this.showIcon=!0,this.showFullPath=!1,this.locale=S(Q),this.layout=S(B),this.unknownRepository={icon:Qe,label:"",class:"circle-primary-icon",translate:!1}}ngOnInit(){this.setRepository()}ngOnChanges(){this.setRepository()}setRepository(){this.share.parent?.id||this.share.parent?.id===0?this.repository={icon:R.SHARES,label:this.share.parent.name,class:"circle-purple-icon",translate:!1}:this.share.file?.ownerId?this.repository={icon:R.PERSONAL,label:fe.PERSONAL_FILES,class:"circle-primary-icon",translate:!0}:this.share.file?.space?.alias?this.repository={icon:R.SPACES,label:`${this.share.file.space.name}`,class:"circle-primary-icon",translate:!1}:this.share.externalPath?this.repository={icon:R.EXTERNAL,label:"External",class:"circle-primary-icon",translate:!0}:this.repository=y({},this.unknownRepository),this.showFullPath&&this.setFullPath()}setFullPath(){if(!this.repository.label)return;let e=this.share.file?.path?this.share.file.path.split("/").filter(n=>n&&n!=="."):[];this.share.parent?.id&&!this.share.file?.id&&this.share.file?.path.indexOf("/")===-1?e.shift():this.share.file?.space?.alias&&this.share.file.space?.root?.alias&&(e.length?e.unshift(this.share.file.space.root.name):e.push(this.share.file.space.root.name)),this.repository.label===fe.PERSONAL_FILES&&(this.repository.label=this.layout.translateString(this.repository.label)),e.length&&(this.repository.label=`${this.repository.label}/${e.join("/")}`)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=W({type:r,selectors:[["app-share-repository"]],inputs:{share:"share",galleryMode:"galleryMode",showIcon:"showIcon",showFullPath:"showFullPath"},features:[Ee],decls:2,vars:1,consts:[[3,"icon","class","min-width","min-height","font-size"],[1,"d-flex","align-items-center"],[3,"icon"],[1,"me-2",3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"me-2",3,"icon"]],template:function(n,t){n&1&&_(0,Ft,1,9,"fa-icon",0)(1,Bt,5,2,"div",1),n&2&&k(t.galleryMode?0:1)},dependencies:[X,J],encapsulation:2});let o=r;return o})();var h={BASE:`${ee}/shares`,LIST:"list",CHILDREN:"children",LINKS:"links",LINKS_LIST:"links/list",LINKS_UUID:"links/uuid"},It=`${h.BASE}/${h.LIST}`,q=`${h.BASE}/${h.LINKS}`,wt=`${h.BASE}/${h.LINKS_LIST}`,xt=`${h.BASE}/${h.LINKS_UUID}`;var Lt=(()=>{let r=class r{constructor(){this.http=S(Z),this.router=S(Y)}getShare(e){return this.http.get(`${h.BASE}/${e}`).pipe(b(n=>new T(n)))}createShare(e){return this.http.post(h.BASE,e).pipe(b(n=>new T(n)))}updateShare(e){return this.http.put(`${h.BASE}/${e.id}`,e).pipe(b(n=>new T(n)))}deleteShare(e){return this.http.delete(`${h.BASE}/${e}`)}listShares(){return this.http.get(It)}getShareChild(e,n){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}/${n}`).pipe(b(t=>new T(t)))}updateShareChild(e,n,t){return this.http.put(`${h.BASE}/${e}/${h.CHILDREN}/${n}`,t).pipe(b(c=>new T(c)))}deleteShareChild(e,n){return this.http.delete(`${h.BASE}/${e}/${h.CHILDREN}/${n}`)}listChildShares(e){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}`)}initShareFromFile(e,n,t=!1,c=!1){let g,E=null,A=y({id:0,name:"",createdAt:new Date,modifiedAt:new Date,enabled:!0},t?{parent:{id:0,ownerId:0,alias:n.space.alias,name:n.space.name}}:{});if(n){c&&(E=n.root.id);let ge=null;(n?.root?.owner.login===e.login||!n?.space?.alias)&&(n.space=null,ge=e.id),g=new T(I(y({},A),{name:n.name,file:I(y({},n),{path:c?".":st(n.path,2),ownerId:ge})}))}else g=new T(A);return[g,E]}goTo(e){if(!e.id)return Ce(V(!1));if(e.externalPath&&!e.parent?.id)return this.router.navigate([H.SPACES_SHARES],{queryParams:{select:e.name}});if(e.parent?.id&&!e.file?.id&&e.file?.path.indexOf("/")===-1)return this.router.navigate([H.SPACES_SHARES],{queryParams:{select:e.parent.name}});{let[n,t]=bt(e);return this.router.navigate([n],{queryParams:{select:t}})}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var U={BASE:`${ee}/link`,LINK:"link",VALIDATION:"validation",ACCESS:"access",AUTH:"auth"},Tt=`${U.BASE}/${U.VALIDATION}`,Se=`${U.BASE}/${U.ACCESS}`,Dt=`${U.BASE}/${U.AUTH}`;var Nt=new ye("WindowToken",typeof window<"u"&&window.document?{providedIn:"root",factory:()=>window}:{providedIn:"root",factory:()=>{}});var Rt=(()=>{class o{constructor(i,e,n){this.ngZone=i,this.document=e,this.window=n,this.copySubject=new ke,this.copyResponse$=this.copySubject.asObservable(),this.config={}}configure(i){this.config=i}copy(i){if(!this.isSupported||!i)return this.pushCopyResponse({isSuccess:!1,content:i});let e=this.copyFromContent(i);return e?this.pushCopyResponse({content:i,isSuccess:e}):this.pushCopyResponse({isSuccess:!1,content:i})}get isSupported(){return!!this.document.queryCommandSupported&&!!this.document.queryCommandSupported("copy")&&!!this.window}isTargetValid(i){if(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement){if(i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');return!0}throw new Error("Target should be input or textarea")}copyFromInputElement(i,e=!0){try{this.selectTarget(i);let n=this.copyText();return this.clearSelection(e?i:void 0,this.window),n&&this.isCopySuccessInIE11()}catch{return!1}}isCopySuccessInIE11(){let i=this.window.clipboardData;return!(i&&i.getData&&!i.getData("Text"))}copyFromContent(i,e=this.document.body){if(this.tempTextArea&&!e.contains(this.tempTextArea)&&this.destroy(this.tempTextArea.parentElement||void 0),!this.tempTextArea){this.tempTextArea=this.createTempTextArea(this.document,this.window);try{e.appendChild(this.tempTextArea)}catch{throw new Error("Container should be a Dom element")}}this.tempTextArea.value=i;let n=this.copyFromInputElement(this.tempTextArea,!1);return this.config.cleanUpAfterCopy&&this.destroy(this.tempTextArea.parentElement||void 0),n}destroy(i=this.document.body){this.tempTextArea&&(i.removeChild(this.tempTextArea),this.tempTextArea=void 0)}selectTarget(i){return i.select(),i.setSelectionRange(0,i.value.length),i.value.length}copyText(){return this.document.execCommand("copy")}clearSelection(i,e){i&&i.focus(),e.getSelection()?.removeAllRanges()}createTempTextArea(i,e){let n=i.documentElement.getAttribute("dir")==="rtl",t;t=i.createElement("textarea"),t.style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[n?"right":"left"]="-9999px";let c=e.pageYOffset||i.documentElement.scrollTop;return t.style.top=c+"px",t.setAttribute("readonly",""),t}pushCopyResponse(i){this.copySubject.observers.length>0&&this.ngZone.run(()=>{this.copySubject.next(i)})}pushCopyReponse(i){this.pushCopyResponse(i)}}return o.\u0275fac=function(i){return new(i||o)(j(Ae),j(be),j(Nt,8))},o.\u0275prov=P({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Pt=(()=>{let r=class r{constructor(){this.router=S(Y),this.http=S(Z),this.layout=S(B),this.authService=S(kt),this.clipboard=S(Rt)}shareLinksList(){return this.http.get(wt).pipe(b(e=>e.map(n=>new te(n))))}shareLink(e){return this.http.get(`${q}/${e}`).pipe(b(n=>new te(n)))}shareLinkChild(e,n){return this.http.get(`${q}/${e}/${h.CHILDREN}/${n}`).pipe(b(t=>new te(t)))}linkFromSpaceOrShare(e,n,t){return this.http.get(`${q}/${e}/${t}/${n}`)}linkValidation(e){return this.http.get(`${Tt}/${e}`).pipe(b(n=>n.ok?n.link:(n.error&&(n.error===ue.UNAUTHORIZED?this.router.navigate([`${N.LINK}/${e}/${N.AUTH}`]).catch(console.error):this.router.navigate([`${N.LINK}/${e}/${n.error}`]).catch(console.error)),!1)),oe(()=>(this.authService.logout(),V(!1))))}linkAccess(e,n){n.share?.isDir||n.space?.alias?this.http.get(`${Se}/${e}`).subscribe(t=>{this.authService.initUserFromResponse(t),n.space?this.router.navigate([H.SPACES],{queryParams:{select:n.space.name}}).catch(console.error):this.router.navigate([H.SPACES_SHARES],{queryParams:{select:n.share.name}}).catch(console.error)}):lt(`${Se}/${e}`)}linkAuthentication(e,n){return this.http.post(`${Dt}/${e}`,{password:n}).pipe(b(t=>(this.authService.initUserFromResponse(t),this.router.navigate([`${N.LINK}/${e}`]).catch(console.error),!0)),oe(t=>(t.error.message===ue.UNAUTHORIZED?this.layout.sendNotification("warning","Link","Bad password"):this.router.navigate([`${N.LINK}/${e}/${t.error.message}`]).catch(console.error),V(!1))))}copyLinkToClipboard(e){this.clipboard.copyFromContent(this.genLink(e))}genUUID(){return this.http.get(xt).pipe(b(e=>e.uuid))}createLinkDialog(e){this.genUUID().subscribe(n=>{let t=this.layout.openDialog(ne,"md",{initialState:{link:{name:e.name,uuid:n,isActive:!0,nbAccess:0}}});this.subscribeToSubmitLinkModal(t,e)})}updateLinkFromSpaceOrShare(e,n,t,c){return this.http.put(`${q}/${e}/${t}/${n}`,c)}editLinkDialog(e,n,t){if(n.id===0||e?.linkSettings?.uuid){let c=this.layout.openDialog(ne,"md",{initialState:{link:e.linkSettings}});this.subscribeToSubmitLinkModal(c,n,e)}else this.linkFromSpaceOrShare(e.linkId,n.id,t).subscribe({next:c=>{let g=this.layout.openDialog(ne,"md",{initialState:{link:I(y({},c),{permissions:e.permissions})}});this.subscribeToSubmitLinkModal(g,n,e)},error:c=>this.layout.sendNotification("error","Link error",e.name||n.name,c)})}shareLinkGuestToMember(e,n,t){return new ft({id:e,linkId:n,name:t.name,description:t.email,createdAt:t.createdAt,permissions:t.permissions,type:ht.LINK,spaceRole:ct.IS_MEMBER,linkSettings:t},[L.SHARE_INSIDE,L.SHARE_OUTSIDE])}subscribeToSubmitLinkModal(e,n,t){e.content.submitEvent.pipe(ve(1)).subscribe(c=>{if(Object.keys(c).length){let g=Object.assign(e.content.link,c),E=this.shareLinkGuestToMember(g.userId||-(n.links.length+1),t?.linkId||-(n.links.length+1),g);E.linkId?n.links=[E,...n.links.filter(A=>A.linkId!==E.linkId)]:n.links=[E,...n.links]}e.content.layout.closeDialog()})}genLink(e){return`${document.location.origin}/#/${N.LINK}/${e}`}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var Ut=o=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:o,showWeekNumbers:!1}),Vt=(o,r)=>r.key;function Kt(o,r){o&1&&(s(0,"span",4),p(1,"Edit link"),a())}function qt(o,r){o&1&&(s(0,"span",4),p(1,"New link"),a())}function jt(o,r){o&1&&d(0,"div",54)}function Wt(o,r){if(o&1){let i=G();s(0,"button",53),C(1,"translate"),pe("ngModelChange",function(n){let t=F(i).$implicit,c=u(3);return ce(c.permissions[t.key],n)||(c.permissions[t.key]=n),M(n)}),w("ngModelChange",function(){F(i);let n=u(3);return M(n.onPermissionChange())}),d(2,"fa-icon",50),a(),_(3,jt,1,0,"div",54)}if(o&2){let i=r.$implicit,e=r.$index,n=r.$count,t=u(3);le("ngModel",t.permissions[i.key]),m("tooltip",v(1,4,t.SPACES_PERMISSIONS_TEXT[i.key].text,t.locale.language)),l(2),m("icon",t.SPACES_PERMISSIONS_TEXT[i.key].icon),l(),k(e===n-1?3:-1)}}function Gt(o,r){if(o&1&&(se(0,Wt,4,7,null,null,Vt),C(2,"keyvalue")),o&2){let i=u(2);ae(v(2,0,i.permissions,i.originalOrderKeyValue))}}function Zt(o,r){if(o&1&&(s(0,"div",51),d(1,"app-share-repository",55),a()),o&2){let i=u(2);l(),m("share",i.share)("showIcon",!0)("showFullPath",!0)}}function Yt(o,r){if(o&1){let i=G();s(0,"div",44),d(1,"fa-icon",45),s(2,"div",46)(3,"span"),p(4),a(),s(5,"span",47),p(6),a()(),s(7,"div",48),_(8,Gt,3,3),s(9,"button",49),C(10,"translate"),w("click",function(){F(i);let n=u();return M(n.toggleRequireAuth())}),d(11,"fa-icon",50),a(),s(12,"button",49),C(13,"translate"),w("click",function(){F(i);let n=u();return M(n.copyToClipboard())}),d(14,"fa-icon",50),a()()(),_(15,Zt,2,3,"div",51),d(16,"hr",52)}if(o&2){let i=u();l(),m("icon",i.icons.links),l(3),$(i.linkForm.value.name||i.linkForm.value.shareName),l(2),$(i.linkForm.value.email),l(2),k(i.share&&i.permissions?8:-1),l(),x(O("btn btn-sm ",i.linkForm.value.requireAuth?"btn-success":"btn-warning")),m("tooltip",v(10,15,"Password",i.locale.language)),l(2),m("icon",i.linkForm.value.requireAuth?i.icons.faLock:i.icons.faLockOpen),l(),x(O("btn btn-sm ms-2 ",i.linkWasCopied?"btn-info":"btn-secondary")),m("tooltip",v(13,18,"Copy link",i.locale.language)),l(2),m("icon",i.linkWasCopied?i.icons.faClipboardCheck:i.icons.faClipboard),l(),k(i.share?15:-1)}}function Xt(o,r){if(o&1&&(s(0,"span"),p(1),a()),o&2){let i=u();x(O("badge rounded-pill ",(i.share?i.share.link.nbAccess:i.link.nbAccess)>=i.linkForm.value.limitAccess?"bg-danger":"bg-success")),l(),xe(" ",i.share?i.share.link.nbAccess:i.link.nbAccess,"/",i.linkForm.value.limitAccess," ")}}function zt(o,r){if(o&1&&(s(0,"span",20),p(1),a()),o&2){let i=u();l(),$(i.share?i.share.link.nbAccess:i.link.nbAccess)}}function Qt(o,r){if(o&1&&(s(0,"div",27)(1,"label",56),p(2,"Share name"),a(),d(3,"input",57),C(4,"translate"),a(),s(5,"div",27)(6,"label",58),p(7,"Share description"),a(),d(8,"input",59),C(9,"translate"),a()),o&2){let i=u();l(3),K("is-invalid",i.linkForm.controls.shareName.invalid),m("placeholder",v(4,4,"Share name",i.locale.language)),l(5),m("placeholder",v(9,7,"Share description",i.locale.language))}}function Jt(o,r){if(o&1&&(s(0,"option",30),p(1),a()),o&2){let i=r.$implicit;m("ngValue",i),l(),$(i)}}function ei(o,r){if(o&1&&(s(0,"div",37),d(1,"app-password-strength-bar",60),a()),o&2){let i=u();l(),m("passwordToCheck",i.password)}}function ti(o,r){if(o&1){let i=G();s(0,"button",61),w("click",function(){F(i);let n=u();return M(n.confirmDeletion=!0)}),p(1," Remove "),a()}if(o&2){let i=u();m("disabled",i.confirmDeletion)}}var ne=(()=>{let r=class r{constructor(){this.layout=S(B),this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.submitEvent=new re,this.shareChange=new re,this.locale=S(Q),this.confirmDeletion=!1,this.submitted=!1,this.SPACES_PERMISSIONS_TEXT=mt,this.originalOrderKeyValue=at,this.icons={faEye:Je,faEyeSlash:ot,links:R.LINKS,faClipboard:tt,faClipboardCheck:et,faLock:nt,faLockOpen:it},this.languages=this.layout.getLanguages(),this.minDate=he(),this.defaultPassword=this.layout.translateString(rt),this.passwordMinLength=8,this.password="",this.linkIsExpired=!1,this.linkIsHovered=!1,this.linkWasCopied=!1,this.userService=S(St),this.sharesService=S(Lt),this.linksService=S(Pt),this.spacesService=S(Et),this.minDate.setDate(this.minDate.getDate()+1)}ngOnInit(){this.link?this.initLink():this.file?this.initFile():this.initShareLink(),this.linkForm.value.requireAuth&&(this.password=this.defaultPassword),this.linkForm.value.expiresAt&&this.isLinkIsExpired(this.share?this.share.link.expiresAt:this.link.expiresAt),this.linkForm.controls.expiresAt.valueChanges.subscribe(e=>this.isLinkIsExpired(e))}onPermissionChange(){let e=ut(this.permissions);this.linkForm.controls.permissions.setValue(e),e!==this.share.link.permissions?this.linkForm.controls.permissions.markAsDirty():this.linkForm.controls.permissions.markAsPristine()}toggleRequireAuth(){this.linkForm.controls.requireAuth.setValue(!this.linkForm.value.requireAuth),this.linkForm.controls.requireAuth.markAsDirty()}copyToClipboard(){this.linksService.copyLinkToClipboard(this.share?this.share.link.uuid:this.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.linkForm.value.name||this.linkForm.value.shareName),setTimeout(()=>this.linkWasCopied=!1,3e3)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion){(this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.layout.sendNotification("success","Link deleted",this.share.link.name||this.share.name),this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:c=>{this.layout.sendNotification("error","Delete share",this.share.name,c),this.layout.closeDialog()}});return}if(this.file?.id){let n=this.share,{link:t}=n,c=_e(n,["link"]),g=I(y(y({},t),this.linkForm.value),{password:this.mustIncludePassword()?this.password:void 0});c.name=de("shareName",g),c.description=de("shareDescription",g);let E=this.linksService.shareLinkGuestToMember(-1,-1,g);this.sharesService.createShare(I(y({},c),{type:yt.LINK,links:[E]})).subscribe({next:A=>{this.shareChange.emit(["add",A]),this.layout.sendNotification("success","Link created",t.name||A.name),this.layout.closeDialog()},error:A=>{this.layout.sendNotification("error","Link error",this.share.name,A),this.layout.closeDialog()}});return}let e={};for(let t in this.linkForm.controls)this.linkForm.controls[t].dirty&&(e[t]=this.linkForm.controls[t].value);if(this.mustIncludePassword()&&(e.password=this.password),this.share?.id){Object.keys(e).length&&this.linksService.updateLinkFromSpaceOrShare(this.share.link.id,this.share.id,pt.SHARE,e).subscribe({next:t=>{this.share.name=this.linkForm.value.shareName,this.share.description=this.linkForm.value.shareDescription,this.share.link=Object.assign(this.share.link,t),this.share.updateTimes(),this.share.updatePermission(),this.shareChange.emit(["update",this.share]),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Link error",this.share.link.name||this.share.name,t),this.layout.closeDialog()}}),this.layout.closeDialog();return}this.submitEvent.emit(e)}initFile(){let e=this.sharesService.initShareFromFile(this.userService.user,this.file,this.isSharesRepo,this.inSharesList)[0];this.share=I(y({},e),{link:{id:-1,userId:-1,uuid:"",isActive:!0,requireAuth:!1,permissions:"",nbAccess:0,limitAccess:0}}),this.linksService.genUUID().subscribe(n=>this.share.link.uuid=n),this.initShareLink(),this.onPermissionChange()}initShareLink(){this.linkForm=new me({shareName:new f(this.share.name,z.required),shareDescription:new f(this.share.description||""),name:new f(this.share.link?.name||""),email:new f(this.share.link?.email||"",z.email),language:new f(this.share.link.language||null),limitAccess:new f(this.share.link.limitAccess||null),expiresAt:new f(this.share.link.expiresAt||null),requireAuth:new f(this.share.link.requireAuth||!1),permissions:new f(this.share.link.permissions),isActive:new f(this.share.link.isActive)}),this.permissions=dt(this.share.file.permissions,this.share.link.permissions,[L.SHARE_INSIDE,L.SHARE_OUTSIDE,...this.share.file.isDir?[]:[L.DELETE,L.ADD]])}initLink(){this.linkForm=new me({shareName:new f(""),shareDescription:new f(""),name:new f(this.link.name||""),email:new f(this.link.email||"",z.email),language:new f(this.link.language||null),limitAccess:new f(this.link.limitAccess||null),expiresAt:new f(this.link.expiresAt||null),requireAuth:new f(this.link.requireAuth||!1),permissions:new f(this.link.permissions),isActive:new f(this.link.isActive)}),this.link.id||(this.linkForm.controls.name.markAsDirty(),this.linkForm.controls.isActive.markAsDirty())}isLinkIsExpired(e){if(e==null){if(this.linkIsExpired=!1,e===null)return;this.linkForm.controls.expiresAt.setValue(null)}this.linkIsExpired=he()>=e}mustIncludePassword(){return!!this.password.length&&this.password!==this.defaultPassword}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=W({type:r,selectors:[["app-link-dialog"]],inputs:{share:"share",parentSpaceId:"parentSpaceId",link:"link",file:"file",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList"},outputs:{submitEvent:"submitEvent",shareChange:"shareChange"},decls:73,vars:52,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],["autocomplete","off",3,"formGroup"],[1,"d-flex"],[1,"d-flex","flex-column","flex-grow-1"],[1,"d-flex","align-items-center","cursor-pointer","py-2",3,"mouseover","mouseleave","focus","click"],["for","link","l10nTranslate",""],["id","link",1,"ms-auto"],[1,"d-flex","align-items-center","py-2"],["for","state","l10nTranslate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","state","formControlName","isActive","type","checkbox","role","button",1,"form-check-input"],["for","access","l10nTranslate",""],["id","access",1,"ms-auto"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"d-flex","align-items-center"],["for","guestName","l10nTranslate",""],["id","guestName","formControlName","name","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between","px-0"],["for","guestEmail","l10nTranslate",""],["id","guestEmail","autocomplete","off","formControlName","email","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between"],["for","guestLanguage","l10nTranslate",""],["id","guestLanguage","formControlName","language",1,"form-control","form-select","form-select-sm","ms-auto","w-50"],[3,"ngValue"],["for","limitAccess","l10nTranslate",""],["id","limitAccess","formControlName","limitAccess","min","1","type","number",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","expiration","l10nTranslate",""],["id","expiration","formControlName","expiresAt","placement","left","type","text","bsDatepicker","",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder","bsConfig"],[1,"d-flex","align-items-center","px-0"],["for","requireAuth","translate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","d-none","d-sm-flex","mx-auto"],["id","requireAuth","formControlName","requireAuth","type","checkbox","role","button",1,"form-check-input"],["placeholder","Set a password",2,"width","45%",3,"passwordChange","isRequired","disabled","passwordMinLength","password","showGenerator"],[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,"d-flex","flex-fill","align-items-center"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","flex-column"],[1,"fs-xxxs"],[1,"d-flex","ms-auto"],["container","body","type","button",3,"click","tooltip"],["size","lg",3,"icon"],[1,"d-flex","align-items-center","d-none","d-sm-flex","py-2"],[1,"my-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-0","ms-2",3,"ngModelChange","ngModel","tooltip"],[1,"vr","mx-2"],["id","file",3,"share","showIcon","showFullPath"],["for","shareName","l10nTranslate",""],["id","shareName","formControlName","shareName","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","shareDescription","l10nTranslate",""],["id","shareDescription","formControlName","shareDescription","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[3,"passwordToCheck"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(n,t){n&1&&(s(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),s(3,"span"),p(4),a()(),s(5,"h4",3),_(6,Kt,2,0,"span",4)(7,qt,2,0,"span",4),a(),s(8,"button",5),w("click",function(){return t.layout.closeDialog()}),a()(),s(9,"div",6),_(10,Yt,17,21),s(11,"form",7)(12,"div",8)(13,"div",9)(14,"div",10),w("mouseover",function(){return t.linkIsHovered=!0})("mouseleave",function(){return t.linkIsHovered=!1})("focus",function(){return t.linkIsHovered=!0})("click",function(){return t.copyToClipboard()}),s(15,"label",11),p(16,"Link"),a(),s(17,"span",12),p(18),a()(),s(19,"div",13)(20,"label",14),p(21,"Active"),a(),s(22,"div",15),d(23,"input",16),s(24,"span"),p(25),C(26,"translate"),a()()(),s(27,"div",13)(28,"label",17),p(29,"Current access count"),a(),s(30,"span",18),_(31,Xt,2,5,"span",19)(32,zt,2,1,"span",20),a()(),_(33,Qt,10,10),s(34,"div",21)(35,"label",22),p(36,"Guest name"),a(),d(37,"input",23),C(38,"translate"),a(),s(39,"div",24)(40,"label",25),p(41,"Guest email"),a(),d(42,"input",26),C(43,"translate"),a(),s(44,"div",27)(45,"label",28),p(46,"Guest language"),a(),s(47,"select",29),se(48,Jt,2,2,"option",30,Ie),a()(),s(50,"div",27)(51,"label",31),p(52,"Limit access"),a(),d(53,"input",32),C(54,"translate"),a(),s(55,"div",27)(56,"label",33),p(57,"Expiration"),a(),d(58,"input",34),C(59,"translate"),a(),s(60,"div",35)(61,"label",36),p(62,"Password"),a(),_(63,ei,2,1,"div",37),s(64,"div",15),d(65,"input",38),a(),s(66,"app-input-password",39),pe("passwordChange",function(g){return ce(t.password,g)||(t.password=g),g}),a()()()()()(),s(67,"div",40),_(68,ti,2,1,"button",41),s(69,"button",42),w("click",function(){return t.onCancel()}),p(70,"Cancel"),a(),s(71,"button",43),w("click",function(){return t.onSubmit()}),p(72),a()()),n&2&&(l(2),m("icon",t.icons.links),l(2),$(t.linkForm.value.name||t.linkForm.value.shareName),l(2),k(t.share!=null&&t.share.id||t.link!=null&&t.link.id?6:7),l(4),k(t.share||t.link?10:-1),l(),m("formGroup",t.linkForm),l(6),K("text-primary",t.linkIsHovered),l(),D(" ",t.share?t.share.link.uuid:t.link.uuid," "),l(6),x(O("badge rounded-pill ms-3 ",t.linkForm.value.isActive?"bg-primary":"bg-danger")),l(),D(" ",v(26,35,t.linkForm.value.isActive?"yes":"no",t.locale.language)," "),l(6),k(t.linkForm.value.limitAccess?31:32),l(2),k(t.share?33:-1),l(4),m("placeholder",v(38,38,"Guest name",t.locale.language)),l(5),K("is-invalid",t.linkForm.controls.email.invalid),m("placeholder",v(43,41,"Guest email",t.locale.language)),l(6),ae(t.languages),l(5),m("placeholder",v(54,44,"Unlimited",t.locale.language)),l(5),K("text-danger",t.linkIsExpired),m("placeholder",v(59,47,"Unlimited",t.locale.language))("bsConfig",Le(50,Ut,t.minDate)),l(5),k(t.linkForm.value.requireAuth&&t.password!==t.defaultPassword?63:-1),l(3),m("isRequired",t.linkForm.value.requireAuth)("disabled",!t.linkForm.value.requireAuth)("passwordMinLength",t.passwordMinLength),le("password",t.password),m("showGenerator",!0),l(2),k(t.share!=null&&t.share.id?68:-1),l(3),x(O("btn btn-sm ",t.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",t.linkForm.invalid||t.linkForm.controls.requireAuth.value&&t.password.length<t.passwordMinLength||t.submitted),l(),D(" ",t.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[X,We,ze,Ye,Xe,_t,gt,qe,Me,Ue,Ve,Ne,$e,De,He,Re,Pe,Ke,Fe,Ct,Ze,Ge,je,Oe,Be,At,vt,Te,J],encapsulation:2});let o=r;return o})();export{Rt as a,At as b,Lt as c,ne as d,Pt as e};
1
+ import{a as yt,c as bt,d as T,e as te,g as Et}from"./chunk-V5OITZAT.js";import{a as Ct,b as vt}from"./chunk-XXVSRYSO.js";import{f as kt}from"./chunk-ASH3CAYZ.js";import{f as St,g as gt,h as _t}from"./chunk-FSDIOBH6.js";import{A as ze,Ca as he,Ea as de,Hb as fe,Ib as R,Jb as H,Kb as mt,La as st,Mb as ht,Ob as dt,Qb as ut,Rb as ft,S as ee,Xa as at,Za as lt,mb as L,pb as ct,v as Ge,va as rt,w as Ze,xb as B,y as Ye,z as Xe}from"./chunk-SGDMUCQ7.js";import{d as Y}from"./chunk-J6YSVODR.js";import{$b as Le,$c as De,Cb as w,Eb as u,Ed as J,Fd as We,G as oe,Gc as Te,Jd as Qe,L as ve,Lf as ot,Ma as l,Mb as we,Nb as K,Ob as x,Oc as Z,Pb as p,Qb as $,Rb as D,Sb as xe,Tb as le,Ub as ce,Vb as pe,Xa as W,Xb as O,Zc as X,ad as Ne,bb as re,be as Je,bg as ue,ca as P,cb as Ae,cd as z,ce as et,cg as pt,dc as C,dg as N,ed as Re,f as ke,fa as ye,fc as v,fd as Pe,ga as j,gd as me,ha as S,id as f,jb as _,jd as Fe,kb as k,kd as Me,lb as Ie,ld as $e,lf as it,ma as F,na as M,nb as se,nd as Oe,ob as ae,od as Be,p as V,pa as be,pb as m,pd as He,qb as s,qd as Ue,rb as a,rd as Ve,sb as d,sd as Ke,t as Ce,te as tt,tf as nt,v as b,va as Ee,wd as qe,xd as je,yd as Q,zb as G}from"./chunk-JQOMI5VI.js";import{a as y,b as I,c as _e}from"./chunk-RTRJ3KFH.js";function Ft(o,r){if(o&1&&d(0,"fa-icon",2),o&2){let i=u();x(i.repository.class),we("min-width",i.galleryMode.dimensions/3,"px")("min-height",i.galleryMode.dimensions/3,"px")("font-size",i.galleryMode.faSize/1.8,"px"),m("icon",i.repository.icon)}}function Mt(o,r){if(o&1&&d(0,"fa-icon",5),o&2){let i=u(2);x(i.repository.class),m("icon",i.repository.icon)}}function $t(o,r){if(o&1&&(p(0),C(1,"translate")),o&2){let i=u(2);D(" ",v(1,1,i.repository.label,i.locale.language)," ")}}function Ot(o,r){if(o&1&&p(0),o&2){let i=u(2);D(" ",i.repository.label," ")}}function Bt(o,r){if(o&1&&(s(0,"div",1),_(1,Mt,1,3,"fa-icon",3),s(2,"span",4),_(3,$t,2,4)(4,Ot,1,1),a()()),o&2){let i=u();l(),k(i.showIcon?1:-1),l(2),k(i.repository.translate?3:4)}}var At=(()=>{let r=class r{constructor(){this.showIcon=!0,this.showFullPath=!1,this.locale=S(Q),this.layout=S(B),this.unknownRepository={icon:Qe,label:"",class:"circle-primary-icon",translate:!1}}ngOnInit(){this.setRepository()}ngOnChanges(){this.setRepository()}setRepository(){this.share.parent?.id||this.share.parent?.id===0?this.repository={icon:R.SHARES,label:this.share.parent.name,class:"circle-purple-icon",translate:!1}:this.share.file?.ownerId?this.repository={icon:R.PERSONAL,label:fe.PERSONAL_FILES,class:"circle-primary-icon",translate:!0}:this.share.file?.space?.alias?this.repository={icon:R.SPACES,label:`${this.share.file.space.name}`,class:"circle-primary-icon",translate:!1}:this.share.externalPath?this.repository={icon:R.EXTERNAL,label:"External",class:"circle-primary-icon",translate:!0}:this.repository=y({},this.unknownRepository),this.showFullPath&&this.setFullPath()}setFullPath(){if(!this.repository.label)return;let e=this.share.file?.path?this.share.file.path.split("/").filter(n=>n&&n!=="."):[];this.share.parent?.id&&!this.share.file?.id&&this.share.file?.path.indexOf("/")===-1?e.shift():this.share.file?.space?.alias&&this.share.file.space?.root?.alias&&(e.length?e.unshift(this.share.file.space.root.name):e.push(this.share.file.space.root.name)),this.repository.label===fe.PERSONAL_FILES&&(this.repository.label=this.layout.translateString(this.repository.label)),e.length&&(this.repository.label=`${this.repository.label}/${e.join("/")}`)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=W({type:r,selectors:[["app-share-repository"]],inputs:{share:"share",galleryMode:"galleryMode",showIcon:"showIcon",showFullPath:"showFullPath"},features:[Ee],decls:2,vars:1,consts:[[3,"icon","class","min-width","min-height","font-size"],[1,"d-flex","align-items-center"],[3,"icon"],[1,"me-2",3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"me-2",3,"icon"]],template:function(n,t){n&1&&_(0,Ft,1,9,"fa-icon",0)(1,Bt,5,2,"div",1),n&2&&k(t.galleryMode?0:1)},dependencies:[X,J],encapsulation:2});let o=r;return o})();var h={BASE:`${ee}/shares`,LIST:"list",CHILDREN:"children",LINKS:"links",LINKS_LIST:"links/list",LINKS_UUID:"links/uuid"},It=`${h.BASE}/${h.LIST}`,q=`${h.BASE}/${h.LINKS}`,wt=`${h.BASE}/${h.LINKS_LIST}`,xt=`${h.BASE}/${h.LINKS_UUID}`;var Lt=(()=>{let r=class r{constructor(){this.http=S(Z),this.router=S(Y)}getShare(e){return this.http.get(`${h.BASE}/${e}`).pipe(b(n=>new T(n)))}createShare(e){return this.http.post(h.BASE,e).pipe(b(n=>new T(n)))}updateShare(e){return this.http.put(`${h.BASE}/${e.id}`,e).pipe(b(n=>new T(n)))}deleteShare(e){return this.http.delete(`${h.BASE}/${e}`)}listShares(){return this.http.get(It)}getShareChild(e,n){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}/${n}`).pipe(b(t=>new T(t)))}updateShareChild(e,n,t){return this.http.put(`${h.BASE}/${e}/${h.CHILDREN}/${n}`,t).pipe(b(c=>new T(c)))}deleteShareChild(e,n){return this.http.delete(`${h.BASE}/${e}/${h.CHILDREN}/${n}`)}listChildShares(e){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}`)}initShareFromFile(e,n,t=!1,c=!1){let g,E=null,A=y({id:0,name:"",createdAt:new Date,modifiedAt:new Date,enabled:!0},t?{parent:{id:0,ownerId:0,alias:n.space.alias,name:n.space.name}}:{});if(n){c&&(E=n.root.id);let ge=null;(n?.root?.owner.login===e.login||!n?.space?.alias)&&(n.space=null,ge=e.id),g=new T(I(y({},A),{name:n.name,file:I(y({},n),{path:c?".":st(n.path,2),ownerId:ge})}))}else g=new T(A);return[g,E]}goTo(e){if(!e.id)return Ce(V(!1));if(e.externalPath&&!e.parent?.id)return this.router.navigate([H.SPACES_SHARES],{queryParams:{select:e.name}});if(e.parent?.id&&!e.file?.id&&e.file?.path.indexOf("/")===-1)return this.router.navigate([H.SPACES_SHARES],{queryParams:{select:e.parent.name}});{let[n,t]=bt(e);return this.router.navigate([n],{queryParams:{select:t}})}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var U={BASE:`${ee}/link`,LINK:"link",VALIDATION:"validation",ACCESS:"access",AUTH:"auth"},Tt=`${U.BASE}/${U.VALIDATION}`,Se=`${U.BASE}/${U.ACCESS}`,Dt=`${U.BASE}/${U.AUTH}`;var Nt=new ye("WindowToken",typeof window<"u"&&window.document?{providedIn:"root",factory:()=>window}:{providedIn:"root",factory:()=>{}});var Rt=(()=>{class o{constructor(i,e,n){this.ngZone=i,this.document=e,this.window=n,this.copySubject=new ke,this.copyResponse$=this.copySubject.asObservable(),this.config={}}configure(i){this.config=i}copy(i){if(!this.isSupported||!i)return this.pushCopyResponse({isSuccess:!1,content:i});let e=this.copyFromContent(i);return e?this.pushCopyResponse({content:i,isSuccess:e}):this.pushCopyResponse({isSuccess:!1,content:i})}get isSupported(){return!!this.document.queryCommandSupported&&!!this.document.queryCommandSupported("copy")&&!!this.window}isTargetValid(i){if(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement){if(i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');return!0}throw new Error("Target should be input or textarea")}copyFromInputElement(i,e=!0){try{this.selectTarget(i);let n=this.copyText();return this.clearSelection(e?i:void 0,this.window),n&&this.isCopySuccessInIE11()}catch{return!1}}isCopySuccessInIE11(){let i=this.window.clipboardData;return!(i&&i.getData&&!i.getData("Text"))}copyFromContent(i,e=this.document.body){if(this.tempTextArea&&!e.contains(this.tempTextArea)&&this.destroy(this.tempTextArea.parentElement||void 0),!this.tempTextArea){this.tempTextArea=this.createTempTextArea(this.document,this.window);try{e.appendChild(this.tempTextArea)}catch{throw new Error("Container should be a Dom element")}}this.tempTextArea.value=i;let n=this.copyFromInputElement(this.tempTextArea,!1);return this.config.cleanUpAfterCopy&&this.destroy(this.tempTextArea.parentElement||void 0),n}destroy(i=this.document.body){this.tempTextArea&&(i.removeChild(this.tempTextArea),this.tempTextArea=void 0)}selectTarget(i){return i.select(),i.setSelectionRange(0,i.value.length),i.value.length}copyText(){return this.document.execCommand("copy")}clearSelection(i,e){i&&i.focus(),e.getSelection()?.removeAllRanges()}createTempTextArea(i,e){let n=i.documentElement.getAttribute("dir")==="rtl",t;t=i.createElement("textarea"),t.style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[n?"right":"left"]="-9999px";let c=e.pageYOffset||i.documentElement.scrollTop;return t.style.top=c+"px",t.setAttribute("readonly",""),t}pushCopyResponse(i){this.copySubject.observers.length>0&&this.ngZone.run(()=>{this.copySubject.next(i)})}pushCopyReponse(i){this.pushCopyResponse(i)}}return o.\u0275fac=function(i){return new(i||o)(j(Ae),j(be),j(Nt,8))},o.\u0275prov=P({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Pt=(()=>{let r=class r{constructor(){this.router=S(Y),this.http=S(Z),this.layout=S(B),this.authService=S(kt),this.clipboard=S(Rt)}shareLinksList(){return this.http.get(wt).pipe(b(e=>e.map(n=>new te(n))))}shareLink(e){return this.http.get(`${q}/${e}`).pipe(b(n=>new te(n)))}shareLinkChild(e,n){return this.http.get(`${q}/${e}/${h.CHILDREN}/${n}`).pipe(b(t=>new te(t)))}linkFromSpaceOrShare(e,n,t){return this.http.get(`${q}/${e}/${t}/${n}`)}linkValidation(e){return this.http.get(`${Tt}/${e}`).pipe(b(n=>n.ok?n.link:(n.error&&(n.error===ue.UNAUTHORIZED?this.router.navigate([`${N.LINK}/${e}/${N.AUTH}`]).catch(console.error):this.router.navigate([`${N.LINK}/${e}/${n.error}`]).catch(console.error)),!1)),oe(()=>(this.authService.logout(),V(!1))))}linkAccess(e,n){n.share?.isDir||n.space?.alias?this.http.get(`${Se}/${e}`).subscribe(t=>{this.authService.initUserFromResponse(t),n.space?this.router.navigate([H.SPACES],{queryParams:{select:n.space.name}}).catch(console.error):this.router.navigate([H.SPACES_SHARES],{queryParams:{select:n.share.name}}).catch(console.error)}):lt(`${Se}/${e}`)}linkAuthentication(e,n){return this.http.post(`${Dt}/${e}`,{password:n}).pipe(b(t=>(this.authService.initUserFromResponse(t),this.router.navigate([`${N.LINK}/${e}`]).catch(console.error),!0)),oe(t=>(t.error.message===ue.UNAUTHORIZED?this.layout.sendNotification("warning","Link","Bad password"):this.router.navigate([`${N.LINK}/${e}/${t.error.message}`]).catch(console.error),V(!1))))}copyLinkToClipboard(e){this.clipboard.copyFromContent(this.genLink(e))}genUUID(){return this.http.get(xt).pipe(b(e=>e.uuid))}createLinkDialog(e){this.genUUID().subscribe(n=>{let t=this.layout.openDialog(ne,"md",{initialState:{link:{name:e.name,uuid:n,isActive:!0,nbAccess:0}}});this.subscribeToSubmitLinkModal(t,e)})}updateLinkFromSpaceOrShare(e,n,t,c){return this.http.put(`${q}/${e}/${t}/${n}`,c)}editLinkDialog(e,n,t){if(n.id===0||e?.linkSettings?.uuid){let c=this.layout.openDialog(ne,"md",{initialState:{link:e.linkSettings}});this.subscribeToSubmitLinkModal(c,n,e)}else this.linkFromSpaceOrShare(e.linkId,n.id,t).subscribe({next:c=>{let g=this.layout.openDialog(ne,"md",{initialState:{link:I(y({},c),{permissions:e.permissions})}});this.subscribeToSubmitLinkModal(g,n,e)},error:c=>this.layout.sendNotification("error","Link error",e.name||n.name,c)})}shareLinkGuestToMember(e,n,t){return new ft({id:e,linkId:n,name:t.name,description:t.email,createdAt:t.createdAt,permissions:t.permissions,type:ht.LINK,spaceRole:ct.IS_MEMBER,linkSettings:t},[L.SHARE_INSIDE,L.SHARE_OUTSIDE])}subscribeToSubmitLinkModal(e,n,t){e.content.submitEvent.pipe(ve(1)).subscribe(c=>{if(Object.keys(c).length){let g=Object.assign(e.content.link,c),E=this.shareLinkGuestToMember(g.userId||-(n.links.length+1),t?.linkId||-(n.links.length+1),g);E.linkId?n.links=[E,...n.links.filter(A=>A.linkId!==E.linkId)]:n.links=[E,...n.links]}e.content.layout.closeDialog()})}genLink(e){return`${document.location.origin}/#/${N.LINK}/${e}`}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();var Ut=o=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:o,showWeekNumbers:!1}),Vt=(o,r)=>r.key;function Kt(o,r){o&1&&(s(0,"span",4),p(1,"Edit link"),a())}function qt(o,r){o&1&&(s(0,"span",4),p(1,"New link"),a())}function jt(o,r){o&1&&d(0,"div",54)}function Wt(o,r){if(o&1){let i=G();s(0,"button",53),C(1,"translate"),pe("ngModelChange",function(n){let t=F(i).$implicit,c=u(3);return ce(c.permissions[t.key],n)||(c.permissions[t.key]=n),M(n)}),w("ngModelChange",function(){F(i);let n=u(3);return M(n.onPermissionChange())}),d(2,"fa-icon",50),a(),_(3,jt,1,0,"div",54)}if(o&2){let i=r.$implicit,e=r.$index,n=r.$count,t=u(3);le("ngModel",t.permissions[i.key]),m("tooltip",v(1,4,t.SPACES_PERMISSIONS_TEXT[i.key].text,t.locale.language)),l(2),m("icon",t.SPACES_PERMISSIONS_TEXT[i.key].icon),l(),k(e===n-1?3:-1)}}function Gt(o,r){if(o&1&&(se(0,Wt,4,7,null,null,Vt),C(2,"keyvalue")),o&2){let i=u(2);ae(v(2,0,i.permissions,i.originalOrderKeyValue))}}function Zt(o,r){if(o&1&&(s(0,"div",51),d(1,"app-share-repository",55),a()),o&2){let i=u(2);l(),m("share",i.share)("showIcon",!0)("showFullPath",!0)}}function Yt(o,r){if(o&1){let i=G();s(0,"div",44),d(1,"fa-icon",45),s(2,"div",46)(3,"span"),p(4),a(),s(5,"span",47),p(6),a()(),s(7,"div",48),_(8,Gt,3,3),s(9,"button",49),C(10,"translate"),w("click",function(){F(i);let n=u();return M(n.toggleRequireAuth())}),d(11,"fa-icon",50),a(),s(12,"button",49),C(13,"translate"),w("click",function(){F(i);let n=u();return M(n.copyToClipboard())}),d(14,"fa-icon",50),a()()(),_(15,Zt,2,3,"div",51),d(16,"hr",52)}if(o&2){let i=u();l(),m("icon",i.icons.links),l(3),$(i.linkForm.value.name||i.linkForm.value.shareName),l(2),$(i.linkForm.value.email),l(2),k(i.share&&i.permissions?8:-1),l(),x(O("btn btn-sm ",i.linkForm.value.requireAuth?"btn-success":"btn-warning")),m("tooltip",v(10,15,"Password",i.locale.language)),l(2),m("icon",i.linkForm.value.requireAuth?i.icons.faLock:i.icons.faLockOpen),l(),x(O("btn btn-sm ms-2 ",i.linkWasCopied?"btn-info":"btn-secondary")),m("tooltip",v(13,18,"Copy link",i.locale.language)),l(2),m("icon",i.linkWasCopied?i.icons.faClipboardCheck:i.icons.faClipboard),l(),k(i.share?15:-1)}}function Xt(o,r){if(o&1&&(s(0,"span"),p(1),a()),o&2){let i=u();x(O("badge rounded-pill ",(i.share?i.share.link.nbAccess:i.link.nbAccess)>=i.linkForm.value.limitAccess?"bg-danger":"bg-success")),l(),xe(" ",i.share?i.share.link.nbAccess:i.link.nbAccess,"/",i.linkForm.value.limitAccess," ")}}function zt(o,r){if(o&1&&(s(0,"span",20),p(1),a()),o&2){let i=u();l(),$(i.share?i.share.link.nbAccess:i.link.nbAccess)}}function Qt(o,r){if(o&1&&(s(0,"div",27)(1,"label",56),p(2,"Share name"),a(),d(3,"input",57),C(4,"translate"),a(),s(5,"div",27)(6,"label",58),p(7,"Share description"),a(),d(8,"input",59),C(9,"translate"),a()),o&2){let i=u();l(3),K("is-invalid",i.linkForm.controls.shareName.invalid),m("placeholder",v(4,4,"Share name",i.locale.language)),l(5),m("placeholder",v(9,7,"Share description",i.locale.language))}}function Jt(o,r){if(o&1&&(s(0,"option",30),p(1),a()),o&2){let i=r.$implicit;m("ngValue",i),l(),$(i)}}function ei(o,r){if(o&1&&(s(0,"div",37),d(1,"app-password-strength-bar",60),a()),o&2){let i=u();l(),m("passwordToCheck",i.password)}}function ti(o,r){if(o&1){let i=G();s(0,"button",61),w("click",function(){F(i);let n=u();return M(n.confirmDeletion=!0)}),p(1," Remove "),a()}if(o&2){let i=u();m("disabled",i.confirmDeletion)}}var ne=(()=>{let r=class r{constructor(){this.layout=S(B),this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.submitEvent=new re,this.shareChange=new re,this.locale=S(Q),this.confirmDeletion=!1,this.submitted=!1,this.SPACES_PERMISSIONS_TEXT=mt,this.originalOrderKeyValue=at,this.icons={faEye:Je,faEyeSlash:ot,links:R.LINKS,faClipboard:tt,faClipboardCheck:et,faLock:nt,faLockOpen:it},this.languages=this.layout.getLanguages(),this.minDate=he(),this.defaultPassword=this.layout.translateString(rt),this.passwordMinLength=8,this.password="",this.linkIsExpired=!1,this.linkIsHovered=!1,this.linkWasCopied=!1,this.userService=S(St),this.sharesService=S(Lt),this.linksService=S(Pt),this.spacesService=S(Et),this.minDate.setDate(this.minDate.getDate()+1)}ngOnInit(){this.link?this.initLink():this.file?this.initFile():this.initShareLink(),this.linkForm.value.requireAuth&&(this.password=this.defaultPassword),this.linkForm.value.expiresAt&&this.isLinkIsExpired(this.share?this.share.link.expiresAt:this.link.expiresAt),this.linkForm.controls.expiresAt.valueChanges.subscribe(e=>this.isLinkIsExpired(e))}onPermissionChange(){let e=ut(this.permissions);this.linkForm.controls.permissions.setValue(e),e!==this.share.link.permissions?this.linkForm.controls.permissions.markAsDirty():this.linkForm.controls.permissions.markAsPristine()}toggleRequireAuth(){this.linkForm.controls.requireAuth.setValue(!this.linkForm.value.requireAuth),this.linkForm.controls.requireAuth.markAsDirty()}copyToClipboard(){this.linksService.copyLinkToClipboard(this.share?this.share.link.uuid:this.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.linkForm.value.name||this.linkForm.value.shareName),setTimeout(()=>this.linkWasCopied=!1,3e3)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion){(this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.layout.sendNotification("success","Link deleted",this.share.link.name||this.share.name),this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:c=>{this.layout.sendNotification("error","Delete share",this.share.name,c),this.layout.closeDialog()}});return}if(this.file?.id){let n=this.share,{link:t}=n,c=_e(n,["link"]),g=I(y(y({},t),this.linkForm.value),{password:this.mustIncludePassword()?this.password:void 0});c.name=de("shareName",g),c.description=de("shareDescription",g);let E=this.linksService.shareLinkGuestToMember(-1,-1,g);this.sharesService.createShare(I(y({},c),{type:yt.LINK,links:[E]})).subscribe({next:A=>{this.shareChange.emit(["add",A]),this.layout.sendNotification("success","Link created",t.name||A.name),this.layout.closeDialog()},error:A=>{this.layout.sendNotification("error","Link error",this.share.name,A),this.layout.closeDialog()}});return}let e={};for(let t in this.linkForm.controls)this.linkForm.controls[t].dirty&&(e[t]=this.linkForm.controls[t].value);if(this.mustIncludePassword()&&(e.password=this.password),this.share?.id){Object.keys(e).length&&this.linksService.updateLinkFromSpaceOrShare(this.share.link.id,this.share.id,pt.SHARE,e).subscribe({next:t=>{this.share.name=this.linkForm.value.shareName,this.share.description=this.linkForm.value.shareDescription,this.share.link=Object.assign(this.share.link,t),this.share.updateTimes(),this.share.updatePermission(),this.shareChange.emit(["update",this.share]),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Link error",this.share.link.name||this.share.name,t),this.layout.closeDialog()}}),this.layout.closeDialog();return}this.submitEvent.emit(e)}initFile(){let e=this.sharesService.initShareFromFile(this.userService.user,this.file,this.isSharesRepo,this.inSharesList)[0];this.share=I(y({},e),{link:{id:-1,userId:-1,uuid:"",isActive:!0,requireAuth:!1,permissions:"",nbAccess:0,limitAccess:0}}),this.linksService.genUUID().subscribe(n=>this.share.link.uuid=n),this.initShareLink(),this.onPermissionChange()}initShareLink(){this.linkForm=new me({shareName:new f(this.share.name,z.required),shareDescription:new f(this.share.description||""),name:new f(this.share.link?.name||""),email:new f(this.share.link?.email||"",z.email),language:new f(this.share.link.language||null),limitAccess:new f(this.share.link.limitAccess||null),expiresAt:new f(this.share.link.expiresAt||null),requireAuth:new f(this.share.link.requireAuth||!1),permissions:new f(this.share.link.permissions),isActive:new f(this.share.link.isActive)}),this.permissions=dt(this.share.file.permissions,this.share.link.permissions,[L.SHARE_INSIDE,L.SHARE_OUTSIDE,...this.share.file.isDir?[]:[L.DELETE,L.ADD]])}initLink(){this.linkForm=new me({shareName:new f(""),shareDescription:new f(""),name:new f(this.link.name||""),email:new f(this.link.email||"",z.email),language:new f(this.link.language||null),limitAccess:new f(this.link.limitAccess||null),expiresAt:new f(this.link.expiresAt||null),requireAuth:new f(this.link.requireAuth||!1),permissions:new f(this.link.permissions),isActive:new f(this.link.isActive)}),this.link.id||(this.linkForm.controls.name.markAsDirty(),this.linkForm.controls.isActive.markAsDirty())}isLinkIsExpired(e){if(e==null){if(this.linkIsExpired=!1,e===null)return;this.linkForm.controls.expiresAt.setValue(null)}this.linkIsExpired=he()>=e}mustIncludePassword(){return!!this.password.length&&this.password!==this.defaultPassword}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=W({type:r,selectors:[["app-link-dialog"]],inputs:{share:"share",parentSpaceId:"parentSpaceId",link:"link",file:"file",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList"},outputs:{submitEvent:"submitEvent",shareChange:"shareChange"},decls:73,vars:52,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],["autocomplete","off",3,"formGroup"],[1,"d-flex"],[1,"d-flex","flex-column","flex-grow-1"],[1,"d-flex","align-items-center","cursor-pointer","py-2",3,"mouseover","mouseleave","focus","click"],["for","link","l10nTranslate",""],["id","link",1,"ms-auto"],[1,"d-flex","align-items-center","py-2"],["for","state","l10nTranslate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","state","formControlName","isActive","type","checkbox","role","button",1,"form-check-input"],["for","access","l10nTranslate",""],["id","access",1,"ms-auto"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"d-flex","align-items-center"],["for","guestName","l10nTranslate",""],["id","guestName","formControlName","name","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between","px-0"],["for","guestEmail","l10nTranslate",""],["id","guestEmail","autocomplete","off","formControlName","email","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between"],["for","guestLanguage","l10nTranslate",""],["id","guestLanguage","formControlName","language",1,"form-control","form-select","form-select-sm","ms-auto","w-50"],[3,"ngValue"],["for","limitAccess","l10nTranslate",""],["id","limitAccess","formControlName","limitAccess","min","1","type","number",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","expiration","l10nTranslate",""],["id","expiration","formControlName","expiresAt","placement","left","type","text","bsDatepicker","",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder","bsConfig"],[1,"d-flex","align-items-center","px-0"],["for","requireAuth","translate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","d-none","d-sm-flex","mx-auto"],["id","requireAuth","formControlName","requireAuth","type","checkbox","role","button",1,"form-check-input"],["placeholder","Set a password",2,"width","45%",3,"passwordChange","isRequired","disabled","passwordMinLength","password","showGenerator"],[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,"d-flex","flex-fill","align-items-center"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","flex-column"],[1,"fs-xxxs"],[1,"d-flex","ms-auto"],["container","body","type","button",3,"click","tooltip"],["size","lg",3,"icon"],[1,"d-flex","align-items-center","d-none","d-sm-flex","py-2"],[1,"my-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-0","ms-2",3,"ngModelChange","ngModel","tooltip"],[1,"vr","mx-2"],["id","file",3,"share","showIcon","showFullPath"],["for","shareName","l10nTranslate",""],["id","shareName","formControlName","shareName","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","shareDescription","l10nTranslate",""],["id","shareDescription","formControlName","shareDescription","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[3,"passwordToCheck"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(n,t){n&1&&(s(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),s(3,"span"),p(4),a()(),s(5,"h4",3),_(6,Kt,2,0,"span",4)(7,qt,2,0,"span",4),a(),s(8,"button",5),w("click",function(){return t.layout.closeDialog()}),a()(),s(9,"div",6),_(10,Yt,17,21),s(11,"form",7)(12,"div",8)(13,"div",9)(14,"div",10),w("mouseover",function(){return t.linkIsHovered=!0})("mouseleave",function(){return t.linkIsHovered=!1})("focus",function(){return t.linkIsHovered=!0})("click",function(){return t.copyToClipboard()}),s(15,"label",11),p(16,"Link"),a(),s(17,"span",12),p(18),a()(),s(19,"div",13)(20,"label",14),p(21,"Active"),a(),s(22,"div",15),d(23,"input",16),s(24,"span"),p(25),C(26,"translate"),a()()(),s(27,"div",13)(28,"label",17),p(29,"Current access count"),a(),s(30,"span",18),_(31,Xt,2,5,"span",19)(32,zt,2,1,"span",20),a()(),_(33,Qt,10,10),s(34,"div",21)(35,"label",22),p(36,"Guest name"),a(),d(37,"input",23),C(38,"translate"),a(),s(39,"div",24)(40,"label",25),p(41,"Guest email"),a(),d(42,"input",26),C(43,"translate"),a(),s(44,"div",27)(45,"label",28),p(46,"Guest language"),a(),s(47,"select",29),se(48,Jt,2,2,"option",30,Ie),a()(),s(50,"div",27)(51,"label",31),p(52,"Limit access"),a(),d(53,"input",32),C(54,"translate"),a(),s(55,"div",27)(56,"label",33),p(57,"Expiration"),a(),d(58,"input",34),C(59,"translate"),a(),s(60,"div",35)(61,"label",36),p(62,"Password"),a(),_(63,ei,2,1,"div",37),s(64,"div",15),d(65,"input",38),a(),s(66,"app-input-password",39),pe("passwordChange",function(g){return ce(t.password,g)||(t.password=g),g}),a()()()()()(),s(67,"div",40),_(68,ti,2,1,"button",41),s(69,"button",42),w("click",function(){return t.onCancel()}),p(70,"Cancel"),a(),s(71,"button",43),w("click",function(){return t.onSubmit()}),p(72),a()()),n&2&&(l(2),m("icon",t.icons.links),l(2),$(t.linkForm.value.name||t.linkForm.value.shareName),l(2),k(t.share!=null&&t.share.id||t.link!=null&&t.link.id?6:7),l(4),k(t.share||t.link?10:-1),l(),m("formGroup",t.linkForm),l(6),K("text-primary",t.linkIsHovered),l(),D(" ",t.share?t.share.link.uuid:t.link.uuid," "),l(6),x(O("badge rounded-pill ms-3 ",t.linkForm.value.isActive?"bg-primary":"bg-danger")),l(),D(" ",v(26,35,t.linkForm.value.isActive?"yes":"no",t.locale.language)," "),l(6),k(t.linkForm.value.limitAccess?31:32),l(2),k(t.share?33:-1),l(4),m("placeholder",v(38,38,"Guest name",t.locale.language)),l(5),K("is-invalid",t.linkForm.controls.email.invalid),m("placeholder",v(43,41,"Guest email",t.locale.language)),l(6),ae(t.languages),l(5),m("placeholder",v(54,44,"Unlimited",t.locale.language)),l(5),K("text-danger",t.linkIsExpired),m("placeholder",v(59,47,"Unlimited",t.locale.language))("bsConfig",Le(50,Ut,t.minDate)),l(5),k(t.linkForm.value.requireAuth&&t.password!==t.defaultPassword?63:-1),l(3),m("isRequired",t.linkForm.value.requireAuth)("disabled",!t.linkForm.value.requireAuth)("passwordMinLength",t.passwordMinLength),le("password",t.password),m("showGenerator",!0),l(2),k(t.share!=null&&t.share.id?68:-1),l(3),x(O("btn btn-sm ",t.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",t.linkForm.invalid||t.linkForm.controls.requireAuth.value&&t.password.length<t.passwordMinLength||t.submitted),l(),D(" ",t.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[X,We,ze,Ye,Xe,_t,gt,qe,Me,Ue,Ve,Ne,$e,De,He,Re,Pe,Ke,Fe,Ct,Ze,Ge,je,Oe,Be,At,vt,Te,J],encapsulation:2});let o=r;return o})();export{Rt as a,At as b,Lt as c,ne as d,Pt as e};
@@ -1,4 +1,4 @@
1
- import{f as _e,g as Ce}from"./chunk-2AC4RLMK.js";import{f as ge}from"./chunk-3SC36MTD.js";import{Mb as fe,Rb as z,ua as me,xb as he}from"./chunk-4GYSKJJC.js";import{$b as Z,Cb as h,Dc as Y,Eb as c,Fa as E,Fd as ae,J as L,Jd as le,Lb as D,Ma as r,N as R,Nb as y,Ob as J,Pb as m,Qb as k,Re as pe,Tb as F,Ub as V,Vb as G,Xa as M,Xb as K,Xc as ee,Za as U,Zb as X,Zc as P,_c as te,ab as w,ac as $,ad as ie,ba as I,bb as x,bf as de,dc as A,ed as ne,fc as H,ha as O,hc as j,jb as f,jd as oe,kb as g,lb as q,ma as C,na as v,nb as B,ob as Q,of as ue,pb as d,pe as ce,qb as l,rb as a,sb as _,wd as se,xd as re,ya as W,yb as T,zb as b}from"./chunk-JQOMI5VI.js";var be=function(i){return i[i.USER=0]="USER",i[i.PERSONAL=1]="PERSONAL",i}(be||{}),ye=function(i){return i[i.VISIBLE=0]="VISIBLE",i[i.PRIVATE=1]="PRIVATE",i[i.ISOLATED=2]="ISOLATED",i}(ye||{});function ke(i,n){if(i&1&&(l(0,"span"),m(1),a()),i&2){let s=c();r(),k(s.group.name)}}function Se(i,n){i&1&&(l(0,"span",3),m(1,"New personal group"),a())}function Me(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let s=c();d("icon",s.icons.faSpinner)}}function we(i,n){i&1&&(l(0,"span",3),m(1,"Edit personal group"),a())}function Pe(i,n){i&1&&(l(0,"span",3),m(1,"Edit group"),a())}function Ee(i,n){if(i&1&&(l(0,"h4",5),f(1,we,2,0,"span",3)(2,Pe,2,0,"span",3),a()),i&2){let s=c();r(),g(s.isPersonalGroup?1:2)}}var st=(()=>{let n=class n{constructor(){this.groupChange=new x,this.layout=O(he),this.icons={GROUPS:me.GROUPS,faSpinner:de,faCog:pe,faUsers:ce,faPen:ue},this.isPersonalGroup=!0,this.submitted=!1,this.loading=!1,this.userService=O(ge),this.user=this.userService.user}ngOnInit(){this.originalGroup?.id?(this.isPersonalGroup=this.originalGroup.isPersonalGroup,this.group=new z({id:this.originalGroup.id,name:this.originalGroup.name,description:this.originalGroup.description,createdAt:this.originalGroup.createdAt,modifiedAt:this.originalGroup.modifiedAt,type:this.originalGroup.type})):this.group=new z({id:0,name:"",description:"",createdAt:null,modifiedAt:null,type:fe.PGROUP})}onCancel(){this.layout.closeDialog()}onSubmit(){if(this.loading=!0,this.submitted=!0,this.group.id===0)this.userService.createPersonalGroup(this.makeDto(!0)).subscribe({next:e=>{this.loading=!1,this.groupChange.emit(["add",e]),this.layout.sendNotification("success","Group created",e.name),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.userService.updatePersonalGroup(this.originalGroup.id,this.makeDto()).subscribe({next:t=>{this.loading=!1,this.groupChange.emit(["update",t]),this.layout.sendNotification("success","Group updated",t.name),this.layout.closeDialog()},error:t=>this.onError(t)})}}makeDto(e=!1){return{name:e?this.group.name:this.group.name!==this.originalGroup.name?this.group.name:void 0,description:e?this.group.description:this.group.description!==this.originalGroup.description?this.group.description:void 0}}onError(e){this.layout.sendNotification("error","Group error",this.group.name,e),this.submitted=!1,this.loading=!1}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=M({type:n,selectors:[["app-user-group-dialog"]],inputs:{originalGroup:"originalGroup"},outputs:{groupChange:"groupChange"},decls:23,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","disabled","autoSelect","ngModel"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","disabled"],[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(t,o){t&1&&(l(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),f(3,ke,2,1,"span")(4,Se,2,0,"span",3),f(5,Me,1,1,"fa-icon",4),a(),f(6,Ee,3,1,"h4",5),l(7,"button",6),h("click",function(){return o.layout.closeDialog()}),a()(),l(8,"div",7)(9,"div",8)(10,"div",9)(11,"label",10),m(12,"Name"),a(),l(13,"input",11),G("ngModelChange",function(u){return V(o.group.name,u)||(o.group.name=u),u}),a()(),l(14,"div",12)(15,"label",13),m(16,"Description"),a(),l(17,"input",14),G("ngModelChange",function(u){return V(o.group.description,u)||(o.group.description=u),u}),a()()()(),l(18,"div",15)(19,"button",16),h("click",function(){return o.onCancel()}),m(20,"Cancel"),a(),l(21,"button",17),h("click",function(){return o.onSubmit()}),m(22," Confirm "),a()()),t&2&&(r(2),d("icon",o.icons.GROUPS),r(),g(o.group.id?3:4),r(2),g(o.loading?5:-1),r(),g(o.group.id?6:-1),r(),J(K("btn-close btn-close-white ",o.group.id?"ms-2":"ms-auto"," ms-2")),r(6),y("is-invalid",!o.group.name),d("disabled",!o.isPersonalGroup)("autoSelect",!1),F("ngModel",o.group.name),r(4),F("ngModel",o.group.description),d("disabled",!o.isPersonalGroup),r(4),d("disabled",!o.group.name||o.submitted))},dependencies:[re,ie,ne,se,oe,P,ae,_e],encapsulation:2});let i=n;return i})();var xe=(()=>{let n=class n{onClick(e){e.stopPropagation()}ngOnInit(){setTimeout(()=>{typeof document<"u"&&document.addEventListener("click",this.offClickHandler)},0)}ngOnDestroy(){typeof document<"u"&&document.removeEventListener("click",this.offClickHandler)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=U({type:n,selectors:[["","offClick",""]],hostBindings:function(t,o){t&1&&h("click",function(u){return o.onClick(u)})},inputs:{offClickHandler:[0,"offClick","offClickHandler"]}});let i=n;return i})();var S=class{constructor(n){typeof n=="string"&&(this.id=this.name=n,this.description=""),typeof n=="object"&&(this.id=n.id||n.name,this.name=n.name,this.description=n.description||"")}};var Te=i=>({active:i}),De=(i,n)=>({o:i,i:n});function Fe(i,n){if(i&1){let s=b();l(0,"input",6),h("keydown",function(t){C(s);let o=c();return v(o.inputEvent(t))})("keyup",function(t){C(s);let o=c();return v(o.inputEvent(t,!0))}),a()}if(i&2){let s=c();d("disabled",s.disabled)}}function Ve(i,n){i&1&&T(0)}function Ge(i,n){if(i&1&&(l(0,"span",12),w(1,Ve,1,0,"ng-container",13),a()),i&2){let s=c(2),e=D(6);y("ui-select-allow-clear",s.allowClear&&s.active),r(),d("ngTemplateOutlet",s.customTemplateSelect||e)("ngTemplateOutletContext",Z(4,Te,s.active))}}function Ae(i,n){if(i&1&&(l(0,"span",9),m(1),a()),i&2){let s=c(2);r(),k(s.placeholder)}}function He(i,n){if(i&1){let s=b();l(0,"button",14),h("click",function(t){C(s);let o=c(2);return v(o.removeClick(o.active,t))}),a()}}function je(i,n){if(i&1){let s=b();l(0,"div",4)(1,"span",7),h("click",function(t){C(s);let o=c();return v(o.matchClick(t))}),f(2,Ge,2,6,"span",8)(3,Ae,2,1,"span",9),f(4,He,1,0,"button",10),_(5,"i",11),a()()}if(i&2){let s=c();r(2),g(s.active?2:3),r(2),g(s.allowClear&&s.active?4:-1)}}function ze(i,n){i&1&&T(0)}function Ne(i,n){if(i&1){let s=b();l(0,"li",15)(1,"div",16),h("click",function(t){let o=C(s).$implicit,p=c(2);return v(p.selectMatch(o,t))})("mouseenter",function(){let t=C(s).$implicit,o=c(2);return v(o.selectActive(t))}),w(2,ze,1,0,"ng-container",13),a()()}if(i&2){let s=n.$implicit,e=c(2),t=D(8);r(),y("active",e.isActive(s)),r(),d("ngTemplateOutlet",e.customTemplateOptions||t)("ngTemplateOutletContext",$(4,De,s,e.inputValue))}}function Le(i,n){if(i&1&&(l(0,"ul",5),B(1,Ne,3,7,"li",15,q),a()),i&2){let s=c();r(),Q(s.options)}}function Re(i,n){if(i&1&&(l(0,"div",17)(1,"span",18),_(2,"fa-icon",19),a(),l(3,"span"),m(4),a(),l(5,"div",20),m(6),a()()),i&2){let s=n.active,e=c();r(2),d("icon",e.itemIcon)("fixedWidth",!1),r(2),k(s.name),r(2),k(s.description)}}function Ie(i,n){if(i&1&&(l(0,"a",21)(1,"div",17)(2,"span",18),_(3,"fa-icon",19),a(),_(4,"span",22),A(5,"highlight"),_(6,"span",23),A(7,"highlight"),a()()),i&2){let s=n.i,e=n.o,t=c();r(3),d("icon",t.itemIcon)("fixedWidth",!1),r(),d("innerHtml",t.sanitize(H(5,4,e.name,s)),E),r(2),d("innerHtml",t.sanitize(H(7,7,e.description,s)),E)}}var bt=(()=>{let n=class n{constructor(){this.element=O(W),this.itemIcon=le,this.allowClear=!0,this.placeholder="",this.idField="id",this.nameField="name",this.descriptionField="description",this.data=new x,this.selected=new x,this.removed=new x,this.typed=new x,this.opened=new x,this.options=[],this.itemObjects=[],this.inputMode=!1,this.inputValue="",this.onChange=Function.prototype,this.onTouched=Function.prototype,this.sanitizer=O(ee),this._items=[],this._optionsOpened=!1,this._disabled=!1,this._active=null,this.clickedOutside=this.clickedOutside.bind(this)}set items(e){if(!e.length){this._items=this.itemObjects=[],this.itemObjects=[];return}this._items=e.filter(t=>{if(typeof t=="string"||typeof t=="object"&&t&&t[this.nameField]&&t[this.idField])return t}),this.itemObjects=this._items.map(t=>typeof t=="string"?new S(t):new S({id:t[this.idField],name:t[this.nameField],description:t[this.descriptionField]}))}get optionsOpened(){return this._optionsOpened}set optionsOpened(e){this._optionsOpened=e,this.opened.emit(e)}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._disabled===!0&&this.hideOptions()}get active(){return this._active}set active(e){e?this._active=typeof e=="string"?e:new S({id:e[this.idField],name:e[this.nameField],description:e[this.descriptionField]}):this._active=null}sanitize(e){return this.sanitizer.bypassSecurityTrustHtml(e)}inputEvent(e,t=!1){if(e.keyCode===9)return;if(t&&(e.keyCode===37||e.keyCode===39||e.keyCode===38||e.keyCode===40||e.keyCode===13)){e.preventDefault();return}if(!t&&e.keyCode===8){let p=this.element.nativeElement.querySelector("div.ui-select-container > input");(!p.value||p.value.length<=0)&&(this.active&&this.remove(this.active),e.preventDefault())}if(!t&&e.keyCode===27){this.hideOptions(),e.preventDefault();return}if(!t&&e.keyCode===46&&(this.active&&this.remove(this.active),e.preventDefault()),!t&&e.keyCode===37&&this._items.length>0){this.behavior.first(),e.preventDefault();return}if(!t&&e.keyCode===39&&this._items.length>0){this.behavior.last(),e.preventDefault();return}if(!t&&e.keyCode===38){this.behavior.prev(),e.preventDefault();return}if(!t&&e.keyCode===40){this.behavior.next(),e.preventDefault();return}if(!t&&e.keyCode===13){(!this.active||this.active.id!==this.activeOption.id)&&(this.selectActiveMatch(),this.behavior.next()),e.preventDefault();return}let o=e.target||e.srcElement;o?(this.inputValue=o.value,this.doEvent("typed",this.inputValue||" ")):this.open()}ngOnInit(){this.subscription=this.typed.asObservable().pipe(L(200),R()).subscribe(e=>this.doSearch(e)),this.behavior=new N(this),this.doEvent("typed"," ")}ngOnDestroy(){this.subscription.unsubscribe()}remove(e){this._disabled!==!0&&(this.active=null,this.data.next(this.active),this.doEvent("removed",e),this.inputValue="",this.doEvent("typed"," "))}doEvent(e,t){this[e]&&t&&this[e].next(t),this.onTouched(),(e==="selected"||e==="removed")&&this.onChange(this.active)}clickedOutside(){this.inputMode=!1,this.optionsOpened=!1}writeValue(e){this.active=e,this.data.emit(this.active)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}matchClick(e){this._disabled!==!0&&(this.inputMode=!this.inputMode,this.inputMode===!0&&(this.focusToInput(),this.open()))}mainClick(e){if(this.inputMode===!0||this._disabled===!0)return;if(e.keyCode===46){e.preventDefault(),this.inputEvent(e);return}if(e.keyCode===8){e.preventDefault(),this.inputEvent(e,!0);return}if(e.keyCode===9||e.keyCode===13||e.keyCode===27||e.keyCode>=37&&e.keyCode<=40){e.preventDefault();return}this.inputMode=!0;let t=String.fromCharCode(96<=e.keyCode&&e.keyCode<=105?e.keyCode-48:e.keyCode).toLowerCase();this.focusToInput(t),this.open();let o=e.target||e.srcElement;o.value=t,this.inputEvent(e)}selectActive(e){this.activeOption=e}isActive(e){return this.activeOption.id===e.id}removeClick(e,t){t.stopPropagation(),this.remove(e)}focusToInput(e=""){setTimeout(()=>{let t=this.element.nativeElement.querySelector("div.ui-select-container > input");t&&(t.focus(),t.value=e)},0)}selectMatch(e,t=void 0){t&&(t.stopPropagation(),t.preventDefault()),!(this.options.length<=0)&&(this.active=e,this.data.next(this.active),this.doEvent("selected",e),this.hideOptions(),this.focusToInput(e.name),this.element.nativeElement.querySelector(".ui-select-container").focus())}doSearch(e){this.searchFunction(e).subscribe({next:t=>{this.items=t},error:t=>{console.error(t),this.items=[]},complete:()=>this.behavior.filter()})}open(){this.options=this.itemObjects,this.options.length>0&&this.behavior.first(),this.optionsOpened=!0}hideOptions(){this.inputMode=!1,this.optionsOpened=!1}selectActiveMatch(){this.selectMatch(this.activeOption)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=M({type:n,selectors:[["app-select"]],inputs:{searchFunction:"searchFunction",customTemplateOptions:"customTemplateOptions",customTemplateSelect:"customTemplateSelect",itemIcon:"itemIcon",allowClear:"allowClear",placeholder:"placeholder",idField:"idField",nameField:"nameField",descriptionField:"descriptionField",disabled:"disabled",active:"active"},outputs:{data:"data",selected:"selected",removed:"removed",typed:"typed",opened:"opened"},features:[X([{provide:te,useExisting:I(()=>n),multi:!0}])],decls:9,vars:5,consts:[["DefaultSelect",""],["DefaultOptions",""],[1,"ui-select-container","dropdown","open",3,"keyup","offClick"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"disabled"],[1,"ui-select-match","form-control","form-control-sm"],["role","menu",1,"ui-select-choices","dropdown-menu"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"keydown","keyup","disabled"],["tabindex","-1",1,"ui-select-toggle","no-select",2,"outline","0",3,"click"],[1,"ui-select-match-text","w-100",3,"ui-select-allow-clear"],[1,"ui-select-placeholder"],["aria-label","close","type","button",1,"btn-close"],[1,"dropdown-toggle"],[1,"ui-select-match-text","w-100"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-label","close","type","button",1,"btn-close",3,"click"],["role","menuitem"],[1,"ui-select-choices-row",3,"click","mouseenter"],[1,"d-flex","align-items-center"],[1,"ui-icon","circle-primary-icon","me-2"],[3,"icon","fixedWidth"],[1,"d-flex","ms-auto","me-4","fs-xxxs","text-muted"],["href","javascript:void(0)",1,"dropdown-item","cursor-pointer",2,"padding","3px 5px"],[3,"innerHtml"],[1,"d-flex","ms-auto","fs-xxxs","text-muted",3,"innerHtml"]],template:function(t,o){if(t&1){let p=b();l(0,"div",2),h("keyup",function(Oe){return C(p),v(o.mainClick(Oe))}),_(1,"div"),f(2,Fe,1,1,"input",3)(3,je,6,2,"div",4),f(4,Le,3,0,"ul",5),a(),w(5,Re,7,4,"ng-template",null,0,j)(7,Ie,8,10,"ng-template",null,1,j)}t&2&&(d("offClick",o.clickedOutside),r(),y("ui-disabled",o.disabled),r(),g(o.inputMode?2:3),r(2),g(o.optionsOpened&&o.options&&o.options.length>0?4:-1))},dependencies:[xe,P,Y,Ce],styles:[`.ui-select-container[_ngcontent-%COMP%]{background-color:transparent;border-radius:4px}.ui-select-container.open[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{display:block}.ui-select-container.open[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{outline:none}.ui-select-container[_ngcontent-%COMP%] .ui-icon[_ngcontent-%COMP%]{min-width:26px;min-height:26px;font-size:.85rem}.ui-select-container[_ngcontent-%COMP%] .ui-disabled[_ngcontent-%COMP%]{background-color:#d4dbe8;border-radius:4px;position:absolute;width:100%;height:100%;z-index:5;opacity:.6;top:0;left:0;cursor:not-allowed}.ui-select-container[_ngcontent-%COMP%] .ui-select-search[_ngcontent-%COMP%]{line-height:26px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%]{padding-left:.3rem}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{text-align:start!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{position:absolute;top:45%;right:15px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:1.6em;line-height:.75}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%]{display:flex;align-items:center}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%] > .caret[_ngcontent-%COMP%]{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-placeholder[_ngcontent-%COMP%]{float:left;line-height:26px;color:#8c8c8c;width:100%}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]{cursor:pointer}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%]{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block;padding:3px 5px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;outline:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{pointer-events:none}
1
+ import{f as _e,g as Ce}from"./chunk-IKNQ6PPM.js";import{f as ge}from"./chunk-FSDIOBH6.js";import{Mb as fe,Rb as z,ua as me,xb as he}from"./chunk-SGDMUCQ7.js";import{$b as Z,Cb as h,Dc as Y,Eb as c,Fa as E,Fd as ae,J as L,Jd as le,Lb as D,Ma as r,N as R,Nb as y,Ob as J,Pb as m,Qb as k,Re as pe,Tb as F,Ub as V,Vb as G,Xa as M,Xb as K,Xc as ee,Za as U,Zb as X,Zc as P,_c as te,ab as w,ac as $,ad as ie,ba as I,bb as x,bf as de,dc as A,ed as ne,fc as H,ha as O,hc as j,jb as f,jd as oe,kb as g,lb as q,ma as C,na as v,nb as B,ob as Q,of as ue,pb as d,pe as ce,qb as l,rb as a,sb as _,wd as se,xd as re,ya as W,yb as T,zb as b}from"./chunk-JQOMI5VI.js";var be=function(i){return i[i.USER=0]="USER",i[i.PERSONAL=1]="PERSONAL",i}(be||{}),ye=function(i){return i[i.VISIBLE=0]="VISIBLE",i[i.PRIVATE=1]="PRIVATE",i[i.ISOLATED=2]="ISOLATED",i}(ye||{});function ke(i,n){if(i&1&&(l(0,"span"),m(1),a()),i&2){let s=c();r(),k(s.group.name)}}function Se(i,n){i&1&&(l(0,"span",3),m(1,"New personal group"),a())}function Me(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let s=c();d("icon",s.icons.faSpinner)}}function we(i,n){i&1&&(l(0,"span",3),m(1,"Edit personal group"),a())}function Pe(i,n){i&1&&(l(0,"span",3),m(1,"Edit group"),a())}function Ee(i,n){if(i&1&&(l(0,"h4",5),f(1,we,2,0,"span",3)(2,Pe,2,0,"span",3),a()),i&2){let s=c();r(),g(s.isPersonalGroup?1:2)}}var st=(()=>{let n=class n{constructor(){this.groupChange=new x,this.layout=O(he),this.icons={GROUPS:me.GROUPS,faSpinner:de,faCog:pe,faUsers:ce,faPen:ue},this.isPersonalGroup=!0,this.submitted=!1,this.loading=!1,this.userService=O(ge),this.user=this.userService.user}ngOnInit(){this.originalGroup?.id?(this.isPersonalGroup=this.originalGroup.isPersonalGroup,this.group=new z({id:this.originalGroup.id,name:this.originalGroup.name,description:this.originalGroup.description,createdAt:this.originalGroup.createdAt,modifiedAt:this.originalGroup.modifiedAt,type:this.originalGroup.type})):this.group=new z({id:0,name:"",description:"",createdAt:null,modifiedAt:null,type:fe.PGROUP})}onCancel(){this.layout.closeDialog()}onSubmit(){if(this.loading=!0,this.submitted=!0,this.group.id===0)this.userService.createPersonalGroup(this.makeDto(!0)).subscribe({next:e=>{this.loading=!1,this.groupChange.emit(["add",e]),this.layout.sendNotification("success","Group created",e.name),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.userService.updatePersonalGroup(this.originalGroup.id,this.makeDto()).subscribe({next:t=>{this.loading=!1,this.groupChange.emit(["update",t]),this.layout.sendNotification("success","Group updated",t.name),this.layout.closeDialog()},error:t=>this.onError(t)})}}makeDto(e=!1){return{name:e?this.group.name:this.group.name!==this.originalGroup.name?this.group.name:void 0,description:e?this.group.description:this.group.description!==this.originalGroup.description?this.group.description:void 0}}onError(e){this.layout.sendNotification("error","Group error",this.group.name,e),this.submitted=!1,this.loading=!1}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=M({type:n,selectors:[["app-user-group-dialog"]],inputs:{originalGroup:"originalGroup"},outputs:{groupChange:"groupChange"},decls:23,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","disabled","autoSelect","ngModel"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","disabled"],[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(t,o){t&1&&(l(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),f(3,ke,2,1,"span")(4,Se,2,0,"span",3),f(5,Me,1,1,"fa-icon",4),a(),f(6,Ee,3,1,"h4",5),l(7,"button",6),h("click",function(){return o.layout.closeDialog()}),a()(),l(8,"div",7)(9,"div",8)(10,"div",9)(11,"label",10),m(12,"Name"),a(),l(13,"input",11),G("ngModelChange",function(u){return V(o.group.name,u)||(o.group.name=u),u}),a()(),l(14,"div",12)(15,"label",13),m(16,"Description"),a(),l(17,"input",14),G("ngModelChange",function(u){return V(o.group.description,u)||(o.group.description=u),u}),a()()()(),l(18,"div",15)(19,"button",16),h("click",function(){return o.onCancel()}),m(20,"Cancel"),a(),l(21,"button",17),h("click",function(){return o.onSubmit()}),m(22," Confirm "),a()()),t&2&&(r(2),d("icon",o.icons.GROUPS),r(),g(o.group.id?3:4),r(2),g(o.loading?5:-1),r(),g(o.group.id?6:-1),r(),J(K("btn-close btn-close-white ",o.group.id?"ms-2":"ms-auto"," ms-2")),r(6),y("is-invalid",!o.group.name),d("disabled",!o.isPersonalGroup)("autoSelect",!1),F("ngModel",o.group.name),r(4),F("ngModel",o.group.description),d("disabled",!o.isPersonalGroup),r(4),d("disabled",!o.group.name||o.submitted))},dependencies:[re,ie,ne,se,oe,P,ae,_e],encapsulation:2});let i=n;return i})();var xe=(()=>{let n=class n{onClick(e){e.stopPropagation()}ngOnInit(){setTimeout(()=>{typeof document<"u"&&document.addEventListener("click",this.offClickHandler)},0)}ngOnDestroy(){typeof document<"u"&&document.removeEventListener("click",this.offClickHandler)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=U({type:n,selectors:[["","offClick",""]],hostBindings:function(t,o){t&1&&h("click",function(u){return o.onClick(u)})},inputs:{offClickHandler:[0,"offClick","offClickHandler"]}});let i=n;return i})();var S=class{constructor(n){typeof n=="string"&&(this.id=this.name=n,this.description=""),typeof n=="object"&&(this.id=n.id||n.name,this.name=n.name,this.description=n.description||"")}};var Te=i=>({active:i}),De=(i,n)=>({o:i,i:n});function Fe(i,n){if(i&1){let s=b();l(0,"input",6),h("keydown",function(t){C(s);let o=c();return v(o.inputEvent(t))})("keyup",function(t){C(s);let o=c();return v(o.inputEvent(t,!0))}),a()}if(i&2){let s=c();d("disabled",s.disabled)}}function Ve(i,n){i&1&&T(0)}function Ge(i,n){if(i&1&&(l(0,"span",12),w(1,Ve,1,0,"ng-container",13),a()),i&2){let s=c(2),e=D(6);y("ui-select-allow-clear",s.allowClear&&s.active),r(),d("ngTemplateOutlet",s.customTemplateSelect||e)("ngTemplateOutletContext",Z(4,Te,s.active))}}function Ae(i,n){if(i&1&&(l(0,"span",9),m(1),a()),i&2){let s=c(2);r(),k(s.placeholder)}}function He(i,n){if(i&1){let s=b();l(0,"button",14),h("click",function(t){C(s);let o=c(2);return v(o.removeClick(o.active,t))}),a()}}function je(i,n){if(i&1){let s=b();l(0,"div",4)(1,"span",7),h("click",function(t){C(s);let o=c();return v(o.matchClick(t))}),f(2,Ge,2,6,"span",8)(3,Ae,2,1,"span",9),f(4,He,1,0,"button",10),_(5,"i",11),a()()}if(i&2){let s=c();r(2),g(s.active?2:3),r(2),g(s.allowClear&&s.active?4:-1)}}function ze(i,n){i&1&&T(0)}function Ne(i,n){if(i&1){let s=b();l(0,"li",15)(1,"div",16),h("click",function(t){let o=C(s).$implicit,p=c(2);return v(p.selectMatch(o,t))})("mouseenter",function(){let t=C(s).$implicit,o=c(2);return v(o.selectActive(t))}),w(2,ze,1,0,"ng-container",13),a()()}if(i&2){let s=n.$implicit,e=c(2),t=D(8);r(),y("active",e.isActive(s)),r(),d("ngTemplateOutlet",e.customTemplateOptions||t)("ngTemplateOutletContext",$(4,De,s,e.inputValue))}}function Le(i,n){if(i&1&&(l(0,"ul",5),B(1,Ne,3,7,"li",15,q),a()),i&2){let s=c();r(),Q(s.options)}}function Re(i,n){if(i&1&&(l(0,"div",17)(1,"span",18),_(2,"fa-icon",19),a(),l(3,"span"),m(4),a(),l(5,"div",20),m(6),a()()),i&2){let s=n.active,e=c();r(2),d("icon",e.itemIcon)("fixedWidth",!1),r(2),k(s.name),r(2),k(s.description)}}function Ie(i,n){if(i&1&&(l(0,"a",21)(1,"div",17)(2,"span",18),_(3,"fa-icon",19),a(),_(4,"span",22),A(5,"highlight"),_(6,"span",23),A(7,"highlight"),a()()),i&2){let s=n.i,e=n.o,t=c();r(3),d("icon",t.itemIcon)("fixedWidth",!1),r(),d("innerHtml",t.sanitize(H(5,4,e.name,s)),E),r(2),d("innerHtml",t.sanitize(H(7,7,e.description,s)),E)}}var bt=(()=>{let n=class n{constructor(){this.element=O(W),this.itemIcon=le,this.allowClear=!0,this.placeholder="",this.idField="id",this.nameField="name",this.descriptionField="description",this.data=new x,this.selected=new x,this.removed=new x,this.typed=new x,this.opened=new x,this.options=[],this.itemObjects=[],this.inputMode=!1,this.inputValue="",this.onChange=Function.prototype,this.onTouched=Function.prototype,this.sanitizer=O(ee),this._items=[],this._optionsOpened=!1,this._disabled=!1,this._active=null,this.clickedOutside=this.clickedOutside.bind(this)}set items(e){if(!e.length){this._items=this.itemObjects=[],this.itemObjects=[];return}this._items=e.filter(t=>{if(typeof t=="string"||typeof t=="object"&&t&&t[this.nameField]&&t[this.idField])return t}),this.itemObjects=this._items.map(t=>typeof t=="string"?new S(t):new S({id:t[this.idField],name:t[this.nameField],description:t[this.descriptionField]}))}get optionsOpened(){return this._optionsOpened}set optionsOpened(e){this._optionsOpened=e,this.opened.emit(e)}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._disabled===!0&&this.hideOptions()}get active(){return this._active}set active(e){e?this._active=typeof e=="string"?e:new S({id:e[this.idField],name:e[this.nameField],description:e[this.descriptionField]}):this._active=null}sanitize(e){return this.sanitizer.bypassSecurityTrustHtml(e)}inputEvent(e,t=!1){if(e.keyCode===9)return;if(t&&(e.keyCode===37||e.keyCode===39||e.keyCode===38||e.keyCode===40||e.keyCode===13)){e.preventDefault();return}if(!t&&e.keyCode===8){let p=this.element.nativeElement.querySelector("div.ui-select-container > input");(!p.value||p.value.length<=0)&&(this.active&&this.remove(this.active),e.preventDefault())}if(!t&&e.keyCode===27){this.hideOptions(),e.preventDefault();return}if(!t&&e.keyCode===46&&(this.active&&this.remove(this.active),e.preventDefault()),!t&&e.keyCode===37&&this._items.length>0){this.behavior.first(),e.preventDefault();return}if(!t&&e.keyCode===39&&this._items.length>0){this.behavior.last(),e.preventDefault();return}if(!t&&e.keyCode===38){this.behavior.prev(),e.preventDefault();return}if(!t&&e.keyCode===40){this.behavior.next(),e.preventDefault();return}if(!t&&e.keyCode===13){(!this.active||this.active.id!==this.activeOption.id)&&(this.selectActiveMatch(),this.behavior.next()),e.preventDefault();return}let o=e.target||e.srcElement;o?(this.inputValue=o.value,this.doEvent("typed",this.inputValue||" ")):this.open()}ngOnInit(){this.subscription=this.typed.asObservable().pipe(L(200),R()).subscribe(e=>this.doSearch(e)),this.behavior=new N(this),this.doEvent("typed"," ")}ngOnDestroy(){this.subscription.unsubscribe()}remove(e){this._disabled!==!0&&(this.active=null,this.data.next(this.active),this.doEvent("removed",e),this.inputValue="",this.doEvent("typed"," "))}doEvent(e,t){this[e]&&t&&this[e].next(t),this.onTouched(),(e==="selected"||e==="removed")&&this.onChange(this.active)}clickedOutside(){this.inputMode=!1,this.optionsOpened=!1}writeValue(e){this.active=e,this.data.emit(this.active)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}matchClick(e){this._disabled!==!0&&(this.inputMode=!this.inputMode,this.inputMode===!0&&(this.focusToInput(),this.open()))}mainClick(e){if(this.inputMode===!0||this._disabled===!0)return;if(e.keyCode===46){e.preventDefault(),this.inputEvent(e);return}if(e.keyCode===8){e.preventDefault(),this.inputEvent(e,!0);return}if(e.keyCode===9||e.keyCode===13||e.keyCode===27||e.keyCode>=37&&e.keyCode<=40){e.preventDefault();return}this.inputMode=!0;let t=String.fromCharCode(96<=e.keyCode&&e.keyCode<=105?e.keyCode-48:e.keyCode).toLowerCase();this.focusToInput(t),this.open();let o=e.target||e.srcElement;o.value=t,this.inputEvent(e)}selectActive(e){this.activeOption=e}isActive(e){return this.activeOption.id===e.id}removeClick(e,t){t.stopPropagation(),this.remove(e)}focusToInput(e=""){setTimeout(()=>{let t=this.element.nativeElement.querySelector("div.ui-select-container > input");t&&(t.focus(),t.value=e)},0)}selectMatch(e,t=void 0){t&&(t.stopPropagation(),t.preventDefault()),!(this.options.length<=0)&&(this.active=e,this.data.next(this.active),this.doEvent("selected",e),this.hideOptions(),this.focusToInput(e.name),this.element.nativeElement.querySelector(".ui-select-container").focus())}doSearch(e){this.searchFunction(e).subscribe({next:t=>{this.items=t},error:t=>{console.error(t),this.items=[]},complete:()=>this.behavior.filter()})}open(){this.options=this.itemObjects,this.options.length>0&&this.behavior.first(),this.optionsOpened=!0}hideOptions(){this.inputMode=!1,this.optionsOpened=!1}selectActiveMatch(){this.selectMatch(this.activeOption)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=M({type:n,selectors:[["app-select"]],inputs:{searchFunction:"searchFunction",customTemplateOptions:"customTemplateOptions",customTemplateSelect:"customTemplateSelect",itemIcon:"itemIcon",allowClear:"allowClear",placeholder:"placeholder",idField:"idField",nameField:"nameField",descriptionField:"descriptionField",disabled:"disabled",active:"active"},outputs:{data:"data",selected:"selected",removed:"removed",typed:"typed",opened:"opened"},features:[X([{provide:te,useExisting:I(()=>n),multi:!0}])],decls:9,vars:5,consts:[["DefaultSelect",""],["DefaultOptions",""],[1,"ui-select-container","dropdown","open",3,"keyup","offClick"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"disabled"],[1,"ui-select-match","form-control","form-control-sm"],["role","menu",1,"ui-select-choices","dropdown-menu"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"keydown","keyup","disabled"],["tabindex","-1",1,"ui-select-toggle","no-select",2,"outline","0",3,"click"],[1,"ui-select-match-text","w-100",3,"ui-select-allow-clear"],[1,"ui-select-placeholder"],["aria-label","close","type","button",1,"btn-close"],[1,"dropdown-toggle"],[1,"ui-select-match-text","w-100"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-label","close","type","button",1,"btn-close",3,"click"],["role","menuitem"],[1,"ui-select-choices-row",3,"click","mouseenter"],[1,"d-flex","align-items-center"],[1,"ui-icon","circle-primary-icon","me-2"],[3,"icon","fixedWidth"],[1,"d-flex","ms-auto","me-4","fs-xxxs","text-muted"],["href","javascript:void(0)",1,"dropdown-item","cursor-pointer",2,"padding","3px 5px"],[3,"innerHtml"],[1,"d-flex","ms-auto","fs-xxxs","text-muted",3,"innerHtml"]],template:function(t,o){if(t&1){let p=b();l(0,"div",2),h("keyup",function(Oe){return C(p),v(o.mainClick(Oe))}),_(1,"div"),f(2,Fe,1,1,"input",3)(3,je,6,2,"div",4),f(4,Le,3,0,"ul",5),a(),w(5,Re,7,4,"ng-template",null,0,j)(7,Ie,8,10,"ng-template",null,1,j)}t&2&&(d("offClick",o.clickedOutside),r(),y("ui-disabled",o.disabled),r(),g(o.inputMode?2:3),r(2),g(o.optionsOpened&&o.options&&o.options.length>0?4:-1))},dependencies:[xe,P,Y,Ce],styles:[`.ui-select-container[_ngcontent-%COMP%]{background-color:transparent;border-radius:4px}.ui-select-container.open[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{display:block}.ui-select-container.open[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{outline:none}.ui-select-container[_ngcontent-%COMP%] .ui-icon[_ngcontent-%COMP%]{min-width:26px;min-height:26px;font-size:.85rem}.ui-select-container[_ngcontent-%COMP%] .ui-disabled[_ngcontent-%COMP%]{background-color:#d4dbe8;border-radius:4px;position:absolute;width:100%;height:100%;z-index:5;opacity:.6;top:0;left:0;cursor:not-allowed}.ui-select-container[_ngcontent-%COMP%] .ui-select-search[_ngcontent-%COMP%]{line-height:26px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%]{padding-left:.3rem}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{text-align:start!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{position:absolute;top:45%;right:15px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:1.6em;line-height:.75}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%]{display:flex;align-items:center}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%] > .caret[_ngcontent-%COMP%]{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-placeholder[_ngcontent-%COMP%]{float:left;line-height:26px;color:#8c8c8c;width:100%}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]{cursor:pointer}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%]{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block;padding:3px 5px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;outline:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{pointer-events:none}
2
2
 
3
3
 
4
4
 
@@ -1 +1 @@
1
- import{e as R}from"./chunk-2FUMMTEK.js";import"./chunk-W37K2YDS.js";import"./chunk-Q2UU32ST.js";import"./chunk-WA2KMN23.js";import"./chunk-3SC36MTD.js";import{Ib as T}from"./chunk-4GYSKJJC.js";import{c as w,d as D,h as A,k as I}from"./chunk-ZZ3LHYOY.js";import{b as L,e as b}from"./chunk-J6YSVODR.js";import{Cb as g,Eb as p,Ed as P,Fd as E,Ga as h,Ma as l,Pb as c,Qb as v,Sb as S,Xa as _,Zc as U,dc as x,fc as C,ha as u,jb as f,kb as k,pb as m,qb as n,rb as r,sb as s,yd as y}from"./chunk-JQOMI5VI.js";import"./chunk-RTRJ3KFH.js";function j(e,i){if(e&1&&s(0,"img",6),e&2){let o=p();m("src",o.mimeUrl,h)}}function z(e,i){if(e&1&&s(0,"fa-icon",7),e&2){let o=p();m("icon",o.icons.SPACES)("fixedWidth",!1)}}function M(e,i){if(e&1&&(s(0,"img",14),n(1,"span",15),c(2),r()),e&2){let o=p();m("src",o.link.owner.avatar,h),l(2),v(o.link.owner.fullName)}}function N(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this space"),r())}function B(e,i){if(e&1&&(n(0,"span"),c(1),x(2,"translate"),x(3,"translate"),r()),e&2){let o=p();l(),S("",C(2,2,"share with you this",o.locale.language)," ",C(3,5,o.link.share.isDir?"directory":"file",o.locale.language))}}function F(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this share"),r())}var X=(()=>{let i=class i{constructor(){this.locale=u(y),this.icons={SPACES:T.SPACES},this.logoUrl=I,this.mimeUrl=null,this.activatedRoute=u(L),this.linksService=u(R),this.activatedRoute.params.subscribe(t=>this.linkUUID=t.uuid),this.activatedRoute.data.subscribe(t=>this.setLink(t.link))}setLink(t){t.space||(this.mimeUrl=A(t.share.isDir?t.share.hasParent?D:w:t.share.mime)),this.link=t}followLink(){this.linksService.linkAccess(this.linkUUID,this.link)}};i.\u0275fac=function(d){return new(d||i)},i.\u0275cmp=_({type:i,selectors:[["app-public-link"]],decls:18,vars:5,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],[1,"d-flex","flex-column","align-content-center"],[1,"resource","d-flex","flex-column","align-items-center","mt-3","mx-auto","cursor-pointer",3,"click"],["alt","","height","96",1,"no-select-pointer",3,"src"],[1,"circle-primary-icon",2,"min-width","128px","min-height","128px","font-size","64px",3,"icon","fixedWidth"],[1,"error-code"],[1,"error-text","no-select"],[1,"hr"],[1,"d-flex","justify-content-center","align-items-center"],[1,"solve"],["l10nTranslate",""],["alt","","width","42","height","42",1,"avatar-base-img","me-3",3,"src"],[1,"oops","me-2"]],template:function(d,a){d&1&&(n(0,"div",0)(1,"div",1)(2,"a",2),s(3,"img",3),r()(),n(4,"div",4)(5,"div",5),g("click",function(){return a.followLink()}),f(6,j,1,1,"img",6)(7,z,1,2,"fa-icon",7),n(8,"span",8),c(9),r()()(),n(10,"div",9),s(11,"span",10),n(12,"div",11),f(13,M,3,2),n(14,"span",12),f(15,N,2,0,"span",13)(16,B,4,8,"span")(17,F,2,0,"span",13),r()()()()),d&2&&(l(3),m("src",a.logoUrl,h),l(3),k(a.mimeUrl?6:7),l(3),v((a.link.share==null?null:a.link.share.name)||(a.link.space==null?null:a.link.space.name)),l(4),k(a.link.owner?13:-1),l(2),k(a.link.space?15:a.link.owner?16:17))},dependencies:[b,U,E,P],encapsulation:2});let e=i;return e})();export{X as PublicLinkComponent};
1
+ import{e as R}from"./chunk-T5R64VS4.js";import"./chunk-V5OITZAT.js";import"./chunk-XXVSRYSO.js";import"./chunk-ASH3CAYZ.js";import"./chunk-FSDIOBH6.js";import{Ib as T}from"./chunk-SGDMUCQ7.js";import{c as w,d as D,h as A,k as I}from"./chunk-ZZ3LHYOY.js";import{b as L,e as b}from"./chunk-J6YSVODR.js";import{Cb as g,Eb as p,Ed as P,Fd as E,Ga as h,Ma as l,Pb as c,Qb as v,Sb as S,Xa as _,Zc as U,dc as x,fc as C,ha as u,jb as f,kb as k,pb as m,qb as n,rb as r,sb as s,yd as y}from"./chunk-JQOMI5VI.js";import"./chunk-RTRJ3KFH.js";function j(e,i){if(e&1&&s(0,"img",6),e&2){let o=p();m("src",o.mimeUrl,h)}}function z(e,i){if(e&1&&s(0,"fa-icon",7),e&2){let o=p();m("icon",o.icons.SPACES)("fixedWidth",!1)}}function M(e,i){if(e&1&&(s(0,"img",14),n(1,"span",15),c(2),r()),e&2){let o=p();m("src",o.link.owner.avatar,h),l(2),v(o.link.owner.fullName)}}function N(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this space"),r())}function B(e,i){if(e&1&&(n(0,"span"),c(1),x(2,"translate"),x(3,"translate"),r()),e&2){let o=p();l(),S("",C(2,2,"share with you this",o.locale.language)," ",C(3,5,o.link.share.isDir?"directory":"file",o.locale.language))}}function F(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this share"),r())}var X=(()=>{let i=class i{constructor(){this.locale=u(y),this.icons={SPACES:T.SPACES},this.logoUrl=I,this.mimeUrl=null,this.activatedRoute=u(L),this.linksService=u(R),this.activatedRoute.params.subscribe(t=>this.linkUUID=t.uuid),this.activatedRoute.data.subscribe(t=>this.setLink(t.link))}setLink(t){t.space||(this.mimeUrl=A(t.share.isDir?t.share.hasParent?D:w:t.share.mime)),this.link=t}followLink(){this.linksService.linkAccess(this.linkUUID,this.link)}};i.\u0275fac=function(d){return new(d||i)},i.\u0275cmp=_({type:i,selectors:[["app-public-link"]],decls:18,vars:5,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],[1,"d-flex","flex-column","align-content-center"],[1,"resource","d-flex","flex-column","align-items-center","mt-3","mx-auto","cursor-pointer",3,"click"],["alt","","height","96",1,"no-select-pointer",3,"src"],[1,"circle-primary-icon",2,"min-width","128px","min-height","128px","font-size","64px",3,"icon","fixedWidth"],[1,"error-code"],[1,"error-text","no-select"],[1,"hr"],[1,"d-flex","justify-content-center","align-items-center"],[1,"solve"],["l10nTranslate",""],["alt","","width","42","height","42",1,"avatar-base-img","me-3",3,"src"],[1,"oops","me-2"]],template:function(d,a){d&1&&(n(0,"div",0)(1,"div",1)(2,"a",2),s(3,"img",3),r()(),n(4,"div",4)(5,"div",5),g("click",function(){return a.followLink()}),f(6,j,1,1,"img",6)(7,z,1,2,"fa-icon",7),n(8,"span",8),c(9),r()()(),n(10,"div",9),s(11,"span",10),n(12,"div",11),f(13,M,3,2),n(14,"span",12),f(15,N,2,0,"span",13)(16,B,4,8,"span")(17,F,2,0,"span",13),r()()()()),d&2&&(l(3),m("src",a.logoUrl,h),l(3),k(a.mimeUrl?6:7),l(3),v((a.link.share==null?null:a.link.share.name)||(a.link.space==null?null:a.link.space.name)),l(4),k(a.link.owner?13:-1),l(2),k(a.link.space?15:a.link.owner?16:17))},dependencies:[b,U,E,P],encapsulation:2});let e=i;return e})();export{X as PublicLinkComponent};
@@ -1 +1 @@
1
- import{B as l,Bb as N,Cb as C,Db as k,Ea as c,Jb as p,Nb as U,Pb as h,Qa as $,Rb as u,Ub as E,ib as w,lb as A,mb as m,pb as x,qb as b,yb as r}from"./chunk-4GYSKJJC.js";import{c as a,d as I,h as P,m as R}from"./chunk-ZZ3LHYOY.js";import{Oc as M,ca as T,ha as _,v as n}from"./chunk-JQOMI5VI.js";function g(i){i.file?.id?(i.file.isDir&&(i.file.mime=i.parent?.alias?I:a),i.mimeUrl=P(i.file.mime)):i.mimeUrl=P(i.parent?.alias?I:a)}function y(i){let e,o=i.file.path?i.file.path.split("/").filter(s=>s&&s!=="."):[];if(i.parent?.id){if(!o.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&&(o.length?e=`${e}/${i.file.space.root.alias}`:o.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 t=o.pop();return e&&o.length&&(e=`${e}/${o.join("/")}`),[e,t]}var O=class{constructor(e){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,e),g(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=R}updatePermission(){this.hPerms=h(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=(0,l.default)(this.link.currentAccess).fromNow(!0),this.newly=$(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 B=function(i){return i[i.COMMON=0]="COMMON",i[i.LINK=1]="LINK",i}(B||{}),D=Object.values(m).filter(i=>i!==m.SHARE_INSIDE).sort().join(A);var d=class{constructor(e){this.members=[],this.links=[],this.hPerms={},this.setMembers(c("members",e),e.externalPath||e.file?.isDir?[m.SHARE_INSIDE]:[]),Object.assign(this,e),g(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=R}setMembers(e,o){if(e)for(let t of e)t.linkId?this.links.push(new u(t,[...o,m.SHARE_OUTSIDE])):this.members.push(new u(t,o))}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(A).filter(e=>e===m.SHARE_INSIDE||e===m.ADD&&this.file.id&&!this.file.isDir?!1:!(e===m.DELETE&&this.file.id&&!this.file.isDir)).join(A)))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=h(this.file.permissions):this.externalPath&&(this.hPerms=h(D))}};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=$(this.modifiedAt),this.sort()}addRoot(e,o=!1){e.hPerms=U(e.permissions,[m.SHARE_INSIDE]),e.owner?.login&&(e.owner.avatarUrl=w(e.owner.login)),e.file.mimeUrl=P(e.file?.mime?e.file.mime:a),o?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 o of e){let t=new u(o);t.isLink?this.links.push(t):t.spaceRole===x.IS_MANAGER?this.managers.push(t):this.members.push(t)}}setRoots(e){if(e)for(let o of e)this.addRoot(o)}sort(){E(this.roots,"createdAt",!1),E(this.managers,"createdAt",!1),E(this.members,"createdAt",!1),E(this.links,"createdAt",!1)}};var Oe=(()=>{let e=class e{constructor(){this.http=_(M)}listSpaces(){return this.http.get(N).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=b,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(S=>new d(S)))}updateSpaceShare(t,s){return this.http.put(`${r.BASE}/${t}/${r.SHARES}/${s.id}`,s).pipe(n(S=>new d(S)))}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(S=>new O(S)))}listTrashBins(){return this.http.get(C)}checkSpaceRootPath(t){return this.http.post(k,{path:t})}};e.\u0275fac=function(s){return new(s||e)},e.\u0275prov=T({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();export{B as a,g as b,y as c,d,O as e,f,Oe as g};
1
+ import{B as l,Bb as N,Cb as C,Db as k,Ea as c,Jb as p,Nb as U,Pb as h,Qa as $,Rb as u,Ub as E,ib as w,lb as A,mb as m,pb as x,qb as b,yb as r}from"./chunk-SGDMUCQ7.js";import{c as a,d as I,h as P,m as R}from"./chunk-ZZ3LHYOY.js";import{Oc as M,ca as T,ha as _,v as n}from"./chunk-JQOMI5VI.js";function g(i){i.file?.id?(i.file.isDir&&(i.file.mime=i.parent?.alias?I:a),i.mimeUrl=P(i.file.mime)):i.mimeUrl=P(i.parent?.alias?I:a)}function y(i){let e,o=i.file.path?i.file.path.split("/").filter(s=>s&&s!=="."):[];if(i.parent?.id){if(!o.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&&(o.length?e=`${e}/${i.file.space.root.alias}`:o.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 t=o.pop();return e&&o.length&&(e=`${e}/${o.join("/")}`),[e,t]}var O=class{constructor(e){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,e),g(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=R}updatePermission(){this.hPerms=h(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=(0,l.default)(this.link.currentAccess).fromNow(!0),this.newly=$(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 B=function(i){return i[i.COMMON=0]="COMMON",i[i.LINK=1]="LINK",i}(B||{}),D=Object.values(m).filter(i=>i!==m.SHARE_INSIDE).sort().join(A);var d=class{constructor(e){this.members=[],this.links=[],this.hPerms={},this.setMembers(c("members",e),e.externalPath||e.file?.isDir?[m.SHARE_INSIDE]:[]),Object.assign(this,e),g(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=R}setMembers(e,o){if(e)for(let t of e)t.linkId?this.links.push(new u(t,[...o,m.SHARE_OUTSIDE])):this.members.push(new u(t,o))}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(A).filter(e=>e===m.SHARE_INSIDE||e===m.ADD&&this.file.id&&!this.file.isDir?!1:!(e===m.DELETE&&this.file.id&&!this.file.isDir)).join(A)))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=h(this.file.permissions):this.externalPath&&(this.hPerms=h(D))}};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=$(this.modifiedAt),this.sort()}addRoot(e,o=!1){e.hPerms=U(e.permissions,[m.SHARE_INSIDE]),e.owner?.login&&(e.owner.avatarUrl=w(e.owner.login)),e.file.mimeUrl=P(e.file?.mime?e.file.mime:a),o?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 o of e){let t=new u(o);t.isLink?this.links.push(t):t.spaceRole===x.IS_MANAGER?this.managers.push(t):this.members.push(t)}}setRoots(e){if(e)for(let o of e)this.addRoot(o)}sort(){E(this.roots,"createdAt",!1),E(this.managers,"createdAt",!1),E(this.members,"createdAt",!1),E(this.links,"createdAt",!1)}};var Oe=(()=>{let e=class e{constructor(){this.http=_(M)}listSpaces(){return this.http.get(N).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=b,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(S=>new d(S)))}updateSpaceShare(t,s){return this.http.put(`${r.BASE}/${t}/${r.SHARES}/${s.id}`,s).pipe(n(S=>new d(S)))}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(S=>new O(S)))}listTrashBins(){return this.http.get(C)}checkSpaceRootPath(t){return this.http.post(k,{path:t})}};e.\u0275fac=function(s){return new(s||e)},e.\u0275prov=T({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();export{B as a,g as b,y as c,d,O as e,f,Oe as g};
@@ -1 +1 @@
1
- import{e as N}from"./chunk-2FUMMTEK.js";import"./chunk-W37K2YDS.js";import"./chunk-Q2UU32ST.js";import"./chunk-WA2KMN23.js";import"./chunk-3SC36MTD.js";import"./chunk-4GYSKJJC.js";import{k as F,l as I}from"./chunk-ZZ3LHYOY.js";import{b as _,e as P}from"./chunk-J6YSVODR.js";import{Cb as p,Ed as E,Fd as U,Ga as h,Ma as i,Pb as g,Tb as v,Ub as k,Vb as y,Xa as f,Zc as S,ad as L,ae as D,dc as b,ed as C,fc as w,fe as R,ha as l,jd as A,pb as n,qb as t,rb as o,sb as a,wd as M,yd as T}from"./chunk-JQOMI5VI.js";import"./chunk-RTRJ3KFH.js";var Q=(()=>{let r=class r{constructor(){this.locale=l(T),this.logoUrl=F,this.linkProtected=I,this.icons={faKey:D,faSignInAlt:R},this.password="",this.activatedRoute=l(_),this.linksService=l(N),this.activatedRoute.params.subscribe(c=>this.uuid=c.uuid)}validPassword(){this.password&&this.linksService.linkAuthentication(this.uuid,this.password).subscribe(()=>this.password="")}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=f({type:r,selectors:[["app-public-link-auth"]],decls:18,vars:10,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],["alt","","height","96",1,"cursor-pointer",3,"click","src"],[1,"d-flex","mt-2","ms-auto","me-auto",2,"width","250px"],[1,"input-group"],[1,"input-group-text","bg-gray-light"],[3,"icon"],["autocomplete","off","type","password",1,"form-control","border-0",3,"ngModelChange","keyup.enter","ngModel","placeholder"],["type","button",1,"btn","btn-default","btn-custom","border-0",3,"click","disabled"],[1,"error-text","no-select"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(s,e){s&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),a(3,"img",3),o()(),t(4,"img",4),p("click",function(){return e.validPassword()}),o(),t(5,"div",5)(6,"div",6)(7,"span",7),a(8,"fa-icon",8),o(),t(9,"input",9),b(10,"translate"),y("ngModelChange",function(m){return k(e.password,m)||(e.password=m),m}),p("keyup.enter",function(){return e.validPassword()}),o(),t(11,"button",10),p("click",function(){return e.validPassword()}),a(12,"fa-icon",8),o()()(),t(13,"div",11),a(14,"span",12),t(15,"div")(16,"span",13),g(17,"This share is protected by a password"),o()()()()),s&2&&(i(3),n("src",e.logoUrl,h),i(),n("src",e.linkProtected,h),i(4),n("icon",e.icons.faKey),i(),v("ngModel",e.password),n("placeholder",w(10,7,"Password",e.locale.language)),i(2),n("disabled",!(e.password!=null&&e.password.length)),i(),n("icon",e.icons.faSignInAlt))},dependencies:[P,M,L,C,A,S,U,E],encapsulation:2});let d=r;return d})();export{Q as PublicLinkAuthComponent};
1
+ import{e as N}from"./chunk-T5R64VS4.js";import"./chunk-V5OITZAT.js";import"./chunk-XXVSRYSO.js";import"./chunk-ASH3CAYZ.js";import"./chunk-FSDIOBH6.js";import"./chunk-SGDMUCQ7.js";import{k as F,l as I}from"./chunk-ZZ3LHYOY.js";import{b as _,e as P}from"./chunk-J6YSVODR.js";import{Cb as p,Ed as E,Fd as U,Ga as h,Ma as i,Pb as g,Tb as v,Ub as k,Vb as y,Xa as f,Zc as S,ad as L,ae as D,dc as b,ed as C,fc as w,fe as R,ha as l,jd as A,pb as n,qb as t,rb as o,sb as a,wd as M,yd as T}from"./chunk-JQOMI5VI.js";import"./chunk-RTRJ3KFH.js";var Q=(()=>{let r=class r{constructor(){this.locale=l(T),this.logoUrl=F,this.linkProtected=I,this.icons={faKey:D,faSignInAlt:R},this.password="",this.activatedRoute=l(_),this.linksService=l(N),this.activatedRoute.params.subscribe(c=>this.uuid=c.uuid)}validPassword(){this.password&&this.linksService.linkAuthentication(this.uuid,this.password).subscribe(()=>this.password="")}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=f({type:r,selectors:[["app-public-link-auth"]],decls:18,vars:10,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],["alt","","height","96",1,"cursor-pointer",3,"click","src"],[1,"d-flex","mt-2","ms-auto","me-auto",2,"width","250px"],[1,"input-group"],[1,"input-group-text","bg-gray-light"],[3,"icon"],["autocomplete","off","type","password",1,"form-control","border-0",3,"ngModelChange","keyup.enter","ngModel","placeholder"],["type","button",1,"btn","btn-default","btn-custom","border-0",3,"click","disabled"],[1,"error-text","no-select"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(s,e){s&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),a(3,"img",3),o()(),t(4,"img",4),p("click",function(){return e.validPassword()}),o(),t(5,"div",5)(6,"div",6)(7,"span",7),a(8,"fa-icon",8),o(),t(9,"input",9),b(10,"translate"),y("ngModelChange",function(m){return k(e.password,m)||(e.password=m),m}),p("keyup.enter",function(){return e.validPassword()}),o(),t(11,"button",10),p("click",function(){return e.validPassword()}),a(12,"fa-icon",8),o()()(),t(13,"div",11),a(14,"span",12),t(15,"div")(16,"span",13),g(17,"This share is protected by a password"),o()()()()),s&2&&(i(3),n("src",e.logoUrl,h),i(),n("src",e.linkProtected,h),i(4),n("icon",e.icons.faKey),i(),v("ngModel",e.password),n("placeholder",w(10,7,"Password",e.locale.language)),i(2),n("disabled",!(e.password!=null&&e.password.length)),i(),n("icon",e.icons.faSignInAlt))},dependencies:[P,M,L,C,A,S,U,E],encapsulation:2});let d=r;return d})();export{Q as PublicLinkAuthComponent};
@@ -1 +1 @@
1
- import{a as P,b as R,c as X,d as $}from"./chunk-HX6BM5E5.js";import{Xa as K,xb as O}from"./chunk-4GYSKJJC.js";import{Cb as h,Eb as l,Fd as B,Gc as k,Le as F,Ma as r,Pb as m,Rb as y,Re as E,Ue as L,Uf as I,Xa as M,Ye as d,Yf as N,Zc as z,ab as T,bb as g,dc as S,fc as V,ha as C,jb as b,kb as D,ma as w,na as f,nb as _,ob as v,pb as p,qb as a,rb as s,sb as u,zb as x}from"./chunk-JQOMI5VI.js";var A=(t,i)=>i.key;function U(t,i){if(t&1){let e=x();a(0,"li",6)(1,"a",8),h("click",function(){let o=w(e).$implicit,c=l(2);return f(c.setView(o.key))}),a(2,"span"),u(3,"fa-icon",2),m(4),s()()()}if(t&2){let e=i.$implicit;r(3),p("icon",e.value.icon),r(),y(" ",e.value.text)}}function j(t,i){if(t&1&&u(0,"fa-icon",10),t&2){let e=l(3);p("icon",e.sortParams.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function q(t,i){if(t&1){let e=x();a(0,"li",6)(1,"a",8),h("click",function(){let o=w(e).$implicit,c=l(2);return f(c.sortBy.emit(o.key))}),a(2,"span",9),m(3),b(4,j,1,1,"fa-icon",10),s()()()}if(t&2){let e=i.$implicit,n=l(2);r(3),y(" ",e.value," "),r(),D(n.sortParams.column===e.key?4:-1)}}function G(t,i){if(t&1&&(a(0,"ul",4)(1,"li",5),m(2,"Display"),s(),_(3,U,5,2,"li",6,A),S(5,"keyvalue"),a(6,"li",7),m(7,"Sort by"),s(),_(8,q,5,2,"li",6,A),S(10,"keyvalue"),s()),t&2){let e=l();r(3),v(V(5,0,e.viewsMode,e.originalOrderKeyValue)),r(5),v(V(10,3,e.sortFields,e.originalOrderKeyValue))}}var le=(()=>{let i=class i{constructor(){this.switchView=new g,this.sortBy=new g,this.originalOrderKeyValue=K,this.icons={faCog:E,faArrowDown:I,faArrowUp:L},this.viewsMode={tl:{enabled:!1,text:"List",icon:F},th:{enabled:!0,text:"S",icon:d,dimensions:96,image:56,imageRes:128,faSize:30,textSize:10,margins:18},thM:{enabled:!0,text:"M",icon:d,dimensions:112,image:72,imageRes:192,faSize:34,textSize:11,margins:18},thL:{enabled:!0,text:"L",icon:d,dimensions:152,image:112,imageRes:256,faSize:50,textSize:12,margins:18},thXl:{enabled:!0,text:"XL",icon:d,dimensions:192,image:152,imageRes:512,faSize:65,textSize:13,margins:18},thXxl:{enabled:!0,text:"XXL",icon:N,dimensions:232,image:192,imageRes:1024,faSize:80,textSize:13,margins:18}},this.layout=C(O),this.viewsMode.tl.text=this.layout.translateString(this.viewsMode.tl.text)}get viewMode(){return localStorage.getItem("viewMode")||"tl"}set viewMode(n){localStorage.setItem("viewMode",n)}currentView(){return this.viewsMode[this.viewMode]}setView(n){this.viewMode=n,this.switchView.emit(this.viewsMode[n])}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=M({type:i,selectors:[["app-navigation-view"]],inputs:{sortParams:"sortParams",sortFields:"sortFields"},outputs:{switchView:"switchView",sortBy:"sortBy"},decls:4,vars:1,consts:[["dropdown","",1,"btn-group","btn-group-sm"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],[3,"icon"],["class","dropdown-menu dropdown-menu-right","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu","dropdown-menu-right"],["l10nTranslate","",1,"dropdown-header","fw-bold"],["role","menuitem"],["l10nTranslate","",1,"dropdown-header","fw-bold","mt-1"],[1,"dropdown-item",3,"click"],["l10nTranslate","",1,"me-2"],["size","xs",1,"ms-1",3,"icon"]],template:function(o,c){o&1&&(a(0,"div",0)(1,"button",1),u(2,"fa-icon",2),s(),T(3,G,11,6,"ul",3),s()),o&2&&(r(2),p("icon",c.icons.faCog))},dependencies:[$,R,X,P,z,B,k],encapsulation:2,changeDetection:0});let t=i;return t})();export{le as a};
1
+ import{a as P,b as R,c as X,d as $}from"./chunk-MFZROUQ3.js";import{Xa as K,xb as O}from"./chunk-SGDMUCQ7.js";import{Cb as h,Eb as l,Fd as B,Gc as k,Le as F,Ma as r,Pb as m,Rb as y,Re as E,Ue as L,Uf as I,Xa as M,Ye as d,Yf as N,Zc as z,ab as T,bb as g,dc as S,fc as V,ha as C,jb as b,kb as D,ma as w,na as f,nb as _,ob as v,pb as p,qb as a,rb as s,sb as u,zb as x}from"./chunk-JQOMI5VI.js";var A=(t,i)=>i.key;function U(t,i){if(t&1){let e=x();a(0,"li",6)(1,"a",8),h("click",function(){let o=w(e).$implicit,c=l(2);return f(c.setView(o.key))}),a(2,"span"),u(3,"fa-icon",2),m(4),s()()()}if(t&2){let e=i.$implicit;r(3),p("icon",e.value.icon),r(),y(" ",e.value.text)}}function j(t,i){if(t&1&&u(0,"fa-icon",10),t&2){let e=l(3);p("icon",e.sortParams.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function q(t,i){if(t&1){let e=x();a(0,"li",6)(1,"a",8),h("click",function(){let o=w(e).$implicit,c=l(2);return f(c.sortBy.emit(o.key))}),a(2,"span",9),m(3),b(4,j,1,1,"fa-icon",10),s()()()}if(t&2){let e=i.$implicit,n=l(2);r(3),y(" ",e.value," "),r(),D(n.sortParams.column===e.key?4:-1)}}function G(t,i){if(t&1&&(a(0,"ul",4)(1,"li",5),m(2,"Display"),s(),_(3,U,5,2,"li",6,A),S(5,"keyvalue"),a(6,"li",7),m(7,"Sort by"),s(),_(8,q,5,2,"li",6,A),S(10,"keyvalue"),s()),t&2){let e=l();r(3),v(V(5,0,e.viewsMode,e.originalOrderKeyValue)),r(5),v(V(10,3,e.sortFields,e.originalOrderKeyValue))}}var le=(()=>{let i=class i{constructor(){this.switchView=new g,this.sortBy=new g,this.originalOrderKeyValue=K,this.icons={faCog:E,faArrowDown:I,faArrowUp:L},this.viewsMode={tl:{enabled:!1,text:"List",icon:F},th:{enabled:!0,text:"S",icon:d,dimensions:96,image:56,imageRes:128,faSize:30,textSize:10,margins:18},thM:{enabled:!0,text:"M",icon:d,dimensions:112,image:72,imageRes:192,faSize:34,textSize:11,margins:18},thL:{enabled:!0,text:"L",icon:d,dimensions:152,image:112,imageRes:256,faSize:50,textSize:12,margins:18},thXl:{enabled:!0,text:"XL",icon:d,dimensions:192,image:152,imageRes:512,faSize:65,textSize:13,margins:18},thXxl:{enabled:!0,text:"XXL",icon:N,dimensions:232,image:192,imageRes:1024,faSize:80,textSize:13,margins:18}},this.layout=C(O),this.viewsMode.tl.text=this.layout.translateString(this.viewsMode.tl.text)}get viewMode(){return localStorage.getItem("viewMode")||"tl"}set viewMode(n){localStorage.setItem("viewMode",n)}currentView(){return this.viewsMode[this.viewMode]}setView(n){this.viewMode=n,this.switchView.emit(this.viewsMode[n])}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=M({type:i,selectors:[["app-navigation-view"]],inputs:{sortParams:"sortParams",sortFields:"sortFields"},outputs:{switchView:"switchView",sortBy:"sortBy"},decls:4,vars:1,consts:[["dropdown","",1,"btn-group","btn-group-sm"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],[3,"icon"],["class","dropdown-menu dropdown-menu-right","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu","dropdown-menu-right"],["l10nTranslate","",1,"dropdown-header","fw-bold"],["role","menuitem"],["l10nTranslate","",1,"dropdown-header","fw-bold","mt-1"],[1,"dropdown-item",3,"click"],["l10nTranslate","",1,"me-2"],["size","xs",1,"ms-1",3,"icon"]],template:function(o,c){o&1&&(a(0,"div",0)(1,"button",1),u(2,"fa-icon",2),s(),T(3,G,11,6,"ul",3),s()),o&2&&(r(2),p("icon",c.icons.faCog))},dependencies:[$,R,X,P,z,B,k],encapsulation:2,changeDetection:0});let t=i;return t})();export{le as a};
@@ -1 +1 @@
1
- import{Na as ee,Ra as te}from"./chunk-4GYSKJJC.js";import{Cb as f,Eb as P,Ed as J,Fd as K,Ib as D,Jb as I,Kb as F,Lb as M,Lf as Y,Ma as s,Mb as d,Nb as R,Pb as q,Tb as O,Ub as B,Vb as N,Xa as g,Zc as x,ad as Q,ag as $,bb as L,be as X,dc as A,ed as W,fc as G,ha as E,jb as C,jd as j,kb as y,ma as c,na as u,pb as w,qb as l,rb as m,sb as b,tb as T,td as z,ub as S,va as k,vb as V,wd as H,xd as U,yd as Z,zb as v}from"./chunk-JQOMI5VI.js";var ae=["Password"];function le(n,i){n&1&&(l(0,"label",1),q(1,"Password"),m())}function de(n,i){if(n&1){let _=v();l(0,"div",5),f("click",function(){c(_);let e=P();return u(e.randomPassword())}),l(1,"span"),b(2,"fa-icon",6),m()()}if(n&2){let _=P();s(2),w("icon",_.icons.faDice)}}var ve=(()=>{let i=class i{constructor(){this.passwordChange=new L,this.passwordMinLength=8,this.showGenerator=!1,this.showLabel=!1,this.disabled=!1,this.isRequired=!1,this.focus=!1,this.locale=E(Z),this.toggleVisiblePassword=te,this.icons={faEye:X,faEyeSlash:Y,faDice:$}}ngOnInit(){this.focus&&setTimeout(()=>{this.passwordElement.nativeElement.focus(),this.passwordElement.nativeElement.select()},0)}randomPassword(){this.disabled||this.passwordChange.emit(ee(this.passwordMinLength+2))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=g({type:i,selectors:[["app-input-password"]],viewQuery:function(e,t){if(e&1&&D(ae,7),e&2){let r;I(r=F())&&(t.passwordElement=r.first)}},inputs:{password:"password",passwordMinLength:"passwordMinLength",placeholder:"placeholder",showGenerator:"showGenerator",showLabel:"showLabel",disabled:"disabled",isRequired:"isRequired",focus:"focus"},outputs:{passwordChange:"passwordChange"},decls:9,vars:12,consts:[["Password",""],["for","password","l10nTranslate",""],["id","password",1,"input-group","input-group-sm",2,"min-width","150px"],["autocomplete","off","type","password",1,"form-control","form-control-sm",3,"ngModelChange","keyup","ngModel","disabled","placeholder","required"],[1,"input-group-text","cursor-pointer"],[1,"input-group-text","cursor-pointer",3,"click"],[3,"icon"]],template:function(e,t){if(e&1){let r=v();C(0,le,2,0,"label",1),l(1,"div",2)(2,"input",3,0),A(4,"translate"),N("ngModelChange",function(a){return c(r),B(t.password,a)||(t.password=a),u(a)}),f("keyup",function(){return c(r),u(t.passwordChange.emit(t.password))}),m(),C(5,de,3,1,"div",4),l(6,"div",5),f("click",function(){c(r);let a=M(3);return u(t.toggleVisiblePassword(a))}),l(7,"span"),b(8,"fa-icon",6),m()()()}if(e&2){let r=M(3);y(t.showLabel?0:-1),s(2),R("is-invalid",t.isRequired&&(t.password==null?null:t.password.length)<t.passwordMinLength),O("ngModel",t.password),w("disabled",t.disabled)("placeholder",G(4,9,t.placeholder,t.locale.language))("required",t.isRequired),s(3),y(t.showGenerator?5:-1),s(3),w("icon",r.type==="text"?t.icons.faEye:t.icons.faEyeSlash)}},dependencies:[H,Q,W,z,j,U,x,K,J],encapsulation:2});let n=i;return n})();var Me=(()=>{let i=class i{constructor(){this.passwordToCheck="",this.bar0="",this.bar1="",this.bar2="",this.bar3="",this.bar4="",this.colors=["#F00","#F90","#FF0","#7ACC00","#06854B"]}static measureStrength(o){let e=0,t=/[$-/:-?{-~!"^_`[\]]/g,r=/[a-z]+/.test(o),h=/[A-Z]+/.test(o),a=/[0-9]+/.test(o),oe=t.test(o),ie=[r,h,a,oe],p=0;for(let ne of ie)p+=ne===!0?1:0;return e+=2*o.length+(o.length>=10?1:0),e+=p*10,e=o.length<=6?Math.min(e,10):e,e=p===1?Math.min(e,10):e,e=p===2?Math.min(e,20):e,e=p===3?Math.min(e,40):e,e}ngOnChanges(o){let e=o.passwordToCheck.currentValue;if(this.setBarColors(5,"#DDD"),e){let t=this.getColor(i.measureStrength(e));this.setBarColors(t.idx,t.col)}}getColor(o){let e=Math.min(Math.floor((o-1)/10),4);return{idx:e+1,col:this.colors[e]}}setBarColors(o,e){for(let t=0;t<o;t++)this[`bar${t}`]=e}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=g({type:i,selectors:[["app-password-strength-bar"]],inputs:{passwordToCheck:"passwordToCheck"},features:[k],decls:8,vars:10,consts:[["strength",""],["id","strength"],["id","strengthBar"],[1,"point"]],template:function(e,t){e&1&&(T(0,"div",1,0)(2,"ul",2),V(3,"li",3)(4,"li",3)(5,"li",3)(6,"li",3)(7,"li",3),S()()),e&2&&(s(3),d("background-color",t.bar0),s(),d("background-color",t.bar1),s(),d("background-color",t.bar2),s(),d("background-color",t.bar3),s(),d("background-color",t.bar4))},styles:["ul#strengthBar[_ngcontent-%COMP%]{display:flex;list-style:none;padding:0;align-self:center;margin-bottom:-2px}.point[_ngcontent-%COMP%]:last-child{margin:0!important}.point[_ngcontent-%COMP%]{background:#ddd;border-radius:2px;height:6px;margin-right:1px;width:20px}"],changeDetection:0});let n=i;return n})();export{ve as a,Me as b};
1
+ import{Na as ee,Ra as te}from"./chunk-SGDMUCQ7.js";import{Cb as f,Eb as P,Ed as J,Fd as K,Ib as D,Jb as I,Kb as F,Lb as M,Lf as Y,Ma as s,Mb as d,Nb as R,Pb as q,Tb as O,Ub as B,Vb as N,Xa as g,Zc as x,ad as Q,ag as $,bb as L,be as X,dc as A,ed as W,fc as G,ha as E,jb as C,jd as j,kb as y,ma as c,na as u,pb as w,qb as l,rb as m,sb as b,tb as T,td as z,ub as S,va as k,vb as V,wd as H,xd as U,yd as Z,zb as v}from"./chunk-JQOMI5VI.js";var ae=["Password"];function le(n,i){n&1&&(l(0,"label",1),q(1,"Password"),m())}function de(n,i){if(n&1){let _=v();l(0,"div",5),f("click",function(){c(_);let e=P();return u(e.randomPassword())}),l(1,"span"),b(2,"fa-icon",6),m()()}if(n&2){let _=P();s(2),w("icon",_.icons.faDice)}}var ve=(()=>{let i=class i{constructor(){this.passwordChange=new L,this.passwordMinLength=8,this.showGenerator=!1,this.showLabel=!1,this.disabled=!1,this.isRequired=!1,this.focus=!1,this.locale=E(Z),this.toggleVisiblePassword=te,this.icons={faEye:X,faEyeSlash:Y,faDice:$}}ngOnInit(){this.focus&&setTimeout(()=>{this.passwordElement.nativeElement.focus(),this.passwordElement.nativeElement.select()},0)}randomPassword(){this.disabled||this.passwordChange.emit(ee(this.passwordMinLength+2))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=g({type:i,selectors:[["app-input-password"]],viewQuery:function(e,t){if(e&1&&D(ae,7),e&2){let r;I(r=F())&&(t.passwordElement=r.first)}},inputs:{password:"password",passwordMinLength:"passwordMinLength",placeholder:"placeholder",showGenerator:"showGenerator",showLabel:"showLabel",disabled:"disabled",isRequired:"isRequired",focus:"focus"},outputs:{passwordChange:"passwordChange"},decls:9,vars:12,consts:[["Password",""],["for","password","l10nTranslate",""],["id","password",1,"input-group","input-group-sm",2,"min-width","150px"],["autocomplete","off","type","password",1,"form-control","form-control-sm",3,"ngModelChange","keyup","ngModel","disabled","placeholder","required"],[1,"input-group-text","cursor-pointer"],[1,"input-group-text","cursor-pointer",3,"click"],[3,"icon"]],template:function(e,t){if(e&1){let r=v();C(0,le,2,0,"label",1),l(1,"div",2)(2,"input",3,0),A(4,"translate"),N("ngModelChange",function(a){return c(r),B(t.password,a)||(t.password=a),u(a)}),f("keyup",function(){return c(r),u(t.passwordChange.emit(t.password))}),m(),C(5,de,3,1,"div",4),l(6,"div",5),f("click",function(){c(r);let a=M(3);return u(t.toggleVisiblePassword(a))}),l(7,"span"),b(8,"fa-icon",6),m()()()}if(e&2){let r=M(3);y(t.showLabel?0:-1),s(2),R("is-invalid",t.isRequired&&(t.password==null?null:t.password.length)<t.passwordMinLength),O("ngModel",t.password),w("disabled",t.disabled)("placeholder",G(4,9,t.placeholder,t.locale.language))("required",t.isRequired),s(3),y(t.showGenerator?5:-1),s(3),w("icon",r.type==="text"?t.icons.faEye:t.icons.faEyeSlash)}},dependencies:[H,Q,W,z,j,U,x,K,J],encapsulation:2});let n=i;return n})();var Me=(()=>{let i=class i{constructor(){this.passwordToCheck="",this.bar0="",this.bar1="",this.bar2="",this.bar3="",this.bar4="",this.colors=["#F00","#F90","#FF0","#7ACC00","#06854B"]}static measureStrength(o){let e=0,t=/[$-/:-?{-~!"^_`[\]]/g,r=/[a-z]+/.test(o),h=/[A-Z]+/.test(o),a=/[0-9]+/.test(o),oe=t.test(o),ie=[r,h,a,oe],p=0;for(let ne of ie)p+=ne===!0?1:0;return e+=2*o.length+(o.length>=10?1:0),e+=p*10,e=o.length<=6?Math.min(e,10):e,e=p===1?Math.min(e,10):e,e=p===2?Math.min(e,20):e,e=p===3?Math.min(e,40):e,e}ngOnChanges(o){let e=o.passwordToCheck.currentValue;if(this.setBarColors(5,"#DDD"),e){let t=this.getColor(i.measureStrength(e));this.setBarColors(t.idx,t.col)}}getColor(o){let e=Math.min(Math.floor((o-1)/10),4);return{idx:e+1,col:this.colors[e]}}setBarColors(o,e){for(let t=0;t<o;t++)this[`bar${t}`]=e}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=g({type:i,selectors:[["app-password-strength-bar"]],inputs:{passwordToCheck:"passwordToCheck"},features:[k],decls:8,vars:10,consts:[["strength",""],["id","strength"],["id","strengthBar"],[1,"point"]],template:function(e,t){e&1&&(T(0,"div",1,0)(2,"ul",2),V(3,"li",3)(4,"li",3)(5,"li",3)(6,"li",3)(7,"li",3),S()()),e&2&&(s(3),d("background-color",t.bar0),s(),d("background-color",t.bar1),s(),d("background-color",t.bar2),s(),d("background-color",t.bar3),s(),d("background-color",t.bar4))},styles:["ul#strengthBar[_ngcontent-%COMP%]{display:flex;list-style:none;padding:0;align-self:center;margin-bottom:-2px}.point[_ngcontent-%COMP%]:last-child{margin:0!important}.point[_ngcontent-%COMP%]{background:#ddd;border-radius:2px;height:6px;margin-right:1px;width:20px}"],changeDetection:0});let n=i;return n})();export{ve as a,Me as b};
@@ -1 +1 @@
1
- import{x as xe,z as Se}from"./chunk-JOPTBE35.js";import{a as be}from"./chunk-DZNKFVGE.js";import{h as ge}from"./chunk-2AC4RLMK.js";import{g as Ce}from"./chunk-W37K2YDS.js";import{g as fe,h as _e}from"./chunk-3SC36MTD.js";import{Da as ce,Ib as de,Kb as ue,Qb as he,Xa as pe,bb as y,v as te,w as ie,xb as me,ya as le}from"./chunk-4GYSKJJC.js";import{Cb as h,Eb as l,Ed as Z,Fd as ee,Ga as V,Gc as Q,Gf as re,Ib as $,Jb as L,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,Zc as F,bb as P,bf as ne,dc as C,ec as q,ed as z,f as A,fc as x,ha as f,jb as _,jd as Y,kb as b,kf as oe,ma as S,na as v,nb as T,ob as w,of as ae,pb as p,qb as r,rb as c,sb as m,vf as se,wd as G,ya as B,yd as J,zb as E}from"./chunk-JQOMI5VI.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let a=class a{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new P(!0),this.renamingInProgress=new P(!0),this.elementRef=f(B),this.renderer=f(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=U({type:a,selectors:[["","appInputEdit",""]],hostBindings:function(t,o){t&1&&h("blur",function(){return o.onBlur()})("keyup.enter",function(){return o.onEnter()})("keyup.esc",function(){return o.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=a;return i})();var Ee=["InputRename"],Fe=(i,a)=>a.alias,Pe=(i,a)=>a.key;function Te(i,a){if(i&1&&m(0,"app-user-avatar",15)(1,"div",10),i&2){let n=l().$implicit;p("user",n.owner)}}function we(i,a){if(i&1){let n=E();r(0,"input",16,0),h("updateObject",function(t){S(n);let o=l(2);return v(o.onRenameRoot(t))}),c()}if(i&2){let n=l().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,a){if(i&1&&(r(0,"span"),d(1),c()),i&2){let n=l(2).$implicit;s(),g(n.externalPath)}}function Me(i,a){if(i&1&&(r(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=l(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,a){if(i&1&&(r(0,"div",17)(1,"span"),d(2),c()(),r(3,"div",18),_(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=l().$implicit,e=l();s(2),g(n.name),s(2),b(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,a){if(i&1){let n=E();r(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let o=l().$implicit,u=l().$implicit;return H(u.hPerms[o.key],t)||(u.hPerms[o.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=l(2).$implicit,o=l();return v(o.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=l().$implicit,e=l().$implicit,t=l();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function De(i,a){if(i&1&&(r(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=l().$implicit,e=l().$implicit,t=l();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,a){if(i&1&&_(0,Oe,3,9,"button",19)(1,De,3,7,"button",20),i&2){let n=l().$implicit,e=l();b(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function je(i,a){if(i&1){let n=E();r(0,"div",1)(1,"div",2)(2,"div",3),_(3,Te,2,1),m(4,"img",4),r(5,"div",5),_(6,we,2,2,"input",6)(7,ke,6,2),c()(),r(8,"div",7)(9,"div",8),d(10),c(),r(11,"div",8),d(12),C(13,"amTimeAgo"),c()(),r(14,"div",9),m(15,"div",10),T(16,Ae,2,1,null,null,Pe),C(18,"keyvalue"),m(19,"div",11),r(20,"button",12),C(21,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.setRenamed(t))}),m(22,"fa-icon",13),c(),r(23,"button",14),C(24,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.removeRoot(t))}),m(25,"fa-icon",13),c()()()()}if(i&2){let n=a.$implicit,e=l();s(3),b(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),b(n.isRenamed?6:7),s(4),g(n.alias),s(2),g(q(13,15,n.createdAt)),s(4),w(x(18,17,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(21,20,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(24,23,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let a=class a{constructor(){this.showUsers=!0,this.addRootFile=null,this.locale=f(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(o=>o.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(o=>o.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-manage-roots"]],viewQuery:function(t,o){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(o.inputRename=u.first)}},inputs:{space:"space",user:"user",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","justify-content-end"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,o){t&1&&T(0,je,26,26,"div",1,Fe),t&2&&w(o.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=a;return i})();function Be(i,a){if(i&1&&m(0,"fa-icon",3),i&2){let n=l();p("icon",n.icons.faSpinner)}}function Ve(i,a){i&1&&(r(0,"span",5),d(1,"You have no files anchored on this space"),c())}var Pt=(()=>{let a=class a{constructor(){this.layout=f(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=f(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["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(t,o){t&1&&(r(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),r(3,"span"),d(4),c()(),_(5,Be,1,1,"fa-icon",3),r(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),r(9,"button",6),h("click",function(){return o.layout.closeDialog()}),c()(),r(10,"div",7),m(11,"app-space-manage-roots",8),_(12,Ve,2,0,"span",5),c(),r(13,"div",9)(14,"button",10),h("click",function(){return o.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),r(18,"button",12),h("click",function(){return o.layout.closeDialog()}),d(19,"Cancel"),c(),r(20,"button",13),h("click",function(){return o.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",o.icons.SPACES),s(2),g(o.space.name),s(),b(o.loading?5:-1),s(6),p("space",o.space)("user",o.user)("showUsers",!1)("addRootFile",o.addRootFileEvent),s(),b(o.space.roots.length?-1:12),s(3),p("icon",o.icons.faPlus),s(),p("icon",o.icons.faAnchor),s(4),p("disabled",o.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=a;return i})();export{ye as a,Re as b,Pt as c};
1
+ import{x as xe,z as Se}from"./chunk-MPVQM2PL.js";import{a as be}from"./chunk-LK3ILZP5.js";import{h as ge}from"./chunk-IKNQ6PPM.js";import{g as Ce}from"./chunk-V5OITZAT.js";import{g as fe,h as _e}from"./chunk-FSDIOBH6.js";import{Da as ce,Ib as de,Kb as ue,Qb as he,Xa as pe,bb as y,v as te,w as ie,xb as me,ya as le}from"./chunk-SGDMUCQ7.js";import{Cb as h,Eb as l,Ed as Z,Fd as ee,Ga as V,Gc as Q,Gf as re,Ib as $,Jb as L,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,Zc as F,bb as P,bf as ne,dc as C,ec as q,ed as z,f as A,fc as x,ha as f,jb as _,jd as Y,kb as b,kf as oe,ma as S,na as v,nb as T,ob as w,of as ae,pb as p,qb as r,rb as c,sb as m,vf as se,wd as G,ya as B,yd as J,zb as E}from"./chunk-JQOMI5VI.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let a=class a{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new P(!0),this.renamingInProgress=new P(!0),this.elementRef=f(B),this.renderer=f(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=U({type:a,selectors:[["","appInputEdit",""]],hostBindings:function(t,o){t&1&&h("blur",function(){return o.onBlur()})("keyup.enter",function(){return o.onEnter()})("keyup.esc",function(){return o.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=a;return i})();var Ee=["InputRename"],Fe=(i,a)=>a.alias,Pe=(i,a)=>a.key;function Te(i,a){if(i&1&&m(0,"app-user-avatar",15)(1,"div",10),i&2){let n=l().$implicit;p("user",n.owner)}}function we(i,a){if(i&1){let n=E();r(0,"input",16,0),h("updateObject",function(t){S(n);let o=l(2);return v(o.onRenameRoot(t))}),c()}if(i&2){let n=l().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,a){if(i&1&&(r(0,"span"),d(1),c()),i&2){let n=l(2).$implicit;s(),g(n.externalPath)}}function Me(i,a){if(i&1&&(r(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=l(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,a){if(i&1&&(r(0,"div",17)(1,"span"),d(2),c()(),r(3,"div",18),_(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=l().$implicit,e=l();s(2),g(n.name),s(2),b(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,a){if(i&1){let n=E();r(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let o=l().$implicit,u=l().$implicit;return H(u.hPerms[o.key],t)||(u.hPerms[o.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=l(2).$implicit,o=l();return v(o.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=l().$implicit,e=l().$implicit,t=l();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function De(i,a){if(i&1&&(r(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=l().$implicit,e=l().$implicit,t=l();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,a){if(i&1&&_(0,Oe,3,9,"button",19)(1,De,3,7,"button",20),i&2){let n=l().$implicit,e=l();b(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function je(i,a){if(i&1){let n=E();r(0,"div",1)(1,"div",2)(2,"div",3),_(3,Te,2,1),m(4,"img",4),r(5,"div",5),_(6,we,2,2,"input",6)(7,ke,6,2),c()(),r(8,"div",7)(9,"div",8),d(10),c(),r(11,"div",8),d(12),C(13,"amTimeAgo"),c()(),r(14,"div",9),m(15,"div",10),T(16,Ae,2,1,null,null,Pe),C(18,"keyvalue"),m(19,"div",11),r(20,"button",12),C(21,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.setRenamed(t))}),m(22,"fa-icon",13),c(),r(23,"button",14),C(24,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.removeRoot(t))}),m(25,"fa-icon",13),c()()()()}if(i&2){let n=a.$implicit,e=l();s(3),b(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),b(n.isRenamed?6:7),s(4),g(n.alias),s(2),g(q(13,15,n.createdAt)),s(4),w(x(18,17,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(21,20,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(24,23,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let a=class a{constructor(){this.showUsers=!0,this.addRootFile=null,this.locale=f(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(o=>o.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(o=>o.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-manage-roots"]],viewQuery:function(t,o){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(o.inputRename=u.first)}},inputs:{space:"space",user:"user",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","justify-content-end"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,o){t&1&&T(0,je,26,26,"div",1,Fe),t&2&&w(o.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=a;return i})();function Be(i,a){if(i&1&&m(0,"fa-icon",3),i&2){let n=l();p("icon",n.icons.faSpinner)}}function Ve(i,a){i&1&&(r(0,"span",5),d(1,"You have no files anchored on this space"),c())}var Pt=(()=>{let a=class a{constructor(){this.layout=f(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=f(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["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(t,o){t&1&&(r(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),r(3,"span"),d(4),c()(),_(5,Be,1,1,"fa-icon",3),r(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),r(9,"button",6),h("click",function(){return o.layout.closeDialog()}),c()(),r(10,"div",7),m(11,"app-space-manage-roots",8),_(12,Ve,2,0,"span",5),c(),r(13,"div",9)(14,"button",10),h("click",function(){return o.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),r(18,"button",12),h("click",function(){return o.layout.closeDialog()}),d(19,"Cancel"),c(),r(20,"button",13),h("click",function(){return o.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",o.icons.SPACES),s(2),g(o.space.name),s(),b(o.loading?5:-1),s(6),p("space",o.space)("user",o.user)("showUsers",!1)("addRootFile",o.addRootFileEvent),s(),b(o.space.roots.length?-1:12),s(3),p("icon",o.icons.faPlus),s(),p("icon",o.icons.faAnchor),s(4),p("disabled",o.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=a;return i})();export{ye as a,Re as b,Pt as c};