export const getLovelace = ( ) => { let root = document . querySelector ( 'home-assistant' ) ; root = root && root . shadowRoot ; root = root && root . querySelector ( 'home-assistant-main' ) ; root = root && root . shadowRoot ; root = root && root . querySelector ( 'app-drawer-layout partial-panel-resolver' ) ; root = root && root . shadowRoot || root ; root = root && root . querySelector ( 'ha-panel-lovelace' ) ; root = root && root . shadowRoot ; root = root && root . querySelector ( 'hui-root' ) ; if ( root ) { const ll = root . lovelace ; ll . current_view = root . ___curView ; return ll ; } return null ; } ;