@sync-in/server 1.10.0 → 1.10.1

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 (75) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -2
  3. package/package.json +2 -3
  4. package/server/app.bootstrap.js +3 -22
  5. package/server/app.bootstrap.js.map +1 -1
  6. package/server/applications/comments/services/comments-queries.service.js +5 -9
  7. package/server/applications/comments/services/comments-queries.service.js.map +1 -1
  8. package/server/applications/users/users.e2e-spec.js +0 -1
  9. package/server/applications/users/users.e2e-spec.js.map +1 -1
  10. package/server/applications/webdav/constants/webdav.js +7 -0
  11. package/server/applications/webdav/constants/webdav.js.map +1 -1
  12. package/server/applications/webdav/utils/bootstrap.js +45 -0
  13. package/server/applications/webdav/utils/bootstrap.js.map +1 -0
  14. package/server/applications/webdav/webdav.controller.js +1 -1
  15. package/server/applications/webdav/webdav.controller.js.map +1 -1
  16. package/server/applications/webdav/webdav.e2e-spec.js +131 -2
  17. package/server/applications/webdav/webdav.e2e-spec.js.map +1 -1
  18. package/server/authentication/auth.e2e-spec.js +12 -6
  19. package/server/authentication/auth.e2e-spec.js.map +1 -1
  20. package/server/authentication/guards/auth-basic.guard.spec.js +23 -0
  21. package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
  22. package/server/authentication/guards/auth-basic.strategy.js +3 -3
  23. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  24. package/server/authentication/guards/auth-digest.strategy.js +32 -11
  25. package/server/authentication/guards/auth-digest.strategy.js.map +1 -1
  26. package/server/authentication/guards/implementations/http-basic.strategy.js +76 -0
  27. package/server/authentication/guards/implementations/http-basic.strategy.js.map +1 -0
  28. package/server/authentication/guards/implementations/http-digest.strategy.js +155 -0
  29. package/server/authentication/guards/implementations/http-digest.strategy.js.map +1 -0
  30. package/server/authentication/services/auth-manager.service.js +1 -2
  31. package/server/authentication/services/auth-manager.service.js.map +1 -1
  32. package/static/{chunk-XBKCQCBI.js → chunk-2GXOVGTD.js} +1 -1
  33. package/static/{chunk-QHJT5H4M.js → chunk-3MVPXC3U.js} +1 -1
  34. package/static/{chunk-I5SPA4G2.js → chunk-3VRUIWQG.js} +1 -1
  35. package/static/{chunk-L3BIP4AA.js → chunk-3ZBAQTHJ.js} +1 -1
  36. package/static/{chunk-D55YR5X7.js → chunk-76M3BMK6.js} +11 -11
  37. package/static/{chunk-GXWGB7WO.js → chunk-76REYAEA.js} +1 -1
  38. package/static/{chunk-CCZWPM7Q.js → chunk-7HJFIMNF.js} +1 -1
  39. package/static/{chunk-NIR4YE2E.js → chunk-7KAYOR3A.js} +1 -1
  40. package/static/{chunk-O3YLAEVE.js → chunk-AALPWGPB.js} +2 -2
  41. package/static/{chunk-KWFELZTM.js → chunk-CN5YVRFT.js} +1 -1
  42. package/static/{chunk-B6HQYQYG.js → chunk-CVXLHSO5.js} +1 -1
  43. package/static/{chunk-R7PLNX75.js → chunk-D2MLAO5N.js} +1 -1
  44. package/static/{chunk-HGODIZTV.js → chunk-EKWB5W72.js} +1 -1
  45. package/static/{chunk-PQZLR4P3.js → chunk-FTFEQDWH.js} +1 -1
  46. package/static/{chunk-3WZ6F3LC.js → chunk-FWQJ4ZCD.js} +1 -1
  47. package/static/{chunk-FIUF2JM4.js → chunk-IHS5LSJJ.js} +1 -1
  48. package/static/{chunk-G3PL6YX3.js → chunk-J7474P3L.js} +1 -1
  49. package/static/{chunk-LGIVVJDD.js → chunk-JAJ7VXMB.js} +1 -1
  50. package/static/{chunk-T42BV6TR.js → chunk-KEZNIIFH.js} +1 -1
  51. package/static/{chunk-OUHCDDT6.js → chunk-LWSCODLD.js} +1 -1
  52. package/static/{chunk-6WMXMIE4.js → chunk-NIKNG2FX.js} +1 -1
  53. package/static/{chunk-KPOQLDWF.js → chunk-QGHNJVJ6.js} +1 -1
  54. package/static/{chunk-GWRAGN3M.js → chunk-QJ22N76V.js} +1 -1
  55. package/static/{chunk-NJJURHX4.js → chunk-QTPIEEZW.js} +1 -1
  56. package/static/{chunk-ZHOE5VEY.js → chunk-R4VYKZVJ.js} +1 -1
  57. package/static/{chunk-7VRYTDX4.js → chunk-RBTLSPYJ.js} +1 -1
  58. package/static/{chunk-GQHXYX6Z.js → chunk-S44QIK3G.js} +1 -1
  59. package/static/{chunk-45AZ6ZML.js → chunk-S6H2ELRY.js} +1 -1
  60. package/static/{chunk-E32J777S.js → chunk-SPQH3ATC.js} +1 -1
  61. package/static/{chunk-DGCVA6BM.js → chunk-TTWMFWEC.js} +1 -1
  62. package/static/{chunk-ULSPQ3HP.js → chunk-U5E5H2DD.js} +1 -1
  63. package/static/{chunk-LNLBIJZD.js → chunk-VBTZDHZ3.js} +1 -1
  64. package/static/{chunk-I3FR3A45.js → chunk-VZFZUI6D.js} +1 -1
  65. package/static/{chunk-S3TTWPQA.js → chunk-WFMEUST4.js} +1 -1
  66. package/static/{chunk-27Z3SYRL.js → chunk-WRK2FTKU.js} +1 -1
  67. package/static/{chunk-4TPFERL6.js → chunk-WZPF4LS2.js} +1 -1
  68. package/static/{chunk-POUWUMC4.js → chunk-X7NHX5C7.js} +1 -1
  69. package/static/{chunk-XTVNHFKX.js → chunk-XSURUW7C.js} +1 -1
  70. package/static/{chunk-5O66CLTD.js → chunk-XX3JPJUM.js} +1 -1
  71. package/static/{chunk-3RPUQ22U.js → chunk-XZHWESIY.js} +1 -1
  72. package/static/{chunk-3JYMJQYT.js → chunk-ZHUBWKA2.js} +1 -1
  73. package/static/{chunk-XEWLBWFF.js → chunk-ZU5MQTFN.js} +1 -1
  74. package/static/index.html +1 -1
  75. package/static/{main-YKDNJ7LK.js → main-5O3KLGIR.js} +3 -3
@@ -1,4 +1,4 @@
1
- import{a as Gc}from"./chunk-KPOQLDWF.js";import{a as kn,b as no,c as ai,d as $c,e as oo,f as si,g as zc,h as ot,i as Fn,j as li}from"./chunk-T42BV6TR.js";import{A as He,a as Le,e as wc,g as Tc,i as Ec,j as Ac,k as Cr,l as Fc,m as Pc,n as Ic,o as Rc,p as Nc,q as wa,r as Vc,s as Mn,t as Lc,u as Oc,v as Bc,w as vr,x as Uc,y as Hc,z as yr}from"./chunk-E32J777S.js";import{a as Wc,b as Pn,c as ce}from"./chunk-3WZ6F3LC.js";import{b as jc,c as Kc,d as Qc,h as ro}from"./chunk-XTVNHFKX.js";import{c as ri,d as Dc,h as io,i as kc,j as xr,k as Mc,m as Sr}from"./chunk-RTNEBRKJ.js";import{a as xc,b as mr,c as En,d as gr}from"./chunk-NIR4YE2E.js";import{a as Ze}from"./chunk-S3TTWPQA.js";import{b as yc}from"./chunk-JXZCNFW7.js";import{a as vc}from"./chunk-HGODIZTV.js";import{a as qi,c as oi,d as ba,e as bc}from"./chunk-R7PLNX75.js";import{a as Fi,b as Pi,c as Ii,d as Ri}from"./chunk-ULSPQ3HP.js";import{a as Yi,d as Ql,e as Dn}from"./chunk-7VRYTDX4.js";import{a as nt,c as An}from"./chunk-XEWLBWFF.js";import{a as Fe}from"./chunk-3JYMJQYT.js";import{a as ya,b as jt}from"./chunk-6WMXMIE4.js";import{a as Qs,b as qs,c as Ys,e as Ca,f as pn,g as Xs,h as Zs,i as il,j as cc,k as _c,l as dr,m as Ye,o as fc,r as hc,t as gc,w as oe}from"./chunk-B6HQYQYG.js";import{a as gt}from"./chunk-DGCVA6BM.js";import{a as ur,b as _r,c as fr,d as hr,e as Je}from"./chunk-ZHOE5VEY.js";import{a as Tn,b as Cc}from"./chunk-GWRAGN3M.js";import{a as Xe}from"./chunk-3RPUQ22U.js";import{a as Ve,b as Ut}from"./chunk-GQHXYX6Z.js";import{a as Sc}from"./chunk-27Z3SYRL.js";import{$a as ar,A as Zn,Aa as ht,B as Ki,Ba as vn,Ca as Yl,Cb as I,D as ft,Da as Xl,E as or,Ea as eo,F as Ae,Fa as Zl,G as Qi,H as Ol,I as ki,J as Wt,Ja as Jl,Jb as mi,Ka as ec,Kb as pc,L as xa,La as tc,Lb as dc,M as Bl,Mb as Bt,N as Ul,Nb as ie,O as Hl,Ob as z,P as $l,Pb as mc,Q as zl,Qa as ic,R as Gl,Rb as uc,S as Wl,Sa as yn,T as jl,Ta as nc,U as rr,Ua as fe,V as Kl,Va as oc,W as ql,Wa as bn,_a as rc,a as _e,b as Gt,cb as sr,db as Sa,e as Ks,f as ga,gb as De,i as ji,ib as lr,j as Po,jb as ac,k as Yn,kb as sc,mb as to,n as di,q as tl,qb as cr,r as Ro,rb as we,s as Me,sb as lc,t as Ke,tb as wn,v as nl,va as Vt,vb as te,w as ol,wa as Lt,x as rl,xa as Ot,ya as qe,za as Jn}from"./chunk-O3YLAEVE.js";import{a as Gs,b as Jt,c as ln,d as Ce,e as cn,f as Ws,g as js}from"./chunk-QHJT5H4M.js";import{$b as Es,$c as $s,$d as Lo,Aa as Ci,Ab as Ie,Ae as Go,Bb as y,Bd as fn,Bf as mt,Cb as Do,Cd as be,Cf as Jo,Dc as Fs,Dd as wi,De as Wo,E as Dt,Ea as da,Eb as f,Ec as Mo,Ed as $,Ee as Cl,Ef as kl,Fb as jn,Fc as Ps,G as bo,Gb as c,Gf as ii,Ha as Wn,Hb as bs,Hc as Fo,Hd as Js,I as _s,Ia as ee,Ib as ws,Id as el,Ie as xl,If as ni,Jb as Kn,Jc as Is,Jd as Z,Je as jo,Jf as Ml,Kb as Y,Kd as P,Kf as Cn,L as pe,La as Ao,Lb as W,Ld as Ti,M as fs,Ma as xi,Mb as j,Mc as zt,Na as ma,Nc as sn,Nf as Fl,O as wo,Oa as s,Od as No,Pa as xs,Pb as Be,Pc as Ee,Pd as al,Qa as ae,Qb as B,Qc as Rs,Qd as hn,Qe as Ko,Qf as xn,Ra as zi,Rb as O,Re as Sl,Rf as er,Sb as L,Sc as Ns,Se as vl,Ta as Ss,Tb as d,Tc as Vs,Td as sl,Tf as Qe,U as hs,Ub as w,Uc as Ls,Ud as ll,Uf as Sn,Va as vs,Vb as D,Ve as yl,Vf as ut,Wa as pt,Wb as Re,Wc as Os,X as gs,Xb as de,Xd as cl,Xe as bl,Xf as Pl,Ya as ys,Yb as me,Yc as Bs,Zb as ue,Zc as Us,Zf as Il,_ as zn,_b as Ts,_c as Hs,_d as Vo,_e as Qo,ab as A,ac as As,ad as zs,ae as Oo,ag as tr,ba as ge,bb as ua,bc as fa,be as Bo,bf as Ei,cb as Si,cc as X,cg as Rl,db as an,dc as wt,de as pl,df as qo,ea as kt,ec as ha,ed as Pt,ef as dt,f as vo,fa as pa,fb as R,fc as Tt,fd as je,fg as _t,g as ms,gc as Ne,ge as dl,gf as Ai,gg as ir,hc as Qn,hd as Et,he as It,hf as Di,hg as nr,ia as To,ic as Ds,ie as ml,if as Xn,ig as Nl,ja as S,jc as ko,jd as xe,jg as Vl,kb as Zt,kc as b,kd as dn,kf as ti,kg as Ll,la as Cs,lb as C,lc as G,le as Uo,lf as Yo,lg as Nt,mb as x,mc as E,mf as wl,nb as We,nc as Mt,nf as Ue,oa as h,oc as Ft,od as ye,oe as Ho,of as Tl,p as gi,pa as g,pb as k,pd as mn,q as yo,qa as Gn,qb as M,qc as ks,qe as ul,qg as F,ra as Eo,rb as m,re as _l,rf as Xo,sb as a,sc as ve,sd as un,se as fl,sf as El,sg as pr,tb as l,tc as $t,td as _n,te as $o,tg as va,ub as _,ud as vi,ue as gn,v as bt,va as it,vb as Gi,vc as qn,vd as yi,w as us,wb as Wi,wc as se,wd as bi,we as hl,wf as Al,xa as rn,xb as _a,xe as gl,xf as Rt,yd as ei,ye as zo,yf as Dl,zc as Ms,zd as Io,zf as Zo}from"./chunk-D55YR5X7.js";import"./chunk-SDJNZULP.js";import"./chunk-2YQ4SX3A.js";import{n as Mi}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as re,b as Se,d as ds,i as Xt}from"./chunk-KAVP6UXH.js";var qc=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-root"]],decls:1,vars:0,template:function(o,r){o&1&&_(0,"router-outlet")},dependencies:[ln],encapsulation:2});let i=n;return i})();function Yc(i){return new ge(3e3,!1)}function Um(){return new ge(3100,!1)}function Hm(){return new ge(3101,!1)}function $m(i){return new ge(3001,!1)}function zm(i){return new ge(3003,!1)}function Gm(i){return new ge(3004,!1)}function Zc(i,n){return new ge(3005,!1)}function Jc(){return new ge(3006,!1)}function ep(){return new ge(3007,!1)}function tp(i,n){return new ge(3008,!1)}function ip(i){return new ge(3002,!1)}function np(i,n,e,t,o){return new ge(3010,!1)}function op(){return new ge(3011,!1)}function rp(){return new ge(3012,!1)}function ap(){return new ge(3200,!1)}function sp(){return new ge(3202,!1)}function lp(){return new ge(3013,!1)}function cp(i){return new ge(3014,!1)}function pp(i){return new ge(3015,!1)}function dp(i){return new ge(3016,!1)}function mp(i,n){return new ge(3404,!1)}function Wm(i){return new ge(3502,!1)}function up(i){return new ge(3503,!1)}function _p(){return new ge(3300,!1)}function fp(i){return new ge(3504,!1)}function hp(i){return new ge(3301,!1)}function gp(i,n){return new ge(3302,!1)}function Cp(i){return new ge(3303,!1)}function xp(i,n){return new ge(3400,!1)}function Sp(i){return new ge(3401,!1)}function vp(i){return new ge(3402,!1)}function yp(i,n){return new ge(3505,!1)}function ui(i){switch(i.length){case 0:return new ji;case 1:return i[0];default:return new Po(i)}}function Da(i,n,e=new Map,t=new Map){let o=[],r=[],p=-1,u=null;if(n.forEach(v=>{let T=v.get("offset"),N=T==p,V=N&&u||new Map;v.forEach((le,q)=>{let K=q,ne=le;if(q!=="offset")switch(K=i.normalizePropertyName(K,o),ne){case Yn:ne=e.get(q);break;case Gt:ne=t.get(q);break;default:ne=i.normalizeStyleValue(q,K,ne,o);break}V.set(K,ne)}),N||r.push(V),u=V,p=T}),o.length)throw Wm(o);return r}function br(i,n,e,t){switch(n){case"start":i.onStart(()=>t(e&&Ta(e,"start",i)));break;case"done":i.onDone(()=>t(e&&Ta(e,"done",i)));break;case"destroy":i.onDestroy(()=>t(e&&Ta(e,"destroy",i)));break}}function Ta(i,n,e){let t=e.totalTime,o=!!e.disabled,r=wr(i.element,i.triggerName,i.fromState,i.toState,n||i.phaseName,t??i.totalTime,o),p=i._data;return p!=null&&(r._data=p),r}function wr(i,n,e,t,o="",r=0,p){return{element:i,triggerName:n,fromState:e,toState:t,phaseName:o,totalTime:r,disabled:!!p}}function Ct(i,n,e){let t=i.get(n);return t||i.set(n,t=e),t}function ka(i){let n=i.indexOf(":"),e=i.substring(1,n),t=i.slice(n+1);return[e,t]}var jm=typeof document>"u"?null:document.documentElement;function Tr(i){let n=i.parentNode||i.host||null;return n===jm?null:n}function Km(i){return i.substring(1,6)=="ebkit"}var Xi=null,Xc=!1;function bp(i){Xi||(Xi=Qm()||{},Xc=Xi.style?"WebkitAppearance"in Xi.style:!1);let n=!0;return Xi.style&&!Km(i)&&(n=i in Xi.style,!n&&Xc&&(n="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Xi.style)),n}function Qm(){return typeof document<"u"?document.body:null}function Ma(i,n){for(;n;){if(n===i)return!0;n=Tr(n)}return!1}function Fa(i,n,e){if(e)return Array.from(i.querySelectorAll(n));let t=i.querySelector(n);return t?[t]:[]}var qm=1e3,Pa="{{",Ym="}}",Ia="ng-enter",Er="ng-leave",ao="ng-trigger",so=".ng-trigger",Ra="ng-animating",Ar=".ng-animating";function ci(i){if(typeof i=="number")return i;let n=i.match(/^(-?[\.\d]+)(m?s)/);return!n||n.length<2?0:Ea(parseFloat(n[1]),n[2])}function Ea(i,n){switch(n){case"s":return i*qm;default:return i}}function lo(i,n,e){return i.hasOwnProperty("duration")?i:Zm(i,n,e)}var Xm=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Zm(i,n,e){let t,o=0,r="";if(typeof i=="string"){let p=i.match(Xm);if(p===null)return n.push(Yc(i)),{duration:0,delay:0,easing:""};t=Ea(parseFloat(p[1]),p[2]);let u=p[3];u!=null&&(o=Ea(parseFloat(u),p[4]));let v=p[5];v&&(r=v)}else t=i;if(!e){let p=!1,u=n.length;t<0&&(n.push(Um()),p=!0),o<0&&(n.push(Hm()),p=!0),p&&n.splice(u,0,Yc(i))}return{duration:t,delay:o,easing:r}}function wp(i){return i.length?i[0]instanceof Map?i:i.map(n=>new Map(Object.entries(n))):[]}function Kt(i,n,e){n.forEach((t,o)=>{let r=Dr(o);e&&!e.has(o)&&e.set(o,i.style[r]),i.style[r]=t})}function Ni(i,n){n.forEach((e,t)=>{let o=Dr(t);i.style[o]=""})}function In(i){return Array.isArray(i)?i.length==1?i[0]:Ks(i):i}function Tp(i,n,e){let t=n.params||{},o=Na(i);o.length&&o.forEach(r=>{t.hasOwnProperty(r)||e.push($m(r))})}var Aa=new RegExp(`${Pa}\\s*(.+?)\\s*${Ym}`,"g");function Na(i){let n=[];if(typeof i=="string"){let e;for(;e=Aa.exec(i);)n.push(e[1]);Aa.lastIndex=0}return n}function Rn(i,n,e){let t=`${i}`,o=t.replace(Aa,(r,p)=>{let u=n[p];return u==null&&(e.push(zm(p)),u=""),u.toString()});return o==t?i:o}var Jm=/-+([a-z0-9])/g;function Dr(i){return i.replace(Jm,(...n)=>n[1].toUpperCase())}function Ep(i,n){return i===0||n===0}function Ap(i,n,e){if(e.size&&n.length){let t=n[0],o=[];if(e.forEach((r,p)=>{t.has(p)||o.push(p),t.set(p,r)}),o.length)for(let r=1;r<n.length;r++){let p=n[r];o.forEach(u=>p.set(u,kr(i,u)))}}return n}function xt(i,n,e){switch(n.type){case _e.Trigger:return i.visitTrigger(n,e);case _e.State:return i.visitState(n,e);case _e.Transition:return i.visitTransition(n,e);case _e.Sequence:return i.visitSequence(n,e);case _e.Group:return i.visitGroup(n,e);case _e.Animate:return i.visitAnimate(n,e);case _e.Keyframes:return i.visitKeyframes(n,e);case _e.Style:return i.visitStyle(n,e);case _e.Reference:return i.visitReference(n,e);case _e.AnimateChild:return i.visitAnimateChild(n,e);case _e.AnimateRef:return i.visitAnimateRef(n,e);case _e.Query:return i.visitQuery(n,e);case _e.Stagger:return i.visitStagger(n,e);default:throw Gm(n.type)}}function kr(i,n){return window.getComputedStyle(i)[n]}var Za=(()=>{class i{validateStyleProperty(e){return bp(e)}containsElement(e,t){return Ma(e,t)}getParentElement(e){return Tr(e)}query(e,t,o){return Fa(e,t,o)}computeStyle(e,t,o){return o||""}animate(e,t,o,r,p,u=[],v){return new ji(o,r)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=kt({token:i,factory:i.\u0275fac})}return i})(),Ji=class{static NOOP=new Za},en=class{};var e0=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Rr=class extends en{normalizePropertyName(n,e){return Dr(n)}normalizeStyleValue(n,e,t,o){let r="",p=t.toString().trim();if(e0.has(e)&&t!==0&&t!=="0")if(typeof t=="number")r="px";else{let u=t.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&o.push(Zc(n,t))}return p+r}};var Nr="*";function t0(i,n){let e=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(t=>i0(t,e,n)):e.push(i),e}function i0(i,n,e){if(i[0]==":"){let v=n0(i,e);if(typeof v=="function"){n.push(v);return}i=v}let t=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return e.push(pp(i)),n;let o=t[1],r=t[2],p=t[3];n.push(Dp(o,p));let u=o==Nr&&p==Nr;r[0]=="<"&&!u&&n.push(Dp(p,o))}function n0(i,n){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return n.push(dp(i)),"* => *"}}var Mr=new Set(["true","1"]),Fr=new Set(["false","0"]);function Dp(i,n){let e=Mr.has(i)||Fr.has(i),t=Mr.has(n)||Fr.has(n);return(o,r)=>{let p=i==Nr||i==o,u=n==Nr||n==r;return!p&&e&&typeof o=="boolean"&&(p=o?Mr.has(i):Fr.has(i)),!u&&t&&typeof r=="boolean"&&(u=r?Mr.has(n):Fr.has(n)),p&&u}}var Op=":self",o0=new RegExp(`s*${Op}s*,?`,"g");function Bp(i,n,e,t){return new Ha(i).build(n,e,t)}var kp="",Ha=class{_driver;constructor(n){this._driver=n}build(n,e,t){let o=new $a(e);return this._resetContextStyleTimingState(o),xt(this,In(n),o)}_resetContextStyleTimingState(n){n.currentQuerySelector=kp,n.collectedStyles=new Map,n.collectedStyles.set(kp,new Map),n.currentTime=0}visitTrigger(n,e){let t=e.queryCount=0,o=e.depCount=0,r=[],p=[];return n.name.charAt(0)=="@"&&e.errors.push(Jc()),n.definitions.forEach(u=>{if(this._resetContextStyleTimingState(e),u.type==_e.State){let v=u,T=v.name;T.toString().split(/\s*,\s*/).forEach(N=>{v.name=N,r.push(this.visitState(v,e))}),v.name=T}else if(u.type==_e.Transition){let v=this.visitTransition(u,e);t+=v.queryCount,o+=v.depCount,p.push(v)}else e.errors.push(ep())}),{type:_e.Trigger,name:n.name,states:r,transitions:p,queryCount:t,depCount:o,options:null}}visitState(n,e){let t=this.visitStyle(n.styles,e),o=n.options&&n.options.params||null;if(t.containsDynamicStyles){let r=new Set,p=o||{};t.styles.forEach(u=>{u instanceof Map&&u.forEach(v=>{Na(v).forEach(T=>{p.hasOwnProperty(T)||r.add(T)})})}),r.size&&e.errors.push(tp(n.name,[...r.values()]))}return{type:_e.State,name:n.name,style:t,options:o?{params:o}:null}}visitTransition(n,e){e.queryCount=0,e.depCount=0;let t=xt(this,In(n.animation),e),o=t0(n.expr,e.errors);return{type:_e.Transition,matchers:o,animation:t,queryCount:e.queryCount,depCount:e.depCount,options:Zi(n.options)}}visitSequence(n,e){return{type:_e.Sequence,steps:n.steps.map(t=>xt(this,t,e)),options:Zi(n.options)}}visitGroup(n,e){let t=e.currentTime,o=0,r=n.steps.map(p=>{e.currentTime=t;let u=xt(this,p,e);return o=Math.max(o,e.currentTime),u});return e.currentTime=o,{type:_e.Group,steps:r,options:Zi(n.options)}}visitAnimate(n,e){let t=l0(n.timings,e.errors);e.currentAnimateTimings=t;let o,r=n.styles?n.styles:ga({});if(r.type==_e.Keyframes)o=this.visitKeyframes(r,e);else{let p=n.styles,u=!1;if(!p){u=!0;let T={};t.easing&&(T.easing=t.easing),p=ga(T)}e.currentTime+=t.duration+t.delay;let v=this.visitStyle(p,e);v.isEmptyStep=u,o=v}return e.currentAnimateTimings=null,{type:_e.Animate,timings:t,style:o,options:null}}visitStyle(n,e){let t=this._makeStyleAst(n,e);return this._validateStyleAst(t,e),t}_makeStyleAst(n,e){let t=[],o=Array.isArray(n.styles)?n.styles:[n.styles];for(let u of o)typeof u=="string"?u===Gt?t.push(u):e.errors.push(ip(u)):t.push(new Map(Object.entries(u)));let r=!1,p=null;return t.forEach(u=>{if(u instanceof Map&&(u.has("easing")&&(p=u.get("easing"),u.delete("easing")),!r)){for(let v of u.values())if(v.toString().indexOf(Pa)>=0){r=!0;break}}}),{type:_e.Style,styles:t,easing:p,offset:n.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(n,e){let t=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;t&&r>0&&(r-=t.duration+t.delay),n.styles.forEach(p=>{typeof p!="string"&&p.forEach((u,v)=>{let T=e.collectedStyles.get(e.currentQuerySelector),N=T.get(v),V=!0;N&&(r!=o&&r>=N.startTime&&o<=N.endTime&&(e.errors.push(np(v,N.startTime,N.endTime,r,o)),V=!1),r=N.startTime),V&&T.set(v,{startTime:r,endTime:o}),e.options&&Tp(u,e.options,e.errors)})})}visitKeyframes(n,e){let t={type:_e.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(op()),t;let o=1,r=0,p=[],u=!1,v=!1,T=0,N=n.steps.map($e=>{let ze=this._makeStyleAst($e,e),at=ze.offset!=null?ze.offset:s0(ze.styles),et=0;return at!=null&&(r++,et=ze.offset=at),v=v||et<0||et>1,u=u||et<T,T=et,p.push(et),ze});v&&e.errors.push(rp()),u&&e.errors.push(ap());let V=n.steps.length,le=0;r>0&&r<V?e.errors.push(sp()):r==0&&(le=o/(V-1));let q=V-1,K=e.currentTime,ne=e.currentAnimateTimings,Te=ne.duration;return N.forEach(($e,ze)=>{let at=le>0?ze==q?1:le*ze:p[ze],et=at*Te;e.currentTime=K+ne.delay+et,ne.duration=et,this._validateStyleAst($e,e),$e.offset=at,t.styles.push($e)}),t}visitReference(n,e){return{type:_e.Reference,animation:xt(this,In(n.animation),e),options:Zi(n.options)}}visitAnimateChild(n,e){return e.depCount++,{type:_e.AnimateChild,options:Zi(n.options)}}visitAnimateRef(n,e){return{type:_e.AnimateRef,animation:this.visitReference(n.animation,e),options:Zi(n.options)}}visitQuery(n,e){let t=e.currentQuerySelector,o=n.options||{};e.queryCount++,e.currentQuery=n;let[r,p]=r0(n.selector);e.currentQuerySelector=t.length?t+" "+r:r,Ct(e.collectedStyles,e.currentQuerySelector,new Map);let u=xt(this,In(n.animation),e);return e.currentQuery=null,e.currentQuerySelector=t,{type:_e.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:p,animation:u,originalSelector:n.selector,options:Zi(n.options)}}visitStagger(n,e){e.currentQuery||e.errors.push(lp());let t=n.timings==="full"?{duration:0,delay:0,easing:"full"}:lo(n.timings,e.errors,!0);return{type:_e.Stagger,animation:xt(this,In(n.animation),e),timings:t,options:null}}};function r0(i){let n=!!i.split(/\s*,\s*/).find(e=>e==Op);return n&&(i=i.replace(o0,"")),i=i.replace(/@\*/g,so).replace(/@\w+/g,e=>so+"-"+e.slice(1)).replace(/:animating/g,Ar),[i,n]}function a0(i){return i?re({},i):null}var $a=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(n){this.errors=n}};function s0(i){if(typeof i=="string")return null;let n=null;if(Array.isArray(i))i.forEach(e=>{if(e instanceof Map&&e.has("offset")){let t=e;n=parseFloat(t.get("offset")),t.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let e=i;n=parseFloat(e.get("offset")),e.delete("offset")}return n}function l0(i,n){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=lo(i,n).duration;return Va(r,0,"")}let e=i;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=Va(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=lo(e,n);return Va(o.duration,o.delay,o.easing)}function Zi(i){return i?(i=re({},i),i.params&&(i.params=a0(i.params))):i={},i}function Va(i,n,e){return{duration:i,delay:n,easing:e}}function Ja(i,n,e,t,o,r,p=null,u=!1){return{type:1,element:i,keyframes:n,preStyleProps:e,postStyleProps:t,duration:o,delay:r,totalTime:o+r,easing:p,subTimeline:u}}var po=class{_map=new Map;get(n){return this._map.get(n)||[]}append(n,e){let t=this._map.get(n);t||this._map.set(n,t=[]),t.push(...e)}has(n){return this._map.has(n)}clear(){this._map.clear()}},c0=1,p0=":enter",d0=new RegExp(p0,"g"),m0=":leave",u0=new RegExp(m0,"g");function Up(i,n,e,t,o,r=new Map,p=new Map,u,v,T=[]){return new za().buildKeyframes(i,n,e,t,o,r,p,u,v,T)}var za=class{buildKeyframes(n,e,t,o,r,p,u,v,T,N=[]){T=T||new po;let V=new Ga(n,e,T,o,r,N,[]);V.options=v;let le=v.delay?ci(v.delay):0;V.currentTimeline.delayNextStep(le),V.currentTimeline.setStyles([p],null,V.errors,v),xt(this,t,V);let q=V.timelines.filter(K=>K.containsAnimation());if(q.length&&u.size){let K;for(let ne=q.length-1;ne>=0;ne--){let Te=q[ne];if(Te.element===e){K=Te;break}}K&&!K.allowOnlyTimelineStyles()&&K.setStyles([u],null,V.errors,v)}return q.length?q.map(K=>K.buildKeyframes()):[Ja(e,[],[],[],0,le,"",!1)]}visitTrigger(n,e){}visitState(n,e){}visitTransition(n,e){}visitAnimateChild(n,e){let t=e.subInstructions.get(e.element);if(t){let o=e.createSubContext(n.options),r=e.currentTimeline.currentTime,p=this._visitSubInstructions(t,o,o.options);r!=p&&e.transformIntoNewTimeline(p)}e.previousNode=n}visitAnimateRef(n,e){let t=e.createSubContext(n.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([n.options,n.animation.options],e,t),this.visitReference(n.animation,t),e.transformIntoNewTimeline(t.currentTimeline.currentTime),e.previousNode=n}_applyAnimationRefDelays(n,e,t){for(let o of n){let r=o?.delay;if(r){let p=typeof r=="number"?r:ci(Rn(r,o?.params??{},e.errors));t.delayNextStep(p)}}}_visitSubInstructions(n,e,t){let r=e.currentTimeline.currentTime,p=t.duration!=null?ci(t.duration):null,u=t.delay!=null?ci(t.delay):null;return p!==0&&n.forEach(v=>{let T=e.appendInstructionToTimeline(v,p,u);r=Math.max(r,T.duration+T.delay)}),r}visitReference(n,e){e.updateOptions(n.options,!0),xt(this,n.animation,e),e.previousNode=n}visitSequence(n,e){let t=e.subContextCount,o=e,r=n.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==_e.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Vr);let p=ci(r.delay);o.delayNextStep(p)}n.steps.length&&(n.steps.forEach(p=>xt(this,p,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>t&&o.transformIntoNewTimeline()),e.previousNode=n}visitGroup(n,e){let t=[],o=e.currentTimeline.currentTime,r=n.options&&n.options.delay?ci(n.options.delay):0;n.steps.forEach(p=>{let u=e.createSubContext(n.options);r&&u.delayNextStep(r),xt(this,p,u),o=Math.max(o,u.currentTimeline.currentTime),t.push(u.currentTimeline)}),t.forEach(p=>e.currentTimeline.mergeTimelineCollectedStyles(p)),e.transformIntoNewTimeline(o),e.previousNode=n}_visitTiming(n,e){if(n.dynamic){let t=n.strValue,o=e.params?Rn(t,e.params,e.errors):t;return lo(o,e.errors)}else return{duration:n.duration,delay:n.delay,easing:n.easing}}visitAnimate(n,e){let t=e.currentAnimateTimings=this._visitTiming(n.timings,e),o=e.currentTimeline;t.delay&&(e.incrementTime(t.delay),o.snapshotCurrentStyles());let r=n.style;r.type==_e.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(t.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=n}visitStyle(n,e){let t=e.currentTimeline,o=e.currentAnimateTimings;!o&&t.hasCurrentStyleProperties()&&t.forwardFrame();let r=o&&o.easing||n.easing;n.isEmptyStep?t.applyEmptyStep(r):t.setStyles(n.styles,r,e.errors,e.options),e.previousNode=n}visitKeyframes(n,e){let t=e.currentAnimateTimings,o=e.currentTimeline.duration,r=t.duration,u=e.createSubContext().currentTimeline;u.easing=t.easing,n.styles.forEach(v=>{let T=v.offset||0;u.forwardTime(T*r),u.setStyles(v.styles,v.easing,e.errors,e.options),u.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(u),e.transformIntoNewTimeline(o+r),e.previousNode=n}visitQuery(n,e){let t=e.currentTimeline.currentTime,o=n.options||{},r=o.delay?ci(o.delay):0;r&&(e.previousNode.type===_e.Style||t==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Vr);let p=t,u=e.invokeQuery(n.selector,n.originalSelector,n.limit,n.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=u.length;let v=null;u.forEach((T,N)=>{e.currentQueryIndex=N;let V=e.createSubContext(n.options,T);r&&V.delayNextStep(r),T===e.element&&(v=V.currentTimeline),xt(this,n.animation,V),V.currentTimeline.applyStylesToKeyframe();let le=V.currentTimeline.currentTime;p=Math.max(p,le)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(p),v&&(e.currentTimeline.mergeTimelineCollectedStyles(v),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=n}visitStagger(n,e){let t=e.parentContext,o=e.currentTimeline,r=n.timings,p=Math.abs(r.duration),u=p*(e.currentQueryTotal-1),v=p*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":v=u-v;break;case"full":v=t.currentStaggerTime;break}let N=e.currentTimeline;v&&N.delayNextStep(v);let V=N.currentTime;xt(this,n.animation,e),e.previousNode=n,t.currentStaggerTime=o.currentTime-V+(o.startTime-t.currentTimeline.startTime)}},Vr={},Ga=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Vr;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(n,e,t,o,r,p,u,v){this._driver=n,this.element=e,this.subInstructions=t,this._enterClassName=o,this._leaveClassName=r,this.errors=p,this.timelines=u,this.currentTimeline=v||new Lr(this._driver,e,0),u.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(n,e){if(!n)return;let t=n,o=this.options;t.duration!=null&&(o.duration=ci(t.duration)),t.delay!=null&&(o.delay=ci(t.delay));let r=t.params;if(r){let p=o.params;p||(p=this.options.params={}),Object.keys(r).forEach(u=>{(!e||!p.hasOwnProperty(u))&&(p[u]=Rn(r[u],p,this.errors))})}}_copyOptions(){let n={};if(this.options){let e=this.options.params;if(e){let t=n.params={};Object.keys(e).forEach(o=>{t[o]=e[o]})}}return n}createSubContext(n=null,e,t){let o=e||this.element,r=new i(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,t||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(n),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(n){return this.previousNode=Vr,this.currentTimeline=this.currentTimeline.fork(this.element,n),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(n,e,t){let o={duration:e??n.duration,delay:this.currentTimeline.currentTime+(t??0)+n.delay,easing:""},r=new Wa(this._driver,n.element,n.keyframes,n.preStyleProps,n.postStyleProps,o,n.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(n){this.currentTimeline.forwardTime(this.currentTimeline.duration+n)}delayNextStep(n){n>0&&this.currentTimeline.delayNextStep(n)}invokeQuery(n,e,t,o,r,p){let u=[];if(o&&u.push(this.element),n.length>0){n=n.replace(d0,"."+this._enterClassName),n=n.replace(u0,"."+this._leaveClassName);let v=t!=1,T=this._driver.query(this.element,n,v);t!==0&&(T=t<0?T.slice(T.length+t,T.length):T.slice(0,t)),u.push(...T)}return!r&&u.length==0&&p.push(cp(e)),u}},Lr=class i{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(n,e,t,o){this._driver=n,this.element=e,this.startTime=t,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(n){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+n),e&&this.snapshotCurrentStyles()):this.startTime+=n}fork(n,e){return this.applyStylesToKeyframe(),new i(this._driver,n,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=c0,this._loadKeyframe()}forwardTime(n){this.applyStylesToKeyframe(),this.duration=n,this._loadKeyframe()}_updateStyle(n,e){this._localTimelineStyles.set(n,e),this._globalTimelineStyles.set(n,e),this._styleSummary.set(n,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(n){n&&this._previousKeyframe.set("easing",n);for(let[e,t]of this._globalTimelineStyles)this._backFill.set(e,t||Gt),this._currentKeyframe.set(e,Gt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(n,e,t,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},p=_0(n,this._globalTimelineStyles);for(let[u,v]of p){let T=Rn(v,r,t);this._pendingStyles.set(u,T),this._localTimelineStyles.has(u)||this._backFill.set(u,this._globalTimelineStyles.get(u)??Gt),this._updateStyle(u,T)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((n,e)=>{this._currentKeyframe.set(e,n)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((n,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,n)}))}snapshotCurrentStyles(){for(let[n,e]of this._localTimelineStyles)this._pendingStyles.set(n,e),this._updateStyle(n,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let n=[];for(let e in this._currentKeyframe)n.push(e);return n}mergeTimelineCollectedStyles(n){n._styleSummary.forEach((e,t)=>{let o=this._styleSummary.get(t);(!o||e.time>o.time)&&this._updateStyle(t,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let n=new Set,e=new Set,t=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((u,v)=>{let T=new Map([...this._backFill,...u]);T.forEach((N,V)=>{N===Yn?n.add(V):N===Gt&&e.add(V)}),t||T.set("offset",v/this.duration),o.push(T)});let r=[...n.values()],p=[...e.values()];if(t){let u=o[0],v=new Map(u);u.set("offset",0),v.set("offset",1),o=[u,v]}return Ja(this.element,o,r,p,this.duration,this.startTime,this.easing,!1)}},Wa=class extends Lr{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(n,e,t,o,r,p,u=!1){super(n,e,p.delay),this.keyframes=t,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=u,this.timings={duration:p.duration,delay:p.delay,easing:p.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let n=this.keyframes,{delay:e,duration:t,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],p=t+e,u=e/p,v=new Map(n[0]);v.set("offset",0),r.push(v);let T=new Map(n[0]);T.set("offset",Mp(u)),r.push(T);let N=n.length-1;for(let V=1;V<=N;V++){let le=new Map(n[V]),q=le.get("offset"),K=e+q*t;le.set("offset",Mp(K/p)),r.push(le)}t=p,e=0,o="",n=r}return Ja(this.element,n,this.preStyleProps,this.postStyleProps,t,e,o,!0)}};function Mp(i,n=3){let e=Math.pow(10,n-1);return Math.round(i*e)/e}function _0(i,n){let e=new Map,t;return i.forEach(o=>{if(o==="*"){t??=n.keys();for(let r of t)e.set(r,Gt)}else for(let[r,p]of o)e.set(r,p)}),e}function Fp(i,n,e,t,o,r,p,u,v,T,N,V,le){return{type:0,element:i,triggerName:n,isRemovalTransition:o,fromState:e,fromStyles:r,toState:t,toStyles:p,timelines:u,queriedElements:v,preStyleProps:T,postStyleProps:N,totalTime:V,errors:le}}var La={},Or=class{_triggerName;ast;_stateStyles;constructor(n,e,t){this._triggerName=n,this.ast=e,this._stateStyles=t}match(n,e,t,o){return f0(this.ast.matchers,n,e,t,o)}buildStyles(n,e,t){let o=this._stateStyles.get("*");return n!==void 0&&(o=this._stateStyles.get(n?.toString())||o),o?o.buildStyles(e,t):new Map}build(n,e,t,o,r,p,u,v,T,N){let V=[],le=this.ast.options&&this.ast.options.params||La,q=u&&u.params||La,K=this.buildStyles(t,q,V),ne=v&&v.params||La,Te=this.buildStyles(o,ne,V),$e=new Set,ze=new Map,at=new Map,et=o==="void",nn={params:Hp(ne,le),delay:this.ast.options?.delay},qt=N?[]:Up(n,e,this.ast.animation,r,p,K,Te,nn,T,V),st=0;return qt.forEach(ct=>{st=Math.max(ct.duration+ct.delay,st)}),V.length?Fp(e,this._triggerName,t,o,et,K,Te,[],[],ze,at,st,V):(qt.forEach(ct=>{let Ui=ct.element,on=Ct(ze,Ui,new Set);ct.preStyleProps.forEach(Hi=>on.add(Hi));let ss=Ct(at,Ui,new Set);ct.postStyleProps.forEach(Hi=>ss.add(Hi)),Ui!==e&&$e.add(Ui)}),Fp(e,this._triggerName,t,o,et,K,Te,qt,[...$e.values()],ze,at,st))}};function f0(i,n,e,t,o){return i.some(r=>r(n,e,t,o))}function Hp(i,n){let e=re({},n);return Object.entries(i).forEach(([t,o])=>{o!=null&&(e[t]=o)}),e}var ja=class{styles;defaultParams;normalizer;constructor(n,e,t){this.styles=n,this.defaultParams=e,this.normalizer=t}buildStyles(n,e){let t=new Map,o=Hp(n,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((p,u)=>{p&&(p=Rn(p,o,e));let v=this.normalizer.normalizePropertyName(u,e);p=this.normalizer.normalizeStyleValue(u,v,p,e),t.set(u,p)})}),t}};function h0(i,n,e){return new Ka(i,n,e)}var Ka=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(n,e,t){this.name=n,this.ast=e,this._normalizer=t,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new ja(o.style,r,t))}),Pp(this.states,"true","1"),Pp(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new Or(n,o,this.states))}),this.fallbackTransition=g0(n,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(n,e,t,o){return this.transitionFactories.find(p=>p.match(n,e,t,o))||null}matchStyles(n,e,t){return this.fallbackTransition.buildStyles(n,e,t)}};function g0(i,n,e){let t=[(p,u)=>!0],o={type:_e.Sequence,steps:[],options:null},r={type:_e.Transition,animation:o,matchers:t,options:null,queryCount:0,depCount:0};return new Or(i,r,n)}function Pp(i,n,e){i.has(n)?i.has(e)||i.set(e,i.get(n)):i.has(e)&&i.set(n,i.get(e))}var C0=new po,Qa=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(n,e,t){this.bodyNode=n,this._driver=e,this._normalizer=t}register(n,e){let t=[],o=[],r=Bp(this._driver,e,t,o);if(t.length)throw up(t);this._animations.set(n,r)}_buildPlayer(n,e,t){let o=n.element,r=Da(this._normalizer,n.keyframes,e,t);return this._driver.animate(o,r,n.duration,n.delay,n.easing,[],!0)}create(n,e,t={}){let o=[],r=this._animations.get(n),p,u=new Map;if(r?(p=Up(this._driver,e,r,Ia,Er,new Map,new Map,t,C0,o),p.forEach(N=>{let V=Ct(u,N.element,new Map);N.postStyleProps.forEach(le=>V.set(le,null))})):(o.push(_p()),p=[]),o.length)throw fp(o);u.forEach((N,V)=>{N.forEach((le,q)=>{N.set(q,this._driver.computeStyle(V,q,Gt))})});let v=p.map(N=>{let V=u.get(N.element);return this._buildPlayer(N,new Map,V)}),T=ui(v);return this._playersById.set(n,T),T.onDestroy(()=>this.destroy(n)),this.players.push(T),T}destroy(n){let e=this._getPlayer(n);e.destroy(),this._playersById.delete(n);let t=this.players.indexOf(e);t>=0&&this.players.splice(t,1)}_getPlayer(n){let e=this._playersById.get(n);if(!e)throw hp(n);return e}listen(n,e,t,o){let r=wr(e,"","","");return br(this._getPlayer(n),t,r,o),()=>{}}command(n,e,t,o){if(t=="register"){this.register(n,o[0]);return}if(t=="create"){let p=o[0]||{};this.create(n,e,p);return}let r=this._getPlayer(n);switch(t){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(n);break}}},Ip="ng-animate-queued",x0=".ng-animate-queued",Oa="ng-animate-disabled",S0=".ng-animate-disabled",v0="ng-star-inserted",y0=".ng-star-inserted",b0=[],$p={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},w0={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Qt="__ng_removed",mo=class{namespaceId;value;options;get params(){return this.options.params}constructor(n,e=""){this.namespaceId=e;let t=n&&n.hasOwnProperty("value"),o=t?n.value:n;if(this.value=E0(o),t){let r=n,{value:p}=r,u=ds(r,["value"]);this.options=u}else this.options={};this.options.params||(this.options.params={})}absorbOptions(n){let e=n.params;if(e){let t=this.options.params;Object.keys(e).forEach(o=>{t[o]==null&&(t[o]=e[o])})}}},co="void",Ba=new mo(co),qa=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(n,e,t){this.id=n,this.hostElement=e,this._engine=t,this._hostClassName="ng-tns-"+n,Ht(e,this._hostClassName)}listen(n,e,t,o){if(!this._triggers.has(e))throw gp(t,e);if(t==null||t.length==0)throw Cp(e);if(!A0(t))throw xp(t,e);let r=Ct(this._elementListeners,n,[]),p={name:e,phase:t,callback:o};r.push(p);let u=Ct(this._engine.statesByElement,n,new Map);return u.has(e)||(Ht(n,ao),Ht(n,ao+"-"+e),u.set(e,Ba)),()=>{this._engine.afterFlush(()=>{let v=r.indexOf(p);v>=0&&r.splice(v,1),this._triggers.has(e)||u.delete(e)})}}register(n,e){return this._triggers.has(n)?!1:(this._triggers.set(n,e),!0)}_getTrigger(n){let e=this._triggers.get(n);if(!e)throw Sp(n);return e}trigger(n,e,t,o=!0){let r=this._getTrigger(e),p=new uo(this.id,e,n),u=this._engine.statesByElement.get(n);u||(Ht(n,ao),Ht(n,ao+"-"+e),this._engine.statesByElement.set(n,u=new Map));let v=u.get(e),T=new mo(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&v&&T.absorbOptions(v.options),u.set(e,T),v||(v=Ba),!(T.value===co)&&v.value===T.value){if(!M0(v.params,T.params)){let ne=[],Te=r.matchStyles(v.value,v.params,ne),$e=r.matchStyles(T.value,T.params,ne);ne.length?this._engine.reportError(ne):this._engine.afterFlush(()=>{Ni(n,Te),Kt(n,$e)})}return}let le=Ct(this._engine.playersByElement,n,[]);le.forEach(ne=>{ne.namespaceId==this.id&&ne.triggerName==e&&ne.queued&&ne.destroy()});let q=r.matchTransition(v.value,T.value,n,T.params),K=!1;if(!q){if(!o)return;q=r.fallbackTransition,K=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:e,transition:q,fromState:v,toState:T,player:p,isFallbackTransition:K}),K||(Ht(n,Ip),p.onStart(()=>{Nn(n,Ip)})),p.onDone(()=>{let ne=this.players.indexOf(p);ne>=0&&this.players.splice(ne,1);let Te=this._engine.playersByElement.get(n);if(Te){let $e=Te.indexOf(p);$e>=0&&Te.splice($e,1)}}),this.players.push(p),le.push(p),p}deregister(n){this._triggers.delete(n),this._engine.statesByElement.forEach(e=>e.delete(n)),this._elementListeners.forEach((e,t)=>{this._elementListeners.set(t,e.filter(o=>o.name!=n))})}clearElementCache(n){this._engine.statesByElement.delete(n),this._elementListeners.delete(n);let e=this._engine.playersByElement.get(n);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(n))}_signalRemovalForInnerTriggers(n,e){let t=this._engine.driver.query(n,so,!0);t.forEach(o=>{if(o[Qt])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(p=>p.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(n,e,t,o){let r=this._engine.statesByElement.get(n),p=new Map;if(r){let u=[];if(r.forEach((v,T)=>{if(p.set(T,v.value),this._triggers.has(T)){let N=this.trigger(n,T,co,o);N&&u.push(N)}}),u.length)return this._engine.markElementAsRemoved(this.id,n,!0,e,p),t&&ui(u).onDone(()=>this._engine.processLeaveNode(n)),!0}return!1}prepareLeaveAnimationListeners(n){let e=this._elementListeners.get(n),t=this._engine.statesByElement.get(n);if(e&&t){let o=new Set;e.forEach(r=>{let p=r.name;if(o.has(p))return;o.add(p);let v=this._triggers.get(p).fallbackTransition,T=t.get(p)||Ba,N=new mo(co),V=new uo(this.id,p,n);this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:p,transition:v,fromState:T,toState:N,player:V,isFallbackTransition:!0})})}}removeNode(n,e){let t=this._engine;if(n.childElementCount&&this._signalRemovalForInnerTriggers(n,e),this.triggerLeaveAnimation(n,e,!0))return;let o=!1;if(t.totalAnimations){let r=t.players.length?t.playersByQueriedElement.get(n):[];if(r&&r.length)o=!0;else{let p=n;for(;p=p.parentNode;)if(t.statesByElement.get(p)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(n),o)t.markElementAsRemoved(this.id,n,!1,e);else{let r=n[Qt];(!r||r===$p)&&(t.afterFlush(()=>this.clearElementCache(n)),t.destroyInnerAnimations(n),t._onRemovalComplete(n,e))}}insertNode(n,e){Ht(n,this._hostClassName)}drainQueuedTransitions(n){let e=[];return this._queue.forEach(t=>{let o=t.player;if(o.destroyed)return;let r=t.element,p=this._elementListeners.get(r);p&&p.forEach(u=>{if(u.name==t.triggerName){let v=wr(r,t.triggerName,t.fromState.value,t.toState.value);v._data=n,br(t.player,u.phase,v,u.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(t)}),this._queue=[],e.sort((t,o)=>{let r=t.transition.ast.depCount,p=o.transition.ast.depCount;return r==0||p==0?r-p:this._engine.driver.containsElement(t.element,o.element)?1:-1})}destroy(n){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,n)}},Ya=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(n,e)=>{};_onRemovalComplete(n,e){this.onRemovalComplete(n,e)}constructor(n,e,t){this.bodyNode=n,this.driver=e,this._normalizer=t}get queuedPlayers(){let n=[];return this._namespaceList.forEach(e=>{e.players.forEach(t=>{t.queued&&n.push(t)})}),n}createNamespace(n,e){let t=new qa(n,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(t,e):(this.newHostElements.set(e,t),this.collectEnterElement(e)),this._namespaceLookup[n]=t}_balanceNamespaceList(n,e){let t=this._namespaceList,o=this.namespacesByHostElement;if(t.length-1>=0){let p=!1,u=this.driver.getParentElement(e);for(;u;){let v=o.get(u);if(v){let T=t.indexOf(v);t.splice(T+1,0,n),p=!0;break}u=this.driver.getParentElement(u)}p||t.unshift(n)}else t.push(n);return o.set(e,n),n}register(n,e){let t=this._namespaceLookup[n];return t||(t=this.createNamespace(n,e)),t}registerTrigger(n,e,t){let o=this._namespaceLookup[n];o&&o.register(e,t)&&this.totalAnimations++}destroy(n,e){n&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(n);this.namespacesByHostElement.delete(t.hostElement);let o=this._namespaceList.indexOf(t);o>=0&&this._namespaceList.splice(o,1),t.destroy(e),delete this._namespaceLookup[n]}))}_fetchNamespace(n){return this._namespaceLookup[n]}fetchNamespacesByElement(n){let e=new Set,t=this.statesByElement.get(n);if(t){for(let o of t.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(n,e,t,o){if(Pr(e)){let r=this._fetchNamespace(n);if(r)return r.trigger(e,t,o),!0}return!1}insertNode(n,e,t,o){if(!Pr(e))return;let r=e[Qt];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let p=this.collectedLeaveElements.indexOf(e);p>=0&&this.collectedLeaveElements.splice(p,1)}if(n){let p=this._fetchNamespace(n);p&&p.insertNode(e,t)}o&&this.collectEnterElement(e)}collectEnterElement(n){this.collectedEnterElements.push(n)}markElementAsDisabled(n,e){e?this.disabledNodes.has(n)||(this.disabledNodes.add(n),Ht(n,Oa)):this.disabledNodes.has(n)&&(this.disabledNodes.delete(n),Nn(n,Oa))}removeNode(n,e,t){if(Pr(e)){let o=n?this._fetchNamespace(n):null;o?o.removeNode(e,t):this.markElementAsRemoved(n,e,!1,t);let r=this.namespacesByHostElement.get(e);r&&r.id!==n&&r.removeNode(e,t)}else this._onRemovalComplete(e,t)}markElementAsRemoved(n,e,t,o,r){this.collectedLeaveElements.push(e),e[Qt]={namespaceId:n,setForRemoval:o,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:r}}listen(n,e,t,o,r){return Pr(e)?this._fetchNamespace(n).listen(e,t,o,r):()=>{}}_buildInstruction(n,e,t,o,r){return n.transition.build(this.driver,n.element,n.fromState.value,n.toState.value,t,o,n.fromState.options,n.toState.options,e,r)}destroyInnerAnimations(n){let e=this.driver.query(n,so,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(n,Ar,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(n){let e=this.playersByElement.get(n);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(n){let e=this.playersByQueriedElement.get(n);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(n=>{if(this.players.length)return ui(this.players).onDone(()=>n());n()})}processLeaveNode(n){let e=n[Qt];if(e&&e.setForRemoval){if(n[Qt]=$p,e.namespaceId){this.destroyInnerAnimations(n);let t=this._fetchNamespace(e.namespaceId);t&&t.clearElementCache(n)}this._onRemovalComplete(n,e.setForRemoval)}n.classList?.contains(Oa)&&this.markElementAsDisabled(n,!1),this.driver.query(n,S0,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(n=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,o)=>this._balanceNamespaceList(t,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let o=this.collectedEnterElements[t];Ht(o,v0)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{e=this._flushAnimations(t,n)}finally{for(let o=0;o<t.length;o++)t[o]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let o=this.collectedLeaveElements[t];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(t=>t()),this._flushFns=[],this._whenQuietFns.length){let t=this._whenQuietFns;this._whenQuietFns=[],e.length?ui(e).onDone(()=>{t.forEach(o=>o())}):t.forEach(o=>o())}}reportError(n){throw vp(n)}_flushAnimations(n,e){let t=new po,o=[],r=new Map,p=[],u=new Map,v=new Map,T=new Map,N=new Set;this.disabledNodes.forEach(H=>{N.add(H);let Q=this.driver.query(H,x0,!0);for(let J=0;J<Q.length;J++)N.add(Q[J])});let V=this.bodyNode,le=Array.from(this.statesByElement.keys()),q=Vp(le,this.collectedEnterElements),K=new Map,ne=0;q.forEach((H,Q)=>{let J=Ia+ne++;K.set(Q,J),H.forEach(he=>Ht(he,J))});let Te=[],$e=new Set,ze=new Set;for(let H=0;H<this.collectedLeaveElements.length;H++){let Q=this.collectedLeaveElements[H],J=Q[Qt];J&&J.setForRemoval&&(Te.push(Q),$e.add(Q),J.hasAnimation?this.driver.query(Q,y0,!0).forEach(he=>$e.add(he)):ze.add(Q))}let at=new Map,et=Vp(le,Array.from($e));et.forEach((H,Q)=>{let J=Er+ne++;at.set(Q,J),H.forEach(he=>Ht(he,J))}),n.push(()=>{q.forEach((H,Q)=>{let J=K.get(Q);H.forEach(he=>Nn(he,J))}),et.forEach((H,Q)=>{let J=at.get(Q);H.forEach(he=>Nn(he,J))}),Te.forEach(H=>{this.processLeaveNode(H)})});let nn=[],qt=[];for(let H=this._namespaceList.length-1;H>=0;H--)this._namespaceList[H].drainQueuedTransitions(e).forEach(J=>{let he=J.player,Ge=J.element;if(nn.push(he),this.collectedEnterElements.length){let tt=Ge[Qt];if(tt&&tt.setForMove){if(tt.previousTriggersValues&&tt.previousTriggersValues.has(J.triggerName)){let $i=tt.previousTriggersValues.get(J.triggerName),At=this.statesByElement.get(J.element);if(At&&At.has(J.triggerName)){let So=At.get(J.triggerName);So.value=$i,At.set(J.triggerName,So)}}he.destroy();return}}let Yt=!V||!this.driver.containsElement(V,Ge),yt=at.get(Ge),hi=K.get(Ge),ke=this._buildInstruction(J,t,hi,yt,Yt);if(ke.errors&&ke.errors.length){qt.push(ke);return}if(Yt){he.onStart(()=>Ni(Ge,ke.fromStyles)),he.onDestroy(()=>Kt(Ge,ke.toStyles)),o.push(he);return}if(J.isFallbackTransition){he.onStart(()=>Ni(Ge,ke.fromStyles)),he.onDestroy(()=>Kt(Ge,ke.toStyles)),o.push(he);return}let ps=[];ke.timelines.forEach(tt=>{tt.stretchStartingKeyframe=!0,this.disabledNodes.has(tt.element)||ps.push(tt)}),ke.timelines=ps,t.append(Ge,ke.timelines);let Bm={instruction:ke,player:he,element:Ge};p.push(Bm),ke.queriedElements.forEach(tt=>Ct(u,tt,[]).push(he)),ke.preStyleProps.forEach((tt,$i)=>{if(tt.size){let At=v.get($i);At||v.set($i,At=new Set),tt.forEach((So,ca)=>At.add(ca))}}),ke.postStyleProps.forEach((tt,$i)=>{let At=T.get($i);At||T.set($i,At=new Set),tt.forEach((So,ca)=>At.add(ca))})});if(qt.length){let H=[];qt.forEach(Q=>{H.push(yp(Q.triggerName,Q.errors))}),nn.forEach(Q=>Q.destroy()),this.reportError(H)}let st=new Map,ct=new Map;p.forEach(H=>{let Q=H.element;t.has(Q)&&(ct.set(Q,Q),this._beforeAnimationBuild(H.player.namespaceId,H.instruction,st))}),o.forEach(H=>{let Q=H.element;this._getPreviousPlayers(Q,!1,H.namespaceId,H.triggerName,null).forEach(he=>{Ct(st,Q,[]).push(he),he.destroy()})});let Ui=Te.filter(H=>Lp(H,v,T)),on=new Map;Np(on,this.driver,ze,T,Gt).forEach(H=>{Lp(H,v,T)&&Ui.push(H)});let Hi=new Map;q.forEach((H,Q)=>{Np(Hi,this.driver,new Set(H),v,Yn)}),Ui.forEach(H=>{let Q=on.get(H),J=Hi.get(H);on.set(H,new Map([...Q?.entries()??[],...J?.entries()??[]]))});let la=[],ls=[],cs={};p.forEach(H=>{let{element:Q,player:J,instruction:he}=H;if(t.has(Q)){if(N.has(Q)){J.onDestroy(()=>Kt(Q,he.toStyles)),J.disabled=!0,J.overrideTotalTime(he.totalTime),o.push(J);return}let Ge=cs;if(ct.size>1){let yt=Q,hi=[];for(;yt=yt.parentNode;){let ke=ct.get(yt);if(ke){Ge=ke;break}hi.push(yt)}hi.forEach(ke=>ct.set(ke,Ge))}let Yt=this._buildAnimation(J.namespaceId,he,st,r,Hi,on);if(J.setRealPlayer(Yt),Ge===cs)la.push(J);else{let yt=this.playersByElement.get(Ge);yt&&yt.length&&(J.parentPlayer=ui(yt)),o.push(J)}}else Ni(Q,he.fromStyles),J.onDestroy(()=>Kt(Q,he.toStyles)),ls.push(J),N.has(Q)&&o.push(J)}),ls.forEach(H=>{let Q=r.get(H.element);if(Q&&Q.length){let J=ui(Q);H.setRealPlayer(J)}}),o.forEach(H=>{H.parentPlayer?H.syncPlayerEvents(H.parentPlayer):H.destroy()});for(let H=0;H<Te.length;H++){let Q=Te[H],J=Q[Qt];if(Nn(Q,Er),J&&J.hasAnimation)continue;let he=[];if(u.size){let Yt=u.get(Q);Yt&&Yt.length&&he.push(...Yt);let yt=this.driver.query(Q,Ar,!0);for(let hi=0;hi<yt.length;hi++){let ke=u.get(yt[hi]);ke&&ke.length&&he.push(...ke)}}let Ge=he.filter(Yt=>!Yt.destroyed);Ge.length?D0(this,Q,Ge):this.processLeaveNode(Q)}return Te.length=0,la.forEach(H=>{this.players.push(H),H.onDone(()=>{H.destroy();let Q=this.players.indexOf(H);this.players.splice(Q,1)}),H.play()}),la}afterFlush(n){this._flushFns.push(n)}afterFlushAnimationsDone(n){this._whenQuietFns.push(n)}_getPreviousPlayers(n,e,t,o,r){let p=[];if(e){let u=this.playersByQueriedElement.get(n);u&&(p=u)}else{let u=this.playersByElement.get(n);if(u){let v=!r||r==co;u.forEach(T=>{T.queued||!v&&T.triggerName!=o||p.push(T)})}}return(t||o)&&(p=p.filter(u=>!(t&&t!=u.namespaceId||o&&o!=u.triggerName))),p}_beforeAnimationBuild(n,e,t){let o=e.triggerName,r=e.element,p=e.isRemovalTransition?void 0:n,u=e.isRemovalTransition?void 0:o;for(let v of e.timelines){let T=v.element,N=T!==r,V=Ct(t,T,[]);this._getPreviousPlayers(T,N,p,u,e.toState).forEach(q=>{let K=q.getRealPlayer();K.beforeDestroy&&K.beforeDestroy(),q.destroy(),V.push(q)})}Ni(r,e.fromStyles)}_buildAnimation(n,e,t,o,r,p){let u=e.triggerName,v=e.element,T=[],N=new Set,V=new Set,le=e.timelines.map(K=>{let ne=K.element;N.add(ne);let Te=ne[Qt];if(Te&&Te.removedBeforeQueried)return new ji(K.duration,K.delay);let $e=ne!==v,ze=k0((t.get(ne)||b0).map(st=>st.getRealPlayer())).filter(st=>{let ct=st;return ct.element?ct.element===ne:!1}),at=r.get(ne),et=p.get(ne),nn=Da(this._normalizer,K.keyframes,at,et),qt=this._buildPlayer(K,nn,ze);if(K.subTimeline&&o&&V.add(ne),$e){let st=new uo(n,u,ne);st.setRealPlayer(qt),T.push(st)}return qt});T.forEach(K=>{Ct(this.playersByQueriedElement,K.element,[]).push(K),K.onDone(()=>T0(this.playersByQueriedElement,K.element,K))}),N.forEach(K=>Ht(K,Ra));let q=ui(le);return q.onDestroy(()=>{N.forEach(K=>Nn(K,Ra)),Kt(v,e.toStyles)}),V.forEach(K=>{Ct(o,K,[]).push(q)}),q}_buildPlayer(n,e,t){return e.length>0?this.driver.animate(n.element,e,n.duration,n.delay,n.easing,t):new ji(n.duration,n.delay)}},uo=class{namespaceId;triggerName;element;_player=new ji;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(n,e,t){this.namespaceId=n,this.triggerName=e,this.element=t}setRealPlayer(n){this._containsRealPlayer||(this._player=n,this._queuedCallbacks.forEach((e,t)=>{e.forEach(o=>br(n,t,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(n.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(n){this.totalTime=n}syncPlayerEvents(n){let e=this._player;e.triggerCallback&&n.onStart(()=>e.triggerCallback("start")),n.onDone(()=>this.finish()),n.onDestroy(()=>this.destroy())}_queueEvent(n,e){Ct(this._queuedCallbacks,n,[]).push(e)}onDone(n){this.queued&&this._queueEvent("done",n),this._player.onDone(n)}onStart(n){this.queued&&this._queueEvent("start",n),this._player.onStart(n)}onDestroy(n){this.queued&&this._queueEvent("destroy",n),this._player.onDestroy(n)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(n){this.queued||this._player.setPosition(n)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(n){let e=this._player;e.triggerCallback&&e.triggerCallback(n)}};function T0(i,n,e){let t=i.get(n);if(t){if(t.length){let o=t.indexOf(e);t.splice(o,1)}t.length==0&&i.delete(n)}return t}function E0(i){return i??null}function Pr(i){return i&&i.nodeType===1}function A0(i){return i=="start"||i=="done"}function Rp(i,n){let e=i.style.display;return i.style.display=n??"none",e}function Np(i,n,e,t,o){let r=[];e.forEach(v=>r.push(Rp(v)));let p=[];t.forEach((v,T)=>{let N=new Map;v.forEach(V=>{let le=n.computeStyle(T,V,o);N.set(V,le),(!le||le.length==0)&&(T[Qt]=w0,p.push(T))}),i.set(T,N)});let u=0;return e.forEach(v=>Rp(v,r[u++])),p}function Vp(i,n){let e=new Map;if(i.forEach(u=>e.set(u,[])),n.length==0)return e;let t=1,o=new Set(n),r=new Map;function p(u){if(!u)return t;let v=r.get(u);if(v)return v;let T=u.parentNode;return e.has(T)?v=T:o.has(T)?v=t:v=p(T),r.set(u,v),v}return n.forEach(u=>{let v=p(u);v!==t&&e.get(v).push(u)}),e}function Ht(i,n){i.classList?.add(n)}function Nn(i,n){i.classList?.remove(n)}function D0(i,n,e){ui(e).onDone(()=>i.processLeaveNode(n))}function k0(i){let n=[];return zp(i,n),n}function zp(i,n){for(let e=0;e<i.length;e++){let t=i[e];t instanceof Po?zp(t.players,n):n.push(t)}}function M0(i,n){let e=Object.keys(i),t=Object.keys(n);if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!n.hasOwnProperty(r)||i[r]!==n[r])return!1}return!0}function Lp(i,n,e){let t=e.get(i);if(!t)return!1;let o=n.get(i);return o?t.forEach(r=>o.add(r)):n.set(i,t),e.delete(i),!0}var Vn=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(n,e)=>{};constructor(n,e,t){this._driver=e,this._normalizer=t,this._transitionEngine=new Ya(n.body,e,t),this._timelineEngine=new Qa(n.body,e,t),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(n,e,t,o,r){let p=n+"-"+o,u=this._triggerCache[p];if(!u){let v=[],T=[],N=Bp(this._driver,r,v,T);if(v.length)throw mp(o,v);u=h0(o,N,this._normalizer),this._triggerCache[p]=u}this._transitionEngine.registerTrigger(e,o,u)}register(n,e){this._transitionEngine.register(n,e)}destroy(n,e){this._transitionEngine.destroy(n,e)}onInsert(n,e,t,o){this._transitionEngine.insertNode(n,e,t,o)}onRemove(n,e,t){this._transitionEngine.removeNode(n,e,t)}disableAnimations(n,e){this._transitionEngine.markElementAsDisabled(n,e)}process(n,e,t,o){if(t.charAt(0)=="@"){let[r,p]=ka(t),u=o;this._timelineEngine.command(r,e,p,u)}else this._transitionEngine.trigger(n,e,t,o)}listen(n,e,t,o,r){if(t.charAt(0)=="@"){let[p,u]=ka(t);return this._timelineEngine.listen(p,e,u,r)}return this._transitionEngine.listen(n,e,t,o,r)}flush(n=-1){this._transitionEngine.flush(n)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(n){this._transitionEngine.afterFlushAnimationsDone(n)}};function F0(i,n){let e=null,t=null;return Array.isArray(n)&&n.length?(e=Ua(n[0]),n.length>1&&(t=Ua(n[n.length-1]))):n instanceof Map&&(e=Ua(n)),e||t?new P0(i,e,t):null}var P0=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,t,o){this._element=e,this._startStyles=t,this._endStyles=o;let r=i.initialStylesByElement.get(e);r||i.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Kt(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Kt(this._element,this._initialStyles),this._endStyles&&(Kt(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(Ni(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Ni(this._element,this._endStyles),this._endStyles=null),Kt(this._element,this._initialStyles),this._state=3)}}return i})();function Ua(i){let n=null;return i.forEach((e,t)=>{I0(t)&&(n=n||new Map,n.set(t,e))}),n}function I0(i){return i==="display"||i==="position"}var Br=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(n,e,t,o){this.element=n,this.keyframes=e,this.options=t,this._specialStyles=o,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let n=this.keyframes,e=this._triggerWebAnimation(this.element,n,this.options);if(!e)return this._onFinish(),null;this.domPlayer=e,this._finalKeyframe=n.length?n[n.length-1]:new Map;let t=()=>this._onFinish();return e.addEventListener("finish",t),this.onDestroy(()=>{e.removeEventListener("finish",t)}),e}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(n){let e=[];return n.forEach(t=>{e.push(Object.fromEntries(t))}),e}_triggerWebAnimation(n,e,t){let o=this._convertKeyframesToObject(e);try{return n.animate(o,t)}catch{return null}}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}play(){let n=this._buildPlayer();n&&(this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),n.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}setPosition(n){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=n*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let n=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,o)=>{o!=="offset"&&n.set(o,this._finished?t:kr(this.element,o))}),this.currentSnapshot=n}triggerCallback(n){let e=n==="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Ur=class{validateStyleProperty(n){return!0}validateAnimatableStyleProperty(n){return!0}containsElement(n,e){return Ma(n,e)}getParentElement(n){return Tr(n)}query(n,e,t){return Fa(n,e,t)}computeStyle(n,e,t){return kr(n,e)}animate(n,e,t,o,r,p=[]){let u=o==0?"both":"forwards",v={duration:t,delay:o,fill:u};r&&(v.easing=r);let T=new Map,N=p.filter(q=>q instanceof Br);Ep(t,o)&&N.forEach(q=>{q.currentSnapshot.forEach((K,ne)=>T.set(ne,K))});let V=wp(e).map(q=>new Map(q));V=Ap(n,V,T);let le=F0(n,V);return new Br(n,V,v,le)}};var Ir="@",Gp="@.disabled",Hr=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(n,e,t,o){this.namespaceId=n,this.delegate=e,this.engine=t,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(n){this.delegate.destroyNode?.(n)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(n,e){return this.delegate.createElement(n,e)}createComment(n){return this.delegate.createComment(n)}createText(n){return this.delegate.createText(n)}appendChild(n,e){this.delegate.appendChild(n,e),this.engine.onInsert(this.namespaceId,e,n,!1)}insertBefore(n,e,t,o=!0){this.delegate.insertBefore(n,e,t),this.engine.onInsert(this.namespaceId,e,n,o)}removeChild(n,e,t,o){if(o){this.delegate.removeChild(n,e,t,o);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(n,e){return this.delegate.selectRootElement(n,e)}parentNode(n){return this.delegate.parentNode(n)}nextSibling(n){return this.delegate.nextSibling(n)}setAttribute(n,e,t,o){this.delegate.setAttribute(n,e,t,o)}removeAttribute(n,e,t){this.delegate.removeAttribute(n,e,t)}addClass(n,e){this.delegate.addClass(n,e)}removeClass(n,e){this.delegate.removeClass(n,e)}setStyle(n,e,t,o){this.delegate.setStyle(n,e,t,o)}removeStyle(n,e,t){this.delegate.removeStyle(n,e,t)}setProperty(n,e,t){e.charAt(0)==Ir&&e==Gp?this.disableAnimations(n,!!t):this.delegate.setProperty(n,e,t)}setValue(n,e){this.delegate.setValue(n,e)}listen(n,e,t,o){return this.delegate.listen(n,e,t,o)}disableAnimations(n,e){this.engine.disableAnimations(n,e)}},Xa=class extends Hr{factory;constructor(n,e,t,o,r){super(e,t,o,r),this.factory=n,this.namespaceId=e}setProperty(n,e,t){e.charAt(0)==Ir?e.charAt(1)=="."&&e==Gp?(t=t===void 0?!0:!!t,this.disableAnimations(n,t)):this.engine.process(this.namespaceId,n,e.slice(1),t):this.delegate.setProperty(n,e,t)}listen(n,e,t,o){if(e.charAt(0)==Ir){let r=R0(n),p=e.slice(1),u="";return p.charAt(0)!=Ir&&([p,u]=N0(p)),this.engine.listen(this.namespaceId,r,p,u,v=>{let T=v._data||-1;this.factory.scheduleListenerCallback(T,t,v)})}return this.delegate.listen(n,e,t,o)}};function R0(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function N0(i){let n=i.indexOf("."),e=i.substring(0,n),t=i.slice(n+1);return[e,t]}var $r=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(n,e,t){this.delegate=n,this.engine=e,this._zone=t,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(n,e){let o=this.delegate.createRenderer(n,e);if(!n||!e?.data?.animation){let T=this._rendererCache,N=T.get(o);if(!N){let V=()=>T.delete(o);N=new Hr("",o,this.engine,V),T.set(o,N)}return N}let r=e.id,p=e.id+"-"+this._currentId;this._currentId++,this.engine.register(p,n);let u=T=>{Array.isArray(T)?T.forEach(u):this.engine.registerTrigger(r,p,n,T.name,T)};return e.data.animation.forEach(u),new Xa(this,p,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(n,e,t){if(n>=0&&n<this._microtaskId){this._zone.run(()=>e(t));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[p,u]=r;p(u)}),this._animationCallbacksBuffer=[]})}),o.push([e,t])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(n){this.engine.flush(),this.delegate.componentReplaced?.(n)}};var L0=(()=>{class i extends Vn{constructor(e,t,o){super(e,t,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(t){return new(t||i)(To(Eo),To(Ji),To(en))};static \u0275prov=kt({token:i,factory:i.\u0275fac})}return i})();function O0(){return new Rr}function B0(i,n,e){return new $r(i,n,e)}var Wp=[{provide:en,useFactory:O0},{provide:Vn,useClass:L0},{provide:vs,useFactory:B0,deps:[Vs,Vn,zi]}],tb=[{provide:Ji,useClass:Za},{provide:da,useValue:"NoopAnimations"},...Wp],U0=[{provide:Ji,useFactory:()=>new Ur},{provide:da,useFactory:()=>"BrowserAnimations"},...Wp];function jp(){return xs("NgEagerAnimations"),[...U0]}var _o=i=>i.url;var Kp=()=>S(oe).user.isAdmin;var Qp=[{path:Yi.BASE,pathMatch:"prefix",canActivate:[Kp],children:[{path:Yi.USERS,data:{type:Zn.USER},loadComponent:()=>import("./chunk-I5SPA4G2.js").then(i=>i.AdminUsersComponent)},{path:Yi.GUESTS,data:{type:Zn.GUEST},loadComponent:()=>import("./chunk-I5SPA4G2.js").then(i=>i.AdminUsersComponent)},{path:Yi.GROUPS,children:[{path:"**",resolve:{routes:_o},data:{type:qi.USER},loadComponent:()=>import("./chunk-LNLBIJZD.js").then(i=>i.AdminGroupsComponent)}]},{path:Yi.PGROUPS,children:[{path:"**",resolve:{routes:_o},data:{type:qi.PERSONAL},loadComponent:()=>import("./chunk-LNLBIJZD.js").then(i=>i.AdminGroupsComponent)}]},{path:"**",redirectTo:Yi.USERS}]}];var qp=i=>S(li).linkValidation(i.params.uuid).pipe(zn(n=>n===!1?gi(!1):(i.data=Se(re({},i.data),{link:n}),gi(!0))));var Yp=[{path:va.LINK,children:[{path:":uuid",loadComponent:()=>import("./chunk-I3FR3A45.js").then(i=>i.PublicLinkComponent),canActivate:[qp]},{path:`:uuid/${va.AUTH}`,loadComponent:()=>import("./chunk-POUWUMC4.js").then(i=>i.PublicLinkAuthComponent)},{path:":uuid/:error",loadComponent:()=>import("./chunk-OUHCDDT6.js").then(i=>i.PublicLinkErrorComponent)}]}];var zr={BASE:`${ql}/comments`,RECENTS:"recents",SPACES:"spaces"},fo=`${zr.BASE}/${zr.SPACES}`,Xp=`${zr.BASE}/${zr.RECENTS}`;var Gr=class{constructor(n){Object.assign(this,n),this.author&&(this.author.avatarUrl=wn(this.author.login)),this.mimeUrl=io(this.file.mime),this.icon=this.file.fromShare?ie.SHARES:this.file.fromSpace?ie.SPACES:ie.PERSONAL,this.iconClass=this.file.fromShare?"purple":"primary",this.showedPath=[...this.file.path.split("/").slice(this.file.path.split("/")[1]===ht.PERSONAL?2:1),this.file.name].join("/")}};var Ln=class{constructor(n){this.wasModified=!1,Object.assign(this,n),this.author.avatarUrl=wn(this.author.login),this.wasModified=this.createdAt!==this.modifiedAt,this.dateToShow=this.wasModified?this.modifiedAt:this.createdAt}};var Wr=(()=>{let n=class n{constructor(){this.store=S(te),this.layout=S(I),this.http=S(Bs)}getComments(t){return this.http.get(`${fo}/${t.path}`).pipe(bt(o=>o.map(r=>new Ln(r))))}createComment(t,o){return this.http.post(`${fo}/${t.path}`,o).pipe(bt(r=>new Ln(r)))}updateComment(t,o){return this.http.patch(`${fo}/${t.path}`,o).pipe(bt(r=>new Ln(r)))}deleteComment(t,o){return this.http.request("delete",`${fo}/${t.path}`,{body:o})}loadRecents(t){this.http.get(Xp,{params:new Os().set("limit",t)}).pipe(bt(o=>o.map(r=>new Gr(r)))).subscribe({next:o=>{this.store.commentsRecents.update(r=>[...o,...r.slice(t)])},error:o=>this.layout.sendNotification("error","Comments","Unable to load",o)})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var H0=(i,n)=>n.id;function $0(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faTrashAlt)}}function z0(i,n){if(i&1){let e=y();a(0,"ul",8)(1,"li",9),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),a(2,"div",10),_(3,"app-user-avatar",11),l(),a(4,"div",12)(5,"span",13)(6,"span"),d(7),l()(),a(8,"span"),C(9,$0,1,1,"fa-icon",2),_(10,"fa-icon",14),a(11,"span"),d(12),l()()(),a(13,"div",15)(14,"span",16),d(15),b(16,"amTimeAgo"),l()()()()}if(i&2){let e=n.$implicit,t=n.$index,o=n.$count;O("border-0",t===o-1),s(3),m("user",e.author),s(4),w(e.content),s(),L(X("product-description text-",e.iconClass)),s(),x(e.file.inTrash?9:-1),s(),m("icon",e.icon),s(2),w(e.showedPath),s(3),w(E(16,11,e.modifiedAt,!0))}}function G0(i,n){if(i&1&&(a(0,"div",7),_(1,"fa-icon",17),a(2,"div",18),d(3,"No recent comments"),l()()),i&2){let e=c();s(),m("icon",e.icons.faCommentDots)}}var Zp=(()=>{let n=class n{constructor(){this.moreElements=!1,this.icons={faCommentDots:vr,faMagnifyingGlassPlus:zo,faMagnifyingGlassMinus:$o,faTrashAlt:Di},this.router=S(Ce),this.layout=S(I),this.store=S(te),this.commentsService=S(Wr),this.nbInitialComments=10,this.nbComments=this.nbInitialComments,this.comments=ve(()=>this.store.commentsRecents().slice(0,this.nbComments)),this.load()}switchMore(){this.moreElements?(this.moreElements=!1,this.nbComments=this.nbInitialComments):(this.moreElements=!0,this.nbComments*=5),this.load()}goToFile(t){this.router.navigate([z.SPACES,...t.file.path.split("/")],{queryParams:{select:t.file.name}}).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}load(){this.commentsService.loadRecents(this.nbComments)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-comments-recents-widget"]],decls:10,vars:3,consts:[[1,"box-transparent"],[1,"box-header"],[3,"icon"],["l10nTranslate","",1,"box-title"],["role","button",1,"ms-auto","btn-link",3,"click","icon"],[1,"box-body","px-0","py-0"],[1,"products-list","product-list-in-box",3,"border-0"],[1,"d-flex","flex-column","justify-content-center","text-align-center","text-gray","mt-5"],[1,"products-list","product-list-in-box"],[1,"item",3,"click"],[1,"product-img"],[3,"user"],[1,"product-info"],[1,"product-title"],[1,"me-1",3,"icon"],[1,"product-badge"],[1,"badge","rounded-pill","bg-warning"],["size","4x",3,"icon"],["l10nTranslate","",1,"mt-4"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Comments"),l(),a(5,"fa-icon",4),f("click",function(){return r.switchMore()}),l()(),a(6,"div",5),k(7,z0,17,14,"ul",6,H0,!1,G0,4,1,"div",7),l()()),o&2&&(s(2),m("icon",r.icons.faCommentDots),s(3),m("icon",r.moreElements?r.icons.faMagnifyingGlassMinus:r.icons.faMagnifyingGlassPlus),s(2),M(r.comments()))},dependencies:[P,F,Ze,Je],encapsulation:2});let i=n;return i})();var W0=(i,n)=>n.id;function j0(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faTrashAlt)}}function K0(i,n){if(i&1){let e=y();a(0,"ul",8)(1,"li",9),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),a(2,"div",10)(3,"img",11),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l()(),a(4,"div",12)(5,"span",13)(6,"span"),d(7),l()(),a(8,"span"),C(9,j0,1,1,"fa-icon",2),_(10,"fa-icon",14),a(11,"span"),d(12),l()()(),a(13,"div",15)(14,"span",16),d(15),b(16,"amTimeAgo"),l()()()()}if(i&2){let e=n.$implicit,t=n.$index,o=n.$count;O("border-0",t===o-1),s(3),m("src",e.mimeUrl,ee),s(4),w(e.name),s(),L(X("product-description text-",e.iconClass)),s(),x(e.inTrash?9:-1),s(),m("icon",e.icon),s(2),w(e.showedPath),s(3),w(E(16,11,e.mtime,!0))}}function Q0(i,n){if(i&1&&(a(0,"div",7),_(1,"fa-icon",17),a(2,"div",18),d(3,"No recent files"),l()()),i&2){let e=c();s(),m("icon",e.icons.faFileLines)}}var Jp=(()=>{let n=class n{constructor(){this.moreElements=!1,this.icons={faFileLines:Bc,faMagnifyingGlassPlus:zo,faMagnifyingGlassMinus:$o,faTrashAlt:Di},this.router=S(Ce),this.store=S(te),this.filesService=S(He),this.nbInitialFiles=10,this.nbFiles=this.nbInitialFiles,this.files=ve(()=>this.store.filesRecents().slice(0,this.nbFiles)),this.load()}switchMore(){this.moreElements?(this.moreElements=!1,this.nbFiles=this.nbInitialFiles):(this.moreElements=!0,this.nbFiles*=5),this.load()}goToFile(t){this.router.navigate([z.SPACES,...t.path.split("/")],{queryParams:{select:t.name}}).catch(console.error)}load(){this.filesService.loadRecents(this.nbFiles)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-recents-widget"]],decls:10,vars:3,consts:[[1,"box-transparent"],[1,"box-header"],[3,"icon"],["l10nTranslate","",1,"box-title"],["role","button",1,"ms-auto","btn-link",3,"click","icon"],[1,"box-body","px-0","py-0"],[1,"products-list","product-list-in-box",3,"border-0"],[1,"d-flex","flex-column","justify-content-center","text-align-center","text-gray","mt-5"],[1,"products-list","product-list-in-box"],[1,"item",3,"click"],[1,"product-img"],["alt","",3,"error","src"],[1,"product-info"],[1,"product-title"],[1,"me-1",3,"icon"],[1,"product-badge"],[1,"badge","rounded-pill","bg-warning"],["size","4x",3,"icon"],["l10nTranslate","",1,"mt-4"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Files"),l(),a(5,"fa-icon",4),f("click",function(){return r.switchMore()}),l()(),a(6,"div",5),k(7,K0,17,14,"ul",6,W0,!1,Q0,4,1,"div",7),l()()),o&2&&(s(2),m("icon",r.icons.faFileLines),s(3),m("icon",r.moreElements?r.icons.faMagnifyingGlassMinus:r.icons.faMagnifyingGlassPlus),s(2),M(r.files()))},dependencies:[P,F,Je],encapsulation:2});let i=n;return i})();var ed=(()=>{let n=class n{constructor(){this.layout=S(I),this.layout.setBreadcrumbIcon(dc),this.layout.setBreadcrumbNav({url:`/${mi.BASE}/${pc}`,translating:!0,sameLink:!0})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-recents"]],decls:6,vars:2,consts:[["appAutoResize","",1,"fs-xs","px-2",3,"useMaxHeight","resizeOffset"],[1,"row"],[1,"col-md-6"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,"app-files-recents-widget"),l(),a(4,"div",2),_(5,"app-comments-recents-widget"),l()()()),o&2&&m("useMaxHeight",!1)("resizeOffset",40)},dependencies:[ce,Jp,Zp],encapsulation:2});let i=n;return i})();var td=[{path:rr.BASE,pathMatch:"full",redirectTo:mi.BASE},{path:mi.BASE,component:ed}];var ho={BASE:"search"},q0="Search",jr=Bo,id={title:q0,link:ho.BASE,icon:jr,level:2,submenus:[]};function X0(i,n){if(i&1){let e=y();a(0,"span",6)(1,"fa-icon",13),f("click",function(){h(e);let o=c();return g(o.clearSearch())}),l()()}if(i&2){let e=c();s(),m("icon",e.icons.faTimes)}}function Z0(i,n){if(i&1&&(a(0,"div",11),d(1),l()),i&2){let e=c();s(),w(e.errorMessage)}}function J0(i,n){if(i&1&&(a(0,"div")(1,"span"),d(2,"..."),l(),_(3,"span",23),a(4,"span"),d(5,"..."),l()()),i&2){let e=n.$implicit;s(3),m("innerHTML",e,Wn)}}function eu(i,n){if(i&1&&(_(0,"hr",21),a(1,"div",22),k(2,J0,6,1,"div",null,We),l()),i&2){let e=c().$implicit;s(2),M(e.matches)}}function tu(i,n){if(i&1){let e=y();a(0,"div",14),f("click",function(){let o=h(e).$index,r=c();return g(r.selectedId=o)})("appTap",function(){let o=h(e).$implicit,r=c();return g(r.goTo(o))}),a(1,"div",15)(2,"img",16),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"div",17)(4,"span",18),d(5),l(),a(6,"div"),_(7,"fa-icon",19),a(8,"span",20)(9,"span"),d(10),l()()()()(),C(11,eu,4,0),l()}if(i&2){let e=n.$implicit,t=n.$index,o=c();O("selected",t===o.selectedId),s(2),m("src",e.mimeUrl,ee),s(3),w(e.name),s(),L(X("d-flex align-items-center text-",e.iconClass)),s(),m("icon",e.icon),s(3),w(e.showedPath),s(),x(e.matches!=null&&e.matches.length?11:-1)}}var nd=(()=>{let n=class n{constructor(){this.locale=S($),this.store=S(te),this.searchContent=ve(()=>this.store.currentSearch().content),this.icons={SEARCH_ICON:jr,faSpinner:Ue,faTrashCan:Ai,faTimes:Rt,faFont:Fl},this.minCharsToSearch=3,this.loading=!1,this.errorMessage=null,this.selectedId=null,this.router=S(Ce),this.layout=S(I),this.filesService=S(He),this.layout.setBreadcrumbIcon(jr),this.layout.setBreadcrumbNav({url:`/${ho.BASE}`,translating:!1,sameLink:!0})}setCurrentSearch(t){this.store.currentSearch.update(o=>Se(re({},o),{content:t.target.value}))}doSearch(){this.searchContent().length<this.minCharsToSearch||(this.errorMessage=null,this.loading=!0,this.selectedId=null,this.filesService.search(this.store.currentSearch()).subscribe({next:t=>{this.store.filesSearch.set(t),this.loading=!1},error:t=>{this.store.filesSearch.set([]),this.errorMessage=t.error.message,this.loading=!1}}))}toggleFullText(){this.store.currentSearch.update(t=>Se(re({},t),{fullText:!t.fullText}))}clearSearch(){this.store.currentSearch.update(t=>Se(re({},t),{content:""})),this.store.filesSearch.set([])}goTo(t){this.router.navigate([z.SPACES,...t.path.split("/")],{queryParams:{select:t.name}}).catch(console.error)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-search"]],viewQuery:function(o,r){if(o&1&&Y(Ve,7),o&2){let p;W(p=j())&&(r.inputFilter=p.first)}},decls:17,vars:19,consts:[[1,"app-top-menu"],[1,"col-12","col-md-6","col-lg-4"],[1,"input-group"],["role","button","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled"],[3,"icon","animation"],["name","search","type","text","appAutofocus","","autocomplete","",1,"flex-fill","form-control","form-control-sm",2,"padding-right","2rem",3,"input","keyup.enter","keyup.escape","value","placeholder"],[1,"cursor-pointer",2,"position","absolute","right","40px","top","3px","z-index","1001","font-size","1rem"],["placement","bottom","role","button","type","button","btnCheckbox","",1,"btn","btn-sm","btn-outline-secondary-alt","fs-xxs",3,"ngModelChange","ngModel","tooltip"],[3,"icon"],[1,"d-none","d-sm-none","d-md-block","d-lg-block","ms-auto"],["appAutoResize","",1,"fs-xs"],["l10nTranslate","",1,"p-3","text-danger","fw-500"],[1,"app-div-striped","py-2",3,"selected"],["role","button",3,"click","icon"],[1,"app-div-striped","py-2",3,"click","appTap"],[1,"d-flex","align-items-center","text-truncate","px-2","py-1"],["alt","","draggable","false","height","28",3,"error","src"],[1,"d-flex","flex-column","text-truncate","ms-2",2,"height","34px"],[1,"fs-xxs","text-truncate"],[1,"me-1",3,"icon"],[1,"fs-xxxs","text-truncate"],[1,"m-0"],[1,"d-flex","flex-column","px-2","py-1"],[1,"fs-xxxs",3,"innerHTML"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),f("click",function(){return r.doSearch()}),_(4,"fa-icon",4),l(),a(5,"input",5),b(6,"translate"),f("input",function(u){return r.setCurrentSearch(u)})("keyup.enter",function(){return r.doSearch()})("keyup.escape",function(){return r.clearSearch()}),l(),C(7,X0,2,1,"span",6),a(8,"button",7),b(9,"translate"),f("ngModelChange",function(){return r.toggleFullText()}),_(10,"fa-icon",8),l()()(),_(11,"app-input-filter",9),l(),a(12,"div",10),C(13,Z0,2,1,"div",11),k(14,tu,12,10,"div",12,We),b(16,"searchFilter"),l()),o&2&&(s(3),m("disabled",r.searchContent().length<r.minCharsToSearch),s(),m("icon",r.loading?r.icons.faSpinner:r.icons.SEARCH_ICON)("animation",r.loading?"spin":null),s(),m("value",r.searchContent())("placeholder",E(6,10,r.store.currentSearch().fullText?"Search for content":"Search for files",r.locale.language)),s(2),x(r.searchContent()?7:-1),s(),m("ngModel",r.store.currentSearch().fullText)("tooltip",E(9,13,"Search for content",r.locale.language)),s(2),m("icon",r.icons.faFont),s(3),x(r.errorMessage?13:-1),s(),M(E(16,16,r.store.filesSearch(),r.inputFilter.search())))},dependencies:[Ve,F,Ye,Tn,be,xe,ye,ce,Me,nt,P,Z,gt],encapsulation:2});let i=n;return i})();var od=[{path:ho.BASE,component:nd}];var rd=(i,n)=>n.key;function iu(i,n){if(i&1){let e=y();a(0,"li",6)(1,"a",8),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.setView(o.key))}),a(2,"span"),_(3,"fa-icon",2),d(4),l()()()}if(i&2){let e=n.$implicit;s(3),m("icon",e.value.icon),s(),D(" ",e.value.text)}}function nu(i,n){if(i&1&&_(0,"fa-icon",10),i&2){let e=c(3);m("icon",e.sortParams.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function ou(i,n){if(i&1){let e=y();a(0,"li",6)(1,"a",8),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.sortBy.emit(o.key))}),a(2,"span",9),d(3),C(4,nu,1,1,"fa-icon",10),l()()()}if(i&2){let e=n.$implicit,t=c(2);s(3),D(" ",e.value," "),s(),x(t.sortParams.column===e.key?4:-1)}}function ru(i,n){if(i&1&&(a(0,"ul",4)(1,"li",5),d(2,"Display"),l(),k(3,iu,5,2,"li",6,rd),b(5,"keyvalue"),a(6,"li",7),d(7,"Sort by"),l(),k(8,ou,5,2,"li",6,rd),b(10,"keyvalue"),l()),i&2){let e=c();s(3),M(E(5,0,e.viewsMode,e.originalOrderKeyValue)),s(5),M(E(10,3,e.sortFields,e.originalOrderKeyValue))}}var lt=(()=>{let n=class n{constructor(){this.switchView=new ae,this.sortBy=new ae,this.originalOrderKeyValue=De,this.icons={faCog:Ei,faArrowDown:_t,faArrowUp:dt},this.viewsMode={tl:{enabled:!1,text:"List",icon:bl},th:{enabled:!0,text:"S",icon:Xn,dimensions:96,image:56,imageRes:128,faSize:30,textSize:10,margins:18},thM:{enabled:!0,text:"M",icon:Xn,dimensions:112,image:72,imageRes:192,faSize:34,textSize:11,margins:18},thL:{enabled:!0,text:"L",icon:Xn,dimensions:152,image:112,imageRes:256,faSize:50,textSize:12,margins:18},thXl:{enabled:!0,text:"XL",icon:Xn,dimensions:192,image:152,imageRes:512,faSize:65,textSize:13,margins:18},thXxl:{enabled:!0,text:"XXL",icon:Ll,dimensions:232,image:192,imageRes:1024,faSize:80,textSize:13,margins:18}},this.layout=S(I),this.viewsMode.tl.text=this.layout.translateString(this.viewsMode.tl.text)}get viewMode(){return localStorage.getItem("viewMode")||"tl"}set viewMode(t){localStorage.setItem("viewMode",t)}currentView(){return this.viewsMode[this.viewMode]}setView(t){this.viewMode=t,this.switchView.emit(this.viewsMode[t])}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,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,r){o&1&&(a(0,"div",0)(1,"button",1),_(2,"fa-icon",2),l(),R(3,ru,11,6,"ul",3),l()),o&2&&(s(2),m("icon",r.icons.faCog))},dependencies:[Ri,Pi,Ii,Fi,F,P,Ee],encapsulation:2,changeDetection:0});let i=n;return i})();var au=(i,n)=>n.key;function su(i,n){i&1&&(a(0,"span",0),d(1,"No permissions"),l())}function lu(i,n){if(i&1&&(_(0,"fa-icon",1),b(1,"translate")),i&2){let e=n.$implicit,t=c(2);m("icon",e.value.icon)("tooltip",E(1,3,e.value.text,t.locale.language))("placement",t.tooltipPlacement)}}function cu(i,n){if(i&1&&(k(0,lu,2,6,"fa-icon",1,au),b(2,"keyvalue")),i&2){let e=c();M(E(2,0,e.permissions,e.originalOrderKeyValue))}}var vt=(()=>{let n=class n{constructor(){this.permissions={},this.tooltipPlacement="top",this.replaceEmptyPermissions=!1,this.locale=S($),this.hasPermissions=!1,this.originalOrderKeyValue=De}ngOnChanges(){this.hasPermissions=!!Object.keys(this.permissions).length}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-file-permissions"]],inputs:{permissions:"permissions",tooltipPlacement:"tooltipPlacement",replaceEmptyPermissions:"replaceEmptyPermissions"},features:[rn],decls:2,vars:1,consts:[["l10nTranslate",""],[1,"cursor-pointer","fs-md",3,"icon","tooltip","placement"]],template:function(o,r){o&1&&C(0,su,2,0,"span",0)(1,cu,3,3),o&2&&x(r.replaceEmptyPermissions&&!r.hasPermissions?0:1)},dependencies:[Ke,Me,P,F,Ee,Z],encapsulation:2});let i=n;return i})();var pu=["MainContextMenu"],du=["TargetContextMenu"],sd=(i,n)=>n.id,ld=(i,n)=>n.key;function mu(i,n){if(i&1&&(a(0,"span",30),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),D(" ",e.hTimeAccessAgo," ")}}function uu(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openLinkDialog())}),a(1,"div",22)(2,"img",23),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"span",24),C(4,mu,2,3,"span",25),l(),a(5,"span",26),_(6,"app-share-repository",27),l()(),a(7,"div",28)(8,"span",29),d(9),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("selected",e.id===(o.selected==null?null:o.selected.id))("disabled",!e.link.isActive),s(),Zt("rowIndex",t),s(),m("src",e.mimeUrl,ee)("height",o.galleryMode.image)("width",o.galleryMode.image),s(2),x(e.newly?4:-1),s(2),m("share",e)("galleryMode",o.galleryMode),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.name)}}function _u(i,n){if(i&1){let e=y();a(0,"div",13)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",19),k(4,uu,10,18,"div",20,sd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function fu(i,n){if(i&1&&_(0,"fa-icon",37),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function hu(i,n){if(i&1){let e=y();a(0,"th",36),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,fu,1,2,"fa-icon",37),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function gu(i,n){if(i&1&&C(0,hu,3,10,"th",35),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Cu(i,n){if(i&1){let e=y();a(0,"div",40)(1,"img",43),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),a(2,"div",44)(3,"span",29),d(4),l(),a(5,"span",45),d(6),l()()()}if(i&2){let e=c(3).$implicit;s(),m("src",e.mimeUrl,ee),s(3),w(e.name),s(2),w(e.description)}}function xu(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.link.email||"")}}function Su(i,n){if(i&1&&(a(0,"span",41)(1,"span"),d(2),l(),C(3,xu,2,1,"span"),l()),i&2){let e=c(3).$implicit;s(2),w(e.link.name),s(),x(e.link.email?3:-1)}}function vu(i,n){if(i&1&&_(0,"app-share-repository",42),i&2){let e=c(3).$implicit;m("share",e)}}function yu(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(4).$implicit;L(X("badge rounded-pill ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),s(),Re(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function bu(i,n){if(i&1&&(a(0,"span",47),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.link.nbAccess)}}function wu(i,n){if(i&1&&(a(0,"span",49),d(1),b(2,"translate"),l()),i&2){let e=c(5).$implicit,t=c(2);s(),Re("",e.hTimeExpirationAgo,"\xA0",E(2,2,e.hTimeExpirationAgo===1?"day":"days",t.locale.language))}}function Tu(i,n){if(i&1&&(a(0,"span"),_(1,"fa-icon",37),C(2,wu,3,5,"span",49),l()),i&2){let e=c(4).$implicit,t=c(2);L(X("badge rounded-pill bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),s(),m("icon",t.icons.faClock)("fixedWidth",!1),s(),x(e.hTimeExpirationAgo>=1?2:-1)}}function Eu(i,n){if(i&1&&(a(0,"span",48),_(1,"fa-icon",6),l()),i&2){let e=c(6);s(),m("icon",e.icons.faLock)}}function Au(i,n){if(i&1&&(C(0,yu,2,5,"span",46)(1,bu,2,1,"span",47),C(2,Tu,3,6,"span",46),C(3,Eu,2,1,"span",48)),i&2){let e=c(3).$implicit;x(e.link.limitAccess?0:1),s(2),x(e.link.expiresAt?2:-1),s(),x(e.link.requireAuth?3:-1)}}function Du(i,n){if(i&1&&_(0,"app-file-permissions",50),i&2){let e=c(4).$implicit;m("permissions",e.hPerms)}}function ku(i,n){if(i&1&&C(0,Du,1,1,"app-file-permissions",50),i&2){let e=c(3).$implicit;x(e.link.permissions?0:-1)}}function Mu(i,n){if(i&1&&d(0),i&2){let e=c(4).$implicit;D(" ",e.hTimeAccessAgo," ")}}function Fu(i,n){i&1&&(a(0,"span",51),d(1,"never"),l())}function Pu(i,n){if(i&1&&C(0,Mu,1,1)(1,Fu,2,0,"span",51),i&2){let e=c(3).$implicit;x(e.link.currentAccess?0:1)}}function Iu(i,n){if(i&1&&(a(0,"td"),C(1,Cu,7,3,"div",40)(2,Su,4,2,"span",41)(3,vu,1,1,"app-share-repository",42)(4,Au,4,3)(5,ku,1,1)(6,Pu,2,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly!==void 0?"props-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="link"?2:e==="from"?3:e==="info"?4:e==="permissions"?5:e==="accessed"?6:-1)}}function Ru(i,n){if(i&1&&C(0,Iu,7,9,"td",39),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Nu(i,n){if(i&1){let e=y();a(0,"tr",38),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openLinkDialog())}),k(1,Ru,1,1,null,null,ld),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("selected",e.id===(t.selected==null?null:t.selected.id))("disabled",!e.link.isActive),s(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Vu(i,n){if(i&1){let e=y();a(0,"table",31)(1,"thead")(2,"tr"),k(3,gu,1,1,null,null,ld),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",32),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",31)(9,"tbody",33),k(10,Nu,4,7,"tr",34,sd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.shares,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Lu(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Ou(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Go to"),l()),i&2){let e=c();s(),m("icon",e.icons.faMapMarkerAlt)}}function Bu(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Edit link"),l()),i&2){let e=c();s(),m("icon",e.icons.faPen)}}function Uu(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Copy link"),l()),i&2){let e=c();s(),m("icon",e.icons.faClipboard)}}function Hu(i,n){}function $u(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var cd=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.icons={faLink:Qo,faArrowRotateRight:ut,faArrowDown:_t,faArrowUp:dt,faMapMarkerAlt:ir,faPen:mt,faEllipsisH:Lo,faClock:fl,faLock:ii,faClipboard:Cl,faClipboardCheck:Uo,faCircleInfo:Nt},this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.loading=!1,this.linkWasCopied=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},link:{label:"Link",width:15,textCenter:!1,class:"d-none d-sm-table-cell",show:!0,sortable:!0},from:{label:"Shared from",width:15,textCenter:!1,class:"d-none d-md-table-cell",show:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},accessed:{label:"Accessed",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",link:"Link",accessed:"Accessed"},this.activatedRoute=S(Jt),this.store=S(te),this.linksService=S(li),this.sharesService=S(si),this.sortSettings={default:[{prop:"name",type:"string"}],link:[{prop:"link.name",type:"string"}],name:[{prop:"name",type:"string"}],info:[{prop:"link.nbAccess",type:"number"}],permissions:[{prop:"link.permissions",type:"length"}],accessed:[{prop:"link.currentAccess",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadShareLinks(),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(this.icons.faLink),this.layout.setBreadcrumbNav({url:`/${z.LINKS}/${Bt.SHARED_BY_LINKS}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShareLinks(){this.loading=!0,this.onSelect(),this.linksService.shareLinksList().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Links",t.error.message)}})}sortBy(t,o=!0,r){this.shares=this.sortTable.sortBy(t,o,r||this.shares)}onSelect(t=null){this.selected=t,this.store.linkSelection.set(this.selected)}openLinkDialog(){this.linksService.shareLink(this.selected.id).subscribe(t=>{this.layout.openDialog(Fn,"md",{initialState:{share:t}}).content.shareChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="update"?this.selected=Object.assign(this.selected,u):p==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(v=>v.id!==u.id)))})})}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}copyToClipboard(){this.selected&&(this.linksService.copyLinkToClipboard(this.selected.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.selected.file.name||this.selected.name),setTimeout(()=>this.linkWasCopied=!1,3e3))}goTo(t){t=t||this.selected,this.sharesService.goTo(t).catch(console.error)}focusOn(t){let o=this.shares.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared-links"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(pu,7),Y(du,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:33,vars:36,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["container","body","type","button",3,"click","disabled","tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","disabled","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected","disabled"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[1,"d-flex","flex-column"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"badge","rounded-pill","bg-gray-dark","ms-1"],[1,"ms-2"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadShareLinks())}),_(3,"fa-icon",4),l(),a(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openLinkDialog())}),_(6,"fa-icon",6),l(),a(7,"button",7),b(8,"translate"),f("click",function(){return h(p),g(r.copyToClipboard())}),_(9,"fa-icon",6),l(),a(10,"button",8),b(11,"translate"),f("click",function(){return h(p),g(r.goTo())}),_(12,"fa-icon",6),l(),a(13,"div",9)(14,"div",10),_(15,"app-input-filter",11),l(),a(16,"app-navigation-view",12),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(17,_u,6,8,"div",13)(18,Vu,12,8),a(19,"div",14)(20,"span",15),d(21),b(22,"translate"),l()(),a(23,"context-menu",null,0),R(25,Lu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.loadShareLinks())}),l(),a(26,"context-menu",null,1),R(28,Ou,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.goTo())}),R(29,Bu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.openLinkDialog())}),R(30,Uu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.copyToClipboard())}),R(31,Hu,0,0,"ng-template",17)(32,$u,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(s(),m("tooltip",E(2,21,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),m("disabled",!r.selected)("tooltip",E(5,24,"Edit link",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),L(X("btn btn-sm me-1 ",r.linkWasCopied?"btn-info":"btn-secondary")),m("disabled",!r.selected)("tooltip",E(8,27,"Copy link",r.locale.language)),s(2),m("icon",r.linkWasCopied?r.icons.faClipboardCheck:r.icons.faClipboard),s(),m("disabled",!r.selected)("tooltip",E(11,30,"Go to",r.locale.language)),s(2),m("icon",r.icons.faMapMarkerAlt),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?17:18),s(4),Re("",r.shares.length," ",E(22,33,"shares",r.locale.language)),s(10),m("divider",!0))},dependencies:[Ot,Lt,Vt,F,P,lt,Ke,Me,Ve,Xe,ai,vt,nt,Ee,Z,gt],encapsulation:2});let i=n;return i})();var Kr=class{constructor(n){this.syncs=[],this.newly=0,Object.assign(this,n),$c(this),this.hTimeAgo=Mi(this.createdAt).fromNow(!0),this.newly=ar(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=Sr}};var Qr=(()=>{let n=class n{transform(t,o=0,r=void 0){return bn(t,o,r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=an({name:"pathSlice",type:n,pure:!0});let i=n;return i})();var zu=i=>({$implicit:i});function Gu(i,n){i&1&&(a(0,"span"),d(1,"loading..."),l())}var Wu=["*"];function ju(i,n){if(i&1){let e=y();Gi(0,"span",2),jn("click",function(o){h(e);let r=c();return g(r.node().mouseAction("expanderClick",o))}),_a(1,"span",3),Wi()}if(i&2){let e=c();O("toggle-children-wrapper-expanded",e.node().isExpanded)("toggle-children-wrapper-collapsed",e.node().isCollapsed)}}function Ku(i,n){i&1&&_a(0,"span",1)}var Qu=(i,n,e)=>({$implicit:i,node:n,index:e});function qu(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c();s(),w(e.node().displayField)}}var hd=(i,n,e,t)=>({$implicit:i,node:n,index:e,templates:t});function Yu(i,n){if(i&1&&_(0,"tree-node-checkbox",3),i&2){let e=c(2);m("node",e.node())}}function Xu(i,n){if(i&1){let e=y();a(0,"div",2),C(1,Yu,1,1,"tree-node-checkbox",3),_(2,"tree-node-expander",3),a(3,"div",4),f("click",function(o){h(e);let r=c();return g(r.node().mouseAction("click",o))})("dblclick",function(o){h(e);let r=c();return g(r.node().mouseAction("dblClick",o))})("mouseover",function(o){h(e);let r=c();return g(r.node().mouseAction("mouseOver",o))})("mouseout",function(o){h(e);let r=c();return g(r.node().mouseAction("mouseOut",o))})("contextmenu",function(o){h(e);let r=c();return g(r.node().mouseAction("contextMenu",o))})("treeDrop",function(o){h(e);let r=c();return g(r.node().onDrop(o))})("treeDropDragOver",function(o){h(e);let r=c();return g(r.node().mouseAction("dragOver",o))})("treeDropDragLeave",function(o){h(e);let r=c();return g(r.node().mouseAction("dragLeave",o))})("treeDropDragEnter",function(o){h(e);let r=c();return g(r.node().mouseAction("dragEnter",o))}),_(4,"tree-node-content",5),l()()}if(i&2){let e=c();B("padding-left",e.node().getNodePadding()),s(),x(e.node().options.useCheckbox?1:-1),s(),m("node",e.node()),s(),O("node-content-wrapper-active",e.node().isActive)("node-content-wrapper-focused",e.node().isFocused),m("treeAllowDrop",e.node().allowDrop)("allowDragoverStyling",e.node().allowDragoverStyling())("treeDrag",e.node())("treeDragEnabled",e.node().allowDrag()),s(),m("node",e.node())("index",e.index())("template",e.templates().treeNodeTemplate)}}function Zu(i,n){if(i&1&&_(0,"tree-node-collection",1),i&2){let e=c(2);m("nodes",e.children())("templates",e.templates())("treeModel",e.node().treeModel)}}function Ju(i,n){if(i&1&&_(0,"tree-loading-component",3),i&2){let e=c(2);B("padding-left",e.node().getNodePadding()),m("template",e.templates().loadingTemplate)("node",e.node())}}function e_(i,n){if(i&1&&(a(0,"div"),C(1,Zu,1,3,"tree-node-collection",1),C(2,Ju,1,4,"tree-loading-component",2),l()),i&2){let e=c();O("tree-children",!0)("tree-children-no-padding",e.node().options.levelPadding),s(),x(e.children()?1:-1),s(),x(e.children()?-1:2)}}function t_(i,n){if(i&1&&_(0,"tree-node",0),i&2){let e=n.$implicit,t=n.$index,o=c();m("node",e)("index",t)("templates",o.templates())}}function i_(i,n){if(i&1&&_(0,"tree-node-drop-slot",2),i&2){let e=c(2);m("dropIndex",e.node().index)("node",e.node().parent)}}function n_(i,n){if(i&1&&(a(0,"div"),C(1,i_,1,2,"tree-node-drop-slot",2),_(2,"tree-node-wrapper",3)(3,"tree-node-children",4)(4,"tree-node-drop-slot",2),l()),i&2){let e=c();L(e.node().getClass()),O("tree-node",!0)("tree-node-expanded",e.node().isExpanded&&e.node().hasChildren)("tree-node-collapsed",e.node().isCollapsed&&e.node().hasChildren)("tree-node-leaf",e.node().isLeaf)("tree-node-active",e.node().isActive)("tree-node-focused",e.node().isFocused),s(),x(e.index()===0?1:-1),s(),m("node",e.node())("index",e.index())("templates",e.templates()),s(),m("node",e.node())("templates",e.templates()),s(),m("dropIndex",e.node().index+1)("node",e.node().parent)}}var o_=["loadingTemplate"],r_=["treeNodeTemplate"],a_=["treeNodeWrapperTemplate"],s_=["treeNodeFullTemplate"],l_=["viewport"],c_=(i,n,e,t)=>({loadingTemplate:i,treeNodeTemplate:n,treeNodeWrapperTemplate:e,treeNodeFullTemplate:t});function p_(i,n){if(i&1&&_(0,"tree-node-collection",4),i&2){let e=c();m("nodes",e.treeModel.roots)("treeModel",e.treeModel)("templates",ko(3,c_,e.loadingTemplate,e.treeNodeTemplate,e.treeNodeWrapperTemplate,e.treeNodeFullTemplate))}}function d_(i,n){if(i&1&&_(0,"tree-node-drop-slot",5),i&2){let e=c();m("dropIndex",0)("node",e.treeModel.virtualRoot)}}var rt={LEFT:37,UP:38,RIGHT:39,DOWN:40,ENTER:13,SPACE:32,CONTEXT_MENU:32},Pe={TOGGLE_ACTIVE:(i,n,e)=>n&&n.toggleActivated(),TOGGLE_ACTIVE_MULTI:(i,n,e)=>n&&n.toggleActivated(!0),TOGGLE_SELECTED:(i,n,e)=>n&&n.toggleSelected(),ACTIVATE:(i,n,e)=>n.setIsActive(!0),DEACTIVATE:(i,n,e)=>n.setIsActive(!1),SELECT:(i,n,e)=>n.setIsSelected(!0),DESELECT:(i,n,e)=>n.setIsSelected(!1),FOCUS:(i,n,e)=>n.focus(),TOGGLE_EXPANDED:(i,n,e)=>n.hasChildren&&n.toggleExpanded(),EXPAND:(i,n,e)=>n.expand(),COLLAPSE:(i,n,e)=>n.collapse(),DRILL_DOWN:(i,n,e)=>i.focusDrillDown(),DRILL_UP:(i,n,e)=>i.focusDrillUp(),NEXT_NODE:(i,n,e)=>i.focusNextNode(),PREVIOUS_NODE:(i,n,e)=>i.focusPreviousNode(),MOVE_NODE:(i,n,e,{from:t,to:o})=>{e.ctrlKey?i.copyNode(t,o):i.moveNode(t,o)}},On={mouse:{click:Pe.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:Pe.TOGGLE_EXPANDED,checkboxClick:Pe.TOGGLE_SELECTED,drop:Pe.MOVE_NODE},keys:{[rt.RIGHT]:Pe.DRILL_DOWN,[rt.LEFT]:Pe.DRILL_UP,[rt.DOWN]:Pe.NEXT_NODE,[rt.UP]:Pe.PREVIOUS_NODE,[rt.SPACE]:Pe.TOGGLE_ACTIVE,[rt.ENTER]:Pe.TOGGLE_ACTIVE}},Yr=class{get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return this.options.scrollOnActivate===void 0?!0:this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return this.options.useTriState===void 0?!0:this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return this.options.allowDragoverStyling===void 0?!0:this.options.allowDragoverStyling}constructor(n={}){this.options=n,this.actionMapping={mouse:{click:this.options?.actionMapping?.mouse?.click??On.mouse.click,dblClick:this.options?.actionMapping?.mouse?.dblClick??On.mouse.dblClick,contextMenu:this.options?.actionMapping?.mouse?.contextMenu??On.mouse.contextMenu,expanderClick:this.options?.actionMapping?.mouse?.expanderClick??On.mouse.expanderClick,checkboxClick:this.options?.actionMapping?.mouse?.checkboxClick??On.mouse.checkboxClick,drop:this.options?.actionMapping?.mouse?.drop??On.mouse.drop,dragStart:this.options?.actionMapping?.mouse?.dragStart??void 0,drag:this.options?.actionMapping?.mouse?.drag??void 0,dragEnd:this.options?.actionMapping?.mouse?.dragEnd??void 0,dragOver:this.options?.actionMapping?.mouse?.dragOver??void 0,dragLeave:this.options?.actionMapping?.mouse?.dragLeave??void 0,dragEnter:this.options?.actionMapping?.mouse?.dragEnter??void 0,mouseOver:this.options?.actionMapping?.mouse?.mouseOver??void 0,mouseOut:this.options?.actionMapping?.mouse?.mouseOut??void 0},keys:{[rt.RIGHT]:Pe.DRILL_DOWN,[rt.LEFT]:Pe.DRILL_UP,[rt.DOWN]:Pe.NEXT_NODE,[rt.UP]:Pe.PREVIOUS_NODE,[rt.SPACE]:Pe.TOGGLE_ACTIVE,[rt.ENTER]:Pe.TOGGLE_ACTIVE}},this.options?.actionMapping?.keys&&(this.actionMapping.keys=re(re({},this.actionMapping.keys),this.options.actionMapping.keys)),n.rtl&&(this.actionMapping.keys[rt.RIGHT]=n.actionMapping?.keys[rt.RIGHT]||Pe.DRILL_UP,this.actionMapping.keys[rt.LEFT]=n.actionMapping?.keys[rt.LEFT]||Pe.DRILL_DOWN)}getNodeClone(n){if(this.options.getNodeClone)return this.options.getNodeClone(n);let e=Object.assign({},n.data);return e.id&&delete e.id,e}allowDrop(n,e,t){return this.options.allowDrop instanceof Function?this.options.allowDrop(n,e,t):this.options.allowDrop===void 0?!0:this.options.allowDrop}allowDrag(n){return this.options.allowDrag instanceof Function?this.options.allowDrag(n):this.options.allowDrag}nodeClass(n){return this.options.nodeClass?this.options.nodeClass(n):""}nodeHeight(n){if(n.data.virtual)return 0;let e=this.options.nodeHeight||22;return typeof e=="function"&&(e=e(n)),e+(n.index===0?2:1)*this.dropSlotHeight}get dropSlotHeight(){return typeof this.options.dropSlotHeight=="number"?this.options.dropSlotHeight:2}},Oe={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"},es=class i{get children(){return this._children()}set children(n){this._children.set(n)}get index(){return this._index()}set index(n){this._index.set(n)}get position(){return this._position()}set position(n){this._position.set(n)}get height(){return this._height()}set height(n){this._height.set(n)}get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children?.some(n=>n.isSelected)}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children?.every(n=>n.isAllSelected)}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw`Element Ref is no longer supported since introducing virtual scroll
1
+ import{a as Gc}from"./chunk-QGHNJVJ6.js";import{a as kn,b as no,c as ai,d as $c,e as oo,f as si,g as zc,h as ot,i as Fn,j as li}from"./chunk-KEZNIIFH.js";import{A as He,a as Le,e as wc,g as Tc,i as Ec,j as Ac,k as Cr,l as Fc,m as Pc,n as Ic,o as Rc,p as Nc,q as wa,r as Vc,s as Mn,t as Lc,u as Oc,v as Bc,w as vr,x as Uc,y as Hc,z as yr}from"./chunk-SPQH3ATC.js";import{a as Wc,b as Pn,c as ce}from"./chunk-FWQJ4ZCD.js";import{b as jc,c as Kc,d as Qc,h as ro}from"./chunk-XSURUW7C.js";import{c as ri,d as Dc,h as io,i as kc,j as xr,k as Mc,m as Sr}from"./chunk-RTNEBRKJ.js";import{a as xc,b as mr,c as En,d as gr}from"./chunk-7KAYOR3A.js";import{a as Ze}from"./chunk-WFMEUST4.js";import{b as yc}from"./chunk-JXZCNFW7.js";import{a as vc}from"./chunk-EKWB5W72.js";import{a as qi,c as oi,d as ba,e as bc}from"./chunk-D2MLAO5N.js";import{a as Fi,b as Pi,c as Ii,d as Ri}from"./chunk-U5E5H2DD.js";import{a as Yi,d as Ql,e as Dn}from"./chunk-RBTLSPYJ.js";import{a as nt,c as An}from"./chunk-ZU5MQTFN.js";import{a as Fe}from"./chunk-ZHUBWKA2.js";import{a as ya,b as jt}from"./chunk-NIKNG2FX.js";import{a as Qs,b as qs,c as Ys,e as Ca,f as pn,g as Xs,h as Zs,i as il,j as cc,k as _c,l as dr,m as Ye,o as fc,r as hc,t as gc,w as oe}from"./chunk-CVXLHSO5.js";import{a as gt}from"./chunk-TTWMFWEC.js";import{a as ur,b as _r,c as fr,d as hr,e as Je}from"./chunk-R4VYKZVJ.js";import{a as Tn,b as Cc}from"./chunk-QJ22N76V.js";import{a as Xe}from"./chunk-XZHWESIY.js";import{a as Ve,b as Ut}from"./chunk-S44QIK3G.js";import{a as Sc}from"./chunk-WRK2FTKU.js";import{$a as ar,A as Zn,Aa as ht,B as Ki,Ba as vn,Ca as Yl,Cb as I,D as ft,Da as Xl,E as or,Ea as eo,F as Ae,Fa as Zl,G as Qi,H as Ol,I as ki,J as Wt,Ja as Jl,Jb as mi,Ka as ec,Kb as pc,L as xa,La as tc,Lb as dc,M as Bl,Mb as Bt,N as Ul,Nb as ie,O as Hl,Ob as z,P as $l,Pb as mc,Q as zl,Qa as ic,R as Gl,Rb as uc,S as Wl,Sa as yn,T as jl,Ta as nc,U as rr,Ua as fe,V as Kl,Va as oc,W as ql,Wa as bn,_a as rc,a as _e,b as Gt,cb as sr,db as Sa,e as Ks,f as ga,gb as De,i as ji,ib as lr,j as Po,jb as ac,k as Yn,kb as sc,mb as to,n as di,q as tl,qb as cr,r as Ro,rb as we,s as Me,sb as lc,t as Ke,tb as wn,v as nl,va as Vt,vb as te,w as ol,wa as Lt,x as rl,xa as Ot,ya as qe,za as Jn}from"./chunk-AALPWGPB.js";import{a as Gs,b as Jt,c as ln,d as Ce,e as cn,f as Ws,g as js}from"./chunk-3MVPXC3U.js";import{$b as Es,$c as $s,$d as Lo,Aa as Ci,Ab as Ie,Ae as Go,Bb as y,Bd as fn,Bf as mt,Cb as Do,Cd as be,Cf as Jo,Dc as Fs,Dd as wi,De as Wo,E as Dt,Ea as da,Eb as f,Ec as Mo,Ed as $,Ee as Cl,Ef as kl,Fb as jn,Fc as Ps,G as bo,Gb as c,Gf as ii,Ha as Wn,Hb as bs,Hc as Fo,Hd as Js,I as _s,Ia as ee,Ib as ws,Id as el,Ie as xl,If as ni,Jb as Kn,Jc as Is,Jd as Z,Je as jo,Jf as Ml,Kb as Y,Kd as P,Kf as Cn,L as pe,La as Ao,Lb as W,Ld as Ti,M as fs,Ma as xi,Mb as j,Mc as zt,Na as ma,Nc as sn,Nf as Fl,O as wo,Oa as s,Od as No,Pa as xs,Pb as Be,Pc as Ee,Pd as al,Qa as ae,Qb as B,Qc as Rs,Qd as hn,Qe as Ko,Qf as xn,Ra as zi,Rb as O,Re as Sl,Rf as er,Sb as L,Sc as Ns,Se as vl,Ta as Ss,Tb as d,Tc as Vs,Td as sl,Tf as Qe,U as hs,Ub as w,Uc as Ls,Ud as ll,Uf as Sn,Va as vs,Vb as D,Ve as yl,Vf as ut,Wa as pt,Wb as Re,Wc as Os,X as gs,Xb as de,Xd as cl,Xe as bl,Xf as Pl,Ya as ys,Yb as me,Yc as Bs,Zb as ue,Zc as Us,Zf as Il,_ as zn,_b as Ts,_c as Hs,_d as Vo,_e as Qo,ab as A,ac as As,ad as zs,ae as Oo,ag as tr,ba as ge,bb as ua,bc as fa,be as Bo,bf as Ei,cb as Si,cc as X,cg as Rl,db as an,dc as wt,de as pl,df as qo,ea as kt,ec as ha,ed as Pt,ef as dt,f as vo,fa as pa,fb as R,fc as Tt,fd as je,fg as _t,g as ms,gc as Ne,ge as dl,gf as Ai,gg as ir,hc as Qn,hd as Et,he as It,hf as Di,hg as nr,ia as To,ic as Ds,ie as ml,if as Xn,ig as Nl,ja as S,jc as ko,jd as xe,jg as Vl,kb as Zt,kc as b,kd as dn,kf as ti,kg as Ll,la as Cs,lb as C,lc as G,le as Uo,lf as Yo,lg as Nt,mb as x,mc as E,mf as wl,nb as We,nc as Mt,nf as Ue,oa as h,oc as Ft,od as ye,oe as Ho,of as Tl,p as gi,pa as g,pb as k,pd as mn,q as yo,qa as Gn,qb as M,qc as ks,qe as ul,qg as F,ra as Eo,rb as m,re as _l,rf as Xo,sb as a,sc as ve,sd as un,se as fl,sf as El,sg as pr,tb as l,tc as $t,td as _n,te as $o,tg as va,ub as _,ud as vi,ue as gn,v as bt,va as it,vb as Gi,vc as qn,vd as yi,w as us,wb as Wi,wc as se,wd as bi,we as hl,wf as Al,xa as rn,xb as _a,xe as gl,xf as Rt,yd as ei,ye as zo,yf as Dl,zc as Ms,zd as Io,zf as Zo}from"./chunk-76M3BMK6.js";import"./chunk-SDJNZULP.js";import"./chunk-2YQ4SX3A.js";import{n as Mi}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as re,b as Se,d as ds,i as Xt}from"./chunk-KAVP6UXH.js";var qc=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-root"]],decls:1,vars:0,template:function(o,r){o&1&&_(0,"router-outlet")},dependencies:[ln],encapsulation:2});let i=n;return i})();function Yc(i){return new ge(3e3,!1)}function Um(){return new ge(3100,!1)}function Hm(){return new ge(3101,!1)}function $m(i){return new ge(3001,!1)}function zm(i){return new ge(3003,!1)}function Gm(i){return new ge(3004,!1)}function Zc(i,n){return new ge(3005,!1)}function Jc(){return new ge(3006,!1)}function ep(){return new ge(3007,!1)}function tp(i,n){return new ge(3008,!1)}function ip(i){return new ge(3002,!1)}function np(i,n,e,t,o){return new ge(3010,!1)}function op(){return new ge(3011,!1)}function rp(){return new ge(3012,!1)}function ap(){return new ge(3200,!1)}function sp(){return new ge(3202,!1)}function lp(){return new ge(3013,!1)}function cp(i){return new ge(3014,!1)}function pp(i){return new ge(3015,!1)}function dp(i){return new ge(3016,!1)}function mp(i,n){return new ge(3404,!1)}function Wm(i){return new ge(3502,!1)}function up(i){return new ge(3503,!1)}function _p(){return new ge(3300,!1)}function fp(i){return new ge(3504,!1)}function hp(i){return new ge(3301,!1)}function gp(i,n){return new ge(3302,!1)}function Cp(i){return new ge(3303,!1)}function xp(i,n){return new ge(3400,!1)}function Sp(i){return new ge(3401,!1)}function vp(i){return new ge(3402,!1)}function yp(i,n){return new ge(3505,!1)}function ui(i){switch(i.length){case 0:return new ji;case 1:return i[0];default:return new Po(i)}}function Da(i,n,e=new Map,t=new Map){let o=[],r=[],p=-1,u=null;if(n.forEach(v=>{let T=v.get("offset"),N=T==p,V=N&&u||new Map;v.forEach((le,q)=>{let K=q,ne=le;if(q!=="offset")switch(K=i.normalizePropertyName(K,o),ne){case Yn:ne=e.get(q);break;case Gt:ne=t.get(q);break;default:ne=i.normalizeStyleValue(q,K,ne,o);break}V.set(K,ne)}),N||r.push(V),u=V,p=T}),o.length)throw Wm(o);return r}function br(i,n,e,t){switch(n){case"start":i.onStart(()=>t(e&&Ta(e,"start",i)));break;case"done":i.onDone(()=>t(e&&Ta(e,"done",i)));break;case"destroy":i.onDestroy(()=>t(e&&Ta(e,"destroy",i)));break}}function Ta(i,n,e){let t=e.totalTime,o=!!e.disabled,r=wr(i.element,i.triggerName,i.fromState,i.toState,n||i.phaseName,t??i.totalTime,o),p=i._data;return p!=null&&(r._data=p),r}function wr(i,n,e,t,o="",r=0,p){return{element:i,triggerName:n,fromState:e,toState:t,phaseName:o,totalTime:r,disabled:!!p}}function Ct(i,n,e){let t=i.get(n);return t||i.set(n,t=e),t}function ka(i){let n=i.indexOf(":"),e=i.substring(1,n),t=i.slice(n+1);return[e,t]}var jm=typeof document>"u"?null:document.documentElement;function Tr(i){let n=i.parentNode||i.host||null;return n===jm?null:n}function Km(i){return i.substring(1,6)=="ebkit"}var Xi=null,Xc=!1;function bp(i){Xi||(Xi=Qm()||{},Xc=Xi.style?"WebkitAppearance"in Xi.style:!1);let n=!0;return Xi.style&&!Km(i)&&(n=i in Xi.style,!n&&Xc&&(n="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Xi.style)),n}function Qm(){return typeof document<"u"?document.body:null}function Ma(i,n){for(;n;){if(n===i)return!0;n=Tr(n)}return!1}function Fa(i,n,e){if(e)return Array.from(i.querySelectorAll(n));let t=i.querySelector(n);return t?[t]:[]}var qm=1e3,Pa="{{",Ym="}}",Ia="ng-enter",Er="ng-leave",ao="ng-trigger",so=".ng-trigger",Ra="ng-animating",Ar=".ng-animating";function ci(i){if(typeof i=="number")return i;let n=i.match(/^(-?[\.\d]+)(m?s)/);return!n||n.length<2?0:Ea(parseFloat(n[1]),n[2])}function Ea(i,n){switch(n){case"s":return i*qm;default:return i}}function lo(i,n,e){return i.hasOwnProperty("duration")?i:Zm(i,n,e)}var Xm=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Zm(i,n,e){let t,o=0,r="";if(typeof i=="string"){let p=i.match(Xm);if(p===null)return n.push(Yc(i)),{duration:0,delay:0,easing:""};t=Ea(parseFloat(p[1]),p[2]);let u=p[3];u!=null&&(o=Ea(parseFloat(u),p[4]));let v=p[5];v&&(r=v)}else t=i;if(!e){let p=!1,u=n.length;t<0&&(n.push(Um()),p=!0),o<0&&(n.push(Hm()),p=!0),p&&n.splice(u,0,Yc(i))}return{duration:t,delay:o,easing:r}}function wp(i){return i.length?i[0]instanceof Map?i:i.map(n=>new Map(Object.entries(n))):[]}function Kt(i,n,e){n.forEach((t,o)=>{let r=Dr(o);e&&!e.has(o)&&e.set(o,i.style[r]),i.style[r]=t})}function Ni(i,n){n.forEach((e,t)=>{let o=Dr(t);i.style[o]=""})}function In(i){return Array.isArray(i)?i.length==1?i[0]:Ks(i):i}function Tp(i,n,e){let t=n.params||{},o=Na(i);o.length&&o.forEach(r=>{t.hasOwnProperty(r)||e.push($m(r))})}var Aa=new RegExp(`${Pa}\\s*(.+?)\\s*${Ym}`,"g");function Na(i){let n=[];if(typeof i=="string"){let e;for(;e=Aa.exec(i);)n.push(e[1]);Aa.lastIndex=0}return n}function Rn(i,n,e){let t=`${i}`,o=t.replace(Aa,(r,p)=>{let u=n[p];return u==null&&(e.push(zm(p)),u=""),u.toString()});return o==t?i:o}var Jm=/-+([a-z0-9])/g;function Dr(i){return i.replace(Jm,(...n)=>n[1].toUpperCase())}function Ep(i,n){return i===0||n===0}function Ap(i,n,e){if(e.size&&n.length){let t=n[0],o=[];if(e.forEach((r,p)=>{t.has(p)||o.push(p),t.set(p,r)}),o.length)for(let r=1;r<n.length;r++){let p=n[r];o.forEach(u=>p.set(u,kr(i,u)))}}return n}function xt(i,n,e){switch(n.type){case _e.Trigger:return i.visitTrigger(n,e);case _e.State:return i.visitState(n,e);case _e.Transition:return i.visitTransition(n,e);case _e.Sequence:return i.visitSequence(n,e);case _e.Group:return i.visitGroup(n,e);case _e.Animate:return i.visitAnimate(n,e);case _e.Keyframes:return i.visitKeyframes(n,e);case _e.Style:return i.visitStyle(n,e);case _e.Reference:return i.visitReference(n,e);case _e.AnimateChild:return i.visitAnimateChild(n,e);case _e.AnimateRef:return i.visitAnimateRef(n,e);case _e.Query:return i.visitQuery(n,e);case _e.Stagger:return i.visitStagger(n,e);default:throw Gm(n.type)}}function kr(i,n){return window.getComputedStyle(i)[n]}var Za=(()=>{class i{validateStyleProperty(e){return bp(e)}containsElement(e,t){return Ma(e,t)}getParentElement(e){return Tr(e)}query(e,t,o){return Fa(e,t,o)}computeStyle(e,t,o){return o||""}animate(e,t,o,r,p,u=[],v){return new ji(o,r)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=kt({token:i,factory:i.\u0275fac})}return i})(),Ji=class{static NOOP=new Za},en=class{};var e0=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Rr=class extends en{normalizePropertyName(n,e){return Dr(n)}normalizeStyleValue(n,e,t,o){let r="",p=t.toString().trim();if(e0.has(e)&&t!==0&&t!=="0")if(typeof t=="number")r="px";else{let u=t.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&o.push(Zc(n,t))}return p+r}};var Nr="*";function t0(i,n){let e=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(t=>i0(t,e,n)):e.push(i),e}function i0(i,n,e){if(i[0]==":"){let v=n0(i,e);if(typeof v=="function"){n.push(v);return}i=v}let t=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return e.push(pp(i)),n;let o=t[1],r=t[2],p=t[3];n.push(Dp(o,p));let u=o==Nr&&p==Nr;r[0]=="<"&&!u&&n.push(Dp(p,o))}function n0(i,n){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return n.push(dp(i)),"* => *"}}var Mr=new Set(["true","1"]),Fr=new Set(["false","0"]);function Dp(i,n){let e=Mr.has(i)||Fr.has(i),t=Mr.has(n)||Fr.has(n);return(o,r)=>{let p=i==Nr||i==o,u=n==Nr||n==r;return!p&&e&&typeof o=="boolean"&&(p=o?Mr.has(i):Fr.has(i)),!u&&t&&typeof r=="boolean"&&(u=r?Mr.has(n):Fr.has(n)),p&&u}}var Op=":self",o0=new RegExp(`s*${Op}s*,?`,"g");function Bp(i,n,e,t){return new Ha(i).build(n,e,t)}var kp="",Ha=class{_driver;constructor(n){this._driver=n}build(n,e,t){let o=new $a(e);return this._resetContextStyleTimingState(o),xt(this,In(n),o)}_resetContextStyleTimingState(n){n.currentQuerySelector=kp,n.collectedStyles=new Map,n.collectedStyles.set(kp,new Map),n.currentTime=0}visitTrigger(n,e){let t=e.queryCount=0,o=e.depCount=0,r=[],p=[];return n.name.charAt(0)=="@"&&e.errors.push(Jc()),n.definitions.forEach(u=>{if(this._resetContextStyleTimingState(e),u.type==_e.State){let v=u,T=v.name;T.toString().split(/\s*,\s*/).forEach(N=>{v.name=N,r.push(this.visitState(v,e))}),v.name=T}else if(u.type==_e.Transition){let v=this.visitTransition(u,e);t+=v.queryCount,o+=v.depCount,p.push(v)}else e.errors.push(ep())}),{type:_e.Trigger,name:n.name,states:r,transitions:p,queryCount:t,depCount:o,options:null}}visitState(n,e){let t=this.visitStyle(n.styles,e),o=n.options&&n.options.params||null;if(t.containsDynamicStyles){let r=new Set,p=o||{};t.styles.forEach(u=>{u instanceof Map&&u.forEach(v=>{Na(v).forEach(T=>{p.hasOwnProperty(T)||r.add(T)})})}),r.size&&e.errors.push(tp(n.name,[...r.values()]))}return{type:_e.State,name:n.name,style:t,options:o?{params:o}:null}}visitTransition(n,e){e.queryCount=0,e.depCount=0;let t=xt(this,In(n.animation),e),o=t0(n.expr,e.errors);return{type:_e.Transition,matchers:o,animation:t,queryCount:e.queryCount,depCount:e.depCount,options:Zi(n.options)}}visitSequence(n,e){return{type:_e.Sequence,steps:n.steps.map(t=>xt(this,t,e)),options:Zi(n.options)}}visitGroup(n,e){let t=e.currentTime,o=0,r=n.steps.map(p=>{e.currentTime=t;let u=xt(this,p,e);return o=Math.max(o,e.currentTime),u});return e.currentTime=o,{type:_e.Group,steps:r,options:Zi(n.options)}}visitAnimate(n,e){let t=l0(n.timings,e.errors);e.currentAnimateTimings=t;let o,r=n.styles?n.styles:ga({});if(r.type==_e.Keyframes)o=this.visitKeyframes(r,e);else{let p=n.styles,u=!1;if(!p){u=!0;let T={};t.easing&&(T.easing=t.easing),p=ga(T)}e.currentTime+=t.duration+t.delay;let v=this.visitStyle(p,e);v.isEmptyStep=u,o=v}return e.currentAnimateTimings=null,{type:_e.Animate,timings:t,style:o,options:null}}visitStyle(n,e){let t=this._makeStyleAst(n,e);return this._validateStyleAst(t,e),t}_makeStyleAst(n,e){let t=[],o=Array.isArray(n.styles)?n.styles:[n.styles];for(let u of o)typeof u=="string"?u===Gt?t.push(u):e.errors.push(ip(u)):t.push(new Map(Object.entries(u)));let r=!1,p=null;return t.forEach(u=>{if(u instanceof Map&&(u.has("easing")&&(p=u.get("easing"),u.delete("easing")),!r)){for(let v of u.values())if(v.toString().indexOf(Pa)>=0){r=!0;break}}}),{type:_e.Style,styles:t,easing:p,offset:n.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(n,e){let t=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;t&&r>0&&(r-=t.duration+t.delay),n.styles.forEach(p=>{typeof p!="string"&&p.forEach((u,v)=>{let T=e.collectedStyles.get(e.currentQuerySelector),N=T.get(v),V=!0;N&&(r!=o&&r>=N.startTime&&o<=N.endTime&&(e.errors.push(np(v,N.startTime,N.endTime,r,o)),V=!1),r=N.startTime),V&&T.set(v,{startTime:r,endTime:o}),e.options&&Tp(u,e.options,e.errors)})})}visitKeyframes(n,e){let t={type:_e.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(op()),t;let o=1,r=0,p=[],u=!1,v=!1,T=0,N=n.steps.map($e=>{let ze=this._makeStyleAst($e,e),at=ze.offset!=null?ze.offset:s0(ze.styles),et=0;return at!=null&&(r++,et=ze.offset=at),v=v||et<0||et>1,u=u||et<T,T=et,p.push(et),ze});v&&e.errors.push(rp()),u&&e.errors.push(ap());let V=n.steps.length,le=0;r>0&&r<V?e.errors.push(sp()):r==0&&(le=o/(V-1));let q=V-1,K=e.currentTime,ne=e.currentAnimateTimings,Te=ne.duration;return N.forEach(($e,ze)=>{let at=le>0?ze==q?1:le*ze:p[ze],et=at*Te;e.currentTime=K+ne.delay+et,ne.duration=et,this._validateStyleAst($e,e),$e.offset=at,t.styles.push($e)}),t}visitReference(n,e){return{type:_e.Reference,animation:xt(this,In(n.animation),e),options:Zi(n.options)}}visitAnimateChild(n,e){return e.depCount++,{type:_e.AnimateChild,options:Zi(n.options)}}visitAnimateRef(n,e){return{type:_e.AnimateRef,animation:this.visitReference(n.animation,e),options:Zi(n.options)}}visitQuery(n,e){let t=e.currentQuerySelector,o=n.options||{};e.queryCount++,e.currentQuery=n;let[r,p]=r0(n.selector);e.currentQuerySelector=t.length?t+" "+r:r,Ct(e.collectedStyles,e.currentQuerySelector,new Map);let u=xt(this,In(n.animation),e);return e.currentQuery=null,e.currentQuerySelector=t,{type:_e.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:p,animation:u,originalSelector:n.selector,options:Zi(n.options)}}visitStagger(n,e){e.currentQuery||e.errors.push(lp());let t=n.timings==="full"?{duration:0,delay:0,easing:"full"}:lo(n.timings,e.errors,!0);return{type:_e.Stagger,animation:xt(this,In(n.animation),e),timings:t,options:null}}};function r0(i){let n=!!i.split(/\s*,\s*/).find(e=>e==Op);return n&&(i=i.replace(o0,"")),i=i.replace(/@\*/g,so).replace(/@\w+/g,e=>so+"-"+e.slice(1)).replace(/:animating/g,Ar),[i,n]}function a0(i){return i?re({},i):null}var $a=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(n){this.errors=n}};function s0(i){if(typeof i=="string")return null;let n=null;if(Array.isArray(i))i.forEach(e=>{if(e instanceof Map&&e.has("offset")){let t=e;n=parseFloat(t.get("offset")),t.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let e=i;n=parseFloat(e.get("offset")),e.delete("offset")}return n}function l0(i,n){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=lo(i,n).duration;return Va(r,0,"")}let e=i;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=Va(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=lo(e,n);return Va(o.duration,o.delay,o.easing)}function Zi(i){return i?(i=re({},i),i.params&&(i.params=a0(i.params))):i={},i}function Va(i,n,e){return{duration:i,delay:n,easing:e}}function Ja(i,n,e,t,o,r,p=null,u=!1){return{type:1,element:i,keyframes:n,preStyleProps:e,postStyleProps:t,duration:o,delay:r,totalTime:o+r,easing:p,subTimeline:u}}var po=class{_map=new Map;get(n){return this._map.get(n)||[]}append(n,e){let t=this._map.get(n);t||this._map.set(n,t=[]),t.push(...e)}has(n){return this._map.has(n)}clear(){this._map.clear()}},c0=1,p0=":enter",d0=new RegExp(p0,"g"),m0=":leave",u0=new RegExp(m0,"g");function Up(i,n,e,t,o,r=new Map,p=new Map,u,v,T=[]){return new za().buildKeyframes(i,n,e,t,o,r,p,u,v,T)}var za=class{buildKeyframes(n,e,t,o,r,p,u,v,T,N=[]){T=T||new po;let V=new Ga(n,e,T,o,r,N,[]);V.options=v;let le=v.delay?ci(v.delay):0;V.currentTimeline.delayNextStep(le),V.currentTimeline.setStyles([p],null,V.errors,v),xt(this,t,V);let q=V.timelines.filter(K=>K.containsAnimation());if(q.length&&u.size){let K;for(let ne=q.length-1;ne>=0;ne--){let Te=q[ne];if(Te.element===e){K=Te;break}}K&&!K.allowOnlyTimelineStyles()&&K.setStyles([u],null,V.errors,v)}return q.length?q.map(K=>K.buildKeyframes()):[Ja(e,[],[],[],0,le,"",!1)]}visitTrigger(n,e){}visitState(n,e){}visitTransition(n,e){}visitAnimateChild(n,e){let t=e.subInstructions.get(e.element);if(t){let o=e.createSubContext(n.options),r=e.currentTimeline.currentTime,p=this._visitSubInstructions(t,o,o.options);r!=p&&e.transformIntoNewTimeline(p)}e.previousNode=n}visitAnimateRef(n,e){let t=e.createSubContext(n.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([n.options,n.animation.options],e,t),this.visitReference(n.animation,t),e.transformIntoNewTimeline(t.currentTimeline.currentTime),e.previousNode=n}_applyAnimationRefDelays(n,e,t){for(let o of n){let r=o?.delay;if(r){let p=typeof r=="number"?r:ci(Rn(r,o?.params??{},e.errors));t.delayNextStep(p)}}}_visitSubInstructions(n,e,t){let r=e.currentTimeline.currentTime,p=t.duration!=null?ci(t.duration):null,u=t.delay!=null?ci(t.delay):null;return p!==0&&n.forEach(v=>{let T=e.appendInstructionToTimeline(v,p,u);r=Math.max(r,T.duration+T.delay)}),r}visitReference(n,e){e.updateOptions(n.options,!0),xt(this,n.animation,e),e.previousNode=n}visitSequence(n,e){let t=e.subContextCount,o=e,r=n.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==_e.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Vr);let p=ci(r.delay);o.delayNextStep(p)}n.steps.length&&(n.steps.forEach(p=>xt(this,p,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>t&&o.transformIntoNewTimeline()),e.previousNode=n}visitGroup(n,e){let t=[],o=e.currentTimeline.currentTime,r=n.options&&n.options.delay?ci(n.options.delay):0;n.steps.forEach(p=>{let u=e.createSubContext(n.options);r&&u.delayNextStep(r),xt(this,p,u),o=Math.max(o,u.currentTimeline.currentTime),t.push(u.currentTimeline)}),t.forEach(p=>e.currentTimeline.mergeTimelineCollectedStyles(p)),e.transformIntoNewTimeline(o),e.previousNode=n}_visitTiming(n,e){if(n.dynamic){let t=n.strValue,o=e.params?Rn(t,e.params,e.errors):t;return lo(o,e.errors)}else return{duration:n.duration,delay:n.delay,easing:n.easing}}visitAnimate(n,e){let t=e.currentAnimateTimings=this._visitTiming(n.timings,e),o=e.currentTimeline;t.delay&&(e.incrementTime(t.delay),o.snapshotCurrentStyles());let r=n.style;r.type==_e.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(t.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=n}visitStyle(n,e){let t=e.currentTimeline,o=e.currentAnimateTimings;!o&&t.hasCurrentStyleProperties()&&t.forwardFrame();let r=o&&o.easing||n.easing;n.isEmptyStep?t.applyEmptyStep(r):t.setStyles(n.styles,r,e.errors,e.options),e.previousNode=n}visitKeyframes(n,e){let t=e.currentAnimateTimings,o=e.currentTimeline.duration,r=t.duration,u=e.createSubContext().currentTimeline;u.easing=t.easing,n.styles.forEach(v=>{let T=v.offset||0;u.forwardTime(T*r),u.setStyles(v.styles,v.easing,e.errors,e.options),u.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(u),e.transformIntoNewTimeline(o+r),e.previousNode=n}visitQuery(n,e){let t=e.currentTimeline.currentTime,o=n.options||{},r=o.delay?ci(o.delay):0;r&&(e.previousNode.type===_e.Style||t==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Vr);let p=t,u=e.invokeQuery(n.selector,n.originalSelector,n.limit,n.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=u.length;let v=null;u.forEach((T,N)=>{e.currentQueryIndex=N;let V=e.createSubContext(n.options,T);r&&V.delayNextStep(r),T===e.element&&(v=V.currentTimeline),xt(this,n.animation,V),V.currentTimeline.applyStylesToKeyframe();let le=V.currentTimeline.currentTime;p=Math.max(p,le)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(p),v&&(e.currentTimeline.mergeTimelineCollectedStyles(v),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=n}visitStagger(n,e){let t=e.parentContext,o=e.currentTimeline,r=n.timings,p=Math.abs(r.duration),u=p*(e.currentQueryTotal-1),v=p*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":v=u-v;break;case"full":v=t.currentStaggerTime;break}let N=e.currentTimeline;v&&N.delayNextStep(v);let V=N.currentTime;xt(this,n.animation,e),e.previousNode=n,t.currentStaggerTime=o.currentTime-V+(o.startTime-t.currentTimeline.startTime)}},Vr={},Ga=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Vr;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(n,e,t,o,r,p,u,v){this._driver=n,this.element=e,this.subInstructions=t,this._enterClassName=o,this._leaveClassName=r,this.errors=p,this.timelines=u,this.currentTimeline=v||new Lr(this._driver,e,0),u.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(n,e){if(!n)return;let t=n,o=this.options;t.duration!=null&&(o.duration=ci(t.duration)),t.delay!=null&&(o.delay=ci(t.delay));let r=t.params;if(r){let p=o.params;p||(p=this.options.params={}),Object.keys(r).forEach(u=>{(!e||!p.hasOwnProperty(u))&&(p[u]=Rn(r[u],p,this.errors))})}}_copyOptions(){let n={};if(this.options){let e=this.options.params;if(e){let t=n.params={};Object.keys(e).forEach(o=>{t[o]=e[o]})}}return n}createSubContext(n=null,e,t){let o=e||this.element,r=new i(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,t||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(n),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(n){return this.previousNode=Vr,this.currentTimeline=this.currentTimeline.fork(this.element,n),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(n,e,t){let o={duration:e??n.duration,delay:this.currentTimeline.currentTime+(t??0)+n.delay,easing:""},r=new Wa(this._driver,n.element,n.keyframes,n.preStyleProps,n.postStyleProps,o,n.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(n){this.currentTimeline.forwardTime(this.currentTimeline.duration+n)}delayNextStep(n){n>0&&this.currentTimeline.delayNextStep(n)}invokeQuery(n,e,t,o,r,p){let u=[];if(o&&u.push(this.element),n.length>0){n=n.replace(d0,"."+this._enterClassName),n=n.replace(u0,"."+this._leaveClassName);let v=t!=1,T=this._driver.query(this.element,n,v);t!==0&&(T=t<0?T.slice(T.length+t,T.length):T.slice(0,t)),u.push(...T)}return!r&&u.length==0&&p.push(cp(e)),u}},Lr=class i{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(n,e,t,o){this._driver=n,this.element=e,this.startTime=t,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(n){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+n),e&&this.snapshotCurrentStyles()):this.startTime+=n}fork(n,e){return this.applyStylesToKeyframe(),new i(this._driver,n,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=c0,this._loadKeyframe()}forwardTime(n){this.applyStylesToKeyframe(),this.duration=n,this._loadKeyframe()}_updateStyle(n,e){this._localTimelineStyles.set(n,e),this._globalTimelineStyles.set(n,e),this._styleSummary.set(n,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(n){n&&this._previousKeyframe.set("easing",n);for(let[e,t]of this._globalTimelineStyles)this._backFill.set(e,t||Gt),this._currentKeyframe.set(e,Gt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(n,e,t,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},p=_0(n,this._globalTimelineStyles);for(let[u,v]of p){let T=Rn(v,r,t);this._pendingStyles.set(u,T),this._localTimelineStyles.has(u)||this._backFill.set(u,this._globalTimelineStyles.get(u)??Gt),this._updateStyle(u,T)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((n,e)=>{this._currentKeyframe.set(e,n)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((n,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,n)}))}snapshotCurrentStyles(){for(let[n,e]of this._localTimelineStyles)this._pendingStyles.set(n,e),this._updateStyle(n,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let n=[];for(let e in this._currentKeyframe)n.push(e);return n}mergeTimelineCollectedStyles(n){n._styleSummary.forEach((e,t)=>{let o=this._styleSummary.get(t);(!o||e.time>o.time)&&this._updateStyle(t,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let n=new Set,e=new Set,t=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((u,v)=>{let T=new Map([...this._backFill,...u]);T.forEach((N,V)=>{N===Yn?n.add(V):N===Gt&&e.add(V)}),t||T.set("offset",v/this.duration),o.push(T)});let r=[...n.values()],p=[...e.values()];if(t){let u=o[0],v=new Map(u);u.set("offset",0),v.set("offset",1),o=[u,v]}return Ja(this.element,o,r,p,this.duration,this.startTime,this.easing,!1)}},Wa=class extends Lr{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(n,e,t,o,r,p,u=!1){super(n,e,p.delay),this.keyframes=t,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=u,this.timings={duration:p.duration,delay:p.delay,easing:p.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let n=this.keyframes,{delay:e,duration:t,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],p=t+e,u=e/p,v=new Map(n[0]);v.set("offset",0),r.push(v);let T=new Map(n[0]);T.set("offset",Mp(u)),r.push(T);let N=n.length-1;for(let V=1;V<=N;V++){let le=new Map(n[V]),q=le.get("offset"),K=e+q*t;le.set("offset",Mp(K/p)),r.push(le)}t=p,e=0,o="",n=r}return Ja(this.element,n,this.preStyleProps,this.postStyleProps,t,e,o,!0)}};function Mp(i,n=3){let e=Math.pow(10,n-1);return Math.round(i*e)/e}function _0(i,n){let e=new Map,t;return i.forEach(o=>{if(o==="*"){t??=n.keys();for(let r of t)e.set(r,Gt)}else for(let[r,p]of o)e.set(r,p)}),e}function Fp(i,n,e,t,o,r,p,u,v,T,N,V,le){return{type:0,element:i,triggerName:n,isRemovalTransition:o,fromState:e,fromStyles:r,toState:t,toStyles:p,timelines:u,queriedElements:v,preStyleProps:T,postStyleProps:N,totalTime:V,errors:le}}var La={},Or=class{_triggerName;ast;_stateStyles;constructor(n,e,t){this._triggerName=n,this.ast=e,this._stateStyles=t}match(n,e,t,o){return f0(this.ast.matchers,n,e,t,o)}buildStyles(n,e,t){let o=this._stateStyles.get("*");return n!==void 0&&(o=this._stateStyles.get(n?.toString())||o),o?o.buildStyles(e,t):new Map}build(n,e,t,o,r,p,u,v,T,N){let V=[],le=this.ast.options&&this.ast.options.params||La,q=u&&u.params||La,K=this.buildStyles(t,q,V),ne=v&&v.params||La,Te=this.buildStyles(o,ne,V),$e=new Set,ze=new Map,at=new Map,et=o==="void",nn={params:Hp(ne,le),delay:this.ast.options?.delay},qt=N?[]:Up(n,e,this.ast.animation,r,p,K,Te,nn,T,V),st=0;return qt.forEach(ct=>{st=Math.max(ct.duration+ct.delay,st)}),V.length?Fp(e,this._triggerName,t,o,et,K,Te,[],[],ze,at,st,V):(qt.forEach(ct=>{let Ui=ct.element,on=Ct(ze,Ui,new Set);ct.preStyleProps.forEach(Hi=>on.add(Hi));let ss=Ct(at,Ui,new Set);ct.postStyleProps.forEach(Hi=>ss.add(Hi)),Ui!==e&&$e.add(Ui)}),Fp(e,this._triggerName,t,o,et,K,Te,qt,[...$e.values()],ze,at,st))}};function f0(i,n,e,t,o){return i.some(r=>r(n,e,t,o))}function Hp(i,n){let e=re({},n);return Object.entries(i).forEach(([t,o])=>{o!=null&&(e[t]=o)}),e}var ja=class{styles;defaultParams;normalizer;constructor(n,e,t){this.styles=n,this.defaultParams=e,this.normalizer=t}buildStyles(n,e){let t=new Map,o=Hp(n,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((p,u)=>{p&&(p=Rn(p,o,e));let v=this.normalizer.normalizePropertyName(u,e);p=this.normalizer.normalizeStyleValue(u,v,p,e),t.set(u,p)})}),t}};function h0(i,n,e){return new Ka(i,n,e)}var Ka=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(n,e,t){this.name=n,this.ast=e,this._normalizer=t,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new ja(o.style,r,t))}),Pp(this.states,"true","1"),Pp(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new Or(n,o,this.states))}),this.fallbackTransition=g0(n,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(n,e,t,o){return this.transitionFactories.find(p=>p.match(n,e,t,o))||null}matchStyles(n,e,t){return this.fallbackTransition.buildStyles(n,e,t)}};function g0(i,n,e){let t=[(p,u)=>!0],o={type:_e.Sequence,steps:[],options:null},r={type:_e.Transition,animation:o,matchers:t,options:null,queryCount:0,depCount:0};return new Or(i,r,n)}function Pp(i,n,e){i.has(n)?i.has(e)||i.set(e,i.get(n)):i.has(e)&&i.set(n,i.get(e))}var C0=new po,Qa=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(n,e,t){this.bodyNode=n,this._driver=e,this._normalizer=t}register(n,e){let t=[],o=[],r=Bp(this._driver,e,t,o);if(t.length)throw up(t);this._animations.set(n,r)}_buildPlayer(n,e,t){let o=n.element,r=Da(this._normalizer,n.keyframes,e,t);return this._driver.animate(o,r,n.duration,n.delay,n.easing,[],!0)}create(n,e,t={}){let o=[],r=this._animations.get(n),p,u=new Map;if(r?(p=Up(this._driver,e,r,Ia,Er,new Map,new Map,t,C0,o),p.forEach(N=>{let V=Ct(u,N.element,new Map);N.postStyleProps.forEach(le=>V.set(le,null))})):(o.push(_p()),p=[]),o.length)throw fp(o);u.forEach((N,V)=>{N.forEach((le,q)=>{N.set(q,this._driver.computeStyle(V,q,Gt))})});let v=p.map(N=>{let V=u.get(N.element);return this._buildPlayer(N,new Map,V)}),T=ui(v);return this._playersById.set(n,T),T.onDestroy(()=>this.destroy(n)),this.players.push(T),T}destroy(n){let e=this._getPlayer(n);e.destroy(),this._playersById.delete(n);let t=this.players.indexOf(e);t>=0&&this.players.splice(t,1)}_getPlayer(n){let e=this._playersById.get(n);if(!e)throw hp(n);return e}listen(n,e,t,o){let r=wr(e,"","","");return br(this._getPlayer(n),t,r,o),()=>{}}command(n,e,t,o){if(t=="register"){this.register(n,o[0]);return}if(t=="create"){let p=o[0]||{};this.create(n,e,p);return}let r=this._getPlayer(n);switch(t){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(n);break}}},Ip="ng-animate-queued",x0=".ng-animate-queued",Oa="ng-animate-disabled",S0=".ng-animate-disabled",v0="ng-star-inserted",y0=".ng-star-inserted",b0=[],$p={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},w0={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Qt="__ng_removed",mo=class{namespaceId;value;options;get params(){return this.options.params}constructor(n,e=""){this.namespaceId=e;let t=n&&n.hasOwnProperty("value"),o=t?n.value:n;if(this.value=E0(o),t){let r=n,{value:p}=r,u=ds(r,["value"]);this.options=u}else this.options={};this.options.params||(this.options.params={})}absorbOptions(n){let e=n.params;if(e){let t=this.options.params;Object.keys(e).forEach(o=>{t[o]==null&&(t[o]=e[o])})}}},co="void",Ba=new mo(co),qa=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(n,e,t){this.id=n,this.hostElement=e,this._engine=t,this._hostClassName="ng-tns-"+n,Ht(e,this._hostClassName)}listen(n,e,t,o){if(!this._triggers.has(e))throw gp(t,e);if(t==null||t.length==0)throw Cp(e);if(!A0(t))throw xp(t,e);let r=Ct(this._elementListeners,n,[]),p={name:e,phase:t,callback:o};r.push(p);let u=Ct(this._engine.statesByElement,n,new Map);return u.has(e)||(Ht(n,ao),Ht(n,ao+"-"+e),u.set(e,Ba)),()=>{this._engine.afterFlush(()=>{let v=r.indexOf(p);v>=0&&r.splice(v,1),this._triggers.has(e)||u.delete(e)})}}register(n,e){return this._triggers.has(n)?!1:(this._triggers.set(n,e),!0)}_getTrigger(n){let e=this._triggers.get(n);if(!e)throw Sp(n);return e}trigger(n,e,t,o=!0){let r=this._getTrigger(e),p=new uo(this.id,e,n),u=this._engine.statesByElement.get(n);u||(Ht(n,ao),Ht(n,ao+"-"+e),this._engine.statesByElement.set(n,u=new Map));let v=u.get(e),T=new mo(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&v&&T.absorbOptions(v.options),u.set(e,T),v||(v=Ba),!(T.value===co)&&v.value===T.value){if(!M0(v.params,T.params)){let ne=[],Te=r.matchStyles(v.value,v.params,ne),$e=r.matchStyles(T.value,T.params,ne);ne.length?this._engine.reportError(ne):this._engine.afterFlush(()=>{Ni(n,Te),Kt(n,$e)})}return}let le=Ct(this._engine.playersByElement,n,[]);le.forEach(ne=>{ne.namespaceId==this.id&&ne.triggerName==e&&ne.queued&&ne.destroy()});let q=r.matchTransition(v.value,T.value,n,T.params),K=!1;if(!q){if(!o)return;q=r.fallbackTransition,K=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:e,transition:q,fromState:v,toState:T,player:p,isFallbackTransition:K}),K||(Ht(n,Ip),p.onStart(()=>{Nn(n,Ip)})),p.onDone(()=>{let ne=this.players.indexOf(p);ne>=0&&this.players.splice(ne,1);let Te=this._engine.playersByElement.get(n);if(Te){let $e=Te.indexOf(p);$e>=0&&Te.splice($e,1)}}),this.players.push(p),le.push(p),p}deregister(n){this._triggers.delete(n),this._engine.statesByElement.forEach(e=>e.delete(n)),this._elementListeners.forEach((e,t)=>{this._elementListeners.set(t,e.filter(o=>o.name!=n))})}clearElementCache(n){this._engine.statesByElement.delete(n),this._elementListeners.delete(n);let e=this._engine.playersByElement.get(n);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(n))}_signalRemovalForInnerTriggers(n,e){let t=this._engine.driver.query(n,so,!0);t.forEach(o=>{if(o[Qt])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(p=>p.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(n,e,t,o){let r=this._engine.statesByElement.get(n),p=new Map;if(r){let u=[];if(r.forEach((v,T)=>{if(p.set(T,v.value),this._triggers.has(T)){let N=this.trigger(n,T,co,o);N&&u.push(N)}}),u.length)return this._engine.markElementAsRemoved(this.id,n,!0,e,p),t&&ui(u).onDone(()=>this._engine.processLeaveNode(n)),!0}return!1}prepareLeaveAnimationListeners(n){let e=this._elementListeners.get(n),t=this._engine.statesByElement.get(n);if(e&&t){let o=new Set;e.forEach(r=>{let p=r.name;if(o.has(p))return;o.add(p);let v=this._triggers.get(p).fallbackTransition,T=t.get(p)||Ba,N=new mo(co),V=new uo(this.id,p,n);this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:p,transition:v,fromState:T,toState:N,player:V,isFallbackTransition:!0})})}}removeNode(n,e){let t=this._engine;if(n.childElementCount&&this._signalRemovalForInnerTriggers(n,e),this.triggerLeaveAnimation(n,e,!0))return;let o=!1;if(t.totalAnimations){let r=t.players.length?t.playersByQueriedElement.get(n):[];if(r&&r.length)o=!0;else{let p=n;for(;p=p.parentNode;)if(t.statesByElement.get(p)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(n),o)t.markElementAsRemoved(this.id,n,!1,e);else{let r=n[Qt];(!r||r===$p)&&(t.afterFlush(()=>this.clearElementCache(n)),t.destroyInnerAnimations(n),t._onRemovalComplete(n,e))}}insertNode(n,e){Ht(n,this._hostClassName)}drainQueuedTransitions(n){let e=[];return this._queue.forEach(t=>{let o=t.player;if(o.destroyed)return;let r=t.element,p=this._elementListeners.get(r);p&&p.forEach(u=>{if(u.name==t.triggerName){let v=wr(r,t.triggerName,t.fromState.value,t.toState.value);v._data=n,br(t.player,u.phase,v,u.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(t)}),this._queue=[],e.sort((t,o)=>{let r=t.transition.ast.depCount,p=o.transition.ast.depCount;return r==0||p==0?r-p:this._engine.driver.containsElement(t.element,o.element)?1:-1})}destroy(n){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,n)}},Ya=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(n,e)=>{};_onRemovalComplete(n,e){this.onRemovalComplete(n,e)}constructor(n,e,t){this.bodyNode=n,this.driver=e,this._normalizer=t}get queuedPlayers(){let n=[];return this._namespaceList.forEach(e=>{e.players.forEach(t=>{t.queued&&n.push(t)})}),n}createNamespace(n,e){let t=new qa(n,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(t,e):(this.newHostElements.set(e,t),this.collectEnterElement(e)),this._namespaceLookup[n]=t}_balanceNamespaceList(n,e){let t=this._namespaceList,o=this.namespacesByHostElement;if(t.length-1>=0){let p=!1,u=this.driver.getParentElement(e);for(;u;){let v=o.get(u);if(v){let T=t.indexOf(v);t.splice(T+1,0,n),p=!0;break}u=this.driver.getParentElement(u)}p||t.unshift(n)}else t.push(n);return o.set(e,n),n}register(n,e){let t=this._namespaceLookup[n];return t||(t=this.createNamespace(n,e)),t}registerTrigger(n,e,t){let o=this._namespaceLookup[n];o&&o.register(e,t)&&this.totalAnimations++}destroy(n,e){n&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(n);this.namespacesByHostElement.delete(t.hostElement);let o=this._namespaceList.indexOf(t);o>=0&&this._namespaceList.splice(o,1),t.destroy(e),delete this._namespaceLookup[n]}))}_fetchNamespace(n){return this._namespaceLookup[n]}fetchNamespacesByElement(n){let e=new Set,t=this.statesByElement.get(n);if(t){for(let o of t.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(n,e,t,o){if(Pr(e)){let r=this._fetchNamespace(n);if(r)return r.trigger(e,t,o),!0}return!1}insertNode(n,e,t,o){if(!Pr(e))return;let r=e[Qt];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let p=this.collectedLeaveElements.indexOf(e);p>=0&&this.collectedLeaveElements.splice(p,1)}if(n){let p=this._fetchNamespace(n);p&&p.insertNode(e,t)}o&&this.collectEnterElement(e)}collectEnterElement(n){this.collectedEnterElements.push(n)}markElementAsDisabled(n,e){e?this.disabledNodes.has(n)||(this.disabledNodes.add(n),Ht(n,Oa)):this.disabledNodes.has(n)&&(this.disabledNodes.delete(n),Nn(n,Oa))}removeNode(n,e,t){if(Pr(e)){let o=n?this._fetchNamespace(n):null;o?o.removeNode(e,t):this.markElementAsRemoved(n,e,!1,t);let r=this.namespacesByHostElement.get(e);r&&r.id!==n&&r.removeNode(e,t)}else this._onRemovalComplete(e,t)}markElementAsRemoved(n,e,t,o,r){this.collectedLeaveElements.push(e),e[Qt]={namespaceId:n,setForRemoval:o,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:r}}listen(n,e,t,o,r){return Pr(e)?this._fetchNamespace(n).listen(e,t,o,r):()=>{}}_buildInstruction(n,e,t,o,r){return n.transition.build(this.driver,n.element,n.fromState.value,n.toState.value,t,o,n.fromState.options,n.toState.options,e,r)}destroyInnerAnimations(n){let e=this.driver.query(n,so,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(n,Ar,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(n){let e=this.playersByElement.get(n);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(n){let e=this.playersByQueriedElement.get(n);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(n=>{if(this.players.length)return ui(this.players).onDone(()=>n());n()})}processLeaveNode(n){let e=n[Qt];if(e&&e.setForRemoval){if(n[Qt]=$p,e.namespaceId){this.destroyInnerAnimations(n);let t=this._fetchNamespace(e.namespaceId);t&&t.clearElementCache(n)}this._onRemovalComplete(n,e.setForRemoval)}n.classList?.contains(Oa)&&this.markElementAsDisabled(n,!1),this.driver.query(n,S0,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(n=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,o)=>this._balanceNamespaceList(t,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let o=this.collectedEnterElements[t];Ht(o,v0)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{e=this._flushAnimations(t,n)}finally{for(let o=0;o<t.length;o++)t[o]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let o=this.collectedLeaveElements[t];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(t=>t()),this._flushFns=[],this._whenQuietFns.length){let t=this._whenQuietFns;this._whenQuietFns=[],e.length?ui(e).onDone(()=>{t.forEach(o=>o())}):t.forEach(o=>o())}}reportError(n){throw vp(n)}_flushAnimations(n,e){let t=new po,o=[],r=new Map,p=[],u=new Map,v=new Map,T=new Map,N=new Set;this.disabledNodes.forEach(H=>{N.add(H);let Q=this.driver.query(H,x0,!0);for(let J=0;J<Q.length;J++)N.add(Q[J])});let V=this.bodyNode,le=Array.from(this.statesByElement.keys()),q=Vp(le,this.collectedEnterElements),K=new Map,ne=0;q.forEach((H,Q)=>{let J=Ia+ne++;K.set(Q,J),H.forEach(he=>Ht(he,J))});let Te=[],$e=new Set,ze=new Set;for(let H=0;H<this.collectedLeaveElements.length;H++){let Q=this.collectedLeaveElements[H],J=Q[Qt];J&&J.setForRemoval&&(Te.push(Q),$e.add(Q),J.hasAnimation?this.driver.query(Q,y0,!0).forEach(he=>$e.add(he)):ze.add(Q))}let at=new Map,et=Vp(le,Array.from($e));et.forEach((H,Q)=>{let J=Er+ne++;at.set(Q,J),H.forEach(he=>Ht(he,J))}),n.push(()=>{q.forEach((H,Q)=>{let J=K.get(Q);H.forEach(he=>Nn(he,J))}),et.forEach((H,Q)=>{let J=at.get(Q);H.forEach(he=>Nn(he,J))}),Te.forEach(H=>{this.processLeaveNode(H)})});let nn=[],qt=[];for(let H=this._namespaceList.length-1;H>=0;H--)this._namespaceList[H].drainQueuedTransitions(e).forEach(J=>{let he=J.player,Ge=J.element;if(nn.push(he),this.collectedEnterElements.length){let tt=Ge[Qt];if(tt&&tt.setForMove){if(tt.previousTriggersValues&&tt.previousTriggersValues.has(J.triggerName)){let $i=tt.previousTriggersValues.get(J.triggerName),At=this.statesByElement.get(J.element);if(At&&At.has(J.triggerName)){let So=At.get(J.triggerName);So.value=$i,At.set(J.triggerName,So)}}he.destroy();return}}let Yt=!V||!this.driver.containsElement(V,Ge),yt=at.get(Ge),hi=K.get(Ge),ke=this._buildInstruction(J,t,hi,yt,Yt);if(ke.errors&&ke.errors.length){qt.push(ke);return}if(Yt){he.onStart(()=>Ni(Ge,ke.fromStyles)),he.onDestroy(()=>Kt(Ge,ke.toStyles)),o.push(he);return}if(J.isFallbackTransition){he.onStart(()=>Ni(Ge,ke.fromStyles)),he.onDestroy(()=>Kt(Ge,ke.toStyles)),o.push(he);return}let ps=[];ke.timelines.forEach(tt=>{tt.stretchStartingKeyframe=!0,this.disabledNodes.has(tt.element)||ps.push(tt)}),ke.timelines=ps,t.append(Ge,ke.timelines);let Bm={instruction:ke,player:he,element:Ge};p.push(Bm),ke.queriedElements.forEach(tt=>Ct(u,tt,[]).push(he)),ke.preStyleProps.forEach((tt,$i)=>{if(tt.size){let At=v.get($i);At||v.set($i,At=new Set),tt.forEach((So,ca)=>At.add(ca))}}),ke.postStyleProps.forEach((tt,$i)=>{let At=T.get($i);At||T.set($i,At=new Set),tt.forEach((So,ca)=>At.add(ca))})});if(qt.length){let H=[];qt.forEach(Q=>{H.push(yp(Q.triggerName,Q.errors))}),nn.forEach(Q=>Q.destroy()),this.reportError(H)}let st=new Map,ct=new Map;p.forEach(H=>{let Q=H.element;t.has(Q)&&(ct.set(Q,Q),this._beforeAnimationBuild(H.player.namespaceId,H.instruction,st))}),o.forEach(H=>{let Q=H.element;this._getPreviousPlayers(Q,!1,H.namespaceId,H.triggerName,null).forEach(he=>{Ct(st,Q,[]).push(he),he.destroy()})});let Ui=Te.filter(H=>Lp(H,v,T)),on=new Map;Np(on,this.driver,ze,T,Gt).forEach(H=>{Lp(H,v,T)&&Ui.push(H)});let Hi=new Map;q.forEach((H,Q)=>{Np(Hi,this.driver,new Set(H),v,Yn)}),Ui.forEach(H=>{let Q=on.get(H),J=Hi.get(H);on.set(H,new Map([...Q?.entries()??[],...J?.entries()??[]]))});let la=[],ls=[],cs={};p.forEach(H=>{let{element:Q,player:J,instruction:he}=H;if(t.has(Q)){if(N.has(Q)){J.onDestroy(()=>Kt(Q,he.toStyles)),J.disabled=!0,J.overrideTotalTime(he.totalTime),o.push(J);return}let Ge=cs;if(ct.size>1){let yt=Q,hi=[];for(;yt=yt.parentNode;){let ke=ct.get(yt);if(ke){Ge=ke;break}hi.push(yt)}hi.forEach(ke=>ct.set(ke,Ge))}let Yt=this._buildAnimation(J.namespaceId,he,st,r,Hi,on);if(J.setRealPlayer(Yt),Ge===cs)la.push(J);else{let yt=this.playersByElement.get(Ge);yt&&yt.length&&(J.parentPlayer=ui(yt)),o.push(J)}}else Ni(Q,he.fromStyles),J.onDestroy(()=>Kt(Q,he.toStyles)),ls.push(J),N.has(Q)&&o.push(J)}),ls.forEach(H=>{let Q=r.get(H.element);if(Q&&Q.length){let J=ui(Q);H.setRealPlayer(J)}}),o.forEach(H=>{H.parentPlayer?H.syncPlayerEvents(H.parentPlayer):H.destroy()});for(let H=0;H<Te.length;H++){let Q=Te[H],J=Q[Qt];if(Nn(Q,Er),J&&J.hasAnimation)continue;let he=[];if(u.size){let Yt=u.get(Q);Yt&&Yt.length&&he.push(...Yt);let yt=this.driver.query(Q,Ar,!0);for(let hi=0;hi<yt.length;hi++){let ke=u.get(yt[hi]);ke&&ke.length&&he.push(...ke)}}let Ge=he.filter(Yt=>!Yt.destroyed);Ge.length?D0(this,Q,Ge):this.processLeaveNode(Q)}return Te.length=0,la.forEach(H=>{this.players.push(H),H.onDone(()=>{H.destroy();let Q=this.players.indexOf(H);this.players.splice(Q,1)}),H.play()}),la}afterFlush(n){this._flushFns.push(n)}afterFlushAnimationsDone(n){this._whenQuietFns.push(n)}_getPreviousPlayers(n,e,t,o,r){let p=[];if(e){let u=this.playersByQueriedElement.get(n);u&&(p=u)}else{let u=this.playersByElement.get(n);if(u){let v=!r||r==co;u.forEach(T=>{T.queued||!v&&T.triggerName!=o||p.push(T)})}}return(t||o)&&(p=p.filter(u=>!(t&&t!=u.namespaceId||o&&o!=u.triggerName))),p}_beforeAnimationBuild(n,e,t){let o=e.triggerName,r=e.element,p=e.isRemovalTransition?void 0:n,u=e.isRemovalTransition?void 0:o;for(let v of e.timelines){let T=v.element,N=T!==r,V=Ct(t,T,[]);this._getPreviousPlayers(T,N,p,u,e.toState).forEach(q=>{let K=q.getRealPlayer();K.beforeDestroy&&K.beforeDestroy(),q.destroy(),V.push(q)})}Ni(r,e.fromStyles)}_buildAnimation(n,e,t,o,r,p){let u=e.triggerName,v=e.element,T=[],N=new Set,V=new Set,le=e.timelines.map(K=>{let ne=K.element;N.add(ne);let Te=ne[Qt];if(Te&&Te.removedBeforeQueried)return new ji(K.duration,K.delay);let $e=ne!==v,ze=k0((t.get(ne)||b0).map(st=>st.getRealPlayer())).filter(st=>{let ct=st;return ct.element?ct.element===ne:!1}),at=r.get(ne),et=p.get(ne),nn=Da(this._normalizer,K.keyframes,at,et),qt=this._buildPlayer(K,nn,ze);if(K.subTimeline&&o&&V.add(ne),$e){let st=new uo(n,u,ne);st.setRealPlayer(qt),T.push(st)}return qt});T.forEach(K=>{Ct(this.playersByQueriedElement,K.element,[]).push(K),K.onDone(()=>T0(this.playersByQueriedElement,K.element,K))}),N.forEach(K=>Ht(K,Ra));let q=ui(le);return q.onDestroy(()=>{N.forEach(K=>Nn(K,Ra)),Kt(v,e.toStyles)}),V.forEach(K=>{Ct(o,K,[]).push(q)}),q}_buildPlayer(n,e,t){return e.length>0?this.driver.animate(n.element,e,n.duration,n.delay,n.easing,t):new ji(n.duration,n.delay)}},uo=class{namespaceId;triggerName;element;_player=new ji;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(n,e,t){this.namespaceId=n,this.triggerName=e,this.element=t}setRealPlayer(n){this._containsRealPlayer||(this._player=n,this._queuedCallbacks.forEach((e,t)=>{e.forEach(o=>br(n,t,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(n.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(n){this.totalTime=n}syncPlayerEvents(n){let e=this._player;e.triggerCallback&&n.onStart(()=>e.triggerCallback("start")),n.onDone(()=>this.finish()),n.onDestroy(()=>this.destroy())}_queueEvent(n,e){Ct(this._queuedCallbacks,n,[]).push(e)}onDone(n){this.queued&&this._queueEvent("done",n),this._player.onDone(n)}onStart(n){this.queued&&this._queueEvent("start",n),this._player.onStart(n)}onDestroy(n){this.queued&&this._queueEvent("destroy",n),this._player.onDestroy(n)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(n){this.queued||this._player.setPosition(n)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(n){let e=this._player;e.triggerCallback&&e.triggerCallback(n)}};function T0(i,n,e){let t=i.get(n);if(t){if(t.length){let o=t.indexOf(e);t.splice(o,1)}t.length==0&&i.delete(n)}return t}function E0(i){return i??null}function Pr(i){return i&&i.nodeType===1}function A0(i){return i=="start"||i=="done"}function Rp(i,n){let e=i.style.display;return i.style.display=n??"none",e}function Np(i,n,e,t,o){let r=[];e.forEach(v=>r.push(Rp(v)));let p=[];t.forEach((v,T)=>{let N=new Map;v.forEach(V=>{let le=n.computeStyle(T,V,o);N.set(V,le),(!le||le.length==0)&&(T[Qt]=w0,p.push(T))}),i.set(T,N)});let u=0;return e.forEach(v=>Rp(v,r[u++])),p}function Vp(i,n){let e=new Map;if(i.forEach(u=>e.set(u,[])),n.length==0)return e;let t=1,o=new Set(n),r=new Map;function p(u){if(!u)return t;let v=r.get(u);if(v)return v;let T=u.parentNode;return e.has(T)?v=T:o.has(T)?v=t:v=p(T),r.set(u,v),v}return n.forEach(u=>{let v=p(u);v!==t&&e.get(v).push(u)}),e}function Ht(i,n){i.classList?.add(n)}function Nn(i,n){i.classList?.remove(n)}function D0(i,n,e){ui(e).onDone(()=>i.processLeaveNode(n))}function k0(i){let n=[];return zp(i,n),n}function zp(i,n){for(let e=0;e<i.length;e++){let t=i[e];t instanceof Po?zp(t.players,n):n.push(t)}}function M0(i,n){let e=Object.keys(i),t=Object.keys(n);if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!n.hasOwnProperty(r)||i[r]!==n[r])return!1}return!0}function Lp(i,n,e){let t=e.get(i);if(!t)return!1;let o=n.get(i);return o?t.forEach(r=>o.add(r)):n.set(i,t),e.delete(i),!0}var Vn=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(n,e)=>{};constructor(n,e,t){this._driver=e,this._normalizer=t,this._transitionEngine=new Ya(n.body,e,t),this._timelineEngine=new Qa(n.body,e,t),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(n,e,t,o,r){let p=n+"-"+o,u=this._triggerCache[p];if(!u){let v=[],T=[],N=Bp(this._driver,r,v,T);if(v.length)throw mp(o,v);u=h0(o,N,this._normalizer),this._triggerCache[p]=u}this._transitionEngine.registerTrigger(e,o,u)}register(n,e){this._transitionEngine.register(n,e)}destroy(n,e){this._transitionEngine.destroy(n,e)}onInsert(n,e,t,o){this._transitionEngine.insertNode(n,e,t,o)}onRemove(n,e,t){this._transitionEngine.removeNode(n,e,t)}disableAnimations(n,e){this._transitionEngine.markElementAsDisabled(n,e)}process(n,e,t,o){if(t.charAt(0)=="@"){let[r,p]=ka(t),u=o;this._timelineEngine.command(r,e,p,u)}else this._transitionEngine.trigger(n,e,t,o)}listen(n,e,t,o,r){if(t.charAt(0)=="@"){let[p,u]=ka(t);return this._timelineEngine.listen(p,e,u,r)}return this._transitionEngine.listen(n,e,t,o,r)}flush(n=-1){this._transitionEngine.flush(n)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(n){this._transitionEngine.afterFlushAnimationsDone(n)}};function F0(i,n){let e=null,t=null;return Array.isArray(n)&&n.length?(e=Ua(n[0]),n.length>1&&(t=Ua(n[n.length-1]))):n instanceof Map&&(e=Ua(n)),e||t?new P0(i,e,t):null}var P0=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,t,o){this._element=e,this._startStyles=t,this._endStyles=o;let r=i.initialStylesByElement.get(e);r||i.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Kt(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Kt(this._element,this._initialStyles),this._endStyles&&(Kt(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(Ni(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Ni(this._element,this._endStyles),this._endStyles=null),Kt(this._element,this._initialStyles),this._state=3)}}return i})();function Ua(i){let n=null;return i.forEach((e,t)=>{I0(t)&&(n=n||new Map,n.set(t,e))}),n}function I0(i){return i==="display"||i==="position"}var Br=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(n,e,t,o){this.element=n,this.keyframes=e,this.options=t,this._specialStyles=o,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let n=this.keyframes,e=this._triggerWebAnimation(this.element,n,this.options);if(!e)return this._onFinish(),null;this.domPlayer=e,this._finalKeyframe=n.length?n[n.length-1]:new Map;let t=()=>this._onFinish();return e.addEventListener("finish",t),this.onDestroy(()=>{e.removeEventListener("finish",t)}),e}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(n){let e=[];return n.forEach(t=>{e.push(Object.fromEntries(t))}),e}_triggerWebAnimation(n,e,t){let o=this._convertKeyframesToObject(e);try{return n.animate(o,t)}catch{return null}}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}play(){let n=this._buildPlayer();n&&(this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),n.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}setPosition(n){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=n*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let n=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,o)=>{o!=="offset"&&n.set(o,this._finished?t:kr(this.element,o))}),this.currentSnapshot=n}triggerCallback(n){let e=n==="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Ur=class{validateStyleProperty(n){return!0}validateAnimatableStyleProperty(n){return!0}containsElement(n,e){return Ma(n,e)}getParentElement(n){return Tr(n)}query(n,e,t){return Fa(n,e,t)}computeStyle(n,e,t){return kr(n,e)}animate(n,e,t,o,r,p=[]){let u=o==0?"both":"forwards",v={duration:t,delay:o,fill:u};r&&(v.easing=r);let T=new Map,N=p.filter(q=>q instanceof Br);Ep(t,o)&&N.forEach(q=>{q.currentSnapshot.forEach((K,ne)=>T.set(ne,K))});let V=wp(e).map(q=>new Map(q));V=Ap(n,V,T);let le=F0(n,V);return new Br(n,V,v,le)}};var Ir="@",Gp="@.disabled",Hr=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(n,e,t,o){this.namespaceId=n,this.delegate=e,this.engine=t,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(n){this.delegate.destroyNode?.(n)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(n,e){return this.delegate.createElement(n,e)}createComment(n){return this.delegate.createComment(n)}createText(n){return this.delegate.createText(n)}appendChild(n,e){this.delegate.appendChild(n,e),this.engine.onInsert(this.namespaceId,e,n,!1)}insertBefore(n,e,t,o=!0){this.delegate.insertBefore(n,e,t),this.engine.onInsert(this.namespaceId,e,n,o)}removeChild(n,e,t,o){if(o){this.delegate.removeChild(n,e,t,o);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(n,e){return this.delegate.selectRootElement(n,e)}parentNode(n){return this.delegate.parentNode(n)}nextSibling(n){return this.delegate.nextSibling(n)}setAttribute(n,e,t,o){this.delegate.setAttribute(n,e,t,o)}removeAttribute(n,e,t){this.delegate.removeAttribute(n,e,t)}addClass(n,e){this.delegate.addClass(n,e)}removeClass(n,e){this.delegate.removeClass(n,e)}setStyle(n,e,t,o){this.delegate.setStyle(n,e,t,o)}removeStyle(n,e,t){this.delegate.removeStyle(n,e,t)}setProperty(n,e,t){e.charAt(0)==Ir&&e==Gp?this.disableAnimations(n,!!t):this.delegate.setProperty(n,e,t)}setValue(n,e){this.delegate.setValue(n,e)}listen(n,e,t,o){return this.delegate.listen(n,e,t,o)}disableAnimations(n,e){this.engine.disableAnimations(n,e)}},Xa=class extends Hr{factory;constructor(n,e,t,o,r){super(e,t,o,r),this.factory=n,this.namespaceId=e}setProperty(n,e,t){e.charAt(0)==Ir?e.charAt(1)=="."&&e==Gp?(t=t===void 0?!0:!!t,this.disableAnimations(n,t)):this.engine.process(this.namespaceId,n,e.slice(1),t):this.delegate.setProperty(n,e,t)}listen(n,e,t,o){if(e.charAt(0)==Ir){let r=R0(n),p=e.slice(1),u="";return p.charAt(0)!=Ir&&([p,u]=N0(p)),this.engine.listen(this.namespaceId,r,p,u,v=>{let T=v._data||-1;this.factory.scheduleListenerCallback(T,t,v)})}return this.delegate.listen(n,e,t,o)}};function R0(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function N0(i){let n=i.indexOf("."),e=i.substring(0,n),t=i.slice(n+1);return[e,t]}var $r=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(n,e,t){this.delegate=n,this.engine=e,this._zone=t,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(n,e){let o=this.delegate.createRenderer(n,e);if(!n||!e?.data?.animation){let T=this._rendererCache,N=T.get(o);if(!N){let V=()=>T.delete(o);N=new Hr("",o,this.engine,V),T.set(o,N)}return N}let r=e.id,p=e.id+"-"+this._currentId;this._currentId++,this.engine.register(p,n);let u=T=>{Array.isArray(T)?T.forEach(u):this.engine.registerTrigger(r,p,n,T.name,T)};return e.data.animation.forEach(u),new Xa(this,p,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(n,e,t){if(n>=0&&n<this._microtaskId){this._zone.run(()=>e(t));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[p,u]=r;p(u)}),this._animationCallbacksBuffer=[]})}),o.push([e,t])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(n){this.engine.flush(),this.delegate.componentReplaced?.(n)}};var L0=(()=>{class i extends Vn{constructor(e,t,o){super(e,t,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(t){return new(t||i)(To(Eo),To(Ji),To(en))};static \u0275prov=kt({token:i,factory:i.\u0275fac})}return i})();function O0(){return new Rr}function B0(i,n,e){return new $r(i,n,e)}var Wp=[{provide:en,useFactory:O0},{provide:Vn,useClass:L0},{provide:vs,useFactory:B0,deps:[Vs,Vn,zi]}],tb=[{provide:Ji,useClass:Za},{provide:da,useValue:"NoopAnimations"},...Wp],U0=[{provide:Ji,useFactory:()=>new Ur},{provide:da,useFactory:()=>"BrowserAnimations"},...Wp];function jp(){return xs("NgEagerAnimations"),[...U0]}var _o=i=>i.url;var Kp=()=>S(oe).user.isAdmin;var Qp=[{path:Yi.BASE,pathMatch:"prefix",canActivate:[Kp],children:[{path:Yi.USERS,data:{type:Zn.USER},loadComponent:()=>import("./chunk-3VRUIWQG.js").then(i=>i.AdminUsersComponent)},{path:Yi.GUESTS,data:{type:Zn.GUEST},loadComponent:()=>import("./chunk-3VRUIWQG.js").then(i=>i.AdminUsersComponent)},{path:Yi.GROUPS,children:[{path:"**",resolve:{routes:_o},data:{type:qi.USER},loadComponent:()=>import("./chunk-VBTZDHZ3.js").then(i=>i.AdminGroupsComponent)}]},{path:Yi.PGROUPS,children:[{path:"**",resolve:{routes:_o},data:{type:qi.PERSONAL},loadComponent:()=>import("./chunk-VBTZDHZ3.js").then(i=>i.AdminGroupsComponent)}]},{path:"**",redirectTo:Yi.USERS}]}];var qp=i=>S(li).linkValidation(i.params.uuid).pipe(zn(n=>n===!1?gi(!1):(i.data=Se(re({},i.data),{link:n}),gi(!0))));var Yp=[{path:va.LINK,children:[{path:":uuid",loadComponent:()=>import("./chunk-VZFZUI6D.js").then(i=>i.PublicLinkComponent),canActivate:[qp]},{path:`:uuid/${va.AUTH}`,loadComponent:()=>import("./chunk-X7NHX5C7.js").then(i=>i.PublicLinkAuthComponent)},{path:":uuid/:error",loadComponent:()=>import("./chunk-LWSCODLD.js").then(i=>i.PublicLinkErrorComponent)}]}];var zr={BASE:`${ql}/comments`,RECENTS:"recents",SPACES:"spaces"},fo=`${zr.BASE}/${zr.SPACES}`,Xp=`${zr.BASE}/${zr.RECENTS}`;var Gr=class{constructor(n){Object.assign(this,n),this.author&&(this.author.avatarUrl=wn(this.author.login)),this.mimeUrl=io(this.file.mime),this.icon=this.file.fromShare?ie.SHARES:this.file.fromSpace?ie.SPACES:ie.PERSONAL,this.iconClass=this.file.fromShare?"purple":"primary",this.showedPath=[...this.file.path.split("/").slice(this.file.path.split("/")[1]===ht.PERSONAL?2:1),this.file.name].join("/")}};var Ln=class{constructor(n){this.wasModified=!1,Object.assign(this,n),this.author.avatarUrl=wn(this.author.login),this.wasModified=this.createdAt!==this.modifiedAt,this.dateToShow=this.wasModified?this.modifiedAt:this.createdAt}};var Wr=(()=>{let n=class n{constructor(){this.store=S(te),this.layout=S(I),this.http=S(Bs)}getComments(t){return this.http.get(`${fo}/${t.path}`).pipe(bt(o=>o.map(r=>new Ln(r))))}createComment(t,o){return this.http.post(`${fo}/${t.path}`,o).pipe(bt(r=>new Ln(r)))}updateComment(t,o){return this.http.patch(`${fo}/${t.path}`,o).pipe(bt(r=>new Ln(r)))}deleteComment(t,o){return this.http.request("delete",`${fo}/${t.path}`,{body:o})}loadRecents(t){this.http.get(Xp,{params:new Os().set("limit",t)}).pipe(bt(o=>o.map(r=>new Gr(r)))).subscribe({next:o=>{this.store.commentsRecents.update(r=>[...o,...r.slice(t)])},error:o=>this.layout.sendNotification("error","Comments","Unable to load",o)})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var H0=(i,n)=>n.id;function $0(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faTrashAlt)}}function z0(i,n){if(i&1){let e=y();a(0,"ul",8)(1,"li",9),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),a(2,"div",10),_(3,"app-user-avatar",11),l(),a(4,"div",12)(5,"span",13)(6,"span"),d(7),l()(),a(8,"span"),C(9,$0,1,1,"fa-icon",2),_(10,"fa-icon",14),a(11,"span"),d(12),l()()(),a(13,"div",15)(14,"span",16),d(15),b(16,"amTimeAgo"),l()()()()}if(i&2){let e=n.$implicit,t=n.$index,o=n.$count;O("border-0",t===o-1),s(3),m("user",e.author),s(4),w(e.content),s(),L(X("product-description text-",e.iconClass)),s(),x(e.file.inTrash?9:-1),s(),m("icon",e.icon),s(2),w(e.showedPath),s(3),w(E(16,11,e.modifiedAt,!0))}}function G0(i,n){if(i&1&&(a(0,"div",7),_(1,"fa-icon",17),a(2,"div",18),d(3,"No recent comments"),l()()),i&2){let e=c();s(),m("icon",e.icons.faCommentDots)}}var Zp=(()=>{let n=class n{constructor(){this.moreElements=!1,this.icons={faCommentDots:vr,faMagnifyingGlassPlus:zo,faMagnifyingGlassMinus:$o,faTrashAlt:Di},this.router=S(Ce),this.layout=S(I),this.store=S(te),this.commentsService=S(Wr),this.nbInitialComments=10,this.nbComments=this.nbInitialComments,this.comments=ve(()=>this.store.commentsRecents().slice(0,this.nbComments)),this.load()}switchMore(){this.moreElements?(this.moreElements=!1,this.nbComments=this.nbInitialComments):(this.moreElements=!0,this.nbComments*=5),this.load()}goToFile(t){this.router.navigate([z.SPACES,...t.file.path.split("/")],{queryParams:{select:t.file.name}}).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}load(){this.commentsService.loadRecents(this.nbComments)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-comments-recents-widget"]],decls:10,vars:3,consts:[[1,"box-transparent"],[1,"box-header"],[3,"icon"],["l10nTranslate","",1,"box-title"],["role","button",1,"ms-auto","btn-link",3,"click","icon"],[1,"box-body","px-0","py-0"],[1,"products-list","product-list-in-box",3,"border-0"],[1,"d-flex","flex-column","justify-content-center","text-align-center","text-gray","mt-5"],[1,"products-list","product-list-in-box"],[1,"item",3,"click"],[1,"product-img"],[3,"user"],[1,"product-info"],[1,"product-title"],[1,"me-1",3,"icon"],[1,"product-badge"],[1,"badge","rounded-pill","bg-warning"],["size","4x",3,"icon"],["l10nTranslate","",1,"mt-4"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Comments"),l(),a(5,"fa-icon",4),f("click",function(){return r.switchMore()}),l()(),a(6,"div",5),k(7,z0,17,14,"ul",6,H0,!1,G0,4,1,"div",7),l()()),o&2&&(s(2),m("icon",r.icons.faCommentDots),s(3),m("icon",r.moreElements?r.icons.faMagnifyingGlassMinus:r.icons.faMagnifyingGlassPlus),s(2),M(r.comments()))},dependencies:[P,F,Ze,Je],encapsulation:2});let i=n;return i})();var W0=(i,n)=>n.id;function j0(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faTrashAlt)}}function K0(i,n){if(i&1){let e=y();a(0,"ul",8)(1,"li",9),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),a(2,"div",10)(3,"img",11),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l()(),a(4,"div",12)(5,"span",13)(6,"span"),d(7),l()(),a(8,"span"),C(9,j0,1,1,"fa-icon",2),_(10,"fa-icon",14),a(11,"span"),d(12),l()()(),a(13,"div",15)(14,"span",16),d(15),b(16,"amTimeAgo"),l()()()()}if(i&2){let e=n.$implicit,t=n.$index,o=n.$count;O("border-0",t===o-1),s(3),m("src",e.mimeUrl,ee),s(4),w(e.name),s(),L(X("product-description text-",e.iconClass)),s(),x(e.inTrash?9:-1),s(),m("icon",e.icon),s(2),w(e.showedPath),s(3),w(E(16,11,e.mtime,!0))}}function Q0(i,n){if(i&1&&(a(0,"div",7),_(1,"fa-icon",17),a(2,"div",18),d(3,"No recent files"),l()()),i&2){let e=c();s(),m("icon",e.icons.faFileLines)}}var Jp=(()=>{let n=class n{constructor(){this.moreElements=!1,this.icons={faFileLines:Bc,faMagnifyingGlassPlus:zo,faMagnifyingGlassMinus:$o,faTrashAlt:Di},this.router=S(Ce),this.store=S(te),this.filesService=S(He),this.nbInitialFiles=10,this.nbFiles=this.nbInitialFiles,this.files=ve(()=>this.store.filesRecents().slice(0,this.nbFiles)),this.load()}switchMore(){this.moreElements?(this.moreElements=!1,this.nbFiles=this.nbInitialFiles):(this.moreElements=!0,this.nbFiles*=5),this.load()}goToFile(t){this.router.navigate([z.SPACES,...t.path.split("/")],{queryParams:{select:t.name}}).catch(console.error)}load(){this.filesService.loadRecents(this.nbFiles)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-recents-widget"]],decls:10,vars:3,consts:[[1,"box-transparent"],[1,"box-header"],[3,"icon"],["l10nTranslate","",1,"box-title"],["role","button",1,"ms-auto","btn-link",3,"click","icon"],[1,"box-body","px-0","py-0"],[1,"products-list","product-list-in-box",3,"border-0"],[1,"d-flex","flex-column","justify-content-center","text-align-center","text-gray","mt-5"],[1,"products-list","product-list-in-box"],[1,"item",3,"click"],[1,"product-img"],["alt","",3,"error","src"],[1,"product-info"],[1,"product-title"],[1,"me-1",3,"icon"],[1,"product-badge"],[1,"badge","rounded-pill","bg-warning"],["size","4x",3,"icon"],["l10nTranslate","",1,"mt-4"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Files"),l(),a(5,"fa-icon",4),f("click",function(){return r.switchMore()}),l()(),a(6,"div",5),k(7,K0,17,14,"ul",6,W0,!1,Q0,4,1,"div",7),l()()),o&2&&(s(2),m("icon",r.icons.faFileLines),s(3),m("icon",r.moreElements?r.icons.faMagnifyingGlassMinus:r.icons.faMagnifyingGlassPlus),s(2),M(r.files()))},dependencies:[P,F,Je],encapsulation:2});let i=n;return i})();var ed=(()=>{let n=class n{constructor(){this.layout=S(I),this.layout.setBreadcrumbIcon(dc),this.layout.setBreadcrumbNav({url:`/${mi.BASE}/${pc}`,translating:!0,sameLink:!0})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-recents"]],decls:6,vars:2,consts:[["appAutoResize","",1,"fs-xs","px-2",3,"useMaxHeight","resizeOffset"],[1,"row"],[1,"col-md-6"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,"app-files-recents-widget"),l(),a(4,"div",2),_(5,"app-comments-recents-widget"),l()()()),o&2&&m("useMaxHeight",!1)("resizeOffset",40)},dependencies:[ce,Jp,Zp],encapsulation:2});let i=n;return i})();var td=[{path:rr.BASE,pathMatch:"full",redirectTo:mi.BASE},{path:mi.BASE,component:ed}];var ho={BASE:"search"},q0="Search",jr=Bo,id={title:q0,link:ho.BASE,icon:jr,level:2,submenus:[]};function X0(i,n){if(i&1){let e=y();a(0,"span",6)(1,"fa-icon",13),f("click",function(){h(e);let o=c();return g(o.clearSearch())}),l()()}if(i&2){let e=c();s(),m("icon",e.icons.faTimes)}}function Z0(i,n){if(i&1&&(a(0,"div",11),d(1),l()),i&2){let e=c();s(),w(e.errorMessage)}}function J0(i,n){if(i&1&&(a(0,"div")(1,"span"),d(2,"..."),l(),_(3,"span",23),a(4,"span"),d(5,"..."),l()()),i&2){let e=n.$implicit;s(3),m("innerHTML",e,Wn)}}function eu(i,n){if(i&1&&(_(0,"hr",21),a(1,"div",22),k(2,J0,6,1,"div",null,We),l()),i&2){let e=c().$implicit;s(2),M(e.matches)}}function tu(i,n){if(i&1){let e=y();a(0,"div",14),f("click",function(){let o=h(e).$index,r=c();return g(r.selectedId=o)})("appTap",function(){let o=h(e).$implicit,r=c();return g(r.goTo(o))}),a(1,"div",15)(2,"img",16),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"div",17)(4,"span",18),d(5),l(),a(6,"div"),_(7,"fa-icon",19),a(8,"span",20)(9,"span"),d(10),l()()()()(),C(11,eu,4,0),l()}if(i&2){let e=n.$implicit,t=n.$index,o=c();O("selected",t===o.selectedId),s(2),m("src",e.mimeUrl,ee),s(3),w(e.name),s(),L(X("d-flex align-items-center text-",e.iconClass)),s(),m("icon",e.icon),s(3),w(e.showedPath),s(),x(e.matches!=null&&e.matches.length?11:-1)}}var nd=(()=>{let n=class n{constructor(){this.locale=S($),this.store=S(te),this.searchContent=ve(()=>this.store.currentSearch().content),this.icons={SEARCH_ICON:jr,faSpinner:Ue,faTrashCan:Ai,faTimes:Rt,faFont:Fl},this.minCharsToSearch=3,this.loading=!1,this.errorMessage=null,this.selectedId=null,this.router=S(Ce),this.layout=S(I),this.filesService=S(He),this.layout.setBreadcrumbIcon(jr),this.layout.setBreadcrumbNav({url:`/${ho.BASE}`,translating:!1,sameLink:!0})}setCurrentSearch(t){this.store.currentSearch.update(o=>Se(re({},o),{content:t.target.value}))}doSearch(){this.searchContent().length<this.minCharsToSearch||(this.errorMessage=null,this.loading=!0,this.selectedId=null,this.filesService.search(this.store.currentSearch()).subscribe({next:t=>{this.store.filesSearch.set(t),this.loading=!1},error:t=>{this.store.filesSearch.set([]),this.errorMessage=t.error.message,this.loading=!1}}))}toggleFullText(){this.store.currentSearch.update(t=>Se(re({},t),{fullText:!t.fullText}))}clearSearch(){this.store.currentSearch.update(t=>Se(re({},t),{content:""})),this.store.filesSearch.set([])}goTo(t){this.router.navigate([z.SPACES,...t.path.split("/")],{queryParams:{select:t.name}}).catch(console.error)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-search"]],viewQuery:function(o,r){if(o&1&&Y(Ve,7),o&2){let p;W(p=j())&&(r.inputFilter=p.first)}},decls:17,vars:19,consts:[[1,"app-top-menu"],[1,"col-12","col-md-6","col-lg-4"],[1,"input-group"],["role","button","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled"],[3,"icon","animation"],["name","search","type","text","appAutofocus","","autocomplete","",1,"flex-fill","form-control","form-control-sm",2,"padding-right","2rem",3,"input","keyup.enter","keyup.escape","value","placeholder"],[1,"cursor-pointer",2,"position","absolute","right","40px","top","3px","z-index","1001","font-size","1rem"],["placement","bottom","role","button","type","button","btnCheckbox","",1,"btn","btn-sm","btn-outline-secondary-alt","fs-xxs",3,"ngModelChange","ngModel","tooltip"],[3,"icon"],[1,"d-none","d-sm-none","d-md-block","d-lg-block","ms-auto"],["appAutoResize","",1,"fs-xs"],["l10nTranslate","",1,"p-3","text-danger","fw-500"],[1,"app-div-striped","py-2",3,"selected"],["role","button",3,"click","icon"],[1,"app-div-striped","py-2",3,"click","appTap"],[1,"d-flex","align-items-center","text-truncate","px-2","py-1"],["alt","","draggable","false","height","28",3,"error","src"],[1,"d-flex","flex-column","text-truncate","ms-2",2,"height","34px"],[1,"fs-xxs","text-truncate"],[1,"me-1",3,"icon"],[1,"fs-xxxs","text-truncate"],[1,"m-0"],[1,"d-flex","flex-column","px-2","py-1"],[1,"fs-xxxs",3,"innerHTML"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),f("click",function(){return r.doSearch()}),_(4,"fa-icon",4),l(),a(5,"input",5),b(6,"translate"),f("input",function(u){return r.setCurrentSearch(u)})("keyup.enter",function(){return r.doSearch()})("keyup.escape",function(){return r.clearSearch()}),l(),C(7,X0,2,1,"span",6),a(8,"button",7),b(9,"translate"),f("ngModelChange",function(){return r.toggleFullText()}),_(10,"fa-icon",8),l()()(),_(11,"app-input-filter",9),l(),a(12,"div",10),C(13,Z0,2,1,"div",11),k(14,tu,12,10,"div",12,We),b(16,"searchFilter"),l()),o&2&&(s(3),m("disabled",r.searchContent().length<r.minCharsToSearch),s(),m("icon",r.loading?r.icons.faSpinner:r.icons.SEARCH_ICON)("animation",r.loading?"spin":null),s(),m("value",r.searchContent())("placeholder",E(6,10,r.store.currentSearch().fullText?"Search for content":"Search for files",r.locale.language)),s(2),x(r.searchContent()?7:-1),s(),m("ngModel",r.store.currentSearch().fullText)("tooltip",E(9,13,"Search for content",r.locale.language)),s(2),m("icon",r.icons.faFont),s(3),x(r.errorMessage?13:-1),s(),M(E(16,16,r.store.filesSearch(),r.inputFilter.search())))},dependencies:[Ve,F,Ye,Tn,be,xe,ye,ce,Me,nt,P,Z,gt],encapsulation:2});let i=n;return i})();var od=[{path:ho.BASE,component:nd}];var rd=(i,n)=>n.key;function iu(i,n){if(i&1){let e=y();a(0,"li",6)(1,"a",8),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.setView(o.key))}),a(2,"span"),_(3,"fa-icon",2),d(4),l()()()}if(i&2){let e=n.$implicit;s(3),m("icon",e.value.icon),s(),D(" ",e.value.text)}}function nu(i,n){if(i&1&&_(0,"fa-icon",10),i&2){let e=c(3);m("icon",e.sortParams.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function ou(i,n){if(i&1){let e=y();a(0,"li",6)(1,"a",8),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.sortBy.emit(o.key))}),a(2,"span",9),d(3),C(4,nu,1,1,"fa-icon",10),l()()()}if(i&2){let e=n.$implicit,t=c(2);s(3),D(" ",e.value," "),s(),x(t.sortParams.column===e.key?4:-1)}}function ru(i,n){if(i&1&&(a(0,"ul",4)(1,"li",5),d(2,"Display"),l(),k(3,iu,5,2,"li",6,rd),b(5,"keyvalue"),a(6,"li",7),d(7,"Sort by"),l(),k(8,ou,5,2,"li",6,rd),b(10,"keyvalue"),l()),i&2){let e=c();s(3),M(E(5,0,e.viewsMode,e.originalOrderKeyValue)),s(5),M(E(10,3,e.sortFields,e.originalOrderKeyValue))}}var lt=(()=>{let n=class n{constructor(){this.switchView=new ae,this.sortBy=new ae,this.originalOrderKeyValue=De,this.icons={faCog:Ei,faArrowDown:_t,faArrowUp:dt},this.viewsMode={tl:{enabled:!1,text:"List",icon:bl},th:{enabled:!0,text:"S",icon:Xn,dimensions:96,image:56,imageRes:128,faSize:30,textSize:10,margins:18},thM:{enabled:!0,text:"M",icon:Xn,dimensions:112,image:72,imageRes:192,faSize:34,textSize:11,margins:18},thL:{enabled:!0,text:"L",icon:Xn,dimensions:152,image:112,imageRes:256,faSize:50,textSize:12,margins:18},thXl:{enabled:!0,text:"XL",icon:Xn,dimensions:192,image:152,imageRes:512,faSize:65,textSize:13,margins:18},thXxl:{enabled:!0,text:"XXL",icon:Ll,dimensions:232,image:192,imageRes:1024,faSize:80,textSize:13,margins:18}},this.layout=S(I),this.viewsMode.tl.text=this.layout.translateString(this.viewsMode.tl.text)}get viewMode(){return localStorage.getItem("viewMode")||"tl"}set viewMode(t){localStorage.setItem("viewMode",t)}currentView(){return this.viewsMode[this.viewMode]}setView(t){this.viewMode=t,this.switchView.emit(this.viewsMode[t])}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,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,r){o&1&&(a(0,"div",0)(1,"button",1),_(2,"fa-icon",2),l(),R(3,ru,11,6,"ul",3),l()),o&2&&(s(2),m("icon",r.icons.faCog))},dependencies:[Ri,Pi,Ii,Fi,F,P,Ee],encapsulation:2,changeDetection:0});let i=n;return i})();var au=(i,n)=>n.key;function su(i,n){i&1&&(a(0,"span",0),d(1,"No permissions"),l())}function lu(i,n){if(i&1&&(_(0,"fa-icon",1),b(1,"translate")),i&2){let e=n.$implicit,t=c(2);m("icon",e.value.icon)("tooltip",E(1,3,e.value.text,t.locale.language))("placement",t.tooltipPlacement)}}function cu(i,n){if(i&1&&(k(0,lu,2,6,"fa-icon",1,au),b(2,"keyvalue")),i&2){let e=c();M(E(2,0,e.permissions,e.originalOrderKeyValue))}}var vt=(()=>{let n=class n{constructor(){this.permissions={},this.tooltipPlacement="top",this.replaceEmptyPermissions=!1,this.locale=S($),this.hasPermissions=!1,this.originalOrderKeyValue=De}ngOnChanges(){this.hasPermissions=!!Object.keys(this.permissions).length}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-file-permissions"]],inputs:{permissions:"permissions",tooltipPlacement:"tooltipPlacement",replaceEmptyPermissions:"replaceEmptyPermissions"},features:[rn],decls:2,vars:1,consts:[["l10nTranslate",""],[1,"cursor-pointer","fs-md",3,"icon","tooltip","placement"]],template:function(o,r){o&1&&C(0,su,2,0,"span",0)(1,cu,3,3),o&2&&x(r.replaceEmptyPermissions&&!r.hasPermissions?0:1)},dependencies:[Ke,Me,P,F,Ee,Z],encapsulation:2});let i=n;return i})();var pu=["MainContextMenu"],du=["TargetContextMenu"],sd=(i,n)=>n.id,ld=(i,n)=>n.key;function mu(i,n){if(i&1&&(a(0,"span",30),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),D(" ",e.hTimeAccessAgo," ")}}function uu(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openLinkDialog())}),a(1,"div",22)(2,"img",23),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"span",24),C(4,mu,2,3,"span",25),l(),a(5,"span",26),_(6,"app-share-repository",27),l()(),a(7,"div",28)(8,"span",29),d(9),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("selected",e.id===(o.selected==null?null:o.selected.id))("disabled",!e.link.isActive),s(),Zt("rowIndex",t),s(),m("src",e.mimeUrl,ee)("height",o.galleryMode.image)("width",o.galleryMode.image),s(2),x(e.newly?4:-1),s(2),m("share",e)("galleryMode",o.galleryMode),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.name)}}function _u(i,n){if(i&1){let e=y();a(0,"div",13)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",19),k(4,uu,10,18,"div",20,sd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function fu(i,n){if(i&1&&_(0,"fa-icon",37),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function hu(i,n){if(i&1){let e=y();a(0,"th",36),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,fu,1,2,"fa-icon",37),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function gu(i,n){if(i&1&&C(0,hu,3,10,"th",35),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Cu(i,n){if(i&1){let e=y();a(0,"div",40)(1,"img",43),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),a(2,"div",44)(3,"span",29),d(4),l(),a(5,"span",45),d(6),l()()()}if(i&2){let e=c(3).$implicit;s(),m("src",e.mimeUrl,ee),s(3),w(e.name),s(2),w(e.description)}}function xu(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.link.email||"")}}function Su(i,n){if(i&1&&(a(0,"span",41)(1,"span"),d(2),l(),C(3,xu,2,1,"span"),l()),i&2){let e=c(3).$implicit;s(2),w(e.link.name),s(),x(e.link.email?3:-1)}}function vu(i,n){if(i&1&&_(0,"app-share-repository",42),i&2){let e=c(3).$implicit;m("share",e)}}function yu(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(4).$implicit;L(X("badge rounded-pill ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),s(),Re(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function bu(i,n){if(i&1&&(a(0,"span",47),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.link.nbAccess)}}function wu(i,n){if(i&1&&(a(0,"span",49),d(1),b(2,"translate"),l()),i&2){let e=c(5).$implicit,t=c(2);s(),Re("",e.hTimeExpirationAgo,"\xA0",E(2,2,e.hTimeExpirationAgo===1?"day":"days",t.locale.language))}}function Tu(i,n){if(i&1&&(a(0,"span"),_(1,"fa-icon",37),C(2,wu,3,5,"span",49),l()),i&2){let e=c(4).$implicit,t=c(2);L(X("badge rounded-pill bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),s(),m("icon",t.icons.faClock)("fixedWidth",!1),s(),x(e.hTimeExpirationAgo>=1?2:-1)}}function Eu(i,n){if(i&1&&(a(0,"span",48),_(1,"fa-icon",6),l()),i&2){let e=c(6);s(),m("icon",e.icons.faLock)}}function Au(i,n){if(i&1&&(C(0,yu,2,5,"span",46)(1,bu,2,1,"span",47),C(2,Tu,3,6,"span",46),C(3,Eu,2,1,"span",48)),i&2){let e=c(3).$implicit;x(e.link.limitAccess?0:1),s(2),x(e.link.expiresAt?2:-1),s(),x(e.link.requireAuth?3:-1)}}function Du(i,n){if(i&1&&_(0,"app-file-permissions",50),i&2){let e=c(4).$implicit;m("permissions",e.hPerms)}}function ku(i,n){if(i&1&&C(0,Du,1,1,"app-file-permissions",50),i&2){let e=c(3).$implicit;x(e.link.permissions?0:-1)}}function Mu(i,n){if(i&1&&d(0),i&2){let e=c(4).$implicit;D(" ",e.hTimeAccessAgo," ")}}function Fu(i,n){i&1&&(a(0,"span",51),d(1,"never"),l())}function Pu(i,n){if(i&1&&C(0,Mu,1,1)(1,Fu,2,0,"span",51),i&2){let e=c(3).$implicit;x(e.link.currentAccess?0:1)}}function Iu(i,n){if(i&1&&(a(0,"td"),C(1,Cu,7,3,"div",40)(2,Su,4,2,"span",41)(3,vu,1,1,"app-share-repository",42)(4,Au,4,3)(5,ku,1,1)(6,Pu,2,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly!==void 0?"props-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="link"?2:e==="from"?3:e==="info"?4:e==="permissions"?5:e==="accessed"?6:-1)}}function Ru(i,n){if(i&1&&C(0,Iu,7,9,"td",39),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Nu(i,n){if(i&1){let e=y();a(0,"tr",38),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openLinkDialog())}),k(1,Ru,1,1,null,null,ld),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("selected",e.id===(t.selected==null?null:t.selected.id))("disabled",!e.link.isActive),s(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Vu(i,n){if(i&1){let e=y();a(0,"table",31)(1,"thead")(2,"tr"),k(3,gu,1,1,null,null,ld),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",32),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",31)(9,"tbody",33),k(10,Nu,4,7,"tr",34,sd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.shares,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Lu(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Ou(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Go to"),l()),i&2){let e=c();s(),m("icon",e.icons.faMapMarkerAlt)}}function Bu(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Edit link"),l()),i&2){let e=c();s(),m("icon",e.icons.faPen)}}function Uu(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Copy link"),l()),i&2){let e=c();s(),m("icon",e.icons.faClipboard)}}function Hu(i,n){}function $u(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var cd=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.icons={faLink:Qo,faArrowRotateRight:ut,faArrowDown:_t,faArrowUp:dt,faMapMarkerAlt:ir,faPen:mt,faEllipsisH:Lo,faClock:fl,faLock:ii,faClipboard:Cl,faClipboardCheck:Uo,faCircleInfo:Nt},this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.loading=!1,this.linkWasCopied=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},link:{label:"Link",width:15,textCenter:!1,class:"d-none d-sm-table-cell",show:!0,sortable:!0},from:{label:"Shared from",width:15,textCenter:!1,class:"d-none d-md-table-cell",show:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},accessed:{label:"Accessed",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",link:"Link",accessed:"Accessed"},this.activatedRoute=S(Jt),this.store=S(te),this.linksService=S(li),this.sharesService=S(si),this.sortSettings={default:[{prop:"name",type:"string"}],link:[{prop:"link.name",type:"string"}],name:[{prop:"name",type:"string"}],info:[{prop:"link.nbAccess",type:"number"}],permissions:[{prop:"link.permissions",type:"length"}],accessed:[{prop:"link.currentAccess",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadShareLinks(),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(this.icons.faLink),this.layout.setBreadcrumbNav({url:`/${z.LINKS}/${Bt.SHARED_BY_LINKS}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShareLinks(){this.loading=!0,this.onSelect(),this.linksService.shareLinksList().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Links",t.error.message)}})}sortBy(t,o=!0,r){this.shares=this.sortTable.sortBy(t,o,r||this.shares)}onSelect(t=null){this.selected=t,this.store.linkSelection.set(this.selected)}openLinkDialog(){this.linksService.shareLink(this.selected.id).subscribe(t=>{this.layout.openDialog(Fn,"md",{initialState:{share:t}}).content.shareChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="update"?this.selected=Object.assign(this.selected,u):p==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(v=>v.id!==u.id)))})})}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}copyToClipboard(){this.selected&&(this.linksService.copyLinkToClipboard(this.selected.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.selected.file.name||this.selected.name),setTimeout(()=>this.linkWasCopied=!1,3e3))}goTo(t){t=t||this.selected,this.sharesService.goTo(t).catch(console.error)}focusOn(t){let o=this.shares.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared-links"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(pu,7),Y(du,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:33,vars:36,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["container","body","type","button",3,"click","disabled","tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","disabled","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected","disabled"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[1,"d-flex","flex-column"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"badge","rounded-pill","bg-gray-dark","ms-1"],[1,"ms-2"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadShareLinks())}),_(3,"fa-icon",4),l(),a(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openLinkDialog())}),_(6,"fa-icon",6),l(),a(7,"button",7),b(8,"translate"),f("click",function(){return h(p),g(r.copyToClipboard())}),_(9,"fa-icon",6),l(),a(10,"button",8),b(11,"translate"),f("click",function(){return h(p),g(r.goTo())}),_(12,"fa-icon",6),l(),a(13,"div",9)(14,"div",10),_(15,"app-input-filter",11),l(),a(16,"app-navigation-view",12),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(17,_u,6,8,"div",13)(18,Vu,12,8),a(19,"div",14)(20,"span",15),d(21),b(22,"translate"),l()(),a(23,"context-menu",null,0),R(25,Lu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.loadShareLinks())}),l(),a(26,"context-menu",null,1),R(28,Ou,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.goTo())}),R(29,Bu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.openLinkDialog())}),R(30,Uu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.copyToClipboard())}),R(31,Hu,0,0,"ng-template",17)(32,$u,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(s(),m("tooltip",E(2,21,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),m("disabled",!r.selected)("tooltip",E(5,24,"Edit link",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),L(X("btn btn-sm me-1 ",r.linkWasCopied?"btn-info":"btn-secondary")),m("disabled",!r.selected)("tooltip",E(8,27,"Copy link",r.locale.language)),s(2),m("icon",r.linkWasCopied?r.icons.faClipboardCheck:r.icons.faClipboard),s(),m("disabled",!r.selected)("tooltip",E(11,30,"Go to",r.locale.language)),s(2),m("icon",r.icons.faMapMarkerAlt),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?17:18),s(4),Re("",r.shares.length," ",E(22,33,"shares",r.locale.language)),s(10),m("divider",!0))},dependencies:[Ot,Lt,Vt,F,P,lt,Ke,Me,Ve,Xe,ai,vt,nt,Ee,Z,gt],encapsulation:2});let i=n;return i})();var Kr=class{constructor(n){this.syncs=[],this.newly=0,Object.assign(this,n),$c(this),this.hTimeAgo=Mi(this.createdAt).fromNow(!0),this.newly=ar(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=Sr}};var Qr=(()=>{let n=class n{transform(t,o=0,r=void 0){return bn(t,o,r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=an({name:"pathSlice",type:n,pure:!0});let i=n;return i})();var zu=i=>({$implicit:i});function Gu(i,n){i&1&&(a(0,"span"),d(1,"loading..."),l())}var Wu=["*"];function ju(i,n){if(i&1){let e=y();Gi(0,"span",2),jn("click",function(o){h(e);let r=c();return g(r.node().mouseAction("expanderClick",o))}),_a(1,"span",3),Wi()}if(i&2){let e=c();O("toggle-children-wrapper-expanded",e.node().isExpanded)("toggle-children-wrapper-collapsed",e.node().isCollapsed)}}function Ku(i,n){i&1&&_a(0,"span",1)}var Qu=(i,n,e)=>({$implicit:i,node:n,index:e});function qu(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c();s(),w(e.node().displayField)}}var hd=(i,n,e,t)=>({$implicit:i,node:n,index:e,templates:t});function Yu(i,n){if(i&1&&_(0,"tree-node-checkbox",3),i&2){let e=c(2);m("node",e.node())}}function Xu(i,n){if(i&1){let e=y();a(0,"div",2),C(1,Yu,1,1,"tree-node-checkbox",3),_(2,"tree-node-expander",3),a(3,"div",4),f("click",function(o){h(e);let r=c();return g(r.node().mouseAction("click",o))})("dblclick",function(o){h(e);let r=c();return g(r.node().mouseAction("dblClick",o))})("mouseover",function(o){h(e);let r=c();return g(r.node().mouseAction("mouseOver",o))})("mouseout",function(o){h(e);let r=c();return g(r.node().mouseAction("mouseOut",o))})("contextmenu",function(o){h(e);let r=c();return g(r.node().mouseAction("contextMenu",o))})("treeDrop",function(o){h(e);let r=c();return g(r.node().onDrop(o))})("treeDropDragOver",function(o){h(e);let r=c();return g(r.node().mouseAction("dragOver",o))})("treeDropDragLeave",function(o){h(e);let r=c();return g(r.node().mouseAction("dragLeave",o))})("treeDropDragEnter",function(o){h(e);let r=c();return g(r.node().mouseAction("dragEnter",o))}),_(4,"tree-node-content",5),l()()}if(i&2){let e=c();B("padding-left",e.node().getNodePadding()),s(),x(e.node().options.useCheckbox?1:-1),s(),m("node",e.node()),s(),O("node-content-wrapper-active",e.node().isActive)("node-content-wrapper-focused",e.node().isFocused),m("treeAllowDrop",e.node().allowDrop)("allowDragoverStyling",e.node().allowDragoverStyling())("treeDrag",e.node())("treeDragEnabled",e.node().allowDrag()),s(),m("node",e.node())("index",e.index())("template",e.templates().treeNodeTemplate)}}function Zu(i,n){if(i&1&&_(0,"tree-node-collection",1),i&2){let e=c(2);m("nodes",e.children())("templates",e.templates())("treeModel",e.node().treeModel)}}function Ju(i,n){if(i&1&&_(0,"tree-loading-component",3),i&2){let e=c(2);B("padding-left",e.node().getNodePadding()),m("template",e.templates().loadingTemplate)("node",e.node())}}function e_(i,n){if(i&1&&(a(0,"div"),C(1,Zu,1,3,"tree-node-collection",1),C(2,Ju,1,4,"tree-loading-component",2),l()),i&2){let e=c();O("tree-children",!0)("tree-children-no-padding",e.node().options.levelPadding),s(),x(e.children()?1:-1),s(),x(e.children()?-1:2)}}function t_(i,n){if(i&1&&_(0,"tree-node",0),i&2){let e=n.$implicit,t=n.$index,o=c();m("node",e)("index",t)("templates",o.templates())}}function i_(i,n){if(i&1&&_(0,"tree-node-drop-slot",2),i&2){let e=c(2);m("dropIndex",e.node().index)("node",e.node().parent)}}function n_(i,n){if(i&1&&(a(0,"div"),C(1,i_,1,2,"tree-node-drop-slot",2),_(2,"tree-node-wrapper",3)(3,"tree-node-children",4)(4,"tree-node-drop-slot",2),l()),i&2){let e=c();L(e.node().getClass()),O("tree-node",!0)("tree-node-expanded",e.node().isExpanded&&e.node().hasChildren)("tree-node-collapsed",e.node().isCollapsed&&e.node().hasChildren)("tree-node-leaf",e.node().isLeaf)("tree-node-active",e.node().isActive)("tree-node-focused",e.node().isFocused),s(),x(e.index()===0?1:-1),s(),m("node",e.node())("index",e.index())("templates",e.templates()),s(),m("node",e.node())("templates",e.templates()),s(),m("dropIndex",e.node().index+1)("node",e.node().parent)}}var o_=["loadingTemplate"],r_=["treeNodeTemplate"],a_=["treeNodeWrapperTemplate"],s_=["treeNodeFullTemplate"],l_=["viewport"],c_=(i,n,e,t)=>({loadingTemplate:i,treeNodeTemplate:n,treeNodeWrapperTemplate:e,treeNodeFullTemplate:t});function p_(i,n){if(i&1&&_(0,"tree-node-collection",4),i&2){let e=c();m("nodes",e.treeModel.roots)("treeModel",e.treeModel)("templates",ko(3,c_,e.loadingTemplate,e.treeNodeTemplate,e.treeNodeWrapperTemplate,e.treeNodeFullTemplate))}}function d_(i,n){if(i&1&&_(0,"tree-node-drop-slot",5),i&2){let e=c();m("dropIndex",0)("node",e.treeModel.virtualRoot)}}var rt={LEFT:37,UP:38,RIGHT:39,DOWN:40,ENTER:13,SPACE:32,CONTEXT_MENU:32},Pe={TOGGLE_ACTIVE:(i,n,e)=>n&&n.toggleActivated(),TOGGLE_ACTIVE_MULTI:(i,n,e)=>n&&n.toggleActivated(!0),TOGGLE_SELECTED:(i,n,e)=>n&&n.toggleSelected(),ACTIVATE:(i,n,e)=>n.setIsActive(!0),DEACTIVATE:(i,n,e)=>n.setIsActive(!1),SELECT:(i,n,e)=>n.setIsSelected(!0),DESELECT:(i,n,e)=>n.setIsSelected(!1),FOCUS:(i,n,e)=>n.focus(),TOGGLE_EXPANDED:(i,n,e)=>n.hasChildren&&n.toggleExpanded(),EXPAND:(i,n,e)=>n.expand(),COLLAPSE:(i,n,e)=>n.collapse(),DRILL_DOWN:(i,n,e)=>i.focusDrillDown(),DRILL_UP:(i,n,e)=>i.focusDrillUp(),NEXT_NODE:(i,n,e)=>i.focusNextNode(),PREVIOUS_NODE:(i,n,e)=>i.focusPreviousNode(),MOVE_NODE:(i,n,e,{from:t,to:o})=>{e.ctrlKey?i.copyNode(t,o):i.moveNode(t,o)}},On={mouse:{click:Pe.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:Pe.TOGGLE_EXPANDED,checkboxClick:Pe.TOGGLE_SELECTED,drop:Pe.MOVE_NODE},keys:{[rt.RIGHT]:Pe.DRILL_DOWN,[rt.LEFT]:Pe.DRILL_UP,[rt.DOWN]:Pe.NEXT_NODE,[rt.UP]:Pe.PREVIOUS_NODE,[rt.SPACE]:Pe.TOGGLE_ACTIVE,[rt.ENTER]:Pe.TOGGLE_ACTIVE}},Yr=class{get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return this.options.scrollOnActivate===void 0?!0:this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return this.options.useTriState===void 0?!0:this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return this.options.allowDragoverStyling===void 0?!0:this.options.allowDragoverStyling}constructor(n={}){this.options=n,this.actionMapping={mouse:{click:this.options?.actionMapping?.mouse?.click??On.mouse.click,dblClick:this.options?.actionMapping?.mouse?.dblClick??On.mouse.dblClick,contextMenu:this.options?.actionMapping?.mouse?.contextMenu??On.mouse.contextMenu,expanderClick:this.options?.actionMapping?.mouse?.expanderClick??On.mouse.expanderClick,checkboxClick:this.options?.actionMapping?.mouse?.checkboxClick??On.mouse.checkboxClick,drop:this.options?.actionMapping?.mouse?.drop??On.mouse.drop,dragStart:this.options?.actionMapping?.mouse?.dragStart??void 0,drag:this.options?.actionMapping?.mouse?.drag??void 0,dragEnd:this.options?.actionMapping?.mouse?.dragEnd??void 0,dragOver:this.options?.actionMapping?.mouse?.dragOver??void 0,dragLeave:this.options?.actionMapping?.mouse?.dragLeave??void 0,dragEnter:this.options?.actionMapping?.mouse?.dragEnter??void 0,mouseOver:this.options?.actionMapping?.mouse?.mouseOver??void 0,mouseOut:this.options?.actionMapping?.mouse?.mouseOut??void 0},keys:{[rt.RIGHT]:Pe.DRILL_DOWN,[rt.LEFT]:Pe.DRILL_UP,[rt.DOWN]:Pe.NEXT_NODE,[rt.UP]:Pe.PREVIOUS_NODE,[rt.SPACE]:Pe.TOGGLE_ACTIVE,[rt.ENTER]:Pe.TOGGLE_ACTIVE}},this.options?.actionMapping?.keys&&(this.actionMapping.keys=re(re({},this.actionMapping.keys),this.options.actionMapping.keys)),n.rtl&&(this.actionMapping.keys[rt.RIGHT]=n.actionMapping?.keys[rt.RIGHT]||Pe.DRILL_UP,this.actionMapping.keys[rt.LEFT]=n.actionMapping?.keys[rt.LEFT]||Pe.DRILL_DOWN)}getNodeClone(n){if(this.options.getNodeClone)return this.options.getNodeClone(n);let e=Object.assign({},n.data);return e.id&&delete e.id,e}allowDrop(n,e,t){return this.options.allowDrop instanceof Function?this.options.allowDrop(n,e,t):this.options.allowDrop===void 0?!0:this.options.allowDrop}allowDrag(n){return this.options.allowDrag instanceof Function?this.options.allowDrag(n):this.options.allowDrag}nodeClass(n){return this.options.nodeClass?this.options.nodeClass(n):""}nodeHeight(n){if(n.data.virtual)return 0;let e=this.options.nodeHeight||22;return typeof e=="function"&&(e=e(n)),e+(n.index===0?2:1)*this.dropSlotHeight}get dropSlotHeight(){return typeof this.options.dropSlotHeight=="number"?this.options.dropSlotHeight:2}},Oe={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"},es=class i{get children(){return this._children()}set children(n){this._children.set(n)}get index(){return this._index()}set index(n){this._index.set(n)}get position(){return this._position()}set position(n){this._position.set(n)}get height(){return this._height()}set height(n){this._height.set(n)}get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children?.some(n=>n.isSelected)}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children?.every(n=>n.isAllSelected)}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw`Element Ref is no longer supported since introducing virtual scroll
2
2
 
3
3
  You may use a template to obtain a reference to the element`}get originalNode(){return this._originalNode}constructor(n,e,t,o){this.data=n,this.parent=e,this.treeModel=t,this._isLoadingChildren=!1,this._children=it(void 0),this._index=it(void 0),this._position=it(0),this._height=it(void 0),this.allowDrop=(r,p)=>this.options.allowDrop(r,{parent:this,index:0},p),this.allowDragoverStyling=()=>this.options.allowDragoverStyling,(this.id===void 0||this.id===null)&&(this.id=m_()),this.index=o,this.getField("children")&&this._initChildren(),this.autoLoadChildren()}get hasChildren(){return!!(this.getField("hasChildren")||this.children&&this.children.length>0)}get isCollapsed(){return!this.isExpanded}get isLeaf(){return!this.hasChildren}get isRoot(){return this.parent.data.virtual}get realParent(){return this.isRoot?null:this.parent}get options(){return this.treeModel.options}fireEvent(n){this.treeModel.fireEvent(n)}get displayField(){return this.getField("display")}get id(){return this.getField("id")}set id(n){this.setField("id",n)}getField(n){return this.data[this.options[`${n}Field`]]}setField(n,e){this.data[this.options[`${n}Field`]]=e}_findAdjacentSibling(n,e=!1){let t=this._getParentsChildren(e),o=t.indexOf(this);return t.length>o+n?t[o+n]:null}findNextSibling(n=!1){return this._findAdjacentSibling(1,n)}findPreviousSibling(n=!1){return this._findAdjacentSibling(-1,n)}getVisibleChildren(){return this.visibleChildren}get visibleChildren(){return(this.children||[]).filter(n=>!n.isHidden)}getFirstChild(n=!1){let e=n?this.visibleChildren:this.children;return e!=null&&e.length?e[0]:null}getLastChild(n=!1){let e=n?this.visibleChildren:this.children;return e!=null&&e.length?e[e.length-1]:null}findNextNode(n=!0,e=!1){return n&&this.isExpanded&&this.getFirstChild(e)||this.findNextSibling(e)||this.parent&&this.parent.findNextNode(!1,e)}findPreviousNode(n=!1){let e=this.findPreviousSibling(n);return e?e._getLastOpenDescendant(n):this.realParent}_getLastOpenDescendant(n=!1){let e=this.getLastChild(n);return this.isCollapsed||!e?this:e._getLastOpenDescendant(n)}_getParentsChildren(n=!1){return this.parent&&(n?this.parent.getVisibleChildren():this.parent.children)||[]}getIndexInParent(n=!1){return this._getParentsChildren(n).indexOf(this)}isDescendantOf(n){return this===n?!0:this.parent&&this.parent.isDescendantOf(n)}getNodePadding(){return this.options.levelPadding*(this.level-1)+"px"}getClass(){return[this.options.nodeClass(this),`tree-node-level-${this.level}`].join(" ")}onDrop(n){this.mouseAction("drop",n.event,{from:n.element,to:{parent:this,index:0,dropOnNode:!0}})}allowDrag(){return this.options.allowDrag(this)}loadNodeChildren(){return this.options.getChildren?Promise.resolve(this.options.getChildren(this)).then(n=>{n&&(this.setField("children",n),this._initChildren(),this.options.useTriState&&this.treeModel.isSelected(this)&&this.setIsSelected(!0),this.children.forEach(e=>{e.getField("isExpanded")&&e.hasChildren&&e.expand()}))}).then(()=>{this.fireEvent({eventName:Oe.loadNodeChildren,node:this})}):Promise.resolve()}expand(){return this.isExpanded||this.toggleExpanded(),this}collapse(){return this.isExpanded&&this.toggleExpanded(),this}doForAll(n){Promise.resolve(n(this)).then(()=>{this.children&&this.children.forEach(e=>e.doForAll(n))})}expandAll(){this.doForAll(n=>n.expand())}collapseAll(){this.doForAll(n=>n.collapse())}ensureVisible(){return this.realParent&&(this.realParent.expand(),this.realParent.ensureVisible()),this}toggleExpanded(){return this.setIsExpanded(!this.isExpanded),this}setIsExpanded(n){return this.hasChildren&&(this.treeModel.setExpandedNode(this,n),n&&!this.children&&this.hasChildren&&!this._isLoadingChildren&&(this._isLoadingChildren=!0,this.loadNodeChildren().finally(()=>{this._isLoadingChildren=!1}))),this}autoLoadChildren(){this.isExpanded&&!this.children&&this.hasChildren&&this.loadNodeChildren()}dispose(){this.children&&this.children.forEach(n=>n.dispose()),this.parent=null,this.children=null}setIsActive(n,e=!1){return this.treeModel.setActiveNode(this,n,e),n&&this.focus(this.options.scrollOnActivate),this}isSelectable(){return this.isLeaf||!this.children||!this.options.useTriState}setIsSelected(n){return this.isSelectable()?this.treeModel.setSelectedNode(this,n):this.visibleChildren.forEach(e=>e.setIsSelected(n)),this}toggleSelected(){return this.setIsSelected(!this.isSelected),this}toggleActivated(n=!1){return this.setIsActive(!this.isActive,n),this}setActiveAndVisible(n=!1){return this.setIsActive(!0,n).ensureVisible(),setTimeout(this.scrollIntoView.bind(this)),this}scrollIntoView(n=!1){this.treeModel.virtualScroll.scrollIntoView(this,n)}focus(n=!0){let e=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(this),n&&this.scrollIntoView(),e&&this.fireEvent({eventName:Oe.blur,node:e}),this.fireEvent({eventName:Oe.focus,node:this}),this}blur(){let n=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(null),n&&this.fireEvent({eventName:Oe.blur,node:this}),this}setIsHidden(n){this.treeModel.setIsHidden(this,n)}hide(){this.setIsHidden(!0)}show(){this.setIsHidden(!1)}mouseAction(n,e,t=null){this.treeModel.setFocus(!0);let r=this.options.actionMapping.mouse[n];r&&r(this.treeModel,this,e,t)}getSelfHeight(){return this.options.nodeHeight(this)}_initChildren(){this.children=this.getField("children").map((n,e)=>new i(n,this,this.treeModel,e))}};function m_(){return Math.floor(Math.random()*1e13)}var ts=(()=>{let n=class n{constructor(){this.options=new Yr,this.eventNames=Object.keys(Oe),this._roots=it(void 0),this._expandedNodeIds=it({}),this._selectedLeafNodeIds=it({}),this._activeNodeIds=it({}),this._hiddenNodeIds=it({}),this._focusedNodeId=it(null),this._virtualRoot=it(void 0),this.firstUpdate=!0,this.subscriptions=[]}get roots(){return this._roots()}set roots(t){this._roots.set(t)}get virtualRoot(){return this._virtualRoot()}get focusedNode(){let t=this._focusedNodeId();return t?this.getNodeById(t):null}get expandedNodes(){let t=this._expandedNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get activeNodes(){let t=this._activeNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get hiddenNodes(){let t=this._hiddenNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get selectedLeafNodes(){let t=this._selectedLeafNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}fireEvent(t){t.treeModel=this,this.events[t.eventName].emit(t),this.events.event.emit(t)}subscribe(t,o){let r=this.events[t].subscribe(o);this.subscriptions.push(r)}getFocusedNode(){return this.focusedNode}getActiveNode(){return this.activeNodes[0]}getActiveNodes(){return this.activeNodes}getVisibleRoots(){return this._virtualRoot()?.visibleChildren}getFirstRoot(t=!1){let o=t?this.getVisibleRoots():this.roots;return o!=null&&o.length?o[0]:null}getLastRoot(t=!1){let o=t?this.getVisibleRoots():this.roots;return o!=null&&o.length?o[o.length-1]:null}get isFocused(){return n.focusedTree===this}isNodeFocused(t){return this.focusedNode===t}isEmptyTree(){let t=this.roots;return t&&t.length===0}getNodeByPath(t,o=null){if(!t)return null;if(o=o||this._virtualRoot(),t.length===0)return o;if(!o.children)return null;let r=t.shift(),p=o.children.find(u=>u.id===r);return p?this.getNodeByPath(t,p):null}getNodeById(t){let o=t.toString();return this.getNodeBy(r=>r.id.toString()===o)}getNodeBy(t,o=null){if(o=o||this._virtualRoot(),!o.children)return null;let r=o.children.find(t);if(r)return r;for(let p of o.children){let u=this.getNodeBy(t,p);if(u)return u}}isExpanded(t){return this._expandedNodeIds()[t.id]}isHidden(t){return this._hiddenNodeIds()[t.id]}isActive(t){return this._activeNodeIds()[t.id]}isSelected(t){return this._selectedLeafNodeIds()[t.id]}ngOnDestroy(){this.dispose(),this.unsubscribeAll()}dispose(){let t=this._virtualRoot();t&&t.dispose()}unsubscribeAll(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}setData({nodes:t,options:o=null,events:r=null}){o&&(this.options=new Yr(o)),r&&(this.events=r),t&&(this.nodes=t),this.update()}update(){let t={id:this.options.rootId,virtual:!0,[this.options.childrenField]:this.nodes};this.dispose();let o=new es(t,null,this,0);this._virtualRoot.set(o),this.roots=o.children;let r=this.roots;this.firstUpdate?r&&(this.firstUpdate=!1,this._calculateExpandedNodes()):this.fireEvent({eventName:Oe.updateData})}setFocusedNode(t){this._focusedNodeId.set(t?t.id:null)}setFocus(t){n.focusedTree=t?this:null}doForAll(t){this.roots.forEach(o=>o.doForAll(t))}focusNextNode(){let t=this.getFocusedNode(),o=t?t.findNextNode(!0,!0):this.getFirstRoot(!0);o&&o.focus()}focusPreviousNode(){let t=this.getFocusedNode(),o=t?t.findPreviousNode(!0):this.getLastRoot(!0);o&&o.focus()}focusDrillDown(){let t=this.getFocusedNode();if(t&&t.isCollapsed&&t.hasChildren)t.toggleExpanded();else{let o=t?t.getFirstChild(!0):this.getFirstRoot(!0);o&&o.focus()}}focusDrillUp(){let t=this.getFocusedNode();if(t)if(t.isExpanded)t.toggleExpanded();else{let o=t.realParent;o&&o.focus()}}setActiveNode(t,o,r=!1){r?this._setActiveNodeMulti(t,o):this._setActiveNodeSingle(t,o),o?(t.focus(this.options.scrollOnActivate),this.fireEvent({eventName:Oe.activate,node:t}),this.fireEvent({eventName:Oe.nodeActivate,node:t})):(this.fireEvent({eventName:Oe.deactivate,node:t}),this.fireEvent({eventName:Oe.nodeDeactivate,node:t}))}setSelectedNode(t,o){this._selectedLeafNodeIds.update(r=>Se(re({},r),{[t.id]:o})),o?(t.focus(),this.fireEvent({eventName:Oe.select,node:t})):this.fireEvent({eventName:Oe.deselect,node:t})}setExpandedNode(t,o){this._expandedNodeIds.update(r=>Se(re({},r),{[t.id]:o})),this.fireEvent({eventName:Oe.toggleExpanded,node:t,isExpanded:o})}expandAll(){this.roots.forEach(t=>t.expandAll())}collapseAll(){this.roots.forEach(t=>t.collapseAll())}setIsHidden(t,o){this._hiddenNodeIds.update(r=>Se(re({},r),{[t.id]:o}))}setHiddenNodeIds(t){let o=t.reduce((r,p)=>Se(re({},r),{[p]:!0}),{});this._hiddenNodeIds.set(o)}performKeyAction(t,o){let r=this.options.actionMapping.keys[o.keyCode];return r?(o.preventDefault(),r(this,t,o),!0):!1}filterNodes(t,o=!0){let r;if(!t)return this.clearFilter();if(t&&typeof t.valueOf()=="string")r=u=>u.displayField.toLowerCase().indexOf(t.toLowerCase())!==-1;else if(t&&typeof t=="function")r=t;else{console.error("Don't know what to do with filter",t),console.error("Should be either a string or function");return}let p={};this.roots.forEach(u=>this._filterNode(p,u,r,o)),this._hiddenNodeIds.set(p),this.fireEvent({eventName:Oe.changeFilter})}clearFilter(){this._hiddenNodeIds.set({}),this.fireEvent({eventName:Oe.changeFilter})}moveNode(t,o){let r=t.getIndexInParent(),p=t.parent;if(!this.canMoveNode(t,o,r))return;let u=p.getField("children");o.parent.getField("children")||o.parent.setField("children",[]);let v=o.parent.getField("children"),T=u.splice(r,1)[0],N=p===o.parent&&o.index>r?o.index-1:o.index;v.splice(N,0,T),p.treeModel.update(),o.parent.treeModel!==p.treeModel&&o.parent.treeModel.update(),this.fireEvent({eventName:Oe.moveNode,node:T,to:{parent:o.parent.data,index:N},from:{parent:p.data,index:r}})}copyNode(t,o){let r=t.getIndexInParent();if(!this.canMoveNode(t,o,r))return;o.parent.getField("children")||o.parent.setField("children",[]);let p=o.parent.getField("children"),u=this.options.getNodeClone(t);p.splice(o.index,0,u),t.treeModel.update(),o.parent.treeModel!==t.treeModel&&o.parent.treeModel.update(),this.fireEvent({eventName:Oe.copyNode,node:u,to:{parent:o.parent.data,index:o.index}})}getState(){return{expandedNodeIds:this._expandedNodeIds(),selectedLeafNodeIds:this._selectedLeafNodeIds(),activeNodeIds:this._activeNodeIds(),hiddenNodeIds:this._hiddenNodeIds(),focusedNodeId:this._focusedNodeId()}}setState(t){t&&(this._expandedNodeIds.set(t.expandedNodeIds||{}),this._selectedLeafNodeIds.set(t.selectedLeafNodeIds||{}),this._activeNodeIds.set(t.activeNodeIds||{}),this._hiddenNodeIds.set(t.hiddenNodeIds||{}),this._focusedNodeId.set(t.focusedNodeId))}subscribeToState(t){$t(()=>t(this.getState()))}canMoveNode(t,o,r=void 0){let p=r||t.getIndexInParent();return t.parent===o.parent&&r===o.index?!1:!o.parent.isDescendantOf(t)}calculateExpandedNodes(){this._calculateExpandedNodes()}_filterNode(t,o,r,p){let u=r(o);return o.children&&o.children.forEach(v=>{this._filterNode(t,v,r,p)&&(u=!0)}),u||(t[o.id]=!0),p&&u&&o.ensureVisible(),u}_calculateExpandedNodes(t=null){t=t||this._virtualRoot(),t.data[this.options.isExpandedField]&&this._expandedNodeIds.update(o=>Se(re({},o),{[t.id]:!0})),t.children&&t.children.forEach(o=>this._calculateExpandedNodes(o))}_setActiveNodeSingle(t,o){this.activeNodes.filter(r=>r!==t).forEach(r=>{this.fireEvent({eventName:Oe.deactivate,node:r}),this.fireEvent({eventName:Oe.nodeDeactivate,node:r})}),o?this._activeNodeIds.set({[t.id]:!0}):this._activeNodeIds.set({})}_setActiveNodeMulti(t,o){this._activeNodeIds.update(r=>Se(re({},r),{[t.id]:o}))}};n.focusedTree=null,n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac});let i=n;return i})(),is=(()=>{let n=class n{constructor(){this._draggedElement=null}set(t){this._draggedElement=t}get(){return this._draggedElement}isDragging(){return!!this.get()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),pd=500,qr=150,dd=(()=>{let n=class n{get yBlocks(){return this._yBlocks()}set yBlocks(t){this._yBlocks.set(t)}get x(){return this._x()}set x(t){this._x.set(t)}get viewportHeight(){return this._viewportHeight()}set viewportHeight(t){this._viewportHeight.set(t)}get y(){return this.yBlocks*qr}get totalHeight(){let t=this.treeModel._virtualRoot();return t?t.height:0}constructor(){this.treeModel=S(ts),this._dispose=[],this._yBlocks=it(0),this._x=it(0),this._viewportHeight=it(null),this.viewport=null;let t=this.treeModel;t.virtualScroll=this}fireEvent(t){this.treeModel.fireEvent(t)}init(){let t=this.recalcPositions.bind(this);t(),this.treeModel.subscribe(Oe.loadNodeChildren,t)}setupWatchers(t){let o=this.recalcPositions.bind(this),r=$t(()=>{let T=this._yBlocks(),N=this.totalHeight,V=this._viewportHeight();this.fixScroll()},{injector:t}),p=$t(()=>{let T=this.treeModel.roots;o()},{injector:t}),u=$t(()=>{let T=this.treeModel.expandedNodes;o()},{injector:t}),v=$t(()=>{let T=this.treeModel.hiddenNodes;o()},{injector:t});this._dispose=[()=>r.destroy(),()=>p.destroy(),()=>u.destroy(),()=>v.destroy()]}isEnabled(){return this.treeModel.options.useVirtualScroll}_setYBlocks(t){this.yBlocks=t}recalcPositions(){let t=this.treeModel._virtualRoot();t&&(t.height=this._getPositionAfter(this.treeModel.getVisibleRoots(),0))}_getPositionAfter(t,o){let r=o;return t.forEach(p=>{p.position=r,r=this._getPositionAfterNode(p,r)}),r}_getPositionAfterNode(t,o){let r=t.getSelfHeight()+o;return t.children&&t.isExpanded&&(r=this._getPositionAfter(t.visibleChildren,r)),t.height=r-o,r}clear(){this._dispose.forEach(t=>t())}setViewport(t){Object.assign(this,{viewport:t,x:t.scrollLeft,yBlocks:Math.round(t.scrollTop/qr),viewportHeight:t.getBoundingClientRect?t.getBoundingClientRect().height:0})}scrollIntoView(t,o,r=!0){if(t.options.scrollContainer){let p=t.options.scrollContainer,u=p.getBoundingClientRect().height,v=p.getBoundingClientRect().top,T=this.viewport.getBoundingClientRect().top+t.position-v;(o||T<p.scrollTop||T+t.getSelfHeight()>p.scrollTop+u)&&(p.scrollTop=r?T-u/2:T)}else(o||t.position<this.y||t.position+t.getSelfHeight()>this.y+this.viewportHeight)&&this.viewport&&(this.viewport.scrollTop=r?t.position-this.viewportHeight/2:t.position,this._setYBlocks(Math.floor(this.viewport.scrollTop/qr)))}getViewportNodes(t){if(!t)return[];let o=t.filter(T=>!T.isHidden);if(!this.isEnabled())return o;if(!this.viewportHeight||!o.length)return[];let r=o.slice(-1)[0];if(!r.height&&r.position===0)return[];let p=md(o,T=>T.position+pd>this.y||T.position+T.height>this.y),u=md(o,T=>T.position-pd>this.y+this.viewportHeight,p),v=[];for(let T=p;T<=u;T++)v.push(o[T]);return v}fixScroll(){let t=Math.max(0,this.totalHeight-this.viewportHeight);this.y<0&&this._setYBlocks(0),this.y>t&&this._setYBlocks(t/qr)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac});let i=n;return i})();function md(i,n,e=0){let t=e,o=i.length-1;for(;t!==o;){let r=Math.floor((t+o)/2);n(i[r])?o=r:t===r?t=o:t=r}return t}var u_=(()=>{let n=class n{constructor(){this.template=se(void 0),this.node=se(void 0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-loading-component"]],inputs:{template:[1,"template"],node:[1,"node"]},decls:2,vars:5,consts:[[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(o,r){o&1&&(C(0,Gu,2,0,"span"),Ie(1,0)),o&2&&(x(r.template()?-1:0),s(),m("ngTemplateOutlet",r.template())("ngTemplateOutletContext",Ne(3,zu,r.node())))},dependencies:[zt],encapsulation:2});let i=n;return i})(),__=(()=>{let n=class n{constructor(){this.elementRef=S(Ci),this.virtualScroll=S(dd),this.injector=S(Gn),this.setViewport=this.throttle(()=>{this.virtualScroll.setViewport(this.elementRef.nativeElement)},17),this.scrollEventHandler=this.setViewport.bind(this)}ngOnInit(){this.virtualScroll.init(),this.virtualScroll.setupWatchers(this.injector)}ngAfterViewInit(){setTimeout(()=>{this.setViewport(),this.virtualScroll.fireEvent({eventName:Oe.initialized})}),this.elementRef.nativeElement.addEventListener("scroll",this.scrollEventHandler)}ngOnDestroy(){this.virtualScroll.clear(),this.elementRef.nativeElement.removeEventListener("scroll",this.scrollEventHandler)}getTotalHeight(){return this.virtualScroll.isEnabled()&&this.virtualScroll.totalHeight+"px"||"auto"}throttle(t,o){let r=0;return function(){let p=Date.now();p-r>=o&&(t(),r=p)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-viewport"]],features:[ha([dd])],ngContentSelectors:Wu,decls:2,vars:2,template:function(o,r){o&1&&(bs(),Gi(0,"div"),ws(1),Wi()),o&2&&B("height",r.getTotalHeight())},encapsulation:2});let i=n;return i})(),ud="is-dragging-over",_d="is-dragging-over-disabled",gd=(()=>{let n=class n{allowDrop(t){return this._allowDrop(this.treeDraggedElement.get(),t)}constructor(){this.el=S(Ci),this.renderer=S(pt),this.treeDraggedElement=S(is),this.ngZone=S(zi),this.allowDragoverStyling=se(!0),this.treeAllowDrop=se(void 0),this.onDropCallback=qn({alias:"treeDrop"}),this.onDragOverCallback=qn({alias:"treeDropDragOver"}),this.onDragLeaveCallback=qn({alias:"treeDropDragLeave"}),this.onDragEnterCallback=qn({alias:"treeDropDragEnter"}),this._allowDrop=(t,o)=>!0,this.dragOverEventHandler=this.onDragOver.bind(this),this.dragEnterEventHandler=this.onDragEnter.bind(this),this.dragLeaveEventHandler=this.onDragLeave.bind(this),$t(()=>{let t=this.treeAllowDrop();t instanceof Function?this._allowDrop=t:t!==void 0&&(this._allowDrop=(o,r)=>t)})}ngAfterViewInit(){let t=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{t.addEventListener("dragover",this.dragOverEventHandler),t.addEventListener("dragenter",this.dragEnterEventHandler),t.addEventListener("dragleave",this.dragLeaveEventHandler)})}ngOnDestroy(){let t=this.el.nativeElement;t.removeEventListener("dragover",this.dragOverEventHandler),t.removeEventListener("dragenter",this.dragEnterEventHandler),t.removeEventListener("dragleave",this.dragLeaveEventHandler)}onDragOver(t){if(!this.allowDrop(t))return this.allowDragoverStyling()?this.addDisabledClass():void 0;this.onDragOverCallback.emit({event:t,element:this.treeDraggedElement.get()}),t.preventDefault(),this.allowDragoverStyling()&&this.addClass()}onDragEnter(t){this.allowDrop(t)&&(t.preventDefault(),this.onDragEnterCallback.emit({event:t,element:this.treeDraggedElement.get()}))}onDragLeave(t){if(!this.allowDrop(t))return this.allowDragoverStyling()?this.removeDisabledClass():void 0;this.onDragLeaveCallback.emit({event:t,element:this.treeDraggedElement.get()}),this.allowDragoverStyling()&&this.removeClass()}onDrop(t){this.allowDrop(t)&&(t.preventDefault(),this.onDropCallback.emit({event:t,element:this.treeDraggedElement.get()}),this.allowDragoverStyling()&&this.removeClass(),this.treeDraggedElement.set(null))}addClass(){this.renderer.addClass(this.el.nativeElement,ud)}removeClass(){this.renderer.removeClass(this.el.nativeElement,ud)}addDisabledClass(){this.renderer.addClass(this.el.nativeElement,_d)}removeDisabledClass(){this.renderer.removeClass(this.el.nativeElement,_d)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","treeDrop",""]],hostBindings:function(o,r){o&1&&f("drop",function(u){return r.onDrop(u)})},inputs:{allowDragoverStyling:[1,"allowDragoverStyling"],treeAllowDrop:[1,"treeAllowDrop"]},outputs:{onDropCallback:"treeDrop",onDragOverCallback:"treeDropDragOver",onDragLeaveCallback:"treeDropDragLeave",onDragEnterCallback:"treeDropDragEnter"}});let i=n;return i})(),Cd=(()=>{let n=class n{constructor(){this.node=se(void 0),this.dropIndex=se(void 0)}onDrop(t){this.node().mouseAction("drop",t.event,{from:t.element,to:{parent:this.node(),index:this.dropIndex()}})}allowDrop(t,o){return this.node().options.allowDrop(t,{parent:this.node(),index:this.dropIndex()},o)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["TreeNodeDropSlot"],["tree-node-drop-slot"]],inputs:{node:[1,"node"],dropIndex:[1,"dropIndex"]},decls:1,vars:2,consts:[[1,"node-drop-slot",3,"treeDrop","treeAllowDrop","allowDragoverStyling"]],template:function(o,r){o&1&&(a(0,"div",0),f("treeDrop",function(u){return r.onDrop(u)}),l()),o&2&&m("treeAllowDrop",r.allowDrop.bind(r))("allowDragoverStyling",!0)},dependencies:[gd],encapsulation:2});let i=n;return i})(),f_=(()=>{let n=class n{constructor(){this.node=se(void 0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-checkbox"]],inputs:{node:[1,"node"]},decls:1,vars:2,consts:[["type","checkbox",1,"tree-node-checkbox",3,"click","checked","indeterminate"]],template:function(o,r){o&1&&(Gi(0,"input",0),jn("click",function(u){return r.node().mouseAction("checkboxClick",u)}),Wi()),o&2&&Do("checked",r.node().isSelected)("indeterminate",r.node().isPartiallySelected)},encapsulation:2});let i=n;return i})(),ns=(()=>{let n=class n{constructor(){this.node=se(),this.hasChildren=ve(()=>this.node().hasChildren)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-expander"]],inputs:{node:[1,"node"]},decls:2,vars:2,consts:[[1,"toggle-children-wrapper",3,"toggle-children-wrapper-expanded","toggle-children-wrapper-collapsed"],[1,"toggle-children-placeholder"],[1,"toggle-children-wrapper",3,"click"],[1,"toggle-children"]],template:function(o,r){o&1&&(C(0,ju,2,4,"span",0),C(1,Ku,1,0,"span",1)),o&2&&(x(r.hasChildren()?0:-1),s(),x(r.hasChildren()?-1:1))},encapsulation:2});let i=n;return i})();var h_=(()=>{let n=class n{constructor(){this.el=S(Ci),this.renderer=S(pt),this.treeDraggedElement=S(is),this.ngZone=S(zi),this.draggedElement=se(void 0,{alias:"treeDrag"}),this.treeDragEnabled=se(void 0),this.dragEventHandler=this.onDrag.bind(this)}ngAfterViewInit(){let t=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{t.addEventListener("drag",this.dragEventHandler)})}ngDoCheck(){this.renderer.setAttribute(this.el.nativeElement,"draggable",this.treeDragEnabled()?"true":"false")}ngOnDestroy(){this.el.nativeElement.removeEventListener("drag",this.dragEventHandler)}onDragStart(t){t.dataTransfer.setData("text",t.target.id);let o=this.draggedElement();this.treeDraggedElement.set(o),o.mouseAction&&o.mouseAction("dragStart",t)}onDrag(t){let o=this.draggedElement();o.mouseAction&&o.mouseAction("drag",t)}onDragEnd(){let t=this.draggedElement();t.mouseAction&&t.mouseAction("dragEnd"),this.treeDraggedElement.set(null)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","treeDrag",""]],hostBindings:function(o,r){o&1&&f("dragstart",function(u){return r.onDragStart(u)})("dragend",function(){return r.onDragEnd()})},inputs:{draggedElement:[1,"treeDrag","draggedElement"],treeDragEnabled:[1,"treeDragEnabled"]}});let i=n;return i})(),os=(()=>{let n=class n{constructor(){this.node=se(void 0),this.index=se(void 0),this.template=se(void 0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-content"]],inputs:{node:[1,"node"],index:[1,"index"],template:[1,"template"]},decls:2,vars:7,consts:[[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(o,r){o&1&&(C(0,qu,2,1,"span"),Ie(1,0)),o&2&&(x(r.template()?-1:0),s(),m("ngTemplateOutlet",r.template())("ngTemplateOutletContext",Ds(3,Qu,r.node(),r.node(),r.index())))},dependencies:[zt],encapsulation:2});let i=n;return i})(),g_=(()=>{let n=class n{constructor(){this.node=se(),this.index=se(void 0),this.templates=se(),this.treeNodeWrapperTemplate=ve(()=>this.templates().treeNodeWrapperTemplate)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-wrapper"]],inputs:{node:[1,"node"],index:[1,"index"],templates:[1,"templates"]},decls:2,vars:8,consts:[[1,"node-wrapper",3,"padding-left"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"node-wrapper"],[3,"node"],[1,"node-content-wrapper",3,"click","dblclick","mouseover","mouseout","contextmenu","treeDrop","treeDropDragOver","treeDropDragLeave","treeDropDragEnter","treeAllowDrop","allowDragoverStyling","treeDrag","treeDragEnabled"],[3,"node","index","template"]],template:function(o,r){o&1&&(C(0,Xu,5,15,"div",0),Ie(1,1)),o&2&&(x(r.treeNodeWrapperTemplate()?-1:0),s(),m("ngTemplateOutlet",r.treeNodeWrapperTemplate())("ngTemplateOutletContext",ko(3,hd,r.node(),r.node(),r.index(),r.templates())))},dependencies:[f_,ns,h_,gd,os,zt],encapsulation:2});let i=n;return i})(),fd=1.005,C_=(()=>{let n=class n{constructor(){this.renderer=S(pt),this.templateRef=S(Ss),this.viewContainerRef=S(ys),this.isOpen=se(void 0,{alias:"treeAnimateOpen"}),this.animateSpeed=se(void 0,{alias:"treeAnimateOpenSpeed"}),this.animateAcceleration=se(void 0,{alias:"treeAnimateOpenAcceleration"}),this.isEnabled=se(void 0,{alias:"treeAnimateOpenEnabled"}),$t(()=>{let t=this.isOpen();t?(this._show(),this.isEnabled()&&this.previousIsOpen===!1&&this._animateOpen()):this.isEnabled()?this._animateClose():this._hide(),this.previousIsOpen=!!t})}_show(){this.innerElement||(this.innerElement=this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0])}_hide(){this.viewContainerRef.clear(),this.innerElement=null}_animateOpen(){let t=this.animateSpeed(),o=this.animateAcceleration(),r=0;this.renderer.setStyle(this.innerElement,"max-height","0"),setTimeout(()=>{let p=setInterval(()=>{if(!this.isOpen()||!this.innerElement)return clearInterval(p);r+=t;let u=Math.round(r);this.renderer.setStyle(this.innerElement,"max-height",`${u}px`);let v=this.innerElement.getBoundingClientRect?this.innerElement.getBoundingClientRect().height:0;t*=o,o*=fd,v<u&&(this.renderer.setStyle(this.innerElement,"max-height",null),clearInterval(p))},17)})}_animateClose(){if(!this.innerElement)return;let t=this.animateSpeed(),o=this.animateAcceleration(),r=this.innerElement.getBoundingClientRect().height,p=setInterval(()=>{if(this.isOpen()||!this.innerElement)return clearInterval(p);r-=t,this.renderer.setStyle(this.innerElement,"max-height",`${r}px`),t*=o,o*=fd,r<=0&&(this.viewContainerRef.clear(),this.innerElement=null,clearInterval(p))},17)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","treeAnimateOpen",""]],inputs:{isOpen:[1,"treeAnimateOpen","isOpen"],animateSpeed:[1,"treeAnimateOpenSpeed","animateSpeed"],animateAcceleration:[1,"treeAnimateOpenAcceleration","animateAcceleration"],isEnabled:[1,"treeAnimateOpenEnabled","isEnabled"]}});let i=n;return i})(),x_=(()=>{let n=class n{constructor(){this.node=se(),this.templates=se(void 0),this.children=ve(()=>this.node().children)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-children"]],inputs:{node:[1,"node"],templates:[1,"templates"]},decls:1,vars:4,consts:[[3,"tree-children","tree-children-no-padding",4,"treeAnimateOpen","treeAnimateOpenSpeed","treeAnimateOpenAcceleration","treeAnimateOpenEnabled"],[3,"nodes","templates","treeModel"],[1,"tree-node-loading",3,"padding-left","template","node"],[1,"tree-node-loading",3,"template","node"]],template:function(o,r){o&1&&R(0,e_,3,6,"div",0),o&2&&m("treeAnimateOpen",r.node().isExpanded)("treeAnimateOpenSpeed",r.node().options.animateSpeed)("treeAnimateOpenAcceleration",r.node().options.animateAcceleration)("treeAnimateOpenEnabled",r.node().options.animateExpand)},dependencies:()=>[C_,xd,u_],encapsulation:2});let i=n;return i})(),xd=(()=>{let n=class n{constructor(){this.nodes=se(void 0),this.treeModel=se(void 0),this.injector=S(Gn),this.templates=se(void 0),this.viewportNodes=it([]),this.marginTop=ve(()=>{let t=this.viewportNodes(),o=t&&t.length&&t[0];return`${o&&o.parent?o.position-o.parent.position-o.parent.getSelfHeight():0}px`}),this._disposeEffects=[]}ngOnInit(){this.virtualScroll=this.treeModel().virtualScroll;let t=$t(()=>{let o=this.nodes();if(o&&this.virtualScroll){let r=this.virtualScroll.getViewportNodes(o);this.viewportNodes.set(r)}},{injector:this.injector});this._disposeEffects=[()=>t.destroy()]}ngOnDestroy(){this._disposeEffects.forEach(t=>t())}trackNode(t,o){return o.id}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-collection"]],inputs:{nodes:[1,"nodes"],treeModel:[1,"treeModel"],templates:[1,"templates"]},decls:3,vars:2,consts:[[3,"node","index","templates"]],template:function(o,r){o&1&&(a(0,"div"),k(1,t_,1,3,"tree-node",0,r.trackNode,!0),l()),o&2&&(B("margin-top",r.marginTop()),s(),M(r.viewportNodes()))},dependencies:()=>[S_],encapsulation:2});let i=n;return i})(),S_=(()=>{let n=class n{constructor(){this.node=se(void 0),this.index=se(void 0),this.templates=se(),this.treeNodeFullTemplate=ve(()=>this.templates().treeNodeFullTemplate)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["TreeNode"],["tree-node"]],inputs:{node:[1,"node"],index:[1,"index"],templates:[1,"templates"]},decls:2,vars:8,consts:[[3,"class","tree-node","tree-node-expanded","tree-node-collapsed","tree-node-leaf","tree-node-active","tree-node-focused"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"dropIndex","node"],[3,"node","index","templates"],[3,"node","templates"]],template:function(o,r){o&1&&(C(0,n_,5,22,"div",0),Ie(1,1)),o&2&&(x(r.treeNodeFullTemplate()?-1:0),s(),m("ngTemplateOutlet",r.treeNodeFullTemplate())("ngTemplateOutletContext",ko(3,hd,r.node(),r.node(),r.index(),r.templates())))},dependencies:[Cd,g_,x_,zt],encapsulation:2});let i=n;return i})(),Sd=(()=>{let n=class n{set nodes(t){}set options(t){}set focused(t){this.treeModel.setFocus(t)}set state(t){this.treeModel.setState(t)}constructor(){this.treeModel=S(ts),this.treeDraggedElement=S(is);let t=this.treeModel;t.eventNames.forEach(o=>this[o]=new ae),t.subscribeToState(o=>this.stateChange.emit(o))}onKeydown(t){if(!this.treeModel.isFocused||["input","textarea"].includes(document.activeElement.tagName.toLowerCase()))return;let o=this.treeModel.getFocusedNode();this.treeModel.performKeyAction(o,t)}onMousedown(t){function o(r,p){return r?r.localName===p?!1:o(r.parentElement,p):!0}o(t.target,"tree-root")&&this.treeModel.setFocus(!1)}ngOnChanges(t){(t.options||t.nodes)&&this.treeModel.setData({options:t.options&&t.options.currentValue,nodes:t.nodes&&t.nodes.currentValue,events:this.pick(this,this.treeModel.eventNames)})}sizeChanged(){this.viewportComponent.setViewport()}pick(t,o){return o.reduce((r,p)=>(t&&t.hasOwnProperty(p)&&(r[p]=t[p]),r),{})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["Tree"],["tree-root"]],contentQueries:function(o,r,p){if(o&1&&(Kn(p,o_,5),Kn(p,r_,5),Kn(p,a_,5),Kn(p,s_,5)),o&2){let u;W(u=j())&&(r.loadingTemplate=u.first),W(u=j())&&(r.treeNodeTemplate=u.first),W(u=j())&&(r.treeNodeWrapperTemplate=u.first),W(u=j())&&(r.treeNodeFullTemplate=u.first)}},viewQuery:function(o,r){if(o&1&&Y(l_,5),o&2){let p;W(p=j())&&(r.viewportComponent=p.first)}},hostBindings:function(o,r){o&1&&f("keydown",function(u){return r.onKeydown(u)},ma)("mousedown",function(u){return r.onMousedown(u)},ma)},inputs:{nodes:"nodes",options:"options",focused:"focused",state:"state"},outputs:{toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",updateData:"updateData",initialized:"initialized",moveNode:"moveNode",copyNode:"copyNode",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",event:"event",stateChange:"stateChange"},features:[ha([ts]),rn],decls:5,vars:6,consts:[["viewport",""],[1,"angular-tree-component"],[3,"nodes","treeModel","templates",4,"ngIf"],["class","empty-tree-drop-slot",3,"dropIndex","node",4,"ngIf"],[3,"nodes","treeModel","templates"],[1,"empty-tree-drop-slot",3,"dropIndex","node"]],template:function(o,r){o&1&&(a(0,"tree-viewport",null,0)(2,"div",1),R(3,p_,1,8,"tree-node-collection",2)(4,d_,1,2,"tree-node-drop-slot",3),l()()),o&2&&(s(2),O("node-dragging",r.treeDraggedElement.isDragging())("angular-tree-component-rtl",r.treeModel.options.rtl),s(),m("ngIf",r.treeModel.roots),s(),m("ngIf",r.treeModel.isEmptyTree()))},dependencies:[__,Is,xd,Cd],encapsulation:2});let i=n;return i})(),vd=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=ua({type:n}),n.\u0275inj=pa({imports:[Rs]});let i=n;return i})();var y_=["tree"];function b_(i,n){if(i&1&&(a(0,"span",8),d(1),l()),i&2){let e=c(2);s(),w(e.errorMsg)}}function w_(i,n){i&1&&(a(0,"span",9),d(1,"Navigation Tree"),l())}function T_(i,n){if(i&1){let e=y();a(0,"div",3)(1,"button",6),f("click",function(){h(e);let o=c();return g(o.onRefresh())}),_(2,"fa-icon",7),l(),C(3,b_,2,1,"span",8)(4,w_,2,0,"span",9),l()}if(i&2){let e=c();s(2),m("icon",e.icons.faArrowRotateRight),s(),x(e.errorMsg?3:4)}}function E_(i,n){if(i&1&&(a(0,"span")(1,"span"),d(2),l()()),i&2){let e=c(2);s(2),w(e.store.filesSelection()[0].name)}}function A_(i,n){if(i&1&&(a(0,"span"),_(1,"fa-icon",18),l()),i&2){let e=c(2);s(),m("icon",e.icons.faQuestion)}}function D_(i,n){if(i&1&&(a(0,"span")(1,"span"),d(2),l(),d(3,"\xA0"),a(4,"span",9),d(5,"items"),l()()),i&2){let e=c(2);s(2),w(e.store.filesSelection().length)}}function k_(i,n){if(i&1){let e=y();a(0,"div",10)(1,"div",11)(2,"span",12)(3,"span",9),d(4,"Source"),l(),d(5,":"),l(),C(6,E_,3,1,"span")(7,A_,2,1,"span")(8,D_,6,1,"span"),l(),a(9,"div",13)(10,"span",12)(11,"span",9),d(12,"Destination"),l(),d(13,":"),l(),a(14,"span"),d(15),l()(),a(16,"div",14)(17,"button",15),f("click",function(){h(e);let o=c();return g(o.actionMove())}),_(18,"fa-icon",7),d(19," Move "),l(),a(20,"button",15),f("click",function(){h(e);let o=c();return g(o.actionCopy())}),_(21,"fa-icon",7),d(22," Copy "),l(),a(23,"button",16),f("click",function(){h(e);let o=c();return g(o.actionCancel())}),_(24,"fa-icon",7),d(25," Cancel "),l()()(),_(26,"hr",17)}if(i&2){let e,t=c();s(6),x((e=t.store.filesSelection().length)===1?6:e===0?7:8),s(9),w((t.selection==null?null:t.selection.data.name)||""),s(2),m("disabled",!t.selection||!t.store.filesSelection().length||!t.srcAllowed||!t.dstAllowed),s(),m("icon",t.icons.faArrowsAlt),s(2),m("disabled",!t.selection||!t.store.filesSelection().length||!t.dstAllowed),s(),m("icon",t.icons.faClone),s(3),m("icon",t.icons.faTimes)}}function M_(i,n){if(i&1){let e=y();a(0,"div",19),f("click",function(o){let r=h(e).$implicit;return g(r.mouseAction("click",o))})("appTap",function(o){let r=h(e).$implicit;return g(r.mouseAction("dblClick",o))}),_(1,"tree-node-expander",20),a(2,"div",21),_(3,"tree-node-content",22),l()()}if(i&2){let e=n.index,t=n.$implicit;B("padding-left",t.getNodePadding()),O("tree-selected",t.isActive)("tree-disabled",!t.data.enabled),s(),O("toggle-children-file",!t.data.isDir)("toggle-children-shared",t.data.inShare),m("node",t),s(),O("node-content-wrapper-active",t.isActive),s(),m("index",e)("node",t)}}function F_(i,n){if(i&1&&(a(0,"span"),_(1,"fa-icon",23),l()),i&2){let e=c();s(),m("icon",e.icons.faSpinner)}}var Xr=(()=>{let n=class n{constructor(){this.selected=new ae,this.showFiles=!1,this.allowShares=!0,this.allowSpaces=!0,this.enableCopyMove=!0,this.enableNavigateTo=!0,this.sideBarHeader=!0,this.resizeOffset=80,this.toggleNodesAtStartup=!1,this.store=S(te),this.icons={faArrowRotateRight:ut,faArrowsAlt:ti,faClone:gn,faTimes:Rt,faFolder:yl,faFile:Mn,faQuestion:No,faAnglesRight:Rl,faSpinner:Ue},this.options={actionMapping:{mouse:{click:(t,o,r)=>this.onSelect(t,o,r),dblClick:(t,o)=>this.onOpen(o),expanderClick:()=>null}},animateExpand:!1,levelPadding:10,useVirtualScroll:!1,nodeHeight:30,dropSlotHeight:0,allowDrag:!1,allowDrop:!1,getChildren:t=>this.getTreeNode(t)},this.srcAllowed=!0,this.dstAllowed=!0,this.errorMsg=null,this.layout=S(I),this.router=S(Ce),this.user=S(oe),this.filesService=S(He),this.copyMoveOnHeight=80,this.subscriptions=[],this.preventDblClick=!1,this._copyMoveOn=!1,this.enableCopyMove&&this.subscriptions.push(di(this.store.filesSelection).subscribe(()=>this.checkAllowed(this.selection)))}get copyMoveOn(){return this._copyMoveOn}set copyMoveOn(t){this._copyMoveOn!==t&&(this._copyMoveOn=t,t?this.resizeOffset+=this.copyMoveOnHeight:this.resizeOffset-=this.copyMoveOnHeight,setTimeout(()=>this.layout.resizeEvent.next(),0))}get selection(){return this.filesService.treeNodeSelected}set selection(t){this.filesService.treeNodeSelected=t,t&&([0,-1,-2].indexOf(t.data.id)===-1?this.selected.emit(t.data):this.selected.emit(null))}ngOnInit(){this.enableCopyMove&&this.subscriptions.push(this.filesService.treeCopyMoveOn.subscribe(()=>this.onCopyMove())),this.initRoot(),setTimeout(()=>this.focusLastNode(),100)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onRefresh(){this.tree.treeModel.activeNodes.length?this.tree.treeModel.activeNodes.forEach(t=>{t.loadNodeChildren().then(()=>this.tree.treeModel.update())}):(this.user.userHavePermission(ft.PERSONAL_SPACE)&&this.tree.treeModel.getNodeById(0).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.user.userHavePermission(ft.SPACES)&&this.tree.treeModel.getNodeById(-1).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.allowShares&&this.user.userHavePermission(ft.SHARES)&&this.tree.treeModel.getNodeById(-2).loadNodeChildren().then(()=>this.tree.treeModel.update()))}actionCancel(){this.copyMoveOn=!1,this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}actionCopy(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,Le.COPY),this.copyMoveOn=!1}actionMove(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,Le.MOVE),this.copyMoveOn=!1}initRoot(){if(this.nodes=[],this.user.userHavePermission(ft.PERSONAL_SPACE)){let t={id:0,name:this.layout.translateString(Bt.PERSONAL_FILES),path:`${z.FILES}/${ht.PERSONAL}`,isDir:!0,inShare:!1,mime:ri,quotaIsExceeded:this.store.user.getValue().quotaIsExceeded,enabled:!0,permissions:Yl,children:null,hasChildren:!0,isExpanded:!1};this.checkToggleNodeAtStartup(t,!0)}if(this.allowSpaces&&this.user.userHavePermission(ft.SPACES)){let t={id:-1,name:this.layout.translateString(Bt.SPACES),path:z.SPACES,isDir:!0,mime:ri,inShare:!1,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(t)}if(this.allowShares&&this.user.userHavePermission(ft.SHARES)){let t={id:-2,name:this.layout.translateString(Bt.SHARES),path:z.SHARES,isDir:!0,mime:ri,inShare:!0,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(t)}}checkToggleNodeAtStartup(t,o=!1){this.toggleNodesAtStartup?this.getTreeNode(t).then(r=>{t.children=r,o?this.nodes.unshift(t):this.nodes.push(t),this.tree.treeModel.update(),this.toggleExpand(this.tree,this.tree.treeModel.getNodeById(t.id),null)}):(o?this.nodes.unshift(t):this.nodes.push(t),this.tree.treeModel.update())}focusLastNode(){this.selection&&(this.selection=this.tree.treeModel.getNodeById(this.selection.data.id),this.selection&&Pe.ACTIVATE(this.tree,this.selection,null))}getTreeNode(t){return this.filesService.getTreeNode(t?.data?.path||t?.path||t,this.showFiles)}collapseChildren(t,o){for(let r of o)[0,-1,-2].indexOf(r.id)===-1&&r.id!==t.id&&(r.data.isExpanded=!1,r.collapse())}toggleExpand(t,o,r){Pe.TOGGLE_EXPANDED(t,o,r),o.data.isExpanded=!!o.data.isExpanded}onOpen(t){if(!this.copyMoveOn&&this.enableNavigateTo&&t.data.enabled){clearTimeout(this.preventTimer),this.preventDblClick=!0;let o=t.data.path.split("/");o[0]!==z.SPACES&&o.unshift(z.SPACES),this.router.navigate(o).catch(console.error)}}onSelect(t,o,r){if(!o.data.enabled){this.layout.sendNotification("warning",o.data.name,`${o.data.inShare?"Share":"Space"} is disabled`);return}Pe.ACTIVATE(t,o,r),this.preventTimer=setTimeout(()=>{this.checkAllowed(o),this.selection=o,this.preventDblClick||o.hasChildren&&(this.collapseChildren(o,o.parent.children),this.toggleExpand(t,o,r)),this.preventDblClick=!1},200)}checkAllowed(t){if(this.copyMoveOn){if(this.store.filesSelection().length)for(let o of this.store.filesSelection()){if(o.root?.alias){this.errorMsg="You can not move an anchored file",this.srcAllowed=!1,this.dstAllowed=!0;return}if(o.lock&&o.lock.owner.login!==this.store.user.getValue().login){this.errorMsg="You can not move a locked file",this.srcAllowed=!1,this.dstAllowed=!0;return}}if(t){if([-1,-2].indexOf(t.data.id)>-1){this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!1;return}else if(t.data.permissions.indexOf(qe.ADD)===-1){this.errorMsg="You are not allowed to write here",this.srcAllowed=!0,this.dstAllowed=!1;return}else if(t.data.quotaIsExceeded){this.errorMsg="No more space available",this.srcAllowed=!0,this.dstAllowed=!1;return}}this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}}onCopyMove(){this.onRefresh(),this.copyMoveOn=!0,this.checkAllowed(this.selection)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tree"]],viewQuery:function(o,r){if(o&1&&Y(y_,7),o&2){let p;W(p=j())&&(r.tree=p.first)}},inputs:{showFiles:"showFiles",allowShares:"allowShares",allowSpaces:"allowSpaces",enableCopyMove:"enableCopyMove",enableNavigateTo:"enableNavigateTo",sideBarHeader:"sideBarHeader",resizeOffset:"resizeOffset",toggleNodesAtStartup:"toggleNodesAtStartup"},outputs:{selected:"selected"},decls:9,vars:7,consts:[["tree",""],["treeNodeWrapperTemplate",""],["loadingTemplate",""],[1,"sidebar-component-title"],["appAutoResize","",3,"overFlowX","resizeOffset","useMaxHeight"],[3,"nodes","options"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["l10nTranslate","",1,"text-danger","fs-xxs","p-2"],["l10nTranslate",""],[1,"px-2","pt-2","pb-0","fs-xs"],[1,"text-start","text-truncate"],["l10nTranslate","",1,"fs-xs","fw-bold","me-2"],[1,"text-start","text-truncate","mt-1"],[1,"d-flex","justify-content-between","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-secondary",3,"click"],[1,"mx-0","mt-2","mb-0"],[1,"fw-bold","me-1",3,"icon"],[1,"node-wrapper",3,"click","appTap"],[3,"node"],[1,"node-content-wrapper"],[3,"index","node"],["animation","spin",1,"fw-bold",3,"icon"]],template:function(o,r){o&1&&(C(0,T_,5,2,"div",3),C(1,k_,27,7),a(2,"div",4)(3,"tree-root",5,0),R(5,M_,4,15,"ng-template",null,1,Ft)(7,F_,2,1,"ng-template",null,2,Ft),l()()),o&2&&(x(r.sideBarHeader?0:-1),s(),x(r.copyMoveOn?1:-1),s(),m("overFlowX","auto")("resizeOffset",r.resizeOffset)("useMaxHeight",!1),s(),m("nodes",r.nodes)("options",r.options))},dependencies:[ce,vd,Sd,os,ns,P,F,nt],encapsulation:2});let i=n;return i})();function P_(i,n){if(i&1&&(a(0,"span"),_(1,"fa-icon",10),d(2),b(3,"pathSlice"),l()),i&2){let e=c();s(),m("icon",e.selection.isDir?e.icons.faFolderClosed:e.icons.faFile),s(),D(" ",E(3,2,e.selection.path,-1)," ")}}function I_(i,n){i&1&&(a(0,"span",2),d(1,"Select a file"),l())}function R_(i,n){if(i&1&&(a(0,"span",7),d(1),l()),i&2){let e=c();s(),w(e.errorSelection)}}var Bn=(()=>{let n=class n{constructor(){this.currentRoots=[],this.submitEvent=new ae,this.allowSpaces=!1,this.toggleNodesAtStartup=!0,this.mustHaveShareOutsidePermission=!1,this.layout=S(I),this.icons={faFile:Mn,faFolderClosed:yr},this.errorSelection=null,this.selection=null}onSelect(t){if(t){if(this.mustHaveShareOutsidePermission){if(t.permissions.indexOf(qe.SHARE_OUTSIDE)===-1){this.errorSelection=this.layout.translateString("You do not have share permission"),this.selection=null;return}if(t.path.split("/").length<=2){this.errorSelection=this.layout.translateString("You can not share a space"),this.selection=null;return}}let o=t,r=this.currentRoots.find(p=>p.file.id===o.id);r?(this.errorSelection=this.layout.translateString("This item is already selected"),this.selection=null):(r=this.currentRoots.find(p=>o.path.startsWith(p.file.path)),r?(this.errorSelection=`${this.layout.translateString("Parent item is already selected")}: ${r.file.path}`,this.selection=null):(this.errorSelection=null,this.selection=o))}else this.selection=null,this.errorSelection=null}onSubmit(){this.submitEvent.emit({id:this.selection.id,name:this.selection.name,path:this.selection.path,mime:this.selection.mime,permissions:this.selection.permissions}),this.layout.closeDialog()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tree-dialog"]],inputs:{currentRoots:"currentRoots",allowSpaces:"allowSpaces",toggleNodesAtStartup:"toggleNodesAtStartup",mustHaveShareOutsidePermission:"mustHaveShareOutsidePermission"},outputs:{submitEvent:"submitEvent"},decls:13,vars:11,consts:[[1,"modal-header"],[1,"modal-title"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","py-2","px-0"],[3,"selected","enableNavigateTo","enableCopyMove","showFiles","allowShares","allowSpaces","sideBarHeader","toggleNodesAtStartup","resizeOffset"],[1,"modal-footer"],[1,"me-auto","fs-sm","text-danger","text-truncate"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],[3,"icon"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),C(2,P_,4,5,"span")(3,I_,2,0,"span",2),l(),a(4,"button",3),f("click",function(){return r.layout.closeDialog()}),l()(),a(5,"div",4)(6,"app-files-tree",5),f("selected",function(u){return r.onSelect(u)}),l()(),a(7,"div",6),C(8,R_,2,1,"span",7),a(9,"button",8),f("click",function(){return r.layout.closeDialog()}),d(10,"Cancel"),l(),a(11,"button",9),f("click",function(){return r.onSubmit()}),d(12,"Confirm"),l()()),o&2&&(s(2),x(r.selection?2:3),s(4),m("enableNavigateTo",!1)("enableCopyMove",!1)("showFiles",!0)("allowShares",!1)("allowSpaces",r.allowSpaces)("sideBarHeader",!1)("toggleNodesAtStartup",r.toggleNodesAtStartup)("resizeOffset",200),s(2),x(r.errorSelection?8:-1),s(3),m("disabled",!r.selection))},dependencies:[P,Xr,F,Qr],encapsulation:2});let i=n;return i})();function N_(i,n){if(i&1){let e=y();a(0,"input",12),b(1,"translate"),f("ngModelChange",function(o){h(e);let r=c();return g(r.checkInput(o,!0))}),l()}if(i&2){let e=c();O("is-invalid",!e.rootNameIsValid),m("ngModel",e.newSpaceRoot.name)("placeholder",E(1,4,"Name",e.locale.language))}}function V_(i,n){if(i&1&&(a(0,"span",9),d(1),l()),i&2){let e=c();s(),w(e.error)}}function L_(i,n){if(i&1){let e=y();a(0,"button",13),f("click",function(){h(e);let o=c();return g(o.onSubmit())}),d(1,"Confirm"),l()}}function O_(i,n){if(i&1){let e=y();a(0,"button",14),f("click",function(){h(e);let o=c();return g(o.onValidRoot())}),d(1,"Check the location"),l()}}var Zr=(()=>{let n=class n{constructor(){this.currentRoots=[],this.submitEvent=new ae,this.withRootName=!0,this.locale=S($),this.layout=S(I),this.icons={faFolderClosed:nr},this.newSpaceRoot={name:"",externalPath:""},this.rootNameIsValid=!1,this.rootPathIsValid=!1,this.rootIsValid=!1,this.spacesService=S(ot)}ngOnInit(){this.withRootName||(this.rootNameIsValid=!0)}keyEnter(){this.rootIsValid?this.onSubmit():this.onValidRoot()}onValidRoot(){if(this.withRootName&&!this.newSpaceRoot.name||!this.newSpaceRoot.externalPath){this.error="Name and location are required";return}this.newSpaceRoot.externalPath[0]!=="/"&&(this.newSpaceRoot.externalPath="/"+this.newSpaceRoot.externalPath);for(let t of this.currentRoots){let o=t.externalPath[t.externalPath.length-1]==="/"?t.externalPath:`${t.externalPath}/`;if(this.newSpaceRoot.externalPath.startsWith(o)){this.rootPathIsValid=!1,this.error="Parent location already exists in files";return}}this.spacesService.checkSpaceRootPath(this.newSpaceRoot.externalPath).subscribe({next:()=>{this.rootPathIsValid=!0,this.rootNameIsValid=!0,this.rootIsValid=!0,this.error=null},error:t=>{this.rootPathIsValid=!1,this.error=t.error.message}})}onSubmit(){this.submitEvent.emit(this.newSpaceRoot),this.layout.closeDialog()}checkInput(t,o=!1){o?(this.newSpaceRoot.name=t,this.rootNameIsValid=!!t):(this.newSpaceRoot.externalPath=t,this.rootPathIsValid=!!t),this.rootIsValid&&(this.rootIsValid=!1)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-root-path-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.keyEnter()})},inputs:{currentRoots:"currentRoots",withRootName:"withRootName"},outputs:{submitEvent:"submitEvent"},decls:14,vars:13,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","form-validation"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-2",3,"ngModel","is-invalid","placeholder"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-4",3,"ngModelChange","autoFocus","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-sm","text-danger","text-truncate"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-2",3,"ngModelChange","ngModel","placeholder"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Add an external location"),l()(),a(5,"button",4),f("click",function(){return r.layout.closeDialog()}),l()(),a(6,"div",5),C(7,N_,2,7,"input",6),a(8,"input",7),b(9,"translate"),f("ngModelChange",function(u){return r.checkInput(u)}),l()(),a(10,"div",8),C(11,V_,2,1,"span",9),C(12,L_,2,0,"button",10)(13,O_,2,0,"button",11),l()),o&2&&(s(2),m("icon",r.icons.faFolderClosed),s(5),x(r.withRootName?7:-1),s(),O("is-invalid",!r.rootPathIsValid),m("placeholder",X("",E(9,10,"Location",r.locale.language),": /home/sync-in/data"))("autoFocus",!r.withRootName)("ngModel",r.newSpaceRoot.externalPath),s(3),x(r.error?11:-1),s(),x(r.rootIsValid?12:13))},dependencies:[F,P,be,je,xe,ei,ye,Ye,Z],encapsulation:2});let i=n;return i})();var yd=(()=>{let n=class n{constructor(){this.locale=S($)}ngOnInit(){this.setFilePath()}ngOnChanges(){this.setFilePath()}setFilePath(){let t=this.share.file?bn(this.share.file.name,-1):"";t?this.fileName=t:this.share.parent?.id?this.fileName=this.share.parent.name:this.share instanceof oo&&this.share.externalPath&&(this.fileName=this.share.externalPath)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-file-name"]],inputs:{share:"share"},features:[rn],decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],["draggable","false","height","30","width","30","alt","",3,"error","src"],[1,"d-flex","flex-column","overflow-wrap-and-whitespace","ms-2"]],template:function(o,r){o&1&&(Gi(0,"div",0)(1,"img",1),jn("error",function(){return r.share.fallBackMimeUrl()}),Wi(),Gi(2,"div",2),d(3),Wi()()),o&2&&(s(),Do("src",r.share.mimeUrl,ee),s(2),D(" ",r.fileName," "))},encapsulation:2});let i=n;return i})();function U_(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c();s(),w(e.share.name)}}function H_(i,n){i&1&&(a(0,"span",3),d(1,"Create a new share"),l())}function $_(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function z_(i,n){i&1&&(a(0,"h4",5)(1,"span",3),d(2,"Edit share"),l()())}function G_(i,n){if(i&1&&(_(0,"fa-icon",40),a(1,"span",41),d(2,"Settings"),l()),i&2){let e=c();m("icon",e.icons.faCog)}}function W_(i,n){if(i&1&&(a(0,"div",44)(1,"label",45),d(2,"Storage Usage"),l(),_(3,"app-storage-usage",46),l()),i&2){let e=c(2);s(3),m("item",e.share)}}function j_(i,n){if(i&1){let e=y();a(0,"div",42)(1,"app-storage-quota",43),ue("quotaChange",function(o){h(e);let r=c();return me(r.share.storageQuota,o)||(r.share.storageQuota=o),g(o)}),l()(),C(2,W_,4,1,"div",44)}if(i&2){let e=c();s(),de("quota",e.share.storageQuota),m("fullWidth",!0),s(),x(e.share.storageUsage?2:-1)}}function K_(i,n){if(i&1){let e=y();a(0,"div")(1,"label",47),d(2,"Full-text search"),l(),a(3,"div",22)(4,"input",48),ue("ngModelChange",function(o){h(e);let r=c();return me(r.share.storageIndexing,o)||(r.share.storageIndexing=o),g(o)}),l(),a(5,"label",49),d(6),l()()()}if(i&2){let e=c();s(4),de("ngModel",e.share.storageIndexing),s(2),D(" ",e.share.storageIndexing?"enabled":"disabled"," ")}}function Q_(i,n){if(i&1&&(a(0,"div",15)(1,"label",50),d(2,"File"),l(),_(3,"app-share-file-name",51),l()),i&2){let e=c();s(3),m("share",e.share)}}function q_(i,n){if(i&1&&(a(0,"div",58)(1,"label",59),d(2,"Deactivation date"),l(),a(3,"div",60),d(4),b(5,"amDateFormat"),l()()),i&2){let e=c(2);s(4),w(G(5,1,e.share.disabledAt))}}function Y_(i,n){if(i&1&&(a(0,"div",32)(1,"div",52)(2,"label",53),d(3,"Creation date"),l(),a(4,"div",54),d(5),b(6,"amDateFormat"),l()(),a(7,"div",55)(8,"label",56),d(9,"Modification date"),l(),a(10,"div",57),d(11),b(12,"amDateFormat"),l()(),C(13,q_,6,3,"div",58),l()),i&2){let e=c();s(5),w(G(6,3,e.share.createdAt)),s(6),w(G(12,5,e.share.modifiedAt)),s(2),x(e.share.disabledAt&&!e.share.enabled?13:-1)}}function X_(i,n){if(i&1&&(_(0,"fa-icon",40),a(1,"span",61),d(2,"Members"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.faUsers),s(4),D("(",e.share.members.length,")")}}function Z_(i,n){if(i&1&&(_(0,"fa-icon",40),a(1,"span",61),d(2,"Links"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.LINKS),s(4),D("(",e.share.links.length,")")}}function J_(i,n){if(i&1){let e=y();a(0,"button",63),f("click",function(){h(e);let o=c(2);return g(o.confirmDeletion=!0)}),d(1," Remove "),l()}if(i&2){let e=c(2);m("disabled",e.confirmDeletion)}}function ef(i,n){if(i&1){let e=y();a(0,"button",66),f("click",function(){h(e);let o=c(3);return g(o.openAdminRootDialog())}),_(1,"fa-icon",40),d(2," External location "),l()}if(i&2){let e=c(3);s(),m("icon",e.icons.faUserShield)}}function tf(i,n){if(i&1){let e=y();a(0,"button",64),f("click",function(){h(e);let o=c(2);return g(o.openSelectRootDialog())}),_(1,"fa-icon",40)(2,"fa-icon",40),d(3," File "),l(),C(4,ef,3,1,"button",65)}if(i&2){let e=c(2);s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.SHARES),s(2),x(e.user.isAdmin?4:-1)}}function nf(i,n){if(i&1&&C(0,J_,2,1,"button",62)(1,tf,5,3),i&2){let e=c();x(e.share.id?0:e.allowFilesOptions?1:-1)}}function of(i,n){if(i&1){let e=y();a(0,"button",64),f("click",function(){h(e);let o=c();return g(o.openCreateLinkDialog())}),_(1,"fa-icon",40)(2,"fa-icon",40),d(3," Link "),l()}if(i&2){let e=c();s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.LINKS)}}var tn=(()=>{let n=class n{constructor(){this.parentShareId=null,this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.allowFilesOptions=!0,this.shareChange=new ae,this.locale=S($),this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,SHARES:ie.SHARES,LINKS:ie.LINKS,faPlus:Qe,faSpinner:Ue,faUserShield:Wo,faUsers:Go,faCog:Ei},this.allowedPermissions=[],this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=S(oe),this.user=this.userService.user,this.sharesService=S(si),this.linksService=S(li),this.spacesService=S(ot)}ngOnInit(){this.share||([this.share,this.parentShareId]=this.sharesService.initShareFromFile(this.user,this.file,this.isSharesRepo,this.inSharesList)),this.allowedPermissions=Object.keys(this.share.hPerms)}searchMembers(t){let o={search:t,ignoreUserIds:[this.user.id,...this.share.parent?.ownerId?[this.share.parent.ownerId]:[],...this.share.members.filter(r=>r.isUser).map(r=>r.id)],ignoreGroupIds:this.share.members.filter(r=>r.isGroup).map(r=>r.id)};return this.userService.searchMembers(o,[qe.SHARE_INSIDE])}openSelectRootDialog(){this.layout.openDialog(Bn,"xl",{initialState:{toggleNodesAtStartup:!1,allowSpaces:!0,mustHaveShareOutsidePermission:!0}}).content.submitEvent.pipe(pe(1)).subscribe(o=>{let r=o.path.split("/"),p={id:o.id,name:o.name,path:bn(o.path,2),permissions:o.permissions,mime:o.mime,ownerId:r[1]===ht.PERSONAL?this.user.id:null,inTrash:!1,isDir:o.mime===ri,space:{alias:r[1],name:r[1],root:{alias:"",name:""}}},u=Se(re({},this.share),{file:p,externalPath:null});u.name=u.file.name,this.share=new oo(u),this.allowedPermissions=Object.keys(this.share.hPerms)})}openAdminRootDialog(){this.layout.openDialog(Zr,null,{initialState:{withRootName:!1}}).content.submitEvent.pipe(pe(1)).subscribe(o=>{let r=Se(re({},this.share),{file:null,externalPath:o.externalPath,name:o.externalPath.split("/").at(-1)});this.share=new oo(r),this.allowedPermissions=Object.keys(this.share.hPerms)})}openEditLinkDialog(t){this.linksService.editLinkDialog(t,this.share,pr.SHARE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.share)}cantSubmit(){return this.submitted||!this.share.externalPath&&!this.share.file}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.parentShareId?this.sharesService.deleteShareChild(this.parentShareId,this.share.id):this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.loading=!1,this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:o=>{this.onError(),this.layout.sendNotification("error","Delete share",this.share.name,o)}}):this.share.id===0?this.sharesService.createShare(this.share).subscribe({next:t=>{this.loading=!1,this.share=t,this.shareChange.emit(["add",t]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Create share",this.share.name,t)}}):(this.parentShareId?this.sharesService.updateShareChild(this.parentShareId,this.share.id,this.share):this.parentSpaceId?this.spacesService.updateSpaceShare(this.parentSpaceId,this.share):this.sharesService.updateShare(this.share)).subscribe({next:o=>{this.loading=!1,this.share=o,this.shareChange.emit(["update",o]),this.layout.closeDialog()},error:o=>{this.onError(),this.layout.sendNotification("error","Edit share",this.share.name,o)}})}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-dialog"]],inputs:{share:"share",file:"file",parentShareId:"parentShareId",parentSpaceId:"parentSpaceId",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList",allowFilesOptions:"allowFilesOptions"},outputs:{shareChange:"shareChange"},decls:61,vars:41,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"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[2,"max-width","80%"],[1,"mb-3","px-0"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-between"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"col-6"],[1,"mb-3"],["for","from","l10nTranslate",""],["id","from",3,"share","showFullPath"],["for","permissions","l10nTranslate",""],[1,"d-flex"],["id","permissions",3,"permissions","replaceEmptyPermissions"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","filterPermissions","allowedPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],[1,"d-flex","flex-column","align-items-start","mb-3"],[1,"w-100",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],["for","switchFullText","l10nTranslate",""],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],["for","shareFilePath","l10nTranslate","",1,"no-select"],["id","shareFilePath",3,"share"],[1,"d-flex","flex-column","align-items-start","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],[1,"d-flex","flex-column","align-items-end","col-4","text-danger","px-0"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,U_,2,1,"span")(4,H_,2,0,"span",3),C(5,$_,1,1,"fa-icon",4),l(),C(6,z_,3,0,"h4",5),a(7,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),a(8,"div",7)(9,"tabset",8),_(10,"hr",9),a(11,"tab",10),f("selectTab",function(){return r.tabView=null}),R(12,G_,3,1,"ng-template",11),a(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),d(18," Share name "),l(),a(19,"input",17),ue("ngModelChange",function(u){return me(r.share.name,u)||(r.share.name=u),u}),l()(),a(20,"div",15)(21,"label",18),d(22," Description "),l(),a(23,"input",19),ue("ngModelChange",function(u){return me(r.share.description,u)||(r.share.description=u),u}),l()(),C(24,j_,3,3),a(25,"div",20)(26,"div")(27,"label",21),d(28,"Share status"),l(),a(29,"div",22)(30,"input",23),ue("ngModelChange",function(u){return me(r.share.enabled,u)||(r.share.enabled=u),u}),l(),a(31,"label",24),d(32),l()()(),C(33,K_,7,2,"div"),l()()(),a(34,"div",25),C(35,Q_,4,1,"div",15),a(36,"div",26)(37,"label",27),d(38,"Shared from"),l(),_(39,"app-share-repository",28),l(),a(40,"div",26)(41,"label",29),d(42,"File permissions"),l(),a(43,"div",30),_(44,"app-file-permissions",31),l()(),C(45,Y_,14,7,"div",32),l()()(),a(46,"tab",33),f("selectTab",function(){return r.tabView="members"}),R(47,X_,5,2,"ng-template",11),a(48,"div",9)(49,"app-user-search",34),ue("membersChange",function(u){return me(r.share.members,u)||(r.share.members=u),u}),l()()(),a(50,"tab",33),f("selectTab",function(){return r.tabView="links"}),R(51,Z_,5,2,"ng-template",11),a(52,"div",9)(53,"app-user-search",35),ue("membersChange",function(u){return me(r.share.links,u)||(r.share.links=u),u}),l()()()()(),a(54,"div",36),C(55,nf,2,1),C(56,of,4,2,"button",37),a(57,"button",38),f("click",function(){return r.onCancel()}),d(58,"Cancel"),l(),a(59,"button",39),f("click",function(){return r.onSubmit()}),d(60),l()()),o&2&&(s(2),m("icon",r.icons.SHARED),s(),x(r.share.id?3:4),s(2),x(r.loading?5:-1),s(),x(r.share.id?6:-1),s(),L(X("btn-close btn-close-white ",r.share.id?"ms-2":"ms-auto"," ms-2")),s(2),m("justified",!0),s(10),L(X("form-control form-control-sm ",r.share.name?"":"is-invalid")),de("ngModel",r.share.name),s(4),de("ngModel",r.share.description),s(),x(r.share.externalPath?24:-1),s(6),de("ngModel",r.share.enabled),s(2),D(" ",r.share.enabled?"enabled":"disabled"," "),s(),x(r.share.externalPath?33:-1),s(2),x(r.share.file!=null&&r.share.file.name||r.share.externalPath?35:-1),s(4),m("share",r.share)("showFullPath",!0),s(5),m("permissions",r.share.hPerms)("replaceEmptyPermissions",!0),s(),x(r.share!=null&&r.share.id?45:-1),s(4),de("members",r.share.members),m("withPermissions",!0)("filterPermissions",!0)("allowedPermissions",r.allowedPermissions)("searchFunction",r.searchMembers.bind(r)),s(4),de("members",r.share.links),m("filterPermissions",!0)("allowedPermissions",r.allowedPermissions)("withPermissions",!0)("editFunction",r.openEditLinkDialog.bind(r))("hideInput",!0),s(2),x(r.tabView?-1:55),s(),x(r.tabView==="links"?56:-1),s(3),L(X("btn btn-sm ",r.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",r.cantSubmit()),s(),D(" ",r.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[F,P,hr,_r,ur,fr,Ye,wi,je,Pt,xe,ei,be,ye,An,ai,yd,vt,gr,En,Fe],encapsulation:2});let i=n;return i})();var Jr=class{constructor(n){this.isShareLink=!1,Object.assign(this,n),this.owner.avatarUrl=wn(this.owner.login),this.isShareLink=this.type===no.LINK,this.setMimeUrl()}fallBackMimeUrl(){this.mimeUrl=Sr}setMimeUrl(){!this.file||this.file.mime===ri?this.mimeUrl=io(Dc):this.mimeUrl=io(this.file.mime)}};var bd=i=>({$implicit:i}),rf=(i,n)=>n.id;function af(i,n){if(i&1&&_(0,"fa-icon",17),i&2){let e=c(3);m("icon",e.icons.LINKS)}}function sf(i,n){i&1&&Ie(0)}function lf(i,n){if(i&1&&(a(0,"ul"),R(1,sf,1,0,"ng-container",10),l()),i&2){let e=c().$implicit;c(2);let t=Be(15);s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(2,bd,e.children))}}function cf(i,n){if(i&1){let e=y();a(0,"li")(1,"div",14),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("dblclick",function(){h(e);let o=c(2);return g(o.openChildShare())}),a(2,"div",15)(3,"img",16),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),C(4,af,1,1,"fa-icon",17),a(5,"span",18),d(6),l()(),a(7,"div",19)(8,"span",20),d(9),l(),_(10,"app-user-avatar",21),l()(),C(11,lf,2,4,"ul"),l()}if(i&2){let e=n.$implicit,t=c(2);s(),O("selected",t.selected&&t.selected.id===e.id),s(2),m("src",e.mimeUrl,ee),s(),x(e.isShareLink?4:-1),s(2),w(e.name),s(3),w(e.owner.fullName),s(),m("user",e.owner)("height",26)("width",26),s(),x((e.children==null?null:e.children.length)>0?11:-1)}}function pf(i,n){if(i&1&&k(0,cf,12,10,"li",null,rf),i&2){let e=n.$implicit,t=c();M(t.toShares(e))}}function df(i,n){i&1&&Ie(0)}var Li=(()=>{let n=class n{constructor(){this.fromAdmin=!1,this.sharesCountEvent=new ae,this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,LINKS:ie.LINKS},this.loading=!1,this.childSharesLength=0,this.sharesService=S(si),this.linksService=S(li),this.spacesService=S(ot)}ngOnInit(){this.loadChildShares()}toShares(t){return t}loadChildShares(){this.loading=!0;let t;if(this.share)t=this.sharesService.listChildShares(this.share.id);else if(this.space)t=this.spacesService.listSpaceShares(this.space.id);else{console.error("share or space not defined");return}t.subscribe({next:o=>{this.childSharesLength=o.length,this.sharesCountEvent.emit(o.length),this.setShares(o.map(r=>new Jr(r))),this.loading=!1},error:o=>{this.childShares=[],this.childSharesLength=0,this.loading=!1,this.layout.sendNotification("error","Child shares",o.error.message)}})}onSelect(t){this.selected=t}openChildShare(){if(this.selected.isShareLink){let t;if(this.share)t=this.linksService.shareLinkChild(this.share.id,this.selected.id);else if(this.space)t=this.spacesService.getSpaceShareLink(this.space.id,this.selected.id);else{console.error("share or space not defined");return}t.subscribe({next:o=>{this.layout.openDialog(Fn,"md",{initialState:{share:o}}).content.shareChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="update"?this.selected.name=v.name:this.loadChildShares()})},error:o=>this.layout.sendNotification("error","Edit children shares",this.selected.name,o)})}else{let t;if(this.share)t=this.sharesService.getShareChild(this.share.id,this.selected.id);else if(this.space)t=this.spacesService.getSpaceShare(this.space.id,this.selected.id);else{console.error("share or space not defined");return}t.subscribe({next:o=>{this.layout.openDialog(tn,"lg",{initialState:Se(re(re({},this.share?{parentShareId:this.share.id}:{}),this.space?{parentSpaceId:this.space.id}:{}),{share:o})}).content.shareChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="update"?(this.selected.name=v.name,this.selected.alias=v.alias):this.loadChildShares()})},error:o=>this.layout.sendNotification("error","Edit children shares",this.selected.name,o)})}}setShares(t){let o={id:this.share?.id||0,children:[]};this.recurseChildrenShares(t,o),this.childShares=o.children}recurseChildrenShares(t,o){for(let r of t)r.parentId===o.id?(o.children=o.children??[],o.children.push(r),this.recurseChildrenShares(t,r)):o.id===0&&!r.parentId&&(o.children=o.children??[],o.children.push(r),this.recurseChildrenShares(t,r))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared-children-dialog"]],inputs:{fromAdmin:"fromAdmin",share:"share",space:"space"},outputs:{sharesCountEvent:"sharesCountEvent"},decls:22,vars:9,consts:[["recursiveList",""],[1,"modal-header","align-items-center"],[1,"modal-title","w-100"],[1,"d-flex"],[1,"me-2",3,"icon"],[1,"ms-auto","me-2"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],["appAutoResize","",1,"modal-body",2,"padding-right","24px",3,"resizeOffset"],[1,"tree"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"modal-footer"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["data-dismiss","modal","l10nTranslate","","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"app-div-hovered",3,"click","dblclick"],[1,"me-auto","text-truncate"],["alt","","draggable","false","height","28",3,"error","src"],[1,"align-middle","ms-1",3,"icon"],[1,"ms-1","align-middle"],[1,"d-flex","align-items-center"],[1,"fs-xxxs","me-2"],["tooltipPlacement","top","container","body",3,"user","height","width"]],template:function(o,r){if(o&1){let p=y();a(0,"div",1)(1,"h4",2)(2,"div",3)(3,"div"),_(4,"fa-icon",4),a(5,"span"),d(6),l()(),a(7,"div",5)(8,"span",6),d(9,"Child shares"),l(),d(10),l()()(),a(11,"button",7),f("click",function(){return h(p),g(r.layout.closeDialog())}),l()(),a(12,"div",8)(13,"ul",9),R(14,pf,2,0,"ng-template",null,0,Ft)(16,df,1,0,"ng-container",10),l()(),a(17,"div",11)(18,"button",12),f("click",function(){return h(p),g(r.openChildShare())}),d(19,"Edit"),l(),a(20,"button",13),f("click",function(){return h(p),g(r.layout.closeDialog())}),d(21,"Close"),l()()}if(o&2){let p=Be(15);s(4),m("icon",r.icons.SHARED),s(2),w((r.share==null?null:r.share.name)||(r.space==null?null:r.space.name)),s(4),D("\xA0(",r.childSharesLength,") "),s(2),m("resizeOffset",170),s(4),m("ngTemplateOutlet",p)("ngTemplateOutletContext",Ne(7,bd,r.childShares)),s(2),m("disabled",!r.selected)}},dependencies:[ce,zt,P,F,Ze],styles:[`ul.tree[_ngcontent-%COMP%], ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-left:18px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0;padding:0;line-height:30px;border-left:1px solid rgb(100,100,100);white-space:nowrap}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:inline-flex;width:100%;cursor:pointer;border-radius:4px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-left:none}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{position:relative;top:-.3em;height:1.2rem;width:1rem;color:#fff;border-bottom:1px solid rgb(100,100,100);content:"";display:inline-block}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child:before{border-left:1px solid rgb(100,100,100)}
4
4
 
@@ -6,6 +6,6 @@ import{a as Gc}from"./chunk-KPOQLDWF.js";import{a as kn,b as no,c as ai,d as $c,
6
6
 
7
7
 
8
8
 
9
- `]});let i=n;return i})();var mf=["MainContextMenu"],uf=["TargetContextMenu"],_f=()=>["shares"],wd=(i,n)=>n.id,Td=(i,n)=>n.key;function ff(i,n){if(i&1&&(a(0,"span",31),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function hf(i,n){if(i&1){let e=y();a(0,"div",32),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",33),a(2,"span"),d(3),l()()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SHARED),s(2),w(e.counts.shares)}}function gf(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openShareDialog())}),a(1,"div",22)(2,"img",23),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"span",24),C(4,ff,2,3,"span",25),l(),C(5,hf,4,4,"div",26),a(6,"span",27),_(7,"app-share-repository",28),l()(),a(8,"div",29)(9,"span",30),d(10),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),s(),Zt("rowIndex",t),s(),m("src",e.mimeUrl,ee)("height",o.galleryMode.image)("width",o.galleryMode.image),s(2),x(e.newly?4:-1),s(),x(e.counts.shares?5:-1),s(2),m("share",e)("galleryMode",o.galleryMode),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.name)}}function Cf(i,n){if(i&1){let e=y();a(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",19),k(4,gf,11,19,"div",20,wd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function xf(i,n){if(i&1&&_(0,"fa-icon",6),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function Sf(i,n){if(i&1){let e=y();a(0,"th",39),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,xf,1,1,"fa-icon",6),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function vf(i,n){if(i&1&&C(0,Sf,3,10,"th",38),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function yf(i,n){if(i&1){let e=y();a(0,"div",42)(1,"img",44),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),a(2,"div",45)(3,"span",30),d(4),l(),a(5,"span",46),d(6),l()()()}if(i&2){let e=c(3).$implicit;s(),m("src",e.mimeUrl,ee),s(3),w(e.name),s(2),w(e.description)}}function bf(i,n){if(i&1&&_(0,"app-share-repository",43),i&2){let e=c(3).$implicit;m("share",e)}}function wf(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(3).$implicit;s(),w(E(2,1,e.counts,Tt(4,_f)))}}function Tf(i,n){if(i&1){let e=y();a(0,"span",49),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",33),a(2,"span"),d(3),l()()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SHARED),s(2),w(e.counts.shares)}}function Ef(i,n){if(i&1){let e=y();a(0,"span",50),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.goToComments(o))}),_(1,"fa-icon",6),l()}if(i&2){let e=c(6);s(),m("icon",e.icons.faCommentDots)}}function Af(i,n){if(i&1&&(C(0,Tf,4,2,"span",47),C(1,Ef,2,1,"span",48)),i&2){let e=c(3).$implicit;x(e.counts.shares?0:-1),s(),x(e.hasComments?1:-1)}}function Df(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function kf(i,n){if(i&1&&(a(0,"td"),C(1,yf,7,3,"div",42)(2,bf,1,1,"app-share-repository",43)(3,wf,3,5,"span")(4,Af,2,2)(5,Df,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="from"?2:e==="members"?3:e==="info"?4:e==="created"?5:-1)}}function Mf(i,n){if(i&1&&C(0,kf,6,9,"td",41),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Ff(i,n){if(i&1){let e=y();a(0,"tr",40),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openShareDialog())}),k(1,Mf,1,1,null,null,Td),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),s(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Pf(i,n){if(i&1){let e=y();a(0,"table",34)(1,"thead")(2,"tr"),k(3,vf,1,1,null,null,Td),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",35),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",34)(9,"tbody",36),k(10,Ff,4,7,"tr",37,wd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.shares,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function If(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"New share"),l()),i&2){let e=c();s(),m("icon",e.icons.faPlus)}}function Rf(i,n){}function Nf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Vf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Go to"),l()),i&2){let e=c();s(),m("icon",e.icons.faMapMarkerAlt)}}function Lf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Edit"),l()),i&2){let e=c();s(),m("icon",e.icons.faPen)}}function Of(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Edit children shares"),l()),i&2){let e=c(2);s(),m("icon",e.icons.SHARED)}}function Bf(i,n){if(i&1){let e=y();R(0,Of,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openChildShareDialog())})}}function Uf(i,n){}function Hf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var Ed=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,faArrowRotateRight:ut,faArrowDown:_t,faArrowUp:dt,faRotate:Ti,faPlus:Qe,faMinus:hn,faPen:mt,faEllipsisH:Lo,faMapMarkerAlt:ir,faCircleInfo:Nt,faCommentDots:Jo},this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},info:{label:"Info",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",created:"Created"},this.activatedRoute=S(Jt),this.store=S(te),this.sharesService=S(si),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadShares(),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${z.SHARED}/${Bt.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t.map(o=>new Kr(o))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",t.error.message)}})}sortBy(t,o=!0,r){this.shares=this.sortTable.sortBy(t,o,r||this.shares)}onSelect(t=null){this.selected=t,this.store.shareSelection.set(this.selected)}openShareDialog(t=!1){t?this.layout.openDialog(tn,"lg").content.shareChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.focusOnSelect=u.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:o=>{this.layout.openDialog(tn,"lg",{initialState:{share:o}}).content.shareChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;if(u==="update"){this.selected.name=v.name,this.selected.alias=v.alias,this.selected.description=v.description,this.selected.modifiedAt=v.modifiedAt,this.selected.enabled=v.enabled;let T={users:0,groups:0,links:v.links.length};for(let N of v.members)N.isUser?T.users++:T.groups++;this.selected.counts=re(re({},this.selected.counts),T)}else u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(T=>T.id!==v.id)))})},error:o=>this.layout.sendNotification("error","Edit share",this.selected.name,o)})}openChildShareDialog(t){t&&this.onSelect(t),this.layout.openDialog(Li,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(r=>this.selected.counts.shares=r)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}goTo(t){t=t||this.selected,this.sharesService.goTo(t).catch(console.error)}goToComments(t){this.sharesService.goTo(t).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}focusOn(t){let o=this.shares.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(mf,7),Y(uf,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadShares())}),_(3,"fa-icon",4),l(),a(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openShareDialog(!0))}),_(6,"fa-icon",6),l(),a(7,"button",7),b(8,"translate"),f("click",function(){return h(p),g(r.openShareDialog())}),_(9,"fa-icon",6),l(),a(10,"button",7),b(11,"translate"),f("click",function(){return h(p),g(r.openChildShareDialog())}),_(12,"fa-icon",6),l(),a(13,"button",7),b(14,"translate"),f("click",function(){return h(p),g(r.goTo())}),_(15,"fa-icon",6),l(),a(16,"div",8)(17,"div",9),_(18,"app-input-filter",10),l(),a(19,"app-navigation-view",11),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(20,Cf,6,8,"div",12)(21,Pf,12,8),a(22,"div",13)(23,"span",14),d(24),b(25,"translate"),l()(),a(26,"context-menu",null,0),R(28,If,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.openShareDialog(!0))}),R(29,Rf,0,0,"ng-template",16)(30,Nf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.loadShares())}),l(),a(31,"context-menu",null,1),R(33,Vf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.goTo())}),R(34,Lf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.openShareDialog())}),C(35,Bf,1,0,null,17),R(36,Uf,0,0,"ng-template",16)(37,Hf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(s(),m("tooltip",E(2,22,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),m("tooltip",E(5,25,"New share",r.locale.language)),s(2),m("icon",r.icons.faPlus),s(),m("disabled",!r.selected)("tooltip",E(8,28,"Edit share",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),m("disabled",!(r.selected!=null&&r.selected.counts.shares))("tooltip",E(11,31,"Edit children shares",r.locale.language)),s(2),m("icon",r.icons.SHARED),s(),m("disabled",!r.selected)("tooltip",E(14,34,"Go to",r.locale.language)),s(2),m("icon",r.icons.faMapMarkerAlt),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?20:21),s(4),Re("",r.shares.length," ",E(25,37,"shares",r.locale.language)),s(5),m("divider",!0),s(6),x(r.selected!=null&&r.selected.counts.shares?35:-1),s(),m("divider",!0))},dependencies:[F,P,lt,Ve,Ke,Me,Xe,Ri,Ot,Lt,Vt,ai,nt,Ee,Z,gt,oi],encapsulation:2});let i=n;return i})();var ea=(()=>{let n=class n{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new ae(!0),this.renamingInProgress=new ae(!0),this.elementRef=S(Ci),this.renderer=S(pt),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(t){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",t)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","appInputEdit",""]],hostBindings:function(o,r){o&1&&f("blur",function(){return r.onBlur()})("keyup.enter",function(){return r.onEnter()})("keyup.esc",function(){return r.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=n;return i})();var Ad=(()=>{let n=class n{constructor(){this.uploadFiles=new ae,this.elementRef=S(Ci),this.renderer=S(pt)}ngOnInit(){let t=document.createElement("input");this.renderer.setAttribute(t,"type","file"),this.renderer.setStyle(t,"display","none"),this.renderer.setStyle(t,"position","absolute"),this.elementRef.nativeElement.appendChild(t),this.eventElement=this.renderer.listen(this.elementRef.nativeElement,"click",()=>t.click()),this.options?.isMultiple&&this.renderer.setAttribute(t,"multiple","multiple"),this.options?.isDirectory&&this.renderer.setAttribute(t,"webkitdirectory","webkitdirectory"),this.eventInput=this.renderer.listen(t,"change",o=>{o.target.value&&(this.uploadFiles.next({files:o.target.files,isDirectory:this.options?.isDirectory||!1}),o.target.value="")})}ngOnDestroy(){try{this.eventElement(),this.eventInput()}catch(t){console.warn(t)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","appUploadFiles",""]],inputs:{options:"options"},outputs:{uploadFiles:"uploadFiles"}});let i=n;return i})();function zf(i,n){i&1&&(a(0,"span",3),d(1,"Compress and Save"),l())}function Gf(i,n){i&1&&(a(0,"span",3),d(1,"Compress and Download"),l())}function Wf(i,n){if(i&1){let e=y();a(0,"div",15)(1,"label",12)(2,"input",13),ue("ngModelChange",function(o){h(e);let r=c();return me(r.archiveProps.compressInDirectory,o)||(r.archiveProps.compressInDirectory=o),g(o)}),l(),a(3,"span",19),d(4,"Save in the current directory"),l()()()}if(i&2){let e=c();s(2),de("ngModel",e.archiveProps.compressInDirectory)}}var ta=(()=>{let n=class n{constructor(){this.archiveProps={name:"",files:[],compressInDirectory:!0,extension:"tar"},this.submitEvent=new ae,this.disableInDirCompression=!1,this.locale=S($),this.layout=S(I),this.compression=!1,this.icons={faFileArchive:Oo},this.submitted=!1,this.filesService=S(He)}ngOnInit(){this.disableInDirCompression&&(this.archiveProps.compressInDirectory=!1)}onEnter(){this.onSubmit()}onSubmit(){this.archiveProps.name&&!this.submitted&&(this.submitted=!0,this.filesService.compress(this.archiveProps),this.submitEvent.emit(),this.layout.closeDialog())}setCompression(t){this.archiveProps.extension=t?"tgz":"tar"}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-compression-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{archiveProps:"archiveProps"},outputs:{submitEvent:"submitEvent"},decls:29,vars:16,consts:[[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],[1,"fs-xs","ms-1"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"input-group","input-group-sm"],["appAutofocus","","type","text",1,"form-control","form-control-sm","fs-xs",3,"ngModelChange","ngModel","placeholder"],[1,"input-group-text"],[2,"min-width","40px"],[1,"form-check","mb-0","mt-2","ps-0"],[1,"form-check-label","ps-1"],["type","checkbox",3,"ngModelChange","ngModel"],["l10nTranslate","",1,"fs-xs","me-1"],[1,"form-check","mb-0","mt-1","ps-0"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["l10nTranslate","",1,"fs-xs"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,zf,2,0,"span",3)(4,Gf,2,0,"span",3),a(5,"span",4),d(6),b(7,"translate"),l()(),a(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(9,"div",6)(10,"div",7)(11,"input",8),b(12,"translate"),ue("ngModelChange",function(u){return me(r.archiveProps.name,u)||(r.archiveProps.name=u),u}),l(),a(13,"div",9)(14,"span",10),d(15),l()()(),a(16,"div",11)(17,"label",12)(18,"input",13),ue("ngModelChange",function(u){return me(r.compression,u)||(r.compression=u),u}),f("ngModelChange",function(u){return r.setCompression(u)}),l(),a(19,"span",14),d(20,"Enable compression"),l(),a(21,"small",3),d(22,"(this may take longer)"),l()()(),C(23,Wf,5,1,"div",15),l(),a(24,"div",16)(25,"button",17),f("click",function(){return r.layout.closeDialog()}),d(26,"Cancel"),l(),a(27,"button",18),f("click",function(){return r.onSubmit()}),d(28,"Confirm"),l()()),o&2&&(s(2),m("icon",r.icons.faFileArchive),s(),x(r.archiveProps.compressInDirectory?3:4),s(3),Re("(",r.archiveProps.files.length," ",E(7,10,r.archiveProps.files.length>1?"items":"item",r.locale.language),")"),s(5),de("ngModel",r.archiveProps.name),m("placeholder",E(12,13,"Archive name",r.locale.language)),s(4),D(".",r.archiveProps.extension),s(3),de("ngModel",r.compression),s(5),x(r.disableInDirCompression?-1:23),s(4),m("disabled",!r.archiveProps.name||r.submitted))},dependencies:[F,be,je,Pt,xe,ye,Ye,P,Z],encapsulation:2,changeDetection:0});let i=n;return i})();var Dd={"Microsoft Word":".docx","Microsoft Excel":".xlsx","Microsoft PowerPoint":".pptx","Open Document Text":".odt","Open Document Spreadsheet":".ods","Open Document Presentation":".odp","Rich Text Format":".rtf",Text:".txt"};var jf=["InputText"],Kf=(i,n)=>n.key;function Qf(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faGlobe)}}function qf(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFolderClosed)}}function Yf(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFileAlt)}}function Xf(i,n){if(i&1){let e=y();a(0,"li",20)(1,"a",21),f("click",function(){let o=h(e).$implicit,r=c(3);return g(r.onSelectDocType(o.key))}),d(2),l()()}if(i&2){let e=n.$implicit;s(2),w(e.key)}}function Zf(i,n){if(i&1&&(a(0,"ul",19),k(1,Xf,3,1,"li",20,Kf),b(3,"keyvalue"),l()),i&2){let e=c(2);s(),M(E(3,0,e.docTypes,e.originalOrderKeyValue))}}function Jf(i,n){if(i&1&&(a(0,"div",7)(1,"button",15)(2,"span",16),d(3),l(),_(4,"fa-icon",17),l(),R(5,Zf,4,3,"ul",18),l()),i&2){let e=c();s(3),w(e.selectedDocType),s(),m("icon",e.icons.faCaretDown)}}function eh(i,n){if(i&1){let e=y();a(0,"div",8)(1,"span",9),_(2,"fa-icon",3),l(),a(3,"input",22),b(4,"translate"),ue("ngModelChange",function(o){h(e);let r=c();return me(r.downloadProp.url,o)||(r.downloadProp.url=o),g(o)}),f("keydown.control.v",function(){h(e);let o=c();return g(o.pasteUrl())})("keydown.meta.v",function(){h(e);let o=c();return g(o.pasteUrl())}),l()()}if(i&2){let e=c();s(2),m("icon",e.icons.faGlobe),s(),de("ngModel",e.downloadProp.url),m("placeholder",E(4,3,e.downloadProp.placeholder,e.locale.language))}}function th(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFolderClosed)}}function ih(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFileAlt)}}function nh(i,n){if(i&1&&(a(0,"span",12),d(1),l()),i&2){let e=c();s(),w(e.error)}}var kd=(()=>{let n=class n{constructor(){this.refreshFiles=new ae,this.locale=S($),this.layout=S(I),this.originalOrderKeyValue=De,this.icons={faCaretDown:Pl,faGlobe:xn,faFolderClosed:nr,faFileAlt:Zo},this.fileProp={title:"",name:"",placeholder:""},this.downloadProp={title:"Download from an external link",url:"",placeholder:"URL (https://...)"},this.selectedDocType="Text",this.docTypes=Dd,this.submitted=!1,this.filesService=S(He)}ngOnInit(){this.inputType==="download"?(this.fileProp.title="Download from URL",this.fileProp.placeholder="File name"):this.inputType==="file"?(this.fileProp.name=`${this.layout.translateString("New document")}.txt`,this.fileProp.title="New document",this.fileProp.placeholder="Document name",this.updateFileSelection()):(this.fileProp.title="New folder",this.fileProp.placeholder="Folder name")}onSelectDocType(t){this.selectedDocType=t;let o=this.fileNamePosition();this.fileProp.name=`${this.fileProp.name.substring(0,o<0?this.fileProp.name.length:o)}${this.docTypes[t]}`,this.updateFileSelection()}onEnter(){this.fileProp.name&&this.onSubmit()}onSubmit(){if(this.submitted=!0,this.files.find(t=>t.name.toLowerCase()===this.fileProp.name.toLowerCase())){this.error="This name is already used",this.submitted=!1;return}if(this.inputType==="download"){if(!yc.test(this.downloadProp.url)){this.error="Malformed URL",this.submitted=!1;return}this.filesService.downloadFromUrl(this.downloadProp.url,this.fileProp.name)}else this.filesService.make(this.inputType,this.fileProp.name);this.layout.closeDialog()}pasteUrl(){setTimeout(()=>{this.fileProp.name=this.downloadProp.url.split("/").slice(-1)[0]},200)}fileNamePosition(){return this.fileProp.name.lastIndexOf(".")}updateFileSelection(){setTimeout(()=>{this.inputText.nativeElement.focus(),this.inputText.nativeElement.setSelectionRange(0,this.fileNamePosition())},0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-files-new-dialog"]],viewQuery:function(o,r){if(o&1&&Y(jf,7),o&2){let p;W(p=j())&&(r.inputText=p.first)}},hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{files:"files",inputType:"inputType"},outputs:{refreshFiles:"refreshFiles"},decls:24,vars:12,consts:[["InputText",""],[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate","",1,"ms-1"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["dropdown","",1,"btn-group","btn-group-sm","mb-3"],[1,"input-group","input-group-sm","my-2"],[1,"input-group-text"],["type","text","appAutofocus","",1,"form-control","fs-xs",3,"ngModelChange","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-xs","text-danger"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["aria-controls","dropdown-animated","dropdownToggle","","id","button-animated","type","button",1,"btn","btn-primary","dropdown-toggle"],["l10nTranslate",""],[1,"ms-3",3,"icon"],["aria-labelledby","button-animated","class","dropdown-menu","id","dropdown-animated","role","menu",4,"dropdownMenu"],["aria-labelledby","button-animated","id","dropdown-animated","role","menu",1,"dropdown-menu"],["role","menuitem"],["l10nTranslate","",1,"dropdown-item",3,"click"],["type","text","appAutofocus","",1,"form-control","fs-xs",3,"ngModelChange","keydown.control.v","keydown.meta.v","ngModel","placeholder"]],template:function(o,r){if(o&1){let p=y();a(0,"div",1)(1,"h4",2),C(2,Qf,1,1,"fa-icon",3)(3,qf,1,1,"fa-icon",3)(4,Yf,1,1,"fa-icon",3),a(5,"span",4),d(6),l()(),a(7,"button",5),f("click",function(){return h(p),g(r.layout.closeDialog())}),l()(),a(8,"div",6),C(9,Jf,6,2,"div",7),C(10,eh,5,6,"div",8),a(11,"div",8)(12,"span",9),C(13,th,1,1,"fa-icon",3)(14,ih,1,1,"fa-icon",3),l(),a(15,"input",10,0),b(17,"translate"),ue("ngModelChange",function(v){return h(p),me(r.fileProp.name,v)||(r.fileProp.name=v),g(v)}),l()()(),a(18,"div",11),C(19,nh,2,1,"span",12),a(20,"button",13),f("click",function(){return h(p),g(r.layout.closeDialog())}),d(21,"Cancel"),l(),a(22,"button",14),f("click",function(){return h(p),g(r.onSubmit())}),d(23,"Confirm "),l()()}if(o&2){let p;s(2),x((p=r.inputType)==="download"?2:p==="directory"?3:p==="file"?4:-1),s(4),w(r.fileProp.title),s(3),x(r.inputType==="file"?9:-1),s(),x(r.inputType==="download"?10:-1),s(3),x(r.inputType==="directory"?13:14),s(2),de("ngModel",r.fileProp.name),m("placeholder",E(17,9,r.fileProp.placeholder,r.locale.language)),s(4),x(r.error?19:-1),s(3),m("disabled",!r.fileProp.name||r.inputType==="download"&&!r.downloadProp.url||r.submitted)}},dependencies:[F,P,Ri,Pi,Ii,Fi,be,je,xe,ye,Ye,Z,Ee],encapsulation:2});let i=n;return i})();var Md=i=>({arg:i});function oh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function rh(i,n){if(i&1&&(_(0,"div",11),b(1,"translate")),i&2){let e=c(2);m("innerHTML",Mt(1,1,e.permanently?"delete_multiple_files":"trash_multiple_files",e.locale.language,Ne(5,Md,e.files.length)),Wn)}}function ah(i,n){if(i&1&&(_(0,"div",11),b(1,"translate")),i&2){let e=c(2);m("innerHTML",Mt(1,1,e.permanently?"delete_one_file":"trash_one_file",e.locale.language,Ne(5,Md,e.files[0].name)),Wn)}}function sh(i,n){if(i&1&&C(0,rh,2,7,"div",11)(1,ah,2,7,"div",11),i&2){let e=c();x(e.files.length>1?0:e.files.length===1?1:-1)}}function lh(i,n){if(i&1&&(a(0,"div",3),d(1),l()),i&2){let e=c();s(),w(e.permanently?"Permanent deletion":"Moving to trash")}}var Fd=(()=>{let n=class n{constructor(){this.files=[],this.permanently=!1,this.removeFiles=new ae,this.locale=S($),this.layout=S(I),this.icons={faTrashCan:Ai,faSpinner:Ue},this.submitted=!1}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.removeFiles.next(),this.layout.closeDialog())}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-trash-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{files:"files",permanently:"permanently"},outputs:{removeFiles:"removeFiles"},decls:16,vars:4,consts:[[1,"modal-header"],["l10nTranslate","",1,"modal-title"],[1,"me-1",3,"icon"],["l10nTranslate",""],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"overflow-wrap-and-whitespace"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[3,"innerHTML"]],template:function(o,r){if(o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Trash"),l(),C(5,oh,1,1,"fa-icon",4),l(),a(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(7,"div",6)(8,"div",7),C(9,sh,2,1)(10,lh,2,1,"div",3),l()(),a(11,"div",8)(12,"button",9),f("click",function(){return r.layout.closeDialog()}),d(13,"Cancel"),l(),a(14,"button",10),f("click",function(){return r.onSubmit()}),d(15,"Confirm"),l()()),o&2){let p;s(2),m("icon",r.icons.faTrashCan),s(3),x(r.submitted?5:-1),s(4),x((p=r.submitted)===!1?9:p===!0?10:-1),s(5),m("disabled",r.submitted)}},dependencies:[P,F,Z],encapsulation:2,changeDetection:0});let i=n;return i})();function ch(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}var Pd=(()=>{let n=class n{constructor(){this.files=[],this.layout=S(I),this.icons={faTrashCan:Ai,faSpinner:Ue},this.submitted=!1,this.filesService=S(He)}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.filesService.delete(this.files),this.layout.closeDialog(),this.submitted=!1)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-trash-empty-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{files:"files"},decls:17,vars:3,consts:[[1,"modal-header"],["l10nTranslate","",1,"modal-title"],[1,"me-1",3,"icon"],["l10nTranslate",""],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Trash"),l(),C(5,ch,1,1,"fa-icon",4),l(),a(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(7,"div",6)(8,"div",3),d(9,"Would you like to empty the trash ?"),l(),a(10,"small",3),d(11,"All items will be permanently deleted"),l()(),a(12,"div",7)(13,"button",8),f("click",function(){return r.layout.closeDialog()}),d(14,"Cancel"),l(),a(15,"button",9),f("click",function(){return r.onSubmit()}),d(16,"Confirm"),l()()),o&2&&(s(2),m("icon",r.icons.faTrashCan),s(3),x(r.submitted?5:-1),s(10),m("disabled",r.submitted))},dependencies:[F,P],encapsulation:2});let i=n;return i})();var ph=["InputRename"],dh=(i,n)=>n.alias,mh=(i,n)=>n.key;function uh(i,n){if(i&1&&_(0,"app-user-avatar",14)(1,"div",9),i&2){let e=c().$implicit;m("user",e.owner)}}function _h(i,n){if(i&1){let e=y();a(0,"input",15,0),f("updateObject",function(o){h(e);let r=c(2);return g(r.onRenameRoot(o))}),l()}if(i&2){let e=c().$implicit;m("inputObject",e)("fullWidth",!0)}}function fh(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(2).$implicit;s(),w(e.externalPath)}}function hh(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"pathSlice"),l()),i&2){let e=c(2).$implicit;s(),w(E(2,1,e.file.path,-2))}}function gh(i,n){if(i&1&&(a(0,"div",16)(1,"span"),d(2),l()(),a(3,"div",17),C(4,fh,2,1,"span")(5,hh,3,4,"span"),l()),i&2){let e=c().$implicit,t=c();s(2),w(e.name),s(2),x(t.user.isAdmin&&e.externalPath?4:5)}}function Ch(i,n){if(i&1&&(a(0,"div",7)(1,"div",18),d(2),l(),a(3,"div",18),d(4),b(5,"amTimeAgo"),l()()),i&2){let e=c().$implicit;s(2),w(e.alias),s(2),w(G(5,2,e.createdAt))}}function xh(i,n){if(i&1){let e=y();a(0,"button",21),b(1,"translate"),ue("ngModelChange",function(o){h(e);let r=c().$implicit,p=c().$implicit;return me(p.hPerms[r.key],o)||(p.hPerms[r.key]=o),g(o)}),f("ngModelChange",function(){h(e);let o=c(2).$implicit,r=c();return g(r.onPermissionChange(o))}),_(2,"fa-icon",22),l()}if(i&2){let e=c().$implicit,t=c().$implicit,o=c();L(X("btn btn-sm btn-custom ",!t.isDir&&(e.key==="a"||e.key==="d")?"disabled":"")),de("ngModel",t.hPerms[e.key]),m("tooltip",E(1,6,o.SPACES_PERMISSIONS_TEXT[e.key].text,o.locale.language)),s(2),m("icon",o.SPACES_PERMISSIONS_TEXT[e.key].icon)}}function Sh(i,n){if(i&1&&(a(0,"button",23),b(1,"translate"),_(2,"fa-icon",22),l()),i&2){let e=c().$implicit,t=c().$implicit,o=c();O("active",t.hPerms[e.key]),m("tooltip",E(1,4,o.SPACES_PERMISSIONS_TEXT[e.key].text,o.locale.language)),s(2),m("icon",o.SPACES_PERMISSIONS_TEXT[e.key].icon)}}function vh(i,n){if(i&1&&C(0,xh,3,9,"button",19)(1,Sh,3,7,"button",20),i&2){let e=c().$implicit,t=c();x(!(e.owner!=null&&e.owner.id)&&t.user.isAdmin||(e.owner==null?null:e.owner.id)===t.user.id?0:1)}}function yh(i,n){if(i&1){let e=y();a(0,"div",1)(1,"div",2)(2,"div",3),C(3,uh,2,1),_(4,"img",4),a(5,"div",5),C(6,_h,2,2,"input",6)(7,gh,6,2),l()(),C(8,Ch,6,4,"div",7),a(9,"div",8),_(10,"div",9),k(11,vh,2,1,null,null,mh),b(13,"keyvalue"),_(14,"div",10),a(15,"button",11),b(16,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.setRenamed(o))}),_(17,"fa-icon",12),l(),a(18,"button",13),b(19,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.removeRoot(o))}),_(20,"fa-icon",12),l()()()()}if(i&2){let e=n.$implicit,t=c();s(3),x(t.showUsers?3:-1),s(),O("cursor-pointer",!!e.file.path),m("src",e.file.mimeUrl,ee)("tooltip",e.file.path),s(2),x(e.isRenamed?6:7),s(2),x(t.showInfo?8:-1),s(3),M(E(13,14,e.hPerms,t.originalOrderKeyValue)),s(4),L(X("btn btn-sm ",e.isRenamed?"btn-success":"btn-custom"," me-2")),m("tooltip",E(16,17,"Rename",t.locale.language)),s(2),m("icon",t.icons.faPen),s(),m("tooltip",E(19,20,"Remove",t.locale.language)),s(2),m("icon",t.icons.faTimes)}}var Hn=(()=>{let n=class n{constructor(){this.showInfo=!0,this.showUsers=!0,this.addRootFile=null,this.locale=S($),this.icons={faTimes:Rt,faPen:mt},this.SPACES_PERMISSIONS_TEXT=mc,this.originalOrderKeyValue=De,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(t=>this.addRoot(t)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(t){let o={id:0,alias:to(t.name,"alias",this.space.roots).toLowerCase(),name:to(t.name,"name",this.space.roots),permissions:"",createdAt:new Date};t.externalPath?(o.externalPath=t.externalPath,o.owner={id:null,login:null,email:null,fullName:null},o.file={id:0,path:null,mime:null}):(o.externalPath=null,o.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},o.file={id:t.id,path:t.path,mime:t.mime}),this.space.addRoot(o,!0)}removeRoot(t){this.space.roots=this.space.roots.filter(o=>t.alias!==o.alias)}onRenameRoot(t){let o=t.object;o.alias=to(ec(t.name,!0),"alias",this.space.roots.filter(r=>r.id!==o.id)).toLowerCase(),o.name=to(t.name.replace(Zl,""),"name",this.space.roots.filter(r=>r.id!==o.id))}onPermissionChange(t){t.permissions=hc(t.hPerms)}setRenamed(t){t.isRenamed?(this.onRenameRoot({object:t,name:this.inputRename.nativeElement.value}),t.isRenamed=!1):t.isRenamed=!0}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-manage-roots"]],viewQuery:function(o,r){if(o&1&&Y(ph,5),o&2){let p;W(p=j())&&(r.inputRename=p.first)}},inputs:{space:"space",user:"user",showInfo:"showInfo",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","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"],[1,"d-flex","justify-content-end"],["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(o,r){o&1&&k(0,yh,21,23,"div",1,dh),o&2&&M(r.space.roots)},dependencies:[Cc,Tn,F,Ze,Ke,Me,be,xe,ye,ea,Ee,Z,Je,Qr],encapsulation:2});let i=n;return i})();function bh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}var Id=(()=>{let n=class n{constructor(){this.addAnchoredFiles=new ae,this.locale=S($),this.layout=S(I),this.icons={faAnchor:ni,faPlus:Qe,faSpinner:Ue,SPACES:ie.SPACES},this.space={roots:[]},this.submitted=!1,this.loading=!1,this.userService=S(oe),this.user=this.userService.user,this.spacesService=S(ot)}ngOnInit(){for(let t of this.files)this.space.roots.push({id:t.id,name:t.name,alias:t.name,permissions:"",createdAt:new Date,isRenamed:!1,hPerms:fc("",[qe.SHARE_INSIDE]),isDir:t.mime===ri,owner:{id:this.user.id,login:this.user.login},file:t})}onSetSpace(t){this.selectedSpace=t}onSearchSpaces(t){return this.spacesService.searchSpaces({search:t,shareInsidePermission:!0,limit:6})}onSubmit(){!this.selectedSpace||!this.space.roots.length||(this.loading=!0,this.submitted=!0,this.spacesService.createUserSpaceRoots(this.selectedSpace.id,this.space.roots).subscribe({next:t=>{t.length&&this.addAnchoredFiles.emit({space:this.selectedSpace,rootFiles:t.map(o=>({id:o.file.id,name:o.file.path.split("/").at(-1)}))}),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Anchor files to a space",t.error.message),this.loading=!1,this.submitted=!1}}))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-anchor-file-dialog"]],inputs:{files:"files"},decls:22,vars:14,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"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"mb-3"],["for","space","l10nTranslate",""],["id","space",3,"data","searchFunction","active","itemIcon","placeholder"],["for","files","l10nTranslate",""],["id","files",3,"space","user","showInfo","showUsers"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Anchor files to a space"),l()(),C(5,bh,1,1,"fa-icon",4),a(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(7,"div",6)(8,"div",7)(9,"label",8),d(10,"Space"),l(),a(11,"app-select",9),b(12,"translate"),f("data",function(u){return r.onSetSpace(u)}),l()(),a(13,"div",7)(14,"label",10),d(15,"Files"),l(),_(16,"app-space-manage-roots",11),l()(),a(17,"div",12)(18,"button",13),f("click",function(){return r.layout.closeDialog()}),d(19,"Cancel"),l(),a(20,"button",14),f("click",function(){return r.onSubmit()}),d(21," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faAnchor),s(3),x(r.loading?5:-1),s(6),m("searchFunction",r.onSearchSpaces.bind(r))("active",r.selectedSpace)("itemIcon",r.icons.SPACES)("placeholder",E(12,11,"Type to search for space to select",r.locale.language)),s(5),m("space",r.space)("user",r.user)("showInfo",!1)("showUsers",!1),s(4),m("disabled",r.submitted||!r.selectedSpace||!r.space.roots.length))},dependencies:[F,P,Hn,bc,Z],encapsulation:2});let i=n;return i})();var wh=["MainContextMenu"],Th=["MainReadOnlyContextMenu"],Eh=["FileContextMenu"],Ah=i=>({nb:i}),Dh=()=>({isMultiple:!0}),kh=()=>({isDirectory:!0}),Rd=(i,n)=>n.id,Nd=(i,n)=>n.key;function Mh(i,n){if(i&1){let e=y();a(0,"a",33),f("uploadFiles",function(o){h(e);let r=c(3);return g(r.onUploadFiles(o,!0))}),a(1,"span",22),_(2,"fa-icon",10),d(3,"Upload folders"),l()()}if(i&2){let e=c(3);m("options",Tt(2,kh)),s(2),m("icon",e.icons.faUpload)}}function Fh(i,n){if(i&1){let e=y();a(0,"ul",28)(1,"li",29)(2,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("directory"))}),a(3,"span",22),_(4,"fa-icon",10),d(5,"New folder"),l()()(),a(6,"li",29)(7,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("file"))}),a(8,"span",22),_(9,"fa-icon",10),d(10,"New document"),l()()(),a(11,"li",29)(12,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("download"))}),a(13,"span",22),_(14,"fa-icon",10),d(15,"Download from URL"),l()()(),a(16,"li",29)(17,"a",31),f("uploadFiles",function(o){h(e);let r=c(2);return g(r.onUploadFiles(o))}),a(18,"span",22),_(19,"fa-icon",10),d(20,"Upload files"),l()(),C(21,Mh,4,3,"a",32),l()()}if(i&2){let e=c(2);s(4),m("icon",e.icons.PERSONAL),s(5),m("icon",e.icons.faFileAlt),s(5),m("icon",e.icons.faGlobe),s(3),m("options",Tt(6,Dh)),s(2),m("icon",e.icons.faUpload),s(2),x(e.supportUploadFolder?21:-1)}}function Ph(i,n){if(i&1){let e=y();a(0,"div",26),f("onShown",function(){h(e);let o=c();return g(o.initUpload())}),a(1,"button",27),b(2,"translate"),_(3,"fa-icon",10),l(),R(4,Fh,22,7,"ul",13),l()}if(i&2){let e=c();s(),m("tooltip",E(2,2,"New",e.locale.language)),s(2),m("icon",e.icons.faPlus)}}function Ih(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openSpaceAnchorFileDialog())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Anchor to a space"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faAnchor)}}function Rh(i,n){if(i&1){let e=y();a(0,"ul",28)(1,"li",29)(2,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openShareDialog())}),a(3,"span",22),_(4,"fa-icon",10),d(5,"New share"),l()()(),a(6,"li",29)(7,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openShareLinkDialog())}),a(8,"span",22),_(9,"fa-icon",10),d(10,"New share link"),l()()(),C(11,Ih,5,1,"li",29),l()}if(i&2){let e=c(2);s(4),m("icon",e.icons.SHARES),s(5),m("icon",e.icons.faLink),s(2),x(e.isFilesRepo?11:-1)}}function Nh(i,n){if(i&1&&(a(0,"div",11)(1,"button",27),b(2,"translate"),_(3,"fa-icon",10),l(),R(4,Rh,12,3,"ul",13),l()),i&2){let e=c();m("isDisabled",!e.hasSelection||e.inSharesList&&!e.selection[0].canBeReShared),s(),m("tooltip",E(2,3,"Share",e.locale.language)),s(2),m("icon",e.icons.SHARES)}}function Vh(i,n){if(i&1){let e=y();a(0,"button",9),b(1,"translate"),f("click",function(){h(e);let o=c(2);return g(o.openEmptyTrashDialog())}),_(2,"fa-icon",10),l()}if(i&2){let e=c(2);m("disabled",!e.stats.elements)("tooltip",E(1,3,"Empty",e.locale.language)),s(2),m("icon",e.icons.TRASH)}}function Lh(i,n){if(i&1){let e=y();a(0,"button",9),b(1,"translate"),f("click",function(){h(e);let o=c();return g(o.openTrashDialog(!0))}),_(2,"fa-icon",10),l(),C(3,Vh,3,6,"button",34)}if(i&2){let e=c();m("disabled",!e.hasSelection)("tooltip",E(1,4,"Remove",e.locale.language)),s(2),m("icon",e.icons.faBan),s(),x(e.inRootSpace?3:-1)}}function Oh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.shortcutOpen())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Open"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.selection[0].isDir?e.icons.faFolderOpen:e.icons.faEye)}}function Bh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.shortcutRename())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Rename"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faSpellCheck)}}function Uh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.addToSync())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Synchronize"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faRotate)}}function Hh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.decompressFile())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Decompress"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faFileArchive)}}function $h(i,n){if(i&1){let e=y();C(0,Oh,5,1,"li",29),C(1,Bh,5,1,"li",29),a(2,"li",29)(3,"a",30),f("click",function(){h(e);let o=c(2);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),a(4,"span",22),_(5,"fa-icon",10),d(6,"Comment"),l()()(),C(7,Uh,5,1,"li",29),C(8,Hh,5,1,"li",29)}if(i&2){let e=c(2);x(e.selection[0]?0:-1),s(),x(e.inSharesList?-1:1),s(4),m("icon",e.icons.faCommentDots),s(2),x(e.isElectronApp&&e.selection[0].isDir?7:-1),s(),x(!e.inSharesList&&!e.selection[0].isCompressible?8:-1)}}function zh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openCompressionDialog())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Compress"),l()()()}if(i&2){let e=c(2);s(3),m("icon",e.icons.faFileArchive)}}function Gh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(2);return g(o.copyMoveFiles())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Copy \xB7 Move"),l()()()}if(i&2){let e=c(2);s(3),m("icon",e.icons.faArrowsAlt)}}function Wh(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openTrashDialog(!0))}),a(1,"span",22),_(2,"fa-icon",10),d(3,"Remove"),l()()}if(i&2){let e=c(3);s(2),m("icon",e.icons.faBan)}}function jh(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openTrashDialog())}),a(1,"span",22),_(2,"fa-icon",10),d(3,"Trash"),l()()}if(i&2){let e=c(3);s(2),m("icon",e.icons.TRASH)}}function Kh(i,n){if(i&1&&(_(0,"li",35),a(1,"li",29),C(2,Wh,4,1,"a",36)(3,jh,4,1,"a",36),l()),i&2){let e=c(2);s(2),x(e.isTrashRepo?2:3)}}function Qh(i,n){if(i&1){let e=y();a(0,"ul",28),C(1,$h,9,5),C(2,zh,5,1,"li",29),C(3,Gh,5,1,"li",29),a(4,"li",29)(5,"a",30),f("click",function(){h(e);let o=c();return g(o.addToClipboard())}),a(6,"span",22),_(7,"fa-icon",10),d(8,"Clipboard"),l()()(),a(9,"li",29)(10,"a",30),f("click",function(){h(e);let o=c();return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION))}),a(11,"span",22),_(12,"fa-icon",10),d(13,"Info"),l()()(),C(14,Kh,4,1),l()}if(i&2){let e=c();s(),x(e.selection.length===1?1:-1),s(),x(e.canCompress?2:-1),s(),x(e.hasDisabledItemsInSelection?-1:3),s(4),m("icon",e.icons.faClipboardList),s(5),m("icon",e.icons.faCircleInfo),s(2),x(e.inSharesList?-1:14)}}function qh(i,n){i&1&&_(0,"div")}function Yh(i,n){if(i&1){let e=y();a(0,"img",56),f("error",function(){h(e);let o=c().$implicit;return g(o.isImage=!1)}),l()}if(i&2){let e=c().$implicit,t=c(2);B("max-height",t.galleryMode.image,"px"),m("src",wt("",e.thumbnailUrl,"?size=",t.galleryMode.imageRes),ee)}}function Xh(i,n){if(i&1){let e=y();a(0,"img",57),f("error",function(){h(e);let o=c().$implicit;return g(o.fallBackMimeUrl())}),l()}if(i&2){let e=c().$implicit,t=c(2);m("src",e.mimeUrl,ee)("height",t.galleryMode.image)("width",t.galleryMode.image)}}function Zh(i,n){if(i&1){let e=y();a(0,"span",58),b(1,"fileLockFormatPipe"),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.openLockDialog(o))}),_(2,"fa-icon",10),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),m("tooltip",fa(G(1,5,e.lock))),s(2),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faLockOpen)}}function Jh(i,n){if(i&1){let e=y();a(0,"span",59),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SHARES),s(),D("\xA0",e.shares.length," ")}}function e1(i,n){if(i&1){let e=y();a(0,"span",60),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SPACES),s(),D("\xA0",e.spaces.length," ")}}function t1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.LINKS),s(),D("\xA0",e.links.length," ")}}function i1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SYNC),s(),D("\xA0",e.syncs.length," ")}}function n1(i,n){if(i&1){let e=y();a(0,"span",62),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),_(1,"fa-icon",10),l()}if(i&2){let e=c(3);B("font-size",e.galleryMode.textSize,"px"),s(),m("icon",e.icons.faCommentDots)}}function o1(i,n){if(i&1&&(a(0,"span",51),_(1,"app-user-avatar",63),l()),i&2){let e=c().$implicit,t=c(2);s(),m("user",e.root.owner)("height",t.galleryMode.dimensions/3)("width",t.galleryMode.dimensions/3)("fontSize",t.galleryMode.faSize/2)}}function r1(i,n){if(i&1&&(a(0,"span",52)(1,"span",64),d(2),l()()),i&2){let e=c().$implicit,t=c(2);s(),B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function a1(i,n){if(i&1){let e=y();a(0,"input",65),f("renamingInProgress",function(o){h(e);let r=c(3);return g(r.setRenamingInProgress(o))})("updateObject",function(o){h(e);let r=c(3);return g(r.renameFile(o))}),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),m("inputObject",e)("fullWidth",!0)("textCenter",!0)}}function s1(i,n){if(i&1&&(a(0,"span",66),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.name)}}function l1(i,n){if(i&1){let e=y();a(0,"div",41),f("click",function(o){let r=h(e).$implicit,p=c(2);return g(p.onSelect(o,r))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),a(1,"div",42),C(2,Yh,1,5,"img",43)(3,Xh,1,3,"img",44),a(4,"span",45),C(5,Zh,3,7,"span",46),C(6,Jh,3,4,"span",47),C(7,e1,3,4,"span",48),C(8,t1,3,4,"span",49),C(9,i1,3,4,"span",49),C(10,n1,2,3,"span",50),l(),C(11,o1,2,4,"span",51),C(12,r1,3,3,"span",52),l(),a(13,"div",53),C(14,a1,1,5,"input",54)(15,s1,2,3,"span",55),l()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("disabled",e.isDisabled)("deleted",e.isBeingDeleted)("selected",e.isSelected),s(),Zt("rowIndex",t),s(),x(e.isImage?2:3),s(3),x(e.lock?5:-1),s(),x(e.shares.length?6:-1),s(),x(e.spaces.length?7:-1),s(),x(e.links.length?8:-1),s(),x(e.syncs.length?9:-1),s(),x(e.hasComments?10:-1),s(),x(e.root?11:-1),s(),x(e.newly?12:-1),s(2),x(e.isRenamed?14:15)}}function c1(i,n){if(i&1){let e=y();a(0,"div",18)(1,"app-virtual-scroll",37),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),R(3,qh,1,0,"div",38),a(4,"div",39),k(5,l1,16,21,"div",40,Rd),l()()()}if(i&2){let e=c(),t=Be(33);s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",Mt(2,6,e.files,e.inputFilter.search(),"name"))("galleryMode",!0)("resizeOffset",110),s(2),m("ngTemplateOutlet",t),s(2),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function p1(i,n){if(i&1&&_(0,"fa-icon",73),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function d1(i,n){if(i&1){let e=y();a(0,"th",72),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,p1,1,2,"fa-icon",73),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function m1(i,n){if(i&1&&C(0,d1,3,10,"th",71),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function u1(i,n){i&1&&_(0,"div")}function _1(i,n){if(i&1){let e=y();a(0,"input",80),f("renamingInProgress",function(o){h(e);let r=c(6);return g(r.setRenamingInProgress(o))})("updateObject",function(o){h(e);let r=c(6);return g(r.renameFile(o))}),l()}if(i&2){let e=c(4).$implicit;m("inputObject",e)}}function f1(i,n){if(i&1&&(a(0,"span",81),d(1),l()),i&2){let e=c(5).$implicit;s(),w(e.root.description)}}function h1(i,n){if(i&1&&(a(0,"div",79)(1,"span",66),d(2),l(),C(3,f1,2,1,"span",81),l()),i&2){let e=c(4).$implicit,t=c(2);s(2),w(e.name),s(),x(t.inSharesList&&(e.root!=null&&e.root.description)?3:-1)}}function g1(i,n){if(i&1){let e=y();a(0,"div",76)(1,"img",77),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),C(2,_1,1,1,"input",78)(3,h1,4,2,"div",79),l()}if(i&2){let e=c(3).$implicit;s(),m("src",e.mimeUrl,ee),s(),x(e.isRenamed?2:3)}}function C1(i,n){if(i&1&&(a(0,"div",82),_(1,"app-user-avatar",83),l()),i&2){let e=c(4).$implicit;s(),m("user",e.root.owner)}}function x1(i,n){if(i&1&&C(0,C1,2,1,"div",82),i&2){let e=c(3).$implicit;x(e.root?0:-1)}}function S1(i,n){if(i&1){let e=y();a(0,"span",87),b(1,"fileLockFormatPipe"),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openLockDialog(o))}),_(2,"fa-icon",10),l()}if(i&2){let e=c(4).$implicit,t=c(2);m("tooltip",fa(G(1,3,e.lock))),s(2),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faLockOpen)}}function v1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SHARES),s(),D("\xA0",e.shares.length," ")}}function y1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.LINKS),s(),D("\xA0",e.links.length," ")}}function b1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SPACES),s(),D("\xA0",e.spaces.length," ")}}function w1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SYNC),s(),D("\xA0",e.syncs.length," ")}}function T1(i,n){if(i&1){let e=y();a(0,"span",62),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),_(1,"fa-icon",10),l()}if(i&2){let e=c(6);s(),m("icon",e.icons.faCommentDots)}}function E1(i,n){if(i&1&&(C(0,S1,3,5,"span",84),C(1,v1,3,2,"span",85),C(2,y1,3,2,"span",85),C(3,b1,3,2,"span",85),C(4,w1,3,2,"span",85),C(5,T1,2,1,"span",86)),i&2){let e=c(3).$implicit;x(e.lock?0:-1),s(),x(e.shares.length?1:-1),s(),x(e.links.length?2:-1),s(),x(e.spaces.length?3:-1),s(),x(e.syncs.length?4:-1),s(),x(e.hasComments?5:-1)}}function A1(i,n){if(i&1&&_(0,"app-file-permissions",88),i&2){let e=c(4).$implicit;m("permissions",e.root.hPerms)}}function D1(i,n){if(i&1&&C(0,A1,1,1,"app-file-permissions",88),i&2){let e=c(3).$implicit;x(e.root&&e.root.permissions?0:-1)}}function k1(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hSize," ")}}function M1(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function F1(i,n){if(i&1&&(a(0,"td"),C(1,g1,4,2,"div",76)(2,x1,1,1)(3,E1,6,6)(4,D1,1,1)(5,k1,1,1)(6,M1,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="anchored"?2:e==="info"?3:e==="permissions"?4:e==="size"?5:e==="mtime"?6:-1)}}function P1(i,n){if(i&1&&C(0,F1,7,9,"td",75),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function I1(i,n){if(i&1){let e=y();a(0,"tr",74),f("click",function(o){let r=h(e).$implicit,p=c(2);return g(p.onSelect(o,r))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),k(1,P1,1,1,null,null,Nd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("disabled",e.isDisabled)("deleted",e.isBeingDeleted)("selected",e.isSelected),s(),M(E(3,6,t.tableHeaders,t.originalOrderKeyValue))}}function R1(i,n){if(i&1){let e=y();a(0,"table",67)(1,"thead")(2,"tr"),k(3,m1,1,1,null,null,Nd),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",68),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),R(8,u1,1,0,"div",38),a(9,"table",67)(10,"tbody",69),k(11,I1,4,9,"tr",70,Rd),l()()()}if(i&2){let e=c(),t=Be(33);s(3),M(E(5,3,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",Mt(7,6,e.files,e.inputFilter.search(),"name")),s(2),m("ngTemplateOutlet",t),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function N1(i,n){if(i&1&&(a(0,"span",20),d(1),b(2,"translate"),l()),i&2){let e=c();s(),Re("",e.stats.dirs," ",E(2,2,e.stats.dirs>1?"directories":"directory",e.locale.language))}}function V1(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();s(),Re("",e.stats.files," ",E(2,2,e.stats.files>1?"files":"file",e.locale.language))}}function L1(i,n){i&1&&(a(0,"div",89)(1,"span",22),d(2,"Forbidden resource"),l()())}function O1(i,n){i&1&&(a(0,"div",89)(1,"span",22),d(2,"Location not found"),l()())}function B1(i,n){i&1&&(a(0,"div",89)(1,"span",22),d(2,"Server Error"),l()())}function U1(i,n){i&1&&(a(0,"div",90)(1,"span",22),d(2,"Drag and drop your files here"),l()())}function H1(i,n){if(i&1&&C(0,L1,3,0,"div",89)(1,O1,3,0,"div",89)(2,B1,3,0,"div",89)(3,U1,3,0,"div",90),i&2){let e=c();x(e.forbiddenResource?0:e.locationNotFound?1:e.serverError?2:!e.isTrashRepo&&!e.loading&&!e.stats.elements?3:-1)}}function $1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Open"),l()),i&2){let e=c(3);s(),m("icon",e.selection[0].isDir?e.icons.faFolderOpen:e.icons.faEye)}}function z1(i,n){if(i&1){let e=y();R(0,$1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutOpen())})}}function G1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Rename"),l()),i&2){let e=c(3);s(),m("icon",e.icons.faSpellCheck)}}function W1(i,n){if(i&1){let e=y();R(0,G1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutRename())})}}function j1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Comment"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faCommentDots)}}function K1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Synchronize"),l()),i&2){let e=c(3);s(),m("icon",e.icons.faRotate)}}function Q1(i,n){if(i&1){let e=y();R(0,K1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.addToSync())})}}function q1(i,n){if(i&1){let e=y();C(0,z1,1,0,null,23),C(1,W1,1,0,null,23),R(2,j1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),C(3,Q1,1,0,null,23)}if(i&2){let e=c();x(e.selection[0]?0:-1),s(),x(e.inSharesList?-1:1),s(2),x(e.isElectronApp&&e.selection[0].isDir?3:-1)}}function Y1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Download"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faDownload)}}function X1(i,n){if(i&1){let e=y();R(0,Y1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.downloadFiles())})}}function Z1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Compress"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faFileArchive)}}function J1(i,n){if(i&1){let e=y();R(0,Z1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openCompressionDialog())})}}function eg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Decompress"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faFileArchive)}}function tg(i,n){if(i&1){let e=y();R(0,eg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.decompressFile())})}}function ig(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Copy \xB7 Move"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faArrowsAlt)}}function ng(i,n){if(i&1){let e=y();R(0,ig,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.copyMoveFiles())})}}function og(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Share"),l()),i&2){let e=c(2);s(),m("icon",e.icons.SHARES)}}function rg(i,n){if(i&1&&R(0,og,3,1,"ng-template",24),i&2){c();let e=Be(46);m("subMenu",e)}}function ag(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Clipboard"),l()),i&2){let e=c();s(),m("icon",e.icons.faClipboardList)}}function sg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}function lg(i,n){}function cg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2),l()),i&2){let e=c(2);s(),m("icon",e.isTrashRepo?e.icons.faBan:e.icons.TRASH),s(),D(" ",e.isTrashRepo?"Remove":"Trash")}}function pg(i,n){if(i&1){let e=y();R(0,lg,0,0,"ng-template",91)(1,cg,3,2,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openTrashDialog(o.isTrashRepo))})}i&2&&m("divider",!0)}function dg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New share"),l()),i&2){let e=c();s(),m("icon",e.icons.SHARES)}}function mg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New share link"),l()),i&2){let e=c();s(),m("icon",e.icons.faLink)}}function ug(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Anchor to a space"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faAnchor)}}function _g(i,n){if(i&1){let e=y();R(0,ug,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openSpaceAnchorFileDialog())})}}function fg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Empty"),l()),i&2){let e=c();s(),m("icon",e.icons.TRASH)}}function hg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Refresh"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faArrowRotateRight)}}function gg(i,n){if(i&1){let e=y();R(0,hg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.loadFiles())})}}function Cg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New folder"),l()),i&2){let e=c(2);s(),m("icon",e.icons.PERSONAL)}}function xg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New document"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faFileAlt)}}function Sg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Download from URL"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faGlobe)}}function vg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Upload files"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faUpload)}}function yg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Upload folders"),l()),i&2){let e=c(3);s(),m("icon",e.icons.faUpload)}}function bg(i,n){if(i&1){let e=y();R(0,yg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutUploadFolders())})}}function wg(i,n){if(i&1){let e=y();R(0,Cg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("directory"))}),R(1,xg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("file"))}),R(2,Sg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("download"))}),R(3,vg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.shortcutUploadFiles())}),C(4,bg,1,0,null,23)}if(i&2){let e=c();s(4),x(e.supportUploadFolder?4:-1)}}var ia=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.icons={SPACES:ie.SPACES,SHARES:ie.SHARES,TRASH:ie.TRASH,PERSONAL:ie.PERSONAL,LINKS:ie.LINKS,SYNC:cr.SYNC,faArrowRotateRight:ut,faPlus:Qe,faFileAlt:Zo,faGlobe:xn,faUpload:er,faDownload:Cn,faLink:Qo,faAnchor:ni,faEllipsis:Vo,faPen:mt,faEye:ml,faFolderOpen:hl,faRotate:Ti,faCommentDots:Jo,faFileArchive:Oo,faSpellCheck:El,faArrowsAlt:ti,faCircleInfo:Nt,faBan:pl,faArrowUp:dt,faArrowDown:_t,faLock:ii,faLockOpen:Dl,faClipboardList:jo},this.loading=!1,this.locationNotFound=!1,this.forbiddenResource=!1,this.serverError=!1,this.hasRoots=!1,this.canShare={inside:!1,outside:!1},this.multipleSelection=!1,this.hasSelection=!1,this.hasDisabledItemsInSelection=!1,this.canCompress=!0,this.renamingInProgress=!1,this.supportUploadFolder=!1,this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.tableHeaders={name:{label:"Name",width:45,textCenter:!1,class:"",show:!0,sortable:!0},anchored:{label:"Anchored by",width:5,class:"d-none d-md-table-cell",textCenter:!0,show:this.hasRoots,sortable:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:this.hasRoots},size:{label:"Size",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},mtime:{label:"Modified",width:10,textCenter:!0,class:"d-none d-sm-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",isDir:"Type",size:"Size",mtime:"Modified"},this.files=[],this.selection=[],this.stats={dirs:0,files:0,size:0,elements:0},this.router=S(Ce),this.activatedRoute=S(Jt),this.zone=S(zi),this.renderer=S(pt),this.store=S(te),this.isElectronApp=this.store.isElectronApp(),this.spacesBrowser=S(Ec),this.filesService=S(He),this.filesUpload=S(Rc),this.uploadButtonsShowed=!1,this.subscriptions=[],this.sortSettings={default:[{prop:"name",type:"string"},{prop:"isDir",type:"number"}],name:[{prop:"name",type:"string"}],isDir:[{prop:"isDir",type:"number"}],anchored:[{prop:"root.id",type:"number"},{prop:"root.owner.fullName",type:"string"}],size:[{prop:"size",type:"number"}],mtime:[{prop:"mtime",type:"number"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.moveFromDrag=!1}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView(),this.supportUploadFolder=this.filesUpload.supportUploadDirectory,this.activatedRoute.queryParams.subscribe(t=>this.focusOn(t.select)),this.activatedRoute.data.subscribe(t=>this.setSpace(t)),this.subscriptions.push(this.store.filesOnEvent.subscribe(t=>this.onFileEvent(t)))}ngAfterViewInit(){setTimeout(()=>this.initEventHandlers(),500)}ngOnDestroy(){this.destroyEventHandlers(),this.resetFilesSelection(),this.subscriptions.forEach(t=>t.unsubscribe())}onKeyPress(t){if((t.target.id==="table-files"||t.target.id==="thumb-files")&&(t.ctrlKey||t.metaKey))switch(t.which||t.keyCode){case 65:t.preventDefault(),t.stopPropagation(),this.updateSelection(this.files);return;case 67:case 88:t.preventDefault(),t.stopPropagation(),this.selection.length&&(this.filesService.clipboardAction=t.keyCode==67?"copyPaste":"cutPaste",this.filesService.addToClipboard(this.selection));return;case 86:t.preventDefault(),t.stopPropagation(),this.filesService.onPasteClipboard();return;default:return}}loadFiles(){this.loading=!0,this.forbiddenResource=!1,this.locationNotFound=!1,this.serverError=!1,this.inputFilter.clear(),this.resetFilesSelection(),this.spacesBrowser.loadFiles().subscribe({next:t=>{this.spacePermissions=t.permissions,this.canShare.outside=this.spacePermissions.indexOf(qe.SHARE_OUTSIDE)>-1,this.canShare.inside=this.spacePermissions.indexOf(qe.SHARE_INSIDE)>-1,this.hasRoots=t.hasRoots,this.tableHeaders.anchored.show=t.hasRoots,this.tableHeaders.anchored.label=this.isSharesRepo?"Owner":"Anchored by",this.tableHeaders.anchored.width=10,this.tableHeaders.permissions.show=t.hasRoots,this.sortBy(this.sortTable.sortParam.column,!1,t.files.map(o=>new Gc(o,this.baseRepoUrl,this.isSharesRepo,this.store.server().fileEditors))),this.updateFilesStats(this.files),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.files=[],this.updateFilesStats(this.files),t.status!==401&&(this.forbiddenResource=t.status===403,this.locationNotFound=t.status===404,this.serverError=t.status===0,this.layout.sendNotification("error","Files",t.error.message)),this.loading=!1}})}sortBy(t,o=!0,r){this.files=this.sortTable.sortBy(t,o,r||this.files)}switchView(t){let o=this.galleryMode;this.galleryMode=t,this.galleryMode.enabled!==o.enabled&&(this.destroyEventHandlers(),setTimeout(()=>this.initEventHandlers(),500))}onSelect(t,o){this.loading||(t.shiftKey&&this.selection.length>0&&this.selection.indexOf(o)===-1?this.selectRangeFiles(o):!t.ctrlKey&&!t.metaKey?this.updateSelection([o]):this.modifySelection(o))}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.isTrashRepo||this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.selection.length<=1&&this.updateSelection([o]),this.layout.openContextMenu(t,this.fileContextMenu)}browse(t){if(t.isDisabled){this.layout.sendNotification("warning",t.name,"Share is disabled");return}t.isRenamed||(t.isDir?this.router.navigate([t.root?.alias||t.name],{relativeTo:this.activatedRoute}).catch(console.error):this.shortcutOpen())}copyMoveFiles(){this.layout.showRSideBarTab(fe.TREE,!0),setTimeout(()=>this.filesService.treeCopyMoveOn.next(),100)}downloadFiles(){this.multipleSelection?this.openCompressionDialog(!1):this.filesService.download(this.selection[0])}shortcutOpen(){this.selection[0].isDir?this.browse(this.selection[0]):this.selection[0].isViewable||this.selection[0].isEditable?this.openViewerDialog():this.downloadFiles()}shortcutUploadFiles(){this.uploadButtonsShowed||document.getElementById("newButton").click(),setTimeout(()=>document.getElementById("uploadFilesButton").click(),100)}shortcutUploadFolders(){if(!this.uploadButtonsShowed){let t=document.getElementById("newButton");t.click(),t.click()}setTimeout(()=>document.getElementById("uploadFoldersButton").click(),100)}shortcutRename(){this.selection[0].isRenamed=!this.selection[0].isRenamed}renameFile(t){return Xt(this,null,function*(){let o=t.object,r=t.name,p=!1,u=this.files.find(v=>v.name.toLowerCase()===r.toLowerCase()&&v.id!==o.id);u&&(p=yield this.filesService.openOverwriteDialog([o],r),!p)||this.filesService.rename(o,r,p).pipe(pe(1)).subscribe({next:v=>{o.rename(v.name),o.isEditable=!1,p&&(o.updateMime(u.mime),this.sortBy(this.sortTable.sortParam.column,!1,this.files.filter(T=>T.id!==u.id)))},error:v=>this.layout.sendNotification("error","Rename",o.name,v)})})}setRenamingInProgress(t){this.renamingInProgress=t}addToSync(){this.router.navigate([we.BASE,we.WIZARD,we.WIZARD_CLIENT],{state:{file:this.selection[0]}}).catch(console.error)}addToClipboard(){this.filesService.addToClipboard(this.selection)}openShareDialog(){let t=this.setFilePermissionsAndSpace();if(t===null)return;this.layout.openDialog(tn,"lg",{initialState:{file:t,isSharesRepo:this.isSharesRepo,inSharesList:this.inSharesList,allowFilesOptions:!1}}).content.shareChange.pipe(pe(1)).subscribe(r=>{let p=r[1];this.selection[0].id<0&&(this.selection[0].id=p.file.id),this.selection[0].shares.push({id:p.id,alias:p.alias,name:p.name,type:no.COMMON})})}openShareLinkDialog(){let t=this.setFilePermissionsAndSpace();if(t===null)return;this.layout.openDialog(Fn,"md",{initialState:{file:t,isSharesRepo:this.isSharesRepo,inSharesList:this.inSharesList}}).content.shareChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.selection[0].id<0&&(this.selection[0].id=u.file.id),this.selection[0].links.push({id:u.id,alias:u.alias,name:u.name,type:no.LINK}))})}openSpaceAnchorFileDialog(){this.layout.openDialog(Id,"lg",{initialState:{files:this.selection}}).content.addAnchoredFiles.pipe(pe(1)).subscribe(o=>{for(let r of this.selection){let p=o.rootFiles.find(u=>u.name===r.name);p&&r.spaces.map(u=>u.id).indexOf(o.space.id)===-1&&(r.id<0&&(r.id=p.id),r.spaces.push(o.space))}})}initUpload(){!this.isTrashRepo&&!this.uploadButtonsShowed&&(this.uploadButtonsShowed=!0)}onUploadFiles(t,o=!1){return Xt(this,null,function*(){let r=!1,p=[...t.files];if(o){let u=p[0].webkitRelativePath.split("/")[0].normalize(),v=this.files.find(T=>T.name.normalize().toLowerCase()===u.normalize().toLowerCase());if(v&&(r=yield this.filesService.openOverwriteDialog([v]),!r))return}else{let u=this.files.filter(v=>p.some(T=>T.name.normalize().toLowerCase()===v.name.normalize().toLowerCase()));if(u.length>0&&(r=yield this.filesService.openOverwriteDialog(u),!r))return}this.filesUpload.addFiles(p,r).catch(console.error)})}onDropFiles(t){let o=this.files.filter(r=>[...t.dataTransfer.files].some(p=>p.name.normalize().toLowerCase()===r.name.normalize().toLowerCase()));this.filesUpload.onDropFiles(t,o)}decompressFile(){this.filesService.decompress(this.selection[0])}openCompressionDialog(t=!0){let o={name:this.selection[0].name,compressInDirectory:this.inSharesList?!1:t,files:this.selection.map(r=>({name:r.name,rootAlias:r.root?.alias})),extension:"tar"};this.layout.openDialog(ta,null,{initialState:{archiveProps:o,disableInDirCompression:this.inSharesList}})}openNewDialog(t){this.layout.openDialog(kd,null,{initialState:{files:this.files,inputType:t}})}openEmptyTrashDialog(){this.isTrashRepo&&this.inRootSpace&&this.layout.openDialog(Pd,null,{initialState:{files:this.files}})}openTrashDialog(t=!1){if(!this.selection.length)return;this.layout.openDialog(Fd,null,{initialState:{files:this.selection,permanently:t}}).content.removeFiles.pipe(pe(1)).subscribe(()=>this.removeFiles())}openLockDialog(t){this.filesService.openLockDialog(t)}setSpace(t){this.currentRoute=this.filesService.currentRoute=`${t.repository}${sr(t.routes)}`,this.baseRepoUrl=`${t.repository}${t.routes.length?`/${t.routes[0].path}`:""}`,this.isFilesRepo=t.repository===z.FILES,this.isSharesRepo=t.repository===z.SHARES,this.isTrashRepo=t.repository===z.TRASH,this.inRootSpace=this.isSharesRepo?t.routes.length===0:t.routes.length===1,this.inSharesList=this.isSharesRepo&&this.inRootSpace,this.spacesBrowser.setEnvironment(t.repository,t.routes),this.isPersonalSpace=this.spacesBrowser.inPersonalSpace,this.loadFiles()}onFileEvent(t){if(t.archiveId){this.filesService.downloadTaskArchive(t.archiveId);return}let o=t?.fileDstPath===this.currentRoute;if(t.filePath===this.currentRoute||o){let r=o&&t.reloadFocusOnDst;if(t.fileName&&((t.focus||r)&&(this.focusOnSelect=t.fileName),t.delete&&!r))if(t.status===Pc.SUCCESS)this.files=this.files.filter(p=>p.name!==t.fileName),this.updateFilesStats(this.files),this.resetFilesSelection();else{let p=this.files.find(u=>u.name===t.fileName);p&&(p.isBeingDeleted=!1)}(t.reload||r)&&this.loadFiles()}}removeFiles(){let t=this.selection.filter(o=>!o.root?.alias);this.selection.length!==t.length&&this.layout.sendNotification("warning","Remove","You can not remove an anchored file"),t.length&&this.filesService.delete(t)}setFilePermissionsAndSpace(){if(this.selection[0]?.root&&this.selection[0].root.permissions.indexOf(qe.SHARE_OUTSIDE)===-1)return this.layout.sendNotification("warning",this.selection[0].name,"You do not have share permission"),null;let t=re({},this.selection[0]);if(this.isPersonalSpace)t.permissions=this.spacePermissions;else if(this.selection[0]?.root)if(t.permissions=this.selection[0].root.permissions,this.inSharesList)t.space={alias:this.selection[0].root.alias,name:this.selection[0].root.alias,root:void 0};else{let o=this.currentRoute.split("/")[1];t.space={alias:o,name:o,root:{alias:this.selection[0].root.alias,name:this.selection[0].name}}}else{t.permissions=this.spacePermissions;let[o,r]=this.currentRoute.split("/").slice(1,3);t.space={alias:o,name:o,root:{alias:r,name:r}}}return t}openViewerDialog(){let t=this.selection[0],o;this.inSharesList?o=t.root.permissions:o=t?.root?ic(this.spacePermissions,t?.root.permissions):this.spacePermissions,this.filesService.openViewerDialog(t,this.files,o).catch(console.error)}focusOn(t){if(!t){this.focusOnSelect=null;return}if(!this.files.length){this.focusOnSelect=t;return}let o=this.files.find(r=>r.name.toLowerCase()===t.toLowerCase());!o&&this.hasRoots&&(o=this.files.find(r=>r.root?.alias.toLowerCase()===t.toLowerCase())),o?(setTimeout(()=>this.scrollView.scrollInto(o),100),this.updateSelection([o])):this.focusOnSelect=t}updateFilesStats(t){this.stats={dirs:0,files:0,size:0,elements:0};for(let o of t)this.updateCounters(o)}updateCounters(t,o=!0){let r=o?ac:sc;this.stats.elements=r(this.stats.elements,1),this.stats.size=r(this.stats.size,t.size),t.isDir?this.stats.dirs=r(this.stats.dirs,1):this.stats.files=r(this.stats.files,1)}resetFilesSelection(){this.updateSelection([])}modifySelection(t){t&&(t.isSelected?this.updateSelection(this.selection.filter(o=>o.id!==t.id)):this.updateSelection([t,...this.selection]))}updateSelection(t){t.length?this.selection=this.files.filter(o=>t.indexOf(o)>-1?(o.isSelected=!0,!0):(o.isSelected=!1,!1)):this.selection=this.selection.filter(o=>(o.isSelected=!1,!1)),this.hasSelection=!!this.selection.length,this.hasDisabledItemsInSelection=!!this.selection.find(o=>o.isDisabled),this.canCompress=!this.hasDisabledItemsInSelection&&(this.selection.length>1||this.selection.length===1&&this.selection[0].isCompressible),this.multipleSelection=this.selection.length>1||this.selection.length===1&&this.selection[0].isDir,this.store.filesSelection.set(this.selection)}selectRangeFiles(t){let o=this.files.indexOf(t),r=this.selection.map(T=>this.files.indexOf(T)),p=[],u=Math.min(...r),v=Math.max(...r);if(o<u)for(let T=o;T<u;T++)p.push(this.files[T]);else if(o>v)for(let T=o;T>v;T--)p.push(this.files[T]);this.updateSelection([...this.selection,...p])}initEventHandlers(){this.zone.runOutsideAngular(()=>{this.eventDragOverHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragover",t=>{if(this.inSharesList||this.isTrashRepo&&!this.moveFromDrag)return t.preventDefault(),!1;["TD","TR","DIV","APP-VIRTUAL-SCROLL","IMG"].indexOf(t.target.nodeName)>-1&&(t.preventDefault(),this.moveFromDrag?t.dataTransfer.dropEffect="move":t.dataTransfer.dropEffect="copy")}),this.eventDragStartHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragstart",t=>{if(this.inSharesList&&t.preventDefault(),t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV"){let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&(this.selection.indexOf(o)===-1&&this.zone.run(()=>this.updateSelection([o])),this.moveFromDrag=!0)}}),this.eventDragEnterHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragenter",t=>{if(t.preventDefault(),this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV")){let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&o.isDir&&this.selection.indexOf(o)===-1&&(t.target.parentElement.nodeName==="TD"?this.renderer.addClass(t.target.parentElement,Pn):t.target.parentElement.classList.contains("card-body")&&this.renderer.addClass(t.target.parentElement.parentElement,Pn))}}),this.eventDragLeaveHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragleave",t=>{t.preventDefault(),this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"?this.renderer.removeClass(t.target.parentElement,Pn):t.target.parentElement.classList.contains("card-body")&&this.renderer.removeClass(t.target.parentElement.parentElement,Pn))}),this.eventDragEndHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragend",t=>{t.preventDefault(),this.moveFromDrag=!1}),this.eventDropHandler=this.renderer.listen(this.scrollView.element.nativeElement,"drop",t=>{if(this.inSharesList||this.isTrashRepo&&!this.moveFromDrag)return t.preventDefault(),!1;if(this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV")){t.preventDefault();let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&o.isDir&&this.selection.indexOf(o)===-1&&(this.renderer.removeClass(t.target.parentElement,Pn),this.selection.length&&this.zone.run(()=>this.filesService.copyMove(this.selection,o.path,Le.MOVE)))}else return t.dataTransfer.files.length?(t.preventDefault(),this.zone.run(()=>this.onDropFiles(t)),!1):(t.preventDefault(),!1)}),this.eventKeysHandler=this.renderer.listen(this.scrollView.element.nativeElement,"keydown",t=>{if(this.renamingInProgress)return;let o=t.keyCode||t.which;if([37,38,39,40].indexOf(o)===-1)return;if((o===37||o===39)&&!this.galleryMode.enabled)return;t.preventDefault(),t.stopPropagation();let r,p=this.selection.map(N=>this.files.indexOf(N)),u=this.galleryMode.enabled;o===37?(u=!1,o=38):o===39&&(u=!1,o=40),o===38?(u?r=Math.min(...p)-Math.ceil(this.scrollView.element.nativeElement.offsetWidth/(this.galleryMode.dimensions+this.galleryMode.margins)):r=Math.min(...p)-1,r<=-1&&(r=this.files.length-1)):(u?r=Math.max(...p)+Math.ceil(this.scrollView.element.nativeElement.offsetWidth/(this.galleryMode.dimensions+this.galleryMode.margins)):r=Math.max(...p)+1,r>=this.files.length&&(r=0));let v=this.files[r];this.zone.run(()=>{!t.shiftKey&&!t.ctrlKey&&!t.metaKey?this.updateSelection([v]):this.modifySelection(v)});let T=this.scrollView.element.nativeElement.querySelectorAll(Wc);if(T.length){let N;o===38?(N=T[0],Sa(N)||N.scrollIntoView(!0)):(N=T[T.length-1],Sa(N)||N.scrollIntoView(!1))}else setTimeout(()=>this.scrollView.scrollInto(v),0)})})}destroyEventHandlers(){for(let t of[this.eventDragStartHandler,this.eventDragOverHandler,this.eventDragEnterHandler,this.eventDragLeaveHandler,this.eventDragEndHandler,this.eventDropHandler,this.eventKeysHandler].filter(o=>o))try{t()}catch(o){console.warn(o)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-browser"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(wh,7),Y(Th,7),Y(Eh,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.mainReadOnlyContextMenu=p.first),W(p=j())&&(r.fileContextMenu=p.first)}},hostBindings:function(o,r){o&1&&f("keydown",function(u){return r.onKeyPress(u)},Ao)},decls:57,vars:41,consts:[["CommonMessages",""],["FileContextMenu",""],["ShareContextMenu",""],["MainReadOnlyContextMenu",""],["MainContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["dropdown","",1,"btn-group","btn-group-sm","me-1",3,"isDisabled"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"me-1"],[1,"mx-auto"],["l10nTranslate",""],["contextMenuItem",""],["contextMenuItem","",3,"subMenu"],["contextMenuItem","",3,"execute"],["dropdown","",1,"btn-group","btn-group-sm","me-1",3,"onShown"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["appUploadFiles","","id","uploadFilesButton",1,"dropdown-item",3,"uploadFiles","options"],["appUploadFiles","","id","uploadFoldersButton",1,"dropdown-item",3,"options"],["appUploadFiles","","id","uploadFoldersButton",1,"dropdown-item",3,"uploadFiles","options"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"disabled","tooltip"],[1,"dropdown-divider"],[1,"dropdown-item"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],[4,"ngTemplateOutlet"],["id","thumb-files","tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","deleted","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",1,"img-fluid",3,"max-height","src"],["alt","","draggable","true",3,"src","height","width"],[1,"label-bottom-right"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer",3,"tooltip","font-size"],[1,"badge","rounded-pill","bg-primary","cursor-pointer",3,"font-size"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","ms-1",3,"font-size"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"font-size"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"font-size"],[1,"label-bottom-left"],[1,"label-top-right"],[1,"card-footer","text-center","text-truncate","p-1"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth","textCenter","font-size"],["draggable","false",1,"no-pointer-events",3,"font-size"],["alt","","draggable","true",1,"img-fluid",3,"error","src"],["alt","","draggable","true",3,"error","src","height","width"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer",3,"click","tooltip"],[1,"badge","rounded-pill","bg-primary","cursor-pointer",3,"click"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","ms-1",3,"click"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],[3,"user","height","width","fontSize"],[1,"badge","rounded-pill","bg-warning"],["appInputEdit","","type","text","required","",3,"renamingInProgress","updateObject","inputObject","fullWidth","textCenter"],["draggable","false",1,"no-pointer-events"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["id","table-files","tabindex","-1"],[3,"disabled","deleted","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],["draggable","true",1,"d-flex","align-items-center"],["alt","","draggable","false","height","30","width","30",3,"error","src"],["appInputEdit","","required","","type","text",3,"inputObject"],[1,"d-flex","flex-column","text-truncate"],["appInputEdit","","required","","type","text",3,"renamingInProgress","updateObject","inputObject"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"d-flex","flex-column","align-items-center"],[3,"user"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer","me-1",3,"tooltip"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer","me-1",3,"click","tooltip"],["tooltipPlacement","auto",3,"permissions"],[1,"fs-sm","text-center","text-danger","fw-bold","no-select"],[1,"fs-sm","text-center","text-muted","fw-bold","no-select"],["contextMenuItem","",3,"divider"]],template:function(o,r){if(o&1){let p=y();a(0,"div",5)(1,"button",6),b(2,"translate"),f("click",function(){return h(p),g(r.loadFiles())}),_(3,"fa-icon",7),l(),C(4,Ph,5,5,"div",8),a(5,"button",9),b(6,"translate"),f("click",function(){return h(p),g(r.downloadFiles())}),_(7,"fa-icon",10),l(),C(8,Nh,5,6,"div",11),C(9,Lh,4,7),a(10,"div",11)(11,"button",12),_(12,"fa-icon",10),l(),R(13,Qh,15,6,"ul",13),l(),a(14,"div",14)(15,"div",15),_(16,"app-input-filter",16),l(),a(17,"app-navigation-view",17),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.switchView(v))}),l()()(),C(18,c1,7,10,"div",18)(19,R1,13,10),a(20,"div",19)(21,"span"),C(22,N1,3,5,"span",20),C(23,V1,3,5,"span"),l(),a(24,"span",21),d(25),b(26,"translate"),l(),a(27,"span")(28,"span",22),d(29,"Total"),l(),d(30),b(31,"toBytes"),l()(),R(32,H1,4,1,"ng-template",null,0,Ft),a(34,"context-menu",null,1),C(36,q1,4,3),C(37,X1,1,0,null,23),C(38,J1,1,0,null,23),C(39,tg,1,0,null,23),C(40,ng,1,0,null,23),C(41,rg,1,1,null,24),R(42,ag,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.addToClipboard())}),R(43,sg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),C(44,pg,2,1),l(),a(45,"context-menu",null,2),R(47,dg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openShareDialog())}),R(48,mg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openShareLinkDialog())}),C(49,_g,1,0,null,23),l(),a(50,"context-menu",null,3),R(52,fg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openEmptyTrashDialog())}),l(),a(53,"context-menu",null,4),C(55,gg,1,0,null,23)(56,wg,5,1),l()}o&2&&(s(),m("tooltip",E(2,27,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),x(!r.isTrashRepo&&!r.inSharesList?4:-1),s(),m("disabled",!r.hasSelection||r.hasDisabledItemsInSelection)("tooltip",E(6,30,"Download",r.locale.language)),s(2),m("icon",r.icons.faDownload),s(),x(!r.isTrashRepo&&r.canShare.outside||r.inSharesList?8:-1),s(),x(r.isTrashRepo?9:-1),s(),m("isDisabled",!r.hasSelection),s(2),m("icon",r.icons.faEllipsis),s(5),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?18:19),s(4),x(r.stats.dirs?22:-1),s(),x(r.stats.files?23:-1),s(2),w(Mt(26,33,r.hasSelection?r.selection.length>1?"nb_selections":"one_selection":"no_selection",r.locale.language,Ne(39,Ah,r.selection.length))),s(5),D("\xA0",G(31,37,r.stats.size)),s(6),x(r.selection.length===1?36:-1),s(),x(r.hasDisabledItemsInSelection?-1:37),s(),x(r.canCompress?38:-1),s(),x(!r.inSharesList&&r.selection.length===1&&!r.selection[0].isCompressible?39:-1),s(),x(r.hasDisabledItemsInSelection?-1:40),s(),x(!r.isTrashRepo&&r.canShare.outside||r.inSharesList&&(r.selection[0]!=null&&r.selection[0].canBeReShared)?41:-1),s(3),x(r.inSharesList?-1:44),s(5),x(r.isFilesRepo?49:-1),s(6),x(r.inSharesList?55:56))},dependencies:[P,F,Ke,Me,Ri,Pi,Ii,Fi,Ve,Ot,Lt,Vt,Xe,ea,lt,zt,Ze,Ad,vt,nt,Z,mr,Ee,gt,Cr],encapsulation:2});let i=n;return i})();var $n=(i,n)=>n.id;function Tg(i,n){if(i&1){let e=y();a(0,"div",2)(1,"div",3)(2,"button",4),f("click",function(){h(e);let o=c(2);return g(o.addToClipboard())}),_(3,"fa-icon",5),d(4," Send to Clipboard "),l()()(),_(5,"hr",6)}if(i&2){let e=c(2);s(3),m("icon",e.icons.faClipboardCheck)}}function Eg(i,n){if(i&1){let e=y();a(0,"div",7)(1,"img",8),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(2,"span",9),d(3),l()()}if(i&2){let e=n.$implicit;s(),m("src",e.mimeUrl,ee),s(2),w(e.name)}}function Ag(i,n){if(i&1&&(a(0,"div",1),k(1,Eg,4,2,"div",7,$n),l()),i&2){let e=c(2);s(),M(e.files())}}function Dg(i,n){if(i&1&&(a(0,"div",27),_(1,"img",28),l()),i&2){let e=c().$implicit,t=c(3);B("height",t.cardImageSize,"px"),s(),B("max-height",t.cardImageSize,"px"),m("src",X("",e.thumbnailUrl,"?size=256"),ee)}}function kg(i,n){if(i&1&&_(0,"app-files-viewer-media",13),i&2){let e=c().$implicit,t=c(3);m("currentHeight",t.cardImageSize)("fileUrl",e.dataUrl)}}function Mg(i,n){if(i&1){let e=y();a(0,"img",29),f("error",function(){h(e);let o=c().$implicit;return g(o.fallBackMimeUrl())}),l()}if(i&2){let e=c().$implicit,t=c(3);B("height",t.cardImageSize,"px"),m("src",e.mimeUrl,ee)}}function Fg(i,n){if(i&1&&_(0,"fa-icon",21),i&2){let e=c(4);m("icon",e.icons.faSpinner)}}function Pg(i,n){if(i&1&&d(0),i&2){c();let e=As(16);D(" ",e," ")}}function Ig(i,n){if(i&1&&(a(0,"span",30),_(1,"fa-icon",5),a(2,"span",31),d(3,"Exclusive"),l()()),i&2){let e=c(5);s(),m("icon",e.icons.faLock)}}function Rg(i,n){if(i&1&&(a(0,"span",30),_(1,"fa-icon",5),a(2,"span",31),d(3,"Shared"),l()()),i&2){let e=c(5);s(),m("icon",e.icons.faUnlock)}}function Ng(i,n){if(i&1&&C(0,Ig,4,1,"span",30)(1,Rg,4,1,"span",30),i&2){let e=c().$implicit;x(e.lock.isExclusive?0:1)}}function Vg(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Lg(i,n){if(i&1&&(a(0,"span",25),_(1,"fa-icon",5),d(2),l()),i&2){let e=c().$implicit,t=c(3);s(),m("icon",t.icons.SHARES),s(),D("\xA0",e.shares.length+e.links.length," ")}}function Og(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Bg(i,n){if(i&1&&(a(0,"span",25),_(1,"fa-icon",5),d(2),l()),i&2){let e=c().$implicit,t=c(3);s(),m("icon",t.icons.SPACES),s(),D("\xA0",e.spaces.length)}}function Ug(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Hg(i,n){if(i&1&&(a(0,"div",22)(1,"div",18),d(2,"Owner"),l(),_(3,"app-user-avatar",33),l()),i&2){let e=c(2).$implicit;s(3),m("user",e.root.owner)("height",26)("width",26)}}function $g(i,n){if(i&1&&_(0,"app-file-permissions",32),i&2){let e=c(2).$implicit;m("permissions",e.root.hPerms)}}function zg(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Gg(i,n){if(i&1&&(_(0,"hr",15),a(1,"div",16),C(2,Hg,4,3,"div",22),a(3,"div",27)(4,"div",18),d(5,"Permissions"),l(),C(6,$g,1,1,"app-file-permissions",32)(7,zg,2,0,"span",23),l()()),i&2){let e=c().$implicit;s(2),x(e.root.owner?2:-1),s(4),x(e.root.permissions?6:7)}}function Wg(i,n){if(i&1){let e=y();a(0,"div",38),f("click",function(){h(e);let o=c(2).$implicit,r=c(3);return g(r.openLockDialog(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),b(4,"fileLockFormatPipe"),l()()}if(i&2){let e=c(2).$implicit,t=c(3);s(),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faUnlock),s(2),D("\xA0",G(4,2,e.lock))}}function jg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToSpace(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.SPACES),s(2),D("\xA0",e.name)}}function Kg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToShare(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.SHARES),s(2),D("\xA0",e.name)}}function Qg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToShare(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.LINKS),s(2),D("\xA0",e.name)}}function qg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToSync(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.SYNC),s(2),D("\xA0",e.clientName)}}function Yg(i,n){if(i&1&&(_(0,"hr",34),a(1,"div",35),C(2,Wg,5,4,"div",36),k(3,jg,4,2,"div",37,$n),k(5,Kg,4,2,"div",37,$n),k(7,Qg,4,2,"div",37,$n),k(9,qg,4,2,"div",37,$n),l()),i&2){let e=c().$implicit;s(2),x(e.lock?2:-1),s(),M(e.spaces),s(2),M(e.shares),s(2),M(e.links),s(2),M(e.syncs)}}function Xg(i,n){if(i&1){let e=y();a(0,"div",10)(1,"div",11),C(2,Dg,2,6,"div",12)(3,kg,1,2,"app-files-viewer-media",13)(4,Mg,1,3,"img",14),l()(),_(5,"hr",15),a(6,"div",16)(7,"div",17)(8,"div",18),d(9,"Name"),l(),a(10,"div",19),d(11),l()(),a(12,"div",17)(13,"div",18),d(14,"Size"),l(),a(15,"div",20),Ts(16),b(17,"async"),C(18,Fg,1,1,"fa-icon",21)(19,Pg,1,1),l()(),a(20,"div",17)(21,"div",18),d(22,"Created"),l(),a(23,"div",20),d(24),b(25,"amDateFormat"),l()(),a(26,"div",17)(27,"div",18),d(28,"Modified"),l(),a(29,"div",20),d(30),b(31,"amDateFormat"),l()(),a(32,"div",22)(33,"div",18),d(34,"Lock"),l(),C(35,Ng,2,1)(36,Vg,2,0,"span",23),l(),a(37,"div",22)(38,"div",18),d(39,"Shared"),l(),a(40,"div",24),C(41,Lg,3,2,"span",25)(42,Og,2,0,"span",23),l()(),a(43,"div",22)(44,"div",18),d(45,"Anchored"),l(),C(46,Bg,3,2,"span",25)(47,Ug,2,0,"span",23),l(),a(48,"div",22)(49,"div",18),d(50,"Synced"),l(),a(51,"span"),d(52),b(53,"translate"),l()(),a(54,"div",22)(55,"div",18),d(56,"Comments"),l(),a(57,"span",26),f("click",function(){h(e);let o=c(3);return g(o.goToComments())}),d(58),b(59,"translate"),l()()(),C(60,Gg,8,2),C(61,Yg,11,1)}if(i&2){let e,t=n.$implicit,o=c(3);s(2),x((e=t.shortMime)==="image"?2:e==="media"?3:4),s(9),w(t.name),s(5);let r=Es(G(17,18,o.getSizeLazy(t)));s(2),x(r===null?18:19),s(6),w(G(25,21,t.ctime)),s(6),w(G(31,23,t.mtime)),s(5),x(t.lock?35:36),s(6),x(t.shares.length||t.links.length?41:42),s(5),x(t.spaces.length?46:47),s(5),L(X("badge rounded-pill ",t.syncs.length?"bg-primary":"bg-secondary-alt")),s(),D(" ",E(53,25,t.syncs.length?"yes":"no",o.locale.language)," "),s(5),L(X("badge rounded-pill ",t.hasComments?"bg-success":"bg-secondary-alt"," cursor-pointer")),s(),D(" ",E(59,28,t.hasComments?"yes":"no",o.locale.language)," "),s(2),x(t.root?60:-1),s(),x(t.lock||t.spaces.length||t.shares.length||t.links.length||t.syncs.length?61:-1)}}function Zg(i,n){if(i&1&&k(0,Xg,62,31,null,null,$n),i&2){let e=c(2);M(e.files())}}function Jg(i,n){if(i&1&&(C(0,Tg,6,1),a(1,"div",0),C(2,Ag,3,0,"div",1)(3,Zg,2,0),l()),i&2){let e=c();x(e.multiple()?0:-1),s(),m("resizeOffset",e.resizeOffset()),s(),x(e.multiple()?2:3)}}var Vd=(()=>{let n=class n{constructor(){this.files=se.required(),this.locale=S($),this.multiple=ve(()=>this.files().length>1),this.resizeOffset=ve(()=>this.multiple()?120:80),this.cardImageSize=80,this.icons={SPACES:ie.SPACES,SHARES:ie.SHARES,LINKS:ie.LINKS,SYNC:cr.SYNC,faLock:ii,faUnlock:dl,faClipboardCheck:Uo,faArrowsAlt:ti,faSpinner:Ue},this.fileLockPropsToString=Ac,this.router=S(Ce),this.layout=S(I),this.filesService=S(He)}goToShare(t){this.layout.toggleRSideBar(!1),this.router.navigate([t.type===0?z.SHARED:z.LINKS],{queryParams:{select:t.name}}).catch(console.error)}goToSpace(t){this.layout.toggleRSideBar(!1),this.router.navigate([z.SPACES],{queryParams:{select:t.name}}).catch(console.error)}goToComments(){this.layout.showRSideBarTab(fe.COMMENTS,!0)}addToClipboard(){this.filesService.addToClipboard(this.files()),this.layout.showRSideBarTab(fe.CLIPBOARD,!0)}goToSync(t){this.layout.toggleRSideBar(!1),this.router.navigate([Ae.BASE,Ae.CLIENTS],{state:{clientId:t.clientId,pathId:t.id}}).catch(console.error)}openLockDialog(t){this.filesService.openLockDialog(t)}getSizeLazy(t){return t.isDir?(t.hDirSize||(t.hDirSize=this.filesService.getSize(t).pipe(bt(o=>rc(o,0,!0)),bo(()=>t.hDirSize=gi(t.hSize)),gs(1))),t.hDirSize):gi(t.hSize)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-selection"]],inputs:{files:[1,"files"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"flex-column","p-2","w-100"],[1,"px-2","pt-2","pb-0","fs-xxs"],[1,"d-flex","justify-content-center","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","me-1",3,"click"],[3,"icon"],[1,"mx-0","mt-2","mb-0"],[1,"d-inline-flex","w-100","align-content-center","align-items-center","mx-1"],["alt","","height","30","width","auto",1,"me-1",3,"error","src"],[1,"text-truncate"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"d-flex","align-items-center",3,"height"],[3,"currentHeight","fileUrl"],["alt","",3,"src","height"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],["animation","spin-pulse",3,"icon"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"d-flex","col-sm-7"],[1,"badge","rounded-pill","bg-primary"],[3,"click"],[1,"d-flex","align-items-center"],["alt","",1,"img-fluid",3,"src"],["alt","",3,"error","src"],["l10nTranslate","",1,"badge","rounded-pill","bg-maroon"],["l10nTranslate","",1,"ms-1"],[3,"permissions"],["tooltipPlacement","bottom",3,"user","height","width"],[1,"mt-1","mb-2"],[1,"d-flex","flex-wrap","align-items-center","p-2","fs-xs"],[1,"badge","rounded-pill","white-space-normal","bg-maroon","cursor-pointer","mb-2"],[1,"badge","rounded-pill","white-space-normal","bg-primary","cursor-pointer","me-1","mb-2"],[1,"badge","rounded-pill","white-space-normal","bg-maroon","cursor-pointer","mb-2",3,"click"],[1,"badge","rounded-pill","white-space-normal","bg-primary","cursor-pointer","me-1","mb-2",3,"click"]],template:function(o,r){o&1&&C(0,Jg,4,3),o&2&&x(r.files().length?0:-1)},dependencies:[ce,P,F,Fc,Ze,vt,Fe,Z,sn,Cr],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function eC(i,n){if(i&1&&d(0),i&2){let e=c(2);D(" ",e.link().link.currentIp," ")}}function tC(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);D(" ",G(1,1,e.link().link.currentAccess)," ")}}function iC(i,n){if(i&1&&d(0),i&2){let e=c(2);D(" ",e.link().link.lastIp," ")}}function nC(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);D(" ",G(1,1,e.link().link.lastAccess)," ")}}function oC(i,n){if(i&1&&(a(0,"span")(1,"span"),d(2),b(3,"translate"),b(4,"translate"),l()()),i&2){let e=c(2);L(X("badge rounded-pill bg-",e.link().hTimeExpirationAgo>=1?"warning":"danger")),s(2),w(e.link().hTimeExpirationAgo>=1?e.link().hTimeExpirationAgo+"\xA0"+E(3,4,"days",e.locale.language):E(4,7,"expired",e.locale.language))}}function rC(i,n){i&1&&(a(0,"span",13),d(1," no "),l())}function aC(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(2);L(X("badge rounded-pill ",e.link().link.nbAccess>=e.link().link.limitAccess?"bg-danger":"bg-success")),s(),Re(" ",e.link().link.nbAccess,"/",e.link().link.limitAccess," ")}}function sC(i,n){if(i&1&&(a(0,"span",14),d(1),l()),i&2){let e=c(2);s(),w(e.link().link.nbAccess)}}function lC(i,n){if(i&1&&_(0,"app-file-permissions",16),i&2){let e=c(2);m("permissions",e.link().hPerms)}}function cC(i,n){i&1&&(a(0,"span",13),d(1,"no"),l())}function pC(i,n){if(i&1){let e=y();a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),f("error",function(){h(e);let o=c();return g(o.link().fallBackMimeUrl())}),l()()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),l()(),a(11,"div",6)(12,"div",7),d(13,"Created"),l(),a(14,"div",9),d(15),b(16,"amDateFormat"),l()(),a(17,"div",10),f("mouseover",function(){h(e);let o=c();return g(o.accessHover=!0)})("mouseleave",function(){h(e);let o=c();return g(o.accessHover=!1)})("focus",function(){h(e);let o=c();return g(o.accessHover=!0)}),a(18,"div",7),d(19,"Accessed"),l(),a(20,"div",9),C(21,eC,1,1)(22,tC,2,3),l()(),a(23,"div",10),f("mouseover",function(){h(e);let o=c();return g(o.lastAccessHover=!0)})("mouseleave",function(){h(e);let o=c();return g(o.lastAccessHover=!1)})("focus",function(){h(e);let o=c();return g(o.accessHover=!0)}),a(24,"div",7),d(25,"Last access"),l(),a(26,"div",9),C(27,iC,1,1)(28,nC,2,3),l()(),a(29,"div",11)(30,"div",7),d(31,"Authentication"),l(),a(32,"span"),d(33),b(34,"translate"),l()(),a(35,"div",11)(36,"div",7),d(37,"Expired"),l(),C(38,oC,5,10,"span",12)(39,rC,2,0,"span",13),l(),a(40,"div",11)(41,"div",7),d(42,"Active"),l(),a(43,"span"),d(44),b(45,"translate"),l()(),a(46,"div",11)(47,"div",7),d(48,"Access"),l(),C(49,aC,2,5,"span",12)(50,sC,2,1,"span",14),l()(),_(51,"hr",4),a(52,"div",5)(53,"div",11)(54,"div",7),d(55,"Shared from"),l(),_(56,"app-share-repository",15),l(),a(57,"div",11)(58,"div",7),d(59,"Permissions"),l(),C(60,lC,1,1,"app-file-permissions",16)(61,cC,2,0,"span",13),l()()()}if(i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("height",e.cardImageSize,"px"),m("src",e.link().mimeUrl,ee),s(7),w(e.link().name),s(5),w(G(16,21,e.link().link.createdAt)),s(6),x(e.accessHover?21:22),s(6),x(e.lastAccessHover?27:28),s(5),L(X("badge rounded-pill ",e.link().link.requireAuth?"bg-success":"bg-warning")),s(),D(" ",E(34,23,e.link().link.requireAuth?"yes":"no",e.locale.language)," "),s(5),x(e.link().link.expiresAt?38:39),s(5),L(X("badge rounded-pill ",e.link().link.isActive?"bg-primary":"bg-danger")),s(),D(" ",E(45,26,e.link().link.isActive?"yes":"no",e.locale.language)," "),s(5),x(e.link().link.limitAccess!==0?49:50),s(7),m("share",e.link())("showIcon",!1),s(4),x(e.link().link.permissions?60:61)}}var Ld=(()=>{let n=class n{constructor(){this.link=se.required(),this.locale=S($),this.cardImageSize=80,this.resizeOffset=80,this.accessHover=!1,this.lastAccessHover=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-link-selection"]],inputs:{link:[1,"link"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],["alt","","draggable","false",3,"error","src"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],[1,"d-flex","mb-1",3,"mouseover","mouseleave","focus"],[1,"d-flex","align-items-center","mb-1"],[3,"class"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"badge","rounded-pill","bg-success"],[3,"share","showIcon"],[3,"permissions"]],template:function(o,r){o&1&&C(0,pC,62,29,"div",0),o&2&&x(r.link()?0:-1)},dependencies:[ce,P,ai,vt,Z,Fe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();var dC=()=>["shares"];function mC(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(2);s(),w(E(2,1,e.share().counts,Tt(4,dC)))}}function uC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function _C(i,n){if(i&1){let e=y();a(0,"span",15),f("click",function(){h(e);let o=c(2);return g(o.childShareDialog(o.share()))}),_(1,"fa-icon",16),a(2,"span"),d(3),l()()}if(i&2){let e=c(2);s(),m("icon",e.iconShared),s(2),w(e.share().counts.shares)}}function fC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function hC(i,n){if(i&1){let e=y();a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),f("error",function(){h(e);let o=c();return g(o.share().fallBackMimeUrl())}),l()()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),l()(),a(11,"div",6)(12,"div",7),d(13,"Created"),l(),a(14,"div",9),d(15),b(16,"amDateFormat"),l()(),a(17,"div",6)(18,"div",7),d(19,"Modified"),l(),a(20,"div",9),d(21),b(22,"amDateFormat"),l()(),a(23,"div",10)(24,"div",7),d(25,"Members"),l(),C(26,mC,3,5,"span")(27,uC,2,0,"span",11),l(),a(28,"div",10)(29,"div",7),d(30,"Child shares"),l(),C(31,_C,4,2,"span",12)(32,fC,2,0,"span",11),l(),a(33,"div",10)(34,"div",7),d(35,"Comments"),l(),a(36,"span",13),f("click",function(){h(e);let o=c();return g(o.goToComments())}),d(37),b(38,"translate"),l()()(),_(39,"hr",4),a(40,"div",5)(41,"div",10)(42,"div",7),d(43,"Shared from"),l(),_(44,"app-share-repository",14),l()()()}if(i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("height",e.cardImageSize,"px"),m("src",e.share().mimeUrl,ee),s(7),w(e.share().name),s(5),w(G(16,15,e.share().createdAt)),s(6),w(G(22,17,e.share().modifiedAt)),s(5),x(e.share().counts.users||e.share().counts.groups?26:27),s(5),x(e.share().counts.shares?31:32),s(5),L(X("badge rounded-pill ",e.share().hasComments?"bg-success":"bg-secondary-alt"," cursor-pointer")),s(),D(" ",E(38,19,e.share().hasComments?"yes":"no",e.locale.language)," "),s(7),m("share",e.share())("showIcon",!1)}}var Od=(()=>{let n=class n{constructor(){this.share=se.required(),this.locale=S($),this.iconShared=ie.SHARED_WITH_OTHERS,this.cardImageSize=80,this.resizeOffset=80,this.layout=S(I),this.sharesService=S(si)}childShareDialog(t){t.counts.shares&&this.layout.openDialog(Li,null,{initialState:{share:t}})}goToComments(){this.share().hasComments&&this.sharesService.goTo(this.share()).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-selection"]],inputs:{share:[1,"share"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],["alt","","draggable","false",3,"error","src"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[3,"click"],[3,"share","showIcon"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"]],template:function(o,r){o&1&&C(0,hC,45,22,"div",0),o&2&&x(r.share()?0:-1)},dependencies:[ce,P,F,ai,Z,Fe,oi],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function gC(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faSpinner)}}function CC(i,n){i&1&&(a(0,"span",5),d(1,"You have no files anchored on this space"),l())}var na=(()=>{let n=class n{constructor(){this.layout=S(I),this.addRootFileEvent=new vo,this.icons={faAnchor:ni,faPlus:Qe,faSpinner:Ue,SPACES:ie.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=S(ot)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:t=>this.setSpaceRoots(t),error:t=>{this.layout.sendNotification("error","Manage my anchored files",t.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Bn,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(pe(1)).subscribe(o=>this.addRootFileEvent.next(o))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(t=>({id:t.id,alias:t.alias,name:t.name,permissions:t.permissions,file:{id:t.file.id,path:t.file.path,mime:t.file.mime}}))).subscribe({next:t=>{this.setSpaceRoots(t),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Manage my anchored files",t.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(t){this.space.roots=[];for(let o of t)this.space.addRoot(Se(re({},o),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),C(5,gC,1,1,"fa-icon",3),a(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),l()(),a(9,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),a(10,"div",7),_(11,"app-space-manage-roots",8),C(12,CC,2,0,"span",5),l(),a(13,"div",9)(14,"button",10),f("click",function(){return r.openSelectRootDialog()}),_(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),l(),a(18,"button",12),f("click",function(){return r.layout.closeDialog()}),d(19,"Cancel"),l(),a(20,"button",13),f("click",function(){return r.onSubmit()}),d(21," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.SPACES),s(2),w(r.space.name),s(),x(r.loading?5:-1),s(6),m("space",r.space)("user",r.user)("showUsers",!1)("addRootFile",r.addRootFileEvent),s(),x(r.space.roots.length?-1:12),s(3),m("icon",r.icons.faPlus),s(),m("icon",r.icons.faAnchor),s(4),m("disabled",r.submitted))},dependencies:[F,P,Hn],encapsulation:2});let i=n;return i})();var xC=()=>["roots"],SC=(i,n)=>n.id;function vC(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(2);s(),w(E(2,1,e.space().counts,Tt(4,xC)))}}function yC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function bC(i,n){if(i&1){let e=y();a(0,"span",15),f("click",function(){h(e);let o=c(2);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",16),a(2,"span"),d(3),l()()}if(i&2){let e=c(2);s(),m("icon",e.icons.ANCHORED),s(2),w(e.space().counts.roots)}}function wC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function TC(i,n){if(i&1){let e=y();a(0,"span",18),f("click",function(){h(e);let o=c(3);return g(o.openChildShareDialog(o.space()))}),_(1,"fa-icon",16),a(2,"span"),d(3),l()()}if(i&2){let e=c(3);s(),m("icon",e.icons.SHARED),s(2),w(e.space().counts.shares)}}function EC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function AC(i,n){if(i&1&&(a(0,"div",10)(1,"div",7),d(2,"Child shares"),l(),C(3,TC,4,2,"span",17)(4,EC,2,0,"span",11),l()),i&2){let e=c(2);s(3),x(e.space().counts.shares?3:4)}}function DC(i,n){if(i&1&&_(0,"app-user-avatar",13),i&2){let e=n.$implicit;m("user",e)("isMember",!0)("height",26)("width",26)}}function kC(i,n){if(i&1&&_(0,"app-file-permissions",14),i&2){let e=c(2);m("permissions",e.space().hPerms)}}function MC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function FC(i,n){if(i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,"fa-icon",3),l()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),l()(),a(11,"div",6)(12,"div",7),d(13,"Created"),l(),a(14,"div",9),d(15),b(16,"amDateFormat"),l()(),a(17,"div",6)(18,"div",7),d(19,"Modified"),l(),a(20,"div",9),d(21),b(22,"amDateFormat"),l()(),a(23,"div",10)(24,"div",7),d(25,"Members"),l(),C(26,vC,3,5,"span")(27,yC,2,0,"span",11),l(),a(28,"div",10)(29,"div",7),d(30,"Anchored"),l(),C(31,bC,4,2,"span",12)(32,wC,2,0,"span",11),l(),C(33,AC,5,1,"div",10),l(),_(34,"hr",4),a(35,"div",5)(36,"div",10)(37,"div",7),d(38,"Managers"),l(),k(39,DC,1,4,"app-user-avatar",13,SC),l(),a(41,"div",10)(42,"div",7),d(43,"Permissions"),l(),C(44,kC,1,1,"app-file-permissions",14)(45,MC,2,0,"span",11),l()()()),i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("width",e.cardImageSize,"px")("height",e.cardImageSize,"px"),m("icon",e.icons.SPACES)("fixedWidth",!1),s(7),w(e.space().name),s(5),w(G(16,14,e.space().createdAt)),s(6),w(G(22,16,e.space().modifiedAt)),s(5),x(e.space().counts.users||e.space().counts.groups?26:27),s(5),x(e.space().counts.roots?31:32),s(2),x(e.space().role===e.SPACE_ROLE.IS_MANAGER?33:-1),s(6),M(e.space().managers),s(5),x(e.space().permissions?44:45)}}var Bd=(()=>{let n=class n{constructor(){this.space=se.required(),this.locale=S($),this.SPACE_ROLE=vn,this.icons={SPACES:ie.SPACES,ANCHORED:ie.ANCHORED,SHARED:ie.SHARED_WITH_OTHERS},this.cardImageSize=80,this.resizeOffset=80,this.userService=S(oe),this.layout=S(I)}openSpaceRootsDialog(){this.layout.openDialog(na,"md",{initialState:{space:this.space(),user:this.userService.user}})}openChildShareDialog(t){t.counts.shares&&this.layout.openDialog(Li,null,{initialState:{space:t}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-selection"]],inputs:{space:[1,"space"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"circle-primary-icon",2,"font-size","48px",3,"icon","fixedWidth"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],["tooltipPlacement","bottom",3,"user","isMember","height","width"],[3,"permissions"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"]],template:function(o,r){o&1&&C(0,FC,46,18,"div",0),o&2&&x(r.space()?0:-1)},dependencies:[ce,F,P,vt,Ze,oi,Fe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function PC(i,n){if(i&1&&(a(0,"span",11),d(1),l()),i&2){let e=c(2);s(),w(e.trash().nb)}}function IC(i,n){i&1&&(a(0,"span",12),d(1,"no"),l())}function RC(i,n){if(i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,"fa-icon",3),l()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),b(11,"translate"),l()(),a(12,"div",6)(13,"div",7),d(14,"Created"),l(),a(15,"div",9),d(16),b(17,"amDateFormat"),l()(),a(18,"div",6)(19,"div",7),d(20,"Modified"),l(),a(21,"div",9),d(22),b(23,"amDateFormat"),l()(),a(24,"div",10)(25,"div",7),d(26,"Elements"),l(),C(27,PC,2,1,"span",11)(28,IC,2,0,"span",12),l()()()),i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("width",e.cardImageSize,"px")("height",e.cardImageSize,"px"),m("icon",e.iconTrash)("fixedWidth",!1),s(7),w(e.trash().isPersonal?E(11,11,e.trash().name,e.locale.language):e.trash().name),s(6),w(G(17,14,e.trash().ctime)),s(6),w(G(23,16,e.trash().mtime)),s(5),x(e.trash().nb?27:28)}}var Ud=(()=>{let n=class n{constructor(){this.trash=se.required(),this.locale=S($),this.iconTrash=ie.TRASH,this.cardImageSize=80,this.resizeOffset=80}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-trash-selection"]],inputs:{trash:[1,"trash"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"circle-primary-icon",2,"font-size","48px",3,"icon","fixedWidth"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"d-flex","col-sm-7","word-break-all","fs-xxs"],[1,"d-flex","col-sm-7","fs-xxs"],[1,"d-flex","align-items-center","mb-1"],[1,"badge","rounded-pill","bg-danger"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"]],template:function(o,r){o&1&&C(0,RC,29,18,"div",0),o&2&&x(r.trash()?0:-1)},dependencies:[ce,F,P,Fe,Z],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function NC(i,n){if(i&1&&_(0,"app-files-selection",0),i&2){let e=c();m("files",e.store.filesSelection())}}function VC(i,n){if(i&1&&_(0,"app-space-selection",1),i&2){let e=c();m("space",e.store.spaceSelection())}}function LC(i,n){if(i&1&&_(0,"app-share-selection",2),i&2){let e=c();m("share",e.store.shareSelection())}}function OC(i,n){if(i&1&&_(0,"app-trash-selection",3),i&2){let e=c();m("trash",e.store.trashSelection())}}function BC(i,n){if(i&1&&_(0,"app-link-selection",4),i&2){let e=c();m("link",e.store.linkSelection())}}var Hd=(()=>{let n=class n{constructor(){this.store=S(te),this.SPACES_PATH=z,this.selectionType=ve(()=>this.setRepository(this.store.repository()))}setRepository(t){return[z.SPACES,z.SHARED,z.LINKS,z.TRASHES].indexOf(t)>-1?t:z.FILES}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-selection"]],decls:5,vars:1,consts:[[3,"files"],[3,"space"],[3,"share"],[3,"trash"],[3,"link"]],template:function(o,r){if(o&1&&C(0,NC,1,1,"app-files-selection",0)(1,VC,1,1,"app-space-selection",1)(2,LC,1,1,"app-share-selection",2)(3,OC,1,1,"app-trash-selection",3)(4,BC,1,1,"app-link-selection",4),o&2){let p;x((p=r.selectionType())===r.SPACES_PATH.FILES?0:p===r.SPACES_PATH.SPACES?1:p===r.SPACES_PATH.SHARED?2:p===r.SPACES_PATH.TRASHES?3:p===r.SPACES_PATH.LINKS?4:-1)}},dependencies:[Vd,Od,Bd,Ud,Ld],encapsulation:2,changeDetection:0});let i=n;return i})();var UC=["CommentCreate"],HC=(i,n)=>n.id;function $C(i,n){if(i&1){let e=y();a(0,"i",14),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.onEditComment(o))}),_(1,"fa-icon",15),l()}if(i&2){let e=c(3);s(),m("icon",e.icons.faEdit)}}function zC(i,n){if(i&1){let e=y();_(0,"textarea",16,1),a(2,"div",17)(3,"button",18),f("click",function(){h(e);let o=Be(1),r=c().$implicit,p=c(2);return g(p.updateComment(r,o.value))}),d(4," Update "),l(),a(5,"button",19),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.onEditComment(o))}),d(6," Cancel "),l(),a(7,"button",20),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.removeComment(o))}),d(8," Remove "),l()()}if(i&2){let e=Be(1),t=c().$implicit;m("ngModel",t.content)("disabled",!t.author.isAuthor&&t.isFileOwner),s(3),m("disabled",!e.value||t.content===e.value)}}function GC(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"amDateFormat"),l()),i&2){let e=c(2).$implicit;s(),w(G(2,1,e.dateToShow))}}function WC(i,n){i&1&&(a(0,"span",22),d(1,"modified"),l())}function jC(i,n){if(i&1&&(C(0,WC,2,0,"span",22),a(1,"span"),d(2),b(3,"amTimeAgo"),l()),i&2){let e=c(2).$implicit;x(e.wasModified?0:-1),s(2),w(G(3,2,e.dateToShow))}}function KC(i,n){if(i&1){let e=y();a(0,"div"),d(1),l(),a(2,"span",21),f("mouseleave",function(){h(e);let o=c().$implicit;return g(o.isHover=!1)})("mouseover",function(){h(e);let o=c().$implicit;return g(o.isHover=!0)})("focus",function(){h(e);let o=c().$implicit;return g(o.isHover=!0)}),C(3,GC,3,3,"span")(4,jC,4,4),l()}if(i&2){let e=c().$implicit;s(),w(e.content),s(2),x(e.isHover?3:4)}}function QC(i,n){if(i&1&&(a(0,"div",7)(1,"div",8),_(2,"app-user-avatar",9),a(3,"div",10)(4,"b"),d(5),b(6,"translate"),l()(),a(7,"div",11),C(8,$C,2,1,"i",12),l()(),a(9,"div",13),C(10,zC,9,3)(11,KC,5,2),l()()),i&2){let e=n.$implicit,t=c(2);s(2),m("user",e.author)("width",24)("height",24),s(3),w(e.author.isAuthor?E(6,6,"Me",t.locale.language):e.author.fullName),s(3),x(e.author.isAuthor||e.isFileOwner?8:-1),s(2),x(e.isEdited?10:11)}}function qC(i,n){if(i&1&&(a(0,"div",6),k(1,QC,12,9,"div",7,HC),l()),i&2){let e=c();s(),M(e.comments)}}var $d=(()=>{let n=class n{constructor(){this.locale=S($),this.comments=[],this.icons={faEdit:ul},this.store=S(te),this.file=ve(()=>this.store.filesSelection().length?this.store.filesSelection()[0]:null),this.layout=S(I),this.commentsService=S(Wr),this.subscriptions=[],this.subscriptions.push(di(this.file).subscribe(t=>this.loadComments(t)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onEditComment(t){t.isEdited||this.comments.forEach(o=>o.isEdited=!1),t.isEdited=!t.isEdited}loadComments(t){t&&t.hasComments?this.commentsService.getComments(this.file()).subscribe({next:o=>this.comments=o,error:o=>this.layout.sendNotification("error","Comments","Unable to load",o)}):this.comments=[]}postComment(){let t=this.commentInput.nativeElement.value;this.commentsService.createComment(this.file(),{content:t,fileId:this.file().id}).subscribe({next:o=>{this.comments.unshift(o),this.commentInput.nativeElement.value="",this.file().id=o.fileId,this.file().hasComments=!!this.comments.length},error:o=>this.layout.sendNotification("error","Comment","Unable to create",o)})}removeComment(t){this.commentsService.deleteComment(this.file(),{commentId:t.id,fileId:this.file().id}).subscribe({next:()=>{this.comments=this.comments.filter(o=>o.id!==t.id),this.file().hasComments=!!this.comments.length},error:o=>this.layout.sendNotification("error","Comment","Unable to delete",o)})}updateComment(t,o){this.commentsService.updateComment(this.file(),{commentId:t.id,fileId:this.file().id,content:o}).subscribe({next:r=>{t.isEdited=!1,Object.assign(t,r)},error:r=>{this.layout.sendNotification("error","Comment","Unable to update",r)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-comments-selection"]],viewQuery:function(o,r){if(o&1&&Y(UC,7),o&2){let p;W(p=j())&&(r.commentInput=p.first)}},decls:8,vars:7,consts:[["CommentCreate",""],["CommentUpdate",""],[1,"sidebar-component-title"],[1,"input-group","mb-0"],["type","text","appAutofocus","",1,"form-control","form-control-sm",3,"keyup.enter","disabled","placeholder"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"click","disabled"],["appAutoResize","",1,"fs-xxs","p-2"],[1,"mb-1","app-small-card","app-comment","rounded"],[1,"d-flex","px-2","pt-2","pb-1"],[3,"user","width","height"],[1,"align-self-center","ms-1"],[1,"ms-auto","align-self-center",2,"font-size","14px"],[1,"cursor-pointer"],[1,"pb-2","px-2"],[1,"cursor-pointer",3,"click"],[3,"icon"],["required","",1,"form-control","form-control-sm","mt-1","mb-2",3,"ngModel","disabled"],[1,"d-flex"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary","me-auto",3,"click","disabled"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xxs","btn-secondary","align-content-around",3,"click"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xxs","btn-danger","ms-auto",3,"click"],[1,"text-muted","no-select","pt-1","fs-xxxs",3,"mouseleave","mouseover","focus"],["l10nTranslate","",1,"me-1"]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"div",3)(2,"input",4,0),b(4,"translate"),f("keyup.enter",function(){return h(p),g(r.postComment())}),l(),a(5,"button",5),f("click",function(){return h(p),g(r.postComment())}),d(6," Add "),l()()(),C(7,qC,3,0,"div",6)}if(o&2){let p=Be(3);s(2),m("disabled",!r.file())("placeholder",E(4,4,"Write a comment ...",r.locale.language)),s(3),m("disabled",!p.value),s(2),x(r.comments.length?7:-1)}},dependencies:[Ye,P,ce,F,be,je,xe,ei,ye,Ze,Z,Fe,Je],encapsulation:2});let i=n;return i})();var YC=(i,n)=>n.key,XC=(i,n)=>n.id;function ZC(i,n){if(i&1&&(a(0,"option",8),d(1),l()),i&2){let e=n.$implicit;m("ngValue",e.key),s(),w(e.value.text)}}function JC(i,n){if(i&1){let e=y();a(0,"div",12)(1,"div",13)(2,"img",14),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"div",15),d(4),l(),a(5,"button",16),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.remove(o))}),_(6,"fa-icon",4),l()()()}if(i&2){let e=n.$implicit,t=c(2);s(),m("tooltip",e.path),s(),m("src",e.mimeUrl,ee),s(2),w(e.name),s(2),m("icon",t.icons.faTimes)}}function ex(i,n){if(i&1){let e=y();a(0,"div",5)(1,"div",6)(2,"select",7),ue("ngModelChange",function(o){h(e);let r=c();return me(r.selectedAction,o)||(r.selectedAction=o),g(o)}),k(3,ZC,2,2,"option",8,YC),b(5,"keyvalue"),l(),a(6,"button",9),f("click",function(){h(e);let o=c();return g(o.doAction())}),d(7,"Confirm"),l()()(),_(8,"hr",10),a(9,"div",11),k(10,JC,7,4,"div",12,XC),l()}if(i&2){let e=c();s(2),de("ngModel",e.selectedAction),s(),M(E(5,2,e.operations,e.originalOrderKeyValue)),s(6),m("resizeOffset",120),s(),M(e.files)}}var zd=(()=>{let n=class n{constructor(){this.locale=S($),this.icons={faTrashCan:Ai,faTimes:Rt,faDownload:Cn,faArrowsAlt:ti,faClone:gn,faQuestion:No},this.originalOrderKeyValue=De,this.operations={copyPaste:{text:"Copy-Paste",operation:Le.COPY},cutPaste:{text:"Cut-Paste",operation:Le.MOVE},download:{text:"Download",operation:Le.DOWNLOAD},compress:{text:"Compress",operation:Le.COMPRESS}},this.files=[],this.layout=S(I),this.store=S(te),this.filesService=S(He),this.selectedAction=this.filesService.clipboardAction,this.subscriptions=[],this.subscriptions.push(this.store.filesClipboard.subscribe(t=>this.files=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}clearAll(){this.layout.toggleRSideBar(!1),this.filesService.clearClipboard()}remove(t){this.files.length===1?this.clearAll():this.filesService.removeFromClipboard(t)}doAction(){if(this.selectedAction==="copyPaste"||this.selectedAction==="cutPaste")this.filesService.onPasteClipboard(this.selectedAction);else{let t={name:this.files[0].name,compressInDirectory:this.operations[this.selectedAction].operation===Le.COMPRESS,files:this.files.map(r=>({name:r.name,rootAlias:r.root?.alias,path:r.path})),extension:"tar"};this.layout.openDialog(ta,null,{initialState:{archiveProps:t}}).content.submitEvent.pipe(pe(1)).subscribe(()=>this.filesService.clearClipboard())}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-clipboard"]],decls:8,vars:7,consts:[[1,"sidebar-component-title"],["container","body","placement","left",1,"cursor-pointer",3,"icon","tooltip"],["l10nTranslate",""],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],[1,"px-2","pt-2","pb-2","fs-xs"],[1,"d-flex","justify-content-between","mt-2"],[1,"form-select","form-select-sm","my-auto",3,"ngModelChange","ngModel"],["l10nTranslate","",3,"ngValue"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary","ms-1",3,"click"],[1,"mx-0","mt-2","mb-0"],["appAutoResize","",1,"sidebar-item",3,"resizeOffset"],[1,"sidebar-item-container"],[1,"sidebar-item-content",3,"tooltip"],["alt","","height","28","width","auto",1,"me-1",3,"error","src"],[1,"text-truncate","fs-xxs"],[1,"btn","btn-xxs","btn-danger","ms-auto",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0),_(1,"fa-icon",1),b(2,"translate"),a(3,"span",2),d(4,"Clipboard"),l(),a(5,"button",3),f("click",function(){return r.clearAll()}),_(6,"fa-icon",4),l()(),C(7,ex,12,5)),o&2&&(s(),m("icon",r.icons.faQuestion)("tooltip",E(2,4,"Actions will be performed in the current folder",r.locale.language)),s(5),m("icon",r.icons.faTrashCan),s(),x(r.files.length?7:-1))},dependencies:[ce,F,Ke,Me,P,be,yi,bi,vi,xe,ye,Z,Ee],encapsulation:2});let i=n;return i})();var Gd=(()=>{let n=class n{constructor(){this.layout=S(I),this.store=S(te),this.tabs=[{label:fe.SELECTION,components:[Hd],loadComponent:!1,icon:Tl,count:{value:di(ve(()=>this.store.filesSelection().length>1?this.store.filesSelection().length>1e3?"999+":this.store.filesSelection().length:0)),level:"primary"},title:"Info",active:!1},{label:fe.TREE,components:[Xr],loadComponent:!0,icon:Nl,title:null,active:!1},{label:fe.COMMENTS,components:[$d],loadComponent:!1,icon:vr,title:null,active:!1},{label:fe.CLIPBOARD,components:[zd],loadComponent:!1,icon:jo,count:{value:this.store.filesClipboard.pipe(bt(t=>t.length)),level:"maroon"},showOnCount:!0,title:null,active:!1}],this.layout.setTabsRSideBar(nc.FILES,this.tabs)}ngOnDestroy(){this.layout.setTabsRSideBar(null)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-nav"]],decls:1,vars:0,template:function(o,r){o&1&&_(0,"router-outlet")},dependencies:[ln],encapsulation:2});let i=n;return i})();var Wd=(()=>{let n=class n{transform(t,o,r){if(typeof o>"u"||typeof o=="number"&&typeof r>"u")throw new Error("TimeAddPipe: missing required arguments");return Mi(t).add(o,r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=an({name:"amAdd",type:n,pure:!0});let i=n;return i})();var jd=(()=>{let n=class n{transform(t,o){if(!o)throw new Error("TimeDurationPipe: missing required time unit argument");return Mi.duration({[o]:t}).humanize()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=an({name:"amDuration",type:n,pure:!1});let i=n;return i})();function ix(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c();s(),w(e.space.name)}}function nx(i,n){i&1&&(a(0,"span",3),d(1,"Create a new space"),l())}function ox(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function rx(i,n){i&1&&(a(0,"h4",5)(1,"span",3),d(2,"Edit space"),l()())}function ax(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",48),d(2,"Settings"),l()),i&2){let e=c();m("icon",e.icons.faCog)}}function sx(i,n){if(i&1&&(a(0,"div",22)(1,"label",49),d(2,"Storage Usage"),l(),_(3,"app-storage-usage",50),l()),i&2){let e=c();s(3),m("item",e.space)}}function lx(i,n){i&1&&(a(0,"small",36),d(1,"At least one manager is required"),l())}function cx(i,n){if(i&1&&(a(0,"label",58),d(1,"Deactivation date"),l(),a(2,"div",59),d(3),b(4,"amDateFormat"),l()),i&2){let e=c(2);s(3),w(G(4,1,e.space.disabledAt))}}function px(i,n){if(i&1&&(a(0,"div",37)(1,"div",51),C(2,cx,5,3),l(),a(3,"div",52)(4,"label",53),d(5,"Creation date"),l(),a(6,"div",54),d(7),b(8,"amDateFormat"),l()(),a(9,"div",55)(10,"label",56),d(11,"Modification date"),l(),a(12,"div",57),d(13),b(14,"amDateFormat"),l()()()),i&2){let e=c();s(2),x(e.space.disabledAt&&!e.space.enabled?2:-1),s(5),w(G(8,3,e.space.createdAt)),s(6),w(G(14,5,e.space.modifiedAt))}}function dx(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",60),d(2,"Files"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.faAnchor),s(4),D("(",(e.space.roots==null?null:e.space.roots.length)||0,")")}}function mx(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",60),d(2,"Members"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.faUsers),s(4),D("(",e.space.members.length,")")}}function ux(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",60),d(2,"Links"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.LINKS),s(4),D("(",e.space.links.length,")")}}function _x(i,n){if(i&1){let e=y();a(0,"button",63),f("click",function(){h(e);let o=c(2);return g(o.confirmDeletion=!0)}),d(1," Remove "),l()}if(i&2){let e=c(2);m("disabled",e.confirmDeletion)}}function fx(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"amAdd"),b(3,"amTimeAgo"),l()),i&2){let e=c(3);s(),D("\xA0",E(3,5,Mt(2,1,e.space.disabledAt,e.SPACE_MAX_DISABLED_DAYS,"days"),!0))}}function hx(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"amDuration"),l()),i&2){let e=c(3);s(),D("\xA0",E(2,1,e.SPACE_MAX_DISABLED_DAYS,"days"))}}function gx(i,n){if(i&1&&(a(0,"div")(1,"span",3),d(2,"Space and data will be deleted in"),l(),a(3,"span",64),C(4,fx,4,8,"span")(5,hx,3,4,"span"),l()()),i&2){let e=c(2);L(X("text-danger white-space-truncate fs-sm ",e.user.isAdmin?"mx-auto":"me-auto")),s(4),x(e.space.disabledAt?4:5)}}function Cx(i,n){if(i&1&&(C(0,_x,2,1,"button",61),C(1,gx,6,4,"div",62)),i&2){let e=c();x(e.user.isAdmin?0:-1),s(),x(e.space.enabled?-1:1)}}function xx(i,n){if(i&1){let e=y();a(0,"button",65),f("click",function(){h(e);let o=c();return g(o.openCreateLinkDialog())}),_(1,"fa-icon",47)(2,"fa-icon",47),d(3," Link "),l()}if(i&2){let e=c();s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.LINKS)}}function Sx(i,n){if(i&1){let e=y();a(0,"button",67),f("click",function(){h(e);let o=c(2);return g(o.openAdminRootDialog())}),_(1,"fa-icon",47)(2,"fa-icon",47),d(3," External location "),l()}if(i&2){let e=c(2);s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.faUserShield)}}function vx(i,n){if(i&1){let e=y();a(0,"button",65),f("click",function(){h(e);let o=c();return g(o.openSelectRootDialog())}),_(1,"fa-icon",47)(2,"fa-icon",47),d(3," File "),l(),C(4,Sx,4,2,"button",66)}if(i&2){let e=c();s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.faAnchor),s(2),x(e.user.isAdmin?4:-1)}}var rs=(()=>{let n=class n{constructor(){this.space=new zc({id:0,name:"",createdAt:new Date,enabled:!0,storageUsage:0,storageQuota:null}),this.spaceChange=new ae,this.locale=S($),this.layout=S(I),this.icons={SPACES:ie.SPACES,LINKS:ie.LINKS,faPen:mt,faAnchor:ni,faUserShield:Wo,faPlus:Qe,faSpinner:Ue,faCog:Ei,faUsers:Go},this.SPACE_MAX_DISABLED_DAYS=30,this.addRootFileEvent=new vo,this.allowedLinkPermissions=[qe.ADD,qe.DELETE,qe.MODIFY],this.editManagers=!1,this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=S(oe),this.user=this.userService.user,this.spacesService=S(ot),this.linksService=S(li)}ngOnInit(){this.space.id||this.space.managers.unshift(gc(this.user,vn.IS_MANAGER))}searchManagers(t){let o={search:t,ignoreUserIds:[...this.space.managers.map(r=>r.id),...this.space.members.filter(r=>r.isUser).map(r=>r.id)],onlyUsers:!0};return this.userService.searchMembers(o)}searchMembers(t){let o={search:t,ignoreUserIds:[...this.space.managers.map(r=>r.id),...this.space.members.filter(r=>r.isUser).map(r=>r.id)],ignoreGroupIds:this.space.members.filter(r=>r.isGroup).map(r=>r.id)};return this.userService.searchMembers(o)}openSelectRootDialog(){this.layout.openDialog(Bn,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(pe(1)).subscribe(o=>this.addRootFileEvent.next(o))}openAdminRootDialog(){this.layout.openDialog(Zr,null,{initialState:{currentRoots:this.space.roots.filter(o=>o.externalPath)}}).content.submitEvent.pipe(pe(1)).subscribe(o=>this.addRootFileEvent.next(o))}openEditLinkDialog(t){this.linksService.editLinkDialog(t,this.space,pr.SPACE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.space)}setSpaceStatus(t){this.space.enabled=t,this.space.disabledAt=t?null:new Date}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.space.id===0&&this.layout.closeDialog(),this.spacesService.deleteSpace(this.space.id,{deleteNow:!0}).subscribe({next:()=>{this.loading=!1,this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Delete space",this.space.name,t)}})):this.space.id===0?this.spacesService.createSpace(this.space).subscribe({next:t=>{this.loading=!1,this.space=t,this.spaceChange.emit(["add",t]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Create space",this.space.name,t)}}):this.spacesService.updateSpace(this.space).subscribe({next:t=>{this.loading=!1,t?(this.space=t,this.spaceChange.emit(["update",t])):this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Edit space",this.space.name,t)}})}cantSubmit(){return this.submitted||!this.space.name||!this.space.managers.length}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-dialog"]],inputs:{space:"space"},outputs:{spaceChange:"spaceChange"},decls:70,vars:48,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"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[2,"max-width","85%"],[1,"mb-3","px-0"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"d-flex","flex-column","align-items-start","mb-3"],[1,"w-100",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","justify-content-between"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],["for","switchFullText","l10nTranslate",""],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"d-flex","flex-column","col-6"],["type","button",3,"click"],["for","editManagers","l10nTranslate","",1,"no-select-pointer"],["id","editManagers",1,"ms-1",3,"icon"],[3,"membersChange","members","searchFunction","editMode","hideInput","customPlaceholder"],["l10nTranslate","",1,"text-danger"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[1,"col-12"],[3,"space","user","addRootFile"],[3,"membersChange","members","withPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],[1,"d-flex","flex-column","align-items-start","col-4","px-0","text-danger"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],[3,"class"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[1,"fw-bold"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,ix,2,1,"span")(4,nx,2,0,"span",3),C(5,ox,1,1,"fa-icon",4),l(),C(6,rx,3,0,"h4",5),a(7,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),a(8,"div",7)(9,"tabset",8),_(10,"hr",9),a(11,"tab",10),f("selectTab",function(){return r.tabView=null}),R(12,ax,3,1,"ng-template",11),a(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),d(18," Space name "),l(),a(19,"input",17),ue("ngModelChange",function(u){return me(r.space.name,u)||(r.space.name=u),u}),l()(),a(20,"div",15)(21,"label",18),d(22," Description "),l(),a(23,"input",19),ue("ngModelChange",function(u){return me(r.space.description,u)||(r.space.description=u),u}),l()(),a(24,"div",20)(25,"app-storage-quota",21),ue("quotaChange",function(u){return me(r.space.storageQuota,u)||(r.space.storageQuota=u),u}),l()(),C(26,sx,4,1,"div",22),a(27,"div",23)(28,"div")(29,"label",24),d(30,"Space status"),l(),a(31,"div",25)(32,"input",26),f("ngModelChange",function(u){return r.setSpaceStatus(u)}),l(),a(33,"label",27),d(34),l()()(),a(35,"div")(36,"label",28),d(37,"Full-text search"),l(),a(38,"div",25)(39,"input",29),ue("ngModelChange",function(u){return me(r.space.storageIndexing,u)||(r.space.storageIndexing=u),u}),l(),a(40,"label",30),d(41),l()()()()()(),a(42,"div",31)(43,"div",32),f("click",function(){return r.editManagers=!r.editManagers}),a(44,"label",33),d(45,"Managers"),l(),_(46,"fa-icon",34),l(),a(47,"app-user-search",35),ue("membersChange",function(u){return me(r.space.managers,u)||(r.space.managers=u),u}),l(),C(48,lx,2,0,"small",36),C(49,px,15,7,"div",37),l()()(),a(50,"tab",38),f("selectTab",function(){return r.tabView="roots"}),R(51,dx,5,2,"ng-template",11),a(52,"div",39),_(53,"app-space-manage-roots",40),l()(),a(54,"tab",38),f("selectTab",function(){return r.tabView="members"}),R(55,mx,5,2,"ng-template",11),a(56,"div",9)(57,"app-user-search",41),ue("membersChange",function(u){return me(r.space.members,u)||(r.space.members=u),u}),l()()(),a(58,"tab",38),f("selectTab",function(){return r.tabView="links"}),R(59,ux,5,2,"ng-template",11),a(60,"div",9)(61,"app-user-search",42),ue("membersChange",function(u){return me(r.space.links,u)||(r.space.links=u),u}),l()()()()(),a(62,"div",43),C(63,Cx,2,2),C(64,xx,4,2,"button",44),C(65,vx,5,3),a(66,"button",45),f("click",function(){return r.onCancel()}),d(67,"Cancel"),l(),a(68,"button",46),f("click",function(){return r.onSubmit()}),d(69),l()()),o&2&&(s(2),m("icon",r.icons.SPACES),s(),x(r.space.id?3:4),s(2),x(r.loading?5:-1),s(),x(r.space.id?6:-1),s(),L(X("btn-close btn-close-white ",r.space.id?"ms-2":"ms-auto"," ms-2")),s(2),m("justified",!0),s(10),L(X("form-control form-control-sm ",r.space.name?"":"is-invalid")),de("ngModel",r.space.name),s(4),de("ngModel",r.space.description),s(2),de("quota",r.space.storageQuota),m("fullWidth",!0),s(),x(r.space.storageUsage?26:-1),s(6),m("ngModel",r.space.enabled),s(2),D(" ",r.space.enabled?"enabled":"disabled"," "),s(5),de("ngModel",r.space.storageIndexing),s(2),D(" ",r.space.storageIndexing?"enabled":"disabled"," "),s(5),m("icon",r.icons.faPen),s(),de("members",r.space.managers),m("searchFunction",r.searchManagers.bind(r))("editMode",r.editManagers)("hideInput",!r.editManagers)("customPlaceholder","Type to search for managers to add"),s(),x(r.space.managers.length?-1:48),s(),x(r.space.id?49:-1),s(4),m("space",r.space)("user",r.user)("addRootFile",r.addRootFileEvent),s(4),de("members",r.space.members),m("withPermissions",!0)("searchFunction",r.searchMembers.bind(r)),s(4),de("members",r.space.links),m("filterPermissions",!0)("allowedPermissions",r.allowedLinkPermissions)("withPermissions",!0)("editFunction",r.openEditLinkDialog.bind(r))("hideInput",!0),s(2),x(!r.tabView&&r.space.id?63:-1),s(),x(r.tabView==="links"?64:-1),s(),x(r.tabView==="roots"?65:-1),s(3),L(X("btn btn-sm ",r.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",r.cantSubmit()),s(),D(" ",r.confirmDeletion?"Confirm permanent deletion of data":"Confirm"," "))},dependencies:[P,F,hr,_r,ur,fr,be,je,Pt,xe,ei,ye,Ye,gr,An,Hn,En,Je,Wd,jd,Fe],encapsulation:2});let i=n;return i})();var yx=["MainContextMenu"],bx=["TargetContextMenu"],wx=()=>["roots","shares"],Kd=(i,n)=>n.id,Qd=(i,n)=>n.mid,qd=(i,n)=>n.key;function Tx(i,n){if(i&1){let e=y();a(0,"button",3),b(1,"translate"),f("click",function(){h(e);let o=c();return g(o.openSpaceDialog(!0))}),_(2,"fa-icon",7),l()}if(i&2){let e=c();m("tooltip",E(1,2,"New space",e.locale.language)),s(2),m("icon",e.icons.faPlus)}}function Ex(i,n){if(i&1&&(a(0,"span",29),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function Ax(i,n){if(i&1&&_(0,"app-user-avatar",30),i&2){let e=n.$implicit,t=c(4);m("user",e)("isMember",!0)("height",t.galleryMode.dimensions/3)("width",t.galleryMode.dimensions/3)}}function Dx(i,n){if(i&1&&(a(0,"span",26),k(1,Ax,1,4,"app-user-avatar",30,Qd),l()),i&2){let e=c().$implicit;s(),M(e.managers)}}function kx(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),a(1,"div",22),_(2,"fa-icon",23),a(3,"span",24),C(4,Ex,2,3,"span",25),l(),C(5,Dx,3,0,"span",26),l(),a(6,"div",27)(7,"span",28),d(8),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),s(),Zt("rowIndex",t),s(),B("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),m("icon",o.icons.SPACES),s(2),x(e.newly?4:-1),s(),x(e.managers.length?5:-1),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.name)}}function Mx(i,n){if(i&1){let e=y();a(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",19),k(4,kx,9,21,"div",20,Kd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.spaces,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Fx(i,n){if(i&1&&_(0,"fa-icon",37),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Px(i,n){if(i&1){let e=y();a(0,"th",36),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,Fx,1,2,"fa-icon",37),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function Ix(i,n){if(i&1&&C(0,Px,3,10,"th",35),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Rx(i,n){if(i&1&&(a(0,"div",40),_(1,"fa-icon",41),a(2,"div",42)(3,"span",28),d(4),l(),a(5,"span",43),d(6),l()()()),i&2){let e=c(3).$implicit,t=c(2);s(),m("icon",t.icons.SPACES)("fixedWidth",!1),s(3),w(e.name),s(2),w(e.description)}}function Nx(i,n){if(i&1&&_(0,"app-user-avatar",44),i&2){let e=n.$implicit;m("user",e)("isMember",!0)}}function Vx(i,n){if(i&1&&k(0,Nx,1,2,"app-user-avatar",44,Qd),i&2){let e=c(3).$implicit;M(e.managers)}}function Lx(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(3).$implicit;s(),w(E(2,1,e.counts,Tt(4,wx)))}}function Ox(i,n){if(i&1){let e=y();a(0,"span",47),f("click",function(){h(e);let o=c(6);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",7),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.faAnchor),s(),D("\xA0",e.counts.roots," ")}}function Bx(i,n){if(i&1){let e=y();a(0,"span",48),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",49),a(2,"span"),d(3),l()()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SHARED),s(2),w(e.counts.shares)}}function Ux(i,n){if(i&1&&(C(0,Ox,3,2,"span",45),C(1,Bx,4,2,"span",46)),i&2){let e=c(3).$implicit,t=c(2);x(e.counts!=null&&e.counts.roots?0:-1),s(),x(e.role===t.SPACE_ROLE.IS_MANAGER&&e.counts.shares?1:-1)}}function Hx(i,n){if(i&1&&_(0,"app-file-permissions",50),i&2){let e=c(4).$implicit;m("permissions",e.hPerms)}}function $x(i,n){if(i&1&&C(0,Hx,1,1,"app-file-permissions",50),i&2){let e=c(3).$implicit;x(e.permissions?0:-1)}}function zx(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function Gx(i,n){if(i&1&&(a(0,"td"),C(1,Rx,7,4,"div",40)(2,Vx,2,0)(3,Lx,3,5,"span")(4,Ux,2,2)(5,$x,1,1)(6,zx,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="managers"?2:e==="members"?3:e==="info"?4:e==="permissions"?5:e==="modified"?6:-1)}}function Wx(i,n){if(i&1&&C(0,Gx,7,9,"td",39),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function jx(i,n){if(i&1){let e=y();a(0,"tr",38),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),k(1,Wx,1,1,null,null,qd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),s(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Kx(i,n){if(i&1){let e=y();a(0,"table",31)(1,"thead")(2,"tr"),k(3,Ix,1,1,null,null,qd),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",32),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",31)(9,"tbody",33),k(10,jx,4,7,"tr",34,Kd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.spaces,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Qx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"New space"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPlus)}}function qx(i,n){}function Yx(i,n){if(i&1){let e=y();R(0,Qx,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceDialog(!0))}),R(1,qx,0,0,"ng-template",17)}i&2&&(s(),m("divider",!0))}function Xx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Zx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Edit space"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPen)}}function Jx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Edit children shares"),l()),i&2){let e=c(3);s(),m("icon",e.icons.SHARED)}}function eS(i,n){if(i&1){let e=y();R(0,Jx,3,1,"ng-template",15),f("execute",function(){h(e);let o=c(2);return g(o.openChildShareDialog())})}}function tS(i,n){if(i&1){let e=y();R(0,Zx,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceDialog())}),C(1,eS,1,0,null,16)}if(i&2){let e=c();s(),x(e.selected!=null&&e.selected.counts.shares?1:-1)}}function iS(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Manage my anchored files"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faAnchor)}}function nS(i,n){if(i&1){let e=y();R(0,iS,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceRootsDialog())})}}function oS(i,n){}function rS(i,n){i&1&&R(0,oS,0,0,"ng-template",17),i&2&&m("divider",!0)}function aS(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var Yd=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.SPACE_ROLE=vn,this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.icons={SPACES:ie.SPACES,SHARED:ie.SHARED_WITH_OTHERS,faAnchor:ni,faArrowDown:_t,faArrowUp:dt,faRotate:Ti,faArrowRotateRight:ut,faUpload:er,faPlus:Qe,faPen:mt,faCircleInfo:Nt},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},managers:{label:"Managers",width:10,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},members:{label:"Members",width:20,class:"d-none d-md-table-cell",textCenter:!1,show:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",managers:"Managers",permissions:"Permissions",modified:"Modified"},this.loading=!1,this.spaces=[],this.selected=null,this.canCreateSpace=!1,this.canEditSpace=!1,this.canManageRoots=!1,this.router=S(Ce),this.activatedRoute=S(Jt),this.spacesService=S(ot),this.store=S(te),this.userService=S(oe),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],managers:[{prop:"managers",type:"length"}],permissions:[{prop:"permissions",type:"length"}],modified:[{prop:"modified",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadSpaces(),this.canCreateSpace=this.userService.userHavePermission(ft.SPACES_ADMIN),this.layout.setBreadcrumbIcon(ie.SPACES),this.layout.setBreadcrumbNav({url:`/${z.SPACES}/${Bt.SPACES}`,translating:!0,sameLink:!0}),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select)}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadSpaces(){this.loading=!0,this.onSelect(),this.spacesService.listSpaces().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.spaces=[],this.loading=!1,this.layout.sendNotification("error","Spaces",t.error.message)}})}browse(t){t.enabled?this.router.navigate([z.FILES,t.alias],{relativeTo:this.activatedRoute}).catch(console.error):this.layout.sendNotification("warning",t.name,"Space is disabled")}onSelect(t=null){t?(this.selected=t,this.canEditSpace=!!t.managers.find(o=>o.id===this.userService.user.id),this.canManageRoots=this.canEditSpace||t.havePermission(qe.SHARE_INSIDE)):(this.selected=null,this.canEditSpace=!1,this.canManageRoots=!1),this.store.spaceSelection.set(this.selected)}sortBy(t,o=!0,r){this.spaces=this.sortTable.sortBy(t,o,r||this.spaces)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}openSpaceDialog(t=!1){t?this.layout.openDialog(rs,"xl").content.spaceChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.concat(u)),this.onSelect(u))}):this.selected&&this.canEditSpace&&this.spacesService.getSpace(this.selected.id).subscribe({next:o=>{this.layout.openDialog(rs,"xl",{initialState:{space:o}}).content.spaceChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="update"?(this.selected.name=v.name,this.selected.alias=v.alias,this.selected.description=v.description,this.selected.counts=Se(re({},v.counts),{shares:this.selected.counts.shares}),this.selected.modifiedAt=v.modifiedAt,this.selected.enabled=v.enabled,this.selected.managers=[...v.managers]):u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.filter(T=>T.id!==v.id)))})},error:o=>this.layout.sendNotification("error","Edit space",this.selected.name,o)})}openSpaceRootsDialog(){setTimeout(()=>{this.layout.openDialog(na,"md",{initialState:{space:this.selected,user:this.userService.user}})},this.selected?0:100)}openChildShareDialog(t){t&&this.onSelect(t),this.layout.openDialog(Li,null,{initialState:{space:this.selected}}).content.sharesCountEvent.subscribe(r=>this.selected.counts.shares=r)}focusOn(t){let o=this.spaces.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(yx,7),Y(bx,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:34,vars:37,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[3,"user","isMember","height","width"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[1,"circle-primary-icon",3,"icon","fixedWidth"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadSpaces())}),_(3,"fa-icon",4),l(),C(4,Tx,3,5,"button",5),a(5,"button",6),b(6,"translate"),f("click",function(){return h(p),g(r.openSpaceDialog())}),_(7,"fa-icon",7),l(),a(8,"button",6),b(9,"translate"),f("click",function(){return h(p),g(r.openChildShareDialog())}),_(10,"fa-icon",7),l(),a(11,"button",6),b(12,"translate"),f("click",function(){return h(p),g(r.openSpaceRootsDialog())}),_(13,"fa-icon",7),l(),a(14,"div",8)(15,"div",9),_(16,"app-input-filter",10),l(),a(17,"app-navigation-view",11),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(18,Mx,6,8,"div",12)(19,Kx,12,8),a(20,"div",13)(21,"span",14),d(22),b(23,"translate"),l()(),a(24,"context-menu",null,0),C(26,Yx,2,1),R(27,Xx,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.loadSpaces())}),l(),a(28,"context-menu",null,1),C(30,tS,2,1),C(31,nS,1,0,null,16),C(32,rS,1,1,null,17),R(33,aS,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(s(),m("tooltip",E(2,22,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),x(r.canCreateSpace?4:-1),s(),m("disabled",!r.canEditSpace)("tooltip",E(6,25,"Edit space",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),m("disabled",!r.canEditSpace||!(r.selected!=null&&r.selected.counts.shares))("tooltip",E(9,28,"Edit children shares",r.locale.language)),s(2),m("icon",r.icons.SHARED),s(),m("disabled",!r.canManageRoots)("tooltip",E(12,31,"Manage my anchored files",r.locale.language)),s(2),m("icon",r.icons.faAnchor),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?18:19),s(4),Re("",r.spaces.length," ",E(23,34,"spaces",r.locale.language)),s(4),x(r.canCreateSpace?26:-1),s(4),x(r.canEditSpace?30:-1),s(),x(r.canManageRoots?31:-1),s(),x(r.canEditSpace||r.canManageRoots?32:-1))},dependencies:[P,F,Ze,Xe,Ke,Me,Ot,Lt,Vt,lt,Ve,vt,nt,Ee,oi,Z,gt],encapsulation:2});let i=n;return i})();var oa=class{constructor(n){this.newly=0,this.isPersonal=!1,Object.assign(this,n),this.isPersonal=this.alias===ht.PERSONAL,this.hTimeAgo=Mi(this.mtime).fromNow(!0),this.newly=ar(this.mtime)}};var sS=["MainContextMenu"],lS=["TargetContextMenu"],Xd=(i,n)=>n.id,Zd=(i,n)=>n.key;function cS(i,n){if(i&1&&(a(0,"span",25),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function pS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c().$implicit,t=c(2);D(" ",E(1,1,e.name,t.locale.language)," ")}}function dS(i,n){if(i&1&&d(0),i&2){let e=c().$implicit;D(" ",e.name," ")}}function mS(i,n){if(i&1){let e=y();a(0,"div",16),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),a(1,"div",17),_(2,"fa-icon",18),a(3,"span",19),C(4,cS,2,3,"span",20),l(),a(5,"span",21)(6,"span",22),d(7),l()()(),a(8,"div",23)(9,"span",24),C(10,pS,2,4)(11,dS,1,1),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("selected",e.id===(o.selected==null?null:o.selected.id)),s(),Zt("rowIndex",t),s(),B("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),m("icon",e.isPersonal?o.icons.PERSONAL:o.icons.SPACES),s(2),x(e.newly?4:-1),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.nb),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),x(e.isPersonal?10:11)}}function uS(i,n){if(i&1){let e=y();a(0,"div",9)(1,"app-virtual-scroll",13),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",14),k(4,mS,12,21,"div",15,Xd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.trashBins,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function _S(i,n){if(i&1&&_(0,"fa-icon",32),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function fS(i,n){if(i&1){let e=y();a(0,"th",31),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,_S,1,2,"fa-icon",32),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function hS(i,n){if(i&1&&C(0,fS,3,10,"th",30),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function gS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c(4).$implicit,t=c(2);D(" ",E(1,1,e.name,t.locale.language)," ")}}function CS(i,n){if(i&1&&d(0),i&2){let e=c(4).$implicit;D(" ",e.name," ")}}function xS(i,n){if(i&1&&(a(0,"div",35),_(1,"fa-icon",18),a(2,"span",24),C(3,gS,2,4)(4,CS,1,1),l()()),i&2){let e=c(3).$implicit,t=c(2);s(),m("icon",e.isPersonal?t.icons.PERSONAL:t.icons.SPACES),s(2),x(e.isPersonal?3:4)}}function SS(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(3).$implicit;s(),w(e.nb)}}function vS(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function yS(i,n){if(i&1&&(a(0,"td"),C(1,xS,5,2,"div",35)(2,SS,2,1,"span",22)(3,vS,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="nb"?2:e==="modified"?3:-1)}}function bS(i,n){if(i&1&&C(0,yS,4,9,"td",34),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function wS(i,n){if(i&1){let e=y();a(0,"tr",33),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),k(1,bS,1,1,null,null,Zd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("selected",e.id===(t.selected==null?null:t.selected.id)),s(),M(E(3,2,t.tableHeaders,t.originalOrderKeyValue))}}function TS(i,n){if(i&1){let e=y();a(0,"table",26)(1,"thead")(2,"tr"),k(3,hS,1,1,null,null,Zd),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",27),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",26)(9,"tbody",28),k(10,wS,4,5,"tr",29,Xd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.trashBins,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function ES(i,n){if(i&1&&(a(0,"span",36),_(1,"fa-icon",37),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function AS(i,n){if(i&1&&(a(0,"span",36),_(1,"fa-icon",37),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var Jd=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.originalOrderKeyValue=De,this.icons={SPACES:ie.SPACES,PERSONAL:ie.PERSONAL,faArrowDown:_t,faArrowUp:dt,faArrowRotateRight:ut,faCircleInfo:Nt},this.TAB_MENU=fe,this.loading=!1,this.selected=null,this.trashBins=[],this.tableHeaders={name:{label:"Space",width:50,textCenter:!1,class:"",show:!0,sortable:!0},nb:{label:"Elements",width:10,textCenter:!0,class:"",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",nb:"Elements",mtime:"Modified"},this.router=S(Ce),this.store=S(te),this.spacesService=S(ot),this.sortSettings={default:[{prop:"isPersonal",type:"number"},{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],nb:[{prop:"nb",type:"number"}],modified:[{prop:"mtime",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadTrashBins(),this.layout.setBreadcrumbIcon(ie.TRASH),this.layout.setBreadcrumbNav({url:`/${z.TRASH}/${Bt.TRASH}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadTrashBins(){this.loading=!0,this.onSelect(),this.spacesService.listTrashBins().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t.map(o=>new oa(o))),this.loading=!1}})}onSelect(t=null){this.selected=t,this.store.trashSelection.set(this.selected)}sortBy(t,o=!0,r){this.trashBins=this.sortTable.sortBy(t,o,r||this.trashBins)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}browse(t){this.router.navigate([z.SPACES_TRASH,t.alias]).catch(console.error)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-trash"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(sS,7),Y(lS,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:20,vars:14,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],["contextMenuItem","",3,"execute"],[1,"app-foot-menu"],[1,"mx-auto"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right"],[1,"badge","rounded-pill","bg-danger"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],["l10nTranslate",""],[3,"icon"]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadTrashBins())}),_(3,"fa-icon",4),l(),a(4,"div",5)(5,"div",6),_(6,"app-input-filter",7),l(),a(7,"app-navigation-view",8),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(8,uS,6,8,"div",9)(9,TS,12,8),a(10,"context-menu",null,0),R(12,ES,3,1,"ng-template",10),f("execute",function(){return h(p),g(r.loadTrashBins())}),l(),a(13,"context-menu",null,1),R(15,AS,3,1,"ng-template",10),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l(),a(16,"div",11)(17,"span",12),d(18),b(19,"translate"),l()()}o&2&&(s(),m("tooltip",E(2,8,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?8:9),s(10),Re("",r.trashBins.length," ",E(19,11,"trash bins",r.locale.language)))},dependencies:[F,lt,Ve,Ke,Me,Xe,P,Ot,Lt,Vt,nt,Z,Ee,gt],encapsulation:2});let i=n;return i})();var Oi=i=>(S(te).repository.set(i.data.repository),i.url);var em=[{path:"",component:Gd,children:[{path:z.SPACES,pathMatch:"full",component:Yd,resolve:{routes:Oi},data:{repository:z.SPACES}},{path:z.TRASH,pathMatch:"full",component:Jd,resolve:{routes:Oi},data:{repository:z.TRASHES}},{path:z.SHARED,pathMatch:"full",component:Ed,resolve:{routes:Oi},data:{repository:z.SHARED}},{path:z.LINKS,pathMatch:"full",component:cd,resolve:{routes:Oi},data:{repository:z.LINKS}},{path:z.SPACES_FILES,children:[{path:"**",component:ia,resolve:{routes:Oi},data:{repository:z.FILES}}]},{path:z.SPACES_SHARES,children:[{path:"**",component:ia,resolve:{routes:Oi},data:{repository:z.SHARES}}]},{path:z.SPACES_TRASH,children:[{path:"**",component:ia,resolve:{routes:Oi},data:{repository:z.TRASH}}]}]}];var tm=()=>S(oe).userHavePermission(ft.DESKTOP_APP),im=()=>{let i=S(oe);return i.userHavePermission(ft.DESKTOP_APP_SYNC)&&!!i.user.clientId},nm=()=>{let i=S(ro),n=!!(i.wizard.localPath&&i.wizard.remotePath);return n||S(Ce).navigate([we.BASE,we.WIZARD,i.wizard.localPath?we.WIZARD_SERVER:we.WIZARD_CLIENT]).catch(console.error),n},om=()=>{let n=!!S(ro).wizard.localPath;return n||S(Ce).navigate([we.BASE,we.WIZARD,we.WIZARD_CLIENT]).catch(console.error),n};var rm=()=>S(ro).refreshPaths();var am=[{path:we.BASE,pathMatch:"prefix",canActivate:[im],resolve:[rm],children:[{path:"",pathMatch:"full",redirectTo:we.PATHS},{path:we.PATHS,pathMatch:"full",loadComponent:()=>import("./chunk-45AZ6ZML.js").then(i=>i.SyncPathsComponent)},{path:we.TRANSFERS,pathMatch:"full",loadComponent:()=>import("./chunk-LGIVVJDD.js").then(i=>i.SyncTransfersComponent)},{path:we.WIZARD,pathMatch:"full",redirectTo:`${we.WIZARD}/${we.WIZARD_CLIENT}`},{path:`${we.WIZARD}/${we.WIZARD_CLIENT}`,pathMatch:"full",loadComponent:()=>import("./chunk-FIUF2JM4.js").then(i=>i.SyncWizardClientComponent)},{path:`${we.WIZARD}/${we.WIZARD_SERVER}`,canActivate:[om],pathMatch:"full",loadComponent:()=>import("./chunk-CCZWPM7Q.js").then(i=>i.SyncWizardServerComponent)},{path:`${we.WIZARD}/${we.WIZARD_SETTINGS}`,canActivate:[nm],pathMatch:"full",loadComponent:()=>import("./chunk-PQZLR4P3.js").then(i=>i.SyncWizardSettingsComponent)}]}];var Bi="webdav",pi={SERVER:Xl,WEBDAV:Bi,PERSONAL:ht.PERSONAL,SPACES:ht.SPACES,SHARES:ht.SHARES,TRASH:ht.TRASH},rN={[pi.SERVER]:{route:"/",spaceRepository:null},[pi.WEBDAV]:{route:`/${Bi}`,spaceRepository:null},[pi.PERSONAL]:{route:`/${Bi}/${pi.PERSONAL}`,spaceRepository:[Jn.FILES,ht.PERSONAL]},[pi.SPACES]:{route:`/${Bi}/${pi.SPACES}`,spaceRepository:[Jn.FILES]},[pi.SHARES]:{route:`/${Bi}/${pi.SHARES}`,spaceRepository:[Jn.SHARES]},[pi.TRASH]:{route:`/${Bi}/${pi.TRASH}`,spaceRepository:[Jn.TRASH]}};function DS(i,n){if(i&1&&(a(0,"li",8),d(1),l()),i&2){let e=n.$implicit;s(),w(e)}}function kS(i,n){if(i&1){let e=y();a(0,"p",5),d(1," Keep these codes in a safe place. They will allow you to access your account if you lose access to your two-factor authentication. "),l(),a(2,"p",6),d(3," These recovery codes are for one-time use only and will only be displayed here once. "),l(),a(4,"ul",7),k(5,DS,2,1,"li",8,We),l(),a(7,"div",9)(8,"button",10),f("click",function(){h(e);let o=c();return g(o.downloadRecoveryCodes())}),d(9,"Download"),l(),a(10,"button",11),f("click",function(){h(e);let o=c();return g(o.clipBoardRecoveryCodes())}),d(11,"Copy"),l(),a(12,"button",12),f("click",function(){h(e);let o=c();return g(o.onClose(!0))}),d(13,"Close"),l()()}if(i&2){let e=c();s(5),M(e.recoveryCodes)}}function MS(i,n){if(i&1&&(a(0,"div",14),d(1),l()),i&2){let e=c(2);s(),w(e.hasError)}}function FS(i,n){i&1&&(a(0,"span",3),d(1,"Scan this QR code using your authenticator app."),l(),a(2,"small",28),d(3,"\xA0"),a(4,"i",3),d(5,"(Such as FreeOTP, Proton Authenticator etc.)"),l()())}function PS(i,n){if(i&1){let e=y();a(0,"div",13),C(1,MS,2,1,"div",14)(2,FS,6,0),l(),a(3,"div",15),_(4,"img",16),l(),a(5,"div",17)(6,"div",18),d(7,"Or enter this secret manually"),l(),a(8,"div"),_(9,"fa-icon",19),a(10,"strong",20),f("click",function(){h(e);let o=c();return g(o.clipBoardSecret())}),d(11),l()()(),_(12,"hr",21),a(13,"form",22),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit())}),a(14,"div",23),d(15,"Enter your password"),l(),a(16,"div",24)(17,"app-input-password",25),f("passwordChange",function(o){h(e);let r=c();return g(r.twoFaForm.controls.password.setValue(o))}),l()(),a(18,"div",23),d(19,"Valid with your TOTP code"),l(),a(20,"div",24),_(21,"input",26),l(),a(22,"div",9)(23,"button",27),d(24,"Confirm"),l(),a(25,"button",12),f("click",function(){h(e);let o=c();return g(o.onClose())}),d(26,"Cancel"),l()()()}if(i&2){let e=c();s(),x(e.hasError?1:2),s(3),m("src",e.qrDataUrl,ee),s(5),m("icon",e.icons.faCopy),s(2),w(e.secret),s(2),m("formGroup",e.twoFaForm),s(4),m("password",e.twoFaForm.value.password)("focus",!0)("centered",!0),s(4),m("maxlength",e.twoFaCodelength),s(2),m("disabled",e.twoFaForm.invalid||e.submitted)}}var sm=(()=>{let n=class n{constructor(){this.isValid=new ae,this.wasEnabled=!1,this.submitted=!1,this.hasError=null,this.icons={faKey:It,faLock:ii,faCopy:Sn},this.twoFaCodelength=pn,this.locale=S($),this.layout=S(I),this.userService=S(oe),this.clipBoardService=S(kn),this.fb=S(fn),this.twoFaForm=this.fb.group({totpCode:this.fb.control("",[Et.required,Et.pattern(new RegExp(`^\\d{${pn}}$`))]),password:this.fb.control("")})}onClose(t=!1){this.layout.closeDialog(),this.isValid.emit(t)}onSubmit(){this.submitted=!0,this.userService.enable2Fa({code:this.twoFaForm.value.totpCode,password:this.twoFaForm.value.password}).subscribe({next:t=>{t.success?(this.wasEnabled=!0,this.recoveryCodes=t.recoveryCodes,this.isValid.emit(!0)):this.hasError="Invalid code",setTimeout(()=>this.submitted=!1,1e3)},error:t=>{this.hasError=t.error?t.error.message:t,setTimeout(()=>this.submitted=!1,1e3)}})}clipBoardSecret(){this.clipBoardService.copyFromContent(this.secret),this.layout.sendNotification("info","Two-factor Authentication","Secret copied")}clipBoardRecoveryCodes(){this.clipBoardService.copyFromContent(this.recoveryCodes.join(`
9
+ `]});let i=n;return i})();var mf=["MainContextMenu"],uf=["TargetContextMenu"],_f=()=>["shares"],wd=(i,n)=>n.id,Td=(i,n)=>n.key;function ff(i,n){if(i&1&&(a(0,"span",31),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function hf(i,n){if(i&1){let e=y();a(0,"div",32),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",33),a(2,"span"),d(3),l()()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SHARED),s(2),w(e.counts.shares)}}function gf(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openShareDialog())}),a(1,"div",22)(2,"img",23),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"span",24),C(4,ff,2,3,"span",25),l(),C(5,hf,4,4,"div",26),a(6,"span",27),_(7,"app-share-repository",28),l()(),a(8,"div",29)(9,"span",30),d(10),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),s(),Zt("rowIndex",t),s(),m("src",e.mimeUrl,ee)("height",o.galleryMode.image)("width",o.galleryMode.image),s(2),x(e.newly?4:-1),s(),x(e.counts.shares?5:-1),s(2),m("share",e)("galleryMode",o.galleryMode),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.name)}}function Cf(i,n){if(i&1){let e=y();a(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",19),k(4,gf,11,19,"div",20,wd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function xf(i,n){if(i&1&&_(0,"fa-icon",6),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function Sf(i,n){if(i&1){let e=y();a(0,"th",39),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,xf,1,1,"fa-icon",6),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function vf(i,n){if(i&1&&C(0,Sf,3,10,"th",38),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function yf(i,n){if(i&1){let e=y();a(0,"div",42)(1,"img",44),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),a(2,"div",45)(3,"span",30),d(4),l(),a(5,"span",46),d(6),l()()()}if(i&2){let e=c(3).$implicit;s(),m("src",e.mimeUrl,ee),s(3),w(e.name),s(2),w(e.description)}}function bf(i,n){if(i&1&&_(0,"app-share-repository",43),i&2){let e=c(3).$implicit;m("share",e)}}function wf(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(3).$implicit;s(),w(E(2,1,e.counts,Tt(4,_f)))}}function Tf(i,n){if(i&1){let e=y();a(0,"span",49),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",33),a(2,"span"),d(3),l()()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SHARED),s(2),w(e.counts.shares)}}function Ef(i,n){if(i&1){let e=y();a(0,"span",50),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.goToComments(o))}),_(1,"fa-icon",6),l()}if(i&2){let e=c(6);s(),m("icon",e.icons.faCommentDots)}}function Af(i,n){if(i&1&&(C(0,Tf,4,2,"span",47),C(1,Ef,2,1,"span",48)),i&2){let e=c(3).$implicit;x(e.counts.shares?0:-1),s(),x(e.hasComments?1:-1)}}function Df(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function kf(i,n){if(i&1&&(a(0,"td"),C(1,yf,7,3,"div",42)(2,bf,1,1,"app-share-repository",43)(3,wf,3,5,"span")(4,Af,2,2)(5,Df,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="from"?2:e==="members"?3:e==="info"?4:e==="created"?5:-1)}}function Mf(i,n){if(i&1&&C(0,kf,6,9,"td",41),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Ff(i,n){if(i&1){let e=y();a(0,"tr",40),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openShareDialog())}),k(1,Mf,1,1,null,null,Td),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),s(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Pf(i,n){if(i&1){let e=y();a(0,"table",34)(1,"thead")(2,"tr"),k(3,vf,1,1,null,null,Td),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",35),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",34)(9,"tbody",36),k(10,Ff,4,7,"tr",37,wd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.shares,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function If(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"New share"),l()),i&2){let e=c();s(),m("icon",e.icons.faPlus)}}function Rf(i,n){}function Nf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Vf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Go to"),l()),i&2){let e=c();s(),m("icon",e.icons.faMapMarkerAlt)}}function Lf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Edit"),l()),i&2){let e=c();s(),m("icon",e.icons.faPen)}}function Of(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Edit children shares"),l()),i&2){let e=c(2);s(),m("icon",e.icons.SHARED)}}function Bf(i,n){if(i&1){let e=y();R(0,Of,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openChildShareDialog())})}}function Uf(i,n){}function Hf(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",6),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var Ed=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,faArrowRotateRight:ut,faArrowDown:_t,faArrowUp:dt,faRotate:Ti,faPlus:Qe,faMinus:hn,faPen:mt,faEllipsisH:Lo,faMapMarkerAlt:ir,faCircleInfo:Nt,faCommentDots:Jo},this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},info:{label:"Info",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",created:"Created"},this.activatedRoute=S(Jt),this.store=S(te),this.sharesService=S(si),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadShares(),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${z.SHARED}/${Bt.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t.map(o=>new Kr(o))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",t.error.message)}})}sortBy(t,o=!0,r){this.shares=this.sortTable.sortBy(t,o,r||this.shares)}onSelect(t=null){this.selected=t,this.store.shareSelection.set(this.selected)}openShareDialog(t=!1){t?this.layout.openDialog(tn,"lg").content.shareChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.focusOnSelect=u.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:o=>{this.layout.openDialog(tn,"lg",{initialState:{share:o}}).content.shareChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;if(u==="update"){this.selected.name=v.name,this.selected.alias=v.alias,this.selected.description=v.description,this.selected.modifiedAt=v.modifiedAt,this.selected.enabled=v.enabled;let T={users:0,groups:0,links:v.links.length};for(let N of v.members)N.isUser?T.users++:T.groups++;this.selected.counts=re(re({},this.selected.counts),T)}else u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(T=>T.id!==v.id)))})},error:o=>this.layout.sendNotification("error","Edit share",this.selected.name,o)})}openChildShareDialog(t){t&&this.onSelect(t),this.layout.openDialog(Li,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(r=>this.selected.counts.shares=r)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}goTo(t){t=t||this.selected,this.sharesService.goTo(t).catch(console.error)}goToComments(t){this.sharesService.goTo(t).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}focusOn(t){let o=this.shares.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(mf,7),Y(uf,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadShares())}),_(3,"fa-icon",4),l(),a(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openShareDialog(!0))}),_(6,"fa-icon",6),l(),a(7,"button",7),b(8,"translate"),f("click",function(){return h(p),g(r.openShareDialog())}),_(9,"fa-icon",6),l(),a(10,"button",7),b(11,"translate"),f("click",function(){return h(p),g(r.openChildShareDialog())}),_(12,"fa-icon",6),l(),a(13,"button",7),b(14,"translate"),f("click",function(){return h(p),g(r.goTo())}),_(15,"fa-icon",6),l(),a(16,"div",8)(17,"div",9),_(18,"app-input-filter",10),l(),a(19,"app-navigation-view",11),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(20,Cf,6,8,"div",12)(21,Pf,12,8),a(22,"div",13)(23,"span",14),d(24),b(25,"translate"),l()(),a(26,"context-menu",null,0),R(28,If,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.openShareDialog(!0))}),R(29,Rf,0,0,"ng-template",16)(30,Nf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.loadShares())}),l(),a(31,"context-menu",null,1),R(33,Vf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.goTo())}),R(34,Lf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.openShareDialog())}),C(35,Bf,1,0,null,17),R(36,Uf,0,0,"ng-template",16)(37,Hf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(s(),m("tooltip",E(2,22,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),m("tooltip",E(5,25,"New share",r.locale.language)),s(2),m("icon",r.icons.faPlus),s(),m("disabled",!r.selected)("tooltip",E(8,28,"Edit share",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),m("disabled",!(r.selected!=null&&r.selected.counts.shares))("tooltip",E(11,31,"Edit children shares",r.locale.language)),s(2),m("icon",r.icons.SHARED),s(),m("disabled",!r.selected)("tooltip",E(14,34,"Go to",r.locale.language)),s(2),m("icon",r.icons.faMapMarkerAlt),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?20:21),s(4),Re("",r.shares.length," ",E(25,37,"shares",r.locale.language)),s(5),m("divider",!0),s(6),x(r.selected!=null&&r.selected.counts.shares?35:-1),s(),m("divider",!0))},dependencies:[F,P,lt,Ve,Ke,Me,Xe,Ri,Ot,Lt,Vt,ai,nt,Ee,Z,gt,oi],encapsulation:2});let i=n;return i})();var ea=(()=>{let n=class n{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new ae(!0),this.renamingInProgress=new ae(!0),this.elementRef=S(Ci),this.renderer=S(pt),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(t){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",t)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","appInputEdit",""]],hostBindings:function(o,r){o&1&&f("blur",function(){return r.onBlur()})("keyup.enter",function(){return r.onEnter()})("keyup.esc",function(){return r.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=n;return i})();var Ad=(()=>{let n=class n{constructor(){this.uploadFiles=new ae,this.elementRef=S(Ci),this.renderer=S(pt)}ngOnInit(){let t=document.createElement("input");this.renderer.setAttribute(t,"type","file"),this.renderer.setStyle(t,"display","none"),this.renderer.setStyle(t,"position","absolute"),this.elementRef.nativeElement.appendChild(t),this.eventElement=this.renderer.listen(this.elementRef.nativeElement,"click",()=>t.click()),this.options?.isMultiple&&this.renderer.setAttribute(t,"multiple","multiple"),this.options?.isDirectory&&this.renderer.setAttribute(t,"webkitdirectory","webkitdirectory"),this.eventInput=this.renderer.listen(t,"change",o=>{o.target.value&&(this.uploadFiles.next({files:o.target.files,isDirectory:this.options?.isDirectory||!1}),o.target.value="")})}ngOnDestroy(){try{this.eventElement(),this.eventInput()}catch(t){console.warn(t)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Si({type:n,selectors:[["","appUploadFiles",""]],inputs:{options:"options"},outputs:{uploadFiles:"uploadFiles"}});let i=n;return i})();function zf(i,n){i&1&&(a(0,"span",3),d(1,"Compress and Save"),l())}function Gf(i,n){i&1&&(a(0,"span",3),d(1,"Compress and Download"),l())}function Wf(i,n){if(i&1){let e=y();a(0,"div",15)(1,"label",12)(2,"input",13),ue("ngModelChange",function(o){h(e);let r=c();return me(r.archiveProps.compressInDirectory,o)||(r.archiveProps.compressInDirectory=o),g(o)}),l(),a(3,"span",19),d(4,"Save in the current directory"),l()()()}if(i&2){let e=c();s(2),de("ngModel",e.archiveProps.compressInDirectory)}}var ta=(()=>{let n=class n{constructor(){this.archiveProps={name:"",files:[],compressInDirectory:!0,extension:"tar"},this.submitEvent=new ae,this.disableInDirCompression=!1,this.locale=S($),this.layout=S(I),this.compression=!1,this.icons={faFileArchive:Oo},this.submitted=!1,this.filesService=S(He)}ngOnInit(){this.disableInDirCompression&&(this.archiveProps.compressInDirectory=!1)}onEnter(){this.onSubmit()}onSubmit(){this.archiveProps.name&&!this.submitted&&(this.submitted=!0,this.filesService.compress(this.archiveProps),this.submitEvent.emit(),this.layout.closeDialog())}setCompression(t){this.archiveProps.extension=t?"tgz":"tar"}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-compression-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{archiveProps:"archiveProps"},outputs:{submitEvent:"submitEvent"},decls:29,vars:16,consts:[[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],[1,"fs-xs","ms-1"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"input-group","input-group-sm"],["appAutofocus","","type","text",1,"form-control","form-control-sm","fs-xs",3,"ngModelChange","ngModel","placeholder"],[1,"input-group-text"],[2,"min-width","40px"],[1,"form-check","mb-0","mt-2","ps-0"],[1,"form-check-label","ps-1"],["type","checkbox",3,"ngModelChange","ngModel"],["l10nTranslate","",1,"fs-xs","me-1"],[1,"form-check","mb-0","mt-1","ps-0"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["l10nTranslate","",1,"fs-xs"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,zf,2,0,"span",3)(4,Gf,2,0,"span",3),a(5,"span",4),d(6),b(7,"translate"),l()(),a(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(9,"div",6)(10,"div",7)(11,"input",8),b(12,"translate"),ue("ngModelChange",function(u){return me(r.archiveProps.name,u)||(r.archiveProps.name=u),u}),l(),a(13,"div",9)(14,"span",10),d(15),l()()(),a(16,"div",11)(17,"label",12)(18,"input",13),ue("ngModelChange",function(u){return me(r.compression,u)||(r.compression=u),u}),f("ngModelChange",function(u){return r.setCompression(u)}),l(),a(19,"span",14),d(20,"Enable compression"),l(),a(21,"small",3),d(22,"(this may take longer)"),l()()(),C(23,Wf,5,1,"div",15),l(),a(24,"div",16)(25,"button",17),f("click",function(){return r.layout.closeDialog()}),d(26,"Cancel"),l(),a(27,"button",18),f("click",function(){return r.onSubmit()}),d(28,"Confirm"),l()()),o&2&&(s(2),m("icon",r.icons.faFileArchive),s(),x(r.archiveProps.compressInDirectory?3:4),s(3),Re("(",r.archiveProps.files.length," ",E(7,10,r.archiveProps.files.length>1?"items":"item",r.locale.language),")"),s(5),de("ngModel",r.archiveProps.name),m("placeholder",E(12,13,"Archive name",r.locale.language)),s(4),D(".",r.archiveProps.extension),s(3),de("ngModel",r.compression),s(5),x(r.disableInDirCompression?-1:23),s(4),m("disabled",!r.archiveProps.name||r.submitted))},dependencies:[F,be,je,Pt,xe,ye,Ye,P,Z],encapsulation:2,changeDetection:0});let i=n;return i})();var Dd={"Microsoft Word":".docx","Microsoft Excel":".xlsx","Microsoft PowerPoint":".pptx","Open Document Text":".odt","Open Document Spreadsheet":".ods","Open Document Presentation":".odp","Rich Text Format":".rtf",Text:".txt"};var jf=["InputText"],Kf=(i,n)=>n.key;function Qf(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faGlobe)}}function qf(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFolderClosed)}}function Yf(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFileAlt)}}function Xf(i,n){if(i&1){let e=y();a(0,"li",20)(1,"a",21),f("click",function(){let o=h(e).$implicit,r=c(3);return g(r.onSelectDocType(o.key))}),d(2),l()()}if(i&2){let e=n.$implicit;s(2),w(e.key)}}function Zf(i,n){if(i&1&&(a(0,"ul",19),k(1,Xf,3,1,"li",20,Kf),b(3,"keyvalue"),l()),i&2){let e=c(2);s(),M(E(3,0,e.docTypes,e.originalOrderKeyValue))}}function Jf(i,n){if(i&1&&(a(0,"div",7)(1,"button",15)(2,"span",16),d(3),l(),_(4,"fa-icon",17),l(),R(5,Zf,4,3,"ul",18),l()),i&2){let e=c();s(3),w(e.selectedDocType),s(),m("icon",e.icons.faCaretDown)}}function eh(i,n){if(i&1){let e=y();a(0,"div",8)(1,"span",9),_(2,"fa-icon",3),l(),a(3,"input",22),b(4,"translate"),ue("ngModelChange",function(o){h(e);let r=c();return me(r.downloadProp.url,o)||(r.downloadProp.url=o),g(o)}),f("keydown.control.v",function(){h(e);let o=c();return g(o.pasteUrl())})("keydown.meta.v",function(){h(e);let o=c();return g(o.pasteUrl())}),l()()}if(i&2){let e=c();s(2),m("icon",e.icons.faGlobe),s(),de("ngModel",e.downloadProp.url),m("placeholder",E(4,3,e.downloadProp.placeholder,e.locale.language))}}function th(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFolderClosed)}}function ih(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFileAlt)}}function nh(i,n){if(i&1&&(a(0,"span",12),d(1),l()),i&2){let e=c();s(),w(e.error)}}var kd=(()=>{let n=class n{constructor(){this.refreshFiles=new ae,this.locale=S($),this.layout=S(I),this.originalOrderKeyValue=De,this.icons={faCaretDown:Pl,faGlobe:xn,faFolderClosed:nr,faFileAlt:Zo},this.fileProp={title:"",name:"",placeholder:""},this.downloadProp={title:"Download from an external link",url:"",placeholder:"URL (https://...)"},this.selectedDocType="Text",this.docTypes=Dd,this.submitted=!1,this.filesService=S(He)}ngOnInit(){this.inputType==="download"?(this.fileProp.title="Download from URL",this.fileProp.placeholder="File name"):this.inputType==="file"?(this.fileProp.name=`${this.layout.translateString("New document")}.txt`,this.fileProp.title="New document",this.fileProp.placeholder="Document name",this.updateFileSelection()):(this.fileProp.title="New folder",this.fileProp.placeholder="Folder name")}onSelectDocType(t){this.selectedDocType=t;let o=this.fileNamePosition();this.fileProp.name=`${this.fileProp.name.substring(0,o<0?this.fileProp.name.length:o)}${this.docTypes[t]}`,this.updateFileSelection()}onEnter(){this.fileProp.name&&this.onSubmit()}onSubmit(){if(this.submitted=!0,this.files.find(t=>t.name.toLowerCase()===this.fileProp.name.toLowerCase())){this.error="This name is already used",this.submitted=!1;return}if(this.inputType==="download"){if(!yc.test(this.downloadProp.url)){this.error="Malformed URL",this.submitted=!1;return}this.filesService.downloadFromUrl(this.downloadProp.url,this.fileProp.name)}else this.filesService.make(this.inputType,this.fileProp.name);this.layout.closeDialog()}pasteUrl(){setTimeout(()=>{this.fileProp.name=this.downloadProp.url.split("/").slice(-1)[0]},200)}fileNamePosition(){return this.fileProp.name.lastIndexOf(".")}updateFileSelection(){setTimeout(()=>{this.inputText.nativeElement.focus(),this.inputText.nativeElement.setSelectionRange(0,this.fileNamePosition())},0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-files-new-dialog"]],viewQuery:function(o,r){if(o&1&&Y(jf,7),o&2){let p;W(p=j())&&(r.inputText=p.first)}},hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{files:"files",inputType:"inputType"},outputs:{refreshFiles:"refreshFiles"},decls:24,vars:12,consts:[["InputText",""],[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate","",1,"ms-1"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["dropdown","",1,"btn-group","btn-group-sm","mb-3"],[1,"input-group","input-group-sm","my-2"],[1,"input-group-text"],["type","text","appAutofocus","",1,"form-control","fs-xs",3,"ngModelChange","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-xs","text-danger"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["aria-controls","dropdown-animated","dropdownToggle","","id","button-animated","type","button",1,"btn","btn-primary","dropdown-toggle"],["l10nTranslate",""],[1,"ms-3",3,"icon"],["aria-labelledby","button-animated","class","dropdown-menu","id","dropdown-animated","role","menu",4,"dropdownMenu"],["aria-labelledby","button-animated","id","dropdown-animated","role","menu",1,"dropdown-menu"],["role","menuitem"],["l10nTranslate","",1,"dropdown-item",3,"click"],["type","text","appAutofocus","",1,"form-control","fs-xs",3,"ngModelChange","keydown.control.v","keydown.meta.v","ngModel","placeholder"]],template:function(o,r){if(o&1){let p=y();a(0,"div",1)(1,"h4",2),C(2,Qf,1,1,"fa-icon",3)(3,qf,1,1,"fa-icon",3)(4,Yf,1,1,"fa-icon",3),a(5,"span",4),d(6),l()(),a(7,"button",5),f("click",function(){return h(p),g(r.layout.closeDialog())}),l()(),a(8,"div",6),C(9,Jf,6,2,"div",7),C(10,eh,5,6,"div",8),a(11,"div",8)(12,"span",9),C(13,th,1,1,"fa-icon",3)(14,ih,1,1,"fa-icon",3),l(),a(15,"input",10,0),b(17,"translate"),ue("ngModelChange",function(v){return h(p),me(r.fileProp.name,v)||(r.fileProp.name=v),g(v)}),l()()(),a(18,"div",11),C(19,nh,2,1,"span",12),a(20,"button",13),f("click",function(){return h(p),g(r.layout.closeDialog())}),d(21,"Cancel"),l(),a(22,"button",14),f("click",function(){return h(p),g(r.onSubmit())}),d(23,"Confirm "),l()()}if(o&2){let p;s(2),x((p=r.inputType)==="download"?2:p==="directory"?3:p==="file"?4:-1),s(4),w(r.fileProp.title),s(3),x(r.inputType==="file"?9:-1),s(),x(r.inputType==="download"?10:-1),s(3),x(r.inputType==="directory"?13:14),s(2),de("ngModel",r.fileProp.name),m("placeholder",E(17,9,r.fileProp.placeholder,r.locale.language)),s(4),x(r.error?19:-1),s(3),m("disabled",!r.fileProp.name||r.inputType==="download"&&!r.downloadProp.url||r.submitted)}},dependencies:[F,P,Ri,Pi,Ii,Fi,be,je,xe,ye,Ye,Z,Ee],encapsulation:2});let i=n;return i})();var Md=i=>({arg:i});function oh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function rh(i,n){if(i&1&&(_(0,"div",11),b(1,"translate")),i&2){let e=c(2);m("innerHTML",Mt(1,1,e.permanently?"delete_multiple_files":"trash_multiple_files",e.locale.language,Ne(5,Md,e.files.length)),Wn)}}function ah(i,n){if(i&1&&(_(0,"div",11),b(1,"translate")),i&2){let e=c(2);m("innerHTML",Mt(1,1,e.permanently?"delete_one_file":"trash_one_file",e.locale.language,Ne(5,Md,e.files[0].name)),Wn)}}function sh(i,n){if(i&1&&C(0,rh,2,7,"div",11)(1,ah,2,7,"div",11),i&2){let e=c();x(e.files.length>1?0:e.files.length===1?1:-1)}}function lh(i,n){if(i&1&&(a(0,"div",3),d(1),l()),i&2){let e=c();s(),w(e.permanently?"Permanent deletion":"Moving to trash")}}var Fd=(()=>{let n=class n{constructor(){this.files=[],this.permanently=!1,this.removeFiles=new ae,this.locale=S($),this.layout=S(I),this.icons={faTrashCan:Ai,faSpinner:Ue},this.submitted=!1}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.removeFiles.next(),this.layout.closeDialog())}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-trash-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{files:"files",permanently:"permanently"},outputs:{removeFiles:"removeFiles"},decls:16,vars:4,consts:[[1,"modal-header"],["l10nTranslate","",1,"modal-title"],[1,"me-1",3,"icon"],["l10nTranslate",""],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"overflow-wrap-and-whitespace"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[3,"innerHTML"]],template:function(o,r){if(o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Trash"),l(),C(5,oh,1,1,"fa-icon",4),l(),a(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(7,"div",6)(8,"div",7),C(9,sh,2,1)(10,lh,2,1,"div",3),l()(),a(11,"div",8)(12,"button",9),f("click",function(){return r.layout.closeDialog()}),d(13,"Cancel"),l(),a(14,"button",10),f("click",function(){return r.onSubmit()}),d(15,"Confirm"),l()()),o&2){let p;s(2),m("icon",r.icons.faTrashCan),s(3),x(r.submitted?5:-1),s(4),x((p=r.submitted)===!1?9:p===!0?10:-1),s(5),m("disabled",r.submitted)}},dependencies:[P,F,Z],encapsulation:2,changeDetection:0});let i=n;return i})();function ch(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}var Pd=(()=>{let n=class n{constructor(){this.files=[],this.layout=S(I),this.icons={faTrashCan:Ai,faSpinner:Ue},this.submitted=!1,this.filesService=S(He)}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.filesService.delete(this.files),this.layout.closeDialog(),this.submitted=!1)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-trash-empty-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},xi)},inputs:{files:"files"},decls:17,vars:3,consts:[[1,"modal-header"],["l10nTranslate","",1,"modal-title"],[1,"me-1",3,"icon"],["l10nTranslate",""],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Trash"),l(),C(5,ch,1,1,"fa-icon",4),l(),a(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(7,"div",6)(8,"div",3),d(9,"Would you like to empty the trash ?"),l(),a(10,"small",3),d(11,"All items will be permanently deleted"),l()(),a(12,"div",7)(13,"button",8),f("click",function(){return r.layout.closeDialog()}),d(14,"Cancel"),l(),a(15,"button",9),f("click",function(){return r.onSubmit()}),d(16,"Confirm"),l()()),o&2&&(s(2),m("icon",r.icons.faTrashCan),s(3),x(r.submitted?5:-1),s(10),m("disabled",r.submitted))},dependencies:[F,P],encapsulation:2});let i=n;return i})();var ph=["InputRename"],dh=(i,n)=>n.alias,mh=(i,n)=>n.key;function uh(i,n){if(i&1&&_(0,"app-user-avatar",14)(1,"div",9),i&2){let e=c().$implicit;m("user",e.owner)}}function _h(i,n){if(i&1){let e=y();a(0,"input",15,0),f("updateObject",function(o){h(e);let r=c(2);return g(r.onRenameRoot(o))}),l()}if(i&2){let e=c().$implicit;m("inputObject",e)("fullWidth",!0)}}function fh(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(2).$implicit;s(),w(e.externalPath)}}function hh(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"pathSlice"),l()),i&2){let e=c(2).$implicit;s(),w(E(2,1,e.file.path,-2))}}function gh(i,n){if(i&1&&(a(0,"div",16)(1,"span"),d(2),l()(),a(3,"div",17),C(4,fh,2,1,"span")(5,hh,3,4,"span"),l()),i&2){let e=c().$implicit,t=c();s(2),w(e.name),s(2),x(t.user.isAdmin&&e.externalPath?4:5)}}function Ch(i,n){if(i&1&&(a(0,"div",7)(1,"div",18),d(2),l(),a(3,"div",18),d(4),b(5,"amTimeAgo"),l()()),i&2){let e=c().$implicit;s(2),w(e.alias),s(2),w(G(5,2,e.createdAt))}}function xh(i,n){if(i&1){let e=y();a(0,"button",21),b(1,"translate"),ue("ngModelChange",function(o){h(e);let r=c().$implicit,p=c().$implicit;return me(p.hPerms[r.key],o)||(p.hPerms[r.key]=o),g(o)}),f("ngModelChange",function(){h(e);let o=c(2).$implicit,r=c();return g(r.onPermissionChange(o))}),_(2,"fa-icon",22),l()}if(i&2){let e=c().$implicit,t=c().$implicit,o=c();L(X("btn btn-sm btn-custom ",!t.isDir&&(e.key==="a"||e.key==="d")?"disabled":"")),de("ngModel",t.hPerms[e.key]),m("tooltip",E(1,6,o.SPACES_PERMISSIONS_TEXT[e.key].text,o.locale.language)),s(2),m("icon",o.SPACES_PERMISSIONS_TEXT[e.key].icon)}}function Sh(i,n){if(i&1&&(a(0,"button",23),b(1,"translate"),_(2,"fa-icon",22),l()),i&2){let e=c().$implicit,t=c().$implicit,o=c();O("active",t.hPerms[e.key]),m("tooltip",E(1,4,o.SPACES_PERMISSIONS_TEXT[e.key].text,o.locale.language)),s(2),m("icon",o.SPACES_PERMISSIONS_TEXT[e.key].icon)}}function vh(i,n){if(i&1&&C(0,xh,3,9,"button",19)(1,Sh,3,7,"button",20),i&2){let e=c().$implicit,t=c();x(!(e.owner!=null&&e.owner.id)&&t.user.isAdmin||(e.owner==null?null:e.owner.id)===t.user.id?0:1)}}function yh(i,n){if(i&1){let e=y();a(0,"div",1)(1,"div",2)(2,"div",3),C(3,uh,2,1),_(4,"img",4),a(5,"div",5),C(6,_h,2,2,"input",6)(7,gh,6,2),l()(),C(8,Ch,6,4,"div",7),a(9,"div",8),_(10,"div",9),k(11,vh,2,1,null,null,mh),b(13,"keyvalue"),_(14,"div",10),a(15,"button",11),b(16,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.setRenamed(o))}),_(17,"fa-icon",12),l(),a(18,"button",13),b(19,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.removeRoot(o))}),_(20,"fa-icon",12),l()()()()}if(i&2){let e=n.$implicit,t=c();s(3),x(t.showUsers?3:-1),s(),O("cursor-pointer",!!e.file.path),m("src",e.file.mimeUrl,ee)("tooltip",e.file.path),s(2),x(e.isRenamed?6:7),s(2),x(t.showInfo?8:-1),s(3),M(E(13,14,e.hPerms,t.originalOrderKeyValue)),s(4),L(X("btn btn-sm ",e.isRenamed?"btn-success":"btn-custom"," me-2")),m("tooltip",E(16,17,"Rename",t.locale.language)),s(2),m("icon",t.icons.faPen),s(),m("tooltip",E(19,20,"Remove",t.locale.language)),s(2),m("icon",t.icons.faTimes)}}var Hn=(()=>{let n=class n{constructor(){this.showInfo=!0,this.showUsers=!0,this.addRootFile=null,this.locale=S($),this.icons={faTimes:Rt,faPen:mt},this.SPACES_PERMISSIONS_TEXT=mc,this.originalOrderKeyValue=De,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(t=>this.addRoot(t)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(t){let o={id:0,alias:to(t.name,"alias",this.space.roots).toLowerCase(),name:to(t.name,"name",this.space.roots),permissions:"",createdAt:new Date};t.externalPath?(o.externalPath=t.externalPath,o.owner={id:null,login:null,email:null,fullName:null},o.file={id:0,path:null,mime:null}):(o.externalPath=null,o.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},o.file={id:t.id,path:t.path,mime:t.mime}),this.space.addRoot(o,!0)}removeRoot(t){this.space.roots=this.space.roots.filter(o=>t.alias!==o.alias)}onRenameRoot(t){let o=t.object;o.alias=to(ec(t.name,!0),"alias",this.space.roots.filter(r=>r.id!==o.id)).toLowerCase(),o.name=to(t.name.replace(Zl,""),"name",this.space.roots.filter(r=>r.id!==o.id))}onPermissionChange(t){t.permissions=hc(t.hPerms)}setRenamed(t){t.isRenamed?(this.onRenameRoot({object:t,name:this.inputRename.nativeElement.value}),t.isRenamed=!1):t.isRenamed=!0}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-manage-roots"]],viewQuery:function(o,r){if(o&1&&Y(ph,5),o&2){let p;W(p=j())&&(r.inputRename=p.first)}},inputs:{space:"space",user:"user",showInfo:"showInfo",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","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"],[1,"d-flex","justify-content-end"],["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(o,r){o&1&&k(0,yh,21,23,"div",1,dh),o&2&&M(r.space.roots)},dependencies:[Cc,Tn,F,Ze,Ke,Me,be,xe,ye,ea,Ee,Z,Je,Qr],encapsulation:2});let i=n;return i})();function bh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}var Id=(()=>{let n=class n{constructor(){this.addAnchoredFiles=new ae,this.locale=S($),this.layout=S(I),this.icons={faAnchor:ni,faPlus:Qe,faSpinner:Ue,SPACES:ie.SPACES},this.space={roots:[]},this.submitted=!1,this.loading=!1,this.userService=S(oe),this.user=this.userService.user,this.spacesService=S(ot)}ngOnInit(){for(let t of this.files)this.space.roots.push({id:t.id,name:t.name,alias:t.name,permissions:"",createdAt:new Date,isRenamed:!1,hPerms:fc("",[qe.SHARE_INSIDE]),isDir:t.mime===ri,owner:{id:this.user.id,login:this.user.login},file:t})}onSetSpace(t){this.selectedSpace=t}onSearchSpaces(t){return this.spacesService.searchSpaces({search:t,shareInsidePermission:!0,limit:6})}onSubmit(){!this.selectedSpace||!this.space.roots.length||(this.loading=!0,this.submitted=!0,this.spacesService.createUserSpaceRoots(this.selectedSpace.id,this.space.roots).subscribe({next:t=>{t.length&&this.addAnchoredFiles.emit({space:this.selectedSpace,rootFiles:t.map(o=>({id:o.file.id,name:o.file.path.split("/").at(-1)}))}),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Anchor files to a space",t.error.message),this.loading=!1,this.submitted=!1}}))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-anchor-file-dialog"]],inputs:{files:"files"},decls:22,vars:14,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"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"mb-3"],["for","space","l10nTranslate",""],["id","space",3,"data","searchFunction","active","itemIcon","placeholder"],["for","files","l10nTranslate",""],["id","files",3,"space","user","showInfo","showUsers"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Anchor files to a space"),l()(),C(5,bh,1,1,"fa-icon",4),a(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(7,"div",6)(8,"div",7)(9,"label",8),d(10,"Space"),l(),a(11,"app-select",9),b(12,"translate"),f("data",function(u){return r.onSetSpace(u)}),l()(),a(13,"div",7)(14,"label",10),d(15,"Files"),l(),_(16,"app-space-manage-roots",11),l()(),a(17,"div",12)(18,"button",13),f("click",function(){return r.layout.closeDialog()}),d(19,"Cancel"),l(),a(20,"button",14),f("click",function(){return r.onSubmit()}),d(21," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faAnchor),s(3),x(r.loading?5:-1),s(6),m("searchFunction",r.onSearchSpaces.bind(r))("active",r.selectedSpace)("itemIcon",r.icons.SPACES)("placeholder",E(12,11,"Type to search for space to select",r.locale.language)),s(5),m("space",r.space)("user",r.user)("showInfo",!1)("showUsers",!1),s(4),m("disabled",r.submitted||!r.selectedSpace||!r.space.roots.length))},dependencies:[F,P,Hn,bc,Z],encapsulation:2});let i=n;return i})();var wh=["MainContextMenu"],Th=["MainReadOnlyContextMenu"],Eh=["FileContextMenu"],Ah=i=>({nb:i}),Dh=()=>({isMultiple:!0}),kh=()=>({isDirectory:!0}),Rd=(i,n)=>n.id,Nd=(i,n)=>n.key;function Mh(i,n){if(i&1){let e=y();a(0,"a",33),f("uploadFiles",function(o){h(e);let r=c(3);return g(r.onUploadFiles(o,!0))}),a(1,"span",22),_(2,"fa-icon",10),d(3,"Upload folders"),l()()}if(i&2){let e=c(3);m("options",Tt(2,kh)),s(2),m("icon",e.icons.faUpload)}}function Fh(i,n){if(i&1){let e=y();a(0,"ul",28)(1,"li",29)(2,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("directory"))}),a(3,"span",22),_(4,"fa-icon",10),d(5,"New folder"),l()()(),a(6,"li",29)(7,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("file"))}),a(8,"span",22),_(9,"fa-icon",10),d(10,"New document"),l()()(),a(11,"li",29)(12,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("download"))}),a(13,"span",22),_(14,"fa-icon",10),d(15,"Download from URL"),l()()(),a(16,"li",29)(17,"a",31),f("uploadFiles",function(o){h(e);let r=c(2);return g(r.onUploadFiles(o))}),a(18,"span",22),_(19,"fa-icon",10),d(20,"Upload files"),l()(),C(21,Mh,4,3,"a",32),l()()}if(i&2){let e=c(2);s(4),m("icon",e.icons.PERSONAL),s(5),m("icon",e.icons.faFileAlt),s(5),m("icon",e.icons.faGlobe),s(3),m("options",Tt(6,Dh)),s(2),m("icon",e.icons.faUpload),s(2),x(e.supportUploadFolder?21:-1)}}function Ph(i,n){if(i&1){let e=y();a(0,"div",26),f("onShown",function(){h(e);let o=c();return g(o.initUpload())}),a(1,"button",27),b(2,"translate"),_(3,"fa-icon",10),l(),R(4,Fh,22,7,"ul",13),l()}if(i&2){let e=c();s(),m("tooltip",E(2,2,"New",e.locale.language)),s(2),m("icon",e.icons.faPlus)}}function Ih(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openSpaceAnchorFileDialog())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Anchor to a space"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faAnchor)}}function Rh(i,n){if(i&1){let e=y();a(0,"ul",28)(1,"li",29)(2,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openShareDialog())}),a(3,"span",22),_(4,"fa-icon",10),d(5,"New share"),l()()(),a(6,"li",29)(7,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openShareLinkDialog())}),a(8,"span",22),_(9,"fa-icon",10),d(10,"New share link"),l()()(),C(11,Ih,5,1,"li",29),l()}if(i&2){let e=c(2);s(4),m("icon",e.icons.SHARES),s(5),m("icon",e.icons.faLink),s(2),x(e.isFilesRepo?11:-1)}}function Nh(i,n){if(i&1&&(a(0,"div",11)(1,"button",27),b(2,"translate"),_(3,"fa-icon",10),l(),R(4,Rh,12,3,"ul",13),l()),i&2){let e=c();m("isDisabled",!e.hasSelection||e.inSharesList&&!e.selection[0].canBeReShared),s(),m("tooltip",E(2,3,"Share",e.locale.language)),s(2),m("icon",e.icons.SHARES)}}function Vh(i,n){if(i&1){let e=y();a(0,"button",9),b(1,"translate"),f("click",function(){h(e);let o=c(2);return g(o.openEmptyTrashDialog())}),_(2,"fa-icon",10),l()}if(i&2){let e=c(2);m("disabled",!e.stats.elements)("tooltip",E(1,3,"Empty",e.locale.language)),s(2),m("icon",e.icons.TRASH)}}function Lh(i,n){if(i&1){let e=y();a(0,"button",9),b(1,"translate"),f("click",function(){h(e);let o=c();return g(o.openTrashDialog(!0))}),_(2,"fa-icon",10),l(),C(3,Vh,3,6,"button",34)}if(i&2){let e=c();m("disabled",!e.hasSelection)("tooltip",E(1,4,"Remove",e.locale.language)),s(2),m("icon",e.icons.faBan),s(),x(e.inRootSpace?3:-1)}}function Oh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.shortcutOpen())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Open"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.selection[0].isDir?e.icons.faFolderOpen:e.icons.faEye)}}function Bh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.shortcutRename())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Rename"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faSpellCheck)}}function Uh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.addToSync())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Synchronize"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faRotate)}}function Hh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.decompressFile())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Decompress"),l()()()}if(i&2){let e=c(3);s(3),m("icon",e.icons.faFileArchive)}}function $h(i,n){if(i&1){let e=y();C(0,Oh,5,1,"li",29),C(1,Bh,5,1,"li",29),a(2,"li",29)(3,"a",30),f("click",function(){h(e);let o=c(2);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),a(4,"span",22),_(5,"fa-icon",10),d(6,"Comment"),l()()(),C(7,Uh,5,1,"li",29),C(8,Hh,5,1,"li",29)}if(i&2){let e=c(2);x(e.selection[0]?0:-1),s(),x(e.inSharesList?-1:1),s(4),m("icon",e.icons.faCommentDots),s(2),x(e.isElectronApp&&e.selection[0].isDir?7:-1),s(),x(!e.inSharesList&&!e.selection[0].isCompressible?8:-1)}}function zh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openCompressionDialog())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Compress"),l()()()}if(i&2){let e=c(2);s(3),m("icon",e.icons.faFileArchive)}}function Gh(i,n){if(i&1){let e=y();a(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(2);return g(o.copyMoveFiles())}),a(2,"span",22),_(3,"fa-icon",10),d(4,"Copy \xB7 Move"),l()()()}if(i&2){let e=c(2);s(3),m("icon",e.icons.faArrowsAlt)}}function Wh(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openTrashDialog(!0))}),a(1,"span",22),_(2,"fa-icon",10),d(3,"Remove"),l()()}if(i&2){let e=c(3);s(2),m("icon",e.icons.faBan)}}function jh(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openTrashDialog())}),a(1,"span",22),_(2,"fa-icon",10),d(3,"Trash"),l()()}if(i&2){let e=c(3);s(2),m("icon",e.icons.TRASH)}}function Kh(i,n){if(i&1&&(_(0,"li",35),a(1,"li",29),C(2,Wh,4,1,"a",36)(3,jh,4,1,"a",36),l()),i&2){let e=c(2);s(2),x(e.isTrashRepo?2:3)}}function Qh(i,n){if(i&1){let e=y();a(0,"ul",28),C(1,$h,9,5),C(2,zh,5,1,"li",29),C(3,Gh,5,1,"li",29),a(4,"li",29)(5,"a",30),f("click",function(){h(e);let o=c();return g(o.addToClipboard())}),a(6,"span",22),_(7,"fa-icon",10),d(8,"Clipboard"),l()()(),a(9,"li",29)(10,"a",30),f("click",function(){h(e);let o=c();return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION))}),a(11,"span",22),_(12,"fa-icon",10),d(13,"Info"),l()()(),C(14,Kh,4,1),l()}if(i&2){let e=c();s(),x(e.selection.length===1?1:-1),s(),x(e.canCompress?2:-1),s(),x(e.hasDisabledItemsInSelection?-1:3),s(4),m("icon",e.icons.faClipboardList),s(5),m("icon",e.icons.faCircleInfo),s(2),x(e.inSharesList?-1:14)}}function qh(i,n){i&1&&_(0,"div")}function Yh(i,n){if(i&1){let e=y();a(0,"img",56),f("error",function(){h(e);let o=c().$implicit;return g(o.isImage=!1)}),l()}if(i&2){let e=c().$implicit,t=c(2);B("max-height",t.galleryMode.image,"px"),m("src",wt("",e.thumbnailUrl,"?size=",t.galleryMode.imageRes),ee)}}function Xh(i,n){if(i&1){let e=y();a(0,"img",57),f("error",function(){h(e);let o=c().$implicit;return g(o.fallBackMimeUrl())}),l()}if(i&2){let e=c().$implicit,t=c(2);m("src",e.mimeUrl,ee)("height",t.galleryMode.image)("width",t.galleryMode.image)}}function Zh(i,n){if(i&1){let e=y();a(0,"span",58),b(1,"fileLockFormatPipe"),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.openLockDialog(o))}),_(2,"fa-icon",10),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),m("tooltip",fa(G(1,5,e.lock))),s(2),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faLockOpen)}}function Jh(i,n){if(i&1){let e=y();a(0,"span",59),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SHARES),s(),D("\xA0",e.shares.length," ")}}function e1(i,n){if(i&1){let e=y();a(0,"span",60),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SPACES),s(),D("\xA0",e.spaces.length," ")}}function t1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.LINKS),s(),D("\xA0",e.links.length," ")}}function i1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),m("icon",t.icons.SYNC),s(),D("\xA0",e.syncs.length," ")}}function n1(i,n){if(i&1){let e=y();a(0,"span",62),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),_(1,"fa-icon",10),l()}if(i&2){let e=c(3);B("font-size",e.galleryMode.textSize,"px"),s(),m("icon",e.icons.faCommentDots)}}function o1(i,n){if(i&1&&(a(0,"span",51),_(1,"app-user-avatar",63),l()),i&2){let e=c().$implicit,t=c(2);s(),m("user",e.root.owner)("height",t.galleryMode.dimensions/3)("width",t.galleryMode.dimensions/3)("fontSize",t.galleryMode.faSize/2)}}function r1(i,n){if(i&1&&(a(0,"span",52)(1,"span",64),d(2),l()()),i&2){let e=c().$implicit,t=c(2);s(),B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function a1(i,n){if(i&1){let e=y();a(0,"input",65),f("renamingInProgress",function(o){h(e);let r=c(3);return g(r.setRenamingInProgress(o))})("updateObject",function(o){h(e);let r=c(3);return g(r.renameFile(o))}),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),m("inputObject",e)("fullWidth",!0)("textCenter",!0)}}function s1(i,n){if(i&1&&(a(0,"span",66),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.name)}}function l1(i,n){if(i&1){let e=y();a(0,"div",41),f("click",function(o){let r=h(e).$implicit,p=c(2);return g(p.onSelect(o,r))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),a(1,"div",42),C(2,Yh,1,5,"img",43)(3,Xh,1,3,"img",44),a(4,"span",45),C(5,Zh,3,7,"span",46),C(6,Jh,3,4,"span",47),C(7,e1,3,4,"span",48),C(8,t1,3,4,"span",49),C(9,i1,3,4,"span",49),C(10,n1,2,3,"span",50),l(),C(11,o1,2,4,"span",51),C(12,r1,3,3,"span",52),l(),a(13,"div",53),C(14,a1,1,5,"input",54)(15,s1,2,3,"span",55),l()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("disabled",e.isDisabled)("deleted",e.isBeingDeleted)("selected",e.isSelected),s(),Zt("rowIndex",t),s(),x(e.isImage?2:3),s(3),x(e.lock?5:-1),s(),x(e.shares.length?6:-1),s(),x(e.spaces.length?7:-1),s(),x(e.links.length?8:-1),s(),x(e.syncs.length?9:-1),s(),x(e.hasComments?10:-1),s(),x(e.root?11:-1),s(),x(e.newly?12:-1),s(2),x(e.isRenamed?14:15)}}function c1(i,n){if(i&1){let e=y();a(0,"div",18)(1,"app-virtual-scroll",37),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),R(3,qh,1,0,"div",38),a(4,"div",39),k(5,l1,16,21,"div",40,Rd),l()()()}if(i&2){let e=c(),t=Be(33);s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",Mt(2,6,e.files,e.inputFilter.search(),"name"))("galleryMode",!0)("resizeOffset",110),s(2),m("ngTemplateOutlet",t),s(2),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function p1(i,n){if(i&1&&_(0,"fa-icon",73),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function d1(i,n){if(i&1){let e=y();a(0,"th",72),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,p1,1,2,"fa-icon",73),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function m1(i,n){if(i&1&&C(0,d1,3,10,"th",71),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function u1(i,n){i&1&&_(0,"div")}function _1(i,n){if(i&1){let e=y();a(0,"input",80),f("renamingInProgress",function(o){h(e);let r=c(6);return g(r.setRenamingInProgress(o))})("updateObject",function(o){h(e);let r=c(6);return g(r.renameFile(o))}),l()}if(i&2){let e=c(4).$implicit;m("inputObject",e)}}function f1(i,n){if(i&1&&(a(0,"span",81),d(1),l()),i&2){let e=c(5).$implicit;s(),w(e.root.description)}}function h1(i,n){if(i&1&&(a(0,"div",79)(1,"span",66),d(2),l(),C(3,f1,2,1,"span",81),l()),i&2){let e=c(4).$implicit,t=c(2);s(2),w(e.name),s(),x(t.inSharesList&&(e.root!=null&&e.root.description)?3:-1)}}function g1(i,n){if(i&1){let e=y();a(0,"div",76)(1,"img",77),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),C(2,_1,1,1,"input",78)(3,h1,4,2,"div",79),l()}if(i&2){let e=c(3).$implicit;s(),m("src",e.mimeUrl,ee),s(),x(e.isRenamed?2:3)}}function C1(i,n){if(i&1&&(a(0,"div",82),_(1,"app-user-avatar",83),l()),i&2){let e=c(4).$implicit;s(),m("user",e.root.owner)}}function x1(i,n){if(i&1&&C(0,C1,2,1,"div",82),i&2){let e=c(3).$implicit;x(e.root?0:-1)}}function S1(i,n){if(i&1){let e=y();a(0,"span",87),b(1,"fileLockFormatPipe"),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openLockDialog(o))}),_(2,"fa-icon",10),l()}if(i&2){let e=c(4).$implicit,t=c(2);m("tooltip",fa(G(1,3,e.lock))),s(2),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faLockOpen)}}function v1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SHARES),s(),D("\xA0",e.shares.length," ")}}function y1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.LINKS),s(),D("\xA0",e.links.length," ")}}function b1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SPACES),s(),D("\xA0",e.spaces.length," ")}}function w1(i,n){if(i&1){let e=y();a(0,"span",61),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SYNC),s(),D("\xA0",e.syncs.length," ")}}function T1(i,n){if(i&1){let e=y();a(0,"span",62),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),_(1,"fa-icon",10),l()}if(i&2){let e=c(6);s(),m("icon",e.icons.faCommentDots)}}function E1(i,n){if(i&1&&(C(0,S1,3,5,"span",84),C(1,v1,3,2,"span",85),C(2,y1,3,2,"span",85),C(3,b1,3,2,"span",85),C(4,w1,3,2,"span",85),C(5,T1,2,1,"span",86)),i&2){let e=c(3).$implicit;x(e.lock?0:-1),s(),x(e.shares.length?1:-1),s(),x(e.links.length?2:-1),s(),x(e.spaces.length?3:-1),s(),x(e.syncs.length?4:-1),s(),x(e.hasComments?5:-1)}}function A1(i,n){if(i&1&&_(0,"app-file-permissions",88),i&2){let e=c(4).$implicit;m("permissions",e.root.hPerms)}}function D1(i,n){if(i&1&&C(0,A1,1,1,"app-file-permissions",88),i&2){let e=c(3).$implicit;x(e.root&&e.root.permissions?0:-1)}}function k1(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hSize," ")}}function M1(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function F1(i,n){if(i&1&&(a(0,"td"),C(1,g1,4,2,"div",76)(2,x1,1,1)(3,E1,6,6)(4,D1,1,1)(5,k1,1,1)(6,M1,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="anchored"?2:e==="info"?3:e==="permissions"?4:e==="size"?5:e==="mtime"?6:-1)}}function P1(i,n){if(i&1&&C(0,F1,7,9,"td",75),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function I1(i,n){if(i&1){let e=y();a(0,"tr",74),f("click",function(o){let r=h(e).$implicit,p=c(2);return g(p.onSelect(o,r))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),k(1,P1,1,1,null,null,Nd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("disabled",e.isDisabled)("deleted",e.isBeingDeleted)("selected",e.isSelected),s(),M(E(3,6,t.tableHeaders,t.originalOrderKeyValue))}}function R1(i,n){if(i&1){let e=y();a(0,"table",67)(1,"thead")(2,"tr"),k(3,m1,1,1,null,null,Nd),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",68),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),R(8,u1,1,0,"div",38),a(9,"table",67)(10,"tbody",69),k(11,I1,4,9,"tr",70,Rd),l()()()}if(i&2){let e=c(),t=Be(33);s(3),M(E(5,3,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",Mt(7,6,e.files,e.inputFilter.search(),"name")),s(2),m("ngTemplateOutlet",t),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function N1(i,n){if(i&1&&(a(0,"span",20),d(1),b(2,"translate"),l()),i&2){let e=c();s(),Re("",e.stats.dirs," ",E(2,2,e.stats.dirs>1?"directories":"directory",e.locale.language))}}function V1(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();s(),Re("",e.stats.files," ",E(2,2,e.stats.files>1?"files":"file",e.locale.language))}}function L1(i,n){i&1&&(a(0,"div",89)(1,"span",22),d(2,"Forbidden resource"),l()())}function O1(i,n){i&1&&(a(0,"div",89)(1,"span",22),d(2,"Location not found"),l()())}function B1(i,n){i&1&&(a(0,"div",89)(1,"span",22),d(2,"Server Error"),l()())}function U1(i,n){i&1&&(a(0,"div",90)(1,"span",22),d(2,"Drag and drop your files here"),l()())}function H1(i,n){if(i&1&&C(0,L1,3,0,"div",89)(1,O1,3,0,"div",89)(2,B1,3,0,"div",89)(3,U1,3,0,"div",90),i&2){let e=c();x(e.forbiddenResource?0:e.locationNotFound?1:e.serverError?2:!e.isTrashRepo&&!e.loading&&!e.stats.elements?3:-1)}}function $1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Open"),l()),i&2){let e=c(3);s(),m("icon",e.selection[0].isDir?e.icons.faFolderOpen:e.icons.faEye)}}function z1(i,n){if(i&1){let e=y();R(0,$1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutOpen())})}}function G1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Rename"),l()),i&2){let e=c(3);s(),m("icon",e.icons.faSpellCheck)}}function W1(i,n){if(i&1){let e=y();R(0,G1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutRename())})}}function j1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Comment"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faCommentDots)}}function K1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Synchronize"),l()),i&2){let e=c(3);s(),m("icon",e.icons.faRotate)}}function Q1(i,n){if(i&1){let e=y();R(0,K1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.addToSync())})}}function q1(i,n){if(i&1){let e=y();C(0,z1,1,0,null,23),C(1,W1,1,0,null,23),R(2,j1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),C(3,Q1,1,0,null,23)}if(i&2){let e=c();x(e.selection[0]?0:-1),s(),x(e.inSharesList?-1:1),s(2),x(e.isElectronApp&&e.selection[0].isDir?3:-1)}}function Y1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Download"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faDownload)}}function X1(i,n){if(i&1){let e=y();R(0,Y1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.downloadFiles())})}}function Z1(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Compress"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faFileArchive)}}function J1(i,n){if(i&1){let e=y();R(0,Z1,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openCompressionDialog())})}}function eg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Decompress"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faFileArchive)}}function tg(i,n){if(i&1){let e=y();R(0,eg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.decompressFile())})}}function ig(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Copy \xB7 Move"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faArrowsAlt)}}function ng(i,n){if(i&1){let e=y();R(0,ig,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.copyMoveFiles())})}}function og(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Share"),l()),i&2){let e=c(2);s(),m("icon",e.icons.SHARES)}}function rg(i,n){if(i&1&&R(0,og,3,1,"ng-template",24),i&2){c();let e=Be(46);m("subMenu",e)}}function ag(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Clipboard"),l()),i&2){let e=c();s(),m("icon",e.icons.faClipboardList)}}function sg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}function lg(i,n){}function cg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2),l()),i&2){let e=c(2);s(),m("icon",e.isTrashRepo?e.icons.faBan:e.icons.TRASH),s(),D(" ",e.isTrashRepo?"Remove":"Trash")}}function pg(i,n){if(i&1){let e=y();R(0,lg,0,0,"ng-template",91)(1,cg,3,2,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openTrashDialog(o.isTrashRepo))})}i&2&&m("divider",!0)}function dg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New share"),l()),i&2){let e=c();s(),m("icon",e.icons.SHARES)}}function mg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New share link"),l()),i&2){let e=c();s(),m("icon",e.icons.faLink)}}function ug(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Anchor to a space"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faAnchor)}}function _g(i,n){if(i&1){let e=y();R(0,ug,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openSpaceAnchorFileDialog())})}}function fg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Empty"),l()),i&2){let e=c();s(),m("icon",e.icons.TRASH)}}function hg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Refresh"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faArrowRotateRight)}}function gg(i,n){if(i&1){let e=y();R(0,hg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.loadFiles())})}}function Cg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New folder"),l()),i&2){let e=c(2);s(),m("icon",e.icons.PERSONAL)}}function xg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"New document"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faFileAlt)}}function Sg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Download from URL"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faGlobe)}}function vg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Upload files"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faUpload)}}function yg(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",10),d(2,"Upload folders"),l()),i&2){let e=c(3);s(),m("icon",e.icons.faUpload)}}function bg(i,n){if(i&1){let e=y();R(0,yg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutUploadFolders())})}}function wg(i,n){if(i&1){let e=y();R(0,Cg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("directory"))}),R(1,xg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("file"))}),R(2,Sg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("download"))}),R(3,vg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.shortcutUploadFiles())}),C(4,bg,1,0,null,23)}if(i&2){let e=c();s(4),x(e.supportUploadFolder?4:-1)}}var ia=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.icons={SPACES:ie.SPACES,SHARES:ie.SHARES,TRASH:ie.TRASH,PERSONAL:ie.PERSONAL,LINKS:ie.LINKS,SYNC:cr.SYNC,faArrowRotateRight:ut,faPlus:Qe,faFileAlt:Zo,faGlobe:xn,faUpload:er,faDownload:Cn,faLink:Qo,faAnchor:ni,faEllipsis:Vo,faPen:mt,faEye:ml,faFolderOpen:hl,faRotate:Ti,faCommentDots:Jo,faFileArchive:Oo,faSpellCheck:El,faArrowsAlt:ti,faCircleInfo:Nt,faBan:pl,faArrowUp:dt,faArrowDown:_t,faLock:ii,faLockOpen:Dl,faClipboardList:jo},this.loading=!1,this.locationNotFound=!1,this.forbiddenResource=!1,this.serverError=!1,this.hasRoots=!1,this.canShare={inside:!1,outside:!1},this.multipleSelection=!1,this.hasSelection=!1,this.hasDisabledItemsInSelection=!1,this.canCompress=!0,this.renamingInProgress=!1,this.supportUploadFolder=!1,this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.tableHeaders={name:{label:"Name",width:45,textCenter:!1,class:"",show:!0,sortable:!0},anchored:{label:"Anchored by",width:5,class:"d-none d-md-table-cell",textCenter:!0,show:this.hasRoots,sortable:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:this.hasRoots},size:{label:"Size",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},mtime:{label:"Modified",width:10,textCenter:!0,class:"d-none d-sm-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",isDir:"Type",size:"Size",mtime:"Modified"},this.files=[],this.selection=[],this.stats={dirs:0,files:0,size:0,elements:0},this.router=S(Ce),this.activatedRoute=S(Jt),this.zone=S(zi),this.renderer=S(pt),this.store=S(te),this.isElectronApp=this.store.isElectronApp(),this.spacesBrowser=S(Ec),this.filesService=S(He),this.filesUpload=S(Rc),this.uploadButtonsShowed=!1,this.subscriptions=[],this.sortSettings={default:[{prop:"name",type:"string"},{prop:"isDir",type:"number"}],name:[{prop:"name",type:"string"}],isDir:[{prop:"isDir",type:"number"}],anchored:[{prop:"root.id",type:"number"},{prop:"root.owner.fullName",type:"string"}],size:[{prop:"size",type:"number"}],mtime:[{prop:"mtime",type:"number"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.moveFromDrag=!1}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView(),this.supportUploadFolder=this.filesUpload.supportUploadDirectory,this.activatedRoute.queryParams.subscribe(t=>this.focusOn(t.select)),this.activatedRoute.data.subscribe(t=>this.setSpace(t)),this.subscriptions.push(this.store.filesOnEvent.subscribe(t=>this.onFileEvent(t)))}ngAfterViewInit(){setTimeout(()=>this.initEventHandlers(),500)}ngOnDestroy(){this.destroyEventHandlers(),this.resetFilesSelection(),this.subscriptions.forEach(t=>t.unsubscribe())}onKeyPress(t){if((t.target.id==="table-files"||t.target.id==="thumb-files")&&(t.ctrlKey||t.metaKey))switch(t.which||t.keyCode){case 65:t.preventDefault(),t.stopPropagation(),this.updateSelection(this.files);return;case 67:case 88:t.preventDefault(),t.stopPropagation(),this.selection.length&&(this.filesService.clipboardAction=t.keyCode==67?"copyPaste":"cutPaste",this.filesService.addToClipboard(this.selection));return;case 86:t.preventDefault(),t.stopPropagation(),this.filesService.onPasteClipboard();return;default:return}}loadFiles(){this.loading=!0,this.forbiddenResource=!1,this.locationNotFound=!1,this.serverError=!1,this.inputFilter.clear(),this.resetFilesSelection(),this.spacesBrowser.loadFiles().subscribe({next:t=>{this.spacePermissions=t.permissions,this.canShare.outside=this.spacePermissions.indexOf(qe.SHARE_OUTSIDE)>-1,this.canShare.inside=this.spacePermissions.indexOf(qe.SHARE_INSIDE)>-1,this.hasRoots=t.hasRoots,this.tableHeaders.anchored.show=t.hasRoots,this.tableHeaders.anchored.label=this.isSharesRepo?"Owner":"Anchored by",this.tableHeaders.anchored.width=10,this.tableHeaders.permissions.show=t.hasRoots,this.sortBy(this.sortTable.sortParam.column,!1,t.files.map(o=>new Gc(o,this.baseRepoUrl,this.isSharesRepo,this.store.server().fileEditors))),this.updateFilesStats(this.files),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.files=[],this.updateFilesStats(this.files),t.status!==401&&(this.forbiddenResource=t.status===403,this.locationNotFound=t.status===404,this.serverError=t.status===0,this.layout.sendNotification("error","Files",t.error.message)),this.loading=!1}})}sortBy(t,o=!0,r){this.files=this.sortTable.sortBy(t,o,r||this.files)}switchView(t){let o=this.galleryMode;this.galleryMode=t,this.galleryMode.enabled!==o.enabled&&(this.destroyEventHandlers(),setTimeout(()=>this.initEventHandlers(),500))}onSelect(t,o){this.loading||(t.shiftKey&&this.selection.length>0&&this.selection.indexOf(o)===-1?this.selectRangeFiles(o):!t.ctrlKey&&!t.metaKey?this.updateSelection([o]):this.modifySelection(o))}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.isTrashRepo||this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.selection.length<=1&&this.updateSelection([o]),this.layout.openContextMenu(t,this.fileContextMenu)}browse(t){if(t.isDisabled){this.layout.sendNotification("warning",t.name,"Share is disabled");return}t.isRenamed||(t.isDir?this.router.navigate([t.root?.alias||t.name],{relativeTo:this.activatedRoute}).catch(console.error):this.shortcutOpen())}copyMoveFiles(){this.layout.showRSideBarTab(fe.TREE,!0),setTimeout(()=>this.filesService.treeCopyMoveOn.next(),100)}downloadFiles(){this.multipleSelection?this.openCompressionDialog(!1):this.filesService.download(this.selection[0])}shortcutOpen(){this.selection[0].isDir?this.browse(this.selection[0]):this.selection[0].isViewable||this.selection[0].isEditable?this.openViewerDialog():this.downloadFiles()}shortcutUploadFiles(){this.uploadButtonsShowed||document.getElementById("newButton").click(),setTimeout(()=>document.getElementById("uploadFilesButton").click(),100)}shortcutUploadFolders(){if(!this.uploadButtonsShowed){let t=document.getElementById("newButton");t.click(),t.click()}setTimeout(()=>document.getElementById("uploadFoldersButton").click(),100)}shortcutRename(){this.selection[0].isRenamed=!this.selection[0].isRenamed}renameFile(t){return Xt(this,null,function*(){let o=t.object,r=t.name,p=!1,u=this.files.find(v=>v.name.toLowerCase()===r.toLowerCase()&&v.id!==o.id);u&&(p=yield this.filesService.openOverwriteDialog([o],r),!p)||this.filesService.rename(o,r,p).pipe(pe(1)).subscribe({next:v=>{o.rename(v.name),o.isEditable=!1,p&&(o.updateMime(u.mime),this.sortBy(this.sortTable.sortParam.column,!1,this.files.filter(T=>T.id!==u.id)))},error:v=>this.layout.sendNotification("error","Rename",o.name,v)})})}setRenamingInProgress(t){this.renamingInProgress=t}addToSync(){this.router.navigate([we.BASE,we.WIZARD,we.WIZARD_CLIENT],{state:{file:this.selection[0]}}).catch(console.error)}addToClipboard(){this.filesService.addToClipboard(this.selection)}openShareDialog(){let t=this.setFilePermissionsAndSpace();if(t===null)return;this.layout.openDialog(tn,"lg",{initialState:{file:t,isSharesRepo:this.isSharesRepo,inSharesList:this.inSharesList,allowFilesOptions:!1}}).content.shareChange.pipe(pe(1)).subscribe(r=>{let p=r[1];this.selection[0].id<0&&(this.selection[0].id=p.file.id),this.selection[0].shares.push({id:p.id,alias:p.alias,name:p.name,type:no.COMMON})})}openShareLinkDialog(){let t=this.setFilePermissionsAndSpace();if(t===null)return;this.layout.openDialog(Fn,"md",{initialState:{file:t,isSharesRepo:this.isSharesRepo,inSharesList:this.inSharesList}}).content.shareChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.selection[0].id<0&&(this.selection[0].id=u.file.id),this.selection[0].links.push({id:u.id,alias:u.alias,name:u.name,type:no.LINK}))})}openSpaceAnchorFileDialog(){this.layout.openDialog(Id,"lg",{initialState:{files:this.selection}}).content.addAnchoredFiles.pipe(pe(1)).subscribe(o=>{for(let r of this.selection){let p=o.rootFiles.find(u=>u.name===r.name);p&&r.spaces.map(u=>u.id).indexOf(o.space.id)===-1&&(r.id<0&&(r.id=p.id),r.spaces.push(o.space))}})}initUpload(){!this.isTrashRepo&&!this.uploadButtonsShowed&&(this.uploadButtonsShowed=!0)}onUploadFiles(t,o=!1){return Xt(this,null,function*(){let r=!1,p=[...t.files];if(o){let u=p[0].webkitRelativePath.split("/")[0].normalize(),v=this.files.find(T=>T.name.normalize().toLowerCase()===u.normalize().toLowerCase());if(v&&(r=yield this.filesService.openOverwriteDialog([v]),!r))return}else{let u=this.files.filter(v=>p.some(T=>T.name.normalize().toLowerCase()===v.name.normalize().toLowerCase()));if(u.length>0&&(r=yield this.filesService.openOverwriteDialog(u),!r))return}this.filesUpload.addFiles(p,r).catch(console.error)})}onDropFiles(t){let o=this.files.filter(r=>[...t.dataTransfer.files].some(p=>p.name.normalize().toLowerCase()===r.name.normalize().toLowerCase()));this.filesUpload.onDropFiles(t,o)}decompressFile(){this.filesService.decompress(this.selection[0])}openCompressionDialog(t=!0){let o={name:this.selection[0].name,compressInDirectory:this.inSharesList?!1:t,files:this.selection.map(r=>({name:r.name,rootAlias:r.root?.alias})),extension:"tar"};this.layout.openDialog(ta,null,{initialState:{archiveProps:o,disableInDirCompression:this.inSharesList}})}openNewDialog(t){this.layout.openDialog(kd,null,{initialState:{files:this.files,inputType:t}})}openEmptyTrashDialog(){this.isTrashRepo&&this.inRootSpace&&this.layout.openDialog(Pd,null,{initialState:{files:this.files}})}openTrashDialog(t=!1){if(!this.selection.length)return;this.layout.openDialog(Fd,null,{initialState:{files:this.selection,permanently:t}}).content.removeFiles.pipe(pe(1)).subscribe(()=>this.removeFiles())}openLockDialog(t){this.filesService.openLockDialog(t)}setSpace(t){this.currentRoute=this.filesService.currentRoute=`${t.repository}${sr(t.routes)}`,this.baseRepoUrl=`${t.repository}${t.routes.length?`/${t.routes[0].path}`:""}`,this.isFilesRepo=t.repository===z.FILES,this.isSharesRepo=t.repository===z.SHARES,this.isTrashRepo=t.repository===z.TRASH,this.inRootSpace=this.isSharesRepo?t.routes.length===0:t.routes.length===1,this.inSharesList=this.isSharesRepo&&this.inRootSpace,this.spacesBrowser.setEnvironment(t.repository,t.routes),this.isPersonalSpace=this.spacesBrowser.inPersonalSpace,this.loadFiles()}onFileEvent(t){if(t.archiveId){this.filesService.downloadTaskArchive(t.archiveId);return}let o=t?.fileDstPath===this.currentRoute;if(t.filePath===this.currentRoute||o){let r=o&&t.reloadFocusOnDst;if(t.fileName&&((t.focus||r)&&(this.focusOnSelect=t.fileName),t.delete&&!r))if(t.status===Pc.SUCCESS)this.files=this.files.filter(p=>p.name!==t.fileName),this.updateFilesStats(this.files),this.resetFilesSelection();else{let p=this.files.find(u=>u.name===t.fileName);p&&(p.isBeingDeleted=!1)}(t.reload||r)&&this.loadFiles()}}removeFiles(){let t=this.selection.filter(o=>!o.root?.alias);this.selection.length!==t.length&&this.layout.sendNotification("warning","Remove","You can not remove an anchored file"),t.length&&this.filesService.delete(t)}setFilePermissionsAndSpace(){if(this.selection[0]?.root&&this.selection[0].root.permissions.indexOf(qe.SHARE_OUTSIDE)===-1)return this.layout.sendNotification("warning",this.selection[0].name,"You do not have share permission"),null;let t=re({},this.selection[0]);if(this.isPersonalSpace)t.permissions=this.spacePermissions;else if(this.selection[0]?.root)if(t.permissions=this.selection[0].root.permissions,this.inSharesList)t.space={alias:this.selection[0].root.alias,name:this.selection[0].root.alias,root:void 0};else{let o=this.currentRoute.split("/")[1];t.space={alias:o,name:o,root:{alias:this.selection[0].root.alias,name:this.selection[0].name}}}else{t.permissions=this.spacePermissions;let[o,r]=this.currentRoute.split("/").slice(1,3);t.space={alias:o,name:o,root:{alias:r,name:r}}}return t}openViewerDialog(){let t=this.selection[0],o;this.inSharesList?o=t.root.permissions:o=t?.root?ic(this.spacePermissions,t?.root.permissions):this.spacePermissions,this.filesService.openViewerDialog(t,this.files,o).catch(console.error)}focusOn(t){if(!t){this.focusOnSelect=null;return}if(!this.files.length){this.focusOnSelect=t;return}let o=this.files.find(r=>r.name.toLowerCase()===t.toLowerCase());!o&&this.hasRoots&&(o=this.files.find(r=>r.root?.alias.toLowerCase()===t.toLowerCase())),o?(setTimeout(()=>this.scrollView.scrollInto(o),100),this.updateSelection([o])):this.focusOnSelect=t}updateFilesStats(t){this.stats={dirs:0,files:0,size:0,elements:0};for(let o of t)this.updateCounters(o)}updateCounters(t,o=!0){let r=o?ac:sc;this.stats.elements=r(this.stats.elements,1),this.stats.size=r(this.stats.size,t.size),t.isDir?this.stats.dirs=r(this.stats.dirs,1):this.stats.files=r(this.stats.files,1)}resetFilesSelection(){this.updateSelection([])}modifySelection(t){t&&(t.isSelected?this.updateSelection(this.selection.filter(o=>o.id!==t.id)):this.updateSelection([t,...this.selection]))}updateSelection(t){t.length?this.selection=this.files.filter(o=>t.indexOf(o)>-1?(o.isSelected=!0,!0):(o.isSelected=!1,!1)):this.selection=this.selection.filter(o=>(o.isSelected=!1,!1)),this.hasSelection=!!this.selection.length,this.hasDisabledItemsInSelection=!!this.selection.find(o=>o.isDisabled),this.canCompress=!this.hasDisabledItemsInSelection&&(this.selection.length>1||this.selection.length===1&&this.selection[0].isCompressible),this.multipleSelection=this.selection.length>1||this.selection.length===1&&this.selection[0].isDir,this.store.filesSelection.set(this.selection)}selectRangeFiles(t){let o=this.files.indexOf(t),r=this.selection.map(T=>this.files.indexOf(T)),p=[],u=Math.min(...r),v=Math.max(...r);if(o<u)for(let T=o;T<u;T++)p.push(this.files[T]);else if(o>v)for(let T=o;T>v;T--)p.push(this.files[T]);this.updateSelection([...this.selection,...p])}initEventHandlers(){this.zone.runOutsideAngular(()=>{this.eventDragOverHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragover",t=>{if(this.inSharesList||this.isTrashRepo&&!this.moveFromDrag)return t.preventDefault(),!1;["TD","TR","DIV","APP-VIRTUAL-SCROLL","IMG"].indexOf(t.target.nodeName)>-1&&(t.preventDefault(),this.moveFromDrag?t.dataTransfer.dropEffect="move":t.dataTransfer.dropEffect="copy")}),this.eventDragStartHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragstart",t=>{if(this.inSharesList&&t.preventDefault(),t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV"){let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&(this.selection.indexOf(o)===-1&&this.zone.run(()=>this.updateSelection([o])),this.moveFromDrag=!0)}}),this.eventDragEnterHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragenter",t=>{if(t.preventDefault(),this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV")){let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&o.isDir&&this.selection.indexOf(o)===-1&&(t.target.parentElement.nodeName==="TD"?this.renderer.addClass(t.target.parentElement,Pn):t.target.parentElement.classList.contains("card-body")&&this.renderer.addClass(t.target.parentElement.parentElement,Pn))}}),this.eventDragLeaveHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragleave",t=>{t.preventDefault(),this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"?this.renderer.removeClass(t.target.parentElement,Pn):t.target.parentElement.classList.contains("card-body")&&this.renderer.removeClass(t.target.parentElement.parentElement,Pn))}),this.eventDragEndHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragend",t=>{t.preventDefault(),this.moveFromDrag=!1}),this.eventDropHandler=this.renderer.listen(this.scrollView.element.nativeElement,"drop",t=>{if(this.inSharesList||this.isTrashRepo&&!this.moveFromDrag)return t.preventDefault(),!1;if(this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV")){t.preventDefault();let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&o.isDir&&this.selection.indexOf(o)===-1&&(this.renderer.removeClass(t.target.parentElement,Pn),this.selection.length&&this.zone.run(()=>this.filesService.copyMove(this.selection,o.path,Le.MOVE)))}else return t.dataTransfer.files.length?(t.preventDefault(),this.zone.run(()=>this.onDropFiles(t)),!1):(t.preventDefault(),!1)}),this.eventKeysHandler=this.renderer.listen(this.scrollView.element.nativeElement,"keydown",t=>{if(this.renamingInProgress)return;let o=t.keyCode||t.which;if([37,38,39,40].indexOf(o)===-1)return;if((o===37||o===39)&&!this.galleryMode.enabled)return;t.preventDefault(),t.stopPropagation();let r,p=this.selection.map(N=>this.files.indexOf(N)),u=this.galleryMode.enabled;o===37?(u=!1,o=38):o===39&&(u=!1,o=40),o===38?(u?r=Math.min(...p)-Math.ceil(this.scrollView.element.nativeElement.offsetWidth/(this.galleryMode.dimensions+this.galleryMode.margins)):r=Math.min(...p)-1,r<=-1&&(r=this.files.length-1)):(u?r=Math.max(...p)+Math.ceil(this.scrollView.element.nativeElement.offsetWidth/(this.galleryMode.dimensions+this.galleryMode.margins)):r=Math.max(...p)+1,r>=this.files.length&&(r=0));let v=this.files[r];this.zone.run(()=>{!t.shiftKey&&!t.ctrlKey&&!t.metaKey?this.updateSelection([v]):this.modifySelection(v)});let T=this.scrollView.element.nativeElement.querySelectorAll(Wc);if(T.length){let N;o===38?(N=T[0],Sa(N)||N.scrollIntoView(!0)):(N=T[T.length-1],Sa(N)||N.scrollIntoView(!1))}else setTimeout(()=>this.scrollView.scrollInto(v),0)})})}destroyEventHandlers(){for(let t of[this.eventDragStartHandler,this.eventDragOverHandler,this.eventDragEnterHandler,this.eventDragLeaveHandler,this.eventDragEndHandler,this.eventDropHandler,this.eventKeysHandler].filter(o=>o))try{t()}catch(o){console.warn(o)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-browser"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(wh,7),Y(Th,7),Y(Eh,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.mainReadOnlyContextMenu=p.first),W(p=j())&&(r.fileContextMenu=p.first)}},hostBindings:function(o,r){o&1&&f("keydown",function(u){return r.onKeyPress(u)},Ao)},decls:57,vars:41,consts:[["CommonMessages",""],["FileContextMenu",""],["ShareContextMenu",""],["MainReadOnlyContextMenu",""],["MainContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["dropdown","",1,"btn-group","btn-group-sm","me-1",3,"isDisabled"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"me-1"],[1,"mx-auto"],["l10nTranslate",""],["contextMenuItem",""],["contextMenuItem","",3,"subMenu"],["contextMenuItem","",3,"execute"],["dropdown","",1,"btn-group","btn-group-sm","me-1",3,"onShown"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["appUploadFiles","","id","uploadFilesButton",1,"dropdown-item",3,"uploadFiles","options"],["appUploadFiles","","id","uploadFoldersButton",1,"dropdown-item",3,"options"],["appUploadFiles","","id","uploadFoldersButton",1,"dropdown-item",3,"uploadFiles","options"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"disabled","tooltip"],[1,"dropdown-divider"],[1,"dropdown-item"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],[4,"ngTemplateOutlet"],["id","thumb-files","tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","deleted","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",1,"img-fluid",3,"max-height","src"],["alt","","draggable","true",3,"src","height","width"],[1,"label-bottom-right"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer",3,"tooltip","font-size"],[1,"badge","rounded-pill","bg-primary","cursor-pointer",3,"font-size"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","ms-1",3,"font-size"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"font-size"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"font-size"],[1,"label-bottom-left"],[1,"label-top-right"],[1,"card-footer","text-center","text-truncate","p-1"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth","textCenter","font-size"],["draggable","false",1,"no-pointer-events",3,"font-size"],["alt","","draggable","true",1,"img-fluid",3,"error","src"],["alt","","draggable","true",3,"error","src","height","width"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer",3,"click","tooltip"],[1,"badge","rounded-pill","bg-primary","cursor-pointer",3,"click"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","ms-1",3,"click"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],[3,"user","height","width","fontSize"],[1,"badge","rounded-pill","bg-warning"],["appInputEdit","","type","text","required","",3,"renamingInProgress","updateObject","inputObject","fullWidth","textCenter"],["draggable","false",1,"no-pointer-events"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["id","table-files","tabindex","-1"],[3,"disabled","deleted","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],["draggable","true",1,"d-flex","align-items-center"],["alt","","draggable","false","height","30","width","30",3,"error","src"],["appInputEdit","","required","","type","text",3,"inputObject"],[1,"d-flex","flex-column","text-truncate"],["appInputEdit","","required","","type","text",3,"renamingInProgress","updateObject","inputObject"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"d-flex","flex-column","align-items-center"],[3,"user"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer","me-1",3,"tooltip"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],["placement","auto",1,"badge","rounded-pill","bg-maroon","cursor-pointer","me-1",3,"click","tooltip"],["tooltipPlacement","auto",3,"permissions"],[1,"fs-sm","text-center","text-danger","fw-bold","no-select"],[1,"fs-sm","text-center","text-muted","fw-bold","no-select"],["contextMenuItem","",3,"divider"]],template:function(o,r){if(o&1){let p=y();a(0,"div",5)(1,"button",6),b(2,"translate"),f("click",function(){return h(p),g(r.loadFiles())}),_(3,"fa-icon",7),l(),C(4,Ph,5,5,"div",8),a(5,"button",9),b(6,"translate"),f("click",function(){return h(p),g(r.downloadFiles())}),_(7,"fa-icon",10),l(),C(8,Nh,5,6,"div",11),C(9,Lh,4,7),a(10,"div",11)(11,"button",12),_(12,"fa-icon",10),l(),R(13,Qh,15,6,"ul",13),l(),a(14,"div",14)(15,"div",15),_(16,"app-input-filter",16),l(),a(17,"app-navigation-view",17),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.switchView(v))}),l()()(),C(18,c1,7,10,"div",18)(19,R1,13,10),a(20,"div",19)(21,"span"),C(22,N1,3,5,"span",20),C(23,V1,3,5,"span"),l(),a(24,"span",21),d(25),b(26,"translate"),l(),a(27,"span")(28,"span",22),d(29,"Total"),l(),d(30),b(31,"toBytes"),l()(),R(32,H1,4,1,"ng-template",null,0,Ft),a(34,"context-menu",null,1),C(36,q1,4,3),C(37,X1,1,0,null,23),C(38,J1,1,0,null,23),C(39,tg,1,0,null,23),C(40,ng,1,0,null,23),C(41,rg,1,1,null,24),R(42,ag,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.addToClipboard())}),R(43,sg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),C(44,pg,2,1),l(),a(45,"context-menu",null,2),R(47,dg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openShareDialog())}),R(48,mg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openShareLinkDialog())}),C(49,_g,1,0,null,23),l(),a(50,"context-menu",null,3),R(52,fg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openEmptyTrashDialog())}),l(),a(53,"context-menu",null,4),C(55,gg,1,0,null,23)(56,wg,5,1),l()}o&2&&(s(),m("tooltip",E(2,27,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),x(!r.isTrashRepo&&!r.inSharesList?4:-1),s(),m("disabled",!r.hasSelection||r.hasDisabledItemsInSelection)("tooltip",E(6,30,"Download",r.locale.language)),s(2),m("icon",r.icons.faDownload),s(),x(!r.isTrashRepo&&r.canShare.outside||r.inSharesList?8:-1),s(),x(r.isTrashRepo?9:-1),s(),m("isDisabled",!r.hasSelection),s(2),m("icon",r.icons.faEllipsis),s(5),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?18:19),s(4),x(r.stats.dirs?22:-1),s(),x(r.stats.files?23:-1),s(2),w(Mt(26,33,r.hasSelection?r.selection.length>1?"nb_selections":"one_selection":"no_selection",r.locale.language,Ne(39,Ah,r.selection.length))),s(5),D("\xA0",G(31,37,r.stats.size)),s(6),x(r.selection.length===1?36:-1),s(),x(r.hasDisabledItemsInSelection?-1:37),s(),x(r.canCompress?38:-1),s(),x(!r.inSharesList&&r.selection.length===1&&!r.selection[0].isCompressible?39:-1),s(),x(r.hasDisabledItemsInSelection?-1:40),s(),x(!r.isTrashRepo&&r.canShare.outside||r.inSharesList&&(r.selection[0]!=null&&r.selection[0].canBeReShared)?41:-1),s(3),x(r.inSharesList?-1:44),s(5),x(r.isFilesRepo?49:-1),s(6),x(r.inSharesList?55:56))},dependencies:[P,F,Ke,Me,Ri,Pi,Ii,Fi,Ve,Ot,Lt,Vt,Xe,ea,lt,zt,Ze,Ad,vt,nt,Z,mr,Ee,gt,Cr],encapsulation:2});let i=n;return i})();var $n=(i,n)=>n.id;function Tg(i,n){if(i&1){let e=y();a(0,"div",2)(1,"div",3)(2,"button",4),f("click",function(){h(e);let o=c(2);return g(o.addToClipboard())}),_(3,"fa-icon",5),d(4," Send to Clipboard "),l()()(),_(5,"hr",6)}if(i&2){let e=c(2);s(3),m("icon",e.icons.faClipboardCheck)}}function Eg(i,n){if(i&1){let e=y();a(0,"div",7)(1,"img",8),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(2,"span",9),d(3),l()()}if(i&2){let e=n.$implicit;s(),m("src",e.mimeUrl,ee),s(2),w(e.name)}}function Ag(i,n){if(i&1&&(a(0,"div",1),k(1,Eg,4,2,"div",7,$n),l()),i&2){let e=c(2);s(),M(e.files())}}function Dg(i,n){if(i&1&&(a(0,"div",27),_(1,"img",28),l()),i&2){let e=c().$implicit,t=c(3);B("height",t.cardImageSize,"px"),s(),B("max-height",t.cardImageSize,"px"),m("src",X("",e.thumbnailUrl,"?size=256"),ee)}}function kg(i,n){if(i&1&&_(0,"app-files-viewer-media",13),i&2){let e=c().$implicit,t=c(3);m("currentHeight",t.cardImageSize)("fileUrl",e.dataUrl)}}function Mg(i,n){if(i&1){let e=y();a(0,"img",29),f("error",function(){h(e);let o=c().$implicit;return g(o.fallBackMimeUrl())}),l()}if(i&2){let e=c().$implicit,t=c(3);B("height",t.cardImageSize,"px"),m("src",e.mimeUrl,ee)}}function Fg(i,n){if(i&1&&_(0,"fa-icon",21),i&2){let e=c(4);m("icon",e.icons.faSpinner)}}function Pg(i,n){if(i&1&&d(0),i&2){c();let e=As(16);D(" ",e," ")}}function Ig(i,n){if(i&1&&(a(0,"span",30),_(1,"fa-icon",5),a(2,"span",31),d(3,"Exclusive"),l()()),i&2){let e=c(5);s(),m("icon",e.icons.faLock)}}function Rg(i,n){if(i&1&&(a(0,"span",30),_(1,"fa-icon",5),a(2,"span",31),d(3,"Shared"),l()()),i&2){let e=c(5);s(),m("icon",e.icons.faUnlock)}}function Ng(i,n){if(i&1&&C(0,Ig,4,1,"span",30)(1,Rg,4,1,"span",30),i&2){let e=c().$implicit;x(e.lock.isExclusive?0:1)}}function Vg(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Lg(i,n){if(i&1&&(a(0,"span",25),_(1,"fa-icon",5),d(2),l()),i&2){let e=c().$implicit,t=c(3);s(),m("icon",t.icons.SHARES),s(),D("\xA0",e.shares.length+e.links.length," ")}}function Og(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Bg(i,n){if(i&1&&(a(0,"span",25),_(1,"fa-icon",5),d(2),l()),i&2){let e=c().$implicit,t=c(3);s(),m("icon",t.icons.SPACES),s(),D("\xA0",e.spaces.length)}}function Ug(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Hg(i,n){if(i&1&&(a(0,"div",22)(1,"div",18),d(2,"Owner"),l(),_(3,"app-user-avatar",33),l()),i&2){let e=c(2).$implicit;s(3),m("user",e.root.owner)("height",26)("width",26)}}function $g(i,n){if(i&1&&_(0,"app-file-permissions",32),i&2){let e=c(2).$implicit;m("permissions",e.root.hPerms)}}function zg(i,n){i&1&&(a(0,"span",23),d(1,"no"),l())}function Gg(i,n){if(i&1&&(_(0,"hr",15),a(1,"div",16),C(2,Hg,4,3,"div",22),a(3,"div",27)(4,"div",18),d(5,"Permissions"),l(),C(6,$g,1,1,"app-file-permissions",32)(7,zg,2,0,"span",23),l()()),i&2){let e=c().$implicit;s(2),x(e.root.owner?2:-1),s(4),x(e.root.permissions?6:7)}}function Wg(i,n){if(i&1){let e=y();a(0,"div",38),f("click",function(){h(e);let o=c(2).$implicit,r=c(3);return g(r.openLockDialog(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),b(4,"fileLockFormatPipe"),l()()}if(i&2){let e=c(2).$implicit,t=c(3);s(),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faUnlock),s(2),D("\xA0",G(4,2,e.lock))}}function jg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToSpace(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.SPACES),s(2),D("\xA0",e.name)}}function Kg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToShare(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.SHARES),s(2),D("\xA0",e.name)}}function Qg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToShare(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.LINKS),s(2),D("\xA0",e.name)}}function qg(i,n){if(i&1){let e=y();a(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToSync(o))}),_(1,"fa-icon",5),a(2,"span"),d(3),l()()}if(i&2){let e=n.$implicit,t=c(5);s(),m("icon",t.icons.SYNC),s(2),D("\xA0",e.clientName)}}function Yg(i,n){if(i&1&&(_(0,"hr",34),a(1,"div",35),C(2,Wg,5,4,"div",36),k(3,jg,4,2,"div",37,$n),k(5,Kg,4,2,"div",37,$n),k(7,Qg,4,2,"div",37,$n),k(9,qg,4,2,"div",37,$n),l()),i&2){let e=c().$implicit;s(2),x(e.lock?2:-1),s(),M(e.spaces),s(2),M(e.shares),s(2),M(e.links),s(2),M(e.syncs)}}function Xg(i,n){if(i&1){let e=y();a(0,"div",10)(1,"div",11),C(2,Dg,2,6,"div",12)(3,kg,1,2,"app-files-viewer-media",13)(4,Mg,1,3,"img",14),l()(),_(5,"hr",15),a(6,"div",16)(7,"div",17)(8,"div",18),d(9,"Name"),l(),a(10,"div",19),d(11),l()(),a(12,"div",17)(13,"div",18),d(14,"Size"),l(),a(15,"div",20),Ts(16),b(17,"async"),C(18,Fg,1,1,"fa-icon",21)(19,Pg,1,1),l()(),a(20,"div",17)(21,"div",18),d(22,"Created"),l(),a(23,"div",20),d(24),b(25,"amDateFormat"),l()(),a(26,"div",17)(27,"div",18),d(28,"Modified"),l(),a(29,"div",20),d(30),b(31,"amDateFormat"),l()(),a(32,"div",22)(33,"div",18),d(34,"Lock"),l(),C(35,Ng,2,1)(36,Vg,2,0,"span",23),l(),a(37,"div",22)(38,"div",18),d(39,"Shared"),l(),a(40,"div",24),C(41,Lg,3,2,"span",25)(42,Og,2,0,"span",23),l()(),a(43,"div",22)(44,"div",18),d(45,"Anchored"),l(),C(46,Bg,3,2,"span",25)(47,Ug,2,0,"span",23),l(),a(48,"div",22)(49,"div",18),d(50,"Synced"),l(),a(51,"span"),d(52),b(53,"translate"),l()(),a(54,"div",22)(55,"div",18),d(56,"Comments"),l(),a(57,"span",26),f("click",function(){h(e);let o=c(3);return g(o.goToComments())}),d(58),b(59,"translate"),l()()(),C(60,Gg,8,2),C(61,Yg,11,1)}if(i&2){let e,t=n.$implicit,o=c(3);s(2),x((e=t.shortMime)==="image"?2:e==="media"?3:4),s(9),w(t.name),s(5);let r=Es(G(17,18,o.getSizeLazy(t)));s(2),x(r===null?18:19),s(6),w(G(25,21,t.ctime)),s(6),w(G(31,23,t.mtime)),s(5),x(t.lock?35:36),s(6),x(t.shares.length||t.links.length?41:42),s(5),x(t.spaces.length?46:47),s(5),L(X("badge rounded-pill ",t.syncs.length?"bg-primary":"bg-secondary-alt")),s(),D(" ",E(53,25,t.syncs.length?"yes":"no",o.locale.language)," "),s(5),L(X("badge rounded-pill ",t.hasComments?"bg-success":"bg-secondary-alt"," cursor-pointer")),s(),D(" ",E(59,28,t.hasComments?"yes":"no",o.locale.language)," "),s(2),x(t.root?60:-1),s(),x(t.lock||t.spaces.length||t.shares.length||t.links.length||t.syncs.length?61:-1)}}function Zg(i,n){if(i&1&&k(0,Xg,62,31,null,null,$n),i&2){let e=c(2);M(e.files())}}function Jg(i,n){if(i&1&&(C(0,Tg,6,1),a(1,"div",0),C(2,Ag,3,0,"div",1)(3,Zg,2,0),l()),i&2){let e=c();x(e.multiple()?0:-1),s(),m("resizeOffset",e.resizeOffset()),s(),x(e.multiple()?2:3)}}var Vd=(()=>{let n=class n{constructor(){this.files=se.required(),this.locale=S($),this.multiple=ve(()=>this.files().length>1),this.resizeOffset=ve(()=>this.multiple()?120:80),this.cardImageSize=80,this.icons={SPACES:ie.SPACES,SHARES:ie.SHARES,LINKS:ie.LINKS,SYNC:cr.SYNC,faLock:ii,faUnlock:dl,faClipboardCheck:Uo,faArrowsAlt:ti,faSpinner:Ue},this.fileLockPropsToString=Ac,this.router=S(Ce),this.layout=S(I),this.filesService=S(He)}goToShare(t){this.layout.toggleRSideBar(!1),this.router.navigate([t.type===0?z.SHARED:z.LINKS],{queryParams:{select:t.name}}).catch(console.error)}goToSpace(t){this.layout.toggleRSideBar(!1),this.router.navigate([z.SPACES],{queryParams:{select:t.name}}).catch(console.error)}goToComments(){this.layout.showRSideBarTab(fe.COMMENTS,!0)}addToClipboard(){this.filesService.addToClipboard(this.files()),this.layout.showRSideBarTab(fe.CLIPBOARD,!0)}goToSync(t){this.layout.toggleRSideBar(!1),this.router.navigate([Ae.BASE,Ae.CLIENTS],{state:{clientId:t.clientId,pathId:t.id}}).catch(console.error)}openLockDialog(t){this.filesService.openLockDialog(t)}getSizeLazy(t){return t.isDir?(t.hDirSize||(t.hDirSize=this.filesService.getSize(t).pipe(bt(o=>rc(o,0,!0)),bo(()=>t.hDirSize=gi(t.hSize)),gs(1))),t.hDirSize):gi(t.hSize)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-selection"]],inputs:{files:[1,"files"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"flex-column","p-2","w-100"],[1,"px-2","pt-2","pb-0","fs-xxs"],[1,"d-flex","justify-content-center","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","me-1",3,"click"],[3,"icon"],[1,"mx-0","mt-2","mb-0"],[1,"d-inline-flex","w-100","align-content-center","align-items-center","mx-1"],["alt","","height","30","width","auto",1,"me-1",3,"error","src"],[1,"text-truncate"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"d-flex","align-items-center",3,"height"],[3,"currentHeight","fileUrl"],["alt","",3,"src","height"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],["animation","spin-pulse",3,"icon"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"d-flex","col-sm-7"],[1,"badge","rounded-pill","bg-primary"],[3,"click"],[1,"d-flex","align-items-center"],["alt","",1,"img-fluid",3,"src"],["alt","",3,"error","src"],["l10nTranslate","",1,"badge","rounded-pill","bg-maroon"],["l10nTranslate","",1,"ms-1"],[3,"permissions"],["tooltipPlacement","bottom",3,"user","height","width"],[1,"mt-1","mb-2"],[1,"d-flex","flex-wrap","align-items-center","p-2","fs-xs"],[1,"badge","rounded-pill","white-space-normal","bg-maroon","cursor-pointer","mb-2"],[1,"badge","rounded-pill","white-space-normal","bg-primary","cursor-pointer","me-1","mb-2"],[1,"badge","rounded-pill","white-space-normal","bg-maroon","cursor-pointer","mb-2",3,"click"],[1,"badge","rounded-pill","white-space-normal","bg-primary","cursor-pointer","me-1","mb-2",3,"click"]],template:function(o,r){o&1&&C(0,Jg,4,3),o&2&&x(r.files().length?0:-1)},dependencies:[ce,P,F,Fc,Ze,vt,Fe,Z,sn,Cr],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function eC(i,n){if(i&1&&d(0),i&2){let e=c(2);D(" ",e.link().link.currentIp," ")}}function tC(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);D(" ",G(1,1,e.link().link.currentAccess)," ")}}function iC(i,n){if(i&1&&d(0),i&2){let e=c(2);D(" ",e.link().link.lastIp," ")}}function nC(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);D(" ",G(1,1,e.link().link.lastAccess)," ")}}function oC(i,n){if(i&1&&(a(0,"span")(1,"span"),d(2),b(3,"translate"),b(4,"translate"),l()()),i&2){let e=c(2);L(X("badge rounded-pill bg-",e.link().hTimeExpirationAgo>=1?"warning":"danger")),s(2),w(e.link().hTimeExpirationAgo>=1?e.link().hTimeExpirationAgo+"\xA0"+E(3,4,"days",e.locale.language):E(4,7,"expired",e.locale.language))}}function rC(i,n){i&1&&(a(0,"span",13),d(1," no "),l())}function aC(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(2);L(X("badge rounded-pill ",e.link().link.nbAccess>=e.link().link.limitAccess?"bg-danger":"bg-success")),s(),Re(" ",e.link().link.nbAccess,"/",e.link().link.limitAccess," ")}}function sC(i,n){if(i&1&&(a(0,"span",14),d(1),l()),i&2){let e=c(2);s(),w(e.link().link.nbAccess)}}function lC(i,n){if(i&1&&_(0,"app-file-permissions",16),i&2){let e=c(2);m("permissions",e.link().hPerms)}}function cC(i,n){i&1&&(a(0,"span",13),d(1,"no"),l())}function pC(i,n){if(i&1){let e=y();a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),f("error",function(){h(e);let o=c();return g(o.link().fallBackMimeUrl())}),l()()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),l()(),a(11,"div",6)(12,"div",7),d(13,"Created"),l(),a(14,"div",9),d(15),b(16,"amDateFormat"),l()(),a(17,"div",10),f("mouseover",function(){h(e);let o=c();return g(o.accessHover=!0)})("mouseleave",function(){h(e);let o=c();return g(o.accessHover=!1)})("focus",function(){h(e);let o=c();return g(o.accessHover=!0)}),a(18,"div",7),d(19,"Accessed"),l(),a(20,"div",9),C(21,eC,1,1)(22,tC,2,3),l()(),a(23,"div",10),f("mouseover",function(){h(e);let o=c();return g(o.lastAccessHover=!0)})("mouseleave",function(){h(e);let o=c();return g(o.lastAccessHover=!1)})("focus",function(){h(e);let o=c();return g(o.accessHover=!0)}),a(24,"div",7),d(25,"Last access"),l(),a(26,"div",9),C(27,iC,1,1)(28,nC,2,3),l()(),a(29,"div",11)(30,"div",7),d(31,"Authentication"),l(),a(32,"span"),d(33),b(34,"translate"),l()(),a(35,"div",11)(36,"div",7),d(37,"Expired"),l(),C(38,oC,5,10,"span",12)(39,rC,2,0,"span",13),l(),a(40,"div",11)(41,"div",7),d(42,"Active"),l(),a(43,"span"),d(44),b(45,"translate"),l()(),a(46,"div",11)(47,"div",7),d(48,"Access"),l(),C(49,aC,2,5,"span",12)(50,sC,2,1,"span",14),l()(),_(51,"hr",4),a(52,"div",5)(53,"div",11)(54,"div",7),d(55,"Shared from"),l(),_(56,"app-share-repository",15),l(),a(57,"div",11)(58,"div",7),d(59,"Permissions"),l(),C(60,lC,1,1,"app-file-permissions",16)(61,cC,2,0,"span",13),l()()()}if(i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("height",e.cardImageSize,"px"),m("src",e.link().mimeUrl,ee),s(7),w(e.link().name),s(5),w(G(16,21,e.link().link.createdAt)),s(6),x(e.accessHover?21:22),s(6),x(e.lastAccessHover?27:28),s(5),L(X("badge rounded-pill ",e.link().link.requireAuth?"bg-success":"bg-warning")),s(),D(" ",E(34,23,e.link().link.requireAuth?"yes":"no",e.locale.language)," "),s(5),x(e.link().link.expiresAt?38:39),s(5),L(X("badge rounded-pill ",e.link().link.isActive?"bg-primary":"bg-danger")),s(),D(" ",E(45,26,e.link().link.isActive?"yes":"no",e.locale.language)," "),s(5),x(e.link().link.limitAccess!==0?49:50),s(7),m("share",e.link())("showIcon",!1),s(4),x(e.link().link.permissions?60:61)}}var Ld=(()=>{let n=class n{constructor(){this.link=se.required(),this.locale=S($),this.cardImageSize=80,this.resizeOffset=80,this.accessHover=!1,this.lastAccessHover=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-link-selection"]],inputs:{link:[1,"link"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],["alt","","draggable","false",3,"error","src"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],[1,"d-flex","mb-1",3,"mouseover","mouseleave","focus"],[1,"d-flex","align-items-center","mb-1"],[3,"class"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"badge","rounded-pill","bg-success"],[3,"share","showIcon"],[3,"permissions"]],template:function(o,r){o&1&&C(0,pC,62,29,"div",0),o&2&&x(r.link()?0:-1)},dependencies:[ce,P,ai,vt,Z,Fe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();var dC=()=>["shares"];function mC(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(2);s(),w(E(2,1,e.share().counts,Tt(4,dC)))}}function uC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function _C(i,n){if(i&1){let e=y();a(0,"span",15),f("click",function(){h(e);let o=c(2);return g(o.childShareDialog(o.share()))}),_(1,"fa-icon",16),a(2,"span"),d(3),l()()}if(i&2){let e=c(2);s(),m("icon",e.iconShared),s(2),w(e.share().counts.shares)}}function fC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function hC(i,n){if(i&1){let e=y();a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),f("error",function(){h(e);let o=c();return g(o.share().fallBackMimeUrl())}),l()()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),l()(),a(11,"div",6)(12,"div",7),d(13,"Created"),l(),a(14,"div",9),d(15),b(16,"amDateFormat"),l()(),a(17,"div",6)(18,"div",7),d(19,"Modified"),l(),a(20,"div",9),d(21),b(22,"amDateFormat"),l()(),a(23,"div",10)(24,"div",7),d(25,"Members"),l(),C(26,mC,3,5,"span")(27,uC,2,0,"span",11),l(),a(28,"div",10)(29,"div",7),d(30,"Child shares"),l(),C(31,_C,4,2,"span",12)(32,fC,2,0,"span",11),l(),a(33,"div",10)(34,"div",7),d(35,"Comments"),l(),a(36,"span",13),f("click",function(){h(e);let o=c();return g(o.goToComments())}),d(37),b(38,"translate"),l()()(),_(39,"hr",4),a(40,"div",5)(41,"div",10)(42,"div",7),d(43,"Shared from"),l(),_(44,"app-share-repository",14),l()()()}if(i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("height",e.cardImageSize,"px"),m("src",e.share().mimeUrl,ee),s(7),w(e.share().name),s(5),w(G(16,15,e.share().createdAt)),s(6),w(G(22,17,e.share().modifiedAt)),s(5),x(e.share().counts.users||e.share().counts.groups?26:27),s(5),x(e.share().counts.shares?31:32),s(5),L(X("badge rounded-pill ",e.share().hasComments?"bg-success":"bg-secondary-alt"," cursor-pointer")),s(),D(" ",E(38,19,e.share().hasComments?"yes":"no",e.locale.language)," "),s(7),m("share",e.share())("showIcon",!1)}}var Od=(()=>{let n=class n{constructor(){this.share=se.required(),this.locale=S($),this.iconShared=ie.SHARED_WITH_OTHERS,this.cardImageSize=80,this.resizeOffset=80,this.layout=S(I),this.sharesService=S(si)}childShareDialog(t){t.counts.shares&&this.layout.openDialog(Li,null,{initialState:{share:t}})}goToComments(){this.share().hasComments&&this.sharesService.goTo(this.share()).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-selection"]],inputs:{share:[1,"share"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],["alt","","draggable","false",3,"error","src"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[3,"click"],[3,"share","showIcon"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"]],template:function(o,r){o&1&&C(0,hC,45,22,"div",0),o&2&&x(r.share()?0:-1)},dependencies:[ce,P,F,ai,Z,Fe,oi],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function gC(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faSpinner)}}function CC(i,n){i&1&&(a(0,"span",5),d(1,"You have no files anchored on this space"),l())}var na=(()=>{let n=class n{constructor(){this.layout=S(I),this.addRootFileEvent=new vo,this.icons={faAnchor:ni,faPlus:Qe,faSpinner:Ue,SPACES:ie.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=S(ot)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:t=>this.setSpaceRoots(t),error:t=>{this.layout.sendNotification("error","Manage my anchored files",t.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Bn,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(pe(1)).subscribe(o=>this.addRootFileEvent.next(o))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(t=>({id:t.id,alias:t.alias,name:t.name,permissions:t.permissions,file:{id:t.file.id,path:t.file.path,mime:t.file.mime}}))).subscribe({next:t=>{this.setSpaceRoots(t),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Manage my anchored files",t.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(t){this.space.roots=[];for(let o of t)this.space.addRoot(Se(re({},o),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),C(5,gC,1,1,"fa-icon",3),a(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),l()(),a(9,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),a(10,"div",7),_(11,"app-space-manage-roots",8),C(12,CC,2,0,"span",5),l(),a(13,"div",9)(14,"button",10),f("click",function(){return r.openSelectRootDialog()}),_(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),l(),a(18,"button",12),f("click",function(){return r.layout.closeDialog()}),d(19,"Cancel"),l(),a(20,"button",13),f("click",function(){return r.onSubmit()}),d(21," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.SPACES),s(2),w(r.space.name),s(),x(r.loading?5:-1),s(6),m("space",r.space)("user",r.user)("showUsers",!1)("addRootFile",r.addRootFileEvent),s(),x(r.space.roots.length?-1:12),s(3),m("icon",r.icons.faPlus),s(),m("icon",r.icons.faAnchor),s(4),m("disabled",r.submitted))},dependencies:[F,P,Hn],encapsulation:2});let i=n;return i})();var xC=()=>["roots"],SC=(i,n)=>n.id;function vC(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(2);s(),w(E(2,1,e.space().counts,Tt(4,xC)))}}function yC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function bC(i,n){if(i&1){let e=y();a(0,"span",15),f("click",function(){h(e);let o=c(2);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",16),a(2,"span"),d(3),l()()}if(i&2){let e=c(2);s(),m("icon",e.icons.ANCHORED),s(2),w(e.space().counts.roots)}}function wC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function TC(i,n){if(i&1){let e=y();a(0,"span",18),f("click",function(){h(e);let o=c(3);return g(o.openChildShareDialog(o.space()))}),_(1,"fa-icon",16),a(2,"span"),d(3),l()()}if(i&2){let e=c(3);s(),m("icon",e.icons.SHARED),s(2),w(e.space().counts.shares)}}function EC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function AC(i,n){if(i&1&&(a(0,"div",10)(1,"div",7),d(2,"Child shares"),l(),C(3,TC,4,2,"span",17)(4,EC,2,0,"span",11),l()),i&2){let e=c(2);s(3),x(e.space().counts.shares?3:4)}}function DC(i,n){if(i&1&&_(0,"app-user-avatar",13),i&2){let e=n.$implicit;m("user",e)("isMember",!0)("height",26)("width",26)}}function kC(i,n){if(i&1&&_(0,"app-file-permissions",14),i&2){let e=c(2);m("permissions",e.space().hPerms)}}function MC(i,n){i&1&&(a(0,"span",11),d(1,"no"),l())}function FC(i,n){if(i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,"fa-icon",3),l()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),l()(),a(11,"div",6)(12,"div",7),d(13,"Created"),l(),a(14,"div",9),d(15),b(16,"amDateFormat"),l()(),a(17,"div",6)(18,"div",7),d(19,"Modified"),l(),a(20,"div",9),d(21),b(22,"amDateFormat"),l()(),a(23,"div",10)(24,"div",7),d(25,"Members"),l(),C(26,vC,3,5,"span")(27,yC,2,0,"span",11),l(),a(28,"div",10)(29,"div",7),d(30,"Anchored"),l(),C(31,bC,4,2,"span",12)(32,wC,2,0,"span",11),l(),C(33,AC,5,1,"div",10),l(),_(34,"hr",4),a(35,"div",5)(36,"div",10)(37,"div",7),d(38,"Managers"),l(),k(39,DC,1,4,"app-user-avatar",13,SC),l(),a(41,"div",10)(42,"div",7),d(43,"Permissions"),l(),C(44,kC,1,1,"app-file-permissions",14)(45,MC,2,0,"span",11),l()()()),i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("width",e.cardImageSize,"px")("height",e.cardImageSize,"px"),m("icon",e.icons.SPACES)("fixedWidth",!1),s(7),w(e.space().name),s(5),w(G(16,14,e.space().createdAt)),s(6),w(G(22,16,e.space().modifiedAt)),s(5),x(e.space().counts.users||e.space().counts.groups?26:27),s(5),x(e.space().counts.roots?31:32),s(2),x(e.space().role===e.SPACE_ROLE.IS_MANAGER?33:-1),s(6),M(e.space().managers),s(5),x(e.space().permissions?44:45)}}var Bd=(()=>{let n=class n{constructor(){this.space=se.required(),this.locale=S($),this.SPACE_ROLE=vn,this.icons={SPACES:ie.SPACES,ANCHORED:ie.ANCHORED,SHARED:ie.SHARED_WITH_OTHERS},this.cardImageSize=80,this.resizeOffset=80,this.userService=S(oe),this.layout=S(I)}openSpaceRootsDialog(){this.layout.openDialog(na,"md",{initialState:{space:this.space(),user:this.userService.user}})}openChildShareDialog(t){t.counts.shares&&this.layout.openDialog(Li,null,{initialState:{space:t}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-selection"]],inputs:{space:[1,"space"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"circle-primary-icon",2,"font-size","48px",3,"icon","fixedWidth"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"word-break-all","fs-xxs"],[1,"fs-xxs"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],["tooltipPlacement","bottom",3,"user","isMember","height","width"],[3,"permissions"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"]],template:function(o,r){o&1&&C(0,FC,46,18,"div",0),o&2&&x(r.space()?0:-1)},dependencies:[ce,F,P,vt,Ze,oi,Fe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function PC(i,n){if(i&1&&(a(0,"span",11),d(1),l()),i&2){let e=c(2);s(),w(e.trash().nb)}}function IC(i,n){i&1&&(a(0,"span",12),d(1,"no"),l())}function RC(i,n){if(i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,"fa-icon",3),l()(),_(4,"hr",4),a(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),a(9,"div",8),d(10),b(11,"translate"),l()(),a(12,"div",6)(13,"div",7),d(14,"Created"),l(),a(15,"div",9),d(16),b(17,"amDateFormat"),l()(),a(18,"div",6)(19,"div",7),d(20,"Modified"),l(),a(21,"div",9),d(22),b(23,"amDateFormat"),l()(),a(24,"div",10)(25,"div",7),d(26,"Elements"),l(),C(27,PC,2,1,"span",11)(28,IC,2,0,"span",12),l()()()),i&2){let e=c();m("resizeOffset",e.resizeOffset),s(3),B("width",e.cardImageSize,"px")("height",e.cardImageSize,"px"),m("icon",e.iconTrash)("fixedWidth",!1),s(7),w(e.trash().isPersonal?E(11,11,e.trash().name,e.locale.language):e.trash().name),s(6),w(G(17,14,e.trash().ctime)),s(6),w(G(23,16,e.trash().mtime)),s(5),x(e.trash().nb?27:28)}}var Ud=(()=>{let n=class n{constructor(){this.trash=se.required(),this.locale=S($),this.iconTrash=ie.TRASH,this.cardImageSize=80,this.resizeOffset=80}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-trash-selection"]],inputs:{trash:[1,"trash"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-xxs",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"circle-primary-icon",2,"font-size","48px",3,"icon","fixedWidth"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-sm-5","ps-1","pb-1","fw-bold"],[1,"d-flex","col-sm-7","word-break-all","fs-xxs"],[1,"d-flex","col-sm-7","fs-xxs"],[1,"d-flex","align-items-center","mb-1"],[1,"badge","rounded-pill","bg-danger"],["l10nTranslate","",1,"badge","rounded-pill","bg-secondary-alt"]],template:function(o,r){o&1&&C(0,RC,29,18,"div",0),o&2&&x(r.trash()?0:-1)},dependencies:[ce,F,P,Fe,Z],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function NC(i,n){if(i&1&&_(0,"app-files-selection",0),i&2){let e=c();m("files",e.store.filesSelection())}}function VC(i,n){if(i&1&&_(0,"app-space-selection",1),i&2){let e=c();m("space",e.store.spaceSelection())}}function LC(i,n){if(i&1&&_(0,"app-share-selection",2),i&2){let e=c();m("share",e.store.shareSelection())}}function OC(i,n){if(i&1&&_(0,"app-trash-selection",3),i&2){let e=c();m("trash",e.store.trashSelection())}}function BC(i,n){if(i&1&&_(0,"app-link-selection",4),i&2){let e=c();m("link",e.store.linkSelection())}}var Hd=(()=>{let n=class n{constructor(){this.store=S(te),this.SPACES_PATH=z,this.selectionType=ve(()=>this.setRepository(this.store.repository()))}setRepository(t){return[z.SPACES,z.SHARED,z.LINKS,z.TRASHES].indexOf(t)>-1?t:z.FILES}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-selection"]],decls:5,vars:1,consts:[[3,"files"],[3,"space"],[3,"share"],[3,"trash"],[3,"link"]],template:function(o,r){if(o&1&&C(0,NC,1,1,"app-files-selection",0)(1,VC,1,1,"app-space-selection",1)(2,LC,1,1,"app-share-selection",2)(3,OC,1,1,"app-trash-selection",3)(4,BC,1,1,"app-link-selection",4),o&2){let p;x((p=r.selectionType())===r.SPACES_PATH.FILES?0:p===r.SPACES_PATH.SPACES?1:p===r.SPACES_PATH.SHARED?2:p===r.SPACES_PATH.TRASHES?3:p===r.SPACES_PATH.LINKS?4:-1)}},dependencies:[Vd,Od,Bd,Ud,Ld],encapsulation:2,changeDetection:0});let i=n;return i})();var UC=["CommentCreate"],HC=(i,n)=>n.id;function $C(i,n){if(i&1){let e=y();a(0,"i",14),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.onEditComment(o))}),_(1,"fa-icon",15),l()}if(i&2){let e=c(3);s(),m("icon",e.icons.faEdit)}}function zC(i,n){if(i&1){let e=y();_(0,"textarea",16,1),a(2,"div",17)(3,"button",18),f("click",function(){h(e);let o=Be(1),r=c().$implicit,p=c(2);return g(p.updateComment(r,o.value))}),d(4," Update "),l(),a(5,"button",19),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.onEditComment(o))}),d(6," Cancel "),l(),a(7,"button",20),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.removeComment(o))}),d(8," Remove "),l()()}if(i&2){let e=Be(1),t=c().$implicit;m("ngModel",t.content)("disabled",!t.author.isAuthor&&t.isFileOwner),s(3),m("disabled",!e.value||t.content===e.value)}}function GC(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"amDateFormat"),l()),i&2){let e=c(2).$implicit;s(),w(G(2,1,e.dateToShow))}}function WC(i,n){i&1&&(a(0,"span",22),d(1,"modified"),l())}function jC(i,n){if(i&1&&(C(0,WC,2,0,"span",22),a(1,"span"),d(2),b(3,"amTimeAgo"),l()),i&2){let e=c(2).$implicit;x(e.wasModified?0:-1),s(2),w(G(3,2,e.dateToShow))}}function KC(i,n){if(i&1){let e=y();a(0,"div"),d(1),l(),a(2,"span",21),f("mouseleave",function(){h(e);let o=c().$implicit;return g(o.isHover=!1)})("mouseover",function(){h(e);let o=c().$implicit;return g(o.isHover=!0)})("focus",function(){h(e);let o=c().$implicit;return g(o.isHover=!0)}),C(3,GC,3,3,"span")(4,jC,4,4),l()}if(i&2){let e=c().$implicit;s(),w(e.content),s(2),x(e.isHover?3:4)}}function QC(i,n){if(i&1&&(a(0,"div",7)(1,"div",8),_(2,"app-user-avatar",9),a(3,"div",10)(4,"b"),d(5),b(6,"translate"),l()(),a(7,"div",11),C(8,$C,2,1,"i",12),l()(),a(9,"div",13),C(10,zC,9,3)(11,KC,5,2),l()()),i&2){let e=n.$implicit,t=c(2);s(2),m("user",e.author)("width",24)("height",24),s(3),w(e.author.isAuthor?E(6,6,"Me",t.locale.language):e.author.fullName),s(3),x(e.author.isAuthor||e.isFileOwner?8:-1),s(2),x(e.isEdited?10:11)}}function qC(i,n){if(i&1&&(a(0,"div",6),k(1,QC,12,9,"div",7,HC),l()),i&2){let e=c();s(),M(e.comments)}}var $d=(()=>{let n=class n{constructor(){this.locale=S($),this.comments=[],this.icons={faEdit:ul},this.store=S(te),this.file=ve(()=>this.store.filesSelection().length?this.store.filesSelection()[0]:null),this.layout=S(I),this.commentsService=S(Wr),this.subscriptions=[],this.subscriptions.push(di(this.file).subscribe(t=>this.loadComments(t)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onEditComment(t){t.isEdited||this.comments.forEach(o=>o.isEdited=!1),t.isEdited=!t.isEdited}loadComments(t){t&&t.hasComments?this.commentsService.getComments(this.file()).subscribe({next:o=>this.comments=o,error:o=>this.layout.sendNotification("error","Comments","Unable to load",o)}):this.comments=[]}postComment(){let t=this.commentInput.nativeElement.value;this.commentsService.createComment(this.file(),{content:t,fileId:this.file().id}).subscribe({next:o=>{this.comments.unshift(o),this.commentInput.nativeElement.value="",this.file().id=o.fileId,this.file().hasComments=!!this.comments.length},error:o=>this.layout.sendNotification("error","Comment","Unable to create",o)})}removeComment(t){this.commentsService.deleteComment(this.file(),{commentId:t.id,fileId:this.file().id}).subscribe({next:()=>{this.comments=this.comments.filter(o=>o.id!==t.id),this.file().hasComments=!!this.comments.length},error:o=>this.layout.sendNotification("error","Comment","Unable to delete",o)})}updateComment(t,o){this.commentsService.updateComment(this.file(),{commentId:t.id,fileId:this.file().id,content:o}).subscribe({next:r=>{t.isEdited=!1,Object.assign(t,r)},error:r=>{this.layout.sendNotification("error","Comment","Unable to update",r)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-comments-selection"]],viewQuery:function(o,r){if(o&1&&Y(UC,7),o&2){let p;W(p=j())&&(r.commentInput=p.first)}},decls:8,vars:7,consts:[["CommentCreate",""],["CommentUpdate",""],[1,"sidebar-component-title"],[1,"input-group","mb-0"],["type","text","appAutofocus","",1,"form-control","form-control-sm",3,"keyup.enter","disabled","placeholder"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"click","disabled"],["appAutoResize","",1,"fs-xxs","p-2"],[1,"mb-1","app-small-card","app-comment","rounded"],[1,"d-flex","px-2","pt-2","pb-1"],[3,"user","width","height"],[1,"align-self-center","ms-1"],[1,"ms-auto","align-self-center",2,"font-size","14px"],[1,"cursor-pointer"],[1,"pb-2","px-2"],[1,"cursor-pointer",3,"click"],[3,"icon"],["required","",1,"form-control","form-control-sm","mt-1","mb-2",3,"ngModel","disabled"],[1,"d-flex"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary","me-auto",3,"click","disabled"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xxs","btn-secondary","align-content-around",3,"click"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xxs","btn-danger","ms-auto",3,"click"],[1,"text-muted","no-select","pt-1","fs-xxxs",3,"mouseleave","mouseover","focus"],["l10nTranslate","",1,"me-1"]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"div",3)(2,"input",4,0),b(4,"translate"),f("keyup.enter",function(){return h(p),g(r.postComment())}),l(),a(5,"button",5),f("click",function(){return h(p),g(r.postComment())}),d(6," Add "),l()()(),C(7,qC,3,0,"div",6)}if(o&2){let p=Be(3);s(2),m("disabled",!r.file())("placeholder",E(4,4,"Write a comment ...",r.locale.language)),s(3),m("disabled",!p.value),s(2),x(r.comments.length?7:-1)}},dependencies:[Ye,P,ce,F,be,je,xe,ei,ye,Ze,Z,Fe,Je],encapsulation:2});let i=n;return i})();var YC=(i,n)=>n.key,XC=(i,n)=>n.id;function ZC(i,n){if(i&1&&(a(0,"option",8),d(1),l()),i&2){let e=n.$implicit;m("ngValue",e.key),s(),w(e.value.text)}}function JC(i,n){if(i&1){let e=y();a(0,"div",12)(1,"div",13)(2,"img",14),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),a(3,"div",15),d(4),l(),a(5,"button",16),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.remove(o))}),_(6,"fa-icon",4),l()()()}if(i&2){let e=n.$implicit,t=c(2);s(),m("tooltip",e.path),s(),m("src",e.mimeUrl,ee),s(2),w(e.name),s(2),m("icon",t.icons.faTimes)}}function ex(i,n){if(i&1){let e=y();a(0,"div",5)(1,"div",6)(2,"select",7),ue("ngModelChange",function(o){h(e);let r=c();return me(r.selectedAction,o)||(r.selectedAction=o),g(o)}),k(3,ZC,2,2,"option",8,YC),b(5,"keyvalue"),l(),a(6,"button",9),f("click",function(){h(e);let o=c();return g(o.doAction())}),d(7,"Confirm"),l()()(),_(8,"hr",10),a(9,"div",11),k(10,JC,7,4,"div",12,XC),l()}if(i&2){let e=c();s(2),de("ngModel",e.selectedAction),s(),M(E(5,2,e.operations,e.originalOrderKeyValue)),s(6),m("resizeOffset",120),s(),M(e.files)}}var zd=(()=>{let n=class n{constructor(){this.locale=S($),this.icons={faTrashCan:Ai,faTimes:Rt,faDownload:Cn,faArrowsAlt:ti,faClone:gn,faQuestion:No},this.originalOrderKeyValue=De,this.operations={copyPaste:{text:"Copy-Paste",operation:Le.COPY},cutPaste:{text:"Cut-Paste",operation:Le.MOVE},download:{text:"Download",operation:Le.DOWNLOAD},compress:{text:"Compress",operation:Le.COMPRESS}},this.files=[],this.layout=S(I),this.store=S(te),this.filesService=S(He),this.selectedAction=this.filesService.clipboardAction,this.subscriptions=[],this.subscriptions.push(this.store.filesClipboard.subscribe(t=>this.files=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}clearAll(){this.layout.toggleRSideBar(!1),this.filesService.clearClipboard()}remove(t){this.files.length===1?this.clearAll():this.filesService.removeFromClipboard(t)}doAction(){if(this.selectedAction==="copyPaste"||this.selectedAction==="cutPaste")this.filesService.onPasteClipboard(this.selectedAction);else{let t={name:this.files[0].name,compressInDirectory:this.operations[this.selectedAction].operation===Le.COMPRESS,files:this.files.map(r=>({name:r.name,rootAlias:r.root?.alias,path:r.path})),extension:"tar"};this.layout.openDialog(ta,null,{initialState:{archiveProps:t}}).content.submitEvent.pipe(pe(1)).subscribe(()=>this.filesService.clearClipboard())}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-clipboard"]],decls:8,vars:7,consts:[[1,"sidebar-component-title"],["container","body","placement","left",1,"cursor-pointer",3,"icon","tooltip"],["l10nTranslate",""],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],[1,"px-2","pt-2","pb-2","fs-xs"],[1,"d-flex","justify-content-between","mt-2"],[1,"form-select","form-select-sm","my-auto",3,"ngModelChange","ngModel"],["l10nTranslate","",3,"ngValue"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary","ms-1",3,"click"],[1,"mx-0","mt-2","mb-0"],["appAutoResize","",1,"sidebar-item",3,"resizeOffset"],[1,"sidebar-item-container"],[1,"sidebar-item-content",3,"tooltip"],["alt","","height","28","width","auto",1,"me-1",3,"error","src"],[1,"text-truncate","fs-xxs"],[1,"btn","btn-xxs","btn-danger","ms-auto",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0),_(1,"fa-icon",1),b(2,"translate"),a(3,"span",2),d(4,"Clipboard"),l(),a(5,"button",3),f("click",function(){return r.clearAll()}),_(6,"fa-icon",4),l()(),C(7,ex,12,5)),o&2&&(s(),m("icon",r.icons.faQuestion)("tooltip",E(2,4,"Actions will be performed in the current folder",r.locale.language)),s(5),m("icon",r.icons.faTrashCan),s(),x(r.files.length?7:-1))},dependencies:[ce,F,Ke,Me,P,be,yi,bi,vi,xe,ye,Z,Ee],encapsulation:2});let i=n;return i})();var Gd=(()=>{let n=class n{constructor(){this.layout=S(I),this.store=S(te),this.tabs=[{label:fe.SELECTION,components:[Hd],loadComponent:!1,icon:Tl,count:{value:di(ve(()=>this.store.filesSelection().length>1?this.store.filesSelection().length>1e3?"999+":this.store.filesSelection().length:0)),level:"primary"},title:"Info",active:!1},{label:fe.TREE,components:[Xr],loadComponent:!0,icon:Nl,title:null,active:!1},{label:fe.COMMENTS,components:[$d],loadComponent:!1,icon:vr,title:null,active:!1},{label:fe.CLIPBOARD,components:[zd],loadComponent:!1,icon:jo,count:{value:this.store.filesClipboard.pipe(bt(t=>t.length)),level:"maroon"},showOnCount:!0,title:null,active:!1}],this.layout.setTabsRSideBar(nc.FILES,this.tabs)}ngOnDestroy(){this.layout.setTabsRSideBar(null)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-nav"]],decls:1,vars:0,template:function(o,r){o&1&&_(0,"router-outlet")},dependencies:[ln],encapsulation:2});let i=n;return i})();var Wd=(()=>{let n=class n{transform(t,o,r){if(typeof o>"u"||typeof o=="number"&&typeof r>"u")throw new Error("TimeAddPipe: missing required arguments");return Mi(t).add(o,r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=an({name:"amAdd",type:n,pure:!0});let i=n;return i})();var jd=(()=>{let n=class n{transform(t,o){if(!o)throw new Error("TimeDurationPipe: missing required time unit argument");return Mi.duration({[o]:t}).humanize()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=an({name:"amDuration",type:n,pure:!1});let i=n;return i})();function ix(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c();s(),w(e.space.name)}}function nx(i,n){i&1&&(a(0,"span",3),d(1,"Create a new space"),l())}function ox(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function rx(i,n){i&1&&(a(0,"h4",5)(1,"span",3),d(2,"Edit space"),l()())}function ax(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",48),d(2,"Settings"),l()),i&2){let e=c();m("icon",e.icons.faCog)}}function sx(i,n){if(i&1&&(a(0,"div",22)(1,"label",49),d(2,"Storage Usage"),l(),_(3,"app-storage-usage",50),l()),i&2){let e=c();s(3),m("item",e.space)}}function lx(i,n){i&1&&(a(0,"small",36),d(1,"At least one manager is required"),l())}function cx(i,n){if(i&1&&(a(0,"label",58),d(1,"Deactivation date"),l(),a(2,"div",59),d(3),b(4,"amDateFormat"),l()),i&2){let e=c(2);s(3),w(G(4,1,e.space.disabledAt))}}function px(i,n){if(i&1&&(a(0,"div",37)(1,"div",51),C(2,cx,5,3),l(),a(3,"div",52)(4,"label",53),d(5,"Creation date"),l(),a(6,"div",54),d(7),b(8,"amDateFormat"),l()(),a(9,"div",55)(10,"label",56),d(11,"Modification date"),l(),a(12,"div",57),d(13),b(14,"amDateFormat"),l()()()),i&2){let e=c();s(2),x(e.space.disabledAt&&!e.space.enabled?2:-1),s(5),w(G(8,3,e.space.createdAt)),s(6),w(G(14,5,e.space.modifiedAt))}}function dx(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",60),d(2,"Files"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.faAnchor),s(4),D("(",(e.space.roots==null?null:e.space.roots.length)||0,")")}}function mx(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",60),d(2,"Members"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.faUsers),s(4),D("(",e.space.members.length,")")}}function ux(i,n){if(i&1&&(_(0,"fa-icon",47),a(1,"span",60),d(2,"Links"),l(),a(3,"span"),d(4),l()),i&2){let e=c();m("icon",e.icons.LINKS),s(4),D("(",e.space.links.length,")")}}function _x(i,n){if(i&1){let e=y();a(0,"button",63),f("click",function(){h(e);let o=c(2);return g(o.confirmDeletion=!0)}),d(1," Remove "),l()}if(i&2){let e=c(2);m("disabled",e.confirmDeletion)}}function fx(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"amAdd"),b(3,"amTimeAgo"),l()),i&2){let e=c(3);s(),D("\xA0",E(3,5,Mt(2,1,e.space.disabledAt,e.SPACE_MAX_DISABLED_DAYS,"days"),!0))}}function hx(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"amDuration"),l()),i&2){let e=c(3);s(),D("\xA0",E(2,1,e.SPACE_MAX_DISABLED_DAYS,"days"))}}function gx(i,n){if(i&1&&(a(0,"div")(1,"span",3),d(2,"Space and data will be deleted in"),l(),a(3,"span",64),C(4,fx,4,8,"span")(5,hx,3,4,"span"),l()()),i&2){let e=c(2);L(X("text-danger white-space-truncate fs-sm ",e.user.isAdmin?"mx-auto":"me-auto")),s(4),x(e.space.disabledAt?4:5)}}function Cx(i,n){if(i&1&&(C(0,_x,2,1,"button",61),C(1,gx,6,4,"div",62)),i&2){let e=c();x(e.user.isAdmin?0:-1),s(),x(e.space.enabled?-1:1)}}function xx(i,n){if(i&1){let e=y();a(0,"button",65),f("click",function(){h(e);let o=c();return g(o.openCreateLinkDialog())}),_(1,"fa-icon",47)(2,"fa-icon",47),d(3," Link "),l()}if(i&2){let e=c();s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.LINKS)}}function Sx(i,n){if(i&1){let e=y();a(0,"button",67),f("click",function(){h(e);let o=c(2);return g(o.openAdminRootDialog())}),_(1,"fa-icon",47)(2,"fa-icon",47),d(3," External location "),l()}if(i&2){let e=c(2);s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.faUserShield)}}function vx(i,n){if(i&1){let e=y();a(0,"button",65),f("click",function(){h(e);let o=c();return g(o.openSelectRootDialog())}),_(1,"fa-icon",47)(2,"fa-icon",47),d(3," File "),l(),C(4,Sx,4,2,"button",66)}if(i&2){let e=c();s(),m("icon",e.icons.faPlus),s(),m("icon",e.icons.faAnchor),s(2),x(e.user.isAdmin?4:-1)}}var rs=(()=>{let n=class n{constructor(){this.space=new zc({id:0,name:"",createdAt:new Date,enabled:!0,storageUsage:0,storageQuota:null}),this.spaceChange=new ae,this.locale=S($),this.layout=S(I),this.icons={SPACES:ie.SPACES,LINKS:ie.LINKS,faPen:mt,faAnchor:ni,faUserShield:Wo,faPlus:Qe,faSpinner:Ue,faCog:Ei,faUsers:Go},this.SPACE_MAX_DISABLED_DAYS=30,this.addRootFileEvent=new vo,this.allowedLinkPermissions=[qe.ADD,qe.DELETE,qe.MODIFY],this.editManagers=!1,this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=S(oe),this.user=this.userService.user,this.spacesService=S(ot),this.linksService=S(li)}ngOnInit(){this.space.id||this.space.managers.unshift(gc(this.user,vn.IS_MANAGER))}searchManagers(t){let o={search:t,ignoreUserIds:[...this.space.managers.map(r=>r.id),...this.space.members.filter(r=>r.isUser).map(r=>r.id)],onlyUsers:!0};return this.userService.searchMembers(o)}searchMembers(t){let o={search:t,ignoreUserIds:[...this.space.managers.map(r=>r.id),...this.space.members.filter(r=>r.isUser).map(r=>r.id)],ignoreGroupIds:this.space.members.filter(r=>r.isGroup).map(r=>r.id)};return this.userService.searchMembers(o)}openSelectRootDialog(){this.layout.openDialog(Bn,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(pe(1)).subscribe(o=>this.addRootFileEvent.next(o))}openAdminRootDialog(){this.layout.openDialog(Zr,null,{initialState:{currentRoots:this.space.roots.filter(o=>o.externalPath)}}).content.submitEvent.pipe(pe(1)).subscribe(o=>this.addRootFileEvent.next(o))}openEditLinkDialog(t){this.linksService.editLinkDialog(t,this.space,pr.SPACE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.space)}setSpaceStatus(t){this.space.enabled=t,this.space.disabledAt=t?null:new Date}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.space.id===0&&this.layout.closeDialog(),this.spacesService.deleteSpace(this.space.id,{deleteNow:!0}).subscribe({next:()=>{this.loading=!1,this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Delete space",this.space.name,t)}})):this.space.id===0?this.spacesService.createSpace(this.space).subscribe({next:t=>{this.loading=!1,this.space=t,this.spaceChange.emit(["add",t]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Create space",this.space.name,t)}}):this.spacesService.updateSpace(this.space).subscribe({next:t=>{this.loading=!1,t?(this.space=t,this.spaceChange.emit(["update",t])):this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Edit space",this.space.name,t)}})}cantSubmit(){return this.submitted||!this.space.name||!this.space.managers.length}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-dialog"]],inputs:{space:"space"},outputs:{spaceChange:"spaceChange"},decls:70,vars:48,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"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[2,"max-width","85%"],[1,"mb-3","px-0"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"d-flex","flex-column","align-items-start","mb-3"],[1,"w-100",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","justify-content-between"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],["for","switchFullText","l10nTranslate",""],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"d-flex","flex-column","col-6"],["type","button",3,"click"],["for","editManagers","l10nTranslate","",1,"no-select-pointer"],["id","editManagers",1,"ms-1",3,"icon"],[3,"membersChange","members","searchFunction","editMode","hideInput","customPlaceholder"],["l10nTranslate","",1,"text-danger"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[1,"col-12"],[3,"space","user","addRootFile"],[3,"membersChange","members","withPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],[1,"d-flex","flex-column","align-items-start","col-4","px-0","text-danger"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],[3,"class"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[1,"fw-bold"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,ix,2,1,"span")(4,nx,2,0,"span",3),C(5,ox,1,1,"fa-icon",4),l(),C(6,rx,3,0,"h4",5),a(7,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),a(8,"div",7)(9,"tabset",8),_(10,"hr",9),a(11,"tab",10),f("selectTab",function(){return r.tabView=null}),R(12,ax,3,1,"ng-template",11),a(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),d(18," Space name "),l(),a(19,"input",17),ue("ngModelChange",function(u){return me(r.space.name,u)||(r.space.name=u),u}),l()(),a(20,"div",15)(21,"label",18),d(22," Description "),l(),a(23,"input",19),ue("ngModelChange",function(u){return me(r.space.description,u)||(r.space.description=u),u}),l()(),a(24,"div",20)(25,"app-storage-quota",21),ue("quotaChange",function(u){return me(r.space.storageQuota,u)||(r.space.storageQuota=u),u}),l()(),C(26,sx,4,1,"div",22),a(27,"div",23)(28,"div")(29,"label",24),d(30,"Space status"),l(),a(31,"div",25)(32,"input",26),f("ngModelChange",function(u){return r.setSpaceStatus(u)}),l(),a(33,"label",27),d(34),l()()(),a(35,"div")(36,"label",28),d(37,"Full-text search"),l(),a(38,"div",25)(39,"input",29),ue("ngModelChange",function(u){return me(r.space.storageIndexing,u)||(r.space.storageIndexing=u),u}),l(),a(40,"label",30),d(41),l()()()()()(),a(42,"div",31)(43,"div",32),f("click",function(){return r.editManagers=!r.editManagers}),a(44,"label",33),d(45,"Managers"),l(),_(46,"fa-icon",34),l(),a(47,"app-user-search",35),ue("membersChange",function(u){return me(r.space.managers,u)||(r.space.managers=u),u}),l(),C(48,lx,2,0,"small",36),C(49,px,15,7,"div",37),l()()(),a(50,"tab",38),f("selectTab",function(){return r.tabView="roots"}),R(51,dx,5,2,"ng-template",11),a(52,"div",39),_(53,"app-space-manage-roots",40),l()(),a(54,"tab",38),f("selectTab",function(){return r.tabView="members"}),R(55,mx,5,2,"ng-template",11),a(56,"div",9)(57,"app-user-search",41),ue("membersChange",function(u){return me(r.space.members,u)||(r.space.members=u),u}),l()()(),a(58,"tab",38),f("selectTab",function(){return r.tabView="links"}),R(59,ux,5,2,"ng-template",11),a(60,"div",9)(61,"app-user-search",42),ue("membersChange",function(u){return me(r.space.links,u)||(r.space.links=u),u}),l()()()()(),a(62,"div",43),C(63,Cx,2,2),C(64,xx,4,2,"button",44),C(65,vx,5,3),a(66,"button",45),f("click",function(){return r.onCancel()}),d(67,"Cancel"),l(),a(68,"button",46),f("click",function(){return r.onSubmit()}),d(69),l()()),o&2&&(s(2),m("icon",r.icons.SPACES),s(),x(r.space.id?3:4),s(2),x(r.loading?5:-1),s(),x(r.space.id?6:-1),s(),L(X("btn-close btn-close-white ",r.space.id?"ms-2":"ms-auto"," ms-2")),s(2),m("justified",!0),s(10),L(X("form-control form-control-sm ",r.space.name?"":"is-invalid")),de("ngModel",r.space.name),s(4),de("ngModel",r.space.description),s(2),de("quota",r.space.storageQuota),m("fullWidth",!0),s(),x(r.space.storageUsage?26:-1),s(6),m("ngModel",r.space.enabled),s(2),D(" ",r.space.enabled?"enabled":"disabled"," "),s(5),de("ngModel",r.space.storageIndexing),s(2),D(" ",r.space.storageIndexing?"enabled":"disabled"," "),s(5),m("icon",r.icons.faPen),s(),de("members",r.space.managers),m("searchFunction",r.searchManagers.bind(r))("editMode",r.editManagers)("hideInput",!r.editManagers)("customPlaceholder","Type to search for managers to add"),s(),x(r.space.managers.length?-1:48),s(),x(r.space.id?49:-1),s(4),m("space",r.space)("user",r.user)("addRootFile",r.addRootFileEvent),s(4),de("members",r.space.members),m("withPermissions",!0)("searchFunction",r.searchMembers.bind(r)),s(4),de("members",r.space.links),m("filterPermissions",!0)("allowedPermissions",r.allowedLinkPermissions)("withPermissions",!0)("editFunction",r.openEditLinkDialog.bind(r))("hideInput",!0),s(2),x(!r.tabView&&r.space.id?63:-1),s(),x(r.tabView==="links"?64:-1),s(),x(r.tabView==="roots"?65:-1),s(3),L(X("btn btn-sm ",r.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",r.cantSubmit()),s(),D(" ",r.confirmDeletion?"Confirm permanent deletion of data":"Confirm"," "))},dependencies:[P,F,hr,_r,ur,fr,be,je,Pt,xe,ei,ye,Ye,gr,An,Hn,En,Je,Wd,jd,Fe],encapsulation:2});let i=n;return i})();var yx=["MainContextMenu"],bx=["TargetContextMenu"],wx=()=>["roots","shares"],Kd=(i,n)=>n.id,Qd=(i,n)=>n.mid,qd=(i,n)=>n.key;function Tx(i,n){if(i&1){let e=y();a(0,"button",3),b(1,"translate"),f("click",function(){h(e);let o=c();return g(o.openSpaceDialog(!0))}),_(2,"fa-icon",7),l()}if(i&2){let e=c();m("tooltip",E(1,2,"New space",e.locale.language)),s(2),m("icon",e.icons.faPlus)}}function Ex(i,n){if(i&1&&(a(0,"span",29),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function Ax(i,n){if(i&1&&_(0,"app-user-avatar",30),i&2){let e=n.$implicit,t=c(4);m("user",e)("isMember",!0)("height",t.galleryMode.dimensions/3)("width",t.galleryMode.dimensions/3)}}function Dx(i,n){if(i&1&&(a(0,"span",26),k(1,Ax,1,4,"app-user-avatar",30,Qd),l()),i&2){let e=c().$implicit;s(),M(e.managers)}}function kx(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),a(1,"div",22),_(2,"fa-icon",23),a(3,"span",24),C(4,Ex,2,3,"span",25),l(),C(5,Dx,3,0,"span",26),l(),a(6,"div",27)(7,"span",28),d(8),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),s(),Zt("rowIndex",t),s(),B("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),m("icon",o.icons.SPACES),s(2),x(e.newly?4:-1),s(),x(e.managers.length?5:-1),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.name)}}function Mx(i,n){if(i&1){let e=y();a(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",19),k(4,kx,9,21,"div",20,Kd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.spaces,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Fx(i,n){if(i&1&&_(0,"fa-icon",37),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Px(i,n){if(i&1){let e=y();a(0,"th",36),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,Fx,1,2,"fa-icon",37),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function Ix(i,n){if(i&1&&C(0,Px,3,10,"th",35),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Rx(i,n){if(i&1&&(a(0,"div",40),_(1,"fa-icon",41),a(2,"div",42)(3,"span",28),d(4),l(),a(5,"span",43),d(6),l()()()),i&2){let e=c(3).$implicit,t=c(2);s(),m("icon",t.icons.SPACES)("fixedWidth",!1),s(3),w(e.name),s(2),w(e.description)}}function Nx(i,n){if(i&1&&_(0,"app-user-avatar",44),i&2){let e=n.$implicit;m("user",e)("isMember",!0)}}function Vx(i,n){if(i&1&&k(0,Nx,1,2,"app-user-avatar",44,Qd),i&2){let e=c(3).$implicit;M(e.managers)}}function Lx(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(3).$implicit;s(),w(E(2,1,e.counts,Tt(4,wx)))}}function Ox(i,n){if(i&1){let e=y();a(0,"span",47),f("click",function(){h(e);let o=c(6);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",7),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.faAnchor),s(),D("\xA0",e.counts.roots," ")}}function Bx(i,n){if(i&1){let e=y();a(0,"span",48),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",49),a(2,"span"),d(3),l()()}if(i&2){let e=c(4).$implicit,t=c(2);s(),m("icon",t.icons.SHARED),s(2),w(e.counts.shares)}}function Ux(i,n){if(i&1&&(C(0,Ox,3,2,"span",45),C(1,Bx,4,2,"span",46)),i&2){let e=c(3).$implicit,t=c(2);x(e.counts!=null&&e.counts.roots?0:-1),s(),x(e.role===t.SPACE_ROLE.IS_MANAGER&&e.counts.shares?1:-1)}}function Hx(i,n){if(i&1&&_(0,"app-file-permissions",50),i&2){let e=c(4).$implicit;m("permissions",e.hPerms)}}function $x(i,n){if(i&1&&C(0,Hx,1,1,"app-file-permissions",50),i&2){let e=c(3).$implicit;x(e.permissions?0:-1)}}function zx(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function Gx(i,n){if(i&1&&(a(0,"td"),C(1,Rx,7,4,"div",40)(2,Vx,2,0)(3,Lx,3,5,"span")(4,Ux,2,2)(5,$x,1,1)(6,zx,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="managers"?2:e==="members"?3:e==="info"?4:e==="permissions"?5:e==="modified"?6:-1)}}function Wx(i,n){if(i&1&&C(0,Gx,7,9,"td",39),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function jx(i,n){if(i&1){let e=y();a(0,"tr",38),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),k(1,Wx,1,1,null,null,qd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),s(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Kx(i,n){if(i&1){let e=y();a(0,"table",31)(1,"thead")(2,"tr"),k(3,Ix,1,1,null,null,qd),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",32),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",31)(9,"tbody",33),k(10,jx,4,7,"tr",34,Kd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.spaces,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Qx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"New space"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPlus)}}function qx(i,n){}function Yx(i,n){if(i&1){let e=y();R(0,Qx,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceDialog(!0))}),R(1,qx,0,0,"ng-template",17)}i&2&&(s(),m("divider",!0))}function Xx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Zx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Edit space"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPen)}}function Jx(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Edit children shares"),l()),i&2){let e=c(3);s(),m("icon",e.icons.SHARED)}}function eS(i,n){if(i&1){let e=y();R(0,Jx,3,1,"ng-template",15),f("execute",function(){h(e);let o=c(2);return g(o.openChildShareDialog())})}}function tS(i,n){if(i&1){let e=y();R(0,Zx,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceDialog())}),C(1,eS,1,0,null,16)}if(i&2){let e=c();s(),x(e.selected!=null&&e.selected.counts.shares?1:-1)}}function iS(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Manage my anchored files"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faAnchor)}}function nS(i,n){if(i&1){let e=y();R(0,iS,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceRootsDialog())})}}function oS(i,n){}function rS(i,n){i&1&&R(0,oS,0,0,"ng-template",17),i&2&&m("divider",!0)}function aS(i,n){if(i&1&&(a(0,"span",51),_(1,"fa-icon",7),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var Yd=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.SPACE_ROLE=vn,this.originalOrderKeyValue=De,this.TAB_MENU=fe,this.icons={SPACES:ie.SPACES,SHARED:ie.SHARED_WITH_OTHERS,faAnchor:ni,faArrowDown:_t,faArrowUp:dt,faRotate:Ti,faArrowRotateRight:ut,faUpload:er,faPlus:Qe,faPen:mt,faCircleInfo:Nt},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},managers:{label:"Managers",width:10,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},members:{label:"Members",width:20,class:"d-none d-md-table-cell",textCenter:!1,show:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",managers:"Managers",permissions:"Permissions",modified:"Modified"},this.loading=!1,this.spaces=[],this.selected=null,this.canCreateSpace=!1,this.canEditSpace=!1,this.canManageRoots=!1,this.router=S(Ce),this.activatedRoute=S(Jt),this.spacesService=S(ot),this.store=S(te),this.userService=S(oe),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],managers:[{prop:"managers",type:"length"}],permissions:[{prop:"permissions",type:"length"}],modified:[{prop:"modified",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadSpaces(),this.canCreateSpace=this.userService.userHavePermission(ft.SPACES_ADMIN),this.layout.setBreadcrumbIcon(ie.SPACES),this.layout.setBreadcrumbNav({url:`/${z.SPACES}/${Bt.SPACES}`,translating:!0,sameLink:!0}),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select)}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadSpaces(){this.loading=!0,this.onSelect(),this.spacesService.listSpaces().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.spaces=[],this.loading=!1,this.layout.sendNotification("error","Spaces",t.error.message)}})}browse(t){t.enabled?this.router.navigate([z.FILES,t.alias],{relativeTo:this.activatedRoute}).catch(console.error):this.layout.sendNotification("warning",t.name,"Space is disabled")}onSelect(t=null){t?(this.selected=t,this.canEditSpace=!!t.managers.find(o=>o.id===this.userService.user.id),this.canManageRoots=this.canEditSpace||t.havePermission(qe.SHARE_INSIDE)):(this.selected=null,this.canEditSpace=!1,this.canManageRoots=!1),this.store.spaceSelection.set(this.selected)}sortBy(t,o=!0,r){this.spaces=this.sortTable.sortBy(t,o,r||this.spaces)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}openSpaceDialog(t=!1){t?this.layout.openDialog(rs,"xl").content.spaceChange.pipe(pe(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.concat(u)),this.onSelect(u))}):this.selected&&this.canEditSpace&&this.spacesService.getSpace(this.selected.id).subscribe({next:o=>{this.layout.openDialog(rs,"xl",{initialState:{space:o}}).content.spaceChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="update"?(this.selected.name=v.name,this.selected.alias=v.alias,this.selected.description=v.description,this.selected.counts=Se(re({},v.counts),{shares:this.selected.counts.shares}),this.selected.modifiedAt=v.modifiedAt,this.selected.enabled=v.enabled,this.selected.managers=[...v.managers]):u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.filter(T=>T.id!==v.id)))})},error:o=>this.layout.sendNotification("error","Edit space",this.selected.name,o)})}openSpaceRootsDialog(){setTimeout(()=>{this.layout.openDialog(na,"md",{initialState:{space:this.selected,user:this.userService.user}})},this.selected?0:100)}openChildShareDialog(t){t&&this.onSelect(t),this.layout.openDialog(Li,null,{initialState:{space:this.selected}}).content.sharesCountEvent.subscribe(r=>this.selected.counts.shares=r)}focusOn(t){let o=this.spaces.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(yx,7),Y(bx,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:34,vars:37,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[3,"user","isMember","height","width"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[1,"circle-primary-icon",3,"icon","fixedWidth"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadSpaces())}),_(3,"fa-icon",4),l(),C(4,Tx,3,5,"button",5),a(5,"button",6),b(6,"translate"),f("click",function(){return h(p),g(r.openSpaceDialog())}),_(7,"fa-icon",7),l(),a(8,"button",6),b(9,"translate"),f("click",function(){return h(p),g(r.openChildShareDialog())}),_(10,"fa-icon",7),l(),a(11,"button",6),b(12,"translate"),f("click",function(){return h(p),g(r.openSpaceRootsDialog())}),_(13,"fa-icon",7),l(),a(14,"div",8)(15,"div",9),_(16,"app-input-filter",10),l(),a(17,"app-navigation-view",11),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(18,Mx,6,8,"div",12)(19,Kx,12,8),a(20,"div",13)(21,"span",14),d(22),b(23,"translate"),l()(),a(24,"context-menu",null,0),C(26,Yx,2,1),R(27,Xx,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.loadSpaces())}),l(),a(28,"context-menu",null,1),C(30,tS,2,1),C(31,nS,1,0,null,16),C(32,rS,1,1,null,17),R(33,aS,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(s(),m("tooltip",E(2,22,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(),x(r.canCreateSpace?4:-1),s(),m("disabled",!r.canEditSpace)("tooltip",E(6,25,"Edit space",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),m("disabled",!r.canEditSpace||!(r.selected!=null&&r.selected.counts.shares))("tooltip",E(9,28,"Edit children shares",r.locale.language)),s(2),m("icon",r.icons.SHARED),s(),m("disabled",!r.canManageRoots)("tooltip",E(12,31,"Manage my anchored files",r.locale.language)),s(2),m("icon",r.icons.faAnchor),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?18:19),s(4),Re("",r.spaces.length," ",E(23,34,"spaces",r.locale.language)),s(4),x(r.canCreateSpace?26:-1),s(4),x(r.canEditSpace?30:-1),s(),x(r.canManageRoots?31:-1),s(),x(r.canEditSpace||r.canManageRoots?32:-1))},dependencies:[P,F,Ze,Xe,Ke,Me,Ot,Lt,Vt,lt,Ve,vt,nt,Ee,oi,Z,gt],encapsulation:2});let i=n;return i})();var oa=class{constructor(n){this.newly=0,this.isPersonal=!1,Object.assign(this,n),this.isPersonal=this.alias===ht.PERSONAL,this.hTimeAgo=Mi(this.mtime).fromNow(!0),this.newly=ar(this.mtime)}};var sS=["MainContextMenu"],lS=["TargetContextMenu"],Xd=(i,n)=>n.id,Zd=(i,n)=>n.key;function cS(i,n){if(i&1&&(a(0,"span",25),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),s(),w(e.hTimeAgo)}}function pS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c().$implicit,t=c(2);D(" ",E(1,1,e.name,t.locale.language)," ")}}function dS(i,n){if(i&1&&d(0),i&2){let e=c().$implicit;D(" ",e.name," ")}}function mS(i,n){if(i&1){let e=y();a(0,"div",16),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),a(1,"div",17),_(2,"fa-icon",18),a(3,"span",19),C(4,cS,2,3,"span",20),l(),a(5,"span",21)(6,"span",22),d(7),l()()(),a(8,"div",23)(9,"span",24),C(10,pS,2,4)(11,dS,1,1),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),O("selected",e.id===(o.selected==null?null:o.selected.id)),s(),Zt("rowIndex",t),s(),B("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),m("icon",e.isPersonal?o.icons.PERSONAL:o.icons.SPACES),s(2),x(e.newly?4:-1),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),w(e.nb),s(2),B("font-size",o.galleryMode.textSize,"px"),s(),x(e.isPersonal?10:11)}}function uS(i,n){if(i&1){let e=y();a(0,"div",9)(1,"app-virtual-scroll",13),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(3,"div",14),k(4,mS,12,21,"div",15,Xd),l()()()}if(i&2){let e=c();s(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.trashBins,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),s(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function _S(i,n){if(i&1&&_(0,"fa-icon",32),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function fS(i,n){if(i&1){let e=y();a(0,"th",31),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,_S,1,2,"fa-icon",32),l()}if(i&2){let e=c().$implicit,t=c(2);L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function hS(i,n){if(i&1&&C(0,fS,3,10,"th",30),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function gS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c(4).$implicit,t=c(2);D(" ",E(1,1,e.name,t.locale.language)," ")}}function CS(i,n){if(i&1&&d(0),i&2){let e=c(4).$implicit;D(" ",e.name," ")}}function xS(i,n){if(i&1&&(a(0,"div",35),_(1,"fa-icon",18),a(2,"span",24),C(3,gS,2,4)(4,CS,1,1),l()()),i&2){let e=c(3).$implicit,t=c(2);s(),m("icon",e.isPersonal?t.icons.PERSONAL:t.icons.SPACES),s(2),x(e.isPersonal?3:4)}}function SS(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(3).$implicit;s(),w(e.nb)}}function vS(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;D(" ",e.hTimeAgo," ")}}function yS(i,n){if(i&1&&(a(0,"td"),C(1,xS,5,2,"div",35)(2,SS,2,1,"span",22)(3,vS,1,1),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="nb"?2:e==="modified"?3:-1)}}function bS(i,n){if(i&1&&C(0,yS,4,9,"td",34),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function wS(i,n){if(i&1){let e=y();a(0,"tr",33),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),k(1,bS,1,1,null,null,Zd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);O("selected",e.id===(t.selected==null?null:t.selected.id)),s(),M(E(3,2,t.tableHeaders,t.originalOrderKeyValue))}}function TS(i,n){if(i&1){let e=y();a(0,"table",26)(1,"thead")(2,"tr"),k(3,hS,1,1,null,null,Zd),b(5,"keyvalue"),l()()(),a(6,"app-virtual-scroll",27),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),a(8,"table",26)(9,"tbody",28),k(10,wS,4,5,"tr",29,Xd),l()()()}if(i&2){let e=c();s(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(7,5,e.trashBins,e.inputFilter.search())),s(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function ES(i,n){if(i&1&&(a(0,"span",36),_(1,"fa-icon",37),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function AS(i,n){if(i&1&&(a(0,"span",36),_(1,"fa-icon",37),d(2,"Info"),l()),i&2){let e=c();s(),m("icon",e.icons.faCircleInfo)}}var Jd=(()=>{let n=class n{constructor(){this.locale=S($),this.layout=S(I),this.originalOrderKeyValue=De,this.icons={SPACES:ie.SPACES,PERSONAL:ie.PERSONAL,faArrowDown:_t,faArrowUp:dt,faArrowRotateRight:ut,faCircleInfo:Nt},this.TAB_MENU=fe,this.loading=!1,this.selected=null,this.trashBins=[],this.tableHeaders={name:{label:"Space",width:50,textCenter:!1,class:"",show:!0,sortable:!0},nb:{label:"Elements",width:10,textCenter:!0,class:"",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",nb:"Elements",mtime:"Modified"},this.router=S(Ce),this.store=S(te),this.spacesService=S(ot),this.sortSettings={default:[{prop:"isPersonal",type:"number"},{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],nb:[{prop:"nb",type:"number"}],modified:[{prop:"mtime",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.loadTrashBins(),this.layout.setBreadcrumbIcon(ie.TRASH),this.layout.setBreadcrumbNav({url:`/${z.TRASH}/${Bt.TRASH}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadTrashBins(){this.loading=!0,this.onSelect(),this.spacesService.listTrashBins().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t.map(o=>new oa(o))),this.loading=!1}})}onSelect(t=null){this.selected=t,this.store.trashSelection.set(this.selected)}sortBy(t,o=!0,r){this.trashBins=this.sortTable.sortBy(t,o,r||this.trashBins)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}browse(t){this.router.navigate([z.SPACES_TRASH,t.alias]).catch(console.error)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-trash"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(lt,7),Y(sS,7),Y(lS,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.btnNavigationView=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:20,vars:14,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],["contextMenuItem","",3,"execute"],[1,"app-foot-menu"],[1,"mx-auto"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right"],[1,"badge","rounded-pill","bg-danger"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],["l10nTranslate",""],[3,"icon"]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadTrashBins())}),_(3,"fa-icon",4),l(),a(4,"div",5)(5,"div",6),_(6,"app-input-filter",7),l(),a(7,"app-navigation-view",8),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(8,uS,6,8,"div",9)(9,TS,12,8),a(10,"context-menu",null,0),R(12,ES,3,1,"ng-template",10),f("execute",function(){return h(p),g(r.loadTrashBins())}),l(),a(13,"context-menu",null,1),R(15,AS,3,1,"ng-template",10),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l(),a(16,"div",11)(17,"span",12),d(18),b(19,"translate"),l()()}o&2&&(s(),m("tooltip",E(2,8,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),s(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),s(),x(r.galleryMode!=null&&r.galleryMode.enabled?8:9),s(10),Re("",r.trashBins.length," ",E(19,11,"trash bins",r.locale.language)))},dependencies:[F,lt,Ve,Ke,Me,Xe,P,Ot,Lt,Vt,nt,Z,Ee,gt],encapsulation:2});let i=n;return i})();var Oi=i=>(S(te).repository.set(i.data.repository),i.url);var em=[{path:"",component:Gd,children:[{path:z.SPACES,pathMatch:"full",component:Yd,resolve:{routes:Oi},data:{repository:z.SPACES}},{path:z.TRASH,pathMatch:"full",component:Jd,resolve:{routes:Oi},data:{repository:z.TRASHES}},{path:z.SHARED,pathMatch:"full",component:Ed,resolve:{routes:Oi},data:{repository:z.SHARED}},{path:z.LINKS,pathMatch:"full",component:cd,resolve:{routes:Oi},data:{repository:z.LINKS}},{path:z.SPACES_FILES,children:[{path:"**",component:ia,resolve:{routes:Oi},data:{repository:z.FILES}}]},{path:z.SPACES_SHARES,children:[{path:"**",component:ia,resolve:{routes:Oi},data:{repository:z.SHARES}}]},{path:z.SPACES_TRASH,children:[{path:"**",component:ia,resolve:{routes:Oi},data:{repository:z.TRASH}}]}]}];var tm=()=>S(oe).userHavePermission(ft.DESKTOP_APP),im=()=>{let i=S(oe);return i.userHavePermission(ft.DESKTOP_APP_SYNC)&&!!i.user.clientId},nm=()=>{let i=S(ro),n=!!(i.wizard.localPath&&i.wizard.remotePath);return n||S(Ce).navigate([we.BASE,we.WIZARD,i.wizard.localPath?we.WIZARD_SERVER:we.WIZARD_CLIENT]).catch(console.error),n},om=()=>{let n=!!S(ro).wizard.localPath;return n||S(Ce).navigate([we.BASE,we.WIZARD,we.WIZARD_CLIENT]).catch(console.error),n};var rm=()=>S(ro).refreshPaths();var am=[{path:we.BASE,pathMatch:"prefix",canActivate:[im],resolve:[rm],children:[{path:"",pathMatch:"full",redirectTo:we.PATHS},{path:we.PATHS,pathMatch:"full",loadComponent:()=>import("./chunk-S6H2ELRY.js").then(i=>i.SyncPathsComponent)},{path:we.TRANSFERS,pathMatch:"full",loadComponent:()=>import("./chunk-JAJ7VXMB.js").then(i=>i.SyncTransfersComponent)},{path:we.WIZARD,pathMatch:"full",redirectTo:`${we.WIZARD}/${we.WIZARD_CLIENT}`},{path:`${we.WIZARD}/${we.WIZARD_CLIENT}`,pathMatch:"full",loadComponent:()=>import("./chunk-IHS5LSJJ.js").then(i=>i.SyncWizardClientComponent)},{path:`${we.WIZARD}/${we.WIZARD_SERVER}`,canActivate:[om],pathMatch:"full",loadComponent:()=>import("./chunk-7HJFIMNF.js").then(i=>i.SyncWizardServerComponent)},{path:`${we.WIZARD}/${we.WIZARD_SETTINGS}`,canActivate:[nm],pathMatch:"full",loadComponent:()=>import("./chunk-FTFEQDWH.js").then(i=>i.SyncWizardSettingsComponent)}]}];var Bi="webdav",pi={SERVER:Xl,WEBDAV:Bi,PERSONAL:ht.PERSONAL,SPACES:ht.SPACES,SHARES:ht.SHARES,TRASH:ht.TRASH},rN={[pi.SERVER]:{route:"/",spaceRepository:null},[pi.WEBDAV]:{route:`/${Bi}`,spaceRepository:null},[pi.PERSONAL]:{route:`/${Bi}/${pi.PERSONAL}`,spaceRepository:[Jn.FILES,ht.PERSONAL]},[pi.SPACES]:{route:`/${Bi}/${pi.SPACES}`,spaceRepository:[Jn.FILES]},[pi.SHARES]:{route:`/${Bi}/${pi.SHARES}`,spaceRepository:[Jn.SHARES]},[pi.TRASH]:{route:`/${Bi}/${pi.TRASH}`,spaceRepository:[Jn.TRASH]}};function DS(i,n){if(i&1&&(a(0,"li",8),d(1),l()),i&2){let e=n.$implicit;s(),w(e)}}function kS(i,n){if(i&1){let e=y();a(0,"p",5),d(1," Keep these codes in a safe place. They will allow you to access your account if you lose access to your two-factor authentication. "),l(),a(2,"p",6),d(3," These recovery codes are for one-time use only and will only be displayed here once. "),l(),a(4,"ul",7),k(5,DS,2,1,"li",8,We),l(),a(7,"div",9)(8,"button",10),f("click",function(){h(e);let o=c();return g(o.downloadRecoveryCodes())}),d(9,"Download"),l(),a(10,"button",11),f("click",function(){h(e);let o=c();return g(o.clipBoardRecoveryCodes())}),d(11,"Copy"),l(),a(12,"button",12),f("click",function(){h(e);let o=c();return g(o.onClose(!0))}),d(13,"Close"),l()()}if(i&2){let e=c();s(5),M(e.recoveryCodes)}}function MS(i,n){if(i&1&&(a(0,"div",14),d(1),l()),i&2){let e=c(2);s(),w(e.hasError)}}function FS(i,n){i&1&&(a(0,"span",3),d(1,"Scan this QR code using your authenticator app."),l(),a(2,"small",28),d(3,"\xA0"),a(4,"i",3),d(5,"(Such as FreeOTP, Proton Authenticator etc.)"),l()())}function PS(i,n){if(i&1){let e=y();a(0,"div",13),C(1,MS,2,1,"div",14)(2,FS,6,0),l(),a(3,"div",15),_(4,"img",16),l(),a(5,"div",17)(6,"div",18),d(7,"Or enter this secret manually"),l(),a(8,"div"),_(9,"fa-icon",19),a(10,"strong",20),f("click",function(){h(e);let o=c();return g(o.clipBoardSecret())}),d(11),l()()(),_(12,"hr",21),a(13,"form",22),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit())}),a(14,"div",23),d(15,"Enter your password"),l(),a(16,"div",24)(17,"app-input-password",25),f("passwordChange",function(o){h(e);let r=c();return g(r.twoFaForm.controls.password.setValue(o))}),l()(),a(18,"div",23),d(19,"Valid with your TOTP code"),l(),a(20,"div",24),_(21,"input",26),l(),a(22,"div",9)(23,"button",27),d(24,"Confirm"),l(),a(25,"button",12),f("click",function(){h(e);let o=c();return g(o.onClose())}),d(26,"Cancel"),l()()()}if(i&2){let e=c();s(),x(e.hasError?1:2),s(3),m("src",e.qrDataUrl,ee),s(5),m("icon",e.icons.faCopy),s(2),w(e.secret),s(2),m("formGroup",e.twoFaForm),s(4),m("password",e.twoFaForm.value.password)("focus",!0)("centered",!0),s(4),m("maxlength",e.twoFaCodelength),s(2),m("disabled",e.twoFaForm.invalid||e.submitted)}}var sm=(()=>{let n=class n{constructor(){this.isValid=new ae,this.wasEnabled=!1,this.submitted=!1,this.hasError=null,this.icons={faKey:It,faLock:ii,faCopy:Sn},this.twoFaCodelength=pn,this.locale=S($),this.layout=S(I),this.userService=S(oe),this.clipBoardService=S(kn),this.fb=S(fn),this.twoFaForm=this.fb.group({totpCode:this.fb.control("",[Et.required,Et.pattern(new RegExp(`^\\d{${pn}}$`))]),password:this.fb.control("")})}onClose(t=!1){this.layout.closeDialog(),this.isValid.emit(t)}onSubmit(){this.submitted=!0,this.userService.enable2Fa({code:this.twoFaForm.value.totpCode,password:this.twoFaForm.value.password}).subscribe({next:t=>{t.success?(this.wasEnabled=!0,this.recoveryCodes=t.recoveryCodes,this.isValid.emit(!0)):this.hasError="Invalid code",setTimeout(()=>this.submitted=!1,1e3)},error:t=>{this.hasError=t.error?t.error.message:t,setTimeout(()=>this.submitted=!1,1e3)}})}clipBoardSecret(){this.clipBoardService.copyFromContent(this.secret),this.layout.sendNotification("info","Two-factor Authentication","Secret copied")}clipBoardRecoveryCodes(){this.clipBoardService.copyFromContent(this.recoveryCodes.join(`
10
10
  `)),this.layout.sendNotification("info","Two-factor Authentication","Recovery codes copied")}downloadRecoveryCodes(){let t=this.recoveryCodes.join(`
11
- `),o=new Blob([t],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(o);lr(r,"sync-in.recovery-codes.txt"),URL.revokeObjectURL(r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-auth-2fa-enable-dialog"]],inputs:{qrDataUrl:"qrDataUrl",secret:"secret"},outputs:{isValid:"isValid"},decls:8,vars:2,consts:[[1,"modal-header","align-items-center","justify-content-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"modal-body","modal-auth-verify-2fa"],["l10nTranslate","",1,"text-align-center"],["l10nTranslate","",1,"text-align-center","font-italic","text-warning"],[1,"list-group","text-align-center","my-3"],[1,"list-group-item","font-monospace"],[1,"d-grid","gap-2"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],[1,"d-flex","flex-column","text-align-center","justify-content-center","align-items-center","fs-xs","mt-2","mb-4",2,"height","45px"],["l10nTranslate","",1,"text-danger"],[1,"text-center","my-3"],["alt","QR Code",1,"img-fluid","border","p-2","rounded",2,"max-width","150px",3,"src"],[1,"text-muted","small","text-center","mb-3"],["l10nTranslate","",1,"mb-2"],[3,"icon"],["role","button",1,"ms-1","font-monospace","link-primary",3,"click"],[2,"border-width","2px"],[3,"ngSubmit","formGroup"],["l10nTranslate","",1,"text-align-center","mb-3"],[1,"mb-3"],["id","password","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022",3,"passwordChange","password","focus","centered"],["type","text","formControlName","totpCode","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022","inputmode","numeric","autocomplete","one-time-code","name","totp",1,"form-control","text-center","fs-4",3,"maxlength"],["type","submit","l10nTranslate","",1,"btn","btn-primary",3,"disabled"],[1,"text-muted"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Two-Factor Authentication"),l()()(),a(5,"div",4),C(6,kS,14,0)(7,PS,27,10),l()),o&2&&(s(2),m("icon",r.icons.faLock),s(4),x(r.wasEnabled?6:7))},dependencies:[F,P,wi,mn,je,xe,dn,Io,un,_n,dr],encapsulation:2});let i=n;return i})();var ra=(function(i){return i.WEBDAV="webdav",i})(ra||{});var IS=i=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:i,showWeekNumbers:!1}),RS=(i,n)=>n.name;function NS(i,n){if(i&1&&(a(0,"option",19),d(1),l()),i&2){let e=n.$implicit;m("value",e),s(),w(e)}}function VS(i,n){if(i&1&&(a(0,"div",22),d(1),l()),i&2){let e=c(3);s(),D(" ",e.hasError," ")}}function LS(i,n){i&1&&(a(0,"div",23),d(1," This password will only be shown once after it is generated "),l())}function OS(i,n){i&1&&_(0,"hr",24)}function BS(i,n){if(i&1&&(C(0,VS,2,1,"div",22)(1,LS,2,0,"div",23),C(2,OS,1,0,"hr",24)),i&2){let e=c(2);x(e.hasError?0:1),s(2),x(e.appPasswords.length?2:-1)}}function US(i,n){if(i&1){let e=y();a(0,"div",11)(1,"div",12),d(2,"Generate a new app password"),l(),a(3,"div",13)(4,"form",14),f("ngSubmit",function(){h(e);let o=c();return g(o.genAppPassword())}),a(5,"div",15),_(6,"input",16),b(7,"translate"),a(8,"div",17),d(9,"Application"),l(),a(10,"select",18),k(11,NS,2,2,"option",19,We),l(),_(13,"input",20),b(14,"translate"),a(15,"button",21),d(16," Generate "),l()()()()(),C(17,BS,3,2)}if(i&2){let e=c();s(4),m("formGroup",e.appPasswordForm),s(2),O("is-invalid",e.appPasswordForm.controls.name.invalid),m("placeholder",E(7,8,"Password name",e.locale.language)),s(5),M(e.availableApps),s(2),m("placeholder",E(14,11,"Never expires",e.locale.language))("bsConfig",Ne(14,IS,e.minDate)),s(2),m("disabled",e.appPasswordForm.invalid||e.submitted),s(2),x(e.generatedPassword?-1:17)}}function HS(i,n){if(i&1&&(a(0,"div",26)(1,"strong",3),d(2,"Expiration"),l(),d(3),l()),i&2){let e=c(2);s(3),D(":\xA0",e.generatedPassword.expiration," ")}}function $S(i,n){i&1&&_(0,"hr",24)}function zS(i,n){if(i&1){let e=y();a(0,"div",25)(1,"div",26)(2,"strong",3),d(3,"Password name"),l(),d(4),l(),a(5,"div",26)(6,"strong",3),d(7,"Application"),l(),d(8),b(9,"translate"),l(),C(10,HS,4,1,"div",26),a(11,"div",26)(12,"strong",3),d(13,"Generated password"),l(),d(14,":\xA0 "),a(15,"span",27),f("click",function(){h(e);let o=c();return g(o.clipBoardPassword())}),_(16,"fa-icon",9),a(17,"span"),d(18),l()()()(),C(19,$S,1,0,"hr",24)}if(i&2){let e=c();s(4),D(":\xA0",e.generatedPassword.name," "),s(4),D(":\xA0",E(9,6,e.generatedPassword.app,e.locale.language)," "),s(2),x(e.generatedPassword.expiration?10:-1),s(6),m("icon",e.icons.faCopy),s(2),w(e.generatedPassword.password),s(),x(e.appPasswords.length?19:-1)}}function GS(i,n){if(i&1&&(a(0,"div"),d(1),b(2,"amDateFormat"),l()),i&2){let e=c().$implicit;s(),w(G(2,1,e.lastAccess))}}function WS(i,n){if(i&1&&(a(0,"div"),d(1),l()),i&2){let e=c().$implicit;s(),w(e.lastIp)}}function jS(i,n){if(i&1){let e=y();a(0,"tr")(1,"td"),d(2),l(),a(3,"td"),d(4),b(5,"translate"),l(),a(6,"td",30)(7,"div",31)(8,"div"),d(9),b(10,"amDateFormat"),l(),C(11,GS,3,3,"div"),l()(),a(12,"td",30)(13,"div",31)(14,"div"),d(15),l(),C(16,WS,2,1,"div"),l()(),a(17,"td",30),d(18),b(19,"amDateFormat"),b(20,"translate"),l(),a(21,"td",30),d(22),b(23,"amDateFormat"),l(),a(24,"td")(25,"button",32),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.deleteAppPassword(o.name))}),d(26,"Delete"),l()()()}if(i&2){let e=n.$implicit,t=c(2);s(2),w(e.name),s(2),w(E(5,8,e.app,t.locale.language)),s(5),w(e.currentAccess?G(10,11,e.currentAccess):"-"),s(2),x(e.lastAccess?11:-1),s(4),w(e.currentIp||"-"),s(),x(e.lastIp?16:-1),s(2),w(e.expiration?E(19,13,e.expiration,"L"):E(20,16,"never",t.locale.language)),s(4),w(G(23,19,e.createdAt))}}function KS(i,n){if(i&1&&(a(0,"table",6)(1,"thead")(2,"tr")(3,"th",28),d(4,"Name"),l(),a(5,"th",28),d(6,"Application"),l(),a(7,"th",28),d(8,"Access"),l(),a(9,"th",28),d(10,"IP"),l(),a(11,"th",28),d(12,"Expiration"),l(),a(13,"th",28),d(14,"Created"),l(),a(15,"th",28),d(16,"Action"),l()()(),a(17,"tbody",29),k(18,jS,27,21,"tr",null,RS),l()()),i&2){let e=c();s(18),M(e.appPasswords)}}var lm=(()=>{let n=class n{constructor(){this.appPasswords=[],this.nbAppPasswords=new ae,this.locale=S($),this.availableApps=Object.values(ra),this.allowGeneration=!1,this.minDate=Jl(),this.submitted=!1,this.icons={faKey:It,faCopy:Sn,faPlus:Qe},this.fb=S(fn),this.appPasswordForm=this.fb.group({name:this.fb.control("",[Et.required]),app:this.fb.control(ra.WEBDAV,[Et.required]),expiration:this.fb.control(null)}),this.layout=S(I),this.userService=S(oe),this.clipBoardService=S(kn),this.minDate.setDate(this.minDate.getDate()+1),this.appPasswordForm.controls.name.valueChanges.pipe(Dt(Boolean)).subscribe(t=>{this.hasError=void 0,this.appPasswordForm.controls.name.setValue(tc(t),{emitEvent:!1})})}ngOnInit(){this.appPasswords.length===0&&(this.allowGeneration=!0)}onClose(){this.layout.closeDialog()}deleteAppPassword(t){this.userService.deleteAppPassword(t).subscribe({next:()=>{this.appPasswords=this.appPasswords.filter(o=>o.name!==t),this.nbAppPasswords.emit(this.appPasswords.length)},error:o=>this.layout.sendNotification("error","Application Passwords","Unable to revoke",o)})}genAppPassword(){return Xt(this,null,function*(){for(let o of this.appPasswords)if(o.name===this.appPasswordForm.value.name){this.hasError="This name is already used";return}let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.generateAppPassword(this.appPasswordForm.value,t).subscribe({next:o=>{this.appPasswordForm.patchValue({name:"",expiration:null}),this.appPasswords.unshift(o),this.generatedPassword=o,this.nbAppPasswords.emit(this.appPasswords.length)},error:o=>this.layout.sendNotification("error","Application Passwords","Unable to generate",o)})})}clipBoardPassword(){this.clipBoardService.copyFromContent(this.generatedPassword.password),this.layout.sendNotification("info","Generated password","Copied")}onAllowGenerationChange(){this.generatedPassword?(this.generatedPassword=null,this.allowGeneration=!0):this.allowGeneration=!this.allowGeneration}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-auth-manage-app-passwords"]],inputs:{appPasswords:"appPasswords"},outputs:{nbAppPasswords:"nbAppPasswords"},decls:17,vars:7,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"table","table-striped","table-hover","align-middle","text-center","no-select"],[1,"modal-footer"],["role","button","type","button","btnCheckbox","","l10nTranslate","",1,"btn","btn-sm","btn-outline-success","me-auto",3,"ngModelChange","ngModel"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"d-flex","flex-fill","flex-column"],["l10nTranslate","",1,"fw-500","mb-3"],[1,"d-flex","flex-column","align-items-start"],[1,"w-100",3,"ngSubmit","formGroup"],[1,"input-group","input-group-sm","flex-nowrap"],["appAutofocus","","name","name","formControlName","name","type","text","required","",1,"flex-grow-1","form-control","form-control-sm","pe-0",3,"placeholder"],["l10nTranslate","",1,"input-group-text"],["formControlName","app",1,"form-select","form-select-sm",2,"max-width","150px"],["l10nTranslate","",3,"value"],["bsDatepicker","","id","expiration","formControlName","expiration","placement","bottom","type","text",1,"form-control","form-control-sm",2,"max-width","120px",3,"placeholder","bsConfig"],["type","submit","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"disabled"],["l10nTranslate","",1,"alert","alert-danger","text-center","my-3"],["l10nTranslate","",1,"alert","alert-secondary","text-center","my-3"],[1,"mb-1","mt-4"],[1,"d-flex","flex-column","alert","alert-success","text-center","my-3"],[1,"d-flex"],["role","button",1,"font-monospace","fw-bold","link-body-emphasis",3,"click"],["scope","col","l10nTranslate",""],[1,"table-group-divider"],[1,"fs-xxxs"],[1,"d-flex","flex-column","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-outline-danger",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Manage app passwords"),l()(),a(5,"button",4),f("click",function(){return r.onClose()}),l()(),a(6,"div",5),C(7,US,18,16),C(8,zS,20,9),C(9,KS,20,0,"table",6),l(),a(10,"div",7)(11,"button",8),f("ngModelChange",function(){return r.onAllowGenerationChange()}),_(12,"fa-icon",9)(13,"fa-icon",9),d(14," Password "),l(),a(15,"button",10),f("click",function(){return r.onClose()}),d(16,"Close"),l()()),o&2&&(s(2),m("icon",r.icons.faKey),s(5),x(r.allowGeneration&&!r.generatedPassword?7:-1),s(),x(r.generatedPassword?8:-1),s(),x(r.appPasswords.length?9:-1),s(2),m("ngModel",r.allowGeneration),s(),m("icon",r.icons.faPlus),s(),m("icon",r.icons.faKey))},dependencies:[F,P,be,mn,yi,bi,je,vi,xe,dn,ei,ye,Ye,ol,rl,wi,un,_n,Tn,Fe,Z],encapsulation:2});let i=n;return i})();var QS=(i,n)=>n.key;function qS(i,n){if(i&1&&(a(0,"option",14),d(1),b(2,"translate"),b(3,"capitalize"),l()),i&2){let e=n.$implicit,t=c(2);m("ngValue",t.allOnlineStatus.indexOf(e)),s(),D(" ",G(3,5,E(2,2,e,t.locale.language))," ")}}function YS(i,n){if(i&1&&(a(0,"span",37),_(1,"fa-icon",41),a(2,"span",42),d(3,"Administrator"),l()()),i&2){let e=c(3);s(),m("icon",e.icons.faKey)}}function XS(i,n){if(i&1&&(a(0,"span",43),d(1),l()),i&2){let e=n.$implicit;s(),w(e)}}function ZS(i,n){if(i&1&&k(0,XS,2,1,"span",43,We),i&2){let e=c(3);M(e.user.applications)}}function JS(i,n){if(i&1&&(a(0,"li",29)(1,"span",28),d(2,"Permissions"),l(),C(3,YS,4,1,"span",37)(4,ZS,2,0),l(),a(5,"li",38)(6,"span",28),d(7,"Storage Space"),l(),a(8,"span",39),_(9,"app-storage-usage",40),l()()),i&2){let e=c(2);s(3),x(e.user.isAdmin?3:4),s(6),m("item",e.user)}}function ev(i,n){if(i&1&&(a(0,"option",14),d(1),l()),i&2){let e=n.$implicit;m("ngValue",e.value),s(),w(e.key)}}function tv(i,n){if(i&1){let e=y();a(0,"div",44)(1,"span",45),d(2,"Document editor"),l(),a(3,"div",46)(4,"div",47)(5,"select",48),f("ngModelChange",function(o){h(e);let r=c(2);return g(r.updateEditorPreference(o))}),a(6,"option",15),d(7,"Ask Me"),l(),k(8,ev,2,2,"option",14,QS),b(10,"keyvalue"),l()()()(),a(11,"div",49)(12,"div",50),d(13," Used when both editors support the file type. "),l()()}if(i&2){let e=c(2);s(5),m("ngModel",e.userEditorPreference),s(),m("ngValue",null),s(2),M(E(10,2,e.editors,e.originalOrderKeyValue))}}function iv(i,n){if(i&1){let e=y();a(0,"div",51)(1,"span",52),d(2,"Full-text search"),l(),a(3,"div",46)(4,"div",53)(5,"div",54)(6,"label",55)(7,"span",42),d(8),l()(),a(9,"input",56),f("ngModelChange",function(o){h(e);let r=c(2);return g(r.updateStorageIndexing(o))}),l()()()()(),a(10,"div",49)(11,"div",50),d(12," Enable content indexation for personal files. "),l()()}if(i&2){let e=c(2);s(8),w(e.user.storageIndexing?"enabled":"disabled"),s(),m("ngModel",e.user.storageIndexing)}}function nv(i,n){if(i&1){let e=y();a(0,"div",3)(1,"div",16)(2,"div",9)(3,"div",17)(4,"div",18)(5,"div",19),_(6,"img",20)(7,"span"),l()(),a(8,"div",21)(9,"div",22),d(10),l(),a(11,"div",23),d(12),l(),a(13,"div",24),d(14),b(15,"translate"),b(16,"amTimeAgo"),l(),a(17,"select",25),ue("ngModelChange",function(o){h(e);let r=c();return me(r.user.onlineStatus,o)||(r.user.onlineStatus=o),g(o)}),f("ngModelChange",function(o){h(e);let r=c();return g(r.setOnlineStatus(o))}),k(18,qS,4,7,"option",14,We),l()()(),a(20,"ul",26)(21,"li",27)(22,"span",28),d(23,"Login"),l(),a(24,"span"),d(25),l()(),a(26,"li",29)(27,"span",28),d(28,"IP Addresses"),l(),a(29,"span",30),d(30),l(),a(31,"span",31),d(32),l()(),a(33,"li",29)(34,"span",28),d(35,"Connections"),l(),a(36,"span",30),d(37),b(38,"amDateFormat"),l(),a(39,"span",31),d(40),b(41,"amDateFormat"),l()(),C(42,JS,10,2),a(43,"li",27)(44,"span",32),d(45,"WebDAV"),l(),a(46,"span",33),f("click",function(){h(e);let o=c();return g(o.clipBoardLink())}),_(47,"fa-icon",34),d(48),l()()(),_(49,"hr",35),a(50,"div")(51,"span",36),d(52,"Preferences"),l(),C(53,tv,14,5),C(54,iv,13,2),l()()()()}if(i&2){let e=c();s(6),m("src",e.userAvatar,ee),s(),L(X("avatar-",e.allOnlineStatus[e.user.onlineStatus])),s(3),w(e.user.fullName),s(2),w(e.user.email),s(2),Re(" ",E(15,19,"Member since",e.locale.language)," ",E(16,22,e.user.createdAt,!0)," "),s(3),de("ngModel",e.user.onlineStatus),s(),M(e.allOnlineStatus),s(7),w(e.user.login),s(5),w(e.user.currentIp),s(2),w(e.user.lastIp),s(5),w(G(38,25,e.user.currentAccess)),s(3),w(G(41,27,e.user.lastAccess)),s(2),x(e.user.isUser?42:-1),s(5),m("icon",e.icons.faCopy),s(),D(" ",e.webdavUrl," "),s(5),x(e.showEditorPreference?53:-1),s(),x(e.user.isUser?54:-1)}}function ov(i,n){if(i&1&&_(0,"app-password-strength-bar",8),i&2){let e=c();m("passwordToCheck",e.newPassword)}}function rv(i,n){if(i&1){let e=y();a(0,"div",10)(1,"span",11),d(2,"Avatar"),l(),a(3,"div",12)(4,"button",57),f("click",function(){h(e);let o=c();return g(o.genAvatar())}),d(5,"Generate"),l(),a(6,"button",58)(7,"span",42),d(8,"Import"),l(),a(9,"input",59),f("change",function(o){h(e);let r=c();return g(r.uploadAvatar(o))}),l()()()()}}function av(i,n){if(i&1&&(a(0,"option",14),d(1),l()),i&2){let e=n.$implicit,t=c();m("ngValue",e),s(),w(t.i18nLanguageText[e])}}function sv(i,n){if(i&1&&(a(0,"option",15),d(1),l()),i&2){let e=n.$implicit,t=c();m("ngValue",t.allNotifications.indexOf(e)),s(),w(e)}}function lv(i,n){if(i&1){let e=y();a(0,"button",70),f("click",function(){h(e);let o=c(2);return g(o.disable2Fa())}),d(1," Disable "),l()}if(i&2){let e=c(2);m("disabled",!e.store.server().twoFaEnabled)}}function cv(i,n){if(i&1&&(a(0,"span",42),d(1,"Manage"),l(),d(2,"\xA0"),a(3,"span"),d(4),l()),i&2){let e=c(2);s(4),D("(",e.user.appPasswords,")")}}function pv(i,n){i&1&&(a(0,"span",42),d(1,"Generate"),l())}function dv(i,n){if(i&1){let e=y();a(0,"div",10)(1,"span",60),d(2,"Password"),l(),a(3,"div",12)(4,"div",22)(5,"app-input-password",61),ue("passwordChange",function(o){h(e);let r=c();return me(r.oldPassword,o)||(r.oldPassword=o),g(o)}),l()(),a(6,"div",22)(7,"app-input-password",62),ue("passwordChange",function(o){h(e);let r=c();return me(r.newPassword,o)||(r.newPassword=o),g(o)}),l()(),a(8,"button",63),f("click",function(){h(e);let o=c();return g(o.submitPassword())}),d(9," Update "),l()()(),a(10,"div",10)(11,"span",64),d(12,"Security"),l(),a(13,"div",12)(14,"div",65),d(15,"Two-Factor Authentication"),l(),a(16,"button",66),f("click",function(){h(e);let o=c();return g(o.enable2Fa())}),d(17),l(),C(18,lv,2,1,"button",67),a(19,"div",68),d(20,"Application Passwords"),l(),a(21,"button",69),f("click",function(){h(e);let o=c();return g(o.manageAppPasswords())}),C(22,cv,5,1)(23,pv,2,0,"span",42),l()()()}if(i&2){let e=c();s(5),de("password",e.oldPassword),s(2),de("password",e.newPassword),m("disabled",!(e.oldPassword!=null&&e.oldPassword.length))("isRequired",!!(e.oldPassword!=null&&e.oldPassword.length))("passwordMinLength",e.passwordMinLength)("showGenerator",!0),s(),m("disabled",!e.newPassword||!e.oldPassword||e.newPassword.length<e.passwordMinLength),s(8),m("disabled",!e.store.server().twoFaEnabled),s(),D(" ",e.user.twoFaEnabled?"Reset":"Enable"," "),s(),x(e.user.twoFaEnabled?18:-1),s(4),x(e.user.appPasswords>0?22:23)}}var cm=(()=>{let n=class n{constructor(){this.locale=S($),this.i18nLanguageText=Ul,this.allNotifications=Object.values(Ol),this.allOnlineStatus=ki,this.passwordMinLength=8,this.icons={faCopy:Sn,faKey:It},this.editors={[wc]:"collabora",[Tc]:"onlyoffice"},this.userAvatar=null,this.webdavUrl=`${window.location.origin}/${Bi}`,this.store=S(te),this.showEditorPreference=!1,this.originalOrderKeyValue=De,this.layout=S(I),this.languages=this.layout.getLanguages(!0),this.userService=S(oe),this.clipBoardService=S(kn),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.layout.setBreadcrumbIcon(Wt.ACCOUNT),this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.ACCOUNT}/${Qi.ACCOUNT}`,splicing:2,translating:!0,sameLink:!0}),this.showEditorPreference=this.store.server().fileEditors.collabora&&this.store.server().fileEditors.onlyoffice,this.showEditorPreference&&(this.userEditorPreference=this.userService.getEditorProviderPreference())}get language(){return this.user?.language||xa}set language(t){t===xa&&(t=null),this.userService.changeLanguage({language:t}).subscribe({next:()=>this.updateLanguage(t),error:()=>this.layout.sendNotification("error","Configuration","Unable to update language")})}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}setOnlineStatus(t){this.userService.changeOnlineStatus(t)}genAvatar(){this.userService.genAvatar()}uploadAvatar(t){this.userService.uploadAvatar(t.target.files[0])}submitPassword(){return Xt(this,null,function*(){if(!this.oldPassword){this.layout.sendNotification("error","Configuration","Current password missing !");return}if(!this.newPassword){this.layout.sendNotification("error","Configuration","New password missing !");return}if(this.newPassword.length<8){this.layout.sendNotification("warning","Configuration","New password must have 8 characters minimum");return}let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.changePassword({oldPassword:this.oldPassword,newPassword:this.newPassword},t).subscribe({next:()=>{this.oldPassword="",this.newPassword="",this.layout.sendNotification("info","Configuration","Password has been updated")},error:o=>{this.oldPassword="",o.status===403?this.layout.sendNotification("error","Configuration","Unable to update password",o):this.layout.sendNotification("warning","Configuration","Current password does not match")}})})}updateNotification(t){this.userService.changeNotification({notification:t}).subscribe({next:()=>{this.user.notification=t,this.layout.sendNotification("info","Configuration","Notification preference updated")},error:o=>this.layout.sendNotification("error","Configuration","Unable to update notification preference",o)})}updateStorageIndexing(t){this.userService.changeStorageIndexing({storageIndexing:t}).subscribe({next:()=>{this.user.storageIndexing=t,this.layout.sendNotification("info","Configuration","Full-text search preference updated")},error:o=>this.layout.sendNotification("error","Configuration","Unable to update full-text search preference",o)})}clipBoardLink(){this.clipBoardService.copyFromContent(this.webdavUrl),this.layout.sendNotification("info","Link copied",this.webdavUrl)}updateEditorPreference(t){this.userService.setEditorProviderPreference(t)}enable2Fa(){return Xt(this,null,function*(){this.userService.init2Fa().subscribe({next:t=>{this.layout.openDialog(sm,"xs",{initialState:{qrDataUrl:t.qrDataUrl,secret:t.secret}},{keyboard:!1}).content.isValid.pipe(Dt(r=>r),pe(1)).subscribe(()=>{this.layout.sendNotification("success","Configuration","Two-Factor Authentication is enabled"),this.store.user.next(Se(re({},this.store.user.getValue()),{twoFaEnabled:!0}))})},error:t=>this.layout.sendNotification("error","Configuration","Two-Factor Authentication",t)})})}disable2Fa(){return Xt(this,null,function*(){let t=yield this.userService.auth2FaVerifyDialog(!0);t&&this.userService.disable2Fa({code:t.get(Xs),password:t.get(Zs)}).subscribe({next:()=>{this.layout.sendNotification("success","Configuration","Two-Factor Authentication is disabled"),this.store.user.next(Se(re({},this.store.user.getValue()),{twoFaEnabled:!1}))},error:o=>{this.layout.sendNotification("error","Configuration","Two-Factor Authentication",o)}})})}manageAppPasswords(){return Xt(this,null,function*(){let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.listAppPasswords(t).subscribe({next:o=>{this.layout.openDialog(lm,"md",{initialState:{appPasswords:o}}).content.nbAppPasswords.subscribe(p=>{this.store.user.next(Se(re({},this.store.user.getValue()),{appPasswords:p}))})},error:o=>this.layout.sendNotification("error","Configuration","Unable to get app passwords",o)})})}updateLanguage(t){this.user.language=t,this.layout.setLanguage(t).then(()=>this.layout.sendNotification("info","Configuration","Language updated"))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-account"]],decls:28,vars:7,consts:[["appAutoResize","",1,"profile-page",3,"resizeOffset"],[1,"container-fluid"],[1,"row"],[1,"col-lg-6","col-sm-12","p-2"],[1,"box","box-primary","box-solid","mb-0"],[1,"d-flex","box-header","align-items-center"],["l10nTranslate","",1,"box-title","me-5"],[1,"fs-xxxs"],[3,"passwordToCheck"],[1,"box-body"],[1,"row","mb-3"],["l10nTranslate","",1,"col-4","align-self-start"],[1,"col-auto"],[1,"form-select","form-select-sm",3,"ngModelChange","ngModel"],[3,"ngValue"],["l10nTranslate","",3,"ngValue"],[1,"box","box-primary","mb-0"],[1,"user-header"],[1,"d-flex","flex-column","justify-content-center","me-2"],[1,"avatar-xl"],["alt","",1,"avatar-img","profile-user-img",3,"src"],[1,"user-details"],[1,"mb-1"],[1,"fs-xxs","text-nowrap"],[1,"text-muted","fs-xxs"],[1,"form-select","form-select-sm","my-auto","mt-2",3,"ngModelChange","ngModel"],[1,"list-group","my-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],["l10nTranslate","",1,"me-auto","pe-4"],[1,"list-group-item","d-flex","align-items-center","justify-content-end","flex-wrap"],[1,"badge","bg-warning","rounded-pill","my-1"],[1,"badge","bg-secondary-alt","rounded-pill","ms-1","my-1"],[1,"me-auto","pe-4"],[1,"text-primary","text-end","cursor-pointer",3,"click"],[3,"icon"],[1,"mt-4",2,"border-width","1px"],["l10nTranslate","",1,"fw-500","fs-md"],[1,"badge","bg-gray-dark","rounded-pill","ms-1","my-1"],[1,"list-group-item","d-flex","align-items-center"],[1,"col-5"],[3,"item"],[1,"me-1",3,"icon"],["l10nTranslate",""],["l10nTranslate","",1,"badge","bg-gray-dark","rounded-pill","ms-1","my-1"],[1,"row","mt-3","mb-1"],["l10nTranslate","",1,"col-4","align-self-center","text-nowrap"],[1,"col-auto","ms-auto"],[1,"d-flex","align-items-center","justify-content-end","gap-3"],[1,"form-select","form-select-sm","w-auto",3,"ngModelChange","ngModel"],[1,"row","mb-4"],["l10nTranslate","",1,"text-muted","fs-xxs"],[1,"row","mb-1"],["l10nTranslate","",1,"col-4","text-nowrap","align-self-center"],[1,"d-flex","align-items-center","justify-content-end","form-check","form-switch","cursor-pointer"],[1,"d-flex"],["for","prefSwitchFullText",1,"form-check-label"],["id","prefSwitchFullText","type","checkbox","role","button",1,"form-check-input","ms-2",3,"ngModelChange","ngModel"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-success","me-1",3,"click"],["type","button",1,"btn-file-upload","btn","btn-xs","btn-secondary"],["accept","image/*","name","file","role","button","type","file",3,"change"],["l10nTranslate","",1,"col-4","text-nowrap","align-self-start"],["placeholder","current password",3,"passwordChange","password"],["placeholder","new password",3,"passwordChange","password","disabled","isRequired","passwordMinLength","showGenerator"],["type","button","l10nTranslate","",1,"d-flex","btn","btn-xs","btn-primary","text-nowrap",3,"click","disabled"],["l10nTranslate","",1,"col-4","align-self-start","text-nowrap"],["l10nTranslate","",1,"fw-500","mb-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-danger","ms-2",3,"disabled"],["l10nTranslate","",1,"fw-500","mt-3","mb-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","me-1",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-danger","ms-2",3,"click","disabled"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),C(3,nv,55,29,"div",3),a(4,"div",3)(5,"div",4)(6,"div",5)(7,"h3",6),d(8,"Configuration"),l(),a(9,"span",7),C(10,ov,1,1,"app-password-strength-bar",8),l()(),a(11,"div",9),C(12,rv,10,0,"div",10),a(13,"div",10)(14,"span",11),d(15,"Language"),l(),a(16,"div",12)(17,"select",13),ue("ngModelChange",function(u){return me(r.language,u)||(r.language=u),u}),k(18,av,2,2,"option",14,We),l()()(),a(20,"div",10)(21,"span",11),d(22,"Notification"),l(),a(23,"div",12)(24,"select",13),f("ngModelChange",function(u){return r.updateNotification(u)}),k(25,sv,2,2,"option",15,We),l()()(),C(27,dv,24,11),l()()()()()()),o&2&&(m("resizeOffset",40),s(3),x(r.user?3:-1),s(7),x(r.newPassword?10:-1),s(2),x(r.user.isUser?12:-1),s(5),de("ngModel",r.language),s(),M(r.languages),s(6),m("ngModel",r.user==null?null:r.user.notification),s(),M(r.allNotifications),s(2),x(r.user.isUser?27:-1))},dependencies:[ce,be,yi,bi,Pt,vi,xe,ye,vc,P,F,En,dr,Dn,Z,Fe,Je,Ee],encapsulation:2});let i=n;return i})();var Co=(function(i){return i.WIN="win",i.MAC="mac",i.LINUX="linux",i.NODE="node",i})(Co||{});function mv(i,n){if(i&1&&(a(0,"div",1)(1,"span")(2,"span",3),d(3,"Repository"),l(),d(4,":\xA0"),a(5,"span",4),d(6),l()(),a(7,"span",5),d(8,"Version:\xA0"),a(9,"b"),d(10),l()(),a(11,"span"),d(12),b(13,"amDateFormat"),l()()),i&2){let e=c();s(6),w(e.store.appStoreManifest().repository),s(4),w(e.store.appStoreManifest().version),s(2),w(E(13,3,e.store.appStoreManifest().date,"L"))}}function uv(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Windows"),l()),i&2){let e=c(3);m("icon",e.icons.faWindows)}}function _v(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Mac"),l()),i&2){let e=c(3);m("icon",e.icons.faApple)}}function fv(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Linux"),l()),i&2){let e=c(3);m("icon",e.icons.faLinux)}}function hv(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Command Line"),l()),i&2){let e=c(3);m("icon",e.icons.faTerminal)}}function gv(i,n){if(i&1){let e=y();a(0,"div",17)(1,"span",3),d(2,"System requirements"),l(),a(3,"span"),d(4,":\xA0Node.js 22+"),l()(),a(5,"a",18),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.download(o,!0))}),a(6,"span",3),d(7,"Download tar.gz version"),l(),d(8,"\xA0 "),l()}}function Cv(i,n){if(i&1){let e=y();a(0,"div",17)(1,"span",3),d(2,"System requirements"),l(),a(3,"span"),d(4),l()(),a(5,"a",18),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.download(o,!0))}),d(6),l()}if(i&2){let e=c().$implicit,t=c(2);s(4),D(":\xA0",e===t.APP_STORE_OS.MAC?"Intel 64bit":"64bit"),s(2),w(e===t.APP_STORE_OS.MAC?"Download Apple Silicon ARM64 version":"Download ARM64 version")}}function xv(i,n){if(i&1){let e=y();a(0,"div",10)(1,"div",11)(2,"div",12),C(3,uv,3,1)(4,_v,3,1)(5,fv,3,1)(6,hv,3,1),a(7,"a",13),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.download(o))}),_(8,"fa-icon",14),a(9,"span",3),d(10,"Download"),l()(),a(11,"div"),C(12,gv,9,0)(13,Cv,7,2),l()()()()}if(i&2){let e,t=n.$implicit,o=c(2);s(3),x((e=t)===o.APP_STORE_OS.WIN?3:e===o.APP_STORE_OS.MAC?4:e===o.APP_STORE_OS.LINUX?5:e===o.APP_STORE_OS.NODE?6:-1),s(5),m("icon",o.icons.faDownload),s(4),x(t===o.APP_STORE_OS.NODE?12:13)}}function Sv(i,n){if(i&1&&(a(0,"div",2)(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9),k(5,xv,14,3,"div",10,We),l()()()()()),i&2){let e=c();m("resizeOffset",80),s(5),M(e.APP_STORE_PLATFORM_LIST)}}var pm=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faWindows:jc,faApple:Kc,faLinux:Qc,faDownload:Cn,faTerminal:vl},this.APP_STORE_OS=Co,this.APP_STORE_PLATFORM_LIST=Object.values(Co),this.layout=S(I),this.userService=S(oe),this.userService.checkAppStoreAvailability(),this.layout.setBreadcrumbIcon(Wt.APPS),this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.APPS}/${Qi.APPS}`,splicing:2,translating:!0,sameLink:!0})}download(t,o=!1){let r=this.store.appStoreManifest().platform[t].find(p=>t===Co.NODE?p.ext==="tar.gz"===o:p.arch==="arm64"===o);lr(r.url)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-applications"]],decls:3,vars:2,consts:[[1,"app-top-menu","px-4"],[1,"d-flex","flex-fill","align-items-center","fs-xs"],["appAutoResize","",1,"d-flex","flex-column","fs-sm","bg-theme",2,"height","100%",3,"resizeOffset"],["l10nTranslate",""],["l10nTranslate","",1,"fw-bold"],[1,"mx-auto"],[1,"d-flex"],[1,"col-12","p-4"],[1,"container","p-0"],[1,"row"],[1,"col-md-4"],[1,"card","text-bg-light","text-center","mb-3"],[1,"card-body"],[1,"btn","btn-sm","btn-primary","mt-3","mb-2",3,"click"],[1,"me-2",3,"icon"],["size","3x",2,"height","36px",3,"icon"],[1,"card-title","mt-3","mb-2"],[1,"small","text-muted","mb-1"],["role","button","l10nTranslate","",1,"small",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0),C(1,mv,14,6,"div",1),l(),C(2,Sv,7,1,"div",2)),o&2&&(s(),x(r.store.appStoreManifest()?1:-1),s(),x(r.store.appStoreManifest()?2:-1))},dependencies:[F,P,ce,Fe],encapsulation:2});let i=n;return i})();var dm=(()=>{let n=class n{constructor(){this.currentMemberIds=[],this.hasChanges=new ae,this.layout=S(I),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:Sl},this.userService=S(oe)}searchMembers(t){let o={search:t,onlyUsers:!0,usersRole:this.parentGroup.type===qi.USER?Zn.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(r=>r.id)]};return this.userService.searchMembers(o)}onSubmit(){this.submitted=!0,this.userService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(t=>t.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.parentGroup.name),this.layout.closeDialog()},error:t=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.parentGroup.name,t)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-group-add-users-dialog"]],inputs:{parentGroup:"parentGroup",currentMemberIds:"currentMemberIds"},outputs:{hasChanges:"hasChanges"},decls:16,vars:7,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"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),a(5,"h4",3)(6,"span",4),d(7,"Add members"),l()(),a(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(9,"div",6)(10,"app-user-search",7),ue("membersChange",function(u){return me(r.newMembers,u)||(r.newMembers=u),u}),l()(),a(11,"div",8)(12,"button",9),f("click",function(){return r.layout.closeDialog()}),d(13,"Cancel"),l(),a(14,"button",10),f("click",function(){return r.onSubmit()}),d(15," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faUserPlus),s(2),w(r.parentGroup.name),s(6),de("members",r.newMembers),m("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",r.searchMembers.bind(r)),s(4),m("disabled",r.submitted||!r.newMembers.length))},dependencies:[F,P,An],encapsulation:2});let i=n;return i})();function vv(i,n){if(i&1&&_(0,"img",9),i&2){let e=c();m("src",e.member.avatarUrl,ee)}}function yv(i,n){if(i&1&&_(0,"fa-icon",16),i&2){let e=c();L(e.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",e.icons.GROUPS)}}function bv(i,n){if(i&1&&(a(0,"div",7)(1,"span",17),d(2,"from the group"),l(),a(3,"span",11),d(4),b(5,"capitalize"),l()()),i&2){let e=c();s(4),w(G(5,1,e.parentGroup.name))}}function wv(i,n){i&1&&(a(0,"small",12),d(1,"Only the group will be deleted, the members will no longer be part of it."),l())}var mm=(()=>{let n=class n{constructor(){this.wasDeleted=new ae,this.submitted=!1,this.icons={GROUPS:Wt.GROUPS,faMinus:hn,faUserMinus:Ml},this.layout=S(I),this.userService=S(oe)}onSubmit(){this.submitted=!0;let t=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.userService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.userService.deletePersonalGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",t,this.member.name),this.onClose()},error:r=>{this.submitted=!1,this.layout.sendNotification("error",t,this.member.name,r)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-group-delete-dialog"]],inputs:{parentGroup:"parentGroup",member:"member"},outputs:{wasDeleted:"wasDeleted"},decls:26,vars:10,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"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"fw-bold","me-1"],["translate",""],[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-danger",3,"click","disabled"],[3,"icon"],["translate","",1,"mx-1"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),a(5,"h4",3)(6,"span",4),d(7),l()(),a(8,"button",5),f("click",function(){return r.onClose()}),l()(),a(9,"div",6)(10,"div",7)(11,"div",8),C(12,vv,1,1,"img",9)(13,yv,1,3,"fa-icon",10),l(),a(14,"span",11),d(15),b(16,"capitalize"),l(),a(17,"span",12),d(18,"will be removed"),l(),C(19,bv,6,3,"div",7),l(),C(20,wv,2,0,"small",12),l(),a(21,"div",13)(22,"button",14),f("click",function(){return r.onClose()}),d(23,"Cancel"),l(),a(24,"button",15),f("click",function(){return r.onSubmit()}),d(25," Remove "),l()()),o&2&&(s(2),m("icon",r.member.isUser?r.icons.faUserMinus:r.icons.faMinus),s(2),w(r.member.name),s(3),w(r.member.isUser?"Remove from group":"Delete group"),s(5),x(r.member.isUser?12:13),s(3),w(G(16,8,r.member.name)),s(4),x(r.member.isUser?19:-1),s(),x(r.member.isGroup?20:-1),s(4),m("disabled",r.submitted))},dependencies:[F,P,Dn],encapsulation:2});let i=n;return i})();var um=(()=>{let n=class n{constructor(){this.layout=S(I),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=Ki,this.icons={faUserPen:xl,faKey:It},this.userService=S(oe)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let t=this.isManager?Ki.MANAGER:Ki.MEMBER;this.userService.updateUserFromPersonalGroup(this.parentGroup.id,this.user.id,{role:t}).subscribe({next:()=>{this.user.setGroupRole(t),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,o)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-personal-group-edit-user-dialog"]],inputs:{parentGroup:"parentGroup",user:"user"},decls:25,vars:5,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"],[1,"d-flex","align-items-center"],[1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-1",3,"icon"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),a(5,"h4",3)(6,"span",4),d(7,"Edit user"),l()(),a(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ue("ngModelChange",function(u){return me(r.isManager,u)||(r.isManager=u),u}),l(),a(15,"span",4),d(16,"Set as group manager"),l(),_(17,"fa-icon",12),l()()()(),a(18,"small",4),d(19,"As a manager, the user will be able to manage the group and its members."),l()(),a(20,"div",13)(21,"button",14),f("click",function(){return r.layout.closeDialog()}),d(22,"Cancel"),l(),a(23,"button",15),f("click",function(){return r.onSubmit()}),d(24," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faUserPen),s(2),w(r.user.name),s(10),de("ngModel",r.isManager),s(3),m("icon",r.icons.faKey),s(6),m("disabled",r.submitted))},dependencies:[F,P,be,Pt,xe,ye],encapsulation:2});let i=n;return i})();var _m=(()=>{let n=class n{constructor(){this.wasLeft=new ae,this.submitted=!1,this.icons={GROUPS:Wt.GROUPS,faRightFromBracket:qo},this.layout=S(I),this.userService=S(oe)}onClose(){this.wasLeft.emit(!1),this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.userService.leavePersonalGroup(this.member.id).subscribe({next:()=>{this.wasLeft.emit(!0),this.layout.sendNotification("success","The group was left",this.member.name),this.onClose()},error:t=>{this.submitted=!1,this.layout.sendNotification("error","The group was not left",this.member.name,t)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-personal-group-leave-dialog"]],inputs:{member:"member"},outputs:{wasLeft:"wasLeft"},decls:19,vars:6,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],[3,"icon"],[1,"fw-bold","me-1"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Leave group"),l()(),a(5,"button",4),f("click",function(){return r.onClose()}),l()(),a(6,"div",5)(7,"div",6)(8,"div",7),_(9,"fa-icon",8),l(),a(10,"span",9),d(11),l(),a(12,"span",3),d(13,"will be left, you will no longer be a member of this group"),l()()(),a(14,"div",10)(15,"button",11),f("click",function(){return r.onClose()}),d(16,"Cancel"),l(),a(17,"button",12),f("click",function(){return r.onSubmit()}),d(18," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faRightFromBracket),s(7),L(r.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",r.icons.GROUPS),s(2),w(r.member.name),s(6),m("disabled",r.submitted))},dependencies:[F,P],encapsulation:2});let i=n;return i})();var Tv=["MainContextMenu"],Ev=["TargetContextMenu"],fm=(i,n)=>n.key,Av=(i,n)=>n.mid;function Dv(i,n){if(i&1){let e=y();a(0,"ul",19)(1,"li",20)(2,"a",21),f("click",function(){h(e);let o=c(2);return g(o.browse(o.selected))}),a(3,"span",22),_(4,"fa-icon",6),d(5,"See members"),l()()(),a(6,"li",20)(7,"a",21),f("click",function(){h(e);let o=c(2);return g(o.openLeaveGroupDialog())}),a(8,"span",22),_(9,"fa-icon",6),d(10,"Leave group"),l()()()()}if(i&2){let e=c(2);s(2),O("disabled",!e.selected),s(2),m("icon",e.icons.faUsersRectangle),s(3),O("disabled",!e.selected||!e.selected.isPersonalGroup),s(2),m("icon",e.icons.faRightFromBracket)}}function kv(i,n){if(i&1&&(a(0,"div",7)(1,"button",17),_(2,"fa-icon",6),l(),R(3,Dv,11,6,"ul",18),l()),i&2){let e=c();s(),O("disabled",!e.selected),s(),m("icon",e.icons.faEllipsis)}}function Mv(i,n){if(i&1&&_(0,"fa-icon",25),i&2){let e=c(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Fv(i,n){if(i&1){let e=y();a(0,"th",24),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.sortBy(o.key))}),d(1),C(2,Mv,1,2,"fa-icon",25),l()}if(i&2){let e=c().$implicit,t=c();L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function Pv(i,n){if(i&1&&C(0,Fv,3,10,"th",23),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Iv(i,n){if(i&1&&_(0,"img",29),i&2){let e=c(4).$implicit;m("src",e.avatarUrl,ee)}}function Rv(i,n){if(i&1&&_(0,"fa-icon",6),i&2){let e=c(4).$implicit,t=c();L(e.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",t.icons.GROUPS)}}function Nv(i,n){if(i&1&&_(0,"fa-icon",33),i&2){let e=c(5);m("icon",e.icons.faKey)}}function Vv(i,n){if(i&1&&(a(0,"div",28),C(1,Iv,1,1,"img",29)(2,Rv,1,3,"fa-icon",30),a(3,"div",31)(4,"span",32),d(5),C(6,Nv,1,1,"fa-icon",33),l(),a(7,"span",34),d(8),l()()()),i&2){let e=c(3).$implicit;s(),x(e.isUser?1:2),s(4),D(" ",e.name," "),s(),x(e.isUser&&e.isGroupManager?6:-1),s(2),w(e.description)}}function Lv(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.type)}}function Ov(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.isGroupManager?"Manager":"Member")}}function Bv(i,n){if(i&1&&C(0,Lv,2,1,"span",22)(1,Ov,2,1,"span",22),i&2){let e=c(3).$implicit;x(e.isGroup?0:1)}}function Uv(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(3).$implicit;s(),w(e.isGroupManager?"Manager":"Member")}}function Hv(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(4).$implicit;s(),w(G(2,1,e.counts))}}function $v(i,n){if(i&1&&C(0,Hv,3,3,"span"),i&2){let e=c(3).$implicit;x(e.isGroup?0:-1)}}function zv(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;D(" ",E(1,1,e.createdAt,!0)," ")}}function Gv(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;D(" ",G(1,1,e.createdAt)," ")}}function Wv(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;D(" ",G(1,1,e.modifiedAt)," ")}}function jv(i,n){if(i&1&&(a(0,"td"),C(1,Vv,9,4,"div",28)(2,Bv,2,1)(3,Uv,2,1,"span",22)(4,$v,1,1)(5,zv,2,4)(6,Gv,2,3)(7,Wv,2,3),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="type"?2:e==="role"?3:e==="members"?4:e==="memberSince"?5:e==="createdAt"?6:e==="modifiedAt"?7:-1)}}function Kv(i,n){if(i&1&&C(0,jv,8,9,"td",27),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Qv(i,n){if(i&1){let e=y();a(0,"tr",26),f("click",function(){let o=h(e).$implicit,r=c();return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c();return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c();return g(r.browse(o))}),k(1,Kv,1,1,null,null,fm),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c();O("selected",e.mid===(t.selected==null?null:t.selected.mid)),s(),M(E(3,2,t.tableHeaders,t.originalOrderKeyValue))}}function qv(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPlus),s(),D(" ",e.allowedAction.addGroup?"Personal group":"Add members")}}function Yv(i,n){if(i&1){let e=y();R(0,qv,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog(!0))})}}function Xv(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Zv(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2,"See members"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faUsersRectangle)}}function Jv(i,n){if(i&1){let e=y();R(0,Zv,3,1,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.browse(o.selected))})}}function e2(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPen),s(),D(" ",e.allowedAction.editGroup?"Edit group":"Edit user")}}function t2(i,n){if(i&1){let e=y();R(0,e2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog())})}}function i2(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);s(),m("icon",e.icons.faMinus),s(),D(" ",e.allowedAction.removeGroup?"Delete group":"Remove from group")}}function n2(i,n){if(i&1){let e=y();R(0,i2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog(!1,!0))})}}function o2(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2,"Leave group"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faRightFromBracket)}}function r2(i,n){if(i&1){let e=y();R(0,o2,3,1,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openLeaveGroupDialog())})}}var hm=(()=>{let n=class n{constructor(){this.locale=S($),this.originalOrderKeyValue=De,this.icons={GROUPS:Wt.GROUPS,faRotate:Ti,faPlus:Qe,faMinus:hn,faPen:mt,faArrowDown:_t,faArrowUp:dt,faKey:It,faArrowRotateRight:ut,faRightFromBracket:qo,faUsersRectangle:sl,faEllipsis:Vo},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},type:{label:"Type",width:10,textCenter:!0,class:"",show:!0,sortable:!0},role:{label:"Role",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!1,sortable:!0},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},memberSince:{label:"Member since",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!1,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modifiedAt:{label:"Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.isCurrentGroupManager=!1,this.allowedAction={addGroup:!1,addUsers:!1,removeUser:!1,removeGroup:!1,editUser:!1,editGroup:!1,leaveGroup:!1},this.loading=!1,this.selected=null,this.members=[],this.router=S(Ce),this.activatedRoute=S(Jt),this.layout=S(I),this.userService=S(oe),this.canCreatePersonalGroup=this.userService.userHavePermission(ft.PERSONAL_GROUPS_ADMIN),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],role:[{prop:"isGroupManager",type:"number"}],createdAt:[{prop:"createdAt",type:"date"}],modifiedAt:[{prop:"modifiedAt",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(t=>this.setEnv(t.routes)),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(Wt.GROUPS)}setEnv(t){let o;t.length?(o=t[t.length-1].path,this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.GROUPS}/${Qi.GROUPS}${sr(t)}`,splicing:2,translating:!0,sameLink:!0,mutateLevel:{1:{setUrl:!0}}})):this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.GROUPS}/${Qi.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(o)}refresh(){this.loadGroups(this.currentGroup?.name)}loadGroups(t){this.loading=!0,this.onSelect(),this.userService.browseGroup(t).subscribe({next:o=>{this.tableHeaders.members.show=!t,this.tableHeaders.role.show=!t,this.tableHeaders.modifiedAt.show=!t,this.tableHeaders.createdAt.show=!t,this.tableHeaders.memberSince.show=!!t,this.currentGroup=o.parentGroup,this.isCurrentGroupManager=this.currentGroup?.role===Ki.MANAGER,this.sortBy(this.sortTable.sortParam.column,!1,o.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:o=>{this.members=[],this.layout.sendNotification("error","Groups",o.error.message),this.onSelect(),this.loading=!1}})}browse(t){t.isGroup&&this.router.navigate([t.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(t=null){this.selected=t,this.selected?this.allowedAction={addGroup:!this.currentGroup&&this.canCreatePersonalGroup,addUsers:!!this.currentGroup&&this.isCurrentGroupManager,removeUser:!!this.currentGroup&&this.selected.isUser&&this.isCurrentGroupManager,removeGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isGroupManager&&this.selected.isPersonalGroup,editUser:!!this.currentGroup&&this.selected.isUser&&this.isCurrentGroupManager&&this.currentGroup.type===qi.PERSONAL,editGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isGroupManager&&this.selected.isPersonalGroup,leaveGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isPersonalGroup}:this.allowedAction={addGroup:!this.currentGroup&&this.canCreatePersonalGroup,addUsers:!!this.currentGroup&&this.isCurrentGroupManager,removeUser:!1,removeGroup:!1,editUser:!1,editGroup:!1,leaveGroup:!1}}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}sortBy(t,o=!0,r){this.members=this.sortTable.sortBy(t,o,r||this.members)}openDialog(t=!1,o=!1){t?this.currentGroup?this.layout.openDialog(dm,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(p=>p.isUser).map(p=>p.id)}}).content.hasChanges.pipe(Dt(p=>p),pe(1)).subscribe(()=>this.refresh()):this.layout.openDialog(ba,"md").content.groupChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="add"&&(v.setGroupRole(Ki.MANAGER),v.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(v)),this.onSelect(v))}):o?this.layout.openDialog(mm,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(Dt(p=>p),pe(1)).subscribe(()=>{this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()}):this.selected.isGroup?this.layout.openDialog(ba,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="update"&&(this.selected=Object.assign(this.selected,{name:v.name,description:v.description,modifiedAt:v.modifiedAt}))}):this.layout.openDialog(um,"md",{initialState:{parentGroup:this.currentGroup,user:this.selected}})}openLeaveGroupDialog(){this.layout.openDialog(_m,"md",{initialState:{member:this.selected}}).content.wasLeft.pipe(pe(1)).subscribe(o=>{o&&(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(r=>r.id!==this.selected.id)),this.onSelect())})}focusOn(t){let o=this.members.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-groups"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(Tv,7),Y(Ev,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:41,vars:43,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"execute"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["l10nTranslate",""],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"d-flex","flex-column"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.refresh())}),_(3,"fa-icon",4),l(),a(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openDialog(!0))}),_(6,"fa-icon",6),l(),a(7,"button",5),b(8,"translate"),f("click",function(){return h(p),g(r.openDialog(!1,!0))}),_(9,"fa-icon",6),l(),a(10,"button",5),b(11,"translate"),f("click",function(){return h(p),g(r.openDialog())}),_(12,"fa-icon",6),l(),C(13,kv,4,3,"div",7),_(14,"app-input-filter",8),l(),a(15,"table",9)(16,"thead")(17,"tr"),k(18,Pv,1,1,null,null,fm),b(20,"keyvalue"),l()()(),a(21,"app-virtual-scroll",10),b(22,"searchFilter"),f("contextmenu",function(v){return h(p),g(r.onContextMenu(v))}),a(23,"table",9)(24,"tbody",11),k(25,Qv,4,5,"tr",12,Av),l()()(),a(27,"div",13)(28,"span",14),d(29),b(30,"translate"),l()(),a(31,"context-menu",null,0),C(33,Yv,1,0,null,15),R(34,Xv,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.refresh())}),l(),a(35,"context-menu",null,1),C(37,Jv,1,0,null,15),C(38,t2,1,0,null,15),C(39,n2,1,0,null,15),C(40,r2,1,0,null,15),l()}o&2&&(s(),m("tooltip",E(2,22,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faRotate)("animation",r.loading?"spin":null),s(),m("disabled",!r.allowedAction.addGroup&&!r.allowedAction.addUsers)("tooltip",E(5,25,r.allowedAction.addGroup?"New personal group":"Add members",r.locale.language)),s(2),m("icon",r.icons.faPlus),s(),m("disabled",!r.allowedAction.removeGroup&&!r.allowedAction.removeUser)("tooltip",E(8,28,r.allowedAction.removeGroup?"Delete group":"Remove from group",r.locale.language)),s(2),m("icon",r.icons.faMinus),s(),m("disabled",!r.allowedAction.editGroup&&!r.allowedAction.editUser)("tooltip",E(11,31,r.allowedAction.editGroup?"Edit group":"Edit user",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),x(r.currentGroup?-1:13),s(5),M(E(20,34,r.tableHeaders,r.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(22,37,r.members,r.inputFilter.search())),s(4),M(r.scrollView==null?null:r.scrollView.viewPortItems),s(4),Re("",r.members.length," ",E(30,40,"groups",r.locale.language)),s(4),x(r.allowedAction.addGroup||r.allowedAction.addUsers?33:-1),s(4),x(r.selected!=null&&r.selected.isGroup?37:-1),s(),x(r.allowedAction.editGroup||r.allowedAction.editUser?38:-1),s(),x(r.allowedAction.removeGroup||r.allowedAction.removeUser?39:-1),s(),x(r.allowedAction.leaveGroup?40:-1))},dependencies:[Ot,Lt,Vt,F,P,Ve,Xe,Me,Fi,Ii,Pi,nt,Ee,Z,gt,oi,Je],encapsulation:2});let i=n;return i})();var gm=()=>!S(oe).user.isLink,Cm=()=>S(oe).user.isUser;var xm=[{path:Ae.BASE,pathMatch:"prefix",canActivate:[gm],children:[{path:Ae.ACCOUNT,component:cm},{path:Ae.CLIENTS,canActivate:[tm],loadComponent:()=>import("./chunk-NJJURHX4.js").then(i=>i.SyncClientsComponent)},{path:Ae.GROUPS,children:[{path:"**",resolve:{routes:_o},component:hm}]},{path:Ae.GUESTS,canActivate:[Cm],loadComponent:()=>import("./chunk-G3PL6YX3.js").then(i=>i.UserGuestsComponent)},{path:Ae.APPS,component:pm},{path:"**",redirectTo:Ae.ACCOUNT}]}];var as=(i,n)=>S(jt).checkUserAuthAndLoad(n.url),Sm=()=>S(jt).isLogged()?(S(Ce).navigate([]).catch(console.error),!1):!0;function a2(i,n){if(i&1&&(a(0,"span",17),_(1,"fa-icon",18),l(),_(2,"input",19),b(3,"translate")),i&2){let e=c(2);s(),m("icon",e.icons.faKey),s(),m("placeholder",E(3,2,"Recovery code",e.locale.language))}}function s2(i,n){if(i&1&&(a(0,"span",17),_(1,"fa-icon",18),l(),_(2,"input",20),b(3,"translate")),i&2){let e=c(2);s(),m("icon",e.icons.faQrcode),s(),m("placeholder",E(3,3,"Authentication code",e.locale.language))("maxlength",e.twoFaCodelength)}}function l2(i,n){if(i&1){let e=y();a(0,"p",7),d(1),l(),a(2,"form",8),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit2Fa())}),a(3,"div",9),C(4,a2,4,5)(5,s2,4,6),l(),a(6,"div",10)(7,"div",11)(8,"label",12),_(9,"input",13),a(10,"span",7),d(11,"Use a recovery code"),l()()()(),a(12,"div",14)(13,"button",15),f("click",function(){h(e);let o=c();return g(o.onCancel2Fa())}),d(14,"Cancel"),l(),a(15,"button",16),d(16," Confirm "),l()()()}if(i&2){let e=c();L(X("fs-sm mb-3 ",e.hasError?"text-danger":"text-white-50")),s(),w(e.hasError||"Two-Factor Authentication"),s(),m("formGroup",e.twoFaForm),s(2),x(e.twoFaForm.value.isRecoveryCode?4:5),s(11),m("disabled",e.twoFaForm.value.isRecoveryCode?e.twoFaForm.controls.recoveryCode.invalid:e.twoFaForm.controls.totpCode.invalid||e.submitted)}}function c2(i,n){if(i&1){let e=y();a(0,"form",8),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit())}),a(1,"p",7),d(2),l(),a(3,"div",21)(4,"span",17),_(5,"fa-icon",18),l(),_(6,"input",22),b(7,"translate"),l(),a(8,"div",23)(9,"span",17),_(10,"fa-icon",18),l(),_(11,"input",24),b(12,"translate"),l(),a(13,"div",25)(14,"button",26),d(15,"Sign in"),l()()()}if(i&2){let e=c();m("formGroup",e.loginForm),s(),L(X("fs-sm mb-3 ",e.hasError?"text-danger":"text-white-50")),s(),w(e.hasError||"Sign-in to your account"),s(3),m("icon",e.icons.faUserAlt),s(),m("placeholder",E(7,10,"Login or Email",e.locale.language)),s(4),m("icon",e.icons.faLock),s(),m("placeholder",E(12,13,"Password",e.locale.language)),s(3),m("disabled",e.loginForm.invalid||e.submitted)}}var vm=(()=>{let n=class n{constructor(){this.locale=S($),this.icons={faLock:ii,faUserAlt:Xo,faKey:It,faQrcode:Vl},this.twoFaCodelength=pn,this.logoUrl=xr,this.hasError=null,this.submitted=!1,this.twoFaVerify=!1,this.fb=S(fn),this.loginForm=this.fb.group({username:this.fb.control("",[Et.required]),password:this.fb.control("",[Et.required])}),this.twoFaForm=this.fb.group({totpCode:this.fb.control("",[Et.required,Et.pattern(new RegExp(`^\\d{${pn}}$`))]),recoveryCode:this.fb.control("",[Et.required,Et.minLength(8)]),isRecoveryCode:this.fb.control(!1)}),this.router=S(Ce),this.auth=S(jt)}onSubmit(){this.submitted=!0,this.auth.login(this.loginForm.value.username,this.loginForm.value.password).pipe(wo(()=>setTimeout(()=>this.submitted=!1,1500))).subscribe({next:t=>this.isLogged(t),error:t=>this.isLogged({success:!1,message:t.error?t.error.message:t})})}onSubmit2Fa(){this.submitted=!0;let t={code:this.twoFaForm.value.isRecoveryCode?this.twoFaForm.value.recoveryCode:this.twoFaForm.value.totpCode,isRecoveryCode:this.twoFaForm.value.isRecoveryCode};this.auth.loginWith2Fa(t).subscribe({next:o=>this.is2FaVerified(o),error:o=>this.is2FaVerified({success:!1,message:o.error?o.error.message:o})})}onCancel2Fa(){this.auth.logout(),this.twoFaForm.patchValue({totpCode:"",recoveryCode:""}),this.twoFaVerify=!1,this.submitted=!1,this.hasError=null}is2FaVerified(t){t.success?(this.auth.initUserFromResponse(t),this.isLogged({success:!0,message:t.message})):(this.hasError=t.message||"Unable to verify code",this.submitted=!1),this.twoFaForm.patchValue({totpCode:"",recoveryCode:""})}isLogged(t){t.success?(this.hasError=null,t.twoFaEnabled?this.twoFaVerify=!0:this.auth.returnUrl?this.router.navigateByUrl(this.auth.returnUrl).then(()=>{this.auth.returnUrl=null,this.loginForm.reset()}):this.router.navigate([mi.BASE]).then(()=>this.loginForm.reset())):(this.hasError=t.message||"Server connection error",this.submitted=!1),this.loginForm.patchValue({password:""})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-auth"]],decls:8,vars:2,consts:[[1,"app-auth"],[1,"background"],[1,"content"],[1,"header"],["alt","","height","65",3,"src"],[1,"body"],[3,"formGroup"],["l10nTranslate",""],[3,"ngSubmit","formGroup"],[1,"input-group","mt-2","mb-4"],[1,"d-flex","text-white-50","fs-xs"],[1,"form-check","form-switch","form-check-inline"],["for","useRecovery",1,"form-check-label"],["formControlName","isRecoveryCode","id","useRecovery","type","checkbox",1,"form-check-input"],[1,"d-flex","mt-4"],["type","button","l10nTranslate","",1,"btn","btn-secondary","px-4","w-50","me-3",3,"click"],["type","submit","l10nTranslate","",1,"btn","btn-primary","px-4","w-50",3,"disabled"],[1,"input-group-text"],[3,"icon"],["appAutofocus","","type","password","formControlName","recoveryCode",1,"form-control",3,"placeholder"],["appAutofocus","","type","text","formControlName","totpCode","inputmode","numeric","autocomplete","one-time-code",1,"form-control",3,"placeholder","maxlength"],[1,"input-group","my-2"],["appAutofocus","","formControlName","username","type","text",1,"form-control",3,"placeholder"],[1,"input-group","mb-4"],["formControlName","password","type","password",1,"form-control",3,"placeholder"],[1,"d-flex"],["type","submit","l10nTranslate","",1,"btn","btn-primary","px-4","w-100",3,"disabled"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),_(4,"img",4),l(),a(5,"div",5),C(6,l2,17,7)(7,c2,16,16,"form",6),l()()()()),o&2&&(s(4),m("src",r.logoUrl,ee),s(2),x(r.twoFaVerify?6:7))},dependencies:[Ye,wi,mn,je,Pt,xe,dn,Io,un,_n,F,P,Z],encapsulation:2});let i=n;return i})();var ym=[{path:ya.BASE,canActivate:[Sm],children:[{path:ya.LOGIN,component:vm}]}];var p2=()=>({matrixParams:"ignored",queryParams:"ignored",paths:"exact",fragment:"ignored"});function d2(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faChevronRight)("fixedWidth",!1)}}function m2(i,n){if(i&1&&_(0,"fa-icon",5),i&2){let e=c(2);m("icon",e.breadcrumbIcon)}}function u2(i,n){if(i&1&&(C(0,d2,1,2,"fa-icon",2),a(1,"li",3)(2,"a",4),C(3,m2,1,1,"fa-icon",5),a(4,"span"),d(5),l()()()),i&2){let e=n.$implicit,t=n.$index,o=c();x(t!==0?0:-1),s(),m("routerLinkActiveOptions",Tt(5,p2)),s(),m("routerLink",e.link),s(),x(t===0&&o.breadcrumbIcon?3:-1),s(2),w(e.title)}}var bm=(()=>{let n=class n{constructor(){this.icons={faChevronRight:gl},this.breadcrumbIcon=wl,this.levels=[],this.layout=S(I),this.subscriptions=[],this.subscriptions.push(this.layout.breadcrumbNav.subscribe(t=>this.updateNav(t))),this.subscriptions.push(this.layout.breadcrumbIcon.subscribe(t=>this.breadcrumbIcon=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}updateNav(t){let o=t.splicing||1,r=t.translating||!1,p=t.sameLink||!1,u=t.firstLink||null,v=t.mutateLevel||null,T=t.url.split("/").slice(1);if(this.levels=[],T.length>=1&&T[0]){let N=`/${T.splice(0,o).join("/")}`;this.levels.push({link:u||N,title:""});for(let{index:V,item:le}of T.filter(q=>q!=="").map((q,K)=>({index:K,item:q}))){let q=le.split("?")[0];if((!p||v&&v[V]&&v[V].setUrl)&&(N+="/"+q),v&&v[V]){if(v[V].hide)continue;v[V].setTitle&&(q=v[V].translateTitle?this.layout.translateString(v[V].setTitle):v[V].setTitle)}else r&&(q=this.layout.translateString(q));this.levels.push({link:N,title:q})}}else this.levels.push({link:["/"],title:""})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-breadcrumb"]],decls:4,vars:0,consts:[[1,"breadcrumb"],[1,"breadcrumb-content"],[3,"icon","fixedWidth"],["routerLinkActive","active",3,"routerLinkActiveOptions"],[3,"routerLink"],[3,"icon"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),k(2,u2,6,6,null,null,We),l()()),o&2&&(s(2),M(r.levels))},dependencies:[cn,Ws,F],encapsulation:2});let i=n;return i})();function _2(i,n){if(i&1&&_(0,"img",8),i&2){let e=c();m("src",e.userAvatar,ee)("width",28)("height",28)}}var wm=(()=>{let n=class n{constructor(){this.allOnlineStatus=ki,this.icons={faAngleLeft:Ho,faAngleRight:Ko},this.userAvatar=null,this.location=S(Mo),this.layout=S(I),this.store=S(te),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}openSidebarUser(){this.layout.showRSideBarTab(fe.PROFILE)}navigateTo(t){t==="back"?this.location.back():this.location.forward()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-navbar"]],decls:13,vars:6,consts:[[1,"main-header"],[1,"navbar","navbar-content"],["role","button",1,"d-sm-none","navbar-button",3,"click"],[3,"icon"],[1,"navbar-breadcrumb"],[1,"navbar-right-side"],[1,"menu",3,"click"],[1,"avatar"],["alt","",1,"avatar-img","bg-gray-light-important",3,"src","width","height"]],template:function(o,r){o&1&&(a(0,"header",0)(1,"nav",1)(2,"a",2),f("click",function(){return r.navigateTo("back")}),_(3,"fa-icon",3),l(),a(4,"a",2),f("click",function(){return r.navigateTo("next")}),_(5,"fa-icon",3),l(),a(6,"div",4),_(7,"app-breadcrumb"),l(),a(8,"div",5)(9,"div",6),f("click",function(){return r.openSidebarUser()}),a(10,"div",7),C(11,_2,1,3,"img",8),_(12,"span"),l()()()()()),o&2&&(s(3),m("icon",r.icons.faAngleLeft),s(2),m("icon",r.icons.faAngleRight),s(6),x(r.userAvatar?11:-1),s(),L(X("avatar-",r.allOnlineStatus[r.user==null?null:r.user.onlineStatus])))},dependencies:[bm,F],encapsulation:2});let i=n;return i})();var f2=["sidebar"],h2=(i,n)=>({menu:i,previousLevel:n}),g2=i=>({menu:i}),C2=i=>({menu:i,isMenuIcon:!0}),x2=(i,n)=>({mainMenu:i,menu:n}),sa=i=>({menu:i,isMenuIcon:!1}),xo=(i,n)=>n.title;function S2(i,n){if(i&1&&Ie(0,19),i&2){let e=c(),t=e.$implicit,o=e.$index,r=c(),p=Be(28);m("ngTemplateOutlet",p)("ngTemplateOutletContext",Qn(2,h2,t,o===0?0:r.appsMenu.submenus[o-1].level))}}function v2(i,n){if(i&1&&C(0,S2,1,5,"ng-container",19),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function y2(i,n){if(i&1){let e=y();a(0,"a",8),f("click",function(){h(e);let o=c();return g(o.logOut())})("mouseenter",function(){h(e);let o=c();return g(o.onHoverIconsMenu(!0,{title:"logout"}))})("mouseleave",function(){h(e);let o=c();return g(o.onHoverIconsMenu(!1,{title:"logout"}))}),_(1,"fa-icon",20),l()}if(i&2){let e=c();s(),m("icon",e.icons.faUserSecret)}}function b2(i,n){if(i&1&&Ie(0,19),i&2){let e=c().$implicit;c();let t=Be(30);m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(2,g2,e))}}function w2(i,n){if(i&1&&C(0,b2,1,4,"ng-container",19),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function T2(i,n){i&1&&Ie(0)}function E2(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){h(e);let o=c();return g(o.checkComponentRoute())}),R(1,T2,1,0,"ng-container",22),l()}if(i&2){let e=c();m("resizeOffset",40),s(),m("ngComponentOutlet",e.currentMenu.component)}}function A2(i,n){if(i&1&&(a(0,"span",24),d(1),l()),i&2){let e=c().menu;s(),w(e.title)}}function D2(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(2).menu;L(X("badge bg-",e.count.level," rounded-pill")),s(),w(n)}}function k2(i,n){if(i&1&&(a(0,"span"),C(1,D2,2,4,"span",25),b(2,"async"),l()),i&2){let e,t=c(),o=t.menu,r=t.isMenuIcon;L(r?"menu-badge-icon":"menu-badge"),s(),x((e=G(2,3,o.count.value))?1:-1,e)}}function M2(i,n){if(i&1&&(_(0,"fa-icon",23),C(1,A2,2,1,"span",24),C(2,k2,3,5,"span",25)),i&2){let e=n.menu,t=n.isMenuIcon;m("icon",e.icon)("animation",e.iconAnimated?"spin":null),s(),x(t?-1:1),s(),x(e.count?2:-1)}}function F2(i,n){if(i&1&&Ie(0,19),i&2){let e=c().$implicit,t=c(2).menu;c();let o=Be(32);m("ngTemplateOutlet",o)("ngTemplateOutletContext",Qn(2,x2,t,e))}}function P2(i,n){if(i&1&&C(0,F2,1,5,"ng-container",19),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function I2(i,n){i&1&&Ie(0)}function R2(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){h(e);let o=c(2).menu,r=c();return g(r.checkComponentRoute(o))}),R(1,I2,1,0,"ng-container",22),l()}if(i&2){let e=c(3);m("resizeOffset",40),s(),m("ngComponentOutlet",e.currentMenu.component)}}function N2(i,n){if(i&1&&(a(0,"div"),k(1,P2,1,1,null,null,xo),C(3,R2,2,2,"div",17),l()),i&2){let e=c().menu,t=c();L(X("menu-mini ",e.level<9?"align-self-start":"align-self-end")),s(),M(e.submenus),s(2),x(t.currentMenu.component?3:-1)}}function V2(i,n){if(i&1){let e=y();a(0,"a",26),f("mouseenter",function(){let o=h(e).menu,r=c();return g(r.onHoverIconsMenu(!0,o))})("mouseleave",function(){let o=h(e).menu,r=c();return g(r.onHoverIconsMenu(!1,o))})("click",function(){let o=h(e).menu,r=c();return g(r.checkMenuContext(o))}),Ie(1,19),C(2,N2,4,4,"div",25),l()}if(i&2){let e=n.menu,t=n.previousLevel;c();let o=Be(26);O("mt-auto",t<9&&e.level>9)("active",e.isActive),s(),m("ngTemplateOutlet",o)("ngTemplateOutletContext",Ne(7,C2,e)),s(),x(e.miniOpened?2:-1)}}function L2(i,n){if(i&1&&(a(0,"div",29)(1,"a",27),Ie(2,19),l()()),i&2){let e=c().$implicit,t=c(2).menu;c();let o=Be(26);L(t.isActive?"collapse-show":"collapse-hide"),O("active",e.isActive),s(),m("routerLink",e.link),s(),m("ngTemplateOutlet",o)("ngTemplateOutletContext",Ne(7,sa,e))}}function O2(i,n){if(i&1&&C(0,L2,3,9,"div",28),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function B2(i,n){if(i&1&&k(0,O2,1,1,null,null,xo),i&2){let e=c().menu;M(e.submenus)}}function U2(i,n){if(i&1&&(a(0,"div",7)(1,"a",27),Ie(2,19),l()(),C(3,B2,2,0)),i&2){let e=n.menu;c();let t=Be(26);O("active",e.isActive),s(),m("routerLink",e.link),s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(6,sa,e)),s(),x(e.submenus!=null&&e.submenus.length?3:-1)}}function H2(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(o){h(e);let r=c().$implicit,p=c(2).mainMenu,u=c();return g(u.onMiniMenuNavigate(o,[r.link],p))}),Ie(1,19),l()}if(i&2){let e=c().$implicit;c(3);let t=Be(26);O("active",e.isActive),s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(4,sa,e))}}function $2(i,n){if(i&1&&C(0,H2,2,6,"a",31),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function z2(i,n){if(i&1&&k(0,$2,1,1,null,null,xo),i&2){let e=c().menu;M(e.submenus)}}function G2(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(o){let r=h(e),p=r.mainMenu,u=r.menu,v=c();return g(v.onMiniMenuNavigate(o,[u.link],p))}),Ie(1,19),l(),C(2,z2,2,0)}if(i&2){let e=n.menu;c();let t=Be(26);O("active",e.isActive),s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(5,sa,e)),s(),x(e.submenus!=null&&e.submenus.length?2:-1)}}var Tm=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faAngleLeft:Ho,faAngleRight:Ko,faUserSecret:tr},this.logoIconUrl=kc,this.leftSideBarIsOpen=!1,this.appsMenu=Kl,this.router=S(Ce),this.renderer=S(pt),this.location=S(Mo),this.authService=S(jt),this.layout=S(I),this.userService=S(oe),this.subscriptions=[],this.menuAppsHovered=!1,this.menuIconsHovered=!1,this.menuAppsHoveredTimeout=null,this.menuIconsStopPropagation=!1,this.appName=Wl,this.appVersion=jl,this.appsMenu.submenus=[uc,id,lc,Bl,Ql],Sc("number",this.appsMenu.submenus,"level",!0),this.subscriptions.push(this.store.user.pipe(Dt(t=>!!t)).subscribe(()=>this.loadMenus())),this.subscriptions.push(this.layout.leftSideBarIsOpen.subscribe(t=>this.leftSideBarIsOpen=t)),this.subscriptions.push(this.router.events.pipe(Dt(t=>t instanceof Gs)).subscribe(t=>this.updateUrl(t.urlAfterRedirects)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}loadMenus(){this.userService.setMenusVisibility(this.appsMenu.submenus),this.updateUrl(this.router.url)}logOut(){this.authService.logout(!0)}navigateTo(t){t==="back"?this.location.back():this.location.forward()}toggleSideBar(){for(let t of this.appsMenu.submenus)t.miniOpened=!1;this.leftSideBarIsOpen&&this.renderer.removeStyle(this.sidebar.nativeElement,"z-index"),this.layout.toggleLSideBar()}checkMenuContext(t){!this.leftSideBarIsOpen&&this.layout.isSmallerScreen()&&t.submenus?.length?this.onHoverIconsMenu(!t.miniOpened,t):this.navigateToUrl([t.link])}onMiniMenuNavigate(t,o,r=null){t.stopPropagation(),this.navigateToUrl(o,r)}checkComponentRoute(t){this.currentMenu.link!==this.currentUrl&&this.router.navigate([this.currentMenu.link]).catch(console.error),t&&(t.miniOpened=!1)}onHoverAppsMenu(t){this.leftSideBarIsOpen&&(this.menuAppsHovered=t,t?this.menuAppsHoveredTimeout=setTimeout(()=>this.setActiveMenu(),5e3):(clearTimeout(this.menuAppsHoveredTimeout),this.checkHoveredMenu()))}onHoverIconsMenu(t,o,r=!1){if(!(this.leftSideBarIsOpen&&this.menuIconsStopPropagation))if((t&&o.submenus?.length||o.component)&&(this.currentMenu=o),this.leftSideBarIsOpen||r)this.menuIconsHovered=t,t?this.updateDynamicTitle(o.title):this.checkHoveredMenu();else{t?this.renderer.setStyle(this.sidebar.nativeElement,"z-index","1030"):this.renderer.removeStyle(this.sidebar.nativeElement,"z-index");for(let p of this.appsMenu.submenus.filter(u=>u.title!==o.title))p.miniOpened=!1;o.miniOpened=!!t}}checkHoveredMenu(){setTimeout(()=>{!this.menuIconsHovered&&!this.menuAppsHovered&&this.setActiveMenu()},50)}navigateToUrl(t,o=null){this.router.navigate(t).then(()=>{o&&o.miniOpened&&(o.miniOpened=!1)})}updateUrl(t){this.currentUrl=t.substring(1);for(let o of this.appsMenu.submenus)if(o.isActive=!!(!o.hide&&(o.link===this.currentUrl||o.matchLink&&o.matchLink.test(this.currentUrl))),o.isActive&&(this.currentMenu=o),o.submenus?.length){for(let r of o.submenus)if(r.isActive=o.isActive&&(r.link===this.currentUrl||!!r.matchLink&&r.matchLink.test(this.currentUrl)),r.submenus?.length)for(let p of r.submenus)p.isActive=this.currentUrl.startsWith(p.link)}this.currentMenu??=this.appsMenu.submenus[0],this.updateDynamicTitle(),this.menuIconsStopPropagation=!0,setTimeout(()=>this.menuIconsStopPropagation=!1,500)}setActiveMenu(){let t=this.appsMenu.submenus.find(o=>o.isActive);t&&(this.currentMenu=t,this.updateDynamicTitle(this.currentMenu.title))}updateDynamicTitle(t){this.dynamicTitle=this.layout.translateString(t!==void 0?t:this.currentMenu?this.currentMenu.title:this.appsMenu.title)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-sidebar-left"]],viewQuery:function(o,r){if(o&1&&Y(f2,7),o&2){let p;W(p=j())&&(r.sidebar=p.first)}},decls:33,vars:7,consts:[["sidebar",""],["MenuTemplate",""],["sidebarMenuIcons",""],["MenuApps",""],["MiniMenuApps",""],[1,"left-sidebar"],[1,"sidebar-apps-icons"],[1,"menu"],[3,"click","mouseenter","mouseleave"],[1,"logo-container"],["alt","",3,"src"],[1,"sidebar-apps-menus",3,"mouseenter","mouseleave"],[1,"menu-title",3,"mouseenter"],[1,"sidebar-title"],["role","button",1,"sidebar-btn",3,"click","icon"],[1,"menus-content"],[1,"menus-group"],["appAutoResize","",3,"resizeOffset"],[1,"sidebar-apps-footer"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"icon"],["appAutoResize","",3,"click","resizeOffset"],[4,"ngComponentOutlet"],[3,"icon","animation"],["l10nTranslate",""],[3,"class"],[3,"mouseenter","mouseleave","click"],[3,"routerLink"],[1,"menu","submenu",3,"active","class"],[1,"menu","submenu"],[3,"click"],[3,"active"]],template:function(o,r){if(o&1){let p=y();a(0,"aside",5,0)(2,"div",6)(3,"div",7)(4,"a",8),f("click",function(){return h(p),g(r.toggleSideBar())})("mouseenter",function(){return h(p),g(r.onHoverIconsMenu(!0,{title:r.appName},!0))})("mouseleave",function(){return h(p),g(r.onHoverIconsMenu(!1,{title:r.appName},!0))}),a(5,"div",9),_(6,"img",10),l()(),k(7,v2,1,1,null,null,xo),C(9,y2,2,1,"a"),l()(),a(10,"div",11),f("mouseenter",function(){return h(p),g(r.onHoverAppsMenu(!0))})("mouseleave",function(){return h(p),g(r.onHoverAppsMenu(!1))}),a(11,"div",12),f("mouseenter",function(){return h(p),g(r.onHoverAppsMenu(!1))}),a(12,"a")(13,"span",13),d(14),l(),a(15,"fa-icon",14),f("click",function(){return h(p),g(r.navigateTo("back"))}),l(),a(16,"fa-icon",14),f("click",function(){return h(p),g(r.navigateTo("next"))}),l()()(),a(17,"div",15)(18,"div",16),k(19,w2,1,1,null,null,xo),C(21,E2,2,2,"div",17),l(),a(22,"div",18)(23,"span"),d(24),l()()()()(),R(25,M2,3,4,"ng-template",null,1,Ft)(27,V2,3,9,"ng-template",null,2,Ft)(29,U2,4,8,"ng-template",null,3,Ft)(31,G2,3,7,"ng-template",null,4,Ft)}o&2&&(s(6),m("src",r.logoIconUrl,ee),s(),M(r.appsMenu.submenus),s(2),x(r.store.userImpersonate()?9:-1),s(5),w(r.dynamicTitle),s(),m("icon",r.icons.faAngleLeft),s(),m("icon",r.icons.faAngleRight),s(3),M(r.currentMenu.submenus),s(2),x(r.leftSideBarIsOpen&&r.currentMenu.component?21:-1),s(3),w(r.appVersion))},dependencies:[cn,F,ce,P,Fo,zt,sn],encapsulation:2});let i=n;return i})();var W2=i=>({nb:i}),j2=(i,n)=>({nba:i,nb:n}),K2=(i,n)=>n.id;function Q2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();s(),w(Mt(2,1,e.nbTotalTasks===0?"no_task":e.nbTotalTasks>1?"nb_tasks":"one_task",e.locale.language,Ne(5,W2,e.nbTotalTasks)))}}function q2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();s(),D("",Mt(2,1,e.nbActiveTasks>1?"nb_active_tasks":"one_active_task",e.locale.language,Qn(5,j2,e.nbActiveTasks,e.nbTotalTasks))," ")}}function Y2(i,n){if(i&1){let e=y();a(0,"button",5),f("click",function(){h(e);let o=c();return g(o.removeTasks())}),_(1,"fa-icon",6),l()}if(i&2){let e=c();s(),m("icon",e.icons.faTrashAlt)}}function X2(i,n){i&1&&_(0,"div",1)}function Z2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c().$implicit,t=c();s(),D("\xA0:\xA0",E(2,1,e.result,t.locale.language))}}function J2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"toBytes"),l()),i&2){let e=c().$implicit;s(),D("",E(2,1,e.props.size,2),"\xA0\u2022\xA0")}}function ey(i,n){if(i&1&&(_(0,"fa-icon",6),a(1,"span"),d(2),l()),i&2){let e=c().$implicit,t=c();m("icon",t.icons.faFolderClosed),s(2),D("\xA0",e.props.directories,"\xA0\u2022\xA0")}}function ty(i,n){if(i&1&&(_(0,"fa-icon",6),a(1,"span"),d(2),l()),i&2){let e=c().$implicit,t=c();m("icon",t.icons.faFile),s(2),D("\xA0",e.props.files,"\xA0\u2022\xA0")}}function iy(i,n){if(i&1){let e=y();a(0,"div",4)(1,"div",7),b(2,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),a(3,"span"),_(4,"fa-icon",8),a(5,"b"),_(6,"fa-icon",9),l(),a(7,"span"),d(8),l(),C(9,Z2,3,4,"span"),l(),a(10,"div",10)(11,"progressbar",11)(12,"span",12),C(13,J2,3,4,"span"),C(14,ey,3,2),C(15,ty,3,2),_(16,"fa-icon",6),a(17,"span"),d(18),b(19,"amTimeAgo"),l()()()()()()}if(i&2){let e=n.$implicit,t=c();s(),m("tooltip",E(2,18,e.result,t.locale.language)),s(2),O("text-gray-dark",e.status<2)("text-danger",e.status>=2),s(),m("icon",t.iconsStatus[e.status])("animation",e.status===0?"spin-pulse":null),s(2),m("icon",t.iconsOperation[e.type]),s(2),w(e.name),s(),x(e.status===2?9:-1),s(2),m("max",100)("value",e.status>0?100:e.props.progress||100)("type",e.status<1?"warning":e.status===2?"danger":null),s(2),x(e.props.size?13:-1),s(),x(e.props.directories?14:-1),s(),x(e.props.files?15:-1),s(),m("icon",t.icons.faClock),s(2),D("\xA0",E(19,21,e.startedAt,!0))}}var Em=(()=>{let n=class n{constructor(){this.locale=S($),this.icons={faTrashAlt:Di,faFlag:kl,faClock:Vc,faFile:Mn,faFolderClosed:yr},this.iconsStatus=[Ue,Yo,ll],this.iconsOperation={[Le.DELETE]:Lc,[Le.MOVE]:ti,[Le.COPY]:gn,[Le.DOWNLOAD]:xn,[Le.UPLOAD]:al,[Le.COMPRESS]:wa,[Le.DECOMPRESS]:wa},this.nbActiveTasks=0,this.nbEndedTasks=0,this.nbTotalTasks=0,this.tasks=[],this.router=S(Ce),this.store=S(te),this.filesService=S(He),this.filesTasksService=S(Ic),this.subscriptions=[],this.subscriptions.push(this.store.filesActiveTasks.subscribe(t=>this.updateTasks(t,!0))),this.subscriptions.push(this.store.filesEndedTasks.subscribe(t=>this.updateTasks(t,!1)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}updateTasks(t,o=!1){o?(this.tasks=[...t,...this.store.filesEndedTasks.getValue()],this.nbActiveTasks=t.length,this.nbEndedTasks=this.store.filesEndedTasks.getValue().length):(this.tasks=[...this.store.filesActiveTasks.getValue(),...t],this.nbEndedTasks=t.length,this.nbActiveTasks=this.store.filesActiveTasks.getValue().length),this.nbTotalTasks=this.nbActiveTasks+this.nbEndedTasks}removeTasks(){this.filesTasksService.removeAll()}goToFile(t){if(t.status===1){if(t.type===Le.COMPRESS&&t.props.compressInDirectory===!1){this.filesService.downloadTaskArchive(t.id);return}else if(t.type===Le.DELETE){if(t.path.startsWith(z.FILES))t.path=t.path.replace(z.FILES,z.TRASH);else if(t.path.startsWith(z.SHARES))return}this.router.navigate([`${z.SPACES}/${t.path}`],{queryParams:{select:t.name}}).catch(console.error)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tasks"]],decls:10,vars:2,consts:[[1,"sidebar-component-title","justify-content-between"],[2,"width","35px"],[1,"btn","btn-xs","btn-secondary"],["appAutoResize",""],[1,"task-list"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["placement","bottom",1,"px-2","py-1","text-truncate",3,"click","tooltip"],[3,"icon","animation"],[1,"me-1",3,"icon"],[1,"fs-xxxs"],[1,"custom-progress-bar","position-relative",3,"max","value","type"],[1,"d-flex","align-items-center","justify-content-center","position-absolute","mx-1","w-100"]],template:function(o,r){if(o&1&&(a(0,"div",0),_(1,"div",1),a(2,"div"),C(3,Q2,3,7,"span")(4,q2,3,8,"span"),l(),C(5,Y2,2,1,"button",2)(6,X2,1,0,"div",1),l(),a(7,"div",3),k(8,iy,20,24,"div",4,K2),l()),o&2){let p;s(3),x((p=r.nbActiveTasks)===0?3:4),s(2),x(r.nbTotalTasks?5:6),s(3),M(r.tasks)}},dependencies:[F,ce,Ke,Me,xc,Z,Je,mr],encapsulation:2});let i=n;return i})();var ny=["notificationsHtml"],oy=(i,n)=>n.id;function ry(i,n){if(i&1&&(a(0,"span",4),d(1),l()),i&2){let e=c();s(),D("(",e.store.notifications().length,")")}}function ay(i,n){if(i&1){let e=y();a(0,"button",8),f("click",function(){h(e);let o=c();return g(o.removeAll())}),_(1,"fa-icon",9),l()}if(i&2){let e=c();s(),m("icon",e.icons.faTrashAlt)}}function sy(i,n){i&1&&_(0,"div",2)}function ly(i,n){if(i&1&&(a(0,"b",3),d(1),l()),i&2){let e=c().$implicit;s(),w(e.fromUser.fullName)}}function cy(i,n){if(i&1&&(a(0,"b"),d(1),l()),i&2){let e=c().$implicit;s(),w(e.fromUser.fullName)}}function py(i,n){if(i&1&&_(0,"fa-icon",9),i&2){let e=c().$implicit;m("icon",e.appIcon)}}function dy(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c().$implicit;s(),D("\xA0",e.mainElement)}}function my(i,n){if(i&1){let e=y();a(0,"div",10,0)(2,"div",11),_(3,"app-user-avatar",12),a(4,"div",13),C(5,ly,2,1,"b",3)(6,cy,2,1,"b"),l(),a(7,"div",14)(8,"i",15),f("click",function(){let o=h(e).$implicit,r=c();return g(r.remove(o))}),_(9,"fa-icon",9),l()()(),a(10,"div",16)(11,"div")(12,"span",3),d(13),l(),d(14,":\xA0"),a(15,"b",17),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goto(o))}),d(16),l()(),a(17,"div",18)(18,"div"),d(19),b(20,"amTimeAgo"),l(),a(21,"div",19),C(22,py,1,1,"fa-icon",9),C(23,dy,2,1,"span"),l()()()()}if(i&2){let e=n.$implicit,t=c();O("newly-1",e.soonRead),s(3),m("user",e.fromUser)("width",24)("height",24)("unknownUserAsInfo",e.fromUser.id===-1),s(2),x(e.fromUser.id===-1?5:6),s(4),m("icon",t.icons.faTimes),s(4),w(e.content.event),s(3),w(e.content.element),s(),O("text-muted",!e.soonRead),s(2),w(G(20,15,e.createdAt)),s(3),x(e.appIcon?22:-1),s(),x(e.mainElement?23:-1)}}var Am=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faCheck:Yo,faTimes:Rt,faMagnifyingGlass:Bo,faTrashAlt:Di,faCircleInfo:Nt},this.router=S(Ce),this.layout=S(I),this.notificationsService=S(_c),$t(()=>{this.store.unreadNotifications(),setTimeout(()=>this.observeUnreadNotifications(),0)})}ngAfterViewInit(){this.observer=new IntersectionObserver(t=>{t.forEach(o=>{if(o.isIntersecting){let r=o.target,p=this.notificationsHtml.toArray().findIndex(u=>u.nativeElement===r);if(p!==-1){let u=this.store.notifications()[p];u&&!u.wasRead&&(u.wasRead=!0,u.soonRead=!0,this.observer.unobserve(r),setTimeout(()=>this.wasRead(u),2e3))}}})},{threshold:.5})}removeAll(){this.notificationsService.deleteNotification().subscribe({next:()=>this.store.notifications.set([]),error:t=>this.layout.sendNotification("error","Notifications","Unable to delete",t)})}remove(t){this.notificationsService.deleteNotification(t.id).subscribe({next:()=>this.store.notifications.update(o=>o.filter(r=>t.id!==r.id)),error:o=>this.layout.sendNotification("error","Notifications","Unable to delete",o)})}goto(t){if(t.content.externalUrl)window.open(t.content.externalUrl,"_blank","noopener");else{let o=t.content.app===cc.SYNC?t.content.element.split("/").at(-1):t.content.element;this.router.navigate([z.SPACES,...t.content.url.split("/")],{queryParams:{select:o}}).catch(console.error)}}observeUnreadNotifications(){this.notificationsHtml&&this.notificationsHtml.forEach((t,o)=>{let r=this.store.notifications()[o];r&&!r.wasRead&&this.observer.observe(t.nativeElement)})}wasRead(t){this.notificationsService.wasReadNotification(t.id).subscribe({next:()=>{this.store.notifications.update(o=>{let r=[...o],p=r.find(u=>u.id===t.id);return p&&(p.soonRead=!1,p.wasRead=!0),r})},error:o=>this.layout.sendNotification("error","Notifications","Mark as read",o)})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-notifications"]],viewQuery:function(o,r){if(o&1&&Y(ny,5),o&2){let p;W(p=j())&&(r.notificationsHtml=p)}},decls:11,vars:2,consts:[["notificationsHtml",""],[1,"sidebar-component-title","justify-content-between"],[2,"width","35px"],["l10nTranslate",""],[1,"ps-1"],[1,"btn","btn-xs","btn-secondary"],["appAutoResize","",1,"fs-xxs","p-2"],[1,"mb-1","app-small-card","rounded","no-select",3,"newly-1"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],[1,"mb-1","app-small-card","rounded","no-select"],[1,"d-flex","px-2","pt-2","pb-1"],[3,"user","width","height","unknownUserAsInfo"],[1,"align-self-center","ms-1"],[1,"ms-auto","align-self-center",2,"font-size","14px"],["role","button",3,"click"],[1,"pb-2","px-2"],[1,"cursor-pointer","btn-link",3,"click"],[1,"d-flex","fs-xxxs","pt-1"],[1,"ms-auto"]],template:function(o,r){o&1&&(a(0,"div",1),_(1,"div",2),a(2,"span")(3,"span",3),d(4,"Notifications"),l(),C(5,ry,2,1,"span",4),l(),C(6,ay,2,1,"button",5)(7,sy,1,0,"div",2),l(),a(8,"div",6),k(9,my,24,17,"div",7,oy),l()),o&2&&(s(5),x(r.store.notifications().length?5:-1),s(),x(r.store.notifications().length?6:7),s(3),M(r.store.notifications()))},dependencies:[P,ce,F,Ze,Je],encapsulation:2});let i=n;return i})();var uy=(i,n)=>n.id;function _y(i,n){if(i&1&&(a(0,"div",3)(1,"div",4),_(2,"img",5)(3,"span"),a(4,"div",6)(5,"span",7),d(6),l(),a(7,"span",8),d(8),l()()()()),i&2){let e=n.$implicit,t=c();s(2),m("src",e.avatarUrl,ee),s(),L(X("avatar-",t.allOnlineStatus[e==null?null:e.onlineStatus])),s(3),w(e.fullName),s(2),w(e.email)}}var Dm=(()=>{let n=class n{constructor(){this.allOnlineStatus=ki,this.store=S(te),this.onlineUsers=ve(()=>this.store.onlineUsers().filter(t=>t.onlineStatus!==or.OFFLINE))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-onlines"]],decls:6,vars:0,consts:[[1,"sidebar-component-title"],["l10nTranslate",""],["appAutoResize",""],[1,"app-onlines-content"],[1,"d-flex","align-items-center","align-self-center","avatar"],["alt","",1,"avatar-img",3,"src"],[1,"d-flex","flex-column","ms-2"],["draggable","false",1,"no-pointer-events","fs-xs"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"span",1),d(2,"Online users"),l()(),a(3,"div",2),k(4,_y,9,6,"div",3,uy),l()),o&2&&(s(4),M(r.onlineUsers()))},dependencies:[ce,P],encapsulation:2});let i=n;return i})();function fy(i,n){if(i&1){let e=y();a(0,"button",24),f("click",function(){h(e);let o=c();return g(o.collapseRSideBar())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();m("routerLink",e.USER_PATH.BASE),s(),m("icon",e.icons.faUserAlt)}}function hy(i,n){if(i&1){let e=y();a(0,"button",25),f("click",function(){h(e);let o=c();return g(o.collapseRSideBar())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();s(),m("icon",e.icons.faCog)}}function gy(i,n){if(i&1){let e=y();a(0,"button",4),f("click",function(){h(e);let o=c();return g(o.logOut())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();s(),m("icon",e.store.userImpersonate()?e.icons.faUserSecret:e.icons.faPowerOff)}}function Cy(i,n){i&1&&(a(0,"div",14),d(1,"Guest Link"),l())}function xy(i,n){if(i&1&&(a(0,"div"),d(1),l(),a(2,"div",26),d(3),l()),i&2){let e=c();s(),w(e.user==null?null:e.user.fullName),s(2),w(e.user==null?null:e.user.email)}}function Sy(i,n){if(i&1&&(a(0,"option",16),d(1),b(2,"translate"),b(3,"capitalize"),l()),i&2){let e=n.$implicit,t=c();m("ngValue",t.allOnlineStatus.indexOf(e)),s(),w(G(3,5,E(2,2,e,t.locale.language)))}}var km=(()=>{let n=class n{constructor(){this.logoDarkUrl=xr,this.logoUrl=Mc,this.store=S(te),this.locale=S($),this.USER_PATH=Ae,this.allOnlineStatus=ki,this.appBaseUrl=`${eo.WEBSITE}`,this.icons={faUserAlt:Xo,faCircleHalfStroke:_l,faCog:Ei,faPowerOff:cl,faUserSecret:tr},this.userAvatar=null,this.layout=S(I),this.themeLight=yn,this.authService=S(jt),this.userService=S(oe),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.appBaseUrl=this.layout.getCurrentLanguage()==="fr"?`${eo.WEBSITE}/fr/`:`${eo.WEBSITE}/`}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}collapseRSideBar(){this.layout.toggleRSideBar(!1)}setOnlineStatus(t){this.userService.changeOnlineStatus(t)}toggleTheme(){this.layout.toggleTheme()}logOut(){this.authService.logout(),this.layout.toggleRSideBar(!1)}openLink(t){switch(t){case"website":this.layout.openUrl(this.appBaseUrl);break;case"versions":this.layout.openUrl(eo.RELEASES);break;default:this.layout.openUrl(`${this.appBaseUrl}${t}`)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-profile"]],decls:41,vars:12,consts:[[1,"d-flex","flex-column"],[1,"sidebar-component-title"],[1,"d-flex","flex-fill","justify-content-between"],["type","button",1,"btn","btn-xs","btn-secondary",3,"routerLink"],["type","button",1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["type","button","routerLink","/admin",1,"btn","btn-xs","btn-secondary"],["type","button",1,"btn","btn-xs","btn-secondary"],["appAutoResize","",1,"d-flex","flex-column",3,"useMaxHeight"],[1,"user-header","py-3"],[1,"d-flex","flex-column","justify-content-center","me-2"],[1,"avatar-lg"],["alt","",1,"avatar-img",3,"src"],[1,"user-details"],["l10nTranslate",""],[1,"form-select","form-select-sm","mt-1",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"my-0","w-100"],[1,"mt-auto"],[1,"profile-sync-in-footer"],[1,"mb-1"],["alt","","height","30",3,"src"],["l10nTranslate","",1,"link-primary","cursor-pointer",3,"click"],[1,"link-primary","cursor-pointer",3,"click"],["type","button",1,"btn","btn-xs","btn-secondary",3,"click","routerLink"],["type","button","routerLink","/admin",1,"btn","btn-xs","btn-secondary",3,"click"],[1,"small"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),C(3,fy,2,2,"button",3),a(4,"button",4),f("click",function(){return r.toggleTheme()}),_(5,"fa-icon",5),l(),C(6,hy,2,1,"button",6),C(7,gy,2,1,"button",7),l()(),a(8,"div",8)(9,"div",9)(10,"div",10)(11,"div",11),_(12,"img",12)(13,"span"),l()(),a(14,"div",13),C(15,Cy,2,0,"div",14)(16,xy,4,2),a(17,"select",15),f("ngModelChange",function(u){return r.setOnlineStatus(u)}),k(18,Sy,4,7,"option",16,We),l()()(),_(20,"hr",17),a(21,"div",18),_(22,"hr",17),a(23,"div",19)(24,"div",20),_(25,"img",21),l(),a(26,"div")(27,"a",22),f("click",function(){return r.openLink("website")}),d(28,"Website"),l(),a(29,"span"),d(30,"\xA0|\xA0"),l(),a(31,"a",22),f("click",function(){return r.openLink("docs")}),d(32,"Documentation"),l(),a(33,"span"),d(34,"\xA0|\xA0"),l(),a(35,"a",22),f("click",function(){return r.openLink("versions")}),d(36,"Versions"),l(),a(37,"span"),d(38,"\xA0|\xA0"),l(),a(39,"a",23),f("click",function(){return r.openLink("support")}),d(40," \u{1F49B}"),l()()()()()()),o&2&&(s(3),x(r.user!=null&&r.user.isLink?-1:3),s(2),m("icon",r.icons.faCircleHalfStroke),s(),x(r.user!=null&&r.user.isAdmin?6:-1),s(),x(!r.store.isElectronApp()||r.store.isElectronApp()&&r.store.userImpersonate()?7:-1),s(),m("useMaxHeight",!1),s(4),m("src",r.userAvatar,ee),s(),L(X("avatar-",r.allOnlineStatus[r.user==null?null:r.user.onlineStatus])),s(2),x(r.user!=null&&r.user.isLink?15:16),s(2),m("ngModel",r.user==null?null:r.user.onlineStatus),s(),M(r.allOnlineStatus),s(7),m("src",r.layout.switchTheme.getValue()===r.themeLight?r.logoUrl:r.logoDarkUrl,ee))},dependencies:[be,yi,bi,vi,xe,ye,cn,F,P,ce,Dn,Z],encapsulation:2});let i=n;return i})();var vy=(i,n)=>n.id;function yy(i,n){if(i&1){let e=y();a(0,"button",5),f("click",function(){h(e);let o=c();return g(o.onCloseAll())}),_(1,"fa-icon",6),l()}if(i&2){let e=c();s(),m("icon",e.icons.faXmark)}}function by(i,n){if(i&1){let e=y();a(0,"div",7),f("click",function(){let o=h(e).$implicit,r=c();return g(r.onMaximize(o))}),a(1,"div",8),_(2,"img",9),a(3,"div",10),d(4),l(),a(5,"button",11),f("click",function(o){let r=h(e).$implicit,p=c();return g(p.onClose(o,r))}),_(6,"fa-icon",6),l()()()}if(i&2){let e=n.$implicit,t=c();s(2),m("ngSrc",e.element.mimeUrl),s(2),w(e.element.name),s(2),m("icon",t.icons.faTimes)}}var Mm=(()=>{let n=class n{constructor(){this.icons={faXmark:Al,faTimes:Rt},this.windows=[],this.layout=S(I),this.subscription=null,this.subscription=this.layout.windows.subscribe(t=>this.setWindows(t))}ngOnDestroy(){this.subscription.unsubscribe()}onMaximize(t){this.layout.restoreDialog(t.id)}onClose(t,o){t.preventDefault(),t.stopPropagation();let r=this.layout.modalRefs.get(o.id);r&&r.content.onClose(),this.hideIfNoWindows(this.layout.windows.getValue())}onCloseAll(){for(let t of this.layout.windows.getValue()){let o=this.layout.modalRefs.get(t.id);o&&o.content.onClose()}this.hideIfNoWindows(this.layout.windows.getValue())}setWindows(t){this.hideIfNoWindows(t),this.windows=t}hideIfNoWindows(t){t.length||this.layout.hideRSideBarTab(fe.WINDOWS,1e3)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-windows"]],decls:7,vars:1,consts:[[1,"sidebar-component-title"],[1,"btn","btn-sm","btn-secondary"],["l10nTranslate",""],["appAutoResize","",1,"sidebar-item"],[1,"sidebar-item-container"],[1,"btn","btn-sm","btn-secondary",3,"click"],[3,"icon"],[1,"sidebar-item-container",3,"click"],[1,"sidebar-item-content"],["alt","","width","28","height","28",3,"ngSrc"],[1,"text-truncate","fs-xxs","ms-2"],[1,"btn","btn-xs","btn-danger","ms-auto",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0),C(1,yy,2,1,"button",1),a(2,"span",2),d(3,"Windows Manager"),l()(),a(4,"div",3),k(5,by,7,3,"div",4,vy),l()),o&2&&(s(),x(r.windows.length?1:-1),s(4),M(r.windows))},dependencies:[ce,F,P,Ns],encapsulation:2});let i=n;return i})();var Fm=(i,n)=>n.label,wy=(i,n)=>n.name;function Ty(i,n){if(i&1&&(a(0,"div",5)(1,"div",6),d(2),l()()),i&2){let e=c().$implicit;s(2),w(e.title)}}function Ey(i,n){i&1&&Ie(0)}function Ay(i,n){if(i&1&&(a(0,"div",7),R(1,Ey,1,0,"ng-container",8),l()),i&2){let e=c().$implicit;s(),m("ngComponentOutlet",e)}}function Dy(i,n){if(i&1&&C(0,Ay,2,1,"div",7),i&2){let e=c(2).$implicit;x(e.active||e.loadComponent?0:-1)}}function ky(i,n){if(i&1&&k(0,Dy,1,1,null,null,wy),i&2){let e=c().$implicit;M(e.components)}}function My(i,n){if(i&1&&(a(0,"div"),C(1,Ty,3,1,"div",5),C(2,ky,2,0),l()),i&2){let e=n.$implicit,t=c();L(e.active?"d-block":"d-none"),s(),x(e.title?1:-1),s(),x(t.showComponents||e.loadComponent?2:-1)}}function Fy(i,n){if(i&1&&(a(0,"a",4),_(1,"fa-icon",9),l()),i&2){let e=c();s(),m("icon",e.icons.faWifi)}}function Py(i,n){if(i&1&&(a(0,"span",13)(1,"span"),d(2),l()()),i&2){let e=c(2).$implicit;s(),L(X("badge bg-",e.count.level," rounded-pill")),s(),w(n)}}function Iy(i,n){if(i&1){let e=y();a(0,"a",11),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.setTabVisible(o.label))}),_(1,"fa-icon",12),C(2,Py,3,4,"span",13),b(3,"async"),l()}if(i&2){let e,t=c().$implicit,o=c();O("mt-auto",t.firstOfLasts)("active",o.visible&&t.active),s(),m("icon",t.icon),s(),x((e=G(3,6,t.count&&t.count.value))?2:-1,e)}}function Ry(i,n){if(i&1&&(C(0,Iy,4,8,"a",10),b(1,"async")),i&2){let e=n.$implicit;x(e.icon&&(!e.showOnCount||e.showOnCount&&e.count&&G(1,1,e.count.value))?0:-1)}}var Pm=(()=>{let n=class n{constructor(){this.visible=!1,this.showComponents=!1,this.tabs=[],this.theme=yn,this.networkIsOnline=!0,this.icons={faWifi:Il},this.layout=S(I),this.store=S(te),this.subscriptions=[],this.showDelay=null,this.currentMenu=null,this.firstsTabs=[{label:fe.PROFILE,components:[km],icon:null,title:null,active:!1},{label:fe.ONLINES,components:[Dm],icon:Oc,title:null,count:{value:di(ve(()=>this.store.onlineUsers().filter(t=>t.onlineStatus!==or.OFFLINE).length)),level:"success"},showOnCount:!0,active:!1},{label:fe.NOTIFICATIONS,components:[Am],icon:Nc,title:null,count:{value:di(ve(()=>this.store.unreadNotifications().length)),level:"warning"},active:!1},{label:fe.TASKS,components:[Em],icon:Uc,title:null,count:{value:us([this.store.filesActiveTasks.pipe(bt(t=>t.length)),this.store.clientSyncTasksCount]).pipe(bt(([t,o])=>t+o)),level:"maroon"},active:!1}],this.lastsTabs=[{label:fe.WINDOWS,components:[Mm],icon:Hc,title:null,count:{value:this.layout.windows.pipe(bt(t=>t.length)),level:"maroon"},showOnCount:!0,firstOfLasts:!0,active:!1}],this.tabs=[...this.firstsTabs,...this.lastsTabs],this.subscriptions.push(this.layout.rightSideBarIsOpen.subscribe(t=>this.setVisible(t))),this.subscriptions.push(this.layout.rightSideBarSetTabs.subscribe(t=>this.setTabs(t))),this.subscriptions.push(this.layout.rightSideBarOpenAndShowTab.subscribe(t=>this.setTabVisible(t))),this.subscriptions.push(this.layout.rightSideBarSelectTab.subscribe(t=>this.selectTab(t))),this.subscriptions.push(this.layout.switchTheme.subscribe(t=>this.theme=t)),this.subscriptions.push(this.layout.networkIsOnline.subscribe(t=>this.networkIsOnline=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}setTabVisible(t){this.visible?t&&t!==this.layout.currentRightSideBarTab?this.selectTab(t):this.layout.toggleRSideBar(!1):(this.selectTab(t),this.layout.toggleRSideBar(!0))}setVisible(t){t?(clearTimeout(this.showDelay),this.showComponents=t):this.showDelay=setTimeout(()=>this.showComponents=t,500),this.visible=t}setTabs(t){t.name!==this.currentMenu&&(this.tabs=[...this.firstsTabs,...t.tabs?t.tabs:[],...this.lastsTabs],this.currentMenu=t.name,t.name===null&&!this.tabs.find(o=>o.active)&&this.layout.toggleRSideBar(!1))}selectTab(t){if(t){let o=!1;for(let r of this.tabs)r.active=r.label==t,r.active&&(o=!0,this.layout.currentRightSideBarTab=t);o||(this.tabs[0].active=!0)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-sidebar-right"]],decls:9,vars:6,consts:[[3,"class"],[1,"control-sidebar-menu"],[1,"sidebar-apps-icons"],[1,"menu"],[1,"bg-warning"],[1,"sidebar-title"],["l10nTranslate",""],[1,"sidebar-component-content"],[4,"ngComponentOutlet"],[1,"text-white",3,"icon"],[3,"mt-auto","active"],[3,"click"],[3,"icon"],[1,"menu-badge"]],template:function(o,r){o&1&&(a(0,"aside"),k(1,My,3,4,"div",0,Fm),l(),a(3,"div",1)(4,"div",2)(5,"div",3),C(6,Fy,2,1,"a",4),k(7,Ry,2,3,null,null,Fm),l()()()),o&2&&(L(X("control-sidebar control-sidebar-",r.theme)),O("control-sidebar-open",r.visible),s(),M(r.tabs),s(5),x(r.networkIsOnline?-1:6),s(),M(r.tabs))},dependencies:[F,P,Fo,sn],encapsulation:2});let i=n;return i})();var Im=(()=>{let n=class n{constructor(){this.themeMode=yn,this.document=S(Eo),this.layout=S(I),this.renderer=S(pt),this.rightSideBarClass="control-sidebar-open",this.leftSideBarCollapsedClass="sidebar-collapse",this.leftSideBarOpenedClass="sidebar-open",this.isSmallerThanMediumScreen=!1,this.subscriptions=[],this.subscriptions.push(this.layout.switchTheme.subscribe(t=>this.setTheme(t))),this.subscriptions.push(this.layout.toggleRightSideBar.subscribe(t=>this.toggleRightSideBar(t))),this.subscriptions.push(this.layout.toggleLeftSideBar.subscribe(t=>this.toggleLeftSideBar(t)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onResize(){this.layout.resizeEvent.next(),this.isSmallerThanMediumScreen!==this.layout.isSmallerMediumScreen()&&(this.isSmallerThanMediumScreen=!this.isSmallerThanMediumScreen,this.checkLeftSideBarCollapse())}onDragOver(t){t.preventDefault()}onDrop(t){t.preventDefault()}toggleLeftSideBar(t){t===1?(this.openLeftSideBar(),this.layout.leftSideBarIsOpen.next(!0)):t===2?(this.collapseLeftSideBar(),this.layout.leftSideBarIsOpen.next(!1)):this.document.body.classList.contains(this.leftSideBarOpenedClass)?(this.collapseLeftSideBar(),this.layout.saveLeftSideBarIsOpen.next(!1),this.layout.leftSideBarIsOpen.next(!1)):(this.openLeftSideBar(),this.layout.saveLeftSideBarIsOpen.next(!0),this.layout.leftSideBarIsOpen.next(!0))}toggleRightSideBar(t){t?this.renderer.addClass(this.document.body,this.rightSideBarClass):this.renderer.removeClass(this.document.body,this.rightSideBarClass)}openLeftSideBar(){this.renderer.removeClass(this.document.body,this.leftSideBarCollapsedClass),this.renderer.addClass(this.document.body,this.leftSideBarOpenedClass)}collapseLeftSideBar(){this.renderer.removeClass(this.document.body,this.leftSideBarOpenedClass),this.renderer.addClass(this.document.body,this.leftSideBarCollapsedClass)}checkLeftSideBarCollapse(){this.isSmallerThanMediumScreen?this.toggleLeftSideBar(2):this.toggleLeftSideBar(this.layout.saveLeftSideBarIsOpen.getValue()?1:2)}setTheme(t){this.renderer.removeClass(this.document.body,this.themeMode),this.themeMode=t,this.renderer.addClass(this.document.body,this.themeMode)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-layout"]],hostBindings:function(o,r){o&1&&f("resize",function(){return r.onResize()},Ao)("dragover",function(u){return r.onDragOver(u)})("drop",function(u){return r.onDrop(u)})},decls:8,vars:0,consts:[[1,"app-main"],[1,"wrapper"],[1,"content-wrapper"],[1,"content-container"]],template:function(o,r){o&1&&(a(0,"body",0)(1,"div",1),_(2,"app-navbar")(3,"app-sidebar-left"),a(4,"div",2)(5,"div",3),_(6,"router-outlet"),l()(),_(7,"app-sidebar-right"),l()())},dependencies:[ln,wm,Tm,Pm],encapsulation:2});let i=n;return i})();var Rm=[{path:rr.BASE,component:Im,canActivate:[as],canActivateChild:[as],children:[...td,...od,...em,...xm,...am,...Qp]},...ym,...Yp,{path:"**",redirectTo:mi.BASE}];var Nm=(()=>{let n=class n{constructor(){this.injector=S(Gn),this.auth=null,this.isRefreshingToken=!1,this.waitForRefreshToken=new ms(!1),this.retryCount=3,this.retryWaitMilliSeconds=2e3}intercept(t,o){let r=oc(t.url);return r&&(t=t.clone({url:r})),o.handle(t).pipe(bo(p=>p.status===401?this.handleAuthorizationError(t,o,p):p.status===0?this.handleRetries(t,o,p):yo(()=>p)))}handleAuthorizationError(t,o,r){return this.auth||(this.auth=this.injector.get(jt)),console.debug("AuthInterceptor:",t.url,r.status),[Ys,Qs,qs].indexOf(t.url)===-1?this.isRefreshingToken?(console.debug("AuthInterceptor: wait for refresh token"),this.waitForRefreshToken.pipe(Dt(p=>!p),pe(1),zn(()=>o.handle(this.auth.checkCSRF(t))))):(console.debug("AuthInterceptor: refreshing token"),this.isRefreshingToken=!0,this.waitForRefreshToken.next(!0),this.auth.refreshToken().pipe(zn(()=>(this.waitForRefreshToken.next(!1),o.handle(this.auth.checkCSRF(t)))),wo(()=>this.isRefreshingToken=!1))):yo(()=>r)}handleRetries(t,o,r){return o.handle(t).pipe(hs(p=>p.pipe(_s((u,v)=>v<this.retryCount&&u.status==0?gi(u):yo(()=>u)),fs(this.retryWaitMilliSeconds))))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Vm(){return Object.assign(new Ro,{adaptivePosition:!1,triggers:"hover",delay:500})}var Lm={url:"",options:{autoConnect:!1,reconnection:!0,forceNew:!1,transports:["websocket"]}};var Om={providers:[ks({eventCoalescing:!0}),{provide:Fs,useClass:Ps},{provide:Us,useClass:Nm,multi:!0},js(Rm),Hs($s(),zs({cookieName:Ca,headerName:Ca})),Js(Hl,re({storage:$l,translationLoader:zl},Ms()?{missingTranslationHandler:Gl}:{})),el(),jp(),nl({positionClass:"toast-bottom-right",preventDuplicates:!1,maxOpened:6,autoDismiss:!0,timeOut:6e3}),{provide:Ro,useFactory:Vm},tl,Cs(il.forRoot(Lm))]};Ls(qc,Om).catch(console.error);
11
+ `),o=new Blob([t],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(o);lr(r,"sync-in.recovery-codes.txt"),URL.revokeObjectURL(r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-auth-2fa-enable-dialog"]],inputs:{qrDataUrl:"qrDataUrl",secret:"secret"},outputs:{isValid:"isValid"},decls:8,vars:2,consts:[[1,"modal-header","align-items-center","justify-content-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"modal-body","modal-auth-verify-2fa"],["l10nTranslate","",1,"text-align-center"],["l10nTranslate","",1,"text-align-center","font-italic","text-warning"],[1,"list-group","text-align-center","my-3"],[1,"list-group-item","font-monospace"],[1,"d-grid","gap-2"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],[1,"d-flex","flex-column","text-align-center","justify-content-center","align-items-center","fs-xs","mt-2","mb-4",2,"height","45px"],["l10nTranslate","",1,"text-danger"],[1,"text-center","my-3"],["alt","QR Code",1,"img-fluid","border","p-2","rounded",2,"max-width","150px",3,"src"],[1,"text-muted","small","text-center","mb-3"],["l10nTranslate","",1,"mb-2"],[3,"icon"],["role","button",1,"ms-1","font-monospace","link-primary",3,"click"],[2,"border-width","2px"],[3,"ngSubmit","formGroup"],["l10nTranslate","",1,"text-align-center","mb-3"],[1,"mb-3"],["id","password","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022",3,"passwordChange","password","focus","centered"],["type","text","formControlName","totpCode","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022","inputmode","numeric","autocomplete","one-time-code","name","totp",1,"form-control","text-center","fs-4",3,"maxlength"],["type","submit","l10nTranslate","",1,"btn","btn-primary",3,"disabled"],[1,"text-muted"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Two-Factor Authentication"),l()()(),a(5,"div",4),C(6,kS,14,0)(7,PS,27,10),l()),o&2&&(s(2),m("icon",r.icons.faLock),s(4),x(r.wasEnabled?6:7))},dependencies:[F,P,wi,mn,je,xe,dn,Io,un,_n,dr],encapsulation:2});let i=n;return i})();var ra=(function(i){return i.WEBDAV="webdav",i})(ra||{});var IS=i=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:i,showWeekNumbers:!1}),RS=(i,n)=>n.name;function NS(i,n){if(i&1&&(a(0,"option",19),d(1),l()),i&2){let e=n.$implicit;m("value",e),s(),w(e)}}function VS(i,n){if(i&1&&(a(0,"div",22),d(1),l()),i&2){let e=c(3);s(),D(" ",e.hasError," ")}}function LS(i,n){i&1&&(a(0,"div",23),d(1," This password will only be shown once after it is generated "),l())}function OS(i,n){i&1&&_(0,"hr",24)}function BS(i,n){if(i&1&&(C(0,VS,2,1,"div",22)(1,LS,2,0,"div",23),C(2,OS,1,0,"hr",24)),i&2){let e=c(2);x(e.hasError?0:1),s(2),x(e.appPasswords.length?2:-1)}}function US(i,n){if(i&1){let e=y();a(0,"div",11)(1,"div",12),d(2,"Generate a new app password"),l(),a(3,"div",13)(4,"form",14),f("ngSubmit",function(){h(e);let o=c();return g(o.genAppPassword())}),a(5,"div",15),_(6,"input",16),b(7,"translate"),a(8,"div",17),d(9,"Application"),l(),a(10,"select",18),k(11,NS,2,2,"option",19,We),l(),_(13,"input",20),b(14,"translate"),a(15,"button",21),d(16," Generate "),l()()()()(),C(17,BS,3,2)}if(i&2){let e=c();s(4),m("formGroup",e.appPasswordForm),s(2),O("is-invalid",e.appPasswordForm.controls.name.invalid),m("placeholder",E(7,8,"Password name",e.locale.language)),s(5),M(e.availableApps),s(2),m("placeholder",E(14,11,"Never expires",e.locale.language))("bsConfig",Ne(14,IS,e.minDate)),s(2),m("disabled",e.appPasswordForm.invalid||e.submitted),s(2),x(e.generatedPassword?-1:17)}}function HS(i,n){if(i&1&&(a(0,"div",26)(1,"strong",3),d(2,"Expiration"),l(),d(3),l()),i&2){let e=c(2);s(3),D(":\xA0",e.generatedPassword.expiration," ")}}function $S(i,n){i&1&&_(0,"hr",24)}function zS(i,n){if(i&1){let e=y();a(0,"div",25)(1,"div",26)(2,"strong",3),d(3,"Password name"),l(),d(4),l(),a(5,"div",26)(6,"strong",3),d(7,"Application"),l(),d(8),b(9,"translate"),l(),C(10,HS,4,1,"div",26),a(11,"div",26)(12,"strong",3),d(13,"Generated password"),l(),d(14,":\xA0 "),a(15,"span",27),f("click",function(){h(e);let o=c();return g(o.clipBoardPassword())}),_(16,"fa-icon",9),a(17,"span"),d(18),l()()()(),C(19,$S,1,0,"hr",24)}if(i&2){let e=c();s(4),D(":\xA0",e.generatedPassword.name," "),s(4),D(":\xA0",E(9,6,e.generatedPassword.app,e.locale.language)," "),s(2),x(e.generatedPassword.expiration?10:-1),s(6),m("icon",e.icons.faCopy),s(2),w(e.generatedPassword.password),s(),x(e.appPasswords.length?19:-1)}}function GS(i,n){if(i&1&&(a(0,"div"),d(1),b(2,"amDateFormat"),l()),i&2){let e=c().$implicit;s(),w(G(2,1,e.lastAccess))}}function WS(i,n){if(i&1&&(a(0,"div"),d(1),l()),i&2){let e=c().$implicit;s(),w(e.lastIp)}}function jS(i,n){if(i&1){let e=y();a(0,"tr")(1,"td"),d(2),l(),a(3,"td"),d(4),b(5,"translate"),l(),a(6,"td",30)(7,"div",31)(8,"div"),d(9),b(10,"amDateFormat"),l(),C(11,GS,3,3,"div"),l()(),a(12,"td",30)(13,"div",31)(14,"div"),d(15),l(),C(16,WS,2,1,"div"),l()(),a(17,"td",30),d(18),b(19,"amDateFormat"),b(20,"translate"),l(),a(21,"td",30),d(22),b(23,"amDateFormat"),l(),a(24,"td")(25,"button",32),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.deleteAppPassword(o.name))}),d(26,"Delete"),l()()()}if(i&2){let e=n.$implicit,t=c(2);s(2),w(e.name),s(2),w(E(5,8,e.app,t.locale.language)),s(5),w(e.currentAccess?G(10,11,e.currentAccess):"-"),s(2),x(e.lastAccess?11:-1),s(4),w(e.currentIp||"-"),s(),x(e.lastIp?16:-1),s(2),w(e.expiration?E(19,13,e.expiration,"L"):E(20,16,"never",t.locale.language)),s(4),w(G(23,19,e.createdAt))}}function KS(i,n){if(i&1&&(a(0,"table",6)(1,"thead")(2,"tr")(3,"th",28),d(4,"Name"),l(),a(5,"th",28),d(6,"Application"),l(),a(7,"th",28),d(8,"Access"),l(),a(9,"th",28),d(10,"IP"),l(),a(11,"th",28),d(12,"Expiration"),l(),a(13,"th",28),d(14,"Created"),l(),a(15,"th",28),d(16,"Action"),l()()(),a(17,"tbody",29),k(18,jS,27,21,"tr",null,RS),l()()),i&2){let e=c();s(18),M(e.appPasswords)}}var lm=(()=>{let n=class n{constructor(){this.appPasswords=[],this.nbAppPasswords=new ae,this.locale=S($),this.availableApps=Object.values(ra),this.allowGeneration=!1,this.minDate=Jl(),this.submitted=!1,this.icons={faKey:It,faCopy:Sn,faPlus:Qe},this.fb=S(fn),this.appPasswordForm=this.fb.group({name:this.fb.control("",[Et.required]),app:this.fb.control(ra.WEBDAV,[Et.required]),expiration:this.fb.control(null)}),this.layout=S(I),this.userService=S(oe),this.clipBoardService=S(kn),this.minDate.setDate(this.minDate.getDate()+1),this.appPasswordForm.controls.name.valueChanges.pipe(Dt(Boolean)).subscribe(t=>{this.hasError=void 0,this.appPasswordForm.controls.name.setValue(tc(t),{emitEvent:!1})})}ngOnInit(){this.appPasswords.length===0&&(this.allowGeneration=!0)}onClose(){this.layout.closeDialog()}deleteAppPassword(t){this.userService.deleteAppPassword(t).subscribe({next:()=>{this.appPasswords=this.appPasswords.filter(o=>o.name!==t),this.nbAppPasswords.emit(this.appPasswords.length)},error:o=>this.layout.sendNotification("error","Application Passwords","Unable to revoke",o)})}genAppPassword(){return Xt(this,null,function*(){for(let o of this.appPasswords)if(o.name===this.appPasswordForm.value.name){this.hasError="This name is already used";return}let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.generateAppPassword(this.appPasswordForm.value,t).subscribe({next:o=>{this.appPasswordForm.patchValue({name:"",expiration:null}),this.appPasswords.unshift(o),this.generatedPassword=o,this.nbAppPasswords.emit(this.appPasswords.length)},error:o=>this.layout.sendNotification("error","Application Passwords","Unable to generate",o)})})}clipBoardPassword(){this.clipBoardService.copyFromContent(this.generatedPassword.password),this.layout.sendNotification("info","Generated password","Copied")}onAllowGenerationChange(){this.generatedPassword?(this.generatedPassword=null,this.allowGeneration=!0):this.allowGeneration=!this.allowGeneration}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-auth-manage-app-passwords"]],inputs:{appPasswords:"appPasswords"},outputs:{nbAppPasswords:"nbAppPasswords"},decls:17,vars:7,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"table","table-striped","table-hover","align-middle","text-center","no-select"],[1,"modal-footer"],["role","button","type","button","btnCheckbox","","l10nTranslate","",1,"btn","btn-sm","btn-outline-success","me-auto",3,"ngModelChange","ngModel"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"d-flex","flex-fill","flex-column"],["l10nTranslate","",1,"fw-500","mb-3"],[1,"d-flex","flex-column","align-items-start"],[1,"w-100",3,"ngSubmit","formGroup"],[1,"input-group","input-group-sm","flex-nowrap"],["appAutofocus","","name","name","formControlName","name","type","text","required","",1,"flex-grow-1","form-control","form-control-sm","pe-0",3,"placeholder"],["l10nTranslate","",1,"input-group-text"],["formControlName","app",1,"form-select","form-select-sm",2,"max-width","150px"],["l10nTranslate","",3,"value"],["bsDatepicker","","id","expiration","formControlName","expiration","placement","bottom","type","text",1,"form-control","form-control-sm",2,"max-width","120px",3,"placeholder","bsConfig"],["type","submit","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"disabled"],["l10nTranslate","",1,"alert","alert-danger","text-center","my-3"],["l10nTranslate","",1,"alert","alert-secondary","text-center","my-3"],[1,"mb-1","mt-4"],[1,"d-flex","flex-column","alert","alert-success","text-center","my-3"],[1,"d-flex"],["role","button",1,"font-monospace","fw-bold","link-body-emphasis",3,"click"],["scope","col","l10nTranslate",""],[1,"table-group-divider"],[1,"fs-xxxs"],[1,"d-flex","flex-column","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-outline-danger",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Manage app passwords"),l()(),a(5,"button",4),f("click",function(){return r.onClose()}),l()(),a(6,"div",5),C(7,US,18,16),C(8,zS,20,9),C(9,KS,20,0,"table",6),l(),a(10,"div",7)(11,"button",8),f("ngModelChange",function(){return r.onAllowGenerationChange()}),_(12,"fa-icon",9)(13,"fa-icon",9),d(14," Password "),l(),a(15,"button",10),f("click",function(){return r.onClose()}),d(16,"Close"),l()()),o&2&&(s(2),m("icon",r.icons.faKey),s(5),x(r.allowGeneration&&!r.generatedPassword?7:-1),s(),x(r.generatedPassword?8:-1),s(),x(r.appPasswords.length?9:-1),s(2),m("ngModel",r.allowGeneration),s(),m("icon",r.icons.faPlus),s(),m("icon",r.icons.faKey))},dependencies:[F,P,be,mn,yi,bi,je,vi,xe,dn,ei,ye,Ye,ol,rl,wi,un,_n,Tn,Fe,Z],encapsulation:2});let i=n;return i})();var QS=(i,n)=>n.key;function qS(i,n){if(i&1&&(a(0,"option",14),d(1),b(2,"translate"),b(3,"capitalize"),l()),i&2){let e=n.$implicit,t=c(2);m("ngValue",t.allOnlineStatus.indexOf(e)),s(),D(" ",G(3,5,E(2,2,e,t.locale.language))," ")}}function YS(i,n){if(i&1&&(a(0,"span",37),_(1,"fa-icon",41),a(2,"span",42),d(3,"Administrator"),l()()),i&2){let e=c(3);s(),m("icon",e.icons.faKey)}}function XS(i,n){if(i&1&&(a(0,"span",43),d(1),l()),i&2){let e=n.$implicit;s(),w(e)}}function ZS(i,n){if(i&1&&k(0,XS,2,1,"span",43,We),i&2){let e=c(3);M(e.user.applications)}}function JS(i,n){if(i&1&&(a(0,"li",29)(1,"span",28),d(2,"Permissions"),l(),C(3,YS,4,1,"span",37)(4,ZS,2,0),l(),a(5,"li",38)(6,"span",28),d(7,"Storage Space"),l(),a(8,"span",39),_(9,"app-storage-usage",40),l()()),i&2){let e=c(2);s(3),x(e.user.isAdmin?3:4),s(6),m("item",e.user)}}function ev(i,n){if(i&1&&(a(0,"option",14),d(1),l()),i&2){let e=n.$implicit;m("ngValue",e.value),s(),w(e.key)}}function tv(i,n){if(i&1){let e=y();a(0,"div",44)(1,"span",45),d(2,"Document editor"),l(),a(3,"div",46)(4,"div",47)(5,"select",48),f("ngModelChange",function(o){h(e);let r=c(2);return g(r.updateEditorPreference(o))}),a(6,"option",15),d(7,"Ask Me"),l(),k(8,ev,2,2,"option",14,QS),b(10,"keyvalue"),l()()()(),a(11,"div",49)(12,"div",50),d(13," Used when both editors support the file type. "),l()()}if(i&2){let e=c(2);s(5),m("ngModel",e.userEditorPreference),s(),m("ngValue",null),s(2),M(E(10,2,e.editors,e.originalOrderKeyValue))}}function iv(i,n){if(i&1){let e=y();a(0,"div",51)(1,"span",52),d(2,"Full-text search"),l(),a(3,"div",46)(4,"div",53)(5,"div",54)(6,"label",55)(7,"span",42),d(8),l()(),a(9,"input",56),f("ngModelChange",function(o){h(e);let r=c(2);return g(r.updateStorageIndexing(o))}),l()()()()(),a(10,"div",49)(11,"div",50),d(12," Enable content indexation for personal files. "),l()()}if(i&2){let e=c(2);s(8),w(e.user.storageIndexing?"enabled":"disabled"),s(),m("ngModel",e.user.storageIndexing)}}function nv(i,n){if(i&1){let e=y();a(0,"div",3)(1,"div",16)(2,"div",9)(3,"div",17)(4,"div",18)(5,"div",19),_(6,"img",20)(7,"span"),l()(),a(8,"div",21)(9,"div",22),d(10),l(),a(11,"div",23),d(12),l(),a(13,"div",24),d(14),b(15,"translate"),b(16,"amTimeAgo"),l(),a(17,"select",25),ue("ngModelChange",function(o){h(e);let r=c();return me(r.user.onlineStatus,o)||(r.user.onlineStatus=o),g(o)}),f("ngModelChange",function(o){h(e);let r=c();return g(r.setOnlineStatus(o))}),k(18,qS,4,7,"option",14,We),l()()(),a(20,"ul",26)(21,"li",27)(22,"span",28),d(23,"Login"),l(),a(24,"span"),d(25),l()(),a(26,"li",29)(27,"span",28),d(28,"IP Addresses"),l(),a(29,"span",30),d(30),l(),a(31,"span",31),d(32),l()(),a(33,"li",29)(34,"span",28),d(35,"Connections"),l(),a(36,"span",30),d(37),b(38,"amDateFormat"),l(),a(39,"span",31),d(40),b(41,"amDateFormat"),l()(),C(42,JS,10,2),a(43,"li",27)(44,"span",32),d(45,"WebDAV"),l(),a(46,"span",33),f("click",function(){h(e);let o=c();return g(o.clipBoardLink())}),_(47,"fa-icon",34),d(48),l()()(),_(49,"hr",35),a(50,"div")(51,"span",36),d(52,"Preferences"),l(),C(53,tv,14,5),C(54,iv,13,2),l()()()()}if(i&2){let e=c();s(6),m("src",e.userAvatar,ee),s(),L(X("avatar-",e.allOnlineStatus[e.user.onlineStatus])),s(3),w(e.user.fullName),s(2),w(e.user.email),s(2),Re(" ",E(15,19,"Member since",e.locale.language)," ",E(16,22,e.user.createdAt,!0)," "),s(3),de("ngModel",e.user.onlineStatus),s(),M(e.allOnlineStatus),s(7),w(e.user.login),s(5),w(e.user.currentIp),s(2),w(e.user.lastIp),s(5),w(G(38,25,e.user.currentAccess)),s(3),w(G(41,27,e.user.lastAccess)),s(2),x(e.user.isUser?42:-1),s(5),m("icon",e.icons.faCopy),s(),D(" ",e.webdavUrl," "),s(5),x(e.showEditorPreference?53:-1),s(),x(e.user.isUser?54:-1)}}function ov(i,n){if(i&1&&_(0,"app-password-strength-bar",8),i&2){let e=c();m("passwordToCheck",e.newPassword)}}function rv(i,n){if(i&1){let e=y();a(0,"div",10)(1,"span",11),d(2,"Avatar"),l(),a(3,"div",12)(4,"button",57),f("click",function(){h(e);let o=c();return g(o.genAvatar())}),d(5,"Generate"),l(),a(6,"button",58)(7,"span",42),d(8,"Import"),l(),a(9,"input",59),f("change",function(o){h(e);let r=c();return g(r.uploadAvatar(o))}),l()()()()}}function av(i,n){if(i&1&&(a(0,"option",14),d(1),l()),i&2){let e=n.$implicit,t=c();m("ngValue",e),s(),w(t.i18nLanguageText[e])}}function sv(i,n){if(i&1&&(a(0,"option",15),d(1),l()),i&2){let e=n.$implicit,t=c();m("ngValue",t.allNotifications.indexOf(e)),s(),w(e)}}function lv(i,n){if(i&1){let e=y();a(0,"button",70),f("click",function(){h(e);let o=c(2);return g(o.disable2Fa())}),d(1," Disable "),l()}if(i&2){let e=c(2);m("disabled",!e.store.server().twoFaEnabled)}}function cv(i,n){if(i&1&&(a(0,"span",42),d(1,"Manage"),l(),d(2,"\xA0"),a(3,"span"),d(4),l()),i&2){let e=c(2);s(4),D("(",e.user.appPasswords,")")}}function pv(i,n){i&1&&(a(0,"span",42),d(1,"Generate"),l())}function dv(i,n){if(i&1){let e=y();a(0,"div",10)(1,"span",60),d(2,"Password"),l(),a(3,"div",12)(4,"div",22)(5,"app-input-password",61),ue("passwordChange",function(o){h(e);let r=c();return me(r.oldPassword,o)||(r.oldPassword=o),g(o)}),l()(),a(6,"div",22)(7,"app-input-password",62),ue("passwordChange",function(o){h(e);let r=c();return me(r.newPassword,o)||(r.newPassword=o),g(o)}),l()(),a(8,"button",63),f("click",function(){h(e);let o=c();return g(o.submitPassword())}),d(9," Update "),l()()(),a(10,"div",10)(11,"span",64),d(12,"Security"),l(),a(13,"div",12)(14,"div",65),d(15,"Two-Factor Authentication"),l(),a(16,"button",66),f("click",function(){h(e);let o=c();return g(o.enable2Fa())}),d(17),l(),C(18,lv,2,1,"button",67),a(19,"div",68),d(20,"Application Passwords"),l(),a(21,"button",69),f("click",function(){h(e);let o=c();return g(o.manageAppPasswords())}),C(22,cv,5,1)(23,pv,2,0,"span",42),l()()()}if(i&2){let e=c();s(5),de("password",e.oldPassword),s(2),de("password",e.newPassword),m("disabled",!(e.oldPassword!=null&&e.oldPassword.length))("isRequired",!!(e.oldPassword!=null&&e.oldPassword.length))("passwordMinLength",e.passwordMinLength)("showGenerator",!0),s(),m("disabled",!e.newPassword||!e.oldPassword||e.newPassword.length<e.passwordMinLength),s(8),m("disabled",!e.store.server().twoFaEnabled),s(),D(" ",e.user.twoFaEnabled?"Reset":"Enable"," "),s(),x(e.user.twoFaEnabled?18:-1),s(4),x(e.user.appPasswords>0?22:23)}}var cm=(()=>{let n=class n{constructor(){this.locale=S($),this.i18nLanguageText=Ul,this.allNotifications=Object.values(Ol),this.allOnlineStatus=ki,this.passwordMinLength=8,this.icons={faCopy:Sn,faKey:It},this.editors={[wc]:"collabora",[Tc]:"onlyoffice"},this.userAvatar=null,this.webdavUrl=`${window.location.origin}/${Bi}`,this.store=S(te),this.showEditorPreference=!1,this.originalOrderKeyValue=De,this.layout=S(I),this.languages=this.layout.getLanguages(!0),this.userService=S(oe),this.clipBoardService=S(kn),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.layout.setBreadcrumbIcon(Wt.ACCOUNT),this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.ACCOUNT}/${Qi.ACCOUNT}`,splicing:2,translating:!0,sameLink:!0}),this.showEditorPreference=this.store.server().fileEditors.collabora&&this.store.server().fileEditors.onlyoffice,this.showEditorPreference&&(this.userEditorPreference=this.userService.getEditorProviderPreference())}get language(){return this.user?.language||xa}set language(t){t===xa&&(t=null),this.userService.changeLanguage({language:t}).subscribe({next:()=>this.updateLanguage(t),error:()=>this.layout.sendNotification("error","Configuration","Unable to update language")})}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}setOnlineStatus(t){this.userService.changeOnlineStatus(t)}genAvatar(){this.userService.genAvatar()}uploadAvatar(t){this.userService.uploadAvatar(t.target.files[0])}submitPassword(){return Xt(this,null,function*(){if(!this.oldPassword){this.layout.sendNotification("error","Configuration","Current password missing !");return}if(!this.newPassword){this.layout.sendNotification("error","Configuration","New password missing !");return}if(this.newPassword.length<8){this.layout.sendNotification("warning","Configuration","New password must have 8 characters minimum");return}let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.changePassword({oldPassword:this.oldPassword,newPassword:this.newPassword},t).subscribe({next:()=>{this.oldPassword="",this.newPassword="",this.layout.sendNotification("info","Configuration","Password has been updated")},error:o=>{this.oldPassword="",o.status===403?this.layout.sendNotification("error","Configuration","Unable to update password",o):this.layout.sendNotification("warning","Configuration","Current password does not match")}})})}updateNotification(t){this.userService.changeNotification({notification:t}).subscribe({next:()=>{this.user.notification=t,this.layout.sendNotification("info","Configuration","Notification preference updated")},error:o=>this.layout.sendNotification("error","Configuration","Unable to update notification preference",o)})}updateStorageIndexing(t){this.userService.changeStorageIndexing({storageIndexing:t}).subscribe({next:()=>{this.user.storageIndexing=t,this.layout.sendNotification("info","Configuration","Full-text search preference updated")},error:o=>this.layout.sendNotification("error","Configuration","Unable to update full-text search preference",o)})}clipBoardLink(){this.clipBoardService.copyFromContent(this.webdavUrl),this.layout.sendNotification("info","Link copied",this.webdavUrl)}updateEditorPreference(t){this.userService.setEditorProviderPreference(t)}enable2Fa(){return Xt(this,null,function*(){this.userService.init2Fa().subscribe({next:t=>{this.layout.openDialog(sm,"xs",{initialState:{qrDataUrl:t.qrDataUrl,secret:t.secret}},{keyboard:!1}).content.isValid.pipe(Dt(r=>r),pe(1)).subscribe(()=>{this.layout.sendNotification("success","Configuration","Two-Factor Authentication is enabled"),this.store.user.next(Se(re({},this.store.user.getValue()),{twoFaEnabled:!0}))})},error:t=>this.layout.sendNotification("error","Configuration","Two-Factor Authentication",t)})})}disable2Fa(){return Xt(this,null,function*(){let t=yield this.userService.auth2FaVerifyDialog(!0);t&&this.userService.disable2Fa({code:t.get(Xs),password:t.get(Zs)}).subscribe({next:()=>{this.layout.sendNotification("success","Configuration","Two-Factor Authentication is disabled"),this.store.user.next(Se(re({},this.store.user.getValue()),{twoFaEnabled:!1}))},error:o=>{this.layout.sendNotification("error","Configuration","Two-Factor Authentication",o)}})})}manageAppPasswords(){return Xt(this,null,function*(){let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.listAppPasswords(t).subscribe({next:o=>{this.layout.openDialog(lm,"md",{initialState:{appPasswords:o}}).content.nbAppPasswords.subscribe(p=>{this.store.user.next(Se(re({},this.store.user.getValue()),{appPasswords:p}))})},error:o=>this.layout.sendNotification("error","Configuration","Unable to get app passwords",o)})})}updateLanguage(t){this.user.language=t,this.layout.setLanguage(t).then(()=>this.layout.sendNotification("info","Configuration","Language updated"))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-account"]],decls:28,vars:7,consts:[["appAutoResize","",1,"profile-page",3,"resizeOffset"],[1,"container-fluid"],[1,"row"],[1,"col-lg-6","col-sm-12","p-2"],[1,"box","box-primary","box-solid","mb-0"],[1,"d-flex","box-header","align-items-center"],["l10nTranslate","",1,"box-title","me-5"],[1,"fs-xxxs"],[3,"passwordToCheck"],[1,"box-body"],[1,"row","mb-3"],["l10nTranslate","",1,"col-4","align-self-start"],[1,"col-auto"],[1,"form-select","form-select-sm",3,"ngModelChange","ngModel"],[3,"ngValue"],["l10nTranslate","",3,"ngValue"],[1,"box","box-primary","mb-0"],[1,"user-header"],[1,"d-flex","flex-column","justify-content-center","me-2"],[1,"avatar-xl"],["alt","",1,"avatar-img","profile-user-img",3,"src"],[1,"user-details"],[1,"mb-1"],[1,"fs-xxs","text-nowrap"],[1,"text-muted","fs-xxs"],[1,"form-select","form-select-sm","my-auto","mt-2",3,"ngModelChange","ngModel"],[1,"list-group","my-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],["l10nTranslate","",1,"me-auto","pe-4"],[1,"list-group-item","d-flex","align-items-center","justify-content-end","flex-wrap"],[1,"badge","bg-warning","rounded-pill","my-1"],[1,"badge","bg-secondary-alt","rounded-pill","ms-1","my-1"],[1,"me-auto","pe-4"],[1,"text-primary","text-end","cursor-pointer",3,"click"],[3,"icon"],[1,"mt-4",2,"border-width","1px"],["l10nTranslate","",1,"fw-500","fs-md"],[1,"badge","bg-gray-dark","rounded-pill","ms-1","my-1"],[1,"list-group-item","d-flex","align-items-center"],[1,"col-5"],[3,"item"],[1,"me-1",3,"icon"],["l10nTranslate",""],["l10nTranslate","",1,"badge","bg-gray-dark","rounded-pill","ms-1","my-1"],[1,"row","mt-3","mb-1"],["l10nTranslate","",1,"col-4","align-self-center","text-nowrap"],[1,"col-auto","ms-auto"],[1,"d-flex","align-items-center","justify-content-end","gap-3"],[1,"form-select","form-select-sm","w-auto",3,"ngModelChange","ngModel"],[1,"row","mb-4"],["l10nTranslate","",1,"text-muted","fs-xxs"],[1,"row","mb-1"],["l10nTranslate","",1,"col-4","text-nowrap","align-self-center"],[1,"d-flex","align-items-center","justify-content-end","form-check","form-switch","cursor-pointer"],[1,"d-flex"],["for","prefSwitchFullText",1,"form-check-label"],["id","prefSwitchFullText","type","checkbox","role","button",1,"form-check-input","ms-2",3,"ngModelChange","ngModel"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-success","me-1",3,"click"],["type","button",1,"btn-file-upload","btn","btn-xs","btn-secondary"],["accept","image/*","name","file","role","button","type","file",3,"change"],["l10nTranslate","",1,"col-4","text-nowrap","align-self-start"],["placeholder","current password",3,"passwordChange","password"],["placeholder","new password",3,"passwordChange","password","disabled","isRequired","passwordMinLength","showGenerator"],["type","button","l10nTranslate","",1,"d-flex","btn","btn-xs","btn-primary","text-nowrap",3,"click","disabled"],["l10nTranslate","",1,"col-4","align-self-start","text-nowrap"],["l10nTranslate","",1,"fw-500","mb-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-danger","ms-2",3,"disabled"],["l10nTranslate","",1,"fw-500","mt-3","mb-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","me-1",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-danger","ms-2",3,"click","disabled"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),C(3,nv,55,29,"div",3),a(4,"div",3)(5,"div",4)(6,"div",5)(7,"h3",6),d(8,"Configuration"),l(),a(9,"span",7),C(10,ov,1,1,"app-password-strength-bar",8),l()(),a(11,"div",9),C(12,rv,10,0,"div",10),a(13,"div",10)(14,"span",11),d(15,"Language"),l(),a(16,"div",12)(17,"select",13),ue("ngModelChange",function(u){return me(r.language,u)||(r.language=u),u}),k(18,av,2,2,"option",14,We),l()()(),a(20,"div",10)(21,"span",11),d(22,"Notification"),l(),a(23,"div",12)(24,"select",13),f("ngModelChange",function(u){return r.updateNotification(u)}),k(25,sv,2,2,"option",15,We),l()()(),C(27,dv,24,11),l()()()()()()),o&2&&(m("resizeOffset",40),s(3),x(r.user?3:-1),s(7),x(r.newPassword?10:-1),s(2),x(r.user.isUser?12:-1),s(5),de("ngModel",r.language),s(),M(r.languages),s(6),m("ngModel",r.user==null?null:r.user.notification),s(),M(r.allNotifications),s(2),x(r.user.isUser?27:-1))},dependencies:[ce,be,yi,bi,Pt,vi,xe,ye,vc,P,F,En,dr,Dn,Z,Fe,Je,Ee],encapsulation:2});let i=n;return i})();var Co=(function(i){return i.WIN="win",i.MAC="mac",i.LINUX="linux",i.NODE="node",i})(Co||{});function mv(i,n){if(i&1&&(a(0,"div",1)(1,"span")(2,"span",3),d(3,"Repository"),l(),d(4,":\xA0"),a(5,"span",4),d(6),l()(),a(7,"span",5),d(8,"Version:\xA0"),a(9,"b"),d(10),l()(),a(11,"span"),d(12),b(13,"amDateFormat"),l()()),i&2){let e=c();s(6),w(e.store.appStoreManifest().repository),s(4),w(e.store.appStoreManifest().version),s(2),w(E(13,3,e.store.appStoreManifest().date,"L"))}}function uv(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Windows"),l()),i&2){let e=c(3);m("icon",e.icons.faWindows)}}function _v(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Mac"),l()),i&2){let e=c(3);m("icon",e.icons.faApple)}}function fv(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Linux"),l()),i&2){let e=c(3);m("icon",e.icons.faLinux)}}function hv(i,n){if(i&1&&(_(0,"fa-icon",15),a(1,"h5",16),d(2,"Command Line"),l()),i&2){let e=c(3);m("icon",e.icons.faTerminal)}}function gv(i,n){if(i&1){let e=y();a(0,"div",17)(1,"span",3),d(2,"System requirements"),l(),a(3,"span"),d(4,":\xA0Node.js 22+"),l()(),a(5,"a",18),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.download(o,!0))}),a(6,"span",3),d(7,"Download tar.gz version"),l(),d(8,"\xA0 "),l()}}function Cv(i,n){if(i&1){let e=y();a(0,"div",17)(1,"span",3),d(2,"System requirements"),l(),a(3,"span"),d(4),l()(),a(5,"a",18),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.download(o,!0))}),d(6),l()}if(i&2){let e=c().$implicit,t=c(2);s(4),D(":\xA0",e===t.APP_STORE_OS.MAC?"Intel 64bit":"64bit"),s(2),w(e===t.APP_STORE_OS.MAC?"Download Apple Silicon ARM64 version":"Download ARM64 version")}}function xv(i,n){if(i&1){let e=y();a(0,"div",10)(1,"div",11)(2,"div",12),C(3,uv,3,1)(4,_v,3,1)(5,fv,3,1)(6,hv,3,1),a(7,"a",13),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.download(o))}),_(8,"fa-icon",14),a(9,"span",3),d(10,"Download"),l()(),a(11,"div"),C(12,gv,9,0)(13,Cv,7,2),l()()()()}if(i&2){let e,t=n.$implicit,o=c(2);s(3),x((e=t)===o.APP_STORE_OS.WIN?3:e===o.APP_STORE_OS.MAC?4:e===o.APP_STORE_OS.LINUX?5:e===o.APP_STORE_OS.NODE?6:-1),s(5),m("icon",o.icons.faDownload),s(4),x(t===o.APP_STORE_OS.NODE?12:13)}}function Sv(i,n){if(i&1&&(a(0,"div",2)(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9),k(5,xv,14,3,"div",10,We),l()()()()()),i&2){let e=c();m("resizeOffset",80),s(5),M(e.APP_STORE_PLATFORM_LIST)}}var pm=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faWindows:jc,faApple:Kc,faLinux:Qc,faDownload:Cn,faTerminal:vl},this.APP_STORE_OS=Co,this.APP_STORE_PLATFORM_LIST=Object.values(Co),this.layout=S(I),this.userService=S(oe),this.userService.checkAppStoreAvailability(),this.layout.setBreadcrumbIcon(Wt.APPS),this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.APPS}/${Qi.APPS}`,splicing:2,translating:!0,sameLink:!0})}download(t,o=!1){let r=this.store.appStoreManifest().platform[t].find(p=>t===Co.NODE?p.ext==="tar.gz"===o:p.arch==="arm64"===o);lr(r.url)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-applications"]],decls:3,vars:2,consts:[[1,"app-top-menu","px-4"],[1,"d-flex","flex-fill","align-items-center","fs-xs"],["appAutoResize","",1,"d-flex","flex-column","fs-sm","bg-theme",2,"height","100%",3,"resizeOffset"],["l10nTranslate",""],["l10nTranslate","",1,"fw-bold"],[1,"mx-auto"],[1,"d-flex"],[1,"col-12","p-4"],[1,"container","p-0"],[1,"row"],[1,"col-md-4"],[1,"card","text-bg-light","text-center","mb-3"],[1,"card-body"],[1,"btn","btn-sm","btn-primary","mt-3","mb-2",3,"click"],[1,"me-2",3,"icon"],["size","3x",2,"height","36px",3,"icon"],[1,"card-title","mt-3","mb-2"],[1,"small","text-muted","mb-1"],["role","button","l10nTranslate","",1,"small",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0),C(1,mv,14,6,"div",1),l(),C(2,Sv,7,1,"div",2)),o&2&&(s(),x(r.store.appStoreManifest()?1:-1),s(),x(r.store.appStoreManifest()?2:-1))},dependencies:[F,P,ce,Fe],encapsulation:2});let i=n;return i})();var dm=(()=>{let n=class n{constructor(){this.currentMemberIds=[],this.hasChanges=new ae,this.layout=S(I),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:Sl},this.userService=S(oe)}searchMembers(t){let o={search:t,onlyUsers:!0,usersRole:this.parentGroup.type===qi.USER?Zn.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(r=>r.id)]};return this.userService.searchMembers(o)}onSubmit(){this.submitted=!0,this.userService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(t=>t.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.parentGroup.name),this.layout.closeDialog()},error:t=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.parentGroup.name,t)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-group-add-users-dialog"]],inputs:{parentGroup:"parentGroup",currentMemberIds:"currentMemberIds"},outputs:{hasChanges:"hasChanges"},decls:16,vars:7,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"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),a(5,"h4",3)(6,"span",4),d(7,"Add members"),l()(),a(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(9,"div",6)(10,"app-user-search",7),ue("membersChange",function(u){return me(r.newMembers,u)||(r.newMembers=u),u}),l()(),a(11,"div",8)(12,"button",9),f("click",function(){return r.layout.closeDialog()}),d(13,"Cancel"),l(),a(14,"button",10),f("click",function(){return r.onSubmit()}),d(15," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faUserPlus),s(2),w(r.parentGroup.name),s(6),de("members",r.newMembers),m("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",r.searchMembers.bind(r)),s(4),m("disabled",r.submitted||!r.newMembers.length))},dependencies:[F,P,An],encapsulation:2});let i=n;return i})();function vv(i,n){if(i&1&&_(0,"img",9),i&2){let e=c();m("src",e.member.avatarUrl,ee)}}function yv(i,n){if(i&1&&_(0,"fa-icon",16),i&2){let e=c();L(e.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",e.icons.GROUPS)}}function bv(i,n){if(i&1&&(a(0,"div",7)(1,"span",17),d(2,"from the group"),l(),a(3,"span",11),d(4),b(5,"capitalize"),l()()),i&2){let e=c();s(4),w(G(5,1,e.parentGroup.name))}}function wv(i,n){i&1&&(a(0,"small",12),d(1,"Only the group will be deleted, the members will no longer be part of it."),l())}var mm=(()=>{let n=class n{constructor(){this.wasDeleted=new ae,this.submitted=!1,this.icons={GROUPS:Wt.GROUPS,faMinus:hn,faUserMinus:Ml},this.layout=S(I),this.userService=S(oe)}onSubmit(){this.submitted=!0;let t=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.userService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.userService.deletePersonalGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",t,this.member.name),this.onClose()},error:r=>{this.submitted=!1,this.layout.sendNotification("error",t,this.member.name,r)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-group-delete-dialog"]],inputs:{parentGroup:"parentGroup",member:"member"},outputs:{wasDeleted:"wasDeleted"},decls:26,vars:10,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"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"fw-bold","me-1"],["translate",""],[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-danger",3,"click","disabled"],[3,"icon"],["translate","",1,"mx-1"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),a(5,"h4",3)(6,"span",4),d(7),l()(),a(8,"button",5),f("click",function(){return r.onClose()}),l()(),a(9,"div",6)(10,"div",7)(11,"div",8),C(12,vv,1,1,"img",9)(13,yv,1,3,"fa-icon",10),l(),a(14,"span",11),d(15),b(16,"capitalize"),l(),a(17,"span",12),d(18,"will be removed"),l(),C(19,bv,6,3,"div",7),l(),C(20,wv,2,0,"small",12),l(),a(21,"div",13)(22,"button",14),f("click",function(){return r.onClose()}),d(23,"Cancel"),l(),a(24,"button",15),f("click",function(){return r.onSubmit()}),d(25," Remove "),l()()),o&2&&(s(2),m("icon",r.member.isUser?r.icons.faUserMinus:r.icons.faMinus),s(2),w(r.member.name),s(3),w(r.member.isUser?"Remove from group":"Delete group"),s(5),x(r.member.isUser?12:13),s(3),w(G(16,8,r.member.name)),s(4),x(r.member.isUser?19:-1),s(),x(r.member.isGroup?20:-1),s(4),m("disabled",r.submitted))},dependencies:[F,P,Dn],encapsulation:2});let i=n;return i})();var um=(()=>{let n=class n{constructor(){this.layout=S(I),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=Ki,this.icons={faUserPen:xl,faKey:It},this.userService=S(oe)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let t=this.isManager?Ki.MANAGER:Ki.MEMBER;this.userService.updateUserFromPersonalGroup(this.parentGroup.id,this.user.id,{role:t}).subscribe({next:()=>{this.user.setGroupRole(t),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,o)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-personal-group-edit-user-dialog"]],inputs:{parentGroup:"parentGroup",user:"user"},decls:25,vars:5,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"],[1,"d-flex","align-items-center"],[1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-1",3,"icon"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span"),d(4),l()(),a(5,"h4",3)(6,"span",4),d(7,"Edit user"),l()(),a(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),a(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ue("ngModelChange",function(u){return me(r.isManager,u)||(r.isManager=u),u}),l(),a(15,"span",4),d(16,"Set as group manager"),l(),_(17,"fa-icon",12),l()()()(),a(18,"small",4),d(19,"As a manager, the user will be able to manage the group and its members."),l()(),a(20,"div",13)(21,"button",14),f("click",function(){return r.layout.closeDialog()}),d(22,"Cancel"),l(),a(23,"button",15),f("click",function(){return r.onSubmit()}),d(24," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faUserPen),s(2),w(r.user.name),s(10),de("ngModel",r.isManager),s(3),m("icon",r.icons.faKey),s(6),m("disabled",r.submitted))},dependencies:[F,P,be,Pt,xe,ye],encapsulation:2});let i=n;return i})();var _m=(()=>{let n=class n{constructor(){this.wasLeft=new ae,this.submitted=!1,this.icons={GROUPS:Wt.GROUPS,faRightFromBracket:qo},this.layout=S(I),this.userService=S(oe)}onClose(){this.wasLeft.emit(!1),this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.userService.leavePersonalGroup(this.member.id).subscribe({next:()=>{this.wasLeft.emit(!0),this.layout.sendNotification("success","The group was left",this.member.name),this.onClose()},error:t=>{this.submitted=!1,this.layout.sendNotification("error","The group was not left",this.member.name,t)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-personal-group-leave-dialog"]],inputs:{member:"member"},outputs:{wasLeft:"wasLeft"},decls:19,vars:6,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],[3,"icon"],[1,"fw-bold","me-1"],[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(o,r){o&1&&(a(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),a(3,"span",3),d(4,"Leave group"),l()(),a(5,"button",4),f("click",function(){return r.onClose()}),l()(),a(6,"div",5)(7,"div",6)(8,"div",7),_(9,"fa-icon",8),l(),a(10,"span",9),d(11),l(),a(12,"span",3),d(13,"will be left, you will no longer be a member of this group"),l()()(),a(14,"div",10)(15,"button",11),f("click",function(){return r.onClose()}),d(16,"Cancel"),l(),a(17,"button",12),f("click",function(){return r.onSubmit()}),d(18," Confirm "),l()()),o&2&&(s(2),m("icon",r.icons.faRightFromBracket),s(7),L(r.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",r.icons.GROUPS),s(2),w(r.member.name),s(6),m("disabled",r.submitted))},dependencies:[F,P],encapsulation:2});let i=n;return i})();var Tv=["MainContextMenu"],Ev=["TargetContextMenu"],fm=(i,n)=>n.key,Av=(i,n)=>n.mid;function Dv(i,n){if(i&1){let e=y();a(0,"ul",19)(1,"li",20)(2,"a",21),f("click",function(){h(e);let o=c(2);return g(o.browse(o.selected))}),a(3,"span",22),_(4,"fa-icon",6),d(5,"See members"),l()()(),a(6,"li",20)(7,"a",21),f("click",function(){h(e);let o=c(2);return g(o.openLeaveGroupDialog())}),a(8,"span",22),_(9,"fa-icon",6),d(10,"Leave group"),l()()()()}if(i&2){let e=c(2);s(2),O("disabled",!e.selected),s(2),m("icon",e.icons.faUsersRectangle),s(3),O("disabled",!e.selected||!e.selected.isPersonalGroup),s(2),m("icon",e.icons.faRightFromBracket)}}function kv(i,n){if(i&1&&(a(0,"div",7)(1,"button",17),_(2,"fa-icon",6),l(),R(3,Dv,11,6,"ul",18),l()),i&2){let e=c();s(),O("disabled",!e.selected),s(),m("icon",e.icons.faEllipsis)}}function Mv(i,n){if(i&1&&_(0,"fa-icon",25),i&2){let e=c(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Fv(i,n){if(i&1){let e=y();a(0,"th",24),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.sortBy(o.key))}),d(1),C(2,Mv,1,2,"fa-icon",25),l()}if(i&2){let e=c().$implicit,t=c();L(e.value.class),B("width",e.value.width,"%"),O("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),s(),D(" ",e.value.label," "),s(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function Pv(i,n){if(i&1&&C(0,Fv,3,10,"th",23),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Iv(i,n){if(i&1&&_(0,"img",29),i&2){let e=c(4).$implicit;m("src",e.avatarUrl,ee)}}function Rv(i,n){if(i&1&&_(0,"fa-icon",6),i&2){let e=c(4).$implicit,t=c();L(e.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",t.icons.GROUPS)}}function Nv(i,n){if(i&1&&_(0,"fa-icon",33),i&2){let e=c(5);m("icon",e.icons.faKey)}}function Vv(i,n){if(i&1&&(a(0,"div",28),C(1,Iv,1,1,"img",29)(2,Rv,1,3,"fa-icon",30),a(3,"div",31)(4,"span",32),d(5),C(6,Nv,1,1,"fa-icon",33),l(),a(7,"span",34),d(8),l()()()),i&2){let e=c(3).$implicit;s(),x(e.isUser?1:2),s(4),D(" ",e.name," "),s(),x(e.isUser&&e.isGroupManager?6:-1),s(2),w(e.description)}}function Lv(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.type)}}function Ov(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(4).$implicit;s(),w(e.isGroupManager?"Manager":"Member")}}function Bv(i,n){if(i&1&&C(0,Lv,2,1,"span",22)(1,Ov,2,1,"span",22),i&2){let e=c(3).$implicit;x(e.isGroup?0:1)}}function Uv(i,n){if(i&1&&(a(0,"span",22),d(1),l()),i&2){let e=c(3).$implicit;s(),w(e.isGroupManager?"Manager":"Member")}}function Hv(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"joinCounts"),l()),i&2){let e=c(4).$implicit;s(),w(G(2,1,e.counts))}}function $v(i,n){if(i&1&&C(0,Hv,3,3,"span"),i&2){let e=c(3).$implicit;x(e.isGroup?0:-1)}}function zv(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;D(" ",E(1,1,e.createdAt,!0)," ")}}function Gv(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;D(" ",G(1,1,e.createdAt)," ")}}function Wv(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;D(" ",G(1,1,e.modifiedAt)," ")}}function jv(i,n){if(i&1&&(a(0,"td"),C(1,Vv,9,4,"div",28)(2,Bv,2,1)(3,Uv,2,1,"span",22)(4,$v,1,1)(5,zv,2,4)(6,Gv,2,3)(7,Wv,2,3),l()),i&2){let e,t=c().$implicit,o=c().$implicit;L(wt("",t.value.class," ",t.value.newly?"prop-newly-"+o[t.value.newly]:"")),B("width",t.value.width,"%"),O("text-align-center",t.value.textCenter),s(),x((e=t.key)==="name"?1:e==="type"?2:e==="role"?3:e==="members"?4:e==="memberSince"?5:e==="createdAt"?6:e==="modifiedAt"?7:-1)}}function Kv(i,n){if(i&1&&C(0,jv,8,9,"td",27),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Qv(i,n){if(i&1){let e=y();a(0,"tr",26),f("click",function(){let o=h(e).$implicit,r=c();return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c();return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c();return g(r.browse(o))}),k(1,Kv,1,1,null,null,fm),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c();O("selected",e.mid===(t.selected==null?null:t.selected.mid)),s(),M(E(3,2,t.tableHeaders,t.originalOrderKeyValue))}}function qv(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPlus),s(),D(" ",e.allowedAction.addGroup?"Personal group":"Add members")}}function Yv(i,n){if(i&1){let e=y();R(0,qv,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog(!0))})}}function Xv(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();s(),m("icon",e.icons.faArrowRotateRight)}}function Zv(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2,"See members"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faUsersRectangle)}}function Jv(i,n){if(i&1){let e=y();R(0,Zv,3,1,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.browse(o.selected))})}}function e2(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);s(),m("icon",e.icons.faPen),s(),D(" ",e.allowedAction.editGroup?"Edit group":"Edit user")}}function t2(i,n){if(i&1){let e=y();R(0,e2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog())})}}function i2(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);s(),m("icon",e.icons.faMinus),s(),D(" ",e.allowedAction.removeGroup?"Delete group":"Remove from group")}}function n2(i,n){if(i&1){let e=y();R(0,i2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog(!1,!0))})}}function o2(i,n){if(i&1&&(a(0,"span",22),_(1,"fa-icon",6),d(2,"Leave group"),l()),i&2){let e=c(2);s(),m("icon",e.icons.faRightFromBracket)}}function r2(i,n){if(i&1){let e=y();R(0,o2,3,1,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openLeaveGroupDialog())})}}var hm=(()=>{let n=class n{constructor(){this.locale=S($),this.originalOrderKeyValue=De,this.icons={GROUPS:Wt.GROUPS,faRotate:Ti,faPlus:Qe,faMinus:hn,faPen:mt,faArrowDown:_t,faArrowUp:dt,faKey:It,faArrowRotateRight:ut,faRightFromBracket:qo,faUsersRectangle:sl,faEllipsis:Vo},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},type:{label:"Type",width:10,textCenter:!0,class:"",show:!0,sortable:!0},role:{label:"Role",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!1,sortable:!0},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},memberSince:{label:"Member since",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!1,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modifiedAt:{label:"Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.isCurrentGroupManager=!1,this.allowedAction={addGroup:!1,addUsers:!1,removeUser:!1,removeGroup:!1,editUser:!1,editGroup:!1,leaveGroup:!1},this.loading=!1,this.selected=null,this.members=[],this.router=S(Ce),this.activatedRoute=S(Jt),this.layout=S(I),this.userService=S(oe),this.canCreatePersonalGroup=this.userService.userHavePermission(ft.PERSONAL_GROUPS_ADMIN),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],role:[{prop:"isGroupManager",type:"number"}],createdAt:[{prop:"createdAt",type:"date"}],modifiedAt:[{prop:"modifiedAt",type:"date"}]},this.sortTable=new Ut(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(t=>this.setEnv(t.routes)),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(Wt.GROUPS)}setEnv(t){let o;t.length?(o=t[t.length-1].path,this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.GROUPS}/${Qi.GROUPS}${sr(t)}`,splicing:2,translating:!0,sameLink:!0,mutateLevel:{1:{setUrl:!0}}})):this.layout.setBreadcrumbNav({url:`/${Ae.BASE}/${Ae.GROUPS}/${Qi.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(o)}refresh(){this.loadGroups(this.currentGroup?.name)}loadGroups(t){this.loading=!0,this.onSelect(),this.userService.browseGroup(t).subscribe({next:o=>{this.tableHeaders.members.show=!t,this.tableHeaders.role.show=!t,this.tableHeaders.modifiedAt.show=!t,this.tableHeaders.createdAt.show=!t,this.tableHeaders.memberSince.show=!!t,this.currentGroup=o.parentGroup,this.isCurrentGroupManager=this.currentGroup?.role===Ki.MANAGER,this.sortBy(this.sortTable.sortParam.column,!1,o.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:o=>{this.members=[],this.layout.sendNotification("error","Groups",o.error.message),this.onSelect(),this.loading=!1}})}browse(t){t.isGroup&&this.router.navigate([t.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(t=null){this.selected=t,this.selected?this.allowedAction={addGroup:!this.currentGroup&&this.canCreatePersonalGroup,addUsers:!!this.currentGroup&&this.isCurrentGroupManager,removeUser:!!this.currentGroup&&this.selected.isUser&&this.isCurrentGroupManager,removeGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isGroupManager&&this.selected.isPersonalGroup,editUser:!!this.currentGroup&&this.selected.isUser&&this.isCurrentGroupManager&&this.currentGroup.type===qi.PERSONAL,editGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isGroupManager&&this.selected.isPersonalGroup,leaveGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isPersonalGroup}:this.allowedAction={addGroup:!this.currentGroup&&this.canCreatePersonalGroup,addUsers:!!this.currentGroup&&this.isCurrentGroupManager,removeUser:!1,removeGroup:!1,editUser:!1,editGroup:!1,leaveGroup:!1}}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}sortBy(t,o=!0,r){this.members=this.sortTable.sortBy(t,o,r||this.members)}openDialog(t=!1,o=!1){t?this.currentGroup?this.layout.openDialog(dm,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(p=>p.isUser).map(p=>p.id)}}).content.hasChanges.pipe(Dt(p=>p),pe(1)).subscribe(()=>this.refresh()):this.layout.openDialog(ba,"md").content.groupChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="add"&&(v.setGroupRole(Ki.MANAGER),v.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(v)),this.onSelect(v))}):o?this.layout.openDialog(mm,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(Dt(p=>p),pe(1)).subscribe(()=>{this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()}):this.selected.isGroup?this.layout.openDialog(ba,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(pe(1)).subscribe(p=>{let[u,v]=p;u==="update"&&(this.selected=Object.assign(this.selected,{name:v.name,description:v.description,modifiedAt:v.modifiedAt}))}):this.layout.openDialog(um,"md",{initialState:{parentGroup:this.currentGroup,user:this.selected}})}openLeaveGroupDialog(){this.layout.openDialog(_m,"md",{initialState:{member:this.selected}}).content.wasLeft.pipe(pe(1)).subscribe(o=>{o&&(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(r=>r.id!==this.selected.id)),this.onSelect())})}focusOn(t){let o=this.members.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-groups"]],viewQuery:function(o,r){if(o&1&&(Y(Xe,5),Y(Ve,7),Y(Tv,7),Y(Ev,7)),o&2){let p;W(p=j())&&(r.scrollView=p.first),W(p=j())&&(r.inputFilter=p.first),W(p=j())&&(r.mainContextMenu=p.first),W(p=j())&&(r.targetContextMenu=p.first)}},decls:41,vars:43,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"execute"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["l10nTranslate",""],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"d-flex","flex-column"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,r){if(o&1){let p=y();a(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.refresh())}),_(3,"fa-icon",4),l(),a(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openDialog(!0))}),_(6,"fa-icon",6),l(),a(7,"button",5),b(8,"translate"),f("click",function(){return h(p),g(r.openDialog(!1,!0))}),_(9,"fa-icon",6),l(),a(10,"button",5),b(11,"translate"),f("click",function(){return h(p),g(r.openDialog())}),_(12,"fa-icon",6),l(),C(13,kv,4,3,"div",7),_(14,"app-input-filter",8),l(),a(15,"table",9)(16,"thead")(17,"tr"),k(18,Pv,1,1,null,null,fm),b(20,"keyvalue"),l()()(),a(21,"app-virtual-scroll",10),b(22,"searchFilter"),f("contextmenu",function(v){return h(p),g(r.onContextMenu(v))}),a(23,"table",9)(24,"tbody",11),k(25,Qv,4,5,"tr",12,Av),l()()(),a(27,"div",13)(28,"span",14),d(29),b(30,"translate"),l()(),a(31,"context-menu",null,0),C(33,Yv,1,0,null,15),R(34,Xv,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.refresh())}),l(),a(35,"context-menu",null,1),C(37,Jv,1,0,null,15),C(38,t2,1,0,null,15),C(39,n2,1,0,null,15),C(40,r2,1,0,null,15),l()}o&2&&(s(),m("tooltip",E(2,22,"Refresh",r.locale.language)),s(2),m("icon",r.icons.faRotate)("animation",r.loading?"spin":null),s(),m("disabled",!r.allowedAction.addGroup&&!r.allowedAction.addUsers)("tooltip",E(5,25,r.allowedAction.addGroup?"New personal group":"Add members",r.locale.language)),s(2),m("icon",r.icons.faPlus),s(),m("disabled",!r.allowedAction.removeGroup&&!r.allowedAction.removeUser)("tooltip",E(8,28,r.allowedAction.removeGroup?"Delete group":"Remove from group",r.locale.language)),s(2),m("icon",r.icons.faMinus),s(),m("disabled",!r.allowedAction.editGroup&&!r.allowedAction.editUser)("tooltip",E(11,31,r.allowedAction.editGroup?"Edit group":"Edit user",r.locale.language)),s(2),m("icon",r.icons.faPen),s(),x(r.currentGroup?-1:13),s(5),M(E(20,34,r.tableHeaders,r.originalOrderKeyValue)),s(3),m("bufferAmount",5)("items",E(22,37,r.members,r.inputFilter.search())),s(4),M(r.scrollView==null?null:r.scrollView.viewPortItems),s(4),Re("",r.members.length," ",E(30,40,"groups",r.locale.language)),s(4),x(r.allowedAction.addGroup||r.allowedAction.addUsers?33:-1),s(4),x(r.selected!=null&&r.selected.isGroup?37:-1),s(),x(r.allowedAction.editGroup||r.allowedAction.editUser?38:-1),s(),x(r.allowedAction.removeGroup||r.allowedAction.removeUser?39:-1),s(),x(r.allowedAction.leaveGroup?40:-1))},dependencies:[Ot,Lt,Vt,F,P,Ve,Xe,Me,Fi,Ii,Pi,nt,Ee,Z,gt,oi,Je],encapsulation:2});let i=n;return i})();var gm=()=>!S(oe).user.isLink,Cm=()=>S(oe).user.isUser;var xm=[{path:Ae.BASE,pathMatch:"prefix",canActivate:[gm],children:[{path:Ae.ACCOUNT,component:cm},{path:Ae.CLIENTS,canActivate:[tm],loadComponent:()=>import("./chunk-QTPIEEZW.js").then(i=>i.SyncClientsComponent)},{path:Ae.GROUPS,children:[{path:"**",resolve:{routes:_o},component:hm}]},{path:Ae.GUESTS,canActivate:[Cm],loadComponent:()=>import("./chunk-J7474P3L.js").then(i=>i.UserGuestsComponent)},{path:Ae.APPS,component:pm},{path:"**",redirectTo:Ae.ACCOUNT}]}];var as=(i,n)=>S(jt).checkUserAuthAndLoad(n.url),Sm=()=>S(jt).isLogged()?(S(Ce).navigate([]).catch(console.error),!1):!0;function a2(i,n){if(i&1&&(a(0,"span",17),_(1,"fa-icon",18),l(),_(2,"input",19),b(3,"translate")),i&2){let e=c(2);s(),m("icon",e.icons.faKey),s(),m("placeholder",E(3,2,"Recovery code",e.locale.language))}}function s2(i,n){if(i&1&&(a(0,"span",17),_(1,"fa-icon",18),l(),_(2,"input",20),b(3,"translate")),i&2){let e=c(2);s(),m("icon",e.icons.faQrcode),s(),m("placeholder",E(3,3,"Authentication code",e.locale.language))("maxlength",e.twoFaCodelength)}}function l2(i,n){if(i&1){let e=y();a(0,"p",7),d(1),l(),a(2,"form",8),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit2Fa())}),a(3,"div",9),C(4,a2,4,5)(5,s2,4,6),l(),a(6,"div",10)(7,"div",11)(8,"label",12),_(9,"input",13),a(10,"span",7),d(11,"Use a recovery code"),l()()()(),a(12,"div",14)(13,"button",15),f("click",function(){h(e);let o=c();return g(o.onCancel2Fa())}),d(14,"Cancel"),l(),a(15,"button",16),d(16," Confirm "),l()()()}if(i&2){let e=c();L(X("fs-sm mb-3 ",e.hasError?"text-danger":"text-white-50")),s(),w(e.hasError||"Two-Factor Authentication"),s(),m("formGroup",e.twoFaForm),s(2),x(e.twoFaForm.value.isRecoveryCode?4:5),s(11),m("disabled",e.twoFaForm.value.isRecoveryCode?e.twoFaForm.controls.recoveryCode.invalid:e.twoFaForm.controls.totpCode.invalid||e.submitted)}}function c2(i,n){if(i&1){let e=y();a(0,"form",8),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit())}),a(1,"p",7),d(2),l(),a(3,"div",21)(4,"span",17),_(5,"fa-icon",18),l(),_(6,"input",22),b(7,"translate"),l(),a(8,"div",23)(9,"span",17),_(10,"fa-icon",18),l(),_(11,"input",24),b(12,"translate"),l(),a(13,"div",25)(14,"button",26),d(15,"Sign in"),l()()()}if(i&2){let e=c();m("formGroup",e.loginForm),s(),L(X("fs-sm mb-3 ",e.hasError?"text-danger":"text-white-50")),s(),w(e.hasError||"Sign-in to your account"),s(3),m("icon",e.icons.faUserAlt),s(),m("placeholder",E(7,10,"Login or Email",e.locale.language)),s(4),m("icon",e.icons.faLock),s(),m("placeholder",E(12,13,"Password",e.locale.language)),s(3),m("disabled",e.loginForm.invalid||e.submitted)}}var vm=(()=>{let n=class n{constructor(){this.locale=S($),this.icons={faLock:ii,faUserAlt:Xo,faKey:It,faQrcode:Vl},this.twoFaCodelength=pn,this.logoUrl=xr,this.hasError=null,this.submitted=!1,this.twoFaVerify=!1,this.fb=S(fn),this.loginForm=this.fb.group({username:this.fb.control("",[Et.required]),password:this.fb.control("",[Et.required])}),this.twoFaForm=this.fb.group({totpCode:this.fb.control("",[Et.required,Et.pattern(new RegExp(`^\\d{${pn}}$`))]),recoveryCode:this.fb.control("",[Et.required,Et.minLength(8)]),isRecoveryCode:this.fb.control(!1)}),this.router=S(Ce),this.auth=S(jt)}onSubmit(){this.submitted=!0,this.auth.login(this.loginForm.value.username,this.loginForm.value.password).pipe(wo(()=>setTimeout(()=>this.submitted=!1,1500))).subscribe({next:t=>this.isLogged(t),error:t=>this.isLogged({success:!1,message:t.error?t.error.message:t})})}onSubmit2Fa(){this.submitted=!0;let t={code:this.twoFaForm.value.isRecoveryCode?this.twoFaForm.value.recoveryCode:this.twoFaForm.value.totpCode,isRecoveryCode:this.twoFaForm.value.isRecoveryCode};this.auth.loginWith2Fa(t).subscribe({next:o=>this.is2FaVerified(o),error:o=>this.is2FaVerified({success:!1,message:o.error?o.error.message:o})})}onCancel2Fa(){this.auth.logout(),this.twoFaForm.patchValue({totpCode:"",recoveryCode:""}),this.twoFaVerify=!1,this.submitted=!1,this.hasError=null}is2FaVerified(t){t.success?(this.auth.initUserFromResponse(t),this.isLogged({success:!0,message:t.message})):(this.hasError=t.message||"Unable to verify code",this.submitted=!1),this.twoFaForm.patchValue({totpCode:"",recoveryCode:""})}isLogged(t){t.success?(this.hasError=null,t.twoFaEnabled?this.twoFaVerify=!0:this.auth.returnUrl?this.router.navigateByUrl(this.auth.returnUrl).then(()=>{this.auth.returnUrl=null,this.loginForm.reset()}):this.router.navigate([mi.BASE]).then(()=>this.loginForm.reset())):(this.hasError=t.message||"Server connection error",this.submitted=!1),this.loginForm.patchValue({password:""})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-auth"]],decls:8,vars:2,consts:[[1,"app-auth"],[1,"background"],[1,"content"],[1,"header"],["alt","","height","65",3,"src"],[1,"body"],[3,"formGroup"],["l10nTranslate",""],[3,"ngSubmit","formGroup"],[1,"input-group","mt-2","mb-4"],[1,"d-flex","text-white-50","fs-xs"],[1,"form-check","form-switch","form-check-inline"],["for","useRecovery",1,"form-check-label"],["formControlName","isRecoveryCode","id","useRecovery","type","checkbox",1,"form-check-input"],[1,"d-flex","mt-4"],["type","button","l10nTranslate","",1,"btn","btn-secondary","px-4","w-50","me-3",3,"click"],["type","submit","l10nTranslate","",1,"btn","btn-primary","px-4","w-50",3,"disabled"],[1,"input-group-text"],[3,"icon"],["appAutofocus","","type","password","formControlName","recoveryCode",1,"form-control",3,"placeholder"],["appAutofocus","","type","text","formControlName","totpCode","inputmode","numeric","autocomplete","one-time-code",1,"form-control",3,"placeholder","maxlength"],[1,"input-group","my-2"],["appAutofocus","","formControlName","username","type","text",1,"form-control",3,"placeholder"],[1,"input-group","mb-4"],["formControlName","password","type","password",1,"form-control",3,"placeholder"],[1,"d-flex"],["type","submit","l10nTranslate","",1,"btn","btn-primary","px-4","w-100",3,"disabled"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),_(4,"img",4),l(),a(5,"div",5),C(6,l2,17,7)(7,c2,16,16,"form",6),l()()()()),o&2&&(s(4),m("src",r.logoUrl,ee),s(2),x(r.twoFaVerify?6:7))},dependencies:[Ye,wi,mn,je,Pt,xe,dn,Io,un,_n,F,P,Z],encapsulation:2});let i=n;return i})();var ym=[{path:ya.BASE,canActivate:[Sm],children:[{path:ya.LOGIN,component:vm}]}];var p2=()=>({matrixParams:"ignored",queryParams:"ignored",paths:"exact",fragment:"ignored"});function d2(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faChevronRight)("fixedWidth",!1)}}function m2(i,n){if(i&1&&_(0,"fa-icon",5),i&2){let e=c(2);m("icon",e.breadcrumbIcon)}}function u2(i,n){if(i&1&&(C(0,d2,1,2,"fa-icon",2),a(1,"li",3)(2,"a",4),C(3,m2,1,1,"fa-icon",5),a(4,"span"),d(5),l()()()),i&2){let e=n.$implicit,t=n.$index,o=c();x(t!==0?0:-1),s(),m("routerLinkActiveOptions",Tt(5,p2)),s(),m("routerLink",e.link),s(),x(t===0&&o.breadcrumbIcon?3:-1),s(2),w(e.title)}}var bm=(()=>{let n=class n{constructor(){this.icons={faChevronRight:gl},this.breadcrumbIcon=wl,this.levels=[],this.layout=S(I),this.subscriptions=[],this.subscriptions.push(this.layout.breadcrumbNav.subscribe(t=>this.updateNav(t))),this.subscriptions.push(this.layout.breadcrumbIcon.subscribe(t=>this.breadcrumbIcon=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}updateNav(t){let o=t.splicing||1,r=t.translating||!1,p=t.sameLink||!1,u=t.firstLink||null,v=t.mutateLevel||null,T=t.url.split("/").slice(1);if(this.levels=[],T.length>=1&&T[0]){let N=`/${T.splice(0,o).join("/")}`;this.levels.push({link:u||N,title:""});for(let{index:V,item:le}of T.filter(q=>q!=="").map((q,K)=>({index:K,item:q}))){let q=le.split("?")[0];if((!p||v&&v[V]&&v[V].setUrl)&&(N+="/"+q),v&&v[V]){if(v[V].hide)continue;v[V].setTitle&&(q=v[V].translateTitle?this.layout.translateString(v[V].setTitle):v[V].setTitle)}else r&&(q=this.layout.translateString(q));this.levels.push({link:N,title:q})}}else this.levels.push({link:["/"],title:""})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-breadcrumb"]],decls:4,vars:0,consts:[[1,"breadcrumb"],[1,"breadcrumb-content"],[3,"icon","fixedWidth"],["routerLinkActive","active",3,"routerLinkActiveOptions"],[3,"routerLink"],[3,"icon"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),k(2,u2,6,6,null,null,We),l()()),o&2&&(s(2),M(r.levels))},dependencies:[cn,Ws,F],encapsulation:2});let i=n;return i})();function _2(i,n){if(i&1&&_(0,"img",8),i&2){let e=c();m("src",e.userAvatar,ee)("width",28)("height",28)}}var wm=(()=>{let n=class n{constructor(){this.allOnlineStatus=ki,this.icons={faAngleLeft:Ho,faAngleRight:Ko},this.userAvatar=null,this.location=S(Mo),this.layout=S(I),this.store=S(te),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}openSidebarUser(){this.layout.showRSideBarTab(fe.PROFILE)}navigateTo(t){t==="back"?this.location.back():this.location.forward()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-navbar"]],decls:13,vars:6,consts:[[1,"main-header"],[1,"navbar","navbar-content"],["role","button",1,"d-sm-none","navbar-button",3,"click"],[3,"icon"],[1,"navbar-breadcrumb"],[1,"navbar-right-side"],[1,"menu",3,"click"],[1,"avatar"],["alt","",1,"avatar-img","bg-gray-light-important",3,"src","width","height"]],template:function(o,r){o&1&&(a(0,"header",0)(1,"nav",1)(2,"a",2),f("click",function(){return r.navigateTo("back")}),_(3,"fa-icon",3),l(),a(4,"a",2),f("click",function(){return r.navigateTo("next")}),_(5,"fa-icon",3),l(),a(6,"div",4),_(7,"app-breadcrumb"),l(),a(8,"div",5)(9,"div",6),f("click",function(){return r.openSidebarUser()}),a(10,"div",7),C(11,_2,1,3,"img",8),_(12,"span"),l()()()()()),o&2&&(s(3),m("icon",r.icons.faAngleLeft),s(2),m("icon",r.icons.faAngleRight),s(6),x(r.userAvatar?11:-1),s(),L(X("avatar-",r.allOnlineStatus[r.user==null?null:r.user.onlineStatus])))},dependencies:[bm,F],encapsulation:2});let i=n;return i})();var f2=["sidebar"],h2=(i,n)=>({menu:i,previousLevel:n}),g2=i=>({menu:i}),C2=i=>({menu:i,isMenuIcon:!0}),x2=(i,n)=>({mainMenu:i,menu:n}),sa=i=>({menu:i,isMenuIcon:!1}),xo=(i,n)=>n.title;function S2(i,n){if(i&1&&Ie(0,19),i&2){let e=c(),t=e.$implicit,o=e.$index,r=c(),p=Be(28);m("ngTemplateOutlet",p)("ngTemplateOutletContext",Qn(2,h2,t,o===0?0:r.appsMenu.submenus[o-1].level))}}function v2(i,n){if(i&1&&C(0,S2,1,5,"ng-container",19),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function y2(i,n){if(i&1){let e=y();a(0,"a",8),f("click",function(){h(e);let o=c();return g(o.logOut())})("mouseenter",function(){h(e);let o=c();return g(o.onHoverIconsMenu(!0,{title:"logout"}))})("mouseleave",function(){h(e);let o=c();return g(o.onHoverIconsMenu(!1,{title:"logout"}))}),_(1,"fa-icon",20),l()}if(i&2){let e=c();s(),m("icon",e.icons.faUserSecret)}}function b2(i,n){if(i&1&&Ie(0,19),i&2){let e=c().$implicit;c();let t=Be(30);m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(2,g2,e))}}function w2(i,n){if(i&1&&C(0,b2,1,4,"ng-container",19),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function T2(i,n){i&1&&Ie(0)}function E2(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){h(e);let o=c();return g(o.checkComponentRoute())}),R(1,T2,1,0,"ng-container",22),l()}if(i&2){let e=c();m("resizeOffset",40),s(),m("ngComponentOutlet",e.currentMenu.component)}}function A2(i,n){if(i&1&&(a(0,"span",24),d(1),l()),i&2){let e=c().menu;s(),w(e.title)}}function D2(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c(2).menu;L(X("badge bg-",e.count.level," rounded-pill")),s(),w(n)}}function k2(i,n){if(i&1&&(a(0,"span"),C(1,D2,2,4,"span",25),b(2,"async"),l()),i&2){let e,t=c(),o=t.menu,r=t.isMenuIcon;L(r?"menu-badge-icon":"menu-badge"),s(),x((e=G(2,3,o.count.value))?1:-1,e)}}function M2(i,n){if(i&1&&(_(0,"fa-icon",23),C(1,A2,2,1,"span",24),C(2,k2,3,5,"span",25)),i&2){let e=n.menu,t=n.isMenuIcon;m("icon",e.icon)("animation",e.iconAnimated?"spin":null),s(),x(t?-1:1),s(),x(e.count?2:-1)}}function F2(i,n){if(i&1&&Ie(0,19),i&2){let e=c().$implicit,t=c(2).menu;c();let o=Be(32);m("ngTemplateOutlet",o)("ngTemplateOutletContext",Qn(2,x2,t,e))}}function P2(i,n){if(i&1&&C(0,F2,1,5,"ng-container",19),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function I2(i,n){i&1&&Ie(0)}function R2(i,n){if(i&1){let e=y();a(0,"div",21),f("click",function(){h(e);let o=c(2).menu,r=c();return g(r.checkComponentRoute(o))}),R(1,I2,1,0,"ng-container",22),l()}if(i&2){let e=c(3);m("resizeOffset",40),s(),m("ngComponentOutlet",e.currentMenu.component)}}function N2(i,n){if(i&1&&(a(0,"div"),k(1,P2,1,1,null,null,xo),C(3,R2,2,2,"div",17),l()),i&2){let e=c().menu,t=c();L(X("menu-mini ",e.level<9?"align-self-start":"align-self-end")),s(),M(e.submenus),s(2),x(t.currentMenu.component?3:-1)}}function V2(i,n){if(i&1){let e=y();a(0,"a",26),f("mouseenter",function(){let o=h(e).menu,r=c();return g(r.onHoverIconsMenu(!0,o))})("mouseleave",function(){let o=h(e).menu,r=c();return g(r.onHoverIconsMenu(!1,o))})("click",function(){let o=h(e).menu,r=c();return g(r.checkMenuContext(o))}),Ie(1,19),C(2,N2,4,4,"div",25),l()}if(i&2){let e=n.menu,t=n.previousLevel;c();let o=Be(26);O("mt-auto",t<9&&e.level>9)("active",e.isActive),s(),m("ngTemplateOutlet",o)("ngTemplateOutletContext",Ne(7,C2,e)),s(),x(e.miniOpened?2:-1)}}function L2(i,n){if(i&1&&(a(0,"div",29)(1,"a",27),Ie(2,19),l()()),i&2){let e=c().$implicit,t=c(2).menu;c();let o=Be(26);L(t.isActive?"collapse-show":"collapse-hide"),O("active",e.isActive),s(),m("routerLink",e.link),s(),m("ngTemplateOutlet",o)("ngTemplateOutletContext",Ne(7,sa,e))}}function O2(i,n){if(i&1&&C(0,L2,3,9,"div",28),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function B2(i,n){if(i&1&&k(0,O2,1,1,null,null,xo),i&2){let e=c().menu;M(e.submenus)}}function U2(i,n){if(i&1&&(a(0,"div",7)(1,"a",27),Ie(2,19),l()(),C(3,B2,2,0)),i&2){let e=n.menu;c();let t=Be(26);O("active",e.isActive),s(),m("routerLink",e.link),s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(6,sa,e)),s(),x(e.submenus!=null&&e.submenus.length?3:-1)}}function H2(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(o){h(e);let r=c().$implicit,p=c(2).mainMenu,u=c();return g(u.onMiniMenuNavigate(o,[r.link],p))}),Ie(1,19),l()}if(i&2){let e=c().$implicit;c(3);let t=Be(26);O("active",e.isActive),s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(4,sa,e))}}function $2(i,n){if(i&1&&C(0,H2,2,6,"a",31),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function z2(i,n){if(i&1&&k(0,$2,1,1,null,null,xo),i&2){let e=c().menu;M(e.submenus)}}function G2(i,n){if(i&1){let e=y();a(0,"a",30),f("click",function(o){let r=h(e),p=r.mainMenu,u=r.menu,v=c();return g(v.onMiniMenuNavigate(o,[u.link],p))}),Ie(1,19),l(),C(2,z2,2,0)}if(i&2){let e=n.menu;c();let t=Be(26);O("active",e.isActive),s(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Ne(5,sa,e)),s(),x(e.submenus!=null&&e.submenus.length?2:-1)}}var Tm=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faAngleLeft:Ho,faAngleRight:Ko,faUserSecret:tr},this.logoIconUrl=kc,this.leftSideBarIsOpen=!1,this.appsMenu=Kl,this.router=S(Ce),this.renderer=S(pt),this.location=S(Mo),this.authService=S(jt),this.layout=S(I),this.userService=S(oe),this.subscriptions=[],this.menuAppsHovered=!1,this.menuIconsHovered=!1,this.menuAppsHoveredTimeout=null,this.menuIconsStopPropagation=!1,this.appName=Wl,this.appVersion=jl,this.appsMenu.submenus=[uc,id,lc,Bl,Ql],Sc("number",this.appsMenu.submenus,"level",!0),this.subscriptions.push(this.store.user.pipe(Dt(t=>!!t)).subscribe(()=>this.loadMenus())),this.subscriptions.push(this.layout.leftSideBarIsOpen.subscribe(t=>this.leftSideBarIsOpen=t)),this.subscriptions.push(this.router.events.pipe(Dt(t=>t instanceof Gs)).subscribe(t=>this.updateUrl(t.urlAfterRedirects)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}loadMenus(){this.userService.setMenusVisibility(this.appsMenu.submenus),this.updateUrl(this.router.url)}logOut(){this.authService.logout(!0)}navigateTo(t){t==="back"?this.location.back():this.location.forward()}toggleSideBar(){for(let t of this.appsMenu.submenus)t.miniOpened=!1;this.leftSideBarIsOpen&&this.renderer.removeStyle(this.sidebar.nativeElement,"z-index"),this.layout.toggleLSideBar()}checkMenuContext(t){!this.leftSideBarIsOpen&&this.layout.isSmallerScreen()&&t.submenus?.length?this.onHoverIconsMenu(!t.miniOpened,t):this.navigateToUrl([t.link])}onMiniMenuNavigate(t,o,r=null){t.stopPropagation(),this.navigateToUrl(o,r)}checkComponentRoute(t){this.currentMenu.link!==this.currentUrl&&this.router.navigate([this.currentMenu.link]).catch(console.error),t&&(t.miniOpened=!1)}onHoverAppsMenu(t){this.leftSideBarIsOpen&&(this.menuAppsHovered=t,t?this.menuAppsHoveredTimeout=setTimeout(()=>this.setActiveMenu(),5e3):(clearTimeout(this.menuAppsHoveredTimeout),this.checkHoveredMenu()))}onHoverIconsMenu(t,o,r=!1){if(!(this.leftSideBarIsOpen&&this.menuIconsStopPropagation))if((t&&o.submenus?.length||o.component)&&(this.currentMenu=o),this.leftSideBarIsOpen||r)this.menuIconsHovered=t,t?this.updateDynamicTitle(o.title):this.checkHoveredMenu();else{t?this.renderer.setStyle(this.sidebar.nativeElement,"z-index","1030"):this.renderer.removeStyle(this.sidebar.nativeElement,"z-index");for(let p of this.appsMenu.submenus.filter(u=>u.title!==o.title))p.miniOpened=!1;o.miniOpened=!!t}}checkHoveredMenu(){setTimeout(()=>{!this.menuIconsHovered&&!this.menuAppsHovered&&this.setActiveMenu()},50)}navigateToUrl(t,o=null){this.router.navigate(t).then(()=>{o&&o.miniOpened&&(o.miniOpened=!1)})}updateUrl(t){this.currentUrl=t.substring(1);for(let o of this.appsMenu.submenus)if(o.isActive=!!(!o.hide&&(o.link===this.currentUrl||o.matchLink&&o.matchLink.test(this.currentUrl))),o.isActive&&(this.currentMenu=o),o.submenus?.length){for(let r of o.submenus)if(r.isActive=o.isActive&&(r.link===this.currentUrl||!!r.matchLink&&r.matchLink.test(this.currentUrl)),r.submenus?.length)for(let p of r.submenus)p.isActive=this.currentUrl.startsWith(p.link)}this.currentMenu??=this.appsMenu.submenus[0],this.updateDynamicTitle(),this.menuIconsStopPropagation=!0,setTimeout(()=>this.menuIconsStopPropagation=!1,500)}setActiveMenu(){let t=this.appsMenu.submenus.find(o=>o.isActive);t&&(this.currentMenu=t,this.updateDynamicTitle(this.currentMenu.title))}updateDynamicTitle(t){this.dynamicTitle=this.layout.translateString(t!==void 0?t:this.currentMenu?this.currentMenu.title:this.appsMenu.title)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-sidebar-left"]],viewQuery:function(o,r){if(o&1&&Y(f2,7),o&2){let p;W(p=j())&&(r.sidebar=p.first)}},decls:33,vars:7,consts:[["sidebar",""],["MenuTemplate",""],["sidebarMenuIcons",""],["MenuApps",""],["MiniMenuApps",""],[1,"left-sidebar"],[1,"sidebar-apps-icons"],[1,"menu"],[3,"click","mouseenter","mouseleave"],[1,"logo-container"],["alt","",3,"src"],[1,"sidebar-apps-menus",3,"mouseenter","mouseleave"],[1,"menu-title",3,"mouseenter"],[1,"sidebar-title"],["role","button",1,"sidebar-btn",3,"click","icon"],[1,"menus-content"],[1,"menus-group"],["appAutoResize","",3,"resizeOffset"],[1,"sidebar-apps-footer"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"icon"],["appAutoResize","",3,"click","resizeOffset"],[4,"ngComponentOutlet"],[3,"icon","animation"],["l10nTranslate",""],[3,"class"],[3,"mouseenter","mouseleave","click"],[3,"routerLink"],[1,"menu","submenu",3,"active","class"],[1,"menu","submenu"],[3,"click"],[3,"active"]],template:function(o,r){if(o&1){let p=y();a(0,"aside",5,0)(2,"div",6)(3,"div",7)(4,"a",8),f("click",function(){return h(p),g(r.toggleSideBar())})("mouseenter",function(){return h(p),g(r.onHoverIconsMenu(!0,{title:r.appName},!0))})("mouseleave",function(){return h(p),g(r.onHoverIconsMenu(!1,{title:r.appName},!0))}),a(5,"div",9),_(6,"img",10),l()(),k(7,v2,1,1,null,null,xo),C(9,y2,2,1,"a"),l()(),a(10,"div",11),f("mouseenter",function(){return h(p),g(r.onHoverAppsMenu(!0))})("mouseleave",function(){return h(p),g(r.onHoverAppsMenu(!1))}),a(11,"div",12),f("mouseenter",function(){return h(p),g(r.onHoverAppsMenu(!1))}),a(12,"a")(13,"span",13),d(14),l(),a(15,"fa-icon",14),f("click",function(){return h(p),g(r.navigateTo("back"))}),l(),a(16,"fa-icon",14),f("click",function(){return h(p),g(r.navigateTo("next"))}),l()()(),a(17,"div",15)(18,"div",16),k(19,w2,1,1,null,null,xo),C(21,E2,2,2,"div",17),l(),a(22,"div",18)(23,"span"),d(24),l()()()()(),R(25,M2,3,4,"ng-template",null,1,Ft)(27,V2,3,9,"ng-template",null,2,Ft)(29,U2,4,8,"ng-template",null,3,Ft)(31,G2,3,7,"ng-template",null,4,Ft)}o&2&&(s(6),m("src",r.logoIconUrl,ee),s(),M(r.appsMenu.submenus),s(2),x(r.store.userImpersonate()?9:-1),s(5),w(r.dynamicTitle),s(),m("icon",r.icons.faAngleLeft),s(),m("icon",r.icons.faAngleRight),s(3),M(r.currentMenu.submenus),s(2),x(r.leftSideBarIsOpen&&r.currentMenu.component?21:-1),s(3),w(r.appVersion))},dependencies:[cn,F,ce,P,Fo,zt,sn],encapsulation:2});let i=n;return i})();var W2=i=>({nb:i}),j2=(i,n)=>({nba:i,nb:n}),K2=(i,n)=>n.id;function Q2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();s(),w(Mt(2,1,e.nbTotalTasks===0?"no_task":e.nbTotalTasks>1?"nb_tasks":"one_task",e.locale.language,Ne(5,W2,e.nbTotalTasks)))}}function q2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();s(),D("",Mt(2,1,e.nbActiveTasks>1?"nb_active_tasks":"one_active_task",e.locale.language,Qn(5,j2,e.nbActiveTasks,e.nbTotalTasks))," ")}}function Y2(i,n){if(i&1){let e=y();a(0,"button",5),f("click",function(){h(e);let o=c();return g(o.removeTasks())}),_(1,"fa-icon",6),l()}if(i&2){let e=c();s(),m("icon",e.icons.faTrashAlt)}}function X2(i,n){i&1&&_(0,"div",1)}function Z2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c().$implicit,t=c();s(),D("\xA0:\xA0",E(2,1,e.result,t.locale.language))}}function J2(i,n){if(i&1&&(a(0,"span"),d(1),b(2,"toBytes"),l()),i&2){let e=c().$implicit;s(),D("",E(2,1,e.props.size,2),"\xA0\u2022\xA0")}}function ey(i,n){if(i&1&&(_(0,"fa-icon",6),a(1,"span"),d(2),l()),i&2){let e=c().$implicit,t=c();m("icon",t.icons.faFolderClosed),s(2),D("\xA0",e.props.directories,"\xA0\u2022\xA0")}}function ty(i,n){if(i&1&&(_(0,"fa-icon",6),a(1,"span"),d(2),l()),i&2){let e=c().$implicit,t=c();m("icon",t.icons.faFile),s(2),D("\xA0",e.props.files,"\xA0\u2022\xA0")}}function iy(i,n){if(i&1){let e=y();a(0,"div",4)(1,"div",7),b(2,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),a(3,"span"),_(4,"fa-icon",8),a(5,"b"),_(6,"fa-icon",9),l(),a(7,"span"),d(8),l(),C(9,Z2,3,4,"span"),l(),a(10,"div",10)(11,"progressbar",11)(12,"span",12),C(13,J2,3,4,"span"),C(14,ey,3,2),C(15,ty,3,2),_(16,"fa-icon",6),a(17,"span"),d(18),b(19,"amTimeAgo"),l()()()()()()}if(i&2){let e=n.$implicit,t=c();s(),m("tooltip",E(2,18,e.result,t.locale.language)),s(2),O("text-gray-dark",e.status<2)("text-danger",e.status>=2),s(),m("icon",t.iconsStatus[e.status])("animation",e.status===0?"spin-pulse":null),s(2),m("icon",t.iconsOperation[e.type]),s(2),w(e.name),s(),x(e.status===2?9:-1),s(2),m("max",100)("value",e.status>0?100:e.props.progress||100)("type",e.status<1?"warning":e.status===2?"danger":null),s(2),x(e.props.size?13:-1),s(),x(e.props.directories?14:-1),s(),x(e.props.files?15:-1),s(),m("icon",t.icons.faClock),s(2),D("\xA0",E(19,21,e.startedAt,!0))}}var Em=(()=>{let n=class n{constructor(){this.locale=S($),this.icons={faTrashAlt:Di,faFlag:kl,faClock:Vc,faFile:Mn,faFolderClosed:yr},this.iconsStatus=[Ue,Yo,ll],this.iconsOperation={[Le.DELETE]:Lc,[Le.MOVE]:ti,[Le.COPY]:gn,[Le.DOWNLOAD]:xn,[Le.UPLOAD]:al,[Le.COMPRESS]:wa,[Le.DECOMPRESS]:wa},this.nbActiveTasks=0,this.nbEndedTasks=0,this.nbTotalTasks=0,this.tasks=[],this.router=S(Ce),this.store=S(te),this.filesService=S(He),this.filesTasksService=S(Ic),this.subscriptions=[],this.subscriptions.push(this.store.filesActiveTasks.subscribe(t=>this.updateTasks(t,!0))),this.subscriptions.push(this.store.filesEndedTasks.subscribe(t=>this.updateTasks(t,!1)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}updateTasks(t,o=!1){o?(this.tasks=[...t,...this.store.filesEndedTasks.getValue()],this.nbActiveTasks=t.length,this.nbEndedTasks=this.store.filesEndedTasks.getValue().length):(this.tasks=[...this.store.filesActiveTasks.getValue(),...t],this.nbEndedTasks=t.length,this.nbActiveTasks=this.store.filesActiveTasks.getValue().length),this.nbTotalTasks=this.nbActiveTasks+this.nbEndedTasks}removeTasks(){this.filesTasksService.removeAll()}goToFile(t){if(t.status===1){if(t.type===Le.COMPRESS&&t.props.compressInDirectory===!1){this.filesService.downloadTaskArchive(t.id);return}else if(t.type===Le.DELETE){if(t.path.startsWith(z.FILES))t.path=t.path.replace(z.FILES,z.TRASH);else if(t.path.startsWith(z.SHARES))return}this.router.navigate([`${z.SPACES}/${t.path}`],{queryParams:{select:t.name}}).catch(console.error)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tasks"]],decls:10,vars:2,consts:[[1,"sidebar-component-title","justify-content-between"],[2,"width","35px"],[1,"btn","btn-xs","btn-secondary"],["appAutoResize",""],[1,"task-list"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["placement","bottom",1,"px-2","py-1","text-truncate",3,"click","tooltip"],[3,"icon","animation"],[1,"me-1",3,"icon"],[1,"fs-xxxs"],[1,"custom-progress-bar","position-relative",3,"max","value","type"],[1,"d-flex","align-items-center","justify-content-center","position-absolute","mx-1","w-100"]],template:function(o,r){if(o&1&&(a(0,"div",0),_(1,"div",1),a(2,"div"),C(3,Q2,3,7,"span")(4,q2,3,8,"span"),l(),C(5,Y2,2,1,"button",2)(6,X2,1,0,"div",1),l(),a(7,"div",3),k(8,iy,20,24,"div",4,K2),l()),o&2){let p;s(3),x((p=r.nbActiveTasks)===0?3:4),s(2),x(r.nbTotalTasks?5:6),s(3),M(r.tasks)}},dependencies:[F,ce,Ke,Me,xc,Z,Je,mr],encapsulation:2});let i=n;return i})();var ny=["notificationsHtml"],oy=(i,n)=>n.id;function ry(i,n){if(i&1&&(a(0,"span",4),d(1),l()),i&2){let e=c();s(),D("(",e.store.notifications().length,")")}}function ay(i,n){if(i&1){let e=y();a(0,"button",8),f("click",function(){h(e);let o=c();return g(o.removeAll())}),_(1,"fa-icon",9),l()}if(i&2){let e=c();s(),m("icon",e.icons.faTrashAlt)}}function sy(i,n){i&1&&_(0,"div",2)}function ly(i,n){if(i&1&&(a(0,"b",3),d(1),l()),i&2){let e=c().$implicit;s(),w(e.fromUser.fullName)}}function cy(i,n){if(i&1&&(a(0,"b"),d(1),l()),i&2){let e=c().$implicit;s(),w(e.fromUser.fullName)}}function py(i,n){if(i&1&&_(0,"fa-icon",9),i&2){let e=c().$implicit;m("icon",e.appIcon)}}function dy(i,n){if(i&1&&(a(0,"span"),d(1),l()),i&2){let e=c().$implicit;s(),D("\xA0",e.mainElement)}}function my(i,n){if(i&1){let e=y();a(0,"div",10,0)(2,"div",11),_(3,"app-user-avatar",12),a(4,"div",13),C(5,ly,2,1,"b",3)(6,cy,2,1,"b"),l(),a(7,"div",14)(8,"i",15),f("click",function(){let o=h(e).$implicit,r=c();return g(r.remove(o))}),_(9,"fa-icon",9),l()()(),a(10,"div",16)(11,"div")(12,"span",3),d(13),l(),d(14,":\xA0"),a(15,"b",17),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goto(o))}),d(16),l()(),a(17,"div",18)(18,"div"),d(19),b(20,"amTimeAgo"),l(),a(21,"div",19),C(22,py,1,1,"fa-icon",9),C(23,dy,2,1,"span"),l()()()()}if(i&2){let e=n.$implicit,t=c();O("newly-1",e.soonRead),s(3),m("user",e.fromUser)("width",24)("height",24)("unknownUserAsInfo",e.fromUser.id===-1),s(2),x(e.fromUser.id===-1?5:6),s(4),m("icon",t.icons.faTimes),s(4),w(e.content.event),s(3),w(e.content.element),s(),O("text-muted",!e.soonRead),s(2),w(G(20,15,e.createdAt)),s(3),x(e.appIcon?22:-1),s(),x(e.mainElement?23:-1)}}var Am=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faCheck:Yo,faTimes:Rt,faMagnifyingGlass:Bo,faTrashAlt:Di,faCircleInfo:Nt},this.router=S(Ce),this.layout=S(I),this.notificationsService=S(_c),$t(()=>{this.store.unreadNotifications(),setTimeout(()=>this.observeUnreadNotifications(),0)})}ngAfterViewInit(){this.observer=new IntersectionObserver(t=>{t.forEach(o=>{if(o.isIntersecting){let r=o.target,p=this.notificationsHtml.toArray().findIndex(u=>u.nativeElement===r);if(p!==-1){let u=this.store.notifications()[p];u&&!u.wasRead&&(u.wasRead=!0,u.soonRead=!0,this.observer.unobserve(r),setTimeout(()=>this.wasRead(u),2e3))}}})},{threshold:.5})}removeAll(){this.notificationsService.deleteNotification().subscribe({next:()=>this.store.notifications.set([]),error:t=>this.layout.sendNotification("error","Notifications","Unable to delete",t)})}remove(t){this.notificationsService.deleteNotification(t.id).subscribe({next:()=>this.store.notifications.update(o=>o.filter(r=>t.id!==r.id)),error:o=>this.layout.sendNotification("error","Notifications","Unable to delete",o)})}goto(t){if(t.content.externalUrl)window.open(t.content.externalUrl,"_blank","noopener");else{let o=t.content.app===cc.SYNC?t.content.element.split("/").at(-1):t.content.element;this.router.navigate([z.SPACES,...t.content.url.split("/")],{queryParams:{select:o}}).catch(console.error)}}observeUnreadNotifications(){this.notificationsHtml&&this.notificationsHtml.forEach((t,o)=>{let r=this.store.notifications()[o];r&&!r.wasRead&&this.observer.observe(t.nativeElement)})}wasRead(t){this.notificationsService.wasReadNotification(t.id).subscribe({next:()=>{this.store.notifications.update(o=>{let r=[...o],p=r.find(u=>u.id===t.id);return p&&(p.soonRead=!1,p.wasRead=!0),r})},error:o=>this.layout.sendNotification("error","Notifications","Mark as read",o)})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-notifications"]],viewQuery:function(o,r){if(o&1&&Y(ny,5),o&2){let p;W(p=j())&&(r.notificationsHtml=p)}},decls:11,vars:2,consts:[["notificationsHtml",""],[1,"sidebar-component-title","justify-content-between"],[2,"width","35px"],["l10nTranslate",""],[1,"ps-1"],[1,"btn","btn-xs","btn-secondary"],["appAutoResize","",1,"fs-xxs","p-2"],[1,"mb-1","app-small-card","rounded","no-select",3,"newly-1"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],[1,"mb-1","app-small-card","rounded","no-select"],[1,"d-flex","px-2","pt-2","pb-1"],[3,"user","width","height","unknownUserAsInfo"],[1,"align-self-center","ms-1"],[1,"ms-auto","align-self-center",2,"font-size","14px"],["role","button",3,"click"],[1,"pb-2","px-2"],[1,"cursor-pointer","btn-link",3,"click"],[1,"d-flex","fs-xxxs","pt-1"],[1,"ms-auto"]],template:function(o,r){o&1&&(a(0,"div",1),_(1,"div",2),a(2,"span")(3,"span",3),d(4,"Notifications"),l(),C(5,ry,2,1,"span",4),l(),C(6,ay,2,1,"button",5)(7,sy,1,0,"div",2),l(),a(8,"div",6),k(9,my,24,17,"div",7,oy),l()),o&2&&(s(5),x(r.store.notifications().length?5:-1),s(),x(r.store.notifications().length?6:7),s(3),M(r.store.notifications()))},dependencies:[P,ce,F,Ze,Je],encapsulation:2});let i=n;return i})();var uy=(i,n)=>n.id;function _y(i,n){if(i&1&&(a(0,"div",3)(1,"div",4),_(2,"img",5)(3,"span"),a(4,"div",6)(5,"span",7),d(6),l(),a(7,"span",8),d(8),l()()()()),i&2){let e=n.$implicit,t=c();s(2),m("src",e.avatarUrl,ee),s(),L(X("avatar-",t.allOnlineStatus[e==null?null:e.onlineStatus])),s(3),w(e.fullName),s(2),w(e.email)}}var Dm=(()=>{let n=class n{constructor(){this.allOnlineStatus=ki,this.store=S(te),this.onlineUsers=ve(()=>this.store.onlineUsers().filter(t=>t.onlineStatus!==or.OFFLINE))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-onlines"]],decls:6,vars:0,consts:[[1,"sidebar-component-title"],["l10nTranslate",""],["appAutoResize",""],[1,"app-onlines-content"],[1,"d-flex","align-items-center","align-self-center","avatar"],["alt","",1,"avatar-img",3,"src"],[1,"d-flex","flex-column","ms-2"],["draggable","false",1,"no-pointer-events","fs-xs"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"span",1),d(2,"Online users"),l()(),a(3,"div",2),k(4,_y,9,6,"div",3,uy),l()),o&2&&(s(4),M(r.onlineUsers()))},dependencies:[ce,P],encapsulation:2});let i=n;return i})();function fy(i,n){if(i&1){let e=y();a(0,"button",24),f("click",function(){h(e);let o=c();return g(o.collapseRSideBar())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();m("routerLink",e.USER_PATH.BASE),s(),m("icon",e.icons.faUserAlt)}}function hy(i,n){if(i&1){let e=y();a(0,"button",25),f("click",function(){h(e);let o=c();return g(o.collapseRSideBar())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();s(),m("icon",e.icons.faCog)}}function gy(i,n){if(i&1){let e=y();a(0,"button",4),f("click",function(){h(e);let o=c();return g(o.logOut())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();s(),m("icon",e.store.userImpersonate()?e.icons.faUserSecret:e.icons.faPowerOff)}}function Cy(i,n){i&1&&(a(0,"div",14),d(1,"Guest Link"),l())}function xy(i,n){if(i&1&&(a(0,"div"),d(1),l(),a(2,"div",26),d(3),l()),i&2){let e=c();s(),w(e.user==null?null:e.user.fullName),s(2),w(e.user==null?null:e.user.email)}}function Sy(i,n){if(i&1&&(a(0,"option",16),d(1),b(2,"translate"),b(3,"capitalize"),l()),i&2){let e=n.$implicit,t=c();m("ngValue",t.allOnlineStatus.indexOf(e)),s(),w(G(3,5,E(2,2,e,t.locale.language)))}}var km=(()=>{let n=class n{constructor(){this.logoDarkUrl=xr,this.logoUrl=Mc,this.store=S(te),this.locale=S($),this.USER_PATH=Ae,this.allOnlineStatus=ki,this.appBaseUrl=`${eo.WEBSITE}`,this.icons={faUserAlt:Xo,faCircleHalfStroke:_l,faCog:Ei,faPowerOff:cl,faUserSecret:tr},this.userAvatar=null,this.layout=S(I),this.themeLight=yn,this.authService=S(jt),this.userService=S(oe),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.appBaseUrl=this.layout.getCurrentLanguage()==="fr"?`${eo.WEBSITE}/fr/`:`${eo.WEBSITE}/`}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}collapseRSideBar(){this.layout.toggleRSideBar(!1)}setOnlineStatus(t){this.userService.changeOnlineStatus(t)}toggleTheme(){this.layout.toggleTheme()}logOut(){this.authService.logout(),this.layout.toggleRSideBar(!1)}openLink(t){switch(t){case"website":this.layout.openUrl(this.appBaseUrl);break;case"versions":this.layout.openUrl(eo.RELEASES);break;default:this.layout.openUrl(`${this.appBaseUrl}${t}`)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-profile"]],decls:41,vars:12,consts:[[1,"d-flex","flex-column"],[1,"sidebar-component-title"],[1,"d-flex","flex-fill","justify-content-between"],["type","button",1,"btn","btn-xs","btn-secondary",3,"routerLink"],["type","button",1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["type","button","routerLink","/admin",1,"btn","btn-xs","btn-secondary"],["type","button",1,"btn","btn-xs","btn-secondary"],["appAutoResize","",1,"d-flex","flex-column",3,"useMaxHeight"],[1,"user-header","py-3"],[1,"d-flex","flex-column","justify-content-center","me-2"],[1,"avatar-lg"],["alt","",1,"avatar-img",3,"src"],[1,"user-details"],["l10nTranslate",""],[1,"form-select","form-select-sm","mt-1",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"my-0","w-100"],[1,"mt-auto"],[1,"profile-sync-in-footer"],[1,"mb-1"],["alt","","height","30",3,"src"],["l10nTranslate","",1,"link-primary","cursor-pointer",3,"click"],[1,"link-primary","cursor-pointer",3,"click"],["type","button",1,"btn","btn-xs","btn-secondary",3,"click","routerLink"],["type","button","routerLink","/admin",1,"btn","btn-xs","btn-secondary",3,"click"],[1,"small"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),C(3,fy,2,2,"button",3),a(4,"button",4),f("click",function(){return r.toggleTheme()}),_(5,"fa-icon",5),l(),C(6,hy,2,1,"button",6),C(7,gy,2,1,"button",7),l()(),a(8,"div",8)(9,"div",9)(10,"div",10)(11,"div",11),_(12,"img",12)(13,"span"),l()(),a(14,"div",13),C(15,Cy,2,0,"div",14)(16,xy,4,2),a(17,"select",15),f("ngModelChange",function(u){return r.setOnlineStatus(u)}),k(18,Sy,4,7,"option",16,We),l()()(),_(20,"hr",17),a(21,"div",18),_(22,"hr",17),a(23,"div",19)(24,"div",20),_(25,"img",21),l(),a(26,"div")(27,"a",22),f("click",function(){return r.openLink("website")}),d(28,"Website"),l(),a(29,"span"),d(30,"\xA0|\xA0"),l(),a(31,"a",22),f("click",function(){return r.openLink("docs")}),d(32,"Documentation"),l(),a(33,"span"),d(34,"\xA0|\xA0"),l(),a(35,"a",22),f("click",function(){return r.openLink("versions")}),d(36,"Versions"),l(),a(37,"span"),d(38,"\xA0|\xA0"),l(),a(39,"a",23),f("click",function(){return r.openLink("support")}),d(40," \u{1F49B}"),l()()()()()()),o&2&&(s(3),x(r.user!=null&&r.user.isLink?-1:3),s(2),m("icon",r.icons.faCircleHalfStroke),s(),x(r.user!=null&&r.user.isAdmin?6:-1),s(),x(!r.store.isElectronApp()||r.store.isElectronApp()&&r.store.userImpersonate()?7:-1),s(),m("useMaxHeight",!1),s(4),m("src",r.userAvatar,ee),s(),L(X("avatar-",r.allOnlineStatus[r.user==null?null:r.user.onlineStatus])),s(2),x(r.user!=null&&r.user.isLink?15:16),s(2),m("ngModel",r.user==null?null:r.user.onlineStatus),s(),M(r.allOnlineStatus),s(7),m("src",r.layout.switchTheme.getValue()===r.themeLight?r.logoUrl:r.logoDarkUrl,ee))},dependencies:[be,yi,bi,vi,xe,ye,cn,F,P,ce,Dn,Z],encapsulation:2});let i=n;return i})();var vy=(i,n)=>n.id;function yy(i,n){if(i&1){let e=y();a(0,"button",5),f("click",function(){h(e);let o=c();return g(o.onCloseAll())}),_(1,"fa-icon",6),l()}if(i&2){let e=c();s(),m("icon",e.icons.faXmark)}}function by(i,n){if(i&1){let e=y();a(0,"div",7),f("click",function(){let o=h(e).$implicit,r=c();return g(r.onMaximize(o))}),a(1,"div",8),_(2,"img",9),a(3,"div",10),d(4),l(),a(5,"button",11),f("click",function(o){let r=h(e).$implicit,p=c();return g(p.onClose(o,r))}),_(6,"fa-icon",6),l()()()}if(i&2){let e=n.$implicit,t=c();s(2),m("ngSrc",e.element.mimeUrl),s(2),w(e.element.name),s(2),m("icon",t.icons.faTimes)}}var Mm=(()=>{let n=class n{constructor(){this.icons={faXmark:Al,faTimes:Rt},this.windows=[],this.layout=S(I),this.subscription=null,this.subscription=this.layout.windows.subscribe(t=>this.setWindows(t))}ngOnDestroy(){this.subscription.unsubscribe()}onMaximize(t){this.layout.restoreDialog(t.id)}onClose(t,o){t.preventDefault(),t.stopPropagation();let r=this.layout.modalRefs.get(o.id);r&&r.content.onClose(),this.hideIfNoWindows(this.layout.windows.getValue())}onCloseAll(){for(let t of this.layout.windows.getValue()){let o=this.layout.modalRefs.get(t.id);o&&o.content.onClose()}this.hideIfNoWindows(this.layout.windows.getValue())}setWindows(t){this.hideIfNoWindows(t),this.windows=t}hideIfNoWindows(t){t.length||this.layout.hideRSideBarTab(fe.WINDOWS,1e3)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-windows"]],decls:7,vars:1,consts:[[1,"sidebar-component-title"],[1,"btn","btn-sm","btn-secondary"],["l10nTranslate",""],["appAutoResize","",1,"sidebar-item"],[1,"sidebar-item-container"],[1,"btn","btn-sm","btn-secondary",3,"click"],[3,"icon"],[1,"sidebar-item-container",3,"click"],[1,"sidebar-item-content"],["alt","","width","28","height","28",3,"ngSrc"],[1,"text-truncate","fs-xxs","ms-2"],[1,"btn","btn-xs","btn-danger","ms-auto",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0),C(1,yy,2,1,"button",1),a(2,"span",2),d(3,"Windows Manager"),l()(),a(4,"div",3),k(5,by,7,3,"div",4,vy),l()),o&2&&(s(),x(r.windows.length?1:-1),s(4),M(r.windows))},dependencies:[ce,F,P,Ns],encapsulation:2});let i=n;return i})();var Fm=(i,n)=>n.label,wy=(i,n)=>n.name;function Ty(i,n){if(i&1&&(a(0,"div",5)(1,"div",6),d(2),l()()),i&2){let e=c().$implicit;s(2),w(e.title)}}function Ey(i,n){i&1&&Ie(0)}function Ay(i,n){if(i&1&&(a(0,"div",7),R(1,Ey,1,0,"ng-container",8),l()),i&2){let e=c().$implicit;s(),m("ngComponentOutlet",e)}}function Dy(i,n){if(i&1&&C(0,Ay,2,1,"div",7),i&2){let e=c(2).$implicit;x(e.active||e.loadComponent?0:-1)}}function ky(i,n){if(i&1&&k(0,Dy,1,1,null,null,wy),i&2){let e=c().$implicit;M(e.components)}}function My(i,n){if(i&1&&(a(0,"div"),C(1,Ty,3,1,"div",5),C(2,ky,2,0),l()),i&2){let e=n.$implicit,t=c();L(e.active?"d-block":"d-none"),s(),x(e.title?1:-1),s(),x(t.showComponents||e.loadComponent?2:-1)}}function Fy(i,n){if(i&1&&(a(0,"a",4),_(1,"fa-icon",9),l()),i&2){let e=c();s(),m("icon",e.icons.faWifi)}}function Py(i,n){if(i&1&&(a(0,"span",13)(1,"span"),d(2),l()()),i&2){let e=c(2).$implicit;s(),L(X("badge bg-",e.count.level," rounded-pill")),s(),w(n)}}function Iy(i,n){if(i&1){let e=y();a(0,"a",11),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.setTabVisible(o.label))}),_(1,"fa-icon",12),C(2,Py,3,4,"span",13),b(3,"async"),l()}if(i&2){let e,t=c().$implicit,o=c();O("mt-auto",t.firstOfLasts)("active",o.visible&&t.active),s(),m("icon",t.icon),s(),x((e=G(3,6,t.count&&t.count.value))?2:-1,e)}}function Ry(i,n){if(i&1&&(C(0,Iy,4,8,"a",10),b(1,"async")),i&2){let e=n.$implicit;x(e.icon&&(!e.showOnCount||e.showOnCount&&e.count&&G(1,1,e.count.value))?0:-1)}}var Pm=(()=>{let n=class n{constructor(){this.visible=!1,this.showComponents=!1,this.tabs=[],this.theme=yn,this.networkIsOnline=!0,this.icons={faWifi:Il},this.layout=S(I),this.store=S(te),this.subscriptions=[],this.showDelay=null,this.currentMenu=null,this.firstsTabs=[{label:fe.PROFILE,components:[km],icon:null,title:null,active:!1},{label:fe.ONLINES,components:[Dm],icon:Oc,title:null,count:{value:di(ve(()=>this.store.onlineUsers().filter(t=>t.onlineStatus!==or.OFFLINE).length)),level:"success"},showOnCount:!0,active:!1},{label:fe.NOTIFICATIONS,components:[Am],icon:Nc,title:null,count:{value:di(ve(()=>this.store.unreadNotifications().length)),level:"warning"},active:!1},{label:fe.TASKS,components:[Em],icon:Uc,title:null,count:{value:us([this.store.filesActiveTasks.pipe(bt(t=>t.length)),this.store.clientSyncTasksCount]).pipe(bt(([t,o])=>t+o)),level:"maroon"},active:!1}],this.lastsTabs=[{label:fe.WINDOWS,components:[Mm],icon:Hc,title:null,count:{value:this.layout.windows.pipe(bt(t=>t.length)),level:"maroon"},showOnCount:!0,firstOfLasts:!0,active:!1}],this.tabs=[...this.firstsTabs,...this.lastsTabs],this.subscriptions.push(this.layout.rightSideBarIsOpen.subscribe(t=>this.setVisible(t))),this.subscriptions.push(this.layout.rightSideBarSetTabs.subscribe(t=>this.setTabs(t))),this.subscriptions.push(this.layout.rightSideBarOpenAndShowTab.subscribe(t=>this.setTabVisible(t))),this.subscriptions.push(this.layout.rightSideBarSelectTab.subscribe(t=>this.selectTab(t))),this.subscriptions.push(this.layout.switchTheme.subscribe(t=>this.theme=t)),this.subscriptions.push(this.layout.networkIsOnline.subscribe(t=>this.networkIsOnline=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}setTabVisible(t){this.visible?t&&t!==this.layout.currentRightSideBarTab?this.selectTab(t):this.layout.toggleRSideBar(!1):(this.selectTab(t),this.layout.toggleRSideBar(!0))}setVisible(t){t?(clearTimeout(this.showDelay),this.showComponents=t):this.showDelay=setTimeout(()=>this.showComponents=t,500),this.visible=t}setTabs(t){t.name!==this.currentMenu&&(this.tabs=[...this.firstsTabs,...t.tabs?t.tabs:[],...this.lastsTabs],this.currentMenu=t.name,t.name===null&&!this.tabs.find(o=>o.active)&&this.layout.toggleRSideBar(!1))}selectTab(t){if(t){let o=!1;for(let r of this.tabs)r.active=r.label==t,r.active&&(o=!0,this.layout.currentRightSideBarTab=t);o||(this.tabs[0].active=!0)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-sidebar-right"]],decls:9,vars:6,consts:[[3,"class"],[1,"control-sidebar-menu"],[1,"sidebar-apps-icons"],[1,"menu"],[1,"bg-warning"],[1,"sidebar-title"],["l10nTranslate",""],[1,"sidebar-component-content"],[4,"ngComponentOutlet"],[1,"text-white",3,"icon"],[3,"mt-auto","active"],[3,"click"],[3,"icon"],[1,"menu-badge"]],template:function(o,r){o&1&&(a(0,"aside"),k(1,My,3,4,"div",0,Fm),l(),a(3,"div",1)(4,"div",2)(5,"div",3),C(6,Fy,2,1,"a",4),k(7,Ry,2,3,null,null,Fm),l()()()),o&2&&(L(X("control-sidebar control-sidebar-",r.theme)),O("control-sidebar-open",r.visible),s(),M(r.tabs),s(5),x(r.networkIsOnline?-1:6),s(),M(r.tabs))},dependencies:[F,P,Fo,sn],encapsulation:2});let i=n;return i})();var Im=(()=>{let n=class n{constructor(){this.themeMode=yn,this.document=S(Eo),this.layout=S(I),this.renderer=S(pt),this.rightSideBarClass="control-sidebar-open",this.leftSideBarCollapsedClass="sidebar-collapse",this.leftSideBarOpenedClass="sidebar-open",this.isSmallerThanMediumScreen=!1,this.subscriptions=[],this.subscriptions.push(this.layout.switchTheme.subscribe(t=>this.setTheme(t))),this.subscriptions.push(this.layout.toggleRightSideBar.subscribe(t=>this.toggleRightSideBar(t))),this.subscriptions.push(this.layout.toggleLeftSideBar.subscribe(t=>this.toggleLeftSideBar(t)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onResize(){this.layout.resizeEvent.next(),this.isSmallerThanMediumScreen!==this.layout.isSmallerMediumScreen()&&(this.isSmallerThanMediumScreen=!this.isSmallerThanMediumScreen,this.checkLeftSideBarCollapse())}onDragOver(t){t.preventDefault()}onDrop(t){t.preventDefault()}toggleLeftSideBar(t){t===1?(this.openLeftSideBar(),this.layout.leftSideBarIsOpen.next(!0)):t===2?(this.collapseLeftSideBar(),this.layout.leftSideBarIsOpen.next(!1)):this.document.body.classList.contains(this.leftSideBarOpenedClass)?(this.collapseLeftSideBar(),this.layout.saveLeftSideBarIsOpen.next(!1),this.layout.leftSideBarIsOpen.next(!1)):(this.openLeftSideBar(),this.layout.saveLeftSideBarIsOpen.next(!0),this.layout.leftSideBarIsOpen.next(!0))}toggleRightSideBar(t){t?this.renderer.addClass(this.document.body,this.rightSideBarClass):this.renderer.removeClass(this.document.body,this.rightSideBarClass)}openLeftSideBar(){this.renderer.removeClass(this.document.body,this.leftSideBarCollapsedClass),this.renderer.addClass(this.document.body,this.leftSideBarOpenedClass)}collapseLeftSideBar(){this.renderer.removeClass(this.document.body,this.leftSideBarOpenedClass),this.renderer.addClass(this.document.body,this.leftSideBarCollapsedClass)}checkLeftSideBarCollapse(){this.isSmallerThanMediumScreen?this.toggleLeftSideBar(2):this.toggleLeftSideBar(this.layout.saveLeftSideBarIsOpen.getValue()?1:2)}setTheme(t){this.renderer.removeClass(this.document.body,this.themeMode),this.themeMode=t,this.renderer.addClass(this.document.body,this.themeMode)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-layout"]],hostBindings:function(o,r){o&1&&f("resize",function(){return r.onResize()},Ao)("dragover",function(u){return r.onDragOver(u)})("drop",function(u){return r.onDrop(u)})},decls:8,vars:0,consts:[[1,"app-main"],[1,"wrapper"],[1,"content-wrapper"],[1,"content-container"]],template:function(o,r){o&1&&(a(0,"body",0)(1,"div",1),_(2,"app-navbar")(3,"app-sidebar-left"),a(4,"div",2)(5,"div",3),_(6,"router-outlet"),l()(),_(7,"app-sidebar-right"),l()())},dependencies:[ln,wm,Tm,Pm],encapsulation:2});let i=n;return i})();var Rm=[{path:rr.BASE,component:Im,canActivate:[as],canActivateChild:[as],children:[...td,...od,...em,...xm,...am,...Qp]},...ym,...Yp,{path:"**",redirectTo:mi.BASE}];var Nm=(()=>{let n=class n{constructor(){this.injector=S(Gn),this.auth=null,this.isRefreshingToken=!1,this.waitForRefreshToken=new ms(!1),this.retryCount=3,this.retryWaitMilliSeconds=2e3}intercept(t,o){let r=oc(t.url);return r&&(t=t.clone({url:r})),o.handle(t).pipe(bo(p=>p.status===401?this.handleAuthorizationError(t,o,p):p.status===0?this.handleRetries(t,o,p):yo(()=>p)))}handleAuthorizationError(t,o,r){return this.auth||(this.auth=this.injector.get(jt)),console.debug("AuthInterceptor:",t.url,r.status),[Ys,Qs,qs].indexOf(t.url)===-1?this.isRefreshingToken?(console.debug("AuthInterceptor: wait for refresh token"),this.waitForRefreshToken.pipe(Dt(p=>!p),pe(1),zn(()=>o.handle(this.auth.checkCSRF(t))))):(console.debug("AuthInterceptor: refreshing token"),this.isRefreshingToken=!0,this.waitForRefreshToken.next(!0),this.auth.refreshToken().pipe(zn(()=>(this.waitForRefreshToken.next(!1),o.handle(this.auth.checkCSRF(t)))),wo(()=>this.isRefreshingToken=!1))):yo(()=>r)}handleRetries(t,o,r){return o.handle(t).pipe(hs(p=>p.pipe(_s((u,v)=>v<this.retryCount&&u.status==0?gi(u):yo(()=>u)),fs(this.retryWaitMilliSeconds))))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Vm(){return Object.assign(new Ro,{adaptivePosition:!1,triggers:"hover",delay:500})}var Lm={url:"",options:{autoConnect:!1,reconnection:!0,forceNew:!1,transports:["websocket"]}};var Om={providers:[ks({eventCoalescing:!0}),{provide:Fs,useClass:Ps},{provide:Us,useClass:Nm,multi:!0},js(Rm),Hs($s(),zs({cookieName:Ca,headerName:Ca})),Js(Hl,re({storage:$l,translationLoader:zl},Ms()?{missingTranslationHandler:Gl}:{})),el(),jp(),nl({positionClass:"toast-bottom-right",preventDuplicates:!1,maxOpened:6,autoDismiss:!0,timeOut:6e3}),{provide:Ro,useFactory:Vm},tl,Cs(il.forRoot(Lm))]};Ls(qc,Om).catch(console.error);