public function addPanel(Bar\PanelInterface $panel, string $id = null): self
    {
        if ($id === null) {
            $c = 0;
            do {
                $id = \get_class($panel) . ($c++ ? "-$c" : '');
            } while (isset($this->panels[$id]));
        }
        $this->panels[$id] = $panel;

        return $this;
    }