System.register(["./p-c4df9d4b.system.js","./p-6d4bc86a.system.js","./p-0bbf3c73.system.js","./p-1f1c7f78.system.js","./p-637a7d5a.system.js","./p-118612f6.system.js","./p-dfb1d72b.system.js","./p-5a06f6ce.system.js","./p-a0c1f16a.system.js","./p-e2e7329f.system.js","./p-ac291838.system.js","./p-23628d1c.system.js","./p-e847e88b.system.js","./p-58f2f536.system.js","./p-d86a8e66.system.js","./p-3bb22ffb.system.js","./p-8fde6e09.system.js","./p-a333270e.system.js"],(function(e){"use strict";var n,t,r,i,o,s,a,c,d,u,p,f,m,l,v,w;return{setters:[function(e){n=e.r;t=e.h;r=e.H},function(e){i=e.i},function(e){o=e.D},function(e){s=e.S;a=e.a},function(e){c=e.T},function(e){d=e.F;u=e.M},function(e){p=e.V},function(e){f=e.A},function(e){m=e.I},function(){},function(e){l=e.D;v=e.a},function(e){w=e.D},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var y=function(){function e(e){this.api=e}e.prototype.onSubmit=function(e){var n=this;var t=e.detail.values,r=t.name,i=t.workspaceId,o=t.type;return new Promise((function(e,t){n.api.createProduct(r,i,o).then((function(){e({events:[new m("","")],navigation:{type:"navigation",direction:"back"}})})).catch((function(){t(["Unexpected error"])}))}))};return e}();var h={"devingen-workspaces":w.decode({_id:"devingen-workspaces",base:"devingen-dev",fields:[new l("_created","Created").setDataType(v.Unix).setDateFormat("DD MMM YYYY HH:mm"),new c("name","Name")],name:"devingen-workspaces"})};var b="new-product-form";var g=function(e){return d.decode({_id:b,base:"devingen-dev",title:"New domain",table:h["devingen-workspaces"],type:f.FormView,handler:new y(e),ui:{fields:[{field:new o("workspaceId")},{field:new c("name","Name").addInterceptor("onSubmit",new p(2,32)).addInterceptor("onSubmit",new u).require()},{field:new s("type","Product Type",[new a("Damga","damga",undefined,"Proxy service that generates SSL certificate for your domains.")],"","radioCard").require()}]}})};var k=function(){function e(e){this.api=e}e.prototype.onSubmit=function(e){var n=this;var t=e.detail.values.name;return new Promise((function(e,r){n.api.createWorkspace(t).then((function(){e({events:[new m("","")],navigation:{type:"navigation",direction:"back"}})})).catch((function(){r(["Unexpected error"])}))}))};return e}();var S="new-workspace-form";var j=function(e){return d.decode({_id:S,base:"devingen-dev",title:"New domain",table:h["devingen-workspaces"],type:f.FormView,handler:new k(e),ui:{fields:[{field:new c("name","Name").addInterceptor("onSubmit",new p(2,32)).addInterceptor("onSubmit",new u).require()}]}})};var C=e("devingen_home_page",function(){function e(e){n(this,e);this.isCreateWorkspaceFormShown=false;this.isCreateProductFormShown=false}e.prototype.onInvalidation=function(e){this.isCreateWorkspaceFormShown=false;this.isCreateProductFormShown=false};e.prototype.componentWillLoad=function(){};e.prototype.render=function(){var e=this;var n=this,i=n.isCreateProductFormShown,o=n.isCreateWorkspaceFormShown,s=n.products,a=n.selectedWorkspaceToCreateProduct,c=n.workspaceOwnerships;if(!c||!s){return t("div",{class:"d-flex justify-content-center pt-3"},t("dvn-progress",{indefinite:true}))}return t(r,null,t("div",{class:"container"},t("div",{class:"row"},c.map((function(n){var r=n.workspace;return t("div",{class:"col-sm-12"},t("h2",{class:"mt-3"},r.name),t("div",{class:"row"},s.filter((function(e){return e.workspace._id===r._id})).map((function(e){return t("div",{class:"col-sm-12 col-md-4 mb-3"},t("stencil-route-link",{url:"/products/"+e._id},t("dvn-card",{bodyLeaned:true,elevation:0,leaned:true,selectable:true,tint:"primary"},t("devingen-product-card",{product:e}))))})),t("div",{class:"col-sm-12 col-md-4"},t("dvn-card",{bodyLeaned:true,elevation:0,leaned:true,selectable:true,tint:"primary"},t("devingen-product-card",{onClick:function(){e.isCreateProductFormShown=true;e.selectedWorkspaceToCreateProduct=r._id}})))))}))),t("div",{class:"row"},t("div",{class:"col-sm-12 col-md-4 mt-3 pt-3"},t("dvn-button",{leaned:true,onClick:function(){return e.isCreateWorkspaceFormShown=true},view:"flat"},t("dvn-icon",{iconName:"uil uil-plus"}),"Add new workspace")))),o&&t("dvn-dialog",{raw:true,shown:true,onDismiss:function(){return e.isCreateWorkspaceFormShown=false}},t("dvn-app-view-form-view",{view:j(this.apiDevingen)})),i&&t("dvn-dialog",{raw:true,shown:true,onDismiss:function(){return e.isCreateProductFormShown=false}},t("dvn-app-view-form-view",{view:g(this.apiDevingen),params:{workspaceId:a,type:"damga"}})))};return e}());i(C)}}}));