{
  "version": 3,
  "sources": ["/cdn/shop/t/60/assets/paa-search-guard.js"],
  "sourcesContent": ["/* [PAA pkg: search-guard]\n   The store carries a cloudsearch ScriptTag (store-level, theme-independent)\n   that rewrites the header search forms' action from /search to its own\n   /a/search app-proxy page, bypassing this theme's entire search experience.\n   The app is slated to be disabled at launch, but this guard makes the theme\n   self-sufficient either way: it re-asserts the native action on any search\n   form the script rewrites. No-op once the app is gone. */\n(function () {\n  'use strict';\n  var reassert = function () {\n    document.querySelectorAll('form[action=\"/a/search\"], form[action^=\"/a/search\"]').forEach(function (f) {\n      f.setAttribute('action', '/search');\n      if (!f.querySelector('input[name=\"type\"]')) {\n        var t = document.createElement('input');\n        t.type = 'hidden'; t.name = 'type'; t.value = 'product';\n        f.appendChild(t);\n      }\n    });\n  };\n  // cloudsearch rewrites after its script loads; watch briefly, then stop.\n  var start = Date.now();\n  var iv = setInterval(function () {\n    reassert();\n    if (Date.now() - start > 8000) clearInterval(iv);\n  }, 400);\n  document.addEventListener('DOMContentLoaded', reassert);\n  document.addEventListener('submit', function (e) {\n    var f = e.target;\n    if (f && f.tagName === 'FORM' && /^\\/a\\/search/.test(f.getAttribute('action') || '')) {\n      f.setAttribute('action', '/search');\n    }\n  }, true);\n\n  /* The same app also injects its own full-screen search dialog over the\n     theme's search drawer (verified intercepting taps on mobile). Until the\n     app is uninstalled store-side, remove its UI so the theme's search is\n     what shoppers use. No-op once the app is gone. */\n  var killUi = function () {\n    document.querySelectorAll('.cloud-search-mobile, #cloud-search-results, [id^=\"cloud-search\"], [class^=\"cloud-search\"]').forEach(function (el) {\n      var dialog = el.closest('[role=\"dialog\"]');\n      (dialog || el).remove();\n    });\n  };\n  killUi();\n  new MutationObserver(killUi).observe(document.documentElement, { childList: true, subtree: true });\n\n  /* Predictive-suggestions fallback: the same app's script silently disables\n     the theme component's input listener on the live storefront (no console\n     error; verified the component never fetches /search/suggest). This drives\n     the SAME section endpoint into the theme's own results container, so the\n     designed predictive UX works regardless. Cheap and idempotent: last\n     response wins; clears below 2 chars. Remove once the app is uninstalled\n     and the component's own listener is confirmed firing. */\n  var paaSeq = 0, paaLast = '';\n  var paaDrive = function () {\n    var inp = document.querySelector('.l-hSearchDrawer__search-input');\n    var box = document.getElementById('predictive-search-results');\n    if (!inp || !box) return;\n    var q = inp.value.trim();\n    if (q === paaLast) {\n      if (q.length >= 2 && box.children.length > 0) { box.style.setProperty('display', 'grid', 'important'); box.removeAttribute('hidden'); }\n      return;\n    }\n    paaLast = q;\n    if (q.length < 2) { box.innerHTML = ''; box.style.setProperty('display', 'none', 'important'); inp.setAttribute('aria-expanded', 'false'); return; }\n    var seq = ++paaSeq;\n    fetch('/search/suggest?q=' + encodeURIComponent(q) + '&section_id=a-ajax-header-predictive-search')\n      .then(function (r) { return r.ok ? r.text() : ''; })\n      .then(function (html) {\n        if (seq !== paaSeq || !html) return;\n        var doc = new DOMParser().parseFromString(html, 'text/html');\n        var inner = doc.querySelector('.shopify-section') || doc.body;\n        box.innerHTML = inner.innerHTML;\n        box.style.setProperty('display', 'grid', 'important');\n        box.removeAttribute('hidden');\n        inp.setAttribute('aria-expanded', 'true');\n      })\n      .catch(function () {});\n  };\n  /* Poll instead of listening: the app's script swallows input events before\n     they reach any other listener (window-capture stopImmediatePropagation),\n     which is also why the theme component went quiet. A 400ms value poll\n     cannot be silenced. Negligible cost; only fetches when the value changed. */\n  setInterval(paaDrive, 400);\n})();\n"],
  "mappings": "CAOC,UAAY,CACX,aACA,IAAI,SAAW,UAAY,CACzB,SAAS,iBAAiB,qDAAqD,EAAE,QAAQ,SAAU,EAAG,CAEpG,GADA,EAAE,aAAa,SAAU,SAAS,EAC9B,CAAC,EAAE,cAAc,oBAAoB,EAAG,CAC1C,IAAI,EAAI,SAAS,cAAc,OAAO,EACtC,EAAE,KAAO,SAAU,EAAE,KAAO,OAAQ,EAAE,MAAQ,UAC9C,EAAE,YAAY,CAAC,CACjB,CACF,CAAC,CACH,EAEI,MAAQ,KAAK,IAAI,EACjB,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