"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([[568],{568:(e,o,n)=>{n.r(o),n.d(o,{default:()=>m});var t,a=n(4),c=n(172),r=n(987),l=n(861),i=n(354),s=n(778),b=n(761),d=n(580);!function(e){e.launchNotebookTree="jupyter-notebook:launch-tree",e.openNotebook="jupyter-notebook:open-notebook",e.openLab="jupyter-notebook:open-lab",e.openNbClassic="jupyter-notebook:open-nbclassic"}(t||(t={}));const u={id:"@jupyter-notebook/lab-extension:interface-switcher",autoStart:!0,requires:[i.ITranslator,l.INotebookTracker],optional:[c.ICommandPalette,b.INotebookShell,a.ILabShell,c.IToolbarWidgetRegistry],activate:(e,o,n,a,c,l,i)=>{const{commands:b,shell:u}=e,m=r.PageConfig.getBaseUrl(),p=o.load("notebook"),k="true"===r.PageConfig.getOption("nbclassic_enabled"),_=new s.Menu({commands:b}),h=[];c||h.push({command:t.openNotebook,commandLabel:p.__("Notebook"),commandDescription:p.__("Open in %1","Jupyter Notebook"),buttonLabel:"openNotebook",urlPrefix:`${m}tree/`}),l||h.push({command:t.openLab,commandLabel:p.__("JupyterLab"),commandDescription:p.__("Open in %1","JupyterLab"),buttonLabel:"openLab",urlPrefix:`${m}doc/tree/`}),k&&h.push({command:t.openNbClassic,commandLabel:p.__("NbClassic"),commandDescription:p.__("Open in %1","NbClassic"),buttonLabel:"openNbClassic",urlPrefix:`${m}nbclassic/notebooks/`});const g=()=>null!==n.currentWidget&&n.currentWidget===u.currentWidget;let f;if(h.forEach((e=>{const{command:o}=e;(e=>{const{command:o,commandLabel:t,commandDescription:c,urlPrefix:r}=e;b.addCommand(o,{label:e=>(e.noLabel,e.isMenu||e.isPalette?c:t),caption:t,execute:()=>{const e=n.currentWidget;e&&window.open(`${r}${e.context.path}`)},isEnabled:g}),a&&a.addItem({command:o,category:"Other",args:{isPalette:!0}})})(e),_.addItem({command:o})})),1===h.length)f=e=>{const o=new d.CommandToolbarButton({commands:b,id:h[0].command,label:h[0].commandLabel,icon:d.launchIcon});return o.addClass("jp-nb-interface-switcher-button"),o};else{const e={overflowMenuOptions:{isVisible:!1}},o=new s.MenuBar(e);_.title.label=p.__("Open in..."),_.title.icon=d.caretDownIcon,o.addMenu(_),f=o=>{const n=new s.MenuBar(e);return n.addMenu(_),n.addClass("jp-InterfaceSwitcher"),n}}i&&i.addFactory("Notebook","interfaceSwitcher",f)}},m=[{id:"@jupyter-notebook/lab-extension:launch-tree",autoStart:!0,requires:[i.ITranslator],optional:[c.ICommandPalette],activate:(e,o,n)=>{const{commands:a}=e,c=o.load("notebook"),l=c.__("Help");a.addCommand(t.launchNotebookTree,{label:c.__("Launch Jupyter Notebook File Browser"),execute:()=>{window.open(r.PageConfig.getBaseUrl()+"tree")}}),n&&n.addItem({command:t.launchNotebookTree,category:l})}},u]}}]);