1import{r as o,s as D,j as e,a as E,B as b,L as T,f as K,Z as M,k as w,w as S,g as k,at as Z,O as Q,Q as X,R as ee,U as se,X as te,o as ae,S as B,b as re,A as V,av as ne,u as ie,C as le,a1 as ce,F as oe,I as me,n as F}from"./index-BtZ4WYW8.js";import{I as de,a as xe,b as ue}from"./input-otp-DCtEpHo5.js";import{S as he}from"./shield-check-zfNHG6o3.js";import{R as pe}from"./refresh-cw-BtHdqdm7.js";import{B as z}from"./briefcase-CoflamXn.js";import{P as G}from"./phone-chWn9gh2.js";import{W as J}from"./wifi-C9gTB2pT.js";import{C as U}from"./circle-help-B_tSgnwY.js";import{S as W}from"./star-cvy61TyP.js";import{D as fe}from"./DocumentViewerDrawer-4yNksBPm.js";import{T as L}from"./target-CCKtC-Vr.js";import{D as ge}from"./dollar-sign-BIQ5DaDT.js";import{T as je}from"./thumbs-up-CHtNQZX8.js";import{C as Ne}from"./chart-pie-ZlAFvChr.js";import{T as ye}from"./trending-up-DB2u_fiN.js";import{F as P}from"./file-text-D6XaJCxQ.js";import{G as A}from"./gift-D4lCypVU.js";import"./external-link-T-x_aCH0.js";import"./triangle-alert-DerLXNl5.js";import"./circle-check-Bb5yaGRV.js";const I="2",O="switchit_share_session";function ve(){const[s,x]=o.useState(null),[r,i]=o.useState(()=>{try{const d=sessionStorage.getItem(O);if(d){const t=JSON.parse(d);if(t.expiresAt&&new Date(t.expiresAt)>new Date&&t.version===I)return t;sessionStorage.removeItem(O)}}catch{}return{sessionToken:null,expiresAt:null,offers:[],sharerName:null,personalMessage:null,recipientName:null,version:I}}),[u,l]=o.useState(!1),[h,c]=o.useState(null),f=o.useCallback(async d=>{l(!0),c(null);try{const{data:t,error:a}=await D.functions.invoke("get-share-info",{body:{token:d}});if(a)throw new Error(a.message);if(!(t!=null&&t.valid))throw new Error((t==null?void 0:t.error)||"Invalid share link");return x(t),t}catch(t){const a=(t==null?void 0:t.message)||"Failed to load share info";throw c(a),t}finally{l(!1)}},[]),j=o.useCallback(async d=>{l(!0),c(null);try{const{data:t,error:a}=await D.functions.invoke("send-otp",{body:{email:d,platform:"consumer",purpose:"share_access"}});if(a)throw new Error(a.message);return t}catch(t){const a=(t==null?void 0:t.message)||"Failed to send verification code";throw c(a),t}finally{l(!1)}},[]),N=o.useCallback(async(d,t,a)=>{l(!0),c(null);try{const{data:n,error:y}=await D.functions.invoke("verify-share-otp",{body:{token:d,email:t,code:a}});if(y)throw new Error(y.message);if(!(n!=null&&n.success))throw new Error((n==null?void 0:n.error)||"Verification failed");const C={sessionToken:n.session_token,expiresAt:n.session_expires_at,offers:n.offers||[],sharerName:(s==null?void 0:s.sharer_name)||null,personalMessage:(s==null?void 0:s.personal_message)||null,recipientName:(s==null?void 0:s.recipient_name)||null,version:I};return i(C),sessionStorage.setItem(O,JSON.stringify(C)),C}catch(n){const y=(n==null?void 0:n.message)||"Verification failed";throw c(y),n}finally{l(!1)}},[s]),p=o.useCallback(async()=>{var d,t;if(r.sessionToken){l(!0),c(null);try{const{data:a,error:n}=await D.functions.invoke("get-shared-offers",{body:{session_token:r.sessionToken}});if(n)throw new Error(n.message);if(!(a!=null&&a.success))throw new Error((a==null?void 0:a.error)||"Failed to load offers");const y={...r,offers:a.offers||[],sharerName:a.sharer_name||r.sharerName,personalMessage:a.personal_message||r.personalMessage,recipientName:a.recipient_name||r.recipientName,version:I};return i(y),sessionStorage.setItem(O,JSON.stringify(y)),y}catch(a){((d=a==null?void 0:a.message)!=null&&d.includes("expired")||(t=a==null?void 0:a.message)!=null&&t.includes("Invalid"))&&g();const n=(a==null?void 0:a.message)||"Failed to load offers";throw c(n),a}finally{l(!1)}}},[r]),g=o.useCallback(()=>{sessionStorage.removeItem(O),i({sessionToken:null,expiresAt:null,offers:[],sharerName:null,personalMessage:null,recipientName:null}),x(null)},[]),m=!!(r.sessionToken&&r.expiresAt&&new Date(r.expiresAt)>new Date);return{shareInfo:s,session:r,isVerified:m,isLoading:u,error:h,offers:r.offers,sharerName:r.sharerName,personalMessage:r.personalMessage,recipientName:r.recipientName,fetchShareInfo:f,sendOtp:j,verifyOtp:N,fetchOffers:p,clearSession:g,setError:c}}function be({email:s,isLoading:x,error:r,onVerify:i,onResend:u}
1){const[l,h]=o.useState(""),[c,f]=o.useState(!1),[j,N]=o.useState(0),p=async m=>{m.length===6&&await i(m)},g=async()=>{f(!0);try{await u(),h(""),N(60);const m=setInterval(()=>{N(d=>d<=1?(clearInterval(m),0):d-1)},1e3)}finally{f(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(he,{className:"h-6 w-6 text-primary"})}),e.jsx("h2",{className:"text-xl font-semibold",children:"Verify Your Email"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent a 6-digit code to ",e.jsx("strong",{className:"text-foreground",children:s})]})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(de,{maxLength:6,value:l,onChange:h,onComplete:p,disabled:x,children:e.jsx(xe,{children:[0,1,2,3,4,5].map(m=>e.jsx(ue,{index:m,className:E("w-10 h-12 text-lg",r&&"border-destructive")},m))})})}),r&&e.jsx("p",{className:"text-sm text-destructive text-center",children:r}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{onClick:()=>
1p(l),disabled:l.length!==6||x,className:"w-full",children:x?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify & View Offers"}),e.jsx(b,{variant:"ghost",onClick:g,disabled:c||j>0,className:"w-full text-sm",children:c?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending..."]}):j>0?`Resend code in ${j}s`:e.jsxs(e.Fragment,{children:[e.jsx(pe,{className:"h-4 w-4 mr-2"}),"Resend Code"]})})]})]})}const we={energy:M,broadband:J,mobile:G,insurance:K,pension:z},Se={energy:"text-yellow-500",broadband:"text-blue-500",mobile:"text-green-500",insurance:"text-purple-500",pension:"text-orange-500"};function _e({offer:s,className:x,onClick:r}){const i=we[s.service_type]||U,u=Se[s.service_type]||"text-muted-foreground",l=s.fit_score,h=c=>{r&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),r())};return e.jsx(w,{className:E("overflow-hidden bg-card/50 backdrop-blur-sm border-border/50 transition-colors",r&&"cursor-pointer hover:bg-card/80 hover:border-primary/30 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",x),onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:h,children:e.jsxs(S,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:E("p-2 rounded-lg bg-muted/50",u),children:e.jsx(i,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-medium text-sm truncate",children:s.offer_title||s.provider_name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.provider_name})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l&&l>0&&e.jsxs(k,{variant:"secondary",className:"gap-1",children:[e.jsx(W,{className:"h-3 w-3"}),l,"%"]}),r&&e.jsx(Z,{className:"h-4 w-4 text-muted-foreground"})]})]}),s.offer_description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:s.offer_description}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[s.monthly_cost!=null&&e.jsxs("span",{className:"text-lg font-semibold",children:[s.monthly_cost.toLocaleString("da-DK")," kr",e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"/md"})]}),s.savings_amount!=null&&s.savings_amount>0&&e.jsxs("span",{className:"text-sm text-green-600 font-medium",children:["Spar ",s.savings_amount.toLocaleString("da-DK")," kr"]})]}),s.features&&s.features.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.features.slice(0,4).map((c,f)=>e.jsx(k,{variant:"outline",className:"text-xs font-normal",children:c},f)),s.features.length>4&&e.jsxs(k,{variant:"outline",className:"text-xs font-normal text-muted-foreground",children:["+",s.features.length-4," more"]})]}),e.jsx("div",{className:"pt-1",children:e.jsx(k,{variant:"secondary",className:"text-xs capitalize",children:s.service_type})})]})})}const ke={energy:M,broadband:J,mobile:G,insurance:K,pension:z},Ce={energy:"text-yellow-500",broadband:"text-blue-500",mobile:"text-green-500",insurance:"text-purple-500",pension:"text-orange-500"};function Oe(s){const x=s.mime_type||"";let r="pdf";return x.startsWith("image/")?r="image":x.includes("text")&&(r="text"),{id:s.id,fileName:s.file_name,fileSize:s.file_size||0,fileType:r,signedUrl:s.signed_url||"",expiresAt:new Date(Date.now()+55*60*1e3).toISOString(),createdAt:new Date().toISOString(),processingStatus:"processed"}}function De({offer:s,open:x,onOpenChange:r}){const[i,u]=o.useState(!1),[l,h]=o.useState();if(!s)return null;const c=ke[s.service_type]||U,f=Ce[s.service_type]||"text-muted-foreground",j=[...s.features||[],...s.lm_features?Object.values(s.lm_features).flat().filter(t=>typeof t=="string"):[]],N=[...new Set(j)],p=[{label:"Fit Score",value:s.fit_score,icon:L},{label:"Price",value:s.price_score,icon:ge},{label:"Preference",value:s.preference_score,icon:je},{label:"Satisfaction",value:s.satisfaction_score,icon:W},{label:"Coverage",value:s.coverage_score,icon:Ne}].filter(t=>t.value!=null&&t.value>0),g=[];s.match_breakdown&&(Array.isArray(s.match_breakdown)?g.push(...s.match_breakdown.filter(t=>typeof t=="string")):typeof s.match_breakdown=="object"&&Object.entries(s.match_breakdown).forEac
1h(([t,a])=>{typeof a=="string"?g.push(a):typeof a=="boolean"&&a&&g.push(t.replace(/_/g," "))}));const m=(s.documents||[]).filter(t=>t.signed_url).map(Oe),d=t=>{h(t),u(!0)};return e.jsxs(e.Fragment,{children:[e.jsx(Q,{open:x,onOpenChange:r,children:e.jsxs(X,{side:"bottom",className:"h-[90vh] flex flex-col",children:[e.jsx(ee,{className:"flex-shrink-0 border-b pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:E("p-2.5 rounded-lg bg-muted/50",f),children:e.jsx(c,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(se,{className:"text-base font-semibold truncate",children:s.offer_title||s.provider_name}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.provider_name," ⢠",s.service_type]})]})]}),e.jsx(b,{size:"sm",variant:"ghost",onClick:()=>r(!1),children:e.jsx(te,{className:"h-4 w-4"})})]})}),e.jsx(ae,{className:"flex-1 -mx-6 px-6",children:e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-3 flex-wrap",children:[s.monthly_cost!=null&&e.jsxs("span",{className:"text-2xl font-bold",children:[s.monthly_cost.toLocaleString("da-DK")," kr",e.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"/md"})]}),s.annual_cost!=null&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",s.annual_cost.toLocaleString("da-DK")," kr/Ã¥r)"]})]}),s.savings_amount!=null&&s.savings_amount>0&&e.jsxs(k,{className:"bg-success/10 text-success border-success/30",children:[e.jsx(ye,{className:"h-3 w-3 mr-1"}),"Spar ",s.savings_amount.toLocaleString("da-DK")," kr"]})]}),p.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-primary"}),"Match Score"]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:p.map(t=>e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-lg bg-muted/50",children:[e.jsx(t.icon,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t.label}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${t.value}%`}})}),e.jsxs("span",{className:"text-xs font-medium",children:[t.value,"%"]})]})]})]},t.label))})]}),s.ai_summary&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-primary"}),"AI Analysis"]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.ai_summary})]}),g.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(re,{className:"h-4 w-4 text-success"}),"Why This Matches"]}),e.jsx("ul",{className:"space-y-1.5",children:g.slice(0,5).map((t,a)=>e.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[e.jsx("span",{className:"text-success mt-0.5",children:"â¢"}),e.jsx("span",{className:"capitalize",children:t})]},a))})]}),s.offer_description&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Description"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.offer_description})]}),N.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Features"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:N.map((t,a)=>e.jsx(k,{variant:"outline",className:"text-xs font-normal",children:t},a))})]}),s.structured_features&&Object.keys(s.structured_features).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Details"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(s.structured_features).slice(0,8).map(([t,a])=>e.jsxs("div",{className:"p-2 rounded-lg bg-muted/50",children:[e.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:t.replace(/_/g," ")}),e.jsx("p",{className:"text-sm font-medium truncate",children:typeof a=="boolean"?a?"Yes":"No":String(a)})]},t))})]}),m.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(P,{className:"h-4 w-4 text-primary"}),"Attachments (",m.length,")"]}),e.jsx("div",{className:"space-y-2",children:m.map(t=>e.jsxs("button",{onClick:()=>d(t.id),className:"w-full flex items-center gap-3 p-3 rounded-lg bg-muted/50 hover:bg-muted transition-colors text-left",children:[e.jsx(P,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-sm truncate flex-1",children:t.fileName}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[(t.fileSize/1024).toFixed(1)," KB"]}
1)]},t.id))})]}),s.valid_until&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Valid until ",new Date(s.valid_until).toLocaleDateString("da-DK")]})]})})]})}),m.length>0&&e.jsx(fe,{open:i,onOpenChange:u,documents:m,initialDocumentId:l})]})}function Ie({offers:s,sharerName:x,personalMessage:r,recipientName:i,expiresAt:u}){const[l,h]=o.useState(null),[c,f]=o.useState(!1),j=()=>{window.location.href="/auth?mode=signup"},N=p=>{h(p),f(!0)};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(w,{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-primary/20",children:e.jsxs(S,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"h-5 w-5 text-primary"}),e.jsxs("span",{className:"font-medium",children:[x||"Someone"," shared ",s.length," offer",s.length!==1?"s":""," with you",i&&`, ${i}`,"!"]})]}),r&&e.jsxs("blockquote",{className:"text-sm text-muted-foreground italic border-l-2 border-primary/30 pl-3",children:['"',r,'"']}),u&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["This share expires on ",new Date(u).toLocaleDateString("da-DK",{day:"numeric",month:"long",year:"numeric"})]})]})}),e.jsx("div",{className:"space-y-3",children:s.map(p=>e.jsx(_e,{offer:p,onClick:()=>N(p)},p.id))}),s.length===0&&e.jsx(w,{className:"bg-muted/50",children:e.jsx(S,{className:"p-8 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:"No offers to display."})})}),e.jsx(w,{className:"bg-gradient-to-r from-primary/10 via-primary/5 to-transparent border-primary/20",children:e.jsxs(S,{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-full bg-primary/20",children:e.jsx(B,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:"Get Your Own Personalized Offers"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Join SwitchIt for free and discover offers matched to your household."})]})]}),e.jsxs(b,{onClick:j,className:"w-full",children:["Join SwitchIt Free",e.jsx(V,{className:"h-4 w-4 ml-2"})]})]})}),e.jsx(De,{offer:l,open:c,onOpenChange:f})]})}function Ze(){const[s]=ne(),x=ie(),r=s.get("token"),{shareInfo:i,isVerified:u,isLoading:l,error:h,offers:c,sharerName:f,personalMessage:j,recipientName:N,fetchShareInfo:p,fetchOffers:g,sendOtp:m,verifyOtp:d,setError:t}=ve(),[a,n]=o.useState("loading"),[y,C]=o.useState(!1),[_,R]=o.useState("");o.useEffect(()=>{if(!r){n("error"),t("Invalid share link. No token provided.");return}if(u){n("offers"),y||(C(!0),g().catch(()=>{n("email")}));return}p(r).then(v=>{v!=null&&v.recipient_email&&R(v.recipient_email),n("info")}).catch(()=>{n("error")})},[r,u,y]);const Y=()=>{n("email")},$=async v=>{if(v.preventDefault(),!_.trim()||!_.includes("@")){t("Please enter a valid email address");return}try{await m(_.trim()),n("otp"),F.success("Verification code sent!")}catch{}},q=async v=>{if(r)try{await d(r,_.trim(),v),n("offers"),F.success("Verified! Here are your shared offers.")}catch{}},H=async()=>{try{await m(_.trim()),F.success("New code sent!")}catch{}};return a==="loading"?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(T,{className:"h-8 w-8 animate-spin text-primary mx-auto"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading shared offers..."})]})}):a==="error"?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(w,{className:"max-w-md w-full",children:e.jsxs(S,{className:"p-6 text-center space-y-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-destructive/10 flex items-center justify-center mx-auto",children:e.jsx(le,{className:"h-6 w-6 text-destructive"})}),e.jsx("h2",{className:"text-xl font-semibold",children:"Unable to Load Share"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:h||"This share link may be invalid or expired."}),e.jsx(b,{onClick:()=>x("/"),variant:"outline",className:"mt-4",children:"Go to SwitchIt"})]})})}):a==="offers"&&u?e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-lg mx-auto p-4 py-8 space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(A,{className:"h-6 w-6 text-primary"})}),e.jsx("h1",{className:"text-2xl font-bold",children:"Shared Offers"})]}),e.jsx(Ie,{offers:c,sharerName:f,personalMessage:j,recipientName:N,expiresAt:i==null?void 0:i.expires_at})]})}):a==="info"&&i?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(w,{className:"max-w-md w-full",children:e.jsxs(S,{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(A,{className:"h-6 w-6 text-primary"})}),e.jsxs("h2",{className:"text-xl font-semibold",children:[i.sharer_name||"Someone"," shared offers with you!"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.offer_count," offer",i.offer_count!==1?"s":""," selected for"," ",i.recipient_name||"you"]})]}),i.personal_message&&e.jsxs("blockquote",{className:"text-sm text-muted-foreground italic border-l-2 border-primary/30 pl-3 py-2",children:['"',i.personal_message,'"']}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"To view these offers, we'll verify your email address for security."})}),e.jsxs(b,{onClick:Y,className:"w-full",children:["Continue",e.jsx(V,{className:"h-4 w-4 ml-2"})]}),e.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:["Expires ",new Date(i.expires_at).toLocaleDateString()]})]})})}):a==="email"?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(w,{className:"max-w-md w-full",children:e.jsxs(S,{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(ce,{className:"h-6 w-6 text-primary"})}),e.jsx("h2",{className:"text-xl font-semibold",children:"Verify Your Email"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your email to receive a verification code."})]}),e.jsxs("form",{onSubmit:$,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"email",children:"Email Address"}),e.jsx(me,{id:"email",type:"email",placeholder:"[email protected]",value:_,onCh
1ange:v=>R(v.target.value),required:!0,autoComplete:"email",autoFocus:!0})]}),h&&e.jsx("p",{className:"text-sm text-destructive",children:h}),e.jsx(b,{type:"submit",disabled:l,className:"w-full",children:l?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending Code..."]}):e.jsxs(e.Fragment,{children:["Send Verification Code",e.jsx(V,{className:"h-4 w-4 ml-2"})]})})]}),e.jsx(b,{variant:"ghost",onClick:()=>n("info"),className:"w-full text-sm",children:"Back"})]})})}):a==="otp"?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(w,{className:"max-w-md w-full",children:e.jsxs(S,{className:"p-6",children:[e.jsx(be,{email:_,isLoading:l,error:h,onVerify:q,onResend:H}),e.jsx(b,{variant:"ghost",onClick:()=>{t(null),n("email")},className:"w-full text-sm mt-4",children:"Use Different Email"})]})})}):null}export{Ze 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.