PageSourceSearch

https://maronici.pl/assets/DonorPortalPage-e3e36091.js

js maronici.pl collected 2026-10-02 21:07:43 UTC 25,209 bytes, 1 lines download raw bytes

1import{aH as oe,e as ie,aI as le,r as i,n as de,a5 as ce,j as e,a as b,q as me,l as N,i as xe,b as pe,B as z,aG as H,F as R,a0 as U,k as ue,aY as he,aU as q,a1 as G,ao as we,L as je,H as be,R as ge,I as ye,a6 as fe}from"./index-5a305ee0.js";import{A as Ne,a as ze,b as ke,c as ve,d as Pe,e as Ae,g as Ce,f as De}from"./alert-dialog-b6315dbc.js";import{H as W}from"./history-8356369a.js";import{B as Te}from"./ban-d3f33c3e.js";import{P as Be}from"./plus-2e283f20.js";import{C as Ee}from"./calendar-clock-2105cc90.js";import{C as Se}from"./circle-x-26f2bf9c.js";import{D as Fe}from"./download-93167685.js";const k="donorPortalSession",$="donorPortalView",E=t=>G(Number(t??0)/100),g=t=>t?new Date(t).toLocaleDateString("pl-PL",{day:"numeric",month:"long",year:"numeric"}):"—",K=t=>{if(!t)return"—";const[l,m,y]=String(t).split("-");return`${y}.${m}.${l}`},Z=t=>{if(!t)return"";const[l,m,y]=String(t).split("-").map(Number);return new Date(l,m-1,y).toLocaleDateString("pl-PL",{weekday:"long"})},Le={gregorian:"Msze gregoriańskie",thirty_single:"30 intencji pojedynczych",single:"Intencja mszalna",perpetual:"Msza wieczysta"};function We(){const{t}=oe(),{toast:l}=ie(),[m,y]=le(),[h,d]=i.useState("loading"),[v,V]=i.useState(""),[c,w]=i.useState(!1),[j,P]=i.useState(()=>sessionStorage.getItem(k)||null),[o,Y]=i.useState({subscriptions:[],charges:[],intentions:[],prayers:[]}),[A,C]=i.useState(null),[J,X]=i.useState(()=>sessionStorage.getItem($)||"all"),[D,S]=i.useState(!1),x=i.useCallback(async(a,s={},n=!1)=>{const r={body:{action:a,...s}};n&&j&&(r.headers={"x-donor-session":j});const{data:p,error:u}=await de.functions.invoke("donor-portal",r);if(u)throw new Error("network");return p},[j]),T=i.useCallback(async()=>{const a=await x("data",{},!0);if(!(a!=null&&a.ok))throw new Error((a==null?void 0:a.error)||"unauthorized");Y({subscriptions:a.subscriptions??[],charges:a.charges??[],intentions:a.intentions??[],prayers:a.prayers??[]})},[x]);i.useEffect(()=>{let a=!1;return(async()=>{const s=m.get("token");try{if(s){const n=await x("session",{token:s});if(a)return;if(n!=null&&n.ok&&n.sessionToken){sessionStorage.setItem(k,n.sessionToken),P(n.sessionToken),m.delete("token"),y(m,{replace:!0});return}d("request"),l({title:t("donorPortal.linkExpired","Link wygasł"),description:t("donorPortal.linkExpiredDesc","Ten link jest jednorazowy i ważny 15 minut. Poproś o nowy poniżej."),className:"bg-amber-50 text-amber-900 border-amber-200"});return}if(j){await T(),a||d("panel");return}a||d("request")}catch(n){ce.error("[DonorPortal] boot failed",n),a||(sessionStorage.removeItem(k),P(null),d("request"))}})(),()=>{a=!0}},[]),i.useEffect(()=>{if(!j||h==="panel")return;let a=!1;return(async()=>{try{await T(),a||d("panel")}catch{a||(sessionStorage.removeItem(k),P(null),d("request"))}})(),()=>{a=!0}},[j]);const Q=async a=>{if(a.preventDefault(),!(c||!v.trim())){w(!0);try{await x("request_link",{email:v.trim()}),d("sent")}catch{d("sent")}finally{w(!1)}}},ee=async()=>{if(A){w(!0);try{const a=await x("cancel",{subscriptionId:A},!0);if(!(a!=null&&a.ok))throw new Error((a==null?void 0:a.error)||"failed");l({title:t("donorPortal.cancelOkTitle","Wsparcie anulowane"),description:t("donorPortal.cancelOkDesc","Nie pobierzemy już kolejnych płatności. Potwierdzenie wysłaliśmy e-mailem. Dziękujemy za Twoją hojność."),className:"bg-emerald-50 text-emerald-900 border-emerald-200"}),await T()}catch{l({title:t("donorPortal.errTitle","Coś poszło nie tak"),description:t("donorPortal.cancelErrDesc","Nie udało się anulować. Spróbuj ponownie za chwilę."),className:"bg-amber-50 text-amber-900 border-amber-200"})}finally{w(!1),C(null)}}},ae=async a=>{w(!0);try{const s=await x("rebill",{subscriptionId:a,continueUrl:`${window.location.origin}/panel-darczyncy`},!0);if(!(s!=null&&s.ok)||!s.redirectUri)throw new Error((s==null?void 0:s.error)||"failed");window.location.href=fe(s.redirectUri)}catch{w(!1),l({title:t("donorPortal.errTitle","Coś poszło nie tak"),description:t("donorPortal.cardErrDesc","Nie udało się rozpocząć zmiany karty. Spróbuj ponownie za chwilę."),className:"bg-amber-50 text-amber-900 border-amber-200"})}},F=a=>{X(a);try{sessionStorage.setItem($,a)}catch{}},te=async a=>{if(D)return;S(!0);let s=null;try{const n=await x("receipt_pdf",{year:a},!0);if((n==null?void 0:n.error)==="no_donations"){l({title:t("donorPortal.receiptNoneTitle","Brak darowizn do potwierdzenia"),description:t("donorPortal.receiptNoneDesc","Za ten rok nie mamy darowizny, którą można odliczyć od podatku. Ofiary za intencje mszalne nie wchodzą do potwierdzenia — Msza jest sprawowana za ofiarę, a nie darowizną w rozumieniu podatkowym."),className:"bg-amber-50 text-amber-900 border-amber-200"});return}if(!(n!=null&&n.ok)||!n.pdfBase64)throw new Error((n==null?void 0:n.error)||"failed");const r=atob(n.pdfBase64),p=new Uint8Array(r.length);for(let f=0;f<r.length;f+=1)p[f]=r.charCodeAt(f);s=URL.createObjectURL(new Blob([p],{type:"application/pdf"}));const u=document.createElement("a");u.href=s,u.download=n.filename||`potwierdzenie-darowizn-${a}.pdf`,document.body.appendChild(u),u.click(),u.remove()}catch{l({title:t("donorPortal.errTitle","Coś poszło nie tak"),description:t("donorPortal.receiptErrDesc","Nie udało się pobrać potwierdzenia. Spróbuj ponownie za chwilę."),className:"bg-amber-50 text-amber-900 border-amber-200"})}finally{s&&setTimeout(()=>URL.revokeObjectURL(s),1e4),S(!1)}},se={active:t("donorPortal.statusActive","Aktywne"),cancelled:t("donorPortal.statusCancelled","Anulowane"),failed:t("donorPortal.statusFailed","Wstrzymane"),paused:t("donorPortal.statusPaused","Wstrzymane")},ne={active:"bg-emerald-100 text-emerald-800",cancelled:"bg-stone-200 text-stone-600",failed:"bg-amber-100 text-amber-800",paused:"bg-amber-100 text-amber-800"},re=o.charges.filter(a=>a.status==="COMPLETED").reduce((a,s)=>a+Number(s.amount??0),0),L=o.intentions.length>0||o.prayers.length>0,I=o.subscriptions.length>0||o.charges.length>0,_=L&&I,B=_?J:"all",M=Array.from(new Set(o.charges.filter(a=>a.status==="COMPLETED"&&(a.paid_at||a.created_at)).map(a=>new Date(a.paid_at||a.created_at).getFullYear()))).sort((a,s)=>s-a),O=h!=="panel";return e.jsxs("div",{className:b("bg-[#FAF6EE] px-4",O?"flex min-h-[calc(100vh-5rem)] flex-col items-center justify-center py-16":"min-h-screen pb-12 pt-20"),children:[e.jsxs(me,{children:[e.jsx("title",{children:"Panel Darczyńcy — Maronicka Fundacja Misyjna"}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsxs("div",{className:b("mx-auto w-full",O?"max-w-md":"max-w-2xl"),children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsx("h1",{className:"font-serif text-3xl font-bold text-[#2c1810]",children:t("donorPortal.title","Panel Darczyńcy")}),e.jsx("p",{className:"mt-1.5 text-sm text-[#4A3F5C]",children:t("donorPortal.subtitle","Twoje wsparcie Maronickiej Fundacji Misyjnej")})]}),h==="loading"&&e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(N,{className:"h-8 w-8 animate-spin text-[#8B3A3A]"})}),h==="request"&&e.jsxs("div",{className:"rounded-2xl bg-white p-8 shadow-sm",children:[e.jsx("p",{className:"mb-5 text-sm leading-relaxed text-[#4A3F5C]",children:t("donorPortal.requestIntro","Bez hasła. Podaj e-mail użyty przy darowiźnie, a wyślemy Ci bezpieczny, jednorazowy link do Twojego panelu (ważny 15 minut).")}
1),e.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(xe,{htmlFor:"dp-email",className:"text-xs font-semibold text-[#6B3E2E]",children:t("donorPortal.emailLabel","Adres e-mail")}),e.jsx(pe,{id:"dp-email",type:"email",required:!0,autoComplete:"email",value:v,onChange:a=>V(a.target.value),placeholder:"[email protected]",className:"mt-1 h-11"})]}),e.jsx(z,{type:"submit",disabled:c,className:"w-full h-11 bg-[#8B3A3A] hover:bg-[#6e2e2e] font-semibold",children:c?e.jsx(N,{className:"h-4 w-4 animate-spin"}):t("donorPortal.requestBtn","Wyślij mi link do panelu")})]}),e.jsxs("div",{className:"mt-6 border-t border-stone-100 pt-5",children:[e.jsx("p",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.14em] text-[#8B3A3A]/70",children:t("donorPortal.perksTitle","Co znajdziesz w panelu")}),e.jsx("ul",{className:"space-y-2.5",children:[[H,t("donorPortal.perkIntentions","Terminy wszystkich zamówionych Mszy Świętych")],[R,t("donorPortal.perkReceipt","Potwierdzenie darowizn w PDF, do odliczenia od podatku")],[W,t("donorPortal.perkHistory","Historię wszystkich swoich darowizn")],[U,t("donorPortal.perkCard","Zmianę karty przy wsparciu comiesięcznym")],[Te,t("donorPortal.perkCancel","Zatrzymanie wsparcia w jednej chwili, bez podawania powodu")]].map(([a,s])=>e.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] leading-relaxed text-[#4A3F5C]",children:[e.jsx(a,{className:"mt-0.5 h-4 w-4 shrink-0 text-[#8B3A3A]/70"}),s]},s))})]}),e.jsxs("p",{className:"mt-5 flex items-start gap-2 border-t border-stone-100 pt-4 text-sm leading-relaxed text-stone-600",children:[e.jsx(ue,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),t("donorPortal.requestSecurity","Nie używamy haseł — dzięki temu nie ma czego wykraść. Link działa raz i tylko przez 15 minut.")]})]}),h==="sent"&&e.jsxs("div",{className:"rounded-2xl bg-white p-8 text-center shadow-sm",children:[e.jsx(he,{className:"mx-auto mb-4 h-12 w-12 text-emerald-600"}),e.jsx("h2",{className:"text-lg font-bold text-[#2c1810]",children:t("donorPortal.sentTitle","Sprawdź swoją skrzynkę")}),e.jsx("p",{className:"mx-auto mt-2 max-w-sm text-sm leading-relaxed text-[#4A3F5C]",children:t("donorPortal.sentDesc","Jeśli ten adres e-mail jest powiązany z jakąkolwiek darowizną, wysłaliśmy na niego bezpieczny link do panelu. Sprawdź też folder spam.")})]}),h==="panel"&&e.jsxs("div",{className:"space-y-6",children:[_&&e.jsx("div",{role:"tablist","aria-label":t("donorPortal.viewLabel","Widok panelu"),className:"mx-auto flex w-fit max-w-full gap-1 rounded-xl bg-[#f1ece1] p-1",children:[["all",t("donorPortal.viewAll","Wszystko"),null],["intentions",t("donorPortal.viewIntentions","Intencje"),o.intentions.length+o.prayers.length]].map(([a,s,n])=>{const r=B===a;return e.jsxs("button",{type:"button",role:"tab","aria-selected":r,tabIndex:r?0:-1,onClick:()=>F(a),onKeyDown:p=>{["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"].includes(p.key)&&(p.preventDefault(),F(a==="all"?"intentions":"all"))},className:b("inline-flex items-center gap-2 whitespace-nowrap rounded-lg px-5 py-2 text-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#8B3A3A] focus-visible:ring-offset-2",r?"bg-white font-semibold text-[#2c1810] shadow-sm":"font-medium text-[#6b6255] hover:text-[#2c1810]"),children:[s,n!=null&&e.jsx("span",{className:b("rounded-full px-1.5 py-px text-[11px] font-semibold tabular-nums",r?"bg-[#8B3A3A] text-white":"bg-[#e4dccd] text-[#6b6255]"),children:n})]},a)})}),!I&&!L&&e.jsxs("div",{className:"rounded-2xl bg-white p-8 text-center shadow-sm",children:[e.jsx(q,{className:"mx-auto mb-3 h-10 w-10 text-stone-400"}),e.jsx("p",{className:"text-sm text-[#4A3F5C]",children:t("donorPortal.empty","Nie znaleźliśmy żadnej darowizny powiązanej z tym adresem e-mail.")})]}),o.intentions.map(a=>{const s=a.massCount>0?Math.round(a.celebrated/a.massCount*100):0,n=a.massCount>1;return e.jsxs("div",{className:"overflow-hidden rounded-2xl bg-white shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-stone-100 px-6 py-4",children:[e.jsx(H,{className:"h-4 w-4 text-[#8B3A3A]"}),e.jsx("span",{className:"font-semibold text-[#2c1810]",children:Le[a.type]||t("donorPortal.intentionGeneric","Intencja mszalna")}),e.jsxs("span",{className:"ml-auto text-[12px] text-stone-500",children:[g(a.created_at),Number(a.amount)>0&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("strong",{className:"text-[#2c1810]",children:G(Number(a.amount))})]})]})]}),e.jsxs("div",{className:"px-6 py-5",children:[a.content&&e.jsx("p",{className:"rounded-r-md border-l-[3px] border-[#8B3A3A] bg-[#FAF6EE] px-4 py-3 text-sm leading-relaxed text-[#4A3F5C]",children:a.content}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:t("donorPortal.celebrant","Kapłan")}),e.jsx("div",{className:"font-medium text-[#2c1810]",children:a.priestName||"—"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:t("donorPortal.church","Kościół")}),e.jsx("div",{className:"font-medium text-[#4A3F5C]",children:a.church?e.jsxs(e.Fragment,{children:[e.jsx("strong",{className:"text-[#2c1810]",children:a.church}),a.city?`, ${a.city}`:""]}):"—"})]}),a.time&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:t("donorPortal.hour","Godzina")}),e.jsxs("div",{className:"font-medium text-[#4A3F5C]",children:[e.jsx("strong",{className:"text-[#2c1810]",children:a.time})," ",t("donorPortal.lebaneseTime","czasu libańskiego")]})]}),a.lastDate&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:n?t("donorPortal.lastMass","Ostatnia Msza"):t("donorPortal.massDate","Data Mszy")}),e.jsxs("div",{className:"font-medium text-[#4A3F5C]",children:[e.jsx("strong",{className:"text-[#2c1810]",children:K(a.lastDate)}),", ",Z(a.lastDate)]})]})]}),n&&a.sameChurchAndTime&&e.jsxs("p",{className:"mt-4 rounded-lg border border-[#ece5d8] bg-[#fdfbf7] px-4 py-3 text-[13px] leading-relaxed text-[#6b6255]",children:[e.jsx("strong",{className:"text-[#8B3A3A]",children:t("donorPortal.sameAnchorTitle","Ta sama świątynia i ta sama godzina przy każdej z Mszy.")})," ",t("donorPortal.sameAnchorDesc","Miejsce i godzina wynikają ze stałego porządku nabożeństw kapłana, który podjął się Twojej intencji. W Polsce jest to zwykle o godzinę wcześniej.")]}),n&&e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{className:"mb-2 flex items-baseline justify-between text-[13px] text-stone-500",children:[e.jsxs("span",{children:[t("donorPortal.celebratedCount","Odprawiono")," ",e.jsx("strong",{className:"tabular-nums text-[#2c1810]",children:a.celebrated})," ",t("donorPortal.outOf","z")," ",e.jsx("strong",{className:"tabular-nums text-[#2c1810]",children:a.massCount})]}),e.jsxs("span",{children:[t("donorPortal.remainingCount","pozostało")," ",e.jsx("strong",{className:"tabular-nums text-[#2c1810]",children:a.remaining})]})]}),e.jsx("div",{role:"progressbar","aria-valuenow":a.celebrated,"aria-valuemin":0,"aria-valuemax":a.massCount,"aria-label":t("donorPortal.progressLabel","Odprawione Msze"),className:"h-2 overflow-hidden rounded-full bg-[#efe8da]",children:e.jsx("div",{className:"h-2 rounded-full bg-[#8B3A3A]",style:{width:`${s}%`}})})]}),n&&e.jsx("ul",{className:"mt-4 grid grid-cols-1 gap-x-7 sm:grid-cols-2",children:a.masses.map(r=>e.jsxs("li",{className:b("flex items-center gap-2.5 border-b border-stone-100 py-1.5 text-[13.5px]",r.state==="celebrated"&&"text-[#8f8880]",r.state==="today"&&"font-semibold text-[#2c1810]",r.state==="planned"&&"font-medium text-[#2c1810]",r.state==="unscheduled"&&"text-stone-400"),children:[e.jsx("span",{"aria-hidden":"true",className:b("h-[7px] w-[7px] shrink-0 rounded-full",r.state==="celebrated"&&"border border-[#a9c2b6] bg-[#c9d9cf]",r.state==="today"&&"bg-[#8B3A3A] ring-[3px] ring-[#8B3A3A]/20",r.state==="planned"&&"border-[1.5px] border-[#8B3A3A] bg-white",r.state==="unscheduled"&&"border border-stone-300 bg-white")}),e.jsxs("span",{className:"min-w-[22px] text-right text-[12px] tabular-nums text-stone-400",children:[r.index,"."]}),e.jsx("span",{className:"tabular-nums",children:K(r.date)}),e.jsx("span",{className:"text-[12.5px] text-stone-400",children:Z(r.date)}),e.jsxs("span",{className:"ml-auto text-[11px] text-stone-400",children:[r.state==="celebrated"&&t("donorPortal.massDone","odprawiona"),r.state==="planned"&&t("donorPortal.massPlanned","zaplanowana"),r.state==="unscheduled"&&t("donorPortal.massNoDate","termin ustalany")]}),r.state==="today"&&e.jsx("span",{className:"ml-auto rounded bg-[#8B3A3A] px-1.5 py-px text-[10.5px] font-semibold text-white",children:t("donorPortal.massToday","dziś")})]},r.id))})]})]},a.id)}),B==="intentions"&&e.jsxs("div",{className:"overflow-hidden rounded-2xl bg-white shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-stone-100 px-6 py-4",children:[e.jsx(we,{className:"h-4 w-4 text-[#8B3A3A]"}),e.jsx("span",{className:"font-semibold text-[#2c1810]",children:t("donorPortal.prayersTitle","Intencje modlitewne")}),e.jsx("span",{className:"ml-auto text-[12px] tabular-nums text-stone-500",children:o.prayers.length})]}),o.prayers.length===0?e.jsxs("div",{className:"px-6 py-8 text-center",children:[e.jsx(R,{className:"mx-auto mb-3 h-6 w-6 text-stone-300"}),e.jsx("p",{className:"font-semibold text-[#2c1810]",children:t("donorPortal.prayersEmptyTitle","Nie złożyłeś jeszcze intencji modlitewnej")}),e.jsx("p",{className:"mx-auto mt-1.5 max-w-sm text-[13.5px] leading-relaxed text-stone-500",children:t("donorPortal.prayersEmptyDesc","Intencja modlitewna nie jest Mszą — to prośba, którą wspólnota i kapłani obejmują codzienną modlitwą. Nie wiąże się z żadną ofiarą.")}),e.jsxs(je,{to:"/intencje",className:"mt-4 inline-flex items-center gap-1.5 rounded-lg border border-[#8B3A3A]/30 px-4 py-2 text-[13.5px] font-medium text-[#8B3A3A] hover:bg-[#8B3A3A]/5",children:[e.jsx(Be,{className:"h-4 w-4"}),t("donorPortal.prayersCta","Złóż intencję modlitewną")]})]}):e.jsx("div",{className:"divide-y divide-stone-100",children:o.prayers.map(a=>e.jsxs("div",{className:"px-6 py-3.5",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:g(a.created_at)}),e.jsx("p",{className:"mt-1 text-sm leading-relaxed text-[#4A3F5C]",children:a.intention})]},a.id))})]}),B==="all"&&e.jsxs(e.Fragment,{children:[o.subscriptions.length===0&&o.charges.length>0&&e.jsx("div",{className:"rounded-2xl bg-white p-6 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(be,{className:"mt-0.5 h-5 w-5 shrink-0 text-[#8B3A3A]"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-[#2c1810]",children:t("donorPortal.noSubTitle","Nie masz aktywnego wsparcia comiesięcznego")}),e.jsx("p",{className:"mt-1 text-sm leading-relaxed text-[#4A3F5C]",children:t("donorPortal.noSubDesc","Poniżej znajdziesz historię swoich darowizn. Jeśli zechcesz, możesz zamieniÄ
1‡ je na regularne wsparcie — dzięki niemu planujemy pomoc z wyprzedzeniem.")})]})]})}),o.subscriptions.map(a=>{const s=a.status==="active";return e.jsxs("div",{className:"overflow-hidden rounded-2xl bg-white shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-stone-100 px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4 text-[#8B3A3A]"}),e.jsx("span",{className:"font-semibold text-[#2c1810]",children:t("donorPortal.monthlySupport","Wsparcie comiesięczne")})]}),e.jsx("span",{className:`rounded-full px-2.5 py-0.5 text-[11px] font-semibold ${ne[a.status]||"bg-stone-100 text-stone-600"}`,children:se[a.status]||a.status})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 px-6 py-5 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:t("donorPortal.amount","Kwota miesięczna")}),e.jsx("div",{className:"text-lg font-bold text-[#2c1810]",children:E(a.amount)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:t("donorPortal.since","Wspierasz od")}),e.jsx("div",{className:"font-medium text-[#4A3F5C]",children:g(a.created_at)})]}),s&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 text-[11px] uppercase tracking-wide text-stone-400",children:[e.jsx(Ee,{className:"h-3 w-3"}),t("donorPortal.nextCharge","Najbliższe obciążenie")]}),e.jsx("div",{className:"font-medium text-[#4A3F5C]",children:g(a.next_charge_at)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-stone-400",children:t("donorPortal.lastCharge","Ostatnie obciążenie")}),e.jsx("div",{className:"font-medium text-[#4A3F5C]",children:g(a.last_charged_at)})]})]}),a.in_retry&&e.jsxs("div",{className:"mx-6 mb-4 flex items-start gap-2 rounded-lg bg-amber-50 p-3 text-[12px] leading-relaxed text-amber-800",children:[e.jsx(q,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),t("donorPortal.retryNote","Ostatnia płatność nie przeszła (np. wygasła karta). Próbujemy ponownie raz dziennie — zalecamy zmianę karty poniżej.")]}),s&&e.jsxs("div",{className:"flex flex-wrap gap-2 border-t border-stone-100 px-6 py-4",children:[e.jsxs(z,{type:"button",variant:"outline",disabled:c,onClick:()=>ae(a.id),className:"gap-1.5 border-[#8B3A3A]/30 text-[#8B3A3A] hover:bg-[#8B3A3A]/5",children:[e.jsx(U,{className:"h-4 w-4"}),t("donorPortal.changeCard","Zmień kartę")]}),e.jsxs(z,{type:"button",variant:"ghost",disabled:c,onClick:()=>C(a.id),className:"gap-1.5 text-stone-500 hover:bg-red-50 hover:text-red-700",children:[e.jsx(Se,{className:"h-4 w-4"}),t("donorPortal.cancel","Anuluj wsparcie")]})]})]},a.id)}),o.charges.length>0&&e.jsxs("div",{className:"overflow-hidden rounded-2xl bg-white shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-stone-100 px-6 py-4",children:[e.jsx(W,{className:"h-4 w-4 text-[#8B3A3A]"}),e.jsx("span",{className:"font-semibold text-[#2c1810]",children:t("donorPortal.historyTitle","Historia wpłat")}),e.jsxs("span",{className:"ml-auto text-[12px] text-stone-500",children:[t("donorPortal.totalGiven","Łącznie przekazane:")," ",e.jsx("strong",{className:"text-[#2c1810]",children:E(re)})]})]}),e.jsx("div",{className:"divide-y divide-stone-100",children:o.charges.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-2 px-6 py-3 text-sm",children:[e.jsx("span",{className:"text-[#4A3F5C]",children:g(a.created_at)}),e.jsx("span",{className:"text-[11px] text-stone-500",children:a.is_mass_intention?t("donorPortal.kindIntention","Ofiara mszalna"):a.kind==="recurring"?t("donorPortal.kindRecurring","Cykliczna"):t("donorPortal.kindSingle","Jednorazowa")}),e.jsx("span",{className:"font-medium tabular-nums text-[#2c1810]",children:E(a.amount)}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[11px] font-semibold ${a.status==="COMPLETED"?"bg-emerald-100 text-emerald-800":a.status==="FAILED"||a.status==="CANCELED"?"bg-stone-200 text-stone-600":"bg-amber-100 text-amber-800"}`,children:a.status==="COMPLETED"?t("donorPortal.chargeOk","Opłacono"):a.status==="FAILED"||a.status==="CANCELED"?t("donorPortal.chargeFailed","Nieudane"):t("donorPortal.chargePending","W toku")})]},a.id))}),M.length>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-t border-stone-100 px-6 py-4",children:[M.map(a=>e.jsxs(z,{type:"button",variant:"outline",disabled:D,onClick:()=>te(a),className:"gap-1.5 border-[#8B3A3A]/30 text-[#8B3A3A] hover:bg-[#8B3A3A]/5 hover:text-[#8B3A3A]",children:[D?e.jsx(N,{className:"h-4 w-4 animate-spin"}):e.jsx(Fe,{className:"h-4 w-4"}),t("donorPortal.receiptBtn","Potwierdzenie darowizn")," ",a," (PDF)"]},a)),e.jsxs("p",{className:"flex w-full items-start gap-1.5 text-[12px] leading-relaxed text-stone-400",children:[e.jsx(ye,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),t("donorPortal.receiptNote","Potwierdzenie obejmuje darowizny, które możesz odliczyć od dochodu. Ofiary za intencje mszalne nie wchodzą do tej kwoty — Msza jest sprawowana za ofiarę, a nie darowizną w rozumieniu podatkowym.")]})]})]})]})]})]}),e.jsx(Ne,{open:!!A,onOpenChange:a=>!a&&C(null),children:e.jsxs(ze,{children:[e.jsxs(ke,{children:[e.jsx(ve,{children:t("donorPortal.cancelConfirmTitle","Anulować wsparcie cykliczne?")}),e.jsx(Pe,{children:t("donorPortal.cancelConfirmDesc","Będzie nam smutno. Twoje comiesięczne wsparcie daje misji to, czego nie da pojedyncza wpłata — pewność jutra. Dzięki niemu z wyprzedzeniem wiemy, ilu rodzinom zdołamy pomóc i na co możemy obiecać środki.")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("donorPortal.cancelConfirmDesc2","Jeśli teraz nie możesz — rozumiemy i dziękujemy za każdy miesiąc Twojej obecności. Nie pobierzemy już żadnych kolejnych płatności, dotychczasowe wpłaty pozostają bez zmian, a wr
1ócić możesz w każdej chwili.")})]}),e.jsxs(Ae,{className:"sm:flex-row-reverse sm:justify-start gap-2",children:[e.jsx(Ce,{autoFocus:!0,disabled:c,className:"mt-0 bg-[#8B3A3A] text-white border-0 hover:bg-[#6e2e2e] hover:text-white font-semibold",children:t("donorPortal.cancelKeep","Zostaw wsparcie")}),e.jsx(De,{disabled:c,onClick:a=>{a.preventDefault(),ee()},className:"bg-transparent text-stone-500 shadow-none hover:bg-stone-100 hover:text-red-700 font-normal",children:c?e.jsx(N,{className:"h-4 w-4 animate-spin"}):t("donorPortal.cancelConfirmBtn","Tak, anuluj")})]})]})})]})}export{We 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.