@datalayer/agent-runtimes 1.5.23 → 1.5.25
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.
- package/dist-embed/chunks/{CellSidebarExtension-CDnzN9Cb.js → CellSidebarExtension-B-73cmcQ.js} +1 -1
- package/dist-embed/chunks/{ChatView-BjZ993Ch.js → ChatView-CUWE6I5M.js} +3 -3
- package/dist-embed/chunks/{DeckComponent-Cb4_dZpN.js → DeckComponent-ymp4My5d.js} +1 -1
- package/dist-embed/chunks/{DocumentView-Caxb2xz-.js → DocumentView-i99p_Qzt.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-DIHjR5l8.js → EphemeralDocument--pV47gPl.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-1Rwa3anx.js → EphemeralNotebook-BqccUXGd.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-vJQwgcUt.js → ExcalidrawComponent-DgSMy796.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-BDgjdSz2.js → ExcalidrawModal-DFJW9pQh.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-_7FM5Om8.js → JupyterLexicalExtension-CqDatsgf.js} +5 -5
- package/dist-embed/chunks/{KernelVariables-CKIqy599.js → KernelVariables-CS6h5HyK.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-YAM1bvZS.js → NotebookToolSurfaces-CTLbTvsS.js} +1 -1
- package/dist-embed/chunks/{NotebookView-C8RCvsR1.js → NotebookView-BJpTApeL.js} +1 -1
- package/dist-embed/chunks/{Output-BWClePP-.js → Output-no9rnFJ7.js} +1 -1
- package/dist-embed/chunks/{SandboxDetailsDialog-CDSxIC0-.js → SandboxDetailsDialog-BAv6RMed.js} +1 -1
- package/dist-embed/chunks/{SchemaForm-CO_2yGg2.js → SchemaForm-CE5NfpBU.js} +1 -1
- package/dist-embed/chunks/{WidgetVariableView--osoOLv8.js → WidgetVariableView-V4DsgfIK.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-BB7Z7INn.js → YouTubePlugin-CpgyVTwG.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-D6Ko4I2x.js → ar-SA-G6X2FPQ2-DwUjDWHp.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-B3UhxnSz.js → az-AZ-76LH7QW2-DROX4pJc.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-BS-QRZjB.js → bg-BG-XCXSNQG7-DPLzP9Bm.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-DNg0uIV0.js → bn-BD-2XOGV67Q-CCOU2J2j.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-Bn4yHfTY.js → ca-ES-6MX7JW3Y-3RgFapBd.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-DUGnyonZ.js → cs-CZ-2BRQDIVT-BJS7ofhJ.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-Is8nybqO.js → da-DK-5WZEPLOC-BHDT0zzh.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-D54sMa4L.js → de-DE-XR44H4JA-CWVJKc9t.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-CvM3SWat.js → el-GR-BZB4AONW-2z8DB9lI.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-BZDRRuRf.js → es-ES-U4NZUMDT-DzXGWPd4.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-DAmknI9y.js → eu-ES-A7QVB2H4-CslHE4iE.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-CQhKri4O.js → fa-IR-HGAKTJCU-CBWUHs2r.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-DzEDoP64.js → fi-FI-Z5N7JZ37-MAr8kZMI.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-DiSkyvEB.js → fr-FR-RHASNOE6-BUz3aHQJ.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-3AJMzY-I.js → gl-ES-HMX3MZ6V-DvzQmDYv.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-Cuh5an4X.js → he-IL-6SHJWFNN-DKR3cKyQ.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BbeuFB83.js → hi-IN-IWLTKZ5I-C4tyBNwa.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-C1OMfhob.js → hu-HU-A5ZG7DT2-C8BnBgH5.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-BzKILJTZ.js → id-ID-SAP4L64H-Bn1hY5OS.js} +1 -1
- package/dist-embed/chunks/{index-CPpm1tqJ.js → index-5N0EOEHV.js} +1 -1
- package/dist-embed/chunks/{index-f418CYn7.js → index-BKB97UwL.js} +1 -1
- package/dist-embed/chunks/{index-CyQgE_Es.js → index-BN8Bbau-.js} +2 -2
- package/dist-embed/chunks/{index-CKFrz1es.js → index-BTdq_niO.js} +1 -1
- package/dist-embed/chunks/{index-D4QM3qbA.js → index-Bhzj1Pnv.js} +1 -1
- package/dist-embed/chunks/{index-BMandbJB.js → index-BzMt3uYX.js} +1 -1
- package/dist-embed/chunks/{index-DLimRfHQ.js → index-CCRwowMu.js} +1 -1
- package/dist-embed/chunks/{index-BFdE0KFI.js → index-CEbnhuIo.js} +1 -1
- package/dist-embed/chunks/{index-CAd5YQQl.js → index-CZB8DyUw.js} +1 -1
- package/dist-embed/chunks/{index-BO6VQLH6.js → index-Cd5CgKFr.js} +1 -1
- package/dist-embed/chunks/{index-D64QvG43.js → index-CkQ6IAoY.js} +1 -1
- package/dist-embed/chunks/{index-BktUM85c.js → index-Coj9opLJ.js} +1 -1
- package/dist-embed/chunks/{index-dYwQAVs_.js → index-D9_026K2.js} +1 -1
- package/dist-embed/chunks/{index-SbFvdBPQ.js → index-DVaPKQyL.js} +1 -1
- package/dist-embed/chunks/{index-f9WZsG2n.js → index-DWfzdTZo.js} +1 -1
- package/dist-embed/chunks/{index-DY8mjz1l.js → index-DdBQBN76.js} +1 -1
- package/dist-embed/chunks/{index-DEjLPUAD.js → index-Di3aBGLV.js} +1 -1
- package/dist-embed/chunks/{index-Cu0bp_EI.js → index-Gngo0bXi.js} +1 -1
- package/dist-embed/chunks/{index-DyVR0igi.js → index-S4sn4R3i.js} +1 -1
- package/dist-embed/chunks/{index-noRoZrq5.js → index-Z2pxzg3H.js} +1 -1
- package/dist-embed/chunks/{index-PqsSImlj.js → index-_H5U6gal.js} +1 -1
- package/dist-embed/chunks/{index-x45cMPwN.js → index-_nsBY26B.js} +1 -1
- package/dist-embed/chunks/{index-CM7xo08K.js → index-b6e3y1R-.js} +1 -1
- package/dist-embed/chunks/{index-wk9vl2uW.js → index-szXn1pzS.js} +1 -1
- package/dist-embed/chunks/{index.esm-p0OnSU9h.js → index.esm-nZym6gpK.js} +1 -1
- package/dist-embed/chunks/isEqual-g-jK7vY0.js +1 -0
- package/dist-embed/chunks/{it-IT-JPQ66NNP-DuG05fUR.js → it-IT-JPQ66NNP-DEiaanA7.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-DeDfL3Bk.js → ja-JP-DBVTYXUO-Bb0GBZrQ.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-BRKFVG6s.js → kaa-6HZHGXH3-DxqTv9uN.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-Uqakmhz5.js → kab-KAB-ZGHBKWFO-D0V0yQgV.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DWMXMIAK.js → kk-KZ-P5N5QNE5-CYyEyHXW.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-BXNl9QnV.js → km-KH-HSX4SM5Z-CCTEGikY.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-BZgIqTuN.js → ko-KR-MTYHY66A-C-QDut19.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-CQNa5i5U.js → ku-TR-6OUDTVRD-CIqn8p2Y.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-BQW2k7iv.js → lt-LT-XHIRWOB4-BDLUWFPH.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-B0HRRCC4.js → lv-LV-5QDEKY6T-BItabIJP.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-DXR6sWSH.js → mr-IN-CRQNXWMA-DXXb8N2w.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-BZ5_9oCm.js → my-MM-5M5IBNSE-TidIfjqS.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-CBtv36wZ.js → nb-NO-T6EIAALU-DEINynK7.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CcqE3cY8.js → nl-NL-IS3SIHDZ-D04rJzNe.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-Cl9wPgpU.js → nn-NO-6E72VCQL-oWFzCtpf.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-CQEkV2p1.js → oc-FR-POXYY2M6-BmFfP6hk.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-CaE6yG0U.js → pa-IN-N4M65BXN-RkXrgKXw.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-Bk5xifLL.js → percentages-BXMCSKIN-BL_DuU3S.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-M1pQcF2j.js → pl-PL-T2D74RX3-DqxkHzTj.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-BFDHu72z.js → pt-BR-5N22H2LF-DFA-wWC5.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DFcZY1Gz.js → pt-PT-UZXXM6DQ-Z5jw_7aw.js} +1 -1
- package/dist-embed/chunks/{renderer-Dy4lZ1KZ.js → renderer-DKKfWkWv.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-BGm_Xwik.js → ro-RO-JPDTUUEW-DjC09bHq.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-BsrZ_x8p.js → ru-RU-B4JR7IUQ-CqwD7Yik.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-BfaYS44g.js → si-LK-N5RQ5JYF-OVf4k6G3.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-D-K9yMTN.js → sk-SK-C5VTKIMK-BG__kjLT.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-B48XvZUw.js → sl-SI-NN7IZMDC-CIgxidVH.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-DzA7mJjZ.js → subset-shared.chunk-BR0LJHtQ.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-CsTEdHAt.js → subset-worker.chunk-52aAcjvz.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-DfhLO_Vt.js → sv-SE-XGPEYMSR-CYHz3xCa.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-EZA_oxSt.js → ta-IN-2NMHFXQM-BphRr9QY.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-G9vy_zQH.js → th-TH-HPSO5L25-Ba2-2Bo0.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-DBj_G5CD.js → tr-TR-DEFEU3FU-CRKE7Roy.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-DN7lMu5H.js → uk-UA-QMV73CPH-DlNE5CAT.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-LoT02qgd.js → vi-VN-M7AON7JQ-Cp44PRXY.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-CjexwOqT.js → zh-CN-LNUGB5OW-JHqqwp0j.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-B0ys_HV6.js → zh-HK-E62DVLB3-YEs97mA8.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-tQJWLJuU.js → zh-TW-RAJ6MFWO-CgmeTbuy.js} +1 -1
- package/dist-embed/datalayer-app-main.js +65 -65
- package/lib/apps/plugins/pap-sign-in/signIn.d.ts +3 -89
- package/lib/apps/plugins/pap-sign-in/signIn.js +5 -142
- package/lib/chat/messages/ChatMessageList.js +3 -1
- package/lib/chat/presence/Presence.d.ts +4 -4
- package/lib/chat/presence/Presence.js +3 -2
- package/lib/chat/presence/presenceStatus.d.ts +3 -34
- package/lib/chat/presence/presenceStatus.js +4 -46
- package/lib/portable/conversation.d.ts +3 -0
- package/lib/portable/conversation.js +15 -1
- package/lib/portable/direct.d.ts +100 -0
- package/lib/portable/direct.js +172 -0
- package/lib/portable/displays.d.ts +109 -0
- package/lib/portable/displays.js +261 -0
- package/lib/portable/fixtures.d.ts +11 -0
- package/lib/portable/fixtures.js +72 -0
- package/lib/portable/index.d.ts +6 -0
- package/lib/portable/index.js +10 -0
- package/lib/portable/presence.d.ts +47 -0
- package/lib/portable/presence.js +71 -0
- package/lib/portable/signIn.d.ts +96 -0
- package/lib/portable/signIn.js +148 -0
- package/lib/portable/views.d.ts +147 -0
- package/lib/portable/views.js +52 -0
- package/lib/runtimes/__tests__/fixtures/accounting-agent-card.json +1 -1
- package/package.json +1 -1
- package/dist-embed/chunks/isEqual-Cwjr2skl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ai as v,ak as k,aa as h}from"../datalayer-app-main.js";import{I as g,a as y,b as L}from"./index-
|
|
1
|
+
import{ai as v,ak as k,aa as h}from"../datalayer-app-main.js";import{I as g,a as y,b as L}from"./index-BN8Bbau-.js";import{I as b}from"./tokens-CENaHAHm.js";import{a as R}from"./index-CFP9psRB.js";import{R as _}from"./index-S4sn4R3i.js";import"./Output-no9rnFJ7.js";import"./index-DSN70XMH.js";import"./hoverbox-CStlKQWE.js";import"./index-DbMBnR4l.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./PaintbrushIcon-CLU8RilX.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./CellSidebarExtension-B-73cmcQ.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./renderer-DKKfWkWv.js";import"./SquareIcon-e3ygcjpv.js";import"./SortAscIcon-CVKVWIWQ.js";import"./url-DuKx0yk0.js";/* empty css */import"./index-Dro44tIm.js";/* empty css *//* empty css */import"./index-DsG9xhMj.js";/* empty css */import"./index-CNU-WVhQ.js";import"./index--OLIX362.js";import"./index-DYGslHkf.js";import"./index-BSRVX3UN.js";import"./index-BH2OX5l8.js";import"./index-C3vDfO5_.js";import"./index-Ko8lxXFd.js";import"./index-CB9u17_J.js";import"./index-BUVtc_FV.js";import"./ArrowLeftIcon-Y3PTljcl.js";import"./SkubbleIcon-tlg17jBG.js";import"./usePrimerThemeBridge-CoHussa9.js";import"./index-Dobs-OKl.js";import"./KernelVariables-CS6h5HyK.js";import"./index-BvgsWH_d.js";import"./SortDescIcon-CS4EzHeS.js";import"./NotebookToolbar-rtMQZWHQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./sessions-BRALW9Yv.js";import"./tokens-DTIgYcNS.js";import"./drivecontents-CxwZz_5W.js";import"./kernel-BI-BLP-K.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";var a;(function(t){t.handleLink="rendermime:handle-local-link"})(a||(a={}));const _e={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,r){const d=(r??k).load("jupyterlab");return n&&t.commands.addCommand(a.handleLink,{label:d.__("Handle Local Link"),execute:e=>{const i=e.path,o=e.id,m=e.scope||"server";if(i){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:i})}return n.services.contents.get(i,{content:!1}).then(()=>{const u=n.registry.defaultRenderedWidgetFactory(i),c=n.openOrReveal(i,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:h,trustHandler:{markTrusted:e=>{t.commandLinker.markTrusted(e)},unmarkTrusted:e=>{t.commandLinker.unmarkTrusted(e)}},linkHandler:n?{handleLink:(e,i,o)=>{e.tagName==="A"&&e.hasAttribute("download")||e.addEventListener("click",m=>{m.preventDefault(),t.commands.execute(a.handleLink,{path:i,id:o})})},handlePath:(e,i,o,m)=>{e.addEventListener("click",u=>{u.preventDefault(),t.commands.execute(a.handleLink,{path:i,id:m,scope:o})})}}:void 0,latexTypesetter:p??void 0,markdownParser:l??void 0,translator:r??void 0,sanitizer:s??void 0})}export{_e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ai as b}from"../datalayer-app-main.js";import{b as f,S}from"./index-CFP9psRB.js";import{I}from"./tokens-BHMD_ju9.js";import{c as h}from"./index-
|
|
1
|
+
import{ai as b}from"../datalayer-app-main.js";import{b as f,S}from"./index-CFP9psRB.js";import{I}from"./tokens-BHMD_ju9.js";import{c as h}from"./index-BN8Bbau-.js";import{I as g}from"./tokens-BHLmeqjP.js";import"./hoverbox-CStlKQWE.js";import"./Output-no9rnFJ7.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./PaintbrushIcon-CLU8RilX.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./CellSidebarExtension-B-73cmcQ.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./renderer-DKKfWkWv.js";import"./SquareIcon-e3ygcjpv.js";import"./SortAscIcon-CVKVWIWQ.js";import"./url-DuKx0yk0.js";/* empty css */import"./index-Dro44tIm.js";/* empty css *//* empty css */import"./index-DsG9xhMj.js";/* empty css */import"./index-CNU-WVhQ.js";import"./index--OLIX362.js";import"./index-DYGslHkf.js";import"./index-BSRVX3UN.js";import"./index-BH2OX5l8.js";import"./index-C3vDfO5_.js";import"./index-Ko8lxXFd.js";import"./index-CB9u17_J.js";import"./index-BUVtc_FV.js";import"./ArrowLeftIcon-Y3PTljcl.js";import"./SkubbleIcon-tlg17jBG.js";import"./usePrimerThemeBridge-CoHussa9.js";import"./index-Dobs-OKl.js";import"./KernelVariables-CS6h5HyK.js";import"./index-BvgsWH_d.js";import"./SortDescIcon-CS4EzHeS.js";import"./NotebookToolbar-rtMQZWHQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./sessions-BRALW9Yv.js";import"./tokens-DTIgYcNS.js";import"./drivecontents-CxwZz_5W.js";import"./kernel-BI-BLP-K.js";const s="@jupyterlab/statusbar-extension:plugin",gt={id:s,description:"Provides the application status bar.",requires:[b],provides:I,autoStart:!0,activate:(i,l,p,r,n)=>{const c=l.load("jupyterlab"),t=new S;t.id="jp-main-statusbar",i.shell.add(t,"bottom"),p&&p.layoutModified.connect(()=>{t.update()});const u=c.__("Main Area"),e="statusbar:toggle";if(i.commands.addCommand(e,{label:c.__("Show Status Bar"),execute:()=>{t.setHidden(t.isVisible),r&&r.set(s,"visible",t.isVisible)},isToggled:()=>t.isVisible,describedBy:{args:{type:"object",properties:{}}}}),i.commands.commandExecuted.connect((d,m)=>{m.id==="application:reset-layout"&&!t.isVisible&&i.commands.execute(e).catch(o=>{console.error("Failed to show the status bar.",o)})}),n&&n.addItem({command:e,category:u}),r){const d=r.load(s),m=o=>{const a=o.get("visible").composite;t.setHidden(!a)};Promise.all([d,i.restored]).then(([o])=>{m(o),o.changed.connect(a=>{m(a)})}).catch(o=>{console.error(o.message)})}return t},optional:[h,g,f]};export{gt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as V}from"./LexicalToolRegistry-8wJyLumb.js";import{D as Vl,a as Yl,b as Gl,e as Zl,c as Kl,g as Ql,i as ec,f as tc,l as nc,h as sc,j as oc,k as rc,m as ic,n as ac,r as lc,o as cc,p as uc,q as dc,s as pc,t as fc,v as mc,w as gc,x as hc,y as bc,z as yc,u as xc}from"./LexicalToolRegistry-8wJyLumb.js";import{_ as qt,E as Mn,G as Dn,H as Bn,K as me,M as Wt,O as ot,P as rt,Q as jn,R as Un,S as Xt,U as Fn,V as Jt,W as zn,X as Hn,Y as Vt,Z as Yt,a0 as qn,a1 as Wn,a2 as Xn,a3 as Jn,C as Gt,a4 as Vn,a5 as Zt,a6 as Yn,a7 as Gn,a8 as Ce,a9 as Q,aa as Kt,ab as it,ac as xe,ad as at,ae as Re,af as Zn,ag as Be,ah as Ve,ai as lt,aj as Kn,ak as Ye,al as Qn,am as es,an as ts,ao as Ge,ap as Qt,aq as en,ar as tn,as as Ie,at as ns,au as ss,av as nn,aw as os,ax as Pe,$ as rs,b as is,a as as,c as ls,ay as sn,az as Y,aA as cs,aB as us,aC as Ze,aD as ds,aE as ps,aF as fs,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Ts,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Es,aT as Cs,aU as vs,aV as ws,aW as Ss,aX as Ls,aY as _s,aZ as ks,a_ as As,x as on,a$ as Ns,b0 as $s,b1 as Rs,b2 as Is,b3 as Ps,b4 as Os,b5 as Fe,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Us,bb as rn,bc as an,bd as ln,be as cn,j as Fs,T as zs,L as Hs,w as qs,k as Ws,l as Xs,D as Js,m as Vs,n as Ys,o as Gs,p as Zs,t as Ks,bf as Qs,s as eo,F as to,u as no,v as so,bg as oo,bh as ro}from"./JupyterLexicalExtension-_7FM5Om8.js";import{bi as Ec,bj as Cc,bk as vc,bl as wc,bm as Sc,bn as Lc,bo as _c,bp as kc,bq as Ac,br as Nc,bs as $c,bt as Rc,bu as Ic,bv as Pc,d as Oc,e as Mc,bw as Dc,bx as Bc,B as jc,by as Uc,A as Fc,bz as zc,bA as Hc,bB as qc,bC as Wc,bD as Xc,bE as Jc,bF as Vc,bG as Yc,bH as Gc,bI as Zc,bJ as Kc,bK as Qc,bL as eu,bM as tu,bN as nu,bO as su,bP as ou,f as ru,bQ as iu,g as au,bR as lu,bS as cu,bT as uu,bU as du,bV as pu,q as fu,bW as mu,bX as gu,bY as hu,bZ as bu,b_ as yu,b$ as xu,c0 as Tu,c1 as Eu,c2 as Cu,c3 as vu,c4 as wu,c5 as Su,c6 as Lu,c7 as _u,c8 as ku,c9 as Au,ca as Nu,cb as $u,cc as Ru,cd as Iu,ce as Pu,cf as Ou,cg as Mu,ch as Du,ci as Bu,cj as ju,I as Uu,ck as Fu,cl as zu,cm as Hu,cn as qu,co as Wu,cp as Xu,cq as Ju,cr as Vu,cs as Yu,ct as Gu,cu as Zu,cv as Ku,h as Qu,z as ed,cw as td,cx as nd,cy as sd,cz as od,cA as rd,cB as id,cC as ad,cD as ld,cE as cd,cF as ud,cG as dd,J as pd,cH as fd,cI as md,cJ as gd,cK as hd,cL as bd,cM as yd,cN as xd,cO as Td,cP as Ed,cQ as Cd,cR as vd,cS as wd,cT as Sd,cU as Ld,cV as _d,cW as kd,cX as Ad,cY as Nd,cZ as $d,c_ as Rd,c$ as Id,d0 as Pd,d1 as Od,d2 as Md,d3 as Dd,d4 as Bd,d5 as jd,d6 as Ud,d7 as Fd,d8 as zd,d9 as Hd,da as qd,db as Wd,dc as Xd,dd as Jd,de as Vd,df as Yd,dg as Gd,dh as Zd,di as Kd,dj as Qd,dk as ep,dl as tp,dm as np,dn as sp,dp as op,dq as rp,dr as ip,ds as ap,dt as lp,du as cp,dv as up,dw as dp,dx as pp,dy as fp,dz as mp,dA as gp,dB as hp,dC as bp,dD as yp,dE as xp,dF as Tp,dG as Ep,dH as Cp,dI as vp,dJ as wp,dK as Sp,dL as Lp,dM as _p,dN as kp,dO as Ap,dP as Np,dQ as $p,dR as Rp,dS as Ip,dT as Pp,dU as Op,dV as Mp,dW as Dp,dX as Bp,dY as jp,dZ as Up,d_ as Fp,d$ as zp,e0 as Hp,e1 as qp,e2 as Wp,e3 as Xp,e4 as Jp,e5 as Vp,e6 as Yp,e7 as Gp,e8 as Zp,e9 as Kp,ea as Qp,eb as ef,ec as tf,ed as nf,ee as sf,ef as of,eg as rf,eh as af,ei as lf,ej as cf,ek as uf,el as df,em as pf,en as ff,eo as mf,ep as gf,eq as hf,er as bf,es as yf,et as xf,eu as Tf,ev as Ef,ew as Cf,ex as vf,ey as wf,ez as Sf,eA as Lf,eB as _f,eC as kf,eD as Af,eE as Nf,eF as $f,eG as Rf,eH as If,eI as Pf,eJ as Of,eK as Mf,eL as Df,eM as Bf,eN as jf,eO as Uf,eP as Ff,eQ as zf,eR as Hf,eS as qf,eT as Wf,eU as Xf,eV as Jf,eW as Vf,eX as Yf,r as Gf,eY as Zf,eZ as Kf,e_ as Qf,e$ as em,i as tm,f0 as nm,f1 as sm,f2 as om,f3 as rm,f4 as im,f5 as am,f6 as lm,f7 as cm,f8 as um,f9 as dm,fa as pm,fb as fm,fc as mm,fd as gm,fe as hm,ff as bm,fg as ym,fh as xm,fi as Tm,fj as Em,fk as Cm,fl as vm,fm as wm,fn as Sm,fo as Lm,fp as _m,fq as km,fr as Am,fs as Nm,ft as $m,fu as Rm,fv as Im}from"./JupyterLexicalExtension-_7FM5Om8.js";import{kH as io,r as m,j as h,aA as ao,au as lo,B as co,aE as ee,kI as U,kJ as ae,kK as un,kL as fe,kM as z,kN as uo,kO as po,kP as fo,kQ as mo,kR as j,aD as ce,kS as Te,kT as ut,kU as go,kV as ho,kW as bo,kX as yo,kY as dn,kZ as xo,k_ as To,k$ as Eo,l0 as Co,l1 as vo,l2 as wo,aC as So,K as M,bS as ve,l3 as Lo,l4 as se,l5 as X,l6 as ye,l7 as _o,l8 as ko,l9 as Ao,bT as No,la as le,bV as pn,lb as fn,lc as mn,bd as gn,ld as pe,le as $o,lf as Ro,bi as ie,co as Io,I as Le,e4 as hn,C as Po,e as Oo,bX as Mo,k as Do,lg as Bo,lh as jo,bW as ze,li as Uo,lj as xt,d5 as Fo,el as zo,T as Ho,lk as Tt,ll as qo,lm as Wo,ln as Xo,lo as Et,lp as Jo,lq as Vo,av as Yo,aw as Go,aq as Zo,aB as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Om}from"./index-DY8mjz1l.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-CoHussa9.js";import{u as er}from"./Output-BWClePP-.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Dm,u as Bm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Um}from"./YouTubePlugin-BB7Z7INn.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-DyVR0igi.js";import"./color-CG7_7V2-.js";import"./isEqual-Cwjr2skl.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";class nr{registry;_debug;constructor(t,n=!1){this.registry=t,this._debug=n}calculateIndent(t){const n=this.registry.getConfigOrDefault(t.language),s=this.getLeadingWhitespaceCount(t.currentLine);let o=s,r=!1,i=!1,l;for(const a of n.indentTriggers)if(this.matchesIndentRule(t.currentLine,a)){o=s+a.indentAmount,r=!0,l=a.name;break}if(!r){for(const a of n.dedentTriggers)if(this.matchesDedentRule(t.currentLine,a)){i=!0,l=a.name;break}}if(n.customRules){for(const a of n.customRules)if(a.condition(t.currentLine,t)){o=a.apply(o,t);break}}return o=Math.max(0,o),{spaces:o,shouldIndent:r,shouldDedent:i,triggeredRule:l}}getTabString(t){const n=this.registry.getConfigOrDefault(t);return n.useTabs?" ":" ".repeat(n.tabSize)}getTabSize(t){return this.registry.getConfigOrDefault(t).tabSize}calculateOutdent(t,n){const s=this.registry.getConfigOrDefault(n),o=t-s.tabSize;return Math.max(0,o)}getLeadingWhitespaceCount(t){const n=t.match(/^[\t ]*/);if(!n)return 0;const s=n[0];let o=0;for(const r of s)r===" "?o+=4:o+=1;return o}getLeadingWhitespace(t){const n=t.match(/^[\t ]*/);return n?n[0]:""}matchesIndentRule(t,n){switch(n.context){case"line-end":return n.pattern.test(t);case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}matchesDedentRule(t,n){switch(n.context){case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}normalizeIndentation(t,n){const s=this.registry.getConfigOrDefault(n);if(s.useTabs){const o=this.getLeadingWhitespace(t),r=o.length,i=Math.floor(r/s.tabSize),l=r%s.tabSize;return" ".repeat(i)+" ".repeat(l)+t.substring(o.length)}else{const o=this.getLeadingWhitespace(t);return o.replace(/\t/g," ".repeat(s.tabSize)).concat(t.substring(o.length))}}}const sr={language:"python",tabSize:4,useTabs:!1,indentTriggers:[{name:"colon-indent",pattern:/:\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"continuation-backslash",pattern:/\\\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"open-bracket",pattern:/[[({]\s*$/,context:"line-end",indentAmount:4}],dedentTriggers:[{name:"flow-control-keywords",pattern:/^\s*(return|break|continue|pass)(\s|$)/,context:"line-start",dedentAmount:4},{name:"raise-keyword",pattern:/^\s*raise(\s|$)/,context:"line-start",dedentAmount:4}],customRules:[{name:"close-bracket-dedent",condition:e=>/^\s*[\])}]/.test(e),apply:e=>Math.max(0,e-4)}]},bn={language:"javascript",tabSize:2,useTabs:!1,indentTriggers:[{name:"open-brace",pattern:/\{\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-bracket",pattern:/\[\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-paren",pattern:/\(\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"arrow-function",pattern:/=>\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"ternary-operator",pattern:/\?\s*(\/\/.*)?$/,context:"line-end",indentAmount:2}],dedentTriggers:[{name:"return-statement",pattern:/^\s*return(\s|;)/,context:"line-start",dedentAmount:2},{name:"break-continue",pattern:/^\s*(break|continue)(\s|;)/,context:"line-start",dedentAmount:2},{name:"throw-statement",pattern:/^\s*throw(\s|;)/,context:"line-start",dedentAmount:2}],customRules:[{name:"close-brace-dedent",condition:e=>/^\s*}/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-bracket-dedent",condition:e=>/^\s*\]/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-paren-dedent",condition:e=>/^\s*\)/.test(e),apply:e=>Math.max(0,e-2)},{name:"case-label",condition:e=>/^\s*(case\s+.*:|default:)/.test(e),apply:(e,t)=>e}]},or={...bn,language:"typescript"};class rr{configs;options;constructor(t={}){this.configs=new Map,this.options={defaultLanguage:"python",fallbackTabSize:4,debug:!1,...t},this.registerDefaultLanguages(),t.customConfigs&&t.customConfigs.forEach(n=>this.registerLanguage(n))}registerDefaultLanguages(){this.registerLanguage(sr),this.registerLanguage(bn),this.registerLanguage(or),this.registerAlias("py","python"),this.registerAlias("js","javascript"),this.registerAlias("ts","typescript"),this.registerAlias("jsx","javascript"),this.registerAlias("tsx","typescript")}registerLanguage(t){if(this.configs.has(t.language)){this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t.language}' already registered. Use updateConfig() to modify.`);return}this.configs.set(t.language,t)}registerAlias(t,n){const s=this.configs.get(n);s&&this.configs.set(t,s)}getConfig(t){if(!t)return this.getConfig(this.options.defaultLanguage);const n=t.toLowerCase().trim();return this.configs.get(n)}getConfigOrDefault(t){const n=this.getConfig(t);if(n)return n;const s=this.getConfig(this.options.defaultLanguage);return s?(this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t}' not found, using default: ${this.options.defaultLanguage}`),s):(this.options.debug&&console.error(`[LanguageIndentRegistry] No config found for '${t}' and default '${this.options.defaultLanguage}' missing!`),this.createFallbackConfig(t||"unknown"))}createFallbackConfig(t){return{language:t,tabSize:this.options.fallbackTabSize||4,useTabs:this.options.preserveTabs||!1,indentTriggers:[],dedentTriggers:[]}}hasLanguage(t){if(!t)return!1;const n=t.toLowerCase().trim();return this.configs.has(n)}updateConfig(t,n){const s=t.toLowerCase().trim(),o=this.configs.get(s);if(!o)return this.options.debug&&console.warn(`[LanguageIndentRegistry] Cannot update '${t}' - not registered`),!1;const r={...o,...n,language:o.language};return this.configs.set(s,r),!0}getRegisteredLanguages(){return Array.from(this.configs.keys())}clear(){this.configs.clear()}reset(){this.clear(),this.registerDefaultLanguages()}}const ir="[Deleted Comment]",Qe=e=>e.uid===e.thread_uid,yn=e=>e.anchor?.mark_id??e.uid,ar=(e,t)=>e.created_at!==t.created_at?e.created_at<t.created_at?-1:1:e.uid<t.uid?-1:e.uid>t.uid?1:0,He=(e,t)=>e!==void 0&&e.updated_at>t.updated_at?e:t,vt=e=>{const{uid:t,handle:n,name:s,agent_uid:o}=e.author;return t?{kind:"user",uid:t,handle:n??null,name:s??null,...o?{agentUid:o}:{}}:Bn(s||n)},lr=e=>({type:"comment",id:e.uid,author:Dn(vt(e)),authorPrincipal:vt(e),content:e.deleted?ir:e.body,deleted:e.deleted,...e.mentions&&e.mentions.length>0?{mentions:e.mentions}:{},timeStamp:Date.parse(e.created_at)});function cr(e){const t=[...e].sort(ar),n=new Map;for(const s of t)Qe(s)||n.set(s.thread_uid,[...n.get(s.thread_uid)??[],s]);return t.filter(s=>Qe(s)&&!s.deleted&&s.status==="open").map(s=>({type:"thread",id:yn(s),quote:s.quote??"",assignee:s.assignee??null,comments:[s,...n.get(s.uid)??[]].map(lr)}))}const wt=e=>e&&e.length>0?{mentions:e}:{};class dl{searchPeople;assignThread;_editor;_backend;_options;_listeners=new Set;_heardDuringReads=new Set;_records=new Map;_comments=[];constructor(t,n,s={}){this._editor=t,this._backend=n,this._options=s;const{searchPeople:o,assign:r}=n;o&&(this.searchPeople=i=>o.call(n,i).catch(l=>{throw this._options.onError?.(l),l})),r&&(this.assignThread=(i,l)=>this._write(()=>r.call(n,this._threadRecord(i).uid,l?.uid??null)))}connect(){const t=this._backend.subscribe({comment:n=>this._heard(n),ready:()=>{this.refresh()}});return this.refresh(),t}async refresh(){const t=new Map;this._heardDuringReads.add(t);try{const n=await this._backend.list(),s=new Map(n.map(o=>[o.uid,o]));for(const[o,r]of t)s.set(o,He(s.get(o),r));this._records=s,this._changed()}catch(n){this._options.onError?.(n)}finally{this._heardDuringReads.delete(t)}}getComments(){return this._comments}addComment(t,n){if(t.type==="thread"){const s=t.id,o=t.comments[0];this._write(()=>this._backend.create({body:o?.content??"",anchor:{mark_id:s},quote:t.quote,...wt(o?.mentions)}),()=>this._unmark(s))}else n!==void 0?this._write(()=>this._backend.create({body:t.content,thread_uid:this._threadRecord(n).uid,...wt(t.mentions)})):this._options.onError?.(new Error("A comment is written in a thread."))}deleteComment(t){this._write(()=>this._backend.delete(t.id))}deleteThread(t){this._write(()=>this._backend.delete(this._threadRecord(t).uid))}resolveThread(t){this._write(()=>this._backend.resolve(this._threadRecord(t).uid))}registerOnChange(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_write(t,n){Promise.resolve().then(t).then(s=>this._heard(s),s=>{n?.(),this._options.onError?.(s)})}_threadRecord(t){for(const n of this._records.values())if(Qe(n)&&yn(n)===t.id)return n;throw new Error(`The thread ${t.id} is not one the store read.`)}_heard(t){for(const n of this._heardDuringReads)n.set(t.uid,He(n.get(t.uid),t));this._records.set(t.uid,He(this._records.get(t.uid),t)),this._changed()}_changed(){this._comments=cr(this._records.values());for(const t of this._listeners)t()}_unmark(t){this._editor.update(()=>{for(const{node:n}of io())qt(n)&&n.getIDs().includes(t)&&(n.deleteID(t),n.getIDs().length===0&&Mn(n))})}}const dt=m.createContext(void 0);function ur(){const e=m.useContext(dt);if(!e)throw new Error("useContext must be inside a Provider with a value");return e}const dr=dt.Provider,pl=dt.Consumer,fl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function ml(e){const{useStore:t,children:n}=e,{colorMode:s,resolvedMode:o,themeConfig:r,themeBackground:i,lexicalTheme:l}=Qo(t);return h.jsx(ao,{colorMode:s,theme:r.primerTheme,themeStyles:r.themeStyles,children:h.jsx(lo,{colormode:o,backgroundColor:i,useBaseStyles:!1,children:h.jsx(co,{sx:{"& .editor-shell":{backgroundColor:i,borderRadius:2},"& .editor-container":{backgroundColor:i},"& .editor-inner":{backgroundColor:i},"& .editor-input":{backgroundColor:i},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:i}},children:h.jsx(tr.Provider,{value:{theme:l},children:n})})})})}const pr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>pr[t]??t)}function pt(e,t,n="{",s="}"){let o=0;for(let r=t;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(i===n)o++;else if(i===s&&(o--,o===0))return r}return-1}function W(e,t){let n=t;for(;n<e.length&&(e[n]===" "||e[n]===`
|
|
1
|
+
import{d as V}from"./LexicalToolRegistry-8wJyLumb.js";import{D as Vl,a as Yl,b as Gl,e as Zl,c as Kl,g as Ql,i as ec,f as tc,l as nc,h as sc,j as oc,k as rc,m as ic,n as ac,r as lc,o as cc,p as uc,q as dc,s as pc,t as fc,v as mc,w as gc,x as hc,y as bc,z as yc,u as xc}from"./LexicalToolRegistry-8wJyLumb.js";import{_ as qt,E as Mn,G as Dn,H as Bn,K as me,M as Wt,O as ot,P as rt,Q as jn,R as Un,S as Xt,U as Fn,V as Jt,W as zn,X as Hn,Y as Vt,Z as Yt,a0 as qn,a1 as Wn,a2 as Xn,a3 as Jn,C as Gt,a4 as Vn,a5 as Zt,a6 as Yn,a7 as Gn,a8 as Ce,a9 as Q,aa as Kt,ab as it,ac as xe,ad as at,ae as Re,af as Zn,ag as Be,ah as Ve,ai as lt,aj as Kn,ak as Ye,al as Qn,am as es,an as ts,ao as Ge,ap as Qt,aq as en,ar as tn,as as Ie,at as ns,au as ss,av as nn,aw as os,ax as Pe,$ as rs,b as is,a as as,c as ls,ay as sn,az as Y,aA as cs,aB as us,aC as Ze,aD as ds,aE as ps,aF as fs,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Ts,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Es,aT as Cs,aU as vs,aV as ws,aW as Ss,aX as Ls,aY as _s,aZ as ks,a_ as As,x as on,a$ as Ns,b0 as $s,b1 as Rs,b2 as Is,b3 as Ps,b4 as Os,b5 as Fe,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Us,bb as rn,bc as an,bd as ln,be as cn,j as Fs,T as zs,L as Hs,w as qs,k as Ws,l as Xs,D as Js,m as Vs,n as Ys,o as Gs,p as Zs,t as Ks,bf as Qs,s as eo,F as to,u as no,v as so,bg as oo,bh as ro}from"./JupyterLexicalExtension-CqDatsgf.js";import{bi as Ec,bj as Cc,bk as vc,bl as wc,bm as Sc,bn as Lc,bo as _c,bp as kc,bq as Ac,br as Nc,bs as $c,bt as Rc,bu as Ic,bv as Pc,d as Oc,e as Mc,bw as Dc,bx as Bc,B as jc,by as Uc,A as Fc,bz as zc,bA as Hc,bB as qc,bC as Wc,bD as Xc,bE as Jc,bF as Vc,bG as Yc,bH as Gc,bI as Zc,bJ as Kc,bK as Qc,bL as eu,bM as tu,bN as nu,bO as su,bP as ou,f as ru,bQ as iu,g as au,bR as lu,bS as cu,bT as uu,bU as du,bV as pu,q as fu,bW as mu,bX as gu,bY as hu,bZ as bu,b_ as yu,b$ as xu,c0 as Tu,c1 as Eu,c2 as Cu,c3 as vu,c4 as wu,c5 as Su,c6 as Lu,c7 as _u,c8 as ku,c9 as Au,ca as Nu,cb as $u,cc as Ru,cd as Iu,ce as Pu,cf as Ou,cg as Mu,ch as Du,ci as Bu,cj as ju,I as Uu,ck as Fu,cl as zu,cm as Hu,cn as qu,co as Wu,cp as Xu,cq as Ju,cr as Vu,cs as Yu,ct as Gu,cu as Zu,cv as Ku,h as Qu,z as ed,cw as td,cx as nd,cy as sd,cz as od,cA as rd,cB as id,cC as ad,cD as ld,cE as cd,cF as ud,cG as dd,J as pd,cH as fd,cI as md,cJ as gd,cK as hd,cL as bd,cM as yd,cN as xd,cO as Td,cP as Ed,cQ as Cd,cR as vd,cS as wd,cT as Sd,cU as Ld,cV as _d,cW as kd,cX as Ad,cY as Nd,cZ as $d,c_ as Rd,c$ as Id,d0 as Pd,d1 as Od,d2 as Md,d3 as Dd,d4 as Bd,d5 as jd,d6 as Ud,d7 as Fd,d8 as zd,d9 as Hd,da as qd,db as Wd,dc as Xd,dd as Jd,de as Vd,df as Yd,dg as Gd,dh as Zd,di as Kd,dj as Qd,dk as ep,dl as tp,dm as np,dn as sp,dp as op,dq as rp,dr as ip,ds as ap,dt as lp,du as cp,dv as up,dw as dp,dx as pp,dy as fp,dz as mp,dA as gp,dB as hp,dC as bp,dD as yp,dE as xp,dF as Tp,dG as Ep,dH as Cp,dI as vp,dJ as wp,dK as Sp,dL as Lp,dM as _p,dN as kp,dO as Ap,dP as Np,dQ as $p,dR as Rp,dS as Ip,dT as Pp,dU as Op,dV as Mp,dW as Dp,dX as Bp,dY as jp,dZ as Up,d_ as Fp,d$ as zp,e0 as Hp,e1 as qp,e2 as Wp,e3 as Xp,e4 as Jp,e5 as Vp,e6 as Yp,e7 as Gp,e8 as Zp,e9 as Kp,ea as Qp,eb as ef,ec as tf,ed as nf,ee as sf,ef as of,eg as rf,eh as af,ei as lf,ej as cf,ek as uf,el as df,em as pf,en as ff,eo as mf,ep as gf,eq as hf,er as bf,es as yf,et as xf,eu as Tf,ev as Ef,ew as Cf,ex as vf,ey as wf,ez as Sf,eA as Lf,eB as _f,eC as kf,eD as Af,eE as Nf,eF as $f,eG as Rf,eH as If,eI as Pf,eJ as Of,eK as Mf,eL as Df,eM as Bf,eN as jf,eO as Uf,eP as Ff,eQ as zf,eR as Hf,eS as qf,eT as Wf,eU as Xf,eV as Jf,eW as Vf,eX as Yf,r as Gf,eY as Zf,eZ as Kf,e_ as Qf,e$ as em,i as tm,f0 as nm,f1 as sm,f2 as om,f3 as rm,f4 as im,f5 as am,f6 as lm,f7 as cm,f8 as um,f9 as dm,fa as pm,fb as fm,fc as mm,fd as gm,fe as hm,ff as bm,fg as ym,fh as xm,fi as Tm,fj as Em,fk as Cm,fl as vm,fm as wm,fn as Sm,fo as Lm,fp as _m,fq as km,fr as Am,fs as Nm,ft as $m,fu as Rm,fv as Im}from"./JupyterLexicalExtension-CqDatsgf.js";import{kH as io,r as m,j as h,aA as ao,au as lo,B as co,aE as ee,kI as U,kJ as ae,kK as un,kL as fe,kM as z,kN as uo,kO as po,kP as fo,kQ as mo,kR as j,aD as ce,kS as Te,kT as ut,kU as go,kV as ho,kW as bo,kX as yo,kY as dn,kZ as xo,k_ as To,k$ as Eo,l0 as Co,l1 as vo,l2 as wo,aC as So,K as M,bS as ve,l3 as Lo,l4 as se,l5 as X,l6 as ye,l7 as _o,l8 as ko,l9 as Ao,bT as No,la as le,bV as pn,lb as fn,lc as mn,bd as gn,ld as pe,le as $o,lf as Ro,bi as ie,co as Io,I as Le,e4 as hn,C as Po,e as Oo,bX as Mo,k as Do,lg as Bo,lh as jo,bW as ze,li as Uo,lj as xt,d5 as Fo,el as zo,T as Ho,lk as Tt,ll as qo,lm as Wo,ln as Xo,lo as Et,lp as Jo,lq as Vo,av as Yo,aw as Go,aq as Zo,aB as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Om}from"./index-DdBQBN76.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-CoHussa9.js";import{u as er}from"./Output-no9rnFJ7.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Dm,u as Bm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Um}from"./YouTubePlugin-CpgyVTwG.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";class nr{registry;_debug;constructor(t,n=!1){this.registry=t,this._debug=n}calculateIndent(t){const n=this.registry.getConfigOrDefault(t.language),s=this.getLeadingWhitespaceCount(t.currentLine);let o=s,r=!1,i=!1,l;for(const a of n.indentTriggers)if(this.matchesIndentRule(t.currentLine,a)){o=s+a.indentAmount,r=!0,l=a.name;break}if(!r){for(const a of n.dedentTriggers)if(this.matchesDedentRule(t.currentLine,a)){i=!0,l=a.name;break}}if(n.customRules){for(const a of n.customRules)if(a.condition(t.currentLine,t)){o=a.apply(o,t);break}}return o=Math.max(0,o),{spaces:o,shouldIndent:r,shouldDedent:i,triggeredRule:l}}getTabString(t){const n=this.registry.getConfigOrDefault(t);return n.useTabs?" ":" ".repeat(n.tabSize)}getTabSize(t){return this.registry.getConfigOrDefault(t).tabSize}calculateOutdent(t,n){const s=this.registry.getConfigOrDefault(n),o=t-s.tabSize;return Math.max(0,o)}getLeadingWhitespaceCount(t){const n=t.match(/^[\t ]*/);if(!n)return 0;const s=n[0];let o=0;for(const r of s)r===" "?o+=4:o+=1;return o}getLeadingWhitespace(t){const n=t.match(/^[\t ]*/);return n?n[0]:""}matchesIndentRule(t,n){switch(n.context){case"line-end":return n.pattern.test(t);case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}matchesDedentRule(t,n){switch(n.context){case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}normalizeIndentation(t,n){const s=this.registry.getConfigOrDefault(n);if(s.useTabs){const o=this.getLeadingWhitespace(t),r=o.length,i=Math.floor(r/s.tabSize),l=r%s.tabSize;return" ".repeat(i)+" ".repeat(l)+t.substring(o.length)}else{const o=this.getLeadingWhitespace(t);return o.replace(/\t/g," ".repeat(s.tabSize)).concat(t.substring(o.length))}}}const sr={language:"python",tabSize:4,useTabs:!1,indentTriggers:[{name:"colon-indent",pattern:/:\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"continuation-backslash",pattern:/\\\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"open-bracket",pattern:/[[({]\s*$/,context:"line-end",indentAmount:4}],dedentTriggers:[{name:"flow-control-keywords",pattern:/^\s*(return|break|continue|pass)(\s|$)/,context:"line-start",dedentAmount:4},{name:"raise-keyword",pattern:/^\s*raise(\s|$)/,context:"line-start",dedentAmount:4}],customRules:[{name:"close-bracket-dedent",condition:e=>/^\s*[\])}]/.test(e),apply:e=>Math.max(0,e-4)}]},bn={language:"javascript",tabSize:2,useTabs:!1,indentTriggers:[{name:"open-brace",pattern:/\{\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-bracket",pattern:/\[\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-paren",pattern:/\(\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"arrow-function",pattern:/=>\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"ternary-operator",pattern:/\?\s*(\/\/.*)?$/,context:"line-end",indentAmount:2}],dedentTriggers:[{name:"return-statement",pattern:/^\s*return(\s|;)/,context:"line-start",dedentAmount:2},{name:"break-continue",pattern:/^\s*(break|continue)(\s|;)/,context:"line-start",dedentAmount:2},{name:"throw-statement",pattern:/^\s*throw(\s|;)/,context:"line-start",dedentAmount:2}],customRules:[{name:"close-brace-dedent",condition:e=>/^\s*}/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-bracket-dedent",condition:e=>/^\s*\]/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-paren-dedent",condition:e=>/^\s*\)/.test(e),apply:e=>Math.max(0,e-2)},{name:"case-label",condition:e=>/^\s*(case\s+.*:|default:)/.test(e),apply:(e,t)=>e}]},or={...bn,language:"typescript"};class rr{configs;options;constructor(t={}){this.configs=new Map,this.options={defaultLanguage:"python",fallbackTabSize:4,debug:!1,...t},this.registerDefaultLanguages(),t.customConfigs&&t.customConfigs.forEach(n=>this.registerLanguage(n))}registerDefaultLanguages(){this.registerLanguage(sr),this.registerLanguage(bn),this.registerLanguage(or),this.registerAlias("py","python"),this.registerAlias("js","javascript"),this.registerAlias("ts","typescript"),this.registerAlias("jsx","javascript"),this.registerAlias("tsx","typescript")}registerLanguage(t){if(this.configs.has(t.language)){this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t.language}' already registered. Use updateConfig() to modify.`);return}this.configs.set(t.language,t)}registerAlias(t,n){const s=this.configs.get(n);s&&this.configs.set(t,s)}getConfig(t){if(!t)return this.getConfig(this.options.defaultLanguage);const n=t.toLowerCase().trim();return this.configs.get(n)}getConfigOrDefault(t){const n=this.getConfig(t);if(n)return n;const s=this.getConfig(this.options.defaultLanguage);return s?(this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t}' not found, using default: ${this.options.defaultLanguage}`),s):(this.options.debug&&console.error(`[LanguageIndentRegistry] No config found for '${t}' and default '${this.options.defaultLanguage}' missing!`),this.createFallbackConfig(t||"unknown"))}createFallbackConfig(t){return{language:t,tabSize:this.options.fallbackTabSize||4,useTabs:this.options.preserveTabs||!1,indentTriggers:[],dedentTriggers:[]}}hasLanguage(t){if(!t)return!1;const n=t.toLowerCase().trim();return this.configs.has(n)}updateConfig(t,n){const s=t.toLowerCase().trim(),o=this.configs.get(s);if(!o)return this.options.debug&&console.warn(`[LanguageIndentRegistry] Cannot update '${t}' - not registered`),!1;const r={...o,...n,language:o.language};return this.configs.set(s,r),!0}getRegisteredLanguages(){return Array.from(this.configs.keys())}clear(){this.configs.clear()}reset(){this.clear(),this.registerDefaultLanguages()}}const ir="[Deleted Comment]",Qe=e=>e.uid===e.thread_uid,yn=e=>e.anchor?.mark_id??e.uid,ar=(e,t)=>e.created_at!==t.created_at?e.created_at<t.created_at?-1:1:e.uid<t.uid?-1:e.uid>t.uid?1:0,He=(e,t)=>e!==void 0&&e.updated_at>t.updated_at?e:t,vt=e=>{const{uid:t,handle:n,name:s,agent_uid:o}=e.author;return t?{kind:"user",uid:t,handle:n??null,name:s??null,...o?{agentUid:o}:{}}:Bn(s||n)},lr=e=>({type:"comment",id:e.uid,author:Dn(vt(e)),authorPrincipal:vt(e),content:e.deleted?ir:e.body,deleted:e.deleted,...e.mentions&&e.mentions.length>0?{mentions:e.mentions}:{},timeStamp:Date.parse(e.created_at)});function cr(e){const t=[...e].sort(ar),n=new Map;for(const s of t)Qe(s)||n.set(s.thread_uid,[...n.get(s.thread_uid)??[],s]);return t.filter(s=>Qe(s)&&!s.deleted&&s.status==="open").map(s=>({type:"thread",id:yn(s),quote:s.quote??"",assignee:s.assignee??null,comments:[s,...n.get(s.uid)??[]].map(lr)}))}const wt=e=>e&&e.length>0?{mentions:e}:{};class dl{searchPeople;assignThread;_editor;_backend;_options;_listeners=new Set;_heardDuringReads=new Set;_records=new Map;_comments=[];constructor(t,n,s={}){this._editor=t,this._backend=n,this._options=s;const{searchPeople:o,assign:r}=n;o&&(this.searchPeople=i=>o.call(n,i).catch(l=>{throw this._options.onError?.(l),l})),r&&(this.assignThread=(i,l)=>this._write(()=>r.call(n,this._threadRecord(i).uid,l?.uid??null)))}connect(){const t=this._backend.subscribe({comment:n=>this._heard(n),ready:()=>{this.refresh()}});return this.refresh(),t}async refresh(){const t=new Map;this._heardDuringReads.add(t);try{const n=await this._backend.list(),s=new Map(n.map(o=>[o.uid,o]));for(const[o,r]of t)s.set(o,He(s.get(o),r));this._records=s,this._changed()}catch(n){this._options.onError?.(n)}finally{this._heardDuringReads.delete(t)}}getComments(){return this._comments}addComment(t,n){if(t.type==="thread"){const s=t.id,o=t.comments[0];this._write(()=>this._backend.create({body:o?.content??"",anchor:{mark_id:s},quote:t.quote,...wt(o?.mentions)}),()=>this._unmark(s))}else n!==void 0?this._write(()=>this._backend.create({body:t.content,thread_uid:this._threadRecord(n).uid,...wt(t.mentions)})):this._options.onError?.(new Error("A comment is written in a thread."))}deleteComment(t){this._write(()=>this._backend.delete(t.id))}deleteThread(t){this._write(()=>this._backend.delete(this._threadRecord(t).uid))}resolveThread(t){this._write(()=>this._backend.resolve(this._threadRecord(t).uid))}registerOnChange(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_write(t,n){Promise.resolve().then(t).then(s=>this._heard(s),s=>{n?.(),this._options.onError?.(s)})}_threadRecord(t){for(const n of this._records.values())if(Qe(n)&&yn(n)===t.id)return n;throw new Error(`The thread ${t.id} is not one the store read.`)}_heard(t){for(const n of this._heardDuringReads)n.set(t.uid,He(n.get(t.uid),t));this._records.set(t.uid,He(this._records.get(t.uid),t)),this._changed()}_changed(){this._comments=cr(this._records.values());for(const t of this._listeners)t()}_unmark(t){this._editor.update(()=>{for(const{node:n}of io())qt(n)&&n.getIDs().includes(t)&&(n.deleteID(t),n.getIDs().length===0&&Mn(n))})}}const dt=m.createContext(void 0);function ur(){const e=m.useContext(dt);if(!e)throw new Error("useContext must be inside a Provider with a value");return e}const dr=dt.Provider,pl=dt.Consumer,fl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function ml(e){const{useStore:t,children:n}=e,{colorMode:s,resolvedMode:o,themeConfig:r,themeBackground:i,lexicalTheme:l}=Qo(t);return h.jsx(ao,{colorMode:s,theme:r.primerTheme,themeStyles:r.themeStyles,children:h.jsx(lo,{colormode:o,backgroundColor:i,useBaseStyles:!1,children:h.jsx(co,{sx:{"& .editor-shell":{backgroundColor:i,borderRadius:2},"& .editor-container":{backgroundColor:i},"& .editor-inner":{backgroundColor:i},"& .editor-input":{backgroundColor:i},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:i}},children:h.jsx(tr.Provider,{value:{theme:l},children:n})})})})}const pr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>pr[t]??t)}function pt(e,t,n="{",s="}"){let o=0;for(let r=t;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(i===n)o++;else if(i===s&&(o--,o===0))return r}return-1}function W(e,t){let n=t;for(;n<e.length&&(e[n]===" "||e[n]===`
|
|
2
2
|
`);)n++;if(e[n]!=="{")return null;const s=pt(e,n);return s===-1?null:{value:e.slice(n+1,s),end:s+1}}function ne(e,t){let n=t;for(;n<e.length&&e[n]===" ";)n++;if(e[n]!=="[")return null;const s=pt(e,n,"[","]");return s===-1?null:{value:e.slice(n+1,s),end:s+1}}function xn(e){return e.split(`
|
|
3
3
|
`).map(t=>{for(let n=0;n<t.length;n++){if(t[n]==="\\"){n++;continue}if(t[n]==="%")return t.slice(0,n)}return t}).join(`
|
|
4
4
|
`)}function Tn(e,t){if(!e)return null;const n=new RegExp(`(?:^|,)\\s*${t}\\s*=\\s*([^,]+)`).exec(e);return n?n[1].trim():null}function oe(e,t,n){const s=[];let o=t;for(let r=0;r<n;r++){const i=W(e,o);if(!i)break;s.push(i.value),o=i.end}return{values:s,end:o}}function fr(e){const t=e.indexOf("\\begin{document}");if(t===-1)return{body:e,preamble:""};const n=t+16,s=e.lastIndexOf("\\end{document}");return{body:s===-1?e.slice(n):e.slice(n,s),preamble:e.slice(0,t)}}function En(e){return e.charAt(0).toUpperCase()+e.slice(1)}const mr=new Set(["book","report","memoir","scrbook","scrreprt","amsbook","thesis","mitthesis","phdthesis","bookest"]);function Cn(e,t){return mr.has((e??"").toLowerCase())||t!==void 0&&/(?<!\\)\\chapter\b/.test(t)}const gr={h1:"section",h2:"subsection",h3:"subsubsection",h4:"paragraph",h5:"subparagraph",h6:"subparagraph"},hr={h1:"chapter",h2:"section",h3:"subsection",h4:"subsubsection",h5:"paragraph",h6:"subparagraph"},br={part:"h1",chapter:"h1",section:"h1",subsection:"h2",subsubsection:"h3",paragraph:"h4",subparagraph:"h5"},yr={part:"h1",chapter:"h1",section:"h2",subsection:"h3",subsubsection:"h4",paragraph:"h5",subparagraph:"h6"};function xr(e){return e?{js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"TypeScript",py:"Python",python:"Python",sh:"bash",bash:"bash",r:"R",sql:"SQL",c:"C",cpp:"C++",java:"Java",html:"HTML",xml:"XML",json:"JSON",markdown:"Markdown",md:"Markdown"}[e.toLowerCase()]??e:null}function ft(e){return e.replace(/^\n/,"").replace(/\n[ \t]*$/,"")}function Tr(e){if(uo(e))return St(e.text);if(po(e)||fo(e)){const t=e.data["text/plain"];return t===void 0?null:St(t)}return mo(e)?e.traceback.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b$ as E,ae as I,af as j,c2 as N,ak as x,r as s,c3 as w,c4 as k,c5 as A,ag as D,c6 as O,c7 as P,ai as M,c8 as T,c9 as R,ca as U,cb as W}from"../datalayer-app-main.js";import{I as $}from"./tokens-CBD7cd6p.js";import{c as q}from"./index-
|
|
1
|
+
import{b$ as E,ae as I,af as j,c2 as N,ak as x,r as s,c3 as w,c4 as k,c5 as A,ag as D,c6 as O,c7 as P,ai as M,c8 as T,c9 as R,ca as U,cb as W}from"../datalayer-app-main.js";import{I as $}from"./tokens-CBD7cd6p.js";import{c as q}from"./index-BN8Bbau-.js";import{b as F}from"./index-CFP9psRB.js";import{I as H}from"./tokens-BvmYCqiu.js";import"./Output-no9rnFJ7.js";import"./index-DSN70XMH.js";import"./hoverbox-CStlKQWE.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./PaintbrushIcon-CLU8RilX.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./CellSidebarExtension-B-73cmcQ.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./renderer-DKKfWkWv.js";import"./SquareIcon-e3ygcjpv.js";import"./SortAscIcon-CVKVWIWQ.js";import"./url-DuKx0yk0.js";/* empty css */import"./index-Dro44tIm.js";/* empty css *//* empty css */import"./index-DsG9xhMj.js";/* empty css */import"./index-CNU-WVhQ.js";import"./index--OLIX362.js";import"./index-DYGslHkf.js";import"./index-BSRVX3UN.js";import"./index-BH2OX5l8.js";import"./index-C3vDfO5_.js";import"./index-Ko8lxXFd.js";import"./index-CB9u17_J.js";import"./index-BUVtc_FV.js";import"./ArrowLeftIcon-Y3PTljcl.js";import"./SkubbleIcon-tlg17jBG.js";import"./usePrimerThemeBridge-CoHussa9.js";import"./index-Dobs-OKl.js";import"./KernelVariables-CS6h5HyK.js";import"./index-BvgsWH_d.js";import"./SortDescIcon-CS4EzHeS.js";import"./NotebookToolbar-rtMQZWHQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./sessions-BRALW9Yv.js";import"./tokens-DTIgYcNS.js";import"./drivecontents-CxwZz_5W.js";import"./kernel-BI-BLP-K.js";const K="jp-Launcher";class V extends E{constructor(){super(...arguments),this.itemsList=[]}add(t){const n=y.createItem(t);return this.itemsList.push(n),this.stateChanged.emit(void 0),new I(()=>{j.removeFirstOf(this.itemsList,n),this.stateChanged.emit(void 0)})}items(){return this.itemsList[Symbol.iterator]()}}class z extends N{constructor(t){super(t.model),this._pending=!1,this._cwd="",this._cwd=t.cwd,this.translator=t.translator||x,this._trans=this.translator.load("jupyterlab"),this._callback=t.callback,this._commands=t.commands,this.addClass(K)}get cwd(){return this._cwd}set cwd(t){this._cwd=t,this.update()}get pending(){return this._pending}set pending(t){this._pending=t}render(){if(!this.model)return null;const t=[this._trans.__("Notebook"),this._trans.__("Console"),this._trans.__("Other")],n=[this._trans.__("Notebook"),this._trans.__("Console")],o=Object.create(null);for(const e of this.model.items()){const a=e.category||this._trans.__("Other");a in o||(o[a]=[]),o[a].push(e)}for(const e in o)o[e]=o[e].sort((a,i)=>y.sortCmp(a,i,this._cwd,this._commands));const r=[];let h;const c=[];for(const e of t)c.push(e);for(const e in o)t.indexOf(e)===-1&&c.push(e);return c.forEach(e=>{if(!o[e])return;const a=o[e][0],i={...a.args,cwd:this.cwd},m=n.indexOf(e)>-1,p=this._commands.iconClass(a.command,i),u=this._commands.icon(a.command,i);e in o&&(h=s.createElement("div",{className:"jp-Launcher-section",key:e},s.createElement("div",{className:"jp-Launcher-sectionHeader"},s.createElement(w.resolveReact,{icon:u,iconClass:k(p,"jp-Icon-cover"),stylesheet:"launcherSection","aria-hidden":"true"}),s.createElement("h2",{className:"jp-Launcher-sectionTitle"},e)),s.createElement("div",{className:"jp-Launcher-cardContainer"},Array.from(A(o[e],f=>G(m,f,this,this._commands,this._trans,this._callback))))),r.push(h))}),s.createElement("div",{className:"jp-Launcher-body"},s.createElement("div",{className:"jp-Launcher-content"},s.createElement("div",{className:"jp-Launcher-cwd"},s.createElement("h3",null,this.cwd)),r))}}function G(d,t,n,o,r,h){const c=t.command,e={...t.args,cwd:n.cwd},a=o.caption(c,e),i=o.label(c,e),m=d?i:a||i,p=()=>{n.pending!==!0&&(n.pending=!0,o.execute(c,{...t.args,cwd:n.cwd}).then(l=>{n.pending=!1,l instanceof D&&h(l)}).catch(l=>{console.error(l),n.pending=!1,O(r._p("Error","Launcher Error"),l)}))},u=l=>{l.key==="Enter"&&p()},f=o.iconClass(c,e),C=o.icon(c,e);return s.createElement("div",{className:"jp-LauncherCard",title:m,role:"button",onClick:p,onKeyDown:u,tabIndex:0,"data-category":t.category||r.__("Other"),key:y.keyProperty.get(t)},s.createElement("div",{className:"jp-LauncherCard-icon"},d?t.kernelIconUrl?s.createElement("img",{src:t.kernelIconUrl,className:"jp-Launcher-kernelIcon",alt:m}):s.createElement("div",{className:"jp-LauncherCard-noKernelIcon"},i[0].toUpperCase()):s.createElement(w.resolveReact,{icon:C,iconClass:k(f,"jp-Icon-cover"),stylesheet:"launcherCard"})),s.createElement("div",{className:"jp-LauncherCard-label",title:m},s.createElement("p",null,i)))}var y;(function(d){let t=0;d.keyProperty=new P({name:"key",create:()=>t++});function n(r){return{...r,category:r.category||"",rank:r.rank!==void 0?r.rank:1/0}}d.createItem=n;function o(r,h,c,e){const a=r.rank,i=h.rank;if(a!==i&&a!==void 0&&i!==void 0)return a<i?-1:1;const m=e.label(r.command,{...r.args,cwd:c}),p=e.label(h.command,{...h.args,cwd:c});return m.localeCompare(p)}d.sortCmp=o})(y||(y={}));var g;(function(d){d.create="launcher:create"})(g||(g={}));const Je={activate:J,id:"@jupyterlab/launcher-extension:plugin",description:"Provides the launcher tab service.",requires:[M],optional:[q,F,H],provides:$,autoStart:!0};function J(d,t,n,o,r){const{commands:h,shell:c}=d,e=t.load("jupyterlab"),a=new V;return h.addCommand(g.create,{label:e.__("New Launcher"),icon:i=>i.toolbar?T:void 0,describedBy:{args:{type:"object",properties:{cwd:{type:"string",description:e.__("The current working directory")},toolbar:{type:"boolean",description:e.__("Whether the command is executed from a toolbar")},activate:{type:"boolean",description:e.__("Whether to activate the widget")},ref:{type:"string",description:e.__("The reference widget id")}}}},execute:i=>{var m,p;const u=(p=(m=i.cwd)!==null&&m!==void 0?m:r?.model.path)!==null&&p!==void 0?p:"",f=`launcher-${L.id++}`,C=v=>{W(c.widgets("main"),b=>b===v)&&(c.add(v,"main",{ref:f}),l.dispose())},l=new z({model:a,cwd:u,callback:C,commands:h,translator:t});l.model=a,l.title.icon=R,l.title.label=e.__("Launcher");const _=new U({content:l});if(_.title.closable=!!Array.from(c.widgets("main")).length,_.id=f,c.add(_,"main",{activate:i.activate,ref:i.ref}),n&&n.layoutModified.connect(()=>{_.title.closable=Array.from(n.widgets("main")).length>1},_),r){const v=b=>{l.cwd=b.path};r.model.pathChanged.connect(v),l.disposed.connect(()=>{r.model.pathChanged.disconnect(v)})}return _}}),n&&Promise.all([d.restored,r?.model.restored]).then(()=>{function i(){n.isEmpty("main")&&h.execute(g.create)}n.layoutModified.connect(()=>{i()})}),o&&o.addItem({command:g.create,category:e.__("Launcher")}),n&&(n.addButtonEnabled=!0,n.addRequested.connect((i,m)=>{var p;const u=((p=m.currentTitle)===null||p===void 0?void 0:p.owner.id)||m.titles[m.titles.length-1].owner.id;return h.execute(g.create,{ref:u})})),a}var L;(function(d){d.id=0})(L||(L={}));export{Je as default};
|