"use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[842],{4842(e,r,a){a.r(r),a.d(r,{default:()=>_});var t=a(8516),n=a(603),o=a(3977),s=a(593),i=a(6562),l=a(2692),c=a(3264),d=a(1247),u=a(2453),p=a(2206),m=a(7784);const y={id:"@jupyter/collaboration-extension:userMenu",description:"Provide connected user menu.",requires:[],provides:u.IUserMenu,activate:e=>{const{commands:r}=e,{user:a}=e.serviceManager;return new u.UserMenu({commands:r,user:a})}},b={id:"@jupyter/collaboration-extension:user-menu-bar",description:"Add user menu to the interface.",autoStart:!0,requires:[u.IUserMenu,t.IToolbarWidgetRegistry],activate:async(e,r,a)=>{const{user:t}=e.serviceManager,n=new d.MenuBar({forceItemsPosition:{forceX:!1,forceY:!1},renderer:new u.RendererUserMenu(t)});n.id="jp-UserMenu",t.userChanged.connect(()=>n.update()),n.addMenu(r),a.addFactory("TopBar","user-menu",()=>n)}},v={id:"@jupyter/collaboration-extension:rtcGlobalAwareness",description:"Add global awareness to share working document of users.",requires:[l.IStateDB,s.IAwarenessProviderFactory],provides:o.IGlobalAwareness,activate:(e,r,a)=>{const{user:t}=e.serviceManager,n=new p.Doc,o=new m.ww(n),s={roomID:"JupyterLab:globalAwareness",awareness:o,user:t,serverSettings:e.serviceManager.serverSettings};return a.create(s),r.changed.connect(async()=>{var e,a;const t=(null===(a=null===(e=(await r.toJSON())["layout-restorer:data"])||void 0===e?void 0:e.main)||void 0===a?void 0:a.current)||"";t.match(/^\w+:.+/)?o.setLocalStateField("current",t):o.setLocalStateField("current",null)}),o}},g={id:"@jupyter/collaboration-extension:rtcPanel",description:"Add side panel to display all currently connected users.",autoStart:!0,requires:[o.IGlobalAwareness],optional:[c.ITranslator],activate:(e,r,a)=>{const{user:t}=e.serviceManager,n=(null!=a?a:c.nullTranslator).load("jupyter_collaboration"),o=new i.SidePanel({alignment:"justify"});o.id="jp-collaboration-panel",o.title.icon=i.usersIcon,o.title.caption=n.__("Collaboration"),o.addClass("jp-RTCPanel"),e.shell.add(o,"left",{rank:300});const s=new u.UserInfoPanel({userManager:t,serverSettings:e.serviceManager.serverSettings,trans:n});s.title.label=n.__("User info"),s.title.caption=n.__("User information"),o.addWidget(s);const l=new u.CollaboratorsPanel(t,r,r=>{e.commands.execute("docmanager:open",{path:r})},e.docRegistry);l.title.label=n.__("Online Collaborators"),o.addWidget(l)}},w={id:"@jupyter/collaboration-extension:userEditorCursors",description:"Add CodeMirror extension to display remote user cursors and selections.",autoStart:!0,requires:[n.IEditorExtensionRegistry],activate:(e,r)=>{r.addExtension({name:"remote-user-cursors",factory(e){const{awareness:r,ysource:a}=e.model.sharedModel;return n.EditorExtensionRegistry.createImmutableExtension((0,u.remoteUserCursors)({awareness:r,ytext:a}))}})}};var h;!function(e){e.share="collaboration:shared-link"}(h||(h={}));const _=[y,b,v,g,{id:"@jupyter/collaboration-extension:shared-link",autoStart:!0,optional:[t.ICommandPalette,c.ITranslator],activate:async(e,r,a)=>{const{commands:n}=e,o=(null!=a?a:c.nullTranslator).load("jupyter_collaboration");n.addCommand(h.share,{label:o.__("Generate a Shared Link"),icon:i.shareIcon,execute:async()=>{const e=await(0,u.showSharedLinkDialog)({translator:a});e.button.accept&&e.value&&t.Clipboard.copyToSystem(e.value)}}),r&&r.addItem({command:h.share,category:o.__("Server")})}},w]}}]);