{
  "version": 3,
  "sources": ["/cdn/shop/t/6/assets/product-title-truncation.js?cb=20260407-7"],
  "sourcesContent": ["import { Component } from '@theme/component';\n\n/** @typedef {typeof globalThis} Window */\n\n/**\n * A component that handles title truncation with responsive behavior\n *\n * @typedef {Object} Refs\n * @property {HTMLElement} [text] - The text element to truncate (optional)\n *\n * @extends {Component<Refs>}\n */\nclass ProductTitle extends Component {\n  constructor() {\n    super();\n  }\n\n  connectedCallback() {\n    super.connectedCallback();\n    this.#initializeTruncation();\n  }\n\n  /**\n   * Initialize the title truncation\n   */\n  #initializeTruncation() {\n    if ('ResizeObserver' in window) {\n      this.resizeObserver = new ResizeObserver(() => {\n        this.#calculateTruncation();\n      });\n\n      this.resizeObserver.observe(this);\n      this.#calculateTruncation();\n    } else {\n      /** @type {Window} */\n      (window).addEventListener('resize', this.#handleResize.bind(this));\n      this.#calculateTruncation();\n    }\n  }\n\n  /**\n   * Calculate truncation for the title\n   */\n  #calculateTruncation() {\n    /** @type {HTMLElement} */\n    const textElement = this.refs.text || this.querySelector('.title-text') || this;\n    if (!textElement.textContent) return;\n\n    const containerHeight = this.clientHeight;\n\n    const computedStyle = window.getComputedStyle(this);\n    const lineHeight = parseFloat(computedStyle.lineHeight);\n    const paddingTop = parseFloat(computedStyle.paddingTop);\n    const paddingBottom = parseFloat(computedStyle.paddingBottom);\n\n    const availableHeight = containerHeight - paddingTop - paddingBottom;\n    const maxLines = Math.max(1, Math.floor(availableHeight / lineHeight));\n\n    textElement.style.display = '-webkit-box';\n    textElement.style.webkitBoxOrient = 'vertical';\n    textElement.style.overflow = 'hidden';\n    textElement.style.textOverflow = 'ellipsis';\n    textElement.style.webkitLineClamp = String(maxLines);\n  }\n\n  /**\n   * Handle window resize events\n   */\n  #handleResize() {\n    this.#calculateTruncation();\n  }\n\n  disconnectedCallback() {\n    super.disconnectedCallback();\n    if (this.resizeObserver) {\n      this.resizeObserver.disconnect();\n    }\n    window.removeEventListener('resize', this.#handleResize);\n  }\n}\n\nif (!customElements.get('product-title')) {\n  customElements.define('product-title', ProductTitle);\n}\n\nexport default ProductTitle;\n"],
  "mappings": "AAAA,OAAS,cAAiB,mBAY1B,MAAM,qBAAqB,SAAU,CACnC,aAAc,CACZ,MAAM,CACR,CAEA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,KAAK,sBAAsB,CAC7B,CAKA,uBAAwB,CAClB,mBAAoB,QACtB,KAAK,eAAiB,IAAI,eAAe,IAAM,CAC7C,KAAK,qBAAqB,CAC5B,CAAC,EAED,KAAK,eAAe,QAAQ,IAAI,EAChC,KAAK,qBAAqB,IAGzB,OAAQ,iBAAiB,SAAU,KAAK,cAAc,KAAK,IAAI,CAAC,EACjE,KAAK,qBAAqB,EAE9B,CAKA,sBAAuB,CAErB,MAAM,YAAc,KAAK,KAAK,MAAQ,KAAK,cAAc,aAAa,GAAK,KAC3E,GAAI,CAAC,YAAY,YAAa,OAE9B,MAAM,gBAAkB,KAAK,aAEvB,cAAgB,OAAO,iBAAiB,IAAI,EAC5C,WAAa,WAAW,cAAc,UAAU,EAChD,WAAa,WAAW,cAAc,UAAU,EAChD,cAAgB,WAAW,cAAc,aAAa,EAEtD,gBAAkB,gBAAkB,WAAa,cACjD,SAAW,KAAK,IAAI,EAAG,KAAK,MAAM,gBAAkB,UAAU,CAAC,EAErE,YAAY,MAAM,QAAU,cAC5B,YAAY,MAAM,gBAAkB,WACpC,YAAY,MAAM,SAAW,SAC7B,YAAY,MAAM,aAAe,WACjC,YAAY,MAAM,gBAAkB,OAAO,QAAQ,CACrD,CAKA,eAAgB,CACd,KAAK,qBAAqB,CAC5B,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EACvB,KAAK,gBACP,KAAK,eAAe,WAAW,EAEjC,OAAO,oBAAoB,SAAU,KAAK,aAAa,CACzD,CACF,CAEK,eAAe,IAAI,eAAe,GACrC,eAAe,OAAO,gBAAiB,YAAY,EAGrD,eAAe",
  "names": []
}
