PageSourceSearch

https://travelscape.ai/assets/HomePage-CBCO5d_r.js

js travelscape.ai collected 2026-10-05 13:07:49 UTC 60,654 bytes, 17 lines download raw bytes

1import{c as Lt,s as C,j as e,r as l,E as zt,B as Ft,D as je,a as ke,b as Mt,d as Ne,e as Rt,u as F,f as dt,g as Ut,L as ut,l as Bt,h as _e,C as mt,M as Ot,U as qt,i as Yt,k as Wt,t as Vt,m as Kt,n as Gt,o as Jt,p as Zt,X as Qt,T as pt,q as xt,v as ht,w as ft,H as Xt}from"./index-JwkmAz6m.js";import{B as ea,r as ta,n as aa,a as sa}from"./BottomNav-CYjBfvQd.js";import{N as pe}from"./NotificationsCenter-DpWo16l4.js";import{H as Xe}from"./HomeSidebar-XHzVH7V1.js";import{d as gt,T as bt}from"./TripCardImage-l1nxQv7G.js";import{P as ae,U as yt}from"./PublishItinerarySheet-ePwWJdbR.js";import{P as vt}from"./plus-BVd8_cRv.js";import{S as na}from"./popover-CvwFP34n.js";import{T as ia}from"./TripPublicationMenu-D4P00HhF.js";import{fetchUserTrips as oa}from"./userTrips-2RICtehS.js";import{M as ra}from"./mail-gMGf1ZQb.js";import{L as la}from"./LiveTripBanner-C7opTk5n.js";import{B as ca}from"./bell-DGjVEE6s.js";import{G as da}from"./globe-LVfrR4tC.js";import{f as ua,P as ma,a as pa,H as xa,c as ha}from"./HangoutComposerSheet-CHckK4K1.js";import{T as fa}from"./trash-2-Cv_o79S6.js";import{C as wt}from"./calendar-DimaV86N.js";import{i as ga,f as ba,s as ya,c as va,m as wa,v as ja,p as ka,a as Na,n as _a,b as Sa,d as Ca,e as Da,g as $a,u as Ea,h as Ta,j as Ha,k as Ia,t as Aa}from"./vietnam-hero-C51LTqLf.js";import{c as Pa}from"./cabo-san-lucas-hero-BRUtBzF_.js";import{c as La}from"./czech-republic-hero-Nk2QGM7U.js";import{b as za}from"./bulgaria-hero.jpg.asset-DPn2GnhA.js";import{g as Fa}from"./greece-hero-n6ptozIN.js";import{j as Ma}from"./japan-hero-RtELjh09.js";import{l as Ra}from"./lisbon-hero-BVrit2td.js";import{m as Ua}from"./madeira-hero-CN3NYTsj.js";import{m as Ba}from"./medellin-hero-C0xXDXer.js";import{m as et}from"./mexico-city-hero-BWflaORU.js";import{m as Oa}from"./milos-hero-DFg-GxSK.js";import{e as qa}from"./egypt-header-2hzj4hGc.js";import{o as Ya}from"./okinawa-hero-BWQuMAj3.js";import{p as Wa}from"./phu-quoc-hero-CFvzWRdA.js";import{p as Va}from"./portugal-hero-BKP4jKYh.js";import{s as Ka}from"./switzerland-hero-0ax90NnQ.js";import{t as Ga}from"./thailand-hero-CnpcKNvr.js";import{r as Ja}from"./uzbekistan-registan-hero.jpg.asset-wQxtCEFK.js";import{p as se,f as Za}from"./tripDates-Me2FW_5N.js";import{m as j}from"./proxy-kRnoO8n6.js";import{P as Qa}from"./plane-ldUW6sNt.js";import{C as Xa}from"./chevron-right-zLE0u7Sp.js";import{D as es}from"./download--fFjhJOs.js";import"./use-mobile-D4vQePLD.js";import"./tripPeople-D6zqd3oD.js";import"./index-QsA2kq31.js";import"./user-plus-CH9jqkmU.js";import"./logo-auth-Bo7EX0s0.js";import"./UnsplashCredit-B9N3e7tJ.js";import"./saveSuggestionToTrip-pBVUH4aE.js";import"./alert-dialog-C66vV9IB.js";import"./input-vB7x3GL4.js";import"./label-CkGBJ5Mu.js";import"./switch-B-Yv8S38.js";import"./index-DAgVniAf.js";import"./useRequireVerifiedEmail-6TTaXJSe.js";import"./index-ChFSgUJa.js";import"./PlaceImage-sEqWL95u.js";import"./PhotonPlaceInput-ClsMAOZL.js";import"./SignUpModal-Cill1LS3.js";import"./AuthForm-PR9fZdPH.js";import"./ForgotPasswordModal-BqDlUwfI.js";import"./biometricAuth-BHFnkY5W.js";import"./lock-CowiNct0.js";import"./UpgradeToProModal-cmMQk6Hu.js";import"./featureFlags-DFbh-N9x.js";import"./parseISO-DbE6DtUH.js";import"./differenceInCalendarDays-iUPPqFBQ.js";import"./hotel-B4YY6Jgy.js";import"./utensils-crossed-qwp2eImq.js";import"./imageUpload-D2a9OT1o.js";import"./PlaceAutocomplete-CmhaVqtc.js";import"./persistItemCoords-jmpwkesq.js";import"./invokeGeocodeItems-CjG9IJV5.js";import"./external-link-DlKhb-rA.js";import"./useRouteStopImage-8TkmK5wE.js";import"./calendar-days-C-Zj0kCM.js";import"./clock-BEOsPhty.js";import"./info-CINv5J7_.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ts=Lt("PencilLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]]),H=t=>String(t!=null?t:"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),te=t=>{if(!t)return"";const s=new Date(`${t.slice(0,10)}T12:00:00`);return Number.isNaN(s.getTime())?"":s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"})},tt={breakfast:1,morning:2,brunch:2,lunch:3,afternoon:4,evening:5,dinner:6,night:7};async function as(t){var g,S;const{data:s,error:n}=await C.from("saved_trip_items").select("name, item_type, location, day_number, time_slot, reservation_time, check_in_date, check_out_date, confirmation_number, booking_notes").eq("trip_id",t.id);if(n)throw n;const i=s!=null?s:[],a=new Map;for(const p of i){const d=(g=p.day_number)!=null?g:null;((S=a.get(d))!=null?S:a.set(d,[]).get(d)).push(p)}const o=[...a.keys()].sort((p,d)=>p==null?1:d==null?-1:p-d),u=p=>{if(!t.start_date)return"";const d=new Date(`${t.start_date.slice(0,10)}T12:00:00`);return d.setDate(d.getDate()+p-1),d.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})},c=o.map(p=>{const d=a.get(p).sort((k,$)=>{var I,M;return((I=tt[(k.time_slot||"").toLowerCase()])!=null?I:9)-((M=tt[($.time_slot||"").toLowerCase()])!=null?M:9)}),x=p==null?"Unscheduled":`Day ${p}${u(p)?` · ${u(p)}`:""}`,N=d.map(k=>{const $=[k.item_type,k.time_slot||k.reservation_time,k.check_in_date?`Check-in ${te(k.check_in_date)}
6`:"",k.check_out_date?`Check-out ${te(k.check_out_date)}`:""].filter(Boolean).map(H).join(" · ");return`<li><strong>${H(k.name)}</strong>${$?`<div class="m">${$}</div>`:""}${k.location?`<div class="l">${H(k.location)}</div>`:""}${k.confirmation_number?`<div class="c">Confirmation: ${H(k.confirmation_number)}</div>`:""}${k.booking_notes?`<div class="n">${H(k.booking_notes)}</div>`:""}</li>`}).join("");return`<section><h2>${H(x)}</h2><ul>${N}</ul></section>`}).join(""),f=[te(t.start_date),te(t.end_date)].filter(Boolean).join(" – "),y=`<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
7<title>${H(t.name)} — Travelscape</title><style>
8body{font-family:-apple-system,system-ui,sans-serif;background:#F8F5F0;color:#483434;margin:0;padding:24px;max-width:720px;margin:auto}
9h1{font-size:26px;margin:0 0 4px}.r{opacity:.65;font-size:14px;margin-bottom:20px}
10section{background:#fff;border-radius:14px;padding:16px 18px;margin-bottom:14px;box-shadow:0 4px 12px -6px rgba(72,52,52,.15)}
11h2{font-size:16px;margin:0 0 10px}ul{list-style:none;padding:0;margin:0}li{padding:10px 0;border-top:1px solid #EFE7DE}li:first-child{border-top:0}
12.m{font-size:13px;opacity:.7;text-transform:capitalize}.l,.c,.n{font-size:13px;margin-top:3px}.c{font-weight:600}
13footer{font-size:12px;opacity:.5;margin-top:20px}</style></head><body>
14<h1>${H(t.name)}</h1><div class="r">${H(f)}</div>
15${c||"<section><p>No stops saved yet.</p></section>"}
16<footer>Saved from Travelscape on ${H(new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}))}. Works offline.</footer>
17</body></html>`,m=new Blob([y],{type:"text/html"}),w=URL.createObjectURL(m),h=document.createElement("a");h.href=w,h.download=`${t.name.replace(/[^\w\- ]+/g,"").trim()||"trip"} - Travelscape.html`,document.body.appendChild(h),h.click(),h.remove(),setTimeout(()=>URL.revokeObjectURL(w),1e3)}const J=({title:t,description:s,actionLabel:n,onAction:i,className:a=""})=>e.jsxs("div",{className:`flex flex-col items-center justify-center text-center py-10 ${a}`,children:[e.jsx("p",{className:"font-body text-[15px] font-medium text-navy",children:t}),e.jsx("p",{className:"font-body text-[12px] text-navy/70 mt-1.5 max-w-xs",children:s}),e.jsxs("button",{onClick:i,className:"mt-4 inline-flex items-center gap-2 h-9 px-4 rounded-full font-body text-[13px] font-medium transition-opacity hover:opacity-90",style:{background:"#483434",color:"#F3EFED"},children:[e.jsx(vt,{className:"w-4 h-4",strokeWidth:1.8}),n]})]});function jt(t){const[s,n]=l.useState([]),[i,a]=l.useState(!0),o=l.useCallback(async()=>{if(!t){n([]),a(!1);return}const{data:u}=await C.from("trip_journals").select("id, trip_id, cover_photo_url, summary, tags, saves_count, views_count, published_at").eq("user_id",t).eq("is_published",!0).order("published_at",{ascending:!1}),c=u||[],f=Array.from(new Set(c.map(m=>m.trip_id).filter(Boolean)));let y=new Map;if(f.length>0){const{data:m}=await C.from("trips").select("id, name").in("id",f);y=new Map((m||[]).map(w=>[w.id,w.name]))}n(c.map(m=>{var w,h,g,S,p,d;return{id:m.id,trip_id:m.trip_id,cover_photo_url:(w=m.cover_photo_url)!=null?w:null,summary:(h=m.summary)!=null?h:null,tags:(g=m.tags)!=null?g:[],saves_count:(S=m.saves_count)!=null?S:0,views_count:(p=m.views_count)!=null?p:0,published_at:(d=m.published_at)!=null?d:null,trip_name:y.get(m.trip_id)||"Trip"}})),a(!1)},[t]);return l.useEffect(()=>{o()},[o]),{journals:s,loading:i,refresh:o}}const at=t=>t>=1e3?`${(Math.round(t/100)/10).toLocaleString()}k`:`${t}`,xe=({userId:t,layout:s="grid",journals:n,loading:i,onRefresh:a,onViewAll:o,onEmptyAction:u})=>{const c=jt(t),f=n!=null?n:c.journals,y=i!=null?i:c.loading,m=a!=null?a:c.refresh,[w,h]=l.useState(null),[g,S]=l.useState(null);if(y)return null;if(f.length===0)return u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"font-body text-[15px] font-bold text-navy",children:"Your published itineraries"}),o&&e.jsx("button",{onClick:o,className:"font-body text-[12px] font-medium text-navy/70 hover:text-navy transition-colors",children:"View all"})]}),e.jsx(J,{className:"py-6",title:"No trips published",description:"Share your travel guides with the community.",actionLabel:"Publish itinerary",onAction:u})]}):null;const p=x=>e.jsxs("div",{className:`group rounded-[14px] bg-white overflow-hidden flex-shrink-0 ${s==="scroll"?"w-[240px]":"w-full"}`,style:{border:"0.5px solid rgb(var(--beige-warm))"},children:[e.jsx("div",{className:"p-2 pb-0",children:e.jsxs("div",{className:"relative h-36 rounded-[10px] overflow-hidden bg-muted",children:[e.jsx(na,{src:x.cover_photo_url,alt:x.trip_name,className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100 max-lg:opacity-100 transition-opacity",children:e.jsx(ia,{tripI
17d:x.trip_id,status:{journalId:x.id,publishedAt:x.published_at,savesCount:x.saves_count},onUnpublished:m,onEditPublished:()=>{S(x.trip_id),h(x.id)}})})]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-2.5",children:[e.jsx("p",{className:"font-body text-[14px] font-semibold text-navy truncate leading-snug",children:x.trip_name}),e.jsxs("div",{className:"flex items-center gap-4 mt-1.5 font-body text-[12px] text-navy/55",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",title:`${x.views_count} views`,children:[e.jsx(zt,{className:"w-4 h-4",strokeWidth:1.8}),at(x.views_count)]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",title:`${x.saves_count} saves`,children:[e.jsx(Ft,{className:"w-4 h-4",strokeWidth:1.8}),at(x.saves_count)]})]})]})]},x.id),d=e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"font-body text-[15px] font-bold text-navy",children:"Your published itineraries"}),o&&e.jsx("button",{onClick:o,className:"font-body text-[12px] font-medium text-navy/70 hover:text-navy transition-colors",children:"View all"})]});return e.jsxs(e.Fragment,{children:[s==="scroll"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx("h2",{className:"font-body text-[10px] font-semibold tracking-[0.2em] uppercase text-navy/60",children:"Your published itineraries"})}),e.jsx("div",{className:"flex items-start gap-3 overflow-x-auto pb-2 -mx-5 px-5 scrollbar-none",children:f.map(p)})]}):e.jsxs(e.Fragment,{children:[d,e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:f.map(p)})]}),e.jsx(ae,{open:!!w,onOpenChange:x=>{x||(h(null),S(null),m())},preselectedTripId:g,editJournalId:w})]})};function ss({open:t,onOpenChange:s,currentEmail:n}){const[i,a]=l.useState(""),[o,u]=l.useState(!1);l.useEffect(()=>{t&&a("")},[t]);const c=async f=>{f.preventDefault();const y=i.trim();if(!y||y.toLowerCase()===n.toLowerCase()){F.error("Enter a different email");return}u(!0);try{const{error:m}=await C.auth.updateUser({email:y},{emailRedirectTo:`${window.location.origin}/home`});if(m)throw m;F.success(`Verification link sent to ${y}`),s(!1)}catch(m){F.error((m==null?void 0:m.message)||"Could not update email")}finally{u(!1)}};return e.jsx(je,{open:t,onOpenChange:s,children:e.jsxs(ke,{className:"sm:max-w-md",children:[e.jsxs(Mt,{children:[e.jsx(Ne,{className:"font-display",children:"Change email"}),e.jsx(Rt,{className:"font-body text-sm",children:"We'll send a new verification link to your updated address. You'll stay signed in."})]}),e.jsxs("form",{onSubmit:c,className:"space-y-3 pt-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"font-body text-xs text-navy/60 block mb-1",children:"Current"}),e.jsx("input",{type:"email",value:n,disabled:!0,className:"w-full rounded-lg px-3 py-2.5 text-base bg-beige/50 text-navy/60",style:{border:"0.5px solid rgb(var(--beige-warm))"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-body text-xs text-navy/60 block mb-1",children:"New email"}),e.jsx("input",{type:"email",required:!0,autoFocus:!0,value:i,onChange:f=>a(f.target.value),placeholder:"[email protected]",className:"w-full rounded-lg px-3 py-2.5 text-base bg-white text-navy outline-none focus:ring-2 focus:ring-navy/20",style:{border:"0.5px solid rgb(var(--beige-warm))"}})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>s(!1),className:"px-4 py-2 rounded-full bg-white text-navy font-body text-xs font-semibold hover:bg-beige-warm/40 transition-colors",style:{border:"0.5px solid rgb(var(--beige-warm))"},children:"Cancel"}),e.jsx("button",{type:"submit",disabled:o,className:"px-4 py-2 rounded-full bg-navy text-white font-body text-xs font-semibold hover:bg-navy/90 transition-colors disabled:opacity-60",children:o?"Sending...":"Send verification"})]})]})]})})}function he(){const{isLoggedIn:t,emailConfirmed:s,email:n,loading:i}=dt(),[a,o]=l.useState(0),[u,c]=l.useState(!1),[f,y]=l.useState(!1);if(i||!t||s||!n)return null;const m=()=>{o(60);const h=setInterval(()=>{o(g=>g<=1?(clearInterval(h),0):g-1)},1e3)},w=async()=>
17{if(!(a>0||u)){c(!0);try{const{error:h}=await C.auth.resend({type:"signup",email:n,options:{emailRedirectTo:`${window.location.origin}/home`}});if(h)throw h;F.success(`Verification email sent to ${n}`),m()}catch(h){F.error((h==null?void 0:h.message)||"Could not resend email")}finally{c(!1)}}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl px-4 py-3 flex items-start gap-3",style:{background:"hsl(var(--beige))",border:"0.5px solid rgb(var(--beige-warm))"},children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-white flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(ra,{className:"w-4 h-4 text-navy"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-display text-sm text-navy leading-snug",children:"Verify your email to activate your account."}),e.jsxs("p",{className:"font-body text-[12px] text-navy/65 mt-1 leading-snug",children:["We sent a confirmation link to ",e.jsx("span",{className:"font-semibold",children:n}),' — check your inbox and click "Activate My Account" to unlock all features.']}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2.5",children:[e.jsx("button",{onClick:w,disabled:a>0||u,className:"px-3 py-1.5 rounded-full bg-navy text-white font-body text-[11px] font-semibold hover:bg-navy/90 transition-colors disabled:opacity-60",children:u?"Sending...":a>0?`Sent! Resend in ${a}s`:"Resend email"}),e.jsx("button",{onClick:()=>y(!0),className:"px-3 py-1.5 rounded-full bg-white text-navy font-body text-[11px] font-semibold hover:bg-beige-warm/40 transition-colors",style:{border:"0.5px solid rgb(var(--beige-warm))"},children:"Change email"})]})]})]}),e.jsx(ss,{open:f,onOpenChange:y,currentEmail:n})]})}const ns="/assets/home-hero-palm-D6_Eeb3v.jpg",kt="/assets/home-cover-coconuts-DoxYYYX0.jpg",is="/assets/home-cover-wildflowers-C6IUM-g_.jpg",os="/assets/home-cover-grass-plumes-6vIt3Ybp.jpg",rs="/assets/home-cover-frost-meadow-DUqVs9UH.jpg",ls="/assets/home-cover-autumn-lake-tNfzGyEK.jpg",st=[kt,is,os,rs,ls,ns],cs=kt,nt=t=>`home-hero-cover:${t}`;function ds(){const[t,s]=l.useState(null),[n,i]=l.useState(cs);return l.useEffect(()=>{Ut().then(o=>{var c,f;const u=(f=(c=o==null?void 0:o.user)==null?void 0:c.id)!=null?f:null;if(s(u),u){const y=localStorage.getItem(nt(u));y&&i(y)}})},[]),{uid:t,cover:n,setCover:o=>{i(o),t&&localStorage.setItem(nt(t),o)}}}async function us(t){const s=await createImageBitmap(t),n=Math.min(1,2e3/s.width),i=document.createElement("canvas");return i.width=Math.round(s.width*n),i.height=Math.round(s.height*n),i.getContext("2d").drawImage(s,0,0,i.width,i.height),new Promise((a,o)=>i.toBlob(u=>u?a(u):o(new Error("encode")),"image/jpeg",.85))}function ms({open:t,onOpenChange:s,uid:n,current:i,firstName:a,onApply:o}){const[u,c]=l.useState(i),[f,y]=l.useState([]),[m,w]=l.useState(!1),h=l.useRef(null);l.useEffect(()=>{t&&(c(i),!st.includes(i)&&!f.includes(i)&&y(p=>[i,...p]))},[t,i]);const g=async p=>{if(!(!p||!n)){w(!0);try{const d=await us(p),x=await Bt(),N=`${n}/home-cover-${Date.now()}.jpg`;let k=null;for(const I of[0,400,1200]){I&&await new Promise(V=>setTimeout(V,I));const{error:M}=await x.storage.from("avatars").upload(N,d,{upsert:!0,contentType:"image/jpeg"});if(!M){k=null;break}k=M}if(k)throw k;const $=x.storage.from("avatars").getPublicUrl(N).data.publicUrl;y(I=>[$,...I]),c($)}catch{F.error("Your photo wasn't uploaded, so your cover is unchanged.")}finally{w(!1),h.current&&(h.current.value="")}}},S=[...f,...st];return e.jsx(je,{open:t,onOpenChange:s,children:e.jsxs(ke,{className:"max-w-[520px] rounded-[20px] p-6 gap-4 font-body bg-card",children:[e.jsx(Ne,{className:"font-body font-medium text-[18px]",style:{color:"#483434"},children:"All cover photos"}),e.jsxs("div",{className:"relative h-[216px] rounded-[12px] overflow-hidden flex items-end",style:{backgroundImage:`url(${u})`,backgroundSize:"cover",backgroundPosition:"center",backgroundColor:"hsl(var(--navy))"},children:[e.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, rgba(9,8,8,0) 40%, rgba(9,8,8,0.6) 100%)"}}),e.jsxs("div",{className:"relative p-5",children:[e.jsxs("p",{className:"text-[20px] leading-tight",style:{color:"#f3efed"},children:["Hey, ",a,"!"]}),e.jsx("p",{className:"text-[13px] mt-1",style:{color:"#dcd2d1"},children:"Let's keep planning your trips!"})]})]}
17),e.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>{var p;return(p=h.current)==null?void 0:p.click()},disabled:m||!n,className:"aspect-[4/3] rounded-[8px] border border-dashed flex flex-col items-center justify-center gap-1 text-[12px] disabled:opacity-60",style:{borderColor:"#b9a5a5",color:"#483434",background:"#faf7f5"},children:[m?e.jsx(ut,{className:"w-4 h-4 animate-spin"}):e.jsx(yt,{className:"w-4 h-4"}),"Upload"]}),S.map(p=>{const d=p===u;return e.jsxs("button",{type:"button",onClick:()=>c(p),"aria-pressed":d,className:"relative aspect-[4/3] rounded-[8px] overflow-hidden",style:{outline:d?"2px solid #483434":"none",outlineOffset:1},children:[e.jsx("img",{src:p,alt:"",loading:"lazy",className:"w-full h-full object-cover"}),e.jsx("span",{className:"absolute top-1.5 left-1.5 w-3.5 h-3.5 rounded-full border-2 flex items-center justify-center",style:{borderColor:"#fff",background:d?"#fff":"rgba(255,255,255,0.35)"},children:d&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"#483434"}})})]},p)})]}),e.jsx("input",{ref:h,type:"file",accept:"image/*",className:"hidden",onChange:p=>{var d;return g((d=p.target.files)==null?void 0:d[0])}}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>s(!1),className:"h-11 rounded-full text-[15px] font-medium",style:{background:"#f3efed",color:"#483434"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>{o(u),s(!1)},className:"h-11 rounded-full text-[15px] font-medium",style:{background:"#483434",color:"#fcfcfc"},children:"Apply"})]})]})})}function fe({firstName:t,resumeTripId:s,onPublish:n,onOpenNotifications:i,onOpenSettings:a,notifCount:o=0,showIcons:u=!0,className:c=""}){const f=_e(),{uid:y,cover:m,setCover:w}=ds(),[h,g]=l.useState(!1),S="relative flex items-center justify-center rounded-[100px] p-[14px] transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#fcfcfc]/70",p={background:"rgba(5,4,4,0.14)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"};return e.jsxs("section",{"aria-label":"Welcome",className:`relative overflow-hidden rounded-[16px] min-h-[300px] md:min-h-[340px] flex flex-col ${c}`,style:{backgroundColor:"hsl(var(--navy))",backgroundImage:`url(${m})`,backgroundSize:"cover",backgroundPosition:"bottom center"},children:[u&&e.jsxs("div",{className:"relative z-10 flex justify-end gap-2 p-4 md:p-6",children:[e.jsxs("button",{onClick:i,"aria-label":o>0?`Notifications, ${o} unread`:"Notifications",className:S,style:p,children:[e.jsx(ca,{className:"w-5 h-5",style:{color:"#fcfcfc"}}),o>0&&e.jsx("span",{className:"absolute top-1 right-1 min-w-[16px] h-4 px-1 rounded-full bg-destructive text-[8px] font-bold text-destructive-foreground flex items-center justify-center",children:o>99?"99+":o})]}),e.jsx("button",{onClick:()=>g(!0),"aria-label":"Change cover photo",className:S,style:p,children:e.jsx(ts,{className:"w-5 h-5",style:{color:"#fcfcfc"}})})]}),e.jsx(ms,{open:h,onOpenChange:g,uid:y,current:m,firstName:t,onApply:w}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{"aria-hidden":!0,className:"absolute inset-x-0 bottom-0 h-full min-h-[121px] pointer-events-none",style:{background:"linear-gradient(180deg, rgba(9,8,8,0) 0%, rgba(9,8,8,0.25) 32.447%, rgba(9,8,8,0.6) 69.066%, rgba(9,8,8,0.7) 100%)",backdropFilter:"blur(15px)",WebkitBackdropFilter:"blur(15px)",maskImage:"linear-gradient(180deg, transparent 0%, #000 35%)",WebkitMaskImage:"linear-gradient(180deg, transparent 0%, #000 35%)"}}),e.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row md:items-end md:justify-between gap-4 px-5 md:px-8 pt-10 pb-5 md:pb-6 font-body",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"font-body font-normal text-[24px] leading-[24px] md:text-[32px] md:leading-[32px]",style:{letterSpacing:"-0.8px",color:"#f3efed"},children:["Hey, ",t,"!"]}),e.jsx("p",{className:"mt-1 font-body font-medium text-[14px] md:text-[16px] leading-[22px]",style:{color:"#dcd2d1"},children:"Let's keep planning your trips!"})]}),e.jsxs("div",{className:"flex w-full items-center gap-1.5 md:w-auto md:flex-shrink-0 md:gap-2",children:[e.jsxs("button",{onClick:n,className:"h-10 flex-1 justify-center gap-1.5 rounded-full px-2 inline-flex items-center font-body font-medium text-[12px] whitespace-nowrap transition-opacity hover:opacity-85 md:h-12 md:flex-none md:gap-2 md:px-5 md:text-[15px]",style:{border:"1px solid #fcfcfc",color:"#fcfcfc",background:"rgba(252,252,252,0.08)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},children:[e.jsx(da,{className:"w-4 h-4 shrink-0"}),"Publish itinerary"]}),e.jsx("button",{onClick:()=>f("/chat?new=1"),className:"h-10 flex-1 justify-center rounded-full px-2 inline-flex items-center font-body font-medium text-[12px] whitespace-nowrap transition-opacity hover:opacity-90 md:h-12 md:flex-none md:px-6 md:text-[15px]",style:{background:"#f3efed",color:"#483434"},children:"Start planning new trip"})]})]})]})]})}const ps={solo:{bg:"linear-gradient(135deg, #FEFBF0 0%, #F8F0D4 45%, #F2E3AE 78%, #E8D19A 100%)",dot:"#C7A45C",text:"#483434"},plus_one:{bg:"linear-gradient(135deg, #F3FAFD 0%, #D9EAF3 45%, #C1DBE8 78%, #AFCFE2 100%)",dot:"#8FB8D3",text:"#483434"},small_group:{bg:"linear-gradient(135deg, #D9EAF3 0%, #C1DBE8 50%, #AFCFE2 100%)",dot:"#7FA8C4",text:"#483434"}},xs={solo:1,plus_one:2,small_group:4};function hs({signedIn:t,onRequireAuth:s,defaultArea:n}){const i=_e(),[a,o]=l.useState([]),[u,c]=l.useState(!0),[f,y]=l.useState(!1),[m,w]=l.useState(null),[h,g]=l.useState(!1),S=l.useCallback(async()=>
17{if(!t){o([]),c(!1);return}c(!0);const d=await ua({coords:null,destination:null});o(d.filter(x=>x.is_mine)),c(!1)},[t]);l.useEffect(()=>{S()},[S]),l.useEffect(()=>{const d=window.setInterval(()=>{o(x=>x.filter(N=>new Date(N.ends_at).getTime()>Date.now()))},3e4);return()=>window.clearInterval(d)},[]);const p=async()=>{if(!m)return;g(!0);const d=await ha(m.id);if(g(!1),!d){F.error("Couldn't remove that hangout"),w(null);return}o(x=>x.filter(N=>N.id!==m.id)),F.success("Hangout removed"),w(null)};return e.jsxs("div",{className:"rounded-[20px] p-5 md:p-6",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-body text-[15px] font-bold text-navy",children:"Your hangouts"}),e.jsx("button",{onClick:()=>i("/people?tab=hangouts"),className:"font-body text-[12px] font-medium text-navy/60 hover:text-navy transition-colors",children:"View all"})]}),e.jsx("p",{className:"mt-1 font-body text-[13px] text-navy/55",children:"Post what you're up to and meet travelers nearby."}),!(t&&!u&&a.length===0)&&e.jsxs("button",{onClick:()=>t?y(!0):s(),className:"mt-4 flex w-full items-center justify-center gap-2 rounded-full py-2.5 font-body text-[13px] font-medium text-navy transition-colors hover:bg-white/60",style:{border:"1.5px dashed hsl(var(--navy) / 0.35)"},children:[e.jsx(vt,{className:"h-4 w-4"}),"Post a new one"]}),t&&e.jsx("div",{className:"mt-4",children:u?e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(ut,{className:"h-4 w-4 animate-spin text-primary"})}):a.length===0?e.jsx(J,{title:"No hangouts nearby",description:"Be the first to share your plans and meet fellow travelers!",actionLabel:"Post a hangout",onAction:()=>y(!0)}):e.jsx("div",{className:"space-y-3",children:a.map(d=>{const x=ps[d.party_size];return e.jsxs("div",{className:"rounded-2xl bg-white p-4",style:{border:"0.5px solid rgb(var(--beige-warm))"},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-3 py-1 font-body text-[11px] font-medium",style:{background:x.bg,color:x.text},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:x.dot}}),ma[d.party_size]]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-beige/60 px-3 py-1 font-body text-[11px] text-navy/70",children:[e.jsx(mt,{className:"h-3 w-3"}),d.interested_count,"/",xs[d.party_size]]})]}),e.jsx("button",{onClick:()=>w(d),"aria-label":`Remove ${d.title}`,className:"text-navy/40 transition-colors hover:text-navy",children:e.jsx(fa,{className:"h-4 w-4",strokeWidth:1.8})})]}),e.jsx("p",{className:"mt-2.5 font-body text-[14px] font-semibold text-navy",children:d.title}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-1.5 border-t pt-3 font-body text-[12px] text-navy/55",style:{borderColor:"rgb(var(--beige-warm))"},children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Ot,{className:"h-3.5 w-3.5",strokeWidth:1.8}),d.area_label]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(wt,{className:"h-3.5 w-3.5",strokeWidth:1.8}),pa(d.starts_at,d.ends_at)]})]}),d.interested_count>0&&e.jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[e.jsx("div",{className:"flex -space-x-1.5",children:d.interested_people.slice(0,3).map(N=>N.avatar_url?e.jsx("img",{src:N.avatar_url,alt:N.display_name||"Traveler",className:"h-5 w-5 rounded-full border border-white object-cover"},N.user_id):e.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full border border-white bg-primary/10",children:e.jsx(qt,{className:"h-2.5 w-2.5 text-primary"})},N.user_id))}),e.jsxs("button",{onClick:()=>i("/people?tab=hangouts"),className:"font-body text-[11px] font-medium text-primary hover:underline",children:[d.interested_count," interested — view"]})]})]},d.id)})})}),e.jsx(je,{open:m!==null,onOpenChange:d=>!d&&!h&&w(null),children:e.jsxs(ke,{className:"max-w-[420px] rounded-2xl border-0 bg-white p-6",children:[e.jsx(Ne,{className:"font-body text-[17px] font-bold text-navy",children:"Delete hangout?"}),e.jsxs("p",{className:"mt-3 font-body text-[14px] leading-relaxed text-navy/70",children:["Are you sure you want to delete [",m==null?void 0:m.title,"]? This action cannot be undone and other travelers won't be able to join."]}),e.jsxs("div",{className:"mt-5 flex gap-3",children:[e.jsx("button",{onClick:()=>w(null),disabled:h,className:"flex-1 rounded-full py-2.5 font-body text-[14px] font-medium text-navy transition-colors hover:bg-[#
17EAE5DD]",style:{background:"#F1EDE6"},children:"Cancel"}),e.jsx("button",{onClick:p,disabled:h,className:"flex-1 rounded-full py-2.5 font-body text-[14px] font-medium text-[#C33B33] transition-colors hover:bg-[#F1CFCC]",style:{background:"#F6DBD9"},children:h?"Deleting…":"Delete hangout"})]})]})}),e.jsx(xa,{open:f,onOpenChange:y,defaultArea:n,onPosted:S})]})}const fs=za.url,it=[{slug:"italy",name:"Italy",image:ga,keywords:["italy","rome","florence","venice","amalfi","tuscany","milan","positano"],tags:["europe","food","culture","coast"]},{slug:"japan",name:"Japan",image:Ma,keywords:["japan","tokyo","osaka","shibuya","fuji"],tags:["asia","culture","food","city"]},{slug:"greece",name:"Greece",image:Fa,keywords:["greece","santorini","athens","mykonos","naxos","paros"],tags:["europe","islands","coast","beach"]},{slug:"france",name:"France",image:ba,keywords:["france","paris","nice","lyon","bordeaux","marseille"],tags:["europe","food","culture","city"]},{slug:"bali",name:"Bali",image:Yt,keywords:["bali","ubud","canggu","uluwatu","indonesia"],tags:["asia","beach","wellness","surf"]},{slug:"portugal",name:"Portugal",image:Va,keywords:["portugal","lisbon","porto","algarve","madeira"],tags:["europe","coast","food","city"]},{slug:"spain",name:"Spain",image:ya,keywords:["spain","barcelona","madrid","seville","mallorca","ibiza"],tags:["europe","food","culture","city"]},{slug:"croatia",name:"Croatia",image:va,keywords:["croatia","split","dubrovnik","hvar","plitvice"],tags:["europe","coast","islands"]},{slug:"morocco",name:"Morocco",image:wa,keywords:["morocco","marrakech","fez","chefchaouen","atlas"],tags:["africa","culture","desert"]},{slug:"egypt",name:"Egypt",image:qa,keywords:["egypt","cairo","giza","pyramids","luxor","aswan","nile","red sea","hurghada","sharm el sheikh","alexandria"],tags:["africa","culture","history","beach","diving"]},{slug:"vietnam",name:"Vietnam",image:ja,keywords:["vietnam","hanoi","hoi an","ha long","saigon"],tags:["asia","food","culture"]},{slug:"thailand",name:"Thailand",image:Ga,keywords:["thailand","bangkok","phuket","chiang mai","koh samui"],tags:["asia","beach","food"]},{slug:"peru",name:"Peru",image:ka,keywords:["peru","machu picchu","cusco","lima","sacred valley"],tags:["americas","hiking","culture"]},{slug:"argentina",name:"Argentina",image:Na,keywords:["argentina","patagonia","buenos aires","mendoza","el chalten"],tags:["americas","hiking","wine"]},{slug:"new-zealand",name:"New Zealand",image:_a,keywords:["new zealand","queenstown","milford","auckland","south island"],tags:["pacific","hiking","road trip"]},{slug:"australia",name:"Australia",image:Sa,keywords:["australia","sydney","melbourne","cairns","great barrier reef"],tags:["pacific","beach","city"]},{slug:"south-korea",name:"South Korea",image:Ca,keywords:["south korea","seoul","busan","jeju"],tags:["asia","food","city"]},{slug:"albania",name:"Albania",image:Da,keywords:["albania","tirana","himara","dhermi","riviera"],tags:["europe","beach","budget"]},{slug:"slovenia",name:"Slovenia",image:$a,keywords:["slovenia","ljubljana","bled","bohinj"],tags:["europe","hiking","lakes"]},{slug:"czech-republic",name:"Czech Republic",image:La,keywords:["czech","czechia","prague"],tags:["europe","city","culture"]},{slug:"bulgaria",name:"Bulgaria",image:fs,keywords:["bulgaria","sofia","plovdiv","bansko","black sea"],tags:["europe","city","culture","mountains","beach"]},{slug:"switzerland",name:"Switzerland",image:Ka,keywords:["switzerland","zermatt","zurich","geneva","lucerne","interlaken","jungfrau","matterhorn","glacier express","st moritz","swiss alps"],tags:["europe","mountains","hiking","ski","rail"]},{slug:"united-kingdom",name:"United Kingdom",image:Ea,keywords:["uk","united kingdom","england","london","scotland","highlands","edinburgh"],tags:["europe","city","road trip"]},{slug:"siargao",name:"Siargao",image:Ta,keywords:["siargao","philippines"],tags:["asia","beach","surf"]},{slug:"okinawa",name:"Okinawa",image:Ya,keywords:["okinawa"],tags:["asia","beach","islands"]},{slug:"kyoto",name:"Kyoto",image:Wt,keywords:["kyoto"],tags:["asia","culture","city"]},{slug:"japan/tokyo",name:"Tokyo",image:Vt,keywords:["tokyo","shibuya","shinjuku","asakusa","ginza"],tags:["asia","city","food","culture"]},{slug:"lisbon",name:"Lisbon",image:Ra,keywords:["lisbon"],tags:["europe","city","food"]},{slug:"madeira",name:"Madeira",image:Ua,keywords:["madeira","funchal"],tags:["europe","hiking","islands"]},{slug:"milos",name:"Milos",image:Oa,keywords:["milos"],tags:["europe","islands","beach"]},{slug:"greece/mykonos",name:"Mykonos",image:Kt,keywords:["mykonos"],tags:["europe","islands","beach","nightlife"]},{slug:"sardinia",name:"Sardinia",image:Ha,keywords:["sardinia","costa smeralda"],tags:["europe","beach","islands"]},{slug:"medellin",name:"Medellín",image:Ba,keywords:["medellin","medellín","colombia"],tags:["americas","city","culture"]},{slug:"mexico",name:"Mexico",image:et,keywords:["mexico","cancun","tulum","oaxaca","yucatan","riviera maya"],tags:["americas","beach","food","culture"]},{slug:"mexico-city",name:"Mexico City",image:et,keywords:["mexico city","cdmx"],tags:["americas","city","food"]}
17,{slug:"cabo-san-lucas",name:"Cabo San Lucas",image:Pa,keywords:["cabo","cabo san lucas","los cabos"],tags:["americas","beach"]},{slug:"new-orleans",name:"New Orleans",image:Ia,keywords:["new orleans","nola"],tags:["americas","city","food","music"]},{slug:"phu-quoc",name:"Phu Quoc",image:Wa,keywords:["phu quoc"],tags:["asia","beach","islands"]},{slug:"tbilisi",name:"Tbilisi",image:Aa,keywords:["tbilisi","georgia"],tags:["europe","city","food"]},{slug:"uzbekistan",name:"Uzbekistan",image:Ja.url,keywords:["uzbekistan","samarkand","bukhara","khiva","tashkent","silk road"],tags:["asia","culture","history","rail"]}];function gs(t){let s=t>>>0;return()=>{s=s+1831565813>>>0;let n=s;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function ot(t,s){const n=gs(s),i=t.slice();for(let a=i.length-1;a>0;a--){const o=Math.floor(n()*(a+1));[i[a],i[o]]=[i[o],i[a]]}return i}async function bs(t){try{const{data:s}=await C.from("chat_conversations").select("id, title").eq("user_id",t).order("updated_at",{ascending:!1}).limit(20),n=(s!=null?s:[]).map(c=>c.id),i=(s!=null?s:[]).map(c=>c.title||"").join(" ");let a="";if(n.length>0){const{data:c}=await C.from("chat_messages").select("content, role").in("conversation_id",n).eq("role","user").order("created_at",{ascending:!1}).limit(150);a=(c!=null?c:[]).map(f=>f.content||"").join(" ")}const{data:o}=await C.from("trips").select("name").eq("user_id",t).limit(50),u=(o!=null?o:[]).map(c=>c!=null&&c.name?String(c.name):"").filter(Boolean);return{text:`${i} ${a}`.toLowerCase(),tripDestinations:u}}catch{return{text:"",tripDestinations:[]}}}function ys(t,s){let n=0;const i=s.text;if(i){for(const o of t.keywords){if(!o)continue;const u=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=new RegExp(`\\b${u}\\b`,"g"),f=i.match(c);f&&(n+=f.length*3)}for(const o of t.tags)i.includes(o)&&(n+=1)}const a=s.tripDestinations.join(" ").toLowerCase();if(a)for(const o of t.keywords)o&&a.includes(o)&&(n+=5);return n}function ge(t,s=6,n=Date.now(),i){const a=i!==void 0?i>>>0:(Math.floor(n)^Math.floor(Math.random()*4294967295))>>>0,o=ot(it,a);if(!t)return o.slice(0,s);const u=it.map(g=>({d:g,score:ys(g,t)})).filter(g=>g.score>0).sort((g,S)=>S.score-g.score);if(u.length===0)return o.slice(0,s);const c=u.slice(0,Math.max(s*2,8)).map(g=>g.d),f=ot(c,(a^2654435769)>>>0),y=Math.min(f.length,Math.max(1,Math.ceil(s*2/3))),m=f.slice(0,y),w=new Set(m.map(g=>g.slug)),h=o.filter(g=>!w.has(g.slug));return[...m,...h].slice(0,s)}function vs(t,s=6){const n=l.useRef((Math.floor(Date.now())^Math.floor(Math.random()*4294967295))>>>0),[i,a]=l.useState(()=>ge(null,s,Date.now(),n.current));return l.useEffect(()=>{let o=!1;return t?((async()=>{const u=await bs(t);o||a(ge(u,s,Date.now(),n.current))})(),()=>{o=!0}):(a(ge(null,s,Date.now(),n.current)),()=>{o=!0})},[t,s]),i}const be={hidden:{},show:{transition:{staggerChildren:.06,delayChildren:.12}}},_={hidden:{opacity:0,y:14},show:{opacity:1,y:0,transition:{duration:.45,ease:[.16,1,.3,1]}}},Nt=t=>{if(!(t!=null&&t.end_date))return!1;const s=new Date;return s.setHours(0,0,0,0),new Date(t.end_date)<s},ws=(t,s)=>{const n=se(t);if(!n)return"";const i=se(s);return i?n.getMonth()===i.getMonth()&&n.getFullYear()===i.getFullYear()?`${n.toLocaleDateString("en-US",{month:"short",day:"numeric"})} — ${i.getDate()}, ${i.getFullYear()}`:`${n.toLocaleDateString("en-US",{month:"short",day:"numeric"})} — ${i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`:n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},rt=t=>{const s=se(t.start_date);if(!s)return null;const n=se(t.end_date)||s;return Math.min(365,Math.max(1,Math.round((n.getTime()-s.getTime())/864e5)+1))},ye=({onAction:t})=>e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"font-body text-[15px] font-bold text-navy",children:"Your trips"}),e.jsx("button",{onClick:t,"aria-label":"View all trips",className:"font-body text-[12px] font-medium text-navy/70 hover:text-navy transition-colors",children:"View all"})]}),js=({trip:t,onPublish:s,variant:n="card"})=>{const i=Nt(t),o=e.jsx("button",{onClick:u=>{u.stopPropagation(),i&&s(t.id)},disabled:!i,"aria-label":"Publish itinerary",className:`w-7 h-7 rounded-full flex items-center justify-center transition-colors ${i?"bg-white/95 text-primary hover:bg-white shadow-sm":"bg-white/70 text-navy/30 cursor-not-allowed"}`,children:e.jsx(yt,{className:"w-3.5 h-3.5"})});return e.jsx(pt,{delayDuration:200,children:e.jsxs(xt,{children:[e.jsx(ht,{asChild:!0,children:o}),e.jsx(ft,{side:"top",className:"text-xs",children:i?"Publish my itinerary":"Available once your trip is complete"})]})})},ks=({trip:t,onClick:s,onPublish:n})=>{const i=t.name==="Italy",a=t.inviteStatus==="invited";return e.jsxs(j.button,{whileHover:{y:-2},whileTap:{scale:.97},onClick:s,className:"flex-shrink-0 w-[200px] rounded-xl overflow-hidden text-left bg-white",style:{border:"0.5px solid rgb(var(--beige-warm))"},children:[e.jsxs("div",{className:"relative h-[120px] flex items-end p-3 overflow-hidden",style:{background:gt(t.name)},children:[e.jsx(bt,{tripId:t.id,destination:t.name,ownerId:t.user_id,c
17overUrl:t.cover_photo_url,cachedUrl:t.hero_image_url,cachedSource:t.hero_image_source,cachedAttribution:t.hero_image_attribution_name?{name:t.hero_image_attribution_name,url:t.hero_image_attribution_url||"https://unsplash.com"}:null,className:`absolute inset-0 w-full h-full object-cover ${i?"object-[center_72%]":""}`}),e.jsx("div",{className:`absolute inset-0 rounded-t-xl ${i?"bg-gradient-to-t from-black/70 via-black/35 to-black/20":"bg-gradient-to-t from-black/60 via-black/20 to-transparent"}`}),a&&e.jsx("div",{className:"absolute top-2 left-2 z-20 px-2 py-0.5 rounded-full bg-primary text-primary-foreground text-[9px] font-bold tracking-[0.1em] uppercase shadow-sm",children:"Invited"}),e.jsx("div",{className:"absolute top-2 right-2 z-20",onClick:o=>o.stopPropagation(),children:e.jsx(js,{trip:t,onPublish:n})}),e.jsxs("div",{className:"relative z-10 w-full min-w-0 pr-1",children:[e.jsx("p",{className:"font-body text-[14px] font-semibold text-white leading-tight line-clamp-2 break-words",children:t.name}),a&&e.jsx("p",{className:"font-body text-[11px] text-white/75 mt-0.5 truncate",children:`Invited by ${t.inviterName||"a friend"}`})]})]}),e.jsx("div",{className:"px-3 py-2.5",children:e.jsx("p",{className:"font-body text-[11px] text-navy/50",children:t.start_date?Za(t.start_date,t.end_date):" "})})]})},lt=async(t,s)=>{var n,i,a;try{const{data:o}=await C.auth.getSession(),u=(i=(n=o.session)==null?void 0:n.user)==null?void 0:i.id;if(u){const{data:c}=await C.from("chat_conversations").select("id").eq("trip_id",t.id).eq("user_id",u).order("updated_at",{ascending:!1}).limit(1),f=(a=c==null?void 0:c[0])==null?void 0:a.id;if(f){s(`/chat?c=${f}&tripId=${t.id}`);return}}}catch{}s(`/chat?tripId=${t.id}`)},ct=({trip:t,onClick:s,onPublish:n,active:i,plannedDays:a,totalDays:o})=>{n&&t.id!=="empty"&&Nt(t);const u=a!=null&&a>0?o!=null?`${a} of ${o} days planned`:`${a} days planned`:null;return e.jsxs("button",{onClick:s,className:"w-full flex items-center gap-3.5 p-2 pr-2.5 rounded-[14px] bg-white text-left transition-shadow hover:shadow-[0_6px_18px_-10px_rgba(72,52,52,0.35)]",style:{border:"0.5px solid rgb(var(--beige-warm))"},children:[e.jsx("div",{className:"w-[84px] h-[76px] rounded-[10px] flex-shrink-0 overflow-hidden relative",style:{background:gt(t.name)},children:e.jsx(bt,{tripId:t.id,destination:t.name,ownerId:t.user_id,c
17overUrl:t.cover_photo_url,cachedUrl:t.hero_image_url,cachedSource:t.hero_image_source,cachedAttribution:t.hero_image_attribution_name?{name:t.hero_image_attribution_name,url:t.hero_image_attribution_url||"https://unsplash.com"}:null,className:"absolute inset-0 w-full h-full object-cover",showAttribution:!1})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[i&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-[4px] rounded-full font-body text-[11px] font-medium text-navy mb-1",style:{background:"linear-gradient(135deg, #F3FAFD 0%, #D9EAF3 45%, #C1DBE8 78%, #AFCFE2 100%)"},children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-navy"}),"Continue planning"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"font-body text-[14px] font-semibold text-navy truncate leading-snug",children:t.name}),t.inviteStatus==="invited"&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary text-[8px] font-bold tracking-[0.1em] uppercase flex-shrink-0",children:"Invited"})]}),i&&u?e.jsxs("p",{className:"flex items-center gap-1.5 font-body text-[12px] text-navy/50 mt-1",children:[e.jsx(mt,{className:"w-3.5 h-3.5 flex-shrink-0",strokeWidth:2.2}),u]}):t.start_date?e.jsxs("p",{className:"flex items-center gap-1.5 font-body text-[12px] text-navy/50 mt-1",children:[e.jsx(wt,{className:"w-3.5 h-3.5 flex-shrink-0",strokeWidth:1.8}),ws(t.start_date,t.end_date)]}):null]}),i?e.jsx(Xa,{className:"w-5 h-5 text-navy/50 flex-shrink-0"}):t.id!=="empty"?e.jsx("div",{onClick:c=>c.stopPropagation(),className:"flex-shrink-0",children:e.jsx(pt,{delayDuration:200,children:e.jsxs(xt,{children:[e.jsx(ht,{asChild:!0,children:e.jsx("button",{onClick:async c=>{c.stopPropagation();try{await as({id:t.id,name:t.name,start_date:t.start_date,end_date:t.end_date})}catch{window.alert("We couldn't download this trip right now. Please try again in a moment.")}},"aria-label":"Download trip for offline use",className:"w-8 h-8 rounded-full flex items-center justify-center transition-colors text-navy/70 hover:bg-beige/70",children:e.jsx(es,{className:"w-[18px] h-[18px]",strokeWidth:1.8})})}),e.jsx(ft,{side:"top",className:"text-xs",children:"Download for offline"})]})})}):null]})},ve=({name:t,user:s,image:n,onClick:i,liked:a,onToggleLike:o})=>e.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:u=>{u.key==="Enter"&&(i==null||i())},className:"group relative w-full aspect-[8/5] rounded-2xl overflow-hidden text-left bg-beige-warm cursor-pointer",children:[e.jsx("div",{className:"absolute inset-0 transition-transform duration-500 group-hover:scale-105",style:n?{backgroundImage:`url(${n})`,backgroundSize:"cover",backgroundPosition:"center"}:{background:"linear-gradient(135deg, hsl(var(--sand)), hsl(var(--ocean-light)))"}}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-2/5 backdrop-blur-[6px]",style:{maskImage:"linear-gradient(180deg, transparent 0%, black 75%)",WebkitMaskImage:"linear-gradient(180deg, transparent 0%, black 75%)"}}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-2/3",style:{background:"linear-gradient(180deg, rgba(9,8,8,0) 0%, rgba(9,8,8,0.25) 45%, rgba(9,8,8,0.6) 100%)"}}),e.jsx("button",{type:"button","aria-label":a?`Remove ${t} from liked`:`Like ${t}`,"aria-pressed":!!a,onClick:u=>{u.stopPropagation(),o==null||o()},className:"absolute top-3 right-3 z-10 w-8 h-8 rounded-full flex items-center justify-center transition-transform active:scale-90",style:{background:"rgba(9,8,8,0.25)",backdropFilter:"blur(4px)"},children:e.jsx(Xt,{className:`w-4 h-4 ${a?"fill-red-500 text-red-500":"text-white"}`})}),e.jsxs("div",{className:"absolute bottom-3 left-3.5 right-3",children:[e.jsx("p",{className:"font-body text-white text-[14px] font-semibold leading-tight truncate",children:t}),e.jsxs("p",{className:"font-body text-white/75 text-[11px] mt-0.5 truncate",children:["@",s," · Published"]})]})]}),we=({label:t,onAction:s})=>e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"font-body text-[17px] font-bold text-navy",children:t}),e.jsx("button",{onClick:s,"aria-label":`View all — ${t}`,className:"font-body text-[12px] font-medium text-navy/70 hover:text-navy transition-colors",children:"View all"})]}),Kn=()=>{var $e,Ee,Te,He,Ie,Ae,Pe,Le,ze,Fe,Me,Re,Ue;Gt("Home — Your Travel Dashboard | Travelscape","Access your travel dashboard. View upcoming trips, recent activity, and continue planning with Travelscape's AI travel planner.");const t=_e(),{isLocked:s}=dt(),{openPaywall:n}=Jt(),{openAuthModal:i}
17=Zt(),[a,o]=l.useState(null),[u,c]=l.useState(!0),[f,y]=l.useState(""),[m,w]=l.useState(null),[h,g]=l.useState(0),[S,p]=l.useState(!1),[d,x]=l.useState(!1),[N,k]=l.useState([]),[$,I]=l.useState({}),[M]=l.useState("Free"),[V,_t]=l.useState(window.innerWidth),[ne,K]=l.useState(!1),[ie,Se]=l.useState(null),[St,oe]=l.useState(!1),[Ce,re]=l.useState(new Set);l.useEffect(()=>{var v;const r=(v=a==null?void 0:a.user)==null?void 0:v.id;if(!r){re(new Set);return}C.from("saved_destinations").select("destination_slug").eq("user_id",r).then(({data:b})=>re(new Set((b||[]).map(D=>D.destination_slug))))},[($e=a==null?void 0:a.user)==null?void 0:$e.id]);const Ct=async r=>{var T;const v=(T=a==null?void 0:a.user)==null?void 0:T.id;if(!v){i();return}const b=Ce.has(r),D=ue=>re(me=>{const G=new Set(me);return ue?G.add(r):G.delete(r),G});D(!b);const{error:P}=b?await C.from("saved_destinations").delete().eq("user_id",v).eq("destination_slug",r):await C.from("saved_destinations").upsert({user_id:v,destination_slug:r},{onConflict:"user_id,destination_slug",ignoreDuplicates:!0});P&&D(b)},z=r=>{if(!a){i();return}Se(r!=null?r:null),K(!0)};l.useEffect(()=>{if(!a)return;const r=new URLSearchParams(window.location.search);if(r.get("publish")!=="1")return;Se(r.get("trip")),K(!0),r.delete("publish"),r.delete("trip");const v=r.toString();window.history.replaceState({},"",`${window.location.pathname}${v?`?${v}`:""}`)},[a]),l.useEffect(()=>{const r=()=>_t(window.innerWidth);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),l.useEffect(()=>{const{data:{subscription:r}}=C.auth.onAuthStateChange((v,b)=>{o(b),c(!1)});return C.auth.getSession().then(({data:{session:v}})=>{o(v),c(!1)}),()=>r.unsubscribe()},[]),l.useEffect(()=>{if(!(a!=null&&a.user))return;const r=a.user.id;try{oe(sessionStorage.getItem(`tripInviteBannerDismissed:${r}`)==="1")}catch{oe(!1)}(async()=>{var Be,Oe;const b=await ta(async Q=>{var Qe;const[qe,Ye,We,Ve,Ke]=await Promise.all([C.rpc("get_my_profile").maybeSingle(),C.from("direct_messages").select("*",{count:"exact",head:!0}).eq("recipient_id",Q).is("read_at",null),C.from("follows").select("*",{count:"exact",head:!0}).eq("following_id",Q).eq("status","requested"),C.from("trip_members").select("*",{count:"exact",head:!0}).eq("user_id",Q).eq("status","invited"),oa(Q)]),Ge=qe.error||Ye.error||We.error||Ve.error;if(Ge)throw Ge;const Je=Ke.map(X=>X.id).filter(Boolean),Ze={};if(Je.length>0){const{data:X,error:At}=await C.from("saved_trip_items").select("trip_id, day_number").in("trip_id",Je);if(!At&&X){const ee={};for(const W of X)W.trip_id&&W.day_number!=null&&(ee[Qe=W.trip_id]||(ee[Qe]=new Set)).add(W.day_number);for(const[W,Pt]of Object.entries(ee))Ze[W]=Pt.size}}return{profileRes:qe,msgRes:Ye,friendReqRes:We,tripInvRes:Ve,tripsList:Ke,plannedDaysData:Ze}});if(b.ok!==!0){aa(b.reason)&&(p(!0),sa());return}p(!1);const{profileRes:D,msgRes:P,friendReqRes:T,tripInvRes:ue,tripsList:me,plannedDaysData:G}=b.data,L=D.data;y((L==null?void 0:L.first_name)||((Be=L==null?void 0:L.display_name)==null?void 0:Be.split(" ")[0])||((Oe=a.user.email)==null?void 0:Oe.split("@")[0])||"Traveler"),w((L==null?void 0:L.avatar_url)||null),g((P.count||0)+(T.count||0)+(ue.count||0)),k(me),I(G||{})})()},[a]);const E=l.useMemo(()=>N.filter(r=>r.inviteStatus==="invited"),[N]),R=l.useMemo(()=>{const r=new Date;r.setHours(0,0,0,0);const v=N.filter(b=>b.inviteStatus!=="invited").map(b=>{if(!b.start_date)return{trip:b,rank:2,start:1/0};const D=new Date(b.start_date);D.setHours(0,0,0,0);const P=b.end_date?new Date(b.end_date):new Date(D);if(P.setHours(0,0,0,0),P<r)return null;const T=D<=r;return{trip:b,rank:T?0:1,start:D.getTime()}}).filter(Boolean);return v.sort((b,D)=>b.rank-D.rank||b.start-D.start),v.map(b=>b.trip)},[N]),U=l.useMemo(()=>{const r=new Date;r.setHours(0,0,0,0);let v=null;for(const b of N){if(!b.start_date)continue;const D=new Date(b.start_date);D.setHours(0,0,0,0);const P=b.end_date?new Date(b.end_date):D;if(P.setHours(0,0,0,0),P<r)continue;const T=Math.max(0,Math.round((D.getTime()-r.getTime())/864e5));T>7||(!v||T<v.days)&&(v={trip:b,days:T})}return v},[N]),B=U?e.jsx(la,{tripName:U.trip.name,daysUntil:U.days,liveHref:`/updates?trip=${U.trip.id}
17`,startDate:U.trip.start_date,endDate:U.trip.end_date}):null,Dt=()=>{try{a!=null&&a.user&&sessionStorage.setItem(`tripInviteBannerDismissed:${a.user.id}`,"1")}catch{}oe(!0)},O=!a,Z=O?"Traveler":f||"Traveler",De=V>=680&&V<1024,$t=V>=1024,{journals:Et,loading:Tt,refresh:Ht}=jt((Te=(Ee=a==null?void 0:a.user)==null?void 0:Ee.id)!=null?Te:null),le=vs((Ie=(He=a==null?void 0:a.user)==null?void 0:He.id)!=null?Ie:null,8).map(r=>({name:r.name,user:"travelscape",image:r.image,slug:r.slug}));if(u)return null;const ce=r=>({liked:Ce.has(r),onToggleLike:()=>Ct(r)}),A=(Ae=R[0])!=null?Ae:null,It=e.jsx(J,{title:"No trips planned yet",description:"Your saved itineraries and upcoming journeys will appear here.",actionLabel:"Create your first trip",onAction:()=>t("/chat?new=1"),className:"py-8"}),q=E.length>0&&!St?e.jsxs(j.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"rounded-xl p-4 flex items-center gap-3 bg-primary text-primary-foreground shadow-sm",children:[E.length===1&&E[0].inviterAvatarUrl?e.jsx("img",{src:E[0].inviterAvatarUrl,alt:`${E[0].inviterName||"A friend"}'s profile photo`,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 ring-2 ring-white/40",loading:"lazy"}):e.jsx("div",{className:"w-9 h-9 rounded-full bg-white/15 flex items-center justify-center flex-shrink-0",children:e.jsx(Qa,{className:"w-4 h-4"})}),e.jsx("div",{className:"flex-1 min-w-0",children:E.length===1?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"font-body text-sm font-semibold leading-tight",children:[E[0].inviterName||"A friend"," invited you to ",E[0].name]}),e.jsx("button",{onClick:()=>t(`/trips/${E[0].id}`),className:"font-body text-[11px] font-medium underline mt-0.5 hover:opacity-90",children:"Open trip →"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"font-body text-sm font-semibold leading-tight",children:["You have ",E.length," trip invites"]}),e.jsx("button",{onClick:()=>x(!0),className:"font-body text-[11px] font-medium underline mt-0.5 hover:opacity-90",children:"View all →"})]})}),e.jsx("button",{onClick:Dt,"aria-label":"Dismiss",className:"w-7 h-7 rounded-full flex items-center justify-center hover:bg-white/15 transition-colors flex-shrink-0",children:e.jsx(Qt,{className:"w-4 h-4"})})]}):null,de=e.jsx(hs,{signedIn:!O,onRequireAuth:()=>i(),defaultArea:(Pe=N[0])==null?void 0:Pe.name}),Y=S?e.jsxs("div",{className:"rounded-xl border border-navy/15 bg-sand/40 px-4 py-3 flex items-center justify-between gap-3",children:[e.jsx("p",{className:"font-body text-sm text-navy",children:"Your session expired — please sign in again to see your trips and notifications."}),e.jsx("button",{onClick:()=>t(`/login?redirect=${encodeURIComponent("/home")}`),className:"font-body text-sm font-medium text-white bg-navy rounded-lg px-3 py-1.5 flex-shrink-0",children:"Sign in"})]}):null;return!De&&!$t?e.jsxs("div",{className:"min-h-screen bg-[#fafbfc] pb-20",children:[e.jsx(fe,{firstName:Z,resumeTripId:A==null?void 0:A.id,onPublish:()=>z(),onOpenNotifications:()=>x(!0),onOpenSettings:()=>t("/settings"),notifCount:h,showIcons:!O,className:"mx-3 mt-[calc(env(safe-area-inset-top)+12px)]"}),e.jsxs(j.div,{variants:be,initial:"hidden",animate:"show",className:"px-5 pt-3 space-y-4",children:[e.jsx(j.div,{variants:_,children:e.jsx(he,{})}),Y&&e.jsx(j.div,{variants:_,children:Y}),B&&e.jsx(j.div,{variants:_,children:B}),q&&e.jsx(j.div,{variants:_,children:q}),e.jsx(j.div,{variants:_,children:e.jsxs("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsx(ye,{onAction:()=>t("/collaborate")}),R.length>0?e.jsx("div",{className:"flex items-start gap-3 overflow-x-auto pb-2 -mx-5 px-5 scrollbar-none",children:R.map(r=>e.jsx(ks,{trip:r,onClick:()=>t(`/trips/${r.id}`),onPublish:z},r.id))}):It]})}),e.jsx(j.div,{variants:_,children:e.jsx(xe,{userId:(ze=(Le=a==null?void 0:a.user)==null?void 0:Le.id)!=null?ze:null,layout:"scroll"})}),e.jsx(j.div,{variants:_,children:de}),e.jsx(j.div,{variants:_,children:e.jsxs("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsx(we,{label:"Discover from the community",onAction:()=>t("/explore")}),e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-1 -mx-5 px-5 scrollbar-none",children:le.map(r=>e.jsx("div",{className:"flex-shrink-0 w-[210px]",children:e.jsx(ve,{...r,...ce(r.slug),onClick:()=>t(`/destinations/${r.slug}`)})},r.name))})]})})]}),e.jsx(ea,{}),(a==null?void 0:a.user)&&e.jsx(pe,{open:d,onOpenChange:x,userId:a.user.id}),e.jsx(ae,{open:ne,onOpenChange:K,preselectedTripId:ie})]}):De?e.jsxs("div",{className:"min-h-screen bg-white flex",children:[e.jsx(Xe,{mode:"icons"}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsx(fe,{firstName:Z,resumeTripId:A==null?void 0:A.id,onPublish:()=>z(),onOpenNotifications:()=>x(!0),onOpenSettings:()=>t("/settings"),notifCount:h,showIcons:!O,className:"mx-6 mt-4"}),e.jsxs(j.div,{className:"flex-1 p-6 pt-4 overflow-y-auto space-y-4",variants:be,initial:"hidden",animate:"show",children:[e.jsx(j.div,{variants:_,children:e.jsx(he,{})}),Y&&e.jsx(j.div,{variants:_,children:Y}),B&&e.jsx(j.div,{variants:_,children:B}),q&&e.jsx(j.div,{variants:_,children:q}),e.jsxs(j.div,{variants:_,className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsx(ye,{onAction:()=>t("/collaborate")}),R.length>0?e.jsx("div",{className:"space-y-3",children:R.slice(0,2).map((r,v)=>e.jsx(ct,{trip:r,active:v===0,plannedDays:$[r.id],totalDays:rt(r),onClick:()=>v===0&&s?n("continue_planning"):v===0?lt(r,t):t(`/trips/${r.id}`),onPublish:z},r.id))}):e.jsx(J,{title:"No trips planned yet",description:"Your saved itineraries and upcoming journeys will appear here.",actionLabel:"Create your first trip",onAction:()=>t("/chat?new=1")})]}),de]}),e.jsx(j.div,{variants:_,children:e.jsx("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:e.jsx(xe,{userId:(Me=(Fe=a==null?void 0:a.user)==null?void 0:Fe.id)!=null?Me:null,onViewAll:()=>t("/profile"),onEmptyAction:()=>z()})})}),e.jsx(j.div,{variants:_,children:e.jsxs("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsx(we,{label:"Discover from the community",onAction:()=>t("/explore")}
17),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:le.slice(0,6).map(r=>e.jsx(ve,{...r,...ce(r.slug),onClick:()=>t(`/destinations/${r.slug}`)},r.name))})]})})]})]}),(a==null?void 0:a.user)&&e.jsx(pe,{open:d,onOpenChange:x,userId:a.user.id}),e.jsx(ae,{open:ne,onOpenChange:K,preselectedTripId:ie})]}):e.jsxs("div",{className:"min-h-screen bg-sidebar flex",children:[e.jsx(Xe,{mode:"full",trips:[],user:{name:Z,avatar:m,tier:M}}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col min-h-screen bg-[#fafbfc]",children:[e.jsx(fe,{firstName:Z,resumeTripId:A==null?void 0:A.id,onPublish:()=>z(),onOpenNotifications:()=>x(!0),onOpenSettings:()=>t("/settings"),notifCount:h,showIcons:!O,className:"mx-8 mt-5"}),e.jsxs(j.div,{className:"flex-1 p-8 pt-4 overflow-y-auto space-y-5",variants:be,initial:"hidden",animate:"show",children:[e.jsx(j.div,{variants:_,children:e.jsx(he,{})}),Y&&e.jsx(j.div,{variants:_,children:Y}),B&&e.jsx(j.div,{variants:_,children:B}),q&&e.jsx(j.div,{variants:_,children:q}),e.jsxs(j.div,{variants:_,className:"grid grid-cols-12 gap-5 items-start",children:[e.jsxs("div",{className:"col-span-12 xl:col-span-8 rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsx(ye,{onAction:()=>t("/collaborate")}),R.length>0?e.jsx("div",{className:"space-y-3",children:R.slice(0,3).map((r,v)=>e.jsx(ct,{trip:r,active:v===0,plannedDays:$[r.id],totalDays:rt(r),onClick:()=>v===0&&s?n("continue_planning"):v===0?lt(r,t):t(`/trips/${r.id}`),onPublish:z},r.id))}):e.jsx(J,{title:"No trips planned yet",description:"Your saved itineraries and upcoming journeys will appear here.",actionLabel:"Create your first trip",onAction:()=>t("/chat?new=1")})]}),e.jsx("div",{className:"col-span-12 xl:col-span-4",children:de})]}),!O&&e.jsx(j.div,{variants:_,children:e.jsx("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:e.jsx(xe,{userId:(Ue=(Re=a==null?void 0:a.user)==null?void 0:Re.id)!=null?Ue:null,journals:Et,loading:Tt,onRefresh:Ht,onViewAll:()=>t("/profile"),onEmptyAction:()=>z()})})}),e.jsx(j.div,{variants:_,children:e.jsxs("div",{className:"rounded-[20px] p-5",style:{background:"hsl(40 38% 97.5%)",boxShadow:"0 18px 36px -16px hsl(30 20% 15% / 0.20), 0 4px 12px -6px hsl(30 20% 15% / 0.08)"},children:[e.jsx(we,{label:"Discover from the community",onAction:()=>t("/explore")}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:le.slice(0,8).map(r=>e.jsx(ve,{...r,...ce(r.slug),onClick:()=>t(`/destinations/${r.slug}`)},r.name))})]})})]})]}),(a==null?void 0:a.user)&&e.jsx(pe,{open:d,onOpenChange:x,userId:a.user.id}),e.jsx(ae,{open:ne,onOpenChange:K,preselectedTripId:ie})]})};export{Kn 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.