@sync-in/server 1.9.1 → 1.9.3

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 (163) hide show
  1. package/CHANGELOG.md +12 -8
  2. package/package.json +7 -7
  3. package/server/applications/files/services/files-manager.service.js +2 -2
  4. package/server/applications/files/services/files-manager.service.js.map +1 -1
  5. package/server/applications/files/services/files-tasks-manager.service.js +1 -1
  6. package/server/applications/files/services/files-tasks-manager.service.js.map +1 -1
  7. package/server/applications/files/utils/send-file.js +18 -9
  8. package/server/applications/files/utils/send-file.js.map +1 -1
  9. package/server/applications/files/utils/url-file.js +6 -6
  10. package/server/applications/files/utils/url-file.js.map +1 -1
  11. package/server/applications/links/services/links-manager.service.js +1 -1
  12. package/server/applications/links/services/links-manager.service.js.map +1 -1
  13. package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
  14. package/server/applications/shares/services/shares-manager.service.js +6 -4
  15. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  16. package/server/applications/spaces/services/spaces-manager.service.js +15 -12
  17. package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
  18. package/server/applications/users/services/admin-users-manager.service.js +4 -0
  19. package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
  20. package/server/applications/users/users.controller.js +4 -1
  21. package/server/applications/users/users.controller.js.map +1 -1
  22. package/static/assets/pdfjs/build/pdf.mjs +35 -20
  23. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  24. package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
  25. package/static/assets/pdfjs/build/pdf.worker.mjs +1488 -52
  26. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  27. package/static/assets/pdfjs/version +1 -1
  28. package/static/assets/pdfjs/web/locale/be/viewer.ftl +2 -12
  29. package/static/assets/pdfjs/web/locale/bg/viewer.ftl +4 -0
  30. package/static/assets/pdfjs/web/locale/bs/viewer.ftl +0 -15
  31. package/static/assets/pdfjs/web/locale/ca/viewer.ftl +0 -4
  32. package/static/assets/pdfjs/web/locale/cs/viewer.ftl +4 -14
  33. package/static/assets/pdfjs/web/locale/cy/viewer.ftl +2 -12
  34. package/static/assets/pdfjs/web/locale/da/viewer.ftl +2 -12
  35. package/static/assets/pdfjs/web/locale/de/viewer.ftl +0 -12
  36. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +0 -12
  37. package/static/assets/pdfjs/web/locale/el/viewer.ftl +2 -12
  38. package/static/assets/pdfjs/web/locale/en-CA/viewer.ftl +0 -12
  39. package/static/assets/pdfjs/web/locale/en-GB/viewer.ftl +0 -12
  40. package/static/assets/pdfjs/web/locale/eo/viewer.ftl +2 -12
  41. package/static/assets/pdfjs/web/locale/es-AR/viewer.ftl +0 -12
  42. package/static/assets/pdfjs/web/locale/es-CL/viewer.ftl +2 -12
  43. package/static/assets/pdfjs/web/locale/es-ES/viewer.ftl +2 -12
  44. package/static/assets/pdfjs/web/locale/es-MX/viewer.ftl +0 -12
  45. package/static/assets/pdfjs/web/locale/eu/viewer.ftl +0 -12
  46. package/static/assets/pdfjs/web/locale/fi/viewer.ftl +0 -12
  47. package/static/assets/pdfjs/web/locale/fr/viewer.ftl +0 -12
  48. package/static/assets/pdfjs/web/locale/fur/viewer.ftl +0 -12
  49. package/static/assets/pdfjs/web/locale/fy-NL/viewer.ftl +0 -12
  50. package/static/assets/pdfjs/web/locale/gn/viewer.ftl +2 -12
  51. package/static/assets/pdfjs/web/locale/he/viewer.ftl +0 -12
  52. package/static/assets/pdfjs/web/locale/hsb/viewer.ftl +0 -12
  53. package/static/assets/pdfjs/web/locale/hu/viewer.ftl +0 -12
  54. package/static/assets/pdfjs/web/locale/hy-AM/viewer.ftl +0 -15
  55. package/static/assets/pdfjs/web/locale/ia/viewer.ftl +0 -12
  56. package/static/assets/pdfjs/web/locale/id/viewer.ftl +0 -15
  57. package/static/assets/pdfjs/web/locale/is/viewer.ftl +0 -15
  58. package/static/assets/pdfjs/web/locale/it/viewer.ftl +2 -14
  59. package/static/assets/pdfjs/web/locale/ja/viewer.ftl +7 -2
  60. package/static/assets/pdfjs/web/locale/ka/viewer.ftl +0 -12
  61. package/static/assets/pdfjs/web/locale/kab/viewer.ftl +0 -12
  62. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +3 -12
  63. package/static/assets/pdfjs/web/locale/ko/viewer.ftl +0 -12
  64. package/static/assets/pdfjs/web/locale/nb-NO/viewer.ftl +2 -12
  65. package/static/assets/pdfjs/web/locale/nl/viewer.ftl +0 -12
  66. package/static/assets/pdfjs/web/locale/nn-NO/viewer.ftl +0 -12
  67. package/static/assets/pdfjs/web/locale/pa-IN/viewer.ftl +4 -12
  68. package/static/assets/pdfjs/web/locale/pl/viewer.ftl +2 -12
  69. package/static/assets/pdfjs/web/locale/pt-BR/viewer.ftl +2 -12
  70. package/static/assets/pdfjs/web/locale/rm/viewer.ftl +0 -12
  71. package/static/assets/pdfjs/web/locale/ro/viewer.ftl +2 -14
  72. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +0 -12
  73. package/static/assets/pdfjs/web/locale/sc/viewer.ftl +0 -1
  74. package/static/assets/pdfjs/web/locale/sk/viewer.ftl +0 -12
  75. package/static/assets/pdfjs/web/locale/sl/viewer.ftl +2 -12
  76. package/static/assets/pdfjs/web/locale/sq/viewer.ftl +2 -12
  77. package/static/assets/pdfjs/web/locale/sv-SE/viewer.ftl +0 -12
  78. package/static/assets/pdfjs/web/locale/tg/viewer.ftl +2 -12
  79. package/static/assets/pdfjs/web/locale/th/viewer.ftl +0 -12
  80. package/static/assets/pdfjs/web/locale/tr/viewer.ftl +2 -12
  81. package/static/assets/pdfjs/web/locale/vi/viewer.ftl +0 -12
  82. package/static/assets/pdfjs/web/locale/zh-CN/viewer.ftl +2 -12
  83. package/static/assets/pdfjs/web/locale/zh-TW/viewer.ftl +0 -12
  84. package/static/assets/pdfjs/web/viewer.css +53 -41
  85. package/static/assets/pdfjs/web/viewer.html +493 -132
  86. package/static/assets/pdfjs/web/viewer.mjs +225 -150
  87. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  88. package/static/{chunk-LYZGJZNP.js → chunk-25PWAXTJ.js} +1 -1
  89. package/static/{chunk-HCSWO7BO.js → chunk-27XEAHMV.js} +1 -1
  90. package/static/{chunk-YMAN4LIU.js → chunk-2CAAJBRO.js} +1 -1
  91. package/static/{chunk-RK2ONYTL.js → chunk-2LHHXDD5.js} +1 -1
  92. package/static/{chunk-YCTCESL4.js → chunk-2XY4PMI5.js} +1 -1
  93. package/static/{chunk-ERDZ7IVF.js → chunk-33WFRCUP.js} +1 -1
  94. package/static/chunk-3LVFDMTN.js +1 -0
  95. package/static/{chunk-V6FA5QY4.js → chunk-4DF2SQD4.js} +1 -1
  96. package/static/{chunk-Q556XB3S.js → chunk-4EUHBTWV.js} +1 -1
  97. package/static/{chunk-AADK5D2H.js → chunk-4KXJ6C4N.js} +1 -1
  98. package/static/{chunk-BHZEPHRI.js → chunk-4OV3SAUS.js} +1 -1
  99. package/static/{chunk-5S6KPQRA.js → chunk-5HCVWZMA.js} +1 -1
  100. package/static/{chunk-ZCOWBVOT.js → chunk-5HYSNQR4.js} +1 -1
  101. package/static/{chunk-4PZPHJ7L.js → chunk-5NHB7SV3.js} +1 -1
  102. package/static/chunk-6VJI4X2A.js +1 -0
  103. package/static/{chunk-XCLK7NJL.js → chunk-7H5O4BLV.js} +1 -1
  104. package/static/{chunk-ACUF7IKP.js → chunk-7NI353LS.js} +1 -1
  105. package/static/{chunk-TGLJFALR.js → chunk-A6J6SOM6.js} +1 -1
  106. package/static/{chunk-XOF4UW3S.js → chunk-A7DSX7VP.js} +1 -1
  107. package/static/chunk-A7R246NW.js +1 -0
  108. package/static/{chunk-EL6QL4TP.js → chunk-ASBPYTLT.js} +1 -1
  109. package/static/chunk-BJARRIS6.js +562 -0
  110. package/static/{chunk-VQJYCYWI.js → chunk-CAZSNVMS.js} +1 -1
  111. package/static/{chunk-EIYRBM4J.js → chunk-CURVLK7L.js} +1 -1
  112. package/static/{chunk-5E3TYOL3.js → chunk-DDRGLHOP.js} +1 -1
  113. package/static/{chunk-ZXXHFBGL.js → chunk-FLPZB3OX.js} +1 -1
  114. package/static/{chunk-23UUFZSR.js → chunk-FRBTL2ER.js} +1 -1
  115. package/static/{chunk-JY2I3HGL.js → chunk-FXM7XXWA.js} +1 -1
  116. package/static/{chunk-7CKHC72R.js → chunk-GDPJRUVU.js} +1 -1
  117. package/static/{chunk-QMHUIHSR.js → chunk-GENTF6JM.js} +1 -1
  118. package/static/{chunk-VK7XMFVE.js → chunk-H4RLHI3Y.js} +1 -1
  119. package/static/{chunk-3WLBVJ2S.js → chunk-HE6EDXWI.js} +1 -1
  120. package/static/{chunk-U4RW6XG5.js → chunk-IUJ4IK26.js} +1 -1
  121. package/static/{chunk-XQGPSNQB.js → chunk-JEVBUJQ4.js} +1 -1
  122. package/static/{chunk-K657XPXA.js → chunk-K3MOXDU5.js} +1 -1
  123. package/static/{chunk-6B3GGAV3.js → chunk-KBWK65KM.js} +1 -1
  124. package/static/{chunk-I2S3XPC5.js → chunk-L3PDWJZ3.js} +2 -2
  125. package/static/{chunk-KDEEERWZ.js → chunk-LBXOAKBD.js} +1 -1
  126. package/static/{chunk-Y5RLD72B.js → chunk-LFAQLJZK.js} +1 -1
  127. package/static/{chunk-M4XL3JN5.js → chunk-MBFMTBVJ.js} +1 -1
  128. package/static/{chunk-HMOB6XC5.js → chunk-MZBO5PAR.js} +1 -1
  129. package/static/{chunk-DJDRX53V.js → chunk-NFIES7BC.js} +1 -1
  130. package/static/{chunk-3YDYZLF7.js → chunk-NK2NMAJI.js} +1 -1
  131. package/static/{chunk-FNOTGWRW.js → chunk-O7UXVNR2.js} +1 -1
  132. package/static/{chunk-RDNTK4YH.js → chunk-PKU4IIIR.js} +1 -1
  133. package/static/{chunk-NN4ONTOT.js → chunk-QUSS6SUC.js} +1 -1
  134. package/static/{chunk-BU4ZICZR.js → chunk-R6VB3INJ.js} +1 -1
  135. package/static/{chunk-2TB2INBF.js → chunk-RJOHDAPM.js} +1 -1
  136. package/static/{chunk-BODMMLVB.js → chunk-S6YKBWJE.js} +1 -1
  137. package/static/{chunk-AZ5TF5Y3.js → chunk-SDR3UG2F.js} +1 -1
  138. package/static/{chunk-C3AAEQKW.js → chunk-TGHBDJZA.js} +1 -1
  139. package/static/{chunk-HNMGPG72.js → chunk-TVJQXN73.js} +1 -1
  140. package/static/{chunk-6NEBGCAZ.js → chunk-U75PLYIJ.js} +1 -1
  141. package/static/chunk-UUX3M6DC.js +1 -0
  142. package/static/{chunk-JWPXQOS3.js → chunk-VJ2HWQRJ.js} +2 -2
  143. package/static/{chunk-S2VBGI6Q.js → chunk-VO4WVT6K.js} +1 -1
  144. package/static/{chunk-5XUIPWOH.js → chunk-W72JYHOH.js} +1 -1
  145. package/static/{chunk-PXRT4L57.js → chunk-WJYVS27M.js} +1 -1
  146. package/static/{chunk-HKRGIRKB.js → chunk-XAIOGRBO.js} +1 -1
  147. package/static/{chunk-NKGKBQBX.js → chunk-XHQEF2IX.js} +1 -1
  148. package/static/{chunk-DQ3GEMPM.js → chunk-XXYMVRSH.js} +1 -1
  149. package/static/{chunk-HHWXIK2M.js → chunk-YTBSB2GE.js} +1 -1
  150. package/static/{chunk-GRLHFXGB.js → chunk-YXWF2DGF.js} +1 -1
  151. package/static/{chunk-JMYAD7E2.js → chunk-Z6RJZIDG.js} +1 -1
  152. package/static/{chunk-GNZPP2VO.js → chunk-ZC5ZDCDC.js} +1 -1
  153. package/static/{chunk-EDJAISWO.js → chunk-ZERBTNFW.js} +8 -8
  154. package/static/{chunk-MIA5YBOI.js → chunk-ZPI7RQ2S.js} +1 -1
  155. package/static/{chunk-NOPACN4F.js → chunk-ZRBLCAOK.js} +1 -1
  156. package/static/index.html +2 -2
  157. package/static/{main-56PZQ6TJ.js → main-FE6GWZXU.js} +4 -4
  158. package/static/{styles-Q4OZOSSK.css → styles-S5HVK4H5.css} +1 -1
  159. package/static/chunk-H6WOTGQ5.js +0 -1
  160. package/static/chunk-HC7F57NA.js +0 -1
  161. package/static/chunk-IOIBQGHN.js +0 -562
  162. package/static/chunk-J6YSFHLZ.js +0 -1
  163. package/static/chunk-QVFPHTOH.js +0 -1
