{
  "version": 3,
  "sources": ["/cdn/shop/t/35/assets/quantity-popover.js?blabla=14hw86xa2q"],
  "sourcesContent": ["if (!customElements.get('quantity-popover')) {\n  customElements.define(\n    'quantity-popover',\n    class QuantityPopover extends HTMLElement {\n      constructor() {\n        super();\n        this.mql = window.matchMedia('(min-width: 1025px)');\n        this.mqlTablet = window.matchMedia('(min-width: 768px)');\n        this.infoButtonDesktop = this.querySelector('.quantity-popover__info-button--icon-only');\n        this.infoButtonMobile = this.querySelector('.quantity-popover__info-button--icon-with-label');\n        this.popoverInfo = this.querySelector('.quantity-popover__info');\n        this.closeButton = this.querySelector('.button-close');\n        this.variantInfo = this.querySelector('.quantity-popover-container');\n\n        if (this.closeButton) {\n          this.closeButton.addEventListener('click', this.closePopover.bind(this));\n        }\n\n        if (this.popoverInfo && this.infoButtonDesktop && this.mql.matches) {\n          this.popoverInfo.addEventListener('mouseenter', this.closePopover.bind(this));\n        }\n\n        if (this.infoButtonDesktop) {\n          this.infoButtonDesktop.addEventListener('click', this.togglePopover.bind(this));\n          this.infoButtonDesktop.addEventListener('focusout', this.closePopover.bind(this));\n        }\n\n        if (this.infoButtonMobile) {\n          this.infoButtonMobile.addEventListener('click', this.togglePopover.bind(this));\n          this.infoButtonMobile.addEventListener('focusout', this.closePopover.bind(this));\n        }\n        if (this.infoButtonDesktop && this.mqlTablet.matches) {\n          this.variantInfo.addEventListener('mouseenter', this.togglePopover.bind(this));\n          this.variantInfo.addEventListener('mouseleave', this.closePopover.bind(this));\n        }\n      }\n\n      togglePopover(event) {\n        event.preventDefault();\n\n        const button = this.infoButtonDesktop && this.mql.matches ? this.infoButtonDesktop : this.infoButtonMobile;\n        const isExpanded = button.getAttribute('aria-expanded') === 'true';\n\n        button.setAttribute('aria-expanded', !isExpanded);\n\n        this.popoverInfo.toggleAttribute('hidden');\n\n        const isOpen = button.getAttribute('aria-expanded') === 'true';\n\n        button.classList.toggle('quantity-popover__info-button--open');\n\n        if (isOpen && event.type !== 'mouseenter') {\n          button.focus();\n        }\n      }\n\n      closePopover(event) {\n        event.preventDefault();\n        const isChild = this.variantInfo.contains(event.relatedTarget);\n\n        const button = this.infoButtonDesktop && this.mql.matches ? this.infoButtonDesktop : this.infoButtonMobile;\n\n        if (!event.relatedTarget || !isChild) {\n          button.setAttribute('aria-expanded', 'false');\n          button.classList.remove('quantity-popover__info-button--open');\n          this.popoverInfo.setAttribute('hidden', '');\n        }\n      }\n    }\n  );\n}\n"],
  "mappings": "AAAK,eAAe,IAAI,kBAAkB,GACxC,eAAe,OACb,mBACA,cAA8B,WAAY,CACxC,aAAc,CACZ,MAAM,EACN,KAAK,IAAM,OAAO,WAAW,qBAAqB,EAClD,KAAK,UAAY,OAAO,WAAW,oBAAoB,EACvD,KAAK,kBAAoB,KAAK,cAAc,2CAA2C,EACvF,KAAK,iBAAmB,KAAK,cAAc,iDAAiD,EAC5F,KAAK,YAAc,KAAK,cAAc,yBAAyB,EAC/D,KAAK,YAAc,KAAK,cAAc,eAAe,EACrD,KAAK,YAAc,KAAK,cAAc,6BAA6B,EAE/D,KAAK,aACP,KAAK,YAAY,iBAAiB,QAAS,KAAK,aAAa,KAAK,IAAI,CAAC,EAGrE,KAAK,aAAe,KAAK,mBAAqB,KAAK,IAAI,SACzD,KAAK,YAAY,iBAAiB,aAAc,KAAK,aAAa,KAAK,IAAI,CAAC,EAG1E,KAAK,oBACP,KAAK,kBAAkB,iBAAiB,QAAS,KAAK,cAAc,KAAK,IAAI,CAAC,EAC9E,KAAK,kBAAkB,iBAAiB,WAAY,KAAK,aAAa,KAAK,IAAI,CAAC,GAG9E,KAAK,mBACP,KAAK,iBAAiB,iBAAiB,QAAS,KAAK,cAAc,KAAK,IAAI,CAAC,EAC7E,KAAK,iBAAiB,iBAAiB,WAAY,KAAK,aAAa,KAAK,IAAI,CAAC,GAE7E,KAAK,mBAAqB,KAAK,UAAU,UAC3C,KAAK,YAAY,iBAAiB,aAAc,KAAK,cAAc,KAAK,IAAI,CAAC,EAC7E,KAA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