{
  "version": 3,
  "sources": ["/cdn/shop/t/996/assets/textSlideshow.js?utm_bot_source=7516fd43adaa"],
  "sourcesContent": ["class TextSlideshow extends HTMLElement {\n  constructor() {\n    super();\n    this.slidesContainer = this.querySelector('[data-text-slide-container]');\n    this.slides = this.querySelectorAll('[data-text-slide]');\n    this.hiddenSlides = this.querySelectorAll('[data-text-slide]:not(.active)');\n    this.nextBtn = this.querySelector('button[name=\"next\"]');\n    this.previousBtn = this.querySelector('button[name=\"previous\"]');\n    this.pagination = this.querySelector('[data-text-slide-pagination]');\n    this.handleSwipe = this.handleSwipe.bind(this);\n\n    this.nextBtn.addEventListener('click', this.onButtonClick.bind(this));\n    this.previousBtn.addEventListener('click', this.onButtonClick.bind(this));\n    this.pagination.addEventListener('click', this.handlePagination.bind(this));\n\n    // Prevent tabbing to links in hidden slides\n    this.hiddenSlides.forEach(hiddenSlide => this.setLinkTabIndex(hiddenSlide, '-1'));\n\n    // Swipe navigation on mobile\n    this.slidesContainer.addEventListener('touchstart', e => {\n      if (!this.isMobile()) return;\n      this.swipeStart = e.changedTouches[0].screenX;\n    });\n    this.slidesContainer.addEventListener('touchend', e => {\n      if (!this.isMobile()) return;\n      this.swipeEnd = e.changedTouches[0].screenX;\n      this.handleSwipe();\n    });\n    this.slidesContainer.addEventListener('mousedown', e => {\n      if (!this.isMobile()) return;\n      this.swipeStart = e.screenX;\n    });\n    this.slidesContainer.addEventListener('mouseup', e => {\n      if (!this.isMobile()) return;\n      this.swipeEnd = e.screenX;\n      this.handleSwipe();\n    });\n\n    // Scroll to slide when block selected in theme editor\n    if (window.Shopify.designMode) {\n      document.addEventListener('shopify:block:select', this.handleBlockSelect.bind(this));\n    }\n  }\n\n  onButtonClick(e) {\n    const currentSlideIndex = +this.slidesContainer.querySelector('.active').dataset.textSlide;\n    const activeSlideIndex = e.currentTarget.name == 'next' ? currentSlideIndex + 1 : currentSlideIndex - 1;\n    this.setActiveSlide(activeSlideIndex);\n  }\n\n  handlePagination(e) {\n    const activeSlideIndex = +e.target.dataset.paginationBtn;\n    if (activeSlideIndex >= 0) this.setActiveSlide(activeSlideIndex);\n  }\n\n  setActiveSlide(slideIndex) {\n    this.currentSlide = this.slidesContainer.querySelector('.active');\n    this.currentSlide.classList.remove('active');\n    this.setLinkTabIndex(this.currentSlide, '-1');\n\n    this.activeSlide = this.slidesContainer.querySelector(`[data-text-slide=\"${slideIndex}\"]`);\n    this.activeSlide.classList.add('active');\n    this.setLinkTabIndex(this.activeSlide, '0');\n\n    this.displayButtons(slideIndex);\n    this.displayPagination(slideIndex);\n  }\n\n  displayButtons(slideIndex) {\n    if (slideIndex == 0) {\n      this.hideButton(this.previousBtn);\n    } else {\n      this.showButton(this.previousBtn);\n    }\n    \n    if (slideIndex == this.slides.length - 1) {\n      this.hideButton(this.nextBtn);\n    } else {\n      this.showButton(this.nextBtn);\n    }\n  }\n\n  hideButton(btn) {\n    btn.disabled = true;\n    btn.setAttribute('aria-hidden', true);\n    btn.setAttribute('tabindex', '-1');\n  }\n\n  showButton(btn) {\n    btn.disabled = false;\n    btn.setAttribute('aria-hidden', false);\n    btn.setAttribute('tabindex', '0');\n  }\n\n  displayPagination(slideIndex) {\n    this.currentPagination = this.pagination.querySelector('.active');\n    this.currentPagination.classList.remove('active');\n\n    this.activePagination = this.pagination.querySelector(`[data-pagination-btn=\"${slideIndex}\"]`);\n    this.activePagination.classList.add('active');\n  }\n\n  setLinkTabIndex(slide, tabIndex) {\n    const slideLinks = slide.querySelectorAll('a');\n    if (slideLinks.length) {\n      slideLinks.forEach(slideLink => slideLink.setAttribute('tabindex', tabIndex));\n    }\n  }\n\n  handleSwipe() {\n    const currentSlideIndex = +this.slidesContainer.querySelector('.active').dataset.textSlide;\n    const swipedLeft = this.swipeEnd < this.swipeStart;\n    const swipedRight = this.swipeEnd > this.swipeStart;\n    const isNotLastSlide = currentSlideIndex != this.slides.length - 1;\n    const isNotFirstSlide = currentSlideIndex != 0;\n\n    if (swipedLeft && isNotLastSlide) this.setActiveSlide(currentSlideIndex + 1);\n    if (swipedRight && isNotFirstSlide) this.setActiveSlide(currentSlideIndex - 1);\n  }\n\n  handleBlockSelect(e) {\n    const slideIndex = e.target.dataset.textSlide;\n    if (slideIndex) this.setActiveSlide(slideIndex);\n  }\n\n  isMobile() {\n    return window.matchMedia('only screen and (max-width: 768px)').matches;\n  }\n}\n\ncustomElements.define('text-slideshow', TextSlideshow);\n"],
  "mappings": "AAAA,MAAM,sBAAsB,WAAY,CACtC,aAAc,CACZ,MAAM,EACN,KAAK,gBAAkB,KAAK,cAAc,6BAA6B,EACvE,KAAK,OAAS,KAAK,iBAAiB,mBAAmB,EACvD,KAAK,aAAe,KAAK,iBAAiB,gCAAgC,EAC1E,KAAK,QAAU,KAAK,cAAc,qBAAqB,EACvD,KAAK,YAAc,KAAK,cAAc,yBAAyB,EAC/D,KAAK,WAAa,KAAK,cAAc,8BAA8B,EACnE,KAAK,YAAc,KAAK,YAAY,KAAK,IAAI,EAE7C,KAAK,QAAQ,iBAAiB,QAAS,KAAK,cAAc,KAAK,IAAI,CAAC,EACpE,KAAK,YAAY,iBAAiB,QAAS,KAAK,cAAc,KAAK,IAAI,CAAC,EACxE,KAAK,WAAW,iBAAiB,QAAS,KAAK,iBAAiB,KAAK,IAAI,CAAC,EAG1E,KAAK,aAAa,QAAQ,aAAe,KAAK,gBAAgB,YAAa,IAAI,CAAC,EAGhF,KAAK,gBAAgB,iBAAiB,aAAc,GAAK,CAClD,KAAK,SAAS,IACnB,KAAK,WAAa,EAAE,eAAe,CAAC,EAAE,QACxC,CAAC,EACD,KAAK,gBAAgB,iBAAiB,WAAY,GAAK,CAChD,KAAK,SAAS,IACnB,KAAK,SAAW,EAAE,eAAe,CAAC,EAAE,QACpC,KAAK,YAAY,EACnB,CAAC,EACD,KAAK,gBAAgB,iBAAiB,YAAa,GAAK,CACjD,KAAK,SAAS,IACnB,KAAK,WAAa,EAAE,QACtB,CAAC,EACD,KAAK,gBAAgB,iBAAiB,UAAW,GAAK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