@sync-in/server 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/static/{chunk-MHSCCXVL.js → chunk-2R6HHGUR.js} +1 -1
- package/static/{chunk-P7PX67IR.js → chunk-4U5A2DEP.js} +1 -1
- package/static/{chunk-2V5S7DWD.js → chunk-54EAZ2UD.js} +1 -1
- package/static/{chunk-5GOMMRRE.js → chunk-6OJZWYRZ.js} +1 -1
- package/static/{chunk-P7CTJ5BG.js → chunk-7VRUZRJG.js} +1 -1
- package/static/{chunk-6PVKNZ7Q.js → chunk-7ZRXJONB.js} +1 -1
- package/static/{chunk-4LSJLWYV.js → chunk-CRQNEHTX.js} +1 -1
- package/static/{chunk-SLGGINMR.js → chunk-F2J2IIJE.js} +1 -1
- package/static/{chunk-GSR2MCQG.js → chunk-FNFGUIQH.js} +1 -1
- package/static/{chunk-44YDXGNZ.js → chunk-GGLK52CG.js} +1 -1
- package/static/{chunk-EE2TDTY4.js → chunk-HX6BBYVD.js} +1 -1
- package/static/{chunk-HR7KS5BR.js → chunk-IZL7JPTS.js} +1 -1
- package/static/{chunk-YQSDS6BO.js → chunk-JF7S3UYQ.js} +1 -1
- package/static/{chunk-LUZCOHFN.js → chunk-JYXLQRHG.js} +1 -1
- package/static/{chunk-PPO7DBVO.js → chunk-KSHPKI4G.js} +1 -1
- package/static/{chunk-4UT5VH7R.js → chunk-L6MU6S2V.js} +1 -1
- package/static/{chunk-KP6LSQTK.js → chunk-LLWSLOSX.js} +1 -1
- package/static/{chunk-DFQKHCDR.js → chunk-MCLQFZ3S.js} +1 -1
- package/static/{chunk-J4ALHUDX.js → chunk-MGGT6MIJ.js} +1 -1
- package/static/{chunk-5J4VRDKB.js → chunk-MRSWNAVB.js} +1 -1
- package/static/{chunk-2LVCLKCK.js → chunk-MVO4WZLK.js} +1 -1
- package/static/{chunk-IMB3C547.js → chunk-NE4NDO45.js} +1 -1
- package/static/{chunk-GDKKLLEU.js → chunk-SPTF6FSM.js} +1 -1
- package/static/{chunk-2456KVFZ.js → chunk-VJRTMDEJ.js} +1 -1
- package/static/{chunk-ESNDJ5T6.js → chunk-VPJ2V27B.js} +1 -1
- package/static/{chunk-UHD5XD3G.js → chunk-VUI3KV7V.js} +1 -1
- package/static/{chunk-UPYYAJCJ.js → chunk-WI7FOANP.js} +1 -1
- package/static/{chunk-OMRQYBXV.js → chunk-YJMN3B4N.js} +1 -1
- package/static/{chunk-VHYPQ3D4.js → chunk-ZXS4V7J2.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-FYD34UEC.js → main-FFIWFD2F.js} +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ue,b as z,c as we,d as Ct}from"./chunk-5J4VRDKB.js";import{b as R,c as _t}from"./chunk-44YDXGNZ.js";import{a as S,b as Y,c as tt,e as dt}from"./chunk-4UT5VH7R.js";import{a as bt}from"./chunk-ZC5NIT55.js";import{a as ft,b as ht,c as gt}from"./chunk-IMB3C547.js";import{a as _e,b as st,c as mt,d as pt,f as ct,i as ut}from"./chunk-GSR2MCQG.js";import{a as Ge,b as Se,c as at,d as lt}from"./chunk-2V5S7DWD.js";import"./chunk-YQSDS6BO.js";import{g as rt}from"./chunk-ESNDJ5T6.js";import{L as Ze,Lb as xe,M as K,N as et,Qb as ye,Ta as ve,Xa as de,pa as it,qa as nt,ra as ot,ua as H,v as je,wb as V}from"./chunk-P7PX67IR.js";import{b as Me,d as Pe}from"./chunk-BIUNUYZ5.js";import{$c as Ve,Bf as Ye,Cb as _,E as be,Eb as u,Ed as re,Fd as P,Ga as J,Gc as te,Gd as Ke,Ge as se,Gf as ce,Ib as Q,If as Je,Jb as q,Kb as W,L as O,Ld as ae,Ma as s,Mb as Ce,Nb as U,Ob as k,Pb as m,Qb as C,Qd as He,Rb as $,Re as qe,Sb as Ee,Tb as X,Ub as Z,Ue as We,Uf as Xe,Vb as ee,Xa as E,Xb as Ae,Yb as De,Zc as M,ab as T,ad as Re,ae as le,bb as I,cd as Fe,dc as v,ec as D,ed as L,fc as w,fd as Ue,gd as ke,ha as x,id as j,jb as h,jd as ie,kb as g,ma as y,na as G,nb as B,nd as Oe,ob as N,od as Ie,of as me,pb as c,pd as Be,qb as r,qd as Ne,rb as a,rd as $e,sb as d,wd as ne,wf as pe,xd as Le,xe as Qe,yd as oe,zb as A,zf as ze}from"./chunk-HW2H3ISM.js";import{a as he,b as ge}from"./chunk-RTRJ3KFH.js";var vt=(()=>{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(o){let n={search:o,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(n)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(o=>o.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(o=>o.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(n=>n.name).join("<br>"),o,{enableHtml:!0})}})}};l.\u0275fac=function(n){return new(n||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(n,e){n&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()()),n&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:[M,P,ut],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 Tt(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 Et(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 At(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 xt=(()=>{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 o=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",o,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",o,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(n){return new(n||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(n,e){n&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,Tt,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,Et,6,3,"div",7),a(),h(20,At,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()()),n&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:[M,P,dt],encapsulation:2});let t=l;return t})();var Dt=(t,l)=>l.value;function Mt(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 Pt(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 Vt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Rt(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 Ft(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 Ut(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function kt(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function Ot(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 It(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 Bt(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 Te=(()=>{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(o){this.groupForm.controls.applications.setValue(o),this.groupForm.controls.applications.markAsDirty()}onSetParent(o){this.groupForm.controls.parent.setValue(o?{id:o.id,name:o.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(o){let n={search:o,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(n,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let o=this.makeDto();this.adminService.updateGroup(this.group.id,o).subscribe({next:n=>{this.groupChange.emit(["update",n]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}else{let o=this.makeDto(!0);this.adminService.createGroup(o).subscribe({next:n=>{this.groupChange.emit(["add",n]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}}makeDto(o=!1){let n;o?n=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):n=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 n)switch(e){case"applications":n.permissions=n[e].join(et),delete n.applications;break;case"parent":n.parentId=n[e]?n[e].id:null,delete n.parent;break}return n}onError(o){this.layout.sendNotification("error","Group error",this.groupForm.value.name,o),this.submitted=!1}};l.\u0275fac=function(n){return new(n||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(n,e){if(n&1&&(r(0,"div",0)(1,"h4",1),h(2,Mt,3,2)(3,Pt,3,1),a(),h(4,Vt,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}),T(10,Rt,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,Ft,2,2,"option",21,Dt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,Ut,2,0,"span",23)(31,kt,2,0,"span",23)(32,Ot,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,It,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),T(41,Bt,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()()),n&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(w(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",w(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:[M,P,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,ct,_t,Ct,mt,pt,st,te,re,_e],encapsulation:2});let t=l;return t})();var Gt=(()=>{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 o=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:o}).subscribe({next:()=>{this.user.setGroupRole(o),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,n)}})}};l.\u0275fac=function(n){return new(n||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(n,e){n&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()()),n&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:[M,P,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var Nt=["MainContextMenu"],$t=["TargetContextMenu"],St=(t,l)=>l.key,Lt=(t,l)=>l.mid;function jt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let n=u();return G(n.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 n=u();return G(n.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 Kt(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 Ht(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let n=u().$implicit,e=u();return G(e.sortBy(n.key))}),m(1),h(2,Kt,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,o=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(o.sortTable.sortParam.column===i.key?2:-1)}}function Qt(t,l){if(t&1&&h(0,Ht,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function qt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function Wt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,o=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",o.icons.GROUPS)}}function zt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Yt(t,l){if(t&1&&(r(0,"div",34),h(1,qt,1,1,"img",36)(2,Wt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,zt,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 Jt(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 Xt(t,l){if(t&1&&h(0,Jt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function Zt(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ei(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ti(t,l){if(t&1&&h(0,Zt,2,0,"span",14)(1,ei,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ii(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 ni(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ii,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 oi(t,l){if(t&1&&(r(0,"td"),h(1,Yt,9,4,"div",34)(2,Xt,1,1)(3,ti,2,1)(4,ni,5,4,"div",35),a()),t&2){let i,o=u().$implicit,n=u().$implicit;k(De("",o.value.class," ",o.value.newly?"prop-newly-"+n[o.value.newly]:"")),Ce("width",o.value.width,"%"),U("text-align-center",o.value.textCenter),s(),g((i=o.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ri(t,l){if(t&1&&h(0,oi,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function ai(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let n=y(i).$implicit,e=u();return G(e.onSelect(n))})("contextmenu",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("pressup",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("tap",function(){let n=y(i).$implicit,e=u();return G(e.browse(n))}),B(1,ri,1,1,null,null,St),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,o=u();U("selected",i.mid===(o.selected==null?null:o.selected.mid)),s(),N(w(3,2,o.tableHeaders,o.originalOrderKeyValue))}}function li(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 si(t,l){if(t&1){let i=A();T(0,li,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog(!0))})}}function mi(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 pi(t,l){if(t&1){let i=A();T(0,mi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.addUserToGroupDialog())})}}function ci(t,l){}function ui(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 di(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 _i(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 fi(t,l){if(t&1){let i=A();T(0,_i,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function hi(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 gi(t,l){if(t&1){let i=A();T(0,hi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function bi(t,l){if(t&1){let i=A();T(0,di,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog())}),h(1,fi,1,0,null,23)(2,gi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var oo=(()=>{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 lt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(o=>{this.personalGroupsView=o.type===ue.PERSONAL,this.setEnv(o.routes)}),this.activatedRoute.queryParams.subscribe(o=>this.focusOnSelect=o.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(o){this.personalGroupsView=o,this.router.navigate([S.BASE,o?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(o){o.isGroup&&this.router.navigate([o.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(o=null){this.selected=o}onContextMenu(o){o.preventDefault(),o.stopPropagation(),this.layout.openContextMenu(o,this.mainContextMenu)}onTargetContextMenu(o,n){o.preventDefault(),o.type==="contextmenu"&&o.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(o,this.targetContextMenu)}sortBy(o,n=!0,e){this.members=this.sortTable.sortBy(o,n,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(vt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(n=>n.isUser).map(n=>n.id)}}).content.hasChanges.pipe(be(n=>n),O(1)).subscribe(()=>this.refresh())}openDialog(o=!1,n=!1){o?this.personalGroupsView?this.layout.openDialog(we,"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(Te,"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)}):n?this.layout.openDialog(xt,"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(we,"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(Te,"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(Gt,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(o){let n;o.length?(n=o[o.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(o)}`:`/${S.BASE}/${S.GROUPS}${ve(o)}`,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(n)}loadGroups(o){this.loading=!0,this.onSelect(),this.adminService.browseGroup(o,this.personalGroupsView).subscribe({next:n=>{this.currentGroup=n.parentGroup,this.sortBy(this.sortTable.sortParam.column,!1,n.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:n=>{this.members=[],this.layout.sendNotification("error","Groups",n.error.message),this.onSelect(),this.loading=!1}})}focusOn(o){let n=this.members.find(e=>e.name===o);n&&(setTimeout(()=>this.scrollView.scrollInto(n),100),this.onSelect(n))}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(n,e){if(n&1&&(Q(Se,5),Q(Ge,7),Q(Nt,7),Q($t,7)),n&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","pressup","tap"],[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(n,e){if(n&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(),T(8,jt,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,St),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,ai,4,5,"tr",20,Lt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,si,1,0,null,23),h(42,pi,1,0,null,23),T(43,ci,0,0,"ng-template",24)(44,ui,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,bi,3,1),a()}n&2&&(s(),c("tooltip",w(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",w(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",w(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",w(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(w(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",w(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",w(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,M,P,Ge,Se,je,ft,gt,ht,rt,ne,L,ie,te,re,at,bt,_e],encapsulation:2});let t=l;return t})();export{oo as AdminGroupsComponent};
|
|
1
|
+
import{a as ue,b as z,c as we,d as Ct}from"./chunk-MRSWNAVB.js";import{b as R,c as _t}from"./chunk-GGLK52CG.js";import{a as S,b as Y,c as tt,e as dt}from"./chunk-L6MU6S2V.js";import{a as bt}from"./chunk-ZC5NIT55.js";import{a as ft,b as ht,c as gt}from"./chunk-NE4NDO45.js";import{a as _e,b as st,c as mt,d as pt,f as ct,i as ut}from"./chunk-FNFGUIQH.js";import{a as Ge,b as Se,c as at,d as lt}from"./chunk-54EAZ2UD.js";import"./chunk-JF7S3UYQ.js";import{g as rt}from"./chunk-VPJ2V27B.js";import{L as Ze,Lb as xe,M as K,N as et,Qb as ye,Ta as ve,Xa as de,pa as it,qa as nt,ra as ot,ua as H,v as je,wb as V}from"./chunk-4U5A2DEP.js";import{b as Me,d as Pe}from"./chunk-BIUNUYZ5.js";import{$c as Ve,Bf as Ye,Cb as _,E as be,Eb as u,Ed as re,Fd as P,Ga as J,Gc as te,Gd as Ke,Ge as se,Gf as ce,Ib as Q,If as Je,Jb as q,Kb as W,L as O,Ld as ae,Ma as s,Mb as Ce,Nb as U,Ob as k,Pb as m,Qb as C,Qd as He,Rb as $,Re as qe,Sb as Ee,Tb as X,Ub as Z,Ue as We,Uf as Xe,Vb as ee,Xa as E,Xb as Ae,Yb as De,Zc as M,ab as T,ad as Re,ae as le,bb as I,cd as Fe,dc as v,ec as D,ed as L,fc as w,fd as Ue,gd as ke,ha as x,id as j,jb as h,jd as ie,kb as g,ma as y,na as G,nb as B,nd as Oe,ob as N,od as Ie,of as me,pb as c,pd as Be,qb as r,qd as Ne,rb as a,rd as $e,sb as d,wd as ne,wf as pe,xd as Le,xe as Qe,yd as oe,zb as A,zf as ze}from"./chunk-HW2H3ISM.js";import{a as he,b as ge}from"./chunk-RTRJ3KFH.js";var vt=(()=>{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(o){let n={search:o,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(n)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(o=>o.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(o=>o.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(n=>n.name).join("<br>"),o,{enableHtml:!0})}})}};l.\u0275fac=function(n){return new(n||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(n,e){n&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()()),n&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:[M,P,ut],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 Tt(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 Et(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 At(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 xt=(()=>{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 o=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",o,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",o,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(n){return new(n||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(n,e){n&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,Tt,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,Et,6,3,"div",7),a(),h(20,At,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()()),n&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:[M,P,dt],encapsulation:2});let t=l;return t})();var Dt=(t,l)=>l.value;function Mt(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 Pt(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 Vt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Rt(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 Ft(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 Ut(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function kt(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function Ot(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 It(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 Bt(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 Te=(()=>{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(o){this.groupForm.controls.applications.setValue(o),this.groupForm.controls.applications.markAsDirty()}onSetParent(o){this.groupForm.controls.parent.setValue(o?{id:o.id,name:o.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(o){let n={search:o,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(n,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let o=this.makeDto();this.adminService.updateGroup(this.group.id,o).subscribe({next:n=>{this.groupChange.emit(["update",n]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}else{let o=this.makeDto(!0);this.adminService.createGroup(o).subscribe({next:n=>{this.groupChange.emit(["add",n]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}}makeDto(o=!1){let n;o?n=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):n=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 n)switch(e){case"applications":n.permissions=n[e].join(et),delete n.applications;break;case"parent":n.parentId=n[e]?n[e].id:null,delete n.parent;break}return n}onError(o){this.layout.sendNotification("error","Group error",this.groupForm.value.name,o),this.submitted=!1}};l.\u0275fac=function(n){return new(n||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(n,e){if(n&1&&(r(0,"div",0)(1,"h4",1),h(2,Mt,3,2)(3,Pt,3,1),a(),h(4,Vt,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}),T(10,Rt,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,Ft,2,2,"option",21,Dt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,Ut,2,0,"span",23)(31,kt,2,0,"span",23)(32,Ot,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,It,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),T(41,Bt,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()()),n&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(w(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",w(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:[M,P,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,ct,_t,Ct,mt,pt,st,te,re,_e],encapsulation:2});let t=l;return t})();var Gt=(()=>{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 o=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:o}).subscribe({next:()=>{this.user.setGroupRole(o),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,n)}})}};l.\u0275fac=function(n){return new(n||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(n,e){n&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()()),n&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:[M,P,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var Nt=["MainContextMenu"],$t=["TargetContextMenu"],St=(t,l)=>l.key,Lt=(t,l)=>l.mid;function jt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let n=u();return G(n.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 n=u();return G(n.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 Kt(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 Ht(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let n=u().$implicit,e=u();return G(e.sortBy(n.key))}),m(1),h(2,Kt,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,o=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(o.sortTable.sortParam.column===i.key?2:-1)}}function Qt(t,l){if(t&1&&h(0,Ht,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function qt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function Wt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,o=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",o.icons.GROUPS)}}function zt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Yt(t,l){if(t&1&&(r(0,"div",34),h(1,qt,1,1,"img",36)(2,Wt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,zt,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 Jt(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 Xt(t,l){if(t&1&&h(0,Jt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function Zt(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ei(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ti(t,l){if(t&1&&h(0,Zt,2,0,"span",14)(1,ei,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ii(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 ni(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ii,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 oi(t,l){if(t&1&&(r(0,"td"),h(1,Yt,9,4,"div",34)(2,Xt,1,1)(3,ti,2,1)(4,ni,5,4,"div",35),a()),t&2){let i,o=u().$implicit,n=u().$implicit;k(De("",o.value.class," ",o.value.newly?"prop-newly-"+n[o.value.newly]:"")),Ce("width",o.value.width,"%"),U("text-align-center",o.value.textCenter),s(),g((i=o.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ri(t,l){if(t&1&&h(0,oi,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function ai(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let n=y(i).$implicit,e=u();return G(e.onSelect(n))})("contextmenu",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("pressup",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("tap",function(){let n=y(i).$implicit,e=u();return G(e.browse(n))}),B(1,ri,1,1,null,null,St),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,o=u();U("selected",i.mid===(o.selected==null?null:o.selected.mid)),s(),N(w(3,2,o.tableHeaders,o.originalOrderKeyValue))}}function li(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 si(t,l){if(t&1){let i=A();T(0,li,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog(!0))})}}function mi(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 pi(t,l){if(t&1){let i=A();T(0,mi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.addUserToGroupDialog())})}}function ci(t,l){}function ui(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 di(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 _i(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 fi(t,l){if(t&1){let i=A();T(0,_i,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function hi(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 gi(t,l){if(t&1){let i=A();T(0,hi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function bi(t,l){if(t&1){let i=A();T(0,di,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog())}),h(1,fi,1,0,null,23)(2,gi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var oo=(()=>{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 lt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(o=>{this.personalGroupsView=o.type===ue.PERSONAL,this.setEnv(o.routes)}),this.activatedRoute.queryParams.subscribe(o=>this.focusOnSelect=o.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(o){this.personalGroupsView=o,this.router.navigate([S.BASE,o?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(o){o.isGroup&&this.router.navigate([o.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(o=null){this.selected=o}onContextMenu(o){o.preventDefault(),o.stopPropagation(),this.layout.openContextMenu(o,this.mainContextMenu)}onTargetContextMenu(o,n){o.preventDefault(),o.type==="contextmenu"&&o.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(o,this.targetContextMenu)}sortBy(o,n=!0,e){this.members=this.sortTable.sortBy(o,n,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(vt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(n=>n.isUser).map(n=>n.id)}}).content.hasChanges.pipe(be(n=>n),O(1)).subscribe(()=>this.refresh())}openDialog(o=!1,n=!1){o?this.personalGroupsView?this.layout.openDialog(we,"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(Te,"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)}):n?this.layout.openDialog(xt,"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(we,"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(Te,"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(Gt,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(o){let n;o.length?(n=o[o.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(o)}`:`/${S.BASE}/${S.GROUPS}${ve(o)}`,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(n)}loadGroups(o){this.loading=!0,this.onSelect(),this.adminService.browseGroup(o,this.personalGroupsView).subscribe({next:n=>{this.currentGroup=n.parentGroup,this.sortBy(this.sortTable.sortParam.column,!1,n.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:n=>{this.members=[],this.layout.sendNotification("error","Groups",n.error.message),this.onSelect(),this.loading=!1}})}focusOn(o){let n=this.members.find(e=>e.name===o);n&&(setTimeout(()=>this.scrollView.scrollInto(n),100),this.onSelect(n))}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(n,e){if(n&1&&(Q(Se,5),Q(Ge,7),Q(Nt,7),Q($t,7)),n&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","pressup","tap"],[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(n,e){if(n&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(),T(8,jt,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,St),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,ai,4,5,"tr",20,Lt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,si,1,0,null,23),h(42,pi,1,0,null,23),T(43,ci,0,0,"ng-template",24)(44,ui,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,bi,3,1),a()}n&2&&(s(),c("tooltip",w(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",w(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",w(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",w(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(w(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",w(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",w(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,M,P,Ge,Se,je,ft,gt,ht,rt,ne,L,ie,te,re,at,bt,_e],encapsulation:2});let t=l;return t})();export{oo as AdminGroupsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-HR7KS5BR.js";import{a as xe}from"./chunk-DFQKHCDR.js";import{a as fe}from"./chunk-GSR2MCQG.js";import{a as B,b as N,c as de,d as Ce}from"./chunk-2V5S7DWD.js";import"./chunk-6PVKNZ7Q.js";import{f as me}from"./chunk-ESNDJ5T6.js";import{O as re,Xa as pe,pa as se,qa as ae,ra as le,sa as R,ta as ce,ua as ue,v as X,wb as _e}from"./chunk-P7PX67IR.js";import{Cb as x,Eb as s,Ed as z,Fd as J,Ga as H,Gc as j,Gd as Y,Gf as ie,Ib as S,If as ne,Jb as F,Kb as U,L as D,Ma as a,Mb as I,Nb as $,Ob as k,Pb as m,Qb as V,Rb as w,Sb as O,Ue as ee,Uf as oe,Xa as L,Yb as K,Zc as q,ab as M,ae as Z,dc as g,ec as P,fc as y,ha as E,jb as v,kb as h,ma as p,na as _,nb as b,ob as T,of as te,pb as d,qb as l,rb as u,sb as C,yd as W,zb as G}from"./chunk-HW2H3ISM.js";import"./chunk-RTRJ3KFH.js";var he=["MainContextMenu"],ye=["TargetContextMenu"],ge=(e,o)=>o.key,we=(e,o)=>o.id,be=(e,o)=>o.mid;function Te(e,o){if(e&1&&C(0,"fa-icon",18),e&2){let t=s(3);d("icon",t.sortTable.sortParam.asc?t.icons.faArrowDown:t.icons.faArrowUp)("fixedWidth",!1)}}function Ge(e,o){if(e&1){let t=G();l(0,"th",17),x("click",function(){p(t);let r=s().$implicit,n=s();return _(n.sortBy(r.key))}),m(1),v(2,Te,1,2,"fa-icon",18),u()}if(e&2){let t=s().$implicit,i=s();k(t.value.class),I("width",t.value.width,"%"),$("text-align-center",t.value.textCenter)("cursor-pointer",t.value.sortable),a(),w(" ",t.value.label," "),a(),h(i.sortTable.sortParam.column===t.key?2:-1)}}function Se(e,o){if(e&1&&v(0,Ge,3,10,"th",16),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function Fe(e,o){if(e&1&&(l(0,"div",21),C(1,"img",24),l(2,"div",22)(3,"span",25),m(4),u(),l(5,"span",26),m(6),u()()()),e&2){let t=s(3).$implicit;a(),d("src",t.avatarUrl,H),a(3),w(" ",t.login," "),a(2),V(t.email)}}function Ue(e,o){if(e&1&&(l(0,"div",22)(1,"span",25),m(2),u()()),e&2){let t=s(3).$implicit;a(2),V(t.fullName)}}function Ve(e,o){if(e&1&&C(0,"app-user-avatar",27),e&2){let t=o.$implicit;d("user",t)("isMember",!0)}}function Ae(e,o){if(e&1&&b(0,Ve,1,2,"app-user-avatar",27,be),e&2){let t=s(3).$implicit;T(t.managers)}}function Ee(e,o){e&1&&m(0," too many login attempts ")}function Me(e,o){if(e&1&&m(0),e&2){let t=s(4).$implicit;w(" ",t.userIsActiveText," ")}}function $e(e,o){if(e&1&&(l(0,"span",28),v(1,Ee,1,0)(2,Me,1,1),u()),e&2){let t=s(3).$implicit;k(t.isActive?"text-success":"text-danger"),a(),h(!t.isActive&&t.passwordAttempts?1:2)}}function ke(e,o){if(e&1&&(m(0),g(1,"amDateFormat")),e&2){let t=s(3).$implicit;w(" ",P(1,1,t.createdAt)," ")}}function Pe(e,o){if(e&1&&(l(0,"div",22)(1,"div"),m(2),g(3,"amDateFormat"),u(),l(4,"div"),m(5),g(6,"amDateFormat"),u()()),e&2){let t=s(5).$implicit;a(2),V(P(3,2,t.currentAccess)),a(3),V(P(6,4,t.lastAccess))}}function De(e,o){if(e&1&&m(0),e&2){let t=s(5).$implicit;w(" ",t.hTimeAgo," ")}}function Ie(e,o){if(e&1){let t=G();l(0,"div",30),x("mouseover",function(){p(t);let r=s(4).$implicit;return _(r.currentAccessHover=!0)})("focus",function(){p(t);let r=s(4).$implicit;return _(r.currentAccessHover=!0)})("mouseleave",function(){p(t);let r=s(4).$implicit;return _(r.currentAccessHover=!1)}),v(1,Pe,7,6,"div",22)(2,De,1,1),u()}if(e&2){let t=s(4).$implicit;a(),h(t.currentAccessHover?1:2)}}function Re(e,o){e&1&&(l(0,"span",28),m(1,"never"),u())}function Be(e,o){if(e&1&&v(0,Ie,3,1,"div",29)(1,Re,2,0,"span",28),e&2){let t=s(3).$implicit;h(t.currentAccess?0:1)}}function Ne(e,o){if(e&1&&(l(0,"td"),v(1,Fe,7,3,"div",21)(2,Ue,3,1,"div",22)(3,Ae,2,0)(4,$e,3,3,"span",23)(5,ke,2,3)(6,Be,2,1),u()),e&2){let t,i=s().$implicit,r=s().$implicit;k(K("",i.value.class," ",i.value.newly?"prop-newly-"+r[i.value.newly]:"")),I("width",i.value.width,"%"),$("text-align-center",i.value.textCenter),a(),h((t=i.key)==="login"?1:t==="fullName"?2:t==="managers"?3:t==="isActive"?4:t==="createdAt"?5:t==="currentAccess"?6:-1)}}function Qe(e,o){if(e&1&&v(0,Ne,7,9,"td",20),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function He(e,o){if(e&1){let t=G();l(0,"tr",19),x("click",function(){let r=p(t).$implicit,n=s();return _(n.onSelect(r))})("contextmenu",function(r){let n=p(t).$implicit,c=s();return _(c.onTargetContextMenu(r,n))})("pressup",function(r){let n=p(t).$implicit,c=s();return _(c.onTargetContextMenu(r,n))})("tap",function(){p(t);let r=s();return _(r.openGuestDialog())}),b(1,Qe,1,1,null,null,ge),g(3,"keyvalue"),u()}if(e&2){let t=o.$implicit,i=s();$("disabled",!t.isActive)("selected",t.id===(i.selected==null?null:i.selected.id)),a(),T(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function Le(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"New guest"),u()),e&2){let t=s();a(),d("icon",t.icons.faPlus)}}function Oe(e,o){}function Ke(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"Refresh"),u()),e&2){let t=s();a(),d("icon",t.icons.faArrowRotateRight)}}function je(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"Edit guest"),u()),e&2){let t=s();a(),d("icon",t.icons.faPen)}}var xt=(()=>{let o=class o{constructor(){this.locale=E(W),this.originalOrderKeyValue=pe,this.icons={faRotate:Y,faPlus:ie,faPen:te,faArrowDown:oe,faArrowUp:ee,faKey:Z,faArrowRotateRight:ne},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.loading=!1,this.selected=null,this.guests=[],this.layout=E(_e),this.userService=E(me),this.canCreateGuest=this.userService.userHavePermission(re.GUESTS_ADMIN),this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],createdAt:[{prop:"createdAt",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new Ce(this.constructor.name,this.sortSettings),this.loadGuests(),this.layout.setBreadcrumbIcon(ue.GUESTS),this.layout.setBreadcrumbNav({url:`/${R.BASE}/${R.GUESTS}/${ce.GUESTS}`,splicing:2,translating:!0,sameLink:!0})}loadGuests(){this.loading=!0,this.onSelect(),this.userService.listGuests().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.scrollView.scrollInto(-1),this.loading=!1},error:i=>{this.guests=[],this.layout.sendNotification("error","Guests",i.error.message),this.loading=!1}})}onSelect(i=null){this.selected=i}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,r){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(r),this.layout.openContextMenu(i,this.targetContextMenu)}sortBy(i,r=!0,n){this.guests=this.sortTable.sortBy(i,r,n||this.guests)}openGuestDialog(i=!1){i?this.layout.openDialog(Q,"md").content.guestChange.pipe(D(1)).subscribe(n=>{let[c,f]=n;c==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.guests,f]),this.onSelect(f))}):this.userService.getGuest(this.selected.id).subscribe({next:r=>{this.layout.openDialog(Q,"md",{initialState:{guest:r}}).content.guestChange.pipe(D(1)).subscribe(c=>{let[f,A]=c;f==="update"?this.selected=Object.assign(this.selected,A):f==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.guests.filter(ve=>ve.id!==A.id)))})},error:r=>this.layout.sendNotification("error","Guest error",this.selected.fullName,r)})}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=L({type:o,selectors:[["app-user-guests"]],viewQuery:function(r,n){if(r&1&&(S(N,5),S(B,7),S(he,7),S(ye,7)),r&2){let c;F(c=U())&&(n.scrollView=c.first),F(c=U())&&(n.inputFilter=c.first),F(c=U())&&(n.mainContextMenu=c.first),F(c=U())&&(n.targetContextMenu=c.first)}},decls:35,vars:32,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],["l10nTranslate",""],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(r,n){if(r&1){let c=G();l(0,"div",2)(1,"button",3),g(2,"translate"),x("click",function(){return p(c),_(n.loadGuests())}),C(3,"fa-icon",4),u(),l(4,"button",5),g(5,"translate"),x("click",function(){return p(c),_(n.openGuestDialog(!0))}),C(6,"fa-icon",6),u(),l(7,"button",5),g(8,"translate"),x("click",function(){return p(c),_(n.openGuestDialog())}),C(9,"fa-icon",6),u(),C(10,"app-input-filter",7),u(),l(11,"table",8)(12,"thead")(13,"tr"),b(14,Se,1,1,null,null,ge),g(16,"keyvalue"),u()()(),l(17,"app-virtual-scroll",9),g(18,"searchFilter"),x("contextmenu",function(A){return p(c),_(n.onContextMenu(A))}),l(19,"table",8)(20,"tbody",10),b(21,He,4,7,"tr",11,we),u()()(),l(23,"div",12)(24,"span",13),m(25),g(26,"translate"),u()(),l(27,"context-menu",null,0),M(29,Le,3,1,"ng-template",14),x("execute",function(){return p(c),_(n.openGuestDialog(!0))}),M(30,Oe,0,0,"ng-template",15)(31,Ke,3,1,"ng-template",14),x("execute",function(){return p(c),_(n.loadGuests())}),u(),l(32,"context-menu",null,1),M(34,je,3,1,"ng-template",14),x("execute",function(){return p(c),_(n.openGuestDialog())}),u()}r&2&&(a(),d("tooltip",y(2,14,"Refresh",n.locale.language)),a(2),d("icon",n.icons.faRotate)("animation",n.loading?"spin":null),a(),d("disabled",!n.canCreateGuest)("tooltip",y(5,17,"New guest",n.locale.language)),a(2),d("icon",n.icons.faPlus),a(),d("disabled",!n.selected)("tooltip",y(8,20,"Edit guest",n.locale.language)),a(2),d("icon",n.icons.faPen),a(5),T(y(16,23,n.tableHeaders,n.originalOrderKeyValue)),a(3),d("bufferAmount",5)("items",y(18,26,n.guests,n.inputFilter.search())),a(4),T(n.scrollView==null?null:n.scrollView.viewPortItems),a(4),O("",n.guests.length," ",y(26,29,"guests",n.locale.language)),a(5),d("divider",!0))},dependencies:[q,B,X,J,N,le,ae,se,xe,z,j,de,fe],encapsulation:2});let e=o;return e})();export{xt as UserGuestsComponent};
|
|
1
|
+
import{a as Q}from"./chunk-IZL7JPTS.js";import{a as xe}from"./chunk-MCLQFZ3S.js";import{a as fe}from"./chunk-FNFGUIQH.js";import{a as B,b as N,c as de,d as Ce}from"./chunk-54EAZ2UD.js";import"./chunk-7ZRXJONB.js";import{f as me}from"./chunk-VPJ2V27B.js";import{O as re,Xa as pe,pa as se,qa as ae,ra as le,sa as R,ta as ce,ua as ue,v as X,wb as _e}from"./chunk-4U5A2DEP.js";import{Cb as x,Eb as s,Ed as z,Fd as J,Ga as H,Gc as j,Gd as Y,Gf as ie,Ib as S,If as ne,Jb as F,Kb as U,L as D,Ma as a,Mb as I,Nb as $,Ob as k,Pb as m,Qb as V,Rb as w,Sb as O,Ue as ee,Uf as oe,Xa as L,Yb as K,Zc as q,ab as M,ae as Z,dc as g,ec as P,fc as y,ha as E,jb as v,kb as h,ma as p,na as _,nb as b,ob as T,of as te,pb as d,qb as l,rb as u,sb as C,yd as W,zb as G}from"./chunk-HW2H3ISM.js";import"./chunk-RTRJ3KFH.js";var he=["MainContextMenu"],ye=["TargetContextMenu"],ge=(e,o)=>o.key,we=(e,o)=>o.id,be=(e,o)=>o.mid;function Te(e,o){if(e&1&&C(0,"fa-icon",18),e&2){let t=s(3);d("icon",t.sortTable.sortParam.asc?t.icons.faArrowDown:t.icons.faArrowUp)("fixedWidth",!1)}}function Ge(e,o){if(e&1){let t=G();l(0,"th",17),x("click",function(){p(t);let r=s().$implicit,n=s();return _(n.sortBy(r.key))}),m(1),v(2,Te,1,2,"fa-icon",18),u()}if(e&2){let t=s().$implicit,i=s();k(t.value.class),I("width",t.value.width,"%"),$("text-align-center",t.value.textCenter)("cursor-pointer",t.value.sortable),a(),w(" ",t.value.label," "),a(),h(i.sortTable.sortParam.column===t.key?2:-1)}}function Se(e,o){if(e&1&&v(0,Ge,3,10,"th",16),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function Fe(e,o){if(e&1&&(l(0,"div",21),C(1,"img",24),l(2,"div",22)(3,"span",25),m(4),u(),l(5,"span",26),m(6),u()()()),e&2){let t=s(3).$implicit;a(),d("src",t.avatarUrl,H),a(3),w(" ",t.login," "),a(2),V(t.email)}}function Ue(e,o){if(e&1&&(l(0,"div",22)(1,"span",25),m(2),u()()),e&2){let t=s(3).$implicit;a(2),V(t.fullName)}}function Ve(e,o){if(e&1&&C(0,"app-user-avatar",27),e&2){let t=o.$implicit;d("user",t)("isMember",!0)}}function Ae(e,o){if(e&1&&b(0,Ve,1,2,"app-user-avatar",27,be),e&2){let t=s(3).$implicit;T(t.managers)}}function Ee(e,o){e&1&&m(0," too many login attempts ")}function Me(e,o){if(e&1&&m(0),e&2){let t=s(4).$implicit;w(" ",t.userIsActiveText," ")}}function $e(e,o){if(e&1&&(l(0,"span",28),v(1,Ee,1,0)(2,Me,1,1),u()),e&2){let t=s(3).$implicit;k(t.isActive?"text-success":"text-danger"),a(),h(!t.isActive&&t.passwordAttempts?1:2)}}function ke(e,o){if(e&1&&(m(0),g(1,"amDateFormat")),e&2){let t=s(3).$implicit;w(" ",P(1,1,t.createdAt)," ")}}function Pe(e,o){if(e&1&&(l(0,"div",22)(1,"div"),m(2),g(3,"amDateFormat"),u(),l(4,"div"),m(5),g(6,"amDateFormat"),u()()),e&2){let t=s(5).$implicit;a(2),V(P(3,2,t.currentAccess)),a(3),V(P(6,4,t.lastAccess))}}function De(e,o){if(e&1&&m(0),e&2){let t=s(5).$implicit;w(" ",t.hTimeAgo," ")}}function Ie(e,o){if(e&1){let t=G();l(0,"div",30),x("mouseover",function(){p(t);let r=s(4).$implicit;return _(r.currentAccessHover=!0)})("focus",function(){p(t);let r=s(4).$implicit;return _(r.currentAccessHover=!0)})("mouseleave",function(){p(t);let r=s(4).$implicit;return _(r.currentAccessHover=!1)}),v(1,Pe,7,6,"div",22)(2,De,1,1),u()}if(e&2){let t=s(4).$implicit;a(),h(t.currentAccessHover?1:2)}}function Re(e,o){e&1&&(l(0,"span",28),m(1,"never"),u())}function Be(e,o){if(e&1&&v(0,Ie,3,1,"div",29)(1,Re,2,0,"span",28),e&2){let t=s(3).$implicit;h(t.currentAccess?0:1)}}function Ne(e,o){if(e&1&&(l(0,"td"),v(1,Fe,7,3,"div",21)(2,Ue,3,1,"div",22)(3,Ae,2,0)(4,$e,3,3,"span",23)(5,ke,2,3)(6,Be,2,1),u()),e&2){let t,i=s().$implicit,r=s().$implicit;k(K("",i.value.class," ",i.value.newly?"prop-newly-"+r[i.value.newly]:"")),I("width",i.value.width,"%"),$("text-align-center",i.value.textCenter),a(),h((t=i.key)==="login"?1:t==="fullName"?2:t==="managers"?3:t==="isActive"?4:t==="createdAt"?5:t==="currentAccess"?6:-1)}}function Qe(e,o){if(e&1&&v(0,Ne,7,9,"td",20),e&2){let t=o.$implicit;h(t.value.show?0:-1)}}function He(e,o){if(e&1){let t=G();l(0,"tr",19),x("click",function(){let r=p(t).$implicit,n=s();return _(n.onSelect(r))})("contextmenu",function(r){let n=p(t).$implicit,c=s();return _(c.onTargetContextMenu(r,n))})("pressup",function(r){let n=p(t).$implicit,c=s();return _(c.onTargetContextMenu(r,n))})("tap",function(){p(t);let r=s();return _(r.openGuestDialog())}),b(1,Qe,1,1,null,null,ge),g(3,"keyvalue"),u()}if(e&2){let t=o.$implicit,i=s();$("disabled",!t.isActive)("selected",t.id===(i.selected==null?null:i.selected.id)),a(),T(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function Le(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"New guest"),u()),e&2){let t=s();a(),d("icon",t.icons.faPlus)}}function Oe(e,o){}function Ke(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"Refresh"),u()),e&2){let t=s();a(),d("icon",t.icons.faArrowRotateRight)}}function je(e,o){if(e&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"Edit guest"),u()),e&2){let t=s();a(),d("icon",t.icons.faPen)}}var xt=(()=>{let o=class o{constructor(){this.locale=E(W),this.originalOrderKeyValue=pe,this.icons={faRotate:Y,faPlus:ie,faPen:te,faArrowDown:oe,faArrowUp:ee,faKey:Z,faArrowRotateRight:ne},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.loading=!1,this.selected=null,this.guests=[],this.layout=E(_e),this.userService=E(me),this.canCreateGuest=this.userService.userHavePermission(re.GUESTS_ADMIN),this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],createdAt:[{prop:"createdAt",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new Ce(this.constructor.name,this.sortSettings),this.loadGuests(),this.layout.setBreadcrumbIcon(ue.GUESTS),this.layout.setBreadcrumbNav({url:`/${R.BASE}/${R.GUESTS}/${ce.GUESTS}`,splicing:2,translating:!0,sameLink:!0})}loadGuests(){this.loading=!0,this.onSelect(),this.userService.listGuests().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.scrollView.scrollInto(-1),this.loading=!1},error:i=>{this.guests=[],this.layout.sendNotification("error","Guests",i.error.message),this.loading=!1}})}onSelect(i=null){this.selected=i}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,r){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(r),this.layout.openContextMenu(i,this.targetContextMenu)}sortBy(i,r=!0,n){this.guests=this.sortTable.sortBy(i,r,n||this.guests)}openGuestDialog(i=!1){i?this.layout.openDialog(Q,"md").content.guestChange.pipe(D(1)).subscribe(n=>{let[c,f]=n;c==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.guests,f]),this.onSelect(f))}):this.userService.getGuest(this.selected.id).subscribe({next:r=>{this.layout.openDialog(Q,"md",{initialState:{guest:r}}).content.guestChange.pipe(D(1)).subscribe(c=>{let[f,A]=c;f==="update"?this.selected=Object.assign(this.selected,A):f==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.guests.filter(ve=>ve.id!==A.id)))})},error:r=>this.layout.sendNotification("error","Guest error",this.selected.fullName,r)})}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=L({type:o,selectors:[["app-user-guests"]],viewQuery:function(r,n){if(r&1&&(S(N,5),S(B,7),S(he,7),S(ye,7)),r&2){let c;F(c=U())&&(n.scrollView=c.first),F(c=U())&&(n.inputFilter=c.first),F(c=U())&&(n.mainContextMenu=c.first),F(c=U())&&(n.targetContextMenu=c.first)}},decls:35,vars:32,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],["l10nTranslate",""],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(r,n){if(r&1){let c=G();l(0,"div",2)(1,"button",3),g(2,"translate"),x("click",function(){return p(c),_(n.loadGuests())}),C(3,"fa-icon",4),u(),l(4,"button",5),g(5,"translate"),x("click",function(){return p(c),_(n.openGuestDialog(!0))}),C(6,"fa-icon",6),u(),l(7,"button",5),g(8,"translate"),x("click",function(){return p(c),_(n.openGuestDialog())}),C(9,"fa-icon",6),u(),C(10,"app-input-filter",7),u(),l(11,"table",8)(12,"thead")(13,"tr"),b(14,Se,1,1,null,null,ge),g(16,"keyvalue"),u()()(),l(17,"app-virtual-scroll",9),g(18,"searchFilter"),x("contextmenu",function(A){return p(c),_(n.onContextMenu(A))}),l(19,"table",8)(20,"tbody",10),b(21,He,4,7,"tr",11,we),u()()(),l(23,"div",12)(24,"span",13),m(25),g(26,"translate"),u()(),l(27,"context-menu",null,0),M(29,Le,3,1,"ng-template",14),x("execute",function(){return p(c),_(n.openGuestDialog(!0))}),M(30,Oe,0,0,"ng-template",15)(31,Ke,3,1,"ng-template",14),x("execute",function(){return p(c),_(n.loadGuests())}),u(),l(32,"context-menu",null,1),M(34,je,3,1,"ng-template",14),x("execute",function(){return p(c),_(n.openGuestDialog())}),u()}r&2&&(a(),d("tooltip",y(2,14,"Refresh",n.locale.language)),a(2),d("icon",n.icons.faRotate)("animation",n.loading?"spin":null),a(),d("disabled",!n.canCreateGuest)("tooltip",y(5,17,"New guest",n.locale.language)),a(2),d("icon",n.icons.faPlus),a(),d("disabled",!n.selected)("tooltip",y(8,20,"Edit guest",n.locale.language)),a(2),d("icon",n.icons.faPen),a(5),T(y(16,23,n.tableHeaders,n.originalOrderKeyValue)),a(3),d("bufferAmount",5)("items",y(18,26,n.guests,n.inputFilter.search())),a(4),T(n.scrollView==null?null:n.scrollView.viewPortItems),a(4),O("",n.guests.length," ",y(26,29,"guests",n.locale.language)),a(5),d("divider",!0))},dependencies:[q,B,X,J,N,le,ae,se,xe,z,j,de,fe],encapsulation:2});let e=o;return e})();export{xt as UserGuestsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as Ct,B as he,Ea as _e,Gb as ke,Hb as Y,Ja as be,Q as le,Qa as Ee,Qb as T,S as fe,T as Rt,W as $,Y as pe,Z as de,_ as me,aa as O,ba as ge,ca as ye,da as P,fb as Se,ib as D,jb as ve,kb as ft,wb as pt}from"./chunk-P7PX67IR.js";import{Cb as ct,G as zt,Hb as oe,Jb as ae,Kb as ce,L as Zt,Nb as Tt,Oc as ut,Qa as re,Ra as L,W as te,Ya as nt,Za as ot,Zb as ht,_c as lt,ba as H,c as Xt,ca as st,da as rt,fa as ee,ha as b,hb as ne,ib as at,nf as ue,qc as Ot,v as d,va as ie,ya as se}from"./chunk-HW2H3ISM.js";import{a as it,b as jt,c as Qt,e as Jt}from"./chunk-RTRJ3KFH.js";var we={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var W={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var Wt={};Jt(Wt,{Fetch:()=>X,Manager:()=>N,NodeWebSocket:()=>w,NodeXHR:()=>k,Socket:()=>C,WebSocket:()=>w,WebTransport:()=>R,XHR:()=>k,connect:()=>B,default:()=>B,io:()=>B,protocol:()=>$t});var _=Object.create(null);_.open="0";_.close="1";_.ping="2";_.pong="3";_.message="4";_.upgrade="5";_.noop="6";var G=Object.create(null);Object.keys(_).forEach(s=>{G[_[s]]=s});var K={type:"error",data:"parser error"};var Oe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Re=typeof ArrayBuffer=="function",Ce=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,j=({type:s,data:t},i,e)=>Oe&&t instanceof Blob?i?e(t):Ae(t,e):Re&&(t instanceof ArrayBuffer||Ce(t))?i?e(t):Ae(new Blob([t]),e):e(_[s]+(t||"")),Ae=(s,t)=>{let i=new FileReader;return i.onload=function(){let e=i.result.split(",")[1];t("b"+(e||""))},i.readAsDataURL(s)};function Te(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var xt;function xe(s,t){if(Oe&&s.data instanceof Blob)return s.data.arrayBuffer().then(Te).then(t);if(Re&&(s.data instanceof ArrayBuffer||Ce(s.data)))return t(Te(s.data));j(s,!1,i=>{xt||(xt=new TextEncoder),t(xt.encode(i))})}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ne.length;s++)Q[Ne.charCodeAt(s)]=s;var Be=s=>{let t=s.length*.75,i=s.length,e,r=0,n,o,a,c;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let p=new ArrayBuffer(t),g=new Uint8Array(p);for(e=0;e<i;e+=4)n=Q[s.charCodeAt(e)],o=Q[s.charCodeAt(e+1)],a=Q[s.charCodeAt(e+2)],c=Q[s.charCodeAt(e+3)],g[r++]=n<<2|o>>4,g[r++]=(o&15)<<4|a>>2,g[r++]=(a&3)<<6|c&63;return p};var ni=typeof ArrayBuffer=="function",J=(s,t)=>{if(typeof s!="string")return{type:"message",data:Ie(s,t)};let i=s.charAt(0);return i==="b"?{type:"message",data:oi(s.substring(1),t)}:G[i]?s.length>1?{type:G[i],data:s.substring(1)}:{type:G[i]}:K},oi=(s,t)=>{if(ni){let i=Be(s);return Ie(i,t)}else return{base64:!0,data:s}},Ie=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Le="",Pe=(s,t)=>{let i=s.length,e=new Array(i),r=0;s.forEach((n,o)=>{j(n,!1,a=>{e[o]=a,++r===i&&t(e.join(Le))})})},De=(s,t)=>{let i=s.split(Le),e=[];for(let r=0;r<i.length;r++){let n=J(i[r],t);if(e.push(n),n.type==="error")break}return e};function Ue(){return new TransformStream({transform(s,t){xe(s,i=>{let e=i.length,r;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}s.data&&typeof s.data!="string"&&(r[0]|=128),t.enqueue(r),t.enqueue(i)})}})}var Nt;function dt(s){return s.reduce((t,i)=>t+i.length,0)}function mt(s,t){if(s[0].length===t)return s.shift();let i=new Uint8Array(t),e=0;for(let r=0;r<t;r++)i[r]=s[0][e++],e===s[0].length&&(s.shift(),e=0);return s.length&&e<s[0].length&&(s[0]=s[0].slice(e)),i}function Fe(s,t){Nt||(Nt=new TextDecoder);let i=[],e=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(i.push(o);;){if(e===0){if(dt(i)<1)break;let c=mt(i,1);n=(c[0]&128)===128,r=c[0]&127,r<126?e=3:r===126?e=1:e=2}else if(e===1){if(dt(i)<2)break;let c=mt(i,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),e=3}else if(e===2){if(dt(i)<8)break;let c=mt(i,8),p=new DataView(c.buffer,c.byteOffset,c.length),g=p.getUint32(0);if(g>Math.pow(2,21)-1){a.enqueue(K);break}r=g*Math.pow(2,32)+p.getUint32(4),e=3}else{if(dt(i)<r)break;let c=mt(i,r);a.enqueue(J(n?c:Nt.decode(c),t)),e=0}if(r===0||r>s){a.enqueue(K);break}}}})}var Bt=4;function u(s){if(s)return ai(s)}function ai(s){for(var t in u.prototype)s[t]=u.prototype[t];return s}u.prototype.on=u.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};u.prototype.once=function(s,t){function i(){this.off(s,i),t.apply(this,arguments)}return i.fn=t,this.on(s,i),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var e,r=0;r<i.length;r++)if(e=i[r],e===t||e.fn===t){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+s],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(i){i=i.slice(0);for(var e=0,r=i.length;e<r;++e)i[e].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var E=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Me="arraybuffer";function gt(s,...t){return t.reduce((i,e)=>(s.hasOwnProperty(e)&&(i[e]=s[e]),i),{})}var ci=l.setTimeout,hi=l.clearTimeout;function S(s,t){t.useNativeTimers?(s.setTimeoutFn=ci.bind(l),s.clearTimeoutFn=hi.bind(l)):(s.setTimeoutFn=l.setTimeout.bind(l),s.clearTimeoutFn=l.clearTimeout.bind(l))}var ui=1.33;function Ve(s){return typeof s=="string"?li(s):Math.ceil((s.byteLength||s.size)*ui)}function li(s){let t=0,i=0;for(let e=0,r=s.length;e<r;e++)t=s.charCodeAt(e),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(e++,i+=4);return i}function yt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function qe(s){let t="";for(let i in s)s.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return t}function He(s){let t={},i=s.split("&");for(let e=0,r=i.length;e<r;e++){let n=i[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var _t=class extends Error{constructor(t,i,e){super(t),this.description=i,this.context=e,this.type="TransportError"}},v=class extends u{constructor(t){super(),this.writable=!1,S(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,e){return super.emitReserved("error",new _t(t,i,e)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let i=J(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let i=qe(t);return i.length?"?"+i:""}};var U=class extends v{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let i=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};De(t,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Pe(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=yt()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}};var $e=!1;try{$e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Ye=$e;function fi(){}var It=class extends U{constructor(t){if(super(t),typeof location<"u"){let i=location.protocol==="https:",e=location.port;e||(e=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||e!==t.port}}doWrite(t,i){let e=this.request({method:"POST",data:t});e.on("success",i),e.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,e)=>{this.onError("xhr poll error",i,e)}),this.pollXhr=t}},bt=(()=>{class s extends u{constructor(i,e,r){super(),this.createRequest=i,S(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;let e=gt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=fi,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",We);else if(typeof addEventListener=="function"){let s="onpagehide"in l?"pagehide":"unload";addEventListener(s,We,!1)}}function We(){for(let s in bt.requests)bt.requests.hasOwnProperty(s)&&bt.requests[s].abort()}var pi=(function(){let s=Ge({xdomain:!1});return s&&s.responseType!==null})(),k=class extends It{constructor(t){super(t);let i=t&&t.forceBase64;this.supportsBinary=pi&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new bt(Ge,this.uri(),t)}};function Ge(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ye))return new XMLHttpRequest}catch{}if(!t)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Pt=class extends v{get name(){return"websocket"}doOpen(){let t=this.uri(),i=this.opts.protocols,e=Ke?{}:gt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,e)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;j(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=yt()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}},Lt=l.WebSocket||l.MozWebSocket,w=class extends Pt{createSocket(t,i,e){return Ke?new Lt(t,i,e):i?new Lt(t,i):new Lt(t)}doWrite(t,i){this.ws.send(i)}};var R=class extends v{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let i=Fe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(i).getReader(),r=Ue();r.readable.pipeTo(t.writable),this._writer=r.writable.getWriter();let n=()=>{e.read().then(({done:a,value:c})=>{a||(this.onPacket(c),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;this._writer.write(e).then(()=>{r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var Dt={websocket:w,webtransport:R,polling:k};var di=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function F(s){if(s.length>8e3)throw"URI too long";let t=s,i=s.indexOf("["),e=s.indexOf("]");i!=-1&&e!=-1&&(s=s.substring(0,i)+s.substring(i,e).replace(/:/g,";")+s.substring(e,s.length));let r=di.exec(s||""),n={},o=14;for(;o--;)n[mi[o]]=r[o]||"";return i!=-1&&e!=-1&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=gi(n,n.path),n.queryKey=yi(n,n.query),n}function gi(s,t){let i=/\/{2,9}/g,e=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&e.splice(0,1),t.slice(-1)=="/"&&e.splice(e.length-1,1),e}function yi(s,t){let i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,r,n){r&&(i[r]=n)}),i}var Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Et=[];Ut&&addEventListener("offline",()=>{Et.forEach(s=>s())},!1);var St=(()=>{class s extends u{constructor(i,e){if(super(),this.binaryType=Me,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(e=i,i=null),i){let r=F(i);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=F(e.host).host);S(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=He(this.opts.query)),Ut&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Et.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){let e=Object.assign({},this.opts.query);e.EIO=Bt,e.transport=i,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let i=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(i);e.open(),this.setTransport(e)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=i.data,this._onError(e);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=Ve(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,E(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,e,r){return this._sendPacket("message",i,e,r),this}send(i,e,r){return this._sendPacket("message",i,e,r),this}_sendPacket(i,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:i,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let i=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),i()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=Et.indexOf(this._offlineEventListener);r!==-1&&Et.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,e),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=Bt,s})(),vt=class extends St{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let i=this.createTransport(t),e=!1;St.priorWebsocketSuccess=!1;let r=()=>{e||(i.send([{type:"ping",data:"probe"}]),i.once("packet",A=>{if(!e)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;St.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let q=new Error("probe error");q.transport=i.name,this.emitReserved("upgradeError",q)}}))};function n(){e||(e=!0,g(),i.close(),i=null)}let o=A=>{let q=new Error("probe error: "+A);q.transport=i.name,n(),this.emitReserved("upgradeError",q)};function a(){o("transport closed")}function c(){o("socket closed")}function p(A){i&&A.name!==i.name&&n()}let g=()=>{i.removeListener("open",r),i.removeListener("error",o),i.removeListener("close",a),this.off("close",c),this.off("upgrading",p)};i.once("open",r),i.once("error",o),i.once("close",a),this.once("close",c),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{e||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let i=[];for(let e=0;e<t.length;e++)~this.transports.indexOf(t[e])&&i.push(t[e]);return i}},M=class extends vt{constructor(t,i={}){let e=typeof t=="object"?t:i;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(r=>Dt[r]).filter(r=>!!r)),super(t,e)}};var X=class extends U{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(i=>this.onData(i))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,i){this._fetch(t).then(e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);i()}).catch(e=>{this.onError("fetch write error",e)})}_fetch(t){var i;let e=t!==void 0,r=new Headers(this.opts.extraHeaders);return e&&r.set("content-type","text/plain;charset=UTF-8"),(i=this.socket._cookieJar)===null||i===void 0||i.appendCookies(r),fetch(this.uri(),{method:e?"POST":"GET",body:e?t:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var Ps=M.protocol;function je(s,t="",i){let e=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),e=F(s)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";let n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+t,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}var Yt={};Jt(Yt,{Decoder:()=>qt,Encoder:()=>Vt,PacketType:()=>h,protocol:()=>$t});var _i=typeof ArrayBuffer=="function",bi=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qe=Object.prototype.toString,Ei=typeof Blob=="function"||typeof Blob<"u"&&Qe.call(Blob)==="[object BlobConstructor]",Si=typeof File=="function"||typeof File<"u"&&Qe.call(File)==="[object FileConstructor]";function Z(s){return _i&&(s instanceof ArrayBuffer||bi(s))||Ei&&s instanceof Blob||Si&&s instanceof File}function z(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,e=s.length;i<e;i++)if(z(s[i]))return!0;return!1}if(Z(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return z(s.toJSON(),!0);for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&z(s[i]))return!0;return!1}function Je(s){let t=[],i=s.data,e=s;return e.data=Ft(i,t),e.attachments=t.length,{packet:e,buffers:t}}function Ft(s,t){if(!s)return s;if(Z(s)){let i={_placeholder:!0,num:t.length};return t.push(s),i}else if(Array.isArray(s)){let i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=Ft(s[e],t);return i}else if(typeof s=="object"&&!(s instanceof Date)){let i={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=Ft(s[e],t));return i}return s}function Xe(s,t){return s.data=Mt(s.data,t),delete s.attachments,s}function Mt(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mt(s[i],t);else if(typeof s=="object")for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mt(s[i],t));return s}var vi=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$t=5,h=(function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s})(h||{}),Vt=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&z(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){let i=Je(t),e=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(e),r}};function ze(s){return Object.prototype.toString.call(s)==="[object Object]"}var qt=class s extends u{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);let e=i.type===h.BINARY_EVENT;e||i.type===h.BINARY_ACK?(i.type=e?h.EVENT:h.ACK,this.reconstructor=new Ht(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Z(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0,e={type:Number(t.charAt(0))};if(h[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK){let n=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);let o=t.substring(n,i);if(o!=Number(o)||t.charAt(i)!=="-")throw new Error("Illegal attachments");e.attachments=Number(o)}if(t.charAt(i+1)==="/"){let n=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););e.nsp=t.substring(n,i)}else e.nsp="/";let r=t.charAt(i+1);if(r!==""&&Number(r)==r){let n=i+1;for(;++i;){let o=t.charAt(i);if(o==null||Number(o)!=o){--i;break}if(i===t.length)break}e.id=Number(t.substring(n,i+1))}if(t.charAt(++i)){let n=this.tryParse(t.substr(i));if(s.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case h.CONNECT:return ze(i);case h.DISCONNECT:return i===void 0;case h.CONNECT_ERROR:return typeof i=="string"||ze(i);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&vi.indexOf(i[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ht=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let i=Xe(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function m(s,t,i){return s.on(t,i),function(){s.off(t,i)}}var ki=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),C=class extends u{constructor(t,i,e){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=i,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[m(t,"open",this.onopen.bind(this)),m(t,"packet",this.onpacket.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...i){var e,r,n;if(ki.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:h.EVENT,data:i};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){let g=this.ids++,A=i.pop();this._registerAckCallback(g,A),o.id=g}let a=(r=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,i){var e;let r=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(r===void 0){this.acks[t]=i;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),i.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...i){return new Promise((e,r)=>{let n=(o,a)=>o?r(o):e(a);n.withError=!0,i.push(n),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());let e={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((r,...n)=>e!==this._queue[0]?void 0:(r!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(r)):(this._queue.shift(),i&&i(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){let i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let i=this._anyListeners.slice();for(let e of i)e.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let i=this,e=!1;return function(...r){e||(e=!0,i.packet({type:h.ACK,id:t,data:r}))}}onack(t){let i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let i=this._anyListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let i=this._anyOutgoingListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let e of i)e.apply(this,t.data)}}};function x(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}x.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};x.prototype.reset=function(){this.attempts=0};x.prototype.setMin=function(s){this.ms=s};x.prototype.setMax=function(s){this.max=s};x.prototype.setJitter=function(s){this.jitter=s};var N=class extends u{constructor(t,i){var e;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,S(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((e=i.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new x({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;let r=i.parser||Yt;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new M(this.uri,this.opts);let i=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;let r=m(i,"open",function(){e.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=m(i,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(m(t,"ping",this.onping.bind(this)),m(t,"data",this.ondata.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this)),m(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){E(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let e=this.nsps[t];return e?this._autoConnect&&!e.active&&e.connect():(e=new C(this,t,i),this.nsps[t]=e),e}_destroy(t){let i=Object.keys(this.nsps);for(let e of i)if(this.nsps[e].active)return;this._close()}_packet(t){let i=this.encoder.encode(t);for(let e=0;e<i.length;e++)this.engine.write(i[e],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,i){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let e=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(r=>{r?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",r)):t.onreconnect()}))},i);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var tt={};function B(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let i=je(s,t.path||"/socket.io"),e=i.source,r=i.id,n=i.path,o=tt[r]&&n in tt[r].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,c;return a?c=new N(e,t):(tt[r]||(tt[r]=new N(e,t)),c=tt[r]),i.query&&!t.query&&(t.query=i.queryKey),c.socket(i.path,t)}Object.assign(B,{Manager:N,Socket:C,io:B,connect:B});var V=class s{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,i){this.config=t,this.appRef=i,t===void 0&&(t=this.emptyConfig);let e=t.url,r=t.options,n=B?B:Wt;this.ioSocket=n(e,r)}get auth(){return this.ioSocket.auth}set auth(t){this.ioSocket.auth=t}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(t){if(!t||t==="/")return this;let i=this.namespaces[t];if(i)return i;let a=this.config,{url:e}=a,r=Qt(a,["url"]),n=it({url:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:`${e}${t}`},r),o=new s(n,this.appRef);return this.namespaces[t]=o,o}on(t,i){return this.ioSocket.on(t,i),this}once(t,i){return this.ioSocket.once(t,i),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...i){return this.ioSocket.emit(t,...i),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...i){return this.ioSocket.emitWithAck(t,...i)}removeListener(t,i){return this.ioSocket.removeListener(t,i),this}removeAllListeners(t){return this.ioSocket.removeAllListeners(t),this}fromEvent(t){return this.subscribersCounter[t]||(this.subscribersCounter[t]=0),this.subscribersCounter[t]++,this.eventObservables$[t]||(this.eventObservables$[t]=new Xt(i=>{let e=r=>{i.next(r),this.appRef.tick()};return this.ioSocket.on(t,e),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,e),delete this.eventObservables$[t])}}).pipe(te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(i=>this.once(t,i))}listeners(t){return this.ioSocket.listeners(t)}hasListeners(t){return this.ioSocket.hasListeners(t)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(t,i){return this.ioSocket.off(t,i),this}offAny(t){return this.ioSocket.offAny(t),this}offAnyOutgoing(t){return this.ioSocket.offAnyOutgoing(t),this}onAny(t){return this.ioSocket.onAny(t),this}onAnyOutgoing(t){return this.ioSocket.onAnyOutgoing(t),this}prependAny(t){return this.ioSocket.prependAny(t),this}prependAnyOutgoing(t){return this.ioSocket.prependAnyOutgoing(t),this}timeout(t){return this.ioSocket.timeout(t),this}get volatile(){let t=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(t){return this.ioSocket.compress(t),this}};function wi(s,t){return new V(s,t)}var Ze=new ee("__SOCKET_IO_CONFIG__"),Ar=(()=>{class s{static forRoot(i){return{ngModule:s,providers:[{provide:Ze,useValue:i},{provide:V,useFactory:wi,deps:[Ze,ne]}]}}static \u0275fac=function(e){return new(e||s)};static \u0275mod=nt({type:s});static \u0275inj=rt({})}return s})();var Kt={BASE:`${fe}/notifications`,UNREAD:"unread"},kt=Kt.BASE;var f=(function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s})(f||{});var y=(function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s})(y||{}),Br={COMMENTS:"commented",SPACES:{[f.ADD]:"You now have access to the space",[f.DELETE]:"You no longer have access to the space",[f.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[f.ADD]:"anchored",[f.DELETE]:"unanchored"},SHARES:{[f.ADD]:"shared with you",[f.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[f.ADD]:"You now have access to the share",[f.DELETE]:"You no longer have access to the share",[f.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[f.ADD]:"shared with you",[f.UPDATE]:"You now have access to the space"},SYNC:{[f.DELETE]:"You are no longer synchronizing"}};var ti=ue;var ei={[y.COMMENTS]:ti,[y.SPACES]:Y.SPACES,[y.SPACE_ROOTS]:Y.SPACES,[y.SHARES]:Y.SHARES,[y.LINKS]:Y.LINKS,[y.SYNC]:Se.SYNC};var wt=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=D(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=ei[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.SYNC)return;let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}};var ii=(()=>{let t=class t{constructor(){this.http=b(ut),this.store=b(ft),this.layout=b(pt)}getNotifications(e=!1){return this.http.get(`${kt}${e?`/${Kt.UNREAD}`:""}`).pipe(d(r=>r.map(n=>new wt(n))))}wasReadNotification(e){return this.http.patch(`${kt}/${e}`,null)}deleteNotification(e){return this.http.delete(`${kt}${e?`/${e}`:""}`)}checkUnreadNotifications(e=!1){this.getNotifications().subscribe(r=>{let n;if(e&&r.length){let o=r[0];n=this.layout.sendNotification("warning",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=r.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("warning","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(Zt(1)).subscribe(()=>this.layout.showRSideBarTab(be.NOTIFICATIONS,!0)),this.store.notifications.set(r)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var At=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(i=>new T(i))}};var I=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=D(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=(0,he.default)(this.currentAccess).fromNow(!0),this.newly=Ee(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(i=>new T(i)))}};var et=class{constructor(t){this.setOnlineStatus(_e("status",t)),this.avatarUrl=D(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=le[t]}};var Bn=(()=>{let t=class t{constructor(){this.http=b(ut),this.layout=b(pt),this.store=b(ft),this.webSocket=b(V),this.notifications=b(ii),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(we.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USER).pipe(d(e=>new et(e))).subscribe(e=>this.newOnlineUser(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USERS).pipe(d(e=>e.map(r=>new et(r)))).subscribe(e=>this.setOnlineUsers(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_STATUS).subscribe(e=>this.receiveOnlineStatus(e))}get user(){return this.store.user.getValue()}initUser(e,r=!1){this.refreshAvatar(),this.layout.setLanguage(e.language),this.store.userImpersonate.set(r||e.impersonated),this.store.user.next(e),this.checkQuota(this.store.user.getValue()),r&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(e){this.store.onlineUsers.set(e)}newOnlineUser(e){this.store.onlineUsers().find(r=>r.id===e.id)?this.receiveOnlineStatus({userId:e.id,status:e.onlineStatus}):this.store.onlineUsers.update(r=>[e,...r])}userHavePermission(e){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(e)!==-1:!1}browseGroup(e){return this.http.get(`${ge}${e?`/${e}`:""}`).pipe(d(r=>new At(r)))}createPersonalGroup(e){return this.http.post(O,e).pipe(d(r=>new T(r)))}updatePersonalGroup(e,r){return this.http.put(`${O}/${e}`,r).pipe(d(n=>new T(n)))}leavePersonalGroup(e){return this.http.delete(`${ye}/${e}`)}addUsersToGroup(e,r){return this.http.patch(`${O}/${e}/${$.USERS}`,r)}deletePersonalGroup(e){return this.http.delete(`${O}/${e}`)}updateUserFromPersonalGroup(e,r,n){return this.http.patch(`${O}/${e}/${$.USERS}/${r}`,n)}removeUserFromGroup(e,r){return this.http.delete(`${O}/${e}/${$.USERS}/${r}`)}listGuests(){return this.http.get(P).pipe(d(e=>e.map(r=>new I(r))))}getGuest(e){return this.http.get(`${P}/${e}`).pipe(d(r=>new I(r)))}createGuest(e){return this.http.post(P,e).pipe(d(r=>new I(r)))}updateGuest(e,r){return this.http.put(`${P}/${e}`,r).pipe(d(n=>n?new I(n):null))}deleteGuest(e){return this.http.delete(`${P}/${e}`)}genAvatar(){this.http.patch(Ct,null).subscribe({next:()=>this.refreshAvatar(),error:e=>this.layout.sendNotification("error","Configuration","Avatar",e)})}uploadAvatar(e){let r=new FormData;r.append("file",e),this.http.put(Ct,r).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(e){return this.http.put(de,e)}changeLanguage(e){return this.http.put(pe,e)}changeNotification(e){return this.http.put(me,e)}changeOnlineStatus(e,r=!0){this.webSocket.emit(W.EVENTS.ONLINE_STATUS,{status:e,store:r})}receiveOnlineStatus(e){this.user.id===e.userId?this.user.onlineStatus=e.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(r=>r.map(n=>n.id===e.userId?jt(it({},n),{onlineStatus:e.status}):n))}searchMembers(e,r=[]){return this.http.request("search",$.BASE,{body:e}).pipe(d(n=>n.map(o=>new T(o,r))),zt(()=>[]))}setMenusVisibility(e){for(let r of e)if(!(r.id&&(r.hide=!this.userHavePermission(r.id),r.hide))&&(r.checks?.length&&(r.hide=!r.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),r.submenus?.length&&this.setMenusVisibility(r.submenus),r.title===ke.FILES)){for(let n of r.submenus)if(!n.hide){r.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(ve())}checkAppStoreAvailability(){this.http.get(`${Rt.BASE}/${Rt.APP_STORE}`).subscribe({next:e=>this.store.appStoreManifest.set(e),error:e=>console.error(e)})}checkQuota(e){if(!(e.isGuest||e.isLink)&&e.storageQuota){let r=Math.round(100/e.storageQuota*(e.storageQuota-e.storageUsage));r<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):r<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0}):r<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var Ai={provide:lt,useExisting:H(()=>Ti),multi:!0},Ti=(()=>{let t=class t{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=ot({type:t,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(r,n){r&1&&ct("click",function(){return n.onClick()}),r&2&&(at("aria-pressed",n.state),Tt("active",n.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[ht([Ai])]});let s=t;return s})(),Oi={provide:lt,useExisting:H(()=>si),multi:!0},si=(()=>{let t=class t{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,r,n,o){this.el=e,this.cdr=r,this.renderer=n,this.group=o,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};t.\u0275fac=function(r){return new(r||t)(L(se),L(Ot),L(re),L(H(()=>ri),8))},t.\u0275dir=ot({type:t,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(r,n){r&1&&ct("click",function(){return n.toggleIfAllowed()})("keydown.space",function(a){return n.onSpacePressed(a)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),r&2&&(at("aria-disabled",n.controlOrGroupDisabled)("aria-checked",n.isActive)("role",n.role)("tabindex",n.tabindex),Tt("disabled",n.hasDisabledClass)("active",n.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[ht([Oi]),ie]});let s=t;return s})(),Ri={provide:lt,useExisting:H(()=>ri),multi:!0},ri=(()=>{let t=class t{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(r=>{r.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let r=this.radioButtons.find(n=>!n.disabled);r&&r.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function r(o,a){let p=(o+(e==="next"?1:-1))%a.length;return p<0&&(p=a.length-1),p}let n=this.getActiveOrFocusedRadio();if(n&&this.radioButtons){let o=this.radioButtons.toArray(),a=o.indexOf(n);for(let c=r(a,o);c!==a;c=r(c,o))if(o[c].canToggle()){o[c].toggleIfAllowed(),o[c].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};t.\u0275fac=function(r){return new(r||t)(L(Ot))},t.\u0275dir=ot({type:t,selectors:[["","btnRadioGroup",""]],contentQueries:function(r,n,o){if(r&1&&oe(o,si,4),r&2){let a;ae(a=ce())&&(n.radioButtons=a)}},hostVars:2,hostBindings:function(r,n){r&1&&ct("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("keydown.ArrowRight",function(a){return n.selectNext(a)})("keydown.ArrowDown",function(a){return n.selectNext(a)})("keydown.ArrowLeft",function(a){return n.selectPrevious(a)})("keydown.ArrowUp",function(a){return n.selectPrevious(a)}),r&2&&at("role",n.role)("tabindex",n.tabindex)},features:[ht([Ri])]});let s=t;return s})(),Wn=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275mod=nt({type:t}),t.\u0275inj=rt({});let s=t;return s})();export{Ar as a,y as b,ii as c,At as d,I as e,Bn as f,Ti as g,Wn as h};
|
|
1
|
+
import{$ as Ct,B as he,Ea as _e,Gb as ke,Hb as Y,Ja as be,Q as le,Qa as Ee,Qb as T,S as fe,T as Rt,W as $,Y as pe,Z as de,_ as me,aa as O,ba as ge,ca as ye,da as P,fb as Se,ib as D,jb as ve,kb as ft,wb as pt}from"./chunk-4U5A2DEP.js";import{Cb as ct,G as zt,Hb as oe,Jb as ae,Kb as ce,L as Zt,Nb as Tt,Oc as ut,Qa as re,Ra as L,W as te,Ya as nt,Za as ot,Zb as ht,_c as lt,ba as H,c as Xt,ca as st,da as rt,fa as ee,ha as b,hb as ne,ib as at,nf as ue,qc as Ot,v as d,va as ie,ya as se}from"./chunk-HW2H3ISM.js";import{a as it,b as jt,c as Qt,e as Jt}from"./chunk-RTRJ3KFH.js";var we={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var W={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var Wt={};Jt(Wt,{Fetch:()=>X,Manager:()=>N,NodeWebSocket:()=>w,NodeXHR:()=>k,Socket:()=>C,WebSocket:()=>w,WebTransport:()=>R,XHR:()=>k,connect:()=>B,default:()=>B,io:()=>B,protocol:()=>$t});var _=Object.create(null);_.open="0";_.close="1";_.ping="2";_.pong="3";_.message="4";_.upgrade="5";_.noop="6";var G=Object.create(null);Object.keys(_).forEach(s=>{G[_[s]]=s});var K={type:"error",data:"parser error"};var Oe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Re=typeof ArrayBuffer=="function",Ce=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,j=({type:s,data:t},i,e)=>Oe&&t instanceof Blob?i?e(t):Ae(t,e):Re&&(t instanceof ArrayBuffer||Ce(t))?i?e(t):Ae(new Blob([t]),e):e(_[s]+(t||"")),Ae=(s,t)=>{let i=new FileReader;return i.onload=function(){let e=i.result.split(",")[1];t("b"+(e||""))},i.readAsDataURL(s)};function Te(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var xt;function xe(s,t){if(Oe&&s.data instanceof Blob)return s.data.arrayBuffer().then(Te).then(t);if(Re&&(s.data instanceof ArrayBuffer||Ce(s.data)))return t(Te(s.data));j(s,!1,i=>{xt||(xt=new TextEncoder),t(xt.encode(i))})}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ne.length;s++)Q[Ne.charCodeAt(s)]=s;var Be=s=>{let t=s.length*.75,i=s.length,e,r=0,n,o,a,c;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let p=new ArrayBuffer(t),g=new Uint8Array(p);for(e=0;e<i;e+=4)n=Q[s.charCodeAt(e)],o=Q[s.charCodeAt(e+1)],a=Q[s.charCodeAt(e+2)],c=Q[s.charCodeAt(e+3)],g[r++]=n<<2|o>>4,g[r++]=(o&15)<<4|a>>2,g[r++]=(a&3)<<6|c&63;return p};var ni=typeof ArrayBuffer=="function",J=(s,t)=>{if(typeof s!="string")return{type:"message",data:Ie(s,t)};let i=s.charAt(0);return i==="b"?{type:"message",data:oi(s.substring(1),t)}:G[i]?s.length>1?{type:G[i],data:s.substring(1)}:{type:G[i]}:K},oi=(s,t)=>{if(ni){let i=Be(s);return Ie(i,t)}else return{base64:!0,data:s}},Ie=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Le="",Pe=(s,t)=>{let i=s.length,e=new Array(i),r=0;s.forEach((n,o)=>{j(n,!1,a=>{e[o]=a,++r===i&&t(e.join(Le))})})},De=(s,t)=>{let i=s.split(Le),e=[];for(let r=0;r<i.length;r++){let n=J(i[r],t);if(e.push(n),n.type==="error")break}return e};function Ue(){return new TransformStream({transform(s,t){xe(s,i=>{let e=i.length,r;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}s.data&&typeof s.data!="string"&&(r[0]|=128),t.enqueue(r),t.enqueue(i)})}})}var Nt;function dt(s){return s.reduce((t,i)=>t+i.length,0)}function mt(s,t){if(s[0].length===t)return s.shift();let i=new Uint8Array(t),e=0;for(let r=0;r<t;r++)i[r]=s[0][e++],e===s[0].length&&(s.shift(),e=0);return s.length&&e<s[0].length&&(s[0]=s[0].slice(e)),i}function Fe(s,t){Nt||(Nt=new TextDecoder);let i=[],e=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(i.push(o);;){if(e===0){if(dt(i)<1)break;let c=mt(i,1);n=(c[0]&128)===128,r=c[0]&127,r<126?e=3:r===126?e=1:e=2}else if(e===1){if(dt(i)<2)break;let c=mt(i,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),e=3}else if(e===2){if(dt(i)<8)break;let c=mt(i,8),p=new DataView(c.buffer,c.byteOffset,c.length),g=p.getUint32(0);if(g>Math.pow(2,21)-1){a.enqueue(K);break}r=g*Math.pow(2,32)+p.getUint32(4),e=3}else{if(dt(i)<r)break;let c=mt(i,r);a.enqueue(J(n?c:Nt.decode(c),t)),e=0}if(r===0||r>s){a.enqueue(K);break}}}})}var Bt=4;function u(s){if(s)return ai(s)}function ai(s){for(var t in u.prototype)s[t]=u.prototype[t];return s}u.prototype.on=u.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};u.prototype.once=function(s,t){function i(){this.off(s,i),t.apply(this,arguments)}return i.fn=t,this.on(s,i),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var e,r=0;r<i.length;r++)if(e=i[r],e===t||e.fn===t){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+s],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(i){i=i.slice(0);for(var e=0,r=i.length;e<r;++e)i[e].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var E=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Me="arraybuffer";function gt(s,...t){return t.reduce((i,e)=>(s.hasOwnProperty(e)&&(i[e]=s[e]),i),{})}var ci=l.setTimeout,hi=l.clearTimeout;function S(s,t){t.useNativeTimers?(s.setTimeoutFn=ci.bind(l),s.clearTimeoutFn=hi.bind(l)):(s.setTimeoutFn=l.setTimeout.bind(l),s.clearTimeoutFn=l.clearTimeout.bind(l))}var ui=1.33;function Ve(s){return typeof s=="string"?li(s):Math.ceil((s.byteLength||s.size)*ui)}function li(s){let t=0,i=0;for(let e=0,r=s.length;e<r;e++)t=s.charCodeAt(e),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(e++,i+=4);return i}function yt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function qe(s){let t="";for(let i in s)s.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return t}function He(s){let t={},i=s.split("&");for(let e=0,r=i.length;e<r;e++){let n=i[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var _t=class extends Error{constructor(t,i,e){super(t),this.description=i,this.context=e,this.type="TransportError"}},v=class extends u{constructor(t){super(),this.writable=!1,S(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,e){return super.emitReserved("error",new _t(t,i,e)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let i=J(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let i=qe(t);return i.length?"?"+i:""}};var U=class extends v{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let i=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};De(t,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Pe(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=yt()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}};var $e=!1;try{$e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Ye=$e;function fi(){}var It=class extends U{constructor(t){if(super(t),typeof location<"u"){let i=location.protocol==="https:",e=location.port;e||(e=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||e!==t.port}}doWrite(t,i){let e=this.request({method:"POST",data:t});e.on("success",i),e.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,e)=>{this.onError("xhr poll error",i,e)}),this.pollXhr=t}},bt=(()=>{class s extends u{constructor(i,e,r){super(),this.createRequest=i,S(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;let e=gt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=fi,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",We);else if(typeof addEventListener=="function"){let s="onpagehide"in l?"pagehide":"unload";addEventListener(s,We,!1)}}function We(){for(let s in bt.requests)bt.requests.hasOwnProperty(s)&&bt.requests[s].abort()}var pi=(function(){let s=Ge({xdomain:!1});return s&&s.responseType!==null})(),k=class extends It{constructor(t){super(t);let i=t&&t.forceBase64;this.supportsBinary=pi&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new bt(Ge,this.uri(),t)}};function Ge(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ye))return new XMLHttpRequest}catch{}if(!t)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Pt=class extends v{get name(){return"websocket"}doOpen(){let t=this.uri(),i=this.opts.protocols,e=Ke?{}:gt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,e)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;j(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=yt()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}},Lt=l.WebSocket||l.MozWebSocket,w=class extends Pt{createSocket(t,i,e){return Ke?new Lt(t,i,e):i?new Lt(t,i):new Lt(t)}doWrite(t,i){this.ws.send(i)}};var R=class extends v{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let i=Fe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(i).getReader(),r=Ue();r.readable.pipeTo(t.writable),this._writer=r.writable.getWriter();let n=()=>{e.read().then(({done:a,value:c})=>{a||(this.onPacket(c),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;this._writer.write(e).then(()=>{r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var Dt={websocket:w,webtransport:R,polling:k};var di=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function F(s){if(s.length>8e3)throw"URI too long";let t=s,i=s.indexOf("["),e=s.indexOf("]");i!=-1&&e!=-1&&(s=s.substring(0,i)+s.substring(i,e).replace(/:/g,";")+s.substring(e,s.length));let r=di.exec(s||""),n={},o=14;for(;o--;)n[mi[o]]=r[o]||"";return i!=-1&&e!=-1&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=gi(n,n.path),n.queryKey=yi(n,n.query),n}function gi(s,t){let i=/\/{2,9}/g,e=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&e.splice(0,1),t.slice(-1)=="/"&&e.splice(e.length-1,1),e}function yi(s,t){let i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,r,n){r&&(i[r]=n)}),i}var Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Et=[];Ut&&addEventListener("offline",()=>{Et.forEach(s=>s())},!1);var St=(()=>{class s extends u{constructor(i,e){if(super(),this.binaryType=Me,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(e=i,i=null),i){let r=F(i);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=F(e.host).host);S(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=He(this.opts.query)),Ut&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Et.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){let e=Object.assign({},this.opts.query);e.EIO=Bt,e.transport=i,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let i=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(i);e.open(),this.setTransport(e)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=i.data,this._onError(e);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=Ve(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,E(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,e,r){return this._sendPacket("message",i,e,r),this}send(i,e,r){return this._sendPacket("message",i,e,r),this}_sendPacket(i,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:i,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let i=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),i()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=Et.indexOf(this._offlineEventListener);r!==-1&&Et.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,e),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=Bt,s})(),vt=class extends St{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let i=this.createTransport(t),e=!1;St.priorWebsocketSuccess=!1;let r=()=>{e||(i.send([{type:"ping",data:"probe"}]),i.once("packet",A=>{if(!e)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;St.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let q=new Error("probe error");q.transport=i.name,this.emitReserved("upgradeError",q)}}))};function n(){e||(e=!0,g(),i.close(),i=null)}let o=A=>{let q=new Error("probe error: "+A);q.transport=i.name,n(),this.emitReserved("upgradeError",q)};function a(){o("transport closed")}function c(){o("socket closed")}function p(A){i&&A.name!==i.name&&n()}let g=()=>{i.removeListener("open",r),i.removeListener("error",o),i.removeListener("close",a),this.off("close",c),this.off("upgrading",p)};i.once("open",r),i.once("error",o),i.once("close",a),this.once("close",c),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{e||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let i=[];for(let e=0;e<t.length;e++)~this.transports.indexOf(t[e])&&i.push(t[e]);return i}},M=class extends vt{constructor(t,i={}){let e=typeof t=="object"?t:i;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(r=>Dt[r]).filter(r=>!!r)),super(t,e)}};var X=class extends U{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(i=>this.onData(i))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,i){this._fetch(t).then(e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);i()}).catch(e=>{this.onError("fetch write error",e)})}_fetch(t){var i;let e=t!==void 0,r=new Headers(this.opts.extraHeaders);return e&&r.set("content-type","text/plain;charset=UTF-8"),(i=this.socket._cookieJar)===null||i===void 0||i.appendCookies(r),fetch(this.uri(),{method:e?"POST":"GET",body:e?t:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var Ps=M.protocol;function je(s,t="",i){let e=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),e=F(s)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";let n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+t,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}var Yt={};Jt(Yt,{Decoder:()=>qt,Encoder:()=>Vt,PacketType:()=>h,protocol:()=>$t});var _i=typeof ArrayBuffer=="function",bi=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qe=Object.prototype.toString,Ei=typeof Blob=="function"||typeof Blob<"u"&&Qe.call(Blob)==="[object BlobConstructor]",Si=typeof File=="function"||typeof File<"u"&&Qe.call(File)==="[object FileConstructor]";function Z(s){return _i&&(s instanceof ArrayBuffer||bi(s))||Ei&&s instanceof Blob||Si&&s instanceof File}function z(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,e=s.length;i<e;i++)if(z(s[i]))return!0;return!1}if(Z(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return z(s.toJSON(),!0);for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&z(s[i]))return!0;return!1}function Je(s){let t=[],i=s.data,e=s;return e.data=Ft(i,t),e.attachments=t.length,{packet:e,buffers:t}}function Ft(s,t){if(!s)return s;if(Z(s)){let i={_placeholder:!0,num:t.length};return t.push(s),i}else if(Array.isArray(s)){let i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=Ft(s[e],t);return i}else if(typeof s=="object"&&!(s instanceof Date)){let i={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=Ft(s[e],t));return i}return s}function Xe(s,t){return s.data=Mt(s.data,t),delete s.attachments,s}function Mt(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mt(s[i],t);else if(typeof s=="object")for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mt(s[i],t));return s}var vi=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$t=5,h=(function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s})(h||{}),Vt=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&z(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){let i=Je(t),e=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(e),r}};function ze(s){return Object.prototype.toString.call(s)==="[object Object]"}var qt=class s extends u{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);let e=i.type===h.BINARY_EVENT;e||i.type===h.BINARY_ACK?(i.type=e?h.EVENT:h.ACK,this.reconstructor=new Ht(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Z(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0,e={type:Number(t.charAt(0))};if(h[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK){let n=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);let o=t.substring(n,i);if(o!=Number(o)||t.charAt(i)!=="-")throw new Error("Illegal attachments");e.attachments=Number(o)}if(t.charAt(i+1)==="/"){let n=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););e.nsp=t.substring(n,i)}else e.nsp="/";let r=t.charAt(i+1);if(r!==""&&Number(r)==r){let n=i+1;for(;++i;){let o=t.charAt(i);if(o==null||Number(o)!=o){--i;break}if(i===t.length)break}e.id=Number(t.substring(n,i+1))}if(t.charAt(++i)){let n=this.tryParse(t.substr(i));if(s.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case h.CONNECT:return ze(i);case h.DISCONNECT:return i===void 0;case h.CONNECT_ERROR:return typeof i=="string"||ze(i);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&vi.indexOf(i[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ht=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let i=Xe(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function m(s,t,i){return s.on(t,i),function(){s.off(t,i)}}var ki=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),C=class extends u{constructor(t,i,e){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=i,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[m(t,"open",this.onopen.bind(this)),m(t,"packet",this.onpacket.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...i){var e,r,n;if(ki.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:h.EVENT,data:i};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){let g=this.ids++,A=i.pop();this._registerAckCallback(g,A),o.id=g}let a=(r=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,i){var e;let r=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(r===void 0){this.acks[t]=i;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),i.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...i){return new Promise((e,r)=>{let n=(o,a)=>o?r(o):e(a);n.withError=!0,i.push(n),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());let e={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((r,...n)=>e!==this._queue[0]?void 0:(r!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(r)):(this._queue.shift(),i&&i(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){let i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let i=this._anyListeners.slice();for(let e of i)e.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let i=this,e=!1;return function(...r){e||(e=!0,i.packet({type:h.ACK,id:t,data:r}))}}onack(t){let i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let i=this._anyListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let i=this._anyOutgoingListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let e of i)e.apply(this,t.data)}}};function x(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}x.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};x.prototype.reset=function(){this.attempts=0};x.prototype.setMin=function(s){this.ms=s};x.prototype.setMax=function(s){this.max=s};x.prototype.setJitter=function(s){this.jitter=s};var N=class extends u{constructor(t,i){var e;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,S(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((e=i.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new x({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;let r=i.parser||Yt;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new M(this.uri,this.opts);let i=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;let r=m(i,"open",function(){e.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=m(i,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(m(t,"ping",this.onping.bind(this)),m(t,"data",this.ondata.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this)),m(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){E(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let e=this.nsps[t];return e?this._autoConnect&&!e.active&&e.connect():(e=new C(this,t,i),this.nsps[t]=e),e}_destroy(t){let i=Object.keys(this.nsps);for(let e of i)if(this.nsps[e].active)return;this._close()}_packet(t){let i=this.encoder.encode(t);for(let e=0;e<i.length;e++)this.engine.write(i[e],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,i){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let e=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(r=>{r?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",r)):t.onreconnect()}))},i);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var tt={};function B(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let i=je(s,t.path||"/socket.io"),e=i.source,r=i.id,n=i.path,o=tt[r]&&n in tt[r].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,c;return a?c=new N(e,t):(tt[r]||(tt[r]=new N(e,t)),c=tt[r]),i.query&&!t.query&&(t.query=i.queryKey),c.socket(i.path,t)}Object.assign(B,{Manager:N,Socket:C,io:B,connect:B});var V=class s{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,i){this.config=t,this.appRef=i,t===void 0&&(t=this.emptyConfig);let e=t.url,r=t.options,n=B?B:Wt;this.ioSocket=n(e,r)}get auth(){return this.ioSocket.auth}set auth(t){this.ioSocket.auth=t}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(t){if(!t||t==="/")return this;let i=this.namespaces[t];if(i)return i;let a=this.config,{url:e}=a,r=Qt(a,["url"]),n=it({url:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:`${e}${t}`},r),o=new s(n,this.appRef);return this.namespaces[t]=o,o}on(t,i){return this.ioSocket.on(t,i),this}once(t,i){return this.ioSocket.once(t,i),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...i){return this.ioSocket.emit(t,...i),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...i){return this.ioSocket.emitWithAck(t,...i)}removeListener(t,i){return this.ioSocket.removeListener(t,i),this}removeAllListeners(t){return this.ioSocket.removeAllListeners(t),this}fromEvent(t){return this.subscribersCounter[t]||(this.subscribersCounter[t]=0),this.subscribersCounter[t]++,this.eventObservables$[t]||(this.eventObservables$[t]=new Xt(i=>{let e=r=>{i.next(r),this.appRef.tick()};return this.ioSocket.on(t,e),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,e),delete this.eventObservables$[t])}}).pipe(te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(i=>this.once(t,i))}listeners(t){return this.ioSocket.listeners(t)}hasListeners(t){return this.ioSocket.hasListeners(t)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(t,i){return this.ioSocket.off(t,i),this}offAny(t){return this.ioSocket.offAny(t),this}offAnyOutgoing(t){return this.ioSocket.offAnyOutgoing(t),this}onAny(t){return this.ioSocket.onAny(t),this}onAnyOutgoing(t){return this.ioSocket.onAnyOutgoing(t),this}prependAny(t){return this.ioSocket.prependAny(t),this}prependAnyOutgoing(t){return this.ioSocket.prependAnyOutgoing(t),this}timeout(t){return this.ioSocket.timeout(t),this}get volatile(){let t=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(t){return this.ioSocket.compress(t),this}};function wi(s,t){return new V(s,t)}var Ze=new ee("__SOCKET_IO_CONFIG__"),Ar=(()=>{class s{static forRoot(i){return{ngModule:s,providers:[{provide:Ze,useValue:i},{provide:V,useFactory:wi,deps:[Ze,ne]}]}}static \u0275fac=function(e){return new(e||s)};static \u0275mod=nt({type:s});static \u0275inj=rt({})}return s})();var Kt={BASE:`${fe}/notifications`,UNREAD:"unread"},kt=Kt.BASE;var f=(function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s})(f||{});var y=(function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s})(y||{}),Br={COMMENTS:"commented",SPACES:{[f.ADD]:"You now have access to the space",[f.DELETE]:"You no longer have access to the space",[f.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[f.ADD]:"anchored",[f.DELETE]:"unanchored"},SHARES:{[f.ADD]:"shared with you",[f.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[f.ADD]:"You now have access to the share",[f.DELETE]:"You no longer have access to the share",[f.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[f.ADD]:"shared with you",[f.UPDATE]:"You now have access to the space"},SYNC:{[f.DELETE]:"You are no longer synchronizing"}};var ti=ue;var ei={[y.COMMENTS]:ti,[y.SPACES]:Y.SPACES,[y.SPACE_ROOTS]:Y.SPACES,[y.SHARES]:Y.SHARES,[y.LINKS]:Y.LINKS,[y.SYNC]:Se.SYNC};var wt=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=D(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=ei[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.SYNC)return;let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}};var ii=(()=>{let t=class t{constructor(){this.http=b(ut),this.store=b(ft),this.layout=b(pt)}getNotifications(e=!1){return this.http.get(`${kt}${e?`/${Kt.UNREAD}`:""}`).pipe(d(r=>r.map(n=>new wt(n))))}wasReadNotification(e){return this.http.patch(`${kt}/${e}`,null)}deleteNotification(e){return this.http.delete(`${kt}${e?`/${e}`:""}`)}checkUnreadNotifications(e=!1){this.getNotifications().subscribe(r=>{let n;if(e&&r.length){let o=r[0];n=this.layout.sendNotification("warning",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=r.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("warning","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(Zt(1)).subscribe(()=>this.layout.showRSideBarTab(be.NOTIFICATIONS,!0)),this.store.notifications.set(r)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var At=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(i=>new T(i))}};var I=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=D(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=(0,he.default)(this.currentAccess).fromNow(!0),this.newly=Ee(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(i=>new T(i)))}};var et=class{constructor(t){this.setOnlineStatus(_e("status",t)),this.avatarUrl=D(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=le[t]}};var Bn=(()=>{let t=class t{constructor(){this.http=b(ut),this.layout=b(pt),this.store=b(ft),this.webSocket=b(V),this.notifications=b(ii),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(we.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USER).pipe(d(e=>new et(e))).subscribe(e=>this.newOnlineUser(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USERS).pipe(d(e=>e.map(r=>new et(r)))).subscribe(e=>this.setOnlineUsers(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_STATUS).subscribe(e=>this.receiveOnlineStatus(e))}get user(){return this.store.user.getValue()}initUser(e,r=!1){this.refreshAvatar(),this.layout.setLanguage(e.language),this.store.userImpersonate.set(r||e.impersonated),this.store.user.next(e),this.checkQuota(this.store.user.getValue()),r&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(e){this.store.onlineUsers.set(e)}newOnlineUser(e){this.store.onlineUsers().find(r=>r.id===e.id)?this.receiveOnlineStatus({userId:e.id,status:e.onlineStatus}):this.store.onlineUsers.update(r=>[e,...r])}userHavePermission(e){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(e)!==-1:!1}browseGroup(e){return this.http.get(`${ge}${e?`/${e}`:""}`).pipe(d(r=>new At(r)))}createPersonalGroup(e){return this.http.post(O,e).pipe(d(r=>new T(r)))}updatePersonalGroup(e,r){return this.http.put(`${O}/${e}`,r).pipe(d(n=>new T(n)))}leavePersonalGroup(e){return this.http.delete(`${ye}/${e}`)}addUsersToGroup(e,r){return this.http.patch(`${O}/${e}/${$.USERS}`,r)}deletePersonalGroup(e){return this.http.delete(`${O}/${e}`)}updateUserFromPersonalGroup(e,r,n){return this.http.patch(`${O}/${e}/${$.USERS}/${r}`,n)}removeUserFromGroup(e,r){return this.http.delete(`${O}/${e}/${$.USERS}/${r}`)}listGuests(){return this.http.get(P).pipe(d(e=>e.map(r=>new I(r))))}getGuest(e){return this.http.get(`${P}/${e}`).pipe(d(r=>new I(r)))}createGuest(e){return this.http.post(P,e).pipe(d(r=>new I(r)))}updateGuest(e,r){return this.http.put(`${P}/${e}`,r).pipe(d(n=>n?new I(n):null))}deleteGuest(e){return this.http.delete(`${P}/${e}`)}genAvatar(){this.http.patch(Ct,null).subscribe({next:()=>this.refreshAvatar(),error:e=>this.layout.sendNotification("error","Configuration","Avatar",e)})}uploadAvatar(e){let r=new FormData;r.append("file",e),this.http.put(Ct,r).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(e){return this.http.put(de,e)}changeLanguage(e){return this.http.put(pe,e)}changeNotification(e){return this.http.put(me,e)}changeOnlineStatus(e,r=!0){this.webSocket.emit(W.EVENTS.ONLINE_STATUS,{status:e,store:r})}receiveOnlineStatus(e){this.user.id===e.userId?this.user.onlineStatus=e.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(r=>r.map(n=>n.id===e.userId?jt(it({},n),{onlineStatus:e.status}):n))}searchMembers(e,r=[]){return this.http.request("search",$.BASE,{body:e}).pipe(d(n=>n.map(o=>new T(o,r))),zt(()=>[]))}setMenusVisibility(e){for(let r of e)if(!(r.id&&(r.hide=!this.userHavePermission(r.id),r.hide))&&(r.checks?.length&&(r.hide=!r.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),r.submenus?.length&&this.setMenusVisibility(r.submenus),r.title===ke.FILES)){for(let n of r.submenus)if(!n.hide){r.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(ve())}checkAppStoreAvailability(){this.http.get(`${Rt.BASE}/${Rt.APP_STORE}`).subscribe({next:e=>this.store.appStoreManifest.set(e),error:e=>console.error(e)})}checkQuota(e){if(!(e.isGuest||e.isLink)&&e.storageQuota){let r=Math.round(100/e.storageQuota*(e.storageQuota-e.storageUsage));r<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):r<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0}):r<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var Ai={provide:lt,useExisting:H(()=>Ti),multi:!0},Ti=(()=>{let t=class t{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=ot({type:t,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(r,n){r&1&&ct("click",function(){return n.onClick()}),r&2&&(at("aria-pressed",n.state),Tt("active",n.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[ht([Ai])]});let s=t;return s})(),Oi={provide:lt,useExisting:H(()=>si),multi:!0},si=(()=>{let t=class t{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,r,n,o){this.el=e,this.cdr=r,this.renderer=n,this.group=o,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};t.\u0275fac=function(r){return new(r||t)(L(se),L(Ot),L(re),L(H(()=>ri),8))},t.\u0275dir=ot({type:t,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(r,n){r&1&&ct("click",function(){return n.toggleIfAllowed()})("keydown.space",function(a){return n.onSpacePressed(a)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),r&2&&(at("aria-disabled",n.controlOrGroupDisabled)("aria-checked",n.isActive)("role",n.role)("tabindex",n.tabindex),Tt("disabled",n.hasDisabledClass)("active",n.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[ht([Oi]),ie]});let s=t;return s})(),Ri={provide:lt,useExisting:H(()=>ri),multi:!0},ri=(()=>{let t=class t{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(r=>{r.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let r=this.radioButtons.find(n=>!n.disabled);r&&r.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function r(o,a){let p=(o+(e==="next"?1:-1))%a.length;return p<0&&(p=a.length-1),p}let n=this.getActiveOrFocusedRadio();if(n&&this.radioButtons){let o=this.radioButtons.toArray(),a=o.indexOf(n);for(let c=r(a,o);c!==a;c=r(c,o))if(o[c].canToggle()){o[c].toggleIfAllowed(),o[c].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};t.\u0275fac=function(r){return new(r||t)(L(Ot))},t.\u0275dir=ot({type:t,selectors:[["","btnRadioGroup",""]],contentQueries:function(r,n,o){if(r&1&&oe(o,si,4),r&2){let a;ae(a=ce())&&(n.radioButtons=a)}},hostVars:2,hostBindings:function(r,n){r&1&&ct("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("keydown.ArrowRight",function(a){return n.selectNext(a)})("keydown.ArrowDown",function(a){return n.selectNext(a)})("keydown.ArrowLeft",function(a){return n.selectPrevious(a)})("keydown.ArrowUp",function(a){return n.selectPrevious(a)}),r&2&&at("role",n.role)("tabindex",n.tabindex)},features:[ht([Ri])]});let s=t;return s})(),Wn=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275mod=nt({type:t}),t.\u0275inj=rt({});let s=t;return s})();export{Ar as a,y as b,ii as c,At as d,I as e,Bn as f,Ti as g,Wn as h};
|