"use strict";(self.webpackChunkastronbs=self.webpackChunkastronbs||[]).push([[763],{763:(o,e,t)=>{t.r(e),t.d(e,{default:()=>i});var a=t(411),n=t(576),r=t(477),s=t(434),m=t(978),l=t(19),c=t(579);async function d(o="",e={}){const t=c.ServerConnection.makeSettings(),a=l.URLExt.join(t.baseUrl,"astronbs",o);let n;try{n=await c.ServerConnection.makeRequest(a,e,t)}catch(o){throw new c.ServerConnection.NetworkError(o)}let r=await n.text();if(r.length>0)try{r=JSON.parse(r)}catch(o){console.log("Not a JSON response body.",n)}if(!n.ok)throw new c.ServerConnection.ResponseError(n,r.message||r);return r}const p={id:"astronbs:plugin",autoStart:!0,optional:[a.ISettingRegistry,s.ILauncher,n.IFileBrowserFactory,r.IDocumentManager],activate:(o,e,t,a,n)=>{console.log("JupyterLab extension astronbs is activated!"),e&&e.load(p.id).then((o=>{console.log("astronbs settings loaded:",o.composite)})).catch((o=>{console.error("Failed to load settings for astronbs.",o)})),o.commands.addCommand("astronbs:reduction_template",{execute:()=>{const o=d("reduction_template",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"astronbs.notebooks",nb_name:"reduction_template.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"Reduction Template"}),o.commands.addCommand("astronbs:reprojection_template",{execute:()=>{const o=d("reprojection_template",{body:JSON.stringify({path:a.defaultBrowser.model.path}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"Reprojection Template"}),o.commands.addCommand("astronbs:light_combo_template",{execute:()=>{const o=d("light_combo_template",{body:JSON.stringify({path:a.defaultBrowser.model.path}),method:"POST"});console.log("I am back in open2"),console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"Light Combo Template"}),o.commands.addCommand("astronbs:01_seeing_profile",{execute:()=>{const o=d("nb_make",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"stellarphot.notebooks.photometry",nb_name:"01-viewer-seeing-template.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"01 Seeing Profile"}),o.commands.addCommand("astronbs:02_comp_stars",{execute:()=>{const o=d("nb_make",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"stellarphot.notebooks.photometry",nb_name:"02-comp-star-plotter-template.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"02 Comparison Stars"}),o.commands.addCommand("astronbs:03_do_photometry",{execute:()=>{const o=d("nb_make",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"stellarphot.notebooks.photometry",nb_name:"03-photometry-template.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"03 Do photometry"}),o.commands.addCommand("astronbs:transform_pared_back",{execute:()=>{const o=d("nb_make",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"stellarphot.notebooks.photometry",nb_name:"transform-pared-back.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"04 Transform photometry"}),o.commands.addCommand("astronbs:05_relative_flux",{execute:()=>{const o=d("nb_make",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"stellarphot.notebooks.photometry",nb_name:"05-relative-flux-calculation-template.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"05 Relative flux"}),o.commands.addCommand("astronbs:06_transit_fitting",{execute:()=>{const o=d("nb_make",{body:JSON.stringify({path:a.defaultBrowser.model.path,package_path:"stellarphot.notebooks.photometry",nb_name:"06-transit-fit-template.ipynb"}),method:"POST"});console.log(o),o.then((o=>{console.log(o),n&&n.open(o.path)}))},icon:m.imageIcon,label:"06 Transit fitting"}),t&&(t.add({command:"astronbs:reduction_template",category:"Astro",rank:0}),t.add({command:"astronbs:reprojection_template",category:"Astro",rank:10}),t.add({command:"astronbs:light_combo_template",category:"Astro",rank:20}),t.add({command:"astronbs:01_seeing_profile",category:"Photometry",rank:0}),t.add({command:"astronbs:02_comp_stars",category:"Photometry",rank:0}),t.add({command:"astronbs:03_do_photometry",category:"Photometry",rank:0}),t.add({command:"astronbs:transform_pared_back",category:"Photometry",rank:0}),t.add({command:"astronbs:05_relative_flux",category:"Photometry",rank:0}),t.add({command:"astronbs:06_transit_fitting",category:"Photometry",rank:0})),d("get_example").then((o=>{console.log(o)})).catch((o=>{console.error(`The astronbs server extension appears to be missing.\n${o}`)}))}},i=p}}]);