@datalayer/agent-runtimes 1.6.38 → 1.6.40

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.
Files changed (171) hide show
  1. package/dist-embed/chunks/{AgentDetails-Ba3DRn2p.js → AgentDetails-DC7O2VWb.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-CXN0RO_L.js → AgentDetailsDialog-BTJCl-o-.js} +1 -1
  3. package/dist-embed/chunks/{AgentInspector-C66D0b0W.js → AgentInspector-BXqYY8g-.js} +1 -1
  4. package/dist-embed/chunks/{AgentInspectorDialog-DeK96QG1.js → AgentInspectorDialog-dRHZ1p73.js} +1 -1
  5. package/dist-embed/chunks/Avatar-Cv5OpUWu.js +1 -0
  6. package/dist-embed/chunks/{CellSidebarExtension-D7aXShZc.js → CellSidebarExtension-DXPIz0Km.js} +7 -7
  7. package/dist-embed/chunks/{ChatView-2N7PbcDs.js → ChatView-CRitAB2i.js} +4 -4
  8. package/dist-embed/chunks/{CollapsiblePlugin-y8sx_FL8.js → CollapsiblePlugin-BPlfrDQU.js} +1 -1
  9. package/dist-embed/chunks/DatalayerAgentBridge-D01Ek4NE.js +1 -0
  10. package/dist-embed/chunks/{DeckComponent-BnyeYRQq.js → DeckComponent-jvb83Q__.js} +1 -1
  11. package/dist-embed/chunks/{DocumentView-DT4DcdJI.js → DocumentView-BrdFnTVh.js} +3 -3
  12. package/dist-embed/chunks/{EphemeralDocument-CGISw1N3.js → EphemeralDocument-CkPQKyfy.js} +1 -1
  13. package/dist-embed/chunks/{EphemeralNotebook-Dyx-25uN.js → EphemeralNotebook-CiQIC3MG.js} +1 -1
  14. package/dist-embed/chunks/{ExcalidrawComponent-Bl3R2Mic.js → ExcalidrawComponent-D6Cr_b0Z.js} +1 -1
  15. package/dist-embed/chunks/{ExcalidrawModal-DSL5jBhG.js → ExcalidrawModal-Bso7oDbl.js} +1 -1
  16. package/dist-embed/chunks/{JupyterLexicalExtension-C55KdpCk.js → JupyterLexicalExtension-DuD7IV6j.js} +6 -6
  17. package/dist-embed/chunks/{KernelVariables-D3DSQaD3.js → KernelVariables-CXQagESp.js} +2 -2
  18. package/dist-embed/chunks/{NotebookSkeleton-BkzTMhIX.js → NotebookSkeleton-CvO9WylK.js} +1 -1
  19. package/dist-embed/chunks/{NotebookToolSurfaces-Bvj9nwA9.js → NotebookToolSurfaces-B9fkzQNR.js} +1 -1
  20. package/dist-embed/chunks/{NotebookToolbar-BMjQTGrr.js → NotebookToolbar-D36duUxK.js} +1 -1
  21. package/dist-embed/chunks/{NotebookView-DRPnBAI2.js → NotebookView-BrdHwtKH.js} +1 -1
  22. package/dist-embed/chunks/{Output-D-7eUege.js → Output-D9cwH5rg.js} +1 -1
  23. package/dist-embed/chunks/{SandboxDetailsDialog-qJBg2naH.js → SandboxDetailsDialog-BYgLjg3W.js} +1 -1
  24. package/dist-embed/chunks/{SchemaForm-D6BAKaNe.js → SchemaForm-B3qMIWMy.js} +1 -1
  25. package/dist-embed/chunks/{SheetTabs-BLaEhX0D.js → SheetTabs-BR72mzuo.js} +2 -2
  26. package/dist-embed/chunks/{SpreadsheetPreviewView-CaFQASZ4.js → SpreadsheetPreviewView-RA8ASTBV.js} +1 -1
  27. package/dist-embed/chunks/{SpreadsheetView-DesdGLpm.js → SpreadsheetView-BfScdA-X.js} +1 -1
  28. package/dist-embed/chunks/{Toolbar-BncUh2ly.js → Toolbar-BAjGB6b-.js} +1 -1
  29. package/dist-embed/chunks/{WidgetVariableView-B4faSdWW.js → WidgetVariableView-7lvDcxCg.js} +1 -1
  30. package/dist-embed/chunks/{YouTubePlugin-BPUrB3sh.js → YouTubePlugin-BbjCzaT_.js} +1 -1
  31. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Dq_tRQtR.js → ar-SA-G6X2FPQ2-D4M2b5Lr.js} +1 -1
  32. package/dist-embed/chunks/{az-AZ-76LH7QW2-DQAoJi9C.js → az-AZ-76LH7QW2-Rn7oINhz.js} +1 -1
  33. package/dist-embed/chunks/{bg-BG-XCXSNQG7-CfZUFj2_.js → bg-BG-XCXSNQG7-xztohKe7.js} +1 -1
  34. package/dist-embed/chunks/{bn-BD-2XOGV67Q-DiqZdhkT.js → bn-BD-2XOGV67Q-C7Ssg1_2.js} +1 -1
  35. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-B6c2PcO9.js → ca-ES-6MX7JW3Y-Cr0zd8Z6.js} +1 -1
  36. package/dist-embed/chunks/{celltoolbartracker-BHSFiiuz.js → celltoolbartracker-D1C_kGQL.js} +1 -1
  37. package/dist-embed/chunks/{component-BUTWfiVL.js → component-CmnuUtgX.js} +3 -3
  38. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-ha7l75va.js → cs-CZ-2BRQDIVT-G9tBUkZh.js} +1 -1
  39. package/dist-embed/chunks/{da-DK-5WZEPLOC-C3b8_hbR.js → da-DK-5WZEPLOC-91_vyLpq.js} +1 -1
  40. package/dist-embed/chunks/{de-DE-XR44H4JA-CxWFSn3l.js → de-DE-XR44H4JA-Bb9tvIZa.js} +1 -1
  41. package/dist-embed/chunks/{dist-BF0YFIb6.js → dist-B5YvY_O1.js} +2 -2
  42. package/dist-embed/chunks/{dist-DsEDq9qF.js → dist-BBqWTRLi.js} +1 -1
  43. package/dist-embed/chunks/{dist-DRRbvr4-.js → dist-BC_2VyAM.js} +1 -1
  44. package/dist-embed/chunks/{dist-B_TGJsfl.js → dist-BhfyuH1D.js} +1 -1
  45. package/dist-embed/chunks/{dist-Cfvz7CF7.js → dist-BlIg6ytm.js} +1 -1
  46. package/dist-embed/chunks/{dist-COiURBxL.js → dist-Ct-bkqXx.js} +4 -4
  47. package/dist-embed/chunks/{dist-tosaS6vh.js → dist-CtFgtNKe.js} +1 -1
  48. package/dist-embed/chunks/{dist-B1tXS8Wo.js → dist-DLyNQ3Jj.js} +1 -1
  49. package/dist-embed/chunks/{document-CqNE0DPx.js → document-Dp0KpIjg.js} +1 -1
  50. package/dist-embed/chunks/{drivecontents-D1HzL7Fi.js → drivecontents-BsC6Y2Vl.js} +1 -1
  51. package/dist-embed/chunks/{el-GR-BZB4AONW-iSsL6em8.js → el-GR-BZB4AONW-B5kc3JC5.js} +1 -1
  52. package/dist-embed/chunks/{es-ES-U4NZUMDT-BEbh9GGw.js → es-ES-U4NZUMDT-CpFB18Kf.js} +1 -1
  53. package/dist-embed/chunks/{esm-RWOqF6ly.js → esm-BqqxV5QL.js} +1 -1
  54. package/dist-embed/chunks/{eu-ES-A7QVB2H4-C7o7R9hc.js → eu-ES-A7QVB2H4-CqCALK0Q.js} +1 -1
  55. package/dist-embed/chunks/{fa-IR-HGAKTJCU-DQNpeHKi.js → fa-IR-HGAKTJCU-BzSY8fri.js} +1 -1
  56. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-D083iC1R.js → fi-FI-Z5N7JZ37-DPRPVT_v.js} +1 -1
  57. package/dist-embed/chunks/{fr-FR-RHASNOE6-CUvaq7hG.js → fr-FR-RHASNOE6-Cr4lVSvD.js} +1 -1
  58. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DU31KRvC.js → gl-ES-HMX3MZ6V-CZUw7dN0.js} +1 -1
  59. package/dist-embed/chunks/{he-IL-6SHJWFNN-bMtU7JNY.js → he-IL-6SHJWFNN-DaU5Odek.js} +1 -1
  60. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-Pma0rKxO.js → hi-IN-IWLTKZ5I-BZ84Rooc.js} +1 -1
  61. package/dist-embed/chunks/{htmlselect-CqXICb9e.js → htmlselect-5N6NdDqL.js} +1 -1
  62. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-Dof3afSc.js → hu-HU-A5ZG7DT2-SZiCSe0B.js} +1 -1
  63. package/dist-embed/chunks/{id-ID-SAP4L64H-ZwqZHBDj.js → id-ID-SAP4L64H-DrRa3vVi.js} +1 -1
  64. package/dist-embed/chunks/{index-9EhrHHj7.js → index-B6-uQd5L.js} +3 -3
  65. package/dist-embed/chunks/{index-9wJFadG-.js → index-CEeyR3FZ.js} +1 -1
  66. package/dist-embed/chunks/{index-CqP3xLL5.js → index-CKWSKbHe.js} +1 -1
  67. package/dist-embed/chunks/{index-BbcMy3Al.js → index-DpN8KK6c.js} +1 -1
  68. package/dist-embed/chunks/{index--S8WFITA.js → index-JmqWOkdt.js} +1 -1
  69. package/dist-embed/chunks/{index-CMhceBby.js → index-PKH5uAl-.js} +1 -1
  70. package/dist-embed/chunks/{index-C7UsrKrP.js → index-hhftmReh.js} +1 -1
  71. package/dist-embed/chunks/{index-6zxBQeM_.js → index-qhxI1VzX.js} +2 -2
  72. package/dist-embed/chunks/{index.esm-xgVG4GIx.js → index.esm-Bvtnemp7.js} +1 -1
  73. package/dist-embed/chunks/{it-IT-JPQ66NNP-C-uM6NhO.js → it-IT-JPQ66NNP-_TEhDIcF.js} +1 -1
  74. package/dist-embed/chunks/{ja-JP-DBVTYXUO-qzihtLnX.js → ja-JP-DBVTYXUO-IJaTVgTb.js} +1 -1
  75. package/dist-embed/chunks/{kaa-6HZHGXH3-Amx_Jfx0.js → kaa-6HZHGXH3-CTksAiLJ.js} +1 -1
  76. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-BPZfDYRT.js → kab-KAB-ZGHBKWFO-DbA7aOfU.js} +1 -1
  77. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-B83bJ3Yw.js → kk-KZ-P5N5QNE5-Bdzg30AB.js} +1 -1
  78. package/dist-embed/chunks/{km-KH-HSX4SM5Z-BvPDwBVw.js → km-KH-HSX4SM5Z-Bwn2NP1-.js} +1 -1
  79. package/dist-embed/chunks/{ko-KR-MTYHY66A-jpQ_OpzG.js → ko-KR-MTYHY66A-KUaxlo0q.js} +1 -1
  80. package/dist-embed/chunks/{ku-TR-6OUDTVRD-RsfwTm7i.js → ku-TR-6OUDTVRD-DRegsFXo.js} +1 -1
  81. package/dist-embed/chunks/{lib-CFx15o08.js → lib--J3JPp2K.js} +1 -1
  82. package/dist-embed/chunks/{lib-D6X8UF4a.js → lib-9S57siQD.js} +1 -1
  83. package/dist-embed/chunks/{lib-CoK70EWs.js → lib-BpltV-0Y.js} +1 -1
  84. package/dist-embed/chunks/{lib-DGhrI5Uw.js → lib-C2mgrsS1.js} +1 -1
  85. package/dist-embed/chunks/{lib-XSPvEMl2.js → lib-C46CpvHb.js} +1 -1
  86. package/dist-embed/chunks/{lib-D0Q8IWel.js → lib-CHID83aM.js} +1 -1
  87. package/dist-embed/chunks/{lib-Pqxz_81N.js → lib-COJY2oKd.js} +25 -25
  88. package/dist-embed/chunks/{lib-p7v7zGkv.js → lib-CQeoQJWp.js} +1 -1
  89. package/dist-embed/chunks/{lib-CdtiDxdA.js → lib-CjBEbEzm.js} +1 -1
  90. package/dist-embed/chunks/{lib-BBnVlTAj.js → lib-Cpc8Fspj.js} +1 -1
  91. package/dist-embed/chunks/{lib-CsiCQ8oM.js → lib-D7CvuX1J.js} +1 -1
  92. package/dist-embed/chunks/{lib-7ge2Kma3.js → lib-DOnguzJf.js} +1 -1
  93. package/dist-embed/chunks/{lib-UYAFV0Oh.js → lib-Dh9o1esj.js} +1 -1
  94. package/dist-embed/chunks/{lib-DdeRC7g0.js → lib-DrEcjKb5.js} +1 -1
  95. package/dist-embed/chunks/{lib-Dj12Ge-1.js → lib-PbTUB5SW.js} +1 -1
  96. package/dist-embed/chunks/{lib-DMy40SOL.js → lib-QmOij8gS.js} +1 -1
  97. package/dist-embed/chunks/{lib-C7Y61LM1.js → lib-csBGF1d0.js} +1 -1
  98. package/dist-embed/chunks/{lib-DTyx2eLX.js → lib-op0DTswa.js} +1 -1
  99. package/dist-embed/chunks/{lib-CkcilPdy.js → lib-ox3VOLDA.js} +1 -1
  100. package/dist-embed/chunks/{lib-Bi95m_cb.js → lib-rn9DpcHi.js} +1 -1
  101. package/dist-embed/chunks/{lt-LT-XHIRWOB4-qZ_KjUTQ.js → lt-LT-XHIRWOB4-c6CdaS7u.js} +1 -1
  102. package/dist-embed/chunks/{lv-LV-5QDEKY6T-BOKJbljG.js → lv-LV-5QDEKY6T-D9RognOk.js} +1 -1
  103. package/dist-embed/chunks/{model-C2VRzh1c.js → model-DbDJZyri.js} +1 -1
  104. package/dist-embed/chunks/{mr-IN-CRQNXWMA-xba6p6AI.js → mr-IN-CRQNXWMA-ht3P_mrN.js} +1 -1
  105. package/dist-embed/chunks/{my-MM-5M5IBNSE-B_H0GaRX.js → my-MM-5M5IBNSE-CsIkhWRp.js} +1 -1
  106. package/dist-embed/chunks/{nb-NO-T6EIAALU-Ddg4NpHf.js → nb-NO-T6EIAALU-DJw7Uvbx.js} +1 -1
  107. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-DS_Sofox.js → nl-NL-IS3SIHDZ-Dcrp-zwB.js} +1 -1
  108. package/dist-embed/chunks/{nn-NO-6E72VCQL-CYSB6TTi.js → nn-NO-6E72VCQL-DaBAIbM9.js} +1 -1
  109. package/dist-embed/chunks/{oc-FR-POXYY2M6-QrIn4XvF.js → oc-FR-POXYY2M6-DSdMEDCa.js} +1 -1
  110. package/dist-embed/chunks/{pa-IN-N4M65BXN-BbacRfk_.js → pa-IN-N4M65BXN-BMyPito1.js} +1 -1
  111. package/dist-embed/chunks/{percentages-BXMCSKIN-TyKhSuec.js → percentages-BXMCSKIN-pswfKMt2.js} +3 -3
  112. package/dist-embed/chunks/{pl-PL-T2D74RX3-Cn2ehrU4.js → pl-PL-T2D74RX3-CFk8rHgP.js} +1 -1
  113. package/dist-embed/chunks/{plugin-CPCdQWpK.js → plugin-BpyrQiv7.js} +1 -1
  114. package/dist-embed/chunks/{plugin-D7Giq2rW.js → plugin-NcgdmcAO.js} +1 -1
  115. package/dist-embed/chunks/{plugin-AdqytlNC.js → plugin-omHCT1Jk.js} +1 -1
  116. package/dist-embed/chunks/{pt-BR-5N22H2LF-CpNtiBPh.js → pt-BR-5N22H2LF-BYlDcalT.js} +1 -1
  117. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-CcDR3Igq.js → pt-PT-UZXXM6DQ-xXdoFOOb.js} +1 -1
  118. package/dist-embed/chunks/{pyodide-kernel-CN7B4QLg.js → pyodide-kernel-bjLdubpe.js} +1 -1
  119. package/dist-embed/chunks/{pyodide-kernel-extension-CKE5jq9F.js → pyodide-kernel-extension-CshyO6Mm.js} +1 -1
  120. package/dist-embed/chunks/{renderer-8__rsP1H.js → renderer-We9CyR7b.js} +1 -1
  121. package/dist-embed/chunks/{ro-RO-JPDTUUEW-CANXxss1.js → ro-RO-JPDTUUEW-e-URCww-.js} +1 -1
  122. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-B_NkKbWo.js → ru-RU-B4JR7IUQ-CrXBOpZl.js} +1 -1
  123. package/dist-embed/chunks/{server-extension-BvlUJPbJ.js → server-extension-D9R-wwz5.js} +1 -1
  124. package/dist-embed/chunks/{sessions-CgjtuOSm.js → sessions-DdXtI_C1.js} +1 -1
  125. package/dist-embed/chunks/{si-LK-N5RQ5JYF-Da_Bg8Mv.js → si-LK-N5RQ5JYF-DmJK04-A.js} +1 -1
  126. package/dist-embed/chunks/{sk-SK-C5VTKIMK-BKs6l_DT.js → sk-SK-C5VTKIMK-BDHycW1Q.js} +1 -1
  127. package/dist-embed/chunks/{sl-SI-NN7IZMDC-C4TvSXZU.js → sl-SI-NN7IZMDC-Bv9ZQTNb.js} +1 -1
  128. package/dist-embed/chunks/{subset-shared.chunk-BZGTZU2h.js → subset-shared.chunk-B0WCMaCa.js} +1 -1
  129. package/dist-embed/chunks/{subset-worker.chunk-CNJFtQV7.js → subset-worker.chunk-i0SNRqXr.js} +1 -1
  130. package/dist-embed/chunks/{sv-SE-XGPEYMSR-DdKzikID.js → sv-SE-XGPEYMSR-_HPzcZFc.js} +1 -1
  131. package/dist-embed/chunks/{ta-IN-2NMHFXQM-CDzGLNXS.js → ta-IN-2NMHFXQM-Ccvi-lqm.js} +1 -1
  132. package/dist-embed/chunks/{th-TH-HPSO5L25-X4BJ7awj.js → th-TH-HPSO5L25-DvAg4Mv1.js} +1 -1
  133. package/dist-embed/chunks/{tokens-CBhRbpQP.js → tokens-CTXFWLvM.js} +1 -1
  134. package/dist-embed/chunks/{tr-TR-DEFEU3FU-CN69_6_H.js → tr-TR-DEFEU3FU-DJsjfrja.js} +1 -1
  135. package/dist-embed/chunks/{uk-UA-QMV73CPH-KjB2cySI.js → uk-UA-QMV73CPH-3fvexlQA.js} +1 -1
  136. package/dist-embed/chunks/{usePrimerThemeBridge-DyX4EYyN.js → usePrimerThemeBridge-NsTRGuo7.js} +1 -1
  137. package/dist-embed/chunks/{vi-VN-M7AON7JQ-BqVSbGWG.js → vi-VN-M7AON7JQ-BoQ3ayAr.js} +1 -1
  138. package/dist-embed/chunks/{zh-CN-LNUGB5OW-oRPI4tbl.js → zh-CN-LNUGB5OW-Dzh0Ni_q.js} +1 -1
  139. package/dist-embed/chunks/{zh-HK-E62DVLB3-BUlz3y0i.js → zh-HK-E62DVLB3-_1FpSc_d.js} +1 -1
  140. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-NxjUwhr3.js → zh-TW-RAJ6MFWO-CU-R8eF0.js} +1 -1
  141. package/dist-embed/datalayer-app-main.js +154 -154
  142. package/lib/apps/apps/AppRenderer.d.ts +6 -0
  143. package/lib/apps/apps/AppRenderer.js +3 -0
  144. package/lib/apps/plugins/agents/DatalayerAgentBridge.js +10 -3
  145. package/lib/apps/plugins/agents/SandboxSelector.js +1 -1
  146. package/lib/apps/plugins/agents/appLaunch.js +12 -0
  147. package/lib/apps/plugins/agents/handoffRuntime.d.ts +36 -0
  148. package/lib/apps/plugins/agents/handoffRuntime.js +50 -0
  149. package/lib/apps/plugins/agents/plugin.d.ts +20 -6
  150. package/lib/apps/plugins/agents/plugin.js +1 -0
  151. package/lib/apps/plugins/agents/switchable.d.ts +14 -2
  152. package/lib/apps/plugins/agents/switchable.js +13 -3
  153. package/lib/hooks/useAgentRuntimes.d.ts +1 -1
  154. package/lib/hooks/useAgentRuntimes.js +2 -0
  155. package/lib/loop-main.js +27 -25
  156. package/lib/portable/hosts/agentClient.d.ts +9 -9
  157. package/lib/portable/hosts/agentClient.js +34 -8
  158. package/lib/portable/hosts/contracts.json +3 -28
  159. package/lib/portable/hosts/index.d.ts +0 -1
  160. package/lib/portable/hosts/index.js +0 -1
  161. package/lib/runtimes/actions.js +6 -0
  162. package/lib/runtimes/apis.d.ts +8 -0
  163. package/lib/specs/agents/agents.js +1 -1
  164. package/lib/types/agents-lifecycle.d.ts +7 -0
  165. package/lib/types/agentspecs.d.ts +9 -4
  166. package/lib/types/agentspecs.js +7 -1
  167. package/package.json +1 -1
  168. package/dist-embed/chunks/Avatar-MNx1kN3F.js +0 -1
  169. package/dist-embed/chunks/DatalayerAgentBridge-BmoysA2b.js +0 -1
  170. package/lib/portable/hosts/sessionUid.d.ts +0 -9
  171. package/lib/portable/hosts/sessionUid.js +0 -29
