{
  "version": 3,
  "sources": ["/cdn/shop/t/574/assets/ps-mobile-header.js?x=1793824228484"],
  "sourcesContent": ["/* ============================================================\n   Pink Stork \u2014 Mobile Header Behavior + Widget Close Buttons\n   Build: v26.12.9 \u2014 2026-04-22\n   Loaded once from layout/theme.liquid before </body>.\n\n   Two responsibilities:\n   (1) Toggle `body.ps-scrolled` on vertical scroll past 80px so\n       CSS can collapse the mobile header (hide sub-nav, shrink\n       logo, hide tagline) once the customer starts scrolling.\n   (2) Inject close (X) buttons on the live-chat widget and the\n       accessibility widget (Gorgias / Zendesk / accessiBe /\n       UserWay / generic), so customers can dismiss them. We\n       remember the dismissed state in sessionStorage so they\n       stay closed for the visit but reappear on a fresh tab.\n   ============================================================ */\n\n(function () {\n  'use strict';\n\n  /* \u2500\u2500\u2500 (1) Scroll-class toggle \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n  var ticking = false;\n  var threshold = 40; // px past which the header collapses (kept low so\n                      // the collapse feels instant \u2014 Thomas's reference is\n                      // any scroll = collapsed, not \"after scrolling far\")\n\n  function updateScrollClass() {\n    var y = window.pageYOffset || document.documentElement.scrollTop;\n    var scrolled = y > threshold;\n    document.body.classList.toggle('ps-scrolled', scrolled);\n    // Debug attribute so we can confirm via DevTools that the toggle ran\n    document.body.setAttribute('data-ps-scroll', String(Math.round(y)));\n    ticking = false;\n  }\n\n  function onScroll() {\n    if (!ticking) {\n      window.requestAnimationFrame(updateScrollClass);\n      ticking = true;\n    }\n  }\n\n  window.addEventListener('scroll', onScroll, { passive: true });\n  updateScrollClass(); // run once on load\n\n  /* \u2500\u2500\u2500 (2) Widget close buttons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n  // Selectors for known chat + accessibility widget root elements.\n  // We probe each one and attach a close (X) button if present.\n  // v26.73 \u2014 Restored accessibility widgets to the scan list. The\n  // earlier removal left zero X (the widget didn't have its own native\n  // close after all). Now we inject ONE X, and use a deduplication\n  // step below to ensure only one X exists per widget at any time.\n  var WIDGETS = [\n    { key: 'gorgias',     selectors: ['#gorgias-chat-container', '.gorgias-chat-container', 'iframe[id^=\"chat-button\"]'], label: 'Close chat' },\n    { key: 'zendesk',     selectors: ['iframe#launcher', 'iframe[title*=\"Messaging\"]', '.zEWidget-launcher'], label: 'Close chat' },\n    { key: 'intercom',    selectors: ['.intercom-launcher', '.intercom-lightweight-app-launcher', '#intercom-container'], label: 'Close chat' },\n    { key: 'tidio',       selectors: ['#tidio-chat', '#tidio-chat-iframe'], label: 'Close chat' },\n    { key: 'crisp',       selectors: ['.crisp-client'], label: 'Close chat' },\n    { key: 'shopify-inbox', selectors: ['#ShopifyChat', 'iframe[name=\"ShopifyChat\"]', '.shopify-chat-launcher'], label: 'Close chat' },\n    { key: 'accessibly',  selectors: ['#accessiblyAppWidgetButton', '#accessiblyAppDialogButton', '.accessibly-app-widget-button', '.accessibly-app-widget-button-container'], label: 'Close accessibility menu' },\n    { key: 'accessibe',   selectors: ['.acsb-trigger', '#acsb-icon', '[data-acsb-custom-trigger=\"true\"]'], label: 'Close accessibility menu' },\n    { key: 'userway',     selectors: ['#userwayAccessibilityIcon', '.userway_buttons_wrapper', 'iframe[title*=\"Accessibility\"]'], label: 'Close accessibility menu' },\n    { key: 'equalweb',    selectors: ['#INDmenu-btn', '.INDmenu-btn'], label: 'Close accessibility menu' },\n    { key: 'audioeye',    selectors: ['#ae_launcher', '.ae-launcher'], label: 'Close accessibility menu' }\n  ];\n\n  function dismissedKey(key) { return 'ps-dismiss-' + key; }\n\n  function isDismissed(key) {\n    try { return sessionStorage.getItem(dismissedKey(key)) === '1'; }\n    catch (e) { return false; }\n  }\n\n  function setDismissed(key) {\n    try { sessionStorage.setItem(dismissedKey(key), '1'); } catch (e) {}\n  }\n\n  function attachCloseButton(widgetEl, label, key) {\n    if (!widgetEl || widgetEl.dataset.psCloseAttached === '1') return;\n    // v26.73 \u2014 Dedupe. If another ps-widget-close already exists for this widget\n    // key (e.g. multiple selectors matched the same widget root via different\n    // children), don't add another one.\n    if (document.querySelector('.ps-widget-close[data-ps-key=\"' + key + '\"]')) return;\n    widgetEl.dataset.psCloseAttached = '1';\n\n    // The widget element itself is sometimes an iframe living in the\n    // page. We anchor an absolutely-positioned close button next to it\n    // by inserting a sibling wrapper.\n    var btn = document.createElement('button');\n    btn.type = 'button';\n    btn.className = 'ps-widget-close';\n    btn.setAttribute('aria-label', label);\n    btn.setAttribute('data-ps-key', key);\n    btn.innerHTML = '\u00D7'; // \u00D7\n\n    // Position the button at the top-right corner of the widget's\n    // bounding box, fixed so it tracks the widget on scroll.\n    function positionButton() {\n      var rect = widgetEl.getBoundingClientRect();\n      if (rect.width === 0 || rect.height === 0) {\n        btn.style.display = 'none';\n        return;\n      }\n      btn.style.display = '';\n      btn.style.top = Math.max(0, rect.top - 6) + 'px';\n      btn.style.left = Math.min(window.innerWidth - 30, rect.right - 18) + 'px';\n    }\n\n    btn.addEventListener('click', function (e) {\n      e.preventDefault();\n      e.stopPropagation();\n      // Hide all matching elements for this widget key\n      document.querySelectorAll('[data-ps-widget-key=\"' + key + '\"]').forEach(function (el) {\n        el.style.display = 'none';\n      });\n      // Also hide the widget element itself even if it doesn't have the marker\n      try { widgetEl.style.setProperty('display', 'none', 'important'); } catch (ex) {}\n      btn.remove();\n      setDismissed(key);\n    });\n\n    widgetEl.dataset.psWidgetKey = key;\n    document.body.appendChild(btn);\n    positionButton();\n    window.addEventListener('resize', positionButton, { passive: true });\n    window.addEventListener('scroll', positionButton, { passive: true });\n  }\n\n  function scanWidgets() {\n    WIDGETS.forEach(function (w) {\n      if (isDismissed(w.key)) {\n        // Hide it on subsequent loads within the session\n        w.selectors.forEach(function (sel) {\n          document.querySelectorAll(sel).forEach(function (el) {\n            try { el.style.setProperty('display', 'none', 'important'); } catch (e) {}\n          });\n        });\n        return;\n      }\n      w.selectors.forEach(function (sel) {\n        var matches = document.querySelectorAll(sel);\n        matches.forEach(function (el) {\n          attachCloseButton(el, w.label, w.key);\n        });\n      });\n    });\n  }\n\n  // Widgets load asynchronously. Poll for ~30 seconds after page load,\n  // then keep a slow MutationObserver running for late-arriving widgets\n  // (e.g., third-party scripts that wait for user interaction).\n  var fastChecks = 0;\n  var fastTimer = setInterval(function () {\n    scanWidgets();\n    fastChecks += 1;\n    if (fastChecks > 30) clearInterval(fastTimer); // 30 \u00D7 1s = 30s\n  }, 1000);\n\n  if (window.MutationObserver) {\n    var slowObserver = new MutationObserver(function () {\n      // Debounce \u2014 don't run on every DOM tick\n      if (slowObserver._timer) return;\n      slowObserver._timer = setTimeout(function () {\n        slowObserver._timer = null;\n        scanWidgets();\n      }, 800);\n    });\n    slowObserver.observe(document.body, { childList: true, subtree: true });\n  }\n})();\n\n/* ============================================================\n   (3) Search placeholder typing animation\n   PS Search v2, Nov 4 '26. Types a phrase into the header search\n   placeholder, holds it, deletes it, types the next one.\n\n   - Only runs while the search panel is open (restarts at phrase 1\n     each time it opens), pauses while the shopper has text in the\n     field, and stops when the tab is hidden.\n   - Skipped entirely for prefers-reduced-motion. The static\n     placeholder from header.liquid stays in place.\n   - Phrases: structure/function language only (FDA/FTC). Keep each\n     under ~26 characters so it fits a 375px phone without clipping.\n   ============================================================ */\n(function () {\n  'use strict';\n\n  var PHRASES = [\n    'Prenatal support',\n    'Stress + sleep support',\n    'Hormonal wellness',\n    'Postpartum support',\n    'Fertility support',\n    'Morning sickness support',\n    'Menopause support'\n  ];\n\n  // Timing (ms). Typing averages ~85ms per letter with a little\n  // randomness so it reads like a person, not a ticker.\n  var TYPE_MIN = 60;\n  var TYPE_MAX = 110;\n  var HOLD = 1800;       // full phrase stays up\n  var DELETE = 35;       // per letter, deleting is quicker than typing\n  var GAP = 450;         // empty pause before the next phrase\n  var START_DELAY = 600; // after the panel opens\n\n  if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;\n\n  var input = document.getElementById('header-search');\n  if (!input) return;\n  var panel = input.closest('[data-header-search]');\n  if (!panel || !window.MutationObserver) return;\n\n  var fallback = input.getAttribute('placeholder') || '';\n  var timer = null;\n  var running = false;\n  var phraseIdx = 0;\n  var charIdx = 0;\n  var deleting = false;\n\n  function isVisible() { return input.getClientRects().length > 0; }\n\n  function stop() {\n    clearTimeout(timer);\n    timer = null;\n    running = false;\n    input.setAttribute('placeholder', fallback);\n  }\n\n  function tick() {\n    if (!isVisible() || document.hidden) { stop(); return; }\n    // Shopper is typing: the placeholder is hidden anyway, so just wait.\n    if (input.value) { timer = setTimeout(tick, 400); return; }\n\n    var phrase = PHRASES[phraseIdx];\n    if (!deleting) {\n      charIdx += 1;\n      input.setAttribute('placeholder', phrase.slice(0, charIdx));\n      if (charIdx >= phrase.length) {\n        deleting = true;\n        timer = setTimeout(tick, HOLD);\n        return;\n      }\n      timer = setTimeout(tick, TYPE_MIN + Math.random() * (TYPE_MAX - TYPE_MIN));\n    } else {\n      charIdx -= 1;\n      input.setAttribute('placeholder', phrase.slice(0, charIdx));\n      if (charIdx <= 0) {\n        deleting = false;\n        phraseIdx = (phraseIdx + 1) % PHRASES.length;\n        timer = setTimeout(tick, GAP);\n        return;\n      }\n      timer = setTimeout(tick, DELETE);\n    }\n  }\n\n  function start() {\n    if (running) return;\n    running = true;\n    phraseIdx = 0;\n    charIdx = 0;\n    deleting = false;\n    input.setAttribute('placeholder', '');\n    timer = setTimeout(tick, START_DELAY);\n  }\n\n  function check() { if (isVisible() && !document.hidden) start(); }\n\n  // Alpine toggles the panel's inline style (x-show) and x-cloak.\n  new MutationObserver(check).observe(panel, { attributes: true, attributeFilter: ['style', 'x-cloak', 'class'] });\n  document.addEventListener('visibilitychange', check);\n  check();\n})();\n"],
  "mappings": "CAgBC,UAAY,CACX,aA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