@datalayer/agent-runtimes 1.6.84 → 1.6.86
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-BMTA9AQz.js → CellSidebarExtension-B_Bqi3Eh.js} +1 -1
- package/dist-embed/chunks/{CollapsiblePlugin-D_fVK4i3.js → CollapsiblePlugin-DPGnrmLj.js} +1 -1
- package/dist-embed/chunks/{DeckComponent-CGFO-xGa.js → DeckComponent-oBh8nbTa.js} +1 -1
- package/dist-embed/chunks/{DocumentView-BzBCyOZP.js → DocumentView-C8G8fA7K.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-spGg7WCy.js → EphemeralDocument-Bm1w17Zw.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-BqUNh0zm.js → EphemeralNotebook-jQ7FGCY-.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-Cb0JOQDr.js → ExcalidrawComponent-BgjhoJC3.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-MG-b9Tus.js → ExcalidrawModal-DtdsEiaS.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-lz41mjjY.js → JupyterLexicalExtension-Dr8dgCst.js} +5 -5
- package/dist-embed/chunks/{KernelVariables-BXCbgHG5.js → KernelVariables-cH-x-Hrc.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-BT_hNR4k.js → NotebookToolSurfaces-BcIduPcQ.js} +1 -1
- package/dist-embed/chunks/{NotebookView-wYwtORMB.js → NotebookView-LJ0GBHTQ.js} +1 -1
- package/dist-embed/chunks/{Output-BfjIM99o.js → Output-Do1CYRIF.js} +1 -1
- package/dist-embed/chunks/{SandboxDetailsDialog-B_nI8zH_.js → SandboxDetailsDialog-DjP6mCWy.js} +1 -1
- package/dist-embed/chunks/{WidgetVariableView-Dqsy8MDf.js → WidgetVariableView-BQoMV999.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-BLdLNfNB.js → YouTubePlugin-BCHN7vdi.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Boa4jpGN.js → ar-SA-G6X2FPQ2-4AR7vABL.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-DS7v8DUm.js → az-AZ-76LH7QW2-DQ2RQ6Bt.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-CPWbvkhp.js → bg-BG-XCXSNQG7-BRTYabxb.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-DJlv8gSj.js → bn-BD-2XOGV67Q-DJpR_aiV.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-_XMb5PXx.js → ca-ES-6MX7JW3Y-BrHrTXrx.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-Cc6P0HN5.js → cs-CZ-2BRQDIVT-CmCt0bDq.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-BPgmzhCM.js → da-DK-5WZEPLOC-Bow4-dps.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-DjNk3C1Q.js → de-DE-XR44H4JA-DOrKYiYP.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-BA_6_8BV.js → el-GR-BZB4AONW-BTtxEAc0.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-DB2skShM.js → es-ES-U4NZUMDT-DhrLOB7I.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-D4jAAmi7.js → eu-ES-A7QVB2H4-CdpglPNY.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-Cm5LhQ8o.js → fa-IR-HGAKTJCU-Ea2hzNvl.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-DEH_Gx5V.js → fi-FI-Z5N7JZ37-D6KBS1-v.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-Blvt0egy.js → fr-FR-RHASNOE6-CeDw1EdR.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-CTMS_g-D.js → gl-ES-HMX3MZ6V-DK2-uVTg.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-CwRAX3eS.js → he-IL-6SHJWFNN-Fk0F_rV-.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BGqXOwtD.js → hi-IN-IWLTKZ5I-03USmwuM.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-DPTG8MEz.js → hu-HU-A5ZG7DT2-BSbsIqRs.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-SGVYgM36.js → id-ID-SAP4L64H-Def1ERB7.js} +1 -1
- package/dist-embed/chunks/{index-BGTb9Nvb.js → index-DB6fbGKT.js} +1 -1
- package/dist-embed/chunks/{index-_yFHxlc9.js → index-DrrVr0x3.js} +14 -14
- package/dist-embed/chunks/{index-DRUP-YmW.js → index-z8PItpd8.js} +2 -2
- package/dist-embed/chunks/{it-IT-JPQ66NNP-BVqiIDuA.js → it-IT-JPQ66NNP-SLcJY1NM.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-BVru9viS.js → ja-JP-DBVTYXUO-Cc9AUQ4A.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-COq8GIG8.js → kaa-6HZHGXH3-CzXQn7ER.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-C6sCJW81.js → kab-KAB-ZGHBKWFO-Cd1AWKsn.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-dn5L62v9.js → kk-KZ-P5N5QNE5-CoeOUA0W.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-DHRs2Dac.js → km-KH-HSX4SM5Z-Newj9En6.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-B-6WTOYs.js → ko-KR-MTYHY66A-B0HPCdz1.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-DtHakiL_.js → ku-TR-6OUDTVRD-DGP0qnbh.js} +1 -1
- package/dist-embed/chunks/{lib-BzbIpAN9.js → lib-B8KSw9bH.js} +1 -1
- package/dist-embed/chunks/{lib-Btas-Vc2.js → lib-B8ebpTVD.js} +1 -1
- package/dist-embed/chunks/{lib-DekQ5MbL.js → lib-BSeAgx1v.js} +1 -1
- package/dist-embed/chunks/{lib-Cz-lZRHD.js → lib-BYzUzQ6H.js} +1 -1
- package/dist-embed/chunks/{lib-BrI7Hb25.js → lib-Bc3R7boK.js} +1 -1
- package/dist-embed/chunks/{lib-BMPXKfof.js → lib-CADgZZ9y.js} +1 -1
- package/dist-embed/chunks/{lib-Bt3UDo1P.js → lib-CLcIUOT7.js} +1 -1
- package/dist-embed/chunks/{lib-CYKJVq8i.js → lib-CXGDRspZ.js} +1 -1
- package/dist-embed/chunks/{lib-DLTzM19O.js → lib-CaukawRB.js} +1 -1
- package/dist-embed/chunks/{lib-DS4NMFQk.js → lib-Cn7qCM0u.js} +1 -1
- package/dist-embed/chunks/{lib-ZsSgUH3L.js → lib-Coc8tcSm.js} +1 -1
- package/dist-embed/chunks/{lib-CM6qdZu_.js → lib-CrCTDU2F.js} +1 -1
- package/dist-embed/chunks/{lib-C_8F-jrZ.js → lib-DDbDl1bK.js} +1 -1
- package/dist-embed/chunks/{lib-Y2W358Nu.js → lib-DKIJv0vv.js} +1 -1
- package/dist-embed/chunks/{lib-BQwc_iHi.js → lib-Enno6S7H.js} +1 -1
- package/dist-embed/chunks/{lib-BZqd0lRo.js → lib-EuT6O3Jf.js} +1 -1
- package/dist-embed/chunks/{lib-D--prlsO.js → lib-Y90USIm4.js} +1 -1
- package/dist-embed/chunks/{lib-DPx8N2oL.js → lib-YvkJZ6Rp.js} +1 -1
- package/dist-embed/chunks/{lib-Bukh35h2.js → lib-nq0B6NsD.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-Bov6lsrL.js → lt-LT-XHIRWOB4-BIsLadFj.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-7TYkSlIn.js → lv-LV-5QDEKY6T-C8HmZZBF.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-C1hMHCkZ.js → mr-IN-CRQNXWMA-DKYnEuji.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-CmNBubDy.js → my-MM-5M5IBNSE-MY3GKeMd.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-NtLUc485.js → nb-NO-T6EIAALU-txIp5vuE.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CCHd5AqI.js → nl-NL-IS3SIHDZ-C6xelwh4.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-BYMvh_fX.js → nn-NO-6E72VCQL-BFYvN5n1.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-CkuSUWy_.js → oc-FR-POXYY2M6-uGpH7RML.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-Daq4uKWi.js → pa-IN-N4M65BXN-Cg4Z-vtz.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-_vjQ8CcA.js → percentages-BXMCSKIN-9RttMFHC.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-DUHQouxW.js → pl-PL-T2D74RX3-Dv_CTL10.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-DK_6K-F_.js → pt-BR-5N22H2LF-CK-yjA9j.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DtH8Iay_.js → pt-PT-UZXXM6DQ-DYb7ailg.js} +1 -1
- package/dist-embed/chunks/{renderer-jLLXpZ99.js → renderer-B_98xkGt.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-CfeEiLsp.js → ro-RO-JPDTUUEW-1Cu9X8j1.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-xuXvLXWI.js → ru-RU-B4JR7IUQ-Bl3rV2YR.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-CP-9ouz_.js → si-LK-N5RQ5JYF-C2t5ES1t.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-BB-nLd53.js → sk-SK-C5VTKIMK-BPwM2QoN.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-Ct4gcmka.js → sl-SI-NN7IZMDC-BCS7eO-5.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-Jbgk4hFg.js → subset-shared.chunk-Cs06OLE4.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-C52XcgS8.js → subset-worker.chunk-C-vXxYep.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-DSfTTYTP.js → sv-SE-XGPEYMSR-sUR_yJ3Z.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-_SwRKWkS.js → ta-IN-2NMHFXQM-c1DneC5B.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-NbkJxgfv.js → th-TH-HPSO5L25-TIsXPiQR.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-DrMMVO-E.js → tr-TR-DEFEU3FU-Bvb4Ep_L.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-B53y70gR.js → uk-UA-QMV73CPH-BNgdD_2E.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-BVHYf59K.js → vi-VN-M7AON7JQ-T0aYX7Py.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-z2taSDkS.js → zh-CN-LNUGB5OW-CpDHeCAz.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-Rkl2piEx.js → zh-HK-E62DVLB3-B5Kmyhoq.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-BgDiBZag.js → zh-TW-RAJ6MFWO-D-Gvp4EC.js} +1 -1
- package/dist-embed/datalayer-app-main.js +10 -10
- package/lib/portable/hosts/contracts.json +1 -1
- package/lib/specs/apps.d.ts +1 -1
- package/lib/specs/apps.js +95 -21
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as N,aG as R,aE as S,ax as pe,aa as me,ce as C,az as Q,bh as ee,aD as I,aJ as ge,dw as fe,aH as be,dx as ve,r as k,cn as Z,aL as ye,cs as O,ch as q,dy as he,dz as _e,aB as we,dA as xe,dB as U}from"../datalayer-app-main.js";import{I as Te,S as Be}from"./index-B3Hf3MzW.js";import{I as V}from"./tokens-1h_N3aLM.js";import{I as Pe,b as te,d as Ee,M as X}from"./index-i9IsP_xD.js";import{I as je}from"./treepathupdater-CMx8sTW-.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-
|
|
1
|
+
import{aF as N,aG as R,aE as S,ax as pe,aa as me,ce as C,az as Q,bh as ee,aD as I,aJ as ge,dw as fe,aH as be,dx as ve,r as k,cn as Z,aL as ye,cs as O,ch as q,dy as he,dz as _e,aB as we,dA as xe,dB as U}from"../datalayer-app-main.js";import{I as Te,S as Be}from"./index-B3Hf3MzW.js";import{I as V}from"./tokens-1h_N3aLM.js";import{I as Pe,b as te,d as Ee,M as X}from"./index-i9IsP_xD.js";import{I as je}from"./treepathupdater-CMx8sTW-.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-z8PItpd8.js";import{R as Ae}from"./menu-BMxoTI4i.js";import"./hoverbox-CStlKQWE.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.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{r as j,dC as Z,dD as X,cn as B,aa as ee,aE as T,cj as te,J as k,cf as oe,aA as I,dx as V,aD as x,dE as re,dF as H,ce as v,dG as ie,dH as N,dI as ne,dJ as O,dw as ae,aH as se,cp as le,cm as L,dK as E,dL as de,dM as ce,dN as pe,dO as ue,dP as he,ck as me,dQ as fe,dR as ge,dS as we,dT as be,dU as ye,dV as _e,dW as ve,dy as A}from"../datalayer-app-main.js";import{T as R,G as Fe,e as xe,b as U,I as Ce,f as q}from"./index-i9IsP_xD.js";import{I as Be}from"./tokens-C5FWZLTC.js";import{h as ke,e as Pe,J as Se,c as D,f as Te,k as Ie,F as je,l as Ne}from"./index-DRUP-YmW.js";import{I as G}from"./tokens-BoOsoUsu.js";import{a as C,b as We,I as P,c as J}from"./tokens-DuSIK5iU.js";import{I as M}from"./tokens-1h_N3aLM.js";import{I as Me}from"./treepathupdater-CMx8sTW-.js";import{g as Oe}from"./kernelfilestypes-D2B-sFfi.js";import"./hoverbox-CStlKQWE.js";import"./Output-BfjIM99o.js";import"./index--Rl4aMiU.js";import"./index-_yFHxlc9.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-BMTA9AQz.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-jLLXpZ99.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-BXCbgHG5.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";function Le(o){const{width:a,percentage:h,...p}=o;return j.createElement("div",{className:"jp-Statusbar-ProgressBar-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h},j.createElement(Ue,{percentage:h,...p,contentWidth:a}))}function Ue(o){return j.createElement("div",{style:{width:`${o.percentage}%`}},j.createElement("p",null,o.content))}class K extends Z{constructor(a){super({icon:X,label:a.label,onClick:()=>{this._input.click()},tooltip:W.translateToolTip(a.translator),enabled:a.model.allowFileUploads}),this._onInputChanged=()=>{const p=Array.prototype.slice.call(this._input.files).map(r=>this.fileBrowserModel.upload(r));Promise.all(p).then(r=>{this._filesUploaded.emit(r)}).catch(r=>{B(this._trans._p("showErrorMessage","Upload Error"),r)})},this._onInputClicked=()=>{this._input.value=""},this._input=W.createUploadInput(),this._filesUploaded=new ee(this),this.fileBrowserModel=a.model,this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._input.onclick=this._onInputClicked,this._input.onchange=this._onInputChanged,this.addClass("jp-id-upload")}get filesUploaded(){return this._filesUploaded}}var W;(function(o){function a(){const p=document.createElement("input");return p.type="file",p.multiple=!0,p}o.createUploadInput=a;function h(p){return p=p||T,p.load("jupyterlab").__("Upload Files")}o.translateToolTip=h})(W||(W={}));const Ee=4;function z(o){const h=(o.translator||T).load("jupyterlab");return k.createElement(Fe,{spacing:Ee},k.createElement(R,{source:h.__("Uploading…")}),k.createElement(Le,{percentage:o.upload}))}const Ae=2e3;class S extends te{constructor(a){super(new S.Model(a.tracker.currentWidget&&a.tracker.currentWidget.model)),this._onBrowserChange=(h,p)=>{p===null?this.model.browserModel=null:this.model.browserModel=p.model},this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._tracker=a.tracker,this._tracker.currentChanged.connect(this._onBrowserChange)}render(){return this.model.items.length>0?this.model.items[0].complete?k.createElement(R,{source:this._trans.__("Complete!")}):k.createElement(z,{upload:this.model.items[0].progress,translator:this.translator}):k.createElement(z,{upload:100,translator:this.translator})}dispose(){super.dispose(),this._tracker.currentChanged.disconnect(this._onBrowserChange)}}(function(o){class a extends oe{constructor(p){super(),this._uploadChanged=(r,s)=>{if(s.name==="start")this._items.push({path:s.newValue.path,progress:s.newValue.progress*100,complete:!1});else if(s.name==="update"){const t=I.findFirstIndex(this._items,c=>c.path===s.oldValue.path);t!==-1&&(this._items[t].progress=s.newValue.progress*100)}else if(s.name==="finish"){const t=I.findFirstValue(this._items,c=>c.path===s.oldValue.path);t&&(t.complete=!0,setTimeout(()=>{I.removeFirstOf(this._items,t),this.stateChanged.emit(void 0)},Ae))}else if(s.name==="failure")I.removeFirstWhere(this._items,t=>t.path===s.newValue.path);else return;this.stateChanged.emit(void 0)},this._items=[],this._browserModel=null,this.browserModel=p}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(p){const r=this._browserModel;r&&r.uploadChanged.disconnect(this._uploadChanged),this._browserModel=p,this._items=[],this._browserModel!==null&&this._browserModel.uploadChanged.connect(this._uploadChanged),this.stateChanged.emit(void 0)}}o.Model=a})(S||(S={}));const $="FileBrowser",_="@jupyterlab/filebrowser-extension:browser";var u;(function(o){o.copy="filebrowser:copy",o.copyDownloadLink="filebrowser:copy-download-link",o.cut="filebrowser:cut",o.del="filebrowser:delete",o.download="filebrowser:download",o.duplicate="filebrowser:duplicate",o.selectAll="filebrowser:select-all",o.hideBrowser="filebrowser:hide-main",o.goToPath="filebrowser:go-to-path",o.goUp="filebrowser:go-up",o.openPath="filebrowser:open-path",o.openUrl="filebrowser:open-url",o.open="filebrowser:open",o.openBrowserTab="filebrowser:open-browser-tab",o.paste="filebrowser:paste",o.createNewDirectory="filebrowser:create-new-directory",o.createNewFile="filebrowser:create-new-file",o.createNewMarkdownFile="filebrowser:create-new-markdown-file",o.refresh="filebrowser:refresh",o.rename="filebrowser:rename",o.copyShareableLink="filebrowser:share-main",o.copyPath="filebrowser:copy-path",o.showBrowser="filebrowser:activate",o.shutdown="filebrowser:shutdown",o.toggleBrowser="filebrowser:toggle-main",o.toggleFileFilter="filebrowser:toggle-file-filter",o.toggleNavigateToCurrentDirectory="filebrowser:toggle-navigate-to-current-directory",o.toggleLastModified="filebrowser:toggle-last-modified",o.toggleShowFullPath="filebrowser:toggle-show-full-path",o.toggleDateCreated="filebrowser:toggle-date-created",o.toggleFileSize="filebrowser:toggle-file-size",o.toggleSortNotebooksFirst="filebrowser:toggle-sort-notebooks-first",o.toggleHiddenFiles="filebrowser:toggle-hidden-files",o.toggleSingleClick="filebrowser:toggle-single-click-navigation",o.toggleFileCheckboxes="filebrowser:toggle-file-checkboxes",o.editPath="filebrowser:edit-path"})(u||(u={}));const Y="filebrowser",ze={id:_,description:"Set up the default file browser commands and state restoration",requires:[P,C,x],optional:[Te,M,Me,U],provides:J,autoStart:!0,activate:async(o,a,h,p,r,s,t,c)=>{const i=a;r&&r.add(i,Y);const d=v.PageConfig.getOption("preferredPath");return d&&await i.model.cd(d),Ze(o,i,h,p,s,c),Promise.all([o.restored,i.model.restored]).then(()=>{t&&i.model.pathChanged.connect((f,e)=>{t(e.newValue)})}),{openPath:u.openPath}}},$e={id:"@jupyterlab/filebrowser-extension:settings",description:"Set up the default file browser settings",requires:[P],optional:[M],autoStart:!0,activate:(o,a,h)=>{h&&h.load(_).then(p=>{const r={navigateToCurrentDirectory:!1,singleClickNavigation:!1,showLastModifiedColumn:!0,showDateCreatedColumn:!1,showFileSizeColumn:!1,showHiddenFiles:!1,showFileCheckboxes:!1,sortNotebooksFirst:!1,sortFileNamesNaturally:!0,showFullPath:!1,allowFileUploads:!0};a.showFileFilter=p.get("showFileFilter").composite;function s(t){let c;for(c in r){const e=t.get(c).composite;a[c]=e}const i=t.get("breadcrumbs").composite;a.minimumBreadcrumbsLeftItems=i.minimumLeftItems,a.minimumBreadcrumbsRightItems=i.minimumRightItems;const d=t.get("filterDirectories").composite,f=t.get("useFuzzyFilter").composite;a.model.filterDirectories=d,a.model.useFuzzyFilter=f,a.clearFilterOnNavigation=t.get("clearFilterOnNavigation").composite}p.changed.connect(s),s(p)})}},Ve={id:"@jupyterlab/filebrowser-extension:factory",description:"Provides the file browser factory.",provides:C,requires:[G,x],optional:[V.IStateDB,ke.IInfo],activate:async(o,a,h,p,r)=>{const s=new re({namespace:Y});return{createFileBrowser:(c,i={})=>{var d,f;const e=i.state===null?void 0:i.state||p||void 0,n=new je({translator:h,auto:(d=i.auto)!==null&&d!==void 0?d:!0,manager:a,driveName:i.driveName||"",refreshInterval:i.refreshInterval,refreshStandby:()=>r&&!r.isConnected||"when-hidden",state:e,allowFileUploads:(f=i.allowFileUploads)!==null&&f!==void 0?f:!0}),l=i.restore,m=new Ne({id:c,model:n,restore:l,translator:h,state:e,renderer:i.renderer});return s.add(m),m},tracker:s}}},He={id:"@jupyterlab/filebrowser-extension:default-file-browser",description:"Provides the default file browser",provides:P,requires:[C],optional:[Pe,Se.ITreeResolver,D,x,We,xe,V.IStateDB],activate:async(o,a,h,p,r,s,t,c,i)=>{const{commands:d}=o,f=(s??T).load("jupyterlab"),e=a.createFileBrowser("filebrowser",{auto:!1,restore:!1,renderer:t??void 0});e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",f.__("File Browser Section")),e.title.icon=H,e.title.dataset={...e.title.dataset,jpTabLabel:f.__("File Browser")};const n=()=>{const l=o.commands.keyBindings.find(m=>m.command===u.toggleBrowser);if(l){const m=l.keys.map(de.formatKeystroke).join(", ");e.title.caption=f.__("File Browser (%1)",m)}else e.title.caption=f.__("File Browser")};if(n(),o.commands.keyBindingChanged.connect(()=>{n()}),c&&c.registerTarget("@jupyterlab/filebrowser-extension:default-file-browser",f.__("File Browser"),e),i){const l="filebrowser:section-sizes";let m=null;const w=()=>{const g=e.accordionPanel;if(!g||m===g)return;m=g;const b=async()=>{await i.save(l,g.relativeSizes())};g.handleMoved.connect(b),i.fetch(l).then(y=>{Array.isArray(y)&&g.setRelativeSizes(y)})};e.sectionChanged.connect(()=>{w(),m&&i.save(l,m.relativeSizes())})}return F.restoreBrowser(e,d,h,p,o,r),e}},Re={id:"@jupyterlab/filebrowser-extension:download",description:"Adds the download file commands. Disabling this plugin will NOT disable downloading files from the server, if the user enters the appropriate download URLs.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.download,{execute:()=>{const t=s.currentWidget;if(t)return t.download()},icon:ne.bindprops({stylesheet:"menuItem"}),label:p.__("Download"),describedBy:{args:{type:"object",properties:{}}}}),r.addCommand(u.copyDownloadLink,{execute:()=>{const t=s.currentWidget;if(t)return t.model.manager.services.contents.getDownloadUrl(t.selectedItems().next().value.path).then(c=>{N.copyToSystem(c)})},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:O.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Download Link"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}})}},qe={id:"@jupyterlab/filebrowser-extension:create-new-language-file",description:"Adds context menu entries for creating Python/R/Julia files",requires:[x],autoStart:!0,activate:async(o,a)=>{const h=a.load("jupyterlab");let p=new A;const r=o.serviceManager.kernelspecs,s=async()=>{var t,c;const i=await Oe(r);p.dispose(),p=new A;for(const d of i)p.add(o.contextMenu.addItem({command:u.createNewFile,selector:".jp-DirListing-content",args:{ext:d.extensions[0],label:h.__("New %1 File",d.displayName),iconName:(c=(t=d.icon)===null||t===void 0?void 0:t.toString())!==null&&c!==void 0?c:""},rank:52}))};r.specsChanged.connect(s),s().catch(console.warn)}},Q={id:"@jupyterlab/filebrowser-extension:widget",description:"Adds the file browser to the application shell.",requires:[G,P,C,M,Ce,x,D,J],optional:[U],autoStart:!0,activate:(o,a,h,p,r,s,t,c,i,d)=>{const{commands:f}=o,{tracker:e}=p,n=t.load("jupyterlab");s.addFactory($,"uploader",l=>new K({model:l.model,translator:t})),ae(h,se(s,r,$,Q.id,t)),c.add(h,"left",{rank:100,type:"File Browser"}),f.addCommand(u.toggleBrowser,{label:n.__("File Browser"),describedBy:{args:{type:"object",properties:{}}},execute:()=>h.isHidden?f.execute(u.showBrowser,void 0):f.execute(u.hideBrowser,void 0)}),f.addCommand(u.showBrowser,{label:n.__("Open the file browser for the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:n.__("The path to open in the file browser")}}}},execute:l=>{const m=l.path||"",w=F.getBrowserForPath(m,h,p);if(w)if(h===w){c.activateById(h.id);return}else{const g=["left","right"];for(const b of g)for(const y of c.widgets(b))if(y.contains(w)){c.activateById(y.id);return}}}}),f.addCommand(u.hideBrowser,{label:n.__("Hide the file browser."),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=e.currentWidget;l&&!l.isHidden&&c.collapseLeft()}}),f.addCommand(u.toggleNavigateToCurrentDirectory,{label:n.__("Show Active File in File Browser"),isToggled:()=>h.navigateToCurrentDirectory,execute:()=>{const l=!h.navigateToCurrentDirectory;return r.set(_,"navigateToCurrentDirectory",l).catch(w=>{console.error("Failed to set navigateToCurrentDirectory setting")})},describedBy:{args:{type:"object",properties:{}}}}),d&&d.addItem({command:u.toggleNavigateToCurrentDirectory,category:n.__("File Operations")}),c.restored.then(l=>{l.fresh&&c.mode!=="single-document"&&f.execute(u.showBrowser,void 0)}),Promise.all([o.restored,h.model.restored]).then(()=>{c.currentChanged.connect(async(l,m)=>{if(h.navigateToCurrentDirectory&&m.newValue){const{newValue:w}=m,g=a.contextForWidget(w);if(g){const{path:b}=g;try{await F.navigateToPath(b,h,p,t)}catch(y){console.warn(`${u.goToPath} failed to open: ${b}`,y)}}}})})}},De={id:"@jupyterlab/filebrowser-extension:share-file",description:'Adds the "Copy Shareable Link" command; useful for JupyterHub deployment for example.',requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.copyShareableLink,{execute:()=>{const t=s.currentWidget,c=t?.selectedItems().next();c===void 0||c.done||N.copyToSystem(v.PageConfig.getUrl({workspace:v.PageConfig.defaultWorkspace,treePath:c.value.path,toShare:!0}))},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:ie.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Shareable Link"),describedBy:{args:{type:"object",properties:{}}}})}},Ge={id:"@jupyterlab/filebrowser-extension:open-with",description:"Adds the open-with feature allowing an user to pick the non-preferred document viewer.",requires:[C],autoStart:!0,activate:(o,a)=>{const{docRegistry:h}=o,{tracker:p}=a;let r=[];function s(t){var c,i;const d=(i=(c=t.menu.items.find(e=>{var n;return e.type==="submenu"&&((n=e.submenu)===null||n===void 0?void 0:n.id)==="jp-contextmenu-open-with"}))===null||c===void 0?void 0:c.submenu)!==null&&i!==void 0?i:null;if(!d)return;r.forEach(e=>e.dispose()),r.length=0,d.clearItems(),r=[...p.currentWidget?F.OpenWith.intersection(L(p.currentWidget.selectedItems(),e=>F.OpenWith.getFactories(h,e))):new Set].map(e=>d.addItem({args:{factory:e.name,label:e.label||e.name},command:u.open}))}o.contextMenu.opened.connect(s)}},Je={id:"@jupyterlab/filebrowser-extension:open-browser-tab",description:"Adds the open-in-new-browser-tab features.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const{commands:p}=o,r=h.load("jupyterlab"),{tracker:s}=a;p.addCommand(u.openBrowserTab,{execute:t=>{const c=s.currentWidget;if(!c)return;const i=t.mode;return Promise.all(Array.from(L(c.selectedItems(),d=>{if(i==="single-document"){const f=v.PageConfig.getUrl({mode:"single-document",treePath:d.path}),e=window.open();if(e)e.opener=null,e.location.href=f;else throw new Error("Failed to open new browser tab.")}else return p.execute("docmanager:open-browser-tab",{path:d.path})})))},icon:le.bindprops({stylesheet:"menuItem"}),label:t=>t.mode==="single-document"?r.__("Open in Simple Mode"):r.__("Open in New Browser Tab"),mnemonic:0,describedBy:{args:{type:"object",properties:{mode:{type:"string",description:r.__("Mode for opening files (e.g., single-document)")}}}}})}},Ke={id:"@jupyterlab/filebrowser-extension:file-upload-status",description:"Adds a file upload status widget.",autoStart:!0,requires:[C,x],optional:[Be],activate:(o,a,h,p)=>{if(!p)return;const r=new S({tracker:a.tracker,translator:h});p.registerStatusItem("@jupyterlab/filebrowser-extension:file-upload-status",{item:r,align:"middle",isActive:()=>!!r.model&&r.model.items.length>0,activeStateChanged:r.model.stateChanged})}},Ye={id:"@jupyterlab/filebrowser-extension:open-url",description:'Adds the feature "Open files from remote URLs".',autoStart:!0,requires:[P,x],optional:[U],activate:(o,a,h,p)=>{const{commands:r}=o,s=h.load("jupyterlab"),t=u.openUrl;r.addCommand(t,{label:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL…"),caption:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL"),execute:async c=>{var i,d,f;let e=(i=c?.url)!==null&&i!==void 0?i:"";if(e||(e=(d=(await q.getText({label:s.__("URL"),placeholder:"https://example.com/path/to/file",title:s.__("Open URL"),okLabel:s.__("Open")})).value)!==null&&d!==void 0?d:void 0),!e)return;let n="",l;try{const m=await fetch(e);l=await m.blob(),n=(f=m.headers.get("Content-Type"))!==null&&f!==void 0?f:""}catch(m){return m.response&&m.response.status!==200&&(m.message=s.__("Could not open URL: %1",e)),B(s.__("Cannot fetch"),m)}try{const m=v.PathExt.basename(e),w=new File([l],m,{type:n}),g=await a.model.upload(w);return r.execute("docmanager:open",{path:g.path})}catch(m){return B(s._p("showErrorMessage","Upload Error"),m)}},describedBy:{args:{type:"object",properties:{url:{type:"string",description:s.__("URL of the file to open")}}}}}),p&&p.addItem({command:t,category:s.__("File Operations")})}},Qe={id:"@jupyterlab/filebrowser-extension:notify-upload",requires:[P,M,x],description:"Adds feature to auto-open supported files after upload",autoStart:!0,activate:async(o,a,h,p)=>{const r=p.load("jupyterlab"),s=await h.load(_);let t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024;s.changed.connect(()=>{t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024}),o.restored.then(()=>{const d=Array.from(a.toolbar.children()).find(f=>f instanceof K);if(!d){console.warn("Uploader widget not found");return}d.filesUploaded.connect((f,e)=>{const l=Array.from(o.docRegistry.fileTypes()).reduce((g,b)=>{if(b.extensions)for(const y of b.extensions)g.push(y.toLowerCase());return g},[]),m=e[0].name.toLowerCase(),w=l.some(g=>m.endsWith(g));if(e.length===1&&(e[0].type==="notebook"||e[0].type==="file")){const g=e[0];t&&g.size&&g.size<=c&&w?o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Opening ${g.name} failed`,b)}):E.emit(r.__("Uploaded %1%2",g.name,g.size?` (${Ie(g.size,1,1024)})`:""),"info",{autoClose:5e3,actions:[{label:r.__("Open File"),callback:()=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.name}`,b)})}}]})}else E.emit(r.__("Upload complete (%1 files)",e.length),"info",{autoClose:5e3,actions:[{label:r.__("Open All"),callback:()=>{e.forEach(g=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.path}`,b)})})}}]})})})}};function Ze(o,a,h,p,r,s){const t=p.load("jupyterlab"),{docRegistry:c,commands:i}=o,{tracker:d}=h,f=v.PageConfig.getOption("delete_to_trash")==="true";i.addCommand(u.del,{execute:()=>{const e=d.currentWidget;if(e)return e.delete()},icon:ce.bindprops({stylesheet:"menuItem"}),label:f?t.__("Move to Trash"):t.__("Delete"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copy,{execute:()=>{const e=d.currentWidget;if(e)return e.copy()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Copy"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.cut,{execute:()=>{const e=d.currentWidget;if(e)return e.cut()},icon:pe.bindprops({stylesheet:"menuItem"}),label:t.__("Cut"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.duplicate,{execute:()=>{const e=d.currentWidget;if(e)return e.duplicate()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Duplicate"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.selectAll,{execute:()=>{const e=d.currentWidget;if(e)return e.selectAll()},label:t.__("Select All"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.goToPath,{label:t.__("Update the file browser to display the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("The path to navigate to")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the browser")}}}},execute:async e=>{var n;const l=e.path||"",m=!((n=e?.dontShowBrowser)!==null&&n!==void 0&&n);try{if((await F.navigateToPath(l,a,h,p)).type!=="directory"&&m){const g=F.getBrowserForPath(l,a,h);if(g){g.clearSelectedItems();const b=l.split("/"),y=b[b.length-1];y&&await g.selectItemByName(y)}}}catch(w){console.warn(`${u.goToPath} failed to go to: ${l}`,w)}if(m)return i.execute(u.showBrowser,{path:l})}}),i.addCommand(u.goUp,{label:t.__("Go Up"),execute:async()=>{const e=F.getBrowserForPath("",a,h);if(!e)return;const{model:n}=e;await n.restored,e.goUp()},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.openPath,{label:e=>e.path?t.__("Open %1",e.path):t.__("Open from Path…"),caption:e=>e.path?t.__("Open %1",e.path):t.__("Open from path"),execute:async e=>{var n;let l;if(e?.path?l=e.path:l=(n=(await q.getText({label:t.__("Path"),placeholder:"/path/relative/to/jlab/root",title:t.__("Open Path"),okLabel:t.__("Open")})).value)!==null&&n!==void 0?n:void 0,!!l)try{const m=l!=="/"&&l.endsWith("/");m&&(l=l.slice(0,l.length-1));const w=F.getBrowserForPath(l,a,h),{services:g}=w.model.manager,b=await g.contents.get(l,{content:!1});if(m&&b.type!=="directory")throw new Error(`Path ${l}/ is not a directory`);return await i.execute(u.goToPath,{path:l,dontShowBrowser:e.dontShowBrowser}),b.type==="directory"?void 0:i.execute("docmanager:open",{path:l})}catch(m){return m.response&&m.response.status===404&&(m.message=t.__("Could not find path: %1",l)),B(t.__("Cannot open"),m)}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("Path to the file or directory to open")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the file browser")}}}}}),s&&s.addItem({command:u.openPath,category:t.__("File Operations")}),i.addCommand(u.open,{execute:e=>{const n=e.factory||void 0,l=d.currentWidget;if(!l)return;const{contents:m}=l.model.manager.services;return Promise.all(Array.from(L(l.selectedItems(),w=>{if(w.type==="directory"){const g=m.localPath(w.path);return l.model.cd(`/${g}`)}return i.execute("docmanager:open",{factory:n,path:w.path,kernelPreference:e.kernelPreference})})))},icon:e=>{var n;const l=e.factory||void 0;if(l){const m=c.getFileType(l);return(n=m?.icon)===null||n===void 0?void 0:n.bindprops({stylesheet:"menuItem"})}else return H.bindprops({stylesheet:"menuItem"})},label:e=>e.label||e.factory||t.__("Open"),mnemonic:0,describedBy:{args:{type:"object",properties:{factory:{type:"string",description:t.__("The name of the widget factory to use")},label:{type:"string",description:t.__("The label to display for the command")}}}}}),i.addCommand(u.paste,{execute:()=>{const e=d.currentWidget;if(e)return e.paste()},icon:ue.bindprops({stylesheet:"menuItem"}),label:t.__("Paste"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewDirectory,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewDirectory()},icon:he.bindprops({stylesheet:"menuItem"}),label:t.__("New Folder"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewFile,{execute:e=>{var n;const l=d.currentWidget;if(l)return l.createNewFile({ext:(n=e.ext)!==null&&n!==void 0?n:"txt"})},icon:e=>e.iconName?me.resolve({icon:e.iconName}):fe.bindprops({stylesheet:"menuItem"}),label:e=>e.label===void 0||e.label===null?t.__("New File"):t.__(e.label),describedBy:{args:{type:"object",properties:{label:{type:"string",default:"New File",description:t.__("The command label.")},iconName:{type:"string",description:t.__("The command icon.")},ext:{type:"string",default:"txt",description:t.__("The file extension.")}}}}}),i.addCommand(u.createNewMarkdownFile,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewFile({ext:"md"})},icon:ge.bindprops({stylesheet:"menuItem"}),label:t.__("New Markdown File"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.refresh,{execute:async()=>{const e=d.currentWidget;if(e){e.node.classList.add("jp-mod-refreshing");try{await e.model.refresh()}finally{e.node.classList.remove("jp-mod-refreshing")}}},icon:we.bindprops({stylesheet:"menuItem"}),caption:t.__("Refresh the file browser."),label:t.__("Refresh File List"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.rename,{execute:e=>{const n=d.currentWidget;if(n)return n.rename()},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:be.bindprops({stylesheet:"menuItem"}),label:t.__("Rename"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copyPath,{execute:()=>{var e;const n=d.currentWidget;if(!n)return;const l=n.selectedItems().next();if(!l.done)if(v.PageConfig.getOption("copyAbsolutePath")==="true"){const m=v.PathExt.joinWithLeadingSlash((e=v.PageConfig.getOption("serverRoot"))!==null&&e!==void 0?e:"",l.value.path);N.copyToSystem(m)}else N.copyToSystem(l.value.path)},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:ye.bindprops({stylesheet:"menuItem"}),label:t.__("Copy Path"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.shutdown,{execute:()=>{const e=d.currentWidget;if(e)return e.shutdownKernels()},icon:_e.bindprops({stylesheet:"menuItem"}),label:t.__("Shut Down Kernel"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileFilter,{execute:()=>{a.showFileFilter=!a.showFileFilter,i.notifyCommandChanged(u.toggleFileFilter)},isToggled:()=>a.showFileFilter,icon:ve.bindprops({stylesheet:"menuItem"}),label:t.__("Toggle File Filter"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleLastModified,{label:t.__("Show Last Modified Column"),isToggled:()=>a.showLastModifiedColumn,execute:()=>{const e=!a.showLastModifiedColumn,n="showLastModifiedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleShowFullPath,{label:t.__("Show Full Path"),isToggled:()=>a.showFullPath,execute:()=>{const e=!a.showFullPath,n="showFullPath";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSortNotebooksFirst,{label:t.__("Sort Notebooks Above Files"),isToggled:()=>a.sortNotebooksFirst,execute:()=>{const e=!a.sortNotebooksFirst,n="sortNotebooksFirst";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleDateCreated,{label:t.__("Show Date Created Column"),isToggled:()=>a.showDateCreatedColumn,execute:()=>{const e=!a.showDateCreatedColumn,n="showDateCreatedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileSize,{label:t.__("Show File Size Column"),isToggled:()=>a.showFileSizeColumn,execute:()=>{const e=!a.showFileSizeColumn,n="showFileSizeColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSingleClick,{label:t.__("Enable Single Click Navigation"),isToggled:()=>a.singleClickNavigation,execute:()=>{const e=!a.singleClickNavigation,n="singleClickNavigation";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set singleClickNavigation setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleHiddenFiles,{label:t.__("Show Hidden Files"),isToggled:()=>a.showHiddenFiles,isVisible:()=>v.PageConfig.getOption("allow_hidden_files")==="true",execute:()=>{const e=!a.showHiddenFiles,n="showHiddenFiles";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showHiddenFiles setting")})},describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.toggleHiddenFiles,category:t.__("File Operations")}),i.addCommand(u.toggleFileCheckboxes,{label:t.__("Show File Checkboxes"),isToggled:()=>a.showFileCheckboxes,execute:()=>{const e=!a.showFileCheckboxes,n="showFileCheckboxes";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showFileCheckboxes setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.editPath,{execute:async()=>{var e;if(typeof a.editPath!="function"){console.error("`editPath` is not available on the current file browser");return}await i.execute(u.showBrowser),((e=d.currentWidget)!==null&&e!==void 0?e:a).editPath()},label:t.__("Edit File Browser Path"),isVisible:()=>typeof a.editPath=="function",describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.editPath,category:t.__("File Operations")})}const to=[Ve,He,ze,$e,De,Ke,Re,Q,Ge,Je,Ye,Qe,qe];var F;(function(o){function a(r,s,t){const{tracker:c}=t,i=s.model.manager.services.contents.driveName(r);if(i){const d=c.find(f=>f.model.driveName===i);if(!d){console.warn(`${u.goToPath} failed to find filebrowser for path: ${r}`);return}return d}return s}o.getBrowserForPath=a;async function h(r,s,t,c){const i=c.load("jupyterlab"),d=o.getBrowserForPath(r,s,t);if(!d)throw new Error(i.__("No browser for path"));const{services:f}=d.model.manager,e=f.contents.localPath(r);await f.ready;const n=await f.contents.get(r,{content:!1}),{model:l}=d;return await l.restored,n.type==="directory"?await l.cd(`/${e}`):await l.cd(`/${v.PathExt.dirname(e)}`),n}o.navigateToPath=h;async function p(r,s,t,c,i,d){const f="jp-mod-restoring";if(r.addClass(f),!t){await r.model.restore(r.id),await r.model.refresh(),r.removeClass(f);return}const e=async()=>{t.routed.disconnect(e);const n=await c?.paths;n?.file||n?.browser?(await r.model.restore(r.id,!1),n.file&&await s.execute(u.openPath,{path:n.file,dontShowBrowser:!0}),n.browser&&await s.execute(u.openPath,{path:n.browser,dontShowBrowser:!0})):(await r.model.restore(r.id),await r.model.refresh()),r.removeClass(f),d?.isEmpty("main")&&s.execute("launcher:create")};t.routed.connect(e)}o.restoreBrowser=p,(function(r){function s(c,i){const d=c.preferredWidgetFactories(i.path),f=c.getWidgetFactory("notebook");return f&&i.type==="notebook"&&d.indexOf(f)===-1&&d.unshift(f),d}r.getFactories=s;function t(c){let i;for(const d of c){if(i===void 0){i=new Set(d);continue}if(i.size===0)return i;let f=new Set;for(const e of d)i.has(e)&&f.add(e);i=f}return i??new Set}r.intersection=t})(o.OpenWith||(o.OpenWith={}))})(F||(F={}));export{to as default,Ke as fileUploadStatus};
|
|
1
|
+
import{r as j,dC as Z,dD as X,cn as B,aa as ee,aE as T,cj as te,J as k,cf as oe,aA as I,dx as V,aD as x,dE as re,dF as H,ce as v,dG as ie,dH as N,dI as ne,dJ as O,dw as ae,aH as se,cp as le,cm as L,dK as E,dL as de,dM as ce,dN as pe,dO as ue,dP as he,ck as me,dQ as fe,dR as ge,dS as we,dT as be,dU as ye,dV as _e,dW as ve,dy as A}from"../datalayer-app-main.js";import{T as R,G as Fe,e as xe,b as U,I as Ce,f as q}from"./index-i9IsP_xD.js";import{I as Be}from"./tokens-C5FWZLTC.js";import{h as ke,e as Pe,J as Se,c as D,f as Te,k as Ie,F as je,l as Ne}from"./index-z8PItpd8.js";import{I as G}from"./tokens-BoOsoUsu.js";import{a as C,b as We,I as P,c as J}from"./tokens-DuSIK5iU.js";import{I as M}from"./tokens-1h_N3aLM.js";import{I as Me}from"./treepathupdater-CMx8sTW-.js";import{g as Oe}from"./kernelfilestypes-D2B-sFfi.js";import"./hoverbox-CStlKQWE.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";function Le(o){const{width:a,percentage:h,...p}=o;return j.createElement("div",{className:"jp-Statusbar-ProgressBar-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h},j.createElement(Ue,{percentage:h,...p,contentWidth:a}))}function Ue(o){return j.createElement("div",{style:{width:`${o.percentage}%`}},j.createElement("p",null,o.content))}class K extends Z{constructor(a){super({icon:X,label:a.label,onClick:()=>{this._input.click()},tooltip:W.translateToolTip(a.translator),enabled:a.model.allowFileUploads}),this._onInputChanged=()=>{const p=Array.prototype.slice.call(this._input.files).map(r=>this.fileBrowserModel.upload(r));Promise.all(p).then(r=>{this._filesUploaded.emit(r)}).catch(r=>{B(this._trans._p("showErrorMessage","Upload Error"),r)})},this._onInputClicked=()=>{this._input.value=""},this._input=W.createUploadInput(),this._filesUploaded=new ee(this),this.fileBrowserModel=a.model,this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._input.onclick=this._onInputClicked,this._input.onchange=this._onInputChanged,this.addClass("jp-id-upload")}get filesUploaded(){return this._filesUploaded}}var W;(function(o){function a(){const p=document.createElement("input");return p.type="file",p.multiple=!0,p}o.createUploadInput=a;function h(p){return p=p||T,p.load("jupyterlab").__("Upload Files")}o.translateToolTip=h})(W||(W={}));const Ee=4;function z(o){const h=(o.translator||T).load("jupyterlab");return k.createElement(Fe,{spacing:Ee},k.createElement(R,{source:h.__("Uploading…")}),k.createElement(Le,{percentage:o.upload}))}const Ae=2e3;class S extends te{constructor(a){super(new S.Model(a.tracker.currentWidget&&a.tracker.currentWidget.model)),this._onBrowserChange=(h,p)=>{p===null?this.model.browserModel=null:this.model.browserModel=p.model},this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._tracker=a.tracker,this._tracker.currentChanged.connect(this._onBrowserChange)}render(){return this.model.items.length>0?this.model.items[0].complete?k.createElement(R,{source:this._trans.__("Complete!")}):k.createElement(z,{upload:this.model.items[0].progress,translator:this.translator}):k.createElement(z,{upload:100,translator:this.translator})}dispose(){super.dispose(),this._tracker.currentChanged.disconnect(this._onBrowserChange)}}(function(o){class a extends oe{constructor(p){super(),this._uploadChanged=(r,s)=>{if(s.name==="start")this._items.push({path:s.newValue.path,progress:s.newValue.progress*100,complete:!1});else if(s.name==="update"){const t=I.findFirstIndex(this._items,c=>c.path===s.oldValue.path);t!==-1&&(this._items[t].progress=s.newValue.progress*100)}else if(s.name==="finish"){const t=I.findFirstValue(this._items,c=>c.path===s.oldValue.path);t&&(t.complete=!0,setTimeout(()=>{I.removeFirstOf(this._items,t),this.stateChanged.emit(void 0)},Ae))}else if(s.name==="failure")I.removeFirstWhere(this._items,t=>t.path===s.newValue.path);else return;this.stateChanged.emit(void 0)},this._items=[],this._browserModel=null,this.browserModel=p}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(p){const r=this._browserModel;r&&r.uploadChanged.disconnect(this._uploadChanged),this._browserModel=p,this._items=[],this._browserModel!==null&&this._browserModel.uploadChanged.connect(this._uploadChanged),this.stateChanged.emit(void 0)}}o.Model=a})(S||(S={}));const $="FileBrowser",_="@jupyterlab/filebrowser-extension:browser";var u;(function(o){o.copy="filebrowser:copy",o.copyDownloadLink="filebrowser:copy-download-link",o.cut="filebrowser:cut",o.del="filebrowser:delete",o.download="filebrowser:download",o.duplicate="filebrowser:duplicate",o.selectAll="filebrowser:select-all",o.hideBrowser="filebrowser:hide-main",o.goToPath="filebrowser:go-to-path",o.goUp="filebrowser:go-up",o.openPath="filebrowser:open-path",o.openUrl="filebrowser:open-url",o.open="filebrowser:open",o.openBrowserTab="filebrowser:open-browser-tab",o.paste="filebrowser:paste",o.createNewDirectory="filebrowser:create-new-directory",o.createNewFile="filebrowser:create-new-file",o.createNewMarkdownFile="filebrowser:create-new-markdown-file",o.refresh="filebrowser:refresh",o.rename="filebrowser:rename",o.copyShareableLink="filebrowser:share-main",o.copyPath="filebrowser:copy-path",o.showBrowser="filebrowser:activate",o.shutdown="filebrowser:shutdown",o.toggleBrowser="filebrowser:toggle-main",o.toggleFileFilter="filebrowser:toggle-file-filter",o.toggleNavigateToCurrentDirectory="filebrowser:toggle-navigate-to-current-directory",o.toggleLastModified="filebrowser:toggle-last-modified",o.toggleShowFullPath="filebrowser:toggle-show-full-path",o.toggleDateCreated="filebrowser:toggle-date-created",o.toggleFileSize="filebrowser:toggle-file-size",o.toggleSortNotebooksFirst="filebrowser:toggle-sort-notebooks-first",o.toggleHiddenFiles="filebrowser:toggle-hidden-files",o.toggleSingleClick="filebrowser:toggle-single-click-navigation",o.toggleFileCheckboxes="filebrowser:toggle-file-checkboxes",o.editPath="filebrowser:edit-path"})(u||(u={}));const Y="filebrowser",ze={id:_,description:"Set up the default file browser commands and state restoration",requires:[P,C,x],optional:[Te,M,Me,U],provides:J,autoStart:!0,activate:async(o,a,h,p,r,s,t,c)=>{const i=a;r&&r.add(i,Y);const d=v.PageConfig.getOption("preferredPath");return d&&await i.model.cd(d),Ze(o,i,h,p,s,c),Promise.all([o.restored,i.model.restored]).then(()=>{t&&i.model.pathChanged.connect((f,e)=>{t(e.newValue)})}),{openPath:u.openPath}}},$e={id:"@jupyterlab/filebrowser-extension:settings",description:"Set up the default file browser settings",requires:[P],optional:[M],autoStart:!0,activate:(o,a,h)=>{h&&h.load(_).then(p=>{const r={navigateToCurrentDirectory:!1,singleClickNavigation:!1,showLastModifiedColumn:!0,showDateCreatedColumn:!1,showFileSizeColumn:!1,showHiddenFiles:!1,showFileCheckboxes:!1,sortNotebooksFirst:!1,sortFileNamesNaturally:!0,showFullPath:!1,allowFileUploads:!0};a.showFileFilter=p.get("showFileFilter").composite;function s(t){let c;for(c in r){const e=t.get(c).composite;a[c]=e}const i=t.get("breadcrumbs").composite;a.minimumBreadcrumbsLeftItems=i.minimumLeftItems,a.minimumBreadcrumbsRightItems=i.minimumRightItems;const d=t.get("filterDirectories").composite,f=t.get("useFuzzyFilter").composite;a.model.filterDirectories=d,a.model.useFuzzyFilter=f,a.clearFilterOnNavigation=t.get("clearFilterOnNavigation").composite}p.changed.connect(s),s(p)})}},Ve={id:"@jupyterlab/filebrowser-extension:factory",description:"Provides the file browser factory.",provides:C,requires:[G,x],optional:[V.IStateDB,ke.IInfo],activate:async(o,a,h,p,r)=>{const s=new re({namespace:Y});return{createFileBrowser:(c,i={})=>{var d,f;const e=i.state===null?void 0:i.state||p||void 0,n=new je({translator:h,auto:(d=i.auto)!==null&&d!==void 0?d:!0,manager:a,driveName:i.driveName||"",refreshInterval:i.refreshInterval,refreshStandby:()=>r&&!r.isConnected||"when-hidden",state:e,allowFileUploads:(f=i.allowFileUploads)!==null&&f!==void 0?f:!0}),l=i.restore,m=new Ne({id:c,model:n,restore:l,translator:h,state:e,renderer:i.renderer});return s.add(m),m},tracker:s}}},He={id:"@jupyterlab/filebrowser-extension:default-file-browser",description:"Provides the default file browser",provides:P,requires:[C],optional:[Pe,Se.ITreeResolver,D,x,We,xe,V.IStateDB],activate:async(o,a,h,p,r,s,t,c,i)=>{const{commands:d}=o,f=(s??T).load("jupyterlab"),e=a.createFileBrowser("filebrowser",{auto:!1,restore:!1,renderer:t??void 0});e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",f.__("File Browser Section")),e.title.icon=H,e.title.dataset={...e.title.dataset,jpTabLabel:f.__("File Browser")};const n=()=>{const l=o.commands.keyBindings.find(m=>m.command===u.toggleBrowser);if(l){const m=l.keys.map(de.formatKeystroke).join(", ");e.title.caption=f.__("File Browser (%1)",m)}else e.title.caption=f.__("File Browser")};if(n(),o.commands.keyBindingChanged.connect(()=>{n()}),c&&c.registerTarget("@jupyterlab/filebrowser-extension:default-file-browser",f.__("File Browser"),e),i){const l="filebrowser:section-sizes";let m=null;const w=()=>{const g=e.accordionPanel;if(!g||m===g)return;m=g;const b=async()=>{await i.save(l,g.relativeSizes())};g.handleMoved.connect(b),i.fetch(l).then(y=>{Array.isArray(y)&&g.setRelativeSizes(y)})};e.sectionChanged.connect(()=>{w(),m&&i.save(l,m.relativeSizes())})}return F.restoreBrowser(e,d,h,p,o,r),e}},Re={id:"@jupyterlab/filebrowser-extension:download",description:"Adds the download file commands. Disabling this plugin will NOT disable downloading files from the server, if the user enters the appropriate download URLs.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.download,{execute:()=>{const t=s.currentWidget;if(t)return t.download()},icon:ne.bindprops({stylesheet:"menuItem"}),label:p.__("Download"),describedBy:{args:{type:"object",properties:{}}}}),r.addCommand(u.copyDownloadLink,{execute:()=>{const t=s.currentWidget;if(t)return t.model.manager.services.contents.getDownloadUrl(t.selectedItems().next().value.path).then(c=>{N.copyToSystem(c)})},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:O.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Download Link"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}})}},qe={id:"@jupyterlab/filebrowser-extension:create-new-language-file",description:"Adds context menu entries for creating Python/R/Julia files",requires:[x],autoStart:!0,activate:async(o,a)=>{const h=a.load("jupyterlab");let p=new A;const r=o.serviceManager.kernelspecs,s=async()=>{var t,c;const i=await Oe(r);p.dispose(),p=new A;for(const d of i)p.add(o.contextMenu.addItem({command:u.createNewFile,selector:".jp-DirListing-content",args:{ext:d.extensions[0],label:h.__("New %1 File",d.displayName),iconName:(c=(t=d.icon)===null||t===void 0?void 0:t.toString())!==null&&c!==void 0?c:""},rank:52}))};r.specsChanged.connect(s),s().catch(console.warn)}},Q={id:"@jupyterlab/filebrowser-extension:widget",description:"Adds the file browser to the application shell.",requires:[G,P,C,M,Ce,x,D,J],optional:[U],autoStart:!0,activate:(o,a,h,p,r,s,t,c,i,d)=>{const{commands:f}=o,{tracker:e}=p,n=t.load("jupyterlab");s.addFactory($,"uploader",l=>new K({model:l.model,translator:t})),ae(h,se(s,r,$,Q.id,t)),c.add(h,"left",{rank:100,type:"File Browser"}),f.addCommand(u.toggleBrowser,{label:n.__("File Browser"),describedBy:{args:{type:"object",properties:{}}},execute:()=>h.isHidden?f.execute(u.showBrowser,void 0):f.execute(u.hideBrowser,void 0)}),f.addCommand(u.showBrowser,{label:n.__("Open the file browser for the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:n.__("The path to open in the file browser")}}}},execute:l=>{const m=l.path||"",w=F.getBrowserForPath(m,h,p);if(w)if(h===w){c.activateById(h.id);return}else{const g=["left","right"];for(const b of g)for(const y of c.widgets(b))if(y.contains(w)){c.activateById(y.id);return}}}}),f.addCommand(u.hideBrowser,{label:n.__("Hide the file browser."),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=e.currentWidget;l&&!l.isHidden&&c.collapseLeft()}}),f.addCommand(u.toggleNavigateToCurrentDirectory,{label:n.__("Show Active File in File Browser"),isToggled:()=>h.navigateToCurrentDirectory,execute:()=>{const l=!h.navigateToCurrentDirectory;return r.set(_,"navigateToCurrentDirectory",l).catch(w=>{console.error("Failed to set navigateToCurrentDirectory setting")})},describedBy:{args:{type:"object",properties:{}}}}),d&&d.addItem({command:u.toggleNavigateToCurrentDirectory,category:n.__("File Operations")}),c.restored.then(l=>{l.fresh&&c.mode!=="single-document"&&f.execute(u.showBrowser,void 0)}),Promise.all([o.restored,h.model.restored]).then(()=>{c.currentChanged.connect(async(l,m)=>{if(h.navigateToCurrentDirectory&&m.newValue){const{newValue:w}=m,g=a.contextForWidget(w);if(g){const{path:b}=g;try{await F.navigateToPath(b,h,p,t)}catch(y){console.warn(`${u.goToPath} failed to open: ${b}`,y)}}}})})}},De={id:"@jupyterlab/filebrowser-extension:share-file",description:'Adds the "Copy Shareable Link" command; useful for JupyterHub deployment for example.',requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.copyShareableLink,{execute:()=>{const t=s.currentWidget,c=t?.selectedItems().next();c===void 0||c.done||N.copyToSystem(v.PageConfig.getUrl({workspace:v.PageConfig.defaultWorkspace,treePath:c.value.path,toShare:!0}))},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:ie.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Shareable Link"),describedBy:{args:{type:"object",properties:{}}}})}},Ge={id:"@jupyterlab/filebrowser-extension:open-with",description:"Adds the open-with feature allowing an user to pick the non-preferred document viewer.",requires:[C],autoStart:!0,activate:(o,a)=>{const{docRegistry:h}=o,{tracker:p}=a;let r=[];function s(t){var c,i;const d=(i=(c=t.menu.items.find(e=>{var n;return e.type==="submenu"&&((n=e.submenu)===null||n===void 0?void 0:n.id)==="jp-contextmenu-open-with"}))===null||c===void 0?void 0:c.submenu)!==null&&i!==void 0?i:null;if(!d)return;r.forEach(e=>e.dispose()),r.length=0,d.clearItems(),r=[...p.currentWidget?F.OpenWith.intersection(L(p.currentWidget.selectedItems(),e=>F.OpenWith.getFactories(h,e))):new Set].map(e=>d.addItem({args:{factory:e.name,label:e.label||e.name},command:u.open}))}o.contextMenu.opened.connect(s)}},Je={id:"@jupyterlab/filebrowser-extension:open-browser-tab",description:"Adds the open-in-new-browser-tab features.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const{commands:p}=o,r=h.load("jupyterlab"),{tracker:s}=a;p.addCommand(u.openBrowserTab,{execute:t=>{const c=s.currentWidget;if(!c)return;const i=t.mode;return Promise.all(Array.from(L(c.selectedItems(),d=>{if(i==="single-document"){const f=v.PageConfig.getUrl({mode:"single-document",treePath:d.path}),e=window.open();if(e)e.opener=null,e.location.href=f;else throw new Error("Failed to open new browser tab.")}else return p.execute("docmanager:open-browser-tab",{path:d.path})})))},icon:le.bindprops({stylesheet:"menuItem"}),label:t=>t.mode==="single-document"?r.__("Open in Simple Mode"):r.__("Open in New Browser Tab"),mnemonic:0,describedBy:{args:{type:"object",properties:{mode:{type:"string",description:r.__("Mode for opening files (e.g., single-document)")}}}}})}},Ke={id:"@jupyterlab/filebrowser-extension:file-upload-status",description:"Adds a file upload status widget.",autoStart:!0,requires:[C,x],optional:[Be],activate:(o,a,h,p)=>{if(!p)return;const r=new S({tracker:a.tracker,translator:h});p.registerStatusItem("@jupyterlab/filebrowser-extension:file-upload-status",{item:r,align:"middle",isActive:()=>!!r.model&&r.model.items.length>0,activeStateChanged:r.model.stateChanged})}},Ye={id:"@jupyterlab/filebrowser-extension:open-url",description:'Adds the feature "Open files from remote URLs".',autoStart:!0,requires:[P,x],optional:[U],activate:(o,a,h,p)=>{const{commands:r}=o,s=h.load("jupyterlab"),t=u.openUrl;r.addCommand(t,{label:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL…"),caption:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL"),execute:async c=>{var i,d,f;let e=(i=c?.url)!==null&&i!==void 0?i:"";if(e||(e=(d=(await q.getText({label:s.__("URL"),placeholder:"https://example.com/path/to/file",title:s.__("Open URL"),okLabel:s.__("Open")})).value)!==null&&d!==void 0?d:void 0),!e)return;let n="",l;try{const m=await fetch(e);l=await m.blob(),n=(f=m.headers.get("Content-Type"))!==null&&f!==void 0?f:""}catch(m){return m.response&&m.response.status!==200&&(m.message=s.__("Could not open URL: %1",e)),B(s.__("Cannot fetch"),m)}try{const m=v.PathExt.basename(e),w=new File([l],m,{type:n}),g=await a.model.upload(w);return r.execute("docmanager:open",{path:g.path})}catch(m){return B(s._p("showErrorMessage","Upload Error"),m)}},describedBy:{args:{type:"object",properties:{url:{type:"string",description:s.__("URL of the file to open")}}}}}),p&&p.addItem({command:t,category:s.__("File Operations")})}},Qe={id:"@jupyterlab/filebrowser-extension:notify-upload",requires:[P,M,x],description:"Adds feature to auto-open supported files after upload",autoStart:!0,activate:async(o,a,h,p)=>{const r=p.load("jupyterlab"),s=await h.load(_);let t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024;s.changed.connect(()=>{t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024}),o.restored.then(()=>{const d=Array.from(a.toolbar.children()).find(f=>f instanceof K);if(!d){console.warn("Uploader widget not found");return}d.filesUploaded.connect((f,e)=>{const l=Array.from(o.docRegistry.fileTypes()).reduce((g,b)=>{if(b.extensions)for(const y of b.extensions)g.push(y.toLowerCase());return g},[]),m=e[0].name.toLowerCase(),w=l.some(g=>m.endsWith(g));if(e.length===1&&(e[0].type==="notebook"||e[0].type==="file")){const g=e[0];t&&g.size&&g.size<=c&&w?o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Opening ${g.name} failed`,b)}):E.emit(r.__("Uploaded %1%2",g.name,g.size?` (${Ie(g.size,1,1024)})`:""),"info",{autoClose:5e3,actions:[{label:r.__("Open File"),callback:()=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.name}`,b)})}}]})}else E.emit(r.__("Upload complete (%1 files)",e.length),"info",{autoClose:5e3,actions:[{label:r.__("Open All"),callback:()=>{e.forEach(g=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.path}`,b)})})}}]})})})}};function Ze(o,a,h,p,r,s){const t=p.load("jupyterlab"),{docRegistry:c,commands:i}=o,{tracker:d}=h,f=v.PageConfig.getOption("delete_to_trash")==="true";i.addCommand(u.del,{execute:()=>{const e=d.currentWidget;if(e)return e.delete()},icon:ce.bindprops({stylesheet:"menuItem"}),label:f?t.__("Move to Trash"):t.__("Delete"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copy,{execute:()=>{const e=d.currentWidget;if(e)return e.copy()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Copy"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.cut,{execute:()=>{const e=d.currentWidget;if(e)return e.cut()},icon:pe.bindprops({stylesheet:"menuItem"}),label:t.__("Cut"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.duplicate,{execute:()=>{const e=d.currentWidget;if(e)return e.duplicate()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Duplicate"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.selectAll,{execute:()=>{const e=d.currentWidget;if(e)return e.selectAll()},label:t.__("Select All"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.goToPath,{label:t.__("Update the file browser to display the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("The path to navigate to")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the browser")}}}},execute:async e=>{var n;const l=e.path||"",m=!((n=e?.dontShowBrowser)!==null&&n!==void 0&&n);try{if((await F.navigateToPath(l,a,h,p)).type!=="directory"&&m){const g=F.getBrowserForPath(l,a,h);if(g){g.clearSelectedItems();const b=l.split("/"),y=b[b.length-1];y&&await g.selectItemByName(y)}}}catch(w){console.warn(`${u.goToPath} failed to go to: ${l}`,w)}if(m)return i.execute(u.showBrowser,{path:l})}}),i.addCommand(u.goUp,{label:t.__("Go Up"),execute:async()=>{const e=F.getBrowserForPath("",a,h);if(!e)return;const{model:n}=e;await n.restored,e.goUp()},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.openPath,{label:e=>e.path?t.__("Open %1",e.path):t.__("Open from Path…"),caption:e=>e.path?t.__("Open %1",e.path):t.__("Open from path"),execute:async e=>{var n;let l;if(e?.path?l=e.path:l=(n=(await q.getText({label:t.__("Path"),placeholder:"/path/relative/to/jlab/root",title:t.__("Open Path"),okLabel:t.__("Open")})).value)!==null&&n!==void 0?n:void 0,!!l)try{const m=l!=="/"&&l.endsWith("/");m&&(l=l.slice(0,l.length-1));const w=F.getBrowserForPath(l,a,h),{services:g}=w.model.manager,b=await g.contents.get(l,{content:!1});if(m&&b.type!=="directory")throw new Error(`Path ${l}/ is not a directory`);return await i.execute(u.goToPath,{path:l,dontShowBrowser:e.dontShowBrowser}),b.type==="directory"?void 0:i.execute("docmanager:open",{path:l})}catch(m){return m.response&&m.response.status===404&&(m.message=t.__("Could not find path: %1",l)),B(t.__("Cannot open"),m)}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("Path to the file or directory to open")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the file browser")}}}}}),s&&s.addItem({command:u.openPath,category:t.__("File Operations")}),i.addCommand(u.open,{execute:e=>{const n=e.factory||void 0,l=d.currentWidget;if(!l)return;const{contents:m}=l.model.manager.services;return Promise.all(Array.from(L(l.selectedItems(),w=>{if(w.type==="directory"){const g=m.localPath(w.path);return l.model.cd(`/${g}`)}return i.execute("docmanager:open",{factory:n,path:w.path,kernelPreference:e.kernelPreference})})))},icon:e=>{var n;const l=e.factory||void 0;if(l){const m=c.getFileType(l);return(n=m?.icon)===null||n===void 0?void 0:n.bindprops({stylesheet:"menuItem"})}else return H.bindprops({stylesheet:"menuItem"})},label:e=>e.label||e.factory||t.__("Open"),mnemonic:0,describedBy:{args:{type:"object",properties:{factory:{type:"string",description:t.__("The name of the widget factory to use")},label:{type:"string",description:t.__("The label to display for the command")}}}}}),i.addCommand(u.paste,{execute:()=>{const e=d.currentWidget;if(e)return e.paste()},icon:ue.bindprops({stylesheet:"menuItem"}),label:t.__("Paste"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewDirectory,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewDirectory()},icon:he.bindprops({stylesheet:"menuItem"}),label:t.__("New Folder"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewFile,{execute:e=>{var n;const l=d.currentWidget;if(l)return l.createNewFile({ext:(n=e.ext)!==null&&n!==void 0?n:"txt"})},icon:e=>e.iconName?me.resolve({icon:e.iconName}):fe.bindprops({stylesheet:"menuItem"}),label:e=>e.label===void 0||e.label===null?t.__("New File"):t.__(e.label),describedBy:{args:{type:"object",properties:{label:{type:"string",default:"New File",description:t.__("The command label.")},iconName:{type:"string",description:t.__("The command icon.")},ext:{type:"string",default:"txt",description:t.__("The file extension.")}}}}}),i.addCommand(u.createNewMarkdownFile,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewFile({ext:"md"})},icon:ge.bindprops({stylesheet:"menuItem"}),label:t.__("New Markdown File"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.refresh,{execute:async()=>{const e=d.currentWidget;if(e){e.node.classList.add("jp-mod-refreshing");try{await e.model.refresh()}finally{e.node.classList.remove("jp-mod-refreshing")}}},icon:we.bindprops({stylesheet:"menuItem"}),caption:t.__("Refresh the file browser."),label:t.__("Refresh File List"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.rename,{execute:e=>{const n=d.currentWidget;if(n)return n.rename()},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:be.bindprops({stylesheet:"menuItem"}),label:t.__("Rename"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copyPath,{execute:()=>{var e;const n=d.currentWidget;if(!n)return;const l=n.selectedItems().next();if(!l.done)if(v.PageConfig.getOption("copyAbsolutePath")==="true"){const m=v.PathExt.joinWithLeadingSlash((e=v.PageConfig.getOption("serverRoot"))!==null&&e!==void 0?e:"",l.value.path);N.copyToSystem(m)}else N.copyToSystem(l.value.path)},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:ye.bindprops({stylesheet:"menuItem"}),label:t.__("Copy Path"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.shutdown,{execute:()=>{const e=d.currentWidget;if(e)return e.shutdownKernels()},icon:_e.bindprops({stylesheet:"menuItem"}),label:t.__("Shut Down Kernel"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileFilter,{execute:()=>{a.showFileFilter=!a.showFileFilter,i.notifyCommandChanged(u.toggleFileFilter)},isToggled:()=>a.showFileFilter,icon:ve.bindprops({stylesheet:"menuItem"}),label:t.__("Toggle File Filter"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleLastModified,{label:t.__("Show Last Modified Column"),isToggled:()=>a.showLastModifiedColumn,execute:()=>{const e=!a.showLastModifiedColumn,n="showLastModifiedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleShowFullPath,{label:t.__("Show Full Path"),isToggled:()=>a.showFullPath,execute:()=>{const e=!a.showFullPath,n="showFullPath";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSortNotebooksFirst,{label:t.__("Sort Notebooks Above Files"),isToggled:()=>a.sortNotebooksFirst,execute:()=>{const e=!a.sortNotebooksFirst,n="sortNotebooksFirst";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleDateCreated,{label:t.__("Show Date Created Column"),isToggled:()=>a.showDateCreatedColumn,execute:()=>{const e=!a.showDateCreatedColumn,n="showDateCreatedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileSize,{label:t.__("Show File Size Column"),isToggled:()=>a.showFileSizeColumn,execute:()=>{const e=!a.showFileSizeColumn,n="showFileSizeColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSingleClick,{label:t.__("Enable Single Click Navigation"),isToggled:()=>a.singleClickNavigation,execute:()=>{const e=!a.singleClickNavigation,n="singleClickNavigation";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set singleClickNavigation setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleHiddenFiles,{label:t.__("Show Hidden Files"),isToggled:()=>a.showHiddenFiles,isVisible:()=>v.PageConfig.getOption("allow_hidden_files")==="true",execute:()=>{const e=!a.showHiddenFiles,n="showHiddenFiles";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showHiddenFiles setting")})},describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.toggleHiddenFiles,category:t.__("File Operations")}),i.addCommand(u.toggleFileCheckboxes,{label:t.__("Show File Checkboxes"),isToggled:()=>a.showFileCheckboxes,execute:()=>{const e=!a.showFileCheckboxes,n="showFileCheckboxes";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showFileCheckboxes setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.editPath,{execute:async()=>{var e;if(typeof a.editPath!="function"){console.error("`editPath` is not available on the current file browser");return}await i.execute(u.showBrowser),((e=d.currentWidget)!==null&&e!==void 0?e:a).editPath()},label:t.__("Edit File Browser Path"),isVisible:()=>typeof a.editPath=="function",describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.editPath,category:t.__("File Operations")})}const to=[Ve,He,ze,$e,De,Ke,Re,Q,Ge,Je,Ye,Qe,qe];var F;(function(o){function a(r,s,t){const{tracker:c}=t,i=s.model.manager.services.contents.driveName(r);if(i){const d=c.find(f=>f.model.driveName===i);if(!d){console.warn(`${u.goToPath} failed to find filebrowser for path: ${r}`);return}return d}return s}o.getBrowserForPath=a;async function h(r,s,t,c){const i=c.load("jupyterlab"),d=o.getBrowserForPath(r,s,t);if(!d)throw new Error(i.__("No browser for path"));const{services:f}=d.model.manager,e=f.contents.localPath(r);await f.ready;const n=await f.contents.get(r,{content:!1}),{model:l}=d;return await l.restored,n.type==="directory"?await l.cd(`/${e}`):await l.cd(`/${v.PathExt.dirname(e)}`),n}o.navigateToPath=h;async function p(r,s,t,c,i,d){const f="jp-mod-restoring";if(r.addClass(f),!t){await r.model.restore(r.id),await r.model.refresh(),r.removeClass(f);return}const e=async()=>{t.routed.disconnect(e);const n=await c?.paths;n?.file||n?.browser?(await r.model.restore(r.id,!1),n.file&&await s.execute(u.openPath,{path:n.file,dontShowBrowser:!0}),n.browser&&await s.execute(u.openPath,{path:n.browser,dontShowBrowser:!0})):(await r.model.restore(r.id),await r.model.refresh()),r.removeClass(f),d?.isEmpty("main")&&s.execute("launcher:create")};t.routed.connect(e)}o.restoreBrowser=p,(function(r){function s(c,i){const d=c.preferredWidgetFactories(i.path),f=c.getWidgetFactory("notebook");return f&&i.type==="notebook"&&d.indexOf(f)===-1&&d.unshift(f),d}r.getFactories=s;function t(c){let i;for(const d of c){if(i===void 0){i=new Set(d);continue}if(i.size===0)return i;let f=new Set;for(const e of d)i.has(e)&&f.add(e);i=f}return i??new Set}r.intersection=t})(o.OpenWith||(o.OpenWith={}))})(F||(F={}));export{to as default,Ke as fileUploadStatus};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{it as Je,iu as Se,iv as Y,cl as de,eJ as Ve,iw as Ge,k as H,aD as R,aE as U,dK as F,ce as x,dE as Ye,dS as Qe,ix as Xe,cr as V,eG as ue,aJ as Ze,aK as me,r as S,eP as ke,aB as Te,cf as et,iy as pe,eg as he,dM as Ce,iz as tt,bh as je,_ as nt,gI as ot,iA as st,az as Ee,iB as at,cs as it,dL as Ie,dx as J,iC as xe,dB as rt,eM as Ne,ax as Pe,e1 as ct,e2 as Le,iD as ge,aF as lt,aG as Q,gH as fe,gA as dt,eL as ut,iE as mt}from"../datalayer-app-main.js";import{I as $,a as Ae}from"./tokens-1h_N3aLM.js";import{i as Me,b as G,L as z,G as pt,T as ht,j as gt,g as Oe,k as ft,K as bt,R as yt,l as Re,m as Fe,n as vt,I as _t,o as wt,c as St,e as We,d as Be,a as kt,p as Tt,W as Ct}from"./index-i9IsP_xD.js";import{f as De,c as jt,J as ne,e as ce}from"./index-
|
|
1
|
+
import{it as Je,iu as Se,iv as Y,cl as de,eJ as Ve,iw as Ge,k as H,aD as R,aE as U,dK as F,ce as x,dE as Ye,dS as Qe,ix as Xe,cr as V,eG as ue,aJ as Ze,aK as me,r as S,eP as ke,aB as Te,cf as et,iy as pe,eg as he,dM as Ce,iz as tt,bh as je,_ as nt,gI as ot,iA as st,az as Ee,iB as at,cs as it,dL as Ie,dx as J,iC as xe,dB as rt,eM as Ne,ax as Pe,e1 as ct,e2 as Le,iD as ge,aF as lt,aG as Q,gH as fe,gA as dt,eL as ut,iE as mt}from"../datalayer-app-main.js";import{I as $,a as Ae}from"./tokens-1h_N3aLM.js";import{i as Me,b as G,L as z,G as pt,T as ht,j as gt,g as Oe,k as ft,K as bt,R as yt,l as Re,m as Fe,n as vt,I as _t,o as wt,c as St,e as We,d as Be,a as kt,p as Tt,W as Ct}from"./index-i9IsP_xD.js";import{f as De,c as jt,J as ne,e as ce}from"./index-z8PItpd8.js";import{I as $e}from"./tokens-DfQxPp01.js";import{s as Et}from"./hover-DpawhsId.js";import{I as le}from"./tokens-C5FWZLTC.js";import"./hoverbox-CStlKQWE.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";const It=Je.bindprops({stylesheet:"commandPaletteHeader",className:"jp-icon-hoverShow-content"});var se;(function(e){class o extends Se.Renderer{renderHeader(n){const c=this.formatHeader(n);return Y.li({className:de("lm-CommandPalette-header","jp-icon-hoverShow")},c,Y.span(It))}renderItemIcon(n){const c=this.createIconClass(n);return n.item.isToggled?Y.div({className:c},Ve,n.item.iconLabel):Y.div({className:c},n.item.icon,n.item.iconLabel)}createIconClass(n){return de(Ge.styleClass({stylesheet:"commandPaletteItem"}),n.item.iconClass,"lm-CommandPalette-itemIcon")}}e.Renderer=o,e.defaultRenderer=new o})(se||(se={}));const be="help:open",xt="/lab/api/news",Nt="/lab/api/update",oe="https://jupyterlab.readthedocs.io/en/stable/privacy_policies.html";async function ye(e,o={},i){const n=i??H.ServerConnection.makeSettings(),c=x.URLExt.join(n.baseUrl,e);let t;try{t=await H.ServerConnection.makeRequest(c,o,n)}catch(g){throw new H.ServerConnection.NetworkError(g)}const s=await t.json();if(!t.ok)throw new H.ServerConnection.ResponseError(t,s.message);return s}const ze={id:"@jupyterlab/apputils-extension:announcements",description:"Add the announcement feature. It will fetch news on the internet and check for application updates.",autoStart:!0,optional:[H.IConfigSectionManager,$,R],activate:(e,o,i,n)=>{var c,t;const s=ze.id.replace(/\W/g,"");Promise.all([e.restored,(c=i?.load("@jupyterlab/apputils-extension:notification"))!==null&&c!==void 0?c:Promise.resolve(null),(t=o?.create({name:s}))!==null&&t!==void 0?t:Promise.resolve(null)]).then(async([g,m,l])=>{const r=(n??U).load("jupyterlab");if(F.manager.changed.connect((y,p)=>{var a;if(p.type!=="removed")return;const{id:h,tags:v}=(a=p.notification.options.data)!==null&&a!==void 0?a:{};if((v??[]).some(_=>["news","update"].includes(_))&&h){const _={};_[h]={seen:!0,dismissed:!0},l?.update(_).catch(k=>{console.error(`Failed to update the announcements config:
|
|
2
2
|
${k}`)})}}),m?.get("fetchNews").composite==="none"){const y=F.emit(r.__("Would you like to get notified about official Jupyter news?"),"default",{autoClose:!1,actions:[{label:r.__("Open privacy policy"),caption:oe,callback:p=>{p.preventDefault(),e.commands.hasCommand(be)?e.commands.execute(be,{text:r.__("Privacy policies"),url:oe}):window.open(oe,"_blank","noreferrer")},displayType:"link"},{label:r.__("Yes"),callback:()=>{F.dismiss(y),l?.update({}).then(()=>f()).catch(p=>{console.error(`Failed to get the news:
|
|
3
3
|
${p}`)}),m?.set("fetchNews","true").catch(p=>{console.error(`Failed to save setting 'fetchNews':
|
|
4
4
|
${p}`)})}},{label:r.__("No"),callback:()=>{F.dismiss(y),m?.set("fetchNews","false").catch(p=>{console.error(`Failed to save setting 'fetchNews':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as V}from"./LexicalToolRegistry-rXaW8uXA.js";import{D as Xl,a as Jl,b as Vl,e as Yl,c as Gl,g as Zl,i as Kl,f as Ql,l as ec,h as tc,j as nc,k as sc,m as oc,n as rc,r as ic,o as ac,p as lc,q as cc,s as uc,t as dc,v as fc,w as pc,x as mc,y as gc,z as hc,u as bc}from"./LexicalToolRegistry-rXaW8uXA.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 Fn,S as Xt,U as Un,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 fs,aF as ps,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Es,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Ts,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 Ue,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Fs,bb as rn,bc as an,bd as ln,be as cn,j as Us,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-lz41mjjY.js";import{bi as xc,bj as Ec,bk as Tc,bl as Cc,bm as vc,bn as wc,bo as Sc,bp as Lc,bq as _c,br as kc,bs as Ac,bt as Nc,bu as $c,bv as Rc,d as Ic,e as Pc,bw as Oc,bx as Mc,B as Dc,by as Bc,A as jc,bz as Fc,bA as Uc,bB as zc,bC as Hc,bD as qc,bE as Wc,bF as Xc,bG as Jc,bH as Vc,bI as Yc,bJ as Gc,bK as Zc,bL as Kc,bM as Qc,bN as eu,bO as tu,bP as nu,f as su,bQ as ou,g as ru,bR as iu,bS as au,bT as lu,bU as cu,bV as uu,q as du,bW as fu,bX as pu,bY as mu,bZ as gu,b_ as hu,b$ as bu,c0 as yu,c1 as xu,c2 as Eu,c3 as Tu,c4 as Cu,c5 as vu,c6 as wu,c7 as Su,c8 as Lu,c9 as _u,ca as ku,cb as Au,cc as Nu,cd as $u,ce as Ru,cf as Iu,cg as Pu,ch as Ou,ci as Mu,cj as Du,I as Bu,ck as ju,cl as Fu,cm as Uu,cn as zu,co as Hu,cp as qu,cq as Wu,cr as Xu,cs as Ju,ct as Vu,cu as Yu,cv as Gu,h as Zu,z as Ku,cw as Qu,cx as ed,cy as td,cz as nd,cA as sd,cB as od,cC as rd,cD as id,cE as ad,cF as ld,cG as cd,J as ud,cH as dd,cI as fd,cJ as pd,cK as md,cL as gd,cM as hd,cN as bd,cO as yd,cP as xd,cQ as Ed,cR as Td,cS as Cd,cT as vd,cU as wd,cV as Sd,cW as Ld,cX as _d,cY as kd,cZ as Ad,c_ as Nd,c$ as $d,d0 as Rd,d1 as Id,d2 as Pd,d3 as Od,d4 as Md,d5 as Dd,d6 as Bd,d7 as jd,d8 as Fd,d9 as Ud,da as zd,db as Hd,dc as qd,dd as Wd,de as Xd,df as Jd,dg as Vd,dh as Yd,di as Gd,dj as Zd,dk as Kd,dl as Qd,dm as ef,dn as tf,dp as nf,dq as sf,dr as of,ds as rf,dt as af,du as lf,dv as cf,dw as uf,dx as df,dy as ff,dz as pf,dA as mf,dB as gf,dC as hf,dD as bf,dE as yf,dF as xf,dG as Ef,dH as Tf,dI as Cf,dJ as vf,dK as wf,dL as Sf,dM as Lf,dN as _f,dO as kf,dP as Af,dQ as Nf,dR as $f,dS as Rf,dT as If,dU as Pf,dV as Of,dW as Mf,dX as Df,dY as Bf,dZ as jf,d_ as Ff,d$ as Uf,e0 as zf,e1 as Hf,e2 as qf,e3 as Wf,e4 as Xf,e5 as Jf,e6 as Vf,e7 as Yf,e8 as Gf,e9 as Zf,ea as Kf,eb as Qf,ec as ep,ed as tp,ee as np,ef as sp,eg as op,eh as rp,ei as ip,ej as ap,ek as lp,el as cp,em as up,en as dp,eo as fp,ep as pp,eq as mp,er as gp,es as hp,et as bp,eu as yp,ev as xp,ew as Ep,ex as Tp,ey as Cp,ez as vp,eA as wp,eB as Sp,eC as Lp,eD as _p,eE as kp,eF as Ap,eG as Np,eH as $p,eI as Rp,eJ as Ip,eK as Pp,eL as Op,eM as Mp,eN as Dp,eO as Bp,eP as jp,eQ as Fp,eR as Up,eS as zp,eT as Hp,eU as qp,eV as Wp,eW as Xp,eX as Jp,r as Vp,eY as Yp,eZ as Gp,e_ as Zp,e$ as Kp,i as Qp,f0 as em,f1 as tm,f2 as nm,f3 as sm,f4 as om,f5 as rm,f6 as im,f7 as am,f8 as lm,f9 as cm,fa as um,fb as dm,fc as fm,fd as pm,fe as mm,ff as gm,fg as hm,fh as bm,fi as ym,fj as xm,fk as Em,fl as Tm,fm as Cm,fn as vm,fo as wm,fp as Sm,fq as Lm,fr as _m,fs as km,ft as Am,fu as Nm,fv as $m}from"./JupyterLexicalExtension-lz41mjjY.js";import{l$ as io,r as m,j as h,aX as ao,aR as lo,B as co,a$ as ee,m0 as F,m1 as ae,m2 as un,m3 as pe,m4 as z,m5 as uo,m6 as fo,m7 as po,m8 as mo,m9 as j,a_ as ce,ma as Ee,mb as ut,mc as go,md as ho,me as bo,mf as yo,mg as dn,mh as xo,mi as Eo,mj as To,mk as Co,ml as vo,mm as wo,aZ as So,ab as M,c6 as ve,mn as Lo,mo as se,mp as X,mq as ye,mr as _o,ms as ko,mt as Ao,c7 as No,mu as le,c9 as fn,mv as pn,mw as mn,bs as gn,mx as fe,my as $o,mz as Ro,bx as ie,dp as Io,I as Le,f7 as hn,z as Po,y as Oo,cb as Mo,W as Do,mA as Bo,mB as jo,ca as ze,mC as Fo,mD as xt,fD as Uo,fn as zo,T as Ho,mE as Et,mF as qo,mG as Wo,mH as Xo,mI as Tt,mJ as Jo,mK as Vo,aS as Yo,aT as Go,aN as Zo,aY as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Im}from"./CollapsiblePlugin-D_fVK4i3.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-BoT73xjq.js";import{u as er}from"./Output-BfjIM99o.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Om,u as Mm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Bm}from"./YouTubePlugin-BLdLNfNB.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./url-DY3jeuF8.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-c7kvMU60.js";import"./index-i9IsP_xD.js";import"./hoverbox-CStlKQWE.js";import"./index--Rl4aMiU.js";import"./index-_yFHxlc9.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.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 cl{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,ul=dt.Consumer,dl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function fl(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 fr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>fr[t]??t)}function ft(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-rXaW8uXA.js";import{D as Xl,a as Jl,b as Vl,e as Yl,c as Gl,g as Zl,i as Kl,f as Ql,l as ec,h as tc,j as nc,k as sc,m as oc,n as rc,r as ic,o as ac,p as lc,q as cc,s as uc,t as dc,v as fc,w as pc,x as mc,y as gc,z as hc,u as bc}from"./LexicalToolRegistry-rXaW8uXA.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 Fn,S as Xt,U as Un,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 fs,aF as ps,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Es,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Ts,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 Ue,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Fs,bb as rn,bc as an,bd as ln,be as cn,j as Us,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-Dr8dgCst.js";import{bi as xc,bj as Ec,bk as Tc,bl as Cc,bm as vc,bn as wc,bo as Sc,bp as Lc,bq as _c,br as kc,bs as Ac,bt as Nc,bu as $c,bv as Rc,d as Ic,e as Pc,bw as Oc,bx as Mc,B as Dc,by as Bc,A as jc,bz as Fc,bA as Uc,bB as zc,bC as Hc,bD as qc,bE as Wc,bF as Xc,bG as Jc,bH as Vc,bI as Yc,bJ as Gc,bK as Zc,bL as Kc,bM as Qc,bN as eu,bO as tu,bP as nu,f as su,bQ as ou,g as ru,bR as iu,bS as au,bT as lu,bU as cu,bV as uu,q as du,bW as fu,bX as pu,bY as mu,bZ as gu,b_ as hu,b$ as bu,c0 as yu,c1 as xu,c2 as Eu,c3 as Tu,c4 as Cu,c5 as vu,c6 as wu,c7 as Su,c8 as Lu,c9 as _u,ca as ku,cb as Au,cc as Nu,cd as $u,ce as Ru,cf as Iu,cg as Pu,ch as Ou,ci as Mu,cj as Du,I as Bu,ck as ju,cl as Fu,cm as Uu,cn as zu,co as Hu,cp as qu,cq as Wu,cr as Xu,cs as Ju,ct as Vu,cu as Yu,cv as Gu,h as Zu,z as Ku,cw as Qu,cx as ed,cy as td,cz as nd,cA as sd,cB as od,cC as rd,cD as id,cE as ad,cF as ld,cG as cd,J as ud,cH as dd,cI as fd,cJ as pd,cK as md,cL as gd,cM as hd,cN as bd,cO as yd,cP as xd,cQ as Ed,cR as Td,cS as Cd,cT as vd,cU as wd,cV as Sd,cW as Ld,cX as _d,cY as kd,cZ as Ad,c_ as Nd,c$ as $d,d0 as Rd,d1 as Id,d2 as Pd,d3 as Od,d4 as Md,d5 as Dd,d6 as Bd,d7 as jd,d8 as Fd,d9 as Ud,da as zd,db as Hd,dc as qd,dd as Wd,de as Xd,df as Jd,dg as Vd,dh as Yd,di as Gd,dj as Zd,dk as Kd,dl as Qd,dm as ef,dn as tf,dp as nf,dq as sf,dr as of,ds as rf,dt as af,du as lf,dv as cf,dw as uf,dx as df,dy as ff,dz as pf,dA as mf,dB as gf,dC as hf,dD as bf,dE as yf,dF as xf,dG as Ef,dH as Tf,dI as Cf,dJ as vf,dK as wf,dL as Sf,dM as Lf,dN as _f,dO as kf,dP as Af,dQ as Nf,dR as $f,dS as Rf,dT as If,dU as Pf,dV as Of,dW as Mf,dX as Df,dY as Bf,dZ as jf,d_ as Ff,d$ as Uf,e0 as zf,e1 as Hf,e2 as qf,e3 as Wf,e4 as Xf,e5 as Jf,e6 as Vf,e7 as Yf,e8 as Gf,e9 as Zf,ea as Kf,eb as Qf,ec as ep,ed as tp,ee as np,ef as sp,eg as op,eh as rp,ei as ip,ej as ap,ek as lp,el as cp,em as up,en as dp,eo as fp,ep as pp,eq as mp,er as gp,es as hp,et as bp,eu as yp,ev as xp,ew as Ep,ex as Tp,ey as Cp,ez as vp,eA as wp,eB as Sp,eC as Lp,eD as _p,eE as kp,eF as Ap,eG as Np,eH as $p,eI as Rp,eJ as Ip,eK as Pp,eL as Op,eM as Mp,eN as Dp,eO as Bp,eP as jp,eQ as Fp,eR as Up,eS as zp,eT as Hp,eU as qp,eV as Wp,eW as Xp,eX as Jp,r as Vp,eY as Yp,eZ as Gp,e_ as Zp,e$ as Kp,i as Qp,f0 as em,f1 as tm,f2 as nm,f3 as sm,f4 as om,f5 as rm,f6 as im,f7 as am,f8 as lm,f9 as cm,fa as um,fb as dm,fc as fm,fd as pm,fe as mm,ff as gm,fg as hm,fh as bm,fi as ym,fj as xm,fk as Em,fl as Tm,fm as Cm,fn as vm,fo as wm,fp as Sm,fq as Lm,fr as _m,fs as km,ft as Am,fu as Nm,fv as $m}from"./JupyterLexicalExtension-Dr8dgCst.js";import{l$ as io,r as m,j as h,aX as ao,aR as lo,B as co,a$ as ee,m0 as F,m1 as ae,m2 as un,m3 as pe,m4 as z,m5 as uo,m6 as fo,m7 as po,m8 as mo,m9 as j,a_ as ce,ma as Ee,mb as ut,mc as go,md as ho,me as bo,mf as yo,mg as dn,mh as xo,mi as Eo,mj as To,mk as Co,ml as vo,mm as wo,aZ as So,ab as M,c6 as ve,mn as Lo,mo as se,mp as X,mq as ye,mr as _o,ms as ko,mt as Ao,c7 as No,mu as le,c9 as fn,mv as pn,mw as mn,bs as gn,mx as fe,my as $o,mz as Ro,bx as ie,dp as Io,I as Le,f7 as hn,z as Po,y as Oo,cb as Mo,W as Do,mA as Bo,mB as jo,ca as ze,mC as Fo,mD as xt,fD as Uo,fn as zo,T as Ho,mE as Et,mF as qo,mG as Wo,mH as Xo,mI as Tt,mJ as Jo,mK as Vo,aS as Yo,aT as Go,aN as Zo,aY as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Im}from"./CollapsiblePlugin-DPGnrmLj.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-BoT73xjq.js";import{u as er}from"./Output-Do1CYRIF.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Om,u as Mm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Bm}from"./YouTubePlugin-BCHN7vdi.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./url-DY3jeuF8.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-c7kvMU60.js";import"./index-i9IsP_xD.js";import"./hoverbox-CStlKQWE.js";import"./index--Rl4aMiU.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.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 cl{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,ul=dt.Consumer,dl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function fl(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 fr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>fr[t]??t)}function ft(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=ft(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=ft(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 En(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 pr(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 Tn(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 pt(e){return e.replace(/^\n/,"").replace(/\n[ \t]*$/,"")}function Er(e){if(uo(e))return St(e.text);if(fo(e)||po(e)){const t=e.data["text/plain"];return t===void 0?null:St(t)}return mo(e)?e.traceback.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cf as E,az as I,aA as j,cj as N,aE as x,r as d,ck as L,cl as w,cm as A,aB as D,cn as R,co as M,aD as O,cp as P,cq as T,cr as U,cs as W}from"../datalayer-app-main.js";import{I as q}from"./tokens-iGMkLb0v.js";import{c as z}from"./index-
|
|
1
|
+
import{cf as E,az as I,aA as j,cj as N,aE as x,r as d,ck as L,cl as w,cm as A,aB as D,cn as R,co as M,aD as O,cp as P,cq as T,cr as U,cs as W}from"../datalayer-app-main.js";import{I as q}from"./tokens-iGMkLb0v.js";import{c as z}from"./index-z8PItpd8.js";import{b as F}from"./index-i9IsP_xD.js";import{I as H}from"./tokens-DuSIK5iU.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./hoverbox-CStlKQWE.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";const K="jp-Launcher";class V extends E{constructor(){super(...arguments),this.itemsList=[]}add(r){const e=k.createItem(r);return this.itemsList.push(e),this.stateChanged.emit(void 0),new I(()=>{j.removeFirstOf(this.itemsList,e),this.stateChanged.emit(void 0)})}items(){return this.itemsList[Symbol.iterator]()}}class $ extends N{constructor(r){super(r.model),this._pending=!1,this._cwd="",this._cwd=r.cwd,this.translator=r.translator||x,this._trans=this.translator.load("jupyterlab"),this._callback=r.callback,this._commands=r.commands,this.addClass(K)}get cwd(){return this._cwd}set cwd(r){this._cwd=r,this.update()}get pending(){return this._pending}set pending(r){this._pending=r}render(){if(!this.model)return null;const r=[this._trans.__("Notebook"),this._trans.__("Console")],e=Object.create(null);for(const t of this.model.items()){const a=t.category||this._trans.__("Other");a in e||(e[a]=[]),e[a].push(t)}for(const t in e)e[t]=e[t].sort((a,n)=>k.sortCmp(a,n,this._cwd,this._commands));const p=[];let o;const u={[this._trans.__("Notebook")]:0,[this._trans.__("Console")]:20,[this._trans.__("Other")]:100};return Object.keys(e).sort((t,a)=>{const n=h=>{var _,g;const i=(_=e[h])!==null&&_!==void 0?_:[],f=(g=u[h])!==null&&g!==void 0?g:1/0;return Math.min(...i.map(y=>{var v;return(v=y.categoryRank)!==null&&v!==void 0?v:f}))},c=n(t),s=n(a);return c!==s?c-s:t.localeCompare(a)}).forEach(t=>{if(!e[t])return;const a=e[t][0],n={...a.args,cwd:this.cwd},c=r.indexOf(t)>-1,s=this._commands.iconClass(a.command,n),h=this._commands.icon(a.command,n);t in e&&(o=d.createElement("div",{className:"jp-Launcher-section",key:t},d.createElement("div",{className:"jp-Launcher-sectionHeader"},d.createElement(L.resolveReact,{icon:h,iconClass:w(s,"jp-Icon-cover"),stylesheet:"launcherSection","aria-hidden":"true"}),d.createElement("h2",{className:"jp-Launcher-sectionTitle"},t)),d.createElement("div",{className:"jp-Launcher-cardContainer"},Array.from(A(e[t],_=>G(c,_,this,this._commands,this._trans,this._callback))))),p.push(o))}),d.createElement("div",{className:"jp-Launcher-body jp-zoom-target"},d.createElement("div",{className:"jp-Launcher-content"},d.createElement("div",{className:"jp-Launcher-cwd"},d.createElement("h3",null,this.cwd)),p))}}function G(m,r,e,p,o,u){const l=r.command,t={...r.args,cwd:e.cwd},a=p.caption(l,t),n=p.label(l,t),c=m?n:a||n,s=()=>{e.pending!==!0&&(e.pending=!0,p.execute(l,{...r.args,cwd:e.cwd}).then(i=>{e.pending=!1,i instanceof D&&u(i)}).catch(i=>{console.error(i),e.pending=!1,R(o._p("Error","Launcher Error"),i)}))},h=i=>{(i.key==="Enter"||i.key===" "||i.key==="Spacebar")&&(i.preventDefault(),s())},_=p.iconClass(l,t),g=p.icon(l,t);return d.createElement("div",{className:"jp-LauncherCard",title:c,role:"button",onClick:s,onKeyDown:h,tabIndex:0,"data-category":r.category||o.__("Other"),key:k.keyProperty.get(r)},d.createElement("div",{className:"jp-LauncherCard-icon"},m?r.kernelIconUrl?d.createElement("img",{src:r.kernelIconUrl,className:"jp-Launcher-kernelIcon",alt:c}):d.createElement("div",{className:"jp-LauncherCard-noKernelIcon"},n[0].toUpperCase()):d.createElement(L.resolveReact,{icon:g,iconClass:w(_,"jp-Icon-cover"),stylesheet:"launcherCard"})),d.createElement("div",{className:"jp-LauncherCard-label",title:c},d.createElement("p",null,n)))}var k;(function(m){let r=0;m.keyProperty=new M({name:"key",create:()=>r++});function e(o){return{...o,category:o.category||"",rank:o.rank!==void 0?o.rank:1/0}}m.createItem=e;function p(o,u,l,t){const a=o.rank,n=u.rank;if(a!==n&&a!==void 0&&n!==void 0)return a<n?-1:1;const c=t.label(o.command,{...o.args,cwd:l}),s=t.label(u.command,{...u.args,cwd:l});return c.localeCompare(s)}m.sortCmp=p})(k||(k={}));var C;(function(m){m.create="launcher:create"})(C||(C={}));const Ge={activate:J,id:"@jupyterlab/launcher-extension:plugin",description:"Provides the launcher tab service.",requires:[O],optional:[z,F,H],provides:q,autoStart:!0};function J(m,r,e,p,o){const{commands:u,shell:l}=m,t=r.load("jupyterlab"),a=new V;return u.addCommand(C.create,{label:t.__("New Launcher"),icon:n=>n.toolbar?P:void 0,describedBy:{args:{type:"object",properties:{cwd:{type:"string",description:t.__("The current working directory")},toolbar:{type:"boolean",description:t.__("Whether the command is executed from a toolbar")},activate:{type:"boolean",description:t.__("Whether to activate the widget")},ref:{type:"string",description:t.__("The reference widget id")}}}},execute:n=>{var c,s;const h=(s=(c=n.cwd)!==null&&c!==void 0?c:o?.model.path)!==null&&s!==void 0?s:"",_=`launcher-${b.id++}`,g=y=>{W(l.widgets("main"),v=>v===y)&&(l.add(y,"main",{ref:_}),i.dispose())},i=new $({model:a,cwd:h,callback:g,commands:u,translator:r});i.model=a,i.title.icon=T,i.title.label=t.__("Launcher");const f=new U({content:i});if(f.title.closable=!!Array.from(l.widgets("main")).length,f.id=_,l.add(f,"main",{activate:n.activate,ref:n.ref}),e&&e.layoutModified.connect(()=>{f.title.closable=Array.from(e.widgets("main")).length>1},f),o){const y=v=>{i.cwd=v.path};o.model.pathChanged.connect(y),i.disposed.connect(()=>{o.model.pathChanged.disconnect(y)})}return f}}),e&&Promise.all([m.restored,o?.model.restored]).then(()=>{function n(){e.isEmpty("main")&&u.execute(C.create)}e.layoutModified.connect(()=>{n()})}),p&&p.addItem({command:C.create,category:t.__("Launcher")}),e&&(e.addButtonEnabled=!0,e.addRequested.connect((n,c)=>{var s;const h=((s=c.currentTitle)===null||s===void 0?void 0:s.owner.id)||c.titles[c.titles.length-1].owner.id;return u.execute(C.create,{ref:h})})),a}var b;(function(m){m.id=0})(b||(b={}));export{Ge as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cu as I,cv as w,cw as g,cx as B,cy as b,aD as P,aG as v,aF as M}from"../datalayer-app-main.js";import{J as C,c as E}from"./index-
|
|
1
|
+
import{cu as I,cv as w,cw as g,cx as B,cy as b,aD as P,aG as v,aF as M}from"../datalayer-app-main.js";import{J as C,c as E}from"./index-z8PItpd8.js";import{I as L}from"./tokens-1h_N3aLM.js";import{I as N}from"./tokens-DfQxPp01.js";import{b as A}from"./index-i9IsP_xD.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./hoverbox-CStlKQWE.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";class T{constructor(t="",e,n,a){this._domainData={},this._translationBundles={},this._connector=a??new I(t,n),this._stringsPrefix=e||"",this._englishBundle=new w({stringsPrefix:this._stringsPrefix}),this._currentLocale=g}get languageCode(){return this._currentLocale}async fetch(t){var e,n,a,o;this._languageData=await this._connector.fetch({language:t});let i;if(this._languageData&&t==="default")try{for(const s of Object.values((e=this._languageData.data)!==null&&e!==void 0?e:{})){i=s[""].language;break}}catch{}this._currentLocale=(t!=="default"?t:i??g).replace("_","-"),this._domainData=(a=(n=this._languageData)===null||n===void 0?void 0:n.data)!==null&&a!==void 0?a:{};const r=(o=this._languageData)===null||o===void 0?void 0:o.message;r&&this._currentLocale!==g&&console.warn(r)}load(t){if(this._domainData){if(this._currentLocale==g)return this._englishBundle;if(t=B(t),!(t in this._translationBundles)){let e=new w({domain:t,locale:this._currentLocale,stringsPrefix:this._stringsPrefix});if(t in this._domainData){const n=this._domainData[t][""],a={...this._domainData[t],"":{...n,pluralForms:n.plural_forms}};e.loadJSON(a,t)}this._translationBundles[t]=e}return this._translationBundles[t]}else return this._englishBundle}}const y="@jupyterlab/translation-extension:plugin",$={id:"@jupyterlab/translation-extension:translator-connector",description:"Provides the application translation connector.",autoStart:!0,requires:[C.IPaths],provides:b,activate:(m,t)=>{const e=t.urls.translations,n=m.serviceManager.serverSettings;return new I(e,n)}},F={id:"@jupyterlab/translation-extension:translator",description:"Provides the application translation object.",autoStart:!0,requires:[C.IPaths,L],optional:[E,b],provides:P,activate:async(m,t,e,n,a)=>{const o=await e.load(y),i=o.get("locale").composite;let r=o.get("stringsPrefix").composite;r=o.get("displayStringsPrefix").composite?r:"";const c=m.serviceManager.serverSettings,l=new T(t.urls.translations,r,c,a??void 0);return await l.fetch(i),document.documentElement.lang=l.languageCode,n&&(n.translator=l),v.translator=l,l}},G={id:y,description:"Adds translation commands and settings.",requires:[L,P,b],optional:[N,A],autoStart:!0,activate:(m,t,e,n,a,o)=>{var i;const r=e.load("jupyterlab"),{commands:s}=m,c=a?(i=a.settingsMenu.items.find(u=>{var p;return u.type==="submenu"&&((p=u.submenu)===null||p===void 0?void 0:p.id)==="jp-mainmenu-settings-language"}))===null||i===void 0?void 0:i.submenu:null,l="jupyterlab-translation:install-languages";s.addCommand(l,{label:r.__("Install more languages…"),caption:r.__("Search for language packs in the Extension Manager"),isEnabled:()=>s.hasCommand("extensionmanager:show-panel")&&s.isVisible("extensionmanager:show-panel"),execute:()=>s.execute("extensionmanager:show-panel",{query:"jupyterlab-language-pack"}),describedBy:{args:{type:"object",properties:{}}}}),o&&o.addItem({category:r.__("Display Languages"),command:l}),n.fetch().then(u=>{const p=e.languageCode.replace("-","_");for(const d in u.data){const x=u.data[d],D=x.displayName,S=x.nativeName,h=p===d,_=h?`${D}`:`${D} - ${S}`,f=`jupyterlab-translation:${d}`;s.addCommand(f,{label:_,caption:r.__("Change interface language to %1",_),isEnabled:()=>!h,isToggled:()=>h,execute:async()=>{if((await M({title:r.__("Change interface language?"),body:r.__("After changing the interface language to %1, you will need to reload JupyterLab to see the changes.",_),buttons:[v.cancelButton(),v.okButton({label:r.__("Change and reload")})]})).button.accept)try{await t.set(y,"locale",d),window.location.reload()}catch(j){console.error(`Failed to update language locale to ${d}`,j)}},describedBy:{args:{type:"object",properties:{}}}}),c&&c.addItem({command:f,args:{}}),o&&o.addItem({category:r.__("Display Languages"),command:f})}}).catch(u=>{console.error(`Available locales errored!
|
|
2
2
|
${u}`)}).finally(()=>{c&&(c.items.length>0&&c.addItem({type:"separator"}),c.addItem({command:l,args:{}}))})}},Gt=[$,F,G];export{Gt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aE as T,aa as I,az as E,aD as R,cz as A,cA as B,aB as j,cr as N}from"../datalayer-app-main.js";import{b as M}from"./index-i9IsP_xD.js";import{I as V}from"./tokens-1h_N3aLM.js";import{I as W}from"./tokens-udK9JDBx.js";import{c as k}from"./index-
|
|
1
|
+
import{aE as T,aa as I,az as E,aD as R,cz as A,cA as B,aB as j,cr as N}from"../datalayer-app-main.js";import{b as M}from"./index-i9IsP_xD.js";import{I as V}from"./tokens-1h_N3aLM.js";import{I as W}from"./tokens-udK9JDBx.js";import{c as k}from"./index-z8PItpd8.js";import"./hoverbox-CStlKQWE.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";class D{constructor(n=T){this.translator=n,this._changed=new I(this),this._providerMap=new Map}add(n,c){return this._providerMap.set(n,c),this._changed.emit(),new E(()=>{this._providerMap.delete(n),this._changed.emit()})}getProvider(n){for(const c of this._providerMap.values())if(c.isApplicable(n))return c.createNew(n,this.translator)}hasProvider(n){for(const c of this._providerMap.values())if(c.isApplicable(n))return!0;return!1}get changed(){return this._changed}}const v="jp-mod-searchable",S="jp-mod-search-active",_="--jp-documentsearch-content-header";var o;(function(t){t.search="documentsearch:start",t.searchAndReplace="documentsearch:startWithReplace",t.findNext="documentsearch:highlightNext",t.findPrevious="documentsearch:highlightPrevious",t.end="documentsearch:end",t.toggleSearchInSelection="documentsearch:toggleSearchInSelection"})(o||(o={}));const F={id:"@jupyterlab/documentsearch-extension:labShellWidgetListener",description:"Active search on valid document",requires:[k,W],autoStart:!0,activate:(t,n,c)=>{const h=s=>{s&&(c.hasProvider(s)?s.addClass(v):s.removeClass(v))};c.changed.connect(()=>h(n.activeWidget)),n.activeChanged.connect((s,d)=>{const u=d.oldValue;u&&u.removeClass(v),h(d.newValue)})}};class L{constructor(n){this._commandRegistry=n,this._cache=this._buildCache(),this._commandRegistry.keyBindingChanged.connect(this._rebuildCache,this)}get next(){return this._cache.next}get previous(){return this._cache.previous}get toggleSearchInSelection(){return this._cache.toggleSearchInSelection}_rebuildCache(){this._cache=this._buildCache()}_buildCache(){const n=this._commandRegistry.keyBindings.find(s=>s.command===o.findNext),c=this._commandRegistry.keyBindings.find(s=>s.command===o.findPrevious),h=this._commandRegistry.keyBindings.find(s=>s.command===o.toggleSearchInSelection);return{next:n,previous:c,toggleSearchInSelection:h}}dispose(){this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache,this)}}const P={id:"@jupyterlab/documentsearch-extension:plugin",description:"Provides the document search registry.",provides:W,requires:[R],optional:[M,V],autoStart:!0,activate:(t,n,c,h)=>{var s;const d=n.load("jupyterlab");let u=500,y="never";const p=new D(n),l=new Map;if(h){const e=h.load(P.id),r=i=>{u=i.get("searchDebounceTime").composite,y=i.get("autoSearchInSelection").composite};Promise.all([e,t.restored]).then(([i])=>{r(i),i.changed.connect(a=>{r(a)})}).catch(i=>{console.error(i.message)})}const b=()=>{const e=t.shell.currentWidget;return e?p.hasProvider(e):!1},x=e=>{if(!e)return;const r=e.id;let i=l.get(r);if(!i){const a=p.getProvider(e);if(!a)return;const m=new A(a,u),C=new L(t.commands),g=new B(m,n,C);l.set(r,g),[o.findNext,o.findPrevious,o.end,o.toggleSearchInSelection].forEach(f=>{t.commands.notifyCommandChanged(f)}),g.closed.connect(()=>{e.isDisposed||(e.activate(),e.removeClass(S))}),g.disposed.connect(()=>{e.isDisposed||(e.activate(),e.removeClass(S)),l.delete(r),[o.findNext,o.findPrevious,o.end,o.toggleSearchInSelection].forEach(f=>{t.commands.notifyCommandChanged(f)})}),e.disposed.connect(()=>{g.dispose(),m.dispose(),a.dispose(),C.dispose()}),i=g}return i.isAttached||(j.attach(i,e.node),e.addClass(S),e instanceof N&&(e.contentHeader.node.style.setProperty("anchor-name",_),e.node.style.setProperty("anchor-scope",_),i.node.style.top=`anchor(${_} bottom)`),i.model.searchExpression&&i.model.refresh()),i};return t.commands.addCommand(o.search,{label:d.__("Find…"),isEnabled:b,describedBy:{args:{type:"object",properties:{searchText:{type:"string",description:d.__("The text to search for")}}}},execute:async e=>{const r=x(t.shell.currentWidget);if(r){const i=e.searchText;i?r.setSearchText(i):r.setSearchText(r.model.suggestedInitialQuery);const a=r.model.selectionState;let m=!1;switch(y){case"multiple-selected":m=a==="multiple";break;case"any-selected":m=a==="multiple"||a==="single";break}m&&await r.model.setFilter("selection",!0),r.focusSearchInput()}}}),t.commands.addCommand(o.searchAndReplace,{label:d.__("Find and Replace…"),isEnabled:b,describedBy:{args:{type:"object",properties:{searchText:{type:"string",description:d.__("The text to search for")},replaceText:{type:"string",description:d.__("The text to replace with")}}}},execute:e=>{const r=x(t.shell.currentWidget);if(r){const i=e.searchText;i?r.setSearchText(i):r.setSearchText(r.model.suggestedInitialQuery);const a=e.replaceText;a&&r.setReplaceText(a),r.showReplace(),r.focusSearchInput()}}}),t.commands.addCommand(o.findNext,{label:d.__("Find Next"),isEnabled:()=>!!t.shell.currentWidget&&l.has(t.shell.currentWidget.id),describedBy:{args:{type:"object",properties:{}}},execute:async()=>{var e;const r=t.shell.currentWidget;r&&await((e=l.get(r.id))===null||e===void 0?void 0:e.model.highlightNext())}}),t.commands.addCommand(o.findPrevious,{label:d.__("Find Previous"),isEnabled:()=>!!t.shell.currentWidget&&l.has(t.shell.currentWidget.id),describedBy:{args:{type:"object",properties:{}}},execute:async()=>{var e;const r=t.shell.currentWidget;r&&await((e=l.get(r.id))===null||e===void 0?void 0:e.model.highlightPrevious())}}),t.commands.addCommand(o.end,{label:d.__("End Search"),isEnabled:()=>!!t.shell.currentWidget&&l.has(t.shell.currentWidget.id),describedBy:{args:{type:"object",properties:{}}},execute:async()=>{var e;const r=t.shell.currentWidget;r&&((e=l.get(r.id))===null||e===void 0||e.close())}}),t.commands.addCommand(o.toggleSearchInSelection,{label:d.__("Search in Selection"),isEnabled:()=>!!t.shell.currentWidget&&l.has(t.shell.currentWidget.id)&&"selection"in l.get(t.shell.currentWidget.id).model.filtersDefinition,describedBy:{args:{type:"object",properties:{}}},execute:async()=>{var e;const r=t.shell.currentWidget;if(!r)return;const i=(e=l.get(r.id))===null||e===void 0?void 0:e.model;if(!i)return;const a=i.filters.selection;return i.setFilter("selection",!a)}}),(s=t.shell.currentChanged)===null||s===void 0||s.connect(()=>{Object.values(o).forEach(e=>{t.commands.notifyCommandChanged(e)})}),c&&[o.search,o.searchAndReplace,o.findNext,o.findPrevious,o.end,o.toggleSearchInSelection].forEach(e=>{c.addItem({command:e,category:d.__("Main Area")})}),p}},Fe=[P,F];export{Fe as default};
|