@@ -1,4 +1,4 @@
1
- import{iR as ge,iS as oe,iT as H,iU as fe,iV as be,iW as ne,iX as ve,iY as se,iZ as ie,i_ as b,i$ as D,j0 as C,j1 as xe,j2 as ye,j3 as Ce,j4 as $e,j5 as Te,j6 as we,j7 as _e,j8 as Ie,j9 as je,ja as ke,jb as Fe,jc as P,jd as U,je as q,jf as Se,jg as G,jh as J,ji as R,jj as K,jk as Z,jl as O,jm as Ee,jn as Ne,jo as I,jp as Oe,jq as He,jr as y,js as Q,jt as Ae,ju as Be,jv as j,jw as De,jx as Ve,jy as Me,jz as Pe,jA as ae,jB as k,jC as Le,jD as p,jE as Re,jF as le,jG as re,jH as We,r as h,jI as X,jJ as A,J as de,jK as ce,cp as ze,bf as Ue,aA as qe,ay as Ge,e0 as he,aC as Je,jL as Ke,aD as Ze,cm as Qe,jM as Xe,jN as Ye,jO as et,jP as tt,eD as Y,aI as ot,dz as nt,jQ as st}from"../datalayer-app-main.js";import{S as it,f as at,c as lt,M as rt}from"./index-9EhrHHj7.js";import{I as dt}from"./tokens-DY_UrMLq.js";import"./Output-D-7eUege.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-D7aXShZc.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-DyX4EYyN.js";import"./index-BbcMy3Al.js";import"./KernelVariables-D3DSQaD3.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-BMjQTGrr.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./sessions-CgjtuOSm.js";import"./tokens-CBhRbpQP.js";import"./drivecontents-D1HzL7Fi.js";import"./kernel-BmfZmtIo.js";const ue=o=>typeof o=="function",ct=()=>null;function ee(o){return o===void 0?ct:ue(o)?o:()=>o}function te(o,t,e){const n=ue(o)?o:()=>o,d=ee(t),m=ee(e);return(r,l)=>n(r,l)?d(r,l):m(r,l)}const ht=(o,t)=>H`
1
+ import{iR as ge,iS as oe,iT as H,iU as fe,iV as be,iW as ne,iX as ve,iY as se,iZ as ie,i_ as b,i$ as D,j0 as C,j1 as xe,j2 as ye,j3 as Ce,j4 as $e,j5 as Te,j6 as we,j7 as _e,j8 as Ie,j9 as je,ja as ke,jb as Fe,jc as P,jd as U,je as q,jf as Se,jg as G,jh as J,ji as R,jj as K,jk as Z,jl as O,jm as Ee,jn as Ne,jo as I,jp as Oe,jq as He,jr as y,js as Q,jt as Ae,ju as Be,jv as j,jw as De,jx as Ve,jy as Me,jz as Pe,jA as ae,jB as k,jC as Le,jD as p,jE as Re,jF as le,jG as re,jH as We,r as h,jI as X,jJ as A,J as de,jK as ce,ci as ze,bf as Ue,aA as qe,ay as Ge,e0 as he,aC as Je,jL as Ke,aD as Ze,cf as Qe,jM as Xe,jN as Ye,jO as et,jP as tt,eD as Y,aI as ot,dz as nt,jQ as st}from"../datalayer-app-main.js";import{S as it,f as at,c as lt,M as rt}from"./index-B6-uQd5L.js";import{I as dt}from"./tokens-DY_UrMLq.js";import"./Output-D9cwH5rg.js";import"./index-JmqWOkdt.js";import"./hoverbox-CStlKQWE.js";import"./index-qhxI1VzX.js";import"./index-CEeyR3FZ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-DXPIz0Km.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-We9CyR7b.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DpN8KK6c.js";import"./KernelVariables-CXQagESp.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-D36duUxK.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BAjGB6b-.js";import"./sessions-DdXtI_C1.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";const ue=o=>typeof o=="function",ct=()=>null;function ee(o){return o===void 0?ct:ue(o)?o:()=>o}function te(o,t,e){const n=ue(o)?o:()=>o,d=ee(t),m=ee(e);return(r,l)=>n(r,l)?d(r,l):m(r,l)}const ht=(o,t)=>H`
2
2
  <template
3
3
  role="treeitem"
4
4
  slot="${e=>e.isNestedItem()?"item":void 0}"
