export const __webpack_esm_id__=79222;export const __webpack_esm_ids__=[79222];export const __webpack_esm_modules__={79222(e,t,r){r.r(t),r.d(t,{graphql_playground_component:()=>c});var i=r(61980);class o{static loadJavaScript(e,t=!1){return new Promise((r,i)=>{if(document.querySelector(`script[src="${e}"]`))r();else{const o=document.createElement("script");o.setAttribute("src",e),o.async=t,o.addEventListener("load",()=>r()),o.addEventListener("error",()=>{console.error(`Failed to load script: ${e}`),i(new Error(`Failed to load script: ${e}`))}),document.head.appendChild(o)}})}static loadCss(e){return new Promise(t=>{if(!document.querySelector(`link[href="${e}"]`)){const t=document.createElement("link");t.setAttribute("href",e),t.rel="stylesheet",t.type="text/css",document.head.appendChild(t)}t()})}}class a{static toFetcherConfiguration(e){return{url:e.endpoint,headers:e.headers,onAbortQuery:e.onAbortQuery}}}class n{static toGraphiQLConfiguration(e){return{defaultEditorToolsVisibility:!1,selectedLanguage:e.selectedLanguage,editorTheme:e.editorsThemeName,defaultQuery:e.defaultQuery,translations:e.translations,fetcher:window.GraphiQL.createFetcher(a.toFetcherConfiguration(e)),plugins:[window.GraphiQLPluginExplorer.explorerPlugin()]}}}class s{constructor(e){this.endpoint=e.endpoint,this.headers=e.headers,this.selectedLanguage=e.selectedLanguage||"en",this.translations=e.translations,this.defaultQuery=e.defaultQuery||" ",this.editorsThemeName=e.editorsThemeName}}const c=class{constructor(e){(0,i.r)(this,e),this.abortQuery=(0,i.c)(this,"abortQuery",7),this.configuration=void 0}configurationChanged(e){this.init(e)}setLanguage(e){return this.graphiQlConfiguration&&(this.graphiQlConfiguration.selectedLanguage=e||"en",this.renderGraphiQL()),Promise.resolve()}setEditorsTheme(e="graphiql"){return this.graphiQlConfiguration&&(this.graphiQlConfiguration.editorTheme=e,this.renderGraphiQL()),Promise.resolve()}async componentWillLoad(){const e="./assets/";try{await o.loadJavaScript((0,i.g)(`${e}react.development.js`)),await o.loadJavaScript((0,i.g)(`${e}react-dom.development.js`)),await o.loadJavaScript((0,i.g)(`${e}graphiql.min.js`)),await o.loadJavaScript((0,i.g)(`${e}explorer.index.umd.js`)),await o.loadCss((0,i.g)(`${e}graphiql.min.css`)),await o.loadCss((0,i.g)(`${e}explorer.style.css`))}catch(e){console.error("Error loading assets:",e)}}componentDidLoad(){setTimeout(()=>{this.configuration?this.init(this.configuration):console.error("Configuration is undefined")},500)}disconnectedCallback(){this.reactRoot&&(this.reactRoot.unmount(),this.reactRoot=null)}render(){return(0,i.h)(i.H,{key:"1da0db9d63a0b243e97e1ab9255f03f842c54eec"},(0,i.h)("div",{key:"15c0f880b166f62a7485d572f214ce464cc3cf8a",id:"graphiql"},"Loading..."))}init(e){const t=new s(e);t.onAbortQuery=e=>this.abortQuery.emit(e);const r=document.querySelector("graphql-playground-component #graphiql");r?(this.reactRoot||(this.reactRoot=window.ReactDOM.createRoot(r)),this.graphiQlConfiguration=n.toGraphiQLConfiguration(t),this.renderGraphiQL()):console.error("Container element not found")}renderGraphiQL(){this.reactRoot.render(window.React.createElement(window.GraphiQL,this.graphiQlConfiguration))}static get assetsDirs(){return["assets"]}static get watchers(){return{configuration:["configurationChanged"]}}};c.style="graphql-playground-component{display:block;height:100vh}#graphiql{display:block;height:100%}"}};
//# sourceMappingURL=79222.fef49332afa9b6099cef.bundle.js.map