PageSourceSearch

https://treesthatcount.co.nz/_next/static/chunks/pages/funding-history/billing-details-0b3d69a941039281.js

js treesthatcount.co.nz collected 2026-10-02 10:16:01 UTC 7,836 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7770],{32962:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/funding-history/billing-details",function(){return i(35292)}])},82784:function(e,n,i){"use strict";i.d(n,{j:function(){return s}});var r=i(85893),t=i(67294),o=i(55346);const a={info:o.DAO,infoNew:o.DAO,warning:o.gJy,error:o.a4m},s=e=>{let{children:n,className:i="",variant:o="solid",type:s="info"}=e;const d=a[s],l=(0,t.useMemo)((()=>{if("solid"===o)switch(s){case"info":return"bg-aquaSpring border border-mostlyGreen";case"infoNew":return"bg-limeBright/20 border border-limeBright/50 text-forestDeep";case"warning":return"bg-warningLight border border-honeyAmber";case"error":return"bg-red-300 border border-red-600";default:return""}switch(s){case"info":return"border border-aquaSpring";case"infoNew":return"border border-limeBright/50 text-forestDeep";case"warning":return"border border-honeyAmber";case"error":return"border border-red-300";default:return""}}),[s,o]),c=(0,t.useMemo)((()=>{switch(s){case"info":return"text-mostlyGreen";case"infoNew":return"text-forestDeep";case"warning":return"text-honeyAmber";case"error":return"text-error";default:return""}}),[s]);return(0,r.jsx)("div",{className:"mb-5 md:mb-10 flex flex-row gap-[10px] px-4 py-4 w-full rounded-[10px] ".concat(l," ").concat(i),children:(0,r.jsxs)("div",{className:"flex space-x-4 items-start",children:[(0,r.jsx)(d,{width:26,height:26,className:"mt-[3px] shrink-0 ".concat(c)}),(0,r.jsx)("div",{children:n})]})})}},35292:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return A}});var r=i(85893),t=i(67294),o=i(53719),a=i(24276),s=i(29109),d=i(93212),l=i(14031),c=i(89827),u=i(33712),m=i(27484),v=i.n(m),h=i(70090),p=i(84e3),x=i(77704),b=i(44156),f=i(82784),g=i(23065),j=i(7456),y=i(10616),N=i(27518),w=i(4037),P=i(73967);var S=e=>{let{subscription:n,stripeSubscription:i}=e;var a,s,d,l,u,m,S,D,A,M;const{user:C,isAccountOwner:_}=(0,o.a)(),{openModal:I}=(0,h.dd)(),{currentPage:Y,offset:k,onPageClick:T}=(0,w.h)(),E="annual"===(null===n||void 0===n?void 0:n.Interval)?"Annual":"Monthly",{data:O}=(0,c.Xyg)({variables:{accountId:null===C||void 0===C||null===(a=C.Account)||void 0===a?void 0:a.Id,limit:10,orderBy:{CreatedOn:"desc"},offset:k}}),F=(0,t.useMemo)((()=>{var e;return(null===O||void 0===O||null===(e=O.Purchase_aggregate.aggregate)||void 0===e?void 0:e.count)||0}),[null===O||void 0===O?void 0:O.Purchase_aggregate]),B=(0,t.useMemo)((()=>{var e;let n;if(null===O||void 0===O||null===(e=O.LatestPurchase[0])||void 0===e?void 0:e.PaymentError){var i;const e=null===O||void 0===O||null===(i=O.LatestPurchase[0])||void 0===i?void 0:i.PaymentError;let t;t="insufficient_funds"===e?"Oops! Your recent donation payment failed due to insufficient funds. We'll try again within the next 24 hours.":"expired_card"===e?(0,r.jsxs)(r.Fragment,{children:["Oops! Your card has expired so your recent donation payment failed. To continue supporting important planting projects around Aotearoa New Zealand please"," ",(0,r.jsx)(b.h$,{className:"underline",href:N.WJ,children:"update your payment method"}),"."]}):(0,r.jsxs)(r.Fragment,{children:["Oops! There was an issue processing your donation payment. Please"," ",(0,r.jsx)(b.h$,{className:"underline",href:N.WJ,children:"update your payment method"})," ","or contact your bank."]}),n=(0,r.jsx)(f.j,{type:"warning",children:t})}return n}),[null===O||void 0===O?void 0:O.LatestPurchase]);var L;return(0,r.jsxs)("div",{className:"mb-5 md:mb-10 mt-5 md:mt-10",children:[_?B:null,(0,r.jsxs)("div",{className:"mb-5 md:mb-10",children:[(0,r.jsxs)("div",{className:"flex flex-row items-center gap-5",children:[(0,r.jsx)(g.aC,{className:"m-0! font-semibold",children:"Payment method"}),(0,r.jsx)(b.h$,{className:"underline",href:"".concat(N.WJ),children:"Edit"})]}),(0,r.jsx)("dl",{children:(null===C||void 0===C||null===(s=C.Account)||void 0===s?void 0:s.PaymentMethodDescriptor)?(0,r.jsx)(x.i,{title:"Credit/Debit card",data:null===C||void 0===C||null===(d=C.Account)||void 0===d?void 0:d.PaymentMethodDescriptor}):"You have no saved payment method."})]}),(0,r.jsxs)("div",{className:"mb-5 md:mb-10",children:[(0,r.jsxs)("div",{className:"flex flex-row items-center gap-5",children:[(0,r.jsxs)(g.aC,{className:"m-0! font-semibold",children:[E," donation"]}),(0,r.jsx)(b.h$,{className:"underline",href:"".concat(N.vF),children:"Edit"})]}),n?(0,r.jsxs)("dl",{children:[n.Tier?(0,r.jsx)(x.i,{title:"Package",data:"".concat(null!==(L=null===(l=n.Package)||void 0===l?void 0:l.DisplayName)&&void 0!==L?L:n.Tier," (").concat("annual"===n.Interval?"Annual":"Monthly",")")}):null,(0,r.jsx)(x.i,{title:"Donation",data:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.F,{amount:(null===i||void 0===i||null===(u=i.Subscription)||void 0===u?void 0:u.TotalAmount)||0})," ","(",n.Quantity," trees)"]})}),(0,r.jsx)(x.i,{title:"Receipts sent to",data:"".concat(n.ReceiptName," - ").concat(n.ReceiptEmail)}),(0,r.jsx)(x.i,{title:"Start date",data:(null===i||void 0===i||null===(m=i.Subscription)||void 0===m?void 0:m.StartDate)?(0,P.p6)({date:v().unix(Number(null===i||void 0===i||null===(S=i.Subscription)||void 0===S?void 0:S.StartDate)).toString(),format:"DD MMM YYYY",isUtc:!0}):null}),(0,r.jsx)(x.i,{title:"Next donation payment will be on",data:(null===i||void 0===i||null===(D=i.Subscription)||void 0===D?void 0:D.NextChargeDate)?(0,P.p6)({date:v().unix(Number(null===i||void 0===i||null===(A=i.Subscription)||void 0===A?void 0:A.NextChargeDate)).toString(),format:"DD MMM YYYY",isUtc:!0}):null}),(0,r.jsx)(x.i,{title:"Preferred region",data:(null===n||void 0===n||null===(M=n.Region)||void 0===M?void 0:M.Name)||"Where native trees are needed most"}),(0,r.jsx)(x.i,{title:"Message of support",data:n.PublicMessage}),(0,r.jsx)(x.i,{className:"border-b-0!",title:(0,r.jsxs)(b.Hp,{className:"underline",onClick:()=>{I(h.w8.CancelSubscription)},children:["Cancel ",E.toLowerCase()," donation"]}),data:""})]}):(0,r.jsxs)("div",{className:"mt-4",children:["You have no active"," ",(0,r.jsxs)(b.h$,{className:"underline",href:(0,N.r3)({queryParams:{donationType:"monthly"}}),children:[" ","monthly donations"]}),"."]})]}),(0,r.jsxs)("div",{className:"mb-5 md:mb-10",children:[(0,r.jsx)(g.aC,{className:"font-semibold",children:"Receipts"}),(0,r.jsx)(y.b,{data:(null===O||void 0===O?void 0:O.Purchase)||[]}),(0,r.jsx)(j.D,{count:F,page:Y,pageSize:10,onChange:e=>T(e)})]}),(0,r.jsxs)(g.nv,{className:"font-medium",children:["Tip: You can"," ",(0,r.jsx)(b.h$,{className:"underline",href:N.Ff,children:"download your tax certificates"})," ","whenever you need."]})]})};const D=()=>{var e,n,i,s;const{user:u}=(0,o.a)(),{data:m,loading:v}=(0,c.Gj9)({variables:{funderId:null===u||void 0===u||null===(e=u.Account)||void 0===e?void 0:e.FunderId},skip:!(null===u||void 0===u||null===(n=u.Account)||void 0===n?void 0:n.StripeCustomerId)}),{data:h,loading:p}=(0,c.xu6)({variables:{accountId:null===u||void 0===u||null===(i=u.Account)||void 0===i?void 0:i.Id},skip:!(null===u||void 0===u||null===(s=u.Account)||void 0===s?void 0:s.Id)||!u.Account.StripeCustomerId,fetchPolicy:"no-cache"}),x=(0,t.useMemo)((()=>null===m||void 0===m?void 0:m.Subscription[0]),[null===m||void 0===m?void 0:m.Subscription]);return(0,r.jsx)(l.g,{children:(0,r.jsx)(d.O,{activeTab:d.p.Billing,subscriptionId:null===x||void 0===x?void 0:x.Id,children:(0,r.jsx)(a.T,{isLoading:v||p,children:(0,r.jsx)(S,{subscription:x,str
1ipeSubscription:null===h||void 0===h?void 0:h.subscription})})})})};var A=(0,u.hN)((()=>(0,r.jsx)(s.T,{title:"Payment settings",showBreadcrumbs:!1,children:(0,r.jsx)(D,{})})))}},function(e){e.O(0,[5970,509,1255,9317,4396,5666,9759,4053,9336,1317,5850,9109,7430,3611,2888,9774,179],(function(){return n=32962,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
2//# sourceMappingURL=billing-details-0b3d69a941039281.js.map

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.