1import"./debug-build-l0sNRNKZ.js";import{r as o,h as w,b as g,a as p}from"./chunk-62JRHF6Z-DLi-nzGV.js";import{i as S,a as b,t as T}from"./analytics-BqfSOKaQ.js";import{b as h}from"./exports-BI7RTcps.js";const k=(e,t)=>{const s={name:"Etc/UTC",utc:"0"};if(!t.name)return s.name;const n=e.find(a=>a.name===t.name);if(n)return n.name;const r=t.name.split("/")[0];return e.reduce((a,c)=>{if(c.name.startsWith(r)){if(!a.name.startsWith(r))return c;const u=parseFloat(t.utc),i=parseFloat(c.utc),m=parseFloat(a.utc);if(Math.max(u,i)-Math.min(u,i)<Math.max(u,m)-Math.min(u,m))return c}return a},s).name},l=()=>{const e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=String(-(new Date().getTimezoneOffset()/60));return{name:e,utc:t}},P=e=>{const{state:t}=w();o.useEffect(()=>{typeof window<"u"&&e&&t==="idle"&&(window.location.href=e)},[t,e])},C=e=>{const t=p(),[s,n]=o.useState(!1);o.useEffect(()=>{typeof window<"u"&&e&&!s&&(n(!0),t(e))},[s,t,e])},v=()=>{const e=g();o.useEffect(()=>{e?.redirectTo?window.location.href=e.redirectTo+"&timezone="+btoa(JSON.stringify(l())):(h(new Error("No redirectTo"),{extra:{kind:"hook",name:"useAppleCallback",message:"Likely bad state, redirected to home"}}),window.location.href=window.location.origin)},[e?.redirectTo])},L=()=>{o.useEffect(()=>{try{const e=new URLSearchParams(new URL(window.location.href).hash.substring(1)),t=e.get("id_token"),s=e.get("state")??"{}",n=new URL(window.location.origin+"/auth/callback-submit-action");n.searchParams.set("credential",t??""),n.searchParams.set("provider","google"),n.searchParams.set("state",s),n.searchParams.set("timezone",btoa(JSON.stringify(l()))),window.location.href=n.toString()}catch(e){h(e,{extra:{kind:"hook",name:"useGoogleCallback",message:"Likely bad state, redirected to home"}}),window.location.href=window.location.origin}},[])},R=e=>{const[t,s]=o.useState("");return o.useEffect(()=>{if(t)return;const n=l();s(k(e,n))},[t,e]),t},z=(e,t)=>{const s=o.useRef();s.current||(e.setAttributes({id:t}),s.current=!0)},J=(e,t)=>{const s=o.useRef(),n=JSON.stringify(t);n!==s.current&&(e.setForcedVariations(t),s.current=n)},F=(e,t)=>{const s=o.useRef(),n=JSON.stringify(t);n!==s.current&&(e.setForcedFeatures(new Map(Object.entries(t))),s.current=n)},x=(e,t)=>{o.useLayoutEffect(()=>{t&&e.updateAttributes({organizationId:t})},[e,t])},M=(e,t)=>{const s=o.useRef();if(t&&t!==s.current){try{e.initSync({payload:t})}catch(n){console.error("[growthbook] payload hydration failed",n)}s.current=t}},N=(e,t)=>{const s=o.useCallback(n=>{e.current&&!e.current.contains(n.target)&&t()},[e,t]);o.useEffect(()=>(document.addEventListener("click",s),()=>{document.removeEventListener("click",s)}),[e,s])},D=({currentUser:e,product:t,source:s,redirectUrl:n,redirectTimeout:r=3e3,eventName:d="signup.completed",origin:a})=>{const[c,f]=o.useState(!1);o.useEffect(()=>{if(c)return;f(!0),(async()=>(e&&(S(e,t),await Promise.race([Promise.all([b(),new Promise(i=>{T(d,{user_id:e.id,source_context:s,...a&&{origin:a}},{callback:i})})]),new Promise(i=>{setTimeout(i,r)})])),window.location.assign(n)))()},[e,t,s,c,n,r,d,a])},W=()=>{const[e,t]=o.useState(!1);return o.useEffect(()=>{t(typeof window<"u")},[]),e},_=e=>{const[t,s]=o.useState(!1);return o.useEffect(()=>{const n=()=>{const r=(e?.scrollWidth||0)>(e?.offsetWidth||0);s(r)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e?.offsetWidth,e?.scrollWidth]),t},I=e=>{const s=[e?.plan_user?"plan":null].filter(Boolean);return{canDeleteTogglAccount:!0,nonSharedOrgProducts:s,hasNonSharedOrgProducts:s.length>0}};export{R as a,P as b,v as c,L as d,I as e,C as f,W as g,N as h,M as i,z as j,J as k,F as l,_ as m,x as n,D as u};
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.