{"version":3,"file":"AdaptiveNav.BUqXTmHO.mjs","names":["useState","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","p","J","init_jsx_runtime","ce","toneAt","minWidth","el","x","y","cs","bg","m","r","g","b","lavenderUnderPill","isLavender","paint","top","toneUnderNav","w","f","t","withAdaptiveNav","tone","setTone","scrolled","setScrolled","onLavender","setOnLavender","raf","lavender","check","schedule","remeasure","v","props","phone","PHONE","variant","frost","desk","cls","NAV_CSS","Component","PHONE_CSS","PILL","init_AdaptiveNav"],"sources":["https:/framerusercontent.com/modules/xJ6fYG6U4SWxSa42k1RG/G3tUzb8J9TAmlRiwaAqH/AdaptiveNav.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{forwardRef,useEffect,useState}from\"react\";const PILL='[data-framer-name=\"Talk to Ash\"]';// Desktop and tablet: once the page moves, the nav becomes a slim frosted bar and the wordmark shrinks.\n// Sundial motion \"large\" (320ms, ease-out) because the whole bar resizes; blur small (sigma 3) so the bar reads nearly solid.\n// Bar height and logo scale are not Sundial values; set by eye. The wordmark's ink sits in the upper part of its box,\n// so the offset is measured to put the letters, not the box, on the bar's centre line.\nconst NAV_CSS=`\n.ash-nav { transition: height 320ms ease-out, padding 320ms ease-out, background-color 320ms ease-out, box-shadow 320ms ease-out; background-color: rgba(255, 253, 250, 0); }\n.ash-nav [data-framer-name^=\"Logo\"] { transform-origin: 50% 0; transition: transform 320ms ease-out; }\n.ash-nav ${PILL} { background-color: var(--token-uo0ArHTn_, #DBE1FD) !important; transition: background-color 200ms ease-out; }\n.ash-nav.on-lavender:not(.is-scrolled) ${PILL} { background-color: var(--token-mC8IqZwEs, #FFFFFF) !important; }\n.ash-nav.is-scrolled { height: 48px !important; padding-top: 8px !important; background-color: rgba(255, 253, 250, 0.94) !important; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); }\n.ash-nav.is-scrolled [data-framer-name^=\"Logo\"] { transform: translateY(4.1px) scale(0.65); }\n`;// Phones get the same slim bar once the page moves: 48px tall with the wordmark at 0.6, both centred. Set by eye, like the desktop bar.\nconst PHONE_CSS=`\n.ash-nav-phone, .ash-nav-phone [data-framer-name=\"Bar\"] { transition: height 320ms ease-out; }\n.ash-nav-phone [data-framer-name^=\"Logo\"] { transform-origin: 0 50%; transition: transform 320ms ease-out; }\n.ash-nav-phone.is-scrolled:not([data-framer-name=\"Phone Open\"]), .ash-nav-phone.is-scrolled [data-framer-name=\"Bar\"] { height: 48px !important; min-height: 0 !important; }\n.ash-nav-phone.is-scrolled [data-framer-name^=\"Logo\"] { transform: translateY(-1px) scale(0.6); }\n`;// Site Nav variant ids: Phone, Phone Open, Phone Light, Phone Dark. \"Light\" variants have white text, for dark backgrounds.\nconst PHONE=new Set([\"Lh6_xnvXi\",\"dDcjEw1Mz\",\"KugQboTzU\",\"lof8TADix\"]);// Reads what sits under the nav. Narrow things (like the phone mockup) are skipped so only section backgrounds count.\nfunction toneAt(x,y){const minWidth=window.innerWidth*.4;for(const el of document.elementsFromPoint(x,y)){if(el.closest(\"[data-adaptive-nav]\"))continue;if(el.getBoundingClientRect().width<minWidth)continue;if(el.tagName===\"IMG\"||el.tagName===\"VIDEO\")return\"dark\";const cs=getComputedStyle(el);const bg=cs.backgroundImage;if(bg&&bg!==\"none\"&&bg.includes(\"url(\"))return\"dark\";const m=cs.backgroundColor.match(/[\\d.]+/g);if(m&&(m.length<4||Number(m[3])>.5)){const[r,g,b]=m.map(Number);return(.2126*r+.7152*g+.0722*b)/255<.5?\"dark\":\"light\";}}return\"light\";}// True when the page behind the pill is periwinkle (Home's hero), where a periwinkle pill would vanish, so it turns white.\n// Decorative gradient layers ignore the pointer, so hit-testing misses them: look for any wide layer under the pill instead.\nfunction lavenderUnderPill(){const x=window.innerWidth*.85;const y=40+window.scrollY;const isLavender=paint=>{const m=paint.match(/rgba?\\(([^)]+)\\)/);if(!m)return false;const[r,g,b,a=1]=m[1].split(/[ ,/]+/).map(Number);return a>=.5&&b-r>=15&&(.2126*r+.7152*g+.0722*b)/255>.6;};for(const el of Array.from(document.querySelectorAll(\"[data-framer-name]\"))){if(el.closest(\"[data-adaptive-nav]\"))continue;const r=el.getBoundingClientRect();const top=r.top+window.scrollY;if(r.width<window.innerWidth*.4||x<r.left||x>r.right||y<top||y>top+r.height)continue;const cs=getComputedStyle(el);if(cs.backgroundImage.includes(\"gradient\")?isLavender(cs.backgroundImage):isLavender(cs.backgroundColor))return true;}return false;}// Samples the left links, the wordmark and the right links; the majority wins.\nfunction toneUnderNav(){const w=window.innerWidth;const votes=[.15,.5,.85].map(f=>toneAt(w*f,40));return votes.filter(t=>t===\"dark\").length>=2?\"dark\":\"light\";}/** Swaps a Site Nav between its Light and Dark variants to match the section behind it. */export function withAdaptiveNav(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[tone,setTone]=useState(null);const[scrolled,setScrolled]=useState(false);const[onLavender,setOnLavender]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;let raf=0;let lavender=null;const check=()=>{raf=0;setTone(toneUnderNav());setScrolled(window.scrollY>8);if(lavender===null)lavender=lavenderUnderPill();setOnLavender(lavender);};const schedule=()=>{if(!raf)raf=requestAnimationFrame(check);};check();window.addEventListener(\"scroll\",schedule,{passive:true});const remeasure=()=>{lavender=null;schedule();};window.addEventListener(\"resize\",remeasure);return()=>{window.removeEventListener(\"scroll\",schedule);window.removeEventListener(\"resize\",remeasure);if(raf)cancelAnimationFrame(raf);};},[]);const v=String(props.variant??\"\");const phone=v.startsWith(\"Phone\")||PHONE.has(v);const variant=tone===null?props.variant:phone?tone===\"dark\"&&!scrolled?\"KugQboTzU\":\"lof8TADix\":tone===\"dark\"?\"n7nJLYEjV\":\"rfJH4eW1V\";// On phones, a nearly solid backing appears once content scrolls under the nav (Sundial blur: small, sigma 3).\n// The backing is always the same light bar with black text, whatever is behind it, to match the desktop bar.\nconst frost=phone&&scrolled;if(!phone&&tone!==null){// At the top it takes the tone of the hero; once scrolled it sits on its own light bar, so it reads black.\nconst desk=scrolled?\"rfJH4eW1V\":variant;const cls=[props.className,\"ash-nav\",scrolled?\"is-scrolled\":\"\",onLavender?\"on-lavender\":\"\"].filter(Boolean).join(\" \");return /*#__PURE__*/_jsxs(\"div\",{\"data-adaptive-nav\":true,style:{display:\"contents\"},children:[/*#__PURE__*/_jsx(\"style\",{children:NAV_CSS}),/*#__PURE__*/_jsx(Component,{ref:ref,...props,variant:desk,className:cls})]});}return /*#__PURE__*/_jsxs(\"div\",{\"data-adaptive-nav\":true,style:{display:\"contents\"},children:[phone&&/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{position:\"absolute\",inset:0,pointerEvents:\"none\",WebkitBackdropFilter:frost?\"blur(3px)\":\"none\",backdropFilter:frost?\"blur(3px)\":\"none\",background:frost?\"rgba(255, 253, 250, 0.94)\":\"rgba(255, 253, 250, 0)\",transition:\"background-color 200ms ease-out, backdrop-filter 200ms ease-out\"}}),phone&&/*#__PURE__*/_jsx(\"style\",{children:PHONE_CSS}),/*#__PURE__*/_jsx(Component,{ref:ref,...props,variant:variant,className:[props.className,phone?\"ash-nav-phone\":\"\",phone&&scrolled?\"is-scrolled\":\"\"].filter(Boolean).join(\" \")})]});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withAdaptiveNav\":{\"type\":\"reactHoc\",\"name\":\"withAdaptiveNav\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AdaptiveNav.map"],"mappings":"A,gJAmBA,SAASU,EAAO,EAAE,EAAE,CAAC,IAAMC,EAAST,EAAO,WAAW,GAAG,IAAI,IAAMU,KAAM,SAAS,kBAAkBC,EAAEC,CAAC,EAAE,CAA+C,GAA3CF,EAAG,QAAQ,qBAAqB,GAAcA,EAAG,sBAAsB,CAAC,CAAC,MAAMD,EAAS,SAAS,GAAGC,EAAG,UAAU,OAAOA,EAAG,U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