notebook 7.0.6__py3-none-any.whl → 7.1.0a1__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 (256) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +5 -2
  3. notebook/static/1053.bundle.js +1 -1
  4. notebook/static/1157.bundle.js +1 -0
  5. notebook/static/1169.bundle.js +1 -0
  6. notebook/static/1198.bundle.js +1 -1
  7. notebook/static/131.bundle.js +7 -0
  8. notebook/static/1326.bundle.js +2 -0
  9. notebook/static/1337.bundle.js +1 -1
  10. notebook/static/134.bundle.js +1 -1
  11. notebook/static/1408.bundle.js +1 -1
  12. notebook/static/1496.bundle.js +1 -0
  13. notebook/static/1584.bundle.js +1 -1
  14. notebook/static/1604.bundle.js +1 -0
  15. notebook/static/1647.bundle.js +1 -1
  16. notebook/static/1650.bundle.js +1 -1
  17. notebook/static/1682.bundle.js +1 -1
  18. notebook/static/1684.bundle.js +1 -1
  19. notebook/static/1696.bundle.js +1 -1
  20. notebook/static/1809.bundle.js +1 -1
  21. notebook/static/1827.bundle.js +1 -1
  22. notebook/static/1833.bundle.js +1 -1
  23. notebook/static/1835.bundle.js +1 -1
  24. notebook/static/1869.bundle.js +1 -0
  25. notebook/static/1895.bundle.js +1 -0
  26. notebook/static/1950.bundle.js +1 -1
  27. notebook/static/1958.bundle.js +1 -1
  28. notebook/static/2007.bundle.js +1 -1
  29. notebook/static/2067.bundle.js +1 -1
  30. notebook/static/2088.bundle.js +1 -1
  31. notebook/static/2089.bundle.js +1 -1
  32. notebook/static/2122.bundle.js +1 -1
  33. notebook/static/2167.bundle.js +1 -1
  34. notebook/static/2184.bundle.js +1 -1
  35. notebook/static/2311.bundle.js +1 -1
  36. notebook/static/2401.bundle.js +1 -1
  37. notebook/static/2479.bundle.js +1 -1
  38. notebook/static/2489.bundle.js +1 -0
  39. notebook/static/2502.bundle.js +1 -0
  40. notebook/static/2512.bundle.js +1 -1
  41. notebook/static/2515.bundle.js +1 -0
  42. notebook/static/2552.bundle.js +1 -1
  43. notebook/static/2577.bundle.js +1 -0
  44. notebook/static/2607.bundle.js +1 -1
  45. notebook/static/2615.bundle.js +1 -0
  46. notebook/static/2866.bundle.js +1 -1
  47. notebook/static/2883.bundle.js +1 -0
  48. notebook/static/2924.bundle.js +1 -1
  49. notebook/static/2944.bundle.js +1 -0
  50. notebook/static/2955.bundle.js +1 -1
  51. notebook/static/3079.bundle.js +1 -1
  52. notebook/static/3129.bundle.js +1 -0
  53. notebook/static/3146.bundle.js +1 -1
  54. notebook/static/3190.bundle.js +2 -0
  55. notebook/static/3190.bundle.js.LICENSE.txt +18 -0
  56. notebook/static/3213.bundle.js +1 -1
  57. notebook/static/3301.bundle.js +1 -1
  58. notebook/static/3340.bundle.js +1 -1
  59. notebook/static/3360.bundle.js +1 -1
  60. notebook/static/3466.bundle.js +1 -1
  61. notebook/static/35.bundle.js +1 -1
  62. notebook/static/3512.bundle.js +1 -0
  63. notebook/static/3642.bundle.js +1 -0
  64. notebook/static/3676.bundle.js +1 -1
  65. notebook/static/3680.bundle.js +1 -1
  66. notebook/static/3768.bundle.js +1 -1
  67. notebook/static/377.bundle.js +1 -1
  68. notebook/static/3797.bundle.js +1 -1
  69. notebook/static/3863.bundle.js +1 -1
  70. notebook/static/3881.bundle.js +1 -1
  71. notebook/static/4042.bundle.js +1 -1
  72. notebook/static/4058.bundle.js +1 -1
  73. notebook/static/4131.bundle.js +1 -1
  74. notebook/static/4166.bundle.js +1 -0
  75. notebook/static/4212.bundle.js +1 -1
  76. notebook/static/4271.bundle.js +1 -1
  77. notebook/static/4291.bundle.js +1 -1
  78. notebook/static/433.bundle.js +1 -0
  79. notebook/static/4382.bundle.js +1 -1
  80. notebook/static/4461.bundle.js +1 -0
  81. notebook/static/4499.bundle.js +1 -0
  82. notebook/static/4501.bundle.js +1 -0
  83. notebook/static/4526.bundle.js +1 -1
  84. notebook/static/4558.bundle.js +1 -1
  85. notebook/static/4630.bundle.js +2 -0
  86. notebook/static/4630.bundle.js.LICENSE.txt +9 -0
  87. notebook/static/4645.bundle.js +1 -1
  88. notebook/static/4811.bundle.js +1 -1
  89. notebook/static/4837.bundle.js +1 -1
  90. notebook/static/4892.bundle.js +1 -0
  91. notebook/static/5088.bundle.js +1 -1
  92. notebook/static/5099.bundle.js +1 -1
  93. notebook/static/5135.bundle.js +1 -1
  94. notebook/static/514.bundle.js +1 -1
  95. notebook/static/5261.bundle.js +1 -1
  96. notebook/static/5313.bundle.js +1 -1
  97. notebook/static/5325.bundle.js +1 -1
  98. notebook/static/5346.bundle.js +1 -1
  99. notebook/static/5376.bundle.js +1 -0
  100. notebook/static/5426.bundle.js +1 -1
  101. notebook/static/5573.bundle.js +1 -1
  102. notebook/static/5601.bundle.js +1 -1
  103. notebook/static/5649.bundle.js +3 -3
  104. notebook/static/5733.bundle.js +1 -1
  105. notebook/static/5828.bundle.js +1 -1
  106. notebook/static/5850.bundle.js +1 -1
  107. notebook/static/5874.bundle.js +744 -0
  108. notebook/static/5874.bundle.js.LICENSE.txt +4 -0
  109. notebook/static/5912.bundle.js +1 -1
  110. notebook/static/5921.bundle.js +1 -1
  111. notebook/static/5982.bundle.js +1 -0
  112. notebook/static/6017.bundle.js +1 -1
  113. notebook/static/6027.bundle.js +1 -1
  114. notebook/static/6061.bundle.js +1 -1
  115. notebook/static/6139.bundle.js +1 -1
  116. notebook/static/62.bundle.js +1 -1
  117. notebook/static/6249.bundle.js +1 -0
  118. notebook/static/6256.bundle.js +1 -1
  119. notebook/static/6262.bundle.js +1 -0
  120. notebook/static/6271.bundle.js +1 -1
  121. notebook/static/6345.bundle.js +1 -1
  122. notebook/static/6405.bundle.js +1 -0
  123. notebook/static/6604.bundle.js +1 -1
  124. notebook/static/6621.bundle.js +1 -1
  125. notebook/static/6627.bundle.js +1 -1
  126. notebook/static/6731.bundle.js +1 -1
  127. notebook/static/6815.bundle.js +1 -1
  128. notebook/static/6853.bundle.js +1 -1
  129. notebook/static/6869.bundle.js +1 -0
  130. notebook/static/6893.bundle.js +1 -1
  131. notebook/static/690.bundle.js +1 -1
  132. notebook/static/6962.bundle.js +1 -1
  133. notebook/static/6999.bundle.js +1 -1
  134. notebook/static/7179.bundle.js +1 -0
  135. notebook/static/7226.bundle.js +1 -1
  136. notebook/static/7252.bundle.js +1 -1
  137. notebook/static/7259.bundle.js +1 -0
  138. notebook/static/7302.bundle.js +1 -1
  139. notebook/static/7333.bundle.js +2 -0
  140. notebook/static/7333.bundle.js.LICENSE.txt +9 -0
  141. notebook/static/7339.bundle.js +1 -0
  142. notebook/static/7369.bundle.js +1 -1
  143. notebook/static/7386.bundle.js +1 -1
  144. notebook/static/7391.bundle.js +1 -1
  145. notebook/static/7394.bundle.js +1 -1
  146. notebook/static/7427.bundle.js +1 -1
  147. notebook/static/7450.bundle.js +1 -1
  148. notebook/static/7582.bundle.js +1 -1
  149. notebook/static/7590.bundle.js +1 -0
  150. notebook/static/7603.bundle.js +1 -1
  151. notebook/static/7639.bundle.js +1 -1
  152. notebook/static/7684.bundle.js +1 -1
  153. notebook/static/7811.bundle.js +2 -0
  154. notebook/static/7819.bundle.js +1 -1
  155. notebook/static/7866.bundle.js +1 -1
  156. notebook/static/7900.bundle.js +1 -1
  157. notebook/static/7906.bundle.js +1 -1
  158. notebook/static/7943.bundle.js +1 -0
  159. notebook/static/7957.bundle.js +1 -1
  160. notebook/static/7997.bundle.js +1 -1
  161. notebook/static/8010.bundle.js +1 -1
  162. notebook/static/8032.bundle.js +1 -1
  163. notebook/static/8055.bundle.js +1 -0
  164. notebook/static/8579.bundle.js +1 -1
  165. notebook/static/8633.bundle.js +1 -1
  166. notebook/static/8771.bundle.js +1 -1
  167. notebook/static/8781.bundle.js +1 -0
  168. notebook/static/882.bundle.js +1 -0
  169. notebook/static/8875.bundle.js +1 -1
  170. notebook/static/8907.bundle.js +1 -1
  171. notebook/static/8928.bundle.js +1 -1
  172. notebook/static/8929.bundle.js +1 -1
  173. notebook/static/893.bundle.js +1 -1
  174. notebook/static/901.bundle.js +1 -1
  175. notebook/static/9068.bundle.js +1 -1
  176. notebook/static/911.bundle.js +1 -1
  177. notebook/static/9151.bundle.js +1 -1
  178. notebook/static/9161.bundle.js +1 -0
  179. notebook/static/9239.bundle.js +1 -1
  180. notebook/static/9250.bundle.js +1 -1
  181. notebook/static/9268.bundle.js +1 -1
  182. notebook/static/9284.bundle.js +1 -0
  183. notebook/static/9308.bundle.js +1 -0
  184. notebook/static/9335.bundle.js +1 -1
  185. notebook/static/9341.bundle.js +1 -1
  186. notebook/static/9380.bundle.js +1 -1
  187. notebook/static/9466.bundle.js +1 -0
  188. notebook/static/9554.bundle.js +1 -0
  189. notebook/static/9605.bundle.js +1 -1
  190. notebook/static/9638.bundle.js +1 -1
  191. notebook/static/9680.bundle.js +1 -1
  192. notebook/static/9685.bundle.js +1 -1
  193. notebook/static/9752.bundle.js +1 -1
  194. notebook/static/9799.bundle.js +1 -1
  195. notebook/static/9821.bundle.js +1 -0
  196. notebook/static/9852.bundle.js +1 -1
  197. notebook/static/9987.bundle.js +1 -0
  198. notebook/static/bundle.js +1 -1
  199. notebook/static/third-party-licenses.json +513 -147
  200. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +15 -15
  201. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
  202. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  203. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +10 -10
  204. notebook-7.1.0a1.data/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +17 -0
  205. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +17 -17
  206. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +12 -12
  207. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +11 -11
  208. notebook-7.1.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/50.e41798f78fa32030e149.js +1 -0
  209. notebook-7.1.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.9fa8bfe8da6242a4fc6b.js +1 -0
  210. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.79046a2eb17bde1af38c.js → notebook-7.1.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.faa0d74ec3a151a81a90.js +1 -1
  211. notebook-7.1.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +1 -0
  212. notebook-7.1.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.02d92bfa6cab99929020.js +1 -0
  213. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +4 -4
  214. {notebook-7.0.6.dist-info → notebook-7.1.0a1.dist-info}/METADATA +3 -2
  215. notebook-7.1.0a1.dist-info/RECORD +430 -0
  216. notebook/static/1018.bundle.js +0 -1
  217. notebook/static/4234.bundle.js +0 -1
  218. notebook/static/4746.bundle.js +0 -1
  219. notebook/static/5125.bundle.js +0 -2
  220. notebook/static/5125.bundle.js.LICENSE.txt +0 -9
  221. notebook/static/5678.bundle.js +0 -1
  222. notebook/static/6774.bundle.js +0 -1
  223. notebook/static/6919.bundle.js +0 -7
  224. notebook/static/8548.bundle.js +0 -2
  225. notebook/static/880.bundle.js +0 -1
  226. notebook/static/9086.bundle.js +0 -1
  227. notebook/static/9609.bundle.js +0 -1
  228. notebook/static/9854.bundle.js +0 -2
  229. notebook-7.0.6.data/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -10
  230. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1e7b382fb5e84b6e7620.js +0 -1
  231. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js +0 -1
  232. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/922.0beff4620746e288bd5e.js +0 -1
  233. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.b2792fe643cae74ea824.js +0 -1
  234. notebook-7.0.6.dist-info/RECORD +0 -389
  235. /notebook/static/{8548.bundle.js.LICENSE.txt → 1326.bundle.js.LICENSE.txt} +0 -0
  236. /notebook/static/{9854.bundle.js.LICENSE.txt → 7811.bundle.js.LICENSE.txt} +0 -0
  237. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  238. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  239. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  240. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  241. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  242. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  243. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  244. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  245. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  246. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  247. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  248. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  249. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  250. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  251. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  252. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  253. {notebook-7.0.6.data → notebook-7.1.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  254. {notebook-7.0.6.dist-info → notebook-7.1.0a1.dist-info}/WHEEL +0 -0
  255. {notebook-7.0.6.dist-info → notebook-7.1.0a1.dist-info}/entry_points.txt +0 -0
  256. {notebook-7.0.6.dist-info → notebook-7.1.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2577],{92577:(e,t,n)=>{n.r(t),n.d(t,{CellList:()=>m,CellTypeSwitcher:()=>f,CommandEditStatus:()=>E,ExecutionIndicator:()=>k,ExecutionIndicatorComponent:()=>b,INotebookTools:()=>we,INotebookTracker:()=>ye,INotebookWidgetFactory:()=>fe,KernelError:()=>g,Notebook:()=>ce,NotebookActions:()=>C,NotebookAdapter:()=>H,NotebookModel:()=>M,NotebookModelFactory:()=>I,NotebookPanel:()=>ue,NotebookSearchProvider:()=>ve,NotebookToCFactory:()=>pe,NotebookToCModel:()=>me,NotebookTools:()=>B,NotebookTracker:()=>be,NotebookTrustStatus:()=>Se,NotebookViewModel:()=>J,NotebookWidgetFactory:()=>Me,NotebookWindowedLayout:()=>$,RunningStatus:()=>ge,StaticNotebook:()=>re,ToolbarItems:()=>p,getIdForHeading:()=>_e});var o=n(78036),i=n(79947),s=n(13558),l=n(5944),a=n(33625),d=n(20998),r=n(81997),c=n(78156),h=n.n(c);const u="application/vnd.jupyter.cells";class g extends Error{constructor(e){const t=e,n=t.ename,o=t.evalue;super(`KernelReplyNotOK: ${n} ${o}`),this.errorName=n,this.errorValue=o,this.traceback=t.traceback,Object.setPrototypeOf(this,g.prototype)}}class C{static get executed(){return v.executed}static get executionScheduled(){return v.executionScheduled}static get selectionExecuted(){return v.selectionExecuted}static get outputCleared(){return v.outputCleared}constructor(){}}var v;!function(e){function t(e,t){if(!e.model||!e.activeCell)return;const n=v.getState(e),o=e.widgets.findIndex((t=>e.isSelectedOrActive(t)));let i=e.widgets.slice(o+1).findIndex((t=>!e.isSelectedOrActive(t)));i>=0?i+=o+1:i=e.model.cells.length,t>0?e.moveCell(o,i,i-o):e.moveCell(o,o+t,i-o),v.handleState(e,n,!0)}function n(e,t="below",n,o=!1){if(!e.model||!e.activeCell)return;const i=v.getState(e),s=e.model;e.mode="command";let l=0;const a=e.activeCellIndex;s.sharedModel.transact((()=>{switch(t){case"below":l=e.activeCellIndex+1;break;case"belowSelected":e.widgets.forEach(((t,n)=>{e.isSelectedOrActive(t)&&(l=n+1)}));break;case"above":l=e.activeCellIndex;break;case"replace":{const t=[];e.widgets.forEach(((n,o)=>{const i=!1!==n.model.sharedModel.getMetadata("deletable");e.isSelectedOrActive(n)&&i&&t.push(o)})),t.length>0&&t.reverse().forEach((e=>{s.sharedModel.deleteCell(e)})),l=t[0];break}}s.sharedModel.insertCells(l,n.map((t=>(t.id="code"===t.cell_type&&"cut"===e.lastClipboardInteraction&&"string"==typeof t.id?t.id:void 0,t))))})),e.activeCellIndex=a+n.length,e.deselectAll(),o&&(e.lastClipboardInteraction="paste"),v.handleState(e,i,!0)}function r(t,n,o){const s=(0,a.findIndex)(o.widgets,((e,n)=>t.model.id===e.model.id));if(-1===s)return-1;if(!o.widgets.length)return s+1;let l=e.getHeadingInfo(t);if(t.isHidden||!(t instanceof i.MarkdownCell)||!l.isHeading)return s+1;let d,r=!1,c=0;for(d=s+1;d<o.widgets.length;d++){let t=o.widgets[d],i=e.getHeadingInfo(t);if(i.isHeading&&i.headingLevel<=l.headingLevel){d-=1;break}r&&i.isHeading&&i.headingLevel<=c&&(r=!1),n||r?t.setHidden(!0):(i.collapsed&&i.isHeading&&(r=!0,c=i.headingLevel),t.setHidden(!1))}return d===o.widgets.length?t.numberChildNodes=d-s-1:t.numberChildNodes=d-s,e.setCellCollapse(t,n),d+1}function h(e){if(!(e instanceof i.MarkdownCell))return{isHeading:!1,headingLevel:7};let t=e.headingInfo.level;return{isHeading:t>0,headingLevel:t,collapsed:e.headingCollapsed}}async function g(e,t={waitUntilReady:!0,preventScroll:!1}){const{activeCell:n}=e,{waitUntilReady:o,preventScroll:i}=t;n&&(o&&await n.ready,e.isDisposed||n.isDisposed||n.node.focus({preventScroll:i}))}e.splitCell=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.mode="edit",e.deselectAll();const n=e.model,o=e.activeCellIndex,i=e.widgets[o],s=i.editor;if(!s)return;const l=s.getSelections(),a=i.model.sharedModel.getSource(),d=[0];let r=-1,c=-1;for(let e=0;e<l.length;e++)r=s.getOffsetAt(l[e].start),c=s.getOffsetAt(l[e].end),r<c?(d.push(r),d.push(c)):c<r?(d.push(c),d.push(r)):d.push(r);d.push(a.length);const h=d.slice(0,-1).map(((e,t)=>{const{cell_type:n,metadata:o}=i.model.sharedModel.toJSON();return{cell_type:n,metadata:o,source:a.slice(e,d[t+1]).replace(/^\n+/,"").replace(/\n+$/,"")}}));n.sharedModel.transact((()=>{n.sharedModel.deleteCell(o),n.sharedModel.insertCells(o,h)}));const u=r!==c?2:1;e.activeCellIndex=o+h.length-u,e.scrollToItem(e.activeCellIndex).then((()=>{var t;null===(t=e.activeCell)||void 0===t||t.editor.focus()})).catch((e=>{})),v.handleState(e,t)},e.mergeCells=function(e,t=!1){if(!e.model||!e.activeCell)return;const n=v.getState(e),o=[],s=[],l=e.model,a=l.cells,d=e.activeCell,r=e.activeCellIndex,c={};if(e.widgets.forEach(((t,n)=>{if(e.isSelectedOrActive(t)){o.push(t.model.sharedModel.getSource()),n!==r&&s.push(n);const e=t.model;if((0,i.isRawCellModel)(e)||(0,i.isMarkdownCellModel)(e))for(const t of e.attachments.keys)c[t]=e.attachments.get(t).toJSON()}})),1===o.length)if(!0===t){if(0===r)return;const e=a.get(r-1);o.unshift(e.sharedModel.getSource()),s.push(r-1)}else if(!1===t){if(r===a.length-1)return;const e=a.get(r+1);o.push(e.sharedModel.getSource()),s.push(r+1)}e.deselectAll();const h=d.model.sharedModel,{cell_type:u,metadata:g}=h.toJSON();"code"===h.cell_type&&(g.trusted=!0);const C={cell_type:u,metadata:g,source:o.join("\n\n"),attachments:"markdown"===h.cell_type||"raw"===h.cell_type?c:void 0};l.sharedModel.transact((()=>{l.sharedModel.deleteCell(r),l.sharedModel.insertCell(r,C),s.sort(((e,t)=>t-e)).forEach((e=>{l.sharedModel.deleteCell(e)}))})),d instanceof i.MarkdownCell&&(e.activeCell.rendered=!1),v.handleState(e,n)},e.deleteCells=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);v.deleteCells(e),v.handleState(e,t,!0)},e.insertAbove=function(e){if(!e.model)return;const t=v.getState(e),n=e.model,o=e.activeCell?e.activeCellIndex:0;n.sharedModel.insertCell(o,{cell_type:e.notebookConfig.defaultCell,metadata:"code"===e.notebookConfig.defaultCell?{trusted:!0}:{}}),e.activeCellIndex=o,e.deselectAll(),v.handleState(e,t,!0)},e.insertBelow=function(e){if(!e.model)return;const t=v.getState(e),n=e.model,o=e.activeCell?e.activeCellIndex+1:0;n.sharedModel.insertCell(o,{cell_type:e.notebookConfig.defaultCell,metadata:"code"===e.notebookConfig.defaultCell?{trusted:!0}:{}}),e.activeCellIndex=o,e.deselectAll(),v.handleState(e,t,!0)},e.moveDown=function(e){t(e,1)},e.moveUp=function(e){t(e,-1)},e.changeCellType=function(e,t){if(!e.model||!e.activeCell)return;const n=v.getState(e);v.changeCellType(e,t),v.handleState(e,n)},e.run=function(e,t,n,o){if(!e.model||!e.activeCell)return Promise.resolve(!1);const i=v.getState(e),s=v.runSelected(e,t,n,o);return v.handleRunState(e,i,!1),s},e.runCells=function(e,t,n,o,i){if(!e.model)return Promise.resolve(!1);const s=v.getState(e),l=v.runCells(e,t,n,o,i);return v.handleRunState(e,s,!1),l},e.runAndAdvance=async function(e,t,n,o){var i;if(!e.model||!e.activeCell)return Promise.resolve(!1);const l=v.getState(e),a=v.runSelected(e,t,n,o),d=e.model;return e.activeCellIndex===e.widgets.length-1?(d.sharedModel.insertCell(e.widgets.length,{cell_type:e.notebookConfig.defaultCell,metadata:"code"===e.notebookConfig.defaultCell?{trusted:!0}:{}}),e.activeCellIndex++,!1===(null===(i=e.activeCell)||void 0===i?void 0:i.inViewport)&&await(0,s.signalToPromise)(e.activeCell.inViewportChanged,200).catch((()=>{})),e.mode="edit"):e.activeCellIndex++,v.handleRunState(e,l,!0),a},e.runAndInsert=async function(e,t,n,o){var i;if(!e.model||!e.activeCell)return Promise.resolve(!1);const l=v.getState(e),a=v.runSelected(e,t,n,o);return e.model.sharedModel.insertCell(e.activeCellIndex+1,{cell_type:e.notebookConfig.defaultCell,metadata:"code"===e.notebookConfig.defaultCell?{trusted:!0}:{}}),e.activeCellIndex++,!1===(null===(i=e.activeCell)||void 0===i?void 0:i.inViewport)&&await(0,s.signalToPromise)(e.activeCell.inViewportChanged,200).catch((()=>{})),e.mode="edit",v.handleRunState(e,l,!0),a},e.runAll=function(e,t,n,o){if(!e.model||!e.activeCell)return Promise.resolve(!1);const i=v.getState(e),s=e.widgets.length,l=v.runCells(e,e.widgets,t,n,o);return e.activeCellIndex=s,e.deselectAll(),v.handleRunState(e,i,!0),l},e.renderAllMarkdown=function(e){if(!e.model||!e.activeCell)return Promise.resolve(!1);const t=e.activeCellIndex,n=v.getState(e);if(e.widgets.forEach(((t,n)=>{"markdown"===t.model.type&&(e.select(t),e.activeCellIndex=n)})),"markdown"!==e.activeCell.model.type)return Promise.resolve(!0);const o=v.runSelected(e);return e.activeCellIndex=t,v.handleRunState(e,n,!0),o},e.runAllAbove=function(e,t,n,o){const{activeCell:i,activeCellIndex:s,model:l}=e;if(!l||!i||s<1)return Promise.resolve(!1);const a=v.getState(e),d=v.runCells(e,e.widgets.slice(0,e.activeCellIndex),t,n,o);return e.deselectAll(),v.handleRunState(e,a,!0),d},e.runAllBelow=function(e,t,n,o){if(!e.model||!e.activeCell)return Promise.resolve(!1);const i=v.getState(e),s=e.widgets.length,l=v.runCells(e,e.widgets.slice(e.activeCellIndex),t,n,o);return e.activeCellIndex=s,e.deselectAll(),v.handleRunState(e,i,!0),l},e.replaceSelection=function(e,t){var n,o,i;e.model&&(null===(n=e.activeCell)||void 0===n?void 0:n.editor)&&(null===(i=(o=e.activeCell.editor).replaceSelection)||void 0===i||i.call(o,t))},e.selectAbove=function(e){if(!e.model||!e.activeCell)return;const t=e.layout.footer;if(t&&document.activeElement===t.node)return t.node.blur(),void(e.mode="command");if(0===e.activeCellIndex)return;let n=e.activeCellIndex-1;for(;n>=0;){const t=e.widgets[n];if(!t.inputHidden&&!t.isHidden)break;n-=1}const o=v.getState(e);e.activeCellIndex=n,e.deselectAll(),v.handleState(e,o,!0)},e.selectBelow=function(e){if(!e.model||!e.activeCell)return;let t=e.widgets.length-1;for(;e.widgets[t].isHidden||e.widgets[t].inputHidden;)t-=1;if(e.activeCellIndex===t){const t=e.layout.footer;return void(null==t||t.node.focus())}let n=e.activeCellIndex+1;for(;n<t;){let t=e.widgets[n];if(!t.inputHidden&&!t.isHidden)break;n+=1}const o=v.getState(e);e.activeCellIndex=n,e.deselectAll(),v.handleState(e,o,!0)},e.insertSameLevelHeadingAbove=async function(e){if(!e.model||!e.activeCell)return;let t=v.Headings.determineHeadingLevel(e.activeCell,e);-1==t?await v.Headings.insertHeadingAboveCellIndex(0,1,e):await v.Headings.insertHeadingAboveCellIndex(e.activeCellIndex,t,e)},e.insertSameLevelHeadingBelow=async function(e){if(!e.model||!e.activeCell)return;let t=v.Headings.determineHeadingLevel(e.activeCell,e);t=t>-1?t:1;let n=v.Headings.findLowerEqualLevelHeadingBelow(e.activeCell,e,!0);await v.Headings.insertHeadingAboveCellIndex(-1==n?e.model.cells.length:n,t,e)},e.selectHeadingAboveOrCollapseHeading=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);let n=h(e.activeCell);if(n.isHeading&&!n.collapsed)r(e.activeCell,!0,e);else{let t=v.Headings.findLowerEqualLevelParentHeadingAbove(e.activeCell,e,!0);t>-1&&(e.activeCellIndex=t)}e.deselectAll(),v.handleState(e,t,!0)},e.selectHeadingBelowOrExpandHeading=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);let n=h(e.activeCell);if(n.isHeading&&n.collapsed)r(e.activeCell,!1,e);else{let t=v.Headings.findHeadingBelow(e.activeCell,e,!0);t>-1&&(e.activeCellIndex=t)}e.deselectAll(),v.handleState(e,t,!0)},e.extendSelectionAbove=function(e,t=!1){if(!e.model||!e.activeCell)return;if(0===e.activeCellIndex)return;const n=v.getState(e);e.mode="command",t?e.extendContiguousSelectionTo(0):e.extendContiguousSelectionTo(e.activeCellIndex-1),v.handleState(e,n,!0)},e.extendSelectionBelow=function(e,t=!1){if(!e.model||!e.activeCell)return;if(e.activeCellIndex===e.widgets.length-1)return;const n=v.getState(e);e.mode="command",t?e.extendContiguousSelectionTo(e.widgets.length-1):e.extendContiguousSelectionTo(e.activeCellIndex+1),v.handleState(e,n,!0)},e.selectAll=function(e){e.model&&e.activeCell&&e.widgets.forEach((t=>{e.select(t)}))},e.deselectAll=function(e){e.model&&e.activeCell&&e.deselectAll()},e.copy=function(e){v.copyOrCut(e,!1)},e.cut=function(e){v.copyOrCut(e,!0)},e.paste=function(e,t="below"){const i=o.Clipboard.getInstance();i.hasData(u)&&(n(e,t,i.getData(u),!0),g(e))},e.duplicate=function(e,t="below"){const o=v.selectedCells(e);o&&0!==o.length&&n(e,t,o,!1)},e.undo=function(e){if(!e.model)return;const t=v.getState(e);e.mode="command",e.model.sharedModel.undo(),e.deselectAll(),v.handleState(e,t)},e.redo=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.mode="command",e.model.sharedModel.redo(),e.deselectAll(),v.handleState(e,t)},e.toggleAllLineNumbers=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e),n=e.editorConfig,o=!(n.code.lineNumbers&&n.markdown.lineNumbers&&n.raw.lineNumbers),i={code:{...n.code,lineNumbers:o},markdown:{...n.markdown,lineNumbers:o},raw:{...n.raw,lineNumbers:o}};e.editorConfig=i,v.handleState(e,t)},e.clearOutputs=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);let n=-1;for(const t of e.model.cells){const o=e.widgets[++n];e.isSelectedOrActive(o)&&"code"===t.type&&(t.sharedModel.transact((()=>{t.clearExecution(),o.outputHidden=!1}),!1),v.outputCleared.emit({notebook:e,cell:o}))}v.handleState(e,t,!0)},e.clearAllOutputs=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);let n=-1;for(const t of e.model.cells){const o=e.widgets[++n];"code"===t.type&&(t.sharedModel.transact((()=>{t.clearExecution(),o.outputHidden=!1}),!1),v.outputCleared.emit({notebook:e,cell:o}))}v.handleState(e,t,!0)},e.hideCode=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((t=>{e.isSelectedOrActive(t)&&"code"===t.model.type&&(t.inputHidden=!0)})),v.handleState(e,t)},e.showCode=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((t=>{e.isSelectedOrActive(t)&&"code"===t.model.type&&(t.inputHidden=!1)})),v.handleState(e,t)},e.hideAllCode=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((e=>{"code"===e.model.type&&(e.inputHidden=!0)})),v.handleState(e,t)},e.showAllCode=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((e=>{"code"===e.model.type&&(e.inputHidden=!1)})),v.handleState(e,t)},e.hideOutput=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((t=>{e.isSelectedOrActive(t)&&"code"===t.model.type&&(t.outputHidden=!0)})),v.handleState(e,t,!0)},e.showOutput=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((t=>{e.isSelectedOrActive(t)&&"code"===t.model.type&&(t.outputHidden=!1)})),v.handleState(e,t)},e.hideAllOutputs=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((e=>{"code"===e.model.type&&(e.outputHidden=!0)})),v.handleState(e,t,!0)},e.renderSideBySide=function(e){e.renderingLayout="side-by-side"},e.renderDefault=function(e){e.renderingLayout="default"},e.showAllOutputs=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((e=>{"code"===e.model.type&&(e.outputHidden=!1)})),v.handleState(e,t)},e.enableOutputScrolling=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((t=>{e.isSelectedOrActive(t)&&"code"===t.model.type&&(t.outputsScrolled=!0)})),v.handleState(e,t,!0)},e.disableOutputScrolling=function(e){if(!e.model||!e.activeCell)return;const t=v.getState(e);e.widgets.forEach((t=>{e.isSelectedOrActive(t)&&"code"===t.model.type&&(t.outputsScrolled=!1)})),v.handleState(e,t)},e.selectLastRunCell=function(e){let t=null,n=null;e.widgets.forEach(((e,o)=>{if("code"===e.model.type){const i=e.model.getMetadata("execution");if(i&&d.JSONExt.isObject(i)&&void 0!==i["iopub.status.busy"]){const e=i["iopub.status.busy"].toString();if(e){const i=new Date(e);(!t||i>=t)&&(t=i,n=o)}}}})),null!==n&&(e.activeCellIndex=n)},e.setMarkdownHeader=function(e,t){if(!e.model||!e.activeCell)return;const n=v.getState(e),o=e.model.cells;t=Math.min(Math.max(t,1),6),e.widgets.forEach(((n,i)=>{e.isSelectedOrActive(n)&&v.setMarkdownHeader(o.get(i),t)})),v.changeCellType(e,"markdown"),v.handleState(e,n)},e.collapseAllHeadings=function(t){const n=v.getState(t);for(const n of t.widgets)e.getHeadingInfo(n).isHeading&&(e.setHeadingCollapse(n,!0,t),e.setCellCollapse(n,!0));t.activeCellIndex=0,v.handleState(t,n,!0)},e.expandAllHeadings=function(t){for(const n of t.widgets)e.getHeadingInfo(n).isHeading&&(e.setHeadingCollapse(n,!1,t),e.setCellCollapse(n,!1))},e.expandParent=function e(t,n){let o=function(e,t){const n=(0,a.findIndex)(t.widgets,((t,n)=>e.model.id===t.model.id));if(-1===n)return;if(n>=t.widgets.length)return;let o=h(t.widgets[n]);for(let e=n-1;e>=0;e--)if(e<t.widgets.length){let n=h(t.widgets[e]);if(n.isHeading&&n.headingLevel<o.headingLevel)return t.widgets[e]}}(t,n);o&&(h(o).collapsed||o.isHidden)&&(o.isHidden&&e(o,n),h(o).collapsed&&r(o,!1,n))},e.findNextParentHeading=function(e,t){let n=(0,a.findIndex)(t.widgets,((t,n)=>e.model.id===t.model.id));if(-1===n)return-1;let o=h(e);for(n+=1;n<t.widgets.length;n++){let e=h(t.widgets[n]);if(e.isHeading&&e.headingLevel<=o.headingLevel)return n}return t.widgets.length},e.setHeadingCollapse=r,e.toggleCurrentHeadingCollapse=function(t){if(!t.activeCell||void 0===t.activeCellIndex)return;let n=e.getHeadingInfo(t.activeCell);n.isHeading&&e.setHeadingCollapse(t.activeCell,!n.collapsed,t),t.scrollToItem(t.activeCellIndex).catch((e=>{}))},e.setCellCollapse=function(e,t){e instanceof i.MarkdownCell?e.headingCollapsed=t:e.setHidden(t)},e.getHeadingInfo=h,e.trust=function(e,t){const n=(t=t||l.nullTranslator).load("jupyterlab");if(!e.model)return Promise.resolve();const i=(0,a.every)(e.model.cells,(e=>e.trusted)),s=c.createElement("p",null,n.__("A trusted Jupyter notebook may execute hidden malicious code when you open it."),c.createElement("br",null),n.__('Selecting "Trust" will re-render this notebook in a trusted state.'),c.createElement("br",null),n.__("For more information, see")," ",c.createElement("a",{href:"https://jupyter-server.readthedocs.io/en/stable/operators/security.html",target:"_blank",rel:"noopener noreferrer"},n.__("the Jupyter security documentation")),".");return i?(0,o.showDialog)({body:n.__("Notebook is already trusted"),buttons:[o.Dialog.okButton()]}).then((()=>{})):(0,o.showDialog)({body:s,title:n.__("Trust this notebook?"),buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:n.__("Trust"),ariaLabel:n.__("Confirm Trusting this notebook")})]}).then((t=>{if(t.button.accept&&e.model)for(const t of e.model.cells)t.trusted=!0}))},e.focusActiveCell=g,e.accessPreviousHistory=async function(e){if(!e.notebookConfig.accessKernelHistory)return;const t=e.activeCell;if(t&&e.kernelHistory){const n=await e.kernelHistory.back(t);e.kernelHistory.updateEditor(t,n)}},e.accessNextHistory=async function(e){if(!e.notebookConfig.accessKernelHistory)return;const t=e.activeCell;if(t&&e.kernelHistory){const n=await e.kernelHistory.forward(t);e.kernelHistory.updateEditor(t,n)}}}(C||(C={})),function(e){function t(e){var t,n;return{wasFocused:e.node.contains(document.activeElement),activeCellId:null!==(n=null===(t=e.activeCell)||void 0===t?void 0:t.model.id)&&void 0!==n?n:null}}async function n(e,t,n=!1){const{activeCell:o,activeCellIndex:i}=e;n&&o&&await e.scrollToItem(i,"auto",0).catch((e=>{})),(t.wasFocused||"edit"===e.mode)&&e.activate()}function d(t,n,s,d,r){const c=n[-1];return t.mode="command",Promise.all(n.map((n=>async function(t,n,s,d,r){var c,h,u;const C=(r=r||l.nullTranslator).load("jupyterlab");switch(n.model.type){case"markdown":n.rendered=!0,n.inputHidden=!1,e.executed.emit({notebook:t,cell:n,success:!0});break;case"code":if(s){if(s.isTerminating){await(0,o.showDialog)({title:C.__("Kernel Terminating"),body:C.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(c=s.session)||void 0===c?void 0:c.path),buttons:[o.Dialog.okButton()]});break}if(s.pendingInput)return await(0,o.showDialog)({title:C.__("Cell not executed due to pending input"),body:C.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Submit your pending input and try again."),buttons:[o.Dialog.okButton()]}),!1;if(s.hasNoKernel&&await s.startKernel()&&d&&await d.selectKernel(s),s.hasNoKernel)return n.model.sharedModel.transact((()=>{n.model.clearExecution()})),!0;const l=null!==(u=null===(h=t.model)||void 0===h?void 0:h.deletedCells)&&void 0!==u?u:[];e.executionScheduled.emit({notebook:t,cell:n});let r=!1;try{const e=await i.CodeCell.execute(n,s,{deletedCells:l,recordTiming:t.notebookConfig.recordTiming});l.splice(0,l.length),r=(()=>{if(n.isDisposed)return!1;if(!e)return!0;if("ok"===e.content.status){const o=e.content;return o.payload&&o.payload.length&&function(e,t,n){var o;const i=null===(o=e.payload)||void 0===o?void 0:o.filter((e=>"set_next_input"===e.source))[0];if(!i)return;const s=i.text;if(i.replace)return void n.model.sharedModel.setSource(s);const l=t.model.sharedModel,d=t.model.cells,r=(0,a.findIndex)(d,(e=>e===n.model));-1===r?l.insertCell(l.cells.length,{cell_type:"code",source:s,metadata:{trusted:!1}}):l.insertCell(r+1,{cell_type:"code",source:s,metadata:{trusted:!1}})}(o,t,n),!0}throw new g(e.content)})()}catch(o){if(!n.isDisposed&&!o.message.startsWith("Canceled"))throw e.executed.emit({notebook:t,cell:n,success:!1,error:o}),o;r=!1}return r&&e.executed.emit({notebook:t,cell:n,success:!0}),r}n.model.sharedModel.transact((()=>{n.model.clearExecution()}),!1)}return Promise.resolve(!0)}(t,n,s,d,r)))).then((n=>!t.isDisposed&&(e.selectionExecuted.emit({notebook:t,lastCell:c}),t.update(),n.every((e=>e))))).catch((o=>{if(!o.message.startsWith("KernelReplyNotOK"))throw o;return n.map((e=>{"code"===e.model.type&&null==e.model.executionCount&&e.setPrompt("")})),e.selectionExecuted.emit({notebook:t,lastCell:c}),t.update(),!1}))}function c(e){const t=e.model.sharedModel,n=[];e.mode="command",e.widgets.forEach(((t,o)=>{var i;const s=!1!==t.model.getMetadata("deletable");e.isSelectedOrActive(t)&&s&&(n.push(o),null===(i=e.model)||void 0===i||i.deletedCells.push(t.model.id))})),n.length>0&&(t.transact((()=>{n.reverse().forEach((e=>{t.deleteCell(e)})),t.cells.length==n.length&&t.insertCell(0,{cell_type:e.notebookConfig.defaultCell,metadata:"code"===e.notebookConfig.defaultCell?{trusted:!0}:{}})})),e.activeCellIndex=n[0]-n.length+1),e.deselectAll()}let h;e.executed=new r.Signal({}),e.executionScheduled=new r.Signal({}),e.selectionExecuted=new r.Signal({}),e.outputCleared=new r.Signal({}),e.getState=t,e.handleState=n,e.handleRunState=async function(e,t,n=!1){const{activeCell:o,activeCellIndex:i}=e;n&&o&&await e.scrollToItem(i,"smart",0).catch((e=>{})),(t.wasFocused||"edit"===e.mode)&&e.activate()},e.runCells=d,e.runSelected=function(e,t,n,o){e.mode="command";let i=e.activeCellIndex;const s=e.widgets.filter(((t,n)=>{const o=e.isSelectedOrActive(t);return o&&(i=n),o}));return e.activeCellIndex=i,e.deselectAll(),d(e,s,t,n,o)},e.selectedCells=function(e){return e.widgets.filter((t=>e.isSelectedOrActive(t))).map((e=>e.model.toJSON())).map((e=>(void 0!==e.metadata.deletable&&delete e.metadata.deletable,e)))},e.copyOrCut=function(i,s){if(!i.model||!i.activeCell)return;const l=t(i),a=o.Clipboard.getInstance();i.mode="command",a.clear();const d=e.selectedCells(i);a.setData(u,d),s?c(i):i.deselectAll(),i.lastClipboardInteraction=s?"cut":"copy",n(i,l)},e.changeCellType=function(e,t){const n=e.model.sharedModel;e.widgets.forEach(((o,i)=>{if(e.isSelectedOrActive(o)){if(o.model.type!==t){const e=o.model.toJSON();n.transact((()=>{n.deleteCell(i),e.metadata.trusted="code"===t||void 0;const o=n.insertCell(i,{cell_type:t,source:e.source,metadata:e.metadata});e.attachments&&["markdown","raw"].includes(t)&&(o.attachments=e.attachments)}))}"markdown"===t&&((o=e.widgets[i]).rendered=!1)}})),e.deselectAll()},e.deleteCells=c,e.setMarkdownHeader=function(e,t){let n=e.sharedModel.getSource();const o=Array(t+1).join("#")+" ",i=/^(#+\s*)|^(\s*)/.exec(n);i&&(n=n.slice(i[0].length)),e.sharedModel.setSource(o+n)},function(t){function n(e,t,n=!1,o=!1){let i=t.widgets.indexOf(e)-(n?1:0);for(;i>=0;){if(C.getHeadingInfo(t.widgets[i]).isHeading)return o?i:t.widgets[i];i--}return o?-1:null}t.findParentHeading=n,t.findLowerEqualLevelParentHeadingAbove=function(t,n,o=!1){let i=e.Headings.determineHeadingLevel(t,n);-1==i&&(i=1);let s=n.widgets.indexOf(t)-1;for(;s>=0;){let e=n.widgets[s],t=C.getHeadingInfo(e);if(t.isHeading&&t.headingLevel<=i)return o?s:e;s--}return o?-1:null},t.findLowerEqualLevelHeadingBelow=function(t,n,o=!1){let i=e.Headings.determineHeadingLevel(t,n);-1==i&&(i=1);let s=n.widgets.indexOf(t)+1;for(;s<n.widgets.length;){let e=n.widgets[s],t=C.getHeadingInfo(e);if(t.isHeading&&t.headingLevel<=i)return o?s:e;s++}return o?-1:null},t.findHeadingBelow=function(e,t,n=!1){let o=t.widgets.indexOf(e)+1;for(;o<t.widgets.length;){let e=t.widgets[o];if(C.getHeadingInfo(e).isHeading)return n?o:e;o++}return n?-1:null},t.determineHeadingLevel=function(e,t){let o=C.getHeadingInfo(e);if(o.isHeading)return o.headingLevel;{let o=n(e,t,!0);return null==o?-1:C.getHeadingInfo(o).headingLevel}},t.insertHeadingAboveCellIndex=async function(t,n,o){var i;n=Math.min(Math.max(n,1),6);const l=e.getState(o);o.model.sharedModel.insertCell(t,{cell_type:"markdown",source:"#".repeat(n)+" "}),o.activeCellIndex=t,!1===(null===(i=o.activeCell)||void 0===i?void 0:i.inViewport)&&await(0,s.signalToPromise)(o.activeCell.inViewportChanged,200).catch((()=>{})),o.deselectAll(),e.handleState(o,l,!0),o.mode="edit",o.widgets[t].setHidden(!1)}}(h=e.Headings||(e.Headings={}))}(v||(v={}));class m{constructor(e){this.model=e,this._cellMap=new WeakMap,this._changed=new r.Signal(this),this._isDisposed=!1,this._insertCells(0,this.model.cells),this.model.changed.connect(this._onSharedModelChanged,this)}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get length(){return this.model.cells.length}*[Symbol.iterator](){for(const e of this.model.cells)yield this._cellMap.get(e)}dispose(){var e;if(!this._isDisposed){this._isDisposed=!0;for(const t of this.model.cells)null===(e=this._cellMap.get(t))||void 0===e||e.dispose();r.Signal.clearData(this)}}get(e){return this._cellMap.get(this.model.cells[e])}_insertCells(e,t){return t.forEach((e=>{let t;switch(e.cell_type){case"code":t=new i.CodeCellModel({sharedModel:e});break;case"markdown":t=new i.MarkdownCellModel({sharedModel:e});break;default:t=new i.RawCellModel({sharedModel:e})}this._cellMap.set(e,t),e.disposed.connect((()=>{t.dispose(),this._cellMap.delete(e)}))})),this.length}_onSharedModelChanged(e,t){var n;let o=0;const i=new Array;null===(n=t.cellsChange)||void 0===n||n.forEach((e=>{null!=e.insert?(this._insertCells(o,e.insert),i.push({type:"add",newIndex:o,newValues:e.insert.map((e=>this._cellMap.get(e))),oldIndex:-2,oldValues:[]}),o+=e.insert.length):null!=e.delete?i.push({type:"remove",newIndex:-1,newValues:[],oldIndex:o,oldValues:new Array(e.delete).fill(void 0)}):null!=e.retain&&(o+=e.retain)})),i.forEach((e=>this._changed.emit(e)))}}var p,_=n(70798);!function(e){function t(e,t){const n=(t||l.nullTranslator).load("jupyterlab");function i(){if(e.context.model.readOnly)return(0,o.showDialog)({title:n.__("Cannot Save"),body:n.__("Document is read-only"),buttons:[o.Dialog.okButton()]});e.context.save().then((()=>{if(!e.isDisposed)return e.context.createCheckpoint()}))}return(0,_.addToolbarButtonClass)(_.ReactWidget.create(c.createElement(_.UseSignal,{signal:e.context.fileChanged},(()=>c.createElement(_.ToolbarButtonComponent,{icon:_.saveIcon,onClick:i,tooltip:n.__("Save the notebook contents and create checkpoint"),enabled:!!(e&&e.context&&e.context.contentsModel&&e.context.contentsModel.writable)})))))}function n(e,t){const n=(t||l.nullTranslator).load("jupyterlab");return new _.ToolbarButton({icon:_.addIcon,onClick:()=>{C.insertBelow(e.content)},tooltip:n.__("Insert a cell below")})}function i(e,t){const n=(t||l.nullTranslator).load("jupyterlab");return new _.ToolbarButton({icon:_.cutIcon,onClick:()=>{C.cut(e.content)},tooltip:n.__("Cut the selected cells")})}function s(e,t){const n=(t||l.nullTranslator).load("jupyterlab");return new _.ToolbarButton({icon:_.copyIcon,onClick:()=>{C.copy(e.content)},tooltip:n.__("Copy the selected cells")})}function a(e,t){const n=(t||l.nullTranslator).load("jupyterlab");return new _.ToolbarButton({icon:_.pasteIcon,onClick:()=>{C.paste(e.content)},tooltip:n.__("Paste cells from the clipboard")})}function d(e,t,n){const o=(null!=n?n:l.nullTranslator).load("jupyterlab");return new _.ToolbarButton({icon:_.runIcon,onClick:()=>{C.runAndAdvance(e.content,e.sessionContext,t,n)},tooltip:o.__("Run the selected cells and advance")})}function r(e,t,n){const i=(null!=n?n:l.nullTranslator).load("jupyterlab");return new _.ToolbarButton({icon:_.fastForwardIcon,onClick:()=>{const i=null!=t?t:new o.SessionContextDialogs({translator:n});i.restart(e.sessionContext).then((t=>(t&&C.runAll(e.content,e.sessionContext,i,n),t)))},tooltip:i.__("Restart the kernel, then re-run the whole notebook")})}function h(e,t){return new f(e.content,t)}e.createSaveButton=t,e.createInsertButton=n,e.createCutButton=i,e.createCopyButton=s,e.createPasteButton=a,e.createRunButton=d,e.createRestartRunAllButton=r,e.createCellTypeItem=h,e.getDefaultItems=function(e,l,c){return[{name:"save",widget:t(e,c)},{name:"insert",widget:n(e,c)},{name:"cut",widget:i(e,c)},{name:"copy",widget:s(e,c)},{name:"paste",widget:a(e,c)},{name:"run",widget:d(e,l,c)},{name:"interrupt",widget:o.Toolbar.createInterruptButton(e.sessionContext,c)},{name:"restart",widget:o.Toolbar.createRestartButton(e.sessionContext,l,c)},{name:"restart-and-run",widget:r(e,l,c)},{name:"cellType",widget:h(e,c)},{name:"spacer",widget:_.Toolbar.createSpacerItem()},{name:"kernelName",widget:o.Toolbar.createKernelNameItem(e.sessionContext,l,c)}]}}(p||(p={}));class f extends _.ReactWidget{constructor(e,t){super(),this.handleChange=e=>{"-"!==e.target.value&&(C.changeCellType(this._notebook,e.target.value),this._notebook.activate())},this.handleKeyDown=e=>{13===e.keyCode&&this._notebook.activate()},this._trans=(t||l.nullTranslator).load("jupyterlab"),this.addClass("jp-Notebook-toolbarCellType"),this._notebook=e,e.model&&this.update(),e.activeCellChanged.connect(this.update,this),e.selectionChanged.connect(this.update,this)}render(){let e="-";this._notebook.activeCell&&(e=this._notebook.activeCell.model.type);for(const t of this._notebook.widgets)if(this._notebook.isSelectedOrActive(t)&&t.model.type!==e){e="-";break}return c.createElement(_.HTMLSelect,{className:"jp-Notebook-toolbarCellTypeDropdown",onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e,"aria-label":this._trans.__("Cell type"),title:this._trans.__("Select the cell type")},c.createElement("option",{value:"-"},"-"),c.createElement("option",{value:"code"},this._trans.__("Code")),c.createElement("option",{value:"markdown"},this._trans.__("Markdown")),c.createElement("option",{value:"raw"},this._trans.__("Raw")))}}var w=n(72881),y=n(91940);function b(e){const t=e.translator||l.nullTranslator,n=(0,o.translateKernelStatuses)(t),i=t.load("jupyterlab"),s=e.state,a=e.displayOption.showOnToolBar,d=e.displayOption.showProgress,r=a?"down":"up",c=h().createElement("div",null);if(!s)return c;const u=s.kernelStatus,g={alignSelf:"normal",height:"24px"},C=s.totalTime,v=s.scheduledCellNumber||0,m=v-(s.scheduledCell.size||0);let p=100*m/v,f=d?"":"hidden";!d&&p<100&&(p=0);const y=e=>h().createElement(w.ProgressCircle,{progress:e,width:16,height:24,label:i.__("Kernel status")}),b=e=>i.__("Kernel status: %1",e),k=(e,t,o)=>h().createElement("div",{className:"jp-Notebook-ExecutionIndicator",title:d?"":b(n[e]),"data-status":e},t,h().createElement("div",{className:`jp-Notebook-ExecutionIndicator-tooltip ${r} ${f}`},h().createElement("span",null," ",b(n[e])," "),o));if("connecting"===s.kernelStatus||"disconnected"===s.kernelStatus||"unknown"===s.kernelStatus)return k(u,h().createElement(_.offlineBoltIcon.react,{...g}),[]);if("starting"===s.kernelStatus||"terminating"===s.kernelStatus||"restarting"===s.kernelStatus||"initializing"===s.kernelStatus)return k(u,h().createElement(_.circleIcon.react,{...g}),[]);if("busy"===s.executionStatus)return k("busy",y(p),[h().createElement("span",{key:0},i.__(`Executed ${m}/${v} cells`)),h().createElement("span",{key:1},i._n("Elapsed time: %1 second","Elapsed time: %1 seconds",C))]);{const e="busy"===s.kernelStatus?0:100,t="busy"===s.kernelStatus||0===C?[]:[h().createElement("span",{key:0},i._n("Executed %1 cell","Executed %1 cells",v)),h().createElement("span",{key:1},i._n("Elapsed time: %1 second","Elapsed time: %1 seconds",C))];return k(s.kernelStatus,y(e),t)}}class k extends _.VDomRenderer{constructor(e,t=!0){super(new k.Model),this.translator=e||l.nullTranslator,this.addClass("jp-mod-highlighted")}render(){if(null!==this.model&&this.model.renderFlag){const e=this.model.currentNotebook;return e?h().createElement(b,{displayOption:this.model.displayOption,state:this.model.executionState(e),translator:this.translator}):h().createElement(b,{displayOption:this.model.displayOption,state:void 0,translator:this.translator})}return h().createElement("div",null)}}!function(e){class t extends _.VDomModel{constructor(){super(),this._notebookExecutionProgress=new WeakMap,this._displayOption={showOnToolBar:!0,showProgress:!0},this._renderFlag=!0}attachNotebook(e){var t,n,o,i;if(e&&e.content&&e.context){const s=e.content,l=e.context;if(this._currentNotebook=s,!this._notebookExecutionProgress.has(s)){this._notebookExecutionProgress.set(s,{executionStatus:"idle",kernelStatus:"idle",totalTime:0,interval:0,timeout:0,scheduledCell:new Set,scheduledCellNumber:0,needReset:!0});const e=this._notebookExecutionProgress.get(s),a=t=>{e&&(e.kernelStatus=t.kernelDisplayStatus),this.stateChanged.emit(void 0)};l.statusChanged.connect(a,this);const d=t=>{e&&(e.kernelStatus=t.kernelDisplayStatus),this.stateChanged.emit(void 0)};l.connectionStatusChanged.connect(d,this),l.disposed.connect((e=>{e.connectionStatusChanged.disconnect(d,this),e.statusChanged.disconnect(a,this)}));const r=(e,t)=>{const n=t.msg,o=n.header.msg_id;if("execute_request"===n.header.msg_type)this._cellScheduledCallback(s,o);else if(y.KernelMessage.isStatusMsg(n)&&"idle"===n.content.execution_state){const e=n.parent_header.msg_id;this._cellExecutedCallback(s,e)}else y.KernelMessage.isStatusMsg(n)&&"restarting"===n.content.execution_state?this._restartHandler(s):"execute_input"===n.header.msg_type&&this._startTimer(s)};null===(n=null===(t=l.session)||void 0===t?void 0:t.kernel)||void 0===n||n.anyMessage.connect(r),null===(i=null===(o=l.session)||void 0===o?void 0:o.kernel)||void 0===i||i.disposed.connect((e=>e.anyMessage.disconnect(r)));const c=(t,n)=>{e&&(this._resetTime(e),this.stateChanged.emit(void 0),n.newValue&&n.newValue.anyMessage.connect(r))};l.kernelChanged.connect(c),l.disposed.connect((e=>e.kernelChanged.disconnect(c)))}}}get currentNotebook(){return this._currentNotebook}get displayOption(){return this._displayOption}set displayOption(e){this._displayOption=e}executionState(e){return this._notebookExecutionProgress.get(e)}_scheduleSwitchToIdle(e){window.setTimeout((()=>{e.executionStatus="idle",clearInterval(e.interval),this.stateChanged.emit(void 0)}),150),e.timeout=window.setTimeout((()=>{e.needReset=!0}),1e3)}_cellExecutedCallback(e,t){const n=this._notebookExecutionProgress.get(e);n&&n.scheduledCell.has(t)&&(n.scheduledCell.delete(t),0===n.scheduledCell.size&&this._scheduleSwitchToIdle(n))}_restartHandler(e){const t=this._notebookExecutionProgress.get(e);t&&(t.scheduledCell.clear(),this._scheduleSwitchToIdle(t))}_startTimer(e){const t=this._notebookExecutionProgress.get(e);t&&(t.scheduledCell.size>0?"busy"!==t.executionStatus&&(t.executionStatus="busy",clearTimeout(t.timeout),this.stateChanged.emit(void 0),t.interval=window.setInterval((()=>{this._tick(t)}),1e3)):this._resetTime(t))}_cellScheduledCallback(e,t){const n=this._notebookExecutionProgress.get(e);n&&!n.scheduledCell.has(t)&&(n.needReset&&this._resetTime(n),n.scheduledCell.add(t),n.scheduledCellNumber+=1)}_tick(e){e.totalTime+=1,this.stateChanged.emit(void 0)}_resetTime(e){e.totalTime=0,e.scheduledCellNumber=0,e.executionStatus="idle",e.scheduledCell=new Set,clearTimeout(e.timeout),clearInterval(e.interval),e.needReset=!1}get renderFlag(){return this._renderFlag}updateRenderOption(e){this.displayOption.showOnToolBar&&(e.showOnToolBar?this._renderFlag=!0:this._renderFlag=!1),this.displayOption.showProgress=e.showProgress,this.stateChanged.emit(void 0)}}function n(e){let t=!0,n=!0;const o=e.get("kernelStatus").composite;return o&&(t=!o.showOnStatusBar,n=o.showProgress),{showOnToolBar:t,showProgress:n}}e.Model=t,e.createExecutionIndicatorItem=function(t,o,i){const s=new e(o);return s.model.displayOption={showOnToolBar:!0,showProgress:!0},s.model.attachNotebook({content:t.content,context:t.sessionContext}),i&&i.then((e=>{const t=e=>{s.model.updateRenderOption(n(e))};e.changed.connect(t),t(e),s.disposed.connect((()=>{e.changed.disconnect(t)}))})).catch((e=>{console.error(e.message)})),s},e.getSettingValue=n}(k||(k={}));var S=n(76062),x=n(23781);class M{constructor(e={}){var t,n;this.standaloneModel=!1,this._dirty=!1,this._readOnly=!1,this._contentChanged=new r.Signal(this),this._stateChanged=new r.Signal(this),this._isDisposed=!1,this._metadataChanged=new r.Signal(this),this.standaloneModel=void 0===e.sharedModel,e.sharedModel?this.sharedModel=e.sharedModel:this.sharedModel=x.YNotebook.create({disableDocumentWideUndoRedo:null===(t=e.disableDocumentWideUndoRedo)||void 0===t||t,data:{nbformat:S.MAJOR_VERSION,nbformat_minor:S.MINOR_VERSION,metadata:{kernelspec:{name:"",display_name:""},language_info:{name:null!==(n=e.languagePreference)&&void 0!==n?n:""}}}}),this._cells=new m(this.sharedModel),this._trans=(e.translator||l.nullTranslator).load("jupyterlab"),this._deletedCells=[],this._collaborationEnabled=!!(null==e?void 0:e.collaborationEnabled),this._cells.changed.connect(this._onCellsChanged,this),this.sharedModel.changed.connect(this._onStateChanged,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get contentChanged(){return this._contentChanged}get metadataChanged(){return this._metadataChanged}get stateChanged(){return this._stateChanged}get cells(){return this._cells}get dirty(){return this._dirty}set dirty(e){const t=this._dirty;e!==t&&(this._dirty=e,this.triggerStateChange({name:"dirty",oldValue:t,newValue:e}))}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly)return;const t=this._readOnly;this._readOnly=e,this.triggerStateChange({name:"readOnly",oldValue:t,newValue:e})}get metadata(){return this.sharedModel.metadata}get nbformat(){return this.sharedModel.nbformat}get nbformatMinor(){return this.sharedModel.nbformat_minor}get defaultKernelName(){var e;const t=this.getMetadata("kernelspec");return null!==(e=null==t?void 0:t.name)&&void 0!==e?e:""}get deletedCells(){return this._deletedCells}get defaultKernelLanguage(){var e;const t=this.getMetadata("language_info");return null!==(e=null==t?void 0:t.name)&&void 0!==e?e:""}get collaborative(){return this._collaborationEnabled}dispose(){if(this.isDisposed)return;this._isDisposed=!0;const e=this.cells;this._cells=null,e.dispose(),this.standaloneModel&&this.sharedModel.dispose(),r.Signal.clearData(this)}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){void 0===t?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toString(){return JSON.stringify(this.toJSON())}fromString(e){this.fromJSON(JSON.parse(e))}toJSON(){return this._ensureMetadata(),this.sharedModel.toJSON()}fromJSON(e){var t,n;const i=d.JSONExt.deepCopy(e),s=e.metadata.orig_nbformat;if(i.nbformat=Math.max(e.nbformat,S.MAJOR_VERSION),(i.nbformat!==e.nbformat||i.nbformat_minor<S.MINOR_VERSION)&&(i.nbformat_minor=S.MINOR_VERSION),void 0!==s&&i.nbformat!==s){let e;e=i.nbformat>s?this._trans.__("This notebook has been converted from an older notebook format (v%1)\nto the current notebook format (v%2).\nThe next time you save this notebook, the current notebook format (v%2) will be used.\n'Older versions of Jupyter may not be able to read the new format.' To preserve the original format version,\nclose the notebook without saving it.",s,i.nbformat):this._trans.__("This notebook has been converted from an newer notebook format (v%1)\nto the current notebook format (v%2).\nThe next time you save this notebook, the current notebook format (v%2) will be used.\nSome features of the original notebook may not be available.' To preserve the original format version,\nclose the notebook without saving it.",s,i.nbformat),(0,o.showDialog)({title:this._trans.__("Notebook converted"),body:e,buttons:[o.Dialog.okButton({label:this._trans.__("Ok")})]})}0===(null!==(n=null===(t=i.cells)||void 0===t?void 0:t.length)&&void 0!==n?n:0)&&(i.cells=[{cell_type:"code",source:"",metadata:{trusted:!0}}]),this.sharedModel.fromJSON(i),this._ensureMetadata(),this.dirty=!0}_onCellsChanged(e,t){switch(t.type){case"add":case"set":t.newValues.forEach((e=>{e.contentChanged.connect(this.triggerContentChange,this)}))}this.triggerContentChange()}_onMetadataChanged(e,t){this._metadataChanged.emit(t),this.triggerContentChange()}_onStateChanged(e,t){t.stateChange&&t.stateChange.forEach((e=>{"dirty"===e.name?this.dirty=e.newValue:e.oldValue!==e.newValue&&this.triggerStateChange({newValue:void 0,oldValue:void 0,...e})}))}_ensureMetadata(e=""){this.getMetadata("language_info")||this.sharedModel.setMetadata("language_info",{name:e}),this.getMetadata("kernelspec")||this.sharedModel.setMetadata("kernelspec",{name:"",display_name:""})}triggerStateChange(e){this._stateChanged.emit(e)}triggerContentChange(){this._contentChanged.emit(void 0),this.dirty=!0}get isDisposed(){return this._isDisposed}}class I{constructor(e={}){var t,n;this._disposed=!1,this._disableDocumentWideUndoRedo=null===(t=e.disableDocumentWideUndoRedo)||void 0===t||t,this._collaborative=null===(n=e.collaborative)||void 0===n||n}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}set disableDocumentWideUndoRedo(e){this._disableDocumentWideUndoRedo=e}get name(){return"notebook"}get contentType(){return"notebook"}get fileFormat(){return"json"}get collaborative(){return this._collaborative}get isDisposed(){return this._disposed}dispose(){this._disposed=!0}createNew(e={}){return new M({languagePreference:e.languagePreference,sharedModel:e.sharedModel,collaborationEnabled:e.collaborationEnabled&&this.collaborative,disableDocumentWideUndoRedo:this._disableDocumentWideUndoRedo})}preferredLanguage(e){return""}}function A(e){const t=(e.translator||l.nullTranslator).load("jupyterlab");return c.createElement(w.TextItem,{source:t.__("Mode: %1",e.modeNames[e.notebookMode])})}class E extends _.VDomRenderer{constructor(e){super(new E.Model),this.translator=e||l.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._modeNames={command:this._trans.__("Command"),edit:this._trans.__("Edit")}}render(){return this.model?(this.node.title=this._trans.__("Notebook is in %1 mode",this._modeNames[this.model.notebookMode]),c.createElement(A,{notebookMode:this.model.notebookMode,translator:this.translator,modeNames:this._modeNames})):null}}!function(e){class t extends _.VDomModel{constructor(){super(...arguments),this._onChanged=e=>{const t=this._notebookMode;this._notebook?this._notebookMode=e.mode:this._notebookMode="command",this._triggerChange(t,this._notebookMode)},this._notebookMode="command",this._notebook=null}get notebookMode(){return this._notebookMode}set notebook(e){const t=this._notebook;null!==t&&(t.stateChanged.disconnect(this._onChanged,this),t.activeCellChanged.disconnect(this._onChanged,this),t.modelContentChanged.disconnect(this._onChanged,this));const n=this._notebookMode;this._notebook=e,null===this._notebook?this._notebookMode="command":(this._notebookMode=this._notebook.mode,this._notebook.stateChanged.connect(this._onChanged,this),this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this)),this._triggerChange(n,this._notebookMode)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(E||(E={}));var T=n(97698),P=n(94146);class H extends P.WidgetLSPAdapter{constructor(e,t){super(e,t),this.editorWidget=e,this.options=t,this._type="code",this._readyDelegate=new d.PromiseDelegate,this._editorToCell=new Map,this.editor=e.content,this._cellToEditor=new WeakMap,Promise.all([this.widget.context.sessionContext.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve()})).catch(console.error)}get documentPath(){return this.widget.context.path}get mimeType(){var e;let t,n=this.language_info();return t=n&&n.mimetype?n.mimetype:this.widget.content.codeMimetype,Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:T.IEditorMimeTypeService.defaultMimeType:t}get languageFileExtension(){let e=this.language_info();if(e&&e.file_extension)return e.file_extension.replace(".","")}get wrapperElement(){return this.widget.node}get editors(){if(this.isDisposed)return[];let e=this.widget.content;return this._editorToCell.clear(),e.isDisposed?[]:e.widgets.map((e=>({ceEditor:this._getCellEditor(e),type:e.model.type,value:e.model.sharedModel.getSource()})))}get activeEditor(){return this.editor.activeCell?this._getCellEditor(this.editor.activeCell):void 0}get ready(){return this._readyDelegate.promise}getEditorIndexAt(e){let t=this._getCellAt(e);return this.widget.content.widgets.findIndex((e=>t===e))}getEditorIndex(e){let t=this._editorToCell.get(e);return this.editor.widgets.findIndex((e=>t===e))}getEditorWrapper(e){return this._editorToCell.get(e).node}async onKernelChanged(e,t){if(t.newValue)try{const e=this._languageInfo;await(0,P.untilReady)(this.isReady,-1),await this._updateLanguageInfo();const t=this._languageInfo;(null==e?void 0:e.name)!=t.name||(null==e?void 0:e.mimetype)!=(null==t?void 0:t.mimetype)||(null==e?void 0:e.file_extension)!=(null==t?void 0:t.file_extension)?(console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`),this.reloadConnection()):console.log("Keeping old LSP connection as the new kernel uses the same langauge")}catch(e){console.warn(e),this.reloadConnection()}}dispose(){this.isDisposed||(this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged,this),this.widget.content.activeCellChanged.disconnect(this._activeCellChanged,this),super.dispose(),this._editorToCell.clear(),r.Signal.clearData(this))}isReady(){var e;return!this.widget.isDisposed&&this.widget.context.isReady&&this.widget.content.isVisible&&this.widget.content.widgets.length>0&&null!=(null===(e=this.widget.context.sessionContext.session)||void 0===e?void 0:e.kernel)}async handleCellChange(e,t){let n=[],o=[];const i=this._type;if("set"===t.type){let e=[],s=[];if(t.newValues.length===t.oldValues.length){for(let n=0;n<t.newValues.length;n++)t.oldValues[n].type===i&&t.newValues[n].type!==i?e.push(t.newValues[n]):t.oldValues[n].type!==i&&t.newValues[n].type===i&&s.push(t.newValues[n]);n=s,o=e}}else"add"==t.type&&(n=t.newValues.filter((e=>e.type===i)));(o.length||n.length||"set"===t.type||"move"===t.type||"remove"===t.type)&&await this.updateDocuments();for(let e of n){let t=this.widget.content.widgets.find((t=>t.model.id===e.id));t?this._getCellEditor(t):console.warn(`Widget for added cell with ID: ${e.id} not found!`)}}createVirtualDocument(){return new P.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!1,hasLspSupportedFile:!1})}language_info(){return this._languageInfo}async initOnceReady(){await(0,P.untilReady)(this.isReady.bind(this),-1),await this._updateLanguageInfo(),this.initVirtual(),this.connectDocument(this.virtualDocument,!1).catch(console.warn),this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged,this),this.widget.content.activeCellChanged.connect(this._activeCellChanged,this),this._connectModelSignals(this.widget),this.editor.modelChanged.connect((e=>{console.warn("Model changed, connecting cell change handler; this is not something we were expecting"),this._connectModelSignals(e)}))}_connectModelSignals(e){null===e.model?console.warn(`Model is missing for notebook ${e}, cannot connect cell changed signal!`):e.model.cells.changed.connect(this.handleCellChange,this)}async _updateLanguageInfo(){var e,t,n,o;const i=null===(o=await(null===(n=null===(t=null===(e=this.widget.context.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel)||void 0===n?void 0:n.info))||void 0===o?void 0:o.language_info;if(!i)throw new Error("Language info update failed (no session, kernel, or info available)");this._languageInfo=i}_activeCellChanged(e,t){t&&t.model.type===this._type&&this._activeEditorChanged.emit({editor:this._getCellEditor(t)})}_getCellAt(e){let t=this.virtualDocument.getEditorAtVirtualLine(e);return this._editorToCell.get(t)}_getCellEditor(e){if(!this._cellToEditor.has(e)){const t=Object.freeze({getEditor:()=>e.editor,ready:async()=>(await e.ready,e.editor),reveal:async()=>(await this.editor.scrollToCell(e),e.editor)});this._cellToEditor.set(e,t),this._editorToCell.set(t,e),e.disposed.connect((()=>{this._cellToEditor.delete(e),this._editorToCell.delete(t),this._editorRemoved.emit({editor:t})})),this._editorAdded.emit({editor:t})}return this._cellToEditor.get(e)}}var N,D=n(29491),L=n(49503),O=n(31516);class R extends O.Widget{constructor(){super(),this._items=[],this.layout=new O.PanelLayout,this.addClass("jp-RankedPanel")}addWidget(e,t){const n={widget:e,rank:t},o=a.ArrayExt.upperBound(this._items,n,N.itemCmp);a.ArrayExt.insert(this._items,o,n),this.layout.insertWidget(o,e)}onChildRemoved(e){const t=a.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e.child));-1!==t&&a.ArrayExt.removeAt(this._items,t)}}class B extends O.Widget{constructor(e){super(),this.addClass("jp-NotebookTools"),this.translator=e.translator||l.nullTranslator,this._tools=[],this.layout=new O.PanelLayout,this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged,this),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.selectionChanged.connect(this._onSelectionChanged,this),this._onActiveNotebookPanelChanged(),this._onActiveCellChanged(),this._onSelectionChanged()}get activeCell(){return this._tracker.activeCell}get selectedCells(){const e=this._tracker.currentWidget;if(!e)return[];const t=e.content;return t.widgets.filter((e=>t.isSelectedOrActive(e)))}get activeNotebookPanel(){return this._tracker.currentWidget}addItem(e){var t;const n=e.tool,o=null!==(t=e.rank)&&void 0!==t?t:100;let i;const s=this._tools.find((t=>t.section===e.section));if(!s)throw new Error(`The section ${e.section} does not exist`);i=s.panel,n.addClass("jp-NotebookTools-tool"),i.addWidget(n,o),n.notebookTools=this,L.MessageLoop.sendMessage(n,B.ActiveNotebookPanelMessage),L.MessageLoop.sendMessage(n,B.ActiveCellMessage)}addSection(e){var t;const n=e.sectionName,o=e.label||e.sectionName,i=e.tool;let s=null!==(t=e.rank)&&void 0!==t?t:null;const l=new R;if(l.title.label=o,i&&l.addWidget(i,0),this._tools.push({section:n,panel:l,rank:s}),null!=s)this.layout.insertWidget(s,new _.Collapser({widget:l}));else{let e=null;const t=this.layout;for(let n=0;n<t.widgets.length;n++){let o=t.widgets[n];if(o instanceof _.Collapser&&"advancedToolsSection"===o.widget.id){e=n;break}}null!==e?this.layout.insertWidget(e,new _.Collapser({widget:l})):this.layout.addWidget(new _.Collapser({widget:l}))}}_onActiveNotebookPanelChanged(){this._prevActiveNotebookModel&&!this._prevActiveNotebookModel.isDisposed&&this._prevActiveNotebookModel.metadataChanged.disconnect(this._onActiveNotebookPanelMetadataChanged,this);const e=this.activeNotebookPanel&&this.activeNotebookPanel.content?this.activeNotebookPanel.content.model:null;this._prevActiveNotebookModel=e,e&&e.metadataChanged.connect(this._onActiveNotebookPanelMetadataChanged,this);for(const e of this._toolChildren())L.MessageLoop.sendMessage(e,B.ActiveNotebookPanelMessage)}_onActiveCellChanged(){this._prevActiveCell&&!this._prevActiveCell.isDisposed&&this._prevActiveCell.metadataChanged.disconnect(this._onActiveCellMetadataChanged,this);const e=this.activeCell?this.activeCell.model:null;this._prevActiveCell=e,e&&e.metadataChanged.connect(this._onActiveCellMetadataChanged,this);for(const e of this._toolChildren())L.MessageLoop.sendMessage(e,B.ActiveCellMessage)}_onSelectionChanged(){for(const e of this._toolChildren())L.MessageLoop.sendMessage(e,B.SelectionMessage)}_onActiveNotebookPanelMetadataChanged(e,t){const n=new D.ObservableJSON.ChangeMessage("activenotebookpanel-metadata-changed",{oldValue:void 0,newValue:void 0,...t});for(const e of this._toolChildren())L.MessageLoop.sendMessage(e,n)}_onActiveCellMetadataChanged(e,t){const n=new D.ObservableJSON.ChangeMessage("activecell-metadata-changed",{newValue:void 0,oldValue:void 0,...t});for(const e of this._toolChildren())L.MessageLoop.sendMessage(e,n)}*_toolChildren(){for(let e of this._tools)yield*e.panel.children()}}!function(e){e.ActiveNotebookPanelMessage=new L.ConflatableMessage("activenotebookpanel-changed"),e.ActiveCellMessage=new L.ConflatableMessage("activecell-changed"),e.SelectionMessage=new L.ConflatableMessage("selection-changed");class t extends O.Widget{dispose(){super.dispose(),this.notebookTools&&(this.notebookTools=null)}processMessage(e){switch(super.processMessage(e),e.type){case"activenotebookpanel-changed":this.onActiveNotebookPanelChanged(e);break;case"activecell-changed":this.onActiveCellChanged(e);break;case"selection-changed":this.onSelectionChanged(e);break;case"activecell-metadata-changed":this.onActiveCellMetadataChanged(e);break;case"activenotebookpanel-metadata-changed":this.onActiveNotebookPanelMetadataChanged(e)}}onActiveNotebookPanelChanged(e){}onActiveCellChanged(e){}onSelectionChanged(e){}onActiveCellMetadataChanged(e){}onActiveNotebookPanelMetadataChanged(e){}}e.Tool=t,e.MetadataEditorTool=class extends t{constructor(e){super();const{editorFactory:t}=e;this.addClass("jp-MetadataEditorTool");const n=this.layout=new O.PanelLayout;this._editorFactory=t,this._editorLabel=e.label||"Edit Metadata",this.createEditor();const o=new O.Widget({node:document.createElement("label")});o.node.textContent=e.label||"Edit Metadata",n.addWidget(o),n.addWidget(this.editor)}get editor(){return this._editor}onActiveNotebookPanelChanged(e){this.editor.dispose(),this.notebookTools.activeNotebookPanel&&this.createEditor()}createEditor(){this._editor=new T.JSONEditor({editorFactory:this._editorFactory}),this.editor.title.label=this._editorLabel,this.layout.addWidget(this.editor)}}}(B||(B={})),function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(N||(N={}));var F=n(46819),V=n(19024),W=n(18395),j=n(99615),U=n(14421),q=n(24475);const K="jp-mod-dropTarget",z="jp-mod-dropSource";class J extends _.WindowedListModel{constructor(e,t){super(t),this.cells=e,this.estimateWidgetSize=e=>{const t=this.cells[e].model.sharedModel.getSource().split("\n").length;return J.DEFAULT_EDITOR_LINE_HEIGHT*t+J.DEFAULT_CELL_MARGIN},this.widgetRenderer=e=>this.cells[e],this.scrollDownThreshold=J.DEFAULT_CELL_MARGIN/2+J.DEFAULT_EDITOR_LINE_HEIGHT,this.scrollUpThreshold=J.DEFAULT_CELL_MARGIN/2,this._estimatedWidgetSize=J.DEFAULT_CELL_SIZE}}J.DEFAULT_CELL_SIZE=39,J.DEFAULT_EDITOR_LINE_HEIGHT=17,J.DEFAULT_CELL_MARGIN=22;class $ extends _.WindowedLayout{constructor(){super(...arguments),this._header=null,this._footer=null,this._willBeRemoved=null,this._topHiddenCodeCells=-1}get header(){return this._header}set header(e){var t;this._header&&this._header.isAttached&&O.Widget.detach(this._header),this._header=e,this._header&&(null===(t=this.parent)||void 0===t?void 0:t.isAttached)&&O.Widget.attach(this._header,this.parent.node)}get footer(){return this._footer}set footer(e){var t;this._footer&&this._footer.isAttached&&O.Widget.detach(this._footer),this._footer=e,this._footer&&(null===(t=this.parent)||void 0===t?void 0:t.isAttached)&&O.Widget.attach(this._footer,this.parent.node)}get activeCell(){return this._activeCell}set activeCell(e){this._activeCell=e}dispose(){var e,t;this.isDisposed||(null===(e=this._header)||void 0===e||e.dispose(),null===(t=this._footer)||void 0===t||t.dispose(),super.dispose())}removeWidget(e){const t=this.widgets.indexOf(e);t>=0?this.removeWidgetAt(t):e===this._willBeRemoved&&this.parent&&this.detachWidget(t,e)}attachWidget(e,t){const n=t.isPlaceholder(),o=this._isSoftHidden(t);if(this.parent.isAttached&&!o&&L.MessageLoop.sendMessage(t,O.Widget.Msg.BeforeAttach),o&&this._toggleSoftVisibility(t,!0),!n&&t instanceof i.CodeCell&&t.node.parentElement)t.node.style.display="",this._topHiddenCodeCells=-1;else if(!o){const e=this._findNearestChildBinarySearch(this.parent.viewportNode.childElementCount-1,0,parseInt(t.dataset.windowedListIndex,10)+1);let n=this.parent.viewportNode.children[e];this.parent.viewportNode.insertBefore(t.node,n),this.parent.isAttached&&L.MessageLoop.sendMessage(t,O.Widget.Msg.AfterAttach)}t.inViewport=!0}detachWidget(e,t){t.inViewport=!1,t!==this.activeCell?(t instanceof i.CodeCell&&!t.node.classList.contains(z)&&t!==this._willBeRemoved?(t.node.style.display="none",this._topHiddenCodeCells=-1):(this.parent.isAttached&&L.MessageLoop.sendMessage(t,O.Widget.Msg.BeforeDetach),this.parent.viewportNode.removeChild(t.node),t.node.classList.remove(K)),this.parent.isAttached&&L.MessageLoop.sendMessage(t,O.Widget.Msg.AfterDetach)):this._toggleSoftVisibility(t,!1)}moveWidget(e,t,n){if(this._topHiddenCodeCells<0){this._topHiddenCodeCells=0;for(let e=0;e<this.parent.viewportNode.children.length&&"none"==this.parent.viewportNode.children[e].style.display;e++)this._topHiddenCodeCells++}const o=this.parent.viewportNode.children[t+this._topHiddenCodeCells];e<t?o.insertAdjacentElement("afterend",n.node):o.insertAdjacentElement("beforebegin",n.node)}onAfterAttach(e){super.onAfterAttach(e),this._header&&!this._header.isAttached&&O.Widget.attach(this._header,this.parent.node,this.parent.node.firstElementChild),this._footer&&!this._footer.isAttached&&O.Widget.attach(this._footer,this.parent.node)}onBeforeDetach(e){var t,n;(null===(t=this._header)||void 0===t?void 0:t.isAttached)&&O.Widget.detach(this._header),(null===(n=this._footer)||void 0===n?void 0:n.isAttached)&&O.Widget.detach(this._footer),super.onBeforeDetach(e)}onChildRemoved(e){this._willBeRemoved=e.child,super.onChildRemoved(e),this._willBeRemoved=null}_toggleSoftVisibility(e,t){t?(e.node.style.opacity="",e.node.style.height="",e.node.style.padding=""):(e.node.style.opacity="0",e.node.style.height="0",e.node.style.padding="0")}_isSoftHidden(e){return"0"===e.node.style.opacity}_findNearestChildBinarySearch(e,t,n){for(;t<=e;){const o=t+Math.floor((e-t)/2),i=parseInt(this.parent.viewportNode.children[o].dataset.windowedListIndex,10);if(i===n)return o;i<n?t=o+1:i>n&&(e=o-1)}return t>0?t:0}}class Y extends O.Widget{constructor(e){super({node:document.createElement("button")}),this.notebook=e;const t=e.translator.load("jupyterlab");this.addClass("jp-Notebook-footer"),this.node.innerText=t.__("Click to add a cell.")}handleEvent(e){switch(e.type){case"click":this.onClick();break;case"keydown":if("ArrowUp"===e.key){this.onArrowUp();break}}}onClick(){this.notebook.widgets.length>0&&(this.notebook.activeCellIndex=this.notebook.widgets.length-1),C.insertBelow(this.notebook),C.focusActiveCell(this.notebook)}onArrowUp(){}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this),this.node.addEventListener("keydown",this)}onBeforeDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),super.onBeforeDetach(e)}}const G="jp-Notebook-cell",Q="jp-mod-editMode",X="jp-mod-commandMode",Z="jp-mod-active",ee="jp-mod-selected",te="jp-mod-multiSelected",ne="jp-dragImage",oe="jp-dragImage-singlePrompt",ie="jp-dragImage-content",se="jp-dragImage-prompt",le="jp-dragImage-multipleBack",ae="application/vnd.jupyter.cells",de="jp-mod-sideBySide";void 0===window.requestIdleCallback&&(window.requestIdleCallback=function(e){let t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)},window.cancelIdleCallback=function(e){clearTimeout(e)});class re extends _.WindowedList{constructor(e){var t,n,o,i,s;const a=new Array;super({model:new J(a,{overscanCount:null!==(n=null===(t=e.notebookConfig)||void 0===t?void 0:t.overscanCount)&&void 0!==n?n:re.defaultNotebookConfig.overscanCount,windowingActive:"full"===(null!==(i=null===(o=e.notebookConfig)||void 0===o?void 0:o.windowingMode)&&void 0!==i?i:re.defaultNotebookConfig.windowingMode)}),layout:new $}),this._cellCollapsed=new r.Signal(this),this._cellInViewportChanged=new r.Signal(this),this._renderingLayoutChanged=new r.Signal(this),this.addClass("jp-Notebook"),this.cellsArray=a,this._idleCallBack=null,this._editorConfig=re.defaultEditorConfig,this._notebookConfig=re.defaultNotebookConfig,this._mimetype=T.IEditorMimeTypeService.defaultMimeType,this._notebookModel=null,this._modelChanged=new r.Signal(this),this._modelContentChanged=new r.Signal(this),this.node.dataset.jpKernelUser="true",this.node.dataset.jpUndoer="true",this.node.dataset.jpCodeRunner="true",this.rendermime=e.rendermime,this.translator=e.translator||l.nullTranslator,this.contentFactory=e.contentFactory,this.editorConfig=e.editorConfig||re.defaultEditorConfig,this.notebookConfig=e.notebookConfig||re.defaultNotebookConfig,this._updateNotebookConfig(),this._mimetypeService=e.mimeTypeService,this.renderingLayout=null===(s=e.notebookConfig)||void 0===s?void 0:s.renderingLayout,this.kernelHistory=e.kernelHistory}get cellCollapsed(){return this._cellCollapsed}get cellInViewportChanged(){return this._cellInViewportChanged}get modelChanged(){return this._modelChanged}get modelContentChanged(){return this._modelContentChanged}get renderingLayoutChanged(){return this._renderingLayoutChanged}get model(){return this._notebookModel}set model(e){var t;if(e=e||null,this._notebookModel===e)return;const n=this._notebookModel;this._notebookModel=e,this._onModelChanged(n,e),this.onModelChanged(n,e),this._modelChanged.emit(void 0),this.viewModel.itemsList=null!==(t=null==e?void 0:e.cells)&&void 0!==t?t:null}get codeMimetype(){return this._mimetype}get widgets(){return this.cellsArray}get editorConfig(){return this._editorConfig}set editorConfig(e){this._editorConfig=e,this._updateEditorConfig()}get notebookConfig(){return this._notebookConfig}set notebookConfig(e){this._notebookConfig=e,this._updateNotebookConfig()}get renderingLayout(){return this._renderingLayout}set renderingLayout(e){var t;this._renderingLayout=e,"side-by-side"===this._renderingLayout?this.node.classList.add(de):this.node.classList.remove(de),this._renderingLayoutChanged.emit(null!==(t=this._renderingLayout)&&void 0!==t?t:"default")}dispose(){var e;this.isDisposed||(this._notebookModel=null,null===(e=this.layout.header)||void 0===e||e.dispose(),super.dispose())}moveCell(e,t,n=1){if(!this.model)return;const o=Math.min(this.model.cells.length-1,Math.max(0,t));if(o===e)return;const i=new Array(n);for(let t=0;t<n;t++){i[t]={};const n=this.widgets[e+t];if("markdown"===n.model.type)for(const e of["rendered","headingCollapsed"])i[t][e]=n[e]}this.model.sharedModel.moveCells(e,o,n);for(let e=0;e<n;e++){const n=this.widgets[t+e],o=i[e];for(const e in o)n[e]=o[e]}}renderCellOutputs(e){const t=this.viewModel.widgetRenderer(e);t instanceof i.CodeCell&&t.isPlaceholder()&&(t.dataset.windowedListIndex=`${e}`,this.layout.insertWidget(e,t),"full"===this.notebookConfig.windowingMode&&requestAnimationFrame((()=>{this.layout.removeWidget(t)})))}addHeader(){const e=this.translator.load("jupyterlab"),t=new O.Widget;t.node.textContent=e.__("The notebook is empty. Click the + button on the toolbar to add a new cell."),this.layout.header=t}removeHeader(){var e;null===(e=this.layout.header)||void 0===e||e.dispose(),this.layout.header=null}onModelChanged(e,t){}onModelContentChanged(e,t){this._modelContentChanged.emit(void 0)}onMetadataChanged(e,t){"language_info"===t.key&&this._updateMimetype()}onCellInserted(e,t){}onCellRemoved(e,t){}onUpdateRequest(e){"defer"===this.notebookConfig.windowingMode?this._runOnIdleTime():super.onUpdateRequest(e)}_onModelChanged(e,t){var n;if(e)for(e.contentChanged.disconnect(this.onModelContentChanged,this),e.metadataChanged.disconnect(this.onMetadataChanged,this),e.cells.changed.disconnect(this._onCellsChanged,this);this.cellsArray.length;)this._removeCell(0);if(!t)return void(this._mimetype=T.IEditorMimeTypeService.defaultMimeType);this._updateMimetype();const o=t.cells;null!==(n=t.collaborative)&&void 0!==n&&n||o.length||t.sharedModel.insertCell(0,{cell_type:this.notebookConfig.defaultCell,metadata:"code"===this.notebookConfig.defaultCell?{trusted:!0}:{}});let i=-1;for(const e of o)this._insertCell(++i,e);t.cells.changed.connect(this._onCellsChanged,this),t.metadataChanged.connect(this.onMetadataChanged,this),t.contentChanged.connect(this.onModelContentChanged,this)}_onCellsChanged(e,t){switch(this.removeHeader(),t.type){case"add":{let e=0;e=t.newIndex;for(const n of t.newValues)this._insertCell(e++,n);this._updateDataWindowedListIndex(t.newIndex,this.model.cells.length,t.newValues.length);break}case"remove":for(let e=t.oldValues.length;e>0;e--)this._removeCell(t.oldIndex);if(this._updateDataWindowedListIndex(t.oldIndex,this.model.cells.length+t.oldValues.length,-1*t.oldValues.length),!e.length){const e=this.model;requestAnimationFrame((()=>{!e||e.isDisposed||e.sharedModel.cells.length||e.sharedModel.insertCell(0,{cell_type:this.notebookConfig.defaultCell,metadata:"code"===this.notebookConfig.defaultCell?{trusted:!0}:{}})}))}break;default:return}this.model.sharedModel.cells.length||this.addHeader(),this.update()}_insertCell(e,t){let n;switch(t.type){case"code":n=this._createCodeCell(t),n.model.mimeType=this._mimetype;break;case"markdown":n=this._createMarkdownCell(t),""===t.sharedModel.getSource()&&(n.rendered=!1);break;default:n=this._createRawCell(t)}n.inViewportChanged.connect(this._onCellInViewportChanged,this),n.addClass(G),a.ArrayExt.insert(this.cellsArray,e,n),this.onCellInserted(e,n),this._scheduleCellRenderOnIdle()}_createCodeCell(e){const t=this.rendermime,n={contentFactory:this.contentFactory,editorConfig:this.editorConfig.code,inputHistoryScope:this.notebookConfig.inputHistoryScope,maxNumberOutputs:this.notebookConfig.maxNumberOutputs,model:e,placeholder:"none"!==this._notebookConfig.windowingMode,rendermime:t,translator:this.translator},o=this.contentFactory.createCodeCell(n);return o.syncCollapse=!0,o.syncEditable=!0,o.syncScrolled=!0,o.outputArea.inputRequested.connect(((e,t)=>{this._onInputRequested(o).catch((e=>{console.error("Failed to scroll to cell requesting input.",e)})),t.disposed.connect((()=>{o.node.focus()}))})),o}_createMarkdownCell(e){const t=this.rendermime,n={contentFactory:this.contentFactory,editorConfig:this.editorConfig.markdown,model:e,placeholder:"none"!==this._notebookConfig.windowingMode,rendermime:t,showEditorForReadOnlyMarkdown:this._notebookConfig.showEditorForReadOnlyMarkdown},o=this.contentFactory.createMarkdownCell(n);return o.syncCollapse=!0,o.syncEditable=!0,o.headingCollapsedChanged.connect(this._onCellCollapsed,this),o}_createRawCell(e){const t=this.contentFactory,n={editorConfig:this.editorConfig.raw,model:e,contentFactory:t,placeholder:"none"!==this._notebookConfig.windowingMode},o=this.contentFactory.createRawCell(n);return o.syncCollapse=!0,o.syncEditable=!0,o}_removeCell(e){const t=this.cellsArray[e];t.parent=null,a.ArrayExt.removeAt(this.cellsArray,e),this.onCellRemoved(e,t),t.dispose()}_updateMimetype(){var e;const t=null===(e=this._notebookModel)||void 0===e?void 0:e.getMetadata("language_info");if(t){this._mimetype=this._mimetypeService.getMimeTypeByLanguage(t);for(const e of this.widgets)"code"===e.model.type&&(e.model.mimeType=this._mimetype)}}_onCellCollapsed(e,t){C.setHeadingCollapse(e,t,this),this._cellCollapsed.emit(e)}_onCellInViewportChanged(e){this._cellInViewportChanged.emit(e)}async _onInputRequested(e){if(!e.inViewport){const t=this.widgets.findIndex((t=>t===e));if(t>=0){await this.scrollToItem(t);const n=e.node.querySelector(".jp-Stdin");n&&(W.ElementExt.scrollIntoViewIfNeeded(this.node,n),n.focus())}}}_scheduleCellRenderOnIdle(){"none"===this.notebookConfig.windowingMode||this.isDisposed||this._idleCallBack||(this._idleCallBack=requestIdleCallback((e=>{this._idleCallBack=null,this._runOnIdleTime(e.didTimeout?50:e.timeRemaining())}),{timeout:3e3}))}_updateDataWindowedListIndex(e,t,n){for(let o=0;o<this.viewportNode.childElementCount;o++){const i=this.viewportNode.children[o],s=parseInt(i.dataset.windowedListIndex,10);s>=e&&s<t&&(i.dataset.windowedListIndex=`${s+n}`)}}_updateEditorConfig(){for(let e=0;e<this.widgets.length;e++){const t=this.widgets[e];let n={};switch(t.model.type){case"code":n=this._editorConfig.code;break;case"markdown":n=this._editorConfig.markdown;break;default:n=this._editorConfig.raw}t.updateEditorConfig({...n})}}async _runOnIdleTime(e=50){const t=Date.now();let n=0;for(;Date.now()-t<e&&n<this.cellsArray.length;){const e=this.cellsArray[n];if(e.isPlaceholder())switch(this.notebookConfig.windowingMode){case"defer":await this._updateForDeferMode(e,n);break;case"full":this._renderCSSAndJSOutputs(e,n)}n++}n<this.cellsArray.length?"defer"===this.notebookConfig.windowingMode&&this.viewportNode.clientHeight<this.node.clientHeight?await this._runOnIdleTime():this._scheduleCellRenderOnIdle():this._idleCallBack&&(window.cancelIdleCallback(this._idleCallBack),this._idleCallBack=null)}async _updateForDeferMode(e,t){e.dataset.windowedListIndex=`${t}`,this.layout.insertWidget(t,e),await e.ready}_renderCSSAndJSOutputs(e,t){var n,o,s;if(e instanceof i.CodeCell)for(let i=0;i<(null!==(o=null===(n=e.model.outputs)||void 0===n?void 0:n.length)&&void 0!==o?o:0);i++)if((null!==(s=e.model.outputs.get(i).data["text/html"])&&void 0!==s?s:"").match(/(<style[^>]*>[^<]*<\/style[^>]*>|<script[^>]*>.*?<\/script[^>]*>)/gims)){this.renderCellOutputs(t);break}}_updateNotebookConfig(){this.toggleClass("jp-mod-scrollPastEnd",this._notebookConfig.scrollPastEnd),this.toggleClass("jp-mod-showHiddenCellsButton",this._notebookConfig.showHiddenCellsButton);const e=this._notebookConfig.showEditorForReadOnlyMarkdown;if(void 0!==e)for(const t of this.cellsArray)"markdown"===t.model.type&&(t.showEditorForReadOnly=e);this.viewModel.windowingActive="full"===this._notebookConfig.windowingMode}}!function(e){e.defaultEditorConfig={code:{lineNumbers:!1,lineWrap:!1,matchBrackets:!0,tabFocusable:!1},markdown:{lineNumbers:!1,lineWrap:!0,matchBrackets:!1,tabFocusable:!1},raw:{lineNumbers:!1,lineWrap:!0,matchBrackets:!1,tabFocusable:!1}},e.defaultNotebookConfig={showHiddenCellsButton:!0,scrollPastEnd:!0,defaultCell:"code",recordTiming:!1,inputHistoryScope:"global",maxNumberOutputs:50,showEditorForReadOnlyMarkdown:!0,disableDocumentWideUndoRedo:!0,renderingLayout:"default",sideBySideLeftMarginOverride:"10px",sideBySideRightMarginOverride:"10px",sideBySideOutputRatio:1,overscanCount:1,windowingMode:"full",accessKernelHistory:!1};class t extends i.Cell.ContentFactory{createCodeCell(e){return new i.CodeCell(e).initializeState()}createMarkdownCell(e){return new i.MarkdownCell(e).initializeState()}createRawCell(e){return new i.RawCell(e).initializeState()}}e.ContentFactory=t}(re||(re={}));class ce extends re{constructor(e){super(e),this._activeCellIndex=-1,this._activeCell=null,this._mode="command",this._drag=null,this._dragData=null,this._mouseMode=null,this._activeCellChanged=new r.Signal(this),this._stateChanged=new r.Signal(this),this._selectionChanged=new r.Signal(this),this._checkCacheOnNextResize=!1,this._lastClipboardInteraction=null,this._selectedCells=[],this.node.setAttribute("data-lm-dragscroll","true"),this.activeCellChanged.connect(this._updateSelectedCells,this),this.selectionChanged.connect(this._updateSelectedCells,this),this.addFooter()}get selectedCells(){return this._selectedCells}addFooter(){const e=new Y(this);this.layout.footer=e}_onCellsChanged(e,t){var n,o;const i=null===(n=this.activeCell)||void 0===n?void 0:n.model.id;if(super._onCellsChanged(e,t),i){const e=null===(o=this.model)||void 0===o?void 0:o.sharedModel.cells.findIndex((e=>e.getId()===i));null!=e&&(this.activeCellIndex=e)}}get activeCellChanged(){return this._activeCellChanged}get stateChanged(){return this._stateChanged}get selectionChanged(){return this._selectionChanged}get mode(){return this._mode}set mode(e){const t=this.activeCell;if(t||(e="command"),e===this._mode)return void this._ensureFocus();this.update();const n=this._mode;if(this._mode=e,"edit"===e){for(const e of this.widgets)this.deselect(e);t instanceof i.MarkdownCell&&(t.rendered=!1),t.inputHidden=!1}else C.focusActiveCell(this,{waitUntilReady:!1});this._stateChanged.emit({name:"mode",oldValue:n,newValue:e}),this._ensureFocus()}get activeCellIndex(){return this.model&&this.widgets.length?this._activeCellIndex:-1}set activeCellIndex(e){var t;const n=this._activeCellIndex;this.model&&this.widgets.length?(e=Math.max(e,0),e=Math.min(e,this.widgets.length-1)):e=-1,this._activeCellIndex=e;const o=null!==(t=this.widgets[e])&&void 0!==t?t:null;this.layout.activeCell=o;const s=o!==this._activeCell;s&&(this.update(),this._activeCell=o),(s||e!=n)&&this._activeCellChanged.emit(o),"edit"===this.mode&&o instanceof i.MarkdownCell&&(o.rendered=!1),this._ensureFocus(),e!==n&&(this._trimSelections(),this._stateChanged.emit({name:"activeCellIndex",oldValue:n,newValue:e}))}get activeCell(){return this._activeCell}get lastClipboardInteraction(){return this._lastClipboardInteraction}set lastClipboardInteraction(e){this._lastClipboardInteraction=e}dispose(){this.isDisposed||(this._activeCell=null,super.dispose())}moveCell(e,t,n=1){const o=e<=this.activeCellIndex&&this.activeCellIndex<e+n?this.activeCellIndex+t-e-(e>t?0:n-1):-1,i=this.widgets.slice(e,e+n).map((e=>this.isSelected(e)));super.moveCell(e,t,n),o>=0&&(this.activeCellIndex=o),e>t?i.forEach(((e,n)=>{e&&this.select(this.widgets[t+n])})):i.forEach(((e,o)=>{e&&this.select(this.widgets[t-n+1+o])}))}select(e){he.selectedProperty.get(e)||(he.selectedProperty.set(e,!0),this._selectionChanged.emit(void 0),this.update())}deselect(e){he.selectedProperty.get(e)&&(he.selectedProperty.set(e,!1),this._selectionChanged.emit(void 0),this.update())}isSelected(e){return he.selectedProperty.get(e)}isSelectedOrActive(e){return e===this._activeCell||he.selectedProperty.get(e)}deselectAll(){let e=!1;for(const t of this.widgets)he.selectedProperty.get(t)&&(e=!0),he.selectedProperty.set(t,!1);e&&this._selectionChanged.emit(void 0),this.activeCellIndex=this.activeCellIndex,this.update()}extendContiguousSelectionTo(e){let t,{head:n,anchor:o}=this.getContiguousSelection();if(null===o||null===n){if(e===this.activeCellIndex)return;n=this.activeCellIndex,o=this.activeCellIndex}if(this.activeCellIndex=e,(e=this.activeCellIndex)===o)return void this.deselectAll();let i=!1;if(n<e)for(n<o&&(he.selectedProperty.set(this.widgets[n],!1),i=!0),t=n+1;t<e;t++)t!==o&&(he.selectedProperty.set(this.widgets[t],!he.selectedProperty.get(this.widgets[t])),i=!0);else if(e<n)for(o<n&&(he.selectedProperty.set(this.widgets[n],!1),i=!0),t=e+1;t<n;t++)t!==o&&(he.selectedProperty.set(this.widgets[t],!he.selectedProperty.get(this.widgets[t])),i=!0);he.selectedProperty.get(this.widgets[o])||(i=!0),he.selectedProperty.set(this.widgets[o],!0),he.selectedProperty.get(this.widgets[e])||(i=!0),he.selectedProperty.set(this.widgets[e],!0),i&&this._selectionChanged.emit(void 0)}getContiguousSelection(){const e=this.widgets,t=a.ArrayExt.findFirstIndex(e,(e=>this.isSelected(e)));if(-1===t)return{head:null,anchor:null};const n=a.ArrayExt.findLastIndex(e,(e=>this.isSelected(e)),-1,t);for(let o=t;o<=n;o++)if(!this.isSelected(e[o]))throw new Error("Selection not contiguous");const o=this.activeCellIndex;if(t!==o&&n!==o)throw new Error("Active cell not at endpoint of selection");return t===o?{head:t,anchor:n}:{head:n,anchor:t}}async scrollToCell(e,t="auto"){try{await this.scrollToItem(this.widgets.findIndex((t=>t===e)),t)}catch(e){}this.deselectAll(),this.select(e),e.activate()}_parseFragment(e){const t=e.slice(1);if(!t)return;const n=t.split("=");return 1===n.length?{kind:"heading",value:t}:{kind:n[0],value:n.slice(1).join("=")}}async setFragment(e){const t=this._parseFragment(e);if(!t)return;let n;switch(t.kind){case"heading":n=await this._findHeading(t.value);break;case"cell-id":n=this._findCellById(t.value);break;default:console.warn(`Unknown target type for URI fragment ${e}, interpreting as a heading`),n=await this._findHeading(t.kind+"="+t.value)}if(null==n)return;let{cell:o,element:i}=n;o.inViewport||await this.scrollToCell(o,"center"),null==i&&(i=o.node);const s=this.node.getBoundingClientRect(),l=i.getBoundingClientRect();(l.top>s.bottom||l.bottom<s.top)&&i.scrollIntoView({block:"center"})}handleEvent(e){if(this.model)switch(e.type){case"contextmenu":e.eventPhase===Event.CAPTURING_PHASE&&this._evtContextMenuCapture(e);break;case"mousedown":e.eventPhase===Event.CAPTURING_PHASE?this._evtMouseDownCapture(e):e.defaultPrevented||this._evtMouseDown(e);break;case"mouseup":e.currentTarget===document&&this._evtDocumentMouseup(e);break;case"mousemove":e.currentTarget===document&&this._evtDocumentMousemove(e);break;case"keydown":this._ensureFocus(!0);break;case"dblclick":this._evtDblClick(e);break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e);break;case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:super.handleEvent(e)}}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("contextmenu",this,!0),t.addEventListener("mousedown",this,!0),t.addEventListener("mousedown",this),t.addEventListener("keydown",this),t.addEventListener("dblclick",this),t.addEventListener("focusin",this),t.addEventListener("focusout",this),t.addEventListener("lm-dragenter",this,!0),t.addEventListener("lm-dragleave",this,!0),t.addEventListener("lm-dragover",this,!0),t.addEventListener("lm-drop",this,!0)}onBeforeDetach(e){const t=this.node;t.removeEventListener("contextmenu",this,!0),t.removeEventListener("mousedown",this,!0),t.removeEventListener("mousedown",this),t.removeEventListener("keydown",this),t.removeEventListener("dblclick",this),t.removeEventListener("focusin",this),t.removeEventListener("focusout",this),t.removeEventListener("lm-dragenter",this,!0),t.removeEventListener("lm-dragleave",this,!0),t.removeEventListener("lm-dragover",this,!0),t.removeEventListener("lm-drop",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),super.onBeforeAttach(e)}onAfterShow(e){super.onAfterShow(e),this._checkCacheOnNextResize=!0}onResize(e){var t;if(!this._checkCacheOnNextResize)return super.onResize(e);super.onResize(e),this._checkCacheOnNextResize=!1;const n=this._cellLayoutStateCache,o=parseInt(this.node.style.width,10);if(!n||o!==n.width){this._cellLayoutStateCache={width:o};for(const e of this.widgets)e instanceof i.Cell&&e.inViewport&&(null===(t=e.editorWidget)||void 0===t||t.update())}}onBeforeHide(e){super.onBeforeHide(e);const t=parseInt(this.node.style.width,10);this._cellLayoutStateCache={width:t}}onActivateRequest(e){super.onActivateRequest(e),this._ensureFocus(!0)}onUpdateRequest(e){super.onUpdateRequest(e);const t=this.activeCell;"edit"===this.mode?(this.addClass(Q),this.removeClass(X)):(this.addClass(X),this.removeClass(Q));let n=0;for(const e of this.widgets)e.node.tabIndex=-1,e.removeClass(Z),e.removeClass(te),this.isSelectedOrActive(e)?(e.addClass(ee),n++):e.removeClass(ee);t&&(t.addClass(Z),t.addClass(ee),t.node.tabIndex=0,n>1&&t.addClass(te))}onCellInserted(e,t){t.ready.then((()=>{t.isDisposed||t.editor.edgeRequested.connect(this._onEdgeRequest,this)})),this.activeCellIndex=e<=this.activeCellIndex?this.activeCellIndex+1:this.activeCellIndex}onCellRemoved(e,t){this.activeCellIndex=e<=this.activeCellIndex?this.activeCellIndex-1:this.activeCellIndex,this.isSelected(t)&&this._selectionChanged.emit(void 0)}onModelChanged(e,t){super.onModelChanged(e,t),this.activeCellIndex=0}_onEdgeRequest(e,t){const n=this.activeCellIndex;if("top"===t){if(this.activeCellIndex--,this.activeCellIndex<n){const e=this.activeCell.editor;if(e){const t=e.lineCount-1;e.setCursorPosition({line:t,column:0})}}}else if("bottom"===t&&(this.activeCellIndex++,this.activeCellIndex>n)){const e=this.activeCell.editor;e&&e.setCursorPosition({line:0,column:0})}this.mode="edit"}_ensureFocus(e=!1){var t,n;const o=this.layout.footer;if(o&&document.activeElement===o.node)return;const i=this.activeCell;"edit"===this.mode&&i&&(!0===(null===(t=i.editor)||void 0===t?void 0:t.hasFocus())&&i.inViewport||(i.inViewport?null===(n=i.editor)||void 0===n||n.focus():this.scrollToItem(this.activeCellIndex).then((()=>{i.ready.then((()=>{var e;null===(e=i.editor)||void 0===e||e.focus()}))})).catch((e=>{})))),e&&i&&!i.node.contains(document.activeElement)&&C.focusActiveCell(this,{preventScroll:!0})}_findCell(e){let t=e;for(;t&&t!==this.node;){if(t.classList.contains(G)){const e=a.ArrayExt.findFirstIndex(this.widgets,(e=>e.node===t));if(-1!==e)return e;break}t=t.parentElement}return-1}_findEventTargetAndCell(e){let t=e.target,n=this._findCell(t);return-1===n&&(t=document.elementFromPoint(e.clientX,e.clientY),n=this._findCell(t)),[t,n]}async _findHeading(e){for(let t=0;t<this.widgets.length;t++){const n=this.widgets[t];if("raw"!==n.model.type&&("markdown"!==n.model.type||n.rendered))for(const t of n.headings){let o="";switch(t.type){case i.Cell.HeadingType.HTML:o=t.id;break;case i.Cell.HeadingType.Markdown:{const e=t;o=await V.TableOfContentsUtils.Markdown.getHeadingId(this.rendermime.markdownParser,e.raw,e.level)}}if(o===e)return{cell:n,element:this.node.querySelector(`h${t.level}[id="${o}"]`)}}}return null}_findCellById(e){for(let t=0;t<this.widgets.length;t++){const n=this.widgets[t];if(n.model.id===e)return{cell:n}}return null}_evtContextMenuCapture(e){var t;if(e.shiftKey)return;const[n,o]=this._findEventTargetAndCell(e),i=this.widgets[o];i&&(null===(t=i.editorWidget)||void 0===t?void 0:t.node.contains(n))&&e.preventDefault()}_evtMouseDownCapture(e){var t;const{button:n,shiftKey:o}=e,[i,s]=this._findEventTargetAndCell(e),l=this.widgets[s];2===n&&!o&&l&&(null===(t=l.editorWidget)||void 0===t?void 0:t.node.contains(i))&&(this.mode="command",e.preventDefault())}_evtMouseDown(e){var t,n,o;const{button:i,shiftKey:s}=e;if(0!==i&&2!==i)return;if(s&&2===i)return;const[l,a]=this._findEventTargetAndCell(e),d=this.widgets[a];let r;if(r=d?(null===(t=d.editorWidget)||void 0===t?void 0:t.node.contains(l))?"input":(null===(n=d.promptNode)||void 0===n?void 0:n.contains(l))?"prompt":"cell":"notebook","input"!==r&&(this.mode="command"),"notebook"===r)this.deselectAll();else if("prompt"===r||"cell"===r){const t=""!==(null!==(o=window.getSelection())&&void 0!==o?o:"").toString();if(0!==i||!s||t||["INPUT","OPTION"].includes(l.tagName))0!==i||s?2===i&&(this.isSelectedOrActive(d)||(this.deselectAll(),this.activeCellIndex=a),e.preventDefault()):("prompt"===r&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:a},this._mouseMode="couldDrag",document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault()),this.isSelectedOrActive(d)||(this.deselectAll(),this.activeCellIndex=a));else{e.preventDefault();try{this.extendContiguousSelectionTo(a)}catch(e){return console.error(e),void this.deselectAll()}this._mouseMode="select",document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0)}}else"input"===r&&(2!==i||this.isSelectedOrActive(d)||(this.deselectAll(),this.activeCellIndex=a));this._ensureFocus(!0)}_evtDocumentMouseup(e){if(e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),"couldDrag"===this._mouseMode){const[,t]=this._findEventTargetAndCell(e);this.deselectAll(),this.activeCellIndex=t,this.activeCell.node.contains(document.activeElement)||C.focusActiveCell(this)}this._mouseMode=null}_evtDocumentMousemove(e){switch(e.preventDefault(),e.stopPropagation(),this._mouseMode){case"select":{const t=e.target,n=this._findCell(t);-1!==n&&this.extendContiguousSelectionTo(n);break}case"couldDrag":{const t=this._dragData,n=Math.abs(e.clientX-t.pressX),o=Math.abs(e.clientY-t.pressY);(n>=5||o>=5)&&(this._mouseMode=null,this._startDrag(t.index,e.clientX,e.clientY));break}}}_evtDragEnter(e){if(!e.mimeData.hasData(ae))return;e.preventDefault(),e.stopPropagation();const t=e.target,n=this._findCell(t);-1!==n&&this.cellsArray[n].node.classList.add(K)}_evtDragLeave(e){if(!e.mimeData.hasData(ae))return;e.preventDefault(),e.stopPropagation();const t=this.node.getElementsByClassName(K);t.length&&t[0].classList.remove(K)}_evtDragOver(e){if(!e.mimeData.hasData(ae))return;e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction;const t=this.node.getElementsByClassName(K);t.length&&t[0].classList.remove(K);const n=e.target,o=this._findCell(n);-1!==o&&this.cellsArray[o].node.classList.add(K)}_evtDrop(e){if(!e.mimeData.hasData(ae))return;if(e.preventDefault(),e.stopPropagation(),"none"===e.proposedAction)return void(e.dropAction="none");let t=e.target;for(;t&&t.parentElement;){if(t.classList.contains(K)){t.classList.remove(K);break}t=t.parentElement}const n=this.model,o=e.source;if(o===this){e.dropAction="move";const n=e.mimeData.getData("internal:cells"),s=n[n.length-1];if(s instanceof i.MarkdownCell&&s.headingCollapsed){const e=C.findNextParentHeading(s,o);if(e>0){const t=(0,a.findIndex)(o.widgets,(e=>s.model.id===e.model.id));n.push(...o.widgets.slice(t+1,e))}}let l=a.ArrayExt.firstIndexOf(this.widgets,n[0]),d=this._findCell(t);if(-1!==d&&d>l?d-=1:-1===d&&(d=this.widgets.length-1),d>=l&&d<l+n.length)return;this.moveCell(l,d,n.length)}else{e.dropAction="copy";let o=this._findCell(t);-1===o&&(o=this.widgets.length);const i=o,s=e.mimeData.getData(ae);n.sharedModel.insertCells(o,s),this.deselectAll(),this.activeCellIndex=i,this.extendContiguousSelectionTo(o-1)}C.focusActiveCell(this)}_startDrag(e,t,n){var o;const i=this.model.cells,s=[],l=[];let a=-1;for(const e of this.widgets){const t=i.get(++a);this.isSelectedOrActive(e)&&(e.addClass(z),s.push(t.toJSON()),l.push(e))}const r=this.activeCell;let c,h=null;if("code"===(null==r?void 0:r.model.type)){const e=r.model.executionCount;c=" ",e&&(c=e.toString())}else c="";h=he.createDragImage(s.length,c,null!==(o=null==r?void 0:r.model.sharedModel.getSource().split("\n")[0].slice(0,26))&&void 0!==o?o:""),this._drag=new j.Drag({mimeData:new d.MimeData,dragImage:h,supportedActions:"copy-move",proposedAction:"copy",source:this}),this._drag.mimeData.setData(ae,s),this._drag.mimeData.setData("internal:cells",l);const u=l.map((e=>e.model.sharedModel.getSource())).join("\n");this._drag.mimeData.setData("text/plain",u),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._mouseMode=null,this._drag.start(t,n).then((e=>{if(!this.isDisposed){this._drag=null;for(const e of l)e.removeClass(z)}}))}_evtFocusIn(e){var t,n;const o=e.target,i=this._findCell(o);if(-1!==i){const e=this.widgets[i];e.editorWidget&&!e.editorWidget.node.contains(o)&&(this.mode="command");const n=null===(t=e.editorWidget)||void 0===t?void 0:t.node;(null==n?void 0:n.contains(o))&&(this.mode="edit"),this.activeCellIndex=i}else{this.mode="command",e.preventDefault();const t=e.relatedTarget;this._activeCell&&!this._activeCell.node.contains(t)?this._activeCell.ready.then((()=>{var e;null===(e=this._activeCell)||void 0===e||e.node.focus({preventScroll:!0})})).catch((()=>{var e;null===(e=this.layout.footer)||void 0===e||e.node.focus({preventScroll:!0})})):null===(n=this.layout.footer)||void 0===n||n.node.focus({preventScroll:!0})}}_evtFocusOut(e){var t;const n=e.relatedTarget;if(!n)return;const o=this._findCell(n);-1!==o&&(null===(t=this.widgets[o].editorWidget)||void 0===t?void 0:t.node.contains(n))||"command"!==this.mode&&(this.mode="command",n&&n.focus())}_evtDblClick(e){const t=this.model;if(!t)return;this.deselectAll();const[n,o]=this._findEventTargetAndCell(e);e.target.classList.contains("jp-collapseHeadingButton")||-1===o||(this.activeCellIndex=o,"markdown"===t.cells.get(o).type?this.widgets[o].rendered=!1:"img"===n.localName&&n.classList.toggle("jp-mod-unconfined"))}_trimSelections(){for(let e=0;e<this.widgets.length;e++)if(e!==this._activeCellIndex){const t=this.widgets[e];!t.model.isDisposed&&t.editor&&t.model.selections.delete(t.editor.uuid)}}_updateSelectedCells(){this._selectedCells=this.widgets.filter((e=>this.isSelectedOrActive(e))),this.kernelHistory&&this.kernelHistory.reset()}}var he;!function(e){class t extends re.ContentFactory{}e.ContentFactory=t}(ce||(ce={})),function(e){e.selectedProperty=new U.AttachedProperty({name:"selected",create:()=>!1});class t extends O.PanelLayout{onUpdateRequest(e){}}e.NotebookPanelLayout=t,e.createDragImage=function(e,t,n){return e>1?""!==t?q.VirtualDOM.realize(q.h.div(q.h.div({className:ne},q.h.span({className:se},"["+t+"]:"),q.h.span({className:ie},n)),q.h.div({className:le},""))):q.VirtualDOM.realize(q.h.div(q.h.div({className:ne},q.h.span({className:se}),q.h.span({className:ie},n)),q.h.div({className:le},""))):""!==t?q.VirtualDOM.realize(q.h.div(q.h.div({className:`${ne} ${oe}`},q.h.span({className:se},"["+t+"]:"),q.h.span({className:ie},n)))):q.VirtualDOM.realize(q.h.div(q.h.div({className:`${ne} ${oe}`},q.h.span({className:se}),q.h.span({className:ie},n))))}}(he||(he={}));class ue extends F.DocumentWidget{constructor(e){super(e),this._autorestarting=!1,this.addClass("jp-NotebookPanel"),this.toolbar.addClass("jp-NotebookPanel-toolbar"),this.content.addClass("jp-NotebookPanel-notebook"),this.content.model=this.context.model,this.context.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.context.sessionContext.statusChanged.connect(this._onSessionStatusChanged,this),this.context.saveState.connect(this._onSave,this),this.revealed.then((()=>{if(!this.isDisposed&&1===this.content.widgets.length){const e=this.content.widgets[0].model;"code"===e.type&&""===e.sharedModel.getSource()&&(this.content.mode="edit")}}))}_onSave(e,t){if("started"===t&&this.model)for(const e of this.model.cells)if((0,i.isMarkdownCellModel)(e))for(const t of e.attachments.keys)e.sharedModel.getSource().includes(t)||e.attachments.remove(t)}get sessionContext(){return this.context.sessionContext}get model(){return this.content.model}setConfig(e){this.content.editorConfig=e.editorConfig,this.content.notebookConfig=e.notebookConfig;const t=this.context.sessionContext.kernelPreference;this.context.sessionContext.kernelPreference={...t,shutdownOnDispose:e.kernelShutdown,autoStartDefault:e.autoStartDefault}}setFragment(e){this.context.ready.then((()=>{this.content.setFragment(e)}))}dispose(){this.content.dispose(),super.dispose()}[o.Printing.symbol](){return async()=>{this.context.model.dirty&&!this.context.model.readOnly&&await this.context.save(),await o.Printing.printURL(s.PageConfig.getNBConvertURL({format:"html",download:!1,path:this.context.path}))}}onBeforeHide(e){super.onBeforeHide(e),this.content.isParentHidden=!0}onBeforeShow(e){this.content.isParentHidden=!1,super.onBeforeShow(e)}_onKernelChanged(e,t){if(!this.model||!t.newValue)return;const{newValue:n}=t;n.info.then((e=>{var t;this.model&&(null===(t=this.context.sessionContext.session)||void 0===t?void 0:t.kernel)===n&&this._updateLanguage(e.language_info)})),this._updateSpec(n)}_onSessionStatusChanged(e,t){var n;"autorestarting"!==t||this._autorestarting?"restarting"===t||(this._autorestarting=!1):((0,o.showDialog)({title:this._trans.__("Kernel Restarting"),body:this._trans.__("The kernel for %1 appears to have died. It will restart automatically.",null===(n=this.sessionContext.session)||void 0===n?void 0:n.path),buttons:[o.Dialog.okButton({label:this._trans.__("Ok")})]}),this._autorestarting=!0)}_updateLanguage(e){this.model.setMetadata("language_info",e)}async _updateSpec(e){const t=await e.spec;this.isDisposed||this.model.setMetadata("kernelspec",{name:e.name,display_name:null==t?void 0:t.display_name,language:null==t?void 0:t.language})}}!function(e){class t extends ce.ContentFactory{createNotebook(e){return new ce(e)}}e.ContentFactory=t,e.IContentFactory=new d.Token("@jupyterlab/notebook:IContentFactory","A factory object that creates new notebooks.\n Use this if you want to create and host notebooks in your own UI elements.")}(ue||(ue={}));var ge,Ce=n(41173);class ve extends Ce.SearchProvider{constructor(e,t=l.nullTranslator){super(e),this.translator=t,this._textSelection=null,this._currentProviderIndex=null,this._delayedActiveCellChangeHandler=null,this._onSelection=!1,this._selectedCells=1,this._selectedLines=0,this._query=null,this._searchProviders=[],this._editorSelectionsObservable=null,this._selectionSearchMode="cells",this._selectionLock=!1,this._handleHighlightsAfterActiveCellChange=this._handleHighlightsAfterActiveCellChange.bind(this),this.widget.model.cells.changed.connect(this._onCellsChanged,this),this.widget.content.activeCellChanged.connect(this._onActiveCellChanged,this),this.widget.content.selectionChanged.connect(this._onCellSelectionChanged,this),this.widget.content.stateChanged.connect(this._onNotebookStateChanged,this),this._observeActiveCell(),this._filtersChanged.connect(this._setEnginesSelectionSearchMode,this)}_onNotebookStateChanged(e,t){"mode"===t.name&&window.setTimeout((()=>{var e;"command"===t.newValue&&(null===(e=document.activeElement)||void 0===e?void 0:e.closest(".jp-DocumentSearch-overlay"))||(this._updateSelectionMode(),this._filtersChanged.emit())}),0)}static isApplicable(e){return e instanceof ue}static createNew(e,t){return new ve(e,t)}get currentMatchIndex(){let e=0,t=!1;for(let n=0;n<this._searchProviders.length;n++){const o=this._searchProviders[n];if(this._currentProviderIndex==n){const n=o.currentMatchIndex;if(null===n)return null;e+=n,t=!0;break}e+=o.matchesCount}return t?e:null}get matchesCount(){return this._searchProviders.reduce(((e,t)=>e+t.matchesCount),0)}get isReadOnly(){var e,t,n;return null!==(n=null===(t=null===(e=this.widget)||void 0===e?void 0:e.content.model)||void 0===t?void 0:t.readOnly)&&void 0!==n&&n}get replaceOptionsSupport(){return{preserveCase:!0}}getSelectionState(){const e="cells"===this._selectionSearchMode,t=e?this._selectedCells:this._selectedLines;return t>1?"multiple":1!==t||e?"none":"single"}dispose(){var e;if(this.isDisposed)return;this.widget.content.activeCellChanged.disconnect(this._onActiveCellChanged,this),null===(e=this.widget.model)||void 0===e||e.cells.changed.disconnect(this._onCellsChanged,this),this.widget.content.stateChanged.disconnect(this._onNotebookStateChanged,this),this.widget.content.selectionChanged.disconnect(this._onCellSelectionChanged,this),this._stopObservingLastCell(),super.dispose();const t=this.widget.content.activeCellIndex;this.endQuery().then((()=>{this.widget.isDisposed||(this.widget.content.activeCellIndex=t)})).catch((e=>{console.error(`Fail to end search query in notebook:\n${e}`)}))}getFilters(){const e=this.translator.load("jupyterlab");return{output:{title:e.__("Search Cell Outputs"),description:e.__("Search in the cell outputs."),default:!1,supportReplace:!1},selection:{title:"cells"===this._selectionSearchMode?e._n("Search in %1 Selected Cell","Search in %1 Selected Cells",this._selectedCells):e._n("Search in %1 Selected Line","Search in %1 Selected Lines",this._selectedLines),description:e.__("Search only in the selected cells or text (depending on edit/command mode)."),default:!1,supportReplace:!0}}}_updateSelectionMode(){this._selectionLock||(this._selectionSearchMode=1===this._selectedCells&&"edit"===this.widget.content.mode&&0!==this._selectedLines?"text":"cells")}getInitialQuery(){const e=this.widget.content.activeCell,t=null==e?void 0:e.editor;return t?t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to):""}async clearHighlight(){this._selectionLock=!0,null!==this._currentProviderIndex&&this._currentProviderIndex<this._searchProviders.length&&(await this._searchProviders[this._currentProviderIndex].clearHighlight(),this._currentProviderIndex=null),this._selectionLock=!1}async highlightNext(e=!0,t){const n=await this._stepNext(!1,e,t);return null!=n?n:void 0}async highlightPrevious(e=!0,t){const n=await this._stepNext(!0,e,t);return null!=n?n:void 0}async startQuery(e,t){if(!this.widget)return;await this.endQuery();let n=this.widget.content.widgets;this._query=e,this._filters={output:!1,selection:!1,...null!=t?t:{}},this._onSelection=this._filters.selection;const o=this.widget.content.activeCellIndex;return this._searchProviders=await Promise.all(n.map((async(t,n)=>{const s=(0,i.createCellSearchProvider)(t);return await s.setIsActive(!this._filters.selection||this.widget.content.isSelectedOrActive(t)),this._onSelection&&"text"===this._selectionSearchMode&&n===o&&this._textSelection&&await s.setSearchSelection(this._textSelection),await s.startQuery(e,this._filters),s}))),this._currentProviderIndex=o,await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1}),Promise.resolve()}async endQuery(){await Promise.all(this._searchProviders.map((e=>e.endQuery().then((()=>{e.dispose()}))))),this._searchProviders.length=0,this._currentProviderIndex=null}async replaceCurrentMatch(e,t=!0,n){let o=!1;const i=async(e=!1)=>{var n;const o=null===(n=this.widget)||void 0===n?void 0:n.content.activeCell;"markdown"===(null==o?void 0:o.model.type)&&o.rendered&&(o.rendered=!1,e&&await this.highlightNext(t))};if(null!==this._currentProviderIndex){await i();const s=this._searchProviders[this._currentProviderIndex];o=await s.replaceCurrentMatch(e,!1,n),null===s.currentMatchIndex&&await this.highlightNext(t)}return await i(!0),o}async replaceAllMatches(e,t){return(await Promise.all(this._searchProviders.map((n=>n.replaceAllMatches(e,t))))).includes(!0)}async validateFilter(e,t){if("output"!==e)return t;if(t&&this.widget.content.widgets.some((e=>e instanceof i.CodeCell&&e.isPlaceholder()))){const e=this.translator.load("jupyterlab");if(!(await(0,o.showDialog)({title:e.__("Confirmation"),body:e.__("Searching outputs is expensive and requires to first rendered all outputs. Are you sure you want to search in the cell outputs?"),buttons:[o.Dialog.cancelButton({label:e.__("Cancel")}),o.Dialog.okButton({label:e.__("Ok")})]})).button.accept)return!1;this.widget.content.widgets.forEach(((e,t)=>{e instanceof i.CodeCell&&e.isPlaceholder()&&this.widget.content.renderCellOutputs(t)}))}return t}_addCellProvider(e){var t,n;const o=this.widget.content.widgets[e],s=(0,i.createCellSearchProvider)(o);a.ArrayExt.insert(this._searchProviders,e,s),s.setIsActive(!(null!==(n=null===(t=this._filters)||void 0===t?void 0:t.selection)&&void 0!==n&&n)||this.widget.content.isSelectedOrActive(o)).then((()=>{s.startQuery(this._query,this._filters)}))}_removeCellProvider(e){const t=a.ArrayExt.removeAt(this._searchProviders,e);null==t||t.dispose()}async _onCellsChanged(e,t){switch(t.type){case"add":t.newValues.forEach(((e,n)=>{this._addCellProvider(t.newIndex+n)}));break;case"move":a.ArrayExt.move(this._searchProviders,t.oldIndex,t.newIndex);break;case"remove":for(let e=0;e<t.oldValues.length;e++)this._removeCellProvider(t.oldIndex);break;case"set":t.newValues.forEach(((e,n)=>{this._addCellProvider(t.newIndex+n),this._removeCellProvider(t.newIndex+n+1)}))}this._stateChanged.emit()}async _stepNext(e=!1,t=!1,n){const o=async e=>{var t;if(null!==(t=null==n?void 0:n.scroll)&&void 0!==t&&!t)return;if(this._selectionLock=!0,this.widget.content.activeCellIndex!==this._currentProviderIndex&&(this.widget.content.activeCellIndex=this._currentProviderIndex),-1===this.widget.content.activeCellIndex)return console.warn("No active cell (no cells or no model), aborting search"),void(this._selectionLock=!1);const o=this.widget.content.activeCell;if(!o.inViewport)try{await this.widget.content.scrollToItem(this._currentProviderIndex)}catch(e){}if(o.inputHidden&&(o.inputHidden=!1),!o.inViewport)return void(this._selectionLock=!1);await o.ready;const i=o.editor;i.revealPosition(i.getPositionAt(e.position)),this._selectionLock=!1};null===this._currentProviderIndex&&(this._currentProviderIndex=this.widget.content.activeCellIndex),e&&"command"===this.widget.content.mode&&(this._searchProviders[this._currentProviderIndex].getCurrentMatch()||(this._currentProviderIndex-=1),t&&(this._currentProviderIndex=(this._currentProviderIndex+this._searchProviders.length)%this._searchProviders.length));const i=this._currentProviderIndex;do{const i=this._searchProviders[this._currentProviderIndex],s=e?await i.highlightPrevious(!1,n):await i.highlightNext(!1,n);if(s)return await o(s),s;this._currentProviderIndex=this._currentProviderIndex+(e?-1:1),t&&(this._currentProviderIndex=(this._currentProviderIndex+this._searchProviders.length)%this._searchProviders.length)}while(t?this._currentProviderIndex!==i:0<=this._currentProviderIndex&&this._currentProviderIndex<this._searchProviders.length);if(t){const t=this._searchProviders[i],s=e?await t.highlightPrevious(!1,n):await t.highlightNext(!1,n);if(s)return await o(s),s}return this._currentProviderIndex=null,null}async _onActiveCellChanged(){null!==this._delayedActiveCellChangeHandler&&(clearTimeout(this._delayedActiveCellChangeHandler),this._delayedActiveCellChangeHandler=null),this.widget.content.activeCellIndex!==this._currentProviderIndex&&(this._delayedActiveCellChangeHandler=setTimeout((()=>{this.delayedActiveCellChangeHandlerReady=this._handleHighlightsAfterActiveCellChange()}),0)),this._observeActiveCell()}async _handleHighlightsAfterActiveCellChange(){if(this._onSelection){const e=null!==this._currentProviderIndex&&this._currentProviderIndex<this.widget.content.widgets.length?this.widget.content.widgets[this._currentProviderIndex]:null;e&&this.widget.content.isSelectedOrActive(e)||(await this._updateCellSelection(),await this.clearHighlight(),this._currentProviderIndex=this.widget.content.activeCellIndex)}await this._ensureCurrentMatch()}async _ensureCurrentMatch(){if(null!==this._currentProviderIndex){const e=this._searchProviders[this._currentProviderIndex];if(!e)return;!e.getCurrentMatch()&&this.matchesCount&&await this.highlightNext(!0,{from:"start",scroll:!1,select:!1})}}_observeActiveCell(){var e;const t=null===(e=this.widget.content.activeCell)||void 0===e?void 0:e.editor;t&&(this._stopObservingLastCell(),t.model.selections.changed.connect(this._setSelectedLines,this),this._editorSelectionsObservable=t.model.selections)}_stopObservingLastCell(){this._editorSelectionsObservable&&this._editorSelectionsObservable.changed.disconnect(this._setSelectedLines,this)}_setSelectedLines(){var e;const t=null===(e=this.widget.content.activeCell)||void 0===e?void 0:e.editor;if(!t)return;const n=t.getSelection(),{start:o,end:i}=n,s=i.line===o.line&&i.column===o.column?0:i.line-o.line+1;this._textSelection=n,s!==this._selectedLines&&(this._selectedLines=s,this._updateSelectionMode()),this._filtersChanged.emit()}async _setEnginesSelectionSearchMode(){let e;e=!!this._onSelection&&"text"===this._selectionSearchMode,this._selectionLock||await Promise.all(this._searchProviders.map(((t,n)=>{const o=this.widget.content.activeCellIndex===n;return t.setProtectSelection(o&&this._onSelection),t.setSearchSelection(o&&e?this._textSelection:null)})))}async _onCellSelectionChanged(){if(null!==this._delayedActiveCellChangeHandler&&(clearTimeout(this._delayedActiveCellChangeHandler),this._delayedActiveCellChangeHandler=null),await this._updateCellSelection(),null===this._currentProviderIndex){const e=this.widget.content.widgets.findIndex((e=>this.widget.content.isSelectedOrActive(e)));this._currentProviderIndex=e}await this._ensureCurrentMatch()}async _updateCellSelection(){const e=this.widget.content.widgets;let t=0;await Promise.all(e.map((async(e,n)=>{const o=this._searchProviders[n],i=this.widget.content.isSelectedOrActive(e);i&&(t+=1),o&&this._onSelection&&await o.setIsActive(i)}))),t!==this._selectedCells&&(this._selectedCells=t,this._updateSelectionMode()),this._filtersChanged.emit()}}!function(e){e[e.Idle=-1]="Idle",e[e.Error=-.5]="Error",e[e.Scheduled=0]="Scheduled",e[e.Running=1]="Running"}(ge||(ge={}));class me extends V.TableOfContentsModel{constructor(e,t,n,o){super(e,o),this.parser=t,this.sanitizer=n,this.configMetadataMap={numberHeaders:["toc-autonumbering","toc/number_sections"],numberingH1:["!toc/skip_h1_title"],baseNumbering:["toc/base_numbering"]},this._runningCells=new Array,this._errorCells=new Array,this._cellToHeadingIndex=new WeakMap,e.context.ready.then((()=>{this.setConfiguration({})})),this.widget.context.model.metadataChanged.connect(this.onMetadataChanged,this),this.widget.content.activeCellChanged.connect(this.onActiveCellChanged,this),C.executionScheduled.connect(this.onExecutionScheduled,this),C.executed.connect(this.onExecuted,this),C.outputCleared.connect(this.onOutputCleared,this),this.headingsChanged.connect(this.onHeadingsChanged,this)}get documentType(){return"notebook"}get isAlwaysActive(){return!0}get supportedOptions(){return["baseNumbering","maximalDepth","numberingH1","numberHeaders","includeOutput","syncCollapseState"]}getCellHeadings(e){const t=new Array;let n=this._cellToHeadingIndex.get(e);if(void 0!==n){const e=this.headings[n];for(t.push(e);this.headings[n-1]&&this.headings[n-1].cellRef===e.cellRef;)n--,t.unshift(this.headings[n])}return t}dispose(){var e,t,n;this.isDisposed||(this.headingsChanged.disconnect(this.onHeadingsChanged,this),null===(t=null===(e=this.widget.context)||void 0===e?void 0:e.model)||void 0===t||t.metadataChanged.disconnect(this.onMetadataChanged,this),null===(n=this.widget.content)||void 0===n||n.activeCellChanged.disconnect(this.onActiveCellChanged,this),C.executionScheduled.disconnect(this.onExecutionScheduled,this),C.executed.disconnect(this.onExecuted,this),C.outputCleared.disconnect(this.onOutputCleared,this),this._runningCells.length=0,this._errorCells.length=0,super.dispose())}setConfiguration(e){const t=this.loadConfigurationFromMetadata();super.setConfiguration({...this.configuration,...t,...e})}toggleCollapse(e){super.toggleCollapse(e),this.updateRunningStatus(this.headings)}getHeadings(){const e=this.widget.content.widgets,t=[],n=new Array;for(let o=0;o<e.length;o++){const i=e[o];switch(i.model.type){case"code":!this.configuration.syncCollapseState&&this.configuration.includeOutput&&t.push(...V.TableOfContentsUtils.filterHeadings(i.headings,this.configuration,n).map((e=>({...e,cellRef:i,collapsed:!1,isRunning:ge.Idle}))));break;case"markdown":{const e=V.TableOfContentsUtils.filterHeadings(i.headings,this.configuration,n).map(((e,t)=>({...e,cellRef:i,collapsed:!1,isRunning:ge.Idle})));if(this.configuration.syncCollapseState&&i.headingCollapsed){const t=Math.min(...e.map((e=>e.level)));e.find((e=>e.level===t)).collapsed=i.headingCollapsed}t.push(...e);break}}t.length>0&&this._cellToHeadingIndex.set(i,t.length-1)}return this.updateRunningStatus(t),Promise.resolve(t)}loadConfigurationFromMetadata(){const e=this.widget.content.model,t={};if(e)for(const n in this.configMetadataMap){const o=this.configMetadataMap[n];for(const i of o){let o=i;const s="!"===o[0];s&&(o=o.slice(1));const l=o.split("/");let a=e.getMetadata(l[0]);for(let e=1;e<l.length;e++)a=(null!=a?a:{})[l[e]];void 0!==a&&("boolean"==typeof a&&s&&(a=!a),t[n]=a)}}return t}onActiveCellChanged(e,t){const n=this.getCellHeadings(t)[0];this.setActiveHeading(null!=n?n:null,!1)}onHeadingsChanged(){this.widget.content.activeCell&&this.onActiveCellChanged(this.widget.content,this.widget.content.activeCell)}onExecuted(e,t){this._runningCells.forEach(((e,n)=>{var o;if(e===t.cell){this._runningCells.splice(n,1);const i=this._cellToHeadingIndex.get(e);if(void 0!==i){const n=this.headings[i];if(t.success||void 0===(null===(o=t.error)||void 0===o?void 0:o.errorName))return void(n.isRunning=ge.Idle);n.isRunning=ge.Error,this._errorCells.includes(e)||this._errorCells.push(e)}}})),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onExecutionScheduled(e,t){this._runningCells.includes(t.cell)||this._runningCells.push(t.cell),this._errorCells.forEach(((e,n)=>{e===t.cell&&this._errorCells.splice(n,1)})),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onOutputCleared(e,t){this._errorCells.forEach(((e,n)=>{if(e===t.cell){this._errorCells.splice(n,1);const t=this._cellToHeadingIndex.get(e);void 0!==t&&(this.headings[t].isRunning=ge.Idle)}})),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onMetadataChanged(){this.setConfiguration({})}updateRunningStatus(e){this._runningCells.forEach(((e,t)=>{const n=this._cellToHeadingIndex.get(e);if(void 0!==n){const e=this.headings[n];e.isRunning!==ge.Running&&(e.isRunning=t>0?ge.Scheduled:ge.Running)}})),this._errorCells.forEach(((e,t)=>{const n=this._cellToHeadingIndex.get(e);if(void 0!==n){const e=this.headings[n];e.isRunning===ge.Idle&&(e.isRunning=ge.Error)}}));let t=0;for(;t<e.length;){const o=e[t];if(t++,o.collapsed){const t=Math.max(o.isRunning,n(e,o.level));o.dataset={...o.dataset,"data-running":t.toString()}}else o.dataset={...o.dataset,"data-running":o.isRunning.toString()}}function n(e,o){let i=ge.Idle;for(;t<e.length;){const s=e[t];if(s.dataset={...s.dataset,"data-running":s.isRunning.toString()},!(s.level>o))break;t++,i=Math.max(s.isRunning,i),s.collapsed&&(i=Math.max(i,n(e,s.level)),s.dataset={...s.dataset,"data-running":i.toString()})}return i}}}class pe extends V.TableOfContentsFactory{constructor(e,t,n){super(e),this.parser=t,this.sanitizer=n}_createNew(e,t){const n=new me(e,this.parser,this.sanitizer,t);let o=new WeakMap;const s=(t,n)=>{if(n){const t=async t=>{if(!t.inViewport)return;const i=o.get(n);if(i){const t=e.content.node.getBoundingClientRect(),n=i.getBoundingClientRect();(n.top>t.bottom||n.bottom<t.top)&&i.scrollIntoView({block:"center"})}else console.debug("scrolling to heading: using fallback strategy"),await e.content.scrollToItem(e.content.activeCellIndex)},i=n.cellRef,s=e.content.widgets.indexOf(i);e.content.activeCellIndex=s,i.inViewport?t(i).catch((e=>{console.error(`Fail to scroll to cell to display the required heading (${e}).`)})):e.content.scrollToItem(s).then((()=>t(i))).catch((e=>{console.error(`Fail to scroll to cell to display the required heading (${e}).`)}))}},l=e=>{n.getCellHeadings(e).forEach((async e=>{var t,n;const i=await _e(e,this.parser),s=i?`h${e.level}[id="${i}"]`:`h${e.level}`;void 0!==e.outputIndex?o.set(e,V.TableOfContentsUtils.addPrefix(e.cellRef.outputArea.widgets[e.outputIndex].node,s,null!==(t=e.prefix)&&void 0!==t?t:"")):o.set(e,V.TableOfContentsUtils.addPrefix(e.cellRef.node,s,null!==(n=e.prefix)&&void 0!==n?n:""))}))},a=t=>{this.parser&&(V.TableOfContentsUtils.clearNumbering(e.content.node),o=new WeakMap,e.content.widgets.forEach((e=>{l(e)})))},d=(t,o)=>{var s,l,a,d;if(n.configuration.syncCollapseState)if(null!==o){const e=o.cellRef;e.headingCollapsed!==(null!==(s=o.collapsed)&&void 0!==s&&s)&&(e.headingCollapsed=null!==(l=o.collapsed)&&void 0!==l&&l)}else{const t=null!==(d=null===(a=n.headings[0])||void 0===a?void 0:a.collapsed)&&void 0!==d&&d;e.content.widgets.forEach((e=>{e instanceof i.MarkdownCell&&e.headingInfo.level>=0&&(e.headingCollapsed=t)}))}},r=(e,t)=>{if(n.configuration.syncCollapseState){const e=n.getCellHeadings(t)[0];e&&n.toggleCollapse({heading:e,collapsed:t.headingCollapsed})}},c=(e,t)=>{t.inViewport?l(t):V.TableOfContentsUtils.clearNumbering(t.node)};return e.context.ready.then((()=>{a(),n.activeHeadingChanged.connect(s),n.headingsChanged.connect(a),n.collapseChanged.connect(d),e.content.cellCollapsed.connect(r),e.content.cellInViewportChanged.connect(c),e.disposed.connect((()=>{n.activeHeadingChanged.disconnect(s),n.headingsChanged.disconnect(a),n.collapseChanged.disconnect(d),e.content.cellCollapsed.disconnect(r),e.content.cellInViewportChanged.disconnect(c)}))})),n}}async function _e(e,t){let n=null;return e.type===i.Cell.HeadingType.Markdown?n=await V.TableOfContentsUtils.Markdown.getHeadingId(t,e.raw,e.level):e.type===i.Cell.HeadingType.HTML&&(n=e.id),n}const fe=new d.Token("@jupyterlab/notebook:INotebookWidgetFactory","A service to create the notebook viewer."),we=new d.Token("@jupyterlab/notebook:INotebookTools",'A service for the "Notebook Tools" panel in the\n right sidebar. Use this to add your own functionality to the panel.'),ye=new d.Token("@jupyterlab/notebook:INotebookTracker","A widget tracker for notebooks.\n Use this if you want to be able to iterate over and interact with notebooks\n created by the application.");class be extends o.WidgetTracker{constructor(){super(...arguments),this._activeCell=null,this._activeCellChanged=new r.Signal(this),this._selectionChanged=new r.Signal(this)}get activeCell(){const e=this.currentWidget;return e&&e.content.activeCell||null}get activeCellChanged(){return this._activeCellChanged}get selectionChanged(){return this._selectionChanged}add(e){const t=super.add(e);return e.content.activeCellChanged.connect(this._onActiveCellChanged,this),e.content.selectionChanged.connect(this._onSelectionChanged,this),t}dispose(){this._activeCell=null,super.dispose()}onCurrentChanged(e){const t=this.activeCell;t&&t===this._activeCell||(this._activeCell=t,e&&this._activeCellChanged.emit(e.content.activeCell||null))}_onActiveCellChanged(e,t){this.currentWidget&&this.currentWidget.content===e&&(this._activeCell=t||null,this._activeCellChanged.emit(this._activeCell))}_onSelectionChanged(e){this.currentWidget&&this.currentWidget.content===e&&this._selectionChanged.emit(void 0)}}function ke(e){return e.allCellsTrusted?h().createElement(_.trustedIcon.react,{top:"2px",stylesheet:"statusBar"}):h().createElement(_.notTrustedIcon.react,{top:"2px",stylesheet:"statusBar"})}class Se extends _.VDomRenderer{constructor(e){super(new Se.Model),this.translator=e||l.nullTranslator,this.node.classList.add("jp-StatusItem-trust")}render(){if(!this.model)return null;const e=function(e,t){const n=(t=t||l.nullTranslator).load("jupyterlab");return e.trustedCells===e.totalCells?n.__("Notebook trusted: %1 of %2 code cells trusted.",e.trustedCells,e.totalCells):e.activeCellTrusted?n.__("Active cell trusted: %1 of %2 code cells trusted.",e.trustedCells,e.totalCells):n.__("Notebook not trusted: %1 of %2 code cells trusted.",e.trustedCells,e.totalCells)}(this.model,this.translator);return e!==this.node.title&&(this.node.title=e),h().createElement(ke,{allCellsTrusted:this.model.trustedCells===this.model.totalCells,activeCellTrusted:this.model.activeCellTrusted,totalCells:this.model.totalCells,trustedCells:this.model.trustedCells})}}!function(e){class t extends _.VDomModel{constructor(){super(...arguments),this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1,this._notebook=null}get trustedCells(){return this._trustedCells}get totalCells(){return this._totalCells}get activeCellTrusted(){return this._activeCellTrusted}get notebook(){return this._notebook}set notebook(e){const t=this._notebook;null!==t&&(t.activeCellChanged.disconnect(this._onActiveCellChanged,this),t.modelContentChanged.disconnect(this._onModelChanged,this));const n=this._getAllState();if(this._notebook=e,null===this._notebook)this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1;else{this._notebook.activeCellChanged.connect(this._onActiveCellChanged,this),this._notebook.modelContentChanged.connect(this._onModelChanged,this),this._notebook.activeCell?this._activeCellTrusted=this._notebook.activeCell.model.trusted:this._activeCellTrusted=!1;const{total:e,trusted:t}=this._deriveCellTrustState(this._notebook.model);this._totalCells=e,this._trustedCells=t}this._triggerChange(n,this._getAllState())}_onModelChanged(e){const t=this._getAllState(),{total:n,trusted:o}=this._deriveCellTrustState(e.model);this._totalCells=n,this._trustedCells=o,this._triggerChange(t,this._getAllState())}_onActiveCellChanged(e,t){const n=this._getAllState();this._activeCellTrusted=!!t&&t.model.trusted,this._triggerChange(n,this._getAllState())}_deriveCellTrustState(e){if(null===e)return{total:0,trusted:0};let t=0,n=0;for(const o of e.cells)"code"===o.type&&(t++,o.trusted&&n++);return{total:t,trusted:n}}_getAllState(){return[this._trustedCells,this._totalCells,this.activeCellTrusted]}_triggerChange(e,t){e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]||this.stateChanged.emit(void 0)}}e.Model=t}(Se||(Se={}));class xe{constructor(e){this._requestBatchSize=10,this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._kernelSession="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[],this._kernel=null,this._sessionContext=e.sessionContext,this._trans=(e.translator||l.nullTranslator).load("jupyterlab"),this._handleKernel().then((()=>{this._sessionContext.kernelChanged.connect(this._handleKernel,this)})),this._toRequest=this._requestBatchSize}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&t.model.sharedModel.changed.disconnect(this.onTextChange,this),this._editor=e,e&&e.model.sharedModel.changed.connect(this.onTextChange,this)}get placeholder(){return this._placeholder}get kernelSession(){return this._kernelSession}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,r.Signal.clearData(this)}async checkSession(e){var t;this._hasSession||(await this._retrieveHistory(),this._hasSession=!0,this.editor=e.editor,this._placeholder=(null===(t=this._editor)||void 0===t?void 0:t.model.sharedModel.getSource())||"",this.setFilter(this._placeholder),this._cursor=this._filtered.length-1)}async back(e){return await this.checkSession(e),--this._cursor,this._cursor<0&&await this.fetchBatch(),this._cursor=Math.max(0,this._cursor),this._filtered[this._cursor]}async forward(e){return await this.checkSession(e),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor),this._filtered[this._cursor]}updateEditor(e,t){var n,o;if(e){const i=null===(n=e.editor)||void 0===n?void 0:n.model,s=null==i?void 0:i.sharedModel.getSource();if(this.isDisposed||!t)return;if(s===t)return;this._setByHistory=!0,null==i||i.sharedModel.setSource(t);let l=0;l=t.indexOf("\n"),l<0&&(l=t.length),null===(o=e.editor)||void 0===o||o.setCursorPosition({line:0,column:l})}}reset(){this._hasSession=!1,this._placeholder="",this._toRequest=this._requestBatchSize}async fetchBatch(){this._toRequest+=this._requestBatchSize;let e=this._filtered.slice().reverse(),t=this._history.slice();await this._retrieveHistory().then((()=>{this.setFilter(this._placeholder);let t=0,n=this._filtered.slice().reverse();for(let o=0;o<e.length;o++){let i=e[o];for(let e=o+t;e<n.length&&i!==n[e];e++)t+=1}this._cursor=this._filtered.length-(e.length+1)-t})),this._cursor<0&&this._history.length>t.length&&await this.fetchBatch()}onHistory(e,t){this._history.length=0;let n=["","",""],o=["","",""],i="";if("ok"===e.content.status){for(let t=0;t<e.content.history.length;t++)o=e.content.history[t],o!==n&&(i=e.content.history[t][0],this._history.push(n=o));this.kernelSession||o[2]==(null==t?void 0:t.model.sharedModel.getSource())&&(this._kernelSession=i)}}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}async _handleKernel(){var e;this._kernel=null===(e=this._sessionContext.session)||void 0===e?void 0:e.kernel,this._kernel?await this._retrieveHistory().catch():this._history.length=0}async _retrieveHistory(e){var t,n;return await(null===(t=this._kernel)||void 0===t?void 0:t.requestHistory((n=this._toRequest,{output:!1,raw:!0,hist_access_type:"tail",n})).then((t=>{this.onHistory(t,e)})).catch((()=>{console.warn(this._trans.__("History was unable to be retrieved"))})))}setFilter(e=""){this._filtered.length=0;let t="",n="";for(let o=0;o<this._history.length;o++)n=this._history[o][2],n!==t&&e!==n&&this._filtered.push(t=n);this._filtered.push(e)}}class Me extends F.ABCWidgetFactory{constructor(e){super(e),this.rendermime=e.rendermime,this.contentFactory=e.contentFactory,this.mimeTypeService=e.mimeTypeService,this._editorConfig=e.editorConfig||re.defaultEditorConfig,this._notebookConfig=e.notebookConfig||re.defaultNotebookConfig}get editorConfig(){return this._editorConfig}set editorConfig(e){this._editorConfig=e}get notebookConfig(){return this._notebookConfig}set notebookConfig(e){this._notebookConfig=e}createNewWidget(e,t){const n=e.translator,o=new xe({sessionContext:e.sessionContext,translator:n}),i={rendermime:t?t.content.rendermime:this.rendermime.clone({resolver:e.urlResolver}),contentFactory:this.contentFactory,mimeTypeService:this.mimeTypeService,editorConfig:t?t.content.editorConfig:this._editorConfig,notebookConfig:t?t.content.notebookConfig:this._notebookConfig,translator:n,kernelHistory:o},s=this.contentFactory.createNotebook(i);return new ue({context:e,content:s})}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2607,2007],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(59361),i=s(33625),a=s(9267),u=s(56165);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(20998).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2607,2007],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(70798),i=s(33625),a=s(31516),u=s(78036);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(20998).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2615],{92615:(e,t,a)=>{a.r(t),a.d(t,{DETAILS_CLASS:()=>u,IMermaidManager:()=>h,IMermaidMarkdown:()=>M,MERMAID_CLASS:()=>l,MERMAID_CODE_CLASS:()=>c,MERMAID_DARK_THEME:()=>m,MERMAID_DEFAULT_THEME:()=>d,MERMAID_FILE_EXTENSIONS:()=>s,MERMAID_MIME_TYPE:()=>i,MermaidManager:()=>p,MermaidMarkdown:()=>y,RenderedMermaid:()=>E,SUMMARY_CLASS:()=>g,WARNING_CLASS:()=>o,rendererFactory:()=>T});var r=a(20998),n=a(13558);const i="text/vnd.mermaid",s=[".mmd",".mermaid"],d="default",m="dark",l="jp-RenderedMermaid",c="mermaid",o="jp-mod-warning",u="jp-RenderedMermaid-Details",g="jp-RenderedMermaid-Summary",h=new r.Token("@jupyterlab/mermaid:IMermaidManager","a manager for rendering mermaid text-based diagrams"),M=new r.Token("@jupyterlab/mermaid:IMermaidMarkdown","a manager for rendering mermaid text-based diagrams in markdown fenced code blocks");class p{constructor(e={}){this._diagrams=new n.LruCache({maxSize:e.maxCacheSize||null}),e.themes&&(_.initThemes(e.themes||null),e.themes.themeChanged.connect(this.initialize,this))}initialize(){this._diagrams.clear(),_.initMermaid()}async getMermaid(){return await _.ensureMermaid()}getMermaidVersion(){return _.version()}getCachedFigure(e){return this._diagrams.get(e)}async renderSvg(e){const t=await this.getMermaid(),a=`jp-mermaid-${_.nextMermaidId()}`,r=document.createElement("div");document.body.appendChild(r);try{const{svg:n}=await t.render(a,e,r),i=(new DOMParser).parseFromString(n,"image/svg+xml"),s={text:e,svg:n},d=i.querySelector("svg"),{maxWidth:m}=(null==d?void 0:d.style)||{};s.width=m?parseFloat(m):null;const l=i.querySelector("title"),c=i.querySelector("desc");return l&&(s.accessibleTitle=l.textContent),c&&(s.accessibleDescription=c.textContent),s}finally{r.remove()}}async renderFigure(e){let t=this._diagrams.get(e);if(null!=t)return t;let a=l,r=null;t=document.createElement("div"),t.className=a;try{const t=await this.renderSvg(e);r=this.makeMermaidFigure(t)}catch(a){t.classList.add(o),r=await this.makeMermaidError(e)}let n=this.getMermaidVersion();return n&&(r.dataset.jpMermaidVersion=n),t.appendChild(r),this._diagrams.set(e,t),t}makeMermaidCode(e){const t=document.createElement("pre"),a=document.createElement("code");return a.innerText=e,t.appendChild(a),a.className=c,a.textContent=e,t}async makeMermaidError(e){const t=await this.getMermaid();let a="";try{await t.parse(e)}catch(e){a=`${e}`}const r=document.createElement("details");r.className=u;const n=document.createElement("summary");n.className=g,n.appendChild(this.makeMermaidCode(e)),r.appendChild(n);const i=document.createElement("pre");return i.innerText=a,r.appendChild(i),r}makeMermaidFigure(e){const t=document.createElement("figure"),a=document.createElement("img");if(t.appendChild(a),a.setAttribute("src",`data:image/svg+xml,${encodeURIComponent(e.svg)}`),e.width&&(a.width=e.width),e.accessibleTitle&&a.setAttribute("alt",e.accessibleTitle),t.appendChild(this.makeMermaidCode(e.text)),e.accessibleDescription){const a=document.createElement("figcaption");a.className="sr-only",a.textContent=e.accessibleDescription,t.appendChild(a)}return t}}var _;!function(e){let t=null,n=null,i=null,s=0,l=null;function c(){if(!n)return!1;let e=d;if(t){const a=t.theme;e=a&&t.isLight(a)?d:m}const a=window.getComputedStyle(document.body).getPropertyValue("--jp-ui-font-family");return n.mermaidAPI.globalReset(),n.mermaidAPI.initialize({theme:e,fontFamily:a,maxTextSize:1e5,startOnLoad:!1}),!0}e.initThemes=function(e){t=e},e.version=function(){return l},e.initMermaid=c,e.getMermaid=function(){return n},e.nextMermaidId=function(){return s++},e.ensureMermaid=async function(){return null!=n?n:i?i.promise:(i=new r.PromiseDelegate,l=(await a.e(1169).then(a.t.bind(a,21169,19))).version,n=(await Promise.all([a.e(4499),a.e(4630)]).then(a.bind(a,84630))).default,c(),i.resolve(n),n)}}(_||(_={}));class y{constructor(e){this.languages=["mermaid"],this.rank=100,this._mermaid=e.mermaid}async walk(e){await this._mermaid.renderFigure(e)}render(e){let t=this._mermaid.getCachedFigure(e);return t?t.outerHTML:null}}var C=a(31516);const w="image/svg+xml";class E extends C.Widget{constructor(e){super(),this._lastRendered=null,this._mimeType=e.mimeType,this.addClass(l)}static set manager(e){E._manager?console.warn("Mermaid manager may only be set once, and is already set."):(E._manager=e,E._managerReady.resolve(e))}async renderModel(e){const t=await E._managerReady.promise,a=e.data[this._mimeType];if(null==a||a===this._lastRendered)return;this._lastRendered=a;const r=await t.renderFigure(a);if(r.classList.contains(o)?this.node.classList.add(o):this.node.classList.remove(o),!r.firstChild)return;this.node.innerHTML!==r.innerHTML&&(this.node.innerHTML=r.innerHTML);const n=t.getMermaidVersion(),s={...e.metadata[i]||{},version:n},d={...e.metadata,[i]:s},m=r.querySelector("img");if(m){const t=decodeURIComponent(m.src.split(",")[1]);t!==e.data[w]&&e.setData({data:{...e.data,[w]:t},metadata:d})}else{const t={...e.data};delete t[w],e.setData({data:t,metadata:d})}}}E._manager=null,E._managerReady=new r.PromiseDelegate;const T={safe:!0,mimeTypes:[i],createRenderer:e=>new E(e)}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2866],{24598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const o=n(81997);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new o.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},2866:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(24598),t),r(n(51632),t),r(n(94741),t),r(n(86083),t),r(n(12361),t),r(n(82053),t),r(n(84157),t),r(n(59635),t),r(n(34410),t)},51632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const o=t.split("\n"),r=[];let i=null;for(let t=0;t<o.length;t++){const s=o[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=i;if(a||c)if(c)i&&(a?(i.endLine=t-1,r.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const o=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);o!==a&&(i.code=s.substring(o+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,r.push(i),i=null)}}return r}}(t.MarkdownCodeBlocks||(t.MarkdownCodeBlocks={}))},86083:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(27061),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(20998),minimist_1=__importDefault(__webpack_require__(66161)),url_1=__webpack_require__(34410);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&void 0!==process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(67425);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,o,r;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),c="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,c),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(o=getOption("workspace"))&&void 0!==o?o:PageConfig.defaultWorkspace)));const l=null!==(r=e.treePath)&&void 0!==r?r:getOption("treePath");return l&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(l))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const o=url_1.URLExt.encodeParts(e),r=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,o);return n?r+"?download=true":r}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.deferred.some((e=>e===t||o&&e===o))},e.isDisabled=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.disabled.some((e=>e===t||o&&e===o))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig=exports.PageConfig||(exports.PageConfig={}))},12361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const o=n(67425);!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=o.posix.join(...e);return"."===n?"":t(n)},e.basename=function(e,t){return o.posix.basename(e,t)},e.dirname=function(e){const n=t(o.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return o.posix.extname(e)},e.normalize=function(e){return""===e?"":t(o.posix.normalize(e))},e.resolve=function(...e){return t(o.posix.resolve(...e))},e.relative=function(e,n){return t(o.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(t.PathExt||(t.PathExt={}))},82053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const o=n(20998);t.signalToPromise=function(e,t){const n=new o.PromiseDelegate;function r(){e.disconnect(i)}function i(e,t){r(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},84157:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,(n=t.Text||(t.Text={})).jsIndexToCharIndex=function(e,t){return e},n.charIndexToJsIndex=function(e,t){return e},n.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,o){return o?o.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},n.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}},59635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var o;(o=t.Time||(t.Time={})).formatHuman=function(e){const t=document.documentElement.lang||"en",o=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),r=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(r/e.milliseconds);if(0!==t)return o.format(t,e.name)}return o.format(0,"seconds")},o.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}},34410:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(67425),i=o(n(80899));!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const o=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=r.posix.join(`${o&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${o}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(o||"")),e}),{})},e.isLocal=function(e){const{protocol:n}=t(e);return(!n||0!==e.toLowerCase().indexOf(n))&&0!==e.indexOf("/")}}(t.URLExt||(t.URLExt={}))},66161:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,o){o||(o={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(r.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?r.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return r.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){i[e]=[].concat(o.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(o.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){r.strings[e]=!0}))}));var a=o.default||{},c={_:[]};function l(e,t,o){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var c=t[t.length-1];n(i,c)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[c]||r.bools[c]||"boolean"==typeof i[c]?i[c]=o:Array.isArray(i[c])?i[c].push(o):i[c]=[i[c],o])}function u(e,n,o){if(!o||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,o)||!1!==r.unknownFn(o)){var s=!r.strings[e]&&t(n)?Number(n):n;l(c,e.split("."),s),(i[e]||[]).forEach((function(e){l(c,e.split("."),s)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,d,g=e[p];if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var v=m[2];r.bools[h]&&(v="false"!==v),u(h,v,g)}else if(/^--no-.+/.test(g))u(h=g.match(/^--no-(.+)/)[1],!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],void 0===(d=e[p+1])||/^(-|--)[^-]/.test(d)||r.bools[h]||r.allBools||i[h]&&s(h)?/^(true|false)$/.test(d)?(u(h,"true"===d,g),p+=1):u(h,!r.strings[h]||"",g):(u(h,d,g),p+=1);else if(/^-[^-]+/.test(g)){for(var _=g.slice(1,-1).split(""),b=!1,y=0;y<_.length;y++)if("-"!==(d=g.slice(y+2))){if(/[A-Za-z]/.test(_[y])&&"="===d[0]){u(_[y],d.slice(1),g),b=!0;break}if(/[A-Za-z]/.test(_[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(_[y],d,g),b=!0;break}if(_[y+1]&&_[y+1].match(/\W/)){u(_[y],g.slice(y+2),g),b=!0;break}u(_[y],!r.strings[_[y]]||"",g)}else u(_[y],d,g);h=g.slice(-1)[0],b||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||i[h]&&s(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],g),p+=1):u(h,!r.strings[h]||"",g):(u(h,e[p+1],g),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(g)||c._.push(r.strings._||!t(g)?g:Number(g)),o.stopEarly){c._.push.apply(c._,e.slice(p+1));break}}return Object.keys(a).forEach((function(e){var t,n,o;t=c,n=e.split("."),o=t,n.slice(0,-1).forEach((function(e){o=o[e]||{}})),n[n.length-1]in o||(l(c,e.split("."),a[e]),(i[e]||[]).forEach((function(t){l(c,t.split("."),a[e])})))})),o["--"]?c["--"]=f.slice():f.forEach((function(e){c._.push(e)})),c}},67425:(e,t,n)=>{"use strict";var o=n(27061);function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,o="",r=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(o.length<2||2!==r||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",r=0):r=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),i=a,s=0;continue}}else if(2===o.length||1===o.length){o="",r=0,i=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",r=2)}else o.length>0?o+="/"+e.slice(i+1,a):o=e.slice(i+1,a),r=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return o}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=i(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var o=e.length,i=o-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=i<c?i:c,u=-1,f=0;f<=l;++f){if(f===l){if(c>l){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>l&&(47===e.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(n+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=n+u+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=n):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){n=a+1;break}}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+o:n+"/"+o:o}(0,e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),i=47===o;i?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},27061:e=>{var t,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],l=!1,u=-1;function f(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},88157:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in r||(r[i]=s)}return r}},53096:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},80899:(e,t,n)=>{"use strict";var o=n(53096),r=n(88157),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(e=e||o);if("blob:"===e.protocol)r=new v(unescape(e.pathname),{});else if("string"===i)for(t in r=new v(e,{}),h)delete r[t];else if("object"===i){for(t in e)t in h||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,o=l.exec(e),r=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):a?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):g(r)?n=o[4]:r?i&&(n=n.slice(2)):c>=2&&g(t.protocol)&&(n=o[4]),{protocol:r,slashes:i||g(r),slashesCount:c,rest:n}}function v(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof v))return new v(e,t,n);var i,a,c,l,h,_,b=p.slice(),y=typeof t,w=this,C=0;for("object"!==y&&"string"!==y&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),i=!(a=m(e||"",t=d(t))).protocol&&!a.slashes,w.slashes=a.slashes||i&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(b[3]=[/(.*)/,"pathname"]);C<b.length;C++)"function"!=typeof(l=b[C])?(c=l[0],_=l[1],c!=c?w[_]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(w[_]=e.slice(0,h),e=e.slice(h+l[2])):(w[_]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[_]=h[1],e=e.slice(0,h.index)),w[_]=w[_]||i&&l[3]&&t[_]||"",l[4]&&(w[_]=w[_].toLowerCase())):e=l(e,w);n&&(w.query=n(w.query)),i&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(i=!0),n.splice(o,1),s--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}v.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&g(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||g(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&g(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},v.extractProtocol=m,v.location=d,v.trimLeft=f,v.qs=r,e.exports=v}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2866],{24598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const o=n(81997);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new o.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},2866:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(24598),t),r(n(51632),t),r(n(79844),t),r(n(94741),t),r(n(86083),t),r(n(12361),t),r(n(82053),t),r(n(84157),t),r(n(59635),t),r(n(34410),t)},51632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},94741:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const o=t.split("\n"),r=[];let i=null;for(let t=0;t<o.length;t++){const s=o[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=i;if(a||c)if(c)i&&(a?(i.endLine=t-1,r.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const o=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);o!==a&&(i.code=s.substring(o+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,r.push(i),i=null)}}return r}}(n||(t.MarkdownCodeBlocks=n={}))},86083:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(27061),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(20998),minimist_1=__importDefault(__webpack_require__(66161)),url_1=__webpack_require__(34410);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&void 0!==process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(67425);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,o,r;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),c="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,c),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(o=getOption("workspace"))&&void 0!==o?o:PageConfig.defaultWorkspace)));const l=null!==(r=e.treePath)&&void 0!==r?r:getOption("treePath");return l&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(l))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const o=url_1.URLExt.encodeParts(e),r=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,o);return n?r+"?download=true":r}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.deferred.some((e=>e===t||o&&e===o))},e.isDisabled=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.disabled.some((e=>e===t||o&&e===o))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},12361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const o=n(67425);var r;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=o.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=o.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return o.posix.basename(e,t)},e.dirname=function(e){const n=t(o.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return o.posix.extname(e)},e.normalize=function(e){return""===e?"":t(o.posix.normalize(e))},e.resolve=function(...e){return t(o.posix.resolve(...e))},e.relative=function(e,n){return t(o.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(r||(t.PathExt=r={}))},82053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const o=n(20998);t.signalToPromise=function(e,t){const n=new o.PromiseDelegate;function r(){e.disconnect(i)}function i(e,t){r(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},84157:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,o){return o?o.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},59635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var o;!function(e){e.formatHuman=function(e){const t=document.documentElement.lang||"en",o=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),r=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(r/e.milliseconds);if(0!==t)return o.format(t,e.name)}return o.format(0,"seconds")},e.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}}(o||(t.Time=o={}))},34410:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(67425),i=o(n(80899));var s;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const o=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=r.posix.join(`${o&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${o}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(o||"")),e}),{})},e.isLocal=function(e){const{protocol:n}=t(e);return(!n||0!==e.toLowerCase().indexOf(n))&&0!==e.indexOf("/")}}(s||(t.URLExt=s={}))},66161:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,o){o||(o={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(r.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?r.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return r.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){i[e]=[].concat(o.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(o.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){r.strings[e]=!0}))}));var a=o.default||{},c={_:[]};function l(e,t,o){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var c=t[t.length-1];n(i,c)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[c]||r.bools[c]||"boolean"==typeof i[c]?i[c]=o:Array.isArray(i[c])?i[c].push(o):i[c]=[i[c],o])}function u(e,n,o){if(!o||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,o)||!1!==r.unknownFn(o)){var s=!r.strings[e]&&t(n)?Number(n):n;l(c,e.split("."),s),(i[e]||[]).forEach((function(e){l(c,e.split("."),s)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,d,g=e[p];if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var _=m[2];r.bools[h]&&(_="false"!==_),u(h,_,g)}else if(/^--no-.+/.test(g))u(h=g.match(/^--no-(.+)/)[1],!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],void 0===(d=e[p+1])||/^(-|--)[^-]/.test(d)||r.bools[h]||r.allBools||i[h]&&s(h)?/^(true|false)$/.test(d)?(u(h,"true"===d,g),p+=1):u(h,!r.strings[h]||"",g):(u(h,d,g),p+=1);else if(/^-[^-]+/.test(g)){for(var v=g.slice(1,-1).split(""),b=!1,y=0;y<v.length;y++)if("-"!==(d=g.slice(y+2))){if(/[A-Za-z]/.test(v[y])&&"="===d[0]){u(v[y],d.slice(1),g),b=!0;break}if(/[A-Za-z]/.test(v[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[y],d,g),b=!0;break}if(v[y+1]&&v[y+1].match(/\W/)){u(v[y],g.slice(y+2),g),b=!0;break}u(v[y],!r.strings[v[y]]||"",g)}else u(v[y],d,g);h=g.slice(-1)[0],b||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||i[h]&&s(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],g),p+=1):u(h,!r.strings[h]||"",g):(u(h,e[p+1],g),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(g)||c._.push(r.strings._||!t(g)?g:Number(g)),o.stopEarly){c._.push.apply(c._,e.slice(p+1));break}}return Object.keys(a).forEach((function(e){var t,n,o;t=c,n=e.split("."),o=t,n.slice(0,-1).forEach((function(e){o=o[e]||{}})),n[n.length-1]in o||(l(c,e.split("."),a[e]),(i[e]||[]).forEach((function(t){l(c,t.split("."),a[e])})))})),o["--"]?c["--"]=f.slice():f.forEach((function(e){c._.push(e)})),c}},67425:(e,t,n)=>{"use strict";var o=n(27061);function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,o="",r=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(o.length<2||2!==r||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",r=0):r=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),i=a,s=0;continue}}else if(2===o.length||1===o.length){o="",r=0,i=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",r=2)}else o.length>0?o+="/"+e.slice(i+1,a):o=e.slice(i+1,a),r=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return o}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=i(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var o=e.length,i=o-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=i<c?i:c,u=-1,f=0;f<=l;++f){if(f===l){if(c>l){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>l&&(47===e.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(n+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=n+u+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=n):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){n=a+1;break}}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+o:n+"/"+o:o}(0,e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),i=47===o;i?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},27061:e=>{var t,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],l=!1,u=-1;function f(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},88157:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in r||(r[i]=s)}return r}},53096:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},80899:(e,t,n)=>{"use strict";var o=n(53096),r=n(88157),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(e=e||o);if("blob:"===e.protocol)r=new _(unescape(e.pathname),{});else if("string"===i)for(t in r=new _(e,{}),h)delete r[t];else if("object"===i){for(t in e)t in h||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,o=l.exec(e),r=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):a?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):g(r)?n=o[4]:r?i&&(n=n.slice(2)):c>=2&&g(t.protocol)&&(n=o[4]),{protocol:r,slashes:i||g(r),slashesCount:c,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,c,l,h,v,b=p.slice(),y=typeof t,w=this,C=0;for("object"!==y&&"string"!==y&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),i=!(a=m(e||"",t=d(t))).protocol&&!a.slashes,w.slashes=a.slashes||i&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(b[3]=[/(.*)/,"pathname"]);C<b.length;C++)"function"!=typeof(l=b[C])?(c=l[0],v=l[1],c!=c?w[v]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(w[v]=e.slice(0,h),e=e.slice(h+l[2])):(w[v]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[v]=h[1],e=e.slice(0,h.index)),w[v]=w[v]||i&&l[3]&&t[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):e=l(e,w);n&&(w.query=n(w.query)),i&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(i=!0),n.splice(o,1),s--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&g(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||g(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&g(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=m,_.location=d,_.trimLeft=f,_.qs=r,e.exports=_}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2883],{82545:(t,r,e)=>{var o=e(81822)(e(77400),"DataView");t.exports=o},96586:(t,r,e)=>{var o=e(57753),n=e(82452),a=e(22115),s=e(38256),i=e(67426);function c(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var o=t[r];this.set(o[0],o[1])}}c.prototype.clear=o,c.prototype.delete=n,c.prototype.get=a,c.prototype.has=s,c.prototype.set=i,t.exports=c},36301:(t,r,e)=>{var o=e(69417),n=e(72470),a=e(66165),s=e(71873),i=e(52556);function c(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var o=t[r];this.set(o[0],o[1])}}c.prototype.clear=o,c.prototype.delete=n,c.prototype.get=a,c.prototype.has=s,c.prototype.set=i,t.exports=c},44538:(t,r,e)=>{var o=e(81822)(e(77400),"Map");t.exports=o},74554:(t,r,e)=>{var o=e(39448),n=e(7738),a=e(66575),s=e(7238),i=e(38738);function c(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var o=t[r];this.set(o[0],o[1])}}c.prototype.clear=o,c.prototype.delete=n,c.prototype.get=a,c.prototype.has=s,c.prototype.set=i,t.exports=c},64825:(t,r,e)=>{var o=e(81822)(e(77400),"Promise");t.exports=o},46151:(t,r,e)=>{var o=e(81822)(e(77400),"Set");t.exports=o},23694:(t,r,e)=>{var o=e(36301),n=e(48814),a=e(5863),s=e(12367),i=e(90748),c=e(97569);function u(t){var r=this.__data__=new o(t);this.size=r.size}u.prototype.clear=n,u.prototype.delete=a,u.prototype.get=s,u.prototype.has=i,u.prototype.set=c,t.exports=u},96539:(t,r,e)=>{var o=e(77400).Symbol;t.exports=o},59942:(t,r,e)=>{var o=e(77400).Uint8Array;t.exports=o},66902:(t,r,e)=>{var o=e(81822)(e(77400),"WeakMap");t.exports=o},10263:t=>{t.exports=function(t,r){for(var e=-1,o=null==t?0:t.length,n=0,a=[];++e<o;){var s=t[e];r(s,e,t)&&(a[n++]=s)}return a}},98213:(t,r,e)=>{var o=e(24701),n=e(2900),a=e(19785),s=e(43854),i=e(42383),c=e(48519),u=Object.prototype.hasOwnProperty;t.exports=function(t,r){var e=a(t),p=!e&&n(t),f=!e&&!p&&s(t),l=!e&&!p&&!f&&c(t),v=e||p||f||l,h=v?o(t.length,String):[],y=h.length;for(var _ in t)!r&&!u.call(t,_)||v&&("length"==_||f&&("offset"==_||"parent"==_)||l&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||i(_,y))||h.push(_);return h}},66070:t=>{t.exports=function(t,r){for(var e=-1,o=null==t?0:t.length,n=Array(o);++e<o;)n[e]=r(t[e],e,t);return n}},97141:t=>{t.exports=function(t,r){for(var e=-1,o=r.length,n=t.length;++e<o;)t[n+e]=r[e];return t}},93382:(t,r,e)=>{var o=e(85638);t.exports=function(t,r){for(var e=t.length;e--;)if(o(t[e][0],r))return e;return-1}},79867:(t,r,e)=>{var o=e(76747),n=e(37948);t.exports=function(t,r){for(var e=0,a=(r=o(r,t)).length;null!=t&&e<a;)t=t[n(r[e++])];return e&&e==a?t:void 0}},11324:(t,r,e)=>{var o=e(97141),n=e(19785);t.exports=function(t,r,e){var a=r(t);return n(t)?a:o(a,e(t))}},99736:(t,r,e)=>{var o=e(96539),n=e(34840),a=e(21258),s=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?n(t):a(t)}},55829:(t,r,e)=>{var o=e(99736),n=e(92360);t.exports=function(t){return n(t)&&"[object Arguments]"==o(t)}},46729:(t,r,e)=>{var o=e(28338),n=e(99678),a=e(11611),s=e(76532),i=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,p=c.toString,f=u.hasOwnProperty,l=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||n(t))&&(o(t)?l:i).test(s(t))}},26972:(t,r,e)=>{var o=e(99736),n=e(84194),a=e(92360),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return a(t)&&n(t.length)&&!!s[o(t)]}},20186:(t,r,e)=>{var o=e(56016),n=e(50962),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!o(t))return n(t);var r=[];for(var e in Object(t))a.call(t,e)&&"constructor"!=e&&r.push(e);return r}},24701:t=>{t.exports=function(t,r){for(var e=-1,o=Array(t);++e<t;)o[e]=r(e);return o}},34282:(t,r,e)=>{var o=e(96539),n=e(66070),a=e(19785),s=e(55193),i=o?o.prototype:void 0,c=i?i.toString:void 0;t.exports=function t(r){if("string"==typeof r)return r;if(a(r))return n(r,t)+"";if(s(r))return c?c.call(r):"";var e=r+"";return"0"==e&&1/r==-1/0?"-0":e}},39334:t=>{t.exports=function(t){return function(r){return t(r)}}},76747:(t,r,e)=>{var o=e(19785),n=e(40318),a=e(23419),s=e(65567);t.exports=function(t,r){return o(t)?t:n(t,r)?[t]:a(s(t))}},64937:(t,r,e)=>{var o=e(77400)["__core-js_shared__"];t.exports=o},39120:(t,r,e)=>{var o="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=o},51385:(t,r,e)=>{var o=e(11324),n=e(83080),a=e(50098);t.exports=function(t){return o(t,a,n)}},95899:(t,r,e)=>{var o=e(54479);t.exports=function(t,r){var e=t.__data__;return o(r)?e["string"==typeof r?"string":"hash"]:e.map}},81822:(t,r,e)=>{var o=e(46729),n=e(15371);t.exports=function(t,r){var e=n(t,r);return o(e)?e:void 0}},34840:(t,r,e)=>{var o=e(96539),n=Object.prototype,a=n.hasOwnProperty,s=n.toString,i=o?o.toStringTag:void 0;t.exports=function(t){var r=a.call(t,i),e=t[i];try{t[i]=void 0;var o=!0}catch(t){}var n=s.call(t);return o&&(r?t[i]=e:delete t[i]),n}},83080:(t,r,e)=>{var o=e(10263),n=e(15937),a=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,i=s?function(t){return null==t?[]:(t=Object(t),o(s(t),(function(r){return a.call(t,r)})))}:n;t.exports=i},3533:(t,r,e)=>{var o=e(82545),n=e(44538),a=e(64825),s=e(46151),i=e(66902),c=e(99736),u=e(76532),p="[object Map]",f="[object Promise]",l="[object Set]",v="[object WeakMap]",h="[object DataView]",y=u(o),_=u(n),b=u(a),x=u(s),d=u(i),j=c;(o&&j(new o(new ArrayBuffer(1)))!=h||n&&j(new n)!=p||a&&j(a.resolve())!=f||s&&j(new s)!=l||i&&j(new i)!=v)&&(j=function(t){var r=c(t),e="[object Object]"==r?t.constructor:void 0,o=e?u(e):"";if(o)switch(o){case y:return h;case _:return p;case b:return f;case x:return l;case d:return v}return r}),t.exports=j},15371:t=>{t.exports=function(t,r){return null==t?void 0:t[r]}},57753:(t,r,e)=>{var o=e(35718);t.exports=function(){this.__data__=o?o(null):{},this.size=0}},82452:t=>{t.exports=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}},22115:(t,r,e)=>{var o=e(35718),n=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;if(o){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return n.call(r,t)?r[t]:void 0}},38256:(t,r,e)=>{var o=e(35718),n=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;return o?void 0!==r[t]:n.call(r,t)}},67426:(t,r,e)=>{var o=e(35718);t.exports=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=o&&void 0===r?"__lodash_hash_undefined__":r,this}},42383:t=>{var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&r.test(t))&&t>-1&&t%1==0&&t<e}},40318:(t,r,e)=>{var o=e(19785),n=e(55193),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,r){if(o(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!n(t))||s.test(t)||!a.test(t)||null!=r&&t in Object(r)}},54479:t=>{t.exports=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t}},99678:(t,r,e)=>{var o,n=e(64937),a=(o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";t.exports=function(t){return!!a&&a in t}},56016:t=>{var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},69417:t=>{t.exports=function(){this.__data__=[],this.size=0}},72470:(t,r,e)=>{var o=e(93382),n=Array.prototype.splice;t.exports=function(t){var r=this.__data__,e=o(r,t);return!(e<0||(e==r.length-1?r.pop():n.call(r,e,1),--this.size,0))}},66165:(t,r,e)=>{var o=e(93382);t.exports=function(t){var r=this.__data__,e=o(r,t);return e<0?void 0:r[e][1]}},71873:(t,r,e)=>{var o=e(93382);t.exports=function(t){return o(this.__data__,t)>-1}},52556:(t,r,e)=>{var o=e(93382);t.exports=function(t,r){var e=this.__data__,n=o(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this}},39448:(t,r,e)=>{var o=e(96586),n=e(36301),a=e(44538);t.exports=function(){this.size=0,this.__data__={hash:new o,map:new(a||n),string:new o}}},7738:(t,r,e)=>{var o=e(95899);t.exports=function(t){var r=o(this,t).delete(t);return this.size-=r?1:0,r}},66575:(t,r,e)=>{var o=e(95899);t.exports=function(t){return o(this,t).get(t)}},7238:(t,r,e)=>{var o=e(95899);t.exports=function(t){return o(this,t).has(t)}},38738:(t,r,e)=>{var o=e(95899);t.exports=function(t,r){var e=o(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this}},2941:(t,r,e)=>{var o=e(16651);t.exports=function(t){var r=o(t,(function(t){return 500===e.size&&e.clear(),t})),e=r.cache;return r}},35718:(t,r,e)=>{var o=e(81822)(Object,"create");t.exports=o},50962:(t,r,e)=>{var o=e(58023)(Object.keys,Object);t.exports=o},18125:(t,r,e)=>{t=e.nmd(t);var o=e(39120),n=r&&!r.nodeType&&r,a=n&&t&&!t.nodeType&&t,s=a&&a.exports===n&&o.process,i=function(){try{return a&&a.require&&a.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=i},21258:t=>{var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},58023:t=>{t.exports=function(t,r){return function(e){return t(r(e))}}},77400:(t,r,e)=>{var o=e(39120),n="object"==typeof self&&self&&self.Object===Object&&self,a=o||n||Function("return this")();t.exports=a},48814:(t,r,e)=>{var o=e(36301);t.exports=function(){this.__data__=new o,this.size=0}},5863:t=>{t.exports=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}},12367:t=>{t.exports=function(t){return this.__data__.get(t)}},90748:t=>{t.exports=function(t){return this.__data__.has(t)}},97569:(t,r,e)=>{var o=e(36301),n=e(44538),a=e(74554);t.exports=function(t,r){var e=this.__data__;if(e instanceof o){var s=e.__data__;if(!n||s.length<199)return s.push([t,r]),this.size=++e.size,this;e=this.__data__=new a(s)}return e.set(t,r),this.size=e.size,this}},23419:(t,r,e)=>{var o=e(2941),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,s=o((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(n,(function(t,e,o,n){r.push(o?n.replace(a,"$1"):e||t)})),r}));t.exports=s},37948:(t,r,e)=>{var o=e(55193);t.exports=function(t){if("string"==typeof t||o(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},76532:t=>{var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},85638:t=>{t.exports=function(t,r){return t===r||t!=t&&r!=r}},99729:(t,r,e)=>{var o=e(79867);t.exports=function(t,r,e){var n=null==t?void 0:o(t,r);return void 0===n?e:n}},2900:(t,r,e)=>{var o=e(55829),n=e(92360),a=Object.prototype,s=a.hasOwnProperty,i=a.propertyIsEnumerable,c=o(function(){return arguments}())?o:function(t){return n(t)&&s.call(t,"callee")&&!i.call(t,"callee")};t.exports=c},19785:t=>{var r=Array.isArray;t.exports=r},80068:(t,r,e)=>{var o=e(28338),n=e(84194);t.exports=function(t){return null!=t&&n(t.length)&&!o(t)}},43854:(t,r,e)=>{t=e.nmd(t);var o=e(77400),n=e(57714),a=r&&!r.nodeType&&r,s=a&&t&&!t.nodeType&&t,i=s&&s.exports===a?o.Buffer:void 0,c=(i?i.isBuffer:void 0)||n;t.exports=c},28338:(t,r,e)=>{var o=e(99736),n=e(11611);t.exports=function(t){if(!n(t))return!1;var r=o(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},84194:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},11611:t=>{t.exports=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}},92360:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},55193:(t,r,e)=>{var o=e(99736),n=e(92360);t.exports=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==o(t)}},48519:(t,r,e)=>{var o=e(26972),n=e(39334),a=e(18125),s=a&&a.isTypedArray,i=s?n(s):o;t.exports=i},50098:(t,r,e)=>{var o=e(98213),n=e(20186),a=e(80068);t.exports=function(t){return a(t)?o(t):n(t)}},16651:(t,r,e)=>{var o=e(74554);function n(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var e=function(){var o=arguments,n=r?r.apply(this,o):o[0],a=e.cache;if(a.has(n))return a.get(n);var s=t.apply(this,o);return e.cache=a.set(n,s)||a,s};return e.cache=new(n.Cache||o),e}n.Cache=o,t.exports=n},15937:t=>{t.exports=function(){return[]}},57714:t=>{t.exports=function(){return!1}},65567:(t,r,e)=>{var o=e(34282);t.exports=function(t){return null==t?"":o(t)}},59312:(t,r,e)=>{"use strict";function o(t,r){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(e[o[n]]=t[o[n]])}return e}function n(t,r,e,o){var n,a=arguments.length,s=a<3?r:null===o?o=Object.getOwnPropertyDescriptor(r,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,r,e,o);else for(var i=t.length-1;i>=0;i--)(n=t[i])&&(s=(a<3?n(s):a>3?n(r,e,s):n(r,e))||s);return a>3&&s&&Object.defineProperty(r,e,s),s}e.d(r,{_T:()=>o,gn:()=>n})}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2924,9852],{22924:(t,e,o)=>{o.r(e),o.d(e,{FormWidget:()=>r,IMetadataFormProvider:()=>g,MetadataFormProvider:()=>v,MetadataFormWidget:()=>_});var a=o(56165),i=o(59361),s=o(89319),l=o.n(s),d=o(78156),n=o.n(d);class r extends a.ReactWidget{constructor(t){super(),this.addClass("jp-FormWidget"),this._props=t}render(){const t={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return n().createElement(i.FormComponent,{validator:l(),schema:this._props.properties,formData:this._props.formData,formContext:t,uiSchema:this._props.uiSchema,liveValidate:!0,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:t=>{this._props.metadataFormWidget.updateMetadata(t.formData||{})},compact:!0,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var h,m=o(44148),p=o(20457),c=o(49255),u=o(20998),f=o(9267);class _ extends m.NotebookTools.Tool{constructor(t){super(),this.updateMetadata=(t,e)=>{var o,a,i,s,l,d,n,r;if(null==this.notebookTools)return;const m=this.notebookTools.activeNotebookPanel,p=this.notebookTools.activeCell;if(null==p)return;this._updatingMetadata=!0;const c={},u={};for(let[e,f]of Object.entries(t)){if(!this.metadataKeys.includes(e))continue;if("notebook"===(null===(o=this._metaInformation[e])||void 0===o?void 0:o.level)&&this._notebookModelNull)continue;if((null===(a=this._metaInformation[e])||void 0===a?void 0:a.cellTypes)&&!(null===(s=null===(i=this._metaInformation[e])||void 0===i?void 0:i.cellTypes)||void 0===s?void 0:s.includes(p.model.type)))continue;let t,_;"notebook"===(null===(l=this._metaInformation[e])||void 0===l?void 0:l.level)?(t=m.model.metadata,_=u):(t=p.model.metadata,_=c);let v=e.replace(/^\/+/,"").replace(/\/+$/,"").split("/"),g=v[0];if(null==g)continue;let b=void 0!==f&&(null===(n=null===(d=this._metaInformation[e])||void 0===d?void 0:d.writeDefault)||void 0===n||n||f!==(null===(r=this._metaInformation[e])||void 0===r?void 0:r.default));if(1==v.length){_[g]=b?f:void 0;continue}let M=v.slice(1,-1),k=v[v.length-1];g in _||(_[g]=t[g]),void 0===_[g]&&(_[g]={});let C=_[g],w=!0;for(let t of M){if(!(t in C)){if(!b){w=!1;break}C[t]={}}C=C[t]}w&&(b?C[k]=f:delete C[k]),b||(_[g]=h.deleteEmptyNested(_[g],v.slice(1)),Object.keys(_[g]).length||(_[g]=void 0))}for(let[t,e]of Object.entries(c))void 0===e?p.model.deleteMetadata(t):p.model.setMetadata(t,e);if(!this._notebookModelNull)for(let[t,e]of Object.entries(u))void 0===e?m.model.deleteMetadata(t):m.model.setMetadata(t,e);this._updatingMetadata=!1,e&&this._update()},this._notebookModelNull=!1,this._metadataSchema=t.metadataSchema,this._metaInformation=t.metaInformation,this._uiSchema=t.uiSchema||{},this._pluginId=t.pluginId,this._showModified=t.showModified||!1,this.translator=t.translator||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._updatingMetadata=!1;const e=this.layout=new f.SingletonLayout,o=document.createElement("div"),a=document.createElement("div");a.textContent=this._trans.__("No metadata."),a.className="jp-MetadataForm-placeholderContent",o.appendChild(a),this._placeholder=new f.Widget({node:o}),this._placeholder.addClass("jp-MetadataForm-placeholder"),e.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var t;const e=[];for(let t of Object.keys(this._metadataSchema.properties))e.push(t);return null===(t=this._metadataSchema.allOf)||void 0===t||t.forEach((t=>{if(void 0!==t.then&&void 0!==t.then.properties){let o=t.then.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}if(void 0!==t.else&&void 0!==t.else.properties){let o=t.else.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}})),e}getProperties(t){return u.JSONExt.deepCopy(this._metadataSchema.properties[t])||null}setProperties(t,e){Object.entries(e).forEach((([e,o])=>{this._metadataSchema.properties[t][e]=o}))}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-MetadataForm-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-MetadataForm-content"),e.widget=t}buildWidget(t){this._form=new r(t),this._form.addClass("jp-MetadataForm"),this.setContent(this._form)}onAfterShow(t){this._update()}onActiveCellChanged(t){this.isVisible&&this._update()}onActiveCellMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelChanged(t){const e=this.notebookTools.activeNotebookPanel;this._notebookModelNull=null===e||null===e.model,!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}_update(){var t,e,o,a,i;const s=this.notebookTools.activeNotebookPanel,l=this.notebookTools.activeCell;if(null==l)return;const d=u.JSONExt.deepCopy(this._metadataSchema),n={};for(let r of Object.keys(this._metadataSchema.properties||u.JSONExt.emptyObject)){if("notebook"===(null===(t=this._metaInformation[r])||void 0===t?void 0:t.level)&&this._notebookModelNull){delete d.properties[r];continue}if((null===(e=this._metaInformation[r])||void 0===e?void 0:e.cellTypes)&&!(null===(a=null===(o=this._metaInformation[r])||void 0===o?void 0:o.cellTypes)||void 0===a?void 0:a.includes(l.model.type))){delete d.properties[r];continue}let h,m=r.replace(/^\/+/,"").replace(/\/+$/,"").split("/");h="notebook"===(null===(i=this._metaInformation[r])||void 0===i?void 0:i.level)?s.model.metadata:l.model.metadata;let p=!0;for(let t of m){if(!(t in h)){p=!1;break}h=h[t]}p&&(n[r]=h)}this.buildWidget({properties:d,settings:new p.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:n,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}!function(t){t.deleteEmptyNested=function t(e,o){let a=o.shift();return void 0!==a&&a in e&&(Object.keys(e[a]).length&&(e[a]=t(e[a],o)),Object.keys(e[a]).length||delete e[a]),e}}(h||(h={}));class v{constructor(){this._items={}}add(t,e){this._items[t]?console.warn(`A MetadataformWidget is already registered with id ${t}`):this._items[t]=e}get(t){if(this._items[t])return this._items[t];console.warn(`There is no MetadataformWidget registered with id ${t}`)}}const g=new u.Token("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2924,9852],{22924:(t,e,o)=>{o.r(e),o.d(e,{FormWidget:()=>r,IMetadataFormProvider:()=>g,MetadataFormProvider:()=>v,MetadataFormWidget:()=>_});var a=o(78036),i=o(70798),s=o(8138),l=o.n(s),d=o(78156),n=o.n(d);class r extends a.ReactWidget{constructor(t){super(),this.addClass("jp-FormWidget"),this._props=t}render(){const t={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return n().createElement(i.FormComponent,{validator:l(),schema:this._props.properties,formData:this._props.formData,formContext:t,uiSchema:this._props.uiSchema,liveValidate:!0,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:t=>{this._props.metadataFormWidget.updateMetadata(t.formData||{})},compact:!0,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var h,m=o(37242),p=o(50727),c=o(5944),u=o(20998),f=o(31516);class _ extends m.NotebookTools.Tool{constructor(t){super(),this.updateMetadata=(t,e)=>{var o,a,i,s,l,d,n,r;if(null==this.notebookTools)return;const m=this.notebookTools.activeNotebookPanel,p=this.notebookTools.activeCell;if(null==p)return;this._updatingMetadata=!0;const c={},u={};for(let[e,f]of Object.entries(t)){if(!this.metadataKeys.includes(e))continue;if("notebook"===(null===(o=this._metaInformation[e])||void 0===o?void 0:o.level)&&this._notebookModelNull)continue;if((null===(a=this._metaInformation[e])||void 0===a?void 0:a.cellTypes)&&!(null===(s=null===(i=this._metaInformation[e])||void 0===i?void 0:i.cellTypes)||void 0===s?void 0:s.includes(p.model.type)))continue;let t,_;"notebook"===(null===(l=this._metaInformation[e])||void 0===l?void 0:l.level)?(t=m.model.metadata,_=u):(t=p.model.metadata,_=c);let v=e.replace(/^\/+/,"").replace(/\/+$/,"").split("/"),g=v[0];if(null==g)continue;let b=void 0!==f&&(null===(n=null===(d=this._metaInformation[e])||void 0===d?void 0:d.writeDefault)||void 0===n||n||f!==(null===(r=this._metaInformation[e])||void 0===r?void 0:r.default));if(1==v.length){_[g]=b?f:void 0;continue}let M=v.slice(1,-1),k=v[v.length-1];g in _||(_[g]=t[g]),void 0===_[g]&&(_[g]={});let C=_[g],w=!0;for(let t of M){if(!(t in C)){if(!b){w=!1;break}C[t]={}}C=C[t]}w&&(b?C[k]=f:delete C[k]),b||(_[g]=h.deleteEmptyNested(_[g],v.slice(1)),Object.keys(_[g]).length||(_[g]=void 0))}for(let[t,e]of Object.entries(c))void 0===e?p.model.deleteMetadata(t):p.model.setMetadata(t,e);if(!this._notebookModelNull)for(let[t,e]of Object.entries(u))void 0===e?m.model.deleteMetadata(t):m.model.setMetadata(t,e);this._updatingMetadata=!1,e&&this._update()},this._notebookModelNull=!1,this._metadataSchema=t.metadataSchema,this._metaInformation=t.metaInformation,this._uiSchema=t.uiSchema||{},this._pluginId=t.pluginId,this._showModified=t.showModified||!1,this.translator=t.translator||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._updatingMetadata=!1;const e=this.layout=new f.SingletonLayout,o=document.createElement("div"),a=document.createElement("div");a.textContent=this._trans.__("No metadata."),a.className="jp-MetadataForm-placeholderContent",o.appendChild(a),this._placeholder=new f.Widget({node:o}),this._placeholder.addClass("jp-MetadataForm-placeholder"),e.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var t;const e=[];for(let t of Object.keys(this._metadataSchema.properties))e.push(t);return null===(t=this._metadataSchema.allOf)||void 0===t||t.forEach((t=>{if(void 0!==t.then&&void 0!==t.then.properties){let o=t.then.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}if(void 0!==t.else&&void 0!==t.else.properties){let o=t.else.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}})),e}getProperties(t){return u.JSONExt.deepCopy(this._metadataSchema.properties[t])||null}setProperties(t,e){Object.entries(e).forEach((([e,o])=>{this._metadataSchema.properties[t][e]=o}))}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-MetadataForm-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-MetadataForm-content"),e.widget=t}buildWidget(t){this._form=new r(t),this._form.addClass("jp-MetadataForm"),this.setContent(this._form)}onAfterShow(t){this._update()}onActiveCellChanged(t){this.isVisible&&this._update()}onActiveCellMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelChanged(t){const e=this.notebookTools.activeNotebookPanel;this._notebookModelNull=null===e||null===e.model,!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}_update(){var t,e,o,a,i;const s=this.notebookTools.activeNotebookPanel,l=this.notebookTools.activeCell;if(null==l)return;const d=u.JSONExt.deepCopy(this._metadataSchema),n={};for(let r of Object.keys(this._metadataSchema.properties||u.JSONExt.emptyObject)){if("notebook"===(null===(t=this._metaInformation[r])||void 0===t?void 0:t.level)&&this._notebookModelNull){delete d.properties[r];continue}if((null===(e=this._metaInformation[r])||void 0===e?void 0:e.cellTypes)&&!(null===(a=null===(o=this._metaInformation[r])||void 0===o?void 0:o.cellTypes)||void 0===a?void 0:a.includes(l.model.type))){delete d.properties[r];continue}let h,m=r.replace(/^\/+/,"").replace(/\/+$/,"").split("/");h="notebook"===(null===(i=this._metaInformation[r])||void 0===i?void 0:i.level)?s.model.metadata:l.model.metadata;let p=!0;for(let t of m){if(!(t in h)){p=!1;break}h=h[t]}p&&(n[r]=h)}this.buildWidget({properties:d,settings:new p.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:n,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}!function(t){t.deleteEmptyNested=function t(e,o){let a=o.shift();return void 0!==a&&a in e&&(Object.keys(e[a]).length&&(e[a]=t(e[a],o)),Object.keys(e[a]).length||delete e[a]),e}}(h||(h={}));class v{constructor(){this._items={}}add(t,e){this._items[t]?console.warn(`A MetadataformWidget is already registered with id ${t}`):this._items[t]=e}get(t){if(this._items[t])return this._items[t];console.warn(`There is no MetadataformWidget registered with id ${t}`)}}const g=new u.Token("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets.")}}]);