notebook 7.2.0rc1__py3-none-any.whl → 7.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of notebook might be problematic. Click here for more details.

Files changed (171) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/{6078.bundle.js → 1053.bundle.js} +1 -1
  3. notebook/static/113.bundle.js +1 -1
  4. notebook/static/1198.bundle.js +1 -1
  5. notebook/static/134.bundle.js +1 -1
  6. notebook/static/1408.bundle.js +1 -1
  7. notebook/static/1496.bundle.js +1 -1
  8. notebook/static/1647.bundle.js +1 -1
  9. notebook/static/1650.bundle.js +1 -1
  10. notebook/static/1684.bundle.js +1 -1
  11. notebook/static/1809.bundle.js +1 -1
  12. notebook/static/1827.bundle.js +1 -1
  13. notebook/static/1833.bundle.js +1 -1
  14. notebook/static/1846.bundle.js +1 -1
  15. notebook/static/1958.bundle.js +1 -1
  16. notebook/static/1962.bundle.js +1 -1
  17. notebook/static/2007.bundle.js +1 -1
  18. notebook/static/2088.bundle.js +1 -1
  19. notebook/static/2089.bundle.js +1 -1
  20. notebook/static/2122.bundle.js +1 -1
  21. notebook/static/2167.bundle.js +1 -1
  22. notebook/static/2184.bundle.js +1 -1
  23. notebook/static/2311.bundle.js +1 -1
  24. notebook/static/2401.bundle.js +1 -1
  25. notebook/static/2479.bundle.js +1 -1
  26. notebook/static/2489.bundle.js +1 -1
  27. notebook/static/2607.bundle.js +1 -1
  28. notebook/static/2615.bundle.js +1 -1
  29. notebook/static/2636.bundle.js +1 -1
  30. notebook/static/2924.bundle.js +1 -1
  31. notebook/static/2944.bundle.js +1 -1
  32. notebook/static/3129.bundle.js +1 -1
  33. notebook/static/3146.bundle.js +1 -1
  34. notebook/static/3187.bundle.js +1 -1
  35. notebook/static/3213.bundle.js +1 -1
  36. notebook/static/3340.bundle.js +1 -1
  37. notebook/static/3360.bundle.js +1 -1
  38. notebook/static/3466.bundle.js +1 -1
  39. notebook/static/3512.bundle.js +1 -1
  40. notebook/static/3676.bundle.js +1 -1
  41. notebook/static/3680.bundle.js +1 -1
  42. notebook/static/374.bundle.js +1 -1
  43. notebook/static/3768.bundle.js +1 -1
  44. notebook/static/377.bundle.js +1 -1
  45. notebook/static/3863.bundle.js +1 -1
  46. notebook/static/3881.bundle.js +1 -1
  47. notebook/static/4042.bundle.js +1 -1
  48. notebook/static/4212.bundle.js +1 -1
  49. notebook/static/4382.bundle.js +1 -1
  50. notebook/static/4630.bundle.js +1 -1
  51. notebook/static/4645.bundle.js +1 -1
  52. notebook/static/4811.bundle.js +1 -1
  53. notebook/static/4837.bundle.js +1 -1
  54. notebook/static/5099.bundle.js +1 -1
  55. notebook/static/5135.bundle.js +1 -1
  56. notebook/static/5254.bundle.js +1 -1
  57. notebook/static/5263.bundle.js +1 -1
  58. notebook/static/5313.bundle.js +1 -1
  59. notebook/static/5325.bundle.js +1 -1
  60. notebook/static/5346.bundle.js +1 -1
  61. notebook/static/5425.bundle.js +1 -1
  62. notebook/static/5426.bundle.js +1 -1
  63. notebook/static/545.bundle.js +1 -1
  64. notebook/static/5573.bundle.js +1 -1
  65. notebook/static/5601.bundle.js +1 -1
  66. notebook/static/5733.bundle.js +1 -1
  67. notebook/static/5912.bundle.js +1 -1
  68. notebook/static/5921.bundle.js +1 -1
  69. notebook/static/6017.bundle.js +1 -1
  70. notebook/static/6139.bundle.js +1 -1
  71. notebook/static/62.bundle.js +1 -1
  72. notebook/static/6281.bundle.js +1 -1
  73. notebook/static/6345.bundle.js +1 -1
  74. notebook/static/{2756.bundle.js → 6593.bundle.js} +1 -1
  75. notebook/static/6604.bundle.js +1 -1
  76. notebook/static/6621.bundle.js +1 -1
  77. notebook/static/6627.bundle.js +1 -1
  78. notebook/static/6748.bundle.js +1 -1
  79. notebook/static/6815.bundle.js +1 -1
  80. notebook/static/6853.bundle.js +1 -1
  81. notebook/static/6893.bundle.js +1 -1
  82. notebook/static/690.bundle.js +1 -1
  83. notebook/static/6962.bundle.js +1 -1
  84. notebook/static/6999.bundle.js +1 -1
  85. notebook/static/7226.bundle.js +1 -1
  86. notebook/static/7252.bundle.js +1 -1
  87. notebook/static/7259.bundle.js +1 -1
  88. notebook/static/7302.bundle.js +1 -1
  89. notebook/static/7386.bundle.js +1 -1
  90. notebook/static/7391.bundle.js +1 -1
  91. notebook/static/7506.bundle.js +2 -2
  92. notebook/static/7543.bundle.js +1 -1
  93. notebook/static/755.bundle.js +1 -1
  94. notebook/static/7603.bundle.js +1 -1
  95. notebook/static/7639.bundle.js +1 -1
  96. notebook/static/7655.bundle.js +1 -1
  97. notebook/static/7684.bundle.js +1 -1
  98. notebook/static/7812.bundle.js +1 -1
  99. notebook/static/7819.bundle.js +1 -1
  100. notebook/static/7854.bundle.js +1 -1
  101. notebook/static/7900.bundle.js +1 -1
  102. notebook/static/7906.bundle.js +1 -1
  103. notebook/static/8471.bundle.js +1 -1
  104. notebook/static/8579.bundle.js +1 -1
  105. notebook/static/8633.bundle.js +1 -1
  106. notebook/static/8771.bundle.js +1 -1
  107. notebook/static/8781.bundle.js +1 -1
  108. notebook/static/8845.bundle.js +1 -1
  109. notebook/static/8875.bundle.js +1 -1
  110. notebook/static/8907.bundle.js +1 -1
  111. notebook/static/8928.bundle.js +1 -1
  112. notebook/static/893.bundle.js +1 -1
  113. notebook/static/901.bundle.js +1 -1
  114. notebook/static/9068.bundle.js +1 -1
  115. notebook/static/9136.bundle.js +1 -1
  116. notebook/static/9151.bundle.js +1 -1
  117. notebook/static/9161.bundle.js +1 -1
  118. notebook/static/9268.bundle.js +1 -1
  119. notebook/static/9335.bundle.js +1 -1
  120. notebook/static/9341.bundle.js +1 -1
  121. notebook/static/9380.bundle.js +1 -1
  122. notebook/static/9605.bundle.js +1 -1
  123. notebook/static/9638.bundle.js +1 -1
  124. notebook/static/9680.bundle.js +1 -1
  125. notebook/static/9685.bundle.js +1 -1
  126. notebook/static/9752.bundle.js +1 -1
  127. notebook/static/9821.bundle.js +1 -1
  128. notebook/static/9852.bundle.js +1 -1
  129. notebook/static/bundle.js +1 -1
  130. notebook/static/third-party-licenses.json +101 -101
  131. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  132. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  133. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  134. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  135. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  136. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  137. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  138. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/42.33f638f0a4239bed9676.js +1 -0
  139. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.3dd58d88e32a98358776.js +1 -0
  140. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.bf5955f09ff1e05edfbb.js +1 -0
  141. notebook-7.2.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.04dfa589925e7e7c6a3d.js +1 -0
  142. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  143. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/METADATA +1 -1
  144. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/RECORD +167 -167
  145. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/WHEEL +1 -1
  146. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/302.8a8d0af0376cb309e580.js +0 -1
  147. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1176453d31b84477bbd4.js +0 -1
  148. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.76f40c4b4ee1c8583ca3.js +0 -1
  149. notebook-7.2.0rc1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.a5e570ba118d1d45c877.js +0 -1
  150. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  151. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  152. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  153. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  154. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  155. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  156. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  157. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  158. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  159. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  160. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  161. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  162. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  163. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  164. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  165. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  166. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  167. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  168. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  169. {notebook-7.2.0rc1.data → notebook-7.2.2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  170. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/entry_points.txt +0 -0
  171. {notebook-7.2.0rc1.dist-info → notebook-7.2.2.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6853],{76853:(e,t,i)=>{i.r(t),i.d(t,{ConnectionLost:()=>a,IConnectionLost:()=>I,ILabShell:()=>B,ILabStatus:()=>R,ILayoutRestorer:()=>E.L,IMimeDocumentTracker:()=>m.w2,IRouter:()=>j,ITreePathUpdater:()=>U,JupyterFrontEnd:()=>g,JupyterFrontEndContextMenu:()=>o,JupyterLab:()=>x,LabShell:()=>H,LabStatus:()=>M.J,LayoutRestorer:()=>E.c,Router:()=>S,addSemanticCommand:()=>O,createRendermimePlugin:()=>m.aX,createRendermimePlugins:()=>m.as,createSemanticCommand:()=>D});var n=i(53312),s=i(12030);const a=async function(e,t,i){const a=(i=i||s.nullTranslator).load("jupyterlab"),r=a.__("Server Connection Error"),o=a.__("A connection to the Jupyter server could not be established.\nJupyterLab will continue trying to reconnect.\nCheck your network connection or Jupyter server configuration.\n");return(0,n.showErrorMessage)(r,{message:o})};var r,o,d=i(65903),l=i(87408),h=i(35613),c=i(34771),u=i(20998),p=i(81997);class g extends c.Application{constructor(e){super(e),this._formatChanged=new p.Signal(this),this.contextMenu=new h.ContextMenuSvg({commands:this.commands,renderer:e.contextMenuRenderer,groupByTarget:!1,sortBySelector:!1});const t=new Promise((e=>{requestAnimationFrame((()=>{e()}))}));this.commandLinker=e.commandLinker||new n.CommandLinker({commands:this.commands}),this.docRegistry=e.docRegistry||new d.DocumentRegistry,this.restored=e.restored||this.started.then((()=>t)).catch((()=>t)),this.serviceManager=e.serviceManager||new l.ServiceManager}get format(){return this._format}set format(e){this._format!==e&&(this._format=e,document.body.dataset.format=e,this._formatChanged.emit(e))}get formatChanged(){return this._formatChanged}contextMenuHitTest(e){if(!(this._contextMenuEvent&&this._contextMenuEvent.target instanceof Node))return;let t=this._contextMenuEvent.target;do{if(t instanceof HTMLElement&&e(t))return t;t=t.parentNode}while(t&&t.parentNode&&t!==t.parentNode)}evtContextMenu(e){if(this._contextMenuEvent=e,!e.shiftKey&&!r.suppressContextMenu(e.target)&&this.contextMenu.open(e)){const t=this.contextMenu.menu.items;if(1===t.length&&t[0].command===o.contextMenu)return void this.contextMenu.menu.close();e.preventDefault(),e.stopPropagation()}}}!function(e){e.inDocMode=function(e,t){const i=new RegExp(`^${t.urls.doc}`);return!!e.match(i)},e.IPaths=new u.Token("@jupyterlab/application:IPaths","A service providing information about various\n URLs and server paths for the current application. Use this service if you want to\n assemble URLs to use the JupyterLab REST API."),e.ITreeResolver=new u.Token("@jupyterlab/application:ITreeResolver","A service to resolve the tree path.")}(g||(g={})),function(e){e.suppressContextMenu=function(e){return null!==e.closest("[data-jp-suppress-context-menu]")}}(r||(r={})),function(e){e.contextMenu="__internal:context-menu-info"}(o||(o={}));var _=i(68722),m=i(75677),f=i(33625),v=i(49503),y=i(97934),w=i(63485);const b="jp-SideBar",P="jp-mod-current",k="jp-mod-active",C=900,T="jp-Activity",B=new u.Token("@jupyterlab/application:ILabShell","A service for interacting with the JupyterLab shell. The top-level ``application`` object also has a reference to the shell, but it has a restricted interface in order to be agnostic to different shell implementations on the application. Use this to get more detailed information about currently active widgets and layout state.");class H extends w.Widget{constructor(e){super(),this._dockChildHook=(e,t)=>{switch(t.type){case"child-added":t.child.addClass(T),this._tracker.add(t.child);break;case"child-removed":t.child.removeClass(T),this._tracker.remove(t.child)}return!0},this._activeChanged=new p.Signal(this),this._cachedLayout=null,this._currentChanged=new p.Signal(this),this._currentPath="",this._currentPathChanged=new p.Signal(this),this._modeChanged=new p.Signal(this),this._isRestored=!1,this._layoutModified=new p.Signal(this),this._layoutDebouncer=new y.Debouncer((()=>{this._layoutModified.emit(void 0)}),0),this._restored=new u.PromiseDelegate,this._tracker=new w.FocusTracker,this._topHandlerHiddenByUser=!1,this._idTypeMap=new Map,this._mainOptionsCache=new Map,this._sideOptionsCache=new Map,this._delayedWidget=new Array,this.addClass("jp-LabShell"),this.id="main",!1===(null==e?void 0:e.waitForRestore)&&(this._userLayout={"multiple-document":{},"single-document":{}});const t=this._skipLinkWidget=new L.SkipLinkWidget(this);this._skipLinkWidget.show();const i=new w.Panel;i.addClass("jp-skiplink-wrapper"),i.addWidget(t);const n=this._headerPanel=new w.BoxPanel,a=this._menuHandler=new L.PanelHandler;a.panel.node.setAttribute("role","navigation");const r=this._topHandler=new L.PanelHandler;r.panel.node.setAttribute("role","banner");const o=this._bottomPanel=new w.BoxPanel;o.node.setAttribute("role","contentinfo");const l=new w.BoxPanel,c=this._vsplitPanel=new L.RestorableSplitPanel,g=this._dockPanel=new h.DockPanelSvg({hiddenMode:w.Widget.HiddenMode.Display});v.MessageLoop.installMessageHook(g,this._dockChildHook);const _=this._hsplitPanel=new L.RestorableSplitPanel,m=this._downPanel=new h.TabPanelSvg({tabsMovable:!0}),f=this._leftHandler=new L.SideBarHandler,P=this._rightHandler=new L.SideBarHandler,k=new w.BoxLayout;n.id="jp-header-panel",a.panel.id="jp-menu-panel",r.panel.id="jp-top-panel",o.id="jp-bottom-panel",l.id="jp-main-content-panel",c.id="jp-main-vsplit-panel",g.id="jp-main-dock-panel",_.id="jp-main-split-panel",m.id="jp-down-stack",f.sideBar.addClass(b),f.sideBar.addClass("jp-mod-left"),f.sideBar.node.setAttribute("role","complementary"),f.stackedPanel.id="jp-left-stack",P.sideBar.addClass(b),P.sideBar.addClass("jp-mod-right"),P.sideBar.node.setAttribute("role","complementary"),P.stackedPanel.id="jp-right-stack",g.node.setAttribute("role","main"),l.spacing=0,c.spacing=1,g.spacing=5,_.spacing=1,n.direction="top-to-bottom",c.orientation="vertical",l.direction="left-to-right",_.orientation="horizontal",o.direction="bottom-to-top",w.SplitPanel.setStretch(f.stackedPanel,0),w.SplitPanel.setStretch(m,0),w.SplitPanel.setStretch(g,1),w.SplitPanel.setStretch(P.stackedPanel,0),w.BoxPanel.setStretch(f.sideBar,0),w.BoxPanel.setStretch(_,1),w.BoxPanel.setStretch(P.sideBar,0),w.SplitPanel.setStretch(c,1),_.addWidget(f.stackedPanel),_.addWidget(g),_.addWidget(P.stackedPanel),c.addWidget(_),c.addWidget(m),l.addWidget(f.sideBar),l.addWidget(c),l.addWidget(P.sideBar),k.direction="top-to-bottom",k.spacing=0,c.setRelativeSizes([3,1]),_.setRelativeSizes([1,2.5,1]),w.BoxLayout.setStretch(n,0),w.BoxLayout.setStretch(a.panel,0),w.BoxLayout.setStretch(r.panel,0),w.BoxLayout.setStretch(l,1),w.BoxLayout.setStretch(o,0),k.addWidget(i),k.addWidget(n),k.addWidget(r.panel),k.addWidget(l),k.addWidget(o),this._headerPanel.hide(),this._bottomPanel.hide(),this._downPanel.hide(),this.layout=k,this._tracker.currentChanged.connect(this._onCurrentChanged,this),this._tracker.activeChanged.connect(this._onActiveChanged,this),this._dockPanel.layoutModified.connect(this._onLayoutModified,this),this._vsplitPanel.updated.connect(this._onLayoutModified,this),this._downPanel.currentChanged.connect(this._onLayoutModified,this),this._downPanel.tabBar.tabMoved.connect(this._onTabPanelChanged,this),this._downPanel.stackedPanel.widgetRemoved.connect(this._onTabPanelChanged,this),this._leftHandler.updated.connect(this._onLayoutModified,this),this._rightHandler.updated.connect(this._onLayoutModified,this),this._hsplitPanel.updated.connect(this._onLayoutModified,this);const C=this._titleHandler=new L.TitleHandler(this);this.add(C,"top",{rank:100}),"multiple-document"===this._dockPanel.mode?(this._topHandler.addWidget(this._menuHandler.panel,100),C.hide()):k.insertWidget(3,this._menuHandler.panel),this.translator=s.nullTranslator,this.currentChanged.connect(((e,t)=>{let i=t.newValue,n=t.oldValue;n&&(n.title.changed.disconnect(this._updateTitlePanelTitle,this),n instanceof d.DocumentWidget&&n.context.pathChanged.disconnect(this._updateCurrentPath,this)),i&&(i.title.changed.connect(this._updateTitlePanelTitle,this),this._updateTitlePanelTitle(),i instanceof d.DocumentWidget&&i.context.pathChanged.connect(this._updateCurrentPath,this)),this._updateCurrentPath()}))}get activeChanged(){return this._activeChanged}get activeWidget(){return this._tracker.activeWidget}get addButtonEnabled(){return this._dockPanel.addButtonEnabled}set addButtonEnabled(e){this._dockPanel.addButtonEnabled=e}get addRequested(){return this._dockPanel.addRequested}get currentChanged(){return this._currentChanged}get currentPath(){return this._currentPath}get currentPathChanged(){return this._currentPathChanged}get currentWidget(){return this._tracker.currentWidget}get layoutModified(){return this._layoutModified}get leftCollapsed(){return!this._leftHandler.sideBar.currentTitle}get rightCollapsed(){return!this._rightHandler.sideBar.currentTitle}get presentationMode(){return this.hasClass("jp-mod-presentationMode")}set presentationMode(e){this.toggleClass("jp-mod-presentationMode",e)}get mode(){return this._dockPanel.mode}set mode(e){const t=this._dockPanel;if(e===t.mode)return;const i=this.currentWidget;if("single-document"===e)this._cachedLayout=t.saveLayout(),t.mode=e,this.currentWidget&&t.activateWidget(this.currentWidget),this.layout.insertWidget(3,this._menuHandler.panel),this._titleHandler.show(),this._updateTitlePanelTitle(),this._topHandlerHiddenByUser&&this._topHandler.panel.hide();else{const n=Array.from(t.widgets());t.mode=e,this._cachedLayout&&(L.normalizeAreaConfig(t,this._cachedLayout.main),t.restoreLayout(this._cachedLayout),this._cachedLayout=null),this._layoutRestorer.isDeferred&&this._layoutRestorer.restoreDeferred().then((e=>{if(e){const{currentWidget:t,dock:i}=e;i&&this._dockPanel.restoreLayout(i),t&&this.activateById(t.id)}})).catch((e=>{console.error("Failed to restore the deferred layout."),console.error(e)})),n.forEach((e=>{e.parent||this._addToMainArea(e,{...this._mainOptionsCache.get(e),activate:!1})})),this._mainOptionsCache.clear(),i&&t.activateWidget(i),this.add(this._menuHandler.panel,"top",{rank:100}),this._titleHandler.hide()}this.node.dataset.shellMode=e,this._downPanel.fit(),this._modeChanged.emit(e)}get modeChanged(){return this._modeChanged}get restored(){return this._restored.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:s.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e,h.TabBarSvg.translator=e;const t=e.load("jupyterlab");this._menuHandler.panel.node.setAttribute("aria-label",t.__("main menu")),this._leftHandler.sideBar.node.setAttribute("aria-label",t.__("main sidebar")),this._leftHandler.sideBar.contentNode.setAttribute("aria-label",t.__("main sidebar")),this._rightHandler.sideBar.node.setAttribute("aria-label",t.__("alternate sidebar")),this._rightHandler.sideBar.contentNode.setAttribute("aria-label",t.__("alternate sidebar"))}}get userLayout(){return u.JSONExt.deepCopy(this._userLayout)}activateById(e){if(this._leftHandler.has(e))return void this._leftHandler.activate(e);if(this._rightHandler.has(e))return void this._rightHandler.activate(e);const t=this._downPanel.tabBar.titles.findIndex((t=>t.owner.id===e));if(t>=0)return void(this._downPanel.currentIndex=t);const i=this._dockPanel,n=(0,f.find)(i.widgets(),(t=>t.id===e));n&&i.activateWidget(n)}activateArea(e="main"){switch(e){case"main":{const e=this._currentTabBar();if(!e)return;e.currentTitle&&e.currentTitle.owner.activate()}return;case"left":case"right":case"header":case"top":case"menu":case"bottom":console.debug(`Area: ${e} activation not yet implemented`);break;default:throw new Error(`Invalid area: ${e}`)}}activateNextTab(){const e=this._currentTabBar();if(!e)return;const t=e.currentIndex;if(-1!==t){if(t<e.titles.length-1)return e.currentIndex+=1,void(e.currentTitle&&e.currentTitle.owner.activate());if(t===e.titles.length-1){const e=this._adjacentBar("next");e&&(e.currentIndex=0,e.currentTitle&&e.currentTitle.owner.activate())}}}activatePreviousTab(){const e=this._currentTabBar();if(!e)return;const t=e.currentIndex;if(-1!==t){if(t>0)return e.currentIndex-=1,void(e.currentTitle&&e.currentTitle.owner.activate());if(0===t){const e=this._adjacentBar("previous");if(e){const t=e.titles.length;e.currentIndex=t-1,e.currentTitle&&e.currentTitle.owner.activate()}}}}activateNextTabBar(){const e=this._adjacentBar("next");e&&e.currentTitle&&e.currentTitle.owner.activate()}activatePreviousTabBar(){const e=this._adjacentBar("previous");e&&e.currentTitle&&e.currentTitle.owner.activate()}add(e,t="main",i){var n;if(!this._userLayout)return void this._delayedWidget.push({widget:e,area:t,options:i});let s;switch((null==i?void 0:i.type)&&this._userLayout[this.mode][i.type]?(s=this._userLayout[this.mode][i.type],this._idTypeMap.set(e.id,i.type)):s=this._userLayout[this.mode][e.id],(null==i?void 0:i.type)&&(this._idTypeMap.set(e.id,i.type),e.disposed.connect((()=>{this._idTypeMap.delete(e.id)}))),t=null!==(n=null==s?void 0:s.area)&&void 0!==n?n:t,i=i||(null==s?void 0:s.options)?{...i,...null==s?void 0:s.options}:void 0,t||"main"){case"bottom":return this._addToBottomArea(e,i);case"down":return this._addToDownArea(e,i);case"header":return this._addToHeaderArea(e,i);case"left":return this._addToLeftArea(e,i);case"main":return this._addToMainArea(e,i);case"menu":return this._addToMenuArea(e,i);case"right":return this._addToRightArea(e,i);case"top":return this._addToTopArea(e,i);default:throw new Error(`Invalid area: ${t}`)}}move(e,t,i){var n;const s=null!==(n=this._idTypeMap.get(e.id))&&void 0!==n?n:e.id;for(const e of["single-document","multiple-document"].filter((e=>!i||e===i)))this._userLayout[e][s]={...this._userLayout[e][s],area:t};return this.add(e,t),this._userLayout}collapseLeft(){this._leftHandler.collapse(),this._onLayoutModified()}collapseRight(){this._rightHandler.collapse(),this._onLayoutModified()}dispose(){this.isDisposed||(this._layoutDebouncer.dispose(),super.dispose())}expandLeft(){this._leftHandler.expand(),this._onLayoutModified()}expandRight(){this._rightHandler.expand(),this._onLayoutModified()}closeAll(){Array.from(this._dockPanel.widgets()).forEach((e=>e.close())),this._downPanel.stackedPanel.widgets.forEach((e=>e.close()))}isSideTabBarVisible(e){switch(e){case"left":return this._leftHandler.isVisible;case"right":return this._rightHandler.isVisible}}isTopInSimpleModeVisible(){return!this._topHandlerHiddenByUser}isEmpty(e){switch(e){case"bottom":return 0===this._bottomPanel.widgets.length;case"down":return 0===this._downPanel.stackedPanel.widgets.length;case"header":return 0===this._headerPanel.widgets.length;case"left":return 0===this._leftHandler.stackedPanel.widgets.length;case"main":return this._dockPanel.isEmpty;case"menu":return 0===this._menuHandler.panel.widgets.length;case"right":return 0===this._rightHandler.stackedPanel.widgets.length;case"top":return 0===this._topHandler.panel.widgets.length;default:return!0}}async restoreLayout(e,t,i={}){var n,s,a,r;this._userLayout={"single-document":null!==(n=i["single-document"])&&void 0!==n?n:{},"multiple-document":null!==(s=i["multiple-document"])&&void 0!==s?s:{}},this._delayedWidget.forEach((({widget:e,area:t,options:i})=>{this.add(e,t,i)})),this._delayedWidget.length=0,this._layoutRestorer=t;const o=await t.fetch(),{mainArea:d,downArea:l,leftArea:h,rightArea:c,topArea:u,relativeSizes:p}=o;if(d){const{currentWidget:t,dock:i}=d;i&&"multiple-document"===e&&this._dockPanel.restoreLayout(i),e&&(this.mode=e),t&&this.activateById(t.id)}else e&&(this.mode=e);if(void 0!==(null==u?void 0:u.simpleVisibility)&&(this._topHandlerHiddenByUser=!u.simpleVisibility,"single-document"===this.mode&&this._topHandler.panel.setHidden(this._topHandlerHiddenByUser)),l){const{currentWidget:e,widgets:t,size:i}=l,n=null!==(a=null==t?void 0:t.map((e=>e.id)))&&void 0!==a?a:[];this._downPanel.tabBar.titles.filter((e=>!n.includes(e.owner.id))).map((e=>e.owner.close()));const s=this._downPanel.tabBar.titles.map((e=>e.owner.id));for(null==t||t.filter((e=>!s.includes(e.id))).map((e=>this._downPanel.addWidget(e)));!f.ArrayExt.shallowEqual(n,this._downPanel.tabBar.titles.map((e=>e.owner.id)));)this._downPanel.tabBar.titles.forEach(((e,t)=>{const i=n.findIndex((t=>e.owner.id==t));i>=0&&i!=t&&this._downPanel.tabBar.insertTab(i,e)}));if(e){const t=this._downPanel.stackedPanel.widgets.findIndex((t=>t.id===e.id));t&&(this._downPanel.currentIndex=t,null===(r=this._downPanel.currentWidget)||void 0===r||r.activate())}i&&i>0?this._vsplitPanel.setRelativeSizes([1-i,i]):(this._downPanel.stackedPanel.widgets.forEach((e=>e.close())),this._downPanel.hide())}h?this._leftHandler.rehydrate(h):"single-document"===e&&this.collapseLeft(),c?this._rightHandler.rehydrate(c):"single-document"===e&&this.collapseRight(),p&&this._hsplitPanel.setRelativeSizes(p),this._isRestored||(v.MessageLoop.flush(),this._restored.resolve(o))}saveLayout(){return{mainArea:{currentWidget:this._tracker.currentWidget,dock:"single-document"===this.mode&&this._cachedLayout||this._dockPanel.saveLayout()},downArea:{currentWidget:this._downPanel.currentWidget,widgets:Array.from(this._downPanel.stackedPanel.widgets),size:this._vsplitPanel.relativeSizes()[1]},leftArea:this._leftHandler.dehydrate(),rightArea:this._rightHandler.dehydrate(),topArea:{simpleVisibility:!this._topHandlerHiddenByUser},relativeSizes:this._hsplitPanel.relativeSizes()}}toggleTopInSimpleModeVisibility(){"single-document"===this.mode&&(this._topHandler.panel.isVisible?(this._topHandlerHiddenByUser=!0,this._topHandler.panel.hide()):(this._topHandlerHiddenByUser=!1,this._topHandler.panel.show(),this._updateTitlePanelTitle()),this._onLayoutModified())}toggleSideTabBarVisibility(e){"right"===e?this._rightHandler.isVisible?this._rightHandler.hide():this._rightHandler.show():this._leftHandler.isVisible?this._leftHandler.hide():this._leftHandler.show()}updateConfig(e){if(e.hiddenMode)switch(e.hiddenMode){case"display":this._dockPanel.hiddenMode=w.Widget.HiddenMode.Display;break;case"scale":this._dockPanel.hiddenMode=w.Widget.HiddenMode.Scale;break;case"contentVisibility":this._dockPanel.hiddenMode=w.Widget.HiddenMode.ContentVisibility}}widgets(e){switch(null!=e?e:"main"){case"main":return this._dockPanel.widgets();case"left":return(0,f.map)(this._leftHandler.sideBar.titles,(e=>e.owner));case"right":return(0,f.map)(this._rightHandler.sideBar.titles,(e=>e.owner));case"header":return this._headerPanel.children();case"top":return this._topHandler.panel.children();case"menu":return this._menuHandler.panel.children();case"bottom":return this._bottomPanel.children();default:throw new Error(`Invalid area: ${e}`)}}onAfterAttach(e){this.node.dataset.shellMode=this.mode}_updateTitlePanelTitle(){let e=this.currentWidget;const t=this._titleHandler.inputElement;t.value=e?e.title.label:"",t.title=e?e.title.caption:""}_updateCurrentPath(){let e=this.currentWidget,t="";e&&e instanceof d.DocumentWidget&&(t=e.context.path),this._currentPathChanged.emit({newValue:t,oldValue:this._currentPath}),this._currentPath=t}_addToLeftArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");t=t||this._sideOptionsCache.get(e)||{},this._sideOptionsCache.set(e,t);const i="rank"in t?t.rank:C;this._leftHandler.addWidget(e,i),this._onLayoutModified()}_addToMainArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");t=t||{};const i=this._dockPanel,n=t.mode||"tab-after";let s=this.currentWidget;t.ref&&(s=(0,f.find)(i.widgets(),(e=>e.id===t.ref))||null);const{title:a}=e;a.dataset={...a.dataset,id:e.id},a.icon instanceof h.LabIcon?a.icon=a.icon.bindprops({stylesheet:"mainAreaTab"}):"string"!=typeof a.icon&&a.icon||(a.iconClass=(0,h.classes)(a.iconClass,"jp-Icon")),i.addWidget(e,{mode:n,ref:s}),"single-document"===i.mode&&this._mainOptionsCache.set(e,t),!1!==t.activate&&i.activateWidget(e)}_addToRightArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");const i="rank"in(t=t||this._sideOptionsCache.get(e)||{})?t.rank:C;this._sideOptionsCache.set(e,t),this._rightHandler.addWidget(e,i),this._onLayoutModified()}_addToTopArea(e,t){var i;if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");const n=null!==(i=(t=t||{}).rank)&&void 0!==i?i:C;this._topHandler.addWidget(e,n),this._onLayoutModified(),this._topHandler.panel.isHidden&&this._topHandler.panel.show()}_addToMenuArea(e,t){var i;if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");const n=null!==(i=(t=t||{}).rank)&&void 0!==i?i:C;this._menuHandler.addWidget(e,n),this._onLayoutModified(),this._menuHandler.panel.isHidden&&this._menuHandler.panel.show()}_addToHeaderArea(e,t){e.id?(this._headerPanel.addWidget(e),this._onLayoutModified(),this._headerPanel.isHidden&&this._headerPanel.show()):console.error("Widgets added to app shell must have unique id property.")}_addToBottomArea(e,t){e.id?(this._bottomPanel.addWidget(e),this._onLayoutModified(),this._bottomPanel.isHidden&&this._bottomPanel.show()):console.error("Widgets added to app shell must have unique id property.")}_addToDownArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");t=t||{};const{title:i}=e;i.dataset={...i.dataset,id:e.id},i.icon instanceof h.LabIcon?i.icon=i.icon.bindprops({stylesheet:"mainAreaTab"}):"string"!=typeof i.icon&&i.icon||(i.iconClass=(0,h.classes)(i.iconClass,"jp-Icon")),this._downPanel.addWidget(e),this._onLayoutModified(),this._downPanel.isHidden&&this._downPanel.show()}_adjacentBar(e){const t=this._currentTabBar();if(!t)return null;const i=Array.from(this._dockPanel.tabBars()),n=i.length,s=i.indexOf(t);return"previous"===e?s>0?i[s-1]:0===s?i[n-1]:null:s<n-1?i[s+1]:s===n-1?i[0]:null}_currentTabBar(){const e=this._tracker.currentWidget;if(!e)return null;const t=e.title,i=this._dockPanel.tabBars();return(0,f.find)(i,(e=>e.titles.indexOf(t)>-1))||null}_onActiveChanged(e,t){t.newValue&&(t.newValue.title.className+=` ${k}`),t.oldValue&&(t.oldValue.title.className=t.oldValue.title.className.replace(k,"")),this._activeChanged.emit(t)}_onCurrentChanged(e,t){t.newValue&&(t.newValue.title.className+=` ${P}`),t.oldValue&&(t.oldValue.title.className=t.oldValue.title.className.replace(P,"")),this._currentChanged.emit(t),this._onLayoutModified()}_onTabPanelChanged(){0===this._downPanel.stackedPanel.widgets.length&&this._downPanel.hide(),this._onLayoutModified()}_onLayoutModified(){this._layoutDebouncer.invoke()}}var L;!function(e){e.itemCmp=function(e,t){return e.rank-t.rank},e.normalizeAreaConfig=function e(t,i){i&&("tab-area"!==i.type?i.children.forEach((i=>{e(t,i)})):i.widgets=i.widgets.filter((e=>!e.isDisposed&&e.parent===t)))},e.PanelHandler=class{constructor(){this._panelChildHook=(e,t)=>{switch(t.type){case"child-added":{const e=t.child;if(this._items.find((t=>t.widget===e)))break;const i=this._items[this._items.length-1].rank;this._items.push({widget:e,rank:i})}break;case"child-removed":{const e=t.child;f.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}}return!0},this._items=new Array,this._panel=new w.Panel,v.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(t,i){t.parent=null;const n={widget:t,rank:i},s=f.ArrayExt.upperBound(this._items,n,e.itemCmp);f.ArrayExt.insert(this._items,s,n),this._panel.insertWidget(s,t)}},e.SideBarHandler=class{constructor(){this._isHiddenByUser=!1,this._items=new Array,this._updated=new p.Signal(this),this._sideBar=new w.TabBar({insertBehavior:"none",removeBehavior:"none",allowDeselect:!0,orientation:"vertical"}),this._stackedPanel=new w.StackedPanel,this._sideBar.hide(),this._stackedPanel.hide(),this._lastCurrent=null,this._sideBar.currentChanged.connect(this._onCurrentChanged,this),this._sideBar.tabActivateRequested.connect(this._onTabActivateRequested,this),this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved,this)}get isVisible(){return this._sideBar.isVisible}get sideBar(){return this._sideBar}get stackedPanel(){return this._stackedPanel}get updated(){return this._updated}_onHandleMoved(){return this._refreshVisibility()}_onExpansionToggle(e,t){return this._refreshVisibility()}expand(){const e=this._lastCurrent||this._items.length>0&&this._items[0].widget;e&&this.activate(e.id)}activate(e){const t=this._findWidgetByID(e);t&&(this._sideBar.currentTitle=t.title,t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){this._sideBar.currentTitle=null}addWidget(e,t){var i,n,s,a;e.parent=null,e.hide();const r={widget:e,rank:t},o=this._findInsertIndex(r);f.ArrayExt.insert(this._items,o,r),this._stackedPanel.insertWidget(o,e);const d=this._sideBar.insertTab(o,e.title);d.dataset={id:e.id},d.icon instanceof h.LabIcon?d.icon=d.icon.bindprops({stylesheet:"sideBar"}):"string"==typeof d.icon&&""!=d.icon?d.iconClass=(0,h.classes)(d.iconClass,"jp-Icon","jp-Icon-20"):d.icon||d.label||(d.icon=h.tabIcon.bindprops({stylesheet:"sideBar"})),null===(n=null===(i=e.content)||void 0===i?void 0:i.expansionToggled)||void 0===n||n.connect(this._onExpansionToggle,this),null===(a=null===(s=e.content)||void 0===s?void 0:s.handleMoved)||void 0===a||a.connect(this._onHandleMoved,this),this._refreshVisibility()}dehydrate(){const e=null===this._sideBar.currentTitle,t=Array.from(this._stackedPanel.widgets),i=t[this._sideBar.currentIndex],n={};return this._stackedPanel.widgets.forEach((e=>{e.id&&e.content instanceof w.SplitPanel&&(n[e.id]={sizes:e.content.relativeSizes(),expansionStates:e.content.widgets.map((e=>e.isVisible))})})),{collapsed:e,currentWidget:i,visible:!this._isHiddenByUser,widgets:t,widgetStates:n}}rehydrate(e){e.currentWidget&&this.activate(e.currentWidget.id),e.collapsed&&this.collapse(),e.visible||this.hide(),e.widgetStates&&this._stackedPanel.widgets.forEach((t=>{var i;if(t.id&&t.content instanceof w.SplitPanel){const n=null!==(i=e.widgetStates[t.id])&&void 0!==i?i:{};t.content.widgets.forEach(((e,i)=>{var s;const a=(null!==(s=n.expansionStates)&&void 0!==s?s:[])[i];"boolean"==typeof a&&t.content instanceof w.AccordionPanel&&(a?t.content.expand(i):t.content.collapse(i))})),n.sizes&&t.content.setRelativeSizes(n.sizes)}}))}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(t){return f.ArrayExt.upperBound(this._items,t,e.itemCmp)}_findWidgetIndex(e){return f.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByTitle(e){const t=(0,f.find)(this._items,(t=>t.widget.title===e));return t?t.widget:null}_findWidgetByID(e){const t=(0,f.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._stackedPanel.setHidden(null===this._sideBar.currentTitle),this._sideBar.setHidden(this._isHiddenByUser||0===this._sideBar.titles.length),this._updated.emit()}_onCurrentChanged(e,t){const i=t.previousTitle?this._findWidgetByTitle(t.previousTitle):null,n=t.currentTitle?this._findWidgetByTitle(t.currentTitle):null;i&&i.hide(),n&&n.show(),this._lastCurrent=n||i,this._refreshVisibility()}_onTabActivateRequested(e,t){t.title.owner.activate()}_onWidgetRemoved(e,t){t===this._lastCurrent&&(this._lastCurrent=null),f.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._sideBar.removeTab(t.title),this._refreshVisibility()}};class t extends w.Widget{constructor(e){super(),this.addClass("jp-skiplink"),this.id="jp-skiplink",this._shell=e,this._createSkipLink("Skip to main panel","main")}handleEvent(e){var t,i;"click"===e.type&&e.target instanceof HTMLElement&&this._shell.activateArea(null===(i=null===(t=e.target)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.targetarea)}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this)}onBeforeDetach(e){this.node.removeEventListener("click",this),super.onBeforeDetach(e)}_createSkipLink(e,t){const i=document.createElement("a");i.href="#",i.tabIndex=0,i.text=e,i.className="skip-link",i.dataset.targetarea=t,this.node.appendChild(i)}}e.SkipLinkWidget=t;class i extends w.Widget{constructor(e){super(),this._selected=!1;const t=document.createElement("input");t.type="text",this.node.appendChild(t),this._shell=e,this.id="jp-title-panel-title"}onAfterAttach(e){super.onAfterAttach(e),this.inputElement.addEventListener("keyup",this),this.inputElement.addEventListener("click",this),this.inputElement.addEventListener("blur",this)}onBeforeDetach(e){super.onBeforeDetach(e),this.inputElement.removeEventListener("keyup",this),this.inputElement.removeEventListener("click",this),this.inputElement.removeEventListener("blur",this)}handleEvent(e){switch(e.type){case"keyup":this._evtKeyUp(e);break;case"click":this._evtClick(e);break;case"blur":this._selected=!1}}async _evtKeyUp(e){if("Enter"==e.key){const e=this._shell.currentWidget;if(null==e)return;const t=e.title.label,i=this.inputElement,n=i.value;i.blur(),n!==t?e.title.label=n:i.value=t}}_evtClick(e){if(0!==e.button||this._selected)return;const t=this.inputElement;e.preventDefault(),e.stopPropagation(),this._selected=!0;const i=t.value.indexOf(".");-1===i?t.select():t.setSelectionRange(0,i)}get inputElement(){return this.node.children[0]}}e.TitleHandler=i;class n extends w.SplitPanel{constructor(e={}){super(e),this.updated=new p.Signal(this)}onUpdateRequest(e){super.onUpdateRequest(e),this.updated.emit()}}e.RestorableSplitPanel=n}(L||(L={}));var A,M=i(20389);class x extends g{constructor(e={shell:new H}){super({...e,shell:e.shell||new H,serviceManager:e.serviceManager||new l.ServiceManager({standby:()=>!this._info.isConnected||"when-hidden"})}),this.name=_.PageConfig.getOption("appName")||"JupyterLab",this.namespace=_.PageConfig.getOption("appNamespace")||this.name,this.registerPluginErrors=[],this.status=new M.J(this),this.version=_.PageConfig.getOption("appVersion")||"unknown",this._info=x.defaultInfo,this._allPluginsActivated=new u.PromiseDelegate;const t=Object.keys(x.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...x.defaultInfo,...t},this.restored=this.shell.restored.then((async()=>{const e=[],t=this.activateDeferredPlugins().catch((e=>{console.error("Error when activating deferred plugins\n:",e)}));if(e.push(t),this._info.deferred){const t=Promise.all(this._info.deferred.matches.map((e=>this.activatePlugin(e)))).catch((e=>{console.error("Error when activating customized list of deferred plugins:\n",e)}));e.push(t)}Promise.all(e).then((()=>{this._allPluginsActivated.resolve()})).catch((()=>{}))})).catch((()=>{}));const i=x.defaultPaths.urls,n=x.defaultPaths.directories,s=e.paths&&e.paths.urls||{},a=e.paths&&e.paths.directories||{};if(this._paths={urls:Object.keys(i).reduce(((e,t)=>{if(t in s){const i=s[t];e[t]=i}else e[t]=i[t];return e}),{}),directories:Object.keys(x.defaultPaths.directories).reduce(((e,t)=>{if(t in a){const i=a[t];e[t]=i}else e[t]=n[t];return e}),{})},this._info.devMode&&this.shell.addClass("jp-mod-devMode"),this.docRegistry.addModelFactory(new d.Base64ModelFactory),e.mimeExtensions)for(const t of(0,m.as)(e.mimeExtensions))this.registerPlugin(t)}get info(){return this._info}get paths(){return this._paths}get allPluginsActivated(){return this._allPluginsActivated.promise}registerPluginModule(e){let t=e.default;e.hasOwnProperty("__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){this.registerPluginErrors.push(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}evtKeydown(e){const t=new u.PromiseDelegate;this.commands.holdKeyBindingExecution(e,t.promise),this.commands.processKeydownEvent(e);const i=e.target;if(!i)return t.resolve(!0);let n=null,s=null;const a=()=>{n&&i.removeEventListener("beforeinput",n),s&&i.removeEventListener("keyup",s)};Promise.race([new Promise((e=>{n=t=>{switch(t.inputType){case"historyUndo":case"historyRedo":if(t.target instanceof Element&&t.target.closest("[data-jp-undoer]"))return t.preventDefault(),a(),e(!1);break;case"insertLineBreak":if(t.target instanceof Element&&t.target.closest(".jp-Cell"))return t.preventDefault(),a(),e(!1)}return a(),e(!0)},i.addEventListener("beforeinput",n,{once:!0})})),new Promise((t=>{s=i=>{if(i.code===e.code)return a(),t(!1)},i.addEventListener("keyup",s,{once:!0})})),new Promise((e=>{setTimeout((()=>(a(),e(!1))),A.INPUT_GUARD_TIMEOUT)}))]).then((e=>{t.resolve(!e)})).catch(console.warn)}}!function(e){e.IInfo=new u.Token("@jupyterlab/application:IInfo","A service providing metadata about the current application, including disabled extensions and whether dev mode is enabled."),e.defaultInfo={devMode:"true"===_.PageConfig.getOption("devMode").toLowerCase(),deferred:{patterns:[],matches:[]},disabled:{patterns:[],matches:[]},mimeExtensions:[],availablePlugins:[],filesCached:"true"===_.PageConfig.getOption("cacheFiles").toLowerCase(),isConnected:!0},e.defaultPaths={urls:{base:_.PageConfig.getOption("baseUrl"),notFound:_.PageConfig.getOption("notFoundUrl"),app:_.PageConfig.getOption("appUrl"),doc:_.PageConfig.getOption("docUrl"),static:_.PageConfig.getOption("staticUrl"),settings:_.PageConfig.getOption("settingsUrl"),themes:_.PageConfig.getOption("themesUrl"),translations:_.PageConfig.getOption("translationsApiUrl"),hubHost:_.PageConfig.getOption("hubHost")||void 0,hubPrefix:_.PageConfig.getOption("hubPrefix")||void 0,hubUser:_.PageConfig.getOption("hubUser")||void 0,hubServerName:_.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:_.PageConfig.getOption("appSettingsDir"),schemas:_.PageConfig.getOption("schemasDir"),static:_.PageConfig.getOption("staticDir"),templates:_.PageConfig.getOption("templatesDir"),themes:_.PageConfig.getOption("themesDir"),userSettings:_.PageConfig.getOption("userSettingsDir"),serverRoot:_.PageConfig.getOption("serverRoot"),workspaces:_.PageConfig.getOption("workspacesDir")}}}(x||(x={})),function(e){e.INPUT_GUARD_TIMEOUT=10}(A||(A={}));var E=i(67863),W=i(2549);class S{constructor(e){this.stop=new u.Token("@jupyterlab/application:Router#stop"),this._routed=new p.Signal(this),this._rules=new Map,this.base=e.base,this.commands=e.commands}get current(){var e,t;const{base:i}=this,n=_.URLExt.parse(window.location.href),{search:s,hash:a}=n,r=null!==(t=null===(e=n.pathname)||void 0===e?void 0:e.replace(i,"/"))&&void 0!==t?t:"";return{hash:a,path:r,request:r+s+a,search:s}}get routed(){return this._routed}navigate(e,t={}){const{base:i}=this,{history:n}=window,{hard:s}=t,a=document.location.href,r=e&&0===e.indexOf(i)?e:_.URLExt.join(i,e);return r===a?s?this.reload():void 0:(n.pushState({},"",r),s?this.reload():void(t.skipRouting||requestAnimationFrame((()=>{this.route()}))))}register(e){var t;const{command:i,pattern:n}=e,s=null!==(t=e.rank)&&void 0!==t?t:100,a=this._rules;return a.set(n,{command:i,rank:s}),new W.DisposableDelegate((()=>{a.delete(n)}))}reload(){window.location.reload()}route(){const{commands:e,current:t,stop:i}=this,{request:n}=t,s=this._routed,a=this._rules,r=[];a.forEach(((e,t)=>{(null==n?void 0:n.match(t))&&r.push(e)}));const o=r.sort(((e,t)=>t.rank-e.rank)),d=new u.PromiseDelegate,l=async()=>{if(!o.length)return s.emit(t),void d.resolve(void 0);const{command:a}=o.pop();try{const n=this.current.request;await e.execute(a,t)===i&&(o.length=0,console.debug(`Routing ${n} was short-circuited by ${a}`))}catch(e){console.warn(`Routing ${n} to ${a} failed`,e)}l()};return l(),d.promise}}const I=new u.Token("@jupyterlab/application:IConnectionLost",'A service for invoking the dialog shown\n when JupyterLab has lost its connection to the server. Use this if, for some reason,\n you want to bring up the "connection lost" dialog under new circumstances.'),R=new u.Token("@jupyterlab/application:ILabStatus",'A service for interacting with the application busy/dirty\n status. Use this if you want to set the application "busy" favicon, or to set\n the application "dirty" status, which asks the user for confirmation before leaving the application page.'),j=new u.Token("@jupyterlab/application:IRouter","The URL router used by the application. Use this to add custom URL-routing for your extension (e.g., to invoke a command if the user navigates to a sub-path)."),U=new u.Token("@jupyterlab/application:ITreePathUpdater","A service to update the tree path.");function O(e){const{id:t,commands:i,shell:n,semanticCommands:a,default:r,overrides:o,trans:d}=e;i.addCommand(t,{...D({commands:i,shell:n},a,null!=r?r:{},null!=d?d:s.nullTranslator.load("jupyterlab")),...o});const l=Array.isArray(a)?a:[a],h=(e,i)=>{if(i.id)if(i.id===t&&"removed"===i.type)e.commandChanged.disconnect(h);else if(l.reduce(((e,t)=>e.concat(t.ids)),[]).includes(i.id))switch(i.type){case"changed":case"many-changed":e.notifyCommandChanged(t);break;case"removed":for(const e of l)e.remove(i.id)}};i.commandChanged.connect(h)}function D(e,t,i,n){const{commands:s,shell:a}=e,r=Array.isArray(t)?t:[t];return{label:d("label"),caption:d("caption"),isEnabled:()=>{var e;const t=o("isEnabled");return t.length>0&&!t.some((e=>!1===e))||null!==(e=i.isEnabled)&&void 0!==e&&e},isToggled:()=>{var e;return o("isToggled").some((e=>!0===e))||null!==(e=i.isToggled)&&void 0!==e&&e},isVisible:()=>{var e;const t=o("isVisible");return t.length>0&&!t.some((e=>!1===e))||null===(e=i.isVisible)||void 0===e||e},execute:async()=>{const e=a.currentWidget,t=r.map((t=>null!==e?t.getActiveCommandId(e):null)).filter((e=>null!==e&&s.isEnabled(e)));let n=null;if(t.length>0){for(const e of t)if(n=await s.execute(e),"boolean"==typeof n&&!1===n)break}else i.execute&&(n=await s.execute(i.execute));return n}};function o(e){const t=a.currentWidget;return r.map((e=>null!==t?e.getActiveCommandId(t):null)).filter((e=>null!==e)).map((t=>s[e](t)))}function d(e){return()=>{var t;const s=o(e).map(((t,i)=>"caption"==e&&i>0?t.toLocaleLowerCase():t));switch(s.length){case 0:return null!==(t=i[e])&&void 0!==t?t:"";case 1:return s[0];default:{const e=s.some((e=>/…$/.test(e))),t=s.slice(void 0,-1).map((e=>e.replace(/…$/,""))).join(", "),i=s.slice(-1)[0].replace(/…$/,"")+(e?"…":"");return n.__("%1 and %2",t,i)}}}}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6853],{76853:(e,t,i)=>{i.r(t),i.d(t,{ConnectionLost:()=>a,IConnectionLost:()=>I,ILabShell:()=>B,ILabStatus:()=>R,ILayoutRestorer:()=>E.L,IMimeDocumentTracker:()=>m.w2,IRouter:()=>j,ITreePathUpdater:()=>U,JupyterFrontEnd:()=>g,JupyterFrontEndContextMenu:()=>o,JupyterLab:()=>x,LabShell:()=>H,LabStatus:()=>M.J,LayoutRestorer:()=>E.c,Router:()=>S,addSemanticCommand:()=>O,createRendermimePlugin:()=>m.aX,createRendermimePlugins:()=>m.as,createSemanticCommand:()=>D});var n=i(20005),s=i(90646);const a=async function(e,t,i){const a=(i=i||s.nullTranslator).load("jupyterlab"),r=a.__("Server Connection Error"),o=a.__("A connection to the Jupyter server could not be established.\nJupyterLab will continue trying to reconnect.\nCheck your network connection or Jupyter server configuration.\n");return(0,n.showErrorMessage)(r,{message:o})};var r,o,d=i(87973),l=i(50558),h=i(14576),c=i(34771),u=i(20998),p=i(81997);class g extends c.Application{constructor(e){super(e),this._formatChanged=new p.Signal(this),this.contextMenu=new h.ContextMenuSvg({commands:this.commands,renderer:e.contextMenuRenderer,groupByTarget:!1,sortBySelector:!1});const t=new Promise((e=>{requestAnimationFrame((()=>{e()}))}));this.commandLinker=e.commandLinker||new n.CommandLinker({commands:this.commands}),this.docRegistry=e.docRegistry||new d.DocumentRegistry,this.restored=e.restored||this.started.then((()=>t)).catch((()=>t)),this.serviceManager=e.serviceManager||new l.ServiceManager}get format(){return this._format}set format(e){this._format!==e&&(this._format=e,document.body.dataset.format=e,this._formatChanged.emit(e))}get formatChanged(){return this._formatChanged}contextMenuHitTest(e){if(!(this._contextMenuEvent&&this._contextMenuEvent.target instanceof Node))return;let t=this._contextMenuEvent.target;do{if(t instanceof HTMLElement&&e(t))return t;t=t.parentNode}while(t&&t.parentNode&&t!==t.parentNode)}evtContextMenu(e){if(this._contextMenuEvent=e,!e.shiftKey&&!r.suppressContextMenu(e.target)&&this.contextMenu.open(e)){const t=this.contextMenu.menu.items;if(1===t.length&&t[0].command===o.contextMenu)return void this.contextMenu.menu.close();e.preventDefault(),e.stopPropagation()}}}!function(e){e.inDocMode=function(e,t){const i=new RegExp(`^${t.urls.doc}`);return!!e.match(i)},e.IPaths=new u.Token("@jupyterlab/application:IPaths","A service providing information about various\n URLs and server paths for the current application. Use this service if you want to\n assemble URLs to use the JupyterLab REST API."),e.ITreeResolver=new u.Token("@jupyterlab/application:ITreeResolver","A service to resolve the tree path.")}(g||(g={})),function(e){e.suppressContextMenu=function(e){return null!==e.closest("[data-jp-suppress-context-menu]")}}(r||(r={})),function(e){e.contextMenu="__internal:context-menu-info"}(o||(o={}));var _=i(64145),m=i(75677),f=i(33625),v=i(49503),y=i(97934),w=i(63485);const b="jp-SideBar",P="jp-mod-current",k="jp-mod-active",C=900,T="jp-Activity",B=new u.Token("@jupyterlab/application:ILabShell","A service for interacting with the JupyterLab shell. The top-level ``application`` object also has a reference to the shell, but it has a restricted interface in order to be agnostic to different shell implementations on the application. Use this to get more detailed information about currently active widgets and layout state.");class H extends w.Widget{constructor(e){super(),this._dockChildHook=(e,t)=>{switch(t.type){case"child-added":t.child.addClass(T),this._tracker.add(t.child);break;case"child-removed":t.child.removeClass(T),this._tracker.remove(t.child)}return!0},this._activeChanged=new p.Signal(this),this._cachedLayout=null,this._currentChanged=new p.Signal(this),this._currentPath="",this._currentPathChanged=new p.Signal(this),this._modeChanged=new p.Signal(this),this._isRestored=!1,this._layoutModified=new p.Signal(this),this._layoutDebouncer=new y.Debouncer((()=>{this._layoutModified.emit(void 0)}),0),this._restored=new u.PromiseDelegate,this._tracker=new w.FocusTracker,this._topHandlerHiddenByUser=!1,this._idTypeMap=new Map,this._mainOptionsCache=new Map,this._sideOptionsCache=new Map,this._delayedWidget=new Array,this.addClass("jp-LabShell"),this.id="main",!1===(null==e?void 0:e.waitForRestore)&&(this._userLayout={"multiple-document":{},"single-document":{}});const t=this._skipLinkWidget=new L.SkipLinkWidget(this);this._skipLinkWidget.show();const i=new w.Panel;i.addClass("jp-skiplink-wrapper"),i.addWidget(t);const n=this._headerPanel=new w.BoxPanel,a=this._menuHandler=new L.PanelHandler;a.panel.node.setAttribute("role","navigation");const r=this._topHandler=new L.PanelHandler;r.panel.node.setAttribute("role","banner");const o=this._bottomPanel=new w.BoxPanel;o.node.setAttribute("role","contentinfo");const l=new w.BoxPanel,c=this._vsplitPanel=new L.RestorableSplitPanel,g=this._dockPanel=new h.DockPanelSvg({hiddenMode:w.Widget.HiddenMode.Display});v.MessageLoop.installMessageHook(g,this._dockChildHook);const _=this._hsplitPanel=new L.RestorableSplitPanel,m=this._downPanel=new h.TabPanelSvg({tabsMovable:!0}),f=this._leftHandler=new L.SideBarHandler,P=this._rightHandler=new L.SideBarHandler,k=new w.BoxLayout;n.id="jp-header-panel",a.panel.id="jp-menu-panel",r.panel.id="jp-top-panel",o.id="jp-bottom-panel",l.id="jp-main-content-panel",c.id="jp-main-vsplit-panel",g.id="jp-main-dock-panel",_.id="jp-main-split-panel",m.id="jp-down-stack",f.sideBar.addClass(b),f.sideBar.addClass("jp-mod-left"),f.sideBar.node.setAttribute("role","complementary"),f.stackedPanel.id="jp-left-stack",P.sideBar.addClass(b),P.sideBar.addClass("jp-mod-right"),P.sideBar.node.setAttribute("role","complementary"),P.stackedPanel.id="jp-right-stack",g.node.setAttribute("role","main"),l.spacing=0,c.spacing=1,g.spacing=5,_.spacing=1,n.direction="top-to-bottom",c.orientation="vertical",l.direction="left-to-right",_.orientation="horizontal",o.direction="bottom-to-top",w.SplitPanel.setStretch(f.stackedPanel,0),w.SplitPanel.setStretch(m,0),w.SplitPanel.setStretch(g,1),w.SplitPanel.setStretch(P.stackedPanel,0),w.BoxPanel.setStretch(f.sideBar,0),w.BoxPanel.setStretch(_,1),w.BoxPanel.setStretch(P.sideBar,0),w.SplitPanel.setStretch(c,1),_.addWidget(f.stackedPanel),_.addWidget(g),_.addWidget(P.stackedPanel),c.addWidget(_),c.addWidget(m),l.addWidget(f.sideBar),l.addWidget(c),l.addWidget(P.sideBar),k.direction="top-to-bottom",k.spacing=0,c.setRelativeSizes([3,1]),_.setRelativeSizes([1,2.5,1]),w.BoxLayout.setStretch(n,0),w.BoxLayout.setStretch(a.panel,0),w.BoxLayout.setStretch(r.panel,0),w.BoxLayout.setStretch(l,1),w.BoxLayout.setStretch(o,0),k.addWidget(i),k.addWidget(n),k.addWidget(r.panel),k.addWidget(l),k.addWidget(o),this._headerPanel.hide(),this._bottomPanel.hide(),this._downPanel.hide(),this.layout=k,this._tracker.currentChanged.connect(this._onCurrentChanged,this),this._tracker.activeChanged.connect(this._onActiveChanged,this),this._dockPanel.layoutModified.connect(this._onLayoutModified,this),this._vsplitPanel.updated.connect(this._onLayoutModified,this),this._downPanel.currentChanged.connect(this._onLayoutModified,this),this._downPanel.tabBar.tabMoved.connect(this._onTabPanelChanged,this),this._downPanel.stackedPanel.widgetRemoved.connect(this._onTabPanelChanged,this),this._leftHandler.updated.connect(this._onLayoutModified,this),this._rightHandler.updated.connect(this._onLayoutModified,this),this._hsplitPanel.updated.connect(this._onLayoutModified,this);const C=this._titleHandler=new L.TitleHandler(this);this.add(C,"top",{rank:100}),"multiple-document"===this._dockPanel.mode?(this._topHandler.addWidget(this._menuHandler.panel,100),C.hide()):k.insertWidget(3,this._menuHandler.panel),this.translator=s.nullTranslator,this.currentChanged.connect(((e,t)=>{let i=t.newValue,n=t.oldValue;n&&(n.title.changed.disconnect(this._updateTitlePanelTitle,this),n instanceof d.DocumentWidget&&n.context.pathChanged.disconnect(this._updateCurrentPath,this)),i&&(i.title.changed.connect(this._updateTitlePanelTitle,this),this._updateTitlePanelTitle(),i instanceof d.DocumentWidget&&i.context.pathChanged.connect(this._updateCurrentPath,this)),this._updateCurrentPath()}))}get activeChanged(){return this._activeChanged}get activeWidget(){return this._tracker.activeWidget}get addButtonEnabled(){return this._dockPanel.addButtonEnabled}set addButtonEnabled(e){this._dockPanel.addButtonEnabled=e}get addRequested(){return this._dockPanel.addRequested}get currentChanged(){return this._currentChanged}get currentPath(){return this._currentPath}get currentPathChanged(){return this._currentPathChanged}get currentWidget(){return this._tracker.currentWidget}get layoutModified(){return this._layoutModified}get leftCollapsed(){return!this._leftHandler.sideBar.currentTitle}get rightCollapsed(){return!this._rightHandler.sideBar.currentTitle}get presentationMode(){return this.hasClass("jp-mod-presentationMode")}set presentationMode(e){this.toggleClass("jp-mod-presentationMode",e)}get mode(){return this._dockPanel.mode}set mode(e){const t=this._dockPanel;if(e===t.mode)return;const i=this.currentWidget;if("single-document"===e)this._cachedLayout=t.saveLayout(),t.mode=e,this.currentWidget&&t.activateWidget(this.currentWidget),this.layout.insertWidget(3,this._menuHandler.panel),this._titleHandler.show(),this._updateTitlePanelTitle(),this._topHandlerHiddenByUser&&this._topHandler.panel.hide();else{const n=Array.from(t.widgets());t.mode=e,this._cachedLayout&&(L.normalizeAreaConfig(t,this._cachedLayout.main),t.restoreLayout(this._cachedLayout),this._cachedLayout=null),this._layoutRestorer.isDeferred&&this._layoutRestorer.restoreDeferred().then((e=>{if(e){const{currentWidget:t,dock:i}=e;i&&this._dockPanel.restoreLayout(i),t&&this.activateById(t.id)}})).catch((e=>{console.error("Failed to restore the deferred layout."),console.error(e)})),n.forEach((e=>{e.parent||this._addToMainArea(e,{...this._mainOptionsCache.get(e),activate:!1})})),this._mainOptionsCache.clear(),i&&t.activateWidget(i),this.add(this._menuHandler.panel,"top",{rank:100}),this._titleHandler.hide()}this.node.dataset.shellMode=e,this._downPanel.fit(),this._modeChanged.emit(e)}get modeChanged(){return this._modeChanged}get restored(){return this._restored.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:s.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e,h.TabBarSvg.translator=e;const t=e.load("jupyterlab");this._menuHandler.panel.node.setAttribute("aria-label",t.__("main menu")),this._leftHandler.sideBar.node.setAttribute("aria-label",t.__("main sidebar")),this._leftHandler.sideBar.contentNode.setAttribute("aria-label",t.__("main sidebar")),this._rightHandler.sideBar.node.setAttribute("aria-label",t.__("alternate sidebar")),this._rightHandler.sideBar.contentNode.setAttribute("aria-label",t.__("alternate sidebar"))}}get userLayout(){return u.JSONExt.deepCopy(this._userLayout)}activateById(e){if(this._leftHandler.has(e))return void this._leftHandler.activate(e);if(this._rightHandler.has(e))return void this._rightHandler.activate(e);const t=this._downPanel.tabBar.titles.findIndex((t=>t.owner.id===e));if(t>=0)return void(this._downPanel.currentIndex=t);const i=this._dockPanel,n=(0,f.find)(i.widgets(),(t=>t.id===e));n&&i.activateWidget(n)}activateArea(e="main"){switch(e){case"main":{const e=this._currentTabBar();if(!e)return;e.currentTitle&&e.currentTitle.owner.activate()}return;case"left":case"right":case"header":case"top":case"menu":case"bottom":console.debug(`Area: ${e} activation not yet implemented`);break;default:throw new Error(`Invalid area: ${e}`)}}activateNextTab(){const e=this._currentTabBar();if(!e)return;const t=e.currentIndex;if(-1!==t){if(t<e.titles.length-1)return e.currentIndex+=1,void(e.currentTitle&&e.currentTitle.owner.activate());if(t===e.titles.length-1){const e=this._adjacentBar("next");e&&(e.currentIndex=0,e.currentTitle&&e.currentTitle.owner.activate())}}}activatePreviousTab(){const e=this._currentTabBar();if(!e)return;const t=e.currentIndex;if(-1!==t){if(t>0)return e.currentIndex-=1,void(e.currentTitle&&e.currentTitle.owner.activate());if(0===t){const e=this._adjacentBar("previous");if(e){const t=e.titles.length;e.currentIndex=t-1,e.currentTitle&&e.currentTitle.owner.activate()}}}}activateNextTabBar(){const e=this._adjacentBar("next");e&&e.currentTitle&&e.currentTitle.owner.activate()}activatePreviousTabBar(){const e=this._adjacentBar("previous");e&&e.currentTitle&&e.currentTitle.owner.activate()}add(e,t="main",i){var n;if(!this._userLayout)return void this._delayedWidget.push({widget:e,area:t,options:i});let s;switch((null==i?void 0:i.type)&&this._userLayout[this.mode][i.type]?(s=this._userLayout[this.mode][i.type],this._idTypeMap.set(e.id,i.type)):s=this._userLayout[this.mode][e.id],(null==i?void 0:i.type)&&(this._idTypeMap.set(e.id,i.type),e.disposed.connect((()=>{this._idTypeMap.delete(e.id)}))),t=null!==(n=null==s?void 0:s.area)&&void 0!==n?n:t,i=i||(null==s?void 0:s.options)?{...i,...null==s?void 0:s.options}:void 0,t||"main"){case"bottom":return this._addToBottomArea(e,i);case"down":return this._addToDownArea(e,i);case"header":return this._addToHeaderArea(e,i);case"left":return this._addToLeftArea(e,i);case"main":return this._addToMainArea(e,i);case"menu":return this._addToMenuArea(e,i);case"right":return this._addToRightArea(e,i);case"top":return this._addToTopArea(e,i);default:throw new Error(`Invalid area: ${t}`)}}move(e,t,i){var n;const s=null!==(n=this._idTypeMap.get(e.id))&&void 0!==n?n:e.id;for(const e of["single-document","multiple-document"].filter((e=>!i||e===i)))this._userLayout[e][s]={...this._userLayout[e][s],area:t};return this.add(e,t),this._userLayout}collapseLeft(){this._leftHandler.collapse(),this._onLayoutModified()}collapseRight(){this._rightHandler.collapse(),this._onLayoutModified()}dispose(){this.isDisposed||(this._layoutDebouncer.dispose(),super.dispose())}expandLeft(){this._leftHandler.expand(),this._onLayoutModified()}expandRight(){this._rightHandler.expand(),this._onLayoutModified()}closeAll(){Array.from(this._dockPanel.widgets()).forEach((e=>e.close())),this._downPanel.stackedPanel.widgets.forEach((e=>e.close()))}isSideTabBarVisible(e){switch(e){case"left":return this._leftHandler.isVisible;case"right":return this._rightHandler.isVisible}}isTopInSimpleModeVisible(){return!this._topHandlerHiddenByUser}isEmpty(e){switch(e){case"bottom":return 0===this._bottomPanel.widgets.length;case"down":return 0===this._downPanel.stackedPanel.widgets.length;case"header":return 0===this._headerPanel.widgets.length;case"left":return 0===this._leftHandler.stackedPanel.widgets.length;case"main":return this._dockPanel.isEmpty;case"menu":return 0===this._menuHandler.panel.widgets.length;case"right":return 0===this._rightHandler.stackedPanel.widgets.length;case"top":return 0===this._topHandler.panel.widgets.length;default:return!0}}async restoreLayout(e,t,i={}){var n,s,a,r;this._userLayout={"single-document":null!==(n=i["single-document"])&&void 0!==n?n:{},"multiple-document":null!==(s=i["multiple-document"])&&void 0!==s?s:{}},this._delayedWidget.forEach((({widget:e,area:t,options:i})=>{this.add(e,t,i)})),this._delayedWidget.length=0,this._layoutRestorer=t;const o=await t.fetch(),{mainArea:d,downArea:l,leftArea:h,rightArea:c,topArea:u,relativeSizes:p}=o;if(d){const{currentWidget:t,dock:i}=d;i&&"multiple-document"===e&&this._dockPanel.restoreLayout(i),e&&(this.mode=e),t&&this.activateById(t.id)}else e&&(this.mode=e);if(void 0!==(null==u?void 0:u.simpleVisibility)&&(this._topHandlerHiddenByUser=!u.simpleVisibility,"single-document"===this.mode&&this._topHandler.panel.setHidden(this._topHandlerHiddenByUser)),l){const{currentWidget:e,widgets:t,size:i}=l,n=null!==(a=null==t?void 0:t.map((e=>e.id)))&&void 0!==a?a:[];this._downPanel.tabBar.titles.filter((e=>!n.includes(e.owner.id))).map((e=>e.owner.close()));const s=this._downPanel.tabBar.titles.map((e=>e.owner.id));for(null==t||t.filter((e=>!s.includes(e.id))).map((e=>this._downPanel.addWidget(e)));!f.ArrayExt.shallowEqual(n,this._downPanel.tabBar.titles.map((e=>e.owner.id)));)this._downPanel.tabBar.titles.forEach(((e,t)=>{const i=n.findIndex((t=>e.owner.id==t));i>=0&&i!=t&&this._downPanel.tabBar.insertTab(i,e)}));if(e){const t=this._downPanel.stackedPanel.widgets.findIndex((t=>t.id===e.id));t&&(this._downPanel.currentIndex=t,null===(r=this._downPanel.currentWidget)||void 0===r||r.activate())}i&&i>0?this._vsplitPanel.setRelativeSizes([1-i,i]):(this._downPanel.stackedPanel.widgets.forEach((e=>e.close())),this._downPanel.hide())}h?this._leftHandler.rehydrate(h):"single-document"===e&&this.collapseLeft(),c?this._rightHandler.rehydrate(c):"single-document"===e&&this.collapseRight(),p&&this._hsplitPanel.setRelativeSizes(p),this._isRestored||(v.MessageLoop.flush(),this._restored.resolve(o))}saveLayout(){return{mainArea:{currentWidget:this._tracker.currentWidget,dock:"single-document"===this.mode&&this._cachedLayout||this._dockPanel.saveLayout()},downArea:{currentWidget:this._downPanel.currentWidget,widgets:Array.from(this._downPanel.stackedPanel.widgets),size:this._vsplitPanel.relativeSizes()[1]},leftArea:this._leftHandler.dehydrate(),rightArea:this._rightHandler.dehydrate(),topArea:{simpleVisibility:!this._topHandlerHiddenByUser},relativeSizes:this._hsplitPanel.relativeSizes()}}toggleTopInSimpleModeVisibility(){"single-document"===this.mode&&(this._topHandler.panel.isVisible?(this._topHandlerHiddenByUser=!0,this._topHandler.panel.hide()):(this._topHandlerHiddenByUser=!1,this._topHandler.panel.show(),this._updateTitlePanelTitle()),this._onLayoutModified())}toggleSideTabBarVisibility(e){"right"===e?this._rightHandler.isVisible?this._rightHandler.hide():this._rightHandler.show():this._leftHandler.isVisible?this._leftHandler.hide():this._leftHandler.show()}updateConfig(e){if(e.hiddenMode)switch(e.hiddenMode){case"display":this._dockPanel.hiddenMode=w.Widget.HiddenMode.Display;break;case"scale":this._dockPanel.hiddenMode=w.Widget.HiddenMode.Scale;break;case"contentVisibility":this._dockPanel.hiddenMode=w.Widget.HiddenMode.ContentVisibility}}widgets(e){switch(null!=e?e:"main"){case"main":return this._dockPanel.widgets();case"left":return(0,f.map)(this._leftHandler.sideBar.titles,(e=>e.owner));case"right":return(0,f.map)(this._rightHandler.sideBar.titles,(e=>e.owner));case"header":return this._headerPanel.children();case"top":return this._topHandler.panel.children();case"menu":return this._menuHandler.panel.children();case"bottom":return this._bottomPanel.children();default:throw new Error(`Invalid area: ${e}`)}}onAfterAttach(e){this.node.dataset.shellMode=this.mode}_updateTitlePanelTitle(){let e=this.currentWidget;const t=this._titleHandler.inputElement;t.value=e?e.title.label:"",t.title=e?e.title.caption:""}_updateCurrentPath(){let e=this.currentWidget,t="";e&&e instanceof d.DocumentWidget&&(t=e.context.path),this._currentPathChanged.emit({newValue:t,oldValue:this._currentPath}),this._currentPath=t}_addToLeftArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");t=t||this._sideOptionsCache.get(e)||{},this._sideOptionsCache.set(e,t);const i="rank"in t?t.rank:C;this._leftHandler.addWidget(e,i),this._onLayoutModified()}_addToMainArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");t=t||{};const i=this._dockPanel,n=t.mode||"tab-after";let s=this.currentWidget;t.ref&&(s=(0,f.find)(i.widgets(),(e=>e.id===t.ref))||null);const{title:a}=e;a.dataset={...a.dataset,id:e.id},a.icon instanceof h.LabIcon?a.icon=a.icon.bindprops({stylesheet:"mainAreaTab"}):"string"!=typeof a.icon&&a.icon||(a.iconClass=(0,h.classes)(a.iconClass,"jp-Icon")),i.addWidget(e,{mode:n,ref:s}),"single-document"===i.mode&&this._mainOptionsCache.set(e,t),!1!==t.activate&&i.activateWidget(e)}_addToRightArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");const i="rank"in(t=t||this._sideOptionsCache.get(e)||{})?t.rank:C;this._sideOptionsCache.set(e,t),this._rightHandler.addWidget(e,i),this._onLayoutModified()}_addToTopArea(e,t){var i;if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");const n=null!==(i=(t=t||{}).rank)&&void 0!==i?i:C;this._topHandler.addWidget(e,n),this._onLayoutModified(),this._topHandler.panel.isHidden&&this._topHandler.panel.show()}_addToMenuArea(e,t){var i;if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");const n=null!==(i=(t=t||{}).rank)&&void 0!==i?i:C;this._menuHandler.addWidget(e,n),this._onLayoutModified(),this._menuHandler.panel.isHidden&&this._menuHandler.panel.show()}_addToHeaderArea(e,t){e.id?(this._headerPanel.addWidget(e),this._onLayoutModified(),this._headerPanel.isHidden&&this._headerPanel.show()):console.error("Widgets added to app shell must have unique id property.")}_addToBottomArea(e,t){e.id?(this._bottomPanel.addWidget(e),this._onLayoutModified(),this._bottomPanel.isHidden&&this._bottomPanel.show()):console.error("Widgets added to app shell must have unique id property.")}_addToDownArea(e,t){if(!e.id)return void console.error("Widgets added to app shell must have unique id property.");t=t||{};const{title:i}=e;i.dataset={...i.dataset,id:e.id},i.icon instanceof h.LabIcon?i.icon=i.icon.bindprops({stylesheet:"mainAreaTab"}):"string"!=typeof i.icon&&i.icon||(i.iconClass=(0,h.classes)(i.iconClass,"jp-Icon")),this._downPanel.addWidget(e),this._onLayoutModified(),this._downPanel.isHidden&&this._downPanel.show()}_adjacentBar(e){const t=this._currentTabBar();if(!t)return null;const i=Array.from(this._dockPanel.tabBars()),n=i.length,s=i.indexOf(t);return"previous"===e?s>0?i[s-1]:0===s?i[n-1]:null:s<n-1?i[s+1]:s===n-1?i[0]:null}_currentTabBar(){const e=this._tracker.currentWidget;if(!e)return null;const t=e.title,i=this._dockPanel.tabBars();return(0,f.find)(i,(e=>e.titles.indexOf(t)>-1))||null}_onActiveChanged(e,t){t.newValue&&(t.newValue.title.className+=` ${k}`),t.oldValue&&(t.oldValue.title.className=t.oldValue.title.className.replace(k,"")),this._activeChanged.emit(t)}_onCurrentChanged(e,t){t.newValue&&(t.newValue.title.className+=` ${P}`),t.oldValue&&(t.oldValue.title.className=t.oldValue.title.className.replace(P,"")),this._currentChanged.emit(t),this._onLayoutModified()}_onTabPanelChanged(){0===this._downPanel.stackedPanel.widgets.length&&this._downPanel.hide(),this._onLayoutModified()}_onLayoutModified(){this._layoutDebouncer.invoke()}}var L;!function(e){e.itemCmp=function(e,t){return e.rank-t.rank},e.normalizeAreaConfig=function e(t,i){i&&("tab-area"!==i.type?i.children.forEach((i=>{e(t,i)})):i.widgets=i.widgets.filter((e=>!e.isDisposed&&e.parent===t)))},e.PanelHandler=class{constructor(){this._panelChildHook=(e,t)=>{switch(t.type){case"child-added":{const e=t.child;if(this._items.find((t=>t.widget===e)))break;const i=this._items[this._items.length-1].rank;this._items.push({widget:e,rank:i})}break;case"child-removed":{const e=t.child;f.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}}return!0},this._items=new Array,this._panel=new w.Panel,v.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(t,i){t.parent=null;const n={widget:t,rank:i},s=f.ArrayExt.upperBound(this._items,n,e.itemCmp);f.ArrayExt.insert(this._items,s,n),this._panel.insertWidget(s,t)}},e.SideBarHandler=class{constructor(){this._isHiddenByUser=!1,this._items=new Array,this._updated=new p.Signal(this),this._sideBar=new w.TabBar({insertBehavior:"none",removeBehavior:"none",allowDeselect:!0,orientation:"vertical"}),this._stackedPanel=new w.StackedPanel,this._sideBar.hide(),this._stackedPanel.hide(),this._lastCurrent=null,this._sideBar.currentChanged.connect(this._onCurrentChanged,this),this._sideBar.tabActivateRequested.connect(this._onTabActivateRequested,this),this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved,this)}get isVisible(){return this._sideBar.isVisible}get sideBar(){return this._sideBar}get stackedPanel(){return this._stackedPanel}get updated(){return this._updated}_onHandleMoved(){return this._refreshVisibility()}_onExpansionToggle(e,t){return this._refreshVisibility()}expand(){const e=this._lastCurrent||this._items.length>0&&this._items[0].widget;e&&this.activate(e.id)}activate(e){const t=this._findWidgetByID(e);t&&(this._sideBar.currentTitle=t.title,t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){this._sideBar.currentTitle=null}addWidget(e,t){var i,n,s,a;e.parent=null,e.hide();const r={widget:e,rank:t},o=this._findInsertIndex(r);f.ArrayExt.insert(this._items,o,r),this._stackedPanel.insertWidget(o,e);const d=this._sideBar.insertTab(o,e.title);d.dataset={id:e.id},d.icon instanceof h.LabIcon?d.icon=d.icon.bindprops({stylesheet:"sideBar"}):"string"==typeof d.icon&&""!=d.icon?d.iconClass=(0,h.classes)(d.iconClass,"jp-Icon","jp-Icon-20"):d.icon||d.label||(d.icon=h.tabIcon.bindprops({stylesheet:"sideBar"})),null===(n=null===(i=e.content)||void 0===i?void 0:i.expansionToggled)||void 0===n||n.connect(this._onExpansionToggle,this),null===(a=null===(s=e.content)||void 0===s?void 0:s.handleMoved)||void 0===a||a.connect(this._onHandleMoved,this),this._refreshVisibility()}dehydrate(){const e=null===this._sideBar.currentTitle,t=Array.from(this._stackedPanel.widgets),i=t[this._sideBar.currentIndex],n={};return this._stackedPanel.widgets.forEach((e=>{e.id&&e.content instanceof w.SplitPanel&&(n[e.id]={sizes:e.content.relativeSizes(),expansionStates:e.content.widgets.map((e=>e.isVisible))})})),{collapsed:e,currentWidget:i,visible:!this._isHiddenByUser,widgets:t,widgetStates:n}}rehydrate(e){e.currentWidget&&this.activate(e.currentWidget.id),e.collapsed&&this.collapse(),e.visible||this.hide(),e.widgetStates&&this._stackedPanel.widgets.forEach((t=>{var i;if(t.id&&t.content instanceof w.SplitPanel){const n=null!==(i=e.widgetStates[t.id])&&void 0!==i?i:{};t.content.widgets.forEach(((e,i)=>{var s;const a=(null!==(s=n.expansionStates)&&void 0!==s?s:[])[i];"boolean"==typeof a&&t.content instanceof w.AccordionPanel&&(a?t.content.expand(i):t.content.collapse(i))})),n.sizes&&t.content.setRelativeSizes(n.sizes)}}))}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(t){return f.ArrayExt.upperBound(this._items,t,e.itemCmp)}_findWidgetIndex(e){return f.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByTitle(e){const t=(0,f.find)(this._items,(t=>t.widget.title===e));return t?t.widget:null}_findWidgetByID(e){const t=(0,f.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._stackedPanel.setHidden(null===this._sideBar.currentTitle),this._sideBar.setHidden(this._isHiddenByUser||0===this._sideBar.titles.length),this._updated.emit()}_onCurrentChanged(e,t){const i=t.previousTitle?this._findWidgetByTitle(t.previousTitle):null,n=t.currentTitle?this._findWidgetByTitle(t.currentTitle):null;i&&i.hide(),n&&n.show(),this._lastCurrent=n||i,this._refreshVisibility()}_onTabActivateRequested(e,t){t.title.owner.activate()}_onWidgetRemoved(e,t){t===this._lastCurrent&&(this._lastCurrent=null),f.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._sideBar.removeTab(t.title),this._refreshVisibility()}};class t extends w.Widget{constructor(e){super(),this.addClass("jp-skiplink"),this.id="jp-skiplink",this._shell=e,this._createSkipLink("Skip to main panel","main")}handleEvent(e){var t,i;"click"===e.type&&e.target instanceof HTMLElement&&this._shell.activateArea(null===(i=null===(t=e.target)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.targetarea)}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this)}onBeforeDetach(e){this.node.removeEventListener("click",this),super.onBeforeDetach(e)}_createSkipLink(e,t){const i=document.createElement("a");i.href="#",i.tabIndex=0,i.text=e,i.className="skip-link",i.dataset.targetarea=t,this.node.appendChild(i)}}e.SkipLinkWidget=t;class i extends w.Widget{constructor(e){super(),this._selected=!1;const t=document.createElement("input");t.type="text",this.node.appendChild(t),this._shell=e,this.id="jp-title-panel-title"}onAfterAttach(e){super.onAfterAttach(e),this.inputElement.addEventListener("keyup",this),this.inputElement.addEventListener("click",this),this.inputElement.addEventListener("blur",this)}onBeforeDetach(e){super.onBeforeDetach(e),this.inputElement.removeEventListener("keyup",this),this.inputElement.removeEventListener("click",this),this.inputElement.removeEventListener("blur",this)}handleEvent(e){switch(e.type){case"keyup":this._evtKeyUp(e);break;case"click":this._evtClick(e);break;case"blur":this._selected=!1}}async _evtKeyUp(e){if("Enter"==e.key){const e=this._shell.currentWidget;if(null==e)return;const t=e.title.label,i=this.inputElement,n=i.value;i.blur(),n!==t?e.title.label=n:i.value=t}}_evtClick(e){if(0!==e.button||this._selected)return;const t=this.inputElement;e.preventDefault(),e.stopPropagation(),this._selected=!0;const i=t.value.indexOf(".");-1===i?t.select():t.setSelectionRange(0,i)}get inputElement(){return this.node.children[0]}}e.TitleHandler=i;class n extends w.SplitPanel{constructor(e={}){super(e),this.updated=new p.Signal(this)}onUpdateRequest(e){super.onUpdateRequest(e),this.updated.emit()}}e.RestorableSplitPanel=n}(L||(L={}));var A,M=i(20389);class x extends g{constructor(e={shell:new H}){super({...e,shell:e.shell||new H,serviceManager:e.serviceManager||new l.ServiceManager({standby:()=>!this._info.isConnected||"when-hidden"})}),this.name=_.PageConfig.getOption("appName")||"JupyterLab",this.namespace=_.PageConfig.getOption("appNamespace")||this.name,this.registerPluginErrors=[],this.status=new M.J(this),this.version=_.PageConfig.getOption("appVersion")||"unknown",this._info=x.defaultInfo,this._allPluginsActivated=new u.PromiseDelegate;const t=Object.keys(x.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...x.defaultInfo,...t},this.restored=this.shell.restored.then((async()=>{const e=[],t=this.activateDeferredPlugins().catch((e=>{console.error("Error when activating deferred plugins\n:",e)}));if(e.push(t),this._info.deferred){const t=Promise.all(this._info.deferred.matches.map((e=>this.activatePlugin(e)))).catch((e=>{console.error("Error when activating customized list of deferred plugins:\n",e)}));e.push(t)}Promise.all(e).then((()=>{this._allPluginsActivated.resolve()})).catch((()=>{}))})).catch((()=>{}));const i=x.defaultPaths.urls,n=x.defaultPaths.directories,s=e.paths&&e.paths.urls||{},a=e.paths&&e.paths.directories||{};if(this._paths={urls:Object.keys(i).reduce(((e,t)=>{if(t in s){const i=s[t];e[t]=i}else e[t]=i[t];return e}),{}),directories:Object.keys(x.defaultPaths.directories).reduce(((e,t)=>{if(t in a){const i=a[t];e[t]=i}else e[t]=n[t];return e}),{})},this._info.devMode&&this.shell.addClass("jp-mod-devMode"),this.docRegistry.addModelFactory(new d.Base64ModelFactory),e.mimeExtensions)for(const t of(0,m.as)(e.mimeExtensions))this.registerPlugin(t)}get info(){return this._info}get paths(){return this._paths}get allPluginsActivated(){return this._allPluginsActivated.promise}registerPluginModule(e){let t=e.default;e.hasOwnProperty("__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){this.registerPluginErrors.push(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}evtKeydown(e){const t=new u.PromiseDelegate;this.commands.holdKeyBindingExecution(e,t.promise),this.commands.processKeydownEvent(e);const i=e.target;if(!i)return t.resolve(!0);let n=null,s=null;const a=()=>{n&&i.removeEventListener("beforeinput",n),s&&i.removeEventListener("keyup",s)};Promise.race([new Promise((e=>{n=t=>{switch(t.inputType){case"historyUndo":case"historyRedo":if(t.target instanceof Element&&t.target.closest("[data-jp-undoer]"))return t.preventDefault(),a(),e(!1);break;case"insertLineBreak":if(t.target instanceof Element&&t.target.closest(".jp-Cell"))return t.preventDefault(),a(),e(!1)}return a(),e(!0)},i.addEventListener("beforeinput",n,{once:!0})})),new Promise((t=>{s=i=>{if(i.code===e.code)return a(),t(!1)},i.addEventListener("keyup",s,{once:!0})})),new Promise((e=>{setTimeout((()=>(a(),e(!1))),A.INPUT_GUARD_TIMEOUT)}))]).then((e=>{t.resolve(!e)})).catch(console.warn)}}!function(e){e.IInfo=new u.Token("@jupyterlab/application:IInfo","A service providing metadata about the current application, including disabled extensions and whether dev mode is enabled."),e.defaultInfo={devMode:"true"===_.PageConfig.getOption("devMode").toLowerCase(),deferred:{patterns:[],matches:[]},disabled:{patterns:[],matches:[]},mimeExtensions:[],availablePlugins:[],filesCached:"true"===_.PageConfig.getOption("cacheFiles").toLowerCase(),isConnected:!0},e.defaultPaths={urls:{base:_.PageConfig.getOption("baseUrl"),notFound:_.PageConfig.getOption("notFoundUrl"),app:_.PageConfig.getOption("appUrl"),doc:_.PageConfig.getOption("docUrl"),static:_.PageConfig.getOption("staticUrl"),settings:_.PageConfig.getOption("settingsUrl"),themes:_.PageConfig.getOption("themesUrl"),translations:_.PageConfig.getOption("translationsApiUrl"),hubHost:_.PageConfig.getOption("hubHost")||void 0,hubPrefix:_.PageConfig.getOption("hubPrefix")||void 0,hubUser:_.PageConfig.getOption("hubUser")||void 0,hubServerName:_.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:_.PageConfig.getOption("appSettingsDir"),schemas:_.PageConfig.getOption("schemasDir"),static:_.PageConfig.getOption("staticDir"),templates:_.PageConfig.getOption("templatesDir"),themes:_.PageConfig.getOption("themesDir"),userSettings:_.PageConfig.getOption("userSettingsDir"),serverRoot:_.PageConfig.getOption("serverRoot"),workspaces:_.PageConfig.getOption("workspacesDir")}}}(x||(x={})),function(e){e.INPUT_GUARD_TIMEOUT=10}(A||(A={}));var E=i(67863),W=i(2549);class S{constructor(e){this.stop=new u.Token("@jupyterlab/application:Router#stop"),this._routed=new p.Signal(this),this._rules=new Map,this.base=e.base,this.commands=e.commands}get current(){var e,t;const{base:i}=this,n=_.URLExt.parse(window.location.href),{search:s,hash:a}=n,r=null!==(t=null===(e=n.pathname)||void 0===e?void 0:e.replace(i,"/"))&&void 0!==t?t:"";return{hash:a,path:r,request:r+s+a,search:s}}get routed(){return this._routed}navigate(e,t={}){const{base:i}=this,{history:n}=window,{hard:s}=t,a=document.location.href,r=e&&0===e.indexOf(i)?e:_.URLExt.join(i,e);return r===a?s?this.reload():void 0:(n.pushState({},"",r),s?this.reload():void(t.skipRouting||requestAnimationFrame((()=>{this.route()}))))}register(e){var t;const{command:i,pattern:n}=e,s=null!==(t=e.rank)&&void 0!==t?t:100,a=this._rules;return a.set(n,{command:i,rank:s}),new W.DisposableDelegate((()=>{a.delete(n)}))}reload(){window.location.reload()}route(){const{commands:e,current:t,stop:i}=this,{request:n}=t,s=this._routed,a=this._rules,r=[];a.forEach(((e,t)=>{(null==n?void 0:n.match(t))&&r.push(e)}));const o=r.sort(((e,t)=>t.rank-e.rank)),d=new u.PromiseDelegate,l=async()=>{if(!o.length)return s.emit(t),void d.resolve(void 0);const{command:a}=o.pop();try{const n=this.current.request;await e.execute(a,t)===i&&(o.length=0,console.debug(`Routing ${n} was short-circuited by ${a}`))}catch(e){console.warn(`Routing ${n} to ${a} failed`,e)}l()};return l(),d.promise}}const I=new u.Token("@jupyterlab/application:IConnectionLost",'A service for invoking the dialog shown\n when JupyterLab has lost its connection to the server. Use this if, for some reason,\n you want to bring up the "connection lost" dialog under new circumstances.'),R=new u.Token("@jupyterlab/application:ILabStatus",'A service for interacting with the application busy/dirty\n status. Use this if you want to set the application "busy" favicon, or to set\n the application "dirty" status, which asks the user for confirmation before leaving the application page.'),j=new u.Token("@jupyterlab/application:IRouter","The URL router used by the application. Use this to add custom URL-routing for your extension (e.g., to invoke a command if the user navigates to a sub-path)."),U=new u.Token("@jupyterlab/application:ITreePathUpdater","A service to update the tree path.");function O(e){const{id:t,commands:i,shell:n,semanticCommands:a,default:r,overrides:o,trans:d}=e;i.addCommand(t,{...D({commands:i,shell:n},a,null!=r?r:{},null!=d?d:s.nullTranslator.load("jupyterlab")),...o});const l=Array.isArray(a)?a:[a],h=(e,i)=>{if(i.id)if(i.id===t&&"removed"===i.type)e.commandChanged.disconnect(h);else if(l.reduce(((e,t)=>e.concat(t.ids)),[]).includes(i.id))switch(i.type){case"changed":case"many-changed":e.notifyCommandChanged(t);break;case"removed":for(const e of l)e.remove(i.id)}};i.commandChanged.connect(h)}function D(e,t,i,n){const{commands:s,shell:a}=e,r=Array.isArray(t)?t:[t];return{label:d("label"),caption:d("caption"),isEnabled:()=>{var e;const t=o("isEnabled");return t.length>0&&!t.some((e=>!1===e))||null!==(e=i.isEnabled)&&void 0!==e&&e},isToggled:()=>{var e;return o("isToggled").some((e=>!0===e))||null!==(e=i.isToggled)&&void 0!==e&&e},isVisible:()=>{var e;const t=o("isVisible");return t.length>0&&!t.some((e=>!1===e))||null===(e=i.isVisible)||void 0===e||e},execute:async()=>{const e=a.currentWidget,t=r.map((t=>null!==e?t.getActiveCommandId(e):null)).filter((e=>null!==e&&s.isEnabled(e)));let n=null;if(t.length>0){for(const e of t)if(n=await s.execute(e),"boolean"==typeof n&&!1===n)break}else i.execute&&(n=await s.execute(i.execute));return n}};function o(e){const t=a.currentWidget;return r.map((e=>null!==t?e.getActiveCommandId(t):null)).filter((e=>null!==e)).map((t=>s[e](t)))}function d(e){return()=>{var t;const s=o(e).map(((t,i)=>"caption"==e&&i>0?t.toLocaleLowerCase():t));switch(s.length){case 0:return null!==(t=i[e])&&void 0!==t?t:"";case 1:return s[0];default:{const e=s.some((e=>/…$/.test(e))),t=s.slice(void 0,-1).map((e=>e.replace(/…$/,""))).join(", "),i=s.slice(-1)[0].replace(/…$/,"")+(e?"…":"");return n.__("%1 and %2",t,i)}}}}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6893,7684],{56893:(t,e,o)=>{o.r(e),o.d(e,{CommandIDs:()=>n,default:()=>i});var n,a=o(44604),r=o(53312),s=o(68722),u=o(12030);!function(t){t.controlPanel="hub:control-panel",t.logout="hub:logout",t.restart="hub:restart"}(n||(n={}));const i=[{activate:function(t,e,o,a){const r=o.load("jupyterlab"),u=e.urls.hubHost||"",i=e.urls.hubPrefix||"",l=e.urls.hubUser||"",c=e.urls.hubServerName||"",d=e.urls.base;if(!i)return;console.debug("hub-extension: Found configuration ",{hubHost:u,hubPrefix:i});const b=s.URLExt.join(i,"spawn");let h;if(c){const t=s.URLExt.join(b,l,c);if(!t.startsWith(b))throw new Error("Can only be used for spawn requests");h=u+t}h=u+b;const{commands:_}=t;if(_.addCommand(n.restart,{label:r.__("Restart Server"),caption:r.__("Request that the Hub restart this server"),execute:()=>{window.open(h,"_blank")}}),_.addCommand(n.controlPanel,{label:r.__("Hub Control Panel"),caption:r.__("Open the Hub control panel in a new browser tab"),execute:()=>{window.open(u+s.URLExt.join(i,"home"),"_blank")}}),_.addCommand(n.logout,{label:r.__("Log Out"),caption:r.__("Log out of the Hub"),execute:()=>{window.location.href=u+s.URLExt.join(d,"logout")}}),a){const t=r.__("Hub");a.addItem({category:t,command:n.controlPanel}),a.addItem({category:t,command:n.logout})}},id:"@jupyterlab/hub-extension:plugin",description:"Registers commands related to the hub server",requires:[a.JupyterFrontEnd.IPaths,u.ITranslator],optional:[r.ICommandPalette],autoStart:!0},{activate:()=>{},id:"@jupyterlab/hub-extension:menu",description:"Adds hub related commands to the menu.",autoStart:!0},{id:"@jupyterlab/hub-extension:connectionlost",description:"Provides a service to be notified when the connection to the hub server is lost.",requires:[a.JupyterFrontEnd.IPaths,u.ITranslator],optional:[a.JupyterLab.IInfo],activate:(t,e,o,s)=>{const u=o.load("jupyterlab"),i=e.urls.hubPrefix||"",l=e.urls.base;if(!i)return a.ConnectionLost;let c=!1;return async(e,o)=>{if(c)return;c=!0,s&&(s.isConnected=!1);const a=await(0,r.showDialog)({title:u.__("Server unavailable or unreachable"),body:u.__("Your server at %1 is not running.\nWould you like to restart it?",l),buttons:[r.Dialog.okButton({label:u.__("Restart")}),r.Dialog.cancelButton({label:u.__("Dismiss")})]});s&&(s.isConnected=!0),c=!1,a.button.accept&&await t.commands.execute(n.restart)}},autoStart:!0,provides:a.IConnectionLost}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6893,7684],{56893:(t,e,o)=>{o.r(e),o.d(e,{CommandIDs:()=>n,default:()=>i});var n,a=o(2756),r=o(20005),s=o(64145),u=o(90646);!function(t){t.controlPanel="hub:control-panel",t.logout="hub:logout",t.restart="hub:restart"}(n||(n={}));const i=[{activate:function(t,e,o,a){const r=o.load("jupyterlab"),u=e.urls.hubHost||"",i=e.urls.hubPrefix||"",l=e.urls.hubUser||"",c=e.urls.hubServerName||"",d=e.urls.base;if(!i)return;console.debug("hub-extension: Found configuration ",{hubHost:u,hubPrefix:i});const b=s.URLExt.join(i,"spawn");let h=u+b;if(c){const t=s.URLExt.join(b,l,c);if(!t.startsWith(b))throw new Error("Can only be used for spawn requests");h=u+t}const{commands:_}=t;if(_.addCommand(n.restart,{label:r.__("Restart Server"),caption:r.__("Request that the Hub restart this server"),execute:()=>{window.open(h,"_blank")}}),_.addCommand(n.controlPanel,{label:r.__("Hub Control Panel"),caption:r.__("Open the Hub control panel in a new browser tab"),execute:()=>{window.open(u+s.URLExt.join(i,"home"),"_blank")}}),_.addCommand(n.logout,{label:r.__("Log Out"),caption:r.__("Log out of the Hub"),execute:()=>{window.location.href=u+s.URLExt.join(d,"logout")}}),a){const t=r.__("Hub");a.addItem({category:t,command:n.controlPanel}),a.addItem({category:t,command:n.logout})}},id:"@jupyterlab/hub-extension:plugin",description:"Registers commands related to the hub server",requires:[a.JupyterFrontEnd.IPaths,u.ITranslator],optional:[r.ICommandPalette],autoStart:!0},{activate:()=>{},id:"@jupyterlab/hub-extension:menu",description:"Adds hub related commands to the menu.",autoStart:!0},{id:"@jupyterlab/hub-extension:connectionlost",description:"Provides a service to be notified when the connection to the hub server is lost.",requires:[a.JupyterFrontEnd.IPaths,u.ITranslator],optional:[a.JupyterLab.IInfo],activate:(t,e,o,s)=>{const u=o.load("jupyterlab"),i=e.urls.hubPrefix||"",l=e.urls.base;if(!i)return a.ConnectionLost;let c=!1;return async(e,o)=>{if(c)return;c=!0,s&&(s.isConnected=!1);const a=await(0,r.showDialog)({title:u.__("Server unavailable or unreachable"),body:u.__("Your server at %1 is not running.\nWould you like to restart it?",l),buttons:[r.Dialog.okButton({label:u.__("Restart")}),r.Dialog.cancelButton({label:u.__("Dismiss")})]});s&&(s.isConnected=!0),c=!1,a.button.accept&&await t.commands.execute(n.restart)}},autoStart:!0,provides:a.IConnectionLost}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[690],{60690:(e,t,n)=>{n.r(t),n.d(t,{MIME_TYPE:()=>d,MIME_TYPES_JSONL:()=>l,RenderedJSON:()=>p,default:()=>m,rendererFactory:()=>c});var r=n(53312),o=n(12030),s=n(63485),i=n(78156),a=n(37634);const d="application/json",l=["text/jsonl","application/jsonl","application/json-lines"];class p extends s.Widget{constructor(e){super(),this._rootDOM=null,this.addClass("jp-RenderedJSON"),this.addClass("CodeMirror"),this._mimeType=e.mimeType,this.translator=e.translator||o.nullTranslator}[r.Printing.symbol](){return()=>r.Printing.printWidget(this)}async renderModel(e){const{Component:t}=await Promise.all([n.e(9752),n.e(998),n.e(5613),n.e(525),n.e(2209)]).then(n.bind(n,69752));let r;if(l.indexOf(this._mimeType)>=0){const t=(e.data[this._mimeType]||"").trim().split(/\n/);r=JSON.parse(`[${t.join(",")}]`)}else r=e.data[this._mimeType]||{};const o=e.metadata[this._mimeType]||{};return null===this._rootDOM&&(this._rootDOM=(0,a.s)(this.node)),new Promise(((e,n)=>{this._rootDOM.render(i.createElement(t,{data:r,metadata:o,translator:this.translator,forwardedRef:()=>e()}))}))}onBeforeDetach(e){this._rootDOM&&(this._rootDOM.unmount(),this._rootDOM=null)}}const c={safe:!0,mimeTypes:[d,...l],createRenderer:e=>new p(e)},m=[{id:"@jupyterlab/json-extension:factory",description:"Adds renderer for JSON content.",rendererFactory:c,rank:0,dataType:"json",documentWidgetFactoryOptions:{name:"JSON",primaryFileType:"json",fileTypes:["json","notebook","geojson"],defaultFor:["json"]}},{id:"@jupyterlab/json-lines-extension:factory",description:"Adds renderer for JSONLines content.",rendererFactory:c,rank:0,dataType:"string",documentWidgetFactoryOptions:{name:"JSONLines",primaryFileType:"jsonl",fileTypes:["jsonl","ndjson"],defaultFor:["jsonl","ndjson"]}}]},37634:(e,t,n)=>{var r=n(38005);t.s=r.createRoot,r.hydrateRoot}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[690],{60690:(e,t,n)=>{n.r(t),n.d(t,{MIME_TYPE:()=>d,MIME_TYPES_JSONL:()=>l,RenderedJSON:()=>p,default:()=>m,rendererFactory:()=>c});var r=n(20005),o=n(90646),s=n(63485),i=n(78156),a=n(37634);const d="application/json",l=["text/jsonl","application/jsonl","application/json-lines"];class p extends s.Widget{constructor(e){super(),this._rootDOM=null,this.addClass("jp-RenderedJSON"),this.addClass("CodeMirror"),this._mimeType=e.mimeType,this.translator=e.translator||o.nullTranslator}[r.Printing.symbol](){return()=>r.Printing.printWidget(this)}async renderModel(e){const{Component:t}=await Promise.all([n.e(9752),n.e(998),n.e(4576),n.e(5536),n.e(2209)]).then(n.bind(n,69752));let r;if(l.indexOf(this._mimeType)>=0){const t=(e.data[this._mimeType]||"").trim().split(/\n/);r=JSON.parse(`[${t.join(",")}]`)}else r=e.data[this._mimeType]||{};const o=e.metadata[this._mimeType]||{};return null===this._rootDOM&&(this._rootDOM=(0,a.s)(this.node)),new Promise(((e,n)=>{this._rootDOM.render(i.createElement(t,{data:r,metadata:o,translator:this.translator,forwardedRef:()=>e()}))}))}onBeforeDetach(e){this._rootDOM&&(this._rootDOM.unmount(),this._rootDOM=null)}}const c={safe:!0,mimeTypes:[d,...l],createRenderer:e=>new p(e)},m=[{id:"@jupyterlab/json-extension:factory",description:"Adds renderer for JSON content.",rendererFactory:c,rank:0,dataType:"json",documentWidgetFactoryOptions:{name:"JSON",primaryFileType:"json",fileTypes:["json","notebook","geojson"],defaultFor:["json"]}},{id:"@jupyterlab/json-lines-extension:factory",description:"Adds renderer for JSONLines content.",rendererFactory:c,rank:0,dataType:"string",documentWidgetFactoryOptions:{name:"JSONLines",primaryFileType:"jsonl",fileTypes:["jsonl","ndjson"],defaultFor:["jsonl","ndjson"]}}]},37634:(e,t,n)=>{var r=n(38005);t.s=r.createRoot,r.hydrateRoot}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6962],{56962:(t,e,r)=>{r.r(e),r.d(e,{default:()=>T});var n=r(44604),a=r(53312),o=r(57957),s=r(23295),i=r(12030),c=r(35613);const l="@jupyterlab/htmlviewer-extension:plugin",d="HTML Viewer";var u;!function(t){t.trustHTML="htmlviewer:trust-html"}(u||(u={}));const m={activate:function(t,e,r,n,s,i){let T;const h=e.load("jupyterlab");i&&(i.addFactory(d,"refresh",(t=>o.ToolbarItems.createRefreshButton(t,e))),i.addFactory(d,"trust",(t=>o.ToolbarItems.createTrustButton(t,e))),s&&(T=(0,a.createToolbarFactory)(i,s,d,m.id,e)));const y={name:"html",contentType:"file",fileFormat:"text",displayName:h.__("HTML File"),extensions:[".html"],mimeTypes:["text/html"],icon:c.html5Icon};t.docRegistry.addFileType(y);const g=new o.HTMLViewerFactory({name:d,label:h.__("HTML Viewer"),fileTypes:["html"],defaultFor:["html"],readOnly:!0,toolbarFactory:T,translator:e}),p=new a.WidgetTracker({namespace:"htmlviewer"});n&&n.restore(p,{command:"docmanager:open",args:t=>({path:t.context.path,factory:"HTML Viewer"}),name:t=>t.context.path});let f=!1;if(s){const e=s.load(l),r=t=>{f=t.get("trustByDefault").composite};Promise.all([e,t.restored]).then((([t])=>{r(t),t.changed.connect((t=>{r(t)}))})).catch((t=>{console.error(t.message)}))}return t.docRegistry.addWidgetFactory(g),g.widgetCreated.connect(((e,r)=>{var n,a;p.add(r),r.context.pathChanged.connect((()=>{p.save(r)})),r.trustedChanged.connect((()=>{t.commands.notifyCommandChanged(u.trustHTML)})),r.trusted=f,r.title.icon=y.icon,r.title.iconClass=null!==(n=y.iconClass)&&void 0!==n?n:"",r.title.iconLabel=null!==(a=y.iconLabel)&&void 0!==a?a:""})),t.commands.addCommand(u.trustHTML,{label:h.__("Trust HTML File"),caption:h.__("Whether the HTML file is trusted.\n Trusting the file allows scripts to run in it,\n which may result in security risks.\n Only enable for files you trust."),isEnabled:()=>!!p.currentWidget,isToggled:()=>{const t=p.currentWidget;return!!t&&-1!==t.content.sandbox.indexOf("allow-scripts")},execute:()=>{const t=p.currentWidget;t&&(t.trusted=!t.trusted)}}),p.currentChanged.connect((()=>{t.commands.notifyCommandChanged(u.trustHTML)})),r&&r.addItem({command:u.trustHTML,category:h.__("File Operations")}),p},id:l,description:"Adds HTML file viewer and provides its tracker.",provides:o.IHTMLViewerTracker,requires:[i.ITranslator],optional:[a.ICommandPalette,n.ILayoutRestorer,s.ISettingRegistry,a.IToolbarWidgetRegistry],autoStart:!0},T=m}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6962],{56962:(t,e,r)=>{r.r(e),r.d(e,{default:()=>T});var n=r(2756),a=r(20005),o=r(53922),s=r(3339),i=r(90646),c=r(14576);const l="@jupyterlab/htmlviewer-extension:plugin",d="HTML Viewer";var u;!function(t){t.trustHTML="htmlviewer:trust-html"}(u||(u={}));const m={activate:function(t,e,r,n,s,i){let T;const h=e.load("jupyterlab");i&&(i.addFactory(d,"refresh",(t=>o.ToolbarItems.createRefreshButton(t,e))),i.addFactory(d,"trust",(t=>o.ToolbarItems.createTrustButton(t,e))),s&&(T=(0,a.createToolbarFactory)(i,s,d,m.id,e)));const y={name:"html",contentType:"file",fileFormat:"text",displayName:h.__("HTML File"),extensions:[".html"],mimeTypes:["text/html"],icon:c.html5Icon};t.docRegistry.addFileType(y);const g=new o.HTMLViewerFactory({name:d,label:h.__("HTML Viewer"),fileTypes:["html"],defaultFor:["html"],readOnly:!0,toolbarFactory:T,translator:e}),p=new a.WidgetTracker({namespace:"htmlviewer"});n&&n.restore(p,{command:"docmanager:open",args:t=>({path:t.context.path,factory:"HTML Viewer"}),name:t=>t.context.path});let f=!1;if(s){const e=s.load(l),r=t=>{f=t.get("trustByDefault").composite};Promise.all([e,t.restored]).then((([t])=>{r(t),t.changed.connect((t=>{r(t)}))})).catch((t=>{console.error(t.message)}))}return t.docRegistry.addWidgetFactory(g),g.widgetCreated.connect(((e,r)=>{var n,a;p.add(r),r.context.pathChanged.connect((()=>{p.save(r)})),r.trustedChanged.connect((()=>{t.commands.notifyCommandChanged(u.trustHTML)})),r.trusted=f,r.title.icon=y.icon,r.title.iconClass=null!==(n=y.iconClass)&&void 0!==n?n:"",r.title.iconLabel=null!==(a=y.iconLabel)&&void 0!==a?a:""})),t.commands.addCommand(u.trustHTML,{label:h.__("Trust HTML File"),caption:h.__("Whether the HTML file is trusted.\n Trusting the file allows scripts to run in it,\n which may result in security risks.\n Only enable for files you trust."),isEnabled:()=>!!p.currentWidget,isToggled:()=>{const t=p.currentWidget;return!!t&&-1!==t.content.sandbox.indexOf("allow-scripts")},execute:()=>{const t=p.currentWidget;t&&(t.trusted=!t.trusted)}}),p.currentChanged.connect((()=>{t.commands.notifyCommandChanged(u.trustHTML)})),r&&r.addItem({command:u.trustHTML,category:h.__("File Operations")}),p},id:l,description:"Adds HTML file viewer and provides its tracker.",provides:o.IHTMLViewerTracker,requires:[i.ITranslator],optional:[a.ICommandPalette,n.ILayoutRestorer,s.ISettingRegistry,a.IToolbarWidgetRegistry],autoStart:!0},T=m}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6999],{36999:(e,t,s)=>{s.r(t),s.d(t,{FOUND_CLASSES:()=>o,GenericSearchProvider:()=>c,HTMLSearchEngine:()=>h,ISearchProviderRegistry:()=>$,SearchDocumentModel:()=>m,SearchDocumentView:()=>L,SearchProvider:()=>n,SearchProviderRegistry:()=>Q,TextSearchEngine:()=>d});var r=s(63485),i=s(81997);class n{constructor(e){this.widget=e,this._stateChanged=new i.Signal(this),this._filtersChanged=new i.Signal(this),this._disposed=!1}get stateChanged(){return this._stateChanged}get filtersChanged(){return this._filtersChanged}get currentMatchIndex(){return null}get isDisposed(){return this._disposed}get matchesCount(){return null}dispose(){this._disposed||(this._disposed=!0,i.Signal.clearData(this))}getInitialQuery(){return""}getFilters(){return{}}static preserveCase(e,t){return e.toUpperCase()===e?t.toUpperCase():e.toLowerCase()===e?t.toLowerCase():a(e)===e?a(t):t}}function a([e="",...t]){return e.toUpperCase()+""+t.join("").toLowerCase()}const o=["cm-string","cm-overlay","cm-searching"],l=["CodeMirror-selectedtext"];class h{static search(e,t){if(!(t instanceof Node))return console.warn("Unable to search with HTMLSearchEngine the provided object.",t),Promise.resolve([]);e.global||(e=new RegExp(e.source,e.flags+"g"));const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:s=>{let r=s.parentElement;for(;r!==t;){if(r.nodeName in h.UNSUPPORTED_ELEMENTS)return NodeFilter.FILTER_REJECT;r=r.parentElement}return e.test(s.textContent)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let i=null;for(;null!==(i=r.nextNode());){e.lastIndex=0;let t=null;for(;null!==(t=e.exec(i.textContent));)s.push({text:t[0],position:t.index,node:i})}return Promise.resolve(s)}}h.UNSUPPORTED_ELEMENTS={BASE:!0,HEAD:!0,LINK:!0,META:!0,STYLE:!0,TITLE:!0,BODY:!0,AREA:!0,AUDIO:!0,IMG:!0,MAP:!0,TRACK:!0,VIDEO:!0,APPLET:!0,EMBED:!0,IFRAME:!0,NOEMBED:!0,OBJECT:!0,PARAM:!0,PICTURE:!0,SOURCE:!0,CANVAS:!0,NOSCRIPT:!0,SCRIPT:!0,SVG:!0};class c extends n{constructor(){super(...arguments),this.isReadOnly=!0,this._matches=[],this._mutationObserver=new MutationObserver(this._onWidgetChanged.bind(this)),this._markNodes=new Array}static isApplicable(e){return e instanceof r.Widget}static createNew(e,t,s){return new c(e)}get currentMatchIndex(){return this._currentMatchIndex>=0?this._currentMatchIndex:null}get currentMatch(){var e;return null!==(e=this._matches[this._currentMatchIndex])&&void 0!==e?e:null}get matches(){return this._matches?this._matches.map((e=>Object.assign({},e))):this._matches}get matchesCount(){return this._matches.length}clearHighlight(){return this._currentMatchIndex>=0&&this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=-1,Promise.resolve()}dispose(){this.isDisposed||(this.endQuery().catch((e=>{console.error("Failed to end search query.",e)})),super.dispose())}async highlightNext(e){var t;return null!==(t=this._highlightNext(!1,null==e||e))&&void 0!==t?t:void 0}async highlightPrevious(e){var t;return null!==(t=this._highlightNext(!0,null==e||e))&&void 0!==t?t:void 0}async replaceCurrentMatch(e,t){return Promise.resolve(!1)}async replaceAllMatches(e){return Promise.resolve(!1)}async startQuery(e,t={}){if(await this.endQuery(),this._query=e,null===e)return Promise.resolve();const s=await h.search(e,this.widget.node);let r=0;for(;r<s.length;){let e=s[r].node,t=e.parentNode,i=[s[r]];for(;++r<s.length&&s[r].node===e;)i.unshift(s[r]);const n=i.map((s=>{const r=document.createElement("mark");r.classList.add(...o),r.textContent=s.text;const i=e.splitText(s.position);return i.textContent=i.textContent.slice(s.text.length),t.insertBefore(r,i),r}));for(let e=n.length-1;e>=0;e--)this._markNodes.push(n[e])}this._mutationObserver.observe(this.widget.node,{attributes:!1,characterData:!0,childList:!0,subtree:!0}),this._matches=s}async endQuery(){this._mutationObserver.disconnect(),this._markNodes.forEach((e=>{const t=e.parentNode;t.replaceChild(document.createTextNode(e.textContent),e),t.normalize()})),this._markNodes=[],this._matches=[],this._currentMatchIndex=-1}_highlightNext(e,t){if(0===this._matches.length)return null;if(-1===this._currentMatchIndex?this._currentMatchIndex=e?this.matches.length-1:0:(this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=e?this._currentMatchIndex-1:this._currentMatchIndex+1,t&&(this._currentMatchIndex<0||this._currentMatchIndex>=this._matches.length)&&(this._currentMatchIndex=(this._currentMatchIndex+this._matches.length)%this._matches.length)),this._currentMatchIndex>=0&&this._currentMatchIndex<this._matches.length){const t=this._markNodes[this._currentMatchIndex];return t.classList.add(...l),function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.left>=0&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(t)||t.scrollIntoView(e),t.focus(),this._matches[this._currentMatchIndex]}return this._currentMatchIndex=-1,null}async _onWidgetChanged(e,t){this._currentMatchIndex=-1,await this.startQuery(this._query),this._stateChanged.emit()}}const d={search(e,t){if("string"!=typeof t)try{t=JSON.stringify(t)}catch(e){return console.warn("Unable to search with TextSearchEngine non-JSON serializable object.",e,t),Promise.resolve([])}e.global||(e=new RegExp(e.source,e.flags+"g"));const s=new Array;let r=null;for(;null!==(r=e.exec(t));)s.push({text:r[0],position:r.index});return Promise.resolve(s)}};var p,u=s(35613),g=s(97934);class m extends u.VDomModel{constructor(e,t){if(super(),this.searchProvider=e,this._caseSensitive=!1,this._disposed=new i.Signal(this),this._parsingError="",this._preserveCase=!1,this._initialQuery="",this._filters={},this._replaceText="",this._searchActive=!1,this._searchExpression="",this._useRegex=!1,this._wholeWords=!1,this._filters={},this.searchProvider.getFilters){const e=this.searchProvider.getFilters();for(const t in e)this._filters[t]=e[t].default}e.stateChanged.connect(this._onProviderStateChanged,this),this._searchDebouncer=new g.Debouncer((()=>{this._updateSearch().catch((e=>{console.error("Failed to update search on document.",e)}))}),t)}get caseSensitive(){return this._caseSensitive}set caseSensitive(e){this._caseSensitive!==e&&(this._caseSensitive=e,this.stateChanged.emit(),this.refresh())}get currentIndex(){return this.searchProvider.currentMatchIndex}get disposed(){return this._disposed}get filters(){return this._filters}get filtersDefinition(){var e,t,s;return null!==(s=null===(t=(e=this.searchProvider).getFilters)||void 0===t?void 0:t.call(e))&&void 0!==s?s:{}}get filtersDefinitionChanged(){return this.searchProvider.filtersChanged||null}get initialQuery(){return this._initialQuery}set initialQuery(e){this._initialQuery=e||this._searchExpression}get suggestedInitialQuery(){return this.searchProvider.getInitialQuery()}get selectionState(){return this.searchProvider.getSelectionState?this.searchProvider.getSelectionState():void 0}get isReadOnly(){return this.searchProvider.isReadOnly}get replaceOptionsSupport(){return this.searchProvider.replaceOptionsSupport}get parsingError(){return this._parsingError}get preserveCase(){return this._preserveCase}set preserveCase(e){this._preserveCase!==e&&(this._preserveCase=e,this.stateChanged.emit(),this.refresh())}get replaceText(){return this._replaceText}set replaceText(e){this._replaceText!==e&&(this._replaceText=e,this.stateChanged.emit())}get searchExpression(){return this._searchExpression}set searchExpression(e){this._searchExpression!==e&&(this._searchExpression=e,this.stateChanged.emit(),this.refresh())}get totalMatches(){return this.searchProvider.matchesCount}get useRegex(){return this._useRegex}set useRegex(e){this._useRegex!==e&&(this._useRegex=e,this.stateChanged.emit(),this.refresh())}get wholeWords(){return this._wholeWords}set wholeWords(e){this._wholeWords!==e&&(this._wholeWords=e,this.stateChanged.emit(),this.refresh())}dispose(){this.isDisposed||(this._searchExpression&&this.endQuery().catch((e=>{console.error(`Failed to end query '${this._searchExpression}.`,e)})),this.searchProvider.stateChanged.disconnect(this._onProviderStateChanged,this),this._searchDebouncer.dispose(),super.dispose())}async endQuery(){this._searchActive=!1,await this.searchProvider.endQuery(),this.stateChanged.emit()}async highlightNext(){await this.searchProvider.highlightNext(),this.stateChanged.emit()}async highlightPrevious(){await this.searchProvider.highlightPrevious(),this.stateChanged.emit()}refresh(){this._searchDebouncer.invoke().catch((e=>{console.error("Failed to invoke search document debouncer.",e)}))}async replaceAllMatches(){await this.searchProvider.replaceAllMatches(this._replaceText,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async replaceCurrentMatch(){await this.searchProvider.replaceCurrentMatch(this._replaceText,!0,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async setFilter(e,t){this._filters[e]!==t&&(this.searchProvider.validateFilter?(this._filters[e]=await this.searchProvider.validateFilter(e,t),this._filters[e]===t&&(this.stateChanged.emit(),this.refresh())):(this._filters[e]=t,this.stateChanged.emit(),this.refresh()))}async _updateSearch(){this._parsingError&&(this._parsingError="",this.stateChanged.emit());try{const e=this.searchExpression?p.parseQuery(this.searchExpression,this.caseSensitive,this.useRegex,this.wholeWords):null;e?(this._searchActive=!0,await this.searchProvider.startQuery(e,this._filters)):(this._searchActive=!1,await this.searchProvider.endQuery()),this.stateChanged.emit()}catch(e){this._parsingError=e.toString(),this.stateChanged.emit(),console.error(`Failed to parse expression ${this.searchExpression}`,e)}}_onProviderStateChanged(){this._searchActive&&this.refresh()}}!function(e){e.parseQuery=function(e,t,s,r){const i=t?"gm":"gim";let n=s?e:e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r&&(n="\\b"+n+"\\b");const a=new RegExp(n,i);return a.test("")?null:a}}(p||(p={}));var _=s(12030),v=s(16934),x=s(53312),C=s(78156);const E="jp-DocumentSearch-overlay-row",f="jp-DocumentSearch-input",y="jp-DocumentSearch-input-label",S="jp-DocumentSearch-input-wrapper",b="jp-DocumentSearch-input-button-off",w="jp-DocumentSearch-input-button-on",R="jp-DocumentSearch-up-down-button",I="jp-DocumentSearch-search-filter",N="jp-DocumentSearch-replace-button",T="jp-DocumentSearch-replace-button-wrapper",P="jp-DocumentSearch-button-content",M="jp-DocumentSearch-button-wrapper";function D(e){const[t,s]=(0,C.useState)(1),r=(0,C.useCallback)((t=>{var r;const i=t?t.target:null===(r=e.inputRef)||void 0===r?void 0:r.current;if(i){const e=i.value.split(/\n/);let t=e.reduce(((e,t)=>e.length>t.length?e:t),"");i.parentNode&&i.parentNode instanceof HTMLElement&&(i.parentNode.dataset.value=t),s(e.length)}}),[]);return(0,C.useEffect)((()=>{var t,s;null===(s=null===(t=e.inputRef)||void 0===t?void 0:t.current)||void 0===s||s.select(),r()}),[e.initialValue]),C.createElement("label",{className:y},C.createElement("textarea",{onChange:t=>{e.onChange(t),r(t)},onKeyDown:t=>{e.onKeyDown(t),r(t)},rows:t,placeholder:e.placeholder,className:f,key:e.autoUpdate?e.initialValue:null,tabIndex:0,ref:e.inputRef,title:e.title,defaultValue:e.initialValue,autoFocus:e.autoFocus}))}function k(e){var t;const s=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),r=(0,u.classes)(e.caseSensitive?w:b,P),i=(0,u.classes)(e.useRegex?w:b,P),n=(0,u.classes)(e.wholeWords?w:b,P),a=S;return C.createElement("div",{className:a},C.createElement(D,{placeholder:s.__("Find"),onChange:t=>e.onChange(t),onKeyDown:t=>e.onKeydown(t),inputRef:e.inputRef,initialValue:e.initialSearchText,title:s.__("Find"),autoFocus:!0,autoUpdate:!0}),C.createElement("button",{className:M,onClick:()=>{e.onCaseSensitiveToggled()},tabIndex:0,title:s.__("Match Case")},C.createElement(u.caseSensitiveIcon.react,{className:r,tag:"span"})),C.createElement("button",{className:M,onClick:()=>e.onWordToggled(),tabIndex:0,title:s.__("Match Whole Word")},C.createElement(u.wordIcon.react,{className:n,tag:"span"})),C.createElement("button",{className:M,onClick:()=>e.onRegexToggled(),tabIndex:0,title:s.__("Use Regular Expression")},C.createElement(u.regexIcon.react,{className:i,tag:"span"})))}function F(e){var t,s,r;const i=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),n=(0,u.classes)(e.preserveCase?w:b,P);return C.createElement("div",{className:"jp-DocumentSearch-replace-wrapper-class"},C.createElement("div",{className:S},C.createElement(D,{placeholder:i.__("Replace"),initialValue:null!==(s=e.replaceText)&&void 0!==s?s:"",onKeyDown:t=>e.onReplaceKeydown(t),onChange:t=>e.onChange(t),title:i.__("Replace"),autoFocus:!1,autoUpdate:!1}),(null===(r=e.replaceOptionsSupport)||void 0===r?void 0:r.preserveCase)?C.createElement("button",{className:M,onClick:()=>e.onPreserveCaseToggled(),tabIndex:0,title:i.__("Preserve Case")},C.createElement(u.caseSensitiveIcon.react,{className:n,tag:"span"})):null),C.createElement("button",{className:T,onClick:()=>e.onReplaceCurrent(),tabIndex:0},C.createElement("span",{className:`${N} ${P}`,tabIndex:0},i.__("Replace"))),C.createElement("button",{className:T,tabIndex:0,onClick:()=>e.onReplaceAll()},C.createElement("span",{className:`${N} ${P}`,tabIndex:-1},i.__("Replace All"))))}function O(e){var t,s;const r=null===(t=e.keyBindings)||void 0===t?void 0:t.next,i=null===(s=e.keyBindings)||void 0===s?void 0:s.previous,n=r?v.CommandRegistry.formatKeystroke(r.keys):"",a=i?v.CommandRegistry.formatKeystroke(i.keys):"",o=a?` (${a})`:"",l=n?` (${n})`:"",h=C.createElement("button",{className:M,onClick:()=>!!e.isEnabled&&e.onHighlightPrevious(),tabIndex:0,title:`${e.trans.__("Previous Match")}${o}`,disabled:!e.isEnabled},C.createElement(u.caretUpEmptyThinIcon.react,{className:(0,u.classes)(R,P),tag:"span"})),c=C.createElement("button",{className:M,onClick:()=>!!e.isEnabled&&e.onHighlightNext(),tabIndex:0,title:`${e.trans.__("Next Match")}${l}`,disabled:!e.isEnabled},C.createElement(u.caretDownEmptyThinIcon.react,{className:(0,u.classes)(R,P),tag:"span"}));return C.createElement("div",{className:"jp-DocumentSearch-up-down-wrapper"},h,c)}function j(e){return C.createElement("div",{className:"jp-DocumentSearch-index-counter"},0===e.totalMatches?"-/-":`${null===e.currentIndex?"-":e.currentIndex+1}/${e.totalMatches}`)}function A(e){let t=`jp-DocumentSearch-filter-button ${P}`;e.visible&&(t=`${t} jp-DocumentSearch-filter-button-enabled`);const s=e.anyEnabled?u.filterDotIcon:u.filterIcon;return C.createElement("button",{className:M,onClick:()=>e.toggleVisible(),tabIndex:0,title:e.visible?e.trans.__("Hide Search Filters"):e.trans.__("Show Search Filters")},C.createElement(s.react,{className:t,tag:"span",height:"20px",width:"20px"}))}function V(e){return C.createElement("label",{className:e.isEnabled?I:`${I} jp-DocumentSearch-search-filter-disabled`,title:e.description},C.createElement("input",{type:"checkbox",className:"jp-mod-styled",disabled:!e.isEnabled,checked:e.value,onChange:e.onToggle}),e.title)}class W extends C.Component{constructor(e){super(e),this.translator=e.translator||_.nullTranslator}_onSearchChange(e){const t=e.target.value;this.props.onSearchChanged(t)}_onSearchKeydown(e){if(13===e.keyCode)if(e.stopPropagation(),e.preventDefault(),e.ctrlKey){const t=e.target;this._insertNewLine(t),this.props.onSearchChanged(t.value)}else e.shiftKey?this.props.onHighlightPrevious():this.props.onHighlightNext()}_onReplaceKeydown(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),e.ctrlKey?this._insertNewLine(e.target):this.props.onReplaceCurrent())}_insertNewLine(e){const[t,s]=[e.selectionStart,e.selectionEnd];e.setRangeText("\n",t,s,"end")}_onClose(){this.props.onClose()}_onReplaceToggled(){if(!this.props.replaceEntryVisible)for(const e in this.props.filtersDefinition){const t=this.props.filtersDefinition[e];t.supportReplace||this.props.onFilterChanged(e,!1).catch((e=>{console.error(`Fail to update filter value for ${t.title}:\n${e}`)}))}this.props.onReplaceEntryShown(!this.props.replaceEntryVisible)}_toggleFiltersVisibility(){this.props.onFiltersVisibilityChanged(!this.props.filtersVisible)}render(){var e,t,s;const r=this.translator.load("jupyterlab"),i=!this.props.isReadOnly&&this.props.replaceEntryVisible,n=this.props.filtersDefinition,a=Object.keys(n).length>0,o=a?C.createElement(A,{visible:this.props.filtersVisible,anyEnabled:Object.keys(n).some((e=>{var t;const s=n[e];return null!==(t=this.props.filters[e])&&void 0!==t?t:s.default})),toggleVisible:()=>this._toggleFiltersVisibility(),trans:r}):null,l=null===(e=this.props.keyBindings)||void 0===e?void 0:e.toggleSearchInSelection,h=l?v.CommandRegistry.formatKeystroke(l.keys):"",c=h?` (${h})`:"",d=a?C.createElement("div",{className:"jp-DocumentSearch-search-options"},Object.keys(n).map((e=>{var t,s;const r=n[e],a=!i||r.supportReplace,o=a?r.description:null!==(t=r.disabledDescription)&&void 0!==t?t:r.description;return C.createElement(V,{key:e,title:r.title,description:o+("selection"==e?c:""),isEnabled:a,onToggle:async()=>{await this.props.onFilterChanged(e,!this.props.filters[e])},value:null!==(s=this.props.filters[e])&&void 0!==s?s:r.default})}))):null,p=this.props.replaceEntryVisible?u.caretDownIcon:u.caretRightIcon;return C.createElement(C.Fragment,null,C.createElement("div",{className:E},this.props.isReadOnly?C.createElement("div",{className:"jp-DocumentSearch-toggle-placeholder"}):C.createElement("button",{className:"jp-DocumentSearch-toggle-wrapper",onClick:()=>this._onReplaceToggled(),tabIndex:0,title:i?r.__("Hide Replace"):r.__("Show Replace")},C.createElement(p.react,{className:`jp-DocumentSearch-replace-toggle ${P}`,tag:"span",elementPosition:"center",height:"20px",width:"20px"})),C.createElement(k,{inputRef:this.props.searchInputRef,useRegex:this.props.useRegex,caseSensitive:this.props.caseSensitive,wholeWords:this.props.wholeWords,onCaseSensitiveToggled:this.props.onCaseSensitiveToggled,onRegexToggled:this.props.onRegexToggled,onWordToggled:this.props.onWordToggled,onKeydown:e=>this._onSearchKeydown(e),onChange:e=>this._onSearchChange(e),initialSearchText:this.props.initialSearchText,translator:this.translator}),o,C.createElement(j,{currentIndex:this.props.currentIndex,totalMatches:null!==(t=this.props.totalMatches)&&void 0!==t?t:0}),C.createElement(O,{onHighlightPrevious:()=>{this.props.onHighlightPrevious()},onHighlightNext:()=>{this.props.onHighlightNext()},trans:r,keyBindings:this.props.keyBindings,isEnabled:!!(null===(s=this.props.searchInputRef.current)||void 0===s?void 0:s.value)}),C.createElement("button",{className:M,onClick:()=>this._onClose(),tabIndex:0,title:r.__("Close Search Box")},C.createElement(u.closeIcon.react,{className:"jp-icon-hover",elementPosition:"center",height:"16px",width:"16px"}))),C.createElement("div",{className:E},i?C.createElement(C.Fragment,null,C.createElement(F,{onPreserveCaseToggled:this.props.onPreserveCaseToggled,onReplaceKeydown:e=>this._onReplaceKeydown(e),onChange:e=>this.props.onReplaceChanged(e.target.value),onReplaceCurrent:()=>this.props.onReplaceCurrent(),onReplaceAll:()=>this.props.onReplaceAll(),replaceOptionsSupport:this.props.replaceOptionsSupport,replaceText:this.props.replaceText,preserveCase:this.props.preserveCase,translator:this.translator}),C.createElement("div",{className:"jp-DocumentSearch-spacer"})):null),this.props.filtersVisible?d:null,!!this.props.errorMessage&&C.createElement("div",{className:"jp-DocumentSearch-regex-error"},this.props.errorMessage))}}class L extends u.VDomRenderer{constructor(e,t,s){super(e),this.translator=t,this._showReplace=!1,this._showFilters=!1,this._closed=new i.Signal(this),this.addClass("jp-DocumentSearch-overlay"),this._searchInput=C.createRef(),this._keyBindings=s}get closed(){return this._closed}focusSearchInput(){var e;null===(e=this._searchInput.current)||void 0===e||e.select()}setSearchText(e){this.model.initialQuery=e,e&&(this.model.searchExpression=e)}setReplaceText(e){this.model.replaceText=e}showReplace(){this.setReplaceInputVisibility(!0)}onCloseRequest(e){super.onCloseRequest(e),this._closed.emit(),this.model.endQuery()}setReplaceInputVisibility(e){this._showReplace!==e&&(this._showReplace=e,this.update())}setFiltersVisibility(e){this._showFilters!==e&&(this._showFilters=e,this.update())}render(){return this.model.filtersDefinitionChanged?C.createElement(x.UseSignal,{signal:this.model.filtersDefinitionChanged},(()=>this._renderOverlay())):this._renderOverlay()}_renderOverlay(){return C.createElement(W,{caseSensitive:this.model.caseSensitive,currentIndex:this.model.currentIndex,isReadOnly:this.model.isReadOnly,errorMessage:this.model.parsingError,filters:this.model.filters,filtersDefinition:this.model.filtersDefinition,preserveCase:this.model.preserveCase,replaceEntryVisible:this._showReplace,filtersVisible:this._showFilters,replaceOptionsSupport:this.model.replaceOptionsSupport,replaceText:this.model.replaceText,initialSearchText:this.model.initialQuery,searchInputRef:this._searchInput,totalMatches:this.model.totalMatches,translator:this.translator,useRegex:this.model.useRegex,wholeWords:this.model.wholeWords,onCaseSensitiveToggled:()=>{this.model.caseSensitive=!this.model.caseSensitive},onRegexToggled:()=>{this.model.useRegex=!this.model.useRegex},onWordToggled:()=>{this.model.wholeWords=!this.model.wholeWords},onFilterChanged:async(e,t)=>{await this.model.setFilter(e,t)},onFiltersVisibilityChanged:e=>{this.setFiltersVisibility(e)},onHighlightNext:()=>{this.model.highlightNext()},onHighlightPrevious:()=>{this.model.highlightPrevious()},onPreserveCaseToggled:()=>{this.model.preserveCase=!this.model.preserveCase},onSearchChanged:e=>{this.model.searchExpression=e},onClose:()=>{this.close()},onReplaceEntryShown:e=>{this.setReplaceInputVisibility(e)},onReplaceChanged:e=>{this.model.replaceText=e},onReplaceCurrent:()=>{this.model.replaceCurrentMatch()},onReplaceAll:()=>{this.model.replaceAllMatches()},keyBindings:this._keyBindings})}}var U=s(2549);class Q{constructor(e=_.nullTranslator){this.translator=e,this._changed=new i.Signal(this),this._providerMap=new Map}add(e,t){return this._providerMap.set(e,t),this._changed.emit(),new U.DisposableDelegate((()=>{this._providerMap.delete(e),this._changed.emit()}))}getProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return t.createNew(e,this.translator)}hasProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return!0;return!1}get changed(){return this._changed}}const $=new(s(20998).Token)("@jupyterlab/documentsearch:ISearchProviderRegistry","A service for a registry of search\n providers for the application. Plugins can register their UI elements with this registry\n to provide find/replace support.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6999],{36999:(e,t,s)=>{s.r(t),s.d(t,{FOUND_CLASSES:()=>o,GenericSearchProvider:()=>c,HTMLSearchEngine:()=>h,ISearchProviderRegistry:()=>$,SearchDocumentModel:()=>m,SearchDocumentView:()=>L,SearchProvider:()=>n,SearchProviderRegistry:()=>Q,TextSearchEngine:()=>d});var r=s(63485),i=s(81997);class n{constructor(e){this.widget=e,this._stateChanged=new i.Signal(this),this._filtersChanged=new i.Signal(this),this._disposed=!1}get stateChanged(){return this._stateChanged}get filtersChanged(){return this._filtersChanged}get currentMatchIndex(){return null}get isDisposed(){return this._disposed}get matchesCount(){return null}dispose(){this._disposed||(this._disposed=!0,i.Signal.clearData(this))}getInitialQuery(){return""}getFilters(){return{}}static preserveCase(e,t){return e.toUpperCase()===e?t.toUpperCase():e.toLowerCase()===e?t.toLowerCase():a(e)===e?a(t):t}}function a([e="",...t]){return e.toUpperCase()+""+t.join("").toLowerCase()}const o=["cm-string","cm-overlay","cm-searching"],l=["CodeMirror-selectedtext"];class h{static search(e,t){if(!(t instanceof Node))return console.warn("Unable to search with HTMLSearchEngine the provided object.",t),Promise.resolve([]);e.global||(e=new RegExp(e.source,e.flags+"g"));const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:s=>{let r=s.parentElement;for(;r!==t;){if(r.nodeName in h.UNSUPPORTED_ELEMENTS)return NodeFilter.FILTER_REJECT;r=r.parentElement}return e.test(s.textContent)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let i=null;for(;null!==(i=r.nextNode());){e.lastIndex=0;let t=null;for(;null!==(t=e.exec(i.textContent));)s.push({text:t[0],position:t.index,node:i})}return Promise.resolve(s)}}h.UNSUPPORTED_ELEMENTS={BASE:!0,HEAD:!0,LINK:!0,META:!0,STYLE:!0,TITLE:!0,BODY:!0,AREA:!0,AUDIO:!0,IMG:!0,MAP:!0,TRACK:!0,VIDEO:!0,APPLET:!0,EMBED:!0,IFRAME:!0,NOEMBED:!0,OBJECT:!0,PARAM:!0,PICTURE:!0,SOURCE:!0,CANVAS:!0,NOSCRIPT:!0,SCRIPT:!0,SVG:!0};class c extends n{constructor(){super(...arguments),this.isReadOnly=!0,this._matches=[],this._mutationObserver=new MutationObserver(this._onWidgetChanged.bind(this)),this._markNodes=new Array}static isApplicable(e){return e instanceof r.Widget}static createNew(e,t,s){return new c(e)}get currentMatchIndex(){return this._currentMatchIndex>=0?this._currentMatchIndex:null}get currentMatch(){var e;return null!==(e=this._matches[this._currentMatchIndex])&&void 0!==e?e:null}get matches(){return this._matches?this._matches.map((e=>Object.assign({},e))):this._matches}get matchesCount(){return this._matches.length}clearHighlight(){return this._currentMatchIndex>=0&&this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=-1,Promise.resolve()}dispose(){this.isDisposed||(this.endQuery().catch((e=>{console.error("Failed to end search query.",e)})),super.dispose())}async highlightNext(e){var t;return null!==(t=this._highlightNext(!1,null==e||e))&&void 0!==t?t:void 0}async highlightPrevious(e){var t;return null!==(t=this._highlightNext(!0,null==e||e))&&void 0!==t?t:void 0}async replaceCurrentMatch(e,t){return Promise.resolve(!1)}async replaceAllMatches(e){return Promise.resolve(!1)}async startQuery(e,t={}){if(await this.endQuery(),this._query=e,null===e)return Promise.resolve();const s=await h.search(e,this.widget.node);let r=0;for(;r<s.length;){let e=s[r].node,t=e.parentNode,i=[s[r]];for(;++r<s.length&&s[r].node===e;)i.unshift(s[r]);const n=i.map((s=>{const r=document.createElement("mark");r.classList.add(...o),r.textContent=s.text;const i=e.splitText(s.position);return i.textContent=i.textContent.slice(s.text.length),t.insertBefore(r,i),r}));for(let e=n.length-1;e>=0;e--)this._markNodes.push(n[e])}this._mutationObserver.observe(this.widget.node,{attributes:!1,characterData:!0,childList:!0,subtree:!0}),this._matches=s}async endQuery(){this._mutationObserver.disconnect(),this._markNodes.forEach((e=>{const t=e.parentNode;t.replaceChild(document.createTextNode(e.textContent),e),t.normalize()})),this._markNodes=[],this._matches=[],this._currentMatchIndex=-1}_highlightNext(e,t){if(0===this._matches.length)return null;if(-1===this._currentMatchIndex?this._currentMatchIndex=e?this.matches.length-1:0:(this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=e?this._currentMatchIndex-1:this._currentMatchIndex+1,t&&(this._currentMatchIndex<0||this._currentMatchIndex>=this._matches.length)&&(this._currentMatchIndex=(this._currentMatchIndex+this._matches.length)%this._matches.length)),this._currentMatchIndex>=0&&this._currentMatchIndex<this._matches.length){const t=this._markNodes[this._currentMatchIndex];return t.classList.add(...l),function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.left>=0&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(t)||t.scrollIntoView(e),t.focus(),this._matches[this._currentMatchIndex]}return this._currentMatchIndex=-1,null}async _onWidgetChanged(e,t){this._currentMatchIndex=-1,await this.startQuery(this._query),this._stateChanged.emit()}}const d={search(e,t){if("string"!=typeof t)try{t=JSON.stringify(t)}catch(e){return console.warn("Unable to search with TextSearchEngine non-JSON serializable object.",e,t),Promise.resolve([])}e.global||(e=new RegExp(e.source,e.flags+"g"));const s=new Array;let r=null;for(;null!==(r=e.exec(t));)s.push({text:r[0],position:r.index});return Promise.resolve(s)}};var p,u=s(14576),g=s(97934);class m extends u.VDomModel{constructor(e,t){if(super(),this.searchProvider=e,this._caseSensitive=!1,this._disposed=new i.Signal(this),this._parsingError="",this._preserveCase=!1,this._initialQuery="",this._filters={},this._replaceText="",this._searchActive=!1,this._searchExpression="",this._useRegex=!1,this._wholeWords=!1,this._filters={},this.searchProvider.getFilters){const e=this.searchProvider.getFilters();for(const t in e)this._filters[t]=e[t].default}e.stateChanged.connect(this._onProviderStateChanged,this),this._searchDebouncer=new g.Debouncer((()=>{this._updateSearch().catch((e=>{console.error("Failed to update search on document.",e)}))}),t)}get caseSensitive(){return this._caseSensitive}set caseSensitive(e){this._caseSensitive!==e&&(this._caseSensitive=e,this.stateChanged.emit(),this.refresh())}get currentIndex(){return this.searchProvider.currentMatchIndex}get disposed(){return this._disposed}get filters(){return this._filters}get filtersDefinition(){var e,t,s;return null!==(s=null===(t=(e=this.searchProvider).getFilters)||void 0===t?void 0:t.call(e))&&void 0!==s?s:{}}get filtersDefinitionChanged(){return this.searchProvider.filtersChanged||null}get initialQuery(){return this._initialQuery}set initialQuery(e){this._initialQuery=e||this._searchExpression}get suggestedInitialQuery(){return this.searchProvider.getInitialQuery()}get selectionState(){return this.searchProvider.getSelectionState?this.searchProvider.getSelectionState():void 0}get isReadOnly(){return this.searchProvider.isReadOnly}get replaceOptionsSupport(){return this.searchProvider.replaceOptionsSupport}get parsingError(){return this._parsingError}get preserveCase(){return this._preserveCase}set preserveCase(e){this._preserveCase!==e&&(this._preserveCase=e,this.stateChanged.emit(),this.refresh())}get replaceText(){return this._replaceText}set replaceText(e){this._replaceText!==e&&(this._replaceText=e,this.stateChanged.emit())}get searchExpression(){return this._searchExpression}set searchExpression(e){this._searchExpression!==e&&(this._searchExpression=e,this.stateChanged.emit(),this.refresh())}get totalMatches(){return this.searchProvider.matchesCount}get useRegex(){return this._useRegex}set useRegex(e){this._useRegex!==e&&(this._useRegex=e,this.stateChanged.emit(),this.refresh())}get wholeWords(){return this._wholeWords}set wholeWords(e){this._wholeWords!==e&&(this._wholeWords=e,this.stateChanged.emit(),this.refresh())}dispose(){this.isDisposed||(this._searchExpression&&this.endQuery().catch((e=>{console.error(`Failed to end query '${this._searchExpression}.`,e)})),this.searchProvider.stateChanged.disconnect(this._onProviderStateChanged,this),this._searchDebouncer.dispose(),super.dispose())}async endQuery(){this._searchActive=!1,await this.searchProvider.endQuery(),this.stateChanged.emit()}async highlightNext(){await this.searchProvider.highlightNext(),this.stateChanged.emit()}async highlightPrevious(){await this.searchProvider.highlightPrevious(),this.stateChanged.emit()}refresh(){this._searchDebouncer.invoke().catch((e=>{console.error("Failed to invoke search document debouncer.",e)}))}async replaceAllMatches(){await this.searchProvider.replaceAllMatches(this._replaceText,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async replaceCurrentMatch(){await this.searchProvider.replaceCurrentMatch(this._replaceText,!0,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async setFilter(e,t){this._filters[e]!==t&&(this.searchProvider.validateFilter?(this._filters[e]=await this.searchProvider.validateFilter(e,t),this._filters[e]===t&&(this.stateChanged.emit(),this.refresh())):(this._filters[e]=t,this.stateChanged.emit(),this.refresh()))}async _updateSearch(){this._parsingError&&(this._parsingError="",this.stateChanged.emit());try{const e=this.searchExpression?p.parseQuery(this.searchExpression,this.caseSensitive,this.useRegex,this.wholeWords):null;e?(this._searchActive=!0,await this.searchProvider.startQuery(e,this._filters)):(this._searchActive=!1,await this.searchProvider.endQuery()),this.stateChanged.emit()}catch(e){this._parsingError=e.toString(),this.stateChanged.emit(),console.error(`Failed to parse expression ${this.searchExpression}`,e)}}_onProviderStateChanged(){this._searchActive&&this.refresh()}}!function(e){e.parseQuery=function(e,t,s,r){const i=t?"gm":"gim";let n=s?e:e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r&&(n="\\b"+n+"\\b");const a=new RegExp(n,i);return a.test("")?null:a}}(p||(p={}));var _=s(90646),v=s(16934),x=s(20005),C=s(78156);const E="jp-DocumentSearch-overlay-row",f="jp-DocumentSearch-input",y="jp-DocumentSearch-input-label",S="jp-DocumentSearch-input-wrapper",b="jp-DocumentSearch-input-button-off",w="jp-DocumentSearch-input-button-on",R="jp-DocumentSearch-up-down-button",I="jp-DocumentSearch-search-filter",N="jp-DocumentSearch-replace-button",T="jp-DocumentSearch-replace-button-wrapper",P="jp-DocumentSearch-button-content",M="jp-DocumentSearch-button-wrapper";function D(e){const[t,s]=(0,C.useState)(1),r=(0,C.useCallback)((t=>{var r;const i=t?t.target:null===(r=e.inputRef)||void 0===r?void 0:r.current;if(i){const e=i.value.split(/\n/);let t=e.reduce(((e,t)=>e.length>t.length?e:t),"");i.parentNode&&i.parentNode instanceof HTMLElement&&(i.parentNode.dataset.value=t),s(e.length)}}),[]);return(0,C.useEffect)((()=>{var t,s;null===(s=null===(t=e.inputRef)||void 0===t?void 0:t.current)||void 0===s||s.select(),r()}),[e.initialValue]),C.createElement("label",{className:y},C.createElement("textarea",{onChange:t=>{e.onChange(t),r(t)},onKeyDown:t=>{e.onKeyDown(t),r(t)},rows:t,placeholder:e.placeholder,className:f,key:e.autoUpdate?e.initialValue:null,tabIndex:0,ref:e.inputRef,title:e.title,defaultValue:e.initialValue,autoFocus:e.autoFocus}))}function k(e){var t;const s=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),r=(0,u.classes)(e.caseSensitive?w:b,P),i=(0,u.classes)(e.useRegex?w:b,P),n=(0,u.classes)(e.wholeWords?w:b,P),a=S;return C.createElement("div",{className:a},C.createElement(D,{placeholder:s.__("Find"),onChange:t=>e.onChange(t),onKeyDown:t=>e.onKeydown(t),inputRef:e.inputRef,initialValue:e.initialSearchText,title:s.__("Find"),autoFocus:!0,autoUpdate:!0}),C.createElement("button",{className:M,onClick:()=>{e.onCaseSensitiveToggled()},tabIndex:0,title:s.__("Match Case")},C.createElement(u.caseSensitiveIcon.react,{className:r,tag:"span"})),C.createElement("button",{className:M,onClick:()=>e.onWordToggled(),tabIndex:0,title:s.__("Match Whole Word")},C.createElement(u.wordIcon.react,{className:n,tag:"span"})),C.createElement("button",{className:M,onClick:()=>e.onRegexToggled(),tabIndex:0,title:s.__("Use Regular Expression")},C.createElement(u.regexIcon.react,{className:i,tag:"span"})))}function F(e){var t,s,r;const i=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),n=(0,u.classes)(e.preserveCase?w:b,P);return C.createElement("div",{className:"jp-DocumentSearch-replace-wrapper-class"},C.createElement("div",{className:S},C.createElement(D,{placeholder:i.__("Replace"),initialValue:null!==(s=e.replaceText)&&void 0!==s?s:"",onKeyDown:t=>e.onReplaceKeydown(t),onChange:t=>e.onChange(t),title:i.__("Replace"),autoFocus:!1,autoUpdate:!1}),(null===(r=e.replaceOptionsSupport)||void 0===r?void 0:r.preserveCase)?C.createElement("button",{className:M,onClick:()=>e.onPreserveCaseToggled(),tabIndex:0,title:i.__("Preserve Case")},C.createElement(u.caseSensitiveIcon.react,{className:n,tag:"span"})):null),C.createElement("button",{className:T,onClick:()=>e.onReplaceCurrent(),tabIndex:0},C.createElement("span",{className:`${N} ${P}`,tabIndex:0},i.__("Replace"))),C.createElement("button",{className:T,tabIndex:0,onClick:()=>e.onReplaceAll()},C.createElement("span",{className:`${N} ${P}`,tabIndex:-1},i.__("Replace All"))))}function O(e){var t,s;const r=null===(t=e.keyBindings)||void 0===t?void 0:t.next,i=null===(s=e.keyBindings)||void 0===s?void 0:s.previous,n=r?v.CommandRegistry.formatKeystroke(r.keys):"",a=i?v.CommandRegistry.formatKeystroke(i.keys):"",o=a?` (${a})`:"",l=n?` (${n})`:"",h=C.createElement("button",{className:M,onClick:()=>!!e.isEnabled&&e.onHighlightPrevious(),tabIndex:0,title:`${e.trans.__("Previous Match")}${o}`,disabled:!e.isEnabled},C.createElement(u.caretUpEmptyThinIcon.react,{className:(0,u.classes)(R,P),tag:"span"})),c=C.createElement("button",{className:M,onClick:()=>!!e.isEnabled&&e.onHighlightNext(),tabIndex:0,title:`${e.trans.__("Next Match")}${l}`,disabled:!e.isEnabled},C.createElement(u.caretDownEmptyThinIcon.react,{className:(0,u.classes)(R,P),tag:"span"}));return C.createElement("div",{className:"jp-DocumentSearch-up-down-wrapper"},h,c)}function j(e){return C.createElement("div",{className:"jp-DocumentSearch-index-counter"},0===e.totalMatches?"-/-":`${null===e.currentIndex?"-":e.currentIndex+1}/${e.totalMatches}`)}function A(e){let t=`jp-DocumentSearch-filter-button ${P}`;e.visible&&(t=`${t} jp-DocumentSearch-filter-button-enabled`);const s=e.anyEnabled?u.filterDotIcon:u.filterIcon;return C.createElement("button",{className:M,onClick:()=>e.toggleVisible(),tabIndex:0,title:e.visible?e.trans.__("Hide Search Filters"):e.trans.__("Show Search Filters")},C.createElement(s.react,{className:t,tag:"span",height:"20px",width:"20px"}))}function V(e){return C.createElement("label",{className:e.isEnabled?I:`${I} jp-DocumentSearch-search-filter-disabled`,title:e.description},C.createElement("input",{type:"checkbox",className:"jp-mod-styled",disabled:!e.isEnabled,checked:e.value,onChange:e.onToggle}),e.title)}class W extends C.Component{constructor(e){super(e),this.translator=e.translator||_.nullTranslator}_onSearchChange(e){const t=e.target.value;this.props.onSearchChanged(t)}_onSearchKeydown(e){if(13===e.keyCode)if(e.stopPropagation(),e.preventDefault(),e.ctrlKey){const t=e.target;this._insertNewLine(t),this.props.onSearchChanged(t.value)}else e.shiftKey?this.props.onHighlightPrevious():this.props.onHighlightNext()}_onReplaceKeydown(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),e.ctrlKey?this._insertNewLine(e.target):this.props.onReplaceCurrent())}_insertNewLine(e){const[t,s]=[e.selectionStart,e.selectionEnd];e.setRangeText("\n",t,s,"end")}_onClose(){this.props.onClose()}_onReplaceToggled(){if(!this.props.replaceEntryVisible)for(const e in this.props.filtersDefinition){const t=this.props.filtersDefinition[e];t.supportReplace||this.props.onFilterChanged(e,!1).catch((e=>{console.error(`Fail to update filter value for ${t.title}:\n${e}`)}))}this.props.onReplaceEntryShown(!this.props.replaceEntryVisible)}_toggleFiltersVisibility(){this.props.onFiltersVisibilityChanged(!this.props.filtersVisible)}render(){var e,t,s;const r=this.translator.load("jupyterlab"),i=!this.props.isReadOnly&&this.props.replaceEntryVisible,n=this.props.filtersDefinition,a=Object.keys(n).length>0,o=a?C.createElement(A,{visible:this.props.filtersVisible,anyEnabled:Object.keys(n).some((e=>{var t;const s=n[e];return null!==(t=this.props.filters[e])&&void 0!==t?t:s.default})),toggleVisible:()=>this._toggleFiltersVisibility(),trans:r}):null,l=null===(e=this.props.keyBindings)||void 0===e?void 0:e.toggleSearchInSelection,h=l?v.CommandRegistry.formatKeystroke(l.keys):"",c=h?` (${h})`:"",d=a?C.createElement("div",{className:"jp-DocumentSearch-search-options"},Object.keys(n).map((e=>{var t,s;const r=n[e],a=!i||r.supportReplace,o=a?r.description:null!==(t=r.disabledDescription)&&void 0!==t?t:r.description;return C.createElement(V,{key:e,title:r.title,description:o+("selection"==e?c:""),isEnabled:a,onToggle:async()=>{await this.props.onFilterChanged(e,!this.props.filters[e])},value:null!==(s=this.props.filters[e])&&void 0!==s?s:r.default})}))):null,p=this.props.replaceEntryVisible?u.caretDownIcon:u.caretRightIcon;return C.createElement(C.Fragment,null,C.createElement("div",{className:E},this.props.isReadOnly?C.createElement("div",{className:"jp-DocumentSearch-toggle-placeholder"}):C.createElement("button",{className:"jp-DocumentSearch-toggle-wrapper",onClick:()=>this._onReplaceToggled(),tabIndex:0,title:i?r.__("Hide Replace"):r.__("Show Replace")},C.createElement(p.react,{className:`jp-DocumentSearch-replace-toggle ${P}`,tag:"span",elementPosition:"center",height:"20px",width:"20px"})),C.createElement(k,{inputRef:this.props.searchInputRef,useRegex:this.props.useRegex,caseSensitive:this.props.caseSensitive,wholeWords:this.props.wholeWords,onCaseSensitiveToggled:this.props.onCaseSensitiveToggled,onRegexToggled:this.props.onRegexToggled,onWordToggled:this.props.onWordToggled,onKeydown:e=>this._onSearchKeydown(e),onChange:e=>this._onSearchChange(e),initialSearchText:this.props.initialSearchText,translator:this.translator}),o,C.createElement(j,{currentIndex:this.props.currentIndex,totalMatches:null!==(t=this.props.totalMatches)&&void 0!==t?t:0}),C.createElement(O,{onHighlightPrevious:()=>{this.props.onHighlightPrevious()},onHighlightNext:()=>{this.props.onHighlightNext()},trans:r,keyBindings:this.props.keyBindings,isEnabled:!!(null===(s=this.props.searchInputRef.current)||void 0===s?void 0:s.value)}),C.createElement("button",{className:M,onClick:()=>this._onClose(),tabIndex:0,title:r.__("Close Search Box")},C.createElement(u.closeIcon.react,{className:"jp-icon-hover",elementPosition:"center",height:"16px",width:"16px"}))),C.createElement("div",{className:E},i?C.createElement(C.Fragment,null,C.createElement(F,{onPreserveCaseToggled:this.props.onPreserveCaseToggled,onReplaceKeydown:e=>this._onReplaceKeydown(e),onChange:e=>this.props.onReplaceChanged(e.target.value),onReplaceCurrent:()=>this.props.onReplaceCurrent(),onReplaceAll:()=>this.props.onReplaceAll(),replaceOptionsSupport:this.props.replaceOptionsSupport,replaceText:this.props.replaceText,preserveCase:this.props.preserveCase,translator:this.translator}),C.createElement("div",{className:"jp-DocumentSearch-spacer"})):null),this.props.filtersVisible?d:null,!!this.props.errorMessage&&C.createElement("div",{className:"jp-DocumentSearch-regex-error"},this.props.errorMessage))}}class L extends u.VDomRenderer{constructor(e,t,s){super(e),this.translator=t,this._showReplace=!1,this._showFilters=!1,this._closed=new i.Signal(this),this.addClass("jp-DocumentSearch-overlay"),this._searchInput=C.createRef(),this._keyBindings=s}get closed(){return this._closed}focusSearchInput(){var e;null===(e=this._searchInput.current)||void 0===e||e.select()}setSearchText(e){this.model.initialQuery=e,e&&(this.model.searchExpression=e)}setReplaceText(e){this.model.replaceText=e}showReplace(){this.setReplaceInputVisibility(!0)}onCloseRequest(e){super.onCloseRequest(e),this._closed.emit(),this.model.endQuery()}setReplaceInputVisibility(e){this._showReplace!==e&&(this._showReplace=e,this.update())}setFiltersVisibility(e){this._showFilters!==e&&(this._showFilters=e,this.update())}render(){return this.model.filtersDefinitionChanged?C.createElement(x.UseSignal,{signal:this.model.filtersDefinitionChanged},(()=>this._renderOverlay())):this._renderOverlay()}_renderOverlay(){return C.createElement(W,{caseSensitive:this.model.caseSensitive,currentIndex:this.model.currentIndex,isReadOnly:this.model.isReadOnly,errorMessage:this.model.parsingError,filters:this.model.filters,filtersDefinition:this.model.filtersDefinition,preserveCase:this.model.preserveCase,replaceEntryVisible:this._showReplace,filtersVisible:this._showFilters,replaceOptionsSupport:this.model.replaceOptionsSupport,replaceText:this.model.replaceText,initialSearchText:this.model.initialQuery,searchInputRef:this._searchInput,totalMatches:this.model.totalMatches,translator:this.translator,useRegex:this.model.useRegex,wholeWords:this.model.wholeWords,onCaseSensitiveToggled:()=>{this.model.caseSensitive=!this.model.caseSensitive},onRegexToggled:()=>{this.model.useRegex=!this.model.useRegex},onWordToggled:()=>{this.model.wholeWords=!this.model.wholeWords},onFilterChanged:async(e,t)=>{await this.model.setFilter(e,t)},onFiltersVisibilityChanged:e=>{this.setFiltersVisibility(e)},onHighlightNext:()=>{this.model.highlightNext()},onHighlightPrevious:()=>{this.model.highlightPrevious()},onPreserveCaseToggled:()=>{this.model.preserveCase=!this.model.preserveCase},onSearchChanged:e=>{this.model.searchExpression=e},onClose:()=>{this.close()},onReplaceEntryShown:e=>{this.setReplaceInputVisibility(e)},onReplaceChanged:e=>{this.model.replaceText=e},onReplaceCurrent:()=>{this.model.replaceCurrentMatch()},onReplaceAll:()=>{this.model.replaceAllMatches()},keyBindings:this._keyBindings})}}var U=s(2549);class Q{constructor(e=_.nullTranslator){this.translator=e,this._changed=new i.Signal(this),this._providerMap=new Map}add(e,t){return this._providerMap.set(e,t),this._changed.emit(),new U.DisposableDelegate((()=>{this._providerMap.delete(e),this._changed.emit()}))}getProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return t.createNew(e,this.translator)}hasProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return!0;return!1}get changed(){return this._changed}}const $=new(s(20998).Token)("@jupyterlab/documentsearch:ISearchProviderRegistry","A service for a registry of search\n providers for the application. Plugins can register their UI elements with this registry\n to provide find/replace support.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7226],{47226:(t,e,s)=>{s.r(e),s.d(e,{OutputArea:()=>x,OutputAreaModel:()=>d,OutputPrompt:()=>v,SimplifiedOutputArea:()=>w,Stdin:()=>O});var i,n=s(81139),r=s(31231),a=s(81221),o=s(33625),h=s(20998),u=s(81997);class d{constructor(t={}){if(this.clearNext=!1,this._lastStream="",this._trusted=!1,this._isDisposed=!1,this._stateChanged=new u.Signal(this),this._changed=new u.Signal(this),this._trusted=!!t.trusted,this.contentFactory=t.contentFactory||d.defaultContentFactory,this.list=new r.ObservableList,t.values)for(const e of t.values){const t=this._add(e)-1;this.list.get(t).changed.connect(this._onGenericChange,this)}this.list.changed.connect(this._onListChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get length(){return this.list?this.list.length:0}get trusted(){return this._trusted}set trusted(t){if(t===this._trusted)return;const e=this._trusted=t;for(let t=0;t<this.list.length;t++){const s=this.list.get(t),i=s.toJSON(),n=this._createItem({value:i,trusted:e});this.list.set(t,n),s.dispose()}}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.list.dispose(),u.Signal.clearData(this))}get(t){return this.list.get(t)}set(t,e){e=h.JSONExt.deepCopy(e),i.normalize(e);const s=this._createItem({value:e,trusted:this._trusted});this.list.set(t,s)}add(t){return this.clearNext&&(this.clear(),this.clearNext=!1),this._add(t)}clear(t=!1){if(this._lastStream="",t)this.clearNext=!0;else{for(const t of this.list)t.dispose();this.list.clear()}}fromJSON(t){this.clear();for(const e of t)this._add(e)}toJSON(){return Array.from((0,o.map)(this.list,(t=>t.toJSON())))}_add(t){const e=this._trusted;if(t=h.JSONExt.deepCopy(t),i.normalize(t),n.isStream(t)&&this._lastStream&&t.name===this._lastName&&this.shouldCombine({value:t,lastModel:this.list.get(this.length-1)})){this._lastStream+=t.text,this._lastStream=i.removeOverwrittenChars(this._lastStream),t.text=this._lastStream;const s=this._createItem({value:t,trusted:e}),n=this.length-1,r=this.list.get(n);return this.list.set(n,s),r.dispose(),this.length}n.isStream(t)&&(t.text=i.removeOverwrittenChars(t.text));const s=this._createItem({value:t,trusted:e});return n.isStream(t)?(this._lastStream=t.text,this._lastName=t.name):this._lastStream="",this.list.push(s)}shouldCombine(t){return!0}_createItem(t){return this.contentFactory.createOutputModel(t)}_onListChanged(t,e){switch(e.type){case"add":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)}));break;case"remove":e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}));break;case"set":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)})),e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}))}this._changed.emit(e)}_onGenericChange(t){let e,s=null;for(e=0;e<this.list.length&&(s=this.list.get(e),s!==t);e++);null!=s&&(this._stateChanged.emit(e),this._changed.emit({type:"set",newIndex:e,oldIndex:e,oldValues:[s],newValues:[s]}))}}!function(t){class e{createOutputModel(t){return new a.OutputModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(d||(d={})),function(t){t.normalize=function(t){n.isStream(t)&&Array.isArray(t.text)&&(t.text=t.text.join("\n"))},t.removeOverwrittenChars=function(t){return function(t){for(t=t.replace(/\r+\n/gm,"\n");t.search(/\r[^$]/g)>-1;){const e=t.match(/^(.*)\r+/m)[1];let s=t.match(/\r+(.*)$/m)[1];s+=e.slice(s.length,e.length),t=t.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,s)}return t}(function(t){let e=t;do{e=(t=e).replace(/[^\n]\x08/gm,"")}while(e.length<t.length);return t}(t))}}(i||(i={}));var l=s(53312),c=s(87408),p=s(12030),_=s(14421),m=s(63485);const g="jp-OutputArea-child",y="jp-OutputArea-output",f="jp-OutputArea-prompt";class x extends m.Widget{constructor(t){var e,s,i,n;super(),this.outputLengthChanged=new u.Signal(this),this._onIOPub=t=>{const e=this.model,s=t.header.msg_type;let i;const n=(t.content.transient||{}).display_id;let r;switch(s){case"execute_result":case"display_data":case"stream":case"error":i={...t.content,output_type:s},e.add(i);break;case"clear_output":{const s=t.content.wait;e.clear(s);break}case"update_display_data":if(i={...t.content,output_type:"display_data"},r=this._displayIdMap.get(n),r)for(const t of r)e.set(t,i);break;case"status":"idle"===t.content.execution_state&&(this._pendingInput=!1)}n&&"display_data"===s&&(r=this._displayIdMap.get(n)||[],r.push(e.length-1),this._displayIdMap.set(n,r))},this._onExecuteReply=t=>{const e=this.model,s=t.content;if("ok"!==s.status)return;const i=s&&s.payload;if(!i||!i.length)return;const n=i.filter((t=>"page"===t.source));if(!n.length)return;const r={output_type:"display_data",data:JSON.parse(JSON.stringify(n[0])).data,metadata:{}};e.add(r)},this._displayIdMap=new Map,this._minHeightTimeout=null,this._inputRequested=new u.Signal(this),this._toggleScrolling=new u.Signal(this),this._initialize=new u.Signal(this),this._outputTracker=new l.WidgetTracker({namespace:h.UUID.uuid4()}),this._inputHistoryScope="global",this._pendingInput=!1,super.layout=new m.PanelLayout,this.addClass("jp-OutputArea"),this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:x.defaultContentFactory,this.rendermime=t.rendermime,this._maxNumberOutputs=null!==(s=t.maxNumberOutputs)&&void 0!==s?s:1/0,this._translator=null!==(i=t.translator)&&void 0!==i?i:p.nullTranslator,this._inputHistoryScope=null!==(n=t.inputHistoryScope)&&void 0!==n?n:"global";const r=this.model=t.model;for(let t=0;t<Math.min(r.length,this._maxNumberOutputs+1);t++){const e=r.get(t);this._insertOutput(t,e)}r.changed.connect(this.onModelChanged,this),r.stateChanged.connect(this.onStateChanged,this),t.promptOverlay&&this._addPromptOverlay()}get layout(){return super.layout}get widgets(){return this.layout.widgets}get future(){return this._future}set future(t){if(this.model.isDisposed)throw Error("Model is disposed");this._future!==t&&(this._future&&this._future.dispose(),this._future=t,t.done.finally((()=>{this._pendingInput=!1})).catch((()=>{})),this.model.clear(),this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))),t.onIOPub=this._onIOPub,t.onReply=this._onExecuteReply,t.onStdin=e=>{c.KernelMessage.isInputRequestMsg(e)&&this.onInputRequest(e,t)})}get inputRequested(){return this._inputRequested}get pendingInput(){return this._pendingInput}get maxNumberOutputs(){return this._maxNumberOutputs}set maxNumberOutputs(t){if(t<=0)return void console.warn("OutputArea.maxNumberOutputs must be strictly positive.");const e=this._maxNumberOutputs;this._maxNumberOutputs=t,e<t&&this._showTrimmedOutputs(e)}dispose(){this._future&&(this._future.dispose(),this._future=null),this._displayIdMap.clear(),this._outputTracker.dispose(),super.dispose()}onModelChanged(t,e){switch(e.type){case"add":this._insertOutput(e.newIndex,e.newValues[0]);break;case"remove":if(this.widgets.length)if(0===this.model.length)this._clear();else{const t=e.oldIndex;for(let s=0;s<e.oldValues.length&&t<this.widgets.length;++s){const e=this.widgets[t];e.parent=null,e.dispose()}this._moveDisplayIdIndices(t,e.oldValues.length),this._preventHeightChangeJitter()}break;case"set":this._setOutput(e.newIndex,e.newValues[0])}this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}get toggleScrolling(){return this._toggleScrolling}get initialize(){return this._initialize}_addPromptOverlay(){const t=document.createElement("div");t.className="jp-OutputArea-promptOverlay",t.addEventListener("click",(()=>{this._toggleScrolling.emit()})),this.node.appendChild(t),requestAnimationFrame((()=>{this._initialize.emit()}))}_moveDisplayIdIndices(t,e){this._displayIdMap.forEach((s=>{const i=t+e;for(let n=s.length-1;n>=0;--n){const r=s[n];r>=t&&r<i?s.splice(n,1):r>=i&&(s[n]-=e)}}))}onStateChanged(t,e){const s=Math.min(this.model.length,this._maxNumberOutputs);if(e){if(e>=this._maxNumberOutputs)return;this._setOutput(e,this.model.get(e))}else for(let t=0;t<s;t++)this._setOutput(t,this.model.get(t));this.outputLengthChanged.emit(s)}_clear(){if(!this.widgets.length)return;const t=this.widgets.length;for(let e=0;e<t;e++){const t=this.widgets[0];t.parent=null,t.dispose()}this._displayIdMap.clear(),this._preventHeightChangeJitter()}_preventHeightChangeJitter(){const t=this.node.getBoundingClientRect();this.node.style.minHeight=`${t.height}px`,this._minHeightTimeout&&window.clearTimeout(this._minHeightTimeout),this._minHeightTimeout=window.setTimeout((()=>{this.isDisposed||(this.node.style.minHeight="")}),50)}onInputRequest(t,e){const s=this.contentFactory,i=t.content.prompt,n=t.content.password,r=new m.Panel;r.addClass(g),r.addClass("jp-OutputArea-stdin-item");const a=s.createOutputPrompt();a.addClass(f),r.addWidget(a),this._pendingInput=!0;const o=s.createStdin({parent_header:t.header,prompt:i,password:n,future:e,translator:this._translator,inputHistoryScope:this._inputHistoryScope});o.addClass(y),r.addWidget(o),this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length),this._inputRequested.emit(o);const h=o.node.getElementsByTagName("input")[0];o.value.then((t=>{this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length+1),r.addClass("jp-OutputArea-stdin-hiding"),this.model.add({output_type:"stream",name:"stdin",text:t+"\n"}),h.focus(),this._pendingInput=!1,window.setTimeout((()=>{const t=document.activeElement;r.dispose(),t&&t instanceof HTMLElement&&t.focus()}),500)})),this.layout.addWidget(r)}_setOutput(t,e){if(t>=this._maxNumberOutputs)return;const s=this.layout.widgets[t],i=s.widgets?s.widgets.filter((t=>"renderModel"in t)).pop():s,n=this.rendermime.preferredMimeType(e.data,e.trusted?"any":"ensure");C.currentPreferredMimetype.get(i)===n&&x.isIsolated(n,e.metadata)===i instanceof C.IsolatedRenderer?i.renderModel(e):(this.layout.widgets[t].dispose(),this._insertOutput(t,e))}_insertOutput(t,e){if(t>this._maxNumberOutputs)return;const s=this.layout;if(t===this._maxNumberOutputs){const e=new C.TrimmedOutputs(this._maxNumberOutputs,(()=>{const t=this._maxNumberOutputs;this._maxNumberOutputs=1/0,this._showTrimmedOutputs(t)}));s.insertWidget(t,this._wrappedOutput(e))}else{let i=this.createOutputItem(e);i?i.toggleClass("jp-OutputArea-executeResult",null!==e.executionCount):i=new m.Widget,this._outputTracker.has(i)||this._outputTracker.add(i),s.insertWidget(t,i)}}get outputTracker(){return this._outputTracker}_showTrimmedOutputs(t){this.widgets[t].dispose();for(let e=t;e<this.model.length;e++)this._insertOutput(e,this.model.get(e));this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}createOutputItem(t){const e=this.createRenderedMimetype(t);return e?this._wrappedOutput(e,t.executionCount):null}createRenderedMimetype(t){const e=this.rendermime.preferredMimeType(t.data,t.trusted?"any":"ensure");if(!e)return null;let s=this.rendermime.createRenderer(e);return!0===x.isIsolated(e,t.metadata)&&(s=new C.IsolatedRenderer(s)),C.currentPreferredMimetype.set(s,e),s.renderModel(t).catch((t=>{const e=document.createElement("pre"),i=this._translator.load("jupyterlab");e.textContent=i.__("Javascript Error: %1",t.message),s.node.appendChild(e),s.node.className="lm-Widget jp-RenderedText",s.node.setAttribute("data-mime-type","application/vnd.jupyter.stderr")})),s}_wrappedOutput(t,e=null){const s=new C.OutputPanel;s.addClass(g);const i=this.contentFactory.createOutputPrompt();return i.executionCount=e,i.addClass(f),s.addWidget(i),t.addClass(y),s.addWidget(t),s}}class w extends x{onInputRequest(t,e){}createOutputItem(t){const e=this.createRenderedMimetype(t);if(!e)return null;const s=new C.OutputPanel;return s.addClass(g),e.addClass(y),s.addWidget(e),s}}!function(t){t.execute=async function(t,e,s,i){var n;let r=!0;i&&Array.isArray(i.tags)&&-1!==i.tags.indexOf("raises-exception")&&(r=!1);const a={code:t,stop_on_error:r},o=null===(n=s.session)||void 0===n?void 0:n.kernel;if(!o)throw new Error("Session has no kernel.");const h=o.requestExecute(a,!1,i);return e.future=h,h.done},t.isIsolated=function(t,e){const s=e[t];return s&&void 0!==s.isolated?!!s.isolated:!!e.isolated};class e{createOutputPrompt(){return new v}createStdin(t){return new O(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(x||(x={}));class v extends m.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-OutputPrompt")}get executionCount(){return this._executionCount}set executionCount(t){this._executionCount=t,this.node.textContent=null===t?"":`[${t}]:`}}class O extends m.Widget{static _historyIx(t,e){const s=O._history.get(t);if(!s)return;const i=s.length;return e<=0?i+e:void 0}static _historyAt(t,e){const s=O._history.get(t);if(!s)return;const i=s.length,n=O._historyIx(t,e);return void 0!==n&&n<i?s[n]:void 0}static _historyPush(t,e){const s=O._history.get(t);s.push(e),s.length>1e3&&s.shift()}static _historySearch(t,e,s,i=!0){const n=O._history.get(t),r=n.length,a=O._historyIx(t,s),o=t=>-1!==t.search(e);if(void 0!==a)if(i){if(0===a)return;const t=n.slice(0,a).findLastIndex(o);if(-1!==t)return t-r}else{if(a>=r-1)return;const t=n.slice(a+1).findIndex(o);if(-1!==t)return t-r+a+1}}constructor(t){var e;super({node:C.createInputWidgetNode(t.prompt,t.password)}),this._promise=new h.PromiseDelegate,this._resolved=!1,this.addClass("jp-Stdin"),this._future=t.future,this._historyIndex=0,this._historyKey="session"===t.inputHistoryScope?t.parent_header.session:"",this._historyPat="",this._parentHeader=t.parent_header,this._password=t.password,this._trans=(null!==(e=t.translator)&&void 0!==e?e:p.nullTranslator).load("jupyterlab"),this._value=t.prompt+" ",this._input=this.node.getElementsByTagName("input")[0],this._password?this._input.placeholder="":this._input.placeholder=this._trans.__("↑↓ for history. Search history with c-↑/c-↓"),O._history.has(this._historyKey)||O._history.set(this._historyKey,[])}get value(){return this._promise.promise.then((()=>this._value))}handleEvent(t){if(this._resolved)return void t.preventDefault();const e=this._input;if("keydown"===t.type)if("Enter"===t.key)this.resetSearch(),this._future.sendInputReply({status:"ok",value:e.value},this._parentHeader),this._password?this._value+="········":(this._value+=e.value,O._historyPush(this._historyKey,e.value)),this._resolved=!0,this._promise.resolve(void 0);else if("Escape"===t.key)this.resetSearch(),e.blur();else if(!t.ctrlKey||"ArrowUp"!==t.key&&"ArrowDown"!==t.key){if("ArrowUp"===t.key){this.resetSearch();const s=O._historyAt(this._historyKey,this._historyIndex-1);s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),--this._historyIndex,t.preventDefault())}else if("ArrowDown"===t.key)if(this.resetSearch(),0===this._historyIndex);else if(-1===this._historyIndex)this._setInputValue(this._valueCache),++this._historyIndex;else{const t=O._historyAt(this._historyKey,this._historyIndex+1);t&&(this._setInputValue(t),++this._historyIndex)}}else{""===this._historyPat&&(this._historyPat=e.value);const s="ArrowUp"===t.key,i=O._historySearch(this._historyKey,this._historyPat,this._historyIndex,s);if(void 0!==i){const s=O._historyAt(this._historyKey,i);void 0!==s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),this._historyIndex=i,t.preventDefault())}}}resetSearch(){this._historyPat=""}onAfterAttach(t){this._input.addEventListener("keydown",this),this._input.focus()}onBeforeDetach(t){this._input.removeEventListener("keydown",this)}_setInputValue(t){this._input.value=t,this._input.setSelectionRange(t.length,t.length)}}var C;O._history=new Map,function(t){t.createInputWidgetNode=function(t,e){const s=document.createElement("div"),i=document.createElement("pre");i.className="jp-Stdin-prompt",i.textContent=t;const n=document.createElement("input");return n.className="jp-Stdin-input",e&&(n.type="password"),s.appendChild(i),i.appendChild(n),s};class e extends m.Widget{constructor(t){super({node:document.createElement("iframe")}),this.addClass("jp-mod-isolated"),this._wrapped=t;const e=this.node;e.frameBorder="0",e.scrolling="auto",e.addEventListener("load",(()=>{e.contentDocument.open(),e.contentDocument.write(this._wrapped.node.innerHTML),e.contentDocument.close();const t=e.contentDocument.body;e.style.height=`${t.scrollHeight}px`,e.heightChangeObserver=new ResizeObserver((()=>{e.style.height=`${t.scrollHeight}px`})),e.heightChangeObserver.observe(t)}))}renderModel(t){return this._wrapped.renderModel(t)}}t.IsolatedRenderer=e,t.currentPreferredMimetype=new _.AttachedProperty({name:"preferredMimetype",create:t=>""});class s extends m.Panel{constructor(t){super(t)}_onContext(t){this.node.focus()}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("contextmenu",this._onContext.bind(this))}onBeforeDetach(t){super.onAfterDetach(t),this.node.removeEventListener("contextmenu",this._onContext.bind(this))}}t.OutputPanel=s;class i extends m.Widget{constructor(t,e){const s=document.createElement("div"),i=`The first ${t} are displayed`;s.insertAdjacentHTML("afterbegin",`<a title=${i}>\n <pre>Show more outputs</pre>\n </a>`),super({node:s}),this._onClick=e,this.addClass("jp-TrimmedOutputs"),this.addClass("jp-RenderedHTMLCommon")}handleEvent(t){"click"===t.type&&this._onClick(t)}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("click",this)}onBeforeDetach(t){super.onBeforeDetach(t),this.node.removeEventListener("click",this)}}t.TrimmedOutputs=i}(C||(C={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7226],{47226:(t,e,s)=>{s.r(e),s.d(e,{OutputArea:()=>x,OutputAreaModel:()=>d,OutputPrompt:()=>v,SimplifiedOutputArea:()=>w,Stdin:()=>O});var i,n=s(57033),r=s(42503),a=s(1323),o=s(33625),h=s(20998),u=s(81997);class d{constructor(t={}){if(this.clearNext=!1,this._lastStream="",this._trusted=!1,this._isDisposed=!1,this._stateChanged=new u.Signal(this),this._changed=new u.Signal(this),this._trusted=!!t.trusted,this.contentFactory=t.contentFactory||d.defaultContentFactory,this.list=new r.ObservableList,t.values)for(const e of t.values){const t=this._add(e)-1;this.list.get(t).changed.connect(this._onGenericChange,this)}this.list.changed.connect(this._onListChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get length(){return this.list?this.list.length:0}get trusted(){return this._trusted}set trusted(t){if(t===this._trusted)return;const e=this._trusted=t;for(let t=0;t<this.list.length;t++){const s=this.list.get(t),i=s.toJSON(),n=this._createItem({value:i,trusted:e});this.list.set(t,n),s.dispose()}}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.list.dispose(),u.Signal.clearData(this))}get(t){return this.list.get(t)}set(t,e){e=h.JSONExt.deepCopy(e),i.normalize(e);const s=this._createItem({value:e,trusted:this._trusted});this.list.set(t,s)}add(t){return this.clearNext&&(this.clear(),this.clearNext=!1),this._add(t)}clear(t=!1){if(this._lastStream="",t)this.clearNext=!0;else{for(const t of this.list)t.dispose();this.list.clear()}}fromJSON(t){this.clear();for(const e of t)this._add(e)}toJSON(){return Array.from((0,o.map)(this.list,(t=>t.toJSON())))}_add(t){const e=this._trusted;if(t=h.JSONExt.deepCopy(t),i.normalize(t),n.isStream(t)&&this._lastStream&&t.name===this._lastName&&this.shouldCombine({value:t,lastModel:this.list.get(this.length-1)})){this._lastStream+=t.text,this._lastStream=i.removeOverwrittenChars(this._lastStream),t.text=this._lastStream;const s=this._createItem({value:t,trusted:e}),n=this.length-1,r=this.list.get(n);return this.list.set(n,s),r.dispose(),this.length}n.isStream(t)&&(t.text=i.removeOverwrittenChars(t.text));const s=this._createItem({value:t,trusted:e});return n.isStream(t)?(this._lastStream=t.text,this._lastName=t.name):this._lastStream="",this.list.push(s)}shouldCombine(t){return!0}_createItem(t){return this.contentFactory.createOutputModel(t)}_onListChanged(t,e){switch(e.type){case"add":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)}));break;case"remove":e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}));break;case"set":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)})),e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}))}this._changed.emit(e)}_onGenericChange(t){let e,s=null;for(e=0;e<this.list.length&&(s=this.list.get(e),s!==t);e++);null!=s&&(this._stateChanged.emit(e),this._changed.emit({type:"set",newIndex:e,oldIndex:e,oldValues:[s],newValues:[s]}))}}!function(t){class e{createOutputModel(t){return new a.OutputModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(d||(d={})),function(t){t.normalize=function(t){n.isStream(t)&&Array.isArray(t.text)&&(t.text=t.text.join("\n"))},t.removeOverwrittenChars=function(t){return function(t){for(t=t.replace(/\r+\n/gm,"\n");t.search(/\r[^$]/g)>-1;){const e=t.match(/^(.*)\r+/m)[1];let s=t.match(/\r+(.*)$/m)[1];s+=e.slice(s.length,e.length),t=t.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,s)}return t}(function(t){let e=t;do{e=(t=e).replace(/[^\n]\x08/gm,"")}while(e.length<t.length);return t}(t))}}(i||(i={}));var l=s(20005),c=s(50558),p=s(90646),_=s(14421),m=s(63485);const g="jp-OutputArea-child",y="jp-OutputArea-output",f="jp-OutputArea-prompt";class x extends m.Widget{constructor(t){var e,s,i,n;super(),this.outputLengthChanged=new u.Signal(this),this._onIOPub=t=>{const e=this.model,s=t.header.msg_type;let i;const n=(t.content.transient||{}).display_id;let r;switch(s){case"execute_result":case"display_data":case"stream":case"error":i={...t.content,output_type:s},e.add(i);break;case"clear_output":{const s=t.content.wait;e.clear(s);break}case"update_display_data":if(i={...t.content,output_type:"display_data"},r=this._displayIdMap.get(n),r)for(const t of r)e.set(t,i);break;case"status":"idle"===t.content.execution_state&&(this._pendingInput=!1)}n&&"display_data"===s&&(r=this._displayIdMap.get(n)||[],r.push(e.length-1),this._displayIdMap.set(n,r))},this._onExecuteReply=t=>{const e=this.model,s=t.content;if("ok"!==s.status)return;const i=s&&s.payload;if(!i||!i.length)return;const n=i.filter((t=>"page"===t.source));if(!n.length)return;const r={output_type:"display_data",data:JSON.parse(JSON.stringify(n[0])).data,metadata:{}};e.add(r)},this._displayIdMap=new Map,this._minHeightTimeout=null,this._inputRequested=new u.Signal(this),this._toggleScrolling=new u.Signal(this),this._initialize=new u.Signal(this),this._outputTracker=new l.WidgetTracker({namespace:h.UUID.uuid4()}),this._inputHistoryScope="global",this._pendingInput=!1,super.layout=new m.PanelLayout,this.addClass("jp-OutputArea"),this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:x.defaultContentFactory,this.rendermime=t.rendermime,this._maxNumberOutputs=null!==(s=t.maxNumberOutputs)&&void 0!==s?s:1/0,this._translator=null!==(i=t.translator)&&void 0!==i?i:p.nullTranslator,this._inputHistoryScope=null!==(n=t.inputHistoryScope)&&void 0!==n?n:"global";const r=this.model=t.model;for(let t=0;t<Math.min(r.length,this._maxNumberOutputs+1);t++){const e=r.get(t);this._insertOutput(t,e)}r.changed.connect(this.onModelChanged,this),r.stateChanged.connect(this.onStateChanged,this),t.promptOverlay&&this._addPromptOverlay()}get layout(){return super.layout}get widgets(){return this.layout.widgets}get future(){return this._future}set future(t){if(this.model.isDisposed)throw Error("Model is disposed");this._future!==t&&(this._future&&this._future.dispose(),this._future=t,t.done.finally((()=>{this._pendingInput=!1})).catch((()=>{})),this.model.clear(),this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))),t.onIOPub=this._onIOPub,t.onReply=this._onExecuteReply,t.onStdin=e=>{c.KernelMessage.isInputRequestMsg(e)&&this.onInputRequest(e,t)})}get inputRequested(){return this._inputRequested}get pendingInput(){return this._pendingInput}get maxNumberOutputs(){return this._maxNumberOutputs}set maxNumberOutputs(t){if(t<=0)return void console.warn("OutputArea.maxNumberOutputs must be strictly positive.");const e=this._maxNumberOutputs;this._maxNumberOutputs=t,e<t&&this._showTrimmedOutputs(e)}dispose(){this._future&&(this._future.dispose(),this._future=null),this._displayIdMap.clear(),this._outputTracker.dispose(),super.dispose()}onModelChanged(t,e){switch(e.type){case"add":this._insertOutput(e.newIndex,e.newValues[0]);break;case"remove":if(this.widgets.length)if(0===this.model.length)this._clear();else{const t=e.oldIndex;for(let s=0;s<e.oldValues.length&&t<this.widgets.length;++s){const e=this.widgets[t];e.parent=null,e.dispose()}this._moveDisplayIdIndices(t,e.oldValues.length),this._preventHeightChangeJitter()}break;case"set":this._setOutput(e.newIndex,e.newValues[0])}this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}get toggleScrolling(){return this._toggleScrolling}get initialize(){return this._initialize}_addPromptOverlay(){const t=document.createElement("div");t.className="jp-OutputArea-promptOverlay",t.addEventListener("click",(()=>{this._toggleScrolling.emit()})),this.node.appendChild(t),requestAnimationFrame((()=>{this._initialize.emit()}))}_moveDisplayIdIndices(t,e){this._displayIdMap.forEach((s=>{const i=t+e;for(let n=s.length-1;n>=0;--n){const r=s[n];r>=t&&r<i?s.splice(n,1):r>=i&&(s[n]-=e)}}))}onStateChanged(t,e){const s=Math.min(this.model.length,this._maxNumberOutputs);if(e){if(e>=this._maxNumberOutputs)return;this._setOutput(e,this.model.get(e))}else for(let t=0;t<s;t++)this._setOutput(t,this.model.get(t));this.outputLengthChanged.emit(s)}_clear(){if(!this.widgets.length)return;const t=this.widgets.length;for(let e=0;e<t;e++){const t=this.widgets[0];t.parent=null,t.dispose()}this._displayIdMap.clear(),this._preventHeightChangeJitter()}_preventHeightChangeJitter(){const t=this.node.getBoundingClientRect();this.node.style.minHeight=`${t.height}px`,this._minHeightTimeout&&window.clearTimeout(this._minHeightTimeout),this._minHeightTimeout=window.setTimeout((()=>{this.isDisposed||(this.node.style.minHeight="")}),50)}onInputRequest(t,e){const s=this.contentFactory,i=t.content.prompt,n=t.content.password,r=new m.Panel;r.addClass(g),r.addClass("jp-OutputArea-stdin-item");const a=s.createOutputPrompt();a.addClass(f),r.addWidget(a),this._pendingInput=!0;const o=s.createStdin({parent_header:t.header,prompt:i,password:n,future:e,translator:this._translator,inputHistoryScope:this._inputHistoryScope});o.addClass(y),r.addWidget(o),this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length),this._inputRequested.emit(o);const h=o.node.getElementsByTagName("input")[0];o.value.then((t=>{this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length+1),r.addClass("jp-OutputArea-stdin-hiding"),this.model.add({output_type:"stream",name:"stdin",text:t+"\n"}),h.focus(),this._pendingInput=!1,window.setTimeout((()=>{const t=document.activeElement;r.dispose(),t&&t instanceof HTMLElement&&t.focus()}),500)})),this.layout.addWidget(r)}_setOutput(t,e){if(t>=this._maxNumberOutputs)return;const s=this.layout.widgets[t],i=s.widgets?s.widgets.filter((t=>"renderModel"in t)).pop():s,n=this.rendermime.preferredMimeType(e.data,e.trusted?"any":"ensure");C.currentPreferredMimetype.get(i)===n&&x.isIsolated(n,e.metadata)===i instanceof C.IsolatedRenderer?i.renderModel(e):(this.layout.widgets[t].dispose(),this._insertOutput(t,e))}_insertOutput(t,e){if(t>this._maxNumberOutputs)return;const s=this.layout;if(t===this._maxNumberOutputs){const e=new C.TrimmedOutputs(this._maxNumberOutputs,(()=>{const t=this._maxNumberOutputs;this._maxNumberOutputs=1/0,this._showTrimmedOutputs(t)}));s.insertWidget(t,this._wrappedOutput(e))}else{let i=this.createOutputItem(e);i?i.toggleClass("jp-OutputArea-executeResult",null!==e.executionCount):i=new m.Widget,this._outputTracker.has(i)||this._outputTracker.add(i),s.insertWidget(t,i)}}get outputTracker(){return this._outputTracker}_showTrimmedOutputs(t){this.widgets[t].dispose();for(let e=t;e<this.model.length;e++)this._insertOutput(e,this.model.get(e));this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}createOutputItem(t){const e=this.createRenderedMimetype(t);return e?this._wrappedOutput(e,t.executionCount):null}createRenderedMimetype(t){const e=this.rendermime.preferredMimeType(t.data,t.trusted?"any":"ensure");if(!e)return null;let s=this.rendermime.createRenderer(e);return!0===x.isIsolated(e,t.metadata)&&(s=new C.IsolatedRenderer(s)),C.currentPreferredMimetype.set(s,e),s.renderModel(t).catch((t=>{const e=document.createElement("pre"),i=this._translator.load("jupyterlab");e.textContent=i.__("Javascript Error: %1",t.message),s.node.appendChild(e),s.node.className="lm-Widget jp-RenderedText",s.node.setAttribute("data-mime-type","application/vnd.jupyter.stderr")})),s}_wrappedOutput(t,e=null){const s=new C.OutputPanel;s.addClass(g);const i=this.contentFactory.createOutputPrompt();return i.executionCount=e,i.addClass(f),s.addWidget(i),t.addClass(y),s.addWidget(t),s}}class w extends x{onInputRequest(t,e){}createOutputItem(t){const e=this.createRenderedMimetype(t);if(!e)return null;const s=new C.OutputPanel;return s.addClass(g),e.addClass(y),s.addWidget(e),s}}!function(t){t.execute=async function(t,e,s,i){var n;let r=!0;i&&Array.isArray(i.tags)&&-1!==i.tags.indexOf("raises-exception")&&(r=!1);const a={code:t,stop_on_error:r},o=null===(n=s.session)||void 0===n?void 0:n.kernel;if(!o)throw new Error("Session has no kernel.");const h=o.requestExecute(a,!1,i);return e.future=h,h.done},t.isIsolated=function(t,e){const s=e[t];return s&&void 0!==s.isolated?!!s.isolated:!!e.isolated};class e{createOutputPrompt(){return new v}createStdin(t){return new O(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(x||(x={}));class v extends m.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-OutputPrompt")}get executionCount(){return this._executionCount}set executionCount(t){this._executionCount=t,this.node.textContent=null===t?"":`[${t}]:`}}class O extends m.Widget{static _historyIx(t,e){const s=O._history.get(t);if(!s)return;const i=s.length;return e<=0?i+e:void 0}static _historyAt(t,e){const s=O._history.get(t);if(!s)return;const i=s.length,n=O._historyIx(t,e);return void 0!==n&&n<i?s[n]:void 0}static _historyPush(t,e){const s=O._history.get(t);s.push(e),s.length>1e3&&s.shift()}static _historySearch(t,e,s,i=!0){const n=O._history.get(t),r=n.length,a=O._historyIx(t,s),o=t=>-1!==t.search(e);if(void 0!==a)if(i){if(0===a)return;const t=n.slice(0,a).findLastIndex(o);if(-1!==t)return t-r}else{if(a>=r-1)return;const t=n.slice(a+1).findIndex(o);if(-1!==t)return t-r+a+1}}constructor(t){var e;super({node:C.createInputWidgetNode(t.prompt,t.password)}),this._promise=new h.PromiseDelegate,this._resolved=!1,this.addClass("jp-Stdin"),this._future=t.future,this._historyIndex=0,this._historyKey="session"===t.inputHistoryScope?t.parent_header.session:"",this._historyPat="",this._parentHeader=t.parent_header,this._password=t.password,this._trans=(null!==(e=t.translator)&&void 0!==e?e:p.nullTranslator).load("jupyterlab"),this._value=t.prompt+" ",this._input=this.node.getElementsByTagName("input")[0],this._password?this._input.placeholder="":this._input.placeholder=this._trans.__("↑↓ for history. Search history with c-↑/c-↓"),O._history.has(this._historyKey)||O._history.set(this._historyKey,[])}get value(){return this._promise.promise.then((()=>this._value))}handleEvent(t){if(this._resolved)return void t.preventDefault();const e=this._input;if("keydown"===t.type)if("Enter"===t.key)this.resetSearch(),this._future.sendInputReply({status:"ok",value:e.value},this._parentHeader),this._password?this._value+="········":(this._value+=e.value,O._historyPush(this._historyKey,e.value)),this._resolved=!0,this._promise.resolve(void 0);else if("Escape"===t.key)this.resetSearch(),e.blur();else if(!t.ctrlKey||"ArrowUp"!==t.key&&"ArrowDown"!==t.key){if("ArrowUp"===t.key){this.resetSearch();const s=O._historyAt(this._historyKey,this._historyIndex-1);s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),--this._historyIndex,t.preventDefault())}else if("ArrowDown"===t.key)if(this.resetSearch(),0===this._historyIndex);else if(-1===this._historyIndex)this._setInputValue(this._valueCache),++this._historyIndex;else{const t=O._historyAt(this._historyKey,this._historyIndex+1);t&&(this._setInputValue(t),++this._historyIndex)}}else{""===this._historyPat&&(this._historyPat=e.value);const s="ArrowUp"===t.key,i=O._historySearch(this._historyKey,this._historyPat,this._historyIndex,s);if(void 0!==i){const s=O._historyAt(this._historyKey,i);void 0!==s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),this._historyIndex=i,t.preventDefault())}}}resetSearch(){this._historyPat=""}onAfterAttach(t){this._input.addEventListener("keydown",this),this._input.focus()}onBeforeDetach(t){this._input.removeEventListener("keydown",this)}_setInputValue(t){this._input.value=t,this._input.setSelectionRange(t.length,t.length)}}var C;O._history=new Map,function(t){t.createInputWidgetNode=function(t,e){const s=document.createElement("div"),i=document.createElement("pre");i.className="jp-Stdin-prompt",i.textContent=t;const n=document.createElement("input");return n.className="jp-Stdin-input",e&&(n.type="password"),s.appendChild(i),i.appendChild(n),s};class e extends m.Widget{constructor(t){super({node:document.createElement("iframe")}),this.addClass("jp-mod-isolated"),this._wrapped=t;const e=this.node;e.frameBorder="0",e.scrolling="auto",e.addEventListener("load",(()=>{e.contentDocument.open(),e.contentDocument.write(this._wrapped.node.innerHTML),e.contentDocument.close();const t=e.contentDocument.body;e.style.height=`${t.scrollHeight}px`,e.heightChangeObserver=new ResizeObserver((()=>{e.style.height=`${t.scrollHeight}px`})),e.heightChangeObserver.observe(t)}))}renderModel(t){return this._wrapped.renderModel(t)}}t.IsolatedRenderer=e,t.currentPreferredMimetype=new _.AttachedProperty({name:"preferredMimetype",create:t=>""});class s extends m.Panel{constructor(t){super(t)}_onContext(t){this.node.focus()}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("contextmenu",this._onContext.bind(this))}onBeforeDetach(t){super.onAfterDetach(t),this.node.removeEventListener("contextmenu",this._onContext.bind(this))}}t.OutputPanel=s;class i extends m.Widget{constructor(t,e){const s=document.createElement("div"),i=`The first ${t} are displayed`;s.insertAdjacentHTML("afterbegin",`<a title=${i}>\n <pre>Show more outputs</pre>\n </a>`),super({node:s}),this._onClick=e,this.addClass("jp-TrimmedOutputs"),this.addClass("jp-RenderedHTMLCommon")}handleEvent(t){"click"===t.type&&this._onClick(t)}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("click",this)}onBeforeDetach(t){super.onBeforeDetach(t),this.node.removeEventListener("click",this)}}t.TrimmedOutputs=i}(C||(C={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7252,9685],{79685:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var n,a=r(44604),o=r(53312),d=r(68722),i=r(3991),c=r(81221),s=r(23295),w=r(79426),m=r(12030);!function(e){e.markdownPreview="markdownviewer:open",e.markdownEditor="markdownviewer:edit"}(n||(n={}));const p="Markdown Preview",l={activate:function(e,t,r,a,s,w,m){const k=r.load("jupyterlab"),{commands:u,docRegistry:g}=e;t.addFactory(c.markdownRendererFactory);const f=new o.WidgetTracker({namespace:"markdownviewer-widget"});let h={...i.MarkdownViewer.defaultConfig};function y(e){Object.keys(h).forEach((t=>{var r;e.setOption(t,null!==(r=h[t])&&void 0!==r?r:null)}))}if(s){const e=e=>{h=e.composite,f.forEach((e=>{y(e.content)}))};s.load(l.id).then((t=>{t.changed.connect((()=>{e(t)})),e(t)})).catch((e=>{console.error(e.message)}))}const v=new i.MarkdownViewerFactory({rendermime:t,name:p,label:k.__("Markdown Preview"),primaryFileType:g.getFileType("markdown"),fileTypes:["markdown"],defaultRendered:["markdown"]});return v.widgetCreated.connect(((e,t)=>{t.context.pathChanged.connect((()=>{f.save(t)})),y(t.content),f.add(t)})),g.addWidgetFactory(v),a&&a.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:p}),name:e=>e.context.path}),u.addCommand(n.markdownPreview,{label:k.__("Markdown Preview"),execute:e=>{const t=e.path;if("string"==typeof t)return u.execute("docmanager:open",{path:t,factory:p,options:e.options})}}),u.addCommand(n.markdownEditor,{execute:()=>{const e=f.currentWidget;if(!e)return;const t=e.context.path;return u.execute("docmanager:open",{path:t,factory:"Editor",options:{mode:"split-right"}})},isVisible:()=>{const e=f.currentWidget;return e&&".md"===d.PathExt.extname(e.context.path)||!1},label:k.__("Show Markdown Editor")}),w&&w.add(new i.MarkdownViewerTableOfContentsFactory(f,t.markdownParser,null!=m?m:t.sanitizer)),f},id:"@jupyterlab/markdownviewer-extension:plugin",description:"Adds markdown file viewer and provides its tracker.",provides:i.IMarkdownViewerTracker,requires:[c.IRenderMimeRegistry,m.ITranslator],optional:[a.ILayoutRestorer,s.ISettingRegistry,w.ITableOfContentsRegistry,o.ISanitizer],autoStart:!0},k=l}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7252,9685],{79685:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var n,a=r(2756),o=r(20005),d=r(64145),i=r(51739),c=r(1323),s=r(3339),w=r(27333),m=r(90646);!function(e){e.markdownPreview="markdownviewer:open",e.markdownEditor="markdownviewer:edit"}(n||(n={}));const p="Markdown Preview",l={activate:function(e,t,r,a,s,w,m){const k=r.load("jupyterlab"),{commands:u,docRegistry:g}=e;t.addFactory(c.markdownRendererFactory);const f=new o.WidgetTracker({namespace:"markdownviewer-widget"});let h={...i.MarkdownViewer.defaultConfig};function y(e){Object.keys(h).forEach((t=>{var r;e.setOption(t,null!==(r=h[t])&&void 0!==r?r:null)}))}if(s){const e=e=>{h=e.composite,f.forEach((e=>{y(e.content)}))};s.load(l.id).then((t=>{t.changed.connect((()=>{e(t)})),e(t)})).catch((e=>{console.error(e.message)}))}const v=new i.MarkdownViewerFactory({rendermime:t,name:p,label:k.__("Markdown Preview"),primaryFileType:g.getFileType("markdown"),fileTypes:["markdown"],defaultRendered:["markdown"]});return v.widgetCreated.connect(((e,t)=>{t.context.pathChanged.connect((()=>{f.save(t)})),y(t.content),f.add(t)})),g.addWidgetFactory(v),a&&a.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:p}),name:e=>e.context.path}),u.addCommand(n.markdownPreview,{label:k.__("Markdown Preview"),execute:e=>{const t=e.path;if("string"==typeof t)return u.execute("docmanager:open",{path:t,factory:p,options:e.options})}}),u.addCommand(n.markdownEditor,{execute:()=>{const e=f.currentWidget;if(!e)return;const t=e.context.path;return u.execute("docmanager:open",{path:t,factory:"Editor",options:{mode:"split-right"}})},isVisible:()=>{const e=f.currentWidget;return e&&".md"===d.PathExt.extname(e.context.path)||!1},label:k.__("Show Markdown Editor")}),w&&w.add(new i.MarkdownViewerTableOfContentsFactory(f,t.markdownParser,null!=m?m:t.sanitizer)),f},id:"@jupyterlab/markdownviewer-extension:plugin",description:"Adds markdown file viewer and provides its tracker.",provides:i.IMarkdownViewerTracker,requires:[c.IRenderMimeRegistry,m.ITranslator],optional:[a.ILayoutRestorer,s.ISettingRegistry,w.ITableOfContentsRegistry,o.ISanitizer],autoStart:!0},k=l}}]);