'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-1ee80297.js');
const product = require('./product-0222e027.js');
require('./User-286a0714.js');
require('./data-model-c51de090.js');

let DevingenProductPage = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.fetchProduct = async () => {
      const { id } = this.match.params;
      const productResponse = await this.apiDevingen.getProduct(id).catch((e) => this.error = e);
      if (!productResponse)
        return;
      this.product = product.Product.decode(productResponse);
    };
  }
  componentWillLoad() {
    this.fetchProduct();
  }
  render() {
    const { apiData, apiDevingen, product, products, workspaceOwnerships } = this;
    if (!product) {
      return (index.h("div", { class: "d-flex justify-content-center pt-3" }, index.h("dvn-progress", { indefinite: true })));
    }
    const Tag = `devingen-product-root-${product.type}`;
    return (index.h(index.Host, null, index.h(Tag, { apiData: apiData, apiDevingen: apiDevingen, product: product, products: products, workspaceOwnerships: workspaceOwnerships })));
  }
};

exports.devingen_product_page = DevingenProductPage;
