import{r as t,h as s,H as i}from"./p-d55626d1.js";import{c as r}from"./p-2fd22ed9.js";import"./p-0bc4f624.js";import"./p-9bfc48ee.js";import{s as a}from"./p-62c3d279.js";const e=class{constructor(s){t(this,s),this.data=null}async componentWillLoad(){this.query&&this.fetchData()}async fetchData(){this.data=await r.client.query({query:a(this.query)})}renderData(){if(!this.query)return"No query.";if(this.renderer)this.data||this.renderer({loading:!0}),this.data&&this.renderer({loading:!1,data:this.data});else{if(!this.data)return"Loading...";if(this.data)return JSON.stringify(this.data)}}render(){return s(i,null,this.renderData())}static get watchers(){return{query:["fetchData"]}}};export{e as corejam_data_fetcher}