"use strict";(self.webpackChunk_jupyterlite_xeus_python_kernel=self.webpackChunk_jupyterlite_xeus_python_kernel||[]).push([[686],{686:(e,s,t)=>{t.r(s),t.d(s,{default:()=>l});var i=t(474),a=t(635),r=t(684),n=t(840),o=t(526),d=t(398);class p{constructor(e){this._isDisposed=!1,this._disposed=new n.Signal(this),this._executeDelegate=new o.PromiseDelegate,this._parentHeader=void 0,this._parent=void 0;const{id:s,name:i,sendMessage:a,location:d}=e;this._id=s,this._name=i,this._location=d,this._sendMessage=a,this._worker=new Worker(new URL(t.p+t.u(213),t.b),{type:void 0}),this._worker.onmessage=e=>{this._processWorkerMessage(e.data)},this._remote=(0,r.wrap)(this._worker),this.initFileSytem(e)}async handleMessage(e){this._parent=e,this._parentHeader=e.header,await this._sendMessageToWorker(e)}async _sendMessageToWorker(e){if("input_reply"!==e.header.msg_type&&(this._executeDelegate=new o.PromiseDelegate),await this._remote.processMessage({msg:e,parent:this.parent}),"input_reply"!==e.header.msg_type)return await this._executeDelegate.promise}get parentHeader(){return this._parentHeader}get parent(){return this._parent}get location(){return this._location}_processWorkerMessage(e){var s,t,i,a;e.header&&(e.header.session=null!==(t=null===(s=this._parentHeader)||void 0===s?void 0:s.session)&&void 0!==t?t:"",e.session=null!==(a=null===(i=this._parentHeader)||void 0===i?void 0:i.session)&&void 0!==a?a:"",this._sendMessage(e),"status"===e.header.msg_type&&"idle"===e.content.execution_state&&this._executeDelegate.resolve())}get ready(){return Promise.resolve()}get isDisposed(){return this._isDisposed}get disposed(){return this._disposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit(void 0))}get id(){return this._id}get name(){return this._name}async initFileSytem(e){let s,t;if(e.location.includes(":")){const i=e.location.split(":");s=i[0],t=i[1]}else s="",t=e.location;await this._remote.ready(),e.mountDrive&&(await this._remote.mount(s,"/drive",d.PageConfig.getBaseUrl()),await this._remote.cd(t))}}const h=t.p+"e32b5c282072d717887b60da73178fdd35a65dc3caeacba7a026e5a4255cc997.png",_=t.p+"5c9063b436cedf0567480fe487ece0d1479ea9545f310cba93fa184ccbab290d.png",l=[{id:"@jupyterlite/xeus-kernel-extension:kernel",autoStart:!0,requires:[a.IKernelSpecs,i.IServiceWorkerRegistrationWrapper],activate:(e,s,t)=>{s.register({spec:{name:"xeus-python",display_name:"xeus-python",language:"python",argv:[],spec:{argv:[],env:{},display_name:"xeus-python",language:"python",interrupt_mode:"message",metadata:{}},resources:{"logo-32x32":h,"logo-64x64":_}},create:async e=>new p({...e,mountDrive:t.enabled})})}}]}}]);