"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([["845"],{274(e,t,r){r.d(t,{jO:()=>h});var i,n,a,o=r(676),s=r(910),d=r(759),u=r(828),c=r(482),l=r(989),y=r(416);let p=new l.Token("@jupyterlab/application:ILayoutRestorer","A service providing application layout restoration functionality. Use this to have your activities restored across page loads.");(i=n||(n={})).nameProperty=new y.AttachedProperty({name:"name",create:e=>""}),i.serializeMain=function(e){let t={dock:e&&e.dock&&function e(t){return t&&t.type?"tab-area"===t.type?{type:"tab-area",currentIndex:t.currentIndex,widgets:t.widgets.map(e=>i.nameProperty.get(e)).filter(e=>!!e)}:{type:"split-area",orientation:t.orientation,sizes:t.sizes,children:t.children.map(e).filter(e=>!!e)}:null}(e.dock.main)||null};if(e&&e.currentWidget){let r=i.nameProperty.get(e.currentWidget);r&&(t.current=r)}return t},i.deserializeMain=function(e,t){if(!e)return null;let r=e.current||null,i=e.dock||null;return{currentWidget:r&&t.has(r)&&t.get(r)||null,dock:i?{main:function e(t,r){if(!t)return null;let i=t.type||"unknown";if("unknown"===i||"tab-area"!==i&&"split-area"!==i)return console.warn(`Attempted to deserialize unknown type: ${i}`),null;if("tab-area"===i){let{currentIndex:e,widgets:i}=t,n={type:"tab-area",currentIndex:e||0,widgets:i&&i.map(e=>r.get(e)).filter(e=>!!e)||[]};return n.currentIndex>n.widgets.length-1&&(n.currentIndex=0),n}let{orientation:n,sizes:a,children:o}=t;return{type:"split-area",orientation:n,sizes:a||[],children:o&&o.map(t=>e(t,r)).filter(e=>!!e)||[]}}(i,t)}:null}};let m=new l.Token("@jupyterlab/application:IMimeDocumentTracker","A widget tracker for documents rendered using a mime renderer extension. Use this if you want to list and interact with documents rendered by such extensions.");function h(e){let t=[],r=new o.WidgetTracker({namespace:"application-mimedocuments"});return e.forEach(e=>{let i=e.default;e.hasOwnProperty("__esModule")||(i=e),Array.isArray(i)||(i=[i]),i.forEach(e=>{var i,n;t.push((i=r,{id:(n=e).id,description:n.description,requires:[d.IRenderMimeRegistry,u.ITranslator],autoStart:!0,activate:(e,t,r)=>{if(void 0!==n.rank?t.addFactory(n.rendererFactory,n.rank):t.addFactory(n.rendererFactory),!n.documentWidgetFactoryOptions)return;let o=e.docRegistry,d=[];d=Array.isArray(n.documentWidgetFactoryOptions)?n.documentWidgetFactoryOptions:[n.documentWidgetFactoryOptions],n.fileTypes&&n.fileTypes.forEach(t=>{t.icon&&(t={...t,icon:c.LabIcon.resolve({icon:t.icon})}),e.docRegistry.addFileType(t)}),d.forEach(e=>{let d=e.toolbarFactory?t=>e.toolbarFactory(t.content.renderer):void 0,u=new s.MimeDocumentFactory({renderTimeout:n.renderTimeout,dataType:n.dataType,rendermime:t,modelName:e.modelName,name:e.name,primaryFileType:o.getFileType(e.primaryFileType),fileTypes:e.fileTypes,defaultFor:e.defaultFor,defaultRendered:e.defaultRendered,toolbarFactory:d,translator:r,factory:n.rendererFactory});o.addWidgetFactory(u),u.widgetCreated.connect((e,t)=>{a.factoryNameProperty.set(t,u.name),t.context.pathChanged.connect(()=>{i.save(t)}),i.add(t)})})}}))})}),t.push({id:"@jupyterlab/application-extension:mimedocument",description:"Provides a mime document widget tracker.",optional:[p],provides:m,autoStart:!0,activate:(e,t)=>(t&&t.restore(r,{command:"docmanager:open",args:e=>({path:e.context.path,factory:a.factoryNameProperty.get(e)}),name:e=>`${e.context.path}:${a.factoryNameProperty.get(e)}`}),r)}),t}(a||(a={})).factoryNameProperty=new y.AttachedProperty({name:"factoryName",create:()=>void 0})},297(e,t,r){r.d(t,{g:()=>a});var i=r(525),n=r(401);class a{constructor(e){this._busyCount=0,this._dirtyCount=0,this._busySignal=new n.Signal(e),this._dirtySignal=new n.Signal(e)}get busySignal(){return this._busySignal}get dirtySignal(){return this._dirtySignal}get isBusy(){return this._busyCount>0}get isDirty(){return this._dirtyCount>0}setDirty(){let e=this.isDirty;return this._dirtyCount++,this.isDirty!==e&&this._dirtySignal.emit(this.isDirty),new i.DisposableDelegate(()=>{let e=this.isDirty;this._dirtyCount=Math.max(0,this._dirtyCount-1),this.isDirty!==e&&this._dirtySignal.emit(this.isDirty)})}setBusy(){let e=this.isBusy;return this._busyCount++,this.isBusy!==e&&this._busySignal.emit(this.isBusy),new i.DisposableDelegate(()=>{let e=this.isBusy;this._busyCount--,this.isBusy!==e&&this._busySignal.emit(this.isBusy)})}}}}]);