1import{r as n}from"./react-vendor-DiO3iB5x.js";import{av as L,aw as K,ax as A,ay as T,az as $,p as F}from"./index-qxLdu01o.js";function S(){const e=n.useRef(!1);return L(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function U(){const e=S(),[t,r]=n.useState(0),o=n.useCallback(()=>{e.current&&r(t+1)},[t]);return[n.useCallback(()=>K.postRender(o),[o]),t]}class b extends n.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=r.offsetHeight||0,o.width=r.offsetWidth||0,o.top=r.offsetTop,o.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function V({children:e,isPresent:t}){const r=n.useId(),o=n.useRef(null),d=n.useRef({width:0,height:0,top:0,left:0});return n.useInsertionEffect(()=>{const{width:u,height:p,top:f,left:h}=d.current;if(t||!o.current||!u||!p)return;o.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` 2 [data-motion-pop-id="${r}"] { 3 position: absolute !important; 4 width: ${u}px !important; 5 height: ${p}px !important; 6 top: ${f}px !important; 7 left: ${h}px !important; 8 } 9 `),()=>{document.head.removeChild(l)}},[t]),n.createElement(b,{isPresent:t,childRef:o,sizeRef:d},n.cloneElement(e,{ref:o}))}const I=({children:e,initial:t,isPresent:r,onExitComplete:o,custom:d,presenceAffectsLayout:u,mode:p})=>{const f=A(N),h=n.useId(),l=n.useMemo(()=>({id:h,initial:t,isPresent:r,custom:d,onExitComplete:s=>{f.set(s,!0);for(const c of f.values())if(!c)return;o&&o()},register:s=>(f.set(s,!1),()=>f.delete(s))}),u?void 0:[r]);return n.useMemo(()=>{f.forEach((s,c)=>f.set(c,!1))},[r]),n.useEffect(()=>{!r&&!f.size&&o&&o()},[r]),p==="popLayout"&&(e=n.createElement(V,{isPresent:r},e)),n.createElement(T.Provider,{value:l},e)};function N(){return new Map}function j(e){return n.useEffect(()=>()=>e(),[])}const m=e=>e.key||"";function B(e,t){e.forEach(r=>{const o=m(r);t.set(o,r)})}function H(e){const t=[];return n.Children.forEach(e,r=>{n.isValidElement(r)&&t.push(r)}),t}const ee=({children:e,custom:t,initial:r=!0,onExitComplete:o,exitBeforeEnter:d,presenceAffectsLayout:u=!0,mode:p="sync"})=>{const f=n.useContext($).forceRender||U()[0],h=S(),l=H(e);let s=l;const c=n.useRef(new Map).current,w=n.useRef(s),g=n.useRef(new Map).current,E=n.useRef(!0);if(L(()=>{E.current=!1,B(l,g),w.current=s}),j(()=>{E.current=!0,g.clear(),c.clear()}),E.current)return n.createElement(n.Fragment,null,s.map(i=>n.createElement(I,{key:m(i),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:u,mode:p},i)));s=[...s];const R=w.current.map(m),x=l.map(m),M=R.length;for(let i=0;i<M;i++){const a=R[i];x.indexOf(a)===-1&&!c.has(a)&&c.set(a,void 0)}return p==="wait"&&c.size&&(s=[]),c.forEach((i,a)=>{if(x.indexOf(a)!==-1)return;const _=g.get(a);if(!_)return;const P=R.indexOf(a);let C=i;if(!C){const O=()=>{c.delete(a);const k=Array.from(g.keys()).filter(y=>!x.includes(y));if(k.forEach(y=>g.delete(y)),w.current=l.filter(y=>{const v=m(y);return v===a||k.includes(v)}),!c.size){if(h.current===!1)return;f(),o&&o()}};C=n.createElement(I,{key:m(_),isPresent:!1,onExitComplete:O,custom:t,presenceAffectsLayout:u,mode:p},_),c.set(a,C)}s.splice(P,0,C)}),s=s.map(i=>{const a=i.key;return c.has(a)?i:n.createElement(I,{key:m(i),isPresent:!0,presenceAffectsLayout:u,mode:p},i)}),n.createElement(n.Fragment,null,c.size?s:s.map(i=>n.cloneElement(i)))},Y=`https://us-central1-${F}.cloudfunctions.net/trackLandingAnalyticsHttp`,z="bewell_visit_location",D=["loc","location","utm_location"];function G(e){const t=e.trim().slice(0,48);return t?t.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"").toLowerCase():""}function J(e=window.location.search){var r;if(typeof window>"u")return;const t=new URLSearchParams(e);for(const o of D){const d=(r=t.get(o))==null?void 0:r.trim();if(d){const u=G(d);if(u){sessionStorage.setItem(z,u);return}}}}function W(){return typeof window>"u"?void 0:sessionStorage.getItem(z)||void 0}function Z(e){return`bewell_analytics_landing_${e}`}async function q(e,t){if(typeof window>"u")return;const r=(t==null?void 0:t.location)??W();try{await fetch(Y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,...r?{location:r}:{},...t!=null&&t.page?{page:t.page}:{}}),keepalive:e==="checkout_completed"})}catch{}}function te(e){if(typeof window>"u")return;J();const t=Z(e);sessionStorage.getItem(t)||(sessionStorage.setItem(t,"1"),q("landing_view",{page:e}))}
9export{ee as A,te as a,W as g,q as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.