{
  "version": 3,
  "sources": ["/cdn/shop/t/1064/assets/component-product-image-zoom.js?auto=format%2Ccompress"],
  "sourcesContent": ["if ( typeof ProductImageZoom !== 'function' ) {\n\tclass ProductImageZoom extends HTMLElement {\n\n\t\tconstructor(){\n\n\t\t\tsuper();\n\n\t\t\tif ( ! document.getElementById('zoom') ) {\n\t\t\t\tthis.zoom = document.createElement('div');\n\t\t\t\tthis.zoom.id = 'zoom';\n\t\t\t\tthis.zoom.innerHTML = `\n\t\t\t\t\t<img />\n\t\t\t\t\t<span class=\"zoom__exit\"><svg width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\"><path style=\"fill:none\" d=\"M6 6L18 18\" stroke=\"#000\" stroke-linecap=\"round\"></path><path style=\"fill:none\" d=\"M18 6L6.00001 18\" stroke=\"#000\" stroke-linecap=\"round\"></path></svg></span>\n\t\t\t\t\t<span class=\"zoom__loader\">${KROWN.settings.symbols.zoom_loader}</span>\n\t\t\t\t\t<div class=\"zoom__overlay\"></div>\n\t\t\t\t`;\n\t\t\t\tdocument.body.append(this.zoom);\n\t\t\t\tthis.zoom.querySelector('.zoom__exit').addEventListener('click', this._productZoomUnmount.bind(this));\n\t\t\t\t/* Contained lightbox (Owen 2026-10-15): backdrop click and Esc close it. */\n\t\t\t\tthis.zoom.querySelector('.zoom__overlay').addEventListener('click', this._productZoomUnmount.bind(this));\n\t\t\t\tdocument.addEventListener('keydown', (e)=>{\n\t\t\t\t\tif ( e.key === 'Escape' && this.zoom.classList.contains('opened') ) {\n\t\t\t\t\t\tthis._productZoomUnmount();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.zoom = document.getElementById('zoom');\n\t\t\t}\n\n\t\t\tthis.onResizeHandlerBinded = this.onResizeHandler.bind(this);\n\n\t\t\tthis.addEventListener('click', (e)=>{\n\t\t\t\tthis.zoom.classList.add('opened');\n\t\t\t\tthis.image = this.zoom.querySelector('img');\n\t\t\t\tthis.image.src = this.getAttribute('data-image');\n\t\t\t\tif ( this.image.naturalWidth > 0 ) {\n\t\t\t\t\tthis._productZoomMount();\n\t\t\t\t} else {\n\t\t\t\t\tthis.image.addEventListener('load', this._productZoomMount.bind(this));\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\n\t\tonResizeHandler(){\n\n\t\t\t/* Contained lightbox (Owen 2026-10-15): the image FITS the viewport\n\t\t\t   (centered, with breathing room) and never upscales past its native\n\t\t\t   pixels \u2014 replaces the old pan-zoom, which painted every image at\n\t\t\t   >=viewport size (x2 on mobile) and blurred the small supplier\n\t\t\t   files blanks ship (hats/tees are 500x625 originals). */\n\t\t\tconst pad = 48;\n\t\t\tconst ratio = parseFloat( this.image.dataset.ratio );\n\t\t\tconst maxW = window.innerWidth - pad * 2;\n\t\t\tconst maxH = window.innerHeight - pad * 2;\n\t\t\tlet w = Math.min( this.image.naturalWidth || maxW, maxW, maxH * ratio );\n\t\t\tw = Math.max( 1, w );\n\t\t\tconst h = w / ratio;\n\t\t\tthis.image.style.width = w + 'px';\n\t\t\tthis.image.style.height = h + 'px';\n\t\t\t/* centering is CSS (50%/50% + translate) so it holds on every screen;\n\t\t\t   the vars anchor the X button to the image's top-right corner */\n\t\t\tthis.zoom.style.setProperty( '--zi-w', w + 'px' );\n\t\t\tthis.zoom.style.setProperty( '--zi-h', h + 'px' );\n\n\t\t}\n\n\t\t_productZoomMount(image) {\n\n\t\t\tthis.image.dataset.ratio = this.image.naturalWidth / this.image.naturalHeight;\n\t\t\twindow.addEventListener('resize', this.onResizeHandlerBinded, {passive:true});\n\t\t\tthis.onResizeHandler();\n\n\t\t\tsetTimeout(()=>{\n\t\t\t\tthis.zoom.classList.add('loaded');\n\t\t\t}, 50);\n\n\t\t}\n\n\t\t_productZoomUnmount() {\n\n\t\t\tthis.zoom.classList.remove('opened');\n\n\t\t\tsetTimeout(()=>{\n\t\t\t\twindow.removeEventListener('resize', this.onResizeHandlerBinded);\n\t\t\t\tconst image = document.querySelector('#zoom img');\n\t\t\t\timage.src = '';\n\t\t\t\timage.className = '';\n\t\t\t\timage.style = '';\n\t\t\t\tthis.zoom.classList.remove('loaded');\n\t\t\t}, 300);\n\n\t\t}\n\n\t}\n\n  if ( typeof customElements.get('product-image-zoom') == 'undefined' ) {\n\t\tcustomElements.define('product-image-zoom', ProductImageZoom);\n\t}\n\n}"],
  "mappings": "AAAA,GAAK,OAAO,kBAAqB,WAAa,CAC7C,MAAMA,0BAAyB,WAAY,CAE1C,aAAa,CAEZ,MAAM,EAEC,SAAS,eAAe,MAAM,EAmBpC,KAAK,KAAO,SAAS,eAAe,MAAM,GAlB1C,KAAK,KAAO,SAAS,cAAc,KAAK,EACxC,KAAK,KAAK,GAAK,OACf,KAAK,KAAK,UAAY;AAAA;AAAA;AAAA,kCAGQ,MAAM,SAAS,QAAQ,WAAW;AAAA;AAAA,MAGhE,SAAS,KAAK,OAAO,KAAK,IAAI,EAC9B,KAAK,KAAK,cAAc,aAAa,EAAE,iBAAiB,QAAS,KAAK,oBAAoB,KAAK,IAAI,CAAC,EAEpG,KAAK,KAAK,cAAc,gBAAgB,EAAE,iBAAiB,QAAS,KAAK,oBAAoB,KAAK,IAAI,CAAC,EACvG,SAAS,iBAAiB,UAAY,GAAI,CACpC,EAAE,MAAQ,UAAY,KAAK,KAAK,UAAU,SAAS,QAAQ,GAC/D,KAAK,oBAAoB,CAE3B,CAAC,GAKF,KAAK,sBAAwB,KAAK,gBAAgB,KAAK,IAAI,EAE3D,KAAK,iBAAiB,QAAU,GAAI,CACnC,KAAK,KAAK,UAAU,IAAI,QAAQ,EAChC,KAAK,MAAQ,KAAK,KAAK,cAAc,KAAK,EAC1C,KAAK,MAAM,IAAM,KAAK,aAAa,YAAY,EAC1C,KAAK,MAAM,aAAe,EAC9B,KAAK,kBAAkB,EAEvB,KAAK,MAAM,iBAAiB,OAAQ,KAAK,kBAAkB,KAAK,IAAI,CAAC,CAEvE,CAAC,C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