const SIDEBAR_VIEW_MODE_FULL = 0;
const SIDEBAR_VIEW_MODE_COMPACT = 1;
const SIDEBAR_VIEW_MODE_HIDDEN = 2;
const SIDEBAR_HOVER_DELAY = 1000;
const SIDEBAR_EVENT_BLUR = 'blur';
const SIDEBAR_EVENT_CLOSE = 'close';
const SIDEBAR_EVENT_FOCUS = 'focus';
const SIDEBAR_EVENT_OPEN = 'open';
const SIDEBAR_EVENT_VIEWMODECHANGE = 'viewmodechange';
class CSidebar extends CBaseComponent {
this._sidebar_toggle = document.getElementById('sidebar-button-toggle');
this._sidebar_scrollable = this._target.querySelector('.scrollable');
this._is_focused = false;
const sidebar_header = this._target.querySelector('.sidebar-header'),
sidebar_header_style = window.getComputedStyle(sidebar_header),
sidebar_header_style_position = sidebar_header_style.position;
sidebar_header.style.position = 'absolute';
let max_width = sidebar_header.clientWidth + parseInt(sidebar_header_style.getPropertyValue('margin-left'))
+ parseInt(sidebar_header_style.getPropertyValue('margin-right'));
sidebar_header.style.position = sidebar_header_style_position;
for (const child of this._target.querySelectorAll('nav > ul')) {
const position = window.getComputedStyle(child).position;
child.style.position = 'absolute';
max_width = Math.max(max_width, child.clientWidth);