"use strict";(self.webpackChunk_shannon_shen_chapyter=self.webpackChunk_shannon_shen_chapyter||[]).push([[568],{568:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(919),c=o(56);const s={id:"@shannon-shen/chapyter:plugin",description:"A Natural Language-Based Python Program Interpreter",autoStart:!0,requires:[n.INotebookTracker],optional:[c.ISettingRegistry],activate:(e,t)=>{n.NotebookActions.executed.connect(((e,o)=>{if(o.success&&!o.cell.model.getMetadata("chatGen")){console.log("Real Code cell was successfully executed");let e=o.cell;console.log("Executed cell:",e);let c=e.model.sharedModel.getSource();if(c.startsWith("%chat")||c.startsWith("%%chat")){let e=t.currentWidget;if(e){n.NotebookActions.selectAbove(e.content);let t=e.content.activeCell;console.log("New cell:",t),t&&t.model.setMetadata("chatGen",!0),n.NotebookActions.run(e.content,e.sessionContext),n.NotebookActions.hideCode(e.content),n.NotebookActions.selectBelow(e.content)}}}}))}}}}]);