{
  "version": 3,
  "sources": ["/cdn/shop/t/2/assets/love-collection.js?x=162"],
  "sourcesContent": ["/* 2202 collection page: \"Load more\" instead of page numbers, and a \"Showing X of Y styles\" count.\n   Without JavaScript the normal Dawn page numbers stay visible. */\n(() => {\n  const grid = () => document.getElementById('product-grid');\n  const nextLink = (root) => root.querySelector('.pagination-wrapper .pagination__item--prev');\n  let busy = false;\n  let batch = 0;\n\n  function totalFromPage() {\n    const el = document.getElementById('ProductCountDesktop') || document.getElementById('ProductCount');\n    if (!el) return null;\n    const nums = (el.textContent.match(/\\d+/g) || []).map(Number);\n    return nums.length ? nums[nums.length - 1] : null;\n  }\n\n  function sync() {\n    const g = grid();\n    if (!g) return;\n    const wrap = document.querySelector('.pagination-wrapper');\n    const shown = g.querySelectorAll('.card-wrapper').length;\n    const total = totalFromPage();\n    if (!batch && shown) batch = shown;\n\n    document.querySelectorAll('#ProductCountDesktop, #ProductCount').forEach((el) => {\n      if (total === null) return;\n      const searchTerm = document.querySelector('#Search-In-Template')?.value?.trim();\n      const text = searchTerm\n        ? `${shown} of ${total} styles match \u201C${searchTerm}\u201D`\n        : `Showing ${shown} of ${total} styles`;\n      if (el.textContent.trim() !== text) el.textContent = text;\n    });\n\n    let more = document.querySelector('.love-loadmore-wrap');\n    const next = wrap && nextLink(document);\n    if (!next) { if (more) more.remove(); if (wrap) wrap.classList.remove('love-pagination-hidden'); return; }\n    wrap.classList.add('love-pagination-hidden');\n    if (!more) {\n      more = document.createElement('div');\n      more.className = 'love-loadmore-wrap';\n      more.innerHTML = '<button type=\"button\" class=\"button love-loadmore\"></button><p class=\"love-loadmore-note\"></p>';\n      wrap.parentNode.insertBefore(more, wrap);\n    }\n    const remaining = total === null ? '' : ` \u00B7 ${Math.max(total - shown, 0)} remaining`;\n    const label = `Load more${remaining}`;\n    const b = more.querySelector('button');\n    if (!busy && b.textContent !== label) b.textContent = label; // keep \"Loading styles\u2026\" while a batch loads\n    if (b.dataset.url !== next.href) b.dataset.url = next.href;\n    const note = `More styles load in ${batch || 12}-style batches.`;\n    const n = more.querySelector('.love-loadmore-note');\n    if (n.textContent !== note) n.textContent = note;\n  }\n\n  function setupFilterToggle() {\n    document.querySelectorAll('.love-filter-toggle').forEach((button) => {\n      if (button.dataset.bound) return;\n      button.dataset.bound = 'true';\n      button.addEventListener('click', () => {\n        const container = button.closest('.facets-container');\n        if (!container) return;\n\n        if (window.matchMedia('(max-width: 749px)').matches) {\n          container.querySelector('.mobile-facets__open-wrapper')?.click();\n          return;\n        }\n\n        const open = container.classList.toggle('love-facets-open');\n        button.setAttribute('aria-expanded', String(open));\n      });\n    });\n  }\n\n  document.addEventListener('click', async (e) => {\n    const btn = e.target.closest('.love-loadmore');\n    if (!btn || busy) return;\n    busy = true;\n    btn.setAttribute('aria-busy', 'true');\n    btn.classList.add('is-loading');\n    btn.innerHTML = '<span class=\"love-loadmore__label\"><span class=\"love-loadmore__spinner\" aria-hidden=\"true\"></span>Loading styles\u2026</span>';\n    const minShow = new Promise((r) => setTimeout(r, 600)); // keep the loading state visible long enough to read\n    try {\n      const [res] = await Promise.all([fetch(btn.dataset.url), minShow]);\n      if (!res.ok) throw new Error(`Load more failed: ${res.status}`);\n      const doc = new DOMParser().parseFromString(await res.text(), 'text/html');\n      const incoming = doc.getElementById('product-grid');\n      const g = grid();\n      if (!incoming || !g) throw new Error('Load more: product grid missing');\n      [...incoming.children].forEach((li, i) => {\n        const node = document.importNode(li, true);\n        node.classList.add('love-card-in');\n        node.style.setProperty('--love-in-delay', `${Math.min(i, 11) * 40}ms`);\n        g.appendChild(node);\n      });\n      const old = document.querySelector('.pagination-wrapper');\n      const fresh = doc.querySelector('.pagination-wrapper');\n      if (old && fresh) old.replaceWith(document.importNode(fresh, true));\n      else if (old) old.remove();\n    } catch (err) {\n      window.location.href = btn.dataset.url; // fall back to a normal page load\n    } finally {\n      busy = false;\n      // Clear the busy state; the button is reused for the next batch.\n      btn.removeAttribute('aria-busy');\n      btn.classList.remove('is-loading');\n      sync();\n    }\n  });\n\n  document.addEventListener('DOMContentLoaded', () => {\n    setupFilterToggle();\n    sync();\n  });\n  if (document.readyState !== 'loading') {\n    setupFilterToggle();\n    sync();\n  }\n  // Dawn swaps the grid when filters or sorting change; keep the button and count in step.\n  new MutationObserver(() => {\n    setupFilterToggle();\n    window.clearTimeout(sync.t);\n    sync.t = window.setTimeout(sync, 60);\n  })\n    .observe(document.body, { childList: true, subtree: true });\n})();\n"],
  "mappings": "CAEC,IAAM,CACL,MAAM,KAAO,IAAM,SAAS,eAAe,cAAc,EACnD,SAAY,MAAS,KAAK,cAAc,6CAA6C,EAC3F,IAAI,KAAO,GACP,MAAQ,EAEZ,SAAS,eAAgB,CACvB,MAAM,GAAK,SAAS,eAAe,qBAAqB,GAAK,SAAS,eAAe,cAAc,EACnG,GAAI,CAAC,GAAI,OAAO,KAChB,MAAM,MAAQ,GAAG,YAAY,MAAM,MAAM,GAAK,CAAC,GAAG,IAAI,MAAM,EAC5D,OAAO,KAAK,OAAS,KAAK,KAAK,OAAS,CAAC,EAAI,IAC/C,CAEA,SAAS,MAAO,CACd,MAAM,EAAI,KAAK,EACf,GAAI,CAAC,EAAG,OACR,MAAM,KAAO,SAAS,cAAc,qBAAqB,EACnD,MAAQ,EAAE,iBAAiB,eAAe,EAAE,OAC5C,MAAQ,cAAc,EACxB,CAAC,OAAS,QAAO,MAAQ,OAE7B,SAAS,iBAAiB,qCAAqC,EAAE,QAAS,IAAO,CAC/E,GAAI,QAAU,KAAM,OACpB,MAAM,WAAa,SAAS,cAAc,qBAAqB,GAAG,OAAO,KAAK,EACxE,KAAO,WACT,GAAG,KAAK,OAAO,KAAK,uBAAkB,UAAU,SAChD,WAAW,KAAK,OAAO,KAAK,UAC5B,GAAG,YAAY,KAAK,IAAM,OAAM,GAAG,YAAc,KACvD,CAAC,EAED,IAAI,KAAO,SAAS,cAAc,qBAAqB,EACvD,MAAM,KAAO,MAAQ,SAAS,QAAQ,EACtC,GAAI,CAAC,KAAM,CAAM,MA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