PageSourceSearch

https://perqt.ai/assets/reminders.lazy-J_YDpGr8.js

js perqt.ai collected 2026-09-24 14:30:30 UTC 44,918 bytes, 13 lines download raw bytes

1import{c as qe,f as ze,u as te,m as Ie,r as _,N as Me,s as M,j as e,L as Ce,A as Pe,I as Oe,B as T,i as se,a4 as Ge,a5 as Be,a6 as Ue,a7 as Ve,a8 as Fe,a9 as ge,t as U}from"./index-DDmnGebA.js";import{B as We}from"./back-link-fAx5pDXH.js";import{u as ee}from"./useQuery-BOYPOZA2.js";import{u as Ye}from"./useMutation-DBHl1pVE.js";import{u as He,s as Ze,W as Ke}from"./wallet-scope-filter-3wZ8Satp.js";import{u as f,f as Z}from"./format-xqYhVKQ8.js";import{g as Qe}from"./benefit-periods-dTY6AXHB.js";import{u as Xe,T as Je}from"./use-plan-ByoPC8LL.js";import{B as ne}from"./badge-D9Sr_es5.js";import{R as fe,a as ea}from"./radio-group-Bvo1HP21.js";import{S as P,a as O,b as G,c as B,d as g}from"./select-hru4Kc7V.js";import{T as aa,a as sa,b as ra}from"./tabs-xiIm4XWh.js";import{A as he,a as be,b as ve,c as je}from"./accordion-DKV6pSt2.js";import{D as ta,a as na,b as oa,c as ia,d as la,e as da}from"./dialog-BVCSaYHk.js";import{C as Ne}from"./checkbox-BX7OZSnV.js";import{u as ca}from"./use-lineage-context-C5a8td_O.js";import{p as ma}from"./benefit-window-DkR0t29L.js";import{S as ua}from"./sparkles-L_FhHmAq.js";import{C as ye}from"./circle-check-D5R51RbP.js";import{B as H}from"./bell-DAoUFuhF.js";import{G as pa}from"./gift-D_kledJu.js";import{T as _e}from"./triangle-alert-DBrL6KzO.js";import{R as xa}from"./refresh-cw-C4ad6KCw.js";import{C as we}from"./clock-Pur_79UV.js";import{L as ga}from"./lock-CVDAHYv3.js";import{C as De}from"./calendar-B5A-qEs1.js";import{S as fa}from"./search-DSK4SkFs.js";import{C as ha}from"./credit-card-Cs6-thJO.js";import{F as ba}from"./funnel-B_AI6FwU.js";import{C as re}from"./calendar-plus-BVfKe24T.js";import{S as va}from"./settings-2-ELQJICpK.js";import{B as ja}from"./briefcase-CQe1MhIa.js";import{W as Na}from"./wallet-Bc2kgjk9.js";import{A as ya}from"./arrow-up-CoAj7u_K.js";import"./arrow-left-Dk89Ghvb.js";import"./use-wallet-mode-Bah0wIMd.js";import"./inline-info-BhdHe_df.js";import"./popover-DueWJB-u.js";import"./index-DxwnAwF9.js";import"./info-D3kkduYQ.js";import"./layers-Cprm38nV.js";import"./proxy-DCKJJ4HU.js";import"./index-CwtwCT07.js";import"./index-CW4Bw66c.js";import"./index-vWqnPDcG.js";import"./chevron-down-C98teVg7.js";import"./index-BukYfZGe.js";import"./x-CFnp5CwC.js";import"./useServerFn-Cy0AXs3T.js";import"./view.functions--g1mWtIC.js";function oe(a){if(a)return a;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function C(a){return a<10?`0${a}`:String(a)}function R(a){return`${a.getFullYear()}${C(a.getMonth()+1)}${C(a.getDate())}`}function K(a){return`${a.getUTCFullYear()}${C(a.getUTCMonth()+1)}${C(a.getUTCDate())}T${C(a.getUTCHours())}${C(a.getUTCMinutes())}${C(a.getUTCSeconds())}Z`}function ie(a){const s=[a.description?.trim()||""];return a.url&&s.push(`
2
3${a.url}`),s.join("").trim()}function $e(a){const s=oe(a.timeZone),n=new Date(a.date),d=new Date(a.date);d.setDate(d.getDate()+1);const l=new URLSearchParams({action:"TEMPLATE",text:a.title,dates:`${R(n)}/${R(d)}`,details:ie(a),ctz:s});return a.location&&l.set("location",a.location),`https://calendar.google.com/calendar/render?${l.toString()}`}function _a(a){const s=new Date(a.date),n=new Date(a.date);n.setDate(n.getDate()+1);const d=Math.max(0,Math.floor(a.reminderDaysBefore??1)),l=`${K(new Date)}-${Math.random().toString(36).slice(2,10)}@perqt.ai`,x=j=>j.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;"),p=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//Perqt//Reminders//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH",`X-WR-TIMEZONE:${oe(a.timeZone)}`,"BEGIN:VEVENT",`UID:${l}`,`DTSTAMP:${K(new Date)}`,`DTSTART;VALUE=DATE:${R(s)}`,`DTEND;VALUE=DATE:${R(n)}`,`SUMMARY:${x(a.title)}`,`DESCRIPTION:${x(ie(a))}`];return a.location&&p.push(`LOCATION:${x(a.location)}`),d>0&&p.push("BEGIN:VALARM","ACTION:DISPLAY",`DESCRIPTION:${x(a.title)}`,`TRIGGER:-P${d}D`,"END:VALARM"),p.push("END:VEVENT","END:VCALENDAR"),p.join(`\r
4`)}function wa(a,s="perqt-reminder.ics"){Ae(_a(a),s)}function ka(a){const s=oe(a[0]?.timeZone),n=l=>l.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;"),d=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//Perqt//Reminders//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH",`X-WR-TIMEZONE:${s}`,"X-WR-CALNAME:Perqt reminders"];for(const l of a){const x=new Date(l.date),i=new Date(l.date);i.setDate(i.getDate()+1);const p=Math.max(0,Math.floor(l.reminderDaysBefore??1)),j=`${K(new Date)}-${Math.random().toString(36).slice(2,10)}@perqt.ai`;d.push("BEGIN:VEVENT",`UID:${j}`,`DTSTAMP:${K(new Date)}`,`DTSTART;VALUE=DATE:${R(x)}`,`DTEND;VALUE=DATE:${R(i)}
4`,`SUMMARY:${n(l.title)}`,`DESCRIPTION:${n(ie(l))}`),l.location&&d.push(`LOCATION:${n(l.location)}`),p>0&&d.push("BEGIN:VALARM","ACTION:DISPLAY",`DESCRIPTION:${n(l.title)}`,`TRIGGER:-P${p}D`,"END:VALARM"),d.push("END:VEVENT")}return d.push("END:VCALENDAR"),d.join(`\r
5`)}function Ca(a,s="perqt-reminders.ics"){a.length&&Ae(ka(a),s)}function Ae(a,s){const n=new Blob([a],{type:"text/calendar;charset=utf-8"}),d=URL.createObjectURL(n),l=document.createElement("a");l.href=d,l.download=s,document.body.appendChild(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(d),1e3)}const $s=qe("/_authenticated/reminders")({component:Da});function Da(){const{user:a}=ze(),{t:s}=te(),n=Ie(),{data:d,isLoading:l}=Xe(),x=d&&d.tier!=="free",[i,p]=_.useState("all"),[j,V]=_.useState(""),[w,h]=_.useState("all"),[E,Q]=_.useState("urgency"),[c,N]=_.useState(!1),[F,W]=_.useState(new Set),Se=Me(),{scope:D,setScope:le}=He("dashboard");D==="all"&&queueMicrotask(()=>le("personal"));const k=D==="business"?"business":"personal",{data:de}=ee({queryKey:["reminder-prefs",a?.id],queryFn:async()=>{const{data:r,error:o}=await M.from("notification_preferences").select("wallet_scope, reminders_enabled, reminder_grouping, reminder_frequency, notification_mode, digest_day, digest_hour, digest_tz").eq("user_id",a.id);if(o)throw o;const m=t=>({wallet_scope:t,reminders_enabled:!0,reminder_grouping:"per_card",reminder_frequency:"2m_1m_1w",notification_mode:"digest",digest_day:0,digest_hour:8,digest_tz:"America/New_York"}),y={personal:m("personal"),business:m("business")};for(const t of r??[])y[t.wallet_scope]={...m(t.wallet_scope),...t};return y},enabled:!!a&&!!x}),u=de?.[k],L=Ye({mutationFn:async r=>{const o=de?.[k],{error:m}=await M.from("notification_preferences").upsert({user_id:a.id,wallet_scope:k,reminders_enabled:o?.reminders_enabled??!0,reminder_grouping:o?.reminder_grouping??"per_card",reminder_frequency:o?.reminder_frequency??"2m_1m_1w",notification_mode:o?.notification_mode??"digest",digest_day:o?.digest_day??0,digest_hour:o?.digest_hour??8,digest_tz:o?.digest_tz??"America/New_York",...r},{onConflict:"user_id,wallet_scope"});if(m)throw m},onSuccess:()=>{n.invalidateQueries({queryKey:["reminder-prefs"]}),U.success(s("Notification preferences saved","Preferencias de notificación guardadas"))},onError:r=>U.error(r.message??s("Could not save","No se pudo guardar"))}),X=_.useRef(new Set);_.useEffect(()=>{if(!a||!u||u.notification_mode!=="digest")return;const r=`${a.id}:${k}`;if(X.current.has(r))return;let o;try{o=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{o=void 0}if(!o||o===u.digest_tz){X.current.add(r);return}X.current.add(r),(async()=>{const{error:m}=await M.from("notification_preferences").upsert({user_id:a.id,wallet_scope:k,reminders_enabled:u.reminders_enabled,reminder_grouping:u.reminder_grouping,reminder_frequency:u.reminder_frequency,notification_mode:u.notification_mode,digest_day:u.digest_day,digest_hour:u.digest_hour,digest_tz:o},{onConflict:"user_id,wallet_scope"});m||n.invalidateQueries({queryKey:["reminder-prefs"]})})()},[a,u,k,n]);const{data:ce=[]}=ee({queryKey:["reminders-cards",a?.id],queryFn:async()=>{const{data:r,error:o}=await M.from("user_cards").select("id, opened_at, nickname, card_lineage_id, replaces_user_card_id, replacement_type, archived, archived_reason, card_catalog!inner(name, issuer, annual_fee, card_type, card_benefits(id, name, dollar_value, frequency, period_amount, period_unit, period_anchor_month, effective_from, effective_to, status, value_class, annual_value_override))").eq("user_id",a.id);if(o)throw o;return ma(r??[])},enabled:!!a&&!!x}),me=ca(),Y=_.useMemo(()=>ce.filter(r=>!me.historyCardIds.has(r.id)&&Ze(D,r.card_catalog?.card_type)),[ce,D,me]),{data:ue=[]}=ee({queryKey:["reminders-redemptions",a?.id],queryFn:async()=>{const{data:r,error:o}=await M.from("benefit_redemptions").select("benefit_id, user_card_id, amount, redeemed_at").eq("user_id",a.id).eq("lifecycle_status","active");if(o)throw o;return r??[]},enabled:!!a&&!!x}),{renewals:q,credits:z,totalAtRisk:Te}=_.useMemo(()=>{const r=new Date,o=Y.map(t=>{const b=new Date(t.opened_at),v=new Date(b);for(;v<=r;)v.setFullYear(v.getFullYear()+1);const A=Math.ceil((v.getTime()-r.getTime())/864e5);return{kind:"renewal",key:`r-${t.id}`,cardId:t.id,cardName:t.card_catalog.name,issuer:t.card_catalog.issuer,daysLeft:A,fee:Number(t.card_catalog.annual_fee),renewalDate:v}}).filter(t=>t.daysLeft<=60&&t.fee>0),m=[];let y=0;for(const t of Y)for(const b of t.card_catalog.card_benefits??[]){const v=Qe(b,r);
5if(!v||v.unit==="annual")continue;const A=v.perPeriodCap;if(A<=0)continue;const J=ue.filter(I=>I.benefit_id===b.id&&I.user_card_id===t.id&&new Date(I.redeemed_at)>=v.start).reduce((I,Le)=>I+Number(Le.amount),0);if(J>=A)continue;const pe=Math.ceil((v.end.getTime()-r.getTime())/864e5),xe=Math.max(0,A-J);m.push({kind:"credit",key:`c-${t.id}-${b.id}`,cardId:t.id,cardName:t.card_catalog.name,issuer:t.card_catalog.issuer,benefitName:b.name,daysLeft:pe,remaining:xe,cap:A,used:J,periodLabel:v.label}),pe<=30&&(y+=xe)}return{renewals:o,credits:m,totalAtRisk:y}},[Y,ue]),Re=z.filter(r=>r.daysLeft<=21).length,Ee=q.filter(r=>r.daysLeft<=30).length,$=_.useMemo(()=>{let r=[];(i==="all"||i==="credits")&&(r=r.concat(z)),(i==="all"||i==="renewals")&&(r=r.concat(q)),w!=="all"&&(r=r.filter(t=>t.cardId===w));const o=j.trim().toLowerCase();o&&(r=r.filter(t=>(t.kind==="credit"?`${t.benefitName} ${t.cardName} ${t.issuer}`:`${t.cardName} ${t.issuer} annual fee renewal`).toLowerCase().includes(o)));const m=t=>t.kind==="credit"?t.remaining:t.fee,y=t=>t.kind==="credit"?t.benefitName:`${t.cardName} renewal`;return r.sort((t,b)=>{switch(E){case"value-desc":return m(b)-m(t);case"value-asc":return m(t)-m(b);case"name":return y(t).localeCompare(y(b));default:return t.daysLeft-b.daysLeft}}),r},[i,z,q,w,j,E]);return!l&&!x?e.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-8 md:py-10",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-muted-foreground",children:s("Don't leave value on the table","No dejes valor sobre la mesa")}),e.jsx("h1",{className:"font-display text-3xl sm:text-4xl mt-1 leading-tight mb-8",children:s("Reminders","Recordatorios")}),e.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-gold/50 bg-gradient-to-br from-gold/20 via-gold/5 to-transparent p-6 md:p-10 shadow-[0_0_60px_-15px_rgba(212,175,55,0.35)]",children:[e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 size-72 rounded-full bg-gold/20 blur-3xl"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-32 -left-20 size-72 rounded-full bg-gold/10 blur-3xl"}),e.jsxs("div",{className:"relative grid lg:grid-cols-[1.1fr_1fr] gap-8 lg:gap-12 items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-gold/20 border border-gold/40 px-3 py-1 text-[11px] uppercase tracking-[0.18em] text-gold font-medium",children:[e.jsx(ua,{className:"size-3"})," ",s("Premium Reminders","Recordatorios Premium")]}),e.jsx(ne,{children:Je[d?.tier??"free"]})]}),e.jsx("h2",{className:"font-display text-2xl sm:text-3xl md:text-4xl leading-tight text-balance",children:s("Never miss an expiring credit or surprise annual fee again.","Nunca más pierdas un crédito por vencer o te sorprenda una cuota anual.")}),e.jsx("p",{className:"text-platinum/90 mt-3 max-w-lg leading-relaxed",children:s("Perqt watches every benefit period and renewal date in your wallet, then nudges you in time to redeem the credit or decide whether to keep the card.","Perqt vigila cada periodo de beneficios y fecha de renovación de tu cartera, y te avisa a tiempo para canjear el crédito o decidir si conservar la tarjeta.")}),e.jsx("ul",{className:"mt-5 space-y-2.5",children:[s("Expiring credit alerts — 3 months, 1 month, and 1 week out","Alertas de créditos por vencer — 3 meses, 1 mes y 1 semana antes"),s("Annual fee renewal warnings before the charge posts","Avisos de renovación de cuota anual antes de que se cobre"),s("Customizable cadence — pick exactly when you want to be nudged","Cadencia personalizable — elige exactamente cuándo recibir los avisos"),s("Group by benefit, by card, or one digest — your choice","Agrupa por beneficio, por tarjeta o en un solo resumen — tú eliges"),s("Sort by urgency or by dollars left on the table","Ordena por urgencia o por dólares sobre la mesa"),s("Quiet what you don't care about — silence credits you'll never use","Silencia lo que no te importa — oculta créditos que nunca usarás")].map(r=>e.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-platinum",children:[e.jsx("div",{className:"mt-0.5 size-4 rounded-full bg-gold/25 flex items-center justify-center shrink-0",children:e.jsx(ye,{className:"size-2.5 text-gold"})}),r]},r))}),e.jsxs("div",{className:"mt-7 flex flex-wrap gap-3",children:[e.jsxs(Ce,{to:"/billing",className:"preview-hardware-button inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-gold text-gold-foreground font-medium shadow-lg shadow-gold/20 hover:brightness-110 transition",children:[s("Upgrade & Unlock Reminders","Mejorar y desbloquear recordatorios")," ",e.jsx(Pe,{className:"size-4"})]}),e.jsx(We,{to:"/dashboard",children:s("Back to dashboard","Volver al panel")})]}),e.jsx("p",{className:"text-xs text-titanium mt-3",children:s("Cancel anytime · Unlocks instantly","Cancela cuando quieras · Se desbloquea al instante")})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute -inset-3 bg-gradient-to-br from-gold/30 to-transparent roun
5ded-3xl blur-2xl opacity-60"}),e.jsxs("div",{className:"relative rounded-2xl border border-metallic bg-card-elevated/90 backdrop-blur p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] uppercase tracking-widest text-titanium",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(H,{className:"size-3 text-gold"})," ",s("Preview","Vista previa")]}),e.jsx("span",{className:"text-gold/80",children:s("Your timely nudges","Tus avisos a tiempo")})]}),[{icon:e.jsx(pa,{className:"size-3.5"}),label:s("Dining credit · expires in 12d","Crédito restaurantes · vence en 12d"),value:"$25",tone:"text-gold"},{icon:e.jsx(_e,{className:"size-3.5"}),label:s("Travel credit · expires in 38d","Crédito viaje · vence en 38d"),value:"$200",tone:"text-emerald-300"},{icon:e.jsx(xa,{className:"size-3.5"}),label:s("Sapphire Reserve renews","Renovación Sapphire Reserve"),value:"$550",tone:"text-platinum"},{icon:e.jsx(we,{className:"size-3.5"}),label:s("Streaming credit · expires in 7d","Crédito streaming · vence en 7d"),value:"$15",tone:"text-gold"}].map(r=>e.jsxs("div",{className:"rounded-xl border border-metallic/60 bg-background/40 p-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-platinum min-w-0",children:[e.jsx("span",{className:"text-gold/80 shrink-0",children:r.icon}),e.jsx("span",{className:"truncate",children:r.label})]}),e.jsx("div",{className:`text-sm font-semibold tabular-nums shrink-0 ${r.tone}`,children:r.value})]},r.label)),e.jsxs("div",{className:"rounded-lg bg-gold/10 border border-gold/30 px-3 py-2 text-[11px] text-gold flex items-center gap-2",children:[e.jsx(ga,{className:"size-3"}),s("Unlock to see your personalized reminders","Desbloquea para ver tus recordatorios personalizados")]})]})]})]})]})]}):e.jsxs("div",{className:"max-w-5xl mx-auto px-3 md:px-6 py-6 md:py-10",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-border/70 bg-card-elevated/60 backdrop-blur-sm shadow-[0_30px_80px_-40px_rgba(0,0,0,0.9)]",children:[e.jsx("div",{className:"pointer-events-none absolute -top-32 -right-32 size-96 rounded-full bg-gold/10 blur-[120px]"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-40 -left-24 size-80 rounded-full bg-gold/[0.06] blur-[120px]"}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-gold/50 to-transparent"}),e.jsxs("div",{className:"relative z-10 p-5 sm:p-8 md:p-12",children:[e.jsxs("header",{className:"flex flex-col gap-5 sm:grid sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end sm:gap-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] sm:text-[11px] uppercase tracking-[0.3em] text-gold font-semibold",children:s("Don't leave value on the table","No dejes valor sobre la mesa")}),e.jsx("h1",{className:"font-display text-5xl sm:text-6xl md:text-7xl leading-[0.95] mt-3 text-platinum",children:s("Reminders","Recordatorios")})]}),e.jsx("div",{className:"shrink-0 self-start sm:self-end",children:e.jsx(Ke,{scope:D==="all"?"personal":D,onChange:le,size:"default",hideAll:!0})})]}),e.jsx("p",{className:"text-sm text-titanium/90 mt-4 max-w-xl leading-relaxed",children:s("Everything that needs your attention — credits about to expire and annual fees about to post — in one sortable list.","Todo lo que necesita tu atención —créditos por vencer y cuotas anuales a punto de cobrarse— en una lista ordenable.")}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4 mt-8 sm:mt-12",children:[e.jsx(ae,{icon:e.jsx(_e,{className:"size-3.5"}),label:s("At risk","En riesgo"),value:f(Te),hint:s("Next 30 days","Próximos 30 días"),tone:"warning"}),e.jsx(ae,{icon:e.jsx(we,{className:"size-3.5"}),label:s("Expiring","Por vencer"),value:String(Re),hint:s("≤ 21 days","≤ 21 días"),tone:"gold"}),e.jsx(ae,{icon:e.jsx(De,{className:"size-3.5"}),label:s("Fees due","Cuotas próximas"),value:String(Ee),hint:s("≤ 30 days","≤ 30 días"),tone:"gold"})]}),e.jsx("div",{className:"mt-10 sm:mt-12 border-t border-border/70",children:e.jsxs("div",{className:"pt-5 flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsx(aa,{value:i,onValueChange:r=>p(r),children:e.jsx(sa,{className:"h-auto p-0 bg-transparent gap-6 sm:gap-8 rounded-none",children:[{v:"all",label:s("All","Todos"),count:z.length+q.length},{v:"credits",label:s("Credits","Créditos"),count:z.length},{v:"renewals",label:s("Renewals","Renovaciones"),count:q.length}].map(r=>{const o=i===r.v;return e.jsx(ra,{value:r.v,className:`relative rounded-none bg-transparent p-0 pb-2 text-sm font-medium tracking-wide transition-colors data-[state=active]:bg-transparent data-[state=active]:shadow-none ${o?"text-platinum border-b-2 border-gold":"text-titanium/50 hover:text-platinum border-b-2 border-transparent"}`,children:e.jsxs("span",{className:"flex items-center gap-2",children:[r.label,e.jsx("span",{className:`inline-flex items-center justify-center min-w-[1.1rem] h-4 px-1 text-[9px] font-bold rounded-full ${o?"bg-gold/20 text-gold":"bg-white/[0.06] text-titanium/60"}`,children:r.count})]})},r.v)})})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 md:items-center",children:[e.jsxs("div",{className:"relative flex-1 md:flex-initial",children:[e.jsx(fa,{className:"absolute left-4 top-1/2 -translate-y-1/2 size-4 text-titanium/50"}),e.jsx(Oe,{value:j,onChange:r=>V(r.target.value),placeholder:s("Search…","Buscar…"),className:"pl-10 h-10 rounded-full bg-white/[0.03] border-border/70 focus-visible:border-gold/50 focus-visible:ring-0 md:w-52"})]}),e.jsxs(P,{value:w,onValueChange:h,children:[e.jsxs(O,{className:"md:w-44 h-10 rounded-full bg-white/[0.03] border-border/70 hover:border-gold/40 transition-colors text-xs",children:[e.jsx(ha,{className:"size-3.5 text-titanium/60 mr-2 shrink-0"}),e.jsx(G,{})]}),e.jsxs(B,{children:[e.jsx(g,{value:"all",children:s("All cards","Todas las tarjetas")}),Y.map(r=>
5e.jsx(g,{value:r.id,children:r.card_catalog.name},r.id))]})]}),e.jsxs(P,{value:E,onValueChange:r=>Q(r),children:[e.jsxs(O,{className:"md:w-40 h-10 rounded-full bg-white/[0.03] border-border/70 hover:border-gold/40 transition-colors text-xs",children:[e.jsx(ba,{className:"size-3.5 text-titanium/60 mr-2 shrink-0"}),e.jsx(G,{})]}),e.jsxs(B,{children:[e.jsx(g,{value:"urgency",children:s("Most urgent","Más urgentes")}),e.jsx(g,{value:"value-desc",children:s("Highest value","Mayor valor")}),e.jsx(g,{value:"value-asc",children:s("Lowest value","Menor valor")}),e.jsx(g,{value:"name",children:s("Name (A–Z)","Nombre (A–Z)")})]})]})]})]})}),e.jsxs("div",{className:"mt-4 space-y-6",children:[$.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 rounded-xl border border-border/60 bg-white/[0.02] px-3 py-2 text-xs text-titanium/70",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[e.jsx(re,{className:"size-3.5 mt-0.5 shrink-0 text-gold/80","aria-hidden":!0}),e.jsx("p",{children:s("Tip: tap the calendar icon on any reminder to add it — or bulk-add multiple at once. Works with Google, Apple, or Outlook, no account connection needed.","Consejo: toca el icono de calendario en cualquier recordatorio para agregarlo, o agrega varios a la vez. Funciona con Google, Apple u Outlook, sin conectar tu cuenta.")})]}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 rounded-full border-gold/40 text-gold hover:text-gold hover:bg-gold/10 shrink-0",onClick:()=>{W(new Set($.map(r=>r.key))),N(!0)},children:[e.jsx(re,{className:"size-3.5 mr-1.5"}),s("Add all to calendar","Agregar todo al calendario"),e.jsxs("span",{className:"ml-1.5 text-[10px] opacity-70",children:["(",$.length,")"]})]})]}),$.length===0?e.jsxs("div",{className:"rounded-2xl border border-dashed border-border p-10 text-center",children:[e.jsx(ye,{className:"size-8 text-gold mx-auto mb-3"}),e.jsx("p",{className:"font-medium",children:s("You're all caught up","Estás al día")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j||w!=="all"?s("No reminders match your filters.","Ningún recordatorio coincide con tus filtros."):s("No expiring credits or upcoming renewals right now.","No hay créditos por vencer ni renovaciones próximas ahora mismo.")}),(j||w!=="all")&&e.jsx(T,{variant:"ghost",size:"sm",className:"mt-4",onClick:()=>{V(""),h("all")},children:s("Clear filters","Limpiar filtros")})]}):(()=>{const r=[{key:"30",title:s("Next 30 days","Próximos 30 días"),hint:s("Most urgent","Más urgente"),rows:[]},{key:"60",title:s("Next 60 days","Próximos 60 días"),hint:s("31–60 days out","31–60 días"),rows:[]},{key:"90",title:s("90+ days","90+ días"),hint:s("More than 60 days out","Más de 60 días"),rows:[]}];for(const m of $)m.daysLeft<=30?r[0].rows.push(m):m.daysLeft<=60?r[1].rows.push(m):r[2].rows.push(m);const o=r.filter(m=>m.rows.length>0);return e.jsx(he,{type:"multiple",defaultValue:o.map(m=>m.key),className:"space-y-3",children:o.map(m=>e.jsxs(be,{value:m.key,className:"bg-card-elevated border border-border rounded-2xl px-4 md:px-5",children:[e.jsx(ve,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex flex-1 items-baseline justify-between gap-3 pr-2",children:[e.jsxs("h2",{className:"font-display text-lg",children:[m.title," ",e.jsxs("span",{className:"text-sm text-muted-foreground font-sans",children:["(",m.rows.length,")"]})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:m.hint})]})}),e.jsx(je,{children:e.jsx("div",{className:"space-y-2 pb-2",children:m.rows.map(y=>e.jsx(Aa,{row:y},y.key))})})]},m.key))})})()]}),e.jsx("div",{className:"mt-12",children:e.jsx(he,{type:"single",collapsible:!0,defaultValue:"prefs",children:e.jsxs(be,{value:"prefs",className:"relative overflow-hidden bg-gradient-to-br from-card-elevated via-card-elevated to-background/60 border border-gold/25 rounded-3xl px-5 md:px-8 shadow-[0_20px_60px_-30px_rgba(212,175,55,0.35)]",children:[e.jsx("div",{className:"pointer-events-none absolute -top-16 -right-16 size-56 rounded-full bg-gold/20 blur-3xl op
5acity-60"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-20 -left-20 size-56 rounded-full bg-gold/10 blur-3xl opacity-50"}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-gold/60 to-transparent"}),e.jsx(ve,{className:"hover:no-underline py-6",children:e.jsxs("div",{className:"relative flex items-start sm:items-center gap-4 text-left w-full",children:[e.jsx("div",{className:"size-12 rounded-2xl bg-gradient-to-br from-gold/30 to-gold/5 border border-gold/40 flex items-center justify-center shrink-0 shadow-[0_0_28px_-8px_rgba(212,175,55,0.55)]",children:e.jsx(va,{className:"size-6 text-gold"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.22em] text-gold/80 font-medium mb-1",children:s("Concierge controls","Controles del conserje")}),e.jsx("p",{className:"font-display text-2xl sm:text-3xl leading-tight text-metallic-shimmer",children:s("Notification preferences","Preferencias de notificación")}),e.jsxs("p",{className:"text-sm text-muted-foreground font-normal mt-1.5 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-gold/30 bg-gold/10 px-2.5 py-0.5 text-[11px] text-gold",children:[e.jsx(H,{className:"size-3"}),u?.notification_mode==="off"?s("All off","Todo desactivado"):u?.notification_mode==="per_benefit"?s("Per-benefit","Por beneficio"):s("Weekly digest","Resumen semanal")]}),u?.notification_mode==="per_benefit"?e.jsx("span",{className:"text-xs",children:Sa(u?.reminder_frequency,s)}):null,e.jsxs("span",{className:"text-xs",children:["· ",s("Tap to fine-tune","Toca para ajustar")]})]})]})]})}),e.jsx(je,{children:e.jsxs("div",{className:"space-y-8 pb-4 pt-2",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-gold/30 bg-gradient-to-br from-gold/[0.08] via-gold/[0.02] to-transparent p-5 md:p-6",children:[e.jsx("div",{className:"pointer-events-none absolute -top-10 -right-10 size-40 rounded-full bg-gold/15 blur-2xl opacity-60"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-12 -left-12 size-40 rounded-full bg-gold/10 blur-2xl opacity-40"}),e.jsxs("div",{className:"relative flex flex-col sm:flex-row sm:items-center gap-4 sm:gap-5",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[e.jsx("div",{className:"size-14 rounded-2xl bg-gradient-to-br from-gold/25 to-gold/10 border border-gold/40 flex items-center justify-center shrink-0 shadow-[0_0_24px_-6px_rgba(212,175,55,0.35)]",children:k==="business"?e.jsx(ja,{className:"size-7 text-gold"}):e.jsx(Na,{className:"size-7 text-gold"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:s("Editing preferences for","Editando preferencias para")})}),e.jsx("p",{className:"font-display text-2xl sm:text-3xl leading-tight text-metallic-shimmer",children:k==="business"?s("Business Wallet","Cartera de Negocios"):s("Personal Wallet","Cartera Personal")})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-titanium bg-background/60 border border-border rounded-full px-3 py-1.5 shrink-0",children:[e.jsx(ya,{className:"size-3"}),s("Follows top toggle","Sigue el selector superior")]})]}),e.jsx("p",{className:"relative text-sm text-platinum/80 mt-4 leading-relaxed",children:s("Switch the Personal / Business toggle at the top of this page to edit the other wallet's preferences. Each wallet is saved independently.","Cambia el selector Personal / Negocios en la parte superior de esta página para editar las preferencias de la otra cartera. Cada cartera se guarda por separado.")})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-background/40 p-4 md:p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{className:"size-5 text-gold mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("Notification mode","Modo de notificación")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s("Pick one. We'll never send you both a weekly digest and per-benefit reminders.","Elige uno. Nunca te enviaremos a la vez un resumen semanal y recordatorios por beneficio.")})]})]}),e.jsxs(fe,{value:u?.notification_mode??"digest",onValueChange:r=>L.mutate({notification_mode:r,reminders_enabled:r!=="off"}),className:"gap-3",children:[e.jsx(S,{id:"mode-digest",value:"digest",title:s("Weekly digest","Resumen semanal"),recommended:!0,recommendedLabel:s("Default","Predeterminado"),desc:s("One email a week recapping last 7 days' value, expiring credits, and your top move.","Un correo a la semana con el resumen del valor de los últimos 7 días, créditos por vencer y tu mejor acción.")}),e.jsx(S,{id:"mode-per-benefit",value:"per_benefit",title:s("Per-benefit reminders","Recordatorios por beneficio"),desc:s("Granular nudges before each credit expires. Higher email volume — best for power users.","Avisos granulares antes de que venza cada crédito. Mayor volumen de correos — ideal para usuarios avanzados.")}),e.jsx(S,{id:"mode-off",value:"off",title:s("Off","Desactivado"),desc:s("No reminder emails. You'll still get critical account emails (security, billing).","Sin correos de recordatorio. Aún recibirás correos críticos de cuenta (seguridad, facturación).")})]}),u?.notification_mode==="digest"?e.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx(se,{className:"text-xs text-muted-foreground",children:s("Day","Día")}),e.jsxs(P,{value:String(u?.digest_day??0),onValueChange:r=>L.mutate({digest_day:parseInt(r,10)}),children:[e.jsx(O,{className:"h-11 rounded-xl mt-1",children:e.jsx(G,{})}),e.jsxs(B,{children:[e.jsx(g,{value:"0",children:s("Sunday","Domingo")}),e.jsx(g,{value:"1",children:s("Monday","Lunes")}),e.jsx(g,{value:"2",children:s("Tuesday","Martes")}),e.jsx(g,{value:"3",children:s("Wednesday","Miércoles")}),e.jsx(g,{value:"4",children:s("Thursday","Jueves")}),e.jsx(g,{value:"5",children:s("Friday","Viernes")}),e.jsx(g,{value:"6",children:s("Saturday","Sábado")})]})]})]}),e.jsxs("div",{children:[e.jsx(se,{className:"text-xs text-muted-foreground",children:s("Hour","Hora")}),e.jsxs(P,{value:String(u?.digest_hour??8),onValueChange:r=>L.mutate({digest_hour:parseInt(r,10)}),children:[e.jsx(O,{className:"h-11 rounded-xl mt-1",children:e.jsx(G,{})}),e.jsx(B,{children:Array.from({length:24}).map((r,o)=>e.jsx(g,{value:String(o),children:o===0?"12 AM":o<12?`${o} AM`:o===12?"12 PM":`${o-12} PM`},o))})]})]}),e.jsxs("p",{className:"col-span-2 text-[11px] text-muted-foreground",children:[s("Local time (","Hora local ("),u?.digest_tz??"America/Ne
5w_York",s("). Auto-detected from your browser when you next save.","). Detectada automáticamente desde tu navegador la próxima vez que guardes.")]})]}):null]}),e.jsxs("div",{className:u?.notification_mode!=="per_benefit"?"opacity-50 pointer-events-none":"",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:s("Step 1","Paso 1")}),e.jsx("span",{className:"h-px flex-1 bg-border"})]}),e.jsx("p",{className:"font-display text-base mb-1",children:s("How should we group them?","¿Cómo quieres agruparlos?")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:s("Controls how many separate emails land in your inbox.","Controla cuántos correos por separado llegan a tu bandeja.")}),e.jsxs(fe,{value:u?.reminder_grouping??"per_card",onValueChange:r=>L.mutate({reminder_grouping:r}),className:"gap-3",children:[e.jsx(S,{id:"grp-benefit",value:"per_benefit",title:s("One email per benefit","Un correo por beneficio"),desc:s("Most granular — a separate reminder for every credit. Higher email volume.","Más granular: un recordatorio separado por cada crédito. Más volumen de correos.")}),e.jsx(S,{id:"grp-card",value:"per_card",title:s("One email per card","Un correo por tarjeta"),recommended:!0,recommendedLabel:s("Recommended","Recomendado"),desc:s("All unredeemed benefits for a single card bundled into one email.","Todos los beneficios no canjeados de una sola tarjeta en un solo correo.")}),e.jsx(S,{id:"grp-all",value:"all_in_one",title:s("One email for everything","Un correo para todo"),desc:s("A single digest covering every card and every benefit. Lowest volume.","Un solo resumen que cubre todas las tarjetas y beneficios. Menor volumen.")})]})]}),e.jsxs("div",{className:u?.notification_mode!=="per_benefit"?"opacity-50 pointer-events-none":"",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:s("Step 2","Paso 2")}),e.jsx("span",{className:"h-px flex-1 bg-border"})]}),e.jsx("p",{className:"font-display text-base mb-1",children:s("How often?","¿Con qué frecuencia?")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:s("Choose a cadence of nudges before each benefit expires.","Elige la cadencia de avisos antes de que venza cada beneficio.")}),e.jsxs(P,{value:u?.reminder_frequency??"2m_1m_1w",onValueChange:r=>L.mutate({reminder_frequency:r}),children:[e.jsx(O,{className:"w-full md:w-96 h-12 rounded-xl",children:e.jsx(G,{})}),e.jsxs(B,{children:[e.jsx(g,{value:"3m_1m_1w",children:s("3 months, 1 month & 1 week before expiry","3 meses, 1 mes y 1 semana antes del vencimiento")}),e.jsx(g,{value:"3m_2m_1m",children:s("3 months, 2 months & 1 month before expiry","3 meses, 2 meses y 1 mes antes del vencimiento")}),e.jsx(g,{value:"2m_1m_1w",children:s("2 months, 1 month & 1 week before expiry","2 meses, 1 mes y 1 semana antes del vencimiento")})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 text-xs text-muted-foreground border-t border-border pt-4",children:[e.jsx(H,{className:"size-3.5 mt-0.5 shrink-0"}),e.jsx("p",{children:s("Email delivery is rolling out soon. Your preferences are saved now and will apply automatically once it's live.","El envío por correo se activará pronto. Tus preferencias ya están guardadas y se aplicarán automáticamente cuando esté disponible.")})]})]})})]})})})]})]}),e.jsx(Ta,{open:c,onOpenChange:N,rows:$,selected:F,setSelected:W,confirm:Se,t:s})]})}function ae({icon:a,label:s,value:n,hint:d,tone:l="gold"}){const x=l==="warning"?"text-warning":"text-platinum",i=l==="warning"?"border-l-warning/60":"border-l-gold/60",p=l==="warning"?"text-warning":"text-gold";return e.jsxs("div",{className:`group relative overflow-hidden border-l-2 ${i} bg-gradient-to-br from-white/[0.04] via-white/[0.015] to-transparent rounded-r-2xl rounded-l-md p-4 md:p-6 min-h-[110px] md:min-h-[130px] flex flex-col justify-between transition-colors hover:from-white/[0.06]`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-[0.2em] text-titanium/70 whitespace-nowrap",children:[e.jsx("span",{className:p,children:a}),e.jsx("span",{children:s})]}),e.jsxs("div",{className:"flex items-baseline gap-2 mt-3",children:[e.jsx("p",{className:`font-display leading-none text-3xl md:text-5xl tabular-nums ${x}`,children:n}),d&&e.jsx("span",{className:"text-[9px] md:text-[10px] uppercase tracking-[0.15em] text-titanium/60 whitespace-nowrap",children:d})]})]})}function $a(a){return a<=7?{ring:"border-destructive/50",text:"text-destructive",bg:"bg-destructive/10"}:a<=21?{ring:"border-warning/50",text:"text-warning",bg:"bg-warning/10"}:{ring:"border-border",text:"text-muted-foreground",bg:"bg-muted/40"}}function ke(a){const s=a.kind==="renewal"?new Date(a.renewalDate):new Date(Date.now()+Math.max(0,a.daysLeft)*24*60*60*1e3),n=a.kind==="credit"?`Perqt: ${a.benefitName} expires (${f(a.remaining)} left) — ${a.cardName}`:`Perqt: ${Z(a.issuer,a.cardName)} annual fee posts (${f(a.fee)})`,d=a.kind==="credit"?`${f(a.remaining)} unredeemed on ${a.benefitName} (${a.cardName}
5). Cycle ends ${a.periodLabel}.
6
7Open in Perqt: https://perqt.ai/cards/${a.cardId}`:`Annual fee of ${f(a.fee)} posts on ${a.renewalDate.toLocaleDateString()}. Review ROI before it renews.
8
9Open in Perqt: https://perqt.ai/cards/${a.cardId}`;return{title:n,description:d,date:s,reminderDaysBefore:a.kind==="credit"?3:14}}function Aa({row:a}){const s=$a(a.daysLeft),{t:n}=te(),d=a.kind==="renewal"?new Date(a.renewalDate):new Date(Date.now()+Math.max(0,a.daysLeft)*24*60*60*1e3),l=a.kind==="credit"?`Perqt: ${a.benefitName} expires (${f(a.remaining)} left) — ${a.cardName}`:`Perqt: ${Z(a.issuer,a.cardName)} annual fee posts (${f(a.fee)})`,x=a.kind==="credit"?`${f(a.remaining)} unredeemed on ${a.benefitName} (${a.cardName}). Cycle ends ${a.periodLabel}.
10
11Open in Perqt: https://perqt.ai/cards/${a.cardId}`:`Annual fee of ${f(a.fee)} posts on ${a.renewalDate.toLocaleDateString()}. Review ROI before it renews.
12
13Open in Perqt: https://perqt.ai/cards/${a.cardId}`,i=$e({title:l,description:x,date:d,reminderDaysBefore:a.kind==="credit"?3:14});return e.jsxs("div",{className:`relative bg-card-elevated border ${s.ring} rounded-xl hover:border-gold/40 transition-colors`,children:[e.jsx(Ce,{to:"/cards/$cardId",params:{cardId:a.cardId},className:"block p-4 pr-14",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{variant:"outline",className:"text-[10px] uppercase tracking-wider whitespace-nowrap shrink-0",children:a.kind==="credit"?n("Credit","Crédito"):n("Annual fee","Cuota anual")}),a.kind==="credit"?e.jsxs("p",{className:"font-medium break-words",children:[a.benefitName," ",e.jsxs("span",{className:"text-muted-foreground text-sm",children:["· ",a.cardName]})]}):e.jsxs("p",{className:"font-medium break-words",children:[Z(a.issuer,a.cardName)," ",e.jsxs("span",{className:"text-muted-foreground text-sm",children:["· ",n("renewal","renovación")]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.kind==="credit"?`${f(a.remaining)} ${n("unredeemed","sin canjear")}${a.used>0?` ${n("of","de")} ${f(a.cap)}`:""} · ${n("ends","termina")} ${a.periodLabel}`:`${f(a.fee)} ${n("fee posts on","cuota se cobra el")} ${a.renewalDate.toLocaleDateString()}`})]}),e.jsx("div",{className:"text-right shrink-0",children:e.jsx("span",{className:`inline-block text-xs font-medium px-2 py-1 rounded-full ${s.bg} ${s.text}`,children:a.daysLeft<=0?n("Today","Hoy"):`${a.daysLeft}${n("d","d")}`})})]})}),e.jsx("div",{className:"absolute top-1/2 right-3 -translate-y-1/2",children:e.jsxs(Ge,{children:[e.jsx(Be,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-gold","aria-label":n("Add to calendar","Agregar al calendario"),onClick:p=>p.stopPropagation(),children:e.jsx(De,{className:"size-4"})})}),e.jsxs(Ue,{align:"end",onClick:p=>p.stopPropagation(),children:[e.jsx(Ve,{children:n("Add to calendar","Agregar al calendario")}),e.jsx(Fe,{}),e.jsx(ge,{asChild:!0,children:e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:n("Google Calendar","Google Calendar")})}),e.jsx(ge,{onSelect:p=>{p.preventDefault(),wa({title:l,description:x,date:d,reminderDaysBefore:a.kind==="credit"?3:14},`perqt-${a.kind}-${a.key}.ics`)},children:n("Apple / Outlook (.ics)","Apple / Outlook (.ics)")})]})]})})]})}function S({id:a,value:s,title:n,desc:d,recommended:l,recommendedLabel:x}){const{t:i}=te();return e.jsxs(se,{htmlFor:a,className:"flex items-start gap-3 rounded-xl border border-border p-4 cursor-pointer hover:border-gold/40 has-[:checked]:border-gold/60 has-[:checked]:bg-gold/5",children:[e.jsx(ea,{value:s,id:a,className:"mt-0.5"}),e.jsxs("span",{className:"space-y-1",children:[e.jsxs("span",{className:"block font-medium",children:[n,l&&e.jsxs("span",{className:"text-xs text-gold ml-2",children:["· ",x??i("Recommended","Recomendado")]})]}),e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:d})]})]})}function Sa(a,s){switch(a){case"3m_1m_1w":return s("3mo · 1mo · 1wk before","3m · 1m · 1sem antes");case"3m_2m_1m":return s("3mo · 2mo · 1mo before","3m · 2m · 1m antes");default:return s("2mo · 1mo · 1wk before","2m · 1m · 1sem antes")}}function Ta({open:a,onOpenChange:s,rows:n,selected:d,setSelected:l,confirm:x,t:i}){const p=n.length>0&&n.every(c=>d.has(c.key)),j=c=>{const N=new Set(d);N.has(c)?N.delete(c):N.add(c),l(N)},V=()=>
13{l(p?new Set:new Set(n.map(c=>c.key)))},w=n.filter(c=>d.has(c.key)),h=w.length,E=()=>{if(!h)return;const c=w.map(ke);Ca(c,`perqt-reminders-${new Date().toISOString().slice(0,10)}.ics`),U.success(i(`Downloaded ${h} reminder${h===1?"":"s"}. Open the file to add them to Apple, Outlook, or Google.`,`Se descargaron ${h} recordatorio${h===1?"":"s"}. Abre el archivo para agregarlos a Apple, Outlook o Google.`)),s(!1)},Q=()=>{if(h!==1)return;const c=w[0];if(!c)return;const N=$e(ke(c));if(!window.open(N,"_blank","noopener,noreferrer")){U.error(i("Your browser blocked the pop-up. Allow pop-ups for perqt.ai or use the .ics download instead.","Tu navegador bloqueó la ventana emergente. Permítela para perqt.ai o usa la descarga .ics."));return}U.success(i("Opened Google Calendar. Save the event to add it.","Se abrió Google Calendar. Guarda el evento para agregarlo.")),s(!1)};return e.jsx(ta,{open:a,onOpenChange:s,children:e.jsxs(na,{className:"max-w-lg",children:[e.jsxs(oa,{children:[e.jsx(ia,{children:i("Add reminders to your calendar","Agregar recordatorios a tu calendario")}),e.jsx(la,{children:i("Review what you want to add, then download a single .ics file (Apple, Outlook, Google) or open each in Google Calendar. Perqt never touches your calendar.","Revisa lo que quieres agregar, luego descarga un solo archivo .ics (Apple, Outlook, Google) o abre cada uno en Google Calendar. Perqt nunca toca tu calendario.")})]}),e.jsxs("div",{className:"flex items-center justify-between border-y border-border py-2",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(Ne,{checked:p,onCheckedChange:V}),e.jsx("span",{children:p?i("Deselect all","Deseleccionar todos"):i("Select all","Seleccionar todos")})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," / ",n.length," ",i("selected","seleccionados")]})]}),e.jsx("div",{className:"max-h-[45vh] overflow-y-auto -mx-2 px-2 space-y-1.5",children:n.map(c=>{const N=d.has(c.key),F=c.kind==="credit"?`${c.benefitName} · ${c.cardName}`:`${Z(c.issuer,c.cardName)} · ${i("annual fee","cuota anual")}`,W=c.kind==="credit"?`${f(c.remaining)} · ${c.daysLeft<=0?i("today","hoy"):`${c.daysLeft}${i("d","d")}`}`:`${f(c.fee)} · ${c.renewalDate.toLocaleDateString()}`;return e.jsxs("label",{htmlFor:`bulk-${c.key}`,className:"flex items-center gap-3 rounded-lg border border-border/60 hover:border-gold/40 p-2.5 cursor-pointer has-[:checked]:border-gold/50 has-[:checked]:bg-gold/5",children:[e.jsx(Ne,{id:`bulk-${c.key}`,checked:N,onCheckedChange:()=>j(c.key)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:F}),e.jsx("p",{className:"text-xs text-muted-foreground",children:W})]}),e.jsx(ne,{variant:"outline",className:"text-[10px] uppercase tracking-wider shrink-0",children:c.kind==="credit"?i("Credit","Crédito"):i("Fee","Cuota")})]},c.key)})}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:i("Credit reminders alert 3 days before expiry; annual-fee reminders alert 14 days before renewal.","Los créditos avisan 3 días antes del vencimiento; las cuotas anuales avisan 14 días antes de la renovación.")}),e.jsxs(da,{className:"gap-2 sm:gap-2",children:[e.jsx(T,{variant:"ghost",onClick:()=>s(!1),children:i("Cancel","Cancelar")}
13),e.jsx(T,{variant:"outline",onClick:Q,disabled:h!==1,title:h>1?i("Google Calendar only supports one event per click. Use Download .ics for multiple reminders.","Google Calendar solo admite un evento por clic. Usa Descargar .ics para varios recordatorios."):void 0,children:i("Open in Google","Abrir en Google")}),e.jsxs(T,{onClick:E,disabled:!h,children:[e.jsx(re,{className:"size-4 mr-1.5"}),i("Download .ics","Descargar .ics")]})]})]})})}export{$s as Route};

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.