/** Shopify CDN: Minification failed

Line 17:2 Unexpected "constructor("
Line 18:4 Expected identifier but found "super("
Line 20:4 Comments in CSS use "/* ... */" instead of "//"
Line 20:73 Unterminated string token
Line 23:2 Unexpected "open("
Line 24:4 Comments in CSS use "/* ... */" instead of "//"
Line 28:2 Unexpected "close("
Line 29:4 Comments in CSS use "/* ... */" instead of "//"
Line 33:2 Unexpected "renderContents("
Line 34:8 Expected ":"
... and 14 more hidden warnings

**/
class CartNotification extends HTMLElement {
  constructor() {
    super();

    // Removed all event listeners because we don't need the notification
  }

  open() {
    // Disabled: No pop-up will open
    return;
  }

  close() {
    // Disabled: No pop-up to close
    return;
  }

  renderContents(parsedState) {
    this.cartItemKey = parsedState.key;
    this.getSectionsToRender().forEach((section) => {
      document.getElementById(section.id).innerHTML = this.getSectionInnerHTML(
        parsedState.sections[section.id],
        section.selector
      );
    });

    if (this.header) this.header.reveal();

    // Disabled: No pop-up to open
    // this.open();
  }

  getSectionsToRender() {
    return [
      {
        id: 'cart-icon-bubble',
      },
    ];
  }

  getSectionInnerHTML(html, selector = '.shopify-section') {
    return new DOMParser().parseFromString(html, 'text/html').querySelector(selector).innerHTML;
  }

  handleBodyClick(evt) {
    return; // Disabled
  }

  setActiveElement(element) {
    this.activeElement = element;
  }
}

customElements.define('cart-notification', CartNotification);
