import { RuleContext } from '@alfresco/adf-extensions' ; /**
 * Checks if a Preview route is activated.
 * JSON ref: `app.navigation.isPreview`
 */ export function isPreview ( context ) { const { url } = context . navigation ; return url && ( url . includes ( '/preview/' ) || url . includes ( 'viewer:view' ) || url . includes ( '/view/' ) ) ; } /**
 * Checks if a **Favorites** route is activated.
 * JSON ref: `app.navigation.isFavorites`
 */ export function isFavorites ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/favorites' ) && ! isPreview ( context ) ; } /**
 * Checks if the activated route is not **Favorites**.
 * JSON ref: `app.navigation.isNotFavorites`
 */ export function isNotFavorites ( context ) { return ! isFavorites ( context ) ; } /**
 * Checks if a **Shared Files** route is activated.
 * JSON ref: `app.navigation.isSharedFiles`
 */ export function isSharedFiles ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/shared' ) && ! isPreview ( context ) ; } /**
 * Checks if the activated route is not **Shared Files**.
 * JSON ref: `app.navigation.isNotSharedFiles`
 */ export function isNotSharedFiles ( context ) { return ! isSharedFiles ( context ) ; } /**
 * Checks if a **Trashcan** route is activated.
 * JSON ref: `app.navigation.isTrashcan`
 */ export function isTrashcan ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/trashcan' ) ; } /**
 * Checks if the activated route is not **Trashcan**.
 * JSON ref: `app.navigation.isNotTrashcan`
 */ export function isNotTrashcan ( context ) { return ! isTrashcan ( context ) ; } /**
 * Checks if a **Personal Files** route is activated.
 * JSON ref: `app.navigation.isPersonalFiles`
 */ export function isPersonalFiles ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/personal-files' ) ; } /**
 * Checks if a **Library Files** route is activated.
 * JSON ref: `app.navigation.isLibraryFiles`
 */ export function isLibraryFiles ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/libraries' ) ; } /**
 * Checks if a **Library Files** or **Library Search Result** route is activated.
 * JSON ref: `app.navigation.isLibraryFiles`
 */ export function isLibraries ( context ) { const { url } = context . navigation ; return url && ( url . endsWith ( '/libraries' ) || url . startsWith ( '/search-libraries' ) ) ; } /**
 * Checks if the activated route is neither **Libraries** nor **Library Search Results**.
 * JSON ref: `app.navigation.isNotLibraries`
 */ export function isNotLibraries ( context ) { return ! isLibraries ( context ) ; } /**
 * Checks if a **Recent Files** route is activated.
 * JSON ref: `app.navigation.isRecentFiles`
 */ export function isRecentFiles ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/recent-files' ) ; } /**
 * Checks if the activated route is not **Recent Files**.
 * JSON ref: `app.navigation.isNotRecentFiles`
 */ export function isNotRecentFiles ( context ) { return ! isRecentFiles ( context ) ; } /**
 * Checks if a **Search Results** route is activated.
 * JSON ref: `app.navigation.isSearchResults`
 */ export function isSearchResults ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/search' ) ; } /**
 * Checks if the activated route is not **Search Results**.
 * JSON ref: `app.navigation.isNotSearchResults`
 */ export function isNotSearchResults ( context ) { return ! isSearchResults ( context ) ; } /**
 * Checks if a **Shared Preview** route is activated.
 * JSON ref: `app.navigation.isSharedPreview`
 */ export function isSharedPreview ( context ) { const { url } = context . navigation ; return url && ( url . startsWith ( '/shared/preview/' ) || ( url . startsWith ( '/shared' ) && url . includes ( 'viewer:view' ) ) ) ; } /**
 * Checks if a **Favorites Preview** route is activated.
 * JSON ref: `app.navigation.isFavoritesPreview`
 */ export function isFavoritesPreview ( context ) { const { url } = context . navigation ; return url && ( url . startsWith ( '/favorites/preview/' ) || ( url . startsWith ( '/favorites' ) && url . includes ( 'viewer:view' ) ) ) ; } /**
 * Checks if a **Shared File Preview** route is activated.
 * JSON ref: `app.navigation.isFavoritesPreview`
 */ export function isSharedFileViewer ( context ) { const { url } = context . navigation ; return url && url . startsWith ( '/preview/s/' ) ; }