"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3844,9853],{23844:(e,t,o)=>{o.r(t),o.d(t,{default:()=>v});var n=o(46693),s=o(46605),a=o(79075),r=o(26915),c=o(4857),l=o(86072),d=o(75736),i=o(19691),u=o(34340);const k="jp-NotebookKernelStatus-error",g="jp-NotebookKernelStatus-warn",p="jp-NotebookKernelStatus-info",C="jp-NotebookKernelStatus-fade",h={id:"@jupyter-notebook/notebook-extension:checkpoints",autoStart:!0,requires:[a.IDocumentManager,l.ITranslator],optional:[d.INotebookShell,n.IToolbarWidgetRegistry],activate:(e,t,o,a,r)=>{const{shell:c}=e,l=o.load("notebook"),d=document.createElement("div");r&&r.addFactory("TopBar","checkpoint",(e=>{const t=new u.Widget({node:d});return t.id=n.DOMUtils.createDomID(),t.addClass("jp-NotebookCheckpoint"),t}));const k=async()=>{const e=c.currentWidget;if(!e)return;const o=t.contextForWidget(e);null==o||o.fileChanged.disconnect(k),null==o||o.fileChanged.connect(k);const n=await(null==o?void 0:o.listCheckpoints());if(!n)return;const a=n[n.length-1];d.textContent=l.__("Last Checkpoint: %1",s.Time.formatHuman(new Date(a.last_modified)))};a&&a.currentChanged.connect(k),new i.Poll({auto:!0,factory:()=>k(),frequency:{interval:2e3,backoff:!1},standby:"when-hidden"})}},b={id:"@jupyter-notebook/notebook-extension:kernel-logo",autoStart:!0,requires:[d.INotebookShell],optional:[n.IToolbarWidgetRegistry],activate:(e,t,o)=>{const{serviceManager:n}=e,s=document.createElement("div"),a=document.createElement("img");s.appendChild(a);const c=async()=>{var e,o,s,l,d;const i=t.currentWidget;if(!(i instanceof r.NotebookPanel))return;await i.sessionContext.ready,i.sessionContext.kernelChanged.disconnect(c),i.sessionContext.kernelChanged.connect(c);const u=null!==(s=null===(o=null===(e=i.sessionContext.session)||void 0===e?void 0:e.kernel)||void 0===o?void 0:o.name)&&void 0!==s?s:"",k=null===(d=null===(l=n.kernelspecs)||void 0===l?void 0:l.specs)||void 0===d?void 0:d.kernelspecs[u];if(!k)return;const g=k.resources["logo-64x64"];g&&(a.src=g,a.title=k.display_name)};o&&o.addFactory("TopBar","kernelLogo",(e=>{const t=new u.Widget({node:s});return t.addClass("jp-NotebookKernelLogo"),t})),e.started.then((()=>{t.currentChanged.connect(c)}))}},m={id:"@jupyter-notebook/notebook-extension:kernel-status",autoStart:!0,requires:[d.INotebookShell,l.ITranslator],activate:(e,t,o)=>{const n=o.load("notebook"),a=new u.Widget;a.addClass("jp-NotebookKernelStatus"),e.shell.add(a,"menu",{rank:10010});const c=e=>{const t=e.kernelDisplayStatus;let o=`Kernel ${s.Text.titleCase(t)}`;switch(a.removeClass(k),a.removeClass(g),a.removeClass(p),a.removeClass(C),t){case"busy":case"idle":o="",a.addClass(C);break;case"dead":case"terminating":a.addClass(k);break;case"unknown":a.addClass(g);break;default:a.addClass(p),a.addClass(C)}a.node.textContent=n.__(o)};t.currentChanged.connect((async()=>{const e=t.currentWidget;e instanceof r.NotebookPanel&&e.sessionContext.statusChanged.connect(c)}))}},f={id:"@jupyter-notebook/notebook-extension:scroll-output",autoStart:!0,requires:[r.INotebookTracker],optional:[c.ISettingRegistry],activate:async(e,t,o)=>{let n=!0;const s=e=>{if(!n)return;const{outputArea:t}=e;if(void 0!==e.model.metadata.get("scrolled"))return;const{node:o}=t,s=o.scrollHeight>1.3*(parseFloat(o.style.fontSize.replace("px",""))||14)*100;e.toggleClass("jp-mod-outputsScrolled",s)},a={},r=e=>{if("code"===e.model.type){const t=e,o=t.model.id;s(t),a[o]&&t.outputArea.model.changed.disconnect(a[o]),a[o]=()=>s(t),t.outputArea.model.changed.connect(a[o])}};if(t.widgetAdded.connect(((e,t)=>{var o;t.sessionContext.ready.then((()=>{t.content.widgets.forEach(r)})),null===(o=t.model)||void 0===o||o.cells.changed.connect(((e,o)=>{t.content.widgets.forEach(r)}))})),o){const t=o.load(f.id),s=e=>{n=e.get("autoScrollOutputs").composite};Promise.all([t,e.restored]).then((([e])=>{s(e),e.changed.connect((e=>{s(e)}))})).catch((e=>{console.error(e.message)}))}}},v=[h,b,m,f]}}]);