function permissionInSet(_0x3ce72f,_0x3514ff){if(!_0x3ce72f||!_0x3514ff)return![];if(_0x3ce72f['includes']('*'))return!![];if(_0x3ce72f['includes'](_0x3514ff))return!![];const [_0x5607a4]=_0x3514ff['split'](':');if(_0x3ce72f['includes'](_0x5607a4+':*'))return!![];return![];}function hasServerPermission(_0x543224,_0x337570){const _0x3e5394=_0x543224?.['permissions']?.['server'];if(!_0x3e5394)return![];return permissionInSet(_0x3e5394,_0x337570);}function hasEnvPermission(_0x119cbf,_0xfce21){if(hasServerPermission(_0x119cbf,'*'))return!![];const _0x203d01=_0x119cbf?.['permissions']?.['environments'];if(!_0x203d01)return![];for(const _0x3000ef of Object['values'](_0x203d01)){if(permissionInSet(_0x3000ef,_0xfce21))return!![];}return![];}function hasEnvPermissionOn(_0x29bebb,_0xe6eea4,_0x465b4d){if(hasServerPermission(_0x29bebb,'*'))return!![];const _0x1f87e5=_0x29bebb?.['permissions']?.['environments']?.[_0xe6eea4];if(!_0x1f87e5)return![];return permissionInSet(_0x1f87e5,_0x465b4d);}function hasTeamPermission(_0x1ab042,_0x59fca0){if(hasServerPermission(_0x1ab042,'*'))return!![];const _0x474e4b=_0x1ab042?.['permissions']?.['teams'];if(!_0x474e4b)return![];for(const _0x2638e5 of Object['values'](_0x474e4b)){if(permissionInSet(_0x2638e5,_0x59fca0))return!![];}return![];}function hasAnyEnvironment(_0x107336){if(hasServerPermission(_0x107336,'*'))return!![];const _0x51f122=_0x107336?.['permissions']?.['environments'];return _0x51f122!=null&&Object['keys'](_0x51f122)['length']>0x0;}function canDeleteTask(_0x2967b3,_0x5ade7a){if(!_0x2967b3||!_0x5ade7a||!_0x5ade7a['environment'])return![];if(hasEnvPermissionOn(_0x2967b3,_0x5ade7a['environment'],'tasks:delete_any'))return!![];if(!hasEnvPermissionOn(_0x2967b3,_0x5ade7a['environment'],'tasks:delete'))return![];return _0x5ade7a['createdBy']?.['userId']===_0x2967b3['id'];}window['Permissions']={'hasServerPermission':hasServerPermission,'hasEnvPermission':hasEnvPermission,'hasEnvPermissionOn':hasEnvPermissionOn,'hasTeamPermission':hasTeamPermission,'hasAnyEnvironment':hasAnyEnvironment,'canDeleteTask':canDeleteTask};