import { i18n } from '@kbn/i18n' ; import type { ApplicationSetup , AppMountParameters , StartServicesAccessor } from 'src/core/public' ; import type { SpacesManager } from '../spaces_manager' ; interface CreateDeps { application : ApplicationSetup ; spacesManager : SpacesManager ; getStartServices : StartServicesAccessor ; } export const spaceSelectorApp = Object . freeze ( { id : 'space_selector' , create ( { application , getStartServices , spacesManager } ) { application . register ( { id : this . id , title : i18n . translate ( 'xpack.spaces.spaceSelector.appTitle' , { defaultMessage : 'Select a space' , } ) , chromeless : true , appRoute : '/spaces/space_selector' , mount : async ( { element , theme$ } ) => { const [ [ coreStart ] , { renderSpaceSelectorApp } ] = await Promise . all ( [ getStartServices ( ) , import ( './space_selector' ) , ] ) ; return renderSpaceSelectorApp ( coreStart . i18n , { element , theme$ } , { spacesManager , serverBasePath : coreStart . http . basePath . serverBasePath , } ) ; } , } ) ; } , } ) ;