1import{bM as P,l as R,a as z,aJ as I,n as O,bN as y,aC as M,br as Y,j as e,af as S,g as L,be as C,Z as W,i as G,ao as K,bf as q,W as Q,B as n,A as f}from"./index-Byg2HWAE.js";import{r as l,u as U}from"./vendor-Qgthw7N1.js";const b="repshield_onboarding_completed",X="geofence_mobile_intro_seen",x=3;function H({onDone:r}={}){const[s,i]=l.useState(0),[p,j]=l.useState(()=>localStorage.getItem(b)!=="true"),{isActive:v,startTour:E,setHasCompletedOnboarding:w}=P(),{user:F}=R(),{toast:N}=z(),T=I(),o=l.useRef(null),c=l.useRef(null),{data:h}=O({queryKey:["/api/auth/user"],enabled:!!F,staleTime:1/0}),A=(h==null?void 0:h.hasCompletedOnboardingForm)===!0;l.useEffect(()=>{if(!y()||!A||v||localStorage.getItem(b)==="true")return;const t=setTimeout(()=>j(!0),600);return()=>clearTimeout(t)},[A,v]);const d=l.useCallback((t="/dashboard")=>{localStorage.setItem(b,"true"),localStorage.setItem(X,"true"),w(!0),j(!1),r?r():window.location.href=t},[w,r]),u=l.useCallback(()=>{i(t=>Math.min(t+1,x-1))},[]),m=M({mutationFn:async()=>{const t=await fetch("/api/user/preferences",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({locationTrackingEnabled:!0})});if(!t.ok)throw new Error("Failed to save preference");try{localStorage.setItem("geofence_optin_cache","true")}catch{}return t.json()},onSuccess:()=>{T.invalidateQueries({queryKey:["/api/user/preferences"]}),Y.start().catch(console.error),N({title:"Visit detection enabled",description:"We'll detect visits to your properties and create pending entr
1ies."}),u()},onError:()=>{N({title:"Could not save preference",description:"Enable it later from Settings â Privacy & Location.",variant:"destructive"}),u()}}),D=t=>{o.current=t.touches[0].clientX,c.current=t.touches[0].clientY},_=t=>{if(o.current===null||c.current===null)return;const a=t.changedTouches[0].clientX-o.current,B=Math.abs(t.changedTouches[0].clientY-c.current);Math.abs(a)>40&&B<60&&(a<0&&s<x-1&&i(g=>g+1),a>0&&s>0&&i(g=>g-1)),o.current=null,c.current=null};return p?e.jsxs("div",{className:"fixed inset-0 z-[9999] flex h-[100dvh] flex-col select-none overflow-hidden bg-white safe-area-left safe-area-right",onTouchStart:D,onTouchEnd:_,children:[s<x-1&&e.jsxs("button",{onClick:d,className:"absolute right-6 top-[calc(env(safe-area-inset-top)+1rem)] z-10 text-[#9CA3AF] text-sm font-medium flex items-center gap-1 hover:text-[#4B5563] transition-colors","aria-label":"Skip intro",children:["Skip ",e.jsx(S,{className:"w-4 h-4"})]}),e.jsxs("div",{className:"relative z-10 flex min-h-0 flex-1 flex-col items-center justify-center gap-5 overflow-y-auto px-8 pb-4 pt-[calc(env(safe-area-inset-top)+3rem)] text-center",children:[s===0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-20 h-3 bg-black/10 rounded-full blur-sm"}),e.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield mascot",className:"w-32 h-auto object-contain relative z-10"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-[#DCFCE7] px-4 py-1 text-[#16A34A] text-xs font-semibold tracking-wide",children:[e.jsx(L,{className:"w-3 h-3"}),"Welcome"]}),e.jsx("h1",{className:"text-3xl font-bold text-[#111827] leading-snug whitespace-pre-line",children:`Welcome to 2REPSShield`}),e.jsx("p",{className:"text-[#4B5563] text-base leading-relaxed max-w-xs",children:"Your all-in-one IRS-ready REP Status compliance partner. Track every qualifying hour, attach evidence, and stay audit-proof all year."})]}),s===1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[#DCFCE7] flex items-center justify-center shadow-sm",children:e.jsx(C,{className:"w-10 h-10 text-[#16A34A]"})}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-[#DCFCE7] px-4 py-1 text-[#16A34A] text-xs font-semibold tracking-wide",children:[e.jsx(C,{className:"w-3 h-3"}),"Auto-detect visits"]}),e.jsx("h1",{className:"text-2xl font-bold text-[#111827] leading-snug",children:"Log property visits automatically"}),e.jsx("div",{className:"w-full space-y-3 max-w-xs",children:[{icon:e.jsx(W,{className:"h-4 w-4 text-[#16A34A]"}),label:"Automatic time entries",detail:"Qualifying visits create pending entr
2ies for your review."},{icon:e.jsx(G,{className:"h-4 w-4 text-[#16A34A]"}),label:"Arrival & departure timestamps",detail:"Precise duration helps satisfy material participation."},{icon:e.jsx(K,{className:"h-4 w-4 text-[#16A34A]"}),label:"You stay in control",detail:"All entries are pending until you approve them."}].map(t=>e.jsxs("div",{className:"flex items-start gap-3 text-left",children:[e.jsx("div",{className:"mt-0.5 flex-shrink-0 w-8 h-8 rounded-xl bg-[#DCFCE7] flex items-center justify-center",children:t.icon}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-[#111827] leading-tight",children:t.label}),e.jsx("p",{className:"text-xs text-[#9CA3AF] leading-snug",children:t.detail})]})]},t.label))}),e.jsxs("div",{className:"w-full rounded-xl bg-[#F9FAFB] border border-[#E5E7EB] px-4 py-2.5 flex items-start gap-2 text-left",children:[e.jsx(q,{className:"h-4 w-4 text-[#16A34A] flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-[#9CA3AF] leading-relaxed",children:"Only tracks your saved properties · No background tracking · Disable anytime in Settings"})]})]}),s===2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-20 h-3 bg-black/10 rounded-full blur-sm"}),e.jsx("img",{src:"/repsshield-logo-main.png",alt:"REPSShield mascot",className:"w-32 h-auto object-contain relative z-10"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-[#DCFCE7] px-4 py-1 text-[#16A34A] text-xs font-semibold tracking-wide",children:[e.jsx(Q,{className:"w-3 h-3"}),"Guided Tour"]}),e.jsx("h1",{className:"text-3xl font-bold text-[#111827] leading-snug",children:"Ready to explore?"}),e.jsx("p",{className:"text-[#4B5563] text-base leading-relaxed max-w-xs",children:"Take a 2-minute interactive tour to discover every feature â or jump straight into the dashboard."})]})]}),e.jsxs("div",{className:"relative z-10 px-8 pb-[calc(env(safe-area-inset-bottom)+2rem)] flex flex-col items-center gap-6",children:[e.jsx("div",{className:"flex h-6 items-center justify-center gap-1.5",role:"tablist","aria-label":"Slide navigation",children:Array.from({length:x}).map((t,a)=>e.jsx("button",{type:"button",role:"tab","aria-selected":a===s,"aria-label":`Slide ${a+1}`,onClick:()=>i(a),className:"flex h-6 w-8 min-h-0 min-w-0 items-center justify-center rounded-full border-0 bg-transparent p-0",children:e.jsx("span",{className:`block h-2 rounded-full transition-all duration-300 ${a===s?"w-6 bg-[#16A34A]":"w-2 bg-[#D1D5DB]"}`})},a))}),s===0&&e.jsxs(n,{size:"lg",className:"w-full h-12 text-sm font-semibold bg-[#16A34A] text-white hover:bg-[#15803D] border-0 rounded-lg shadow-sm",onClick:u,children:["Get Started ",e.jsx(S,{className:"ml-1 w-4 h-4"})]}),s===1&&e.jsxs("div",{className:"w-full flex flex-col gap-3",children:[e.jsxs(n,{size:"lg",className:"w-full h-12 text-sm font-semibold bg-[#16A34A] text-white hover:bg-[#15803D] border-0 rounded-lg shadow-sm",onClick:()=>m.mutate(),disabled:m.isPending,children:[m.isPending?"Enablingâ¦":"Enable visit detection",e.jsx(f,{className:"ml-2 w-4 h-4"})]}),e.jsx(n,{size:"lg",variant:"ghost",className:"w-full h-10 text-[#9CA3AF] text-sm hover:text-[#4B5563] hover:bg-[#F9FAFB]",onClick:u,disabled:m.isPending,children:"Not now â set it up in Settings"})]}),s===2&&e.jsx("div",{className:"w-full flex flex-col gap-3",children:y()?e.jsxs(n,{size:"lg",className:"w-full h-12 text-sm font-semibold bg-[#16A34A] text-white hover:bg-[#15803D] border-0 rounded-lg shadow-sm",onClick:d,children:["Go to Dashboard",e.jsx(f,{className:"ml-2 w-4 h-4"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(n,{size:"lg",className:"w-full h-12 text-sm font-semibold bg-[#16A34A] text-white hover:bg-[#15803D] border-0 rounded-lg shadow-sm",onClick:()=>{d(),E()},children:["Start Interactive Tour",e.jsx(f,{className:"ml-2 w-4 h-4"})]}),e.jsx(n,{size:"lg",variant:"ghost",className:"w-full h-10 text-[#9CA3AF] text-sm hover:text-[#4B5563] hover:bg-[#F9FAFB]",onClick:d,children:"Skip â go to dashboard"})]})})]})]}):null}const k="repshield_onboarding_completed";function Z(){const[,r]=U();l.useEffect(()=>{!(new URLSearchParams(window.location.search).get("show")==="1")&&localStorage.getItem(k)==="true"&&r("/dashboard")},[r]);const s=()=>{localStorage.setItem(k,"true"),r("/dashboard")};return e.jsx(H,{onDone:s}
2)}export{Z as default};
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.