@@ -1,4 +1,4 @@
1
- import{aE as N,aF as R,aD as S,aw as pe,a9 as me,ck as C,ay as Q,bg as ee,aC as I,aI as ge,dt as fe,aG as be,du as ve,r as k,ct as Z,aK as ye,cy as O,cn as q,dv as he,dw as _e,aA as we,dx as xe,dy as U}from"../datalayer-app-main.js";import{I as Te,S as Be}from"./index-CMhceBby.js";import{I as V}from"./tokens-DY_UrMLq.js";import{I as Pe,b as te,d as Ee,M as X}from"./index--S8WFITA.js";import{I as je}from"./treepathupdater-DiwXSt-s.js";import{d as Me,e as K,J as H,c as J,f as oe,g as ie,h as $,i as Ce,L as ne,j as Le}from"./index-9EhrHHj7.js";import{R as Ae}from"./menu-Ntu8pEH0.js";import"./hoverbox-CStlKQWE.js";import"./Output-D-7eUege.js";import"./index-6zxBQeM_.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-D7aXShZc.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-DyX4EYyN.js";import"./index-BbcMy3Al.js";import"./KernelVariables-D3DSQaD3.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-BMjQTGrr.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./sessions-CgjtuOSm.js";import"./tokens-CBhRbpQP.js";import"./drivecontents-D1HzL7Fi.js";import"./kernel-BmfZmtIo.js";const Ie=async function(i,m,d){d=d||S;const t=d.load("jupyterlab"),u=t.__("Server Connection Error"),r=t.__(`A connection to the Jupyter server could not be established.
1
+ import{aE as N,aF as R,aD as S,aw as pe,a9 as me,cd as C,ay as Q,bg as ee,aC as I,aI as ge,dt as fe,aG as be,du as ve,r as k,cm as Z,aK as ye,cr as O,cg as q,dv as he,dw as _e,aA as we,dx as xe,dy as U}from"../datalayer-app-main.js";import{I as Te,S as Be}from"./index-PKH5uAl-.js";import{I as V}from"./tokens-DY_UrMLq.js";import{I as Pe,b as te,d as Ee,M as X}from"./index-JmqWOkdt.js";import{I as je}from"./treepathupdater-DiwXSt-s.js";import{d as Me,e as K,J as H,c as J,f as oe,g as ie,h as $,i as Ce,L as ne,j as Le}from"./index-B6-uQd5L.js";import{R as Ae}from"./menu-Ntu8pEH0.js";import"./hoverbox-CStlKQWE.js";import"./Output-D9cwH5rg.js";import"./index-qhxI1VzX.js";import"./index-CEeyR3FZ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-DXPIz0Km.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-We9CyR7b.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DpN8KK6c.js";import"./KernelVariables-CXQagESp.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-D36duUxK.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BAjGB6b-.js";import"./sessions-DdXtI_C1.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";const Ie=async function(i,m,d){d=d||S;const t=d.load("jupyterlab"),u=t.__("Server Connection Error"),r=t.__(`A connection to the Jupyter server could not be established.
2
2
  JupyterLab will continue trying to reconnect.
3
3
  Check your network connection or Jupyter server configuration.
4
4
  `);if(!F.displayConnectionLost)return;if(F.serverConnectionLost){await F.serverConnectionLost;return}const n=N({title:u,body:r,checkbox:{label:t.__("Do not show this message again in this session."),caption:t.__("If checked, you will not see a dialog informing you about an issue with server connection in this session.")},buttons:[R.cancelButton({label:t.__("Close")})]}).then(f=>{f.isChecked&&(F.displayConnectionLost=!1)}).catch(f=>{console.error("An error occurred while showing the dialog: ",f)}).finally(()=>{F.serverConnectionLost=void 0});F.serverConnectionLost=n};var F;(function(i){i.displayConnectionLost=!0})(F||(F={}));class Re{constructor(m){this.stop=new pe("@jupyterlab/application:Router#stop"),this._routed=new me(this),this._rules=new Map,this.base=m.base,this.commands=m.commands}get current(){var m,d;const{base:t}=this,u=C.URLExt.parse(window.location.href),{search:r,hash:n}=u,f=(d=(m=u.pathname)===null||m===void 0?void 0:m.replace(t,"/"))!==null&&d!==void 0?d:"",a=f+r+n;return{hash:n,path:f,request:a,search:r}}get routed(){return this._routed}navigate(m,d={}){const{base:t}=this,{history:u}=window,{hard:r}=d,n=document.location.href,f=m&&m.indexOf(t)===0?m:C.URLExt.join(t,m);if(f===n)return r?this.reload():void 0;if(u.pushState({},"",f),r)return this.reload();d.skipRouting||requestAnimationFrame(()=>{this.route()})}register(m){var d;const{command:t,pattern:u}=m,r=(d=m.rank)!==null&&d!==void 0?d:100,n=this._rules;return n.set(u,{command:t,rank:r}),new Q(()=>{n.delete(u)})}reload(){window.location.reload()}route(){const{commands:m,current:d,stop:t}=this,{request:u}=d,r=this._routed,n=this._rules,f=[];n.forEach((b,p)=>{u?.match(p)&&f.push(b)});const a=f.sort((b,p)=>p.rank-b.rank),w=new ee,h=async()=>{if(!a.length){r.emit(d),w.resolve(void 0);return}const{command:b}=a.pop();try{const p=this.current.request;await m.execute(b,d)===t&&(a.length=0,console.debug(`Routing ${p} was short-circuited by ${b}`))}catch(p){console.warn(`Routing ${u} to ${b} failed`,p)}h()};return h(),w.promise}}const We="TopBar",re={id:"@jupyterlab/application-extension:top-bar",description:"Adds a toolbar to the top area (next to the main menu bar).",autoStart:!0,requires:[V,Pe],optional:[I],activate:(i,m,d,t)=>{const u=(t??S).load("jupyterlab"),r=new ge;r.id="jp-top-bar",r.node.setAttribute("aria-label",u.__("Topbar toolbar")),fe(r,be(d,m,We,re.id,t??S),r),i.shell.add(r,"top",{rank:900})}},G=100;var l;(function(i){i.activateNextTab="application:activate-next-tab",i.activatePreviousTab="application:activate-previous-tab",i.activateNextTabBar="application:activate-next-tab-bar",i.activatePreviousTabBar="application:activate-previous-tab-bar",i.close="application:close",i.closeOtherTabs="application:close-other-tabs",i.closeRightTabs="application:close-right-tabs",i.closeAll="application:close-all",i.setActivityBarPosition="application:set-activity-bar-position",i.moveWidget="application:move-widget",i.setMode="application:set-mode",i.showPropertyPanel="property-inspector:show-panel",i.resetLayout="application:reset-layout",i.toggleContextMenu="application:toggle-context-menu",i.toggleHeader="application:toggle-header",i.toggleMode="application:toggle-mode",i.toggleLeftArea="application:toggle-left-area",i.toggleRightArea="application:toggle-right-area",i.toggleDownArea="application:toggle-down-area",i.toggleSideTabBar="application:toggle-side-tabbar",i.toggleSidebarWidget="application:toggle-sidebar-widget",i.togglePresentationMode="application:toggle-presentation-mode",i.toggleFullscreenMode="application:toggle-fullscreen-mode",i.tree="router:tree",i.switchSidebar="sidebar:switch",i.splitTab="application:split-tab",i.zoomInWidget="application:zoom-in-widget",i.zoomOutWidget="application:zoom-out-widget",i.resetWidgetZoom="application:reset-widget-zoom"})(l||(l={}));const ke=.5,qe=3,Fe={id:"@jupyterlab/application-extension:commands",description:"Adds commands related to the shell.",autoStart:!0,requires:[I,V],optional:[J,te],activate:(i,m,d,t,u)=>{var r;const{commands:n,shell:f}=i,a=m.load("jupyterlab"),w=a.__("Main Area");n.addCommand(Ce.contextMenu,{label:a.__("Shift+Right Click for Browser Menu"),describedBy:{args:{type:"object",properties:{}}},isEnabled:()=>!1,execute:()=>{}});const h=o=>{var e;if(t)for(const s of["main","left","right","down"]){const v=O(t.widgets(s),E=>E.id===o);if(v)return v}return(e=O(f.widgets("main"),s=>s.id===o))!==null&&e!==void 0?e:null},b=()=>{const o=v=>!!v.dataset.id,e=i.contextMenuHitTest(o);if(!e)return f.currentWidget;const s=e.dataset.id;return s?h(s):null},p=o=>{o.forEach(e=>e.close())},c=(o,e)=>{if(o.type==="tab-area")return o.widgets.includes(e)?o:null;if(o.type==="split-area")for(const s of o.children){const v=c(s,e);if(v)return v}return null},g=o=>{var e;const s=t?.saveLayout(),v=s?.mainArea;if(!v||C.PageConfig.getOption("mode")!=="multiple-document")return null;const E=(e=v.dock)===null||e===void 0?void 0:e.main;return E?c(E,o):null},_=o=>{const{id:e}=o,s=g(o),v=s?s.widgets||[]:[],E=v.findIndex(A=>A.id===e);return E<0?[]:v.slice(E+1)},M=o=>{let e;if(o!="left"&&o!="right")throw Error(`Unsupported sidebar: ${o}`);if(o==="left")e=document.querySelector(".lm-TabBar-tab.lm-mod-current");else{const v=document.querySelectorAll(".lm-TabBar-tab.lm-mod-current");e=v[v.length-1]}const s=e?.getAttribute("data-id");return s?s?.toString():""},W=()=>{var o;return(o=f.currentWidget)!==null&&o!==void 0?o:null};function z(o){const e=y(o);e&&e.style.removeProperty("zoom")}function y(o){const e=o.node;let s=e.querySelector(".jp-zoom-target");return s||(e.classList.add("jp-zoom-target"),e)}function x(o,e){const s=y(o);if(!s)return;const v=Number(s.style.zoom||1),E=Math.min(qe,Math.max(ke,v+e));s.style.zoom=String(E)}function T(o){o&&o.focus()}if(n.addCommand(l.close,{label:()=>a.__("Close Tab"),describedBy:{args:{type:"object",properties:{}}},isEnabled:()=>{const o=b();return!!o&&o.title.closable},execute:()=>{const o=b();o&&o.close()}}),n.addCommand(l.closeOtherTabs,{label:()=>a.__("Close All Other Tabs"),describedBy:{args:{type:"object",properties:{}}},isEnabled:()=>ye(f.widgets("main"),(o,e)=>e===1),execute:()=>{const o=b();if(!o)return;const{id:e}=o;for(const s of f.widgets("main"))s.id!==e&&s.close()}}),n.addCommand(l.closeRightTabs,{label:()=>a.__("Close Tabs to Right"),describedBy:{args:{type:"object",properties:{}}},isEnabled:()=>!!b()&&_(b()).length>0,execute:()=>{const o=b();o&&p(_(o))}}),n.addCommand(l.zoomInWidget,{label:a.__("Zoom In Active Widget"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=W();o&&x(o,.1)}}),n.addCommand(l.zoomOutWidget,{label:a.__("Zoom Out Active Widget"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=W();o&&x(o,-.1)}}),n.addCommand(l.resetWidgetZoom,{label:a.__("Reset Widget Zoom"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=W();o&&z(o)}}),(r=f.currentChanged)===null||r===void 0||r.connect(()=>{[l.close,l.closeOtherTabs,l.closeRightTabs].forEach(o=>n.notifyCommandChanged(o))}),t){n.addCommand(l.activateNextTab,{label:a.__("Activate Next Tab"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.activateNextTab()}}),n.addCommand(l.activatePreviousTab,{label:a.__("Activate Previous Tab"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.activatePreviousTab()}}),n.addCommand(l.activateNextTabBar,{label:a.__("Activate Next Tab Bar"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.activateNextTabBar()}}),n.addCommand(l.activatePreviousTabBar,{label:a.__("Activate Previous Tab Bar"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.activatePreviousTabBar()}}),n.addCommand(l.closeAll,{label:a.__("Close All Tabs"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.closeAll()}}),n.addCommand(l.toggleHeader,{label:a.__("Show Header"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.mode==="single-document"&&t.toggleTopInSimpleModeVisibility()},isToggled:()=>t.isTopInSimpleModeVisible(),isVisible:()=>t.mode==="single-document"}),n.addCommand(l.toggleLeftArea,{label:a.__("Show Left Sidebar"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.leftCollapsed?t.expandLeft():(t.collapseLeft(),t.currentWidget&&t.activateById(t.currentWidget.id))},isToggled:()=>!t.leftCollapsed,isEnabled:()=>!t.isEmpty("left")}),n.addCommand(l.toggleRightArea,{label:a.__("Show Right Sidebar"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.rightCollapsed?t.expandRight():(t.collapseRight(),t.currentWidget&&t.activateById(t.currentWidget.id))},isToggled:()=>!t.rightCollapsed,isEnabled:()=>!t.isEmpty("right")}),n.addCommand(l.toggleDownArea,{label:a.__("Show Down Area"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.downCollapsed?t.expandDown():(t.collapseDown(),t.currentWidget&&t.activateById(t.currentWidget.id))},isToggled:()=>!t.downCollapsed,isEnabled:()=>!t.isEmpty("down")}),n.addCommand(l.toggleSidebarWidget,{label:e=>e===void 0||e.side===void 0||e.index===void 0?a.__("Toggle Sidebar Element"):e.side==="right"?a.__("Toggle Element %1 in Right Sidebar",parseInt(e.index,10)+1):a.__("Toggle Element %1 in Left Sidebar",parseInt(e.index,10)+1),describedBy:{args:{type:"object",properties:{side:{type:"string",enum:["left","right"],description:a.__("The sidebar side")},index:{type:["string","number"],description:a.__("The index of the sidebar widget")}},required:["side","index"]}},execute:e=>{const s=parseInt(e.index,10);if(e.side!="left"&&e.side!="right")throw Error(`Unsupported sidebar: ${e.side}`);const v=Array.from(t.widgets(e.side));if(s>=v.length)return;const E=v[s].id,A=document.querySelector("[data-id='"+E+"']");M(e.side)===E?(e.side=="left"&&(t.collapseLeft(),T(A)),e.side=="right"&&(t.collapseRight(),T(A))):(t.activateById(E),T(A))}}),n.addCommand(l.toggleSideTabBar,{label:e=>e.side==="right"?a.__("Show Right Activity Bar"):a.__("Show Left Activity Bar"),describedBy:{args:{type:"object",properties:{side:{type:"string",enum:["left","right"],description:a.__("The sidebar side")}},required:["side"]}},execute:e=>{e.side==="right"?t.toggleSideTabBarVisibility("right"):t.toggleSideTabBarVisibility("left")},isToggled:e=>e.side==="right"?t.isSideTabBarVisible("right"):t.isSideTabBarVisible("left"),isEnabled:e=>e.side==="right"?!t.isEmpty("right"):!t.isEmpty("left")}),n.addCommand(l.togglePresentationMode,{label:()=>a.__("Presentation Mode"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.presentationMode=!t.presentationMode},isToggled:()=>t.presentationMode,isVisible:()=>!0}),n.addCommand(l.toggleFullscreenMode,{label:a.__("Fullscreen Mode"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{document.fullscreenElement===null||document.fullscreenElement===void 0?document.documentElement.requestFullscreen().catch(e=>{console.error("Failed to enter fullscreen mode.",e)}):document.fullscreenElement!==null&&document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen mode.",e)})},isToggled:()=>document.fullscreenElement!==null}),n.addCommand(l.setMode,{label:e=>e.mode?a.__("Set %1 mode.",e.mode):a.__("Set the layout `mode`."),caption:a.__('The layout `mode` can be "single-document" or "multiple-document".'),describedBy:{args:{type:"object",properties:{mode:{type:"string",enum:["single-document","multiple-document"],description:a.__("The layout mode")}},required:["mode"]}},isVisible:e=>{const s=e.mode;return s==="single-document"||s==="multiple-document"},execute:e=>{const s=e.mode;if(s==="single-document"||s==="multiple-document"){t.mode=s;return}throw new Error(`Unsupported application shell mode: ${s}`)}}),n.addCommand(l.toggleMode,{label:a.__("Simple Interface"),describedBy:{args:{type:"object",properties:{}}},isToggled:()=>t.mode==="single-document",execute:()=>{const e=t.mode==="multiple-document"?{mode:"single-document"}:{mode:"multiple-document"};return n.execute(l.setMode,e)}}),n.addCommand(l.resetLayout,{label:a.__("Reset Default Layout"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{t.presentationMode&&n.execute(l.togglePresentationMode).catch(e=>{console.error("Failed to undo presentation mode.",e)}),(document.fullscreenElement!==null||document.fullscreenElement!==void 0)&&n.execute(l.toggleFullscreenMode).catch(e=>{console.error("Failed to exit fullscreen mode.",e)}),t.mode==="single-document"&&!t.isTopInSimpleModeVisible()&&n.execute(l.toggleHeader).catch(e=>{console.error("Failed to display title header.",e)}),["left","right"].forEach(e=>{!t.isSideTabBarVisible(e)&&!t.isEmpty(e)&&n.execute(l.toggleSideTabBar,{side:e}).catch(s=>{console.error(`Failed to show ${e} activity bar.`,s)})})}});const o=()=>{var e;const s=A=>A.classList.contains("lm-TabBar-tab")&&!!A.dataset.id,v=i.contextMenuHitTest(s);if(!v)return null;const E=v.dataset.id;return E&&(e=O(t.widgets("main"),A=>A.id===E))!==null&&e!==void 0?e:null};n.addCommand(l.splitTab,{label:e=>{const s=e?.direction;return s?{left:a.__("Left"),right:a.__("Right"),top:a.__("Up"),bottom:a.__("Down")}[s]:a.__("Split Tab")},caption:a.__("Split the current tab"),describedBy:{args:{type:"object",properties:{direction:{type:"string",enum:["left","right","top","bottom"],description:a.__("The direction to split the tab")},id:{type:"string",description:a.__("The widget ID to split. Defaults to the context menu target.")}},required:["direction"]}},isEnabled:()=>{const e=o();if(!e||!(t instanceof ne))return!1;const s=t.getMainAreaTabBar(e);return s?s.titles.length>1:!1},execute:e=>{const s=e?.direction;let v=e?.id?O(t.widgets("main"),E=>E.id===e?.id):null;v||(v=o()),v&&s&&t.moveTab(v,s)}})}u&&([l.activateNextTab,l.activatePreviousTab,l.activateNextTabBar,l.activatePreviousTabBar,l.close,l.closeAll,l.closeOtherTabs,l.closeRightTabs,l.toggleHeader,l.toggleLeftArea,l.toggleRightArea,l.toggleDownArea,l.togglePresentationMode,l.toggleFullscreenMode,l.toggleMode,l.resetLayout,l.zoomInWidget,l.zoomOutWidget,l.resetWidgetZoom].forEach(o=>u.addItem({command:o,category:w})),["right","left"].forEach(o=>{u.addItem({command:l.toggleSideTabBar,category:w,args:{side:o}})}));function L(o){const e=o.target;if(!e)return null;const s=e.closest(".lm-Widget");if(!s)return null;for(const v of f.widgets("main"))if(v.node.contains(s))return v;return null}let B=!1,P="side";d.load("@jupyterlab/application-extension:shell").then(o=>{B=o.get("zoomOnWheel").composite,P=o.get("activityBarPosition").composite,o.changed.connect(()=>{B=o.get("zoomOnWheel").composite;const e=o.get("activityBarPosition").composite;e!==P&&(P=e,n.notifyCommandChanged(l.setActivityBarPosition))}),n.addCommand(l.setActivityBarPosition,{label:e=>{const s=e.position,v=s==="side"?a.__("Side"):s==="top"?a.__("Top"):s==="bottom"?a.__("Bottom"):"";return v?e.isPalette?a.__("Activity Bar Position: %1",v):v:a.__("Set Activity Bar Position")},caption:a.__("Position of the side activity bars (side, top, or bottom)."),describedBy:{args:{type:"object",properties:{position:{type:"string",oneOf:[{const:"side",title:a.__("Side")},{const:"top",title:a.__("Top")},{const:"bottom",title:a.__("Bottom")}],description:a.__("The activity bar position")},isPalette:{type:"boolean",description:a.__("Whether the command is being called from the palette")}},required:["position"]}},isToggled:e=>e.position===P,execute:e=>{const s=e.position;if(s!=="side"&&s!=="top"&&s!=="bottom")throw new Error(`Unsupported activity bar position: ${s}`);return o.set("activityBarPosition",s)}}),u&&["side","top","bottom"].forEach(e=>{u.addItem({command:l.setActivityBarPosition,category:w,args:{position:e,isPalette:!0}})})}).catch(o=>{console.error("Failed to load shell settings.",o)});let j=!1;window.addEventListener("keydown",o=>{o.key==="Control"&&(j=!0)}),window.addEventListener("keyup",o=>{o.key==="Control"&&(j=!1)}),window.addEventListener("blur",()=>{j=!1}),window.addEventListener("wheel",o=>{if(!B||!o.ctrlKey||!j)return;const e=L(o);if(!e)return;o.preventDefault();const s=o.deltaY<0?.1:-.1;x(e,s)},{passive:!1,capture:!0})}},ae={id:"@jupyterlab/application-extension:main",description:"Initializes the application and provides the URL tree path handler.",requires:[K,Ee,I,H.ITreeResolver],optional:[Me],provides:je,activate:(i,m,d,t,u,r)=>{const n=t.load("jupyterlab");if(!(i instanceof $))throw new Error(`${ae.id} must be activated in JupyterLab.`);let f="",a="";function w(c){u.paths.then(()=>{if(a=c,!f){const g=C.PageConfig.getUrl({treePath:c}),_=C.URLExt.parse(g).pathname;m.navigate(_,{skipRouting:!0}),C.PageConfig.setOption("treePath",c)}})}const h=d.name;if(console.debug(`Starting application in workspace: "${h}"`),i.registerPluginErrors.length!==0){const c=k.createElement("pre",null,i.registerPluginErrors.map(g=>g.message).join(`
@@ -1 +1 @@
1
- import{aD as Q,cy as Z,fL as te,az as S,aC as D,ck as J,ct as ne,ax as re,bg as ie,aE as I,aF as T,k as P,aA as se,dS as oe,dP as ae,fM as de,fN as le,cn as K,dy as E}from"../datalayer-app-main.js";import{c as ce}from"./tokens-DbNnxPrX.js";import{a as ue}from"./tokens-Nkg3e_k9.js";import{I as ee}from"./tokens-B7nNzQEE.js";import{h as _,b as pe,M as z}from"./index--S8WFITA.js";import{M as v,c as me,e as he}from"./index-9EhrHHj7.js";import{I as be}from"./tokens-DY_UrMLq.js";import{R as j,I as _e}from"./menu-Ntu8pEH0.js";import"./hoverbox-CStlKQWE.js";import"./Output-D-7eUege.js";import"./index-6zxBQeM_.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-D7aXShZc.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-DyX4EYyN.js";import"./index-BbcMy3Al.js";import"./KernelVariables-D3DSQaD3.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-BMjQTGrr.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./sessions-CgjtuOSm.js";import"./tokens-CBhRbpQP.js";import"./drivecontents-D1HzL7Fi.js";import"./kernel-BmfZmtIo.js";function f(t){const{id:e,commands:n,shell:r,semanticCommands:i,default:c,overrides:u,trans:o}=t;n.addCommand(e,{...fe({commands:n,shell:r},i,c??{},o??Q.load("jupyterlab")),...u});const a=Array.isArray(i)?i:[i],l=(s,d)=>{if(d.id){if(d.id===e&&d.type==="removed")s.commandChanged.disconnect(l);else if(a.reduce((h,B)=>h.concat(B.ids),[]).includes(d.id))switch(d.type){case"changed":case"many-changed":s.notifyCommandChanged(e);break;case"removed":for(const h of a)h.remove(d.id);break}}};n.commandChanged.connect(l)}function fe(t,e,n,r){const{commands:i,shell:c}=t,u=Array.isArray(e)?e:[e];return{label:a("label"),caption:a("caption"),isEnabled:()=>{var l;const s=o("isEnabled");return s.length>0?!s.some(d=>d===!1):(l=n.isEnabled)!==null&&l!==void 0?l:!1},isToggled:()=>{var l;const s=o("isToggled");return s.length>0?s.some(d=>d===!0):(l=n.isToggled)!==null&&l!==void 0?l:!1},isVisible:()=>{var l;const s=o("isVisible");return s.length>0?!s.some(d=>d===!1):(l=n.isVisible)!==null&&l!==void 0?l:!0},execute:async()=>{const l=c.currentWidget,d=u.map(h=>l!==null?h.getActiveCommandId(l):null).filter(h=>h!==null&&i.isEnabled(h));let b=null;if(d.length>0)for(const h of d){const B={[_.WIDGET]:l.id};if(b=await i.execute(h,B),typeof b=="boolean"&&b===!1)break}else n.execute&&(b=await i.execute(n.execute));return b}};function o(l){const s=c.currentWidget;return u.map(h=>s!==null?h.getActiveCommandId(s):null).filter(h=>h!==null).map(h=>i[l](h))}function a(l){return()=>{var s;const d=o(l).map((b,h)=>l=="caption"&&h>0?b.toLocaleLowerCase():b);switch(d.length){case 0:return(s=n[l])!==null&&s!==void 0?s:"";case 1:return d[0];default:{const b=d.some(m=>/…$/.test(m)),h=d.slice(void 0,-1).map(m=>m.replace(/…$/,"")).join(", "),B=d.slice(-1)[0].replace(/…$/,"")+(b?"…":"");return r.__("%1 and %2",h,B)}}}}}class U extends j{constructor(e){super(e),this.undoers={redo:new _,undo:new _},this.clearers={clearAll:new _,clearCurrent:new _},this.goToLiners=new _}}class V extends j{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new _,this.consoleCreators=new _}get newMenu(){var e,n;return this._newMenu||(this._newMenu=(n=(e=Z(this.items,r=>{var i;return((i=r.submenu)===null||i===void 0?void 0:i.id)==="jp-mainmenu-file-new"}))===null||e===void 0?void 0:e.submenu)!==null&&n!==void 0?n:new j({commands:this.commands})),this._newMenu}dispose(){var e;(e=this._newMenu)===null||e===void 0||e.dispose(),super.dispose()}}class W extends j{constructor(e){super(e),this.getKernel=new _}}class F extends j{constructor(e){super(e),this.kernelUsers={changeKernel:new _,clearWidget:new _,interruptKernel:new _,reconnectToKernel:new _,restartKernel:new _,shutdownKernel:new _}}}class q extends j{constructor(e){super(e),this.codeRunners={restart:new _,run:new _,runAll:new _}}}class N extends j{constructor(e){super(e)}}class $ extends j{constructor(e){super(e)}}class G extends j{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new _,toggleMinimap:new _,toggleMatchBrackets:new _,toggleWordWrap:new _}}}class X extends te{constructor(e){let n={forceItemsPosition:{forceX:!1,forceY:!0}};super(n),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new U({commands:this._commands,rank:2,renderer:v.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new V({commands:this._commands,rank:1,renderer:v.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new W({commands:this._commands,rank:1e3,renderer:v.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new F({commands:this._commands,rank:5,renderer:v.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new q({commands:this._commands,rank:4,renderer:v.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new N({commands:this._commands,rank:999,renderer:v.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new G({commands:this._commands,rank:3,renderer:v.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new $({commands:this._commands,rank:500,renderer:v.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,r={}){if(S.firstIndexOf(this.menus,e)>-1)return;v.overrideDefaultRenderer(e);const i="rank"in r?r.rank:"rank"in e?e.rank:_e.DEFAULT_RANK,c={menu:e,rank:i},u=S.upperBound(this._items,c,H.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),S.insert(this._items,u,c),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof V&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof U&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof G&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof q&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof F&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof $&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof N&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof W&&(this._helpMenu=e);break}}dispose(){var e,n,r,i,c,u,o,a;(e=this._editMenu)===null||e===void 0||e.dispose(),(n=this._fileMenu)===null||n===void 0||n.dispose(),(r=this._helpMenu)===null||r===void 0||r.dispose(),(i=this._kernelMenu)===null||i===void 0||i.dispose(),(c=this._runMenu)===null||c===void 0||c.dispose(),(u=this._settingsMenu)===null||u===void 0||u.dispose(),(o=this._viewMenu)===null||o===void 0||o.dispose(),(a=this._tabsMenu)===null||a===void 0||a.dispose(),super.dispose()}static generateMenu(e,n,r){let i;const{id:c,label:u,rank:o}=n;switch(c){case"jp-mainmenu-file":i=new V({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-edit":i=new U({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-view":i=new G({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-run":i=new q({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-kernel":i=new F({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-tabs":i=new $({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-settings":i=new N({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-help":i=new W({commands:e,rank:o,renderer:v.defaultRenderer});break;default:i=new j({commands:e,rank:o,renderer:v.defaultRenderer})}return u&&(i.title.label=r._p("menu",u)),i}_onMenuDisposed(e){this.removeMenu(e);const n=S.findFirstIndex(this._items,r=>r.menu===e);n!==-1&&S.removeAt(this._items,n)}}var H;(function(t){function e(n,r){return n.rank-r.rank}t.itemCmp=e})(H||(H={}));const ge="@jupyterlab/mainmenu-extension:recents";var C;(function(t){t.openRecent="recentmenu:open-recent",t.reopenLast="recentmenu:reopen-last",t.clearRecents="docmanager:clear-recents"})(C||(C={}));class ve extends re{constructor(e){super(e),this._manager=e.manager,this._showDirectories=e.showDirectories,this.updateItems(),this._manager.changed.connect(this.updateItems,this)}async _validateRecentlyOpened(){Promise.all(this._manager.recentlyOpened.map(e=>this._manager.validate(e)))}onBeforeAttach(e){const n=new ie;setTimeout(()=>{n.reject("Recents validation timed out.")},550),Promise.race([n.promise,this._validateRecentlyOpened()]).then(()=>{this.update()}).catch(()=>{}),super.onBeforeAttach(e)}updateItems(){this.clearItems(),this.addItem({command:C.reopenLast}),this.addItem({type:"separator"});let e=!0,n=!1;this._manager.recentlyOpened.sort((r,i)=>r.contentType===i.contentType?0:r.contentType!=="directory"?1:-1).forEach(r=>{if(r.contentType==="directory"){if(!this._showDirectories)return;n=!0}else e&&n&&(e=!1,this.addItem({type:"separator"}));this.addItem({command:C.openRecent,args:{recent:r}})}),this.addItem({type:"separator"}),this.addItem({command:C.clearRecents})}}const ye={id:ge,description:"Adds sub-menu for opening recent documents to the File section of the main menu.",autoStart:!0,requires:[ue,ee],optional:[ce,D],activate:(t,e,n,r,i)=>{const{commands:c}=t,u=(i??Q).load("jupyterlab"),o=r!==null,a=async s=>{const d=await e.validate(s);return d||await ne(u.__("Could Not Open Recent"),u.__("%1 is no longer valid and will be removed from the list",s.path)),d};c.addCommand(C.openRecent,{execute:async s=>{const d=s.recent,b=d.path===""?"/":d.path;await a(d)&&(r&&d.contentType==="directory"?await c.execute(r.openPath,{path:b}):await c.execute("docmanager:open",{path:b,factory:d.factory}))},label:s=>{const d=s.recent;return d?J.PathExt.joinWithLeadingSlash(d.root,d.path):u.__("Open a Recent Document (given by `recent` argument)")},isEnabled:s=>e.recentlyOpened.includes(s.recent),describedBy:{args:{type:"object",properties:{recent:{type:"object",description:u.__("Recent document to open")}}}}}),t.commands.addCommand(C.reopenLast,{execute:async()=>{const s=e.recentlyClosed[0];!s||!await a(s)||(await c.execute("docmanager:open",{path:s.path,factory:s.factory}),e.removeRecent(s,"closed"))},label:()=>{const s=e.recentlyClosed[0];return s?u.__("Reopen %1",s.path):u.__("Reopen Closed Document")},isEnabled:()=>e.recentlyClosed.length!==0,caption:u.__("Reopen recently closed file or notebook."),describedBy:{args:{type:"object",properties:{}}}});const l=new ve({commands:c,manager:e,showDirectories:o});l.title.label=u.__("Open Recent"),n.fileMenu.addItem({type:"submenu",submenu:l,rank:1})}},L="@jupyterlab/mainmenu-extension:plugin";var p;(function(t){t.openEdit="editmenu:open",t.undo="editmenu:undo",t.redo="editmenu:redo",t.clearCurrent="editmenu:clear-current",t.clearAll="editmenu:clear-all",t.find="editmenu:find",t.goToLine="editmenu:go-to-line",t.openFile="filemenu:open",t.closeAndCleanup="filemenu:close-and-cleanup",t.createConsole="filemenu:create-console",t.shutdown="filemenu:shutdown",t.logout="filemenu:logout",t.openKernel="kernelmenu:open",t.interruptKernel="kernelmenu:interrupt",t.reconnectToKernel="kernelmenu:reconnect-to-kernel",t.restartKernel="kernelmenu:restart",t.restartKernelAndClear="kernelmenu:restart-and-clear",t.changeKernel="kernelmenu:change",t.shutdownKernel="kernelmenu:shutdown",t.shutdownAllKernels="kernelmenu:shutdownAll",t.openView="viewmenu:open",t.wordWrap="viewmenu:word-wrap",t.lineNumbering="viewmenu:line-numbering",t.minimap="viewmenu:show-minimap",t.matchBrackets="viewmenu:match-brackets",t.openRun="runmenu:open",t.run="runmenu:run",t.runAll="runmenu:run-all",t.restartAndRunAll="runmenu:restart-and-run-all",t.runAbove="runmenu:run-above",t.runBelow="runmenu:run-below",t.openTabs="tabsmenu:open",t.activateById="tabsmenu:activate-by-id",t.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab",t.openSettings="settingsmenu:open",t.openHelp="helpmenu:open",t.getKernel="helpmenu:get-kernel",t.openFirst="mainmenu:open-first"})(p||(p={}));const we={id:L,description:"Adds and provides the application main menu.",requires:[he,D],optional:[pe,me,be],provides:ee,activate:async(t,e,n,r,i,c)=>{const{commands:u}=t,o=n.load("jupyterlab"),a=new X(u);a.id="jp-MainMenu",a.addClass("jp-scrollbar-tiny"),c&&(await Y.loadSettingsMenu(c,d=>{a.addMenu(d,!1,{rank:d.rank})},d=>X.generateMenu(u,d,o),n),a.update());const l=J.PageConfig.getOption("quitButton").toLowerCase();a.fileMenu.quitEntry=l==="true",Me(t,a.editMenu,o),ke(t,a.fileMenu,e,o),Re(t,a.kernelMenu,o),Ae(t,a.runMenu,o),je(t,a.viewMenu,o),Ce(t,a.helpMenu,o),i&&Be(t,a.tabsMenu,i,o);const s=d=>{a.activeMenu=d,a.openActiveMenu()};return u.addCommand(p.openEdit,{label:o.__("Open Edit Menu"),execute:()=>s(a.editMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openFile,{label:o.__("Open File Menu"),execute:()=>s(a.fileMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openKernel,{label:o.__("Open Kernel Menu"),execute:()=>s(a.kernelMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openRun,{label:o.__("Open Run Menu"),execute:()=>s(a.runMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openView,{label:o.__("Open View Menu"),execute:()=>s(a.viewMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openSettings,{label:o.__("Open Settings Menu"),execute:()=>s(a.settingsMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openTabs,{label:o.__("Open Tabs Menu"),execute:()=>s(a.tabsMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openHelp,{label:o.__("Open Help Menu"),execute:()=>s(a.helpMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openFirst,{label:o.__("Open First Menu"),execute:()=>{a.activeIndex=0,a.openActiveMenu()},describedBy:{args:{type:"object",properties:{}}}}),r&&(r.addItem({command:p.shutdown,category:o.__("Main Area")}),r.addItem({command:p.logout,category:o.__("Main Area")}),r.addItem({command:p.shutdownAllKernels,category:o.__("Kernel Operations")}),r.addItem({command:p.activatePreviouslyUsedTab,category:o.__("Main Area")})),t.shell.add(a,"menu",{rank:100}),a}};function Me(t,e,n){const{commands:r,shell:i}=t;f({id:p.undo,commands:r,shell:i,semanticCommands:e.undoers.undo,default:{label:n.__("Undo")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.redo,commands:r,shell:i,semanticCommands:e.undoers.redo,default:{label:n.__("Redo")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.clearCurrent,commands:r,shell:i,semanticCommands:e.clearers.clearCurrent,default:{label:n.__("Clear")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.clearAll,commands:r,shell:i,semanticCommands:e.clearers.clearAll,default:{label:n.__("Clear All")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.goToLine,commands:r,shell:i,semanticCommands:e.goToLiners,default:{label:n.__("Go to Line…")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n})}function ke(t,e,n,r){const{commands:i,shell:c}=t;f({id:p.closeAndCleanup,commands:i,shell:c,semanticCommands:e.closeAndCleaners,default:{execute:"application:close",label:r.__("Close and Shut Down"),isEnabled:!0},overrides:{isEnabled:()=>!!t.shell.currentWidget&&!!t.shell.currentWidget.title.closable,describedBy:{args:{type:"object",properties:{}}}},trans:r}),f({id:p.createConsole,commands:i,shell:c,semanticCommands:e.consoleCreators,default:{label:r.__("New Console for Activity")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:r}),i.addCommand(p.shutdown,{label:r.__("Shut Down"),caption:r.__("Shut down %1",t.name),isVisible:()=>e.quitEntry,isEnabled:()=>e.quitEntry,describedBy:{args:{type:"object",properties:{}}},execute:()=>I({title:r.__("Shutdown confirmation"),body:r.__("Please confirm you want to shut down %1.",t.name),buttons:[T.cancelButton(),T.warnButton({label:r.__("Shut Down")})]}).then(async u=>{if(u.button.accept){const o=t.serviceManager.serverSettings,a=J.URLExt.join(o.baseUrl,"api/shutdown");try{await Promise.all([t.serviceManager.sessions.shutdownAll(),t.serviceManager.terminals.shutdownAll()])}catch(l){console.log(`Failed to shutdown sessions and terminals: ${l}`)}return P.ServerConnection.makeRequest(a,{method:"POST"},o).then(l=>{if(l.ok){const s=document.createElement("div"),d=document.createElement("p");d.textContent=r.__("You have shut down the Jupyter server. You can now close this tab.");const b=document.createElement("p");b.textContent=r.__("To use %1 again, you will need to relaunch it.",t.name),s.appendChild(d),s.appendChild(b),I({title:r.__("Server stopped"),body:new se({node:s}),buttons:[]}),window.close()}else throw new P.ServerConnection.ResponseError(l)}).catch(l=>{throw new P.ServerConnection.NetworkError(l)})}})}),i.addCommand(p.logout,{label:r.__("Log Out"),caption:r.__("Log out of %1",t.name),isVisible:()=>e.quitEntry,isEnabled:()=>e.quitEntry,describedBy:{args:{type:"object",properties:{}}},execute:()=>{n.navigate("/logout",{hard:!0})}})}function Re(t,e,n){const{commands:r,shell:i}=t;f({id:p.interruptKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.interruptKernel,default:{label:n.__("Interrupt Kernel"),caption:n.__("Interrupt the kernel")},overrides:{icon:c=>c.toolbar?oe:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.reconnectToKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.reconnectToKernel,default:{label:n.__("Reconnect to Kernel")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.restartKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.restartKernel,default:{label:n.__("Restart Kernel…"),caption:n.__("Restart the kernel")},overrides:{icon:c=>c.toolbar?ae:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.restartKernelAndClear,commands:r,shell:i,semanticCommands:[e.kernelUsers.restartKernel,e.kernelUsers.clearWidget],default:{label:n.__("Restart Kernel and Clear…")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.changeKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.changeKernel,default:{label:n.__("Change Kernel…")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.shutdownKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.shutdownKernel,default:{label:n.__("Shut Down Kernel"),caption:n.__("Shut down kernel")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),r.addCommand(p.shutdownAllKernels,{label:n.__("Shut Down All Kernels…"),isEnabled:()=>!t.serviceManager.sessions.running().next().done,describedBy:{args:{type:"object",properties:{}}},execute:()=>I({title:n.__("Shut Down All?"),body:n._n("Are you sure you want to permanently shut down the running kernel?","Are you sure you want to permanently shut down the %1 running kernels?",t.serviceManager.kernels.runningCount),buttons:[T.cancelButton(),T.warnButton({label:n.__("Shut Down All")})]}).then(c=>{if(c.button.accept)return t.serviceManager.sessions.shutdownAll()})})}function je(t,e,n){const{commands:r,shell:i}=t;f({id:p.lineNumbering,commands:r,shell:i,semanticCommands:e.editorViewers.toggleLineNumbers,default:{label:n.__("Show Line Numbers")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.minimap,commands:r,shell:i,semanticCommands:e.editorViewers.toggleMinimap,default:{label:n.__("Show Minimap")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.matchBrackets,commands:r,shell:i,semanticCommands:e.editorViewers.toggleMatchBrackets,default:{label:n.__("Match Brackets")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.wordWrap,commands:r,shell:i,semanticCommands:e.editorViewers.toggleWordWrap,default:{label:n.__("Wrap Words")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n})}function Ae(t,e,n){const{commands:r,shell:i}=t;f({id:p.run,commands:r,shell:i,semanticCommands:e.codeRunners.run,default:{label:n.__("Run Selected"),caption:n.__("Run Selected")},overrides:{icon:c=>c.toolbar?de:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.runAll,commands:r,shell:i,semanticCommands:e.codeRunners.runAll,default:{label:n.__("Run All"),caption:n.__("Run All")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.restartAndRunAll,commands:r,shell:i,semanticCommands:[e.codeRunners.restart,e.codeRunners.runAll],default:{label:n.__("Restart Kernel and Run All"),caption:n.__("Restart Kernel and Run All")},overrides:{icon:c=>c.toolbar?le:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n})}function Be(t,e,n,r){const i=t.commands,c=[];let u;i.addCommand(p.activateById,{label:a=>{if(a.id===void 0)return r.__("Activate a widget by its `id`.");const l=a.id||"",s=Z(t.shell.widgets("main"),d=>d.id===l);return s&&s.title.label||""},isToggled:a=>{const l=a.id||"";return!!t.shell.currentWidget&&t.shell.currentWidget.id===l},describedBy:{args:{type:"object",properties:{id:{type:"string",description:r.__("The widget id to activate")}},required:["id"]}},execute:a=>t.shell.activateById(a.id||"")});let o="";i.addCommand(p.activatePreviouslyUsedTab,{label:r.__("Activate Previously Used Tab"),isEnabled:()=>!!o,describedBy:{args:{type:"object",properties:{}}},execute:()=>i.execute(p.activateById,{id:o})}),n&&t.restored.then(()=>{const a=()=>{u&&!u.isDisposed&&u.dispose(),c.length=0;let l=!1;for(const s of t.shell.widgets("main"))s.id===o&&(l=!0),c.push({command:p.activateById,args:{id:s.id}});u=e.addGroup(c,1),o=l?o:""};a(),n.layoutModified.connect(()=>{a()}),n.currentChanged.connect((l,s)=>{const d=s.oldValue;d&&(o=d.id)})})}function Ce(t,e,n){const{commands:r,shell:i}=t;f({id:p.getKernel,commands:r,shell:i,semanticCommands:e.getKernel,default:{label:n.__("Get Kernel"),isVisible:!1},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n})}const Tt=[we,ye];var Y;(function(t){async function e(r){(await I({title:r.__("Information"),body:r.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[T.cancelButton(),T.okButton({label:r.__("Reload")})]})).button.accept&&location.reload()}async function n(r,i,c,u){var o;const a=u.load("jupyterlab");let l=null,s={};function d(m){var g,M;s={};const A=Object.keys(r.plugins).map(y=>{var k,w;const R=(w=(k=r.plugins[y].schema["jupyter.lab.menus"])===null||k===void 0?void 0:k.main)!==null&&w!==void 0?w:[];return s[y]=R,R}).concat([(M=(g=m["jupyter.lab.menus"])===null||g===void 0?void 0:g.main)!==null&&M!==void 0?M:[]]).reduceRight((y,k)=>E.reconcileMenus(y,k,!0),m.properties.menus.default);m.properties.menus.default=E.reconcileMenus(A,m.properties.menus.default,!0).sort((y,k)=>{var w,R;return((w=y.rank)!==null&&w!==void 0?w:1/0)-((R=k.rank)!==null&&R!==void 0?R:1/0)})}r.transform(L,{compose:m=>{var g,M,A,y;l||(l=K.deepCopy(m.schema),d(l));const k=(A=(M=(g=l.properties)===null||g===void 0?void 0:g.menus)===null||M===void 0?void 0:M.default)!==null&&A!==void 0?A:[],w={...m.data.user,menus:(y=m.data.user.menus)!==null&&y!==void 0?y:[]},R={...m.data.composite,menus:E.reconcileMenus(k,w.menus)};return m.data={composite:R,user:w},m},fetch:m=>(l||(l=K.deepCopy(m.schema),d(l)),{data:m.data,id:m.id,raw:m.raw,schema:l,version:m.version})});const b=await r.load(L),h=(o=K.deepCopy(b.composite.menus))!==null&&o!==void 0?o:[],B=new Array;z.createMenus(h.filter(m=>!m.disabled).map(m=>{var g;return{...m,items:E.filterDisabledItems((g=m.items)!==null&&g!==void 0?g:[])}}),c).forEach(m=>{B.push(m),i(m)}),b.changed.connect(()=>{var m;const g=(m=b.composite.menus)!==null&&m!==void 0?m:[];K.deepEqual(h,g)||e(a)}),r.pluginChanged.connect(async(m,g)=>{var M,A,y;if(g!==L){const k=(M=s[g])!==null&&M!==void 0?M:[],w=(y=(A=r.plugins[g].schema["jupyter.lab.menus"])===null||A===void 0?void 0:A.main)!==null&&y!==void 0?y:[];if(!K.deepEqual(k,w))if(s[g])await e(a);else{s[g]=K.deepCopy(w);const R=E.reconcileMenus(w,h,!1,!1).filter(x=>!x.disabled).map(x=>{var O;return{...x,items:E.filterDisabledItems((O=x.items)!==null&&O!==void 0?O:[])}});z.updateMenus(B,R,c).forEach(x=>{i(x)})}}})}t.loadSettingsMenu=n})(Y||(Y={}));export{p as CommandIDs,Tt as default};
1
+ import{aD as Q,cr as Z,fL as te,az as S,aC as D,cd as J,cm as ne,ax as re,bg as ie,aE as I,aF as T,k as P,aA as se,dS as oe,dP as ae,fM as de,fN as le,cg as K,dy as E}from"../datalayer-app-main.js";import{c as ce}from"./tokens-DbNnxPrX.js";import{a as ue}from"./tokens-Nkg3e_k9.js";import{I as ee}from"./tokens-B7nNzQEE.js";import{h as _,b as pe,M as z}from"./index-JmqWOkdt.js";import{M as v,c as me,e as he}from"./index-B6-uQd5L.js";import{I as be}from"./tokens-DY_UrMLq.js";import{R as j,I as _e}from"./menu-Ntu8pEH0.js";import"./hoverbox-CStlKQWE.js";import"./Output-D9cwH5rg.js";import"./index-qhxI1VzX.js";import"./index-CEeyR3FZ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-DXPIz0Km.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-We9CyR7b.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DpN8KK6c.js";import"./KernelVariables-CXQagESp.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-D36duUxK.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BAjGB6b-.js";import"./sessions-DdXtI_C1.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";function f(t){const{id:e,commands:n,shell:r,semanticCommands:i,default:c,overrides:u,trans:o}=t;n.addCommand(e,{...fe({commands:n,shell:r},i,c??{},o??Q.load("jupyterlab")),...u});const a=Array.isArray(i)?i:[i],l=(s,d)=>{if(d.id){if(d.id===e&&d.type==="removed")s.commandChanged.disconnect(l);else if(a.reduce((h,B)=>h.concat(B.ids),[]).includes(d.id))switch(d.type){case"changed":case"many-changed":s.notifyCommandChanged(e);break;case"removed":for(const h of a)h.remove(d.id);break}}};n.commandChanged.connect(l)}function fe(t,e,n,r){const{commands:i,shell:c}=t,u=Array.isArray(e)?e:[e];return{label:a("label"),caption:a("caption"),isEnabled:()=>{var l;const s=o("isEnabled");return s.length>0?!s.some(d=>d===!1):(l=n.isEnabled)!==null&&l!==void 0?l:!1},isToggled:()=>{var l;const s=o("isToggled");return s.length>0?s.some(d=>d===!0):(l=n.isToggled)!==null&&l!==void 0?l:!1},isVisible:()=>{var l;const s=o("isVisible");return s.length>0?!s.some(d=>d===!1):(l=n.isVisible)!==null&&l!==void 0?l:!0},execute:async()=>{const l=c.currentWidget,d=u.map(h=>l!==null?h.getActiveCommandId(l):null).filter(h=>h!==null&&i.isEnabled(h));let b=null;if(d.length>0)for(const h of d){const B={[_.WIDGET]:l.id};if(b=await i.execute(h,B),typeof b=="boolean"&&b===!1)break}else n.execute&&(b=await i.execute(n.execute));return b}};function o(l){const s=c.currentWidget;return u.map(h=>s!==null?h.getActiveCommandId(s):null).filter(h=>h!==null).map(h=>i[l](h))}function a(l){return()=>{var s;const d=o(l).map((b,h)=>l=="caption"&&h>0?b.toLocaleLowerCase():b);switch(d.length){case 0:return(s=n[l])!==null&&s!==void 0?s:"";case 1:return d[0];default:{const b=d.some(m=>/…$/.test(m)),h=d.slice(void 0,-1).map(m=>m.replace(/…$/,"")).join(", "),B=d.slice(-1)[0].replace(/…$/,"")+(b?"…":"");return r.__("%1 and %2",h,B)}}}}}class U extends j{constructor(e){super(e),this.undoers={redo:new _,undo:new _},this.clearers={clearAll:new _,clearCurrent:new _},this.goToLiners=new _}}class V extends j{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new _,this.consoleCreators=new _}get newMenu(){var e,n;return this._newMenu||(this._newMenu=(n=(e=Z(this.items,r=>{var i;return((i=r.submenu)===null||i===void 0?void 0:i.id)==="jp-mainmenu-file-new"}))===null||e===void 0?void 0:e.submenu)!==null&&n!==void 0?n:new j({commands:this.commands})),this._newMenu}dispose(){var e;(e=this._newMenu)===null||e===void 0||e.dispose(),super.dispose()}}class W extends j{constructor(e){super(e),this.getKernel=new _}}class F extends j{constructor(e){super(e),this.kernelUsers={changeKernel:new _,clearWidget:new _,interruptKernel:new _,reconnectToKernel:new _,restartKernel:new _,shutdownKernel:new _}}}class q extends j{constructor(e){super(e),this.codeRunners={restart:new _,run:new _,runAll:new _}}}class N extends j{constructor(e){super(e)}}class $ extends j{constructor(e){super(e)}}class G extends j{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new _,toggleMinimap:new _,toggleMatchBrackets:new _,toggleWordWrap:new _}}}class X extends te{constructor(e){let n={forceItemsPosition:{forceX:!1,forceY:!0}};super(n),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new U({commands:this._commands,rank:2,renderer:v.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new V({commands:this._commands,rank:1,renderer:v.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new W({commands:this._commands,rank:1e3,renderer:v.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new F({commands:this._commands,rank:5,renderer:v.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new q({commands:this._commands,rank:4,renderer:v.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new N({commands:this._commands,rank:999,renderer:v.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new G({commands:this._commands,rank:3,renderer:v.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new $({commands:this._commands,rank:500,renderer:v.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,r={}){if(S.firstIndexOf(this.menus,e)>-1)return;v.overrideDefaultRenderer(e);const i="rank"in r?r.rank:"rank"in e?e.rank:_e.DEFAULT_RANK,c={menu:e,rank:i},u=S.upperBound(this._items,c,H.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),S.insert(this._items,u,c),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof V&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof U&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof G&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof q&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof F&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof $&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof N&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof W&&(this._helpMenu=e);break}}dispose(){var e,n,r,i,c,u,o,a;(e=this._editMenu)===null||e===void 0||e.dispose(),(n=this._fileMenu)===null||n===void 0||n.dispose(),(r=this._helpMenu)===null||r===void 0||r.dispose(),(i=this._kernelMenu)===null||i===void 0||i.dispose(),(c=this._runMenu)===null||c===void 0||c.dispose(),(u=this._settingsMenu)===null||u===void 0||u.dispose(),(o=this._viewMenu)===null||o===void 0||o.dispose(),(a=this._tabsMenu)===null||a===void 0||a.dispose(),super.dispose()}static generateMenu(e,n,r){let i;const{id:c,label:u,rank:o}=n;switch(c){case"jp-mainmenu-file":i=new V({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-edit":i=new U({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-view":i=new G({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-run":i=new q({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-kernel":i=new F({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-tabs":i=new $({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-settings":i=new N({commands:e,rank:o,renderer:v.defaultRenderer});break;case"jp-mainmenu-help":i=new W({commands:e,rank:o,renderer:v.defaultRenderer});break;default:i=new j({commands:e,rank:o,renderer:v.defaultRenderer})}return u&&(i.title.label=r._p("menu",u)),i}_onMenuDisposed(e){this.removeMenu(e);const n=S.findFirstIndex(this._items,r=>r.menu===e);n!==-1&&S.removeAt(this._items,n)}}var H;(function(t){function e(n,r){return n.rank-r.rank}t.itemCmp=e})(H||(H={}));const ge="@jupyterlab/mainmenu-extension:recents";var C;(function(t){t.openRecent="recentmenu:open-recent",t.reopenLast="recentmenu:reopen-last",t.clearRecents="docmanager:clear-recents"})(C||(C={}));class ve extends re{constructor(e){super(e),this._manager=e.manager,this._showDirectories=e.showDirectories,this.updateItems(),this._manager.changed.connect(this.updateItems,this)}async _validateRecentlyOpened(){Promise.all(this._manager.recentlyOpened.map(e=>this._manager.validate(e)))}onBeforeAttach(e){const n=new ie;setTimeout(()=>{n.reject("Recents validation timed out.")},550),Promise.race([n.promise,this._validateRecentlyOpened()]).then(()=>{this.update()}).catch(()=>{}),super.onBeforeAttach(e)}updateItems(){this.clearItems(),this.addItem({command:C.reopenLast}),this.addItem({type:"separator"});let e=!0,n=!1;this._manager.recentlyOpened.sort((r,i)=>r.contentType===i.contentType?0:r.contentType!=="directory"?1:-1).forEach(r=>{if(r.contentType==="directory"){if(!this._showDirectories)return;n=!0}else e&&n&&(e=!1,this.addItem({type:"separator"}));this.addItem({command:C.openRecent,args:{recent:r}})}),this.addItem({type:"separator"}),this.addItem({command:C.clearRecents})}}const ye={id:ge,description:"Adds sub-menu for opening recent documents to the File section of the main menu.",autoStart:!0,requires:[ue,ee],optional:[ce,D],activate:(t,e,n,r,i)=>{const{commands:c}=t,u=(i??Q).load("jupyterlab"),o=r!==null,a=async s=>{const d=await e.validate(s);return d||await ne(u.__("Could Not Open Recent"),u.__("%1 is no longer valid and will be removed from the list",s.path)),d};c.addCommand(C.openRecent,{execute:async s=>{const d=s.recent,b=d.path===""?"/":d.path;await a(d)&&(r&&d.contentType==="directory"?await c.execute(r.openPath,{path:b}):await c.execute("docmanager:open",{path:b,factory:d.factory}))},label:s=>{const d=s.recent;return d?J.PathExt.joinWithLeadingSlash(d.root,d.path):u.__("Open a Recent Document (given by `recent` argument)")},isEnabled:s=>e.recentlyOpened.includes(s.recent),describedBy:{args:{type:"object",properties:{recent:{type:"object",description:u.__("Recent document to open")}}}}}),t.commands.addCommand(C.reopenLast,{execute:async()=>{const s=e.recentlyClosed[0];!s||!await a(s)||(await c.execute("docmanager:open",{path:s.path,factory:s.factory}),e.removeRecent(s,"closed"))},label:()=>{const s=e.recentlyClosed[0];return s?u.__("Reopen %1",s.path):u.__("Reopen Closed Document")},isEnabled:()=>e.recentlyClosed.length!==0,caption:u.__("Reopen recently closed file or notebook."),describedBy:{args:{type:"object",properties:{}}}});const l=new ve({commands:c,manager:e,showDirectories:o});l.title.label=u.__("Open Recent"),n.fileMenu.addItem({type:"submenu",submenu:l,rank:1})}},L="@jupyterlab/mainmenu-extension:plugin";var p;(function(t){t.openEdit="editmenu:open",t.undo="editmenu:undo",t.redo="editmenu:redo",t.clearCurrent="editmenu:clear-current",t.clearAll="editmenu:clear-all",t.find="editmenu:find",t.goToLine="editmenu:go-to-line",t.openFile="filemenu:open",t.closeAndCleanup="filemenu:close-and-cleanup",t.createConsole="filemenu:create-console",t.shutdown="filemenu:shutdown",t.logout="filemenu:logout",t.openKernel="kernelmenu:open",t.interruptKernel="kernelmenu:interrupt",t.reconnectToKernel="kernelmenu:reconnect-to-kernel",t.restartKernel="kernelmenu:restart",t.restartKernelAndClear="kernelmenu:restart-and-clear",t.changeKernel="kernelmenu:change",t.shutdownKernel="kernelmenu:shutdown",t.shutdownAllKernels="kernelmenu:shutdownAll",t.openView="viewmenu:open",t.wordWrap="viewmenu:word-wrap",t.lineNumbering="viewmenu:line-numbering",t.minimap="viewmenu:show-minimap",t.matchBrackets="viewmenu:match-brackets",t.openRun="runmenu:open",t.run="runmenu:run",t.runAll="runmenu:run-all",t.restartAndRunAll="runmenu:restart-and-run-all",t.runAbove="runmenu:run-above",t.runBelow="runmenu:run-below",t.openTabs="tabsmenu:open",t.activateById="tabsmenu:activate-by-id",t.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab",t.openSettings="settingsmenu:open",t.openHelp="helpmenu:open",t.getKernel="helpmenu:get-kernel",t.openFirst="mainmenu:open-first"})(p||(p={}));const we={id:L,description:"Adds and provides the application main menu.",requires:[he,D],optional:[pe,me,be],provides:ee,activate:async(t,e,n,r,i,c)=>{const{commands:u}=t,o=n.load("jupyterlab"),a=new X(u);a.id="jp-MainMenu",a.addClass("jp-scrollbar-tiny"),c&&(await Y.loadSettingsMenu(c,d=>{a.addMenu(d,!1,{rank:d.rank})},d=>X.generateMenu(u,d,o),n),a.update());const l=J.PageConfig.getOption("quitButton").toLowerCase();a.fileMenu.quitEntry=l==="true",Me(t,a.editMenu,o),ke(t,a.fileMenu,e,o),Re(t,a.kernelMenu,o),Ae(t,a.runMenu,o),je(t,a.viewMenu,o),Ce(t,a.helpMenu,o),i&&Be(t,a.tabsMenu,i,o);const s=d=>{a.activeMenu=d,a.openActiveMenu()};return u.addCommand(p.openEdit,{label:o.__("Open Edit Menu"),execute:()=>s(a.editMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openFile,{label:o.__("Open File Menu"),execute:()=>s(a.fileMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openKernel,{label:o.__("Open Kernel Menu"),execute:()=>s(a.kernelMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openRun,{label:o.__("Open Run Menu"),execute:()=>s(a.runMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openView,{label:o.__("Open View Menu"),execute:()=>s(a.viewMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openSettings,{label:o.__("Open Settings Menu"),execute:()=>s(a.settingsMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openTabs,{label:o.__("Open Tabs Menu"),execute:()=>s(a.tabsMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openHelp,{label:o.__("Open Help Menu"),execute:()=>s(a.helpMenu),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(p.openFirst,{label:o.__("Open First Menu"),execute:()=>{a.activeIndex=0,a.openActiveMenu()},describedBy:{args:{type:"object",properties:{}}}}),r&&(r.addItem({command:p.shutdown,category:o.__("Main Area")}),r.addItem({command:p.logout,category:o.__("Main Area")}),r.addItem({command:p.shutdownAllKernels,category:o.__("Kernel Operations")}),r.addItem({command:p.activatePreviouslyUsedTab,category:o.__("Main Area")})),t.shell.add(a,"menu",{rank:100}),a}};function Me(t,e,n){const{commands:r,shell:i}=t;f({id:p.undo,commands:r,shell:i,semanticCommands:e.undoers.undo,default:{label:n.__("Undo")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.redo,commands:r,shell:i,semanticCommands:e.undoers.redo,default:{label:n.__("Redo")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.clearCurrent,commands:r,shell:i,semanticCommands:e.clearers.clearCurrent,default:{label:n.__("Clear")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.clearAll,commands:r,shell:i,semanticCommands:e.clearers.clearAll,default:{label:n.__("Clear All")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.goToLine,commands:r,shell:i,semanticCommands:e.goToLiners,default:{label:n.__("Go to Line…")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n})}function ke(t,e,n,r){const{commands:i,shell:c}=t;f({id:p.closeAndCleanup,commands:i,shell:c,semanticCommands:e.closeAndCleaners,default:{execute:"application:close",label:r.__("Close and Shut Down"),isEnabled:!0},overrides:{isEnabled:()=>!!t.shell.currentWidget&&!!t.shell.currentWidget.title.closable,describedBy:{args:{type:"object",properties:{}}}},trans:r}),f({id:p.createConsole,commands:i,shell:c,semanticCommands:e.consoleCreators,default:{label:r.__("New Console for Activity")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:r}),i.addCommand(p.shutdown,{label:r.__("Shut Down"),caption:r.__("Shut down %1",t.name),isVisible:()=>e.quitEntry,isEnabled:()=>e.quitEntry,describedBy:{args:{type:"object",properties:{}}},execute:()=>I({title:r.__("Shutdown confirmation"),body:r.__("Please confirm you want to shut down %1.",t.name),buttons:[T.cancelButton(),T.warnButton({label:r.__("Shut Down")})]}).then(async u=>{if(u.button.accept){const o=t.serviceManager.serverSettings,a=J.URLExt.join(o.baseUrl,"api/shutdown");try{await Promise.all([t.serviceManager.sessions.shutdownAll(),t.serviceManager.terminals.shutdownAll()])}catch(l){console.log(`Failed to shutdown sessions and terminals: ${l}`)}return P.ServerConnection.makeRequest(a,{method:"POST"},o).then(l=>{if(l.ok){const s=document.createElement("div"),d=document.createElement("p");d.textContent=r.__("You have shut down the Jupyter server. You can now close this tab.");const b=document.createElement("p");b.textContent=r.__("To use %1 again, you will need to relaunch it.",t.name),s.appendChild(d),s.appendChild(b),I({title:r.__("Server stopped"),body:new se({node:s}),buttons:[]}),window.close()}else throw new P.ServerConnection.ResponseError(l)}).catch(l=>{throw new P.ServerConnection.NetworkError(l)})}})}),i.addCommand(p.logout,{label:r.__("Log Out"),caption:r.__("Log out of %1",t.name),isVisible:()=>e.quitEntry,isEnabled:()=>e.quitEntry,describedBy:{args:{type:"object",properties:{}}},execute:()=>{n.navigate("/logout",{hard:!0})}})}function Re(t,e,n){const{commands:r,shell:i}=t;f({id:p.interruptKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.interruptKernel,default:{label:n.__("Interrupt Kernel"),caption:n.__("Interrupt the kernel")},overrides:{icon:c=>c.toolbar?oe:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.reconnectToKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.reconnectToKernel,default:{label:n.__("Reconnect to Kernel")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.restartKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.restartKernel,default:{label:n.__("Restart Kernel…"),caption:n.__("Restart the kernel")},overrides:{icon:c=>c.toolbar?ae:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.restartKernelAndClear,commands:r,shell:i,semanticCommands:[e.kernelUsers.restartKernel,e.kernelUsers.clearWidget],default:{label:n.__("Restart Kernel and Clear…")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.changeKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.changeKernel,default:{label:n.__("Change Kernel…")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.shutdownKernel,commands:r,shell:i,semanticCommands:e.kernelUsers.shutdownKernel,default:{label:n.__("Shut Down Kernel"),caption:n.__("Shut down kernel")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),r.addCommand(p.shutdownAllKernels,{label:n.__("Shut Down All Kernels…"),isEnabled:()=>!t.serviceManager.sessions.running().next().done,describedBy:{args:{type:"object",properties:{}}},execute:()=>I({title:n.__("Shut Down All?"),body:n._n("Are you sure you want to permanently shut down the running kernel?","Are you sure you want to permanently shut down the %1 running kernels?",t.serviceManager.kernels.runningCount),buttons:[T.cancelButton(),T.warnButton({label:n.__("Shut Down All")})]}).then(c=>{if(c.button.accept)return t.serviceManager.sessions.shutdownAll()})})}function je(t,e,n){const{commands:r,shell:i}=t;f({id:p.lineNumbering,commands:r,shell:i,semanticCommands:e.editorViewers.toggleLineNumbers,default:{label:n.__("Show Line Numbers")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.minimap,commands:r,shell:i,semanticCommands:e.editorViewers.toggleMinimap,default:{label:n.__("Show Minimap")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.matchBrackets,commands:r,shell:i,semanticCommands:e.editorViewers.toggleMatchBrackets,default:{label:n.__("Match Brackets")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.wordWrap,commands:r,shell:i,semanticCommands:e.editorViewers.toggleWordWrap,default:{label:n.__("Wrap Words")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n})}function Ae(t,e,n){const{commands:r,shell:i}=t;f({id:p.run,commands:r,shell:i,semanticCommands:e.codeRunners.run,default:{label:n.__("Run Selected"),caption:n.__("Run Selected")},overrides:{icon:c=>c.toolbar?de:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.runAll,commands:r,shell:i,semanticCommands:e.codeRunners.runAll,default:{label:n.__("Run All"),caption:n.__("Run All")},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n}),f({id:p.restartAndRunAll,commands:r,shell:i,semanticCommands:[e.codeRunners.restart,e.codeRunners.runAll],default:{label:n.__("Restart Kernel and Run All"),caption:n.__("Restart Kernel and Run All")},overrides:{icon:c=>c.toolbar?le:void 0,describedBy:{args:{type:"object",properties:{}}}},trans:n})}function Be(t,e,n,r){const i=t.commands,c=[];let u;i.addCommand(p.activateById,{label:a=>{if(a.id===void 0)return r.__("Activate a widget by its `id`.");const l=a.id||"",s=Z(t.shell.widgets("main"),d=>d.id===l);return s&&s.title.label||""},isToggled:a=>{const l=a.id||"";return!!t.shell.currentWidget&&t.shell.currentWidget.id===l},describedBy:{args:{type:"object",properties:{id:{type:"string",description:r.__("The widget id to activate")}},required:["id"]}},execute:a=>t.shell.activateById(a.id||"")});let o="";i.addCommand(p.activatePreviouslyUsedTab,{label:r.__("Activate Previously Used Tab"),isEnabled:()=>!!o,describedBy:{args:{type:"object",properties:{}}},execute:()=>i.execute(p.activateById,{id:o})}),n&&t.restored.then(()=>{const a=()=>{u&&!u.isDisposed&&u.dispose(),c.length=0;let l=!1;for(const s of t.shell.widgets("main"))s.id===o&&(l=!0),c.push({command:p.activateById,args:{id:s.id}});u=e.addGroup(c,1),o=l?o:""};a(),n.layoutModified.connect(()=>{a()}),n.currentChanged.connect((l,s)=>{const d=s.oldValue;d&&(o=d.id)})})}function Ce(t,e,n){const{commands:r,shell:i}=t;f({id:p.getKernel,commands:r,shell:i,semanticCommands:e.getKernel,default:{label:n.__("Get Kernel"),isVisible:!1},overrides:{describedBy:{args:{type:"object",properties:{}}}},trans:n})}const Tt=[we,ye];var Y;(function(t){async function e(r){(await I({title:r.__("Information"),body:r.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[T.cancelButton(),T.okButton({label:r.__("Reload")})]})).button.accept&&location.reload()}async function n(r,i,c,u){var o;const a=u.load("jupyterlab");let l=null,s={};function d(m){var g,M;s={};const A=Object.keys(r.plugins).map(y=>{var k,w;const R=(w=(k=r.plugins[y].schema["jupyter.lab.menus"])===null||k===void 0?void 0:k.main)!==null&&w!==void 0?w:[];return s[y]=R,R}).concat([(M=(g=m["jupyter.lab.menus"])===null||g===void 0?void 0:g.main)!==null&&M!==void 0?M:[]]).reduceRight((y,k)=>E.reconcileMenus(y,k,!0),m.properties.menus.default);m.properties.menus.default=E.reconcileMenus(A,m.properties.menus.default,!0).sort((y,k)=>{var w,R;return((w=y.rank)!==null&&w!==void 0?w:1/0)-((R=k.rank)!==null&&R!==void 0?R:1/0)})}r.transform(L,{compose:m=>{var g,M,A,y;l||(l=K.deepCopy(m.schema),d(l));const k=(A=(M=(g=l.properties)===null||g===void 0?void 0:g.menus)===null||M===void 0?void 0:M.default)!==null&&A!==void 0?A:[],w={...m.data.user,menus:(y=m.data.user.menus)!==null&&y!==void 0?y:[]},R={...m.data.composite,menus:E.reconcileMenus(k,w.menus)};return m.data={composite:R,user:w},m},fetch:m=>(l||(l=K.deepCopy(m.schema),d(l)),{data:m.data,id:m.id,raw:m.raw,schema:l,version:m.version})});const b=await r.load(L),h=(o=K.deepCopy(b.composite.menus))!==null&&o!==void 0?o:[],B=new Array;z.createMenus(h.filter(m=>!m.disabled).map(m=>{var g;return{...m,items:E.filterDisabledItems((g=m.items)!==null&&g!==void 0?g:[])}}),c).forEach(m=>{B.push(m),i(m)}),b.changed.connect(()=>{var m;const g=(m=b.composite.menus)!==null&&m!==void 0?m:[];K.deepEqual(h,g)||e(a)}),r.pluginChanged.connect(async(m,g)=>{var M,A,y;if(g!==L){const k=(M=s[g])!==null&&M!==void 0?M:[],w=(y=(A=r.plugins[g].schema["jupyter.lab.menus"])===null||A===void 0?void 0:A.main)!==null&&y!==void 0?y:[];if(!K.deepEqual(k,w))if(s[g])await e(a);else{s[g]=K.deepCopy(w);const R=E.reconcileMenus(w,h,!1,!1).filter(x=>!x.disabled).map(x=>{var O;return{...x,items:E.filterDisabledItems((O=x.items)!==null&&O!==void 0?O:[])}});z.updateMenus(B,R,c).forEach(x=>{i(x)})}}})}t.loadSettingsMenu=n})(Y||(Y={}));export{p as CommandIDs,Tt as default};
@@ -1,3 +1,3 @@
1
- import{aw as L,ck as R,bg as A,_ as w,co as D}from"../datalayer-app-main.js";import{I as O}from"./token-d9po19EN.js";import{b as z}from"./index-9EhrHHj7.js";import"./Output-D-7eUege.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-D7aXShZc.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-DyX4EYyN.js";import"./index-BbcMy3Al.js";import"./KernelVariables-D3DSQaD3.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-BMjQTGrr.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./sessions-CgjtuOSm.js";import"./tokens-CBhRbpQP.js";import"./drivecontents-D1HzL7Fi.js";import"./kernel-BmfZmtIo.js";const C=new L("@jupyterlab/mermaid:IMermaidMarkdown","a manager for rendering mermaid text-based diagrams in markdown fenced code blocks"),g="```~~~",G=/^<h[1-6]\b[^>]*>/i;function N(c,m){return{render:t=>f.render(t,c,m),getHeadingTokens:t=>f.getHeadingTokens(t,m)}}const Ne={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:!0,provides:z,requires:[O],optional:[C],activate:(c,m,t)=>N(m,{blocks:t?[t]:[]})};var f;(function(c){let m=null,t=null,p=[],d=null,_={},h=new R.LruCache;async function b(e,r,a){return d=r,t||(t=await k(a)),t(e,_)}c.render=b;async function k(e){if(t)return t;if(m)return await m.promise;p=e?.blocks||[],p=p.sort((i,o)=>{var l,n;return((l=i.rank)!==null&&l!==void 0?l:1/0)-((n=o.rank)!==null&&n!==void 0?n:1/0)}),m=new A;const[{marked:r,Renderer:a},s]=await Promise.all([w(()=>import("./marked.esm-eXxjURbE.js"),[],import.meta.url),E()]);for(const i of s)r.use(i);return _={async:!0,gfm:!0,walkTokens:M,renderer:$(a)},t=r,m.resolve(t),t}c.initializeMarked=k;async function E(){return Promise.all([(async()=>(await w(async()=>{const{gfmHeadingId:e}=await import("./src-MJc5X3wa.js");return{gfmHeadingId:e}},[],import.meta.url)).gfmHeadingId())(),(async()=>(await w(async()=>{const{mangle:e}=await import("./src-96ipjnQx.js");return{mangle:e}},[],import.meta.url)).mangle())()])}function $(e){const r=new e,a=r.code;return r.code=s=>{const{text:i,lang:o}=s;for(const u of p)if(o&&u.languages.includes(o)){const I=u.render(i);if(I!=null)return I}const l=`${o}${g}${i}${g}`,n=h.get(l);return n??a.call(r,s)},r}async function x(e){const{lang:r,text:a}=e;if(!r||!d)return;const s=`${r}${g}${a}${g}`;if(h.get(s))return;const i=document.createElement("div");try{await d.highlight(a,d.findBest(r),i);const o=`<pre><code class="language-${r}">${i.innerHTML}</code></pre>`;h.set(s,o)}catch(o){console.error(`Failed to highlight ${r} code`,o)}finally{i.remove()}}async function M(e){switch(e.type){case"code":if(e.lang){for(const r of p)if(r.languages.includes(e.lang)){await r.walk(e.text);return}}await x(e)}}async function T(e,r){t||(t=await k(r));const a=new Array,{text:s,math:i}=D(e),o=t.lexer(v(s,i,P));let l=0;for(const n of o){const u=v(n.raw,i);(n.type==="heading"||n.type==="html"&&y(n.raw)||n.type==="paragraph"&&H(n))&&a.push({raw:u,line:l}),l+=u.split(`
1
+ import{aw as L,cd as R,bg as A,_ as k,ch as D}from"../datalayer-app-main.js";import{I as O}from"./token-d9po19EN.js";import{b as z}from"./index-B6-uQd5L.js";import"./Output-D9cwH5rg.js";import"./index-JmqWOkdt.js";import"./hoverbox-CStlKQWE.js";import"./index-qhxI1VzX.js";import"./index-CEeyR3FZ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-DXPIz0Km.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-We9CyR7b.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DpN8KK6c.js";import"./KernelVariables-CXQagESp.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-D36duUxK.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BAjGB6b-.js";import"./sessions-DdXtI_C1.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";const C=new L("@jupyterlab/mermaid:IMermaidMarkdown","a manager for rendering mermaid text-based diagrams in markdown fenced code blocks"),g="```~~~",G=/^<h[1-6]\b[^>]*>/i;function N(c,m){return{render:t=>f.render(t,c,m),getHeadingTokens:t=>f.getHeadingTokens(t,m)}}const Ne={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:!0,provides:z,requires:[O],optional:[C],activate:(c,m,t)=>N(m,{blocks:t?[t]:[]})};var f;(function(c){let m=null,t=null,p=[],u=null,_={},h=new R.LruCache;async function b(e,r,a){return u=r,t||(t=await w(a)),t(e,_)}c.render=b;async function w(e){if(t)return t;if(m)return await m.promise;p=e?.blocks||[],p=p.sort((i,o)=>{var l,n;return((l=i.rank)!==null&&l!==void 0?l:1/0)-((n=o.rank)!==null&&n!==void 0?n:1/0)}),m=new A;const[{marked:r,Renderer:a},s]=await Promise.all([k(()=>import("./marked.esm-eXxjURbE.js"),[],import.meta.url),E()]);for(const i of s)r.use(i);return _={async:!0,gfm:!0,walkTokens:M,renderer:$(a)},t=r,m.resolve(t),t}c.initializeMarked=w;async function E(){return Promise.all([(async()=>(await k(async()=>{const{gfmHeadingId:e}=await import("./src-MJc5X3wa.js");return{gfmHeadingId:e}},[],import.meta.url)).gfmHeadingId())(),(async()=>(await k(async()=>{const{mangle:e}=await import("./src-96ipjnQx.js");return{mangle:e}},[],import.meta.url)).mangle())()])}function $(e){const r=new e,a=r.code;return r.code=s=>{const{text:i,lang:o}=s;for(const d of p)if(o&&d.languages.includes(o)){const I=d.render(i);if(I!=null)return I}const l=`${o}${g}${i}${g}`,n=h.get(l);return n??a.call(r,s)},r}async function x(e){const{lang:r,text:a}=e;if(!r||!u)return;const s=`${r}${g}${a}${g}`;if(h.get(s))return;const i=document.createElement("div");try{await u.highlight(a,u.findBest(r),i);const o=`<pre><code class="language-${r}">${i.innerHTML}</code></pre>`;h.set(s,o)}catch(o){console.error(`Failed to highlight ${r} code`,o)}finally{i.remove()}}async function M(e){switch(e.type){case"code":if(e.lang){for(const r of p)if(r.languages.includes(e.lang)){await r.walk(e.text);return}}await x(e)}}async function T(e,r){t||(t=await w(r));const a=new Array,{text:s,math:i}=D(e),o=t.lexer(v(s,i,P));let l=0;for(const n of o){const d=v(n.raw,i);(n.type==="heading"||n.type==="html"&&y(n.raw)||n.type==="paragraph"&&H(n))&&a.push({raw:d,line:l}),l+=d.split(`
2
2
  `).length-1}return a}c.getHeadingTokens=T;function y(e){return G.test(e)}function H(e){return e.tokens?e.tokens.some(r=>r.type==="html"&&y(r.raw)):!1}function P(e){return/^\$[^$]/.test(e)&&e.includes(`
3
3
  `)}function v(e,r,a=()=>!0){const s=/@@(\d+)@@/g;let i="",o=0,l;for(;(l=s.exec(e))!==null;){const n=r[Number(l[1])];n===void 0?s.lastIndex=l.index+1:a(n)&&(i+=e.slice(o,l.index)+n.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"),o=s.lastIndex)}return i+e.slice(o)}})(f||(f={}));export{N as createMarkdownParser,Ne as default};
@@ -1,4 +1,4 @@
1
- import{a9 as R,aF as I,aA as O,fO as M,r as n,dI as w,cn as b,fP as q,eG as F,fQ as H,fR as U,az as J,fS as k,ec as x,dQ as W,fT as z,fU as $,cv as Q,J as P,aC as V,et as G,aD as Y,dy as X,dv as Z}from"../datalayer-app-main.js";import{H as tt}from"./htmlselect-CqXICb9e.js";import{o as et}from"./index-9EhrHHj7.js";import{a as st}from"./tokens-BYcJtuKD.js";import{I as ot}from"./tokens-DY_UrMLq.js";import"./Output-D-7eUege.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-D7aXShZc.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-DyX4EYyN.js";import"./index-BbcMy3Al.js";import"./KernelVariables-D3DSQaD3.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-BMjQTGrr.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./sessions-CgjtuOSm.js";import"./tokens-CBhRbpQP.js";import"./drivecontents-D1HzL7Fi.js";import"./kernel-BmfZmtIo.js";class it{constructor(e){this.reset=()=>{this._shortcut={id:"new shortcut",command:"",keybindings:[],selector:"body",category:"",args:{}},this._changed.emit()},this.addKeybinding=async(t,o)=>{this._shortcut.keybindings.push({keys:o,isDefault:!1}),this._changed.emit()},this.replaceKeybinding=async(t,o,s)=>{if(s=s.filter(i=>i!==""),!s.length)return this.deleteKeybinding(t,o);const r=this._shortcut.keybindings.findIndex(i=>i.keys===o.keys);r>-1?this._shortcut.keybindings[r]={keys:s,isDefault:!1}:this.addKeybinding(t,s),this._changed.emit()},this.deleteKeybinding=async(t,o)=>{const s=this._shortcut.keybindings.findIndex(r=>r.keys===o.keys);s>-1&&(this._shortcut.keybindings.splice(s,1),this._changed.emit())},this.resetKeybindings=async t=>{this._shortcut={...this._shortcut,keybindings:[]},this._changed.emit()},this.setCustomOptions=async(t,o)=>(this._shortcut={...this._shortcut,selector:o.selector,args:o.args},this._changed.emit(),!0),this.updateCommand=(t,o)=>{this._shortcut={...this._shortcut,command:t,category:o},this._changed.emit()},this._changed=new R(this),this._shortcut={id:"new shortcut",command:"",keybindings:[],selector:"body",category:"",args:{}},this.findConflictsFor=e.findConflictsFor,this.showSelectors=e.showSelectors,this.external=e.external}get shortcut(){return this._shortcut}get changed(){return this._changed}}class rt extends I{constructor(e){const{shortcut:t,translator:o,editorFactory:s}=e,r=o.load("jupyterlab"),i=new nt(t,o,s,()=>this._checkValidation(),e.readOnly),a=[];e.readOnly?a.push(I.cancelButton({label:r.__("OK")})):(a.push(I.cancelButton({label:r.__("Cancel")})),a.push(I.okButton({label:r.__("Apply")}))),super({title:e.readOnly?r.__("Shortcut Options"):r.__("Custom Shortcut Options"),body:i,buttons:a})}_evtKeydown(e){if(e.key==="Enter"){const t=this.node.querySelector(".jp-JSONEditor"),o=document.activeElement;if(t instanceof HTMLElement&&o instanceof HTMLElement&&t.contains(o)){e.stopPropagation();return}}super._evtKeydown(e)}}class nt extends O{constructor(e,t,o,s,r){var i,a;super();const c=t.load("jupyterlab");this.addClass("jp-Shortcuts-CustomOptionsDialogBody");const g=document.createElement("div");g.className="jp-Shortcuts-CustomOptionDialog-container";const p=document.createElement("label");p.textContent=c.__("Selector:"),p.className="jp-Dialog-label",this._selectorInput=document.createElement("input"),this._selectorInput.type="text",this._selectorInput.disabled=r??!1,this._selectorInput.value=e.selector,this._selectorInput.className="jp-mod-styled",g.appendChild(p),g.appendChild(this._selectorInput);const f=document.createElement("label");if(f.textContent=c.__("Arguments:"),f.className="jp-Dialog-label",g.appendChild(f),r){const d=document.createElement("pre");d.textContent=JSON.stringify((i=e.args)!==null&&i!==void 0?i:{},void 0,2),g.appendChild(d)}else this._editorWidget=new at((a=e.args)!==null&&a!==void 0?a:{},o,s),g.appendChild(this._editorWidget.node);this.node.appendChild(g)}getValue(){var e,t;const o=(t=(e=this._editorWidget)===null||e===void 0?void 0:e.getJSON())!==null&&t!==void 0?t:"{}";let s;try{s=JSON.parse(o)}catch(r){console.error(`Invalid JSON in arguments: ${r instanceof Error?r.message:String(r)}`),s={}}return{selector:this._selectorInput.value,args:s}}dispose(){var e;(e=this._editorWidget)===null||e===void 0||e.dispose(),super.dispose()}}class at extends O{constructor(e,t,o){super(),this._validateJSON=()=>{try{const a=this._editor.model.sharedModel.getSource();JSON.parse(a),this.node.classList.remove("jp-mod-error")}catch{this.node.classList.add("jp-mod-error")}this._checkValidation()},this.addClass("jp-JSONEditor"),this._checkValidation=o;const s=document.createElement("div");s.className="jp-JSONEditor-host";const r=new M.Model({mimeType:"application/json"}),i=JSON.stringify(e,null,2);r.sharedModel.setSource(i),this._editor=t({host:s,model:r,config:{readOnly:!1}}),this.node.appendChild(s),this._editor.model.sharedModel.changed.connect(this._validateJSON,this)}getJSON(){return this._editor.model.sharedModel.getSource()}dispose(){this._editor.model.sharedModel.changed.disconnect(this._validateJSON,this),this._editor.dispose(),super.dispose()}}const D="jp-Shortcuts-ConflictContainer";class A extends n.Component{constructor(e){super(e),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?this.props.toggleInput():await this._updateShortcut():(await this._updateShortcut(),this.props.toggleInput())},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this._handleOverwrite=async(t,o)=>{const s=o.map(w.normalizeKeystroke);for(const r of t){const i=r.keybindings.filter(a=>b.deepEqual(a.keys,s)||s.some(c=>b.deepEqual(a.keys,[c])))[0];if(!i){console.error(`Conflicting binding could not be found for ${r} using keys ${o}`);continue}await this.props.deleteKeybinding(r,i)}await this._updateShortcut()},this.parseChaining=(t,o,s,r,i)=>{let a=q.keyForKeydownEvent(t.nativeEvent);const c=["Shift","Control","Alt","Meta","Ctrl","Accel"];if(t.key==="Backspace")s="",o="",r=[],i="",this.setState({value:o,userInput:s,keys:r,currentChain:i});else if(t.key!=="CapsLock"){const g=s.substr(s.lastIndexOf(" ")+1,s.length).trim();c.lastIndexOf(g)===-1&&g!=""?(s=s+",",r.push(i),i="",t.ctrlKey&&t.key!="Control"&&(s=(s+" Ctrl").trim(),i=(i+" Ctrl").trim()),t.metaKey&&t.key!="Meta"&&(s=(s+" Accel").trim(),i=(i+" Accel").trim()),t.altKey&&t.key!="Alt"&&(s=(s+" Alt").trim(),i=(i+" Alt").trim()),t.shiftKey&&t.key!="Shift"&&(s=(s+" Shift").trim(),i=(i+" Shift").trim()),c.lastIndexOf(t.key)===-1?(s=(s+" "+a).trim(),i=(i+" "+a).trim()):t.key==="Meta"?(s=(s+" Accel").trim(),i=(i+" Accel").trim()):t.key==="Control"?(s=(s+" Ctrl").trim(),i=(i+" Ctrl").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),i=(i+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),i=(i+" Alt").trim()):(s=(s+" "+t.key).trim(),i=(i+" "+t.key).trim())):t.key==="Control"?(s=(s+" Ctrl").trim(),i=(i+" Ctrl").trim()):t.key==="Meta"?(s=(s+" Accel").trim(),i=(i+" Accel").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),i=(i+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),i=(i+" Alt").trim()):(s=(s+" "+a).trim(),i=(i+" "+a).trim())}return this.setState({keys:r,currentChain:i}),[s,r,i]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],o=this.state.currentChain.split(" "),s=o[o.length-1];return this.setState({isFunctional:t.indexOf(s)===-1}),t.indexOf(s)!==-1},this.checkShortcutAvailability=(t,o,s)=>{const r=this.props.findConflictsFor([...o,s],this.props.shortcut.selector),i=t===""||r.length===0;return!i&&r.length===1&&r[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:i}),r)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const o=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=o[0],r=o[1],i=o[2],a=this.props.toSymbols(s);let c=this.checkShortcutAvailability(s,r,i);this.setState({value:a,userInput:s,keys:r,currentChain:i},()=>{this.checkNonFunctional(),this._emitConflicts(c)})},this._handleBlur=t=>{var o,s;!((o=this._ref.current)===null||o===void 0)&&o.contains(t.relatedTarget)||!((s=t.relatedTarget)===null||s===void 0)&&s.closest(`.${D}`)||this.props.toggleInput()},this._ref=n.createRef(),this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_emitConflicts(e){const t=[...this.state.keys,this.state.currentChain];this.props.displayConflicts({conflictsWith:e,keys:this.state.keys,overwrite:async()=>{this.setState({isAvailable:!0}),await this._handleOverwrite(e,t),this.props.toggleInput()},cancel:()=>{this.props.toggleInput()}})}render(){const e=this.props.translator.load("jupyterlab");let t="jp-Shortcuts-Input";return this.state.isAvailable||(t+=" jp-mod-unavailable-Input"),n.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",ref:this._ref,onBlur:this._handleBlur},n.createElement("div",{tabIndex:0,className:t,onKeyDown:this.handleInput,ref:o=>o&&o.focus(),"data-lm-suppress-shortcuts":"true"},n.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":this.state.value===""?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},this.state.value===""?e.__("press keys"):this.state.value)),n.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit,tabIndex:0},this.state.isAvailable?n.createElement(F.react,null):n.createElement(H.react,null)))}}var C;(function(l){l.editBinding="shortcuts:edit-keybinding",l.addBinding="shortcuts:add-keybinding",l.deleteBinding="shortcuts:delete-keybinding",l.toggleSelectors="shortcuts:toggle-selectors",l.resetAll="shortcuts:reset-all"})(C||(C={}));var E;(function(l){l[l.Label=0]="Label",l[l.Category=1]="Category",l[l.Split=2]="Split",l[l.Default=3]="Default"})(E||(E={}));class j extends Map{constructor(e){var t,o,s,r;super();const{settings:i,commandRegistry:a,allCommands:c}=e;if(c)for(const g of a.listCommands()){const p={command:g,selector:"body"},f=this._computeTargetId(p),d=p.command.split(":"),m=(t=a.label(p.command,p.args))!==null&&t!==void 0?t:d.length>1?d[1]:void 0,u=d[0],y={...p,id:f,keybindings:[],category:u,label:m,args:{}};this.set(f,y)}else if(i){const g=(o=i.user.shortcuts)!==null&&o!==void 0?o:[],p=new Set(g.map(this._computeKeybindingId.bind(this))),f=(s=i.composite.shortcuts)!==null&&s!==void 0?s:[],d=i.default("shortcuts").map(m=>this._computeTargetId(m));for(const m of f){const u=this._computeTargetId(m),y=this._computeKeybindingId(m),h={keys:w.normalizeKeys(m),isDefault:!p.has(y),...m.preventDefault===void 0?{}:{preventDefault:m.preventDefault}},S=this.get(u);if(S)S.keybindings.push(h);else{const _=m.command.split(":"),K=(r=a.label(m.command,m.args))!==null&&r!==void 0?r:_.length>1?_[1]:void 0,B=_[0];this.set(u,{id:u,selector:m.selector,command:m.command,category:B,label:K,args:m.args,keybindings:[h],userDefined:!d.includes(u)})}}}}findConflictsFor(e,t){const o=new lt({registry:this}),s=e.map(w.normalizeKeystroke);let r=o.findConflicts(s,t);if(r.length!==0)return r;for(const i of s)if(r=o.findConflicts([i],t),r.length!==0)return r;return[]}_computeTargetId(e){var t;return e.command+"_"+e.selector+"_"+JSON.stringify((t=e.args)!==null&&t!==void 0?t:{})}_computeKeybindingId(e){var t;return[e.command,e.selector,JSON.stringify((t=e.args)!==null&&t!==void 0?t:{}),w.normalizeKeys(e).join(" ")].join("_")}}class lt{constructor(e){var t;const o=new Map;for(const s of e.registry.values())for(const r of s.keybindings){const i=this._keybindingHash(r.keys,s.selector),a=(t=o.get(i))!==null&&t!==void 0?t:[];a.push(s),o.set(i,a)}this._keybindingsMap=o}findConflicts(e,t){var o;const s=this._keybindingHash(e,t);return(o=this._keybindingsMap.get(s))!==null&&o!==void 0?o:[]}_keybindingHash(e,t){return e.join(" ")+"_"+t}}(function(l){function e(s){return s.replace(/\s+/g,"").toLowerCase()}function t(s,r){var i;const a=s.category.toLowerCase(),c=((i=s.label)!==null&&i!==void 0?i:"").toLowerCase(),g=`${a} ${c}`;let p=1/0,f=null;const d=/\b\w/g;for(;;){const S=d.exec(g);if(!S)break;const _=U.matchSumOfDeltas(g,r,S.index);if(!_)break;_&&_.score<=p&&(p=_.score,f=_.indices)}if(!f||p===1/0)return null;const m=a.length+1,u=J.lowerBound(f,m,(S,_)=>S-_),y=f.slice(0,u),h=f.slice(u);for(let S=0,_=h.length;S<_;++S)h[S]-=m;return y.length===0?{matchType:E.Label,categoryIndices:null,labelIndices:h,score:p,item:s}:h.length===0?{matchType:E.Category,categoryIndices:y,labelIndices:null,score:p,item:s}:{matchType:E.Split,categoryIndices:y,labelIndices:h,score:p,item:s}}function o(s,r){r=e(r);let i=[];for(const a of s.values()){if(!r){i.push({matchType:E.Default,categoryIndices:null,labelIndices:null,score:0,item:a});continue}let c=t(a,r);c&&i.push(c)}return i}l.matchItems=o})(j||(j={}));const ct={Ctrl:"⌃",Alt:"⌥",Shift:"⇧",Accel:"⌘",Cmd:"⌘"};class L extends n.Component{constructor(e){super(e),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput,conflicts:new Map})},this.toSymbols=t=>k.IS_MAC?t.split(" ").map(o=>{var s;return(s=ct[o])!==null&&s!==void 0?s:o}).join(" "):t.split(" ").map(o=>o==="Accel"?"Ctrl":o).join(" "),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(!("shortcutId"in t&&t.shortcutId!==this.props.shortcut.id)){if(t.request==="add-keybinding")return this.toggleInputNew();if(t.request==="edit-keybinding"&&this.toggleInputReplaceMethod(t.keybinding),t.request==="delete-keybinding"){const o=this.props.shortcut,s=o.keybindings[t.keybinding];this.props.deleteKeybinding(o,s).catch(console.error)}}}getCategoryCell(){return n.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var e;if(this.props.newShortcutUtils){const t=this._getFilteredCommands();return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement(tt,{value:this.props.shortcut.command,options:[{value:"",label:this._trans.__("Select a command")},...t.map(o=>({value:o.command,label:`${o.category}: ${o.label}`}))],onChange:o=>{var s,r,i;const a=t.find(c=>c.command===o.target.value);(s=this.props.newShortcutUtils)===null||s===void 0||s.updateCommand((r=a?.command)!==null&&r!==void 0?r:"",(i=a?.category)!==null&&i!==void 0?i:"")}}))}else return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:"jp-label"},(e=this.props.shortcut.label)!==null&&e!==void 0?e:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return n.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this.props.shortcut.userDefined?this._trans.__("Delete"):this._trans.__("Reset"))}getSourceCell(){var e;const t=this.props.shortcut.keybindings.every(r=>r.isDefault),o=this.props.shortcut.userDefined||!!this.props.newShortcutUtils,s=o?this._trans.__("Custom options"):this._trans.__("Show options");return n.createElement("div",{className:"jp-Shortcuts-Cell"},!this.props.newShortcutUtils&&n.createElement("div",{className:"jp-Shortcuts-SourceCell"},t?this._trans.__("Default"):this._trans.__("Custom")),t?"":this.getResetShortCutLink(),this.props.external.editorFactory&&n.createElement(x,{className:"jp-mod-styled jp-mod-reject jp-Shortcuts-CustomOptions",onClick:async()=>{if(!this.props.external.editorFactory){console.error("Cannot build the custom options form");return}const i=await new rt({shortcut:this.props.shortcut,translator:this.props.external.translator,editorFactory:this.props.external.editorFactory,readOnly:!o}).launch();i.button.accept&&o&&i.value&&await this.props.setCustomOptions(this.props.shortcut,i.value)},title:s,"aria-label":s,appearance:"neutral"},o?n.createElement(W.react,{tag:null}):n.createElement(z.react,{tag:null})),!!this.props.newShortcutUtils&&n.createElement(n.Fragment,null,n.createElement(x,{className:"jp-mod-styled jp-mod-accept jp-Shortcuts-SaveNew",onClick:(e=this.props.newShortcutUtils)===null||e===void 0?void 0:e.saveShortcut,title:this._trans.__("Save shortcut"),"aria-label":this._trans.__("Save shortcut"),appearance:"neutral",disabled:!this.props.shortcut.command||!this.props.shortcut.keybindings.length||this.props.shortcut.keybindings.every(r=>!r.keys||r.keys.length===0)},n.createElement(F.react,{tag:null}))))}getOptionalSelectorCell(){return this.props.showSelectors?n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(e){const t=["jp-Shortcuts-ShortcutCell"];switch(e.length){case 1:t.push("jp-Shortcuts-SingleCell");break;case 0:t.push("jp-Shortcuts-EmptyCell");break}return t.join(" ")}toggleInputReplaceMethod(e){const t=this.state.displayReplaceInput[e];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[e]:!t},conflicts:new Map})}getDisplayReplaceInput(e){return this.state.displayReplaceInput[e]}getOrDisplayIfNeeded(e){const t=["jp-Shortcuts-Or"];return(e||this.state.displayNewInput)&&t.push("jp-Shortcuts-Or-Forced"),n.createElement("div",{className:t.join(" ")},this._trans.__("or"))}getShortCutAsInput(e,t){return n.createElement(A,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(t),shortcut:this.props.shortcut,keybinding:e,displayConflicts:o=>{const s=new Map(this.state.conflicts);s.set(e,o),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(t),placeholder:this.toSymbols(e.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(e){return e.keys.map((t,o)=>n.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:o},n.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(t).split(" ").map((s,r,i)=>n.createElement(n.Fragment,{key:`${o}-${s}-${r}`},n.createElement("span",{className:"jp-ContextualShortcut-Key"},s),r+1<i.length?" + ":null))),o+1<e.keys.length?n.createElement("div",{className:"jp-Shortcuts-Comma"},","):null))}isLocationBeingEdited(e){return this.state.displayReplaceInput[e]}getDivForKey(e,t,o){return n.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+e,"data-keybinding":e,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(e)},this.isLocationBeingEdited(e)?this.getShortCutAsInput(t,e):this.getShortCutForDisplayOnly(t),!(e===this._nonEmptyBindings.length-1&&Object.values(this.state.displayReplaceInput).some(Boolean))&&this.getOrDisplayIfNeeded(e<this._nonEmptyBindings.length-1))}getAddLink(){return n.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?n.createElement(A,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:e=>{const t=new Map(this.state.conflicts);t.set(null,e),this.setState({conflicts:t})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):n.createElement("div",null)}getShortCutsCell(e){return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:this.getClassNameForShortCuts(e)},e.map((t,o)=>this.getDivForKey(o,t,e)),e.length>=1&&!this.state.displayNewInput&&!Object.values(this.state.displayReplaceInput).some(Boolean)&&this.getAddLink(),e.length===0&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const e=[...this.state.conflicts.values()].filter(t=>t.conflictsWith.length!==0);return e.length===0?n.createElement(n.Fragment,null):n.createElement("div",{className:"jp-Shortcuts-Row jp-Shortcuts-RowWithConflict"},n.createElement("div",{className:D},e.map(t=>{const o=t.keys.join(" ")+"_"+t.conflictsWith.map(s=>s.id).join("");return n.createElement("div",{className:"jp-Shortcuts-Conflict",key:o},n.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map(s=>{var r;return(r=s.label)!==null&&r!==void 0?r:s.command}).join(", "))),n.createElement("div",{className:"jp-Shortcuts-ErrorButton"},n.createElement("button",{className:"jp-Button jp-mod-reject jp-mod-styled",onClick:()=>{this._clearConflict(t),t.cancel()}},this._trans.__("Cancel")),n.createElement("button",{className:"jp-Button jp-mod-warn jp-mod-styled",onClick:()=>{this._clearConflict(t),t.overwrite()}},this._trans.__("Overwrite"))))})))}_clearConflict(e){const t=new Map,o=this._conflictId(e);for(const[s,r]of this.state.conflicts.entries())this._conflictId(r)!==o&&t.set(s,r);this.setState({conflicts:t})}_conflictId(e){return e.keys.join(" ")+"_"+e.conflictsWith.map(t=>t.id).join("")}_getFilteredCommands(){var e,t;const o=new j({commandRegistry:this.props.external.commandRegistry,allCommands:!0}),s=j.matchItems(o,(t=(e=this.props.newShortcutUtils)===null||e===void 0?void 0:e.searchQuery)!==null&&t!==void 0?t:"").map(r=>r.item).filter(r=>!r.command.startsWith("__internal:"));return s.sort((r,i)=>{var a,c;const g=r.category,p=i.category,f=g.localeCompare(p);if(f)return f;{const d=(a=r.label)!==null&&a!==void 0?a:"",m=(c=i.label)!==null&&c!==void 0?c:"";return d.localeCompare(m)}}),s}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter(e=>e.keys.filter(t=>t!="").length!==0)}render(){return n.createElement(n.Fragment,null,n.createElement("div",{className:`jp-Shortcuts-Row${this.props.newShortcutUtils?" jp-Shortcuts-Row-newShortcut":""}`,"data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}const dt=115;class ht extends n.Component{render(){return n.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:`${this.props.height-dt}px`},id:"shortcutListContainer"},n.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map(e=>n.createElement(L,{key:e.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,setCustomOptions:this.props.setCustomOptions,shortcut:e,showSelectors:this.props.showSelectors,external:this.props.external}))))}}class ut extends n.Component{render(){return n.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,n.createElement($.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function pt(l){const e=l.translator.load("jupyterlab");return n.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},n.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>l.toggleSelectors()},l.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),n.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>l.resetShortcuts()},e.__("Reset All")),n.createElement(x,{className:"jp-mod-styled jp-mod-accept jp-Shortcuts-AdvancedOptionsButton",onClick:l.toggleAddCommandRow,title:e.__("Tool for adding shortcuts"),"aria-label":e.__("Tool for adding shortcuts")},n.createElement(Q.react,{tag:"span",elementSize:"xlarge",elementPosition:"center"})))}class mt extends n.Component{constructor(e){super(e)}getShortCutTitleItem(e,t){return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement(ut,{title:e,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:t}))}render(){const e=this.props.translator.load("jupyterlab");return n.createElement("div",{className:"jp-Shortcuts-Top"},n.createElement("div",{className:"jp-Shortcuts-TopNav"},n.createElement(et,{"aria-label":e.__("Search shortcuts"),updateFilter:(t,o)=>this.props.updateSearchQuery(o??""),placeholder:e.__("Search…"),useFuzzyFilter:!1}),n.createElement(pt,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,toggleAddCommandRow:this.props.toggleAddCommandRow,translator:this.props.translator})),n.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},n.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(e.__("Category"),"category"),this.getShortCutTitleItem(e.__("Command"),"command"),n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:"title-div"},e.__("Shortcut"))),this.getShortCutTitleItem(e.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(e.__("Selectors"),"selector"))))}}class gt extends n.Component{constructor(e){super(e),this.updateSearchQuery=t=>{this.setState({searchQuery:t},()=>{const o=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(o)},()=>{this.sortShortcuts()})})},this.resetShortcuts=async()=>{await(await this.props.external.getSettings()).set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{await this._setKeybinding(t,[])},this.replaceKeybinding=async(t,o,s)=>this._setKeybinding(t,s,o),this.deleteKeybinding=async(t,o)=>{await this._setKeybinding(t,[],o)},this.addKeybinding=async(t,o)=>{await this._setKeybinding(t,o)},this.setCustomOptions=async(t,o)=>{var s;const r=await this.props.external.getSettings(),i=(s=r.user.shortcuts)!==null&&s!==void 0?s:[],a=i.filter(c=>{var g,p;return c.command===t.command&&c.selector===t.selector&&b.deepEqual((g=c.args)!==null&&g!==void 0?g:{},(p=t.args)!==null&&p!==void 0?p:{})});return a.length?(a.forEach(c=>{c.selector=o.selector,c.args=o.args}),await r.set("shortcuts",i),await this._refreshShortcutList(),!0):(console.error("Error writing the custom options: target not found"),!1)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.toggleAddCommandRow=async()=>{this.setState({showAddCommand:!this.state.showAddCommand})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.saveNewShortcut=async()=>{const t={...this.state.newShortcut,args:void 0};for(let s of t.keybindings)await this.addKeybinding(t,s.keys);await this.setCustomOptions(t,{selector:t.selector,args:this.state.newShortcut.args})&&(this._newShortcutItem.reset(),this.toggleAddCommandRow())},this._newShortcutItem=new it({showSelectors:!1,findConflictsFor:(t,o)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(t,o):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),external:this.props.external}),this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category",showAddCommand:!1,newShortcut:this._newShortcutItem.shortcut},this._newShortcutItem.changed.connect(()=>{this.setState({newShortcut:{...this._newShortcutItem.shortcut}})})}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(t.request==="toggle-selectors")return this.toggleSelectors();t.request==="reset-all"&&await this.resetShortcuts()}async _refreshShortcutList(){const e=await this.props.external.getSettings(),t=new j({commandRegistry:this.props.external.commandRegistry,settings:e});this.setState({shortcutRegistry:t,filteredShortcutList:this._searchFilterShortcuts(t),shortcutsFetched:!0},()=>{this.sortShortcuts()})}_searchFilterShortcuts(e){return e?j.matchItems(e,this.state.searchQuery).map(o=>o.item):[]}async _setKeybinding(e,t,o){var s,r,i,a,c;t.length===1&&t[0]==""&&(t=[]);const g=t.map(w.normalizeKeystroke),p=await this.props.external.getSettings(),f=(s=p.user.shortcuts)!==null&&s!==void 0?s:[],d=[];let m=!1;for(let u of f)if(u.command===e.command&&u.selector===e.selector&&b.deepEqual((r=u.args)!==null&&r!==void 0?r:{},(i=e.args)!==null&&i!==void 0?i:{})&&o&&b.deepEqual(o.keys,w.normalizeKeys(u))){const y=o.isDefault&&b.deepEqual(o.keys,g);t.length!==0&&!y&&d.push(this._setShortcutKeys(u,t)),m=!0}else{if(u.command===e.command&&u.selector===e.selector&&b.deepEqual((a=u.args)!==null&&a!==void 0?a:{},(c=e.args)!==null&&c!==void 0?c:{})&&!o&&t.length===0)continue;d.push(u)}if(!m){const u=!o||!b.deepEqual(o.keys,g);o&&o.isDefault&&u&&d.push(this._shortcutFromTarget(e,o.keys,{disabled:!0,preventDefault:o.preventDefault})),t.length!==0&&u&&d.push(this._shortcutFromTarget(e,t,{preventDefault:o?.preventDefault}))}await p.set("shortcuts",d),await this._refreshShortcutList()}_setShortcutKeys(e,t){const o=this._platformKeys(e);return{...e,[o]:t}}_shortcutFromTarget(e,t,o={}){const s={command:e.command,selector:e.selector,keys:t};return e.args&&!b.deepEqual(e.args,{})&&(s.args=e.args),o.disabled&&(s.disabled=!0),o.preventDefault!==void 0&&(s.preventDefault=o.preventDefault),s}_platformKeys(e){return k.IS_WIN&&e.winKeys?"winKeys":k.IS_MAC&&e.macKeys?"macKeys":!k.IS_WIN&&!k.IS_MAC&&e.linuxKeys?"linuxKeys":"keys"}sortShortcuts(){const e=this.state.filteredShortcutList;let t=this.state.currentSort;t==="command"&&(t="label");const o=s=>{var r;return t==="source"?s.keybindings.every(i=>i.isDefault)?"default":"other":(r=s[t])!==null&&r!==void 0?r:""};e.sort((s,r)=>{var i,a;const c=o(s),g=o(r),p=c.localeCompare(g);if(p)return p;{const f=(i=s.label)!==null&&i!==void 0?i:"",d=(a=r.label)!==null&&a!==void 0?a:"";return f.localeCompare(d)}}),this.setState({filteredShortcutList:e})}render(){return this.state.shortcutsFetched?n.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},n.createElement(mt,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,toggleAddCommandRow:this.toggleAddCommandRow,width:this.props.width,translator:this.props.external.translator}),this.state.showAddCommand&&n.createElement(L,{...this._newShortcutItem,shortcut:this.state.newShortcut,newShortcutUtils:{searchQuery:this.state.searchQuery,updateCommand:this._newShortcutItem.updateCommand,saveShortcut:this.saveNewShortcut}}),n.createElement(ht,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,setCustomOptions:this.setCustomOptions,showSelectors:this.state.showSelectors,findConflictsFor:(e,t)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(e,t):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}const yt=l=>P.createElement(gt,{external:l.external,height:1e3,width:1e3}),T="@jupyterlab/shortcuts-extension:shortcuts";function ft(l,e,t,o,s){return{translator:t,getSettings:()=>l.load(T,!0),commandRegistry:e.commands,actionRequested:o,editorFactory:s}}const v={id:T,description:"Adds the keyboard shortcuts editor.",requires:[ot],optional:[V,st,G],activate:async(l,e,t,o,s)=>{const r=t??Y,i=r.load("jupyterlab"),{commands:a}=l;let c,g,p={};if(o){const d=new R({}),m=h=>h.dataset.shortcut!==void 0;l.commands.addCommand(C.editBinding,{label:i.__("Edit Keybinding"),caption:i.__("Edit existing keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const h=l.contextMenuHitTest(m),S=h?.dataset.keybinding,_=h?.dataset.shortcut;if(!_||!S)return console.log("Missing shortcut id/keybinding information");d.emit({request:"edit-keybinding",keybinding:parseInt(S,10),shortcutId:_})}}),l.commands.addCommand(C.deleteBinding,{label:i.__("Delete Keybinding"),caption:i.__("Delete chosen keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const h=l.contextMenuHitTest(m),S=h?.dataset.keybinding,_=h?.dataset.shortcut;if(!_||!S)return console.log("Missing shortcut id/keybinding information");d.emit({request:"delete-keybinding",keybinding:parseInt(S,10),shortcutId:_})}}),l.commands.addCommand(C.addBinding,{label:i.__("Add Keybinding"),caption:i.__("Add new keybinding for existing shortcut target"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const h=l.contextMenuHitTest(m),S=h?.dataset.shortcut;if(!S)return console.log("Missing shortcut id to add keybinding to");d.emit({request:"add-keybinding",shortcutId:S})}}),a.addCommand(C.toggleSelectors,{label:i.__("Toggle Selectors"),caption:i.__("Toggle command selectors"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{d.emit({request:"toggle-selectors"})}}),a.addCommand(C.resetAll,{label:i.__("Reset All"),caption:i.__("Reset all shortcuts"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{d.emit({request:"reset-all"})}});const u=s?h=>s.factoryService.newInlineEditor(h):void 0,y={fieldRenderer:h=>yt({external:ft(e,l,r,d,u),...h})};o.addRenderer(`${v.id}.shortcuts`,y)}function f(d){const m=l.commands.listCommands().join(`
1
+ import{a9 as R,aF as I,aA as O,fO as M,r as n,dI as w,cg as b,fP as q,eG as F,fQ as H,fR as U,az as J,fS as k,ec as x,dQ as W,fT as z,fU as $,co as Q,J as P,aC as V,et as G,aD as Y,dy as X,dv as Z}from"../datalayer-app-main.js";import{H as tt}from"./htmlselect-5N6NdDqL.js";import{o as et}from"./index-B6-uQd5L.js";import{a as st}from"./tokens-BYcJtuKD.js";import{I as ot}from"./tokens-DY_UrMLq.js";import"./Output-D9cwH5rg.js";import"./index-JmqWOkdt.js";import"./hoverbox-CStlKQWE.js";import"./index-qhxI1VzX.js";import"./index-CEeyR3FZ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-DXPIz0Km.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-We9CyR7b.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DpN8KK6c.js";import"./KernelVariables-CXQagESp.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-D36duUxK.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BAjGB6b-.js";import"./sessions-DdXtI_C1.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";class it{constructor(e){this.reset=()=>{this._shortcut={id:"new shortcut",command:"",keybindings:[],selector:"body",category:"",args:{}},this._changed.emit()},this.addKeybinding=async(t,o)=>{this._shortcut.keybindings.push({keys:o,isDefault:!1}),this._changed.emit()},this.replaceKeybinding=async(t,o,s)=>{if(s=s.filter(i=>i!==""),!s.length)return this.deleteKeybinding(t,o);const r=this._shortcut.keybindings.findIndex(i=>i.keys===o.keys);r>-1?this._shortcut.keybindings[r]={keys:s,isDefault:!1}:this.addKeybinding(t,s),this._changed.emit()},this.deleteKeybinding=async(t,o)=>{const s=this._shortcut.keybindings.findIndex(r=>r.keys===o.keys);s>-1&&(this._shortcut.keybindings.splice(s,1),this._changed.emit())},this.resetKeybindings=async t=>{this._shortcut={...this._shortcut,keybindings:[]},this._changed.emit()},this.setCustomOptions=async(t,o)=>(this._shortcut={...this._shortcut,selector:o.selector,args:o.args},this._changed.emit(),!0),this.updateCommand=(t,o)=>{this._shortcut={...this._shortcut,command:t,category:o},this._changed.emit()},this._changed=new R(this),this._shortcut={id:"new shortcut",command:"",keybindings:[],selector:"body",category:"",args:{}},this.findConflictsFor=e.findConflictsFor,this.showSelectors=e.showSelectors,this.external=e.external}get shortcut(){return this._shortcut}get changed(){return this._changed}}class rt extends I{constructor(e){const{shortcut:t,translator:o,editorFactory:s}=e,r=o.load("jupyterlab"),i=new nt(t,o,s,()=>this._checkValidation(),e.readOnly),a=[];e.readOnly?a.push(I.cancelButton({label:r.__("OK")})):(a.push(I.cancelButton({label:r.__("Cancel")})),a.push(I.okButton({label:r.__("Apply")}))),super({title:e.readOnly?r.__("Shortcut Options"):r.__("Custom Shortcut Options"),body:i,buttons:a})}_evtKeydown(e){if(e.key==="Enter"){const t=this.node.querySelector(".jp-JSONEditor"),o=document.activeElement;if(t instanceof HTMLElement&&o instanceof HTMLElement&&t.contains(o)){e.stopPropagation();return}}super._evtKeydown(e)}}class nt extends O{constructor(e,t,o,s,r){var i,a;super();const c=t.load("jupyterlab");this.addClass("jp-Shortcuts-CustomOptionsDialogBody");const g=document.createElement("div");g.className="jp-Shortcuts-CustomOptionDialog-container";const p=document.createElement("label");p.textContent=c.__("Selector:"),p.className="jp-Dialog-label",this._selectorInput=document.createElement("input"),this._selectorInput.type="text",this._selectorInput.disabled=r??!1,this._selectorInput.value=e.selector,this._selectorInput.className="jp-mod-styled",g.appendChild(p),g.appendChild(this._selectorInput);const f=document.createElement("label");if(f.textContent=c.__("Arguments:"),f.className="jp-Dialog-label",g.appendChild(f),r){const d=document.createElement("pre");d.textContent=JSON.stringify((i=e.args)!==null&&i!==void 0?i:{},void 0,2),g.appendChild(d)}else this._editorWidget=new at((a=e.args)!==null&&a!==void 0?a:{},o,s),g.appendChild(this._editorWidget.node);this.node.appendChild(g)}getValue(){var e,t;const o=(t=(e=this._editorWidget)===null||e===void 0?void 0:e.getJSON())!==null&&t!==void 0?t:"{}";let s;try{s=JSON.parse(o)}catch(r){console.error(`Invalid JSON in arguments: ${r instanceof Error?r.message:String(r)}`),s={}}return{selector:this._selectorInput.value,args:s}}dispose(){var e;(e=this._editorWidget)===null||e===void 0||e.dispose(),super.dispose()}}class at extends O{constructor(e,t,o){super(),this._validateJSON=()=>{try{const a=this._editor.model.sharedModel.getSource();JSON.parse(a),this.node.classList.remove("jp-mod-error")}catch{this.node.classList.add("jp-mod-error")}this._checkValidation()},this.addClass("jp-JSONEditor"),this._checkValidation=o;const s=document.createElement("div");s.className="jp-JSONEditor-host";const r=new M.Model({mimeType:"application/json"}),i=JSON.stringify(e,null,2);r.sharedModel.setSource(i),this._editor=t({host:s,model:r,config:{readOnly:!1}}),this.node.appendChild(s),this._editor.model.sharedModel.changed.connect(this._validateJSON,this)}getJSON(){return this._editor.model.sharedModel.getSource()}dispose(){this._editor.model.sharedModel.changed.disconnect(this._validateJSON,this),this._editor.dispose(),super.dispose()}}const D="jp-Shortcuts-ConflictContainer";class A extends n.Component{constructor(e){super(e),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?this.props.toggleInput():await this._updateShortcut():(await this._updateShortcut(),this.props.toggleInput())},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this._handleOverwrite=async(t,o)=>{const s=o.map(w.normalizeKeystroke);for(const r of t){const i=r.keybindings.filter(a=>b.deepEqual(a.keys,s)||s.some(c=>b.deepEqual(a.keys,[c])))[0];if(!i){console.error(`Conflicting binding could not be found for ${r} using keys ${o}`);continue}await this.props.deleteKeybinding(r,i)}await this._updateShortcut()},this.parseChaining=(t,o,s,r,i)=>{let a=q.keyForKeydownEvent(t.nativeEvent);const c=["Shift","Control","Alt","Meta","Ctrl","Accel"];if(t.key==="Backspace")s="",o="",r=[],i="",this.setState({value:o,userInput:s,keys:r,currentChain:i});else if(t.key!=="CapsLock"){const g=s.substr(s.lastIndexOf(" ")+1,s.length).trim();c.lastIndexOf(g)===-1&&g!=""?(s=s+",",r.push(i),i="",t.ctrlKey&&t.key!="Control"&&(s=(s+" Ctrl").trim(),i=(i+" Ctrl").trim()),t.metaKey&&t.key!="Meta"&&(s=(s+" Accel").trim(),i=(i+" Accel").trim()),t.altKey&&t.key!="Alt"&&(s=(s+" Alt").trim(),i=(i+" Alt").trim()),t.shiftKey&&t.key!="Shift"&&(s=(s+" Shift").trim(),i=(i+" Shift").trim()),c.lastIndexOf(t.key)===-1?(s=(s+" "+a).trim(),i=(i+" "+a).trim()):t.key==="Meta"?(s=(s+" Accel").trim(),i=(i+" Accel").trim()):t.key==="Control"?(s=(s+" Ctrl").trim(),i=(i+" Ctrl").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),i=(i+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),i=(i+" Alt").trim()):(s=(s+" "+t.key).trim(),i=(i+" "+t.key).trim())):t.key==="Control"?(s=(s+" Ctrl").trim(),i=(i+" Ctrl").trim()):t.key==="Meta"?(s=(s+" Accel").trim(),i=(i+" Accel").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),i=(i+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),i=(i+" Alt").trim()):(s=(s+" "+a).trim(),i=(i+" "+a).trim())}return this.setState({keys:r,currentChain:i}),[s,r,i]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],o=this.state.currentChain.split(" "),s=o[o.length-1];return this.setState({isFunctional:t.indexOf(s)===-1}),t.indexOf(s)!==-1},this.checkShortcutAvailability=(t,o,s)=>{const r=this.props.findConflictsFor([...o,s],this.props.shortcut.selector),i=t===""||r.length===0;return!i&&r.length===1&&r[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:i}),r)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const o=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=o[0],r=o[1],i=o[2],a=this.props.toSymbols(s);let c=this.checkShortcutAvailability(s,r,i);this.setState({value:a,userInput:s,keys:r,currentChain:i},()=>{this.checkNonFunctional(),this._emitConflicts(c)})},this._handleBlur=t=>{var o,s;!((o=this._ref.current)===null||o===void 0)&&o.contains(t.relatedTarget)||!((s=t.relatedTarget)===null||s===void 0)&&s.closest(`.${D}`)||this.props.toggleInput()},this._ref=n.createRef(),this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_emitConflicts(e){const t=[...this.state.keys,this.state.currentChain];this.props.displayConflicts({conflictsWith:e,keys:this.state.keys,overwrite:async()=>{this.setState({isAvailable:!0}),await this._handleOverwrite(e,t),this.props.toggleInput()},cancel:()=>{this.props.toggleInput()}})}render(){const e=this.props.translator.load("jupyterlab");let t="jp-Shortcuts-Input";return this.state.isAvailable||(t+=" jp-mod-unavailable-Input"),n.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",ref:this._ref,onBlur:this._handleBlur},n.createElement("div",{tabIndex:0,className:t,onKeyDown:this.handleInput,ref:o=>o&&o.focus(),"data-lm-suppress-shortcuts":"true"},n.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":this.state.value===""?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},this.state.value===""?e.__("press keys"):this.state.value)),n.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit,tabIndex:0},this.state.isAvailable?n.createElement(F.react,null):n.createElement(H.react,null)))}}var C;(function(l){l.editBinding="shortcuts:edit-keybinding",l.addBinding="shortcuts:add-keybinding",l.deleteBinding="shortcuts:delete-keybinding",l.toggleSelectors="shortcuts:toggle-selectors",l.resetAll="shortcuts:reset-all"})(C||(C={}));var E;(function(l){l[l.Label=0]="Label",l[l.Category=1]="Category",l[l.Split=2]="Split",l[l.Default=3]="Default"})(E||(E={}));class j extends Map{constructor(e){var t,o,s,r;super();const{settings:i,commandRegistry:a,allCommands:c}=e;if(c)for(const g of a.listCommands()){const p={command:g,selector:"body"},f=this._computeTargetId(p),d=p.command.split(":"),m=(t=a.label(p.command,p.args))!==null&&t!==void 0?t:d.length>1?d[1]:void 0,u=d[0],y={...p,id:f,keybindings:[],category:u,label:m,args:{}};this.set(f,y)}else if(i){const g=(o=i.user.shortcuts)!==null&&o!==void 0?o:[],p=new Set(g.map(this._computeKeybindingId.bind(this))),f=(s=i.composite.shortcuts)!==null&&s!==void 0?s:[],d=i.default("shortcuts").map(m=>this._computeTargetId(m));for(const m of f){const u=this._computeTargetId(m),y=this._computeKeybindingId(m),h={keys:w.normalizeKeys(m),isDefault:!p.has(y),...m.preventDefault===void 0?{}:{preventDefault:m.preventDefault}},S=this.get(u);if(S)S.keybindings.push(h);else{const _=m.command.split(":"),K=(r=a.label(m.command,m.args))!==null&&r!==void 0?r:_.length>1?_[1]:void 0,B=_[0];this.set(u,{id:u,selector:m.selector,command:m.command,category:B,label:K,args:m.args,keybindings:[h],userDefined:!d.includes(u)})}}}}findConflictsFor(e,t){const o=new lt({registry:this}),s=e.map(w.normalizeKeystroke);let r=o.findConflicts(s,t);if(r.length!==0)return r;for(const i of s)if(r=o.findConflicts([i],t),r.length!==0)return r;return[]}_computeTargetId(e){var t;return e.command+"_"+e.selector+"_"+JSON.stringify((t=e.args)!==null&&t!==void 0?t:{})}_computeKeybindingId(e){var t;return[e.command,e.selector,JSON.stringify((t=e.args)!==null&&t!==void 0?t:{}),w.normalizeKeys(e).join(" ")].join("_")}}class lt{constructor(e){var t;const o=new Map;for(const s of e.registry.values())for(const r of s.keybindings){const i=this._keybindingHash(r.keys,s.selector),a=(t=o.get(i))!==null&&t!==void 0?t:[];a.push(s),o.set(i,a)}this._keybindingsMap=o}findConflicts(e,t){var o;const s=this._keybindingHash(e,t);return(o=this._keybindingsMap.get(s))!==null&&o!==void 0?o:[]}_keybindingHash(e,t){return e.join(" ")+"_"+t}}(function(l){function e(s){return s.replace(/\s+/g,"").toLowerCase()}function t(s,r){var i;const a=s.category.toLowerCase(),c=((i=s.label)!==null&&i!==void 0?i:"").toLowerCase(),g=`${a} ${c}`;let p=1/0,f=null;const d=/\b\w/g;for(;;){const S=d.exec(g);if(!S)break;const _=U.matchSumOfDeltas(g,r,S.index);if(!_)break;_&&_.score<=p&&(p=_.score,f=_.indices)}if(!f||p===1/0)return null;const m=a.length+1,u=J.lowerBound(f,m,(S,_)=>S-_),y=f.slice(0,u),h=f.slice(u);for(let S=0,_=h.length;S<_;++S)h[S]-=m;return y.length===0?{matchType:E.Label,categoryIndices:null,labelIndices:h,score:p,item:s}:h.length===0?{matchType:E.Category,categoryIndices:y,labelIndices:null,score:p,item:s}:{matchType:E.Split,categoryIndices:y,labelIndices:h,score:p,item:s}}function o(s,r){r=e(r);let i=[];for(const a of s.values()){if(!r){i.push({matchType:E.Default,categoryIndices:null,labelIndices:null,score:0,item:a});continue}let c=t(a,r);c&&i.push(c)}return i}l.matchItems=o})(j||(j={}));const ct={Ctrl:"⌃",Alt:"⌥",Shift:"⇧",Accel:"⌘",Cmd:"⌘"};class L extends n.Component{constructor(e){super(e),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput,conflicts:new Map})},this.toSymbols=t=>k.IS_MAC?t.split(" ").map(o=>{var s;return(s=ct[o])!==null&&s!==void 0?s:o}).join(" "):t.split(" ").map(o=>o==="Accel"?"Ctrl":o).join(" "),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(!("shortcutId"in t&&t.shortcutId!==this.props.shortcut.id)){if(t.request==="add-keybinding")return this.toggleInputNew();if(t.request==="edit-keybinding"&&this.toggleInputReplaceMethod(t.keybinding),t.request==="delete-keybinding"){const o=this.props.shortcut,s=o.keybindings[t.keybinding];this.props.deleteKeybinding(o,s).catch(console.error)}}}getCategoryCell(){return n.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var e;if(this.props.newShortcutUtils){const t=this._getFilteredCommands();return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement(tt,{value:this.props.shortcut.command,options:[{value:"",label:this._trans.__("Select a command")},...t.map(o=>({value:o.command,label:`${o.category}: ${o.label}`}))],onChange:o=>{var s,r,i;const a=t.find(c=>c.command===o.target.value);(s=this.props.newShortcutUtils)===null||s===void 0||s.updateCommand((r=a?.command)!==null&&r!==void 0?r:"",(i=a?.category)!==null&&i!==void 0?i:"")}}))}else return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:"jp-label"},(e=this.props.shortcut.label)!==null&&e!==void 0?e:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return n.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this.props.shortcut.userDefined?this._trans.__("Delete"):this._trans.__("Reset"))}getSourceCell(){var e;const t=this.props.shortcut.keybindings.every(r=>r.isDefault),o=this.props.shortcut.userDefined||!!this.props.newShortcutUtils,s=o?this._trans.__("Custom options"):this._trans.__("Show options");return n.createElement("div",{className:"jp-Shortcuts-Cell"},!this.props.newShortcutUtils&&n.createElement("div",{className:"jp-Shortcuts-SourceCell"},t?this._trans.__("Default"):this._trans.__("Custom")),t?"":this.getResetShortCutLink(),this.props.external.editorFactory&&n.createElement(x,{className:"jp-mod-styled jp-mod-reject jp-Shortcuts-CustomOptions",onClick:async()=>{if(!this.props.external.editorFactory){console.error("Cannot build the custom options form");return}const i=await new rt({shortcut:this.props.shortcut,translator:this.props.external.translator,editorFactory:this.props.external.editorFactory,readOnly:!o}).launch();i.button.accept&&o&&i.value&&await this.props.setCustomOptions(this.props.shortcut,i.value)},title:s,"aria-label":s,appearance:"neutral"},o?n.createElement(W.react,{tag:null}):n.createElement(z.react,{tag:null})),!!this.props.newShortcutUtils&&n.createElement(n.Fragment,null,n.createElement(x,{className:"jp-mod-styled jp-mod-accept jp-Shortcuts-SaveNew",onClick:(e=this.props.newShortcutUtils)===null||e===void 0?void 0:e.saveShortcut,title:this._trans.__("Save shortcut"),"aria-label":this._trans.__("Save shortcut"),appearance:"neutral",disabled:!this.props.shortcut.command||!this.props.shortcut.keybindings.length||this.props.shortcut.keybindings.every(r=>!r.keys||r.keys.length===0)},n.createElement(F.react,{tag:null}))))}getOptionalSelectorCell(){return this.props.showSelectors?n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(e){const t=["jp-Shortcuts-ShortcutCell"];switch(e.length){case 1:t.push("jp-Shortcuts-SingleCell");break;case 0:t.push("jp-Shortcuts-EmptyCell");break}return t.join(" ")}toggleInputReplaceMethod(e){const t=this.state.displayReplaceInput[e];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[e]:!t},conflicts:new Map})}getDisplayReplaceInput(e){return this.state.displayReplaceInput[e]}getOrDisplayIfNeeded(e){const t=["jp-Shortcuts-Or"];return(e||this.state.displayNewInput)&&t.push("jp-Shortcuts-Or-Forced"),n.createElement("div",{className:t.join(" ")},this._trans.__("or"))}getShortCutAsInput(e,t){return n.createElement(A,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(t),shortcut:this.props.shortcut,keybinding:e,displayConflicts:o=>{const s=new Map(this.state.conflicts);s.set(e,o),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(t),placeholder:this.toSymbols(e.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(e){return e.keys.map((t,o)=>n.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:o},n.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(t).split(" ").map((s,r,i)=>n.createElement(n.Fragment,{key:`${o}-${s}-${r}`},n.createElement("span",{className:"jp-ContextualShortcut-Key"},s),r+1<i.length?" + ":null))),o+1<e.keys.length?n.createElement("div",{className:"jp-Shortcuts-Comma"},","):null))}isLocationBeingEdited(e){return this.state.displayReplaceInput[e]}getDivForKey(e,t,o){return n.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+e,"data-keybinding":e,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(e)},this.isLocationBeingEdited(e)?this.getShortCutAsInput(t,e):this.getShortCutForDisplayOnly(t),!(e===this._nonEmptyBindings.length-1&&Object.values(this.state.displayReplaceInput).some(Boolean))&&this.getOrDisplayIfNeeded(e<this._nonEmptyBindings.length-1))}getAddLink(){return n.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?n.createElement(A,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:e=>{const t=new Map(this.state.conflicts);t.set(null,e),this.setState({conflicts:t})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):n.createElement("div",null)}getShortCutsCell(e){return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:this.getClassNameForShortCuts(e)},e.map((t,o)=>this.getDivForKey(o,t,e)),e.length>=1&&!this.state.displayNewInput&&!Object.values(this.state.displayReplaceInput).some(Boolean)&&this.getAddLink(),e.length===0&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const e=[...this.state.conflicts.values()].filter(t=>t.conflictsWith.length!==0);return e.length===0?n.createElement(n.Fragment,null):n.createElement("div",{className:"jp-Shortcuts-Row jp-Shortcuts-RowWithConflict"},n.createElement("div",{className:D},e.map(t=>{const o=t.keys.join(" ")+"_"+t.conflictsWith.map(s=>s.id).join("");return n.createElement("div",{className:"jp-Shortcuts-Conflict",key:o},n.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map(s=>{var r;return(r=s.label)!==null&&r!==void 0?r:s.command}).join(", "))),n.createElement("div",{className:"jp-Shortcuts-ErrorButton"},n.createElement("button",{className:"jp-Button jp-mod-reject jp-mod-styled",onClick:()=>{this._clearConflict(t),t.cancel()}},this._trans.__("Cancel")),n.createElement("button",{className:"jp-Button jp-mod-warn jp-mod-styled",onClick:()=>{this._clearConflict(t),t.overwrite()}},this._trans.__("Overwrite"))))})))}_clearConflict(e){const t=new Map,o=this._conflictId(e);for(const[s,r]of this.state.conflicts.entries())this._conflictId(r)!==o&&t.set(s,r);this.setState({conflicts:t})}_conflictId(e){return e.keys.join(" ")+"_"+e.conflictsWith.map(t=>t.id).join("")}_getFilteredCommands(){var e,t;const o=new j({commandRegistry:this.props.external.commandRegistry,allCommands:!0}),s=j.matchItems(o,(t=(e=this.props.newShortcutUtils)===null||e===void 0?void 0:e.searchQuery)!==null&&t!==void 0?t:"").map(r=>r.item).filter(r=>!r.command.startsWith("__internal:"));return s.sort((r,i)=>{var a,c;const g=r.category,p=i.category,f=g.localeCompare(p);if(f)return f;{const d=(a=r.label)!==null&&a!==void 0?a:"",m=(c=i.label)!==null&&c!==void 0?c:"";return d.localeCompare(m)}}),s}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter(e=>e.keys.filter(t=>t!="").length!==0)}render(){return n.createElement(n.Fragment,null,n.createElement("div",{className:`jp-Shortcuts-Row${this.props.newShortcutUtils?" jp-Shortcuts-Row-newShortcut":""}`,"data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}const dt=115;class ht extends n.Component{render(){return n.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:`${this.props.height-dt}px`},id:"shortcutListContainer"},n.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map(e=>n.createElement(L,{key:e.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,setCustomOptions:this.props.setCustomOptions,shortcut:e,showSelectors:this.props.showSelectors,external:this.props.external}))))}}class ut extends n.Component{render(){return n.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,n.createElement($.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function pt(l){const e=l.translator.load("jupyterlab");return n.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},n.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>l.toggleSelectors()},l.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),n.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>l.resetShortcuts()},e.__("Reset All")),n.createElement(x,{className:"jp-mod-styled jp-mod-accept jp-Shortcuts-AdvancedOptionsButton",onClick:l.toggleAddCommandRow,title:e.__("Tool for adding shortcuts"),"aria-label":e.__("Tool for adding shortcuts")},n.createElement(Q.react,{tag:"span",elementSize:"xlarge",elementPosition:"center"})))}class mt extends n.Component{constructor(e){super(e)}getShortCutTitleItem(e,t){return n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement(ut,{title:e,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:t}))}render(){const e=this.props.translator.load("jupyterlab");return n.createElement("div",{className:"jp-Shortcuts-Top"},n.createElement("div",{className:"jp-Shortcuts-TopNav"},n.createElement(et,{"aria-label":e.__("Search shortcuts"),updateFilter:(t,o)=>this.props.updateSearchQuery(o??""),placeholder:e.__("Search…"),useFuzzyFilter:!1}),n.createElement(pt,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,toggleAddCommandRow:this.props.toggleAddCommandRow,translator:this.props.translator})),n.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},n.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(e.__("Category"),"category"),this.getShortCutTitleItem(e.__("Command"),"command"),n.createElement("div",{className:"jp-Shortcuts-Cell"},n.createElement("div",{className:"title-div"},e.__("Shortcut"))),this.getShortCutTitleItem(e.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(e.__("Selectors"),"selector"))))}}class gt extends n.Component{constructor(e){super(e),this.updateSearchQuery=t=>{this.setState({searchQuery:t},()=>{const o=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(o)},()=>{this.sortShortcuts()})})},this.resetShortcuts=async()=>{await(await this.props.external.getSettings()).set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{await this._setKeybinding(t,[])},this.replaceKeybinding=async(t,o,s)=>this._setKeybinding(t,s,o),this.deleteKeybinding=async(t,o)=>{await this._setKeybinding(t,[],o)},this.addKeybinding=async(t,o)=>{await this._setKeybinding(t,o)},this.setCustomOptions=async(t,o)=>{var s;const r=await this.props.external.getSettings(),i=(s=r.user.shortcuts)!==null&&s!==void 0?s:[],a=i.filter(c=>{var g,p;return c.command===t.command&&c.selector===t.selector&&b.deepEqual((g=c.args)!==null&&g!==void 0?g:{},(p=t.args)!==null&&p!==void 0?p:{})});return a.length?(a.forEach(c=>{c.selector=o.selector,c.args=o.args}),await r.set("shortcuts",i),await this._refreshShortcutList(),!0):(console.error("Error writing the custom options: target not found"),!1)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.toggleAddCommandRow=async()=>{this.setState({showAddCommand:!this.state.showAddCommand})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.saveNewShortcut=async()=>{const t={...this.state.newShortcut,args:void 0};for(let s of t.keybindings)await this.addKeybinding(t,s.keys);await this.setCustomOptions(t,{selector:t.selector,args:this.state.newShortcut.args})&&(this._newShortcutItem.reset(),this.toggleAddCommandRow())},this._newShortcutItem=new it({showSelectors:!1,findConflictsFor:(t,o)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(t,o):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),external:this.props.external}),this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category",showAddCommand:!1,newShortcut:this._newShortcutItem.shortcut},this._newShortcutItem.changed.connect(()=>{this.setState({newShortcut:{...this._newShortcutItem.shortcut}})})}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(t.request==="toggle-selectors")return this.toggleSelectors();t.request==="reset-all"&&await this.resetShortcuts()}async _refreshShortcutList(){const e=await this.props.external.getSettings(),t=new j({commandRegistry:this.props.external.commandRegistry,settings:e});this.setState({shortcutRegistry:t,filteredShortcutList:this._searchFilterShortcuts(t),shortcutsFetched:!0},()=>{this.sortShortcuts()})}_searchFilterShortcuts(e){return e?j.matchItems(e,this.state.searchQuery).map(o=>o.item):[]}async _setKeybinding(e,t,o){var s,r,i,a,c;t.length===1&&t[0]==""&&(t=[]);const g=t.map(w.normalizeKeystroke),p=await this.props.external.getSettings(),f=(s=p.user.shortcuts)!==null&&s!==void 0?s:[],d=[];let m=!1;for(let u of f)if(u.command===e.command&&u.selector===e.selector&&b.deepEqual((r=u.args)!==null&&r!==void 0?r:{},(i=e.args)!==null&&i!==void 0?i:{})&&o&&b.deepEqual(o.keys,w.normalizeKeys(u))){const y=o.isDefault&&b.deepEqual(o.keys,g);t.length!==0&&!y&&d.push(this._setShortcutKeys(u,t)),m=!0}else{if(u.command===e.command&&u.selector===e.selector&&b.deepEqual((a=u.args)!==null&&a!==void 0?a:{},(c=e.args)!==null&&c!==void 0?c:{})&&!o&&t.length===0)continue;d.push(u)}if(!m){const u=!o||!b.deepEqual(o.keys,g);o&&o.isDefault&&u&&d.push(this._shortcutFromTarget(e,o.keys,{disabled:!0,preventDefault:o.preventDefault})),t.length!==0&&u&&d.push(this._shortcutFromTarget(e,t,{preventDefault:o?.preventDefault}))}await p.set("shortcuts",d),await this._refreshShortcutList()}_setShortcutKeys(e,t){const o=this._platformKeys(e);return{...e,[o]:t}}_shortcutFromTarget(e,t,o={}){const s={command:e.command,selector:e.selector,keys:t};return e.args&&!b.deepEqual(e.args,{})&&(s.args=e.args),o.disabled&&(s.disabled=!0),o.preventDefault!==void 0&&(s.preventDefault=o.preventDefault),s}_platformKeys(e){return k.IS_WIN&&e.winKeys?"winKeys":k.IS_MAC&&e.macKeys?"macKeys":!k.IS_WIN&&!k.IS_MAC&&e.linuxKeys?"linuxKeys":"keys"}sortShortcuts(){const e=this.state.filteredShortcutList;let t=this.state.currentSort;t==="command"&&(t="label");const o=s=>{var r;return t==="source"?s.keybindings.every(i=>i.isDefault)?"default":"other":(r=s[t])!==null&&r!==void 0?r:""};e.sort((s,r)=>{var i,a;const c=o(s),g=o(r),p=c.localeCompare(g);if(p)return p;{const f=(i=s.label)!==null&&i!==void 0?i:"",d=(a=r.label)!==null&&a!==void 0?a:"";return f.localeCompare(d)}}),this.setState({filteredShortcutList:e})}render(){return this.state.shortcutsFetched?n.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},n.createElement(mt,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,toggleAddCommandRow:this.toggleAddCommandRow,width:this.props.width,translator:this.props.external.translator}),this.state.showAddCommand&&n.createElement(L,{...this._newShortcutItem,shortcut:this.state.newShortcut,newShortcutUtils:{searchQuery:this.state.searchQuery,updateCommand:this._newShortcutItem.updateCommand,saveShortcut:this.saveNewShortcut}}),n.createElement(ht,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,setCustomOptions:this.setCustomOptions,showSelectors:this.state.showSelectors,findConflictsFor:(e,t)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(e,t):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}const yt=l=>P.createElement(gt,{external:l.external,height:1e3,width:1e3}),T="@jupyterlab/shortcuts-extension:shortcuts";function ft(l,e,t,o,s){return{translator:t,getSettings:()=>l.load(T,!0),commandRegistry:e.commands,actionRequested:o,editorFactory:s}}const v={id:T,description:"Adds the keyboard shortcuts editor.",requires:[ot],optional:[V,st,G],activate:async(l,e,t,o,s)=>{const r=t??Y,i=r.load("jupyterlab"),{commands:a}=l;let c,g,p={};if(o){const d=new R({}),m=h=>h.dataset.shortcut!==void 0;l.commands.addCommand(C.editBinding,{label:i.__("Edit Keybinding"),caption:i.__("Edit existing keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const h=l.contextMenuHitTest(m),S=h?.dataset.keybinding,_=h?.dataset.shortcut;if(!_||!S)return console.log("Missing shortcut id/keybinding information");d.emit({request:"edit-keybinding",keybinding:parseInt(S,10),shortcutId:_})}}),l.commands.addCommand(C.deleteBinding,{label:i.__("Delete Keybinding"),caption:i.__("Delete chosen keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const h=l.contextMenuHitTest(m),S=h?.dataset.keybinding,_=h?.dataset.shortcut;if(!_||!S)return console.log("Missing shortcut id/keybinding information");d.emit({request:"delete-keybinding",keybinding:parseInt(S,10),shortcutId:_})}}),l.commands.addCommand(C.addBinding,{label:i.__("Add Keybinding"),caption:i.__("Add new keybinding for existing shortcut target"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const h=l.contextMenuHitTest(m),S=h?.dataset.shortcut;if(!S)return console.log("Missing shortcut id to add keybinding to");d.emit({request:"add-keybinding",shortcutId:S})}}),a.addCommand(C.toggleSelectors,{label:i.__("Toggle Selectors"),caption:i.__("Toggle command selectors"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{d.emit({request:"toggle-selectors"})}}),a.addCommand(C.resetAll,{label:i.__("Reset All"),caption:i.__("Reset all shortcuts"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{d.emit({request:"reset-all"})}});const u=s?h=>s.factoryService.newInlineEditor(h):void 0,y={fieldRenderer:h=>yt({external:ft(e,l,r,d,u),...h})};o.addRenderer(`${v.id}.shortcuts`,y)}function f(d){const m=l.commands.listCommands().join(`
2
2
  `);g||(g=b.deepCopy(d.properties.shortcuts.default)),p={},d.properties.shortcuts.default=Object.keys(e.plugins).map(u=>{const y=e.plugins[u].schema["jupyter.lab.shortcuts"]||[];return p[u]=y,y}).concat([g]).reduce((u,y)=>k.IS_MAC?u.concat(y):u.concat(y.filter(h=>!h.keys.some(S=>{const{cmd:_}=w.parseKeystroke(S);return _}))),[]).sort((u,y)=>u.command.localeCompare(y.command)),d.properties.shortcuts.description=i.__(`Note: To disable a system default shortcut,
3
3
  copy it to User Preferences and add the
4
4
  "disabled" key, for example:
@@ -1 +1 @@
1
- import{aC as v,aD as h,au as k}from"../datalayer-app-main.js";import{I as g,a as y,b as L}from"./index-9EhrHHj7.js";import{I as b}from"./tokens-Nkg3e_k9.js";import{a as R}from"./index--S8WFITA.js";import{R as _}from"./index-9wJFadG-.js";import"./Output-D-7eUege.js";import"./index-6zxBQeM_.js";import"./hoverbox-CStlKQWE.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-D7aXShZc.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-DyX4EYyN.js";import"./index-BbcMy3Al.js";import"./KernelVariables-D3DSQaD3.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-BMjQTGrr.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./sessions-CgjtuOSm.js";import"./tokens-CBhRbpQP.js";import"./drivecontents-D1HzL7Fi.js";import"./kernel-BmfZmtIo.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";var a;(function(t){t.handleLink="rendermime:handle-local-link"})(a||(a={}));const Ie={id:"@jupyterlab/rendermime-extension:plugin",description:"Provides the render mime registry.",optional:[b,y,R,L,v],provides:g,activate:I,autoStart:!0},f="debugger:open-source";function I(t,n,p,s,l,i){const d=(i??h).load("jupyterlab");return n&&t.commands.addCommand(a.handleLink,{label:d.__("Handle Local Link"),execute:e=>{const r=e.path,o=e.id,m=e.scope||"server";if(r){if(m==="kernel"){if(!t.commands.hasCommand(f)){console.warn("Cannot open kernel file: debugger sources provider not available");return}return t.commands.execute(f,{path:r})}return n.services.contents.get(r,{content:!1}).then(()=>{const u=n.registry.defaultRenderedWidgetFactory(r),c=n.openOrReveal(r,u.name);c&&o&&c.setFragment(o)})}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:d.__("The file path to open")},id:{type:"string",description:d.__("Fragment identifier to navigate to")},scope:{type:"string",enum:["kernel","server"],description:d.__("Scope of the file location")}},required:["path"]}}}),new _({initialFactories:k,trustHandler:{markTrusted:e=>{t.commandLinker.markTrusted(e)},unmarkTrusted:e=>{t.commandLinker.unmarkTrusted(e)}},linkHandler:n?{handleLink:(e,r,o)=>{e.tagName==="A"&&e.hasAttribute("download")||e.addEventListener("click",m=>{m.preventDefault(),t.commands.execute(a.handleLink,{path:r,id:o})})},handlePath:(e,r,o,m)=>{e.addEventListener("click",u=>{u.preventDefault(),t.commands.execute(a.handleLink,{path:r,id:m,scope:o})})}}:void 0,latexTypesetter:p??void 0,markdownParser:l??void 0,translator:i??void 0,sanitizer:s??void 0})}export{Ie as default};
1
+ import{aC as v,aD as h,au as k}from"../datalayer-app-main.js";import{I as g,a as y,b as L}from"./index-B6-uQd5L.js";import{I as b}from"./tokens-Nkg3e_k9.js";import{a as R}from"./index-JmqWOkdt.js";import{R as _}from"./index-CEeyR3FZ.js";import"./Output-D9cwH5rg.js";import"./index-qhxI1VzX.js";import"./hoverbox-CStlKQWE.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-DXPIz0Km.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-We9CyR7b.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DpN8KK6c.js";import"./KernelVariables-CXQagESp.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-D36duUxK.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BAjGB6b-.js";import"./sessions-DdXtI_C1.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";var a;(function(t){t.handleLink="rendermime:handle-local-link"})(a||(a={}));const Ie={id:"@jupyterlab/rendermime-extension:plugin",description:"Provides the render mime registry.",optional:[b,y,R,L,v],provides:g,activate:I,autoStart:!0},f="debugger:open-source";function I(t,n,p,s,l,i){const d=(i??h).load("jupyterlab");return n&&t.commands.addCommand(a.handleLink,{label:d.__("Handle Local Link"),execute:e=>{const r=e.path,o=e.id,m=e.scope||"server";if(r){if(m==="kernel"){if(!t.commands.hasCommand(f)){console.warn("Cannot open kernel file: debugger sources provider not available");return}return t.commands.execute(f,{path:r})}return n.services.contents.get(r,{content:!1}).then(()=>{const u=n.registry.defaultRenderedWidgetFactory(r),c=n.openOrReveal(r,u.name);c&&o&&c.setFragment(o)})}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:d.__("The file path to open")},id:{type:"string",description:d.__("Fragment identifier to navigate to")},scope:{type:"string",enum:["kernel","server"],description:d.__("Scope of the file location")}},required:["path"]}}}),new _({initialFactories:k,trustHandler:{markTrusted:e=>{t.commandLinker.markTrusted(e)},unmarkTrusted:e=>{t.commandLinker.unmarkTrusted(e)}},linkHandler:n?{handleLink:(e,r,o)=>{e.tagName==="A"&&e.hasAttribute("download")||e.addEventListener("click",m=>{m.preventDefault(),t.commands.execute(a.handleLink,{path:r,id:o})})},handlePath:(e,r,o,m)=>{e.addEventListener("click",u=>{u.preventDefault(),t.commands.execute(a.handleLink,{path:r,id:m,scope:o})})}}:void 0,latexTypesetter:p??void 0,markdownParser:l??void 0,translator:i??void 0,sanitizer:s??void 0})}export{Ie as default};