var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):o(t.value).then(a,c)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(e){return u([t,e])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;o=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-102043e0.js";import{P as Product}from"./product-053ff543.js";import"./User-d2ee8b71.js";import"./data-model-f5160369.js";var DevingenProductPage=function(){function t(t){var e=this;registerInstance(this,t);this.fetchProduct=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;var r=this;return __generator(this,(function(n){switch(n.label){case 0:t=this.match.params.id;return[4,this.apiDevingen.getProduct(t).catch((function(t){return r.error=t}))];case 1:e=n.sent();if(!e)return[2];this.product=Product.decode(e);return[2]}}))}))}}t.prototype.componentWillLoad=function(){this.fetchProduct()};t.prototype.render=function(){var t=this,e=t.apiData,r=t.apiDevingen,n=t.product,o=t.products,i=t.workspaceOwnerships;if(!n){return h("div",{class:"d-flex justify-content-center pt-3"},h("dvn-progress",{indefinite:true}))}var a="devingen-product-root-"+n.type;return h(Host,null,h(a,{apiData:e,apiDevingen:r,product:n,products:o,workspaceOwnerships:i}))};return t}();export{DevingenProductPage as devingen_product_page};