@@ -1 +1 @@
1
- import{b as R,c as ft}from"./chunk-3WLBVJ2S.js";import{a as ue,b as z,c as Ct,d as Te,e as vt}from"./chunk-HCSWO7BO.js";import{a as ht,b as gt,c as bt}from"./chunk-RK2ONYTL.js";import{a as S,b as Y,c as tt,e as _t}from"./chunk-3YDYZLF7.js";import{a as lt,c as dt}from"./chunk-6B3GGAV3.js";import{a as _e}from"./chunk-QMHUIHSR.js";import{a as st}from"./chunk-V6FA5QY4.js";import{a as pt,b as ct,c as ut}from"./chunk-XCLK7NJL.js";import{a as Se}from"./chunk-MIA5YBOI.js";import{a as Ge,b as mt}from"./chunk-5E3TYOL3.js";import"./chunk-NKGKBQBX.js";import{m as rt,n as xe,s as ye}from"./chunk-FNOTGWRW.js";import{a as at}from"./chunk-ZCOWBVOT.js";import"./chunk-PXRT4L57.js";import{A as Ze,B as K,C as et,Cb as V,J as H,cb as ve,gb as de,s as je,va as it,wa as nt,xa as ot}from"./chunk-I2S3XPC5.js";import{b as Me,d as Pe}from"./chunk-Y5RLD72B.js";import{Bb as A,Cd as ne,Dd as Le,E as be,Eb as _,Ed as oe,Gb as u,He as Qe,Hf as pe,Ia as J,Jd as re,Kb as Q,Kd as M,Kf as ze,L as O,Lb as q,Ld as Ke,Mb as W,Mf as Ye,Oa as s,Pc as te,Qa as I,Qb as Ce,Qd as ae,Qe as se,Rb as U,Rf as ce,Sb as k,Tb as m,Tf as Je,Ub as C,Vb as $,Vd as He,Wb as Ee,Xb as X,Yb as Z,Zb as ee,ab as E,af as qe,cc as Ae,dc as De,df as We,dg as Xe,ed as Ve,fb as w,fd as Re,hd as Fe,he as le,ja as x,jd as L,kc as v,kd as Ue,lb as h,lc as D,ld as ke,mb as g,mc as T,nd as j,oa as y,od as ie,og as P,pa as G,pb as B,qb as N,rb as c,sb as r,sd as Oe,tb as a,td as Ie,ub as d,ud as Be,vd as Ne,wd as $e,zf as me}from"./chunk-IOIBQGHN.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as he,b as ge}from"./chunk-KAVP6UXH.js";var xt=(()=>{let l=class l{constructor(){this.currentMemberIds=[],this.hasChanges=new I,this.layout=x(V),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:se},this.adminService=x(R)}searchMembers(n){let o={search:n,onlyUsers:!0,usersRole:this.parentGroup.type===ue.USER?Ze.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(e=>e.id)]};return this.adminService.searchMembers(o)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(n=>n.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(n=>n.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(o=>o.name).join("<br>"),n,{enableHtml:!0})}})}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-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,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Add members"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"app-user-search",7),ee("membersChange",function(f){return Z(e.newMembers,f)||(e.newMembers=f),f}),a()(),r(11,"div",8)(12,"button",9),_("click",function(){return e.layout.closeDialog()}),m(13,"Cancel"),a(),r(14,"button",10),_("click",function(){return e.onSubmit()}),m(15," Confirm "),a()()),o&2&&(s(2),c("icon",e.icons.faUserPlus),s(2),C(e.parentGroup.name),s(6),X("members",e.newMembers),c("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",e.searchMembers.bind(e)),s(4),c("disabled",e.submitted||!e.newMembers.length))},dependencies:[P,M,dt],encapsulation:2});let t=l;return t})();function wt(t,l){if(t&1&&d(0,"img",9),t&2){let i=u();c("src",i.member.avatarUrl,J)}}function Et(t,l){if(t&1&&d(0,"fa-icon",15),t&2){let i=u();k(i.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",i.icons.GROUPS)}}function At(t,l){if(t&1&&(r(0,"div",7)(1,"span",16),m(2,"from the group"),a(),r(3,"span",11),m(4),v(5,"capitalize"),a()()),t&2){let i=u();s(4),C(D(5,1,i.parentGroup.name))}}function Dt(t,l){t&1&&(r(0,"small",4),m(1,"Only the group will be deleted, the members will no longer be part of it."),a())}var yt=(()=>{let l=class l{constructor(){this.wasDeleted=new I,this.submitted=!1,this.icons={GROUPS:H.GROUPS,faMinus:ae,faUserMinus:pe},this.layout=x(V),this.adminService=x(R)}onSubmit(){this.submitted=!0;let n=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.adminService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.adminService.deleteGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",n,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",n,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-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"],[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"],["l10nTranslate","",1,"mx-1"]],template:function(o,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7),a()(),r(8,"button",5),_("click",function(){return e.onClose()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8),h(12,wt,1,1,"img",9)(13,Et,1,3,"fa-icon",10),a(),r(14,"span",11),m(15),v(16,"capitalize"),a(),r(17,"span",4),m(18,"will be removed"),a(),h(19,At,6,3,"div",7),a(),h(20,Dt,2,0,"small",4),a(),r(21,"div",12)(22,"button",13),_("click",function(){return e.onClose()}),m(23,"Cancel"),a(),r(24,"button",14),_("click",function(){return e.onSubmit()}),m(25," Remove "),a()()),o&2&&(s(2),c("icon",e.member.isUser?e.icons.faUserMinus:e.icons.faMinus),s(2),C(e.member.name),s(3),C(e.member.isUser?"Remove from group":"Delete group"),s(5),g(e.member.isUser?12:13),s(3),C(D(16,8,e.member.name)),s(4),g(e.member.isUser?19:-1),s(),g(e.member.isGroup?20:-1),s(4),c("disabled",e.submitted))},dependencies:[P,M,_t],encapsulation:2});let t=l;return t})();var Mt=(t,l)=>l.value;function Pt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span"),m(2),a()),t&2){let i=u();c("icon",i.icons.faPen),s(2),C(i.group.name)}}function Vt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span",23),m(2,"New group"),a()),t&2){let i=u();c("icon",i.icons.faPlus)}}function Rt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Ft(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Settings"),a()),t&2){let i=u();c("icon",i.icons.faCog)}}function Ut(t,l){if(t&1&&(r(0,"option",21),m(1),a()),t&2){let i=l.$implicit;c("ngValue",i.value),s(),C(i.key)}}function kt(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function Ot(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function It(t,l){t&1&&(r(0,"span",23),m(1,"The group is not visible, its members cannot see it and cannot see each other."),a())}function Bt(t,l){if(t&1&&(r(0,"div",24)(1,"div",18)(2,"label",34),m(3,"Creation date"),a(),r(4,"div",35),m(5),v(6,"amDateFormat"),a()(),r(7,"div",36)(8,"label",37),m(9,"Modification date"),a(),r(10,"div",38),m(11),v(12,"amDateFormat"),a()()()),t&2){let i=u();s(5),C(D(6,2,i.group.createdAt)),s(6),C(D(12,4,i.group.modifiedAt))}}function Nt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Permissions"),a()),t&2){let i=u();c("icon",i.icons.faShieldHalved)}}var we=(()=>{let l=class l{constructor(){this.group=null,this.parentGroup=null,this.groupChange=new I,this.locale=x(oe),this.layout=x(V),this.icons={GROUPS:H.GROUPS,faPen:me,faPlus:ce,faCog:qe,faShieldHalved:Ye},this.submitted=!1,this.originalOrderKeyValue=de,this.allVisibilities={Visible:z.VISIBLE,Private:z.PRIVATE,Isolated:z.ISOLATED},this.adminService=x(R)}ngOnInit(){this.groupForm=new ke({name:new j(this.group?.name||"",Fe.required),description:new j(this.group?.description||""),visibility:new j(this.group?.visibility||z.VISIBLE),applications:new j(this.group?.applications||[]),parent:new j(this.parentGroup)})}updateApplications(n){this.groupForm.controls.applications.setValue(n),this.groupForm.controls.applications.markAsDirty()}onSetParent(n){this.groupForm.controls.parent.setValue(n?{id:n.id,name:n.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(n){let o={search:n,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(o,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let n=this.makeDto();this.adminService.updateGroup(this.group.id,n).subscribe({next:o=>{this.groupChange.emit(["update",o]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:o=>this.onError(o)})}else{let n=this.makeDto(!0);this.adminService.createGroup(n).subscribe({next:o=>{this.groupChange.emit(["add",o]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:o=>this.onError(o)})}}makeDto(n=!1){let o;n?o=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):o=Object.fromEntries(Object.keys(this.groupForm.controls).filter(e=>this.groupForm.controls[e].dirty).map(e=>[e,this.groupForm.controls[e].value]));for(let e in o)switch(e){case"applications":o.permissions=o[e].join(et),delete o.applications;break;case"parent":o.parentId=o[e]?o[e].id:null,delete o.parent;break}return o}onError(n){this.layout.sendNotification("error","Group error",this.groupForm.value.name,n),this.submitted=!1}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-dialog"]],inputs:{group:"group",parentGroup:"parentGroup"},outputs:{groupChange:"groupChange"},decls:50,vars:24,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body","form-validation",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","formControlName","name","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","formControlName","description","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"d-flex","flex-column","align-items-start","col-12","pb-3"],[1,"col-6","pe-4"],["for","visibility","l10nTranslate",""],["id","visibility","formControlName","visibility",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],[1,"d-none","d-sm-block","fst-italic","fs-xxs"],["l10nTranslate",""],[1,"d-flex","align-items-start","col-12","pb-3"],["for","parent","translate",""],["id","parent",3,"data","searchFunction","active","itemIcon","placeholder"],[3,"permissionsChange","permissions"],[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"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","modified","l10nTranslate",""],["id","modified"]],template:function(o,e){if(o&1&&(r(0,"div",0)(1,"h4",1),h(2,Pt,3,2)(3,Vt,3,1),a(),h(4,Rt,3,0,"h4",2),r(5,"button",3),_("click",function(){return e.layout.closeDialog()}),a()(),r(6,"div",4)(7,"tabset",5),d(8,"hr",6),r(9,"tab",7),_("selectTab",function(){return e.tabView=null}),w(10,Ft,3,1,"ng-template",8),r(11,"div",9)(12,"div",10)(13,"div",11)(14,"label",12),m(15,"Name"),a(),d(16,"input",13),a(),r(17,"div",14)(18,"label",15),m(19,"Description"),a(),d(20,"input",16),a()(),r(21,"div",17)(22,"div",18)(23,"label",19),m(24,"Visibility"),a(),r(25,"select",20),B(26,Ut,2,2,"option",21,Mt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,kt,2,0,"span",23)(31,Ot,2,0,"span",23)(32,It,2,0,"span",23),a()(),r(33,"div",24)(34,"div",18)(35,"label",25),m(36,"Parent group"),a(),r(37,"app-select",26),v(38,"translate"),_("data",function(f){return e.onSetParent(f)}),a()()(),h(39,Bt,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),w(41,Nt,3,1,"ng-template",8),r(42,"div",9)(43,"div",10)(44,"app-admin-permissions",27),_("permissionsChange",function(f){return e.updateApplications(f)}),a()()()()()(),r(45,"div",28)(46,"button",29),_("click",function(){return e.layout.closeDialog()}),m(47,"Cancel"),a(),r(48,"button",30),_("click",function(){return e.onSubmit()}),m(49," Confirm "),a()()),o&2){let p;s(2),g(e.group?2:3),s(2),g(e.group?4:-1),s(),k(Ae("btn-close btn-close-white ",e.group?"ms-2":"ms-auto"," ms-2")),s(),c("formGroup",e.groupForm),s(),c("justified",!0),s(9),U("is-invalid",e.groupForm.controls.name.invalid),c("autoSelect",!1),s(10),N(T(28,18,e.allVisibilities,e.originalOrderKeyValue)),s(4),g((p=e.groupForm.value.visibility)===e.allVisibilities.Visible?30:p===e.allVisibilities.Private?31:p===e.allVisibilities.Isolated?32:-1),s(7),c("searchFunction",e.searchGroups.bind(e))("active",e.groupForm.value.parent)("itemIcon",e.icons.GROUPS)("placeholder",T(38,21,"Select the parent group",e.locale.language)),s(2),g(e.group?39:-1),s(5),c("permissions",e.groupForm.value.applications),s(4),c("disabled",e.submitted||e.groupForm.invalid)}},dependencies:[P,M,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,rt,ft,vt,ct,ut,pt,te,re,_e],encapsulation:2});let t=l;return t})();var St=(()=>{let l=class l{constructor(){this.layout=x(V),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=K,this.icons={faUserPen:Qe,faKey:le},this.adminService=x(R)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let n=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:n}).subscribe({next:()=>{this.user.setGroupRole(n),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)}})}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-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,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Edit user"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ee("ngModelChange",function(f){return Z(e.isManager,f)||(e.isManager=f),f}),a(),r(15,"span",4),m(16,"Set as group manager"),a(),d(17,"fa-icon",12),a()()()(),r(18,"small",4),m(19,"As a manager, the user will be able to manage group members but not group properties."),a()(),r(20,"div",13)(21,"button",14),_("click",function(){return e.layout.closeDialog()}),m(22,"Cancel"),a(),r(23,"button",15),_("click",function(){return e.onSubmit()}),m(24," Confirm "),a()()),o&2&&(s(2),c("icon",e.icons.faUserPen),s(2),C(e.user.name),s(10),X("ngModel",e.isManager),s(3),c("icon",e.icons.faKey),s(6),c("disabled",e.submitted))},dependencies:[P,M,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var $t=["MainContextMenu"],Lt=["TargetContextMenu"],Tt=(t,l)=>l.key,jt=(t,l)=>l.mid;function Kt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let o=u();return G(o.openDialog(!0))}),r(3,"span",14),d(4,"fa-icon",7),m(5),a()()(),r(6,"li",27)(7,"a",28),_("click",function(){y(i);let o=u();return G(o.addUserToGroupDialog())}),r(8,"span",14),d(9,"fa-icon",7),m(10,"Add members"),a()()()()}if(t&2){let i=u();s(2),U("disabled",!!i.currentGroup&&i.personalGroupsView),s(2),c("icon",i.icons.GROUPS),s(),$(" ",i.personalGroupsView?"Personal group":"Group"),s(2),U("disabled",!i.currentGroup),s(2),c("icon",i.icons.faUserPlus)}}function Ht(t,l){if(t&1&&d(0,"fa-icon",31),t&2){let i=u(3);c("icon",i.sortTable.sortParam.asc?i.icons.faArrowDown:i.icons.faArrowUp)("fixedWidth",!1)}}function Qt(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let o=u().$implicit,e=u();return G(e.sortBy(o.key))}),m(1),h(2,Ht,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,n=u();k(i.value.class),Ce("width",i.value.width,"%"),U("text-align-center",i.value.textCenter)("cursor-pointer",i.value.sortable),s(),$(" ",i.value.label," "),s(),g(n.sortTable.sortParam.column===i.key?2:-1)}}function qt(t,l){if(t&1&&h(0,Qt,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function Wt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function zt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,n=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",n.icons.GROUPS)}}function Yt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Jt(t,l){if(t&1&&(r(0,"div",34),h(1,Wt,1,1,"img",36)(2,zt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,Yt,1,1,"fa-icon",39),a(),r(7,"span",40),m(8),a()()()),t&2){let i=u(3).$implicit;s(),g(i.isUser?1:2),s(4),$(" ",i.name," "),s(),g(i.isUser&&i.isGroupManager?6:-1),s(2),C(i.description)}}function Xt(t,l){if(t&1&&(r(0,"span"),m(1),v(2,"joinCounts"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.counts))}}function Zt(t,l){if(t&1&&h(0,Xt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function ei(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ti(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ii(t,l){if(t&1&&h(0,ei,2,0,"span",14)(1,ti,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ni(t,l){if(t&1&&(r(0,"div"),m(1),v(2,"amDateFormat"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.modifiedAt))}}function oi(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ni,3,3,"div"),a()),t&2){let i=u(3).$implicit;s(2),C(D(3,2,i.createdAt)),s(2),g(i.modifiedAt?4:-1)}}function ri(t,l){if(t&1&&(r(0,"td"),h(1,Jt,9,4,"div",34)(2,Zt,1,1)(3,ii,2,1)(4,oi,5,4,"div",35),a()),t&2){let i,n=u().$implicit,o=u().$implicit;k(De("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),Ce("width",n.value.width,"%"),U("text-align-center",n.value.textCenter),s(),g((i=n.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ai(t,l){if(t&1&&h(0,ri,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function li(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let o=y(i).$implicit,e=u();return G(e.onSelect(o))})("contextmenu",function(o){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(o,e))})("appTap",function(){let o=y(i).$implicit,e=u();return G(e.browse(o))}),B(1,ai,1,1,null,null,Tt),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,n=u();U("selected",i.mid===(n.selected==null?null:n.selected.mid)),s(),N(T(3,2,n.tableHeaders,n.originalOrderKeyValue))}}function si(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPlus),s(),$(" ",i.personalGroupsView?"Personal group":"Group")}}function mi(t,l){if(t&1){let i=A();w(0,si,3,2,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.openDialog(!0))})}}function pi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Add members"),a()),t&2){let i=u(2);s(),c("icon",i.icons.faUserPlus)}}function ci(t,l){if(t&1){let i=A();w(0,pi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.addUserToGroupDialog())})}}function ui(t,l){}function di(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Refresh"),a()),t&2){let i=u();s(),c("icon",i.icons.faArrowRotateRight)}}function _i(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPen),s(),$(" ",i.selected.isGroup?"Edit group":"Edit user")}}function fi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Delete group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faMinus)}}function hi(t,l){if(t&1){let i=A();w(0,fi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u(2);return G(o.openDialog(!1,!0))})}}function gi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Remove from group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faUserMinus)}}function bi(t,l){if(t&1){let i=A();w(0,gi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u(2);return G(o.openDialog(!1,!0))})}}function Ci(t,l){if(t&1){let i=A();w(0,_i,3,2,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.openDialog())}),h(1,hi,1,0,null,23)(2,bi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var ao=(()=>{let l=class l{constructor(){this.locale=x(oe),this.originalOrderKeyValue=de,this.icons={GROUPS:H.GROUPS,faRotate:Ke,faPlus:ce,faMinus:ae,faPen:me,faArrowDown:Xe,faArrowUp:We,faKey:le,faUserPlus:se,faUserMinus:pe,faArrowRotateRight:Je,faToggleOn:ze,faToggleOff:He},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},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},createdAndModified:{label:"Created & Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.personalGroupsView=!1,this.loading=!1,this.selected=null,this.members=[],this.router=x(Pe),this.activatedRoute=x(Me),this.layout=x(V),this.adminService=x(R),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],createdAndModified:[{prop:"modifiedAt",type:"date"},{prop:"createdAt",type:"date"}]},this.sortTable=new mt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(n=>{this.personalGroupsView=n.type===ue.PERSONAL,this.setEnv(n.routes)}),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(n){this.personalGroupsView=n,this.router.navigate([S.BASE,n?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(n){n.isGroup&&this.router.navigate([n.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(n=null){this.selected=n}onContextMenu(n){n.preventDefault(),n.stopPropagation(),this.layout.openContextMenu(n,this.mainContextMenu)}onTargetContextMenu(n,o){n.preventDefault(),n.type==="contextmenu"&&n.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(n,this.targetContextMenu)}sortBy(n,o=!0,e){this.members=this.sortTable.sortBy(n,o,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(xt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(o=>o.isUser).map(o=>o.id)}}).content.hasChanges.pipe(be(o=>o),O(1)).subscribe(()=>this.refresh())}openDialog(n=!1,o=!1){n?this.personalGroupsView?this.layout.openDialog(Te,"md").content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="add"&&(b.setGroupRole(K.MANAGER),b.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(b)),this.onSelect(b))}):this.layout.openDialog(we,"md",{initialState:{parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;if(f==="add")if(!this.currentGroup&&!b?.parent||b.parent.id===this.currentGroup.id){let F=new ye(ge(he({},b),{type:xe.GROUP}));this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(new ye(ge(he({},b),{type:xe.GROUP})))),this.onSelect(F)}else this.router.navigate([`${S.BASE}/${S.GROUPS}`,b.parent?.id?b.parent.name:""],{queryParams:{select:b.name}}).catch(console.error)}):o?this.layout.openDialog(yt,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(be(p=>p),O(1)).subscribe(()=>{this.currentGroup?this.selected.counts?.groups?this.loadGroups(this.currentGroup.name):(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()):this.loadGroups()}):this.selected.isGroup?this.personalGroupsView?this.layout.openDialog(Te,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="update"&&(this.selected=Object.assign(this.selected,{name:b.name,description:b.description,modifiedAt:b.modifiedAt}))}):this.adminService.getGroup(this.selected.id).subscribe({next:e=>{this.layout.openDialog(we,"md",{initialState:{group:e,parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(f=>{let[b,F]=f;b==="update"&&(!this.currentGroup&&!F?.parent||F.parent.id===this.currentGroup.id?this.selected=Object.assign(this.selected,F):this.router.navigate([`${S.BASE}/${S.GROUPS}`,F.parent?.id?F.parent.name:""],{queryParams:{select:F.name}}).catch(console.error))})},error:e=>this.layout.sendNotification("error","Edit group",this.selected.name,e)}):this.layout.openDialog(St,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(n){let o;n.length?(o=n[n.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(n)}`:`/${S.BASE}/${S.GROUPS}${ve(n)}`,firstLink:`/${S.BASE}/${S.GROUPS}`,splicing:1,translating:!0,sameLink:!1,mutateLevel:{0:{setTitle:this.personalGroupsView?Y.PGROUPS:Y.GROUPS,translateTitle:!0}}})):this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}/${Y.PGROUPS}`:`/${S.BASE}/${S.GROUPS}/${Y.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(o)}loadGroups(n){this.loading=!0,this.onSelect(),this.adminService.browseGroup(n,this.personalGroupsView).subscribe({next:o=>{this.currentGroup=o.parentGroup,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}})}focusOn(n){let o=this.members.find(e=>e.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(o,e){if(o&1&&(Q(Se,5),Q(Ge,7),Q($t,7),Q(Lt,7)),o&2){let p;q(p=W())&&(e.scrollView=p.first),q(p=W())&&(e.inputFilter=p.first),q(p=W())&&(e.mainContextMenu=p.first),q(p=W())&&(e.targetContextMenu=p.first)}},decls:48,vars:42,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"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],[3,"icon"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],["contextMenuItem","",3,"execute"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["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"],[1,"d-flex","flex-column"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,e){if(o&1){let p=A();r(0,"div",2)(1,"button",3),v(2,"translate"),_("click",function(){return y(p),G(e.refresh())}),d(3,"fa-icon",4),a(),r(4,"div",5)(5,"button",6),v(6,"translate"),d(7,"fa-icon",7),a(),w(8,Kt,11,7,"ul",8),a(),r(9,"button",9),v(10,"translate"),_("click",function(){return y(p),G(e.openDialog(!1,!0))}),d(11,"fa-icon",7),a(),r(12,"button",9),v(13,"translate"),_("click",function(){return y(p),G(e.openDialog())}),d(14,"fa-icon",7),a(),r(15,"div",10)(16,"button",11),_("ngModelChange",function(b){return y(p),G(e.onPersonalGroupsView(b))}),r(17,"div",12),d(18,"fa-icon",13),r(19,"span",14),m(20,"Personal groups"),a()()(),r(21,"div",15),d(22,"app-input-filter",16),a()()(),r(23,"table",17)(24,"thead")(25,"tr"),B(26,qt,1,1,null,null,Tt),v(28,"keyvalue"),a()()(),r(29,"app-virtual-scroll",18),v(30,"searchFilter"),_("contextmenu",function(b){return y(p),G(e.onContextMenu(b))}),r(31,"table",17)(32,"tbody",19),B(33,li,4,5,"tr",20,jt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,mi,1,0,null,23),h(42,ci,1,0,null,23),w(43,ui,0,0,"ng-template",24)(44,di,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,Ci,3,1),a()}o&2&&(s(),c("tooltip",T(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",T(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",T(10,27,e.selected!=null&&e.selected.isUser?"Remove from group":"Delete group",e.locale.language)),s(2),c("icon",e.icons.faMinus),s(),c("disabled",!e.selected)("tooltip",T(13,30,e.selected!=null&&e.selected.isGroup?"Edit group":"Edit user",e.locale.language)),s(2),c("icon",e.icons.faPen),s(2),c("ngModel",e.personalGroupsView),s(2),c("icon",e.personalGroupsView?e.icons.faToggleOn:e.icons.faToggleOff),s(8),N(T(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",T(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",T(38,39,"groups",e.locale.language)),s(4),g(e.currentGroup&&!e.personalGroupsView||!e.currentGroup&&e.personalGroupsView?41:-1),s(),g(e.currentGroup?42:-1),s(),c("divider",!0),s(4),g(e.selected?47:-1))},dependencies:[ot,nt,it,P,M,Ge,Se,je,ht,bt,gt,at,ne,L,ie,lt,te,re,st,Ct,_e],encapsulation:2});let t=l;return t})();export{ao as AdminGroupsComponent};
1
+ import{b as R,c as ft}from"./chunk-HE6EDXWI.js";import{a as ue,b as z,c as Ct,d as Te,e as vt}from"./chunk-27XEAHMV.js";import{a as ht,b as gt,c as bt}from"./chunk-2LHHXDD5.js";import{a as S,b as Y,c as tt,e as _t}from"./chunk-NK2NMAJI.js";import{a as lt,c as dt}from"./chunk-KBWK65KM.js";import{a as _e}from"./chunk-GENTF6JM.js";import{a as st}from"./chunk-4DF2SQD4.js";import{a as pt,b as ct,c as ut}from"./chunk-7H5O4BLV.js";import{a as Se}from"./chunk-ZPI7RQ2S.js";import{a as Ge,b as mt}from"./chunk-DDRGLHOP.js";import"./chunk-XHQEF2IX.js";import{m as rt,n as xe,s as ye}from"./chunk-O7UXVNR2.js";import{a as at}from"./chunk-5HYSNQR4.js";import"./chunk-WJYVS27M.js";import{A as Ze,B as K,C as et,Cb as V,J as H,cb as ve,gb as de,s as je,va as it,wa as nt,xa as ot}from"./chunk-L3PDWJZ3.js";import{b as Me,d as Pe}from"./chunk-LFAQLJZK.js";import{Bb as A,Cd as ne,Dd as Le,E as be,Eb as _,Ed as oe,Gb as u,He as Qe,Hf as pe,Ia as J,Jd as re,Kb as Q,Kd as M,Kf as ze,L as O,Lb as q,Ld as Ke,Mb as W,Mf as Ye,Oa as s,Pc as te,Qa as I,Qb as Ce,Qd as ae,Qe as se,Rb as U,Rf as ce,Sb as k,Tb as m,Tf as Je,Ub as C,Vb as $,Vd as He,Wb as Ee,Xb as X,Yb as Z,Zb as ee,ab as E,af as qe,cc as Ae,dc as De,df as We,dg as Xe,ed as Ve,fb as w,fd as Re,hd as Fe,he as le,ja as x,jd as L,kc as v,kd as Ue,lb as h,lc as D,ld as ke,mb as g,mc as T,nd as j,oa as y,od as ie,og as P,pa as G,pb as B,qb as N,rb as c,sb as r,sd as Oe,tb as a,td as Ie,ub as d,ud as Be,vd as Ne,wd as $e,zf as me}from"./chunk-BJARRIS6.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as he,b as ge}from"./chunk-KAVP6UXH.js";var xt=(()=>{let l=class l{constructor(){this.currentMemberIds=[],this.hasChanges=new I,this.layout=x(V),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:se},this.adminService=x(R)}searchMembers(n){let o={search:n,onlyUsers:!0,usersRole:this.parentGroup.type===ue.USER?Ze.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(e=>e.id)]};return this.adminService.searchMembers(o)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(n=>n.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(n=>n.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(o=>o.name).join("<br>"),n,{enableHtml:!0})}})}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-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,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Add members"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"app-user-search",7),ee("membersChange",function(f){return Z(e.newMembers,f)||(e.newMembers=f),f}),a()(),r(11,"div",8)(12,"button",9),_("click",function(){return e.layout.closeDialog()}),m(13,"Cancel"),a(),r(14,"button",10),_("click",function(){return e.onSubmit()}),m(15," Confirm "),a()()),o&2&&(s(2),c("icon",e.icons.faUserPlus),s(2),C(e.parentGroup.name),s(6),X("members",e.newMembers),c("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",e.searchMembers.bind(e)),s(4),c("disabled",e.submitted||!e.newMembers.length))},dependencies:[P,M,dt],encapsulation:2});let t=l;return t})();function wt(t,l){if(t&1&&d(0,"img",9),t&2){let i=u();c("src",i.member.avatarUrl,J)}}function Et(t,l){if(t&1&&d(0,"fa-icon",15),t&2){let i=u();k(i.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",i.icons.GROUPS)}}function At(t,l){if(t&1&&(r(0,"div",7)(1,"span",16),m(2,"from the group"),a(),r(3,"span",11),m(4),v(5,"capitalize"),a()()),t&2){let i=u();s(4),C(D(5,1,i.parentGroup.name))}}function Dt(t,l){t&1&&(r(0,"small",4),m(1,"Only the group will be deleted, the members will no longer be part of it."),a())}var yt=(()=>{let l=class l{constructor(){this.wasDeleted=new I,this.submitted=!1,this.icons={GROUPS:H.GROUPS,faMinus:ae,faUserMinus:pe},this.layout=x(V),this.adminService=x(R)}onSubmit(){this.submitted=!0;let n=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.adminService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.adminService.deleteGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",n,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",n,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-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"],[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"],["l10nTranslate","",1,"mx-1"]],template:function(o,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7),a()(),r(8,"button",5),_("click",function(){return e.onClose()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8),h(12,wt,1,1,"img",9)(13,Et,1,3,"fa-icon",10),a(),r(14,"span",11),m(15),v(16,"capitalize"),a(),r(17,"span",4),m(18,"will be removed"),a(),h(19,At,6,3,"div",7),a(),h(20,Dt,2,0,"small",4),a(),r(21,"div",12)(22,"button",13),_("click",function(){return e.onClose()}),m(23,"Cancel"),a(),r(24,"button",14),_("click",function(){return e.onSubmit()}),m(25," Remove "),a()()),o&2&&(s(2),c("icon",e.member.isUser?e.icons.faUserMinus:e.icons.faMinus),s(2),C(e.member.name),s(3),C(e.member.isUser?"Remove from group":"Delete group"),s(5),g(e.member.isUser?12:13),s(3),C(D(16,8,e.member.name)),s(4),g(e.member.isUser?19:-1),s(),g(e.member.isGroup?20:-1),s(4),c("disabled",e.submitted))},dependencies:[P,M,_t],encapsulation:2});let t=l;return t})();var Mt=(t,l)=>l.value;function Pt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span"),m(2),a()),t&2){let i=u();c("icon",i.icons.faPen),s(2),C(i.group.name)}}function Vt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span",23),m(2,"New group"),a()),t&2){let i=u();c("icon",i.icons.faPlus)}}function Rt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Ft(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Settings"),a()),t&2){let i=u();c("icon",i.icons.faCog)}}function Ut(t,l){if(t&1&&(r(0,"option",21),m(1),a()),t&2){let i=l.$implicit;c("ngValue",i.value),s(),C(i.key)}}function kt(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function Ot(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function It(t,l){t&1&&(r(0,"span",23),m(1,"The group is not visible, its members cannot see it and cannot see each other."),a())}function Bt(t,l){if(t&1&&(r(0,"div",24)(1,"div",18)(2,"label",34),m(3,"Creation date"),a(),r(4,"div",35),m(5),v(6,"amDateFormat"),a()(),r(7,"div",36)(8,"label",37),m(9,"Modification date"),a(),r(10,"div",38),m(11),v(12,"amDateFormat"),a()()()),t&2){let i=u();s(5),C(D(6,2,i.group.createdAt)),s(6),C(D(12,4,i.group.modifiedAt))}}function Nt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Permissions"),a()),t&2){let i=u();c("icon",i.icons.faShieldHalved)}}var we=(()=>{let l=class l{constructor(){this.group=null,this.parentGroup=null,this.groupChange=new I,this.locale=x(oe),this.layout=x(V),this.icons={GROUPS:H.GROUPS,faPen:me,faPlus:ce,faCog:qe,faShieldHalved:Ye},this.submitted=!1,this.originalOrderKeyValue=de,this.allVisibilities={Visible:z.VISIBLE,Private:z.PRIVATE,Isolated:z.ISOLATED},this.adminService=x(R)}ngOnInit(){this.groupForm=new ke({name:new j(this.group?.name||"",Fe.required),description:new j(this.group?.description||""),visibility:new j(this.group?.visibility||z.VISIBLE),applications:new j(this.group?.applications||[]),parent:new j(this.parentGroup)})}updateApplications(n){this.groupForm.controls.applications.setValue(n),this.groupForm.controls.applications.markAsDirty()}onSetParent(n){this.groupForm.controls.parent.setValue(n?{id:n.id,name:n.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(n){let o={search:n,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(o,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let n=this.makeDto();this.adminService.updateGroup(this.group.id,n).subscribe({next:o=>{this.groupChange.emit(["update",o]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:o=>this.onError(o)})}else{let n=this.makeDto(!0);this.adminService.createGroup(n).subscribe({next:o=>{this.groupChange.emit(["add",o]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:o=>this.onError(o)})}}makeDto(n=!1){let o;n?o=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):o=Object.fromEntries(Object.keys(this.groupForm.controls).filter(e=>this.groupForm.controls[e].dirty).map(e=>[e,this.groupForm.controls[e].value]));for(let e in o)switch(e){case"applications":o.permissions=o[e].join(et),delete o.applications;break;case"parent":o.parentId=o[e]?o[e].id:null,delete o.parent;break}return o}onError(n){this.layout.sendNotification("error","Group error",this.groupForm.value.name,n),this.submitted=!1}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-dialog"]],inputs:{group:"group",parentGroup:"parentGroup"},outputs:{groupChange:"groupChange"},decls:50,vars:24,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body","form-validation",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","formControlName","name","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","formControlName","description","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"d-flex","flex-column","align-items-start","col-12","pb-3"],[1,"col-6","pe-4"],["for","visibility","l10nTranslate",""],["id","visibility","formControlName","visibility",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],[1,"d-none","d-sm-block","fst-italic","fs-xxs"],["l10nTranslate",""],[1,"d-flex","align-items-start","col-12","pb-3"],["for","parent","translate",""],["id","parent",3,"data","searchFunction","active","itemIcon","placeholder"],[3,"permissionsChange","permissions"],[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"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","modified","l10nTranslate",""],["id","modified"]],template:function(o,e){if(o&1&&(r(0,"div",0)(1,"h4",1),h(2,Pt,3,2)(3,Vt,3,1),a(),h(4,Rt,3,0,"h4",2),r(5,"button",3),_("click",function(){return e.layout.closeDialog()}),a()(),r(6,"div",4)(7,"tabset",5),d(8,"hr",6),r(9,"tab",7),_("selectTab",function(){return e.tabView=null}),w(10,Ft,3,1,"ng-template",8),r(11,"div",9)(12,"div",10)(13,"div",11)(14,"label",12),m(15,"Name"),a(),d(16,"input",13),a(),r(17,"div",14)(18,"label",15),m(19,"Description"),a(),d(20,"input",16),a()(),r(21,"div",17)(22,"div",18)(23,"label",19),m(24,"Visibility"),a(),r(25,"select",20),B(26,Ut,2,2,"option",21,Mt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,kt,2,0,"span",23)(31,Ot,2,0,"span",23)(32,It,2,0,"span",23),a()(),r(33,"div",24)(34,"div",18)(35,"label",25),m(36,"Parent group"),a(),r(37,"app-select",26),v(38,"translate"),_("data",function(f){return e.onSetParent(f)}),a()()(),h(39,Bt,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),w(41,Nt,3,1,"ng-template",8),r(42,"div",9)(43,"div",10)(44,"app-admin-permissions",27),_("permissionsChange",function(f){return e.updateApplications(f)}),a()()()()()(),r(45,"div",28)(46,"button",29),_("click",function(){return e.layout.closeDialog()}),m(47,"Cancel"),a(),r(48,"button",30),_("click",function(){return e.onSubmit()}),m(49," Confirm "),a()()),o&2){let p;s(2),g(e.group?2:3),s(2),g(e.group?4:-1),s(),k(Ae("btn-close btn-close-white ",e.group?"ms-2":"ms-auto"," ms-2")),s(),c("formGroup",e.groupForm),s(),c("justified",!0),s(9),U("is-invalid",e.groupForm.controls.name.invalid),c("autoSelect",!1),s(10),N(T(28,18,e.allVisibilities,e.originalOrderKeyValue)),s(4),g((p=e.groupForm.value.visibility)===e.allVisibilities.Visible?30:p===e.allVisibilities.Private?31:p===e.allVisibilities.Isolated?32:-1),s(7),c("searchFunction",e.searchGroups.bind(e))("active",e.groupForm.value.parent)("itemIcon",e.icons.GROUPS)("placeholder",T(38,21,"Select the parent group",e.locale.language)),s(2),g(e.group?39:-1),s(5),c("permissions",e.groupForm.value.applications),s(4),c("disabled",e.submitted||e.groupForm.invalid)}},dependencies:[P,M,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,rt,ft,vt,ct,ut,pt,te,re,_e],encapsulation:2});let t=l;return t})();var St=(()=>{let l=class l{constructor(){this.layout=x(V),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=K,this.icons={faUserPen:Qe,faKey:le},this.adminService=x(R)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let n=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:n}).subscribe({next:()=>{this.user.setGroupRole(n),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)}})}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-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,e){o&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Edit user"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ee("ngModelChange",function(f){return Z(e.isManager,f)||(e.isManager=f),f}),a(),r(15,"span",4),m(16,"Set as group manager"),a(),d(17,"fa-icon",12),a()()()(),r(18,"small",4),m(19,"As a manager, the user will be able to manage group members but not group properties."),a()(),r(20,"div",13)(21,"button",14),_("click",function(){return e.layout.closeDialog()}),m(22,"Cancel"),a(),r(23,"button",15),_("click",function(){return e.onSubmit()}),m(24," Confirm "),a()()),o&2&&(s(2),c("icon",e.icons.faUserPen),s(2),C(e.user.name),s(10),X("ngModel",e.isManager),s(3),c("icon",e.icons.faKey),s(6),c("disabled",e.submitted))},dependencies:[P,M,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var $t=["MainContextMenu"],Lt=["TargetContextMenu"],Tt=(t,l)=>l.key,jt=(t,l)=>l.mid;function Kt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let o=u();return G(o.openDialog(!0))}),r(3,"span",14),d(4,"fa-icon",7),m(5),a()()(),r(6,"li",27)(7,"a",28),_("click",function(){y(i);let o=u();return G(o.addUserToGroupDialog())}),r(8,"span",14),d(9,"fa-icon",7),m(10,"Add members"),a()()()()}if(t&2){let i=u();s(2),U("disabled",!!i.currentGroup&&i.personalGroupsView),s(2),c("icon",i.icons.GROUPS),s(),$(" ",i.personalGroupsView?"Personal group":"Group"),s(2),U("disabled",!i.currentGroup),s(2),c("icon",i.icons.faUserPlus)}}function Ht(t,l){if(t&1&&d(0,"fa-icon",31),t&2){let i=u(3);c("icon",i.sortTable.sortParam.asc?i.icons.faArrowDown:i.icons.faArrowUp)("fixedWidth",!1)}}function Qt(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let o=u().$implicit,e=u();return G(e.sortBy(o.key))}),m(1),h(2,Ht,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,n=u();k(i.value.class),Ce("width",i.value.width,"%"),U("text-align-center",i.value.textCenter)("cursor-pointer",i.value.sortable),s(),$(" ",i.value.label," "),s(),g(n.sortTable.sortParam.column===i.key?2:-1)}}function qt(t,l){if(t&1&&h(0,Qt,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function Wt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function zt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,n=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",n.icons.GROUPS)}}function Yt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Jt(t,l){if(t&1&&(r(0,"div",34),h(1,Wt,1,1,"img",36)(2,zt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,Yt,1,1,"fa-icon",39),a(),r(7,"span",40),m(8),a()()()),t&2){let i=u(3).$implicit;s(),g(i.isUser?1:2),s(4),$(" ",i.name," "),s(),g(i.isUser&&i.isGroupManager?6:-1),s(2),C(i.description)}}function Xt(t,l){if(t&1&&(r(0,"span"),m(1),v(2,"joinCounts"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.counts))}}function Zt(t,l){if(t&1&&h(0,Xt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function ei(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ti(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ii(t,l){if(t&1&&h(0,ei,2,0,"span",14)(1,ti,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ni(t,l){if(t&1&&(r(0,"div"),m(1),v(2,"amDateFormat"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.modifiedAt))}}function oi(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ni,3,3,"div"),a()),t&2){let i=u(3).$implicit;s(2),C(D(3,2,i.createdAt)),s(2),g(i.modifiedAt?4:-1)}}function ri(t,l){if(t&1&&(r(0,"td"),h(1,Jt,9,4,"div",34)(2,Zt,1,1)(3,ii,2,1)(4,oi,5,4,"div",35),a()),t&2){let i,n=u().$implicit,o=u().$implicit;k(De("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),Ce("width",n.value.width,"%"),U("text-align-center",n.value.textCenter),s(),g((i=n.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ai(t,l){if(t&1&&h(0,ri,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function li(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let o=y(i).$implicit,e=u();return G(e.onSelect(o))})("contextmenu",function(o){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(o,e))})("appTap",function(){let o=y(i).$implicit,e=u();return G(e.browse(o))}),B(1,ai,1,1,null,null,Tt),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,n=u();U("selected",i.mid===(n.selected==null?null:n.selected.mid)),s(),N(T(3,2,n.tableHeaders,n.originalOrderKeyValue))}}function si(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPlus),s(),$(" ",i.personalGroupsView?"Personal group":"Group")}}function mi(t,l){if(t&1){let i=A();w(0,si,3,2,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.openDialog(!0))})}}function pi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Add members"),a()),t&2){let i=u(2);s(),c("icon",i.icons.faUserPlus)}}function ci(t,l){if(t&1){let i=A();w(0,pi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.addUserToGroupDialog())})}}function ui(t,l){}function di(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Refresh"),a()),t&2){let i=u();s(),c("icon",i.icons.faArrowRotateRight)}}function _i(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPen),s(),$(" ",i.selected.isGroup?"Edit group":"Edit user")}}function fi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Delete group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faMinus)}}function hi(t,l){if(t&1){let i=A();w(0,fi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u(2);return G(o.openDialog(!1,!0))})}}function gi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Remove from group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faUserMinus)}}function bi(t,l){if(t&1){let i=A();w(0,gi,3,1,"ng-template",25),_("execute",function(){y(i);let o=u(2);return G(o.openDialog(!1,!0))})}}function Ci(t,l){if(t&1){let i=A();w(0,_i,3,2,"ng-template",25),_("execute",function(){y(i);let o=u();return G(o.openDialog())}),h(1,hi,1,0,null,23)(2,bi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var ao=(()=>{let l=class l{constructor(){this.locale=x(oe),this.originalOrderKeyValue=de,this.icons={GROUPS:H.GROUPS,faRotate:Ke,faPlus:ce,faMinus:ae,faPen:me,faArrowDown:Xe,faArrowUp:We,faKey:le,faUserPlus:se,faUserMinus:pe,faArrowRotateRight:Je,faToggleOn:ze,faToggleOff:He},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},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},createdAndModified:{label:"Created & Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.personalGroupsView=!1,this.loading=!1,this.selected=null,this.members=[],this.router=x(Pe),this.activatedRoute=x(Me),this.layout=x(V),this.adminService=x(R),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],createdAndModified:[{prop:"modifiedAt",type:"date"},{prop:"createdAt",type:"date"}]},this.sortTable=new mt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(n=>{this.personalGroupsView=n.type===ue.PERSONAL,this.setEnv(n.routes)}),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(n){this.personalGroupsView=n,this.router.navigate([S.BASE,n?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(n){n.isGroup&&this.router.navigate([n.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(n=null){this.selected=n}onContextMenu(n){n.preventDefault(),n.stopPropagation(),this.layout.openContextMenu(n,this.mainContextMenu)}onTargetContextMenu(n,o){n.preventDefault(),n.type==="contextmenu"&&n.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(n,this.targetContextMenu)}sortBy(n,o=!0,e){this.members=this.sortTable.sortBy(n,o,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(xt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(o=>o.isUser).map(o=>o.id)}}).content.hasChanges.pipe(be(o=>o),O(1)).subscribe(()=>this.refresh())}openDialog(n=!1,o=!1){n?this.personalGroupsView?this.layout.openDialog(Te,"md").content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="add"&&(b.setGroupRole(K.MANAGER),b.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(b)),this.onSelect(b))}):this.layout.openDialog(we,"md",{initialState:{parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;if(f==="add")if(!this.currentGroup&&!b?.parent||b.parent.id===this.currentGroup.id){let F=new ye(ge(he({},b),{type:xe.GROUP}));this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(new ye(ge(he({},b),{type:xe.GROUP})))),this.onSelect(F)}else this.router.navigate([`${S.BASE}/${S.GROUPS}`,b.parent?.id?b.parent.name:""],{queryParams:{select:b.name}}).catch(console.error)}):o?this.layout.openDialog(yt,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(be(p=>p),O(1)).subscribe(()=>{this.currentGroup?this.selected.counts?.groups?this.loadGroups(this.currentGroup.name):(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()):this.loadGroups()}):this.selected.isGroup?this.personalGroupsView?this.layout.openDialog(Te,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="update"&&(this.selected=Object.assign(this.selected,{name:b.name,description:b.description,modifiedAt:b.modifiedAt}))}):this.adminService.getGroup(this.selected.id).subscribe({next:e=>{this.layout.openDialog(we,"md",{initialState:{group:e,parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(f=>{let[b,F]=f;b==="update"&&(!this.currentGroup&&!F?.parent||F.parent.id===this.currentGroup.id?this.selected=Object.assign(this.selected,F):this.router.navigate([`${S.BASE}/${S.GROUPS}`,F.parent?.id?F.parent.name:""],{queryParams:{select:F.name}}).catch(console.error))})},error:e=>this.layout.sendNotification("error","Edit group",this.selected.name,e)}):this.layout.openDialog(St,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(n){let o;n.length?(o=n[n.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(n)}`:`/${S.BASE}/${S.GROUPS}${ve(n)}`,firstLink:`/${S.BASE}/${S.GROUPS}`,splicing:1,translating:!0,sameLink:!1,mutateLevel:{0:{setTitle:this.personalGroupsView?Y.PGROUPS:Y.GROUPS,translateTitle:!0}}})):this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}/${Y.PGROUPS}`:`/${S.BASE}/${S.GROUPS}/${Y.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(o)}loadGroups(n){this.loading=!0,this.onSelect(),this.adminService.browseGroup(n,this.personalGroupsView).subscribe({next:o=>{this.currentGroup=o.parentGroup,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}})}focusOn(n){let o=this.members.find(e=>e.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(o,e){if(o&1&&(Q(Se,5),Q(Ge,7),Q($t,7),Q(Lt,7)),o&2){let p;q(p=W())&&(e.scrollView=p.first),q(p=W())&&(e.inputFilter=p.first),q(p=W())&&(e.mainContextMenu=p.first),q(p=W())&&(e.targetContextMenu=p.first)}},decls:48,vars:42,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"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],[3,"icon"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],["contextMenuItem","",3,"execute"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["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"],[1,"d-flex","flex-column"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(o,e){if(o&1){let p=A();r(0,"div",2)(1,"button",3),v(2,"translate"),_("click",function(){return y(p),G(e.refresh())}),d(3,"fa-icon",4),a(),r(4,"div",5)(5,"button",6),v(6,"translate"),d(7,"fa-icon",7),a(),w(8,Kt,11,7,"ul",8),a(),r(9,"button",9),v(10,"translate"),_("click",function(){return y(p),G(e.openDialog(!1,!0))}),d(11,"fa-icon",7),a(),r(12,"button",9),v(13,"translate"),_("click",function(){return y(p),G(e.openDialog())}),d(14,"fa-icon",7),a(),r(15,"div",10)(16,"button",11),_("ngModelChange",function(b){return y(p),G(e.onPersonalGroupsView(b))}),r(17,"div",12),d(18,"fa-icon",13),r(19,"span",14),m(20,"Personal groups"),a()()(),r(21,"div",15),d(22,"app-input-filter",16),a()()(),r(23,"table",17)(24,"thead")(25,"tr"),B(26,qt,1,1,null,null,Tt),v(28,"keyvalue"),a()()(),r(29,"app-virtual-scroll",18),v(30,"searchFilter"),_("contextmenu",function(b){return y(p),G(e.onContextMenu(b))}),r(31,"table",17)(32,"tbody",19),B(33,li,4,5,"tr",20,jt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,mi,1,0,null,23),h(42,ci,1,0,null,23),w(43,ui,0,0,"ng-template",24)(44,di,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,Ci,3,1),a()}o&2&&(s(),c("tooltip",T(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",T(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",T(10,27,e.selected!=null&&e.selected.isUser?"Remove from group":"Delete group",e.locale.language)),s(2),c("icon",e.icons.faMinus),s(),c("disabled",!e.selected)("tooltip",T(13,30,e.selected!=null&&e.selected.isGroup?"Edit group":"Edit user",e.locale.language)),s(2),c("icon",e.icons.faPen),s(2),c("ngModel",e.personalGroupsView),s(2),c("icon",e.personalGroupsView?e.icons.faToggleOn:e.icons.faToggleOff),s(8),N(T(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",T(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",T(38,39,"groups",e.locale.language)),s(4),g(e.currentGroup&&!e.personalGroupsView||!e.currentGroup&&e.personalGroupsView?41:-1),s(),g(e.currentGroup?42:-1),s(),c("divider",!0),s(4),g(e.selected?47:-1))},dependencies:[ot,nt,it,P,M,Ge,Se,je,ht,bt,gt,at,ne,L,ie,lt,te,re,st,Ct,_e],encapsulation:2});let t=l;return t})();export{ao as AdminGroupsComponent};
@@ -1 +1 @@
1
- import{a as M,b as R}from"./chunk-GRLHFXGB.js";import"./chunk-YMAN4LIU.js";import{f as I,h as W}from"./chunk-ZXXHFBGL.js";import"./chunk-MYM43ENO.js";import{Cb as O,pb as N,qb as y,rb as d,s as b,xb as u,zb as A}from"./chunk-I2S3XPC5.js";import{d as w}from"./chunk-Y5RLD72B.js";import{Eb as x,Gb as m,Ia as C,Kd as z,Oa as o,Sb as T,Tb as a,Ub as p,ab as E,cc as g,ja as v,lb as S,mb as h,og as D,rb as s,sb as i,tb as n,ub as l}from"./chunk-IOIBQGHN.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{i as P}from"./chunk-KAVP6UXH.js";function L(e,r){if(e&1&&l(0,"fa-icon",24),e&2){let t=m();T(g("circle-",t.syncService.wizard.remotePath.iconClass,"-icon")),s("icon",t.syncService.wizard.remotePath.icon)}}function Y(e,r){if(e&1&&l(0,"img",7),e&2){let t=m();s("src",t.syncService.wizard.remotePath.mimeUrl,C)}}function k(e,r){if(e&1&&(i(0,"div",18),a(1),n()),e&2){let t=m();o(),p(t.error)}}function B(e,r){e&1&&(i(0,"span",26),a(1,"and from"),n())}function F(e,r){e&1&&(i(0,"span",28),a(1,"to"),n())}function Z(e,r){e&1&&(i(0,"span",26),a(1,"(Two-Way)"),n())}function U(e,r){e&1&&(i(0,"span",26),a(1,"(One-Way)"),n())}function V(e,r){e&1&&(i(0,"span",28),a(1,"the most recent files will be kept"),n())}function $(e,r){if(e&1&&(i(0,"span",26),a(1,"the files in"),n(),i(2,"span",29),a(3),n(),i(4,"span",26),a(5,"will be preferred"),n()),e&2){let t=m(3);o(3),p(t.syncPath.settings.conflictMode===t.SYNC_PATH_CONFLICT_MODE.LOCAL?t.syncService.wizard.localPath.name:t.syncService.wizard.remotePath.name)}}function j(e,r){if(e&1&&(i(0,"div")(1,"span",26),a(2,"In case of conflict,"),n(),i(3,"span"),a(4,"\xA0"),n(),S(5,V,2,0,"span",28)(6,$,6,1),n()),e&2){let t=m(2);o(5),h(t.syncPath.settings.conflictMode===t.SYNC_PATH_CONFLICT_MODE.RECENT?5:6)}}function G(e,r){if(e&1&&(i(0,"div")(1,"span",26),a(2,"All files created or modified in"),n(),i(3,"span",30),a(4),n(),i(5,"span",26),a(6,"will be ignored and deleted"),n()()),e&2){let t=m(2);o(4),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?t.syncService.wizard.localPath.name:t.syncService.wizard.remotePath.name)}}function q(e,r){if(e&1&&(i(0,"div",25)(1,"span",26),a(2,"The data will be synchronized from"),n(),i(3,"span",27),a(4),n(),S(5,B,2,0,"span",26)(6,F,2,0,"span",28),i(7,"span",27),a(8),n(),S(9,Z,2,0,"span",26)(10,U,2,0,"span",26),n(),l(11,"br"),i(12,"div",25),S(13,j,7,1,"div")(14,G,7,1,"div"),n()),e&2){let t=m();o(4),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?"the server folder":"the client folder"),o(),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?5:6),o(3),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?"the client folder":"the server folder"),o(),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?9:10),o(4),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?13:14)}}var de=(()=>{let r=class r{constructor(){this.syncService=v(W),this.SYNC_PATH_CONFLICT_MODE=A,this.SYNC_PATH_MODE=u,this.icons={CLIENT:y.CLIENT,SERVER:y.SERVER},this.translatedRemotePath=this.syncService.translateServerPath(this.syncService.wizard.remotePath.serverPath),this.error=null,this.router=v(w),this.layout=v(O),this.syncPath=new I({settings:{name:this.syncService.wizard.localPath.name,localPath:this.syncService.wizard.localPath.path,remotePath:this.syncService.wizard.remotePath.serverPath,enabled:this.syncService.wizard.settings.enabled,mode:this.syncService.wizard.remotePath.isWriteable?this.syncService.wizard.settings.mode:u.DOWNLOAD,conflictMode:this.syncService.wizard.settings.conflictMode,diffMode:this.syncService.wizard.settings.diffMode,scheduler:this.syncService.wizard.settings.scheduler,permissions:this.syncService.wizard.remotePath.permissions}}),this.layout.setBreadcrumbIcon(y.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_SETTINGS}/${N.WIZARD_SETTINGS}`,splicing:3,translating:!0,sameLink:!0})}onPrevious(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onSubmit(){return P(this,null,function*(){let _=yield this.syncService.addPath(this.syncPath.settings);typeof _=="string"?this.error=_:(yield this.syncService.refreshPaths(),this.router.navigate([d.BASE,d.PATHS],{state:{id:_.id,withSettings:!1}}).catch(console.error),this.syncService.resetWizard())})}};r.\u0275fac=function(f){return new(f||r)},r.\u0275cmp=E({type:r,selectors:[["app-sync-wizard-settings"]],decls:38,vars:12,consts:[[1,"wizard","fs-sm"],[1,"d-flex","flex-row","justify-content-center","mb-3"],[1,"d-flex","flex-column","align-items-end"],[1,"fw-bold","mb-1","me-1"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["placement","left",1,"cursor-pointer",3,"tooltip"],["alt","","height","35",3,"src"],[1,"position-absolute","text-truncate","pe-2",2,"top","110px"],[1,"d-flex","align-items-end","mb-2","mx-5"],[3,"syncPath"],[1,"d-flex","flex-column","align-items-start"],[1,"fw-bold","mb-1","ms-1"],["placement","right",1,"cursor-pointer",3,"tooltip"],[2,"width","32px","height","32px","font-size","16px",3,"icon","class"],[1,"position-absolute","text-truncate","ps-2",2,"top","110px"],[1,"mt-auto"],[1,"mb-auto"],["l10nTranslate","",1,"text-center","text-warning"],[1,"d-flex","align-items-start"],["translate","","type","button",1,"btn","btn-sm","btn-secondary","me-auto",3,"click"],[1,"fas","fa-arrow-circle-left","fa-fw"],["translate","","type","button",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click","disabled"],[1,"fas","fa-check-circle","fa-fw"],[2,"width","32px","height","32px","font-size","16px",3,"icon"],[1,"text-center"],["l10nTranslate",""],["l10nTranslate","",1,"mx-1"],["l10nTranslate","",1,"fw-bold"],[1,"fw-bold","mx-1"],["l10nTranslate","",1,"fw-bold","mx-1"]],template:function(f,c){f&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",2)(4,"div",3),l(5,"fa-icon",4),i(6,"span",5),a(7,"Client"),n()(),i(8,"div",6),l(9,"img",7),n(),i(10,"div",8),a(11),n()()(),i(12,"div",9),l(13,"app-sync-path-direction-icon",10),n(),i(14,"div",11)(15,"div",11)(16,"div",12),l(17,"fa-icon",4),i(18,"span",5),a(19,"Server"),n()(),i(20,"div",13),S(21,L,1,4,"fa-icon",14)(22,Y,1,1,"img",7),n(),i(23,"div",15),a(24),n()()()(),l(25,"hr",16)(26,"app-sync-path-settings",10)(27,"hr",17),S(28,k,2,1,"div",18)(29,q,15,5),i(30,"div",16)(31,"div",19)(32,"button",20),x("click",function(){return c.onPrevious()}),l(33,"i",21),a(34," Previous "),n(),i(35,"button",22),x("click",function(){return c.onSubmit()}),l(36,"i",23),a(37," Done "),n()()()()),f&2&&(o(5),s("icon",c.icons.CLIENT),o(3),s("tooltip",c.syncService.wizard.localPath.path),o(),s("src",c.syncService.wizard.localPath.mimeUrl,C),o(2),p(c.syncService.wizard.localPath.name),o(2),s("syncPath",c.syncPath),o(4),s("icon",c.icons.SERVER),o(3),s("tooltip",c.translatedRemotePath),o(),h(c.syncService.wizard.remotePath.icon?21:22),o(3),p(c.syncService.wizard.remotePath.name),o(2),s("syncPath",c.syncPath),o(2),h(c.error?28:29),o(7),s("disabled",!c.syncPath.settings.name))},dependencies:[z,D,b,M,R],encapsulation:2});let e=r;return e})();export{de as SyncWizardSettingsComponent};
1
+ import{a as M,b as R}from"./chunk-YXWF2DGF.js";import"./chunk-2CAAJBRO.js";import{f as I,h as W}from"./chunk-FLPZB3OX.js";import"./chunk-MYM43ENO.js";import{Cb as O,pb as N,qb as y,rb as d,s as b,xb as u,zb as A}from"./chunk-L3PDWJZ3.js";import{d as w}from"./chunk-LFAQLJZK.js";import{Eb as x,Gb as m,Ia as C,Kd as z,Oa as o,Sb as T,Tb as a,Ub as p,ab as E,cc as g,ja as v,lb as S,mb as h,og as D,rb as s,sb as i,tb as n,ub as l}from"./chunk-BJARRIS6.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{i as P}from"./chunk-KAVP6UXH.js";function L(e,r){if(e&1&&l(0,"fa-icon",24),e&2){let t=m();T(g("circle-",t.syncService.wizard.remotePath.iconClass,"-icon")),s("icon",t.syncService.wizard.remotePath.icon)}}function Y(e,r){if(e&1&&l(0,"img",7),e&2){let t=m();s("src",t.syncService.wizard.remotePath.mimeUrl,C)}}function k(e,r){if(e&1&&(i(0,"div",18),a(1),n()),e&2){let t=m();o(),p(t.error)}}function B(e,r){e&1&&(i(0,"span",26),a(1,"and from"),n())}function F(e,r){e&1&&(i(0,"span",28),a(1,"to"),n())}function Z(e,r){e&1&&(i(0,"span",26),a(1,"(Two-Way)"),n())}function U(e,r){e&1&&(i(0,"span",26),a(1,"(One-Way)"),n())}function V(e,r){e&1&&(i(0,"span",28),a(1,"the most recent files will be kept"),n())}function $(e,r){if(e&1&&(i(0,"span",26),a(1,"the files in"),n(),i(2,"span",29),a(3),n(),i(4,"span",26),a(5,"will be preferred"),n()),e&2){let t=m(3);o(3),p(t.syncPath.settings.conflictMode===t.SYNC_PATH_CONFLICT_MODE.LOCAL?t.syncService.wizard.localPath.name:t.syncService.wizard.remotePath.name)}}function j(e,r){if(e&1&&(i(0,"div")(1,"span",26),a(2,"In case of conflict,"),n(),i(3,"span"),a(4,"\xA0"),n(),S(5,V,2,0,"span",28)(6,$,6,1),n()),e&2){let t=m(2);o(5),h(t.syncPath.settings.conflictMode===t.SYNC_PATH_CONFLICT_MODE.RECENT?5:6)}}function G(e,r){if(e&1&&(i(0,"div")(1,"span",26),a(2,"All files created or modified in"),n(),i(3,"span",30),a(4),n(),i(5,"span",26),a(6,"will be ignored and deleted"),n()()),e&2){let t=m(2);o(4),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?t.syncService.wizard.localPath.name:t.syncService.wizard.remotePath.name)}}function q(e,r){if(e&1&&(i(0,"div",25)(1,"span",26),a(2,"The data will be synchronized from"),n(),i(3,"span",27),a(4),n(),S(5,B,2,0,"span",26)(6,F,2,0,"span",28),i(7,"span",27),a(8),n(),S(9,Z,2,0,"span",26)(10,U,2,0,"span",26),n(),l(11,"br"),i(12,"div",25),S(13,j,7,1,"div")(14,G,7,1,"div"),n()),e&2){let t=m();o(4),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?"the server folder":"the client folder"),o(),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?5:6),o(3),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?"the client folder":"the server folder"),o(),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?9:10),o(4),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?13:14)}}var de=(()=>{let r=class r{constructor(){this.syncService=v(W),this.SYNC_PATH_CONFLICT_MODE=A,this.SYNC_PATH_MODE=u,this.icons={CLIENT:y.CLIENT,SERVER:y.SERVER},this.translatedRemotePath=this.syncService.translateServerPath(this.syncService.wizard.remotePath.serverPath),this.error=null,this.router=v(w),this.layout=v(O),this.syncPath=new I({settings:{name:this.syncService.wizard.localPath.name,localPath:this.syncService.wizard.localPath.path,remotePath:this.syncService.wizard.remotePath.serverPath,enabled:this.syncService.wizard.settings.enabled,mode:this.syncService.wizard.remotePath.isWriteable?this.syncService.wizard.settings.mode:u.DOWNLOAD,conflictMode:this.syncService.wizard.settings.conflictMode,diffMode:this.syncService.wizard.settings.diffMode,scheduler:this.syncService.wizard.settings.scheduler,permissions:this.syncService.wizard.remotePath.permissions}}),this.layout.setBreadcrumbIcon(y.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_SETTINGS}/${N.WIZARD_SETTINGS}`,splicing:3,translating:!0,sameLink:!0})}onPrevious(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onSubmit(){return P(this,null,function*(){let _=yield this.syncService.addPath(this.syncPath.settings);typeof _=="string"?this.error=_:(yield this.syncService.refreshPaths(),this.router.navigate([d.BASE,d.PATHS],{state:{id:_.id,withSettings:!1}}).catch(console.error),this.syncService.resetWizard())})}};r.\u0275fac=function(f){return new(f||r)},r.\u0275cmp=E({type:r,selectors:[["app-sync-wizard-settings"]],decls:38,vars:12,consts:[[1,"wizard","fs-sm"],[1,"d-flex","flex-row","justify-content-center","mb-3"],[1,"d-flex","flex-column","align-items-end"],[1,"fw-bold","mb-1","me-1"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["placement","left",1,"cursor-pointer",3,"tooltip"],["alt","","height","35",3,"src"],[1,"position-absolute","text-truncate","pe-2",2,"top","110px"],[1,"d-flex","align-items-end","mb-2","mx-5"],[3,"syncPath"],[1,"d-flex","flex-column","align-items-start"],[1,"fw-bold","mb-1","ms-1"],["placement","right",1,"cursor-pointer",3,"tooltip"],[2,"width","32px","height","32px","font-size","16px",3,"icon","class"],[1,"position-absolute","text-truncate","ps-2",2,"top","110px"],[1,"mt-auto"],[1,"mb-auto"],["l10nTranslate","",1,"text-center","text-warning"],[1,"d-flex","align-items-start"],["translate","","type","button",1,"btn","btn-sm","btn-secondary","me-auto",3,"click"],[1,"fas","fa-arrow-circle-left","fa-fw"],["translate","","type","button",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click","disabled"],[1,"fas","fa-check-circle","fa-fw"],[2,"width","32px","height","32px","font-size","16px",3,"icon"],[1,"text-center"],["l10nTranslate",""],["l10nTranslate","",1,"mx-1"],["l10nTranslate","",1,"fw-bold"],[1,"fw-bold","mx-1"],["l10nTranslate","",1,"fw-bold","mx-1"]],template:function(f,c){f&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",2)(4,"div",3),l(5,"fa-icon",4),i(6,"span",5),a(7,"Client"),n()(),i(8,"div",6),l(9,"img",7),n(),i(10,"div",8),a(11),n()()(),i(12,"div",9),l(13,"app-sync-path-direction-icon",10),n(),i(14,"div",11)(15,"div",11)(16,"div",12),l(17,"fa-icon",4),i(18,"span",5),a(19,"Server"),n()(),i(20,"div",13),S(21,L,1,4,"fa-icon",14)(22,Y,1,1,"img",7),n(),i(23,"div",15),a(24),n()()()(),l(25,"hr",16)(26,"app-sync-path-settings",10)(27,"hr",17),S(28,k,2,1,"div",18)(29,q,15,5),i(30,"div",16)(31,"div",19)(32,"button",20),x("click",function(){return c.onPrevious()}),l(33,"i",21),a(34," Previous "),n(),i(35,"button",22),x("click",function(){return c.onSubmit()}),l(36,"i",23),a(37," Done "),n()()()()),f&2&&(o(5),s("icon",c.icons.CLIENT),o(3),s("tooltip",c.syncService.wizard.localPath.path),o(),s("src",c.syncService.wizard.localPath.mimeUrl,C),o(2),p(c.syncService.wizard.localPath.name),o(2),s("syncPath",c.syncPath),o(4),s("icon",c.icons.SERVER),o(3),s("tooltip",c.translatedRemotePath),o(),h(c.syncService.wizard.remotePath.icon?21:22),o(3),p(c.syncService.wizard.remotePath.name),o(2),s("syncPath",c.syncPath),o(2),h(c.error?28:29),o(7),s("disabled",!c.syncPath.settings.name))},dependencies:[z,D,b,M,R],encapsulation:2});let e=r;return e})();export{de as SyncWizardSettingsComponent};
@@ -1,4 +1,4 @@
1
- import{e as ot}from"./chunk-XCLK7NJL.js";import{n as it,r as nt}from"./chunk-FNOTGWRW.js";import{a as at,b as st}from"./chunk-ZCOWBVOT.js";import{J as qe,Nb as et,Pb as tt,c as Be,d as X,f as z,g as fe,gb as Je,h as J,l as ye,o as $,p as ee,s as Ye,t as Ke}from"./chunk-I2S3XPC5.js";import{Aa as R,Ac as ue,Bb as M,Cd as $e,E as be,Eb as b,Ed as We,Gb as r,H as Se,Ha as U,Ia as ne,Ic as De,J as ie,Jc as Fe,Jd as Ge,Kb as B,Kd as je,Lb as H,Mb as V,Mc as ke,Oa as c,Pb as F,Pc as Re,Qa as g,Qb as Ae,Qc as Ue,Ra as K,Rb as le,Sb as q,Tb as S,Ub as T,Wa as ae,Xa as v,Xb as he,Ya as Ie,Yb as ce,Zb as pe,_ as Te,a as ve,aa as Y,ab as Q,bb as we,c as Ce,cb as Z,cc as Pe,db as Me,ea as Ee,ec as de,fa as Oe,fb as w,fd as He,id as Ve,ja as D,jc as me,jd as Ne,k as te,kb as se,kc as E,lb as C,lc as Le,mb as x,mc as I,o as xe,oa as y,oc as N,od as ze,og as Xe,pa as _,pb as oe,qb as re,r as G,rb as p,sb as m,tb as u,ub as f,vf as Qe,x as j,zf as Ze}from"./chunk-IOIBQGHN.js";var Jt=(()=>{let a=class a{constructor(){this.maxMove=10,this.maxDuration=350,this.doubleTapInterval=600,this.doubleTapSlop=24,this.enableDoubleTap=!0,this.emitSingleWhenNoDouble=!1,this.preventGhostClick=!0,this.preventDefault=!1,this.disabled=!1,this.appTap=new g,this.elRef=D(R),this.zone=D(K),this.removeFns=[],this.active=!1,this.pointerId=null,this.startX=0,this.startY=0,this.startTime=0,this.moved=!1,this.lastEmitTs=0,this.pendingSingle=null,this.singleTimer=null,this.onDown=e=>{this.disabled||e.button!==0||this.active||(this.active=!0,this.pointerId=e.pointerId,this.startX=e.clientX,this.startY=e.clientY,this.startTime=e.timeStamp,this.moved=!1,e.target.setPointerCapture?.(e.pointerId))},this.onMove=e=>{if(!(!this.active||e.pointerId!==this.pointerId)&&!this.moved){let t=Math.abs(e.clientX-this.startX),i=Math.abs(e.clientY-this.startY);(t>this.maxMove||i>this.maxMove)&&(this.moved=!0)}},this.onUp=e=>{if(!this.active||e.pointerId!==this.pointerId)return;let t=e.timeStamp-this.startTime,i=Math.abs(e.clientX-this.startX),o=Math.abs(e.clientY-this.startY),l=!this.moved&&i<=this.maxMove&&o<=this.maxMove&&t<=this.maxDuration;if(this.resetGesture(),!l)return;this.preventDefault&&e.preventDefault();let h=performance.now(),d=e.clientX,O=e.clientY;if(!this.enableDoubleTap){this.emit("single",d,O,e);return}if(this.pendingSingle){let P=h-this.pendingSingle.t,L=Math.hypot(d-this.pendingSingle.x,O-this.pendingSingle.y);if(P<=this.doubleTapInterval&&L<=this.doubleTapSlop){clearTimeout(this.singleTimer),this.singleTimer=null,this.pendingSingle=null,this.emit("double",d,O,e);return}}this.pendingSingle={x:d,y:O,t:h},clearTimeout(this.singleTimer),this.singleTimer=setTimeout(()=>{if(this.emitSingleWhenNoDouble){let P=this.pendingSingle;this.emit("single",P.x,P.y)}this.pendingSingle=null,this.singleTimer=null},this.doubleTapInterval)},this.onCancel=()=>this.resetGesture(),this.onKey=e=>{if(this.disabled)return;let t=e.key.toLowerCase();if(t==="enter"||t===" "){if(e.preventDefault(),this.enableDoubleTap&&!this.emitSingleWhenNoDouble)return;this.emit("single",0,0,e)}},this.onContextMenu=e=>{this.preventDefault&&e.preventDefault()},this.onNativeClick=e=>{this.preventGhostClick&&performance.now()-this.lastEmitTs<350&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},this.el=this.elRef.nativeElement,this.zone.runOutsideAngular(()=>{this.add("pointerdown",this.onDown,{passive:!0}),this.add("pointermove",this.onMove,{passive:!0}),this.add("pointerup",this.onUp,{passive:!1}),this.add("pointercancel",this.onCancel,{passive:!0}),this.add("pointerleave",this.onCancel,{passive:!0}),this.add("keydown",this.onKey,{passive:!1}),this.add("contextmenu",this.onContextMenu,{passive:!1}),this.add("click",this.onNativeClick,{passive:!1,capture:!0})})}ngOnDestroy(){for(let e of this.removeFns)e();this.removeFns=[],clearTimeout(this.singleTimer)}emit(e,t,i,o){this.lastEmitTs=performance.now(),this.zone.run(()=>this.appTap.emit({x:t,y:i,type:e,sourceEvent:o}))}add(e,t,i){this.el.addEventListener(e,t,i),this.removeFns.push(()=>this.el.removeEventListener(e,t,i))}resetGesture(){this.active=!1,this.pointerId=null,this.startTime=0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=Z({type:a,selectors:[["","appTap",""]],hostAttrs:[2,"touch-action","manipulation","-webkit-tap-highlight-color","transparent"],inputs:{maxMove:"maxMove",maxDuration:"maxDuration",doubleTapInterval:"doubleTapInterval",doubleTapSlop:"doubleTapSlop",enableDoubleTap:"enableDoubleTap",emitSingleWhenNoDouble:"emitSingleWhenNoDouble",preventGhostClick:"preventGhostClick",preventDefault:"preventDefault",disabled:"disabled"},outputs:{appTap:"appTap"}});let n=a;return n})();var ut=["ulElement"],ft=["liElements"],yt=(n,a,s,e)=>({matches:n,itemTemplate:a,query:s,$implicit:e}),_t=(n,a,s,e)=>({item:n,index:a,match:s,query:e});function gt(n,a){}function vt(n,a){if(n&1&&f(0,"span",4),n&2){let s=a.match,e=a.query,t=r();p("innerHtml",t.highlight(s,e),U)}}function Ct(n,a){if(n&1&&(m(0,"h6",8),S(1),u()),n&2){let s=r().$implicit;c(),T(s)}}function xt(n,a){}function bt(n,a){if(n&1){let s=M();m(0,"button",9,2),b("click",function(t){y(s);let i=r().$implicit,o=r(2);return _(o.selectMatch(i,t))})("mouseenter",function(){y(s);let t=r().$implicit,i=r(2);return _(i.selectActive(t))}),w(2,xt,0,0,"ng-template",3),u()}if(n&2){let s=r(),e=s.$implicit,t=s.index,i=r(2),o=F(2);le("active",i.isActive(e)),p("id",i.popupId+"-"+t)("@typeaheadAnimation",i.animationState),c(2),p("ngTemplateOutlet",i.itemTemplate||o)("ngTemplateOutletContext",me(6,_t,e.item,t,e,i.query))}}function St(n,a){if(n&1&&w(0,Ct,2,1,"h6",6)(1,bt,3,11,"ng-template",7),n&2){let s=a.$implicit;p("ngIf",s.isHeader()),c(),p("ngIf",!s.isHeader())}}function Tt(n,a){if(n&1&&w(0,St,2,2,"ng-template",5),n&2){let s=r();p("ngForOf",s.matches)}}var Et={\u00C1:"A",\u0102:"A",\u1EAE:"A",\u1EB6:"A",\u1EB0:"A",\u1EB2:"A",\u1EB4:"A",\u01CD:"A",\u00C2:"A",\u1EA4:"A",\u1EAC:"A",\u1EA6:"A",\u1EA8:"A",\u1EAA:"A",\u00C4:"A",\u01DE:"A",\u0226:"A",\u01E0:"A",\u1EA0:"A",\u0200:"A",\u00C0:"A",\u1EA2:"A",\u0202:"A",\u0100:"A",\u0104:"A",\u00C5:"A",\u01FA:"A",\u1E00:"A","\u023A":"A",\u00C3:"A","\uA732":"AA",\u00C6:"AE",\u01FC:"AE",\u01E2:"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY",\u1E02:"B",\u1E04:"B",\u0181:"B",\u1E06:"B","\u0243":"B",\u0182:"B",\u0106:"C",\u010C:"C",\u00C7:"C",\u1E08:"C",\u0108:"C",\u010A:"C",\u0187:"C","\u023B":"C",\u010E:"D",\u1E10:"D",\u1E12:"D",\u1E0A:"D",\u1E0C:"D",\u018A:"D",\u1E0E:"D",\u01F2:"D",\u01C5:"D",\u0110:"D",\u018B:"D",\u01F1:"DZ",\u01C4:"DZ",\u00C9:"E",\u0114:"E",\u011A:"E",\u0228:"E",\u1E1C:"E",\u00CA:"E",\u1EBE:"E",\u1EC6:"E",\u1EC0:"E",\u1EC2:"E",\u1EC4:"E",\u1E18:"E",\u00CB:"E",\u0116:"E",\u1EB8:"E",\u0204:"E",\u00C8:"E",\u1EBA:"E",\u0206:"E",\u0112:"E",\u1E16:"E",\u1E14:"E",\u0118:"E","\u0246":"E",\u1EBC:"E",\u1E1A:"E","\uA76A":"ET",\u1E1E:"F",\u0191:"F",\u01F4:"G",\u011E:"G",\u01E6:"G",\u0122:"G",\u011C:"G",\u0120:"G",\u0193:"G",\u1E20:"G",\u01E4:"G",\u1E2A:"H",\u021E:"H",\u1E28:"H",\u0124:"H","\u2C67":"H",\u1E26:"H",\u1E22:"H",\u1E24:"H",\u0126:"H",\u00CD:"I",\u012C:"I",\u01CF:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u0130:"I",\u1ECA:"I",\u0208:"I",\u00CC:"I",\u1EC8:"I",\u020A:"I",\u012A:"I",\u012E:"I",\u0197:"I",\u0128:"I",\u1E2C:"I","\uA779":"D","\uA77B":"F","\uA77D":"G","\uA782":"R","\uA784":"S","\uA786":"T","\uA76C":"IS",\u0134:"J","\u0248":"J",\u1E30:"K",\u01E8:"K",\u0136:"K","\u2C69":"K","\uA742":"K",\u1E32:"K",\u0198:"K",\u1E34:"K","\uA740":"K","\uA744":"K",\u0139:"L","\u023D":"L",\u013D:"L",\u013B:"L",\u1E3C:"L",\u1E36:"L",\u1E38:"L","\u2C60":"L","\uA748":"L",\u1E3A:"L",\u013F:"L","\u2C62":"L",\u01C8:"L",\u0141:"L",\u01C7:"LJ",\u1E3E:"M",\u1E40:"M",\u1E42:"M","\u2C6E":"M",\u0143:"N",\u0147:"N",\u0145:"N",\u1E4A:"N",\u1E44:"N",\u1E46:"N",\u01F8:"N",\u019D:"N",\u1E48:"N","\u0220":"N",\u01CB:"N",\u00D1:"N",\u01CA:"NJ",\u00D3:"O",\u014E:"O",\u01D1:"O",\u00D4:"O",\u1ED0:"O",\u1ED8:"O",\u1ED2:"O",\u1ED4:"O",\u1ED6:"O",\u00D6:"O",\u022A:"O",\u022E:"O",\u0230:"O",\u1ECC:"O",\u0150:"O",\u020C:"O",\u00D2:"O",\u1ECE:"O",\u01A0:"O",\u1EDA:"O",\u1EE2:"O",\u1EDC:"O",\u1EDE:"O",\u1EE0:"O",\u020E:"O","\uA74A":"O","\uA74C":"O",\u014C:"O",\u1E52:"O",\u1E50:"O",\u019F:"O",\u01EA:"O",\u01EC:"O",\u00D8:"O",\u01FE:"O",\u00D5:"O",\u1E4C:"O",\u1E4E:"O",\u022C:"O",\u01A2:"OI","\uA74E":"OO",\u0190:"E",\u0186:"O",\u0222:"OU",\u1E54:"P",\u1E56:"P","\uA752":"P",\u01A4:"P","\uA754":"P","\u2C63":"P","\uA750":"P","\uA758":"Q","\uA756":"Q",\u0154:"R",\u0158:"R",\u0156:"R",\u1E58:"R",\u1E5A:"R",\u1E5C:"R",\u0210:"R",\u0212:"R",\u1E5E:"R","\u024C":"R","\u2C64":"R","\uA73E":"C",\u018E:"E",\u015A:"S",\u1E64:"S",\u0160:"S",\u1E66:"S",\u015E:"S",\u015C:"S",\u0218:"S",\u1E60:"S",\u1E62:"S",\u1E68:"S",\u0164:"T",\u0162:"T",\u1E70:"T",\u021A:"T","\u023E":"T",\u1E6A:"T",\u1E6C:"T",\u01AC:"T",\u1E6E:"T",\u01AE:"T",\u0166:"T","\u2C6F":"A","\uA780":"L",\u019C:"M","\u0245":"V","\uA728":"TZ",\u00DA:"U",\u016C:"U",\u01D3:"U",\u00DB:"U",\u1E76:"U",\u00DC:"U",\u01D7:"U",\u01D9:"U",\u01DB:"U",\u01D5:"U",\u1E72:"U",\u1EE4:"U",\u0170:"U",\u0214:"U",\u00D9:"U",\u1EE6:"U",\u01AF:"U",\u1EE8:"U",\u1EF0:"U",\u1EEA:"U",\u1EEC:"U",\u1EEE:"U",\u0216:"U",\u016A:"U",\u1E7A:"U",\u0172:"U",\u016E:"U",\u0168:"U",\u1E78:"U",\u1E74:"U","\uA75E":"V",\u1E7E:"V",\u01B2:"V",\u1E7C:"V","\uA760":"VY",\u1E82:"W",\u0174:"W",\u1E84:"W",\u1E86:"W",\u1E88:"W",\u1E80:"W","\u2C72":"W",\u1E8C:"X",\u1E8A:"X",\u00DD:"Y",\u0176:"Y",\u0178:"Y",\u1E8E:"Y",\u1EF4:"Y",\u1EF2:"Y",\u01B3:"Y",\u1EF6:"Y","\u1EFE":"Y",\u0232:"Y","\u024E":"Y",\u1EF8:"Y",\u0179:"Z",\u017D:"Z",\u1E90:"Z","\u2C6B":"Z",\u017B:"Z",\u1E92:"Z",\u0224:"Z",\u1E94:"Z",\u01B5:"Z",\u0132:"IJ",\u0152:"OE","\u1D00":"A","\u1D01":"AE",\u0299:"B","\u1D03":"B","\u1D04":"C","\u1D05":"D","\u1D07":"E","\uA730":"F",\u0262:"G",\u029B:"G",\u029C:"H",\u026A:"I",\u0281:"R","\u1D0A":"J","\u1D0B":"K",\u029F:"L","\u1D0C":"L","\u1D0D":"M",\u0274:"N","\u1D0F":"O",\u0276:"OE","\u1D10":"O","\u1D15":"OU","\u1D18":"P",\u0280:"R","\u1D0E":"N","\u1D19":"R","\uA731":"S","\u1D1B":"T","\u2C7B":"E","\u1D1A":"R","\u1D1C":"U","\u1D20":"V","\u1D21":"W",\u028F:"Y","\u1D22":"Z",\u00E1:"a",\u0103:"a",\u1EAF:"a",\u1EB7:"a",\u1EB1:"a",\u1EB3:"a",\u1EB5:"a",\u01CE:"a",\u00E2:"a",\u1EA5:"a",\u1EAD:"a",\u1EA7:"a",\u1EA9:"a",\u1EAB:"a",\u00E4:"a",\u01DF:"a",\u0227:"a",\u01E1:"a",\u1EA1:"a",\u0201:"a",\u00E0:"a",\u1EA3:"a",\u0203:"a",\u0101:"a",\u0105:"a","\u1D8F":"a",\u1E9A:"a",\u00E5:"a",\u01FB:"a",\u1E01:"a","\u2C65":"a",\u00E3:"a","\uA733":"aa",\u00E6:"ae",\u01FD:"ae",\u01E3:"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay",\u1E03:"b",\u1E05:"b",\u0253:"b",\u1E07:"b","\u1D6C":"b","\u1D80":"b",\u0180:"b",\u0183:"b",\u0275:"o",\u0107:"c",\u010D:"c",\u00E7:"c",\u1E09:"c",\u0109:"c",\u0255:"c",\u010B:"c",\u0188:"c","\u023C":"c",\u010F:"d",\u1E11:"d",\u1E13:"d","\u0221":"d",\u1E0B:"d",\u1E0D:"d",\u0257:"d","\u1D91":"d",\u1E0F:"d","\u1D6D":"d","\u1D81":"d",\u0111:"d",\u0256:"d",\u018C:"d",\u0131:"i","\u0237":"j",\u025F:"j",\u0284:"j",\u01F3:"dz",\u01C6:"dz",\u00E9:"e",\u0115:"e",\u011B:"e",\u0229:"e",\u1E1D:"e",\u00EA:"e",\u1EBF:"e",\u1EC7:"e",\u1EC1:"e",\u1EC3:"e",\u1EC5:"e",\u1E19:"e",\u00EB:"e",\u0117:"e",\u1EB9:"e",\u0205:"e",\u00E8:"e",\u1EBB:"e",\u0207:"e",\u0113:"e",\u1E17:"e",\u1E15:"e","\u2C78":"e",\u0119:"e","\u1D92":"e","\u0247":"e",\u1EBD:"e",\u1E1B:"e","\uA76B":"et",\u1E1F:"f",\u0192:"f","\u1D6E":"f","\u1D82":"f",\u01F5:"g",\u011F:"g",\u01E7:"g",\u0123:"g",\u011D:"g",\u0121:"g",\u0260:"g",\u1E21:"g","\u1D83":"g",\u01E5:"g",\u1E2B:"h",\u021F:"h",\u1E29:"h",\u0125:"h","\u2C68":"h",\u1E27:"h",\u1E23:"h",\u1E25:"h",\u0266:"h",\u1E96:"h",\u0127:"h",\u0195:"hv",\u00ED:"i",\u012D:"i",\u01D0:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u1ECB:"i",\u0209:"i",\u00EC:"i",\u1EC9:"i",\u020B:"i",\u012B:"i",\u012F:"i","\u1D96":"i",\u0268:"i",\u0129:"i",\u1E2D:"i","\uA77A":"d","\uA77C":"f","\u1D79":"g","\uA783":"r","\uA785":"s","\uA787":"t","\uA76D":"is",\u01F0:"j",\u0135:"j",\u029D:"j","\u0249":"j",\u1E31:"k",\u01E9:"k",\u0137:"k","\u2C6A":"k","\uA743":"k",\u1E33:"k",\u0199:"k",\u1E35:"k","\u1D84":"k","\uA741":"k","\uA745":"k",\u013A:"l",\u019A:"l",\u026C:"l",\u013E:"l",\u013C:"l",\u1E3D:"l","\u0234":"l",\u1E37:"l",\u1E39:"l","\u2C61":"l","\uA749":"l",\u1E3B:"l",\u0140:"l",\u026B:"l","\u1D85":"l",\u026D:"l",\u0142:"l",\u01C9:"lj",\u017F:"s","\u1E9C":"s",\u1E9B:"s","\u1E9D":"s",\u1E3F:"m",\u1E41:"m",\u1E43:"m",\u0271:"m","\u1D6F":"m","\u1D86":"m",\u0144:"n",\u0148:"n",\u0146:"n",\u1E4B:"n","\u0235":"n",\u1E45:"n",\u1E47:"n",\u01F9:"n",\u0272:"n",\u1E49:"n",\u019E:"n","\u1D70":"n","\u1D87":"n",\u0273:"n",\u00F1:"n",\u01CC:"nj",\u00F3:"o",\u014F:"o",\u01D2:"o",\u00F4:"o",\u1ED1:"o",\u1ED9:"o",\u1ED3:"o",\u1ED5:"o",\u1ED7:"o",\u00F6:"o",\u022B:"o",\u022F:"o",\u0231:"o",\u1ECD:"o",\u0151:"o",\u020D:"o",\u00F2:"o",\u1ECF:"o",\u01A1:"o",\u1EDB:"o",\u1EE3:"o",\u1EDD:"o",\u1EDF:"o",\u1EE1:"o",\u020F:"o","\uA74B":"o","\uA74D":"o","\u2C7A":"o",\u014D:"o",\u1E53:"o",\u1E51:"o",\u01EB:"o",\u01ED:"o",\u00F8:"o",\u01FF:"o",\u00F5:"o",\u1E4D:"o",\u1E4F:"o",\u022D:"o",\u01A3:"oi","\uA74F":"oo",\u025B:"e","\u1D93":"e",\u0254:"o","\u1D97":"o",\u0223:"ou",\u1E55:"p",\u1E57:"p","\uA753":"p",\u01A5:"p","\u1D71":"p","\u1D88":"p","\uA755":"p","\u1D7D":"p","\uA751":"p","\uA759":"q",\u02A0:"q","\u024B":"q","\uA757":"q",\u0155:"r",\u0159:"r",\u0157:"r",\u1E59:"r",\u1E5B:"r",\u1E5D:"r",\u0211:"r",\u027E:"r","\u1D73":"r",\u0213:"r",\u1E5F:"r",\u027C:"r","\u1D72":"r","\u1D89":"r","\u024D":"r",\u027D:"r","\u2184":"c","\uA73F":"c",\u0258:"e",\u027F:"r",\u015B:"s",\u1E65:"s",\u0161:"s",\u1E67:"s",\u015F:"s",\u015D:"s",\u0219:"s",\u1E61:"s",\u1E63:"s",\u1E69:"s",\u0282:"s","\u1D74":"s","\u1D8A":"s","\u023F":"s",\u0261:"g","\u1D11":"o","\u1D13":"o","\u1D1D":"u",\u0165:"t",\u0163:"t",\u1E71:"t",\u021B:"t","\u0236":"t",\u1E97:"t","\u2C66":"t",\u1E6B:"t",\u1E6D:"t",\u01AD:"t",\u1E6F:"t","\u1D75":"t",\u01AB:"t",\u0288:"t",\u0167:"t","\u1D7A":"th",\u0250:"a","\u1D02":"ae",\u01DD:"e","\u1D77":"g",\u0265:"h","\u02AE":"h","\u02AF":"h","\u1D09":"i",\u029E:"k","\uA781":"l",\u026F:"m",\u0270:"m","\u1D14":"oe",\u0279:"r",\u027B:"r",\u027A:"r","\u2C79":"r",\u0287:"t",\u028C:"v",\u028D:"w",\u028E:"y","\uA729":"tz",\u00FA:"u",\u016D:"u",\u01D4:"u",\u00FB:"u",\u1E77:"u",\u00FC:"u",\u01D8:"u",\u01DA:"u",\u01DC:"u",\u01D6:"u",\u1E73:"u",\u1EE5:"u",\u0171:"u",\u0215:"u",\u00F9:"u",\u1EE7:"u",\u01B0:"u",\u1EE9:"u",\u1EF1:"u",\u1EEB:"u",\u1EED:"u",\u1EEF:"u",\u0217:"u",\u016B:"u",\u1E7B:"u",\u0173:"u","\u1D99":"u",\u016F:"u",\u0169:"u",\u1E79:"u",\u1E75:"u","\u1D6B":"ue","\uA778":"um","\u2C74":"v","\uA75F":"v",\u1E7F:"v",\u028B:"v","\u1D8C":"v","\u2C71":"v",\u1E7D:"v","\uA761":"vy",\u1E83:"w",\u0175:"w",\u1E85:"w",\u1E87:"w",\u1E89:"w",\u1E81:"w","\u2C73":"w",\u1E98:"w",\u1E8D:"x",\u1E8B:"x","\u1D8D":"x",\u00FD:"y",\u0177:"y",\u00FF:"y",\u1E8F:"y",\u1EF5:"y",\u1EF3:"y",\u01B4:"y",\u1EF7:"y","\u1EFF":"y",\u0233:"y",\u1E99:"y","\u024F":"y",\u1EF9:"y",\u017A:"z",\u017E:"z",\u1E91:"z",\u0291:"z","\u2C6C":"z",\u017C:"z",\u1E93:"z",\u0225:"z",\u1E95:"z","\u1D76":"z","\u1D8E":"z",\u0290:"z",\u01B6:"z","\u0240":"z",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u0133:"ij",\u0153:"oe",\uFB06:"st","\u2090":"a","\u2091":"e","\u1D62":"i","\u2C7C":"j","\u2092":"o","\u1D63":"r","\u1D64":"u","\u1D65":"v","\u2093":"x"};var k=class{constructor(a,s=a,e=!1){this.item=a,this.value=s,this.header=e}isHeader(){return this.header}toString(){return this.value}};function W(n){return n?n.replace(/[^A-Za-z0-9[\] ]/g,function(a){return Et[a]||a}):""}function ge(n,a=" ",s="",e){let t=[];if(!e)t=rt(n,a,s);else{let i=`([${e}]+)`,o=n.split(new RegExp(i,"g")),l=o[o.length-1];l>""&&(a&&s?t=rt(l,a,s):t.push(l))}return t}function rt(n,a,s){let e=[],t=`(?:[${s}])([^${s}]+)(?:[${s}])|([^${a}]+)`,i=n.split(new RegExp(t,"g")),o=i.length,l,h=new RegExp(`[${s}]+`,"g");for(let d=0;d<o;d+=1)l=i[d],l&&l.length&&l!==a&&e.push(l.replace(h,""));return e}function A(n,a){if(!a||typeof n!="object")return n.toString();if(a.endsWith("()")){let t=a.slice(0,a.length-2);return n[t]().toString()}let e=a.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");for(let t of e)t in n&&(n=n[t]);return n?n.toString():""}var lt="220ms cubic-bezier(0, 0, 0.2, 1)",Ot=Be("typeaheadAnimation",[fe("animated-down",z({height:"*",overflow:"hidden"})),J("* => animated-down",[z({height:0,overflow:"hidden"}),X(lt)]),fe("animated-up",z({height:"*",overflow:"hidden"})),J("* => animated-up",[z({height:"*",overflow:"hidden"}),X(lt)]),J("* => unanimated",X("0s"))]),It=0,wt=(()=>{let a=class a{get typeaheadTemplateMethods(){return{selectMatch:this.selectMatch.bind(this),selectActive:this.selectActive.bind(this),isActive:this.isActive.bind(this)}}constructor(e,t,i,o){this.positionService=e,this.renderer=t,this.element=i,this.changeDetectorRef=o,this.activeChangeEvent=new g,this.isFocused=!1,this.positionServiceSubscription=new ve,this.height=0,this.popupId=`ngb-typeahead-${It++}`,this._matches=[],this.renderer.setAttribute(this.element.nativeElement,"id",this.popupId),this.positionServiceSubscription.add(this.positionService.event$?.subscribe(()=>{if(this.isAnimated){this.animationState=this.isTopPosition?"animated-up":"animated-down",this.changeDetectorRef.detectChanges();return}this.animationState="unanimated",this.changeDetectorRef.detectChanges()}))}get active(){return this._active}set active(e){this._active=e,this.activeChanged()}get matches(){return this._matches}set matches(e){if(this.positionService.setOptions({modifiers:{flip:{enabled:this.adaptivePosition}},allowedPositions:["top","bottom"]}),this._matches=e,this.needScrollbar=this.typeaheadScrollable&&this.typeaheadOptionsInScrollableView<this.matches.length,this.typeaheadScrollable&&setTimeout(()=>{this.setScrollableMode()}),this.typeaheadIsFirstItemActive&&this._matches.length>0&&(this.setActive(this._matches[0]),this._active?.isHeader()&&this.nextActiveMatch()),this._active&&!this.typeaheadIsFirstItemActive){let t=this._matches.find(i=>i.value===this._active?.value);if(t){this.selectActive(t);return}this.active=void 0}}get isTopPosition(){return this.element.nativeElement.classList.contains("top")}get optionsListTemplate(){return this.parent?this.parent.optionsListTemplate:void 0}get isAnimated(){return this.parent?this.parent.isAnimated:!1}get adaptivePosition(){return this.parent?this.parent.adaptivePosition:!1}get typeaheadScrollable(){return this.parent?this.parent.typeaheadScrollable:!1}get typeaheadOptionsInScrollableView(){return this.parent?this.parent.typeaheadOptionsInScrollableView:5}get typeaheadIsFirstItemActive(){return this.parent?this.parent.typeaheadIsFirstItemActive:!0}get itemTemplate(){return this.parent?this.parent.typeaheadItemTemplate:void 0}get canSelectItemsOnBlur(){return!!this.parent?.selectItemOnBlur}selectActiveMatch(e){this._active&&this.parent?.typeaheadSelectFirstItem&&this.selectMatch(this._active),!this.parent?.typeaheadSelectFirstItem&&e&&this.selectMatch(this._active)}activeChanged(){if(!this._active)return;let e=this.matches.indexOf(this._active);this.activeChangeEvent.emit(`${this.popupId}-${e}`)}prevActiveMatch(){if(!this._active)return;let e=this.matches.indexOf(this._active);this.setActive(this.matches[e-1<0?this.matches.length-1:e-1]),this._active.isHeader()&&this.prevActiveMatch(),this.typeaheadScrollable&&this.scrollPrevious(e)}nextActiveMatch(){let e=this._active?this.matches.indexOf(this._active):-1;this.setActive(this.matches[e+1>this.matches.length-1?0:e+1]),this._active?.isHeader()&&this.nextActiveMatch(),this.typeaheadScrollable&&this.scrollNext(e)}selectActive(e){this.isFocused=!0,this.setActive(e)}highlight(e,t){let i=e.value,o=(this.parent&&this.parent.typeaheadLatinize?W(i):i).toLowerCase(),l,h;if(typeof t=="object"){let d=t.length,O="\u2063",P=17;for(let L=0;L<d;L+=1)l=o.indexOf(t[L]),h=t[L].length,l>=0&&h>0&&(i=`${i.substring(0,l)}<strong>${i.substring(l,l+h)}</strong>${i.substring(l+h)}`,o=`${o.substring(0,l)}${O.repeat(P+h)}${o.substring(l+h)}`)}else t&&(l=o.indexOf(t),h=t.length,l>=0&&h>0&&(i=`${i.substring(0,l)}<strong>${i.substring(l,l+h)}</strong>${i.substring(l+h)}`));return i}focusLost(){this.isFocused=!1,this.canSelectItemsOnBlur||this.setActive(void 0)}isActive(e){return this.active===e}selectMatch(e,t){return t&&(t.stopPropagation(),t.preventDefault()),this.parent?.changeModel(e),setTimeout(()=>this.parent?.typeaheadOnSelect.emit(e),0),!1}setScrollableMode(){if(this.ulElement||(this.ulElement=this.element),this.liElements?.first){let e=ye.getStyles(this.ulElement.nativeElement),t=ye.getStyles(this.liElements.first.nativeElement),i=parseFloat((e["padding-bottom"]?e["padding-bottom"]:"").replace("px","")),o=parseFloat((e["padding-top"]?e["padding-top"]:"0").replace("px","")),l=parseFloat((t.height?t.height:"0").replace("px","")),h=this.typeaheadOptionsInScrollableView*l;this.guiHeight=`${h+o+i}px`}this.renderer.setStyle(this.element.nativeElement,"visibility","visible")}scrollPrevious(e){if(e===0){this.scrollToBottom();return}if(this.liElements&&this.ulElement){let t=this.liElements.toArray()[e-1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop)}}scrollNext(e){if(e+1>this.matches.length-1){this.scrollToTop();return}if(this.liElements&&this.ulElement){let t=this.liElements.toArray()[e+1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop-Number(this.ulElement.nativeElement.offsetHeight)+Number(t.nativeElement.offsetHeight))}}ngOnDestroy(){this.positionServiceSubscription.unsubscribe()}setActive(e){this._active=e;let t;this._active==null||this._active.isHeader()||(t=e),this.parent?.typeaheadOnPreview.emit(t)}isScrolledIntoView(e){if(!this.ulElement)return!1;let t=this.ulElement.nativeElement.scrollTop,i=t+Number(this.ulElement.nativeElement.offsetHeight),o=e.offsetTop;return o+e.offsetHeight<=i&&o>=t}scrollToBottom(){this.ulElement?.nativeElement&&(this.ulElement.nativeElement.scrollTop=this.ulElement.nativeElement.scrollHeight)}scrollToTop(){this.ulElement?.nativeElement&&(this.ulElement.nativeElement.scrollTop=0)}};a.\u0275fac=function(t){return new(t||a)(v($),v(ae),v(R),v(ue))},a.\u0275cmp=Q({type:a,selectors:[["typeahead-container"]],viewQuery:function(t,i){if(t&1&&(B(ut,5),B(ft,5)),t&2){let o;H(o=V())&&(i.ulElement=o.first),H(o=V())&&(i.liElements=o)}},hostAttrs:[1,"dropdown","open","bottom","dropdown-menu",2,"position","absolute","display","block"],hostVars:7,hostBindings:function(t,i){t&1&&b("mouseleave",function(){return i.focusLost()})("blur",function(){return i.focusLost()}),t&2&&(se("role","listbox"),Ae("height",i.needScrollbar?i.guiHeight:"auto")("visibility","inherit"),le("dropup",i.dropup))},outputs:{activeChangeEvent:"activeChange"},features:[de([$])],decls:5,vars:7,consts:[["bsItemTemplate",""],["bs4Template",""],["liElements",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHtml"],["ngFor","",3,"ngForOf"],["class","dropdown-header",4,"ngIf"],[3,"ngIf"],[1,"dropdown-header"],["role","option",1,"dropdown-item",3,"click","mouseenter","id"]],template:function(t,i){if(t&1&&w(0,gt,0,0,"ng-template",3)(1,vt,1,1,"ng-template",null,0,N)(3,Tt,1,1,"ng-template",null,1,N),t&2){let o=F(2),l=F(4);p("ngTemplateOutlet",i.optionsListTemplate||l)("ngTemplateOutletContext",me(2,yt,i.matches,i.itemTemplate||o,i.query,i.typeaheadTemplateMethods))}},dependencies:[ke,De,Fe],styles:[".dropdown[_nghost-%COMP%]{z-index:1000}.dropdown-menu[_nghost-%COMP%], .dropdown-menu[_ngcontent-%COMP%]{overflow-y:auto;height:100px}"],data:{animation:[Ot]}});let n=a;return n})(),ht=(()=>{let a=class a{constructor(){this.adaptivePosition=!1,this.isAnimated=!1,this.hideResultsOnBlur=!0,this.cancelRequestOnFocusLost=!1,this.selectFirstItem=!0,this.isFirstItemActive=!0,this.minLength=1,this.selectItemOnBlur=!1}};a.\u0275fac=function(t){return new(t||a)},a.\u0275prov=Ee({token:a,factory:a.\u0275fac,providedIn:"root"});let n=a;return n})(),ct=(()=>{let a=class a{constructor(e,t,i,o,l,h,d){this.changeDetection=i,this.element=o,this.ngControl=l,this.renderer=h,this.typeaheadMinLength=1,this.adaptivePosition=!1,this.isAnimated=!1,this.typeaheadWaitMs=0,this.typeaheadLatinize=!0,this.typeaheadSingleWords=!0,this.typeaheadWordDelimiters=" ",this.typeaheadMultipleSearchDelimiters=",",this.typeaheadPhraseDelimiters=`'"`,this.typeaheadScrollable=!1,this.typeaheadOptionsInScrollableView=5,this.typeaheadSelectFirstItem=!0,this.typeaheadIsFirstItemActive=!0,this.typeaheadLoading=new g,this.typeaheadNoResults=new g,this.typeaheadOnSelect=new g,this.typeaheadOnPreview=new g,this.typeaheadOnBlur=new g,this.dropup=!1,this.isOpen=!1,this.list="list",this.isActiveItemChanged=!1,this.isFocused=!1,this.cancelRequestOnFocusLost=!1,this.selectItemOnBlur=!1,this.keyUpEventEmitter=new g,this.placement="bottom left",this._matches=[],this._subscriptions=[],this._outsideClickListener=()=>{},this._typeahead=e.createLoader(o,d,h).provide({provide:ht,useValue:t}),Object.assign(this,{typeaheadHideResultsOnBlur:t.hideResultsOnBlur,cancelRequestOnFocusLost:t.cancelRequestOnFocusLost,typeaheadSelectFirstItem:t.selectFirstItem,typeaheadIsFirstItemActive:t.isFirstItemActive,typeaheadMinLength:t.minLength,adaptivePosition:t.adaptivePosition,isAnimated:t.isAnimated,selectItemOnBlur:t.selectItemOnBlur})}get matches(){return this._matches}ngOnInit(){this.typeaheadOptionsLimit=this.typeaheadOptionsLimit||20,this.typeaheadMinLength=this.typeaheadMinLength===void 0?1:this.typeaheadMinLength,this.typeaheadAsync===void 0&&!G(this.typeahead)&&(this.typeaheadAsync=!1),G(this.typeahead)&&(this.typeaheadAsync=!0),this.typeaheadAsync?this.asyncActions():this.syncActions(),this.checkDelimitersConflict()}onInput(e){let t=e.target.value!==void 0?e.target.value:e.target.textContent!==void 0?e.target.textContent:e.target.innerText;t!=null&&t.trim().length>=this.typeaheadMinLength?(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(e.target.value)):(this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!1),this.hide())}onChange(e){if(this._container){if(e.keyCode===27||e.key==="Escape"){this.hide();return}if(e.keyCode===38||e.key==="ArrowUp"){this.isActiveItemChanged=!0,this._container.prevActiveMatch();return}if(e.keyCode===40||e.key==="ArrowDown"){this.isActiveItemChanged=!0,this._container.nextActiveMatch();return}if(e.keyCode===13||e.key==="Enter"){this._container.selectActiveMatch();return}}}onFocus(){this.isFocused=!0,setTimeout(()=>{this.typeaheadMinLength===0&&(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(this.element.nativeElement.value||""))},0)}onBlur(){this.isFocused=!1,this._container&&!this._container.isFocused&&this.typeaheadOnBlur.emit(this._container.active),!this.container&&this._matches?.length===0&&this.typeaheadOnBlur.emit(new k(this.element.nativeElement.value,this.element.nativeElement.value,!1))}onKeydown(e){if(this._container&&((e.keyCode===9||e.key==="Tab")&&this.onBlur(),e.keyCode===9||e.key==="Tab"||e.keyCode===13||e.key==="Enter")){if(e.preventDefault(),this.typeaheadSelectFirstItem){this._container.selectActiveMatch();return}this.typeaheadSelectFirstItem||(this._container.selectActiveMatch(this.isActiveItemChanged),this.isActiveItemChanged=!1,this.hide())}}changeModel(e){if(!e)return;let t;if(this.typeaheadMultipleSearch&&this._allEnteredValue){let i=this._allEnteredValue.split(new RegExp(`([${this.typeaheadMultipleSearchDelimiters}]+)`));this._allEnteredValue=i.slice(0,i.length-1).concat(e.value).join(""),t=this._allEnteredValue}else t=e.value;this.ngControl.viewToModelUpdate(t),this.ngControl.control?.setValue(t),this.changeDetection.markForCheck(),this.hide()}show(){if(this._typeahead.attach(wt).to(this.container).position({attachment:`${this.dropup?"top":"bottom"} left`}).show({typeaheadRef:this,placement:this.placement,animation:!1,dropup:this.dropup}),this._outsideClickListener=this.renderer.listen("document","click",t=>{this.typeaheadMinLength===0&&this.element.nativeElement.contains(t.target)||!this.typeaheadHideResultsOnBlur||this.element.nativeElement.contains(t.target)||this.onOutsideClick()}),!this._typeahead.instance||!this.ngControl.control)return;this._container=this._typeahead.instance,this._container.parent=this;let e=(this.typeaheadLatinize?W(this.ngControl.control.value):this.ngControl.control.value).toString().toLowerCase();this._container.query=this.tokenizeQuery(e),this._container.matches=this._matches,this.element.nativeElement.focus(),this._container.activeChangeEvent.subscribe(t=>{this.activeDescendant=t,this.changeDetection.markForCheck()}),this.isOpen=!0}hide(){this._typeahead.isShown&&(this._typeahead.hide(),this._outsideClickListener(),this._container=void 0,this.isOpen=!1,this.changeDetection.markForCheck()),this.typeaheadOnPreview.emit()}onOutsideClick(){this._container&&!this._container.isFocused&&this.hide()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._typeahead.dispose()}asyncActions(){this._subscriptions.push(this.keyUpEventEmitter.pipe(ie(this.typeaheadWaitMs),Y(e=>this._allEnteredValue=e),Te(()=>this.typeahead?this.typeahead:te)).subscribe(e=>{this.finalizeAsyncCall(e)}))}syncActions(){this._subscriptions.push(this.keyUpEventEmitter.pipe(ie(this.typeaheadWaitMs),j(e=>{this._allEnteredValue=e;let t=this.normalizeQuery(e);return this.typeahead?(G(this.typeahead)?this.typeahead:xe(this.typeahead)).pipe(be(o=>!!o&&this.testMatch(this.normalizeOption(o),t)),Se()):te})).subscribe(e=>{this.finalizeAsyncCall(e)}))}normalizeOption(e){let t=A(e,this.typeaheadOptionField);return(this.typeaheadLatinize?W(t):t).toLowerCase()}tokenizeQuery(e){let t=e;return this.typeaheadMultipleSearch&&this.typeaheadSingleWords?this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`,this.typeaheadMultipleSearchDelimiters)||(t=ge(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters,this.typeaheadMultipleSearchDelimiters)):this.typeaheadSingleWords?t=ge(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters):t=ge(t,void 0,void 0,this.typeaheadMultipleSearchDelimiters),t}normalizeQuery(e){let t=(this.typeaheadLatinize?W(e):e).toString().toLowerCase();return t=this.tokenizeQuery(t),t}testMatch(e,t){let i;if(typeof t=="object"){i=t.length;for(let o=0;o<i;o+=1)if(t[o].length>0&&e.indexOf(t[o])<0)return!1;return!0}return e.indexOf(t)>=0}finalizeAsyncCall(e){if(this.prepareMatches(e||[]),this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!this.hasMatches()),!this.hasMatches()){this.hide();return}if(!(!this.isFocused&&this.cancelRequestOnFocusLost))if(this._container&&this.ngControl.control){let i=((this.typeaheadLatinize?W(this.ngControl.control.value):this.ngControl.control.value)||"").toString().toLowerCase();this._container.query=this.tokenizeQuery(i),this._container.matches=this._matches}else this.show()}prepareMatches(e){let t=e.slice(0,this.typeaheadOptionsLimit),i=this.typeaheadOrderBy?this.orderMatches(t):t;if(this.typeaheadGroupField){let o=[];i.map(h=>A(h,this.typeaheadGroupField)).filter((h,d,O)=>O.indexOf(h)===d).forEach(h=>{o.push(new k(h,h,!0)),o=o.concat(i.filter(d=>A(d,this.typeaheadGroupField)===h).map(d=>new k(d,A(d,this.typeaheadOptionField))))}),this._matches=o}else this._matches=i.map(o=>new k(o,A(o,this.typeaheadOptionField)))}orderMatches(e){if(!e.length)return e;if(this.typeaheadOrderBy!==null&&this.typeaheadOrderBy!==void 0&&typeof this.typeaheadOrderBy=="object"&&Object.keys(this.typeaheadOrderBy).length===0)return console.error("Field and direction properties for typeaheadOrderBy have to be set according to documentation!"),e;let{field:t,direction:i}=this.typeaheadOrderBy||{};return!i||!(i==="asc"||i==="desc")?(console.error('typeaheadOrderBy direction has to equal "asc" or "desc". Please follow the documentation.'),e):typeof e[0]=="string"?i==="asc"?e.sort():e.sort().reverse():!t||typeof t!="string"?(console.error("typeaheadOrderBy field has to set according to the documentation."),e):e.sort((o,l)=>{let h=A(o,t),d=A(l,t);return h<d?i==="asc"?-1:1:h>d?i==="asc"?1:-1:0})}hasMatches(){return this._matches.length>0}checkDelimitersConflict(){if(this.typeaheadMultipleSearch&&this.typeaheadSingleWords&&this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`,this.typeaheadMultipleSearchDelimiters))throw new Error(`Delimiters used in typeaheadMultipleSearchDelimiters must be different
1
+ import{e as ot}from"./chunk-7H5O4BLV.js";import{n as it,r as nt}from"./chunk-O7UXVNR2.js";import{a as at,b as st}from"./chunk-5HYSNQR4.js";import{J as qe,Nb as et,Pb as tt,c as Be,d as X,f as z,g as fe,gb as Je,h as J,l as ye,o as $,p as ee,s as Ye,t as Ke}from"./chunk-L3PDWJZ3.js";import{Aa as R,Ac as ue,Bb as M,Cd as $e,E as be,Eb as b,Ed as We,Gb as r,H as Se,Ha as U,Ia as ne,Ic as De,J as ie,Jc as Fe,Jd as Ge,Kb as B,Kd as je,Lb as H,Mb as V,Mc as ke,Oa as c,Pb as F,Pc as Re,Qa as g,Qb as Ae,Qc as Ue,Ra as K,Rb as le,Sb as q,Tb as S,Ub as T,Wa as ae,Xa as v,Xb as he,Ya as Ie,Yb as ce,Zb as pe,_ as Te,a as ve,aa as Y,ab as Q,bb as we,c as Ce,cb as Z,cc as Pe,db as Me,ea as Ee,ec as de,fa as Oe,fb as w,fd as He,id as Ve,ja as D,jc as me,jd as Ne,k as te,kb as se,kc as E,lb as C,lc as Le,mb as x,mc as I,o as xe,oa as y,oc as N,od as ze,og as Xe,pa as _,pb as oe,qb as re,r as G,rb as p,sb as m,tb as u,ub as f,vf as Qe,x as j,zf as Ze}from"./chunk-BJARRIS6.js";var Jt=(()=>{let a=class a{constructor(){this.maxMove=10,this.maxDuration=350,this.doubleTapInterval=600,this.doubleTapSlop=24,this.enableDoubleTap=!0,this.emitSingleWhenNoDouble=!1,this.preventGhostClick=!0,this.preventDefault=!1,this.disabled=!1,this.appTap=new g,this.elRef=D(R),this.zone=D(K),this.removeFns=[],this.active=!1,this.pointerId=null,this.startX=0,this.startY=0,this.startTime=0,this.moved=!1,this.lastEmitTs=0,this.pendingSingle=null,this.singleTimer=null,this.onDown=e=>{this.disabled||e.button!==0||this.active||(this.active=!0,this.pointerId=e.pointerId,this.startX=e.clientX,this.startY=e.clientY,this.startTime=e.timeStamp,this.moved=!1,e.target.setPointerCapture?.(e.pointerId))},this.onMove=e=>{if(!(!this.active||e.pointerId!==this.pointerId)&&!this.moved){let t=Math.abs(e.clientX-this.startX),i=Math.abs(e.clientY-this.startY);(t>this.maxMove||i>this.maxMove)&&(this.moved=!0)}},this.onUp=e=>{if(!this.active||e.pointerId!==this.pointerId)return;let t=e.timeStamp-this.startTime,i=Math.abs(e.clientX-this.startX),o=Math.abs(e.clientY-this.startY),l=!this.moved&&i<=this.maxMove&&o<=this.maxMove&&t<=this.maxDuration;if(this.resetGesture(),!l)return;this.preventDefault&&e.preventDefault();let h=performance.now(),d=e.clientX,O=e.clientY;if(!this.enableDoubleTap){this.emit("single",d,O,e);return}if(this.pendingSingle){let P=h-this.pendingSingle.t,L=Math.hypot(d-this.pendingSingle.x,O-this.pendingSingle.y);if(P<=this.doubleTapInterval&&L<=this.doubleTapSlop){clearTimeout(this.singleTimer),this.singleTimer=null,this.pendingSingle=null,this.emit("double",d,O,e);return}}this.pendingSingle={x:d,y:O,t:h},clearTimeout(this.singleTimer),this.singleTimer=setTimeout(()=>{if(this.emitSingleWhenNoDouble){let P=this.pendingSingle;this.emit("single",P.x,P.y)}this.pendingSingle=null,this.singleTimer=null},this.doubleTapInterval)},this.onCancel=()=>this.resetGesture(),this.onKey=e=>{if(this.disabled)return;let t=e.key.toLowerCase();if(t==="enter"||t===" "){if(e.preventDefault(),this.enableDoubleTap&&!this.emitSingleWhenNoDouble)return;this.emit("single",0,0,e)}},this.onContextMenu=e=>{this.preventDefault&&e.preventDefault()},this.onNativeClick=e=>{this.preventGhostClick&&performance.now()-this.lastEmitTs<350&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},this.el=this.elRef.nativeElement,this.zone.runOutsideAngular(()=>{this.add("pointerdown",this.onDown,{passive:!0}),this.add("pointermove",this.onMove,{passive:!0}),this.add("pointerup",this.onUp,{passive:!1}),this.add("pointercancel",this.onCancel,{passive:!0}),this.add("pointerleave",this.onCancel,{passive:!0}),this.add("keydown",this.onKey,{passive:!1}),this.add("contextmenu",this.onContextMenu,{passive:!1}),this.add("click",this.onNativeClick,{passive:!1,capture:!0})})}ngOnDestroy(){for(let e of this.removeFns)e();this.removeFns=[],clearTimeout(this.singleTimer)}emit(e,t,i,o){this.lastEmitTs=performance.now(),this.zone.run(()=>this.appTap.emit({x:t,y:i,type:e,sourceEvent:o}))}add(e,t,i){this.el.addEventListener(e,t,i),this.removeFns.push(()=>this.el.removeEventListener(e,t,i))}resetGesture(){this.active=!1,this.pointerId=null,this.startTime=0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=Z({type:a,selectors:[["","appTap",""]],hostAttrs:[2,"touch-action","manipulation","-webkit-tap-highlight-color","transparent"],inputs:{maxMove:"maxMove",maxDuration:"maxDuration",doubleTapInterval:"doubleTapInterval",doubleTapSlop:"doubleTapSlop",enableDoubleTap:"enableDoubleTap",emitSingleWhenNoDouble:"emitSingleWhenNoDouble",preventGhostClick:"preventGhostClick",preventDefault:"preventDefault",disabled:"disabled"},outputs:{appTap:"appTap"}});let n=a;return n})();var ut=["ulElement"],ft=["liElements"],yt=(n,a,s,e)=>({matches:n,itemTemplate:a,query:s,$implicit:e}),_t=(n,a,s,e)=>({item:n,index:a,match:s,query:e});function gt(n,a){}function vt(n,a){if(n&1&&f(0,"span",4),n&2){let s=a.match,e=a.query,t=r();p("innerHtml",t.highlight(s,e),U)}}function Ct(n,a){if(n&1&&(m(0,"h6",8),S(1),u()),n&2){let s=r().$implicit;c(),T(s)}}function xt(n,a){}function bt(n,a){if(n&1){let s=M();m(0,"button",9,2),b("click",function(t){y(s);let i=r().$implicit,o=r(2);return _(o.selectMatch(i,t))})("mouseenter",function(){y(s);let t=r().$implicit,i=r(2);return _(i.selectActive(t))}),w(2,xt,0,0,"ng-template",3),u()}if(n&2){let s=r(),e=s.$implicit,t=s.index,i=r(2),o=F(2);le("active",i.isActive(e)),p("id",i.popupId+"-"+t)("@typeaheadAnimation",i.animationState),c(2),p("ngTemplateOutlet",i.itemTemplate||o)("ngTemplateOutletContext",me(6,_t,e.item,t,e,i.query))}}function St(n,a){if(n&1&&w(0,Ct,2,1,"h6",6)(1,bt,3,11,"ng-template",7),n&2){let s=a.$implicit;p("ngIf",s.isHeader()),c(),p("ngIf",!s.isHeader())}}function Tt(n,a){if(n&1&&w(0,St,2,2,"ng-template",5),n&2){let s=r();p("ngForOf",s.matches)}}var Et={\u00C1:"A",\u0102:"A",\u1EAE:"A",\u1EB6:"A",\u1EB0:"A",\u1EB2:"A",\u1EB4:"A",\u01CD:"A",\u00C2:"A",\u1EA4:"A",\u1EAC:"A",\u1EA6:"A",\u1EA8:"A",\u1EAA:"A",\u00C4:"A",\u01DE:"A",\u0226:"A",\u01E0:"A",\u1EA0:"A",\u0200:"A",\u00C0:"A",\u1EA2:"A",\u0202:"A",\u0100:"A",\u0104:"A",\u00C5:"A",\u01FA:"A",\u1E00:"A","\u023A":"A",\u00C3:"A","\uA732":"AA",\u00C6:"AE",\u01FC:"AE",\u01E2:"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY",\u1E02:"B",\u1E04:"B",\u0181:"B",\u1E06:"B","\u0243":"B",\u0182:"B",\u0106:"C",\u010C:"C",\u00C7:"C",\u1E08:"C",\u0108:"C",\u010A:"C",\u0187:"C","\u023B":"C",\u010E:"D",\u1E10:"D",\u1E12:"D",\u1E0A:"D",\u1E0C:"D",\u018A:"D",\u1E0E:"D",\u01F2:"D",\u01C5:"D",\u0110:"D",\u018B:"D",\u01F1:"DZ",\u01C4:"DZ",\u00C9:"E",\u0114:"E",\u011A:"E",\u0228:"E",\u1E1C:"E",\u00CA:"E",\u1EBE:"E",\u1EC6:"E",\u1EC0:"E",\u1EC2:"E",\u1EC4:"E",\u1E18:"E",\u00CB:"E",\u0116:"E",\u1EB8:"E",\u0204:"E",\u00C8:"E",\u1EBA:"E",\u0206:"E",\u0112:"E",\u1E16:"E",\u1E14:"E",\u0118:"E","\u0246":"E",\u1EBC:"E",\u1E1A:"E","\uA76A":"ET",\u1E1E:"F",\u0191:"F",\u01F4:"G",\u011E:"G",\u01E6:"G",\u0122:"G",\u011C:"G",\u0120:"G",\u0193:"G",\u1E20:"G",\u01E4:"G",\u1E2A:"H",\u021E:"H",\u1E28:"H",\u0124:"H","\u2C67":"H",\u1E26:"H",\u1E22:"H",\u1E24:"H",\u0126:"H",\u00CD:"I",\u012C:"I",\u01CF:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u0130:"I",\u1ECA:"I",\u0208:"I",\u00CC:"I",\u1EC8:"I",\u020A:"I",\u012A:"I",\u012E:"I",\u0197:"I",\u0128:"I",\u1E2C:"I","\uA779":"D","\uA77B":"F","\uA77D":"G","\uA782":"R","\uA784":"S","\uA786":"T","\uA76C":"IS",\u0134:"J","\u0248":"J",\u1E30:"K",\u01E8:"K",\u0136:"K","\u2C69":"K","\uA742":"K",\u1E32:"K",\u0198:"K",\u1E34:"K","\uA740":"K","\uA744":"K",\u0139:"L","\u023D":"L",\u013D:"L",\u013B:"L",\u1E3C:"L",\u1E36:"L",\u1E38:"L","\u2C60":"L","\uA748":"L",\u1E3A:"L",\u013F:"L","\u2C62":"L",\u01C8:"L",\u0141:"L",\u01C7:"LJ",\u1E3E:"M",\u1E40:"M",\u1E42:"M","\u2C6E":"M",\u0143:"N",\u0147:"N",\u0145:"N",\u1E4A:"N",\u1E44:"N",\u1E46:"N",\u01F8:"N",\u019D:"N",\u1E48:"N","\u0220":"N",\u01CB:"N",\u00D1:"N",\u01CA:"NJ",\u00D3:"O",\u014E:"O",\u01D1:"O",\u00D4:"O",\u1ED0:"O",\u1ED8:"O",\u1ED2:"O",\u1ED4:"O",\u1ED6:"O",\u00D6:"O",\u022A:"O",\u022E:"O",\u0230:"O",\u1ECC:"O",\u0150:"O",\u020C:"O",\u00D2:"O",\u1ECE:"O",\u01A0:"O",\u1EDA:"O",\u1EE2:"O",\u1EDC:"O",\u1EDE:"O",\u1EE0:"O",\u020E:"O","\uA74A":"O","\uA74C":"O",\u014C:"O",\u1E52:"O",\u1E50:"O",\u019F:"O",\u01EA:"O",\u01EC:"O",\u00D8:"O",\u01FE:"O",\u00D5:"O",\u1E4C:"O",\u1E4E:"O",\u022C:"O",\u01A2:"OI","\uA74E":"OO",\u0190:"E",\u0186:"O",\u0222:"OU",\u1E54:"P",\u1E56:"P","\uA752":"P",\u01A4:"P","\uA754":"P","\u2C63":"P","\uA750":"P","\uA758":"Q","\uA756":"Q",\u0154:"R",\u0158:"R",\u0156:"R",\u1E58:"R",\u1E5A:"R",\u1E5C:"R",\u0210:"R",\u0212:"R",\u1E5E:"R","\u024C":"R","\u2C64":"R","\uA73E":"C",\u018E:"E",\u015A:"S",\u1E64:"S",\u0160:"S",\u1E66:"S",\u015E:"S",\u015C:"S",\u0218:"S",\u1E60:"S",\u1E62:"S",\u1E68:"S",\u0164:"T",\u0162:"T",\u1E70:"T",\u021A:"T","\u023E":"T",\u1E6A:"T",\u1E6C:"T",\u01AC:"T",\u1E6E:"T",\u01AE:"T",\u0166:"T","\u2C6F":"A","\uA780":"L",\u019C:"M","\u0245":"V","\uA728":"TZ",\u00DA:"U",\u016C:"U",\u01D3:"U",\u00DB:"U",\u1E76:"U",\u00DC:"U",\u01D7:"U",\u01D9:"U",\u01DB:"U",\u01D5:"U",\u1E72:"U",\u1EE4:"U",\u0170:"U",\u0214:"U",\u00D9:"U",\u1EE6:"U",\u01AF:"U",\u1EE8:"U",\u1EF0:"U",\u1EEA:"U",\u1EEC:"U",\u1EEE:"U",\u0216:"U",\u016A:"U",\u1E7A:"U",\u0172:"U",\u016E:"U",\u0168:"U",\u1E78:"U",\u1E74:"U","\uA75E":"V",\u1E7E:"V",\u01B2:"V",\u1E7C:"V","\uA760":"VY",\u1E82:"W",\u0174:"W",\u1E84:"W",\u1E86:"W",\u1E88:"W",\u1E80:"W","\u2C72":"W",\u1E8C:"X",\u1E8A:"X",\u00DD:"Y",\u0176:"Y",\u0178:"Y",\u1E8E:"Y",\u1EF4:"Y",\u1EF2:"Y",\u01B3:"Y",\u1EF6:"Y","\u1EFE":"Y",\u0232:"Y","\u024E":"Y",\u1EF8:"Y",\u0179:"Z",\u017D:"Z",\u1E90:"Z","\u2C6B":"Z",\u017B:"Z",\u1E92:"Z",\u0224:"Z",\u1E94:"Z",\u01B5:"Z",\u0132:"IJ",\u0152:"OE","\u1D00":"A","\u1D01":"AE",\u0299:"B","\u1D03":"B","\u1D04":"C","\u1D05":"D","\u1D07":"E","\uA730":"F",\u0262:"G",\u029B:"G",\u029C:"H",\u026A:"I",\u0281:"R","\u1D0A":"J","\u1D0B":"K",\u029F:"L","\u1D0C":"L","\u1D0D":"M",\u0274:"N","\u1D0F":"O",\u0276:"OE","\u1D10":"O","\u1D15":"OU","\u1D18":"P",\u0280:"R","\u1D0E":"N","\u1D19":"R","\uA731":"S","\u1D1B":"T","\u2C7B":"E","\u1D1A":"R","\u1D1C":"U","\u1D20":"V","\u1D21":"W",\u028F:"Y","\u1D22":"Z",\u00E1:"a",\u0103:"a",\u1EAF:"a",\u1EB7:"a",\u1EB1:"a",\u1EB3:"a",\u1EB5:"a",\u01CE:"a",\u00E2:"a",\u1EA5:"a",\u1EAD:"a",\u1EA7:"a",\u1EA9:"a",\u1EAB:"a",\u00E4:"a",\u01DF:"a",\u0227:"a",\u01E1:"a",\u1EA1:"a",\u0201:"a",\u00E0:"a",\u1EA3:"a",\u0203:"a",\u0101:"a",\u0105:"a","\u1D8F":"a",\u1E9A:"a",\u00E5:"a",\u01FB:"a",\u1E01:"a","\u2C65":"a",\u00E3:"a","\uA733":"aa",\u00E6:"ae",\u01FD:"ae",\u01E3:"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay",\u1E03:"b",\u1E05:"b",\u0253:"b",\u1E07:"b","\u1D6C":"b","\u1D80":"b",\u0180:"b",\u0183:"b",\u0275:"o",\u0107:"c",\u010D:"c",\u00E7:"c",\u1E09:"c",\u0109:"c",\u0255:"c",\u010B:"c",\u0188:"c","\u023C":"c",\u010F:"d",\u1E11:"d",\u1E13:"d","\u0221":"d",\u1E0B:"d",\u1E0D:"d",\u0257:"d","\u1D91":"d",\u1E0F:"d","\u1D6D":"d","\u1D81":"d",\u0111:"d",\u0256:"d",\u018C:"d",\u0131:"i","\u0237":"j",\u025F:"j",\u0284:"j",\u01F3:"dz",\u01C6:"dz",\u00E9:"e",\u0115:"e",\u011B:"e",\u0229:"e",\u1E1D:"e",\u00EA:"e",\u1EBF:"e",\u1EC7:"e",\u1EC1:"e",\u1EC3:"e",\u1EC5:"e",\u1E19:"e",\u00EB:"e",\u0117:"e",\u1EB9:"e",\u0205:"e",\u00E8:"e",\u1EBB:"e",\u0207:"e",\u0113:"e",\u1E17:"e",\u1E15:"e","\u2C78":"e",\u0119:"e","\u1D92":"e","\u0247":"e",\u1EBD:"e",\u1E1B:"e","\uA76B":"et",\u1E1F:"f",\u0192:"f","\u1D6E":"f","\u1D82":"f",\u01F5:"g",\u011F:"g",\u01E7:"g",\u0123:"g",\u011D:"g",\u0121:"g",\u0260:"g",\u1E21:"g","\u1D83":"g",\u01E5:"g",\u1E2B:"h",\u021F:"h",\u1E29:"h",\u0125:"h","\u2C68":"h",\u1E27:"h",\u1E23:"h",\u1E25:"h",\u0266:"h",\u1E96:"h",\u0127:"h",\u0195:"hv",\u00ED:"i",\u012D:"i",\u01D0:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u1ECB:"i",\u0209:"i",\u00EC:"i",\u1EC9:"i",\u020B:"i",\u012B:"i",\u012F:"i","\u1D96":"i",\u0268:"i",\u0129:"i",\u1E2D:"i","\uA77A":"d","\uA77C":"f","\u1D79":"g","\uA783":"r","\uA785":"s","\uA787":"t","\uA76D":"is",\u01F0:"j",\u0135:"j",\u029D:"j","\u0249":"j",\u1E31:"k",\u01E9:"k",\u0137:"k","\u2C6A":"k","\uA743":"k",\u1E33:"k",\u0199:"k",\u1E35:"k","\u1D84":"k","\uA741":"k","\uA745":"k",\u013A:"l",\u019A:"l",\u026C:"l",\u013E:"l",\u013C:"l",\u1E3D:"l","\u0234":"l",\u1E37:"l",\u1E39:"l","\u2C61":"l","\uA749":"l",\u1E3B:"l",\u0140:"l",\u026B:"l","\u1D85":"l",\u026D:"l",\u0142:"l",\u01C9:"lj",\u017F:"s","\u1E9C":"s",\u1E9B:"s","\u1E9D":"s",\u1E3F:"m",\u1E41:"m",\u1E43:"m",\u0271:"m","\u1D6F":"m","\u1D86":"m",\u0144:"n",\u0148:"n",\u0146:"n",\u1E4B:"n","\u0235":"n",\u1E45:"n",\u1E47:"n",\u01F9:"n",\u0272:"n",\u1E49:"n",\u019E:"n","\u1D70":"n","\u1D87":"n",\u0273:"n",\u00F1:"n",\u01CC:"nj",\u00F3:"o",\u014F:"o",\u01D2:"o",\u00F4:"o",\u1ED1:"o",\u1ED9:"o",\u1ED3:"o",\u1ED5:"o",\u1ED7:"o",\u00F6:"o",\u022B:"o",\u022F:"o",\u0231:"o",\u1ECD:"o",\u0151:"o",\u020D:"o",\u00F2:"o",\u1ECF:"o",\u01A1:"o",\u1EDB:"o",\u1EE3:"o",\u1EDD:"o",\u1EDF:"o",\u1EE1:"o",\u020F:"o","\uA74B":"o","\uA74D":"o","\u2C7A":"o",\u014D:"o",\u1E53:"o",\u1E51:"o",\u01EB:"o",\u01ED:"o",\u00F8:"o",\u01FF:"o",\u00F5:"o",\u1E4D:"o",\u1E4F:"o",\u022D:"o",\u01A3:"oi","\uA74F":"oo",\u025B:"e","\u1D93":"e",\u0254:"o","\u1D97":"o",\u0223:"ou",\u1E55:"p",\u1E57:"p","\uA753":"p",\u01A5:"p","\u1D71":"p","\u1D88":"p","\uA755":"p","\u1D7D":"p","\uA751":"p","\uA759":"q",\u02A0:"q","\u024B":"q","\uA757":"q",\u0155:"r",\u0159:"r",\u0157:"r",\u1E59:"r",\u1E5B:"r",\u1E5D:"r",\u0211:"r",\u027E:"r","\u1D73":"r",\u0213:"r",\u1E5F:"r",\u027C:"r","\u1D72":"r","\u1D89":"r","\u024D":"r",\u027D:"r","\u2184":"c","\uA73F":"c",\u0258:"e",\u027F:"r",\u015B:"s",\u1E65:"s",\u0161:"s",\u1E67:"s",\u015F:"s",\u015D:"s",\u0219:"s",\u1E61:"s",\u1E63:"s",\u1E69:"s",\u0282:"s","\u1D74":"s","\u1D8A":"s","\u023F":"s",\u0261:"g","\u1D11":"o","\u1D13":"o","\u1D1D":"u",\u0165:"t",\u0163:"t",\u1E71:"t",\u021B:"t","\u0236":"t",\u1E97:"t","\u2C66":"t",\u1E6B:"t",\u1E6D:"t",\u01AD:"t",\u1E6F:"t","\u1D75":"t",\u01AB:"t",\u0288:"t",\u0167:"t","\u1D7A":"th",\u0250:"a","\u1D02":"ae",\u01DD:"e","\u1D77":"g",\u0265:"h","\u02AE":"h","\u02AF":"h","\u1D09":"i",\u029E:"k","\uA781":"l",\u026F:"m",\u0270:"m","\u1D14":"oe",\u0279:"r",\u027B:"r",\u027A:"r","\u2C79":"r",\u0287:"t",\u028C:"v",\u028D:"w",\u028E:"y","\uA729":"tz",\u00FA:"u",\u016D:"u",\u01D4:"u",\u00FB:"u",\u1E77:"u",\u00FC:"u",\u01D8:"u",\u01DA:"u",\u01DC:"u",\u01D6:"u",\u1E73:"u",\u1EE5:"u",\u0171:"u",\u0215:"u",\u00F9:"u",\u1EE7:"u",\u01B0:"u",\u1EE9:"u",\u1EF1:"u",\u1EEB:"u",\u1EED:"u",\u1EEF:"u",\u0217:"u",\u016B:"u",\u1E7B:"u",\u0173:"u","\u1D99":"u",\u016F:"u",\u0169:"u",\u1E79:"u",\u1E75:"u","\u1D6B":"ue","\uA778":"um","\u2C74":"v","\uA75F":"v",\u1E7F:"v",\u028B:"v","\u1D8C":"v","\u2C71":"v",\u1E7D:"v","\uA761":"vy",\u1E83:"w",\u0175:"w",\u1E85:"w",\u1E87:"w",\u1E89:"w",\u1E81:"w","\u2C73":"w",\u1E98:"w",\u1E8D:"x",\u1E8B:"x","\u1D8D":"x",\u00FD:"y",\u0177:"y",\u00FF:"y",\u1E8F:"y",\u1EF5:"y",\u1EF3:"y",\u01B4:"y",\u1EF7:"y","\u1EFF":"y",\u0233:"y",\u1E99:"y","\u024F":"y",\u1EF9:"y",\u017A:"z",\u017E:"z",\u1E91:"z",\u0291:"z","\u2C6C":"z",\u017C:"z",\u1E93:"z",\u0225:"z",\u1E95:"z","\u1D76":"z","\u1D8E":"z",\u0290:"z",\u01B6:"z","\u0240":"z",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u0133:"ij",\u0153:"oe",\uFB06:"st","\u2090":"a","\u2091":"e","\u1D62":"i","\u2C7C":"j","\u2092":"o","\u1D63":"r","\u1D64":"u","\u1D65":"v","\u2093":"x"};var k=class{constructor(a,s=a,e=!1){this.item=a,this.value=s,this.header=e}isHeader(){return this.header}toString(){return this.value}};function W(n){return n?n.replace(/[^A-Za-z0-9[\] ]/g,function(a){return Et[a]||a}):""}function ge(n,a=" ",s="",e){let t=[];if(!e)t=rt(n,a,s);else{let i=`([${e}]+)`,o=n.split(new RegExp(i,"g")),l=o[o.length-1];l>""&&(a&&s?t=rt(l,a,s):t.push(l))}return t}function rt(n,a,s){let e=[],t=`(?:[${s}])([^${s}]+)(?:[${s}])|([^${a}]+)`,i=n.split(new RegExp(t,"g")),o=i.length,l,h=new RegExp(`[${s}]+`,"g");for(let d=0;d<o;d+=1)l=i[d],l&&l.length&&l!==a&&e.push(l.replace(h,""));return e}function A(n,a){if(!a||typeof n!="object")return n.toString();if(a.endsWith("()")){let t=a.slice(0,a.length-2);return n[t]().toString()}let e=a.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");for(let t of e)t in n&&(n=n[t]);return n?n.toString():""}var lt="220ms cubic-bezier(0, 0, 0.2, 1)",Ot=Be("typeaheadAnimation",[fe("animated-down",z({height:"*",overflow:"hidden"})),J("* => animated-down",[z({height:0,overflow:"hidden"}),X(lt)]),fe("animated-up",z({height:"*",overflow:"hidden"})),J("* => animated-up",[z({height:"*",overflow:"hidden"}),X(lt)]),J("* => unanimated",X("0s"))]),It=0,wt=(()=>{let a=class a{get typeaheadTemplateMethods(){return{selectMatch:this.selectMatch.bind(this),selectActive:this.selectActive.bind(this),isActive:this.isActive.bind(this)}}constructor(e,t,i,o){this.positionService=e,this.renderer=t,this.element=i,this.changeDetectorRef=o,this.activeChangeEvent=new g,this.isFocused=!1,this.positionServiceSubscription=new ve,this.height=0,this.popupId=`ngb-typeahead-${It++}`,this._matches=[],this.renderer.setAttribute(this.element.nativeElement,"id",this.popupId),this.positionServiceSubscription.add(this.positionService.event$?.subscribe(()=>{if(this.isAnimated){this.animationState=this.isTopPosition?"animated-up":"animated-down",this.changeDetectorRef.detectChanges();return}this.animationState="unanimated",this.changeDetectorRef.detectChanges()}))}get active(){return this._active}set active(e){this._active=e,this.activeChanged()}get matches(){return this._matches}set matches(e){if(this.positionService.setOptions({modifiers:{flip:{enabled:this.adaptivePosition}},allowedPositions:["top","bottom"]}),this._matches=e,this.needScrollbar=this.typeaheadScrollable&&this.typeaheadOptionsInScrollableView<this.matches.length,this.typeaheadScrollable&&setTimeout(()=>{this.setScrollableMode()}),this.typeaheadIsFirstItemActive&&this._matches.length>0&&(this.setActive(this._matches[0]),this._active?.isHeader()&&this.nextActiveMatch()),this._active&&!this.typeaheadIsFirstItemActive){let t=this._matches.find(i=>i.value===this._active?.value);if(t){this.selectActive(t);return}this.active=void 0}}get isTopPosition(){return this.element.nativeElement.classList.contains("top")}get optionsListTemplate(){return this.parent?this.parent.optionsListTemplate:void 0}get isAnimated(){return this.parent?this.parent.isAnimated:!1}get adaptivePosition(){return this.parent?this.parent.adaptivePosition:!1}get typeaheadScrollable(){return this.parent?this.parent.typeaheadScrollable:!1}get typeaheadOptionsInScrollableView(){return this.parent?this.parent.typeaheadOptionsInScrollableView:5}get typeaheadIsFirstItemActive(){return this.parent?this.parent.typeaheadIsFirstItemActive:!0}get itemTemplate(){return this.parent?this.parent.typeaheadItemTemplate:void 0}get canSelectItemsOnBlur(){return!!this.parent?.selectItemOnBlur}selectActiveMatch(e){this._active&&this.parent?.typeaheadSelectFirstItem&&this.selectMatch(this._active),!this.parent?.typeaheadSelectFirstItem&&e&&this.selectMatch(this._active)}activeChanged(){if(!this._active)return;let e=this.matches.indexOf(this._active);this.activeChangeEvent.emit(`${this.popupId}-${e}`)}prevActiveMatch(){if(!this._active)return;let e=this.matches.indexOf(this._active);this.setActive(this.matches[e-1<0?this.matches.length-1:e-1]),this._active.isHeader()&&this.prevActiveMatch(),this.typeaheadScrollable&&this.scrollPrevious(e)}nextActiveMatch(){let e=this._active?this.matches.indexOf(this._active):-1;this.setActive(this.matches[e+1>this.matches.length-1?0:e+1]),this._active?.isHeader()&&this.nextActiveMatch(),this.typeaheadScrollable&&this.scrollNext(e)}selectActive(e){this.isFocused=!0,this.setActive(e)}highlight(e,t){let i=e.value,o=(this.parent&&this.parent.typeaheadLatinize?W(i):i).toLowerCase(),l,h;if(typeof t=="object"){let d=t.length,O="\u2063",P=17;for(let L=0;L<d;L+=1)l=o.indexOf(t[L]),h=t[L].length,l>=0&&h>0&&(i=`${i.substring(0,l)}<strong>${i.substring(l,l+h)}</strong>${i.substring(l+h)}`,o=`${o.substring(0,l)}${O.repeat(P+h)}${o.substring(l+h)}`)}else t&&(l=o.indexOf(t),h=t.length,l>=0&&h>0&&(i=`${i.substring(0,l)}<strong>${i.substring(l,l+h)}</strong>${i.substring(l+h)}`));return i}focusLost(){this.isFocused=!1,this.canSelectItemsOnBlur||this.setActive(void 0)}isActive(e){return this.active===e}selectMatch(e,t){return t&&(t.stopPropagation(),t.preventDefault()),this.parent?.changeModel(e),setTimeout(()=>this.parent?.typeaheadOnSelect.emit(e),0),!1}setScrollableMode(){if(this.ulElement||(this.ulElement=this.element),this.liElements?.first){let e=ye.getStyles(this.ulElement.nativeElement),t=ye.getStyles(this.liElements.first.nativeElement),i=parseFloat((e["padding-bottom"]?e["padding-bottom"]:"").replace("px","")),o=parseFloat((e["padding-top"]?e["padding-top"]:"0").replace("px","")),l=parseFloat((t.height?t.height:"0").replace("px","")),h=this.typeaheadOptionsInScrollableView*l;this.guiHeight=`${h+o+i}px`}this.renderer.setStyle(this.element.nativeElement,"visibility","visible")}scrollPrevious(e){if(e===0){this.scrollToBottom();return}if(this.liElements&&this.ulElement){let t=this.liElements.toArray()[e-1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop)}}scrollNext(e){if(e+1>this.matches.length-1){this.scrollToTop();return}if(this.liElements&&this.ulElement){let t=this.liElements.toArray()[e+1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop-Number(this.ulElement.nativeElement.offsetHeight)+Number(t.nativeElement.offsetHeight))}}ngOnDestroy(){this.positionServiceSubscription.unsubscribe()}setActive(e){this._active=e;let t;this._active==null||this._active.isHeader()||(t=e),this.parent?.typeaheadOnPreview.emit(t)}isScrolledIntoView(e){if(!this.ulElement)return!1;let t=this.ulElement.nativeElement.scrollTop,i=t+Number(this.ulElement.nativeElement.offsetHeight),o=e.offsetTop;return o+e.offsetHeight<=i&&o>=t}scrollToBottom(){this.ulElement?.nativeElement&&(this.ulElement.nativeElement.scrollTop=this.ulElement.nativeElement.scrollHeight)}scrollToTop(){this.ulElement?.nativeElement&&(this.ulElement.nativeElement.scrollTop=0)}};a.\u0275fac=function(t){return new(t||a)(v($),v(ae),v(R),v(ue))},a.\u0275cmp=Q({type:a,selectors:[["typeahead-container"]],viewQuery:function(t,i){if(t&1&&(B(ut,5),B(ft,5)),t&2){let o;H(o=V())&&(i.ulElement=o.first),H(o=V())&&(i.liElements=o)}},hostAttrs:[1,"dropdown","open","bottom","dropdown-menu",2,"position","absolute","display","block"],hostVars:7,hostBindings:function(t,i){t&1&&b("mouseleave",function(){return i.focusLost()})("blur",function(){return i.focusLost()}),t&2&&(se("role","listbox"),Ae("height",i.needScrollbar?i.guiHeight:"auto")("visibility","inherit"),le("dropup",i.dropup))},outputs:{activeChangeEvent:"activeChange"},features:[de([$])],decls:5,vars:7,consts:[["bsItemTemplate",""],["bs4Template",""],["liElements",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHtml"],["ngFor","",3,"ngForOf"],["class","dropdown-header",4,"ngIf"],[3,"ngIf"],[1,"dropdown-header"],["role","option",1,"dropdown-item",3,"click","mouseenter","id"]],template:function(t,i){if(t&1&&w(0,gt,0,0,"ng-template",3)(1,vt,1,1,"ng-template",null,0,N)(3,Tt,1,1,"ng-template",null,1,N),t&2){let o=F(2),l=F(4);p("ngTemplateOutlet",i.optionsListTemplate||l)("ngTemplateOutletContext",me(2,yt,i.matches,i.itemTemplate||o,i.query,i.typeaheadTemplateMethods))}},dependencies:[ke,De,Fe],styles:[".dropdown[_nghost-%COMP%]{z-index:1000}.dropdown-menu[_nghost-%COMP%], .dropdown-menu[_ngcontent-%COMP%]{overflow-y:auto;height:100px}"],data:{animation:[Ot]}});let n=a;return n})(),ht=(()=>{let a=class a{constructor(){this.adaptivePosition=!1,this.isAnimated=!1,this.hideResultsOnBlur=!0,this.cancelRequestOnFocusLost=!1,this.selectFirstItem=!0,this.isFirstItemActive=!0,this.minLength=1,this.selectItemOnBlur=!1}};a.\u0275fac=function(t){return new(t||a)},a.\u0275prov=Ee({token:a,factory:a.\u0275fac,providedIn:"root"});let n=a;return n})(),ct=(()=>{let a=class a{constructor(e,t,i,o,l,h,d){this.changeDetection=i,this.element=o,this.ngControl=l,this.renderer=h,this.typeaheadMinLength=1,this.adaptivePosition=!1,this.isAnimated=!1,this.typeaheadWaitMs=0,this.typeaheadLatinize=!0,this.typeaheadSingleWords=!0,this.typeaheadWordDelimiters=" ",this.typeaheadMultipleSearchDelimiters=",",this.typeaheadPhraseDelimiters=`'"`,this.typeaheadScrollable=!1,this.typeaheadOptionsInScrollableView=5,this.typeaheadSelectFirstItem=!0,this.typeaheadIsFirstItemActive=!0,this.typeaheadLoading=new g,this.typeaheadNoResults=new g,this.typeaheadOnSelect=new g,this.typeaheadOnPreview=new g,this.typeaheadOnBlur=new g,this.dropup=!1,this.isOpen=!1,this.list="list",this.isActiveItemChanged=!1,this.isFocused=!1,this.cancelRequestOnFocusLost=!1,this.selectItemOnBlur=!1,this.keyUpEventEmitter=new g,this.placement="bottom left",this._matches=[],this._subscriptions=[],this._outsideClickListener=()=>{},this._typeahead=e.createLoader(o,d,h).provide({provide:ht,useValue:t}),Object.assign(this,{typeaheadHideResultsOnBlur:t.hideResultsOnBlur,cancelRequestOnFocusLost:t.cancelRequestOnFocusLost,typeaheadSelectFirstItem:t.selectFirstItem,typeaheadIsFirstItemActive:t.isFirstItemActive,typeaheadMinLength:t.minLength,adaptivePosition:t.adaptivePosition,isAnimated:t.isAnimated,selectItemOnBlur:t.selectItemOnBlur})}get matches(){return this._matches}ngOnInit(){this.typeaheadOptionsLimit=this.typeaheadOptionsLimit||20,this.typeaheadMinLength=this.typeaheadMinLength===void 0?1:this.typeaheadMinLength,this.typeaheadAsync===void 0&&!G(this.typeahead)&&(this.typeaheadAsync=!1),G(this.typeahead)&&(this.typeaheadAsync=!0),this.typeaheadAsync?this.asyncActions():this.syncActions(),this.checkDelimitersConflict()}onInput(e){let t=e.target.value!==void 0?e.target.value:e.target.textContent!==void 0?e.target.textContent:e.target.innerText;t!=null&&t.trim().length>=this.typeaheadMinLength?(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(e.target.value)):(this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!1),this.hide())}onChange(e){if(this._container){if(e.keyCode===27||e.key==="Escape"){this.hide();return}if(e.keyCode===38||e.key==="ArrowUp"){this.isActiveItemChanged=!0,this._container.prevActiveMatch();return}if(e.keyCode===40||e.key==="ArrowDown"){this.isActiveItemChanged=!0,this._container.nextActiveMatch();return}if(e.keyCode===13||e.key==="Enter"){this._container.selectActiveMatch();return}}}onFocus(){this.isFocused=!0,setTimeout(()=>{this.typeaheadMinLength===0&&(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(this.element.nativeElement.value||""))},0)}onBlur(){this.isFocused=!1,this._container&&!this._container.isFocused&&this.typeaheadOnBlur.emit(this._container.active),!this.container&&this._matches?.length===0&&this.typeaheadOnBlur.emit(new k(this.element.nativeElement.value,this.element.nativeElement.value,!1))}onKeydown(e){if(this._container&&((e.keyCode===9||e.key==="Tab")&&this.onBlur(),e.keyCode===9||e.key==="Tab"||e.keyCode===13||e.key==="Enter")){if(e.preventDefault(),this.typeaheadSelectFirstItem){this._container.selectActiveMatch();return}this.typeaheadSelectFirstItem||(this._container.selectActiveMatch(this.isActiveItemChanged),this.isActiveItemChanged=!1,this.hide())}}changeModel(e){if(!e)return;let t;if(this.typeaheadMultipleSearch&&this._allEnteredValue){let i=this._allEnteredValue.split(new RegExp(`([${this.typeaheadMultipleSearchDelimiters}]+)`));this._allEnteredValue=i.slice(0,i.length-1).concat(e.value).join(""),t=this._allEnteredValue}else t=e.value;this.ngControl.viewToModelUpdate(t),this.ngControl.control?.setValue(t),this.changeDetection.markForCheck(),this.hide()}show(){if(this._typeahead.attach(wt).to(this.container).position({attachment:`${this.dropup?"top":"bottom"} left`}).show({typeaheadRef:this,placement:this.placement,animation:!1,dropup:this.dropup}),this._outsideClickListener=this.renderer.listen("document","click",t=>{this.typeaheadMinLength===0&&this.element.nativeElement.contains(t.target)||!this.typeaheadHideResultsOnBlur||this.element.nativeElement.contains(t.target)||this.onOutsideClick()}),!this._typeahead.instance||!this.ngControl.control)return;this._container=this._typeahead.instance,this._container.parent=this;let e=(this.typeaheadLatinize?W(this.ngControl.control.value):this.ngControl.control.value).toString().toLowerCase();this._container.query=this.tokenizeQuery(e),this._container.matches=this._matches,this.element.nativeElement.focus(),this._container.activeChangeEvent.subscribe(t=>{this.activeDescendant=t,this.changeDetection.markForCheck()}),this.isOpen=!0}hide(){this._typeahead.isShown&&(this._typeahead.hide(),this._outsideClickListener(),this._container=void 0,this.isOpen=!1,this.changeDetection.markForCheck()),this.typeaheadOnPreview.emit()}onOutsideClick(){this._container&&!this._container.isFocused&&this.hide()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._typeahead.dispose()}asyncActions(){this._subscriptions.push(this.keyUpEventEmitter.pipe(ie(this.typeaheadWaitMs),Y(e=>this._allEnteredValue=e),Te(()=>this.typeahead?this.typeahead:te)).subscribe(e=>{this.finalizeAsyncCall(e)}))}syncActions(){this._subscriptions.push(this.keyUpEventEmitter.pipe(ie(this.typeaheadWaitMs),j(e=>{this._allEnteredValue=e;let t=this.normalizeQuery(e);return this.typeahead?(G(this.typeahead)?this.typeahead:xe(this.typeahead)).pipe(be(o=>!!o&&this.testMatch(this.normalizeOption(o),t)),Se()):te})).subscribe(e=>{this.finalizeAsyncCall(e)}))}normalizeOption(e){let t=A(e,this.typeaheadOptionField);return(this.typeaheadLatinize?W(t):t).toLowerCase()}tokenizeQuery(e){let t=e;return this.typeaheadMultipleSearch&&this.typeaheadSingleWords?this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`,this.typeaheadMultipleSearchDelimiters)||(t=ge(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters,this.typeaheadMultipleSearchDelimiters)):this.typeaheadSingleWords?t=ge(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters):t=ge(t,void 0,void 0,this.typeaheadMultipleSearchDelimiters),t}normalizeQuery(e){let t=(this.typeaheadLatinize?W(e):e).toString().toLowerCase();return t=this.tokenizeQuery(t),t}testMatch(e,t){let i;if(typeof t=="object"){i=t.length;for(let o=0;o<i;o+=1)if(t[o].length>0&&e.indexOf(t[o])<0)return!1;return!0}return e.indexOf(t)>=0}finalizeAsyncCall(e){if(this.prepareMatches(e||[]),this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!this.hasMatches()),!this.hasMatches()){this.hide();return}if(!(!this.isFocused&&this.cancelRequestOnFocusLost))if(this._container&&this.ngControl.control){let i=((this.typeaheadLatinize?W(this.ngControl.control.value):this.ngControl.control.value)||"").toString().toLowerCase();this._container.query=this.tokenizeQuery(i),this._container.matches=this._matches}else this.show()}prepareMatches(e){let t=e.slice(0,this.typeaheadOptionsLimit),i=this.typeaheadOrderBy?this.orderMatches(t):t;if(this.typeaheadGroupField){let o=[];i.map(h=>A(h,this.typeaheadGroupField)).filter((h,d,O)=>O.indexOf(h)===d).forEach(h=>{o.push(new k(h,h,!0)),o=o.concat(i.filter(d=>A(d,this.typeaheadGroupField)===h).map(d=>new k(d,A(d,this.typeaheadOptionField))))}),this._matches=o}else this._matches=i.map(o=>new k(o,A(o,this.typeaheadOptionField)))}orderMatches(e){if(!e.length)return e;if(this.typeaheadOrderBy!==null&&this.typeaheadOrderBy!==void 0&&typeof this.typeaheadOrderBy=="object"&&Object.keys(this.typeaheadOrderBy).length===0)return console.error("Field and direction properties for typeaheadOrderBy have to be set according to documentation!"),e;let{field:t,direction:i}=this.typeaheadOrderBy||{};return!i||!(i==="asc"||i==="desc")?(console.error('typeaheadOrderBy direction has to equal "asc" or "desc". Please follow the documentation.'),e):typeof e[0]=="string"?i==="asc"?e.sort():e.sort().reverse():!t||typeof t!="string"?(console.error("typeaheadOrderBy field has to set according to the documentation."),e):e.sort((o,l)=>{let h=A(o,t),d=A(l,t);return h<d?i==="asc"?-1:1:h>d?i==="asc"?1:-1:0})}hasMatches(){return this._matches.length>0}checkDelimitersConflict(){if(this.typeaheadMultipleSearch&&this.typeaheadSingleWords&&this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`,this.typeaheadMultipleSearchDelimiters))throw new Error(`Delimiters used in typeaheadMultipleSearchDelimiters must be different
2
2
  from delimiters used in typeaheadWordDelimiters (current value: ${this.typeaheadWordDelimiters}) and
3
3
  typeaheadPhraseDelimiters (current value: ${this.typeaheadPhraseDelimiters}).
4
4
  Please refer to the documentation`)}haveCommonCharacters(e,t){for(let i=0;i<e.length;i++)if(e.charAt(i).indexOf(t)>-1)return!0;return!1}};a.\u0275fac=function(t){return new(t||a)(v(ee),v(ht),v(ue),v(R),v(Ve),v(ae),v(Ie))},a.\u0275dir=Z({type:a,selectors:[["","typeahead",""]],hostVars:4,hostBindings:function(t,i){t&1&&b("input",function(l){return i.onInput(l)})("keyup",function(l){return i.onChange(l)})("click",function(){return i.onFocus()})("focus",function(){return i.onFocus()})("blur",function(){return i.onBlur()})("keydown",function(l){return i.onKeydown(l)}),t&2&&se("aria-activedescendant",i.activeDescendant)("aria-owns",i.isOpen?i._container.popupId:null)("aria-expanded",i.isOpen)("aria-autocomplete",i.list)},inputs:{typeahead:"typeahead",typeaheadMinLength:"typeaheadMinLength",adaptivePosition:"adaptivePosition",isAnimated:"isAnimated",typeaheadWaitMs:"typeaheadWaitMs",typeaheadOptionsLimit:"typeaheadOptionsLimit",typeaheadOptionField:"typeaheadOptionField",typeaheadGroupField:"typeaheadGroupField",typeaheadOrderBy:"typeaheadOrderBy",typeaheadAsync:"typeaheadAsync",typeaheadLatinize:"typeaheadLatinize",typeaheadSingleWords:"typeaheadSingleWords",typeaheadWordDelimiters:"typeaheadWordDelimiters",typeaheadMultipleSearch:"typeaheadMultipleSearch",typeaheadMultipleSearchDelimiters:"typeaheadMultipleSearchDelimiters",typeaheadPhraseDelimiters:"typeaheadPhraseDelimiters",typeaheadItemTemplate:"typeaheadItemTemplate",optionsListTemplate:"optionsListTemplate",typeaheadScrollable:"typeaheadScrollable",typeaheadOptionsInScrollableView:"typeaheadOptionsInScrollableView",typeaheadHideResultsOnBlur:"typeaheadHideResultsOnBlur",typeaheadSelectFirstItem:"typeaheadSelectFirstItem",typeaheadIsFirstItemActive:"typeaheadIsFirstItemActive",container:"container",dropup:"dropup"},outputs:{typeaheadLoading:"typeaheadLoading",typeaheadNoResults:"typeaheadNoResults",typeaheadOnSelect:"typeaheadOnSelect",typeaheadOnPreview:"typeaheadOnPreview",typeaheadOnBlur:"typeaheadOnBlur"},exportAs:["bs-typeahead"],features:[de([ee,$])]});let n=a;return n})(),pt=(()=>{let a=class a{static forRoot(){return{ngModule:a,providers:[]}}};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=we({type:a}),a.\u0275inj=Oe({imports:[Ue]});let n=a;return n})();var dt=(()=>{let a=class a{transform(e,t,i=!1){if(i&&t.length<1)return e;if(t&&e){let o=t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");o=o.split(" ").filter(h=>h.length>0).join("|");let l=new RegExp(o,"gi");return e.replace(l,h=>`<b>${h}</b>`)}else return e}};a.\u0275fac=function(t){return new(t||a)},a.\u0275pipe=Me({name:"highlight",type:a,pure:!0});let n=a;return n})();var At=["InputTypeHead"],Pt=(n,a)=>a.mid,Lt=(n,a)=>a.key;function Dt(n,a){if(n&1&&f(0,"img",7),n&2){let s=r().item;p("src",s.avatarUrl,ne)}}function Ft(n,a){if(n&1&&f(0,"fa-icon",13),n&2){let s=r().item,e=r();q(s.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),p("icon",e.icons.GROUPS)}}function kt(n,a){if(n&1&&(f(0,"span",10),E(1,"highlight")),n&2){let s=r().item,e=r();p("innerHTML",I(1,1,s.description,e.selection),U)}}function Rt(n,a){if(n&1&&(m(0,"div",5)(1,"div",6),C(2,Dt,1,1,"img",7)(3,Ft,1,3,"fa-icon",8),u(),m(4,"div"),f(5,"div",9),E(6,"highlight"),C(7,kt,2,4,"span",10),u(),m(8,"div",11)(9,"span",12),S(10),u()()()),n&2){let s=a.item,e=r();c(2),x(s.isUser?2:3),c(2),q(Pe("d-flex ms-2 pe-5 ",s.description?"flex-column align-items-start":"align-items-center")),c(),p("innerHTML",I(6,7,s.name,e.selection),U),c(2),x(s.description?7:-1),c(3),T(s.type)}}function Ut(n,a){if(n&1){let s=M();m(0,"input",14,1),E(2,"translate"),b("typeaheadOnSelect",function(t){y(s);let i=r();return _(i.onSelect(t))})("typeaheadLoading",function(){y(s);let t=r();return _(t.onLoading())})("typeaheadNoResults",function(){y(s);let t=r();return _(t.onNoResults())})("typeaheadOnPreview",function(){y(s);let t=r();return _(t.onPreview())}),pe("ngModelChange",function(t){y(s);let i=r();return ce(i.selection,t)||(i.selection=t),_(t)}),u()}if(n&2){let s=r(),e=F(1);he("ngModel",s.selection),p("placeholder",I(2,10,s.placeHolder,s.locale.language))("typeaheadItemTemplate",e)("typeaheadAsync",!0)("typeaheadMinLength",0)("typeaheadSingleWords",!0)("typeaheadOptionField","name")("typeaheadWaitMs",100)("typeaheadHideResultsOnBlur",!0)("typeahead",s.asyncSearchUsersOrGroups)}}function Bt(n,a){if(n&1&&f(0,"img",7),n&2){let s=r().$implicit;p("src",s.avatarUrl,ne)}}function Ht(n,a){if(n&1&&f(0,"fa-icon",17),n&2){let s=r(2);p("icon",s.icons.LINKS)}}function Vt(n,a){if(n&1&&f(0,"fa-icon",13),n&2){let s=r().$implicit,e=r();q(s.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),p("icon",e.icons.GROUPS)}}function Nt(n,a){if(n&1&&(m(0,"span",21),S(1),u()),n&2){let s=r().$implicit;c(),T(s.description)}}function zt(n,a){if(n&1&&(m(0,"span",22),S(1),u()),n&2){let s=r().$implicit;c(),T(s.type)}}function $t(n,a){if(n&1){let s=M();m(0,"button",32),E(1,"translate"),pe("ngModelChange",function(t){y(s);let i=r().$implicit,o=r(3).$implicit;return ce(o.hPerms[i.key],t)||(o.hPerms[i.key]=t),_(t)}),b("ngModelChange",function(){y(s);let t=r(4).$implicit,i=r();return _(i.onPermissionChange(t))}),f(2,"fa-icon",33),u()}if(n&2){let s=r().$implicit,e=r(3).$implicit,t=r();he("ngModel",e.hPerms[s.key]),p("tooltip",I(1,3,t.SPACES_PERMISSIONS_TEXT[s.key].text,t.locale.language)),c(2),p("icon",t.SPACES_PERMISSIONS_TEXT[s.key].icon)}}function Wt(n,a){if(n&1&&C(0,$t,3,6,"button",31),n&2){let s=a.$implicit,e=r(4);x(!e.filterPermissions||(e.filterPermissions&&e.allowedPermissions.indexOf(s.key))>-1?0:-1)}}function Gt(n,a){if(n&1&&(oe(0,Wt,1,1,null,null,Lt),E(2,"keyvalue"),f(3,"div",30)),n&2){let s=r(2).$implicit,e=r();re(I(2,0,s.hPerms,e.originalOrderKeyValue))}}function jt(n,a){if(n&1){let s=M();m(0,"button",34),E(1,"translate"),b("click",function(){y(s);let t=r(2).$implicit,i=r();return _(i.editFunction(t))}),f(2,"fa-icon",13),u()}if(n&2){let s=r(3);p("tooltip",I(1,2,"Edit",s.locale.language)),c(2),p("icon",s.icons.faPen)}}function Yt(n,a){if(n&1){let s=M();m(0,"div",26),f(1,"div",27),C(2,Gt,4,3),C(3,jt,3,5,"button",28),m(4,"button",29),E(5,"translate"),b("click",function(){y(s);let t=r().$implicit,i=r();return _(i.removeMember(t))}),f(6,"fa-icon",13),u()()}if(n&2){let s=r(2);c(2),x(s.withPermissions?2:-1),c(),x(s.editFunction?3:-1),c(),p("tooltip",I(5,4,"Remove",s.locale.language)),c(2),p("icon",s.icons.faTimes)}}function Kt(n,a){if(n&1&&(m(0,"div",4)(1,"div",15)(2,"div",16),C(3,Bt,1,1,"img",7)(4,Ht,1,1,"fa-icon",17)(5,Vt,1,3,"fa-icon",8),m(6,"div",18)(7,"div",19),S(8),u(),m(9,"div",20),C(10,Nt,2,1,"span",21)(11,zt,2,1,"span",22),u()()(),m(12,"div",23)(13,"div",24),S(14),u(),m(15,"div",25),S(16),E(17,"amTimeAgo"),u()(),C(18,Yt,7,7,"div",26),u()()),n&2){let s=a.$implicit,e=r();c(3),x(s.isUser?3:s.isLink?4:5),c(5),T(s.name),c(2),x(s.description?10:s.linkId?-1:11),c(4),T(s.isLink?e.MEMBER_TYPE.LINK:s.type),c(2),T(Le(17,6,s.createdAt)),c(2),x(e.editMode?18:-1)}}var Gi=(()=>{let a=class a{constructor(){this.members=[],this.membersChange=new g,this.withPermissions=!1,this.filterPermissions=!1,this.allowedPermissions=[],this.editMode=!0,this.hideInput=!1,this.editFunction=null,this.locale=D(We),this.MEMBER_TYPE=it,this.originalOrderKeyValue=Je,this.SPACES_PERMISSIONS_TEXT=tt,this.icons={GROUPS:qe.GROUPS,LINKS:et.LINKS,faTimes:Qe,faPen:Ze},this.selection="",this.ngZone=D(K),this.defaultPlaceholder="Type to search for users or groups to add",this.placeHolder=this.defaultPlaceholder,this.lastResults=[],this.asyncSearchUsersOrGroups=new Ce(e=>e.next(this.selection)).pipe(j(e=>this.searchFunction(e||"").pipe(Y(t=>this.lastResults=t))))}ngOnInit(){this.setDefaultPlaceHolder()}onSelect(e){this.ngZone.run(()=>{this.selection="",this.inputTypeHead.nativeElement.value=""});let t=e.item;t.createdAt||(t.createdAt=new Date),this.members.unshift(e.item),this.membersChange.emit(this.members),this.lastResults=this.lastResults.filter(i=>i.mid!==t.mid)}onPermissionChange(e){e.permissions=nt(e.hPerms)}removeMember(e){this.members=this.members.filter(t=>t.mid!==e.mid),this.membersChange.emit(this.members),this.lastResults.push(e)}onLoading(){this.placeHolder="Loading..."}onNoResults(){this.placeHolder="No results"}onPreview(){this.setDefaultPlaceHolder()}setDefaultPlaceHolder(){this.placeHolder=this.customPlaceholder||this.defaultPlaceholder}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=Q({type:a,selectors:[["app-user-search"]],viewQuery:function(t,i){if(t&1&&B(At,5),t&2){let o;H(o=V())&&(i.inputTypeHead=o.first)}},inputs:{members:"members",withPermissions:"withPermissions",filterPermissions:"filterPermissions",allowedPermissions:"allowedPermissions",editMode:"editMode",hideInput:"hideInput",searchFunction:"searchFunction",editFunction:"editFunction",customPlaceholder:"customPlaceholder"},outputs:{membersChange:"membersChange"},decls:6,vars:1,consts:[["searchMembers",""],["InputTypeHead",""],[1,"form-control","form-control-sm","mb-2",3,"ngModel","placeholder","typeaheadItemTemplate","typeaheadAsync","typeaheadMinLength","typeaheadSingleWords","typeaheadOptionField","typeaheadWaitMs","typeaheadHideResultsOnBlur","typeahead"],[1,"col-12","mt-1"],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],["role","button",1,"d-flex"],[1,"d-flex","align-items-center","text-truncate"],["alt","","height","30","width","30",1,"avatar-base-img",3,"src"],[3,"icon","class"],[3,"innerHTML"],[1,"fs-xxxs","me-4",3,"innerHTML"],[1,"ms-auto","ps-5","me-1","text-muted","d-none","d-lg-block","fs-xxxs","align-self-center"],["l10nTranslate",""],[3,"icon"],[1,"form-control","form-control-sm","mb-2",3,"typeaheadOnSelect","typeaheadLoading","typeaheadNoResults","typeaheadOnPreview","ngModelChange","ngModel","placeholder","typeaheadItemTemplate","typeaheadAsync","typeaheadMinLength","typeaheadSingleWords","typeaheadOptionField","typeaheadWaitMs","typeaheadHideResultsOnBlur","typeahead"],[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"],[1,"circle-primary-icon",3,"icon"],[1,"d-flex","flex-column","text-truncate","ms-2"],[1,"text-truncate"],[1,"fs-xxxs","text-truncate"],[1,"fs-xxxs"],["l10nTranslate","",1,"fs-xxxs"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],["l10nTranslate","",1,"d-flex","justify-content-end"],[1,"d-flex","justify-content-end"],[1,"d-flex","no-select"],[1,"vr","mx-2"],["type","button",1,"btn","btn-sm","btn-custom","me-2",3,"tooltip"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],[1,"vr","ms-1","me-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom",3,"ngModel","tooltip"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","me-2",3,"click","tooltip"]],template:function(t,i){t&1&&(w(0,Rt,11,10,"ng-template",null,0,N),C(2,Ut,3,13,"input",2),m(3,"div",3),oe(4,Kt,19,8,"div",4,Pt),u()),t&2&&(c(2),x(i.hideInput?-1:2),c(2),re(i.members))},dependencies:[pt,ct,$e,He,Ne,ze,Xe,je,st,at,Ke,Ye,Ge,ot,dt,Re],encapsulation:2});let n=a;return n})();export{Jt as a,dt as b,Gi as c};