{
  "version": 3,
  "sources": ["/cdn/shop/t/16/assets/image-comparison.js?plm=20260721a"],
  "sourcesContent": ["if (!customElements.get(\"m-image-comparison\")) {\n  class MImageComparison extends HTMLElement {\n    constructor() {\n      super();\n      this.active = false;\n      this.button = this.querySelector(\"button\");\n      this.horizontal = this.dataset.layout === \"horizontal\";\n      this.autoEnabled = this.dataset.autoSlide === \"true\";\n      this.autoCycle = Math.max(4, Number(this.dataset.autoSlideSpeed) || 8) * 1000;\n      this.autoPercent = 50;\n      this.autoDirection = 1;\n      this.autoTimer = null;\n      this.autoResumeTimer = null;\n      this.autoLastTime = null;\n      this.autoVisible = false;\n      this.autoPaused = false;\n      this.reducedMotion = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n      this.init();\n      if (this.hasAttribute(\"data-animation\")) {\n        MinimogTheme.initWhenVisible({\n          element: this.querySelector(\".m-image-comparison__slider-animation\"),\n          callback: this.animation.bind(this),\n          threshold: 0,\n        });\n      }\n    }\n\n    init() {\n      this.button.addEventListener(\"touchstart\", this.start.bind(this));\n      document.body.addEventListener(\"touchend\", this.end.bind(this));\n      document.body.addEventListener(\"touchmove\", this.onStart.bind(this));\n\n      this.button.addEventListener(\"mousedown\", this.start.bind(this));\n      document.body.addEventListener(\"mouseup\", this.end.bind(this));\n      document.body.addEventListener(\"mousemove\", this.onStart.bind(this));\n\n      if (this.autoEnabled && !this.reducedMotion) {\n        this.addEventListener(\"mouseenter\", () => this.pauseAuto());\n        this.addEventListener(\"mouseleave\", () => this.resumeAuto(800));\n        this.addEventListener(\"focusin\", () => this.pauseAuto());\n        this.addEventListener(\"focusout\", () => this.resumeAuto(800));\n        document.addEventListener(\"visibilitychange\", () => {\n          if (document.hidden) {\n            this.pauseAuto();\n          } else {\n            this.resumeAuto(600);\n          }\n        });\n\n        this.autoObserver = new IntersectionObserver(\n          ([entry]) => {\n            this.autoVisible = entry.isIntersecting;\n            if (this.autoVisible) {\n              this.resumeAuto(2500);\n            } else {\n              this.pauseAuto(false);\n            }\n          },\n          { threshold: 0.2 }\n        );\n        this.autoObserver.observe(this);\n      }\n    }\n\n    animation() {\n      this.setAttribute(\"is-visible\", \"\");\n      this.classList.add(\"m-animating\");\n      setTimeout(() => {\n        this.classList.remove(\"m-animating\");\n      }, 1e3);\n    }\n\n    start() {\n      document.documentElement.classList.add(\"prevent-scroll\");\n      this.active = true;\n      this.classList.add(\"image-comparing\");\n      this.pauseAuto();\n    }\n\n    end() {\n      document.body.style.removeProperty(\"padding-right\");\n      document.documentElement.classList.remove(\"prevent-scroll\");\n      this.active = false;\n      this.classList.remove(\"image-comparing\");\n      this.resumeAuto(2500);\n    }\n\n    onStart(e) {\n      if (!this.active) return;\n      const event = (e.touches && e.touches[0]) || e;\n      const x = this.horizontal ? event.pageX - this.offsetLeft : event.pageY - this.offsetTop;\n      this.scroll(x);\n    }\n\n    scroll(x) {\n      const distance = this.horizontal ? this.clientWidth : this.clientHeight;\n      const max = distance - 20;\n      const min = 20;\n      const mouseX = Math.max(min, Math.min(x, max));\n      const mousePercent = (mouseX * 100) / distance;\n      this.setPercent(mousePercent);\n    }\n\n    setPercent(percent) {\n      this.autoPercent = Math.max(20, Math.min(percent, 80));\n      this.style.setProperty(\"--percent\", this.autoPercent + \"%\");\n    }\n\n    pauseAuto(markPaused = true) {\n      if (markPaused) this.autoPaused = true;\n      clearTimeout(this.autoResumeTimer);\n      clearInterval(this.autoTimer);\n      this.autoTimer = null;\n      this.autoLastTime = null;\n    }\n\n    resumeAuto(delay = 0) {\n      if (!this.autoEnabled || this.reducedMotion || !this.autoVisible || document.hidden) return;\n      clearTimeout(this.autoResumeTimer);\n      this.autoResumeTimer = setTimeout(() => {\n        if (this.active || this.matches(\":hover\") || this.matches(\":focus-within\")) return;\n        this.autoPaused = false;\n        this.autoLastTime = null;\n        if (!this.autoTimer) {\n          this.autoLastTime = performance.now();\n          this.autoTimer = setInterval(() => this.autoSlide(performance.now()), 120);\n        }\n      }, delay);\n    }\n\n    autoSlide(time) {\n      if (this.autoPaused || !this.autoVisible || document.hidden) {\n        clearInterval(this.autoTimer);\n        this.autoTimer = null;\n        this.autoLastTime = null;\n        return;\n      }\n\n      if (this.autoLastTime !== null) {\n        const oneWayDuration = this.autoCycle / 2;\n        const distancePerMs = 60 / oneWayDuration;\n        this.autoPercent += (time - this.autoLastTime) * distancePerMs * this.autoDirection;\n\n        if (this.autoPercent >= 80) {\n          this.autoPercent = 80;\n          this.autoDirection = -1;\n        } else if (this.autoPercent <= 20) {\n          this.autoPercent = 20;\n          this.autoDirection = 1;\n        }\n        this.style.setProperty(\"--percent\", this.autoPercent + \"%\");\n      }\n\n      this.autoLastTime = time;\n    }\n  }\n  customElements.define(\"m-image-comparison\", MImageComparison);\n}\n"],
  "mappings": "AAAA,GAAI,CAAC,eAAe,IAAI,oBAAoB,EAAG,CAC7C,MAAM,yBAAyB,WAAY,CACzC,aAAc,CACZ,MAAM,EACN,KAAK,OAAS,GACd,KAAK,OAAS,KAAK,cAAc,QAAQ,EACzC,KAAK,WAAa,KAAK,QAAQ,SAAW,aAC1C,KAAK,YAAc,KAAK,QAAQ,YAAc,OAC9C,KAAK,UAAY,KAAK,IAAI,EAAG,OAAO,KAAK,QAAQ,cAAc,GAAK,CAAC,EAAI,IACzE,KAAK,YAAc,GACnB,KAAK,cAAgB,EACrB,KAAK,UAAY,KACjB,KAAK,gBAAkB,KACvB,KAAK,aAAe,KACpB,KAAK,YAAc,GACnB,KAAK,WAAa,GAClB,KAAK,cAAgB,OAAO,WAAW,kCAAkC,EAAE,QAC3E,KAAK,KAAK,EACN,KAAK,aAAa,gBAAgB,GACpC,aAAa,gBAAgB,CAC3B,QAAS,KAAK,cAAc,uCAAuC,EACnE,SAAU,KAAK,UAAU,KAAK,IAAI,EAClC,UAAW,CACb,CAAC,CAEL,CAEA,MAAO,CACL,KAAK,OAAO,iBAAiB,aAAc,KAAK,MAAM,KAAK,IAAI,CAAC,EAChE,SAAS,KAAK,iBAAiB,WAAY,KAAK,IAAI,KAA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