{
  "version": 3,
  "sources": ["/cdn/shop/t/36/assets/tdhq-footer.js"],
  "sourcesContent": ["/* ============================================================\n   TDHQ footer behaviour \u2014 tdhq-footer.js\n\n   Scope is deliberately narrow. The spec rules out using JavaScript to\n   render footer links, decide company information, hide inaccessible\n   content after load, or compute anything Liquid already knows. All of\n   that is server-rendered; this file only handles the mobile\n   accordions and analytics.\n\n   The footer must stay fully usable if this never loads: panels are\n   only collapsed once JS has confirmed it can expand them again.\n   ============================================================ */\n(function () {\n  'use strict';\n\n  if (window.__tdhqFooterLoaded) return;\n  window.__tdhqFooterLoaded = true;\n\n  var footer = document.querySelector('[data-tdhq-footer]');\n  if (!footer) return;\n\n  /* ---------------------------------------------------------\n     ACCORDIONS\n     Real <button> elements with aria-expanded / aria-controls.\n     --------------------------------------------------------- */\n  (function accordions() {\n    var toggles = footer.querySelectorAll('[data-tdhq-acc]');\n    if (!toggles.length) return;\n\n    var mq = window.matchMedia('(max-width: 767px)');\n\n    function apply() {\n      var mobile = mq.matches;\n      /* the CSS keeps the panels shut until this has run (tdhq-footer.css, 22 Oct 2026) */\n      footer.setAttribute('data-acc-ready', '');\n      Array.prototype.forEach.call(toggles, function (btn) {\n        var panel = document.getElementById(btn.getAttribute('aria-controls'));\n        if (!panel) return;\n\n        if (mobile) {\n          // Collapse only on mobile, and only now that JS is running \u2014 if this\n          // file fails to load the panels stay open and every link is reachable.\n          var expanded = btn.getAttribute('aria-expanded') === 'true';\n          panel.hidden = !expanded;\n        } else {\n          // Desktop shows all columns; clear the attribute so the hidden state\n          // can never leak across a resize.\n          panel.hidden = false;\n          btn.setAttribute('aria-expanded', 'false');\n        }\n      });\n    }\n\n    /* OPEN AND CLOSE GLIDE (audit MOT-01). The panel used to jump from 0 to\n       262px between two frames and back, while every other accordion on the\n       site tweens. Height, the bottom padding and opacity run over 220ms on\n       the site's easing, from whatever height is on screen, so a second tap\n       mid-way reverses smoothly instead of snapping. A superseded animation\n       is cancelled and its finish handler checks it is still the current\n       one, so it can never hide a panel the shopper has just re-opened.\n       Reduced motion: the panel simply shows or hides. */\n    var EASE = 'cubic-bezier(0.4, 0, 0.2, 1)';\n    Array.prototype.forEach.call(toggles, function (btn) {\n      btn.addEventListener('click', function () {\n        var panel = document.getElementById(btn.getAttribute('aria-controls'));\n        if (!panel) return;\n        var open = btn.getAttribute('aria-expanded') === 'true';\n        btn.setAttribute('aria-expanded', open ? 'false' : 'true');\n        if (!panel.animate || window.matchMedia('(prefers-reduced-motion: reduce)').matches) { panel.hidden = open; return; }\n        var wasHidden = panel.hidden;\n        var from = wasHidden ? 0 : panel.getBoundingClientRect().height;\n        var fromPb = wasHidden ? '0px' : getComputedStyle(panel).paddingBottom;\n        var fromOp = wasHidden ? 0 : +getComputedStyle(panel).opacity;\n        if (panel._acc) { panel._acc.cancel(); }\n        panel.hidden = false;\n        var full = panel.scrollHeight;\n        var pb = getComputedStyle(panel).paddingBottom;\n        panel.style.overflow = 'hidden';\n        var a = panel.animate({\n          height: [from + 'px', (open ? 0 : full) + 'px'],\n          paddingBottom: [fromPb, open ? '0px' : pb],\n          opacity: [fromOp, open ? 0 : 1]\n        }, { duration: (window.TdhqMotion ? window.TdhqMotion.ms('--tdhq-t', 220) : 220), easing: EASE });\n        panel._acc = a;\n        a.onfinish = function () {\n          if (panel._acc !== a) { return; }\n          panel._acc = null;\n          panel.style.overflow = '';\n          if (btn.getAttribute('aria-expanded') !== 'true') { panel.hidden = true; }\n        };\n      });\n    });\n\n    mq.addEventListener('change', apply);\n    apply();\n  })();\n\n  /* ---------------------------------------------------------\n     ANALYTICS\n     Non-personal parameters only. customer_state comes from a\n     server-rendered data attribute, never from reading customer\n     data in JS \u2014 and the points balance and name are never sent.\n     --------------------------------------------------------- */\n  (function analytics() {\n    var panel = footer.querySelector('[data-tdhq-account]');\n    var state = (panel && panel.getAttribute('data-state')) || 'guest';\n\n    footer.addEventListener('click', function (e) {\n      var el = e.target.closest('[data-tdhq-fevent]');\n      if (!el) return;\n\n      var detail = {\n        customer_state: state,\n        link_category: el.getAttribute('data-link-category') || '',\n        link_label: (el.textContent || '').trim().slice(0, 60),\n        device_type: window.innerWidth < 768 ? 'mobile'\n                   : window.innerWidth < 1100 ? 'tablet' : 'desktop'\n      };\n\n      if (Array.isArray(window.dataLayer)) {\n        window.dataLayer.push(Object.assign({ event: el.getAttribute('data-tdhq-fevent') }, detail));\n      }\n      document.dispatchEvent(new CustomEvent('tdhq:' + el.getAttribute('data-tdhq-fevent'), { detail: detail }));\n    });\n  })();\n})();\n"],
  "mappings": "CAYC,UAAY,CACX,aAEA,GAAI,QAAO,mBACX,QAAO,mBAAqB,GAE5B,IAAI,OAAS,SAAS,cAAc,oBAAoB,EACnD,UAMJ,UAAsB,CACrB,IAAI,QAAU,OAAO,iBAAiB,iBAAiB,EACvD,GAAI,CAAC,QAAQ,OAAQ,OAErB,IAAI,GAAK,OAAO,WAAW,oBAAoB,EAE/C,SAAS,OAAQ,CACf,IAAI,OAAS,GAAG,QAEhB,OAAO,aAAa,iBAAkB,EAAE,EACxC,MAAM,UAAU,QAAQ,KAAK,QAAS,SAAU,IAAK,CACnD,IAAI,MAAQ,SAAS,eAAe,IAAI,aAAa,eAAe,CAAC,EACrE,GAAK,MAEL,GAAI,OAAQ,CAGV,IAAI,SAAW,IAAI,aAAa,eAAe,IAAM,OACrD,MAAM,OAAS,CAAC,QAClB,MAGE,MAAM,OAAS,GACf,IAAI,aAAa,gBAAiB,OAAO,CAE7C,CAAC,CACH,CAUA,IAAI,KAAO,+BACX,MAAM,UAAU,QAAQ,KAAK,QAAS,SAAU,IAAK,CACnD,IAAI,iBAAiB,QAAS,UAAY,CACxC,IAAI,MAAQ,SAAS,eAAe,IAAI,aAAa,eAAe,CAAC,EACrE,GAAK,MACL,KAAI,KAAO,IAAI,aAAa,eAAe,IAAM,OAEjD,GADA,IAAI,aAAa,gBAAiB,KAAO,QAAU,MAAM,EACrD,CAAC,MAAM,SAAW,OAAO,WAAW,kCAAkC,EAAE,QAAS,CAAE,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