"use strict";(self.webpackChunkvule_magics=self.webpackChunkvule_magics||[]).push([[568],{568:(t,e,i)=>{i.r(e),i.d(e,{default:()=>c});var n=i(123),s=i(191);const o={default:"text/x-ipython","%%sql":"text/x-sparksql","%%sh":"text/x-sh","%%bash":"text/x-sh"};class l{constructor(t,e){this.app=t,this.tracker=e,this.tracker.currentChanged.connect((()=>{if(!this.tracker.currentWidget)return;const t=this.tracker.currentWidget;t.content.modelContentChanged.connect((()=>{t.content.widgets.length>0&&t.content.widgets.forEach((t=>{this.configCellEditor(t)}))}))}))}configCellEditor(t){if(null!==t&&(0,s.isCodeCellModel)(t.model)){const e=this.getCellEditor(t);this.cellMagicSyntaxMap(e)}}getCellEditor(t){return t.editor.editor}cellMagicSyntaxMap(t){const e=t.getDoc().getLine(0).split(" ")[0];e.startsWith("%%")&&e in o?this.highlight(t,!0,o[e]):this.highlight(t,!0,o.default)}highlight(t,e=!0,i){"null"!==t.getOption("mode")?t.setOption("mode",i):e&&setTimeout((()=>this.highlight(t,!1,i)),0)}}const c={id:"vule-magics:plugin",autoStart:!0,requires:[n.INotebookTracker],activate:function(t,e){console.log("JupyterLab extension vule-magics is activated!");const i=new l(t,e);console.log("SyntaxHighlighter Loaded ",i)}}}}]);