isOutOfStock(product)}>
                Add to cart
              </button>
            </li>`)}
          </ul>
        `;
      }
    }
  }

  customElements.define('product-list-component', ProductListElement);

  class CartElement extends ReactiveElement {
    cartItems = [];
    onConnect() {
      CartStore.subscribe(state => {
        this.cartItems = state.cartItems;
      });
    }

    template() {
      return html`
        ${this.cartItems.length > 0 ? html`
          <p>Cart value: ${(this.cart