function permissionInSet(_0xa2d98f,_0x467a4b){if(!_0xa2d98f||!_0x467a4b)return![];if(_0xa2d98f['includes']('*'))return!![];if(_0xa2d98f['includes'](_0x467a4b))return!![];const [_0x250d34]=_0x467a4b['split'](':');if(_0xa2d98f['includes'](_0x250d34+':*'))return!![];return![];}function hasServerPermission(_0x25d926,_0x4e369b){const _0x1d072b=_0x25d926?.['permissions']?.['server'];if(!_0x1d072b)return![];return permissionInSet(_0x1d072b,_0x4e369b);}function hasEnvPermission(_0x26c0e6,_0x44f820){if(hasServerPermission(_0x26c0e6,'*'))return!![];const _0x4ff7e5=_0x26c0e6?.['permissions']?.['environments'];if(!_0x4ff7e5)return![];for(const _0x34f9f5 of Object['values'](_0x4ff7e5)){if(permissionInSet(_0x34f9f5,_0x44f820))return!![];}return![];}function hasEnvPermissionOn(_0x3943de,_0x517616,_0x149e3e){if(hasServerPermission(_0x3943de,'*'))return!![];const _0xe26593=_0x3943de?.['permissions']?.['environments']?.[_0x517616];if(!_0xe26593)return![];return permissionInSet(_0xe26593,_0x149e3e);}function hasTeamPermission(_0x113263,_0x3b0d01){if(hasServerPermission(_0x113263,'*'))return!![];const _0x102d39=_0x113263?.['permissions']?.['teams'];if(!_0x102d39)return![];for(const _0x3874b6 of Object['values'](_0x102d39)){if(permissionInSet(_0x3874b6,_0x3b0d01))return!![];}return![];}function hasAnyEnvironment(_0x3c84f6){if(hasServerPermission(_0x3c84f6,'*'))return!![];const _0x18f266=_0x3c84f6?.['permissions']?.['environments'];return _0x18f266!=null&&Object['keys'](_0x18f266)['length']>0x0;}function canDeleteTask(_0x1f3bbf,_0x289291){if(!_0x1f3bbf||!_0x289291||!_0x289291['environment'])return![];if(hasEnvPermissionOn(_0x1f3bbf,_0x289291['environment'],'tasks:delete_any'))return!![];if(!hasEnvPermissionOn(_0x1f3bbf,_0x289291['environment'],'tasks:delete'))return![];return _0x289291['createdBy']?.['userId']===_0x1f3bbf['id'];}window['Permissions']={'hasServerPermission':hasServerPermission,'hasEnvPermission':hasEnvPermission,'hasEnvPermissionOn':hasEnvPermissionOn,'hasTeamPermission':hasTeamPermission,'hasAnyEnvironment':hasAnyEnvironment,'canDeleteTask':canDeleteTask};