{"version":3,"file":"_vendor_fuse-DJsE5LkE.js","sources":["../../../app/components/fuse/header/wrapper_component/wrapper_component.js","../../../app/components/fuse/header_component/header_component.js","../../../app/components/fuse/show_more_component/show_more_component.js","../../../app/frontend/entrypoints/partials/_vendor_fuse.js"],"sourcesContent":["import { scrollTop } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n  static get classes() {\n    return ['bg'];\n  }\n\n  initialize() {\n    this.props = {\n      scrolled: false,\n    };\n  }\n\n  connect() {\n    this.handleScroll();\n  }\n\n  handleScroll() {\n    const fromTop = scrollTop();\n\n    if ((fromTop > 0 && this.scrolled) || (fromTop === 0 && !this.scrolled)) {\n      return;\n    }\n\n    this.scrolled = fromTop > 0;\n\n    if (this.scrolled) {\n      this.element.classList.add(...this.bgClasses);\n    } else {\n      this.element.classList.remove(...this.bgClasses);\n    }\n  }\n\n  get scrolled() {\n    return this.props.scrolled;\n  }\n\n  set scrolled(value) {\n    this.props.scrolled = value;\n  }\n}\n","import { isNaN } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n  initialize() {\n    this.resizeObserver = new ResizeObserver(this.updateHeight.bind(this));\n  }\n\n  connect() {\n    this.updateHeight();\n    this.resizeObserver.observe(this.element);\n  }\n\n  disconnect() {\n    this.resizeObserver.unobserve(this.element);\n    this.cssHeightVariable = null;\n  }\n\n  updateHeight() {\n    if (this.position !== 'fixed') {\n      if (this.cssHeightVariable !== 0) {\n        this.cssHeightVariable = 0;\n        this.dispatchOnDocument('resize', { detail: 0 });\n      }\n\n      return;\n    }\n\n    if (this.cssHeightVariable === this.height) return;\n\n    this.cssHeightVariable = this.height;\n    this.dispatchOnDocument('resize', { detail: this.height });\n  }\n\n  get position() {\n    return window.getComputedStyle(this.element).getPropertyValue('position');\n  }\n\n  get height() {\n    return this.element.offsetHeight;\n  }\n\n  get cssHeightVariable() {\n    const height = parseInt(document.documentElement.style.getPropertyValue('--header-height'), 10);\n\n    if (isNaN(height)) {\n      return 0;\n    }\n\n    return height;\n  }\n\n  set cssHeightVariable(value) {\n    if (!value) {\n      document.documentElement.style.removeProperty('--header-height');\n      return;\n    }\n\n    document.documentElement.style.setProperty('--header-height', `${value}px`);\n  }\n}\n","import { isObject, isVariableDefinedNotNull, viewportWidth } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n  static get targets() {\n    return ['content', 'text', 'item', 'button', 'revealText', 'hideText'];\n  }\n\n  initialize() {\n    this.props = {\n      visibleCount: 0,\n      prevAlwaysVisibleCount: 0,\n      alwaysVisibleCount: null,\n      type: null,\n      isRevealed: false,\n      truncatedTextElement: null,\n      originalTextElement: null,\n    };\n  }\n\n  connect() {\n    this.initType();\n    this.initHidden();\n  }\n\n  disconnect() {\n    this.destroy();\n  }\n\n  initHidden() {\n    this.visibleCount = this.alwaysVisibleCount;\n\n    if (this.isAllVisible) {\n      this.buttonTarget.hidden = true;\n\n      return;\n    }\n\n    if (this.isRevealed) {\n      this.open(true);\n      return;\n    }\n\n    this.hide(true);\n  }\n\n  initType() {\n    this.type = this.targets.has('text') ? 'text' : 'items';\n\n    if (this.type !== 'items') {\n      this.initTextType();\n    }\n  }\n\n  initTextType() {\n    const originalContent = this.textTarget.innerHTML;\n    const noHTMLContent = this.textTarget.textContent;\n\n    if (this.isAllVisible) {\n      return;\n    }\n\n    this.originalTextElement = document.createElement('span');\n    this.originalTextElement.hidden = false;\n    this.truncatedTextElement = document.createElement('span');\n    this.truncatedTextElement.hidden = true;\n\n    this.originalTextElement.innerHTML = originalContent;\n\n    if (noHTMLContent.length === originalContent.length) {\n      this.truncatedTextElement.innerHTML = `${originalContent.substring(0, this.alwaysVisibleCount).trim()}…`;\n    } else {\n      const substrings = originalContent.split(/(<[^>]+>)/g).filter(Boolean);\n      const truncated = [];\n      let count = 0;\n      let isTagOpen = false;\n\n      for (let i = 0; i < substrings.length; i++) {\n        if (!isTagOpen && count > this.alwaysVisibleCount) {\n          break;\n        }\n\n        const substr = substrings[i];\n        const isTag = substr.match(/^<[^>]+>$/);\n\n        if (isTag) {\n          isTagOpen = !isTagOpen;\n          truncated.push(substr);\n        } else {\n          if (count + substr.length <= this.alwaysVisibleCount) {\n            truncated.push(substr);\n          } else {\n            const remaining = this.alwaysVisibleCount - count;\n            const truncatedSubstr = `${substr.substring(0, remaining - 1)}…`;\n\n            truncated.push(truncatedSubstr);\n          }\n\n          count += substr.length;\n        }\n      }\n\n      this.truncatedTextElement.innerHTML = truncated.join('');\n    }\n\n    this.textTarget.innerHTML = '';\n    this.textTarget.insertAdjacentElement('beforeend', this.originalTextElement);\n    this.textTarget.insertAdjacentElement('beforeend', this.truncatedTextElement);\n  }\n\n  checkVisibleCount() {\n    if (\n      this.isRevealed ||\n      this.prevAlwaysVisibleCount === this.alwaysVisibleCount ||\n      this.visibleCount === this.alwaysVisibleCount\n    ) {\n      return;\n    }\n\n    this.destroy();\n    this.initType();\n    this.initHidden();\n  }\n\n  open(force = false) {\n    if (!force && this.isRevealed) {\n      return;\n    }\n\n    this.isRevealed = true;\n    this.revealTextTarget.hidden = true;\n    this.hideTextTarget.hidden = false;\n\n    if (this.type === 'items') {\n      this.openItems();\n    } else if (this.type === 'text') {\n      this.openText();\n    }\n  }\n\n  hide(force = false) {\n    if (!force && !this.isRevealed) {\n      return;\n    }\n\n    this.isRevealed = false;\n    this.revealTextTarget.hidden = false;\n    this.hideTextTarget.hidden = true;\n\n    if (this.type === 'items') {\n      this.hideItems();\n    } else if (this.type === 'text') {\n      this.hideText();\n    }\n  }\n\n  openItems() {\n    this.itemTargets.forEach((item) => {\n      item.hidden = false;\n    });\n    this.visibleCount = this.itemTargets.length;\n  }\n\n  hideItems() {\n    this.visibleCount = this.alwaysVisibleCount;\n    this.itemTargets.forEach((item, index) => {\n      if (index >= this.alwaysVisibleCount) {\n        item.hidden = true;\n      }\n    });\n  }\n\n  openText() {\n    this.originalTextElement.hidden = false;\n    this.truncatedTextElement.hidden = true;\n    this.visibleCount = this.textTarget.textContent.length;\n  }\n\n  hideText() {\n    this.visibleCount = this.alwaysVisibleCount;\n    this.truncatedTextElement.hidden = false;\n    this.originalTextElement.hidden = true;\n  }\n\n  toggle() {\n    if (this.isRevealed) {\n      this.hide();\n      return;\n    }\n\n    this.open();\n  }\n\n  destroy() {\n    if (!this.isAllVisible) {\n      if (this.type === 'items') {\n        this.openItems();\n      } else {\n        this.textTarget.innerHTML = this.originalTextElement.innerHTML;\n      }\n    }\n\n    this.visibleCount = 0;\n    this.prevAlwaysVisibleCount = 0;\n    this.props.alwaysVisibleCount = null;\n    this.type = null;\n    this.isRevealed = false;\n    this.truncatedTextElement = null;\n    this.originalTextElement = null;\n  }\n\n  get alwaysVisibleCount() {\n    if (this.props.alwaysVisibleCount === null) {\n      this.props.alwaysVisibleCount = JSON.parse(this.element.dataset.alwaysVisible);\n    }\n\n    if (!isObject(this.props.alwaysVisibleCount)) {\n      return this.props.alwaysVisibleCount;\n    }\n\n    const width = viewportWidth();\n    let result = this.props.alwaysVisibleCount.default;\n\n    if (width >= 640 && isVariableDefinedNotNull(this.props.alwaysVisibleCount.sm)) {\n      result = this.props.alwaysVisibleCount.sm;\n    }\n\n    if (width >= 768 && isVariableDefinedNotNull(this.props.alwaysVisibleCount.md)) {\n      result = this.props.alwaysVisibleCount.md;\n    }\n\n    if (width >= 1024 && isVariableDefinedNotNull(this.props.alwaysVisibleCount.lg)) {\n      result = this.props.alwaysVisibleCount.lg;\n    }\n\n    if (width >= 1280 && isVariableDefinedNotNull(this.props.alwaysVisibleCount.xl)) {\n      result = this.props.alwaysVisibleCount.xl;\n    }\n\n    if (width >= 1536 && isVariableDefinedNotNull(this.props.alwaysVisibleCount['2xl'])) {\n      result = this.props.alwaysVisibleCount['2xl'];\n    }\n\n    return result;\n  }\n\n  get visibleCount() {\n    return this.props.visibleCount;\n  }\n\n  set visibleCount(value) {\n    this.props.visibleCount = value;\n  }\n\n  get prevAlwaysVisibleCount() {\n    return this.props.prevAlwaysVisibleCount;\n  }\n\n  set prevAlwaysVisibleCount(value) {\n    this.props.prevAlwaysVisibleCount = value;\n  }\n\n  get isAllVisible() {\n    if (this.type === 'items') {\n      return this.visibleCount >= this.itemTargets.length;\n    }\n\n    return this.visibleCount >= this.textTarget.textContent.length;\n  }\n\n  get isRevealed() {\n    return this.props.isRevealed;\n  }\n\n  set isRevealed(value) {\n    this.props.isRevealed = value;\n  }\n\n  get type() {\n    return this.props.type;\n  }\n\n  set type(value) {\n    this.props.type = value;\n  }\n\n  get originalTextElement() {\n    return this.props.originalTextElement;\n  }\n\n  set originalTextElement(value) {\n    this.props.originalTextElement = value;\n  }\n\n  get truncatedTextElement() {\n    return this.props.truncatedTextElement;\n  }\n\n  set truncatedTextElement(value) {\n    this.props.truncatedTextElement = value;\n  }\n}\n","import { isVariableDefinedNotNull } from '@slideslive/fuse-kit/utils';\nimport localizeFlatpickr from 'integration/flatpickr/localize_flatpickr';\nimport localizeMoment from 'integration/moment/localize_moment';\nimport startRails from 'integration/rails/start_rails';\n\nif (isVariableDefinedNotNull(window.gon) && isVariableDefinedNotNull(window.gon.locale)) {\n  localizeFlatpickr(window.gon.locale);\n  localizeMoment(window.gon.locale);\n}\n\nstartRails();\n"],"names":["FuseHeaderWrapperComponent","ApplicationController","fromTop","scrollTop","value","FuseHeaderComponent","height","isNaN","FuseShowMoreComponent","originalContent","noHTMLContent","substrings","truncated","count","isTagOpen","i","substr","remaining","truncatedSubstr","force","item","index","isObject","width","viewportWidth","result","isVariableDefinedNotNull","localizeFlatpickr","localizeMoment","startRails"],"mappings":"4PAGe,MAAKA,UAASC,CAAsB,CACjD,WAAW,SAAU,CACnB,MAAO,CAAC,IAAI,CAChB,CAEE,YAAa,CACX,KAAK,MAAQ,CACX,SAAU,EACX,CACL,CAEE,SAAU,CACR,KAAK,aAAc,CACvB,CAEE,cAAe,CACb,MAAMC,EAAUC,EAAW,EAEtBD,EAAU,GA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