{
  "version": 3,
  "sources": ["/cdn/shop/t/65/assets/core.js"],
  "sourcesContent": ["const BIND_EXCLUDED_METHODS = {\n  constructor: true,\n  render: true\n}\n\nclass Core extends HTMLElement {\n  static autobind = true;\n\n  constructor() {\n    super();\n    this.sectionId = this.getAttribute('section-id');\n    if (typeof this.onIntersect == 'function') {\n      this.observer = new IntersectionObserver((entries) => {\n        this.onIntersect(entries[0].isIntersecting);\n      })\n      this.observer.observe(this);\n    }\n    this._subs = {};\n  }\n\n  subscribe(eventName, options) {\n    const handler = this.subscriptions[eventName];\n    const handleFn = e => {\n      if(options?.global || this.sectionId && this.sectionId === e.detail.sectionId) {\n          const handler = this.subscriptions[eventName];\n          this[handler](e.detail.data, e.detail.sectionId, e);\n        }\n    };\n\n    this._subs[handler] = handleFn.bind(this);\n\n    document.addEventListener(eventName, this._subs[handler], {\n      once: !!options?.once,\n      capture: true\n    })\n  }\n\n  async publish(eventName, data) {\n    const { publishEvent } = await importModule('Utils');\n    publishEvent(eventName, data, this.sectionId)\n  }\n\n  getParentSection() {\n    return document.getElementById(`shopify-section-${this.sectionId}`)\n  }\n\n  connectedCallback() {\n    if (this.elements) {\n      for (const [key, value] of Object.entries(this.elements)) {\n        this[`$${key}`] = value[0] === \"*\" \n          ? Array.from(this.querySelectorAll(value.substring(1)))\n          : this.querySelector(value);\n      }\n    }\n\n    if (typeof this.render == 'function') {\n      this.render();\n    }\n  }\n\n  disconnectedCallback() {\n    if(typeof this.disconnect == 'function') {\n      this.disconnect();\n    }\n    if (this.subscriptions) {\n      for (const [key, value] of Object.entries(this.subscriptions)) {\n        if(typeof this._subs[value] == 'function') {\n          document.removeEventListener(key, this._subs[value], true); \n        }\n      }\n    }\n   }\n\n  reRender(doc, selector, root) {\n    if(!selector) {\n      selector = `${this.tagName}[section-id=\"${this.sectionId}\"]`;\n    }\n    if(!root) {\n      root = this;\n    }\n    const target = doc.querySelector(selector);\n    root.replaceChildren(...target.cloneNode(true).childNodes);\n  }\n\n  $get(el,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