PageSourceSearch

https://yogicurious.com/assets/Profile-ByPbKQwN.js

js yogicurious.com collected 2026-09-30 08:26:13 UTC 31,950 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/contentModeration-CoamvUQX.js","assets/index-Cn6nJhWG.js","assets/vendor-supabase-Bxjw3GPQ.js","assets/vendor-react-B1CyA2bu.js","assets/vendor-query-DoHIXVj8.js","assets/vendor-ui-Dv9JeOyV.js","assets/index-DmQqoYjh.css","assets/platformPayments-CbC8KN8d.js","assets/platformDetection-D69HpErv.js"])))=>i.map(i=>d[i]);
2import{_ as B}from"./vendor-supabase-Bxjw3GPQ.js";import{j as e}from"./vendor-query-DoHIXVj8.js";import{f as ie,r as x,L as Z}from"./vendor-react-B1CyA2bu.js";import{s as E,C as S,e as P,B as j,a as T,b as F,u as le,d as L,R as he}from"./index-Cn6nJhWG.js";import{I as W}from"./input-DAbNkcMA.js";import{L as f}from"./label-RPqHGtRV.js";import{T as xe}from"./textarea-BcrZnnCX.js";import{S as U,a as z,b as q,c as $,d as w}from"./select-DRYI-3RU.js";import{C as H}from"./checkbox-pN95hQnK.js";import{W as pe}from"./WeeklyAvailabilityPicker-Bz1W1HGw.js";import{S as ge}from"./separator-2WBMJ1oc.js";import{g as fe,a as je,P as ye,b as be}from"./PhotoUploadErrorBoundary-Cx_wfI2X.js";import{S as ve}from"./sparkles-BK2JkoPv.js";import{C as ne}from"./check-CEjPdstu.js";import{C as _e}from"./circle-RuH2O2yw.js";import{L as Ne}from"./LocationSelector-Bi17VqXg.js";import{R as X,F as ee,B as se,a as ae}from"./BlockUserDialog-CbOMMjqc.js";import{S as te}from"./shield-BwQ3blZr.js";import{M as we}from"./message-circle-Co-1ZbJU.js";import{H as oe}from"./heart-CEw_tAcA.js";import{C as Se}from"./circle-alert-DuA4ZyIP.js";import{L as Ce,i as ke}from"./locationService-XkoNA8Dg.js";import{B as Pe}from"./badge-BQ5YkzSG.js";import{B as J}from"./building-2-DLBimGpi.js";import{L as I}from"./loader-circle-Lrf5ROOc.js";import{M as G}from"./map-pin-B1BtCxI6.js";import{A as Ee}from"./arrow-left-BDHFhLAh.js";import{S as re}from"./save-DDtajKhP.js";import{D as Te}from"./download-C7NKPy_N.js";import{L as Fe}from"./log-out-RcQ3LDDS.js";import{T as Ae}from"./trash-2-BhO-XKdX.js";import"./vendor-ui-Dv9JeOyV.js";import"./index-BhIhkUGe.js";import"./index-CQ5kx8W4.js";import"./index-BBjTSBt-.js";import"./index-DHIvYiq8.js";import"./index-BYGYe9DC.js";import"./index-DzzFT5Tm.js";import"./clock-f_fY8OtY.js";import"./image-B72gWjYz.js";import"./upload-B3gKR75h.js";import"./star-CnTIotYq.js";import"./LocationSettingsButton-CGgpoHe7.js";import"./platformDetection-D69HpErv.js";import"./smartphone-CaApHHC_.js";import"./monitor-8lOsBT6T.js";import"./search-Dds-mF4T.js";import"./dialog-BAdzqCSX.js";import"./index-BuWUcE7h.js";import"./alert-DkhFZhUN.js";typeof globalThis.require!="function"&&(globalThis.require=function(){return null},window.require=globalThis.require);const Le=({userId:i})=>{const y=ie(),[u,v]=x.useState(null);if(x.useEffect(()=>{let _=!0;return(async()=>{const[{data:R},{count:D}]=await Promise.all([E.from("profiles").select("display_name, bio, age, avatar_url, latitude, longitude, yoga_experience, favorite_yoga_styles").eq("user_id",i).maybeSingle(),E.from("user_photos").select("id",{count:"exact",head:!0}).eq("user_id",i)]);_&&v(fe(R,D??0))})(),()=>{_=!1}},[i]),!u)return null;const b=je(u);return b===100?null:e.jsx(S,{className:"border-primary/30 bg-primary/5",children:e.jsxs(P,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"rounded-2xl bg-primary/10 p-2",children:e.jsx(ve,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("h3",{className:"font-semibold text-foreground",children:["Your profile is ",b,"% complete"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Complete profiles get seen and matched far more often."})]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${b}%`}})}),e.jsx("ul",{className:"space-y-1.5",children:u.map(_=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[_.done?e.jsx(ne,{className:"h-4 w-4 text-primary shrink-0"}):e.jsx(_e,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:_.done?"text-muted-foreground line-through":"text-foreground",children:_.label})]},_.key))}),e.jsx(j,{className:"w-full rounded-xl",onClick:()=>y("/complete-profile"),children:"Finish my profile"})]})})},Re=({userId:i,userName:y,className:u="",compact:v=!1})=>v?e.jsx(S,{className:`border-amber-200 bg-amber-50 ${u}`,children:e.jsx(P,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(te,{className:"h-5 w-5 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-amber-900 mb
2-2",children:"Safety First"}),e.jsx("p",{className:"text-sm text-amber-800 mb-3",children:"YogiCurious has zero tolerance for inappropriate behavior. Use our safety features anytime."}),e.jsx("div",{className:"flex gap-2",children:i&&e.jsxs(e.Fragment,{children:[e.jsx(X,{reportType:"profile",targetUserId:i,children:e.jsxs(j,{size:"sm",variant:"outline",className:"border-amber-300 text-amber-800 hover:bg-amber-100",children:[e.jsx(ee,{className:"h-3 w-3 mr-1"}),"Report"]})}),e.jsx(se,{targetUserId:i,targetUserName:y||"user",children:e.jsxs(j,{size:"sm",variant:"outline",className:"border-amber-300 text-amber-800 hover:bg-amber-100",children:[e.jsx(ae,{className:"h-3 w-3 mr-1"}),"Block"]})})]})})]})]})})}):e.jsx("div",{className:`space-y-4 ${u}`,children:e.jsxs(S,{className:"border-primary/20 bg-primary/5",children:[e.jsx(T,{children:e.jsxs(F,{className:"flex items-center gap-2 text-primary",children:[e.jsx(te,{className:"h-6 w-6"}),"Your Safety Matters"]})}),e.jsxs(P,{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"YogiCurious is committed to creating a safe, respectful community. We provide multiple ways to protect yourself and others."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"flex items-start gap-4 p-4 md:p-5 border rounded-lg",children:[e.jsx(ee,{className:"h-6 w-6 md:h-7 md:w-7 text-destructive mt-1 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-base md:text-lg",children:"Report Inappropriate Behavior"}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground mb-3",children:"Report profiles, messages, or any objectionable content. Our team responds within 24 hours."}),i?e.jsx(X,{reportType:"profile",targetUserId:i,children:e.jsx(j,{size:"sm",variant:"outline",children:"Report This User"})}):e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Available on all profiles and messages"})]})]}),e.jsxs("div",{className:"flex items-start gap-4 p-4 md:p-5 border rounded-lg",children:[e.jsx(ae,{className:"h-6 w-6 md:h-7 md:w-7 text-destructive mt-1 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-base md:text-lg",children:"Block Unwanted Users"}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground mb-3",children:"Instantly prevent contact from abusive users"}),i?e.jsx(se,{targetUserId:i,targetUserName:y||"user",children:e.jsx(j,{size:"sm",variant:"outline",children:"Block This User"})}):e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Available on all profiles"})]})]}),e.jsxs("div",{className:"flex items-start gap-4 p-4 md:p-5 border rounded-lg",children:[e.jsx(we,{className:"h-6 w-6 md:h-7 md:w-7 text-blue-600 mt-1 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-base md:text-lg",children:"24-Hour Response Team"}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground mb-3",children:"All reports reviewed and acted upon within 24 hours"}),e.jsx(j,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(Z,{to:"/contact",className:"text-xs",children:"Contact Support"})})]})]}),e.jsxs("div",{className:"flex items-start gap-4 p-4 md:p-5 border rounded-lg",children:[e.jsx(oe,{className:"h-6 w-6 md:h-7 md:w-7 text-green-600 mt-1 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-base md:text-lg",children:"Safety Guidelines"}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground mb-3",children:"Tips for safe and mindful connections"}),e.jsx(j,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(Z,{to:"/safety-tips",className:"text-xs",children:"Read Guidelines"})})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-destructive/10 border border-destructive/20 rounded-lg",children:[e.jsx(Se,{className:"h-5 w-5 text-destructive mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-sm text-destructive",children:"For Emergencie
2s"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"If you're in immediate danger, contact local emergency services (911 in US) immediately. YogiCurious support is for app-related safety concerns."})]})]}),e.jsx("div",{className:"text-center p-4 md:p-5 bg-muted rounded-lg",children:e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:[e.jsx("strong",{children:"ZERO TOLERANCE POLICY:"})," We have absolutely no tolerance for objectionable content, harassment, or abusive behavior. Users who violate our terms will have their content immediately removed and accounts permanently suspended. Our moderation team acts on all reports within 24 hours to maintain a safe, respectful yoga community."]})})]})]})}),Me=({userId:i,userLatitude:y,userLongitude:u})=>{const[v,b]=x.useState([]),[_,R]=x.useState(new Map),[D,A]=x.useState(!0),[O,l]=x.useState(null),{toast:m}=le();x.useEffect(()=>{r()},[i,y,u]);const r=async()=>{A(!0);try{const{data:n,error:g}=await E.rpc("get_public_studio_data");if(g)throw g;const{data:c,error:N}=await E.from("user_studio_memberships").select("studio_id, is_member").eq("user_id",i);if(N)throw N;const M=new Map;c==null||c.forEach(a=>M.set(a.studio_id,a.is_member)),R(M);let C=(n||[]).filter(a=>a.has_monthly_membership).map(a=>{if(y&&u&&a.latitude&&a.longitude){const h=Ce.calculateDistance(y,u,a.latitude,a.longitude);return{...a,distance:h}}return a});y&&u?C=C.filter(a=>a.distance!==void 0&&a.distance<=50).sort((a,h)=>(a.distance||0)-(h.distance||0)):C.sort((a,h)=>a.studio_name.localeCompare(h.studio_name)),b(C)}catch(n){console.error("Error loading studio memberships:",n)}finally{A(!1)}},p=async n=>{l(n);try{const c=!(_.get(n)||!1),{error:N}=await E.from("user_studio_memberships").upsert({user_id:i,studio_id:n,is_member:c,updated_at:new Date().toISOString()},{onConflict:"user_id,studio_id"});if(N)throw N;R(M=>{const C=new Map(M);return C.set(n,c),C}),m({title:c?"Membership confirmed!":"Membership removed",description:c?"Your membership status has been saved and will be remembered for future bookings.":"Membership status updated."})}catch(g){console.error("Error toggling membership:",g),m({title:"Error updating membership",description:"Please try again.",variant:"destructive"})}finally{l(null)}};return D?e.jsxs(S,{children:[e.jsx(T,{children:e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5"}),"Studio Memberships"]})}),e.jsx(P,{className:"flex justify-center py-8",children:e.jsx(I,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]}):v.length===0?e.jsx(S,{children:e.jsxs(T,{children:[e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5"}),"Studio Memberships"]}),e.jsx(L,{children:"No studios with monthly memberships found in your area. Set your location above to see nearby studios."})]})}):e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5"}),"Studio Memberships"]}),e.jsx(L,{children:"Are you a member at any of these nearby studios? Tap to confirm your membership — it'll be remembered for future yoga match bookings."})]}),e.jsx(P,{className:"space-y-2",children:v.map(n=>{const g=_.get(n.id)||!1,c=O===n.id;return e.jsxs(j,{variant:g?"default":"outline",className:`w-full justify-between h-auto py-3 px-4 ${g?"":"hover:border-primary/50"}`,onClick:()=>p(n.id),disabled:c,children:[e.jsxs("div",{className:"flex flex-col items-start gap-0.5 text-left",children:[e.jsx("span",{className:"font-medium text-sm",children:n.studio_name}),e.jsxs("span",{className:`text-xs ${g?"text-primary-foreground/70":"text-muted-foreground"} flex items-center gap-1`,children:[e.jsx(G,{className:"h-3 w-3"}),n.city,n.state?`, ${n.state}`:"",n.distance!==void 0&&e.jsxs("span",{className:"ml-1",children:["• ",n.distance.toFixed(1)," mi"]})]})]}),e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:c?e.jsx(I,{className:"h-4 w-4 animate-spin"}):g?e.jsxs(Pe,{variant:"secondary",className:"bg-primary-foreground/20 text-primary-foreground text-xs",children:[e.jsx(ne,{className:"h-3 w-3 mr-1"}),"Member"]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Tap to confirm"})})]},n.id)})})]})},De=["hatha","vinyasa","ashtanga","bikram","yin","restorative","kundalini","iyengar"],Oe=["dating","friendship","yoga_partner","long_term","casual"],Ue=["learning_together","sharing_knowledge","finding_guidance","exploring_styles","building_practice","spiritual_growth","physical_wellness","stress_relief"],ze=["visual","hands_on","guided","independent","group_discussion"],qe=["just_curious","once_week","few_times_week","daily","multiple_daily"],$e=["one_on_one","small_group","medium_class","large_class","no_preference"],zs=()=>{const[i,y]=x.useState(null),[u,v]=x.useState(null),[b,_]=x.useState(null),[R,D]=x.useState(!0),[A,O]=x.use
2State(!1),[l,m]=x.useState(null),[r,p]=x.useState({}),[n,g]=x.useState(!1),c=ie(),{toast:N}=le(),M=()=>{const s={};if(a.display_name.trim()||(s.display_name="Display name is required"),a.age){const t=parseInt(a.age);isNaN(t)||t<18?s.age="You must be at least 18 years old":t>100&&(s.age="Please enter a valid age")}if(a.bio&&a.bio.length>500&&(s.bio="Bio must be 500 characters or less"),a.max_distance){const t=parseInt(a.max_distance);(isNaN(t)||t<1||t>100)&&(s.max_distance="Distance must be between 1 and 100 miles")}return p(s),Object.keys(s).length===0},C=s=>{p(t=>{const d={...t};return delete d[s],d})},[a,h]=x.useState({display_name:"",bio:"",age:"",gender:"",location:"",yoga_experience:"",favorite_yoga_styles:[],relationship_intentions:[],looking_for:[],max_distance:"50",practice_intentions:[],teaching_comfort:!1,learning_style:"",practice_frequency:"",preferred_class_size:"",weekly_availability:{}});x.useEffect(()=>{const{data:{subscription:s}}=E.auth.onAuthStateChange((t,d)=>{v(d),y((d==null?void 0:d.user)??null),d!=null&&d.user||c("/auth")});return E.auth.getSession().then(({data:{session:t}})=>{v(t),y((t==null?void 0:t.user)??null),t!=null&&t.user?ce(t.user.id):c("/auth")}),ke(),()=>s.unsubscribe()},[c]);const ce=async s=>{var t,d,k,Y;try{let{data:o,error:V}=await E.from("profiles").select("*").eq("user_id",s).eq("is_dating_profile",!0).maybeSingle();if(!o&&!V){const{data:me,error:ue}=await E.from("profiles").select("*").eq("user_id",s).maybeSingle();o=me,V=ue}V?(console.error("Error loading profile:",V),N({title:"Profile Error",description:"Unable to load your profile.",variant:"destructive"})):o&&(_(o),h({display_name:o.display_name||"",bio:o.bio||"",age:((t=o.age)==null?void 0:t.toString())||"",gender:o.gender||"",location:o.location||"",yoga_experience:o.yoga_experience||"",favorite_yoga_styles:o.favorite_yoga_styles||[],relationship_intentions:o.relationship_intentions||[],looking_for:o.looking_for||[],max_distance:((d=o.max_distance)==null?void 0:d.toString())||"50",practice_intentions:o.practice_intentions||[],teaching_comfort:o.teaching_comfort||!1,learning_style:o.learning_style||"",practice_frequency:o.practice_frequency||"",preferred_class_size:o.preferred_class_size||"",weekly_availability:o.weekly_availability||{}}),o.latitude&&o.longitude&&m({latitude:o.latitude,longitude:o.longitude,city:(k=o.location)==null?void 0:k.split(", ")[0],state:(Y=o.location)==null?void 0:Y.split(", ")[1]}))}catch(o){console.error("Error:",o)}finally{D(!1)}},de=s=>{m(s);const t=s.city&&s.state?`${s.city}, ${s.state}`:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`;h(d=>({...d,location:t}))},K=async()=>{if(i){if(!M()){N({title:"Please fix the errors below",description:"Some fields need your attention before saving.",variant:"destructive"});return}O(!0);try{const{moderateContent:s}=await B(async()=>{const{moderateContent:k}=await import("./contentModeration-CoamvUQX.js");return{moderateContent:k}},__vite__mapDeps([0,1,2,3,4,5,6]));if(a.bio){const k=await s(a.bio,"profile",i.id,i.id);if(k.flagged&&k.autoAction==="block"){N({title:"Content Policy Violation",description:"Your bio contains content that violates our community guidelines. Please revise and try again.",variant:"destructive"}),O(!1);return}}l&&l.latitude&&l.longitude?console.log("Profile has location data:",l):console.log("Profile saving without location - will need location for dating features"),console.log("Form data before saving:",a);const t={display_name:a.display_name,bio:a.bio||null,age:a.age?parseInt(a.age):null,gender:a.gender||null,location:a.location||null,latitude:(l==null?void 0:l.latitude)||null,longitude:(l==null?void 0:l.longitude)||null,yoga_experience:a.yoga_experience||null,favorite_yoga_styles:a.favorite_yoga_styles.length>0?a.favorite_yoga_styles:null,relationship_intentions:a.relationship_intentions.length>0?a.relationship_intentions:null,looking_for:a.looking_for.length>0?a.looking_for:null,max_distance:a.max_distance?parseInt(a.max_distance):50,practice_intentions:a.practice_intentions.length>0?a.practice_intentions:null,teaching_comfort:a.teaching_comfort,learning_style:a.learning_style||null,practice_frequency:a.practice_frequency||null,preferred_class_
2size:a.preferred_class_size||null,weekly_availability:Object.keys(a.weekly_availability).length>0?a.weekly_availability:{}};console.log("Update data being sent:",t);let{error:d}=await E.from("profiles").update(t).eq("user_id",i.id).eq("is_dating_profile",!0);if(d&&d.message.includes("No rows")){const{error:k}=await E.from("profiles").insert({user_id:i.id,is_dating_profile:!0,user_type:"member",...t});d=k}if(d)throw d;N({title:"Profile updated!",description:"Your profile has been saved successfully."}),c("/dashboard")}catch(s){console.error("Error saving profile:",s),N({title:"Error saving profile",description:s.message,variant:"destructive"})}finally{O(!1)}}},Q=(s,t)=>{h(d=>{const k=d[t].includes(s)?d[t].filter(Y=>Y!==s):[...d[t],s];return console.log(`Toggling ${s} for ${t}:`,k),{...d,[t]:k}})};return R?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(I,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs("div",{className:"min-h-screen bg-gradient-subtle",children:[e.jsx("div",{className:"bg-background border-b border-border sticky top-0 z-10 safe-area-nav",children:e.jsx("div",{className:"container mx-auto px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(j,{variant:"ghost",onClick:()=>c("/dashboard"),children:e.jsx(Ee,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"bg-gradient-primary rounded-full p-2",children:e.jsx(oe,{className:"h-6 w-6 text-primary-foreground"})}),e.jsx("span",{className:"text-2xl font-bold bg-gradient-primary bg-clip-text text-transparent",children:"Edit Profile"})]})]}),e.jsxs(j,{onClick:K,disabled:A,variant:"hero",children:[A?e.jsx(I,{className:"h-4 w-4 animate-spin mr-2"}):e.jsx(re,{className:"h-4 w-4 mr-2"}),"Save Profile"]})]})})}),e.jsx("div",{className:"container mx-auto px-6 py-8 max-w-2xl",children:e.jsxs("div",{className:"space-y-6",children:[i&&e.jsx(Le,{userId:i.id}),e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsx(F,{children:"Profile Photos"}),e.jsx(L,{children:"Add photos to make your profile more attractive"})]}),e.jsx(P,{children:e.jsx(ye,{children:i&&e.jsx(be,{userId:i.id})})})]}),e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsx(F,{children:"Basic Information"}),e.jsx(L,{children:"Tell us about yourself"})]}),e.jsxs(P,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"display_name",className:r.display_name?"text-destructive":"",children:"Display Name *"}),e.jsx(W,{id:"display_name",value:a.display_name,onChange:s=>{h(t=>({...t,display_name:s.target.value})),C("display_name")},placeholder:"Your name",required:!0,className:r.display_name?"border-destructive focus-visible:ring-destructive":""}),r.display_name&&e.jsx("p",{className:"text-sm text-destructive",children:r.display_name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"age",className:r.age?"text-destructive":"",children:"Age"}),e.jsx(W,{id:"age",type:"number",min:"18",max:"100",value:a.age,onChange:s=>{h(t=>({...t,age:s.target.value})),C("age")},placeholder:"25",className:r.age?"border-destructive focus-visible:ring-destructive":""}),r.age&&e.jsx("p",{className:"text-sm text-destructive",children:r.age})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"gender",children:"Gender"}),e.jsxs(U,{value:a.gender,onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(z,{children:e.jsx(q,{placeholder:"Select gender"})}),e.jsxs($,{children:[e.jsx(w,{value:"man",children:"Man"}),e.jsx(w,{value:"woman",children:"Woman"}),e.jsx(w,{value:"non_binary",children:"Non-binary"}),e.jsx(w,{value:"prefer_not_to_say",children:"Prefer not to say"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"location",children:"Location"}),e.jsxs("div",{className:"relative",children:[e.jsx(G,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(W,{id:"location",value:a.location,onChange:s=>h(t=>({...t,location:s.target.value})),placeholder:"City, State",className:"pl-10",readOnly:!0})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the location selector below to set your precise location"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"bio",className:r.bio?"text-destructive":"",children:"About You"}),e.jsx(xe,{id:"bio",value:a.bio,onChange:s=>{h(t=>({...t,bio:s.target.value})),C("bio")},placeholder:"Tell others about yourself and your yoga journey...",rows:4,className:r.bio?"border-destructive focus-visible:ring-destructive":""}),r.bio&&e.jsx("p",{className:"text-sm text-destructive",children:r.bio}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.bio.length,"/500 characters"]})]})]})]}),e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-5 w-5"}),"Location"]}),l&&e.jsx(L,{children:l.city&&l.state?`${l.city}, ${l.state}`:l.city?l.city:`${l.latitude.toFixed(4)}, ${l.longitude.toFixed(4)}`})]}),e.jsx(P,{children:n?e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ne,{onLocationSelect:s=>{de(s),g(!1)},currentLocation:l}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"w-full",children:"Cancel"})]}):e.jsxs(j,{variant:"outline",className:"w-full gap-2",onClick:()=>g(!0),children:[e.jsx(G,{className:"h-4 w-4"}),"Change Location"]})})]}),e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsx(F,{children:"Yoga Experience"}),e.jsx(L,{children:"Help others understand your yoga background"})]}),e.jsxs(P,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Experience Level"}),e.jsxs(U,{value:a.yoga_experience,onValueChange:s=>h(t=>({...t,yoga_experience:s})),children:[e.jsx(z,{children:e.jsx(q,{placeholder:"Select your experience level"})}),e.jsxs($,{children:[e.jsx(w,{value:"just_starting",children:"Just starting my yoga journey"}),e.jsx(w,{value:"curious",children:"Curious about yoga"}),e.jsx(w,{value:"beginner",children:"Beginner"}),e.jsx(w,{value:"intermediate",children:"Intermediate"}),e.jsx(w,{value:"advanced",children:"Advanced"}),e.jsx(w,{value:"instructor",children:"Instructor"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Favorite Yoga Styles"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:De.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(H,{id:s,checked:a.favorite_yoga_styles.includes(s),onCheckedChange:()=>Q(s,"favorite_yoga_styles")}),e.jsx(f,{htmlFor:s,className:"capitalize cursor-pointer",children:s})]},s))})]})]})]}),e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsx(F,{children:"Practice Preferences"}),e.jsx(L,{children:"Tell us about your yoga goals and learning style"})]}),e.jsxs(P,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"What draws you to yoga practice?"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Ue.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(H,{id:s,checked:a.practice_intentions.includes(s),onCheckedChange:()=>Q(s,"practice_intentions")}),e.jsx(f,{htmlFor:s,className:"capitalize cursor-pointer text-sm",children:s.replace("_"," ")})]},s))})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Learning Style"}),e.jsxs(U,{value:a.learning_style,onValueChange:s=>h(t=>({...t,learning_style:s})),children:[e.jsx(z,{children:e.jsx(q,{placeholder:"How do you prefer to learn?"})}),e.jsx($,{children:ze.map(s=>e.jsx(w,{value:s,children:s.replace("_"," ")},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Practice Frequency"}),e.jsxs(U,{value:a.practice_frequency,onValueChange:s=>h(t=>({...t,practice_frequency:s})),children:[e.jsx(z,{children:e.jsx(q,{placeholder:"How often do you practice?"})}),e.jsx($,{children:qe.map(s=>e.jsx(w,{value:s,children:s.replace("_"," ")},s))})]})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Preferred Class Size"}
2),e.jsxs(U,{value:a.preferred_class_size,onValueChange:s=>h(t=>({...t,preferred_class_size:s})),children:[e.jsx(z,{children:e.jsx(q,{placeholder:"What size classes do you prefer?"})}),e.jsx($,{children:$e.map(s=>e.jsx(w,{value:s,children:s.replace("_"," ")},s))})]})]}),e.jsxs("div",{className:"flex items-center space-x-2 pt-8",children:[e.jsx(H,{id:"teaching_comfort",checked:a.teaching_comfort,onCheckedChange:s=>h(t=>({...t,teaching_comfort:!!s}))}),e.jsx(f,{htmlFor:"teaching_comfort",className:"cursor-pointer",children:"I enjoy helping beginners learn yoga"})]})]})]})]}),e.jsx(pe,{value:a.weekly_availability,onChange:s=>h(t=>({...t,weekly_availability:s}))}),e.jsxs(S,{children:[e.jsxs(T,{children:[e.jsx(F,{children:"Dating Preferences"}),e.jsx(L,{children:"What are you looking for?"})]}),e.jsxs(P,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Relationship Intentions"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Oe.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(H,{id:s,checked:a.relationship_intentions.includes(s),onCheckedChange:()=>Q(s,"relationship_intentions")}),e.jsx(f,{htmlFor:s,className:"capitalize cursor-pointer",children:s.replace("_"," ")})]},s))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"max_distance",className:r.max_distance?"text-destructive":"",children:"Maximum Distance (miles)"}),e.jsx(W,{id:"max_distance",type:"number",min:"1",max:"100",value:a.max_distance,onChange:s=>{h(t=>({...t,max_distance:s.target.value})),C("max_distance")},placeholder:"50",className:r.max_distance?"border-destructive focus-visible:ring-destructive":""}),r.max_distance&&e.jsx("p",{className:"text-sm text-destructive",children:r.max_distance})]})]})]}),e.jsx("div",{className:"flex justify-center pt-6 pb-4",children:e.jsxs(j,{onClick:K,disabled:A,variant:"hero",size:"lg",children:[A?e.jsx(I,{className:"h-4 w-4 animate-spin mr-2"}):e.jsx(re,{className:"h-4 w-4 mr-2"}),"Save Profile"]})}),e.jsx(Re,{compact:!0,className:"mt-6"}),i&&e.jsx(Me,{userId:i.id,userLatitude:(l==null?void 0:l.latitude)??null,userLongitude:(l==null?void 0:l.longitude)??null}),e.jsx(Be,{userId:i==null?void 0:i.id,navigate:c,toast:N})]})})]})},Be=({userId:i,navigate:y,toast:u})=>{const[v,b]=x.useState(!1),[_,R]=x.useState(!1);x.useEffect(()=>{var n;const m=/iPad|iPhone|iPod/.test(navigator.userAgent),r=window.Capacitor,p=!!((n=r==null?void 0:r.isNativePlatform)!=null&&n.call(r))||!!r;R(m&&p)},[]);const D=async()=>{if(i)try{b(!0);const{supabase:m}=await B(async()=>{const{supabase:N}=await import("./index-Cn6nJhWG.js").then(M=>M.Q);return{supabase:N}},__vite__mapDeps([1,2,3,4,5,6])),{data:r,error:p}=await m.functions.invoke("export-user-data");if(p)throw p;const n=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),g=window.URL.createObjectURL(n),c=document.createElement("a");c.href=g,c.download=`yogicurious-data-${i}.json`,document.body.appendChild(c),c.click(),document.body.removeChild(c),window.URL.revokeObjectURL(g),u({title:"Data exported successfully!"})}catch(m){const r=m instanceof Error?m.message:"Please try again.";u({title:`Export failed: ${r}`,variant:"destructive"})}finally{b(!1)}},A=async()=>{try{b(!0);const{platformPaymentService:m}=await B(async()=>{const{platformPaymentService:p}=await import("./platformPayments-CbC8KN8d.js");return{platformPaymentService:p}},__vite__mapDeps([7,2,3,8])),r=await m.restorePurchases();r.success?u({title:"Purchases restored successfully!"}):u({title:r.error||"No active purchases found.",variant:"destructive"})}catch(m){const r=m instanceof Error?m.message:"Please try again.";u({title:`Restore failed: ${r}`,variant:"destructive"})}finally{b(!1)}},O=async()=>{b(!0);try{const{supabase:m}=await B(async()=>{const{supabase:r}=await import("./index-Cn6nJhWG.js").then(p=>p.Q);return{supabase:r}},__vite__mapDeps([1,2,3,4,5,6]));await m.auth.signOut(),y("/auth",{replace:!0})}catch(m){const r=m instanceof Error?m.message:"Please try again.";u({title:`Sign out failed: ${r}`,variant:"destructive"}),b(!1)}},l=async()=>
2{if(!(!window.confirm("Are you sure you want to delete your account? This cannot be undone and will permanently delete all your data.")||!window.confirm("Final warning: your account and ALL data will be permanently deleted. Tap OK to confirm.")))try{b(!0);const{supabase:p}=await B(async()=>{const{supabase:g}=await import("./index-Cn6nJhWG.js").then(c=>c.Q);return{supabase:g}},__vite__mapDeps([1,2,3,4,5,6])),{error:n}=await p.functions.invoke("delete-user-account");if(n)throw n;u({title:"Account deleted successfully."}),await p.auth.signOut(),y("/")}catch(p){const n=p instanceof Error?p.message:"Please contact support.";u({title:`Deletion failed: ${n}`,variant:"destructive"})}finally{b(!1)}};return e.jsxs(S,{className:"mt-6",children:[e.jsxs(T,{children:[e.jsx(F,{children:"Account"}),e.jsx(L,{children:"Manage your account data and settings"})]}),e.jsxs(P,{className:"space-y-3",children:[e.jsxs(j,{variant:"outline",className:"w-full justify-start gap-3",onClick:D,disabled:v||!i,children:[e.jsx(Te,{className:"h-4 w-4"}),"Export My Data"]}),_&&e.jsxs(j,{variant:"outline",className:"w-full justify-start gap-3",onClick:A,disabled:v,children:[e.jsx(he,{className:"h-4 w-4"}),"Restore Purchases"]}),e.jsxs(j,{variant:"outline",className:"w-full justify-start gap-3",onClick:O,disabled:v,children:[e.jsx(Fe,{className:"h-4 w-4"}),"Sign Out"]}),e.jsx(ge,{}),e.jsxs(j,{variant:"destructive",className:"w-full justify-start gap-3",onClick:l,disabled:v,children:[e.jsx(Ae,{className:"h-4 w-4"}),"Delete Account"]})]})]})};export{zs 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.