import{r as registerInstance,h,H as Host}from"./index-ecdfb761.js";import{d as dark}from"./dark-51789ed8.js";import{D as DataApiImpl}from"./dataApi-c77b0bad.js";import{K as KimlikApiImpl}from"./kimlik-api-66e341bd.js";import{i as isUserLoggedIn}from"./index-7d83a942.js";import{C as CookieStorage}from"./cookie-9f22e0fb.js";import{A as APIBase}from"./apiBase-648a161d.js";import{p as prod}from"./services-68676f67.js";import{l as light}from"./light-e0bd183b.js";import{w as watchDeviceAppearance}from"./theme-a6597800.js";import"./colors-4dc9e03b.js";import"./data-transfer-field-2f305919.js";import"./BaseField-0b01dc2c.js";import"./filter-cbaa3d7d.js";import"./_commonjsHelpers-27f122dd.js";var DevingenApi=function(){function t(t,e){var r=this;if(e===void 0){e={}}this.createProduct=function(t){return r.api.post("products",t)};this.getProducts=function(t){if(t===void 0){t={}}return r.api.get("products",t)};this.getProduct=function(t){return r.api.get("products/".concat(t))};this.updateProduct=function(t,e){return r.api.put("products/".concat(t),e)};this.deleteProduct=function(t){return r.api.delete("products/".concat(t))};this.createWorkspace=function(t){return r.api.post("workspaces",{name:t})};this.updateWorkspace=function(t,e){return r.api.put("workspaces/".concat(t),e)};this.deleteWorkspace=function(t){return r.api.delete("workspaces/".concat(t))};this.getWorkspaceOwnerships=function(){return r.api.get("workspace-ownerships")};this.createProductSettingsKimlik=function(t,e,i,o){return r.api.post("product-settings-kimlik",{product:{_id:t},databaseProduct:{_id:e},webhookAddress:i,headers:o})};this.findProductSettingsKimlik=function(t){return r.api.get("product-settings-kimlik",{productId:t})};this.createProductSettingsTaban=function(t){return r.api.post("product-settings-taban",{product:{_id:t}})};this.findProductSettingsTaban=function(t){return r.api.get("product-settings-taban",{productId:t})};this.api=new APIBase(t,e)}return t}();var wrapContent=function(t,e){return h(Host,null,h("dvn-theme-provider",{theme:t,colorBackground:true,fitHeight:true},h("dvn-global-table",null),h("dvn-global-grid",null),h("dvn-global-text",null),h("notifier-wrapper",null,e)))};var DevingenRoot=function(){function t(t){registerInstance(this,t);this.theme=light}t.prototype.componentWillLoad=function(){var t=this;if(watchDeviceAppearance((function(e){return t.theme=e==="dark"?dark:light}))==="dark"){this.theme=dark}};t.prototype.render=function(){var t=this.theme;var e=(new CookieStorage).getAll().jwt;var r={Authorization:e?"Bearer ".concat((new CookieStorage).getAll().jwt):undefined};var i=new KimlikApiImpl("".concat(prod.kimlik,"/").concat(prod.base),r);var o=new DataApiImpl("".concat(prod.data,"/").concat(prod.base),r);var n=new DevingenApi(prod.devingen,r);if(!isUserLoggedIn()){return wrapContent(t,h("devingen-login-page",{apiKimlik:i}))}return wrapContent(t,h("devingen-router",{apiKimlik:i,apiDevingen:n,apiData:o}))};return t}();export{DevingenRoot as devingen_root};