PageSourceSearch

https://opencollective.com/_next/static/chunks/1295-f07f5e29e11f45b8.js

js opencollective.com collected 2026-09-24 08:37:08 UTC 142,439 bytes, 406 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];if(null!=s)for(var i in s)s.hasOwnProperty(i)&&(e[i]=s[i])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:opencollective-frontend":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3b838182-edd2-4a53-a97f-0923f7121d45",e._sentryDebugIdIdentifier="sentry-dbid-3b838182-edd2-4a53-a97f-0923f7121d45")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1295],{1922:(e,t,s)=>{"use strict";s.d(t,{A:()=>g});var i=s(37876),n=s(14232),a=s(10611),r=s(62449),o=s(16907),l=s(45727),c=s(33341),d=s(16750),u=s(98263),p=s(94019),h=s(58201);let m={country:null,address:null,structured:null},g=({name:e,location:t,autoDetectCountry:s=!1,labelFontSize:g,labelFontWeight:f,onChange:x,errors:y,prefix:b="",required:A=!0,onLoadSuccess:v,useStructuredForFallback:j=!1})=>{let[T,S]=n.useState(!1),C=(0,r.tz)(),I=!!(!t?.structured&&t?.address),N=!!t?.country;return(0,i.jsxs)("div",{children:[(0,i.jsx)(p.A,{name:`${b}country`,htmlFor:`${b}country`,label:(0,i.jsx)(r.sA,{id:"ExpenseForm.ChooseCountry",defaultMessage:"Choose country"}),labelFontSize:g,labelFontWeight:f,error:(0,o.p6)(C,y?.country),required:A,children:({id:e,...n})=>(0,i.jsx)(d.A,{...n,inputId:e,value:t?.country,autoDetect:s,onChange:e=>{x({...t||m,country:e}),S&&S(!1)}})}),!N||T||I?T?(0,i.jsx)(u.A,{type:"error",withIcon:!0,mt:2,children:(0,i.jsx)(r.sA,{defaultMessage:"Failed to load the structured address fields. Please reload the page or <SupportLink>contact support</SupportLink>.",id:"5A4zUi",values:c.Ay})}):(0,i.jsx)(p.A,{name:`${b}${e}`,label:C.formatMessage({id:"collective.address.label",defaultMessage:"Address"}),required:!0,mt:3,labelFontSize:g,labelFontWeight:f,children:e=>(0,i.jsx)(h.A,{...e,disabled:!N,"data-cy":`${b}address`,minHeight:100,placeholder:"P. Sherman 42\nWallaby Way\nSydney",defaultValue:t?.address||"",onChange:e=>{let s=e.target.value;j?x((0,a.A)({...t||m,structured:{address1:s}},["country","structured"])):x((0,a.A)({...t||m,address:s},["country","address"]))}})}):(0,i.jsx)(l.Ay,{selectedCountry:t?.country,value:t?.structured||{},onLoadError:()=>S(!0),onLoadSuccess:v,Component:l.n6,fieldProps:{labelFontSize:g,labelFontWeight:f},required:A,errors:y?.structured,onCountryChange:e=>x((0,a.A)({...t||m,structured:e},["country","structured"]))})]})}},3859:(e,t,s)=>{"use strict";s.d(t,{h$:()=>a,oW:()=>o,qk:()=>l});var i=s(11046);let n=(0,i.J1)`
2  fragment ContributionFlowHostFields on Host {
3    id
4    legacyId
5    slug
6    name
7    settings
8    contributionPolicy
9    location {
10      id
11      country
12    }
13    paypalClientId
14    supportedPaymentMethods
15    manualPaymentProviders {
16      id
17      name
18      icon
19    }
20    payoutMethods {
21      id
22      name
23      data
24      type
25    }
26  }
27`,a=(0,i.J1)`
28  fragment ContributionFlowAccountFields on Account {
29    id
30    legacyId
31    slug
32    type
33    name
34    currency
35    settings
36    twitterHandle
37    description
38    imageUrl(height: 192)
39    backgroundImageUrl
40    isHost
41    isActive
42    location {
43      id
44      country
45    }
46    features {
47      id
48      RECEIVE_FINANCIAL_CONTRIBUTIONS
49    }
50    ... on Organization {
51      platformContributionAvailable
52      host {
53        id
54        ...ContributionFlowHostFields
55      }
56    }
57    ... on AccountWithContributions {
58      contributionPolicy
59      platformContributionAvailable
60      contributors(limit: 6, roles: [BACKER, ATTENDEE]) {
61        totalCount
62        nodes {
63          id
64          name
65          image
66          collectiveSlug
67        }
68      }
69    }
70    ... on AccountWithHost {
71      hostFeePercent
72      host {
73        id
74        ...ContributionFlowHostFields
75      }
76    }
77    ... on AccountWithParent {
78      parent {
79        id
80        slug
81        name
82        settings
83        imageUrl
84        backgroundImageUrl
85        location {
86          id
87          country
88        }
89        ... on AccountWithContributions {
90          contributionPolicy
91        }
92      }
93    }
94    ... on Event {
95      endsAt
96    }
97  }
98  ${n}
99`,r=(0,i.J1)`
100  fragment OrderSuccessHostFragment on Host {
101    id
102    slug
103    settings
104  }
105`,o=(0,i.J1)`
106  fragment OrderSuccessFragment on Order {
107    id
108    legacyId
109    status
110    frequency
111    data
112    platformTipEligible
113    manualPaymentProvider {
114      id
115      type
116      name
117      instructions
118      icon
119      accountDetails
120    }
121    amount {
122      value
123      valueInCents
124      currency
125    }
126    paymentMethod {
127      id
128      service
129      type
130      data
131    }
132    platformTipAmount {
133      value
134      valueInCents
135      currency
136    }
137    tier {
138      id
139      legacyId
140      name
141      slug
142      type
143      amountType
144      amount {
145        valueInCents
146      }
147    }
148    membership {
149      id
150      publicMessage
151    }
152    fromAccount {
153      id
154      name
155      type
156      slug
157      imageUrl(height: 48)
158      isIncognito
159      ... on Individual {
160        isGuest
161      }
162    }
163    toAccount {
164      id
165      name
166      slug
167      tags
168      type
169      isHost
170      settings
171      socialLinks {
172        type
173        url
174      }
175      stats {
176        id
177        contributorsCount
178      }
179      ... on AccountWithContributions {
180        platformContributionAvailable
181      }
182      ... on AccountWithParent {
183        parent {
184          id
185          slug
186          tags
187          socialLinks {
188            type
189          }
190        }
191      }
192      ... on AccountWithHost {
193        host {
194          id
195          ...OrderSuccessHostFragment
196        }
197      }
198      ... on Organization {
199        host {
200          id
201          ...OrderSuccessHostFragment
202        }
203      }
204    }
205  }
206  ${r}
207`,l=(0,i.J1)`
208  fragment OrderResponseFragment on OrderWithPayment {
209    guestToken
210    order {
211      id
212      ...OrderSuccessFragment
213    }
214    stripeError {
215      message
216      account
217      response
218    }
219  }
220  ${o}
221`},4281:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var i=s(37876);s(14232);var n=s(45884),a=s(61184),r=s(8545),o=s(47537),l=s(69020);let c=({children:e,data:t={},description:s,image:l,loadingLoggedInUser:c,LoggedInUser:d,title:u,metaTitle:p,noRobots:h,twitterHandle:m,showSearch:g=!0,canonicalURL:f,collective:x,showMenuItems:y=!0,withTopBar:b=!0,showFooter:A=!0,showProfileAndChangelogMenu:v=!0,loading:j,updatesRss:T})=>t.error?(0,i.jsx)(r.A,{data:t,LoggedInUser:d}):(0,i.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,i.jsx)(o.A,{showSearch:g,title:u,noRobots:h,twitterHandle:m,description:s,image:l,metaTitle:p,canonicalURL:f,collective:x,showMenuItems:y,LoggedInUser:d,showProfileAndChangelogMenu:v,loading:j,withTopBar:b,updatesRss:T}),(0,i.jsx)(a.A,{className:"flex-1",children:"function"==typeof e?e({LoggedInUser:d,loadingLoggedInUser:c}):e}),A&&(0,i.jsx)(n.A,{})]});c.displayName="Page";let d=(0,l.Cb)(c)},22756:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j,isValidExternalRedirect:()=>v});var i=s(37876),n=s(5646),a=s(14232),r=s(15023),o=s(89099),l=s(62449),c=s(71321),d=s(87058),u=s(20322),p=s(56593),h=s(99202),m=s(69756),g=s(98064),f=s(4281),x=s(68901),y=s(62939),b=s(78027),A=s(72945);let v=e=>{let t={};return t.protocols=["http","https"],e&&(0,c.isURL)(e,t)},j=()=>{var e;let t=(0,o.useRouter)(),[s,n]=a.useState(!1),[c,j]=a.useState(!1),S=t?.query||{},C=(e=S.fallback)&&(0,d.c9)(e)?e:"/",I=(0,u.RR)(S.shouldRedirectParent);return a.useEffect(()=>{t&&!S.url?t.push(C):(0,u.E8)(S.url)?t.push(S.url):v(S.url)?(e=>{try{let t=new URL(e);return(0,d.Nq)(t.host)}catch{return!1}})(S.url)?I?window.parent.location.href=S.url:t.push(S.url):n(!0):t.push(C)},[t,S.url]),(0,i.jsx)(f.A,{noRobots:!0,children:(0,i.jsx)(h.so,{justifyContent:"center",alignItems:"center",py:[4,5,6],children:s?(0,i.jsxs)(y.A,{maxWidth:450,children:[(0,i.jsxs)(p.A,{p:3,children:[(0,i.jsxs)(A.H3,{fontSize:"16px",lineHeight:"15px",fontWeight:"bold",my:2,children:[(0,i.jsx)(r.I,{"data-type":"message-icon",size:"1em",color:"#CCCC18"}),(0,i.jsx)(T,{ml:2,children:(0,i.jsx)(l.sA,{id:"PleaseBeCareful",defaultMessage:"Please be careful"})})]}),(0,i.jsx)(b.A,{my:2,borderColor:"black.300"}),(0,i.jsx)(A.P,{fontSize:"14px",lineHeight:"20px",my:3,children:(0,i.jsx)(l.sA,{id:"externalRedirect.message",defaultMessage:"Your request is currently being redirected to {redirect}. For the safety and privacy of your Open Collective account, remember to never enter your credentials unless you're on the real Open Collective website.",values:{redirect:(0,i.jsx)(A.OH,{wordBreak:"break-all",children:S.url})}})})]}),(0,i.jsxs)(p.A,{display:"flex",justifyContent:"flex-end",backgroundColor:"black.100",p:1,children:[(0,i.jsx)("a",{href:S.url,onClick:e=>{j("REDIRECT"),I&&(e.preventDefault(),window.parent.location.href=S.url)},children:(0,i.jsx)(x.A,{buttonSize:"small",my:2,minWidth:140,buttonStyle:"primary",loading:"REDIRECT"===c,disabled:c,
221children:(0,i.jsx)(l.sA,{id:"actions.continue",defaultMessage:"Continue"})})}),(0,i.jsx)(m.A,{href:C,onClick:()=>j("CANCEL"),children:(0,i.jsx)(x.A,{buttonSize:"small",m:2,minWidth:140,"data-cy":"confirmation-modal-cancel",loading:"CANCEL"===c,disabled:c,children:(0,i.jsx)(l.sA,{id:"actions.cancel",defaultMessage:"Cancel"})})})]})]}):(0,i.jsx)(g.A,{})})})};var T=(0,n.Ay)(A.L9).withConfig({componentId:"sc-1d4301ef-0"})({verticalAlign:"middle"})},26385:(e,t,s)=>{"use strict";s.d(t,{A:()=>p});var i=s(37876);s(14232);var n=s(13341),a=s(62449),r=s(60257),o=s(56593),l=s(99202),c=s(68901),d=s(90983),u=s(72945);let p=({defaultEmail:e})=>{let{LoggedInUser:t}=(0,r.A)();return(0,i.jsx)(o.A,{children:(0,i.jsx)(l.so,{children:(0,i.jsx)(l.az,{as:"form",action:"https://opencollective.us12.list-manage.com/subscribe/post?u=88fc8f0f3b646152f1cfe447a&id=475db6d2d7",method:"post",name:"mc-embedded-subscribe-form",target:"_blank",children:(0,i.jsxs)(o.A,{borderRadius:10,border:"1px solid #9D9FA3",bg:"white.full",display:"flex",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:[1,null,"400px"],pl:3,children:[(0,i.jsx)(u.L9,{color:"#5F617D",children:(0,i.jsx)(n.L,{size:"16"})}),(0,i.jsx)(d.A,{bare:!0,fontSize:"14px",name:"EMAIL",defaultValue:e||t?.email,px:3,py:2,minWidth:[50,200],placeholder:"Enter your email address",type:"email",width:1,color:"black.800"}),(0,i.jsx)(c.A,{py:"10px",px:"14px",fontSize:"13px",lineHeight:"16px",name:"subscribe",type:"submit",borderRadius:"0 10px 10px 0",border:"none",borderLeft:"1px solid #9D9FA3",outline:"none",children:(0,i.jsx)(a.sA,{id:"newsletter.subscribe",defaultMessage:"Subscribe"})})]})})})})}},30924:(e,t,s)=>{"use strict";s.d(t,{e:()=>a});var i=s(11046),n=s(3859);let a=(0,i.J1)`
222  query ContributionFlowAccount($collectiveSlug: String!, $tierId: Int, $includeTier: Boolean!) {
223    account(slug: $collectiveSlug, throwIfMissing: false) {
224      id
225      ...ContributionFlowAccountFields
226      policies {
227        id
228        CONTRIBUTOR_INFO_THRESHOLDS {
229          legalName
230          address
231        }
232      }
233    }
234    me {
235      contributorProfiles(forAccount: { slug: $collectiveSlug }) {
236        account {
237          id
238          name
239          legalName
240          slug
241          type
242          imageUrl(height: 192)
243          isIncognito
244          ... on Individual {
245            email
246            isGuest
247          }
248          location {
249            address
250            country
251            structured
252          }
253          ... on AccountWithHost {
254            host {
255              id
256              slug
257              name
258              imageUrl(height: 64)
259            }
260          }
261        }
262        totalContributedToHost(inCollectiveCurrency: true) {
263          valueInCents
264          currency
265        }
266      }
267    }
268    tier(tier: { legacyId: $tierId }, throwIfMissing: false) @include(if: $includeTier) {
269      id
270      legacyId
271      type
272      name
273      slug
274      description
275      customFields
276      availableQuantity
277      singleTicket
278      requireAddress
279      maxQuantity
280      endsAt
281      amount {
282        valueInCents
283        currency
284      }
285      amountType
286      minimumAmount {
287        valueInCents
288        currency
289      }
290      interval
291      presets
292    }
293  }
294  ${n.h$}
295`},33370:(e,t,s)=>{"use strict";s.d(t,{Ay:()=>j,tg:()=>A,yP:()=>x});var i=s(37876),n=s(14232),a=s(62449),r=s(58649),o=s(6435),l=s(84223),c=s(87058),d=s(56593),u=s(99202),p=s(33341),h=s(69756),m=s(98263),g=s(68901),f=s(72945);let x={DISABLED:"DISABLED",NO_HOST:"NO_HOST",NOT_ACTIVE:"NOT_ACTIVE",NO_PAYMENT_PROVIDER:"NO_PAYMENT_PROVIDER",TIER_EMPTY:"TIER_EMPTY",TIER_MISSING:"TIER_MISSING",TIER_EXPIRED:"TIER_EXPIRED",NO_CUSTOM_CONTRIBUTION:"NO_CUSTOM_CONTRIBUTION"},y=(0,a.YK)({[x.DISABLED]:{defaultMessage:"This account cannot receive financial contributions at this time",id:"ZN02TE"},[x.NO_HOST]:{id:"createOrder.missingHost",defaultMessage:"This collective doesn't have a host and can't accept financial contributions"},[x.NOT_ACTIVE]:{id:"createOrder.inactiveCollective",defaultMessage:"This collective is not active and can't accept financial contributions"},[x.TIER_MISSING]:{id:"createOrder.missingTier",defaultMessage:"Oops! This tier doesn't exist or has been removed by the collective admins."},[x.TIER_EXPIRED]:{id:"Tier.Past",defaultMessage:"This tier is not active anymore."},[x.TIER_EMPTY]:{id:"Tier.empty",defaultMessage:"There are no more {type, select, TICKET {tickets} other {units}} for {name}"},[x.NO_CUSTOM_CONTRIBUTION]:{id:"Tier.disableCustomContribution",defaultMessage:"This collective requires you to select a tier to contribute."}}),b=e=>e?.interval&&"flexible"!==e.interval,A=(e,t,s,n)=>{if(!t.host)return{reason:x.NO_HOST};if(!t.isActive)return{reason:x.NOT_ACTIVE};if("DISABLED"===t.features[r.Gv.RECEIVE_FINANCIAL_CONTRIBUTIONS])return{reason:x.DISABLED};if(s?.availableQuantity===0){let e={type:s.type,name:(0,i.jsx)("q",{children:s.name})};return{reason:x.TIER_EMPTY,intlParams:e,showOtherWaysToContribute:!0}}if(n&&!s)return{reason:x.TIER_MISSING,type:"warning",showOtherWaysToContribute:!0};else if(s&&(0,l.CP)(s))return{reason:x.TIER_EXPIRED,type:"warning",showOtherWaysToContribute:!0};else if(!t.host.supportedPaymentMethods?.length||b(s)&&!(0,o.tM)(t,e))return{reason:x.NO_PAYMENT_PROVIDER,type:"warning",showOtherWaysToContribute:!0,content:v(e,t,s)};else return null},v=(e,t,s)=>(0,i.jsxs)(n.Fragment,{children:[(0,i.jsx)("strong",{children:(0,i.jsx)(a.sA,{id:"ContributionFlow.noSupportedPaymentMethods",defaultMessage:"There is no payment provider available"})}),(0,i.jsx)("br",{}),e?.isHostAdmin(t)&&(0,i.jsx)(d.A,{maxWidth:"400px",mt:3,children:t.host.supportedPaymentMethods?.length&&b(s)&&!(0,o.tM)(t,e)?(0,i.jsx)(f.P,{lineHeight:"18px",children:(0,i.jsx)(a.sA,{defaultMessage:"None of the payment providers currently active on your account supports recurring contributions. You can enable them by connecting Stripe or PayPal. Alternatively, you can remove the ability to contribute recurringly from the <TiersLink>tiers settings</TiersLink>.",id:"3RuqnL",values:{TiersLink:(0,p.lv)({as:h.A,href:`${(0,c.q5)(t,"tiers")}`})}})}):(0,i.jsx)(d.A,{textAlign:"center",children:(0,i.jsx)(h.A,{href:`/${t.slug}/accept-financial-contributions/host`,children:(0,i.jsx)(g.A,{buttonStyle:"primary",mt:3,children:(0,i.jsx)(a.sA,{id:"contributions.startAccepting",defaultMessage:"Start accepting contributions"})})})})})]}),j=({account:e,blocker:t})=>{let s=(0,a.tz)();return(0,i.jsxs)(u.so,{flexDirection:"column",alignItems:"center",py:[5,null,6],children:[(0,i.jsx)(m.A,{type:t.type||"info",withIcon:!0,maxWidth:800,children:t.content||y[t.reason]&&s.formatMessage(y[t.reason],t.intlParams)||t.reason}),t.showOtherWaysToContribute&&e&&(0,i.jsx)(h.A,{href:`${(0,c.bl)(e)}/contribute`,children:(0,i.jsx)(g.A,{buttonStyle:"primary",buttonSize:"large",mt:5,children:(0,i.jsx)(a.sA,{id:"createOrder.backToTier",defaultMessage:"View all the other ways to contribute"})})})]})}},34706:e=>{function t(e){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=34706,e.exports=t},42439:(e,t,s)=>{"use strict";s.d(t,{T:()=>l});var i=s(37876),n=s(14232),a=s(20322),r=s(49294),o=s(99271);let l=n.forwardRef(({className:e,showCount:t=!1,...s},n)=>{let l=s.value||s.defaultValue||"",c=(0,i.jsx)("textarea",{className:(0,a.cn)(o._K,s.error&&o.dW,e),ref:n,...s});return t?(0,i.jsxs)("div",{className:"relative",children:[c,(0,i.jsx)("div",{className:"absolute right-1.5 bottom-1.5",children:(0,i.jsxs)(r.E,{size:"sm",children:[(0,i.jsx)("span",{children:l.length}),s.maxLength&&(0,i.jsxs)("span",{className:"text-muted-foreground",children:["/",s.maxLength]})]})})]}):c});l.displayName="Textarea"},45727:(e,t,s)=>{"use strict";s.d(t,{JF:()=>D,n6:()=>F,Ay:()=>U});var i=s(37876),n=s(14232),a=s(46525),r=s(28678),o=s(10611),l=s(40125),c=s(94772),d=s(96918),u=s(72976),p=s(90281),h=s(32919),m=s(54675),g=s(96432),f=s(62449),x=s(85303),y=s(43647);let b={address1:"addressLine1",address2:"addressLine2",city:"city",zone
295:"state",postalCode:"zip"},A=(0,f.YK)({address1:{id:"collective.address.label",defaultMessage:"Address"},address2:{id:"address.address2",defaultMessage:"Apartment, suite, etc."},city:{defaultMessage:"City",id:"TE4fIS"},zone:{id:"address.zone",defaultMessage:"State/Province"},postalCode:{id:"address.postalCode",defaultMessage:"Postal Code"}}),v=["address1","address2","city","zone","postalCode"],j=(e,t)=>A[t]?e.formatMessage(A[t]):(0,y.A)(t);var T=s(2948),S=s(16907),C=s(99271),I=s(28561),N=s(7585),P=s(90983),w=s(94019),M=s(45409);let E=e=>({value:e.code,label:`${(0,l.A)(e.name,{length:30})} - ${e.code}`,name:e.name}),O=(e,t)=>{if(e)return t.find(t=>t.value===e)||t.find(t=>t.name.toLowerCase()===e.toLowerCase())},R=(e,t)=>{let s=t.map(E);return O(e,s)?.value??null},_=(e,t)=>{let s=((e,t)=>{if(!e)return{};let s=t.map(e=>e[0]);return(0,r.A)(Object.keys(e).filter(e=>!s.includes(e)))?e:(0,o.A)(e,s)})(e,t),i=t.find(([e])=>"zone"===e)?.[2];if(!s.zone||!i?.length)return s;let n=R(s.zone,i);return n===s.zone?s:n?{...s,zone:n}:(0,c.A)(s,"zone")},k=({info:e,required:t,value:s,name:a,label:r,onChange:o,id:l,error:c,useLegacyComponent:u=!0,...p})=>{let h=(0,f.tz)(),m=n.useMemo(()=>(0,d.A)((e||[]).map(E),"label"),[e]),g=m.length>0,x=O(s,m);if(n.useEffect(()=>{if(!g||!s)return;let t=R(s,e||[]);t!==s&&o({target:{name:a,value:t}})},[g,e,a,o,s]),!g){let e=s??"";return u?(0,i.jsx)(P.A,{name:a,required:t,...p,id:l,value:e,onChange:o,error:!!c,"data-cy":`address-${a}`}):(0,i.jsx)(C.pd,{name:a,required:t,...p,id:l,value:e,onChange:e=>o({target:{name:e.target.name,value:e.target.value}}),"data-cy":`address-${a}`})}let y=h.formatMessage({defaultMessage:"Please select your {label}",id:"WOyn1N"},{label:r});return u?(0,i.jsx)(M.A,{name:a,required:t,...p,inputId:l,minWidth:150,options:m,error:!!c,placeholder:y,"data-cy":`address-${a}`,value:x||null,onChange:e=>{o({target:{name:a,value:e.value}})}}):(0,i.jsxs)(N.l6,{onValueChange:e=>{o({target:{name:a,value:e}})},value:x?.value||void 0,children:[(0,i.jsx)(N.bq,{"data-cy":`address-${a}`,children:(0,i.jsx)(N.yv,{placeholder:y})}),(0,i.jsx)(N.gC,{className:"relative max-h-80 max-w-full",children:m.map(e=>(0,i.jsx)(N.eb,{value:e.value,className:"cursor-pointer",children:e.label},e.value))})]})},L=({name:e,label:t,required:s,prefix:n,info:r})=>{let o=s?e=>e?void 0:`${t} is required`:void 0;return(0,i.jsx)(a.D0,{name:`${n}.${e}`,validate:o,children:({field:n,meta:a})=>(0,i.jsx)(w.A,{name:n.name,label:t,labelFontSize:"13px",mt:3,error:a.error,children:o=>"zone"===e?(0,i.jsx)(k,{id:o.id,name:o.name||e,required:s,label:t,info:r,value:n.value,onChange:n.onChange}):(0,i.jsx)(P.A,{...o,...n,error:!!a.error,"data-cy":`address-${e}`})})},e)},F=({name:e,label:t,error:s,required:a,prefix:r,value:o,info:l,onChange:c,fieldProps:d})=>{let[p,h]=n.useState(!1),m=r?`${r}.${e}`:e,g=s||(a&&p&&(0,u.A)(o)?`${t} is required`:void 0),f=e=>{c?.(e),p||h(!0)};return(0,i.jsx)(w.A,{name:m,label:t,labelFontSize:"13px",mt:3,error:g,required:a,...d,children:s=>"zone"===e?(0,i.jsx)(k,{id:s.id,name:s.name||e,required:a,label:t,onChange:f,error:g,info:l,value:o}):(0,i.jsx)(P.A,{...s,value:o||"",error:!!g,onChange:f,"data-cy":`address-${e}`})},e)},D=({name:e,label:t,error:s,required:a,prefix:r,value:o,info:l,onChange:c,fieldProps:d})=>{let[h,m]=n.useState(!1),g=(0,f.tz)(),x=r?`${r}.${e}`:e,y=s||(a&&h&&(0,u.A)(o)?`${t} is required`:void 0),b={...(0,p.A)({...d,value:o??"",name:e||x,id:x,required:a,error:y,info:l,label:t,onChange:e=>{c?.(e),h||m(!0)}},e=>void 0!==e)};return(0,i.jsxs)("div",{className:"flex w-full flex-col gap-1",children:[t&&(0,i.jsxs)(I.J,{className:"leading-normal",children:[t," ",!a&&(0,i.jsxs)("span",{className:"font-normal text-muted-foreground",children:["(",(0,i.jsx)(f.sA,{defaultMessage:"optional",id:"FormField.optional"}),")"]})]}),"zone"===e?(0,i.jsx)(k,{...b,useLegacyComponent:!1}):(0,i.jsx)(C.pd,{...b}),y&&(0,i.jsx)("p",{className:"text-sm text-red-600",children:(0,T.nm)(y)?(0,S.p6)(g,y):y})]})},U=({selectedCountry:e,value:t,onCountryChange:s,required:a,prefix:o,onLoadError:l,onLoadSuccess:c,Component:d=L,fieldProps:u,errors:p})=>{let y=(0,f.tz)(),A=n.useMemo(()=>
295{if(!e)return null;try{return function(e,t){let s=(0,x.Kb)(e);if(!s)return{fields:v.map(e=>({name:e,label:j(t,e),required:"address1"===e})),optionalFields:v.filter(e=>"address1"!==e)};let i=(0,x.BJ)(e),n=v;if(i?.lfmt){let e=function(e){let t,s={A:"address1",C:"city",S:"zone",Z:"postalCode"},i=[],n=/%([ACSZ])/g;for(;null!==(t=n.exec(e));){let e=s[t[1]];e&&!i.includes(e)&&(i.push(e),"address1"===e&&i.push("address2"))}return i}(i.lfmt);e.length>0&&(n=e)}let a=(i?.sub_regions||[]).map(e=>({code:e.key,name:e.name})),r=[],o=[];for(let e of n){let i=s[b[e]];if(void 0===i&&"address2"!==e)continue;let n="required"===i;n||r.push(e);let l={name:e,label:j(t,e),required:n};"zone"===e&&a.length>0&&(l.zones=a),o.push(l)}return{fields:o,optionalFields:r}}(e,y)}catch(e){return console.warn("Failed to get address form fields. Error: ",e.message),l?.(),null}},[e,y,l]),T=n.useMemo(()=>A?A.fields.map(e=>{let t=[e.name,e.label];return e.zones&&e.zones.length>0&&t.push(e.zones),t}):null,[A]),[S,C]=n.useState(()=>t||{}),I=n.useRef(S);I.current=S;let N=n.useRef(void 0);n.useEffect(()=>{t&&!(0,r.A)(t)&&C(e=>(0,h.A)(e,t)?e:t)},[t]);let P=n.useCallback(e=>{(0,h.A)(N.current,e)||(N.current=e,s(e))},[s]),w=n.useCallback(e=>{C(t=>(0,h.A)(t,e)?t:e),P(e)},[P]);return(n.useEffect(()=>{if(T&&A){let e=_(I.current,T);C(t=>(0,h.A)(t,e)?t:e),N.current=e,s(e);try{c?.({countryInfo:A,addressFields:T})}catch(e){console.warn("Error calling onLoadSuccess: ",e.message)}}},[e]),e&&T&&A)?(0,i.jsx)(n.Fragment,{children:T.map(([t,s,n])=>(0,i.jsx)(d,{prefix:o,name:t,label:s,info:n,value:S[t],required:!1!==a&&!A.optionalFields.includes(t),error:p?.[t],fieldProps:u,onChange:({target:{name:e,value:t}})=>w(_((0,m.A)((0,g.A)(S),e,t),T))},`${e}-${t}`))}):null}},56299:(e,t,s)=>{"use strict";s.d(t,{h:()=>o,i:()=>l});var i=s(67752),n=s(82564);let a=()=>{try{let e=(0,n.zM)(n.rS.GUEST_TOKENS);return JSON.parse(e)||{}}catch{return{}}},r=e=>e.trim().toLowerCase(),o=(e=[],t=[])=>{let s=a(),o=e?.map(r),l=(0,i.A)(s,(e,s)=>{let{email:i,token:n}="string"==typeof e?{email:s,token:e}:{email:e.email,token:e.email,orderId:s};return!!(o&&o.includes(i))||!!(t&&t.includes(n))});(0,n.ZB)(n.rS.GUEST_TOKENS,JSON.stringify(l))},l=(e,t,s)=>{let i={...a(),[t]:{token:s,email:r(e)}};(0,n.ZB)(n.rS.GUEST_TOKENS,JSON.stringify(i))}},60742:(e,t,s)=>{"use strict";s.d(t,{Ay:()=>j,HK:()=>f,UC:()=>b,hE:()=>y,wv:()=>A});var i=s(37876),n=s(14232),a=s(95062),r=s.n(a),o=s(38600),l=s(27764),c=s(21651),d=s(62449),u=s(5646),p=s(23968),h=s(56593),m=s(99202),g=s(72945);let f=u.Ay.details.withConfig({componentId:"sc-95a8602e-0"})(["&[open]{border-color:",";summary::after{content:'−';}}summary{padding-top:","px;padding-bottom:","px;font-size:13px;font-weight:500;color:",";list-style:none;&:hover{color:",";}button{display:none;}}summary:focus{outline:1px dashed ",";outline-offset:","px;}summary::after{content:'+';display:inline-block;padding-left:","px;color:",";font-weight:bold;}summary::-webkit-details-marker{display:none;}"],(0,c.y)("colors.primary.500"),(0,c.y)("space.2"),(0,c.y)("space.2"),(0,c.y)("colors.black.800"),(0,c.y)("colors.black.700"),(0,c.y)("colors.black.200"),(0,c.y)("space.1"),(0,c.y)("space.2"),(0,c.y)("colors.black.600")),x=u.Ay.div.withConfig({componentId:"sc-95a8602e-1"})(["display:flex;justify-content:center;align-items:center;border-radius:50%;border:1px solid #dcdee0;svg{stroke-width:1.5;}[data-item='chevron-up']{margin-top:-5%;}[data-item='chevron-down']{margin-top:5%;}"," ",""],p.Ej,p.xe),y=(0,u.Ay)(({children:e,...t})=>(0,i.jsxs)("summary",{...t,children:[(0,i.jsx)("div",{children:e}),(0,i.jsxs)(x,{size:18,ml:3,children:[(0,i.jsx)(l.rX,{size:"1em","data-item":"chevron-up",style:{marginTop:-1}}),(0,i.jsx)(o.yQ,{size:"1em","data-item":"chevron-down"})]})]})).withConfig({componentId:"sc-95a8602e-2"})(["cursor:pointer;display:flex;justify-content:space-between;align-items:baseline;"]),b=(0,u.Ay)(m.az).attrs(e=>({py:e.py??2,fontSize:e.fontSize??"13px",color:e.color??"black.600"})).withConfig({componentId:"sc-95a8602e-3"})([""]),A=u.Ay.hr.withConfig({componentId:"sc-95a8602e-4"})(["background:",";width:100%;"],(0,c.y)("colors.black.400")),v=u.Ay.div.withConfig({componentId:"sc-95a8602e-5"})(["","{"," ","}"],f,e=>e.withNewButtons?(0,u.AH)(["[data-item='chevron-up']{display:none;}&[open]{[data-item='chevron-up']{display:inline-block;}[data-item='chevron-down']{display:none;}}summary::after{display:none;}button{display:block;}"]):(0,u.AH)(["","{display:none;}"],x),e=>e.withBorderLeft&&(0,u.AH)(["border-left:1px solid #dcdee0;padding-left:8px;&:focus-within,&:hover{border-color:",";}"],(0,c.y)("colors.primary.500")));
295class j extends n.Component{static{this.propTypes={children:r().node,title:r().string,titleProps:r().object,withBorderLeft:r().bool,withNewButtons:r().bool,...m.az.propTypes}}render(){let{title:e,children:t,withBorderLeft:s,withNewButtons:n,titleProps:a,...r}=this.props;return(0,i.jsxs)(h.A,{...r,children:[null!==e&&(0,i.jsx)(g.P,{fontWeight:"bold",mb:1,color:"black.900",...a,children:e||(0,i.jsx)(d.sA,{id:"FAQ",defaultMessage:"FAQ"})}),(0,i.jsx)(v,{withBorderLeft:s,withNewButtons:n,children:t})]})}}},72240:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var i=s(18122);let n=(e=1e4,t={})=>{let s=Date.now()+e,n=(e,t)=>Math.random()*(t-e)+e,a={disableForReducedMotion:!0,startVelocity:30,spread:360,ticks:60,zIndex:0,...t},r=setInterval(()=>{let t=s-Date.now();if(t<=0)return clearInterval(r);{let s=t/e*50;(0,i.A)({...a,particleCount:s,origin:{x:n(0,.3),y:Math.random()-.2}}),(0,i.A)({...a,particleCount:s,origin:{x:n(.7,1),y:Math.random()-.2}})}},250)}},77153:(e,t,s)=>{"use strict";s.d(t,{X:()=>n});var i,n=((i={}).CONTRIBUTION_STARTED="Contribution Started",i.CONTRIBUTION_DETAILS_STEP_COMPLETED="Contribution Details Step Completed",i.CONTRIBUTION_PAYMENT_STEP="Contribution Payment Step",i.CONTRIBUTION_SUBMITTED="Contribution Submitted",i.CONTRIBUTION_SUCCESS="Contribution Success",i.CONTRIBUTION_ERROR="Contribution Error",i.EXPENSE_SUBMISSION_STARTED="Expense Submission Started",i.EXPENSE_SUBMISSION_PICKED_COLLECTIVE="Expense Submission Picked Collective",i.EXPENSE_SUBMISSION_PICKED_PAYEE="Expense Submission Picked Payee",i.EXPENSE_SUBMISSION_PICKED_EXPENSE_TYPE="Expense Submission Picked Expense Type",i.EXPENSE_SUBMISSION_PICKED_ADDITIONAL_DETAILS="Expense Submission Picked Expense Title",i.EXPENSE_SUBMISSION_FILLED_EXPENSE_DETAILS="Expense Submission Filled Expense Details",i.EXPENSE_SUBMISSION_SUBMITTED="Expense Submitted",i.EXPENSE_SUBMISSION_SUBMITTED_SUCCESS="Expense Submitted Success",i.EXPENSE_SUBMISSION_SUBMITTED_ERROR="Expense Submitted Error",i)},82393:(e,t,s)=>{"use strict";s.d(t,{H_:()=>h,__:()=>p,iQ:()=>u});var i=s(10611),n=s(54468),a=s(88842),r=s(3761);let o={amount:{type:"amount"},quantity:{type:"integer"},interval:{type:"interval"},paymentMethod:{type:"string"},contributeAs:{type:"string"},email:{type:"string"},name:{type:"string"},legalName:{type:"string"},hideCreditCardPostalCode:{type:"boolean",static:!0},disabledPaymentMethodTypes:{type:"stringArray",static:!0},redirect:{type:"string",static:!0},customData:{type:"json"},tags:{type:"stringArray",static:!0},hideSteps:{type:"boolean",static:!0},totalAmount:{type:"alias",on:"amount",modifier:e=>Math.round(e/100)},defaultEmail:{type:"alias",on:"email"},defaultName:{type:"alias",on:"name"}},l={...o,hideFAQ:{type:"boolean",static:!0},hideHeader:{type:"boolean",static:!0},backgroundColor:{type:"color",static:!0},useTheme:{type:"boolean",static:!0},shouldRedirectParent:{type:"boolean",static:!0}},c=Object.keys(o).filter(e=>o[e].static),d=Object.keys(l).filter(e=>l[e].static),u=(e,t,s,a,o,l)=>{let u=(0,i.A)(t,l?d:c);return(0,n.A)(u,(0,i.A)(s,["interval","quantity","customData","amount"])),a.isIncognito?u.contributeAs=r.qo:a?.slug?u.contributeAs=a.slug===e?.collective?.slug?r.YP:a.slug:(0,n.A)(u,(0,i.A)(a,["name","legalName","email"])),o?.key&&(u.paymentMethod=o.key),1===u.quantity&&delete u.quantity,u},p=new a.A(o),h=new a.A(l)},85418:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>l});var i=s(37876);s(14232);var n=s(89099),a=s(56593),r=s(66906),o=s(4281);function l(){let e=(0,n.useRouter)();return(0,i.jsx)(o.A,{"data-cy":"error-page",children:(0,i.jsx)(a.A,{py:[5,6],children:(0,i.jsx)(r.A,{searchTerm:e.query?.slug})})})}},87278:(e,t,s)=>{"use strict";s.d(t,{BN:()=>y,JJ:()=>f,PL:()=>x});var i,n=s(37876),a=s(14232),r=s(64177),o=s(74252),l=s(75694),c=s(9701),d=s(62449),u=s(11046),p=s(60257),h=s(1509),m=s(31934),g=s(42439),f=((i={}).EXPENSE_SUBMITTED="EXPENSE_SUBMITTED",i.EXPENSE_SUBMITTED_NEW_FLOW="EXPENSE_SUBMITTED_NEW_FLOW",i.CONTRIBUTION_COMPLETED="CONTRIBUTION_COMPLETED",i);let x=(0,u.J1)`
296  mutation SendSurveyResponse(
297    $surveyKey: String!
298    $responseId: String!
299    $score: Int!
300    $text: String
301    $okToContact: Boolean
302  ) {
303    sendSurveyResponse(
304      surveyKey: $surveyKey
305      responseId: $responseId
306      score: $score
307      text: $text
308      okToContact: $okToContact
309    )
310  }
311`;function y({surveyKey:e,question:t=(0,n.jsx)(d.sA,{defaultMessage:"How was your experience?",id:"8Jj3NK"}),followUpQuestion:s=(0,n.jsx)(d.sA,{defaultMessage:"Thanks! How could it be improved?",id:"A1c0qG"}),hasParentTitle:i=!1}){let{LoggedInUser:u}=(0,p.A)(),[f]=(0,r.n)(x),[b,A]=a.useState(null),[v,j]=a.useState(""),[T,S]=a.useState(!1),[C,I]=a.use
311State(!1),[N,P]=a.useState(null),[w,M]=a.useState(!1),E=a.useRef(null),O=a.useMemo(()=>self.crypto.randomUUID(),[]),R=null!==b,_=async({surveyKey:e,responseId:t,score:s,text:i,okToContact:n})=>{I(!0);try{await f({variables:{surveyKey:e,responseId:t,score:s,text:i,okToContact:n}})}catch(e){P(e.message)}I(!1)},k=async t=>{t.preventDefault();try{await _({surveyKey:e,responseId:O,score:b,text:v,okToContact:w}),S(!0)}catch(e){P(e.message)}};return(a.useEffect(()=>{R&&setTimeout(()=>E.current.focus(),150)},[R]),u)?(0,n.jsxs)(o.n,{trapped:R,loop:!0,onMountAutoFocus:e=>e.preventDefault(),onUnmountAutoFocus:e=>e.preventDefault(),children:[(0,n.jsx)(c.A,{duration:150,height:T?0:"auto",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)("p",{className:i?"font-normal":"font-bold",children:t}),(0,n.jsx)("div",{className:"flex flex-col gap-1",children:(0,n.jsx)("div",{className:"flex gap-2",children:["\uD83D\uDE2B","\uD83D\uDE15","\uD83D\uDE10","\uD83D\uDE42","\uD83D\uDE00"].map((t,s)=>(0,n.jsx)(h.$n,{size:"icon",variant:s===b?"default":"outline",onClick:async t=>{t.preventDefault(),A(s),await _({surveyKey:e,responseId:O,score:s,text:v,okToContact:w})},className:"text-xl",children:t},t))})}),(0,n.jsx)(c.A,{duration:150,height:R?"auto":0,children:(0,n.jsxs)("form",{className:"flex w-full flex-1 flex-col gap-4",onSubmit:k,children:[(0,n.jsx)("p",{className:"text-muted-foreground",children:s}),(0,n.jsx)(g.T,{ref:E,value:v,onChange:e=>j(e.target.value)}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(m.S,{id:"okToContact",checked:w,onCheckedChange:e=>M(!!e)}),(0,n.jsx)("label",{htmlFor:"okToContact",className:"text-sm leading-none font-normal peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:(0,n.jsx)(d.sA,{defaultMessage:"It's OK to contact me for follow up questions.",id:"OSMRoO"})})]}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)(h.$n,{type:"submit",disabled:C,children:(0,n.jsx)(d.sA,{id:"submit",defaultMessage:"Submit"})}),(0,n.jsx)(l.bm,{asChild:!0,children:(0,n.jsx)(h.$n,{variant:"ghost",children:(0,n.jsx)(d.sA,{id:"Close",defaultMessage:"Close"})})})]}),N&&(0,n.jsx)("p",{className:"text-red-600",children:N})]})})]})}),(0,n.jsx)(c.A,{duration:150,height:T?"auto":0,children:T&&(0,n.jsx)("p",{className:"text-muted-foreground",children:(0,n.jsx)(d.sA,{defaultMessage:"Thank you for your feedback! It will help us improve Open Collective.",id:"xSFQtA"})})})]}):null}},88645:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(14232),n=s(95581);let a=({timeout:e=3e3}={})=>{let[t,s]=i.useState(),a=i.useRef(void 0);return{isCopied:t,copy:i.useCallback(async t=>!!await (0,n.A)(t)&&(s(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s(!1)},e),!0),[e])}}},88842:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var i=s(72976),n=s(60362),a=s(64656),r=s(2038),o=s(20322);class l{constructor(e){this.config=e}static{this.Decoders={amount:e=>{if((0,i.A)(e)||!e.length)return null;{let t=(0,r.$m)(parseFloat(e));return isNaN(t)?null:t}},boolean:e=>(0,i.A)(e)||!e.length?null:(0,o.RR)(e,null),color:e=>{if(e){if(e.match(/^(?=\d*$)(?:.{3}|.{6}|.{8})$/))return`#${e}`;try{return(0,a.Fo)((0,a.kN)(e))}catch{}}return null},integer:e=>{if((0,i.A)(e)||!e.length)return null;{let t=parseInt(e);return isNaN(t)||!Number.isSafeInteger(t)?null:t}},interval:e=>{if(!e)return null;let t=e.trim().replace(/ly$/,"");return["month","year","oneTime"].includes(t)?t:null},json:e=>{try{return JSON.parse(e)}catch{return null}},stringArray:e=>e?e.split(","):null,float:e=>{if((0,i.A)(e)||!e.length)return null;{let t=parseFloat(e);return isNaN(t)?null:t}}}}static{this.Encoders={amount:e=>(0,r.bh)(e)?.toString()||null,boolean:e=>e?"true":"false",integer:e=>e.toString(),json:e=>JSON.stringify(e),stringArray:e=>e.join(","),float:e=>e.toString()}}decode(e){let t={};return Object.entries(this.config).forEach(([s,i])=>{if(!(0,n.A)(e,s))return;let a=e[s],r="alias"===i.type?i.on:s,o=this.config[r].type,c=l.Decoders[o],d=c?c(a):a;t[r]=i.modifier?i.modifier(d):d}),t}encode(e){let t={};return Object.entries(e).forEach(([e,s])=>{let i=this.config[e];if(!i)return;
311let n="alias"===i.type?i.on:e,a=this.config[n].type,r=l.Encoders[a],o=r?r(s):s;t[n]=o}),t}}},91627:(e,t,s)=>{"use strict";s.d(t,{A:()=>sJ});var i,n,a=s(37876),r=s(14232),o=s(95062),l=s.n(o),c=s(99525),d=s(14500),u=s(61902),p=s(32919),h=s(67752),m=s(72976),g=s(28678),f=s(10611),x=s(64487),y=s(49121),b=s(38333),A=s(89099),v=s(62449),j=s(5646),T=s(77153),S=s(98999),C=((i={}).CONTRIBUTION_STEP="contributionStep",i.CONTRIBUTION_HAS_PLATFORM_TIP="contributionHasPlatformTip",i.CONTRIBUTION_PLATFORM_TIP_PERCENTAGE="contributionPlatformTipPercentage",i.CONTRIBUTION_PLATFORM_TIP_VARIANT="contributionPlatformTipVariant",i.CONTRIBUTION_PLATFORM_TIP_ENABLED="contributionPlatformTipEnabled",i.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT="contributionIsOscTipExperiment",i.CONTRIBUTION_HOST_SLUG="contributionHostSlug",i),I=s(6435),N=s(30988),P=s(72903),w=s(57428),M=s(52170),E=s(2038),O=s(2948),R=s(71970),_=s(16614),k=s(88354),L=s(82564),F=s(20322),D=((n={}).NEW_PLATFORM_TIP_FLOW="newPlatformTipFlow",n.OPENSOURCE_PLATFORM_TIP_AB="opensourcePlatformTipAb",n);let U=["ci","e2e","test"];function z(e){return e?.slug==="opensource"||11004===Number(e?.legacyId)}function B(e,t){if(!e?.platformContributionAvailable)return!1;if(t){if(t.type===_.Y.TICKET)return!1;else if(t.amountType===_.w.FIXED&&!t.amount?.valueInCents)return!1}return!0}function H(e,t){return z(e?.host)&&B(e,t)}function $(e,t,s,i){let n;try{let t=JSON.parse((0,L.zM)(e));n=t&&"object"==typeof t&&!Array.isArray(t)?t:{}}catch{n={}}let a=n[t];if(a&&a.pct===s&&"boolean"==typeof a.enabled)return a.enabled;let r=i();return n[t]={enabled:r,pct:s},(0,L.ZB)(e,JSON.stringify(n)),r}let q={newPlatformTipFlow:{enabled(e,t){let s;if(U.includes("production"))return!1;if(z(t?.collective?.host))return!0;let i="string"==typeof(s=(0,k.l)("NEW_PLATFORM_TIP_FLOW_ROLLOUT_PERCENTAGE"))&&/^\d+$/.test(s)?Math.min(parseInt(s,10),100):0,n=()=>100*Math.random()<i,a=t?.collective?.slug;return a?$(L.rS.NEW_PLATFORM_TIP_FLOW_DRAWS,a,i,n):n()}},opensourcePlatformTipAb:{enabled(e,t){let s;if(U.includes("production")||!z(t?.collective?.host))return!1;let i=Number.isFinite(s=parseInt((0,k.l)("OSC_PLATFORM_TIP_ROLLOUT_PERCENTAGE"),10))?Math.min(Math.max(s,0),100):50,n=()=>100*Math.random()>=i,a=t?.collective?.slug;return a?$(L.rS.OSC_TIP_EXPERIMENT_DRAWS,a,i,n):n()}}};function W(e,t,s){let i=function(e){let t=new URLSearchParams(window.location.search).get(e);if(null!==t)return(0,F.RR)(t)}(e);return void 0!==i?i:q[e]?.enabled(t,s)}var G=s(11046),V=s(33123),K=s(56299),Y=s(53061),Q=s(71984),X=s(84223),J=s(87058),Z=s(48519),ee=s(22756),et=s(24334),es=s(56593),ei=s(99202),en=s(64986),ea=s(33341),er=s(69756),eo=s(5885),el=s(60742);let ec=({collective:e,...t})=>(0,a.jsxs)(el.Ay,{withBorderLeft:!0,withNewButtons:!0,...t,children:[(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.FAQ.Secure.Title",defaultMessage:"Is my contribution secure?"})}),(0,a.jsx)(el.UC,{children:(0,a.jsx)(v.sA,{id:"ContributeFAQ.Safe",defaultMessage:"Open Collective doesn't store sensitive payment data (e.g. Credit Card numbers), instead relying on our payment processor, Stripe, a secure solution that is widely adopted. If our systems are compromised, your payment information is not at risk, because we simply don't store it. <LearnMoreLink>Learn more</LearnMoreLink>.",values:{LearnMoreLink:(0,ea.lv)({openInNewTab:!0,href:"https://documentation.opencollective.com/advanced/security-for-accounts"})}})})]}),(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{id:"ContributeFAQ.PlatformTip.Title",defaultMessage:"What is a platform tip?"})}),(0,a.jsx)(el.UC,{children:(0,a.jsx)(v.sA,{id:"ContributeFAQ.PlatformTip.Content",defaultMessage:"A platform tip is an optional donation from you to help maintain and improve the platform. <Link>Learn more</Link>",values:{Link:(0,ea.lv)({openInNewTab:!0,href:"https://documentation.opencollective.com/giving-to-collectives/platform-tips"})}})})]}),(e.contributionPolicy||e.parent?.contributionPolicy)&&(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{id:"ContributeFAQ.Policy.Title",defaultMessage:"Does {name} have a contribution policy?",values:{name:e.name}})}
311),(0,a.jsxs)(el.UC,{children:[e.contributionPolicy&&(0,a.jsx)(en.Ay,{fontSize:"13px",content:e.contributionPolicy}),e.parent?.contributionPolicy&&e.parent.contributionPolicy!==e.contributionPolicy&&(0,a.jsx)(en.Ay,{fontSize:"13px",content:e.parent?.contributionPolicy})]})]}),e.host.contributionPolicy&&e.name!==e.host.name&&(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{id:"ContributeFAQ.Policy.Title",defaultMessage:"Does {name} have a contribution policy?",values:{name:e.host.name}})}),(0,a.jsx)(el.UC,{children:(0,a.jsx)(en.Ay,{fontSize:"13px",content:e.host.contributionPolicy})})]}),(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{id:"createProfile.faq.persoVSOrg.title",defaultMessage:"What's the difference between an individual and an organization profile?"})}),(0,a.jsx)(el.UC,{children:(0,a.jsx)(v.sA,{id:"createProfile.faq.persoVsOrg.content",defaultMessage:"Organizations represent a company or entity, while individual profiles represent a person. Organization profiles can have multiple team members (individual profiles) who have access to edit it and make financial contributions in its name. If a contribution or expense is for a company, it's important to use an organization profile so the correct billing information shows up on receipts and invoices. Organizations can also issue gift cards."})})]}),(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{defaultMessage:"What information is shared with the Collectives?",id:"Ntwzwf"})}),(0,a.jsx)(el.UC,{children:(0,a.jsx)(v.sA,{defaultMessage:"When you contribute to a Collective we share your email address with the Administrators. If you wish to keep your contribution private choose the ‘incognito’ profile. Read our <PrivacyPolicyLink>privacy policy</PrivacyPolicyLink>.",id:"LfwUBd",values:{PrivacyPolicyLink:(0,ea.lv)({href:"/privacypolicy",openInNewTab:!0,as:er.A})}})})]}),(0,a.jsxs)(el.HK,{children:[(0,a.jsx)(el.hE,{children:(0,a.jsx)(v.sA,{id:"ContributeDetails.faq.isIncognito.title",defaultMessage:"What is an incognito contribution?"})}),(0,a.jsx)(el.UC,{children:(0,a.jsx)(v.sA,{id:"ContributeDetails.faq.isIncognito.content",defaultMessage:'Publicly, the contribution amount and date will be visible in the transparent budget, but your identity will be obscured, appearing only as "incognito". The contribution will not be linked to your public profile.'})})]}),(0,a.jsx)(ei.az,{mt:2,children:(0,a.jsxs)(eo.A,{as:eo.A,href:"https://documentation.opencollective.com/giving-to-collectives/payment-methods",openInNewTab:!0,fontSize:"12px",color:"black.700",children:[(0,a.jsx)(v.sA,{id:"moreInfo",defaultMessage:"More info"}),"\xa0→"]})})]});var ed=s(98064),eu=s(98263),ep=s(12838);class eh extends r.Component{static{this.propTypes={steps:l().arrayOf(l().shape({name:l().string.isRequired,validate:l().func,isCompleted:l().bool})).isRequired,currentStepName:l().string.isRequired,onStepChange:l().func.isRequired,onComplete:l().func.isRequired,children:l().func.isRequired,delayCompletionCheck:l().bool.isRequired}}componentDidMount(){this.props.delayCompletionCheck||this.redirectIfStepIsInvalid()}componentDidUpdate(e){!this.props.delayCompletionCheck&&(e.delayCompletionCheck||e.currentStepName!==this.props.currentStepName)&&this.redirectIfStepIsInvalid()}getLastCompletedStep(){let{steps:e}=this.props,t=e.findIndex(e=>!e.isCompleted),s=t-1;if(-1===t)s=e.length-1;else if(0===t)return null;return this.buildStep(e[s],s)}getLastVisitedStep(e){let t=(0,ep.A)(this.props.steps,e=>this.state.visited.has(e.name),e&&!e.isLastStep?e.index+1:this.props.steps.length-1),s=-1===t?0:t;return this.buildStep(this.props.steps[s],s)}getStepByIndex(e){return -1===e||e>=this.props.steps.length?null:this.buildStep(this.props.steps[e],e)}getStepByName(e){return this.getStepByIndex(this.props.steps.findIndex(t=>t.name===e))}render(){let e=this.getStepByName(this.props.currentStepName);if(!e)return null;let t=this.getLastCompletedStep(),s=this.getStepByIndex(e.index-1),i=this.getStepByIndex(e.index+1);return this.props.children({currentStep:e,prevStep:s,nextStep:i,lastValidStep:t,isValidating:this.state.isValidating,lastVisitedStep:this.getLastVisitedStep(t),steps:this.props.steps.map(this.buildStep),goNext:this.goNext,goBack:e.index>
3110?this.goBack:void 0,goToStep:this.goToStep,isValidStep:t?t.index+1>=e.index:0===e.index})}constructor(...e){super(...e),this.state={visited:new Set([]),isValidating:!1},this.redirectIfStepIsInvalid=()=>{let e=this.getStepByName(this.props.currentStepName),t=this.getLastCompletedStep(),s=t?t.index+1:0;!e||e.index>s?this.onInvalidStep(e,t):this.props.steps.slice(0,e.index+1).map(this.markStepAsVisited)},this.onInvalidStep=(e,t)=>{let s=this.getStepByIndex(0),i=t?this.props.steps[t.index+1]:s;return this.goToStep(i,{ignoreValidation:!0})},this.markStepAsVisited=e=>{this.setState(t=>({visited:t.visited.add(e.name)}))},this.buildStep=(e,t)=>({...e,index:t,isLastStep:t===this.props.steps.length-1,isVisited:this.state.visited.has(e.name)}),this.validateCurrentStep=async(e=null)=>{let t=this.getStepByName(this.props.currentStepName);if(!t)return!1;if(t.validate){this.setState({isValidating:!0});let s=await t.validate(e);if(this.setState({isValidating:!1}),!s)return!1}else if(!1===t.isCompleted&&"prev"!==e)return!1;return!0},this.goNext=async()=>{let e=this.getStepByName(this.props.currentStepName);if(e.index===this.props.steps.length-1){if(await this.validateCurrentStep())return this.props.onComplete()}else{let t=this.props.steps[e.index+1];this.goToStep(this.buildStep(t,e.index+1))}return!0},this.goBack=()=>{let e=this.getStepByName(this.props.currentStepName);if(!e||0===e.index)return!1;let t=this.props.steps[e.index-1];return this.goToStep(this.buildStep(t,e.index-1)),!0},this.goToStep=async(e,t={})=>{let s=this.getStepByName(this.props.currentStepName),i=t.ignoreValidation;if(e.index<s?.index&&(t.action="prev",!i)){let e=this.getLastCompletedStep();i=this.getLastVisitedStep(e).index===s.index}return(!!i||!!await this.validateCurrentStep(t.action))&&(this.props.onStepChange(e),!0)}}}var em=s(72945),eg=s(69020),ef=s(3859);let ex=({collective:e,useLink:t,children:s,linkColor:i})=>t?(0,a.jsx)(eo.A,{as:er.A,href:(0,J.bl)(e),color:i,children:s}):(0,a.jsx)(es.A,{children:s});var ey=s(3761),eb=s(11497),eA=s(79839),ev=s(68901),ej=s(69064);let eT=(0,j.I4)(ev.A).withConfig({componentId:"sc-433b7a75-0"})(["span{vertical-align:baseline;}"]);class eS extends r.Component{static{this.propTypes={goNext:l().func,goBack:l().func,step:l().shape({name:l().string}),prevStep:l().shape({name:l().string}),nextStep:l().shape({name:l().string}),isValidating:l().bool,paypalButtonProps:l().object,currency:l().string,disabled:l().bool,tier:l().shape({type:l().string}),stepDetails:l().object,stepSummary:l().object,showPlatformTip:l().bool,isOscTipExperiment:l().bool,hostSlug:l().string}}getStepLabel(e){switch(e.name){case ey.UT.PROFILE:return(0,a.jsx)(v.sA,{id:"ContributionFlow.YourInfo",defaultMessage:"Your info"});case ey.UT.PAYMENT:return(0,a.jsx)(v.sA,{id:"ContributionFlow.Payment",defaultMessage:"Payment"});case ey.UT.DETAILS:return(0,a.jsx)(v.sA,{defaultMessage:"Contribution",id:"0LK5eg"})}}render(){let{goBack:e,isValidating:t,nextStep:s,paypalButtonProps:i,currency:n,tier:o,stepDetails:l,disabled:c}=this.props,d=(0,ej.dv)(l,this.props.stepSummary);return(0,a.jsx)(ei.so,{flexWrap:"wrap",justifyContent:"center",children:(0,a.jsxs)(r.Fragment,{children:[e&&(0,a.jsxs)(ev.A,{mx:[1,null,2],minWidth:s?145:185,onClick:e,color:"black.600",disabled:c||t,"data-cy":"cf-prev-step",type:"button",mt:2,children:["←"," ",this.getStepLabel(this.props.prevStep)||(0,a.jsx)(v.sA,{id:"Pagination.Prev",defaultMessage:"Previous"})]}),!i||s?(0,a.jsx)(eT,{mt:2,mx:[1,null,2],minWidth:s?145:185,buttonStyle:"primary",onClick:this.goNext,disabled:c,loading:t||this.state.isLoadingNext,"data-cy":"cf-next-step",type:"submit",children:s?(0,a.jsxs)(r.Fragment,{children:[this.getStepLabel(s)||(0,a.jsx)(v.sA,{id:"contribute.nextStep",defaultMessage:"Next step"})," ","→"]}):o?.type==="TICKET"?(0,a.jsx)(v.sA,{id:"contribute.ticket",defaultMessage:"Get {quantity, select, 1 {ticket} other {tickets}}",values:{quantity:l.quantity||1}}):d?(0,a.jsx)(v.sA,{id:"contribute.amount",defaultMessage:"Contribute {amount}",values:{amount:(0,a.jsx)(eb.A,{value:d,currency:n,precision:"auto"})}}):(0,a.jsx)(v.sA,{id:"contribute.submit",defaultMessage:"Make contribution"})}):(0,a.jsx)(ei.az,{mx:[1,null,2],minWidth:200,mt:2,children:(0,a.jsx)(eA.A,{...i,isSubmitting:t||this.state.isLoadingNext})})]})})}constructor(...e){super(...e),this.state={isLoadingNext:!1},this.goNext=async e=>{e.preventDefault(),this.props.goNext&&this.setState({isLoadingNext:!0},async()=>{await this.props.goNext(),this.setState({isLoadingNext:!1})}),"details"===this.props.step.name&&(0,S.u)(T.X.CONTRIBUTION_DETAILS_STEP_COMPLETED,{props:{[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:this.props.stepDetails?.isNewPlatformTip?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:!!this.props.showPlatformTip,[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:!!this.props.isOscTipExperiment,[C.CONTRIBUTION_HOST_SLUG]:this.props.hostSlug}})}}}var eC=s(40125),eI=s(30619);class eN extends r.Component{static{this.propTypes={collective:l().shape({slug:l().string,currency:l().string,name:l().string,contributors:l().shape({totalCount:l().number,nodes:l().arrayOf(l().shape({id:l().string,name:l().string}))})}).isRequired,LoggedInUser:l().object,intl:l().object,isEmbed:l().bool}}render(){let{collective:e,isEmbed:t}=this.props,s=e.contributors?.nodes;return(0,a.jsxs)(ei.so,{flexDirection:["column",null,"row"],alignItems:"center",maxWidth:500,children:[(0,a.jsx)(ei.az,{mx:3,children:(0,a.jsx)(eI.Ay,{collective:e,radius:[65,null,96]})}),(0,a.jsxs)(ei.so,{flexDirection:"column",alignItems:"center",children:[(0,a.jsx)(ex,{useLink:!t,collective:e,linkColor:"#333",children:(0,a.jsx)(em.H1,{textAlign:"center",fontSize:["28px",null,"32px"],lineHeight:"40px",fontWeight:500,title:e.name,children:(0,a.jsx)(v.sA,{id:"CreateOrder.Title",defaultMessage:"Contribute to {collective}",values:{collective:(0,eC.A)(e.name,{length:60})}})})}),s?.length>0&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(em.P,{fontSize:"16px",lineHeight:"24px",fontWeight:400,color:"black.500",py:2,children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.Join",defaultMessage:"Join {numberOfContributors} other fellow contributors",values:{numberOfContributors:e.contributors.totalCount}})}),(0,a.jsxs)(ei.so,{alignItems:"center",children:[s.map(e=>(0,a.jsx)(ei.az,{mx:1,children:(0,a.jsx)(eI.bi,{contributor:e,radius:24})},e.id)),e.contributors.totalCount>s.length&&(0,a.jsxs)(es.A,{fontSize:"12px",color:"black.600",children:["+ ",e.contributors.totalCount-s.length]})]})]})]})]})}}let eP=(0,Z.A)((0,eg.Cb)(eN));
311var ew=s(62939),eM=s(78027),eE=s(75645),eO=s(37071),eR=s(27949),e_=s(88645);let ek=()=>{let{isCopied:e,copy:t}=(0,e_.A)();return(0,a.jsxs)(ev.A,{buttonSize:"tiny",onClick:()=>t(window.location.href),children:[(0,a.jsx)(eR._,{size:12}),(0,a.jsx)(em.L9,{ml:1,children:e?(0,a.jsx)(v.sA,{id:"Clipboard.Copied",defaultMessage:"Copied!"}):(0,a.jsx)(v.sA,{defaultMessage:"Share link",id:"GQNYob"})})]})};var eL=s(60257);let eF=(0,v.YK)({[P.Ay.oneTime]:{id:"Frequency.OneTime",defaultMessage:"One time"},[P.Ay.month]:{id:"Frequency.Monthly",defaultMessage:"Monthly"},[P.Ay.year]:{id:"Frequency.Yearly",defaultMessage:"Yearly"}}),eD=(e,t)=>{let s=eF[t];return s?e.formatMessage(s):t};var eU=s(89908),ez=s(62051),eB=s(94019),eH=s(71927),e$=s(84571);let eq=j.I4.div.withConfig({componentId:"sc-4231959e-0"})(["overflow-y:hidden;"]),eW=j.I4.div.withConfig({componentId:"sc-4231959e-1"})(["overflow-y:hidden;"," -webkit-mask-image:linear-gradient(to bottom,black 50%,transparent 100%);mask-image:linear-gradient(to bottom,black 50%,transparent 100%);"],e=>e.$maxCollapsedHeight&&`max-height: ${e.$maxCollapsedHeight+20}px;`),eG=({children:e,maxCollapsedHeight:t})=>{let[s,i]=r.useState(!1),[n,o]=r.useState(!1),l=r.useRef(void 0),c=()=>i(!s);return r.useEffect(()=>{l.current&&l.current.clientHeight>t+20&&o(!0)},[e]),(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(!n||s?eq:eW,{ref:l,$maxCollapsedHeight:t,children:e}),n&&(0,a.jsx)(eo.A,{as:"button",mt:2,onClick:c,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c())},children:s?(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(v.sA,{defaultMessage:"Collapse",id:"W/V6+Y"}),(0,a.jsx)(e$.Z,{size:"10px"})]}):(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(v.sA,{id:"ExpandDescription",defaultMessage:"Read full description"}),(0,a.jsx)(eH.a,{size:"10px"})]})})]})};var eV=s(2996),eK=s(54770);let eY=["15px",null,"20px"],eQ=["23px",null,"28px"],eX=j.I4.span.withConfig({componentId:"sc-eb7c60da-0"})(e=>(0,eK.AH)({lineHeight:eQ,fontSize:e.isSelected?eY:["15px",null,"18px"],fontWeight:e.isSelected?500:400})),eJ="other",eZ=({presets:e,currency:t,value:s,onChange:i})=>{let n=e?.length>0?[...e,eJ]:[eJ];return(0,a.jsx)(ei.so,{width:"100%",children:n.length>0&&(0,a.jsx)(ez.A,{id:"amount","data-cy":"amount-picker",role:"group","aria-label":"Contribution amount",width:"100%",justifyContent:"center",items:n,buttonProps:{px:2,py:"5px"},selected:s,buttonPropsBuilder:({index:e,isSelected:t})=>{var s,i,a;return{display:(s=e,i=n,a=t,0===s||s===i.length-1||a?"inline-block":s<2?["none","inline-block"]:s<4?["none",null,"inline-block"]:"none")}},onChange:i,children:({item:e,isSelected:s})=>{switch(e){case eJ:return(0,a.jsx)(eX,{isSelected:s,"data-cy":"amount-picker-btn-other",children:(0,a.jsx)(v.sA,{id:"contribution.amount.other.label",defaultMessage:"Other"})});case 0:return(0,a.jsx)(eX,{isSelected:s,children:(0,a.jsx)(v.sA,{id:"Amount.Free",defaultMessage:"Free"})});default:return(0,a.jsx)(eX,{isSelected:s,children:(0,a.jsx)(eb.A,{value:e,currency:t,formatWithSeparators:!0,precision:"auto"})})}}})})};var e0=s(90983),e1=s(93182);let e2=({onClose:e,tierName:t,onConfirm:s})=>(0,a.jsx)(e1.A,{width:"100%",maxWidth:"570px",onClose:e,header:(0,a.jsx)(v.sA,{id:"Frequency.change",defaultMessage:"Change frequency?"}),continueHandler:s,children:(0,a.jsx)(em.P,{fontSize:"14px",lineHeight:"18px",mt:2,children:(0,a.jsx)(v.sA,{id:"contribute.changeFrequency.warning",defaultMessage:"If you change the frequency, you will not contribute to this specific {tierName} tier",values:{tierName:(0,a.jsx)("q",{children:t})}})})});var e4=s(76691),e3=s(45409),e5=s(58201);let e6=e=>e?Array.isArray(e)?{fields:e}:e:null,e9=({fieldProps:e,customField:t,onChange:s,translate:i,value:n})=>{let r=t.options?.map(e=>({...e,label:i(e.label)}))||[];return(0,a.jsx)(e3.A,{inputId:e.id,name:e.name,required:e.required,disabled:e.disabled,onChange:s,isMulti:t.settings?.isMulti,placeholder:i(t.placeholder),width:1,options:r,value:r.find(e=>e.value===n)})},e7=({config:e,data:t,onChange:s})=>{let i=(0,v.tz)(),n=r.useMemo(()=>{var t;return t=i.locale,e?.translations?s=>{let i=`${t}.${s}`;return(0,x.A)(e.translations,i,s)}:e=>e},[e,i.locale]);return e.fields.map((e,i)=>"separator"===e.type?(0,a.jsx)(eM.A,{borderColor:"black.200",my:2},`separator-${i}`):(0,a.jsx)(eB.A,{mt:3,htmlFor:`custom-field-input-${e.name}`,inputType:e.type,width:"100%",label:n(e.label||e.name),hint:n(e.hint),helpText:n(e.helpText),...(0,f.A)(e,["name","required","disabled","useRequiredLabel","hideOptionalLabel","isPrivate"]),children:i=>"textarea"===e.type?(0,a.jsx)(e5.A,{autoSize:!0,...i,onChange:({target:i})=>s({...t,[e.name]:i.value}),maxHeight:500,minHeight:150,placeholder:n(e.placeholder)}):"select"===e.type?(0,a.jsx)(e9,{fieldProps:i,customField:e,onChange:({value:i})=>s({...t,[e.name]:i}),value:t?.[i.name],translate:n}):(0,a.jsx)(e8,{...i,width:1,value:t?.[e.name]||"",mt:"checkbox"===e.type?"2px !important":0,placeholder:n(e.placeholder),pattern:e.pattern,onChange:i=>s({...t,[e.name]:"checkbox"===e.type?i.target.checked:i.target.value}),$_css:"checkbox"===e.type?{flex:"0 0 1em"}:void 0})},`${i}-${e.name}`))};var e8=(0,j.Ay)(e0.A).withConfig({componentId:"sc-80712325-0"})(["",""],e=>e.$_css);let te=(0,A.withRouter)(({onChange:e,stepDetails:t,collective:s,tier:i,router:n,showPlatformTip:o,isOscTipExperiment:l})=>{let c=(0,v.tz)(),d=t?.amount,u=i?.amount.currency||s.currency,p=(0,X.DL)(i,s.type,u),[h,f]=r.useState(()=>(0,m.A)(d)||!p?.includes(d)),[x,y]=r.useState(void 0),{LoggedInUser:b}=(0,eL.A)(),A=i?.customFields,j=s.host?.settings?.contributionFlow?.customFields,N=r.useMemo(()=>((...e)=>(0,e4.A)({},...e.map(e6)))(A,j),[A,j]),w=(0,X.jT)(i,u),M=0===w&&0===d,O=M?P.Ay.oneTime:t?.interval,R=i?.type===_.Y.TICKET&&!i.singleTicket||i?.type===_.Y.PRODUCT,k=i?.amountType===_.w.FIXED,L=(0,I.tM)(s,b)&&(!i||i?.interval),F=i?.interval&&i.interval!==P.Ay.flexible,D=r.useCallback((s,i)=>{e({stepDetails:{...t,[s]:i},..."interval"===s&&i!==P.Ay.oneTime&&{stepPayment:null},stepSummary:null})},[e,t]);return r.useEffect(()=>{!O||O===P.Ay.oneTime||(F||L)&&0!==d||D("interval",P.Ay.oneTime)}
311,[O,F,L,d,D]),r.useEffect(()=>{(0,S.u)(T.X.CONTRIBUTION_STARTED,{props:{[C.CONTRIBUTION_STEP]:"details",[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:t.isNewPlatformTip?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:o,[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:l,[C.CONTRIBUTION_HOST_SLUG]:s?.host?.slug}})},[t.isNewPlatformTip,o,l,s?.host?.slug]),(0,a.jsxs)(ei.az,{width:1,children:[i?.type==="TICKET"&&i.description&&(0,a.jsx)(es.A,{mb:4,whiteSpace:"pre-line",children:(0,a.jsx)(eG,{maxCollapsedHeight:125,children:i.description})}),F?(0,a.jsx)(em.P,{fontSize:"20px",fontWeight:"500",color:"black.800",mb:3,children:eD(c,i.interval)}):L?(0,a.jsx)(ez.A,{id:"interval",justifyContent:"center",mt:[4,0],mb:"30px",items:[P.Ay.oneTime,P.Ay.month,P.Ay.year],selected:O||null,buttonProps:{px:2,py:"5px"},role:"group","aria-label":"Amount types",disabled:M,onChange:e=>{i&&i.interval!==P.Ay.flexible?y(e):D("interval",e)},children:({item:e,isSelected:t})=>(0,a.jsx)(em.L9,{fontSize:t?"20px":"18px",lineHeight:"28px",fontWeight:t?500:400,children:eD(c,e)})}):null,k?i.amount.valueInCents?(0,a.jsx)(ei.az,{mb:3,children:(0,a.jsx)(v.sA,{id:"contribute.tierDetails",defaultMessage:"You’ll contribute {amount}{interval, select, month { monthly} year { yearly} other {}}.",values:{interval:i.interval??"",amount:(0,a.jsx)(eV.A,{amount:(0,ej.dv)(t),currency:u})}})}):R?null:(0,a.jsx)(v.sA,{id:"contribute.freeTier",defaultMessage:"This is a free tier."}):(0,a.jsxs)(ei.az,{mb:"30px",children:["number"==typeof d&&!isNaN(d)&&d<w&&(0,a.jsx)("div",{className:"mb-2 text-red-400",children:(0,a.jsx)(v.sA,{id:"amount.belowMinimum",defaultMessage:"Please enter an amount of {minAmount} or more",values:{minAmount:(0,E.vv)(w,u,{locale:c.locale})}})}),(0,a.jsx)(eZ,{currency:u,presets:p,value:h?eJ:t?.amount,onChange:e=>{e===eJ?f(!0):(f(!1),D("amount",e))}}),h&&(0,a.jsxs)(ei.so,{justifyContent:"space-between",alignItems:"center",mt:2,children:[(0,a.jsx)(eU.A,{name:"custom-amount",type:"number",currency:u,value:t?.amount,className:"w-full",min:w,currencyDisplay:"full",required:!0,onChange:(e,s)=>{if("insertReplacementText"===s.nativeEvent.inputType){let s=t?.amount,i=e-s==1,n=e-s==-1;i?e=50*Math.round((e+49)/50):n&&(e=50*Math.round((e-49)/50))}D("amount",e)}}),!!w&&(0,a.jsx)(ei.so,{fontSize:"14px",color:"black.800",flexDirection:"column",alignItems:"flex-end",mt:1,children:(0,a.jsx)(v.sA,{id:"contribution.minimumAmount",defaultMessage:"Minimum amount: {minAmount} {currency}",values:{minAmount:(0,E.vv)(w,u,{locale:c.locale}),currency:u}})})]})]}),R&&(0,a.jsx)(ei.az,{mb:"30px",children:(0,a.jsx)(eB.A,{htmlFor:"quantity",label:(0,a.jsx)(v.sA,{id:"contribution.quantity",defaultMessage:"Quantity"}),labelFontSize:"16px",labelColor:"black.800",labelProps:{fontWeight:500,lineHeight:"28px",mb:1},error:!!(null!==i.availableQuantity&&t?.quantity>i.availableQuantity),"data-cy":"contribution-quantity",required:!0,children:e=>(0,a.jsxs)("div",{children:[null!==i.availableQuantity&&(0,a.jsx)(em.P,{fontSize:"11px",color:"#e69900",textTransform:"uppercase",fontWeight:"500",letterSpacing:"1px",mb:2,children:(0,a.jsx)(v.sA,{id:"tier.limited",defaultMessage:"LIMITED: {availableQuantity} LEFT OUT OF {maxQuantity}",values:i})}),(0,a.jsx)(e0.A,{...e,type:"number",min:1,step:1,max:i.availableQuantity,value:t?.quantity,maxWidth:80,fontSize:"15px",minWidth:100,onChange:e=>{let t=parseInt(e.target.value);D("quantity",isNaN(t)?null:t)}})]})})}),(0,I.TK)(s.host)&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(eM.A,{borderColor:"black.300",mb:16,mt:32}),(0,a.jsx)(em.P,{fontSize:"14px",lineHeight:"20px",fontStyle:"italic",color:"black.500",letterSpacing:"0em",children:(0,a.jsx)(v.sA,{id:"platformFee.taxDeductible",defaultMessage:"This Collective's Fiscal Host is a registered 501(c)(3) non-profit organization. Your contribution will be tax-deductible in the US, to the extent allowed by the law."})}),(0,a.jsx)(eM.A,{borderColor:"black.300",mt:16,mb:32})]}),!(0,g.A)(N?.fields)&&(0,a.jsxs)(ei.az,{mt:28,children:[(0,a.jsx)(em.H5,{fontSize:"20px",fontWeight:"normal",color:"black.800",children:(0,a.jsx)(v.sA,{id:"OtherInfo",defaultMessage:"Other information"})}),(0,a.jsx)(e7,{config:N,data:t?.customData,onChange:e=>D("customData",e)})]}),void 0!==x&&(0,a.jsx)(e2,{tierName:i.name,onClose:()=>y(void 0),onConfirm:()=>{D("interval",x),y(void 0),n.push(`/${s.slug}/donate/details`)}})]})});var tt=s(13487),ts=s(83655),ti=s(670),tn=s(21651),ta=s(54675),tr=s(99596),to=s(47597),tl=s(6859),tc=s(54450),td=s(48953);let tu=(0,G.J1)`
312  query ContributionFlowPaymentMethods($slug: String) {
313    account(slug: $slug) {
314      id
315      paymentMethods(
316        type: [CREDITCARD, US_BANK_ACCOUNT, SEPA_DEBIT, BACS_DEBIT, GIFTCARD, PREPAID, COLLECTIVE]
317        includeExpired: true
318      ) {
319        id
320        name
321        data
322        service
323        type
324        expiryDate
325        providerType
326        sourcePaymentMethod {
327          id
328          name
329          data
330          service
331          type
332          expiryDate
333          providerType
334          balance {
335            currency
336          }
337          limitedToHosts {
338            id
339            legacyId
340            slug
341          }
342        }
343        balance {
344          valueInCents
345          currency
346        }
347        account {
348          id
349          slug
350          type
351          name
352          imageUrl
353        }
354        limitedToHosts {
355          id
356          legacyId
357          slug
358        }
359      }
360    }
361  }
362`,tp=j.Ay.div.withConfig({componentId:"sc-b3c69b1c-0"})(["display:flex;flex-direction:column;background:#ffffff;padding:16px;",""],e=>e.index&&(0,j.AH)(["border-top:1px solid ",";"],(0,tn.y)("colors.black.200")));function th(e){let t=(0,v.tz)(),{LoggedInUser:s}=(0,eL.A)(),{loading:i,data:n,error:o}=(0,ti.IT)(tu,{variables:{slug:e.stepProfile.slug},skip:!e.stepProfile.slug,fetchPolicy:"no-cache"}),l=e.host?.supportedPaymentMethods??[],[c,d,p,h]=(0,tr.A)({chargeAttempt:e.stepPayment?.chargeAttempt,skip:!l.includes(V.RTb.PAYMENT_INTENT),amount:{valueInCents:e.stepDetails.amount,currency:e.stepDetails.currency},fromAccount:e.stepProfile.isGuest?void 0:"string"==typeof e.stepProfile.id?{id:e.stepProfile.id}:{legacyId:e.stepProfile.id},guestInfo:e.stepProfile.isGuest?(0,ej.Cm)(e.stepProfile):void 0,toAccount:(0,f.A)(e.toAccount,"id"),frequency:(0,P.GC)(e.stepDetails.interval)}),m=r.useMemo(()=>(0,ej.z3)(t,n?.account?.paymentMethods??[],e.stepProfile,e.stepDetails,e.stepSummary,e.toAccount,e.isEmbed,e.disabledPaymentMethodTypes,c),[n?.account?.paymentMethods,e.stepProfile,e.stepDetails,e.stepSummary,e.toAccount,e.isEmbed,e.disabledPaymentMethodTypes,c,t]),y=i||p,b=r.useCallback((t,s)=>e.onChange({stepPayment:{key:t,paymentMethod:s,stripeData:c?{stripe:d,paymentIntentClientSecret:c.client_secret}:void 0}}),[e.onChange,d,c]);r.useEffect(()=>{if(!y){if((0,g.A)(m))return e.onChange({stepPayment:null});if(!e.stepPayment||e.stepPayment.isKeyOnly){let t=e.stepPayment?.key,s=m.find(e=>!e.disabled&&(!t||e.key===t));s?b(s.key,{...s.paymentMethod,stripePaymentIntentId:c?.id}):e.stepPayment&&e.onChange({stepPayment:null})}}},[m,e.stepPayment,y,c]);let A=r.useCallback(t=>{t&&e.onChange({stepProfile:(0,ta.A)({...e.stepProfile},"captcha",t)})},[e.onChange,e.stepProfile]);if(y)return(0,a.jsx)(ed.A,{});if(o)return(0,a.jsx)(to.A,{error:o});if(h?.message?.toLowerCase().includes("captcha"))return(0,a.jsxs)("div",{children:[(0,a.jsx)(eu.A,{type:"warning",withIcon:!0,children:(0,a.jsx)(v.sA,{id:"NewContribute.completeCaptchToContinue",defaultMessage:"Complete the captcha form to continue"})}),(0,a.jsx)(ei.so,{mt:"18px",justifyContent:"center",children:(0,a.jsx)(et.Ay,{onVerify:A})})]});if((0,g.A)(m))return(0,a.jsx)(eu.A,{type:"warning",withIcon:!0,children:(0,a.jsx)(v.sA,{id:"NewContribute.noPaymentMethodsAvailable",defaultMessage:"No payment methods available."})});let j=(0,a.jsx)(tc.A,{id:"PaymentMethod",name:"PaymentMethod",keyGetter:"key",options:m,onChange:e=>b(e.key,{...e.value.paymentMethod,stripePaymentIntentId:c?.id}),value:e.stepPayment?.key||null,disabled:e.isSubmitting,containerProps:void 0,labelProps:void 0,radioSize:void 0,"data-cy":"PaymentMethodList",children:({radio:t,checked:i,index:n,value:r})=>(0,a.jsxs)(tp,{index:n,disabled:r.disabled,children:[(0,a.jsxs)(tg,{alignItems:"center",$_css:r.disabled?"filter: grayscale(1) opacity(50%);":void 0,children:[(0,a.jsx)(ei.az,{as:"span",mr:3,flexWrap:"wrap",children:t}),(0,a.jsx)(tm,{mr:3,children:r.icon}),(0,a.jsxs)(ei.so,{flexDirection:"column",children:[(0,a.jsx)(em.P,{fontSize:"15px",lineHeight:"20px",fontWeight:400,color:"black.900",children:r.title}),r.subtitle&&(0,a.jsx)(em.P,{fontSize:"12px",fontWeight:400,lineHeight:"18px",color:"black.500",children:r.subtitle})]})]}
362),r.key===ej.om&&i&&(0,a.jsx)(ei.az,{my:3,children:(0,a.jsx)(u.Elements,{stripe:(0,Y.C)(),children:(0,a.jsx)(tl.A,{name:ej.om,profileType:e.stepProfile?.type,hidePostalCode:e.hideCreditCardPostalCode,onReady:e.onNewCardFormReady,useLegacyCallback:!1,onChange:e=>b(ej.om,e),error:(0,x.A)(e.stepPayment,"paymentMethod?.stripeData?.error?.message"),defaultIsSaved:!e.stepProfile?.isGuest,hasSaveCheckBox:!e.stepProfile?.isGuest})})}),"manual"===r.key&&i&&r.instructions&&(0,a.jsx)(ei.az,{my:3,color:"black.600",fontSize:"14px",children:r.instructions}),r.key===ej.S7&&i&&(0,a.jsx)(ei.az,{my:3,children:(0,a.jsx)(td.W,{bilingDetails:{name:e.stepProfile?.name,email:s?.email??e?.stepProfile?.email},stripePaymentIntentId:c.id,paymentIntentClientSecret:c.client_secret,onChange:e.onChange,defaultIsSaved:!e.stepProfile?.isGuest,hasSaveCheckBox:!e.stepProfile?.isGuest})})]})});if(c&&d){let e={clientSecret:c.client_secret,appearance:{theme:"stripe",variables:{fontFamily:"Inter, sans-serif"}},fonts:[{cssSrc:"https://fonts.googleapis.com/css?family=Inter"}]};return(0,a.jsx)(u.Elements,{options:e,stripe:d,children:j})}return j}var tm=(0,j.Ay)(ei.so).withConfig({componentId:"sc-b3c69b1c-1"})({flexBasis:"26px"}),tg=(0,j.Ay)(ei.so).withConfig({componentId:"sc-b3c69b1c-2"})(["",""],e=>e.$_css);let tf=({stepDetails:e,stepProfile:t,stepPayment:s,stepSummary:i,collective:n,onChange:o,isSubmitting:l,isEmbed:c,hideCreditCardPostalCode:d=!1,onNewCardFormReady:u,disabledPaymentMethodTypes:p,showPlatformTip:h,isOscTipExperiment:m})=>{let{LoggedInUser:g}=(0,eL.A)();return(r.useEffect(()=>{(0,S.u)(T.X.CONTRIBUTION_PAYMENT_STEP,{props:{[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:e?.isNewPlatformTip?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:!!h,[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:!!m,[C.CONTRIBUTION_HOST_SLUG]:n?.host?.slug}})},[]),(0,tt.A)(t)&&!g?.hasTwoFactorAuth)?(0,a.jsx)(ts.y,{borderWidth:0,noTitle:!0}):(0,a.jsx)(es.A,{width:1,border:["1px solid #DCDEE0","none"],borderRadius:15,children:(0,a.jsx)(th,{host:n.host,toAccount:n,disabledPaymentMethodTypes:p,stepSummary:i,stepDetails:e,stepPayment:s,stepProfile:t,isEmbed:c,isSubmitting:l,hideCreditCardPostalCode:d,onNewCardFormReady:u,onChange:o})})};var tx=s(71321),ty=s(65221),tb=s(1922);let tA=(e,t,s,i)=>{let n=(0,ej.C)(void 0,t,i,void 0,s);if(n.address){let t=e.location||{};if(!t.country||!(t.address||t.structured))return!1}return!(n.legalName&&!e.name&&!e.legalName||(0,et.AO)()&&!e.captcha)&&!!e.email&&!!(0,tx.isEmail)(e.email)},tv=({stepDetails:e,onChange:t,data:s,isEmbed:i,onSignInClick:n,tier:o,collective:l})=>{var c;let d,u=(e,i)=>t({stepProfile:(0,ta.A)({...s,isGuest:!0},e,i)}),p=e=>u(e.target.name,e.target.value),h=r.useMemo(()=>(0,ej.C)(void 0,e,l,void 0,o),[e,l,o]),m=o?.type===_.Y.TICKET||o?.requireAddress||!l.policies.CONTRIBUTOR_INFO_THRESHOLDS?.legalName,g=o?.type===_.Y.TICKET||o?.requireAddress||!l.policies.CONTRIBUTOR_INFO_THRESHOLDS?.address;return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)(eu.A,{type:"info",children:[(0,a.jsx)("h1",{className:"font-bold",children:(0,a.jsx)(v.sA,{defaultMessage:"Privacy Information",id:"AyQ5sz"})}),(0,a.jsx)("p",{children:(0,a.jsx)(v.sA,{defaultMessage:"When you contribute to {collectiveName}, your email address will be shared with its administrators.{isSelfHosted, select, false { It will also be shared with {hostName}, the legal entity that provides {collectiveName} with financial services and will be receiving this contribution on their behalf.} other {}}",id:"iVRVyA",values:{collectiveName:l.name,hostName:(0,a.jsx)(er.A,{href:`/${l.host.slug}`,children:l.host.name}),isSelfHosted:l.id===l.host.id}})}),(0,a.jsx)("p",{className:"mt-2",children:(0,a.jsx)(v.sA,{defaultMessage:"<PrivacyPolicyLink>Read our privacy policy</PrivacyPolicyLink>.",id:"ReadOurPrivacyPolicy",values:{PrivacyPolicyLink:(0,ea.lv)({href:"/privacypolicy",openInNewTab:!0,as:er.A})}})})]}),(0,a.jsx)(eB.A,{htmlFor:"email",label:(0,a.jsx)(v.sA,{defaultMessage:"Your email",id:"nONnTw"}),labelFontSize:"16px",labelFontWeight:"700",maxLength:"254",required:!0,hint:!i&&(0,a.jsx)(v.sA,{defaultMessage:"If you already have an account or want to contribute as an organization, <SignInLink>Sign in</SignInLink>.",id:"ucWzrM",values:{SignInLink:(0,ea.lv)({as:er.A,href:{pathname:"/signin",query:(c=s?.email,d={next:window.location.pathname},c?{...d,email:c}:d)},"data-cy":"cf-profile-signin-btn",onClick:e=>{e.preventDefault(),e.stopPropagation(),n()}})}}),children:e=>(0,a.jsx)(e0.A,{...e,value:s?.email||"",placeholder:"[email protected]",type:"email",onChange:p})}),(0,a.jsx)(eM.A,{my:"4px",borderColor:"black.300"}),(0,a.jsx)(eB.A,{htmlFor:"name",label:(0,a.jsx)(v.sA,{defaultMessage:"Your name",id:"vlKhIl"}),labelFontSize:"16px",labelFontWeight:"700",required:!1,hint:(0,a.jsx)(v.sA,{defaultMessage:"This is your display name or alias. Leave it in blank to appear as guest.",id:"h1BHRl"}),children:e=>(0,a.jsx)(e0.A,{...e,value:s?.name||"","data-cy":"input-name",placeholder:"Thomas Anderson",onChange:p,maxLength:"255"})}),(0,a.jsx)(eB.A,{htmlFor:"legalName",label:(0,a.jsx)(v.sA,{defaultMessage:"Legal name",id:"OozR1Y"}),labelFontSize:"16px",labelFontWeight:"700",isPrivate:!0,hideOptionalLabel:h.legalName,required:h.legalName,hint:h.legalName&&m?(0,a.jsx)(v.sA,{defaultMessage:"Required by {isSelfHosted, select, true {{collectiveName}} other {{hostName}}} for legal and compliance purposes.",id:"legalName.hint.noThreshold",values:{hostName:l.host.name,collectiveName:l.name,isSelfHosted:l.id===l.host.id}}):h.legalName?(0,a.jsx)(v.sA,{defaultMessage:"Required for legal purposes as your total anual contribution is more than {amount}. This information is private but it will be shared with {collectiveName}{isSelfHosted, select, false { and {hostName}} other {}}.",id:"RGpvqu",values:{amount:(0,E.vv)(l.policies.CONTRIBUTOR_INFO_THRESHOLDS.legalName,l.currency),hostName:l.host.name,collectiveName:l.name,isSelfHosted:l.id===l.host.id}}):(0,a.jsx)(v.sA,{defaultMessage:"Important for receipts, invoices, payments and official documentation if different from your name.",id:"LdGP5g"}),children:e=>(0,a.jsx)(e0.A,{...e,value:s?.legalName||"","data-cy":"input-legalName",placeholder:"Thomas A. Anderson",onChange:p,maxLength:"255"})}),h.address&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(ei.so,{alignItems:"center",children:[(0,a.jsx)(em.P,{fontSize:"24px",lineHeight:"32px",fontWeight:"500",mr:2,children:(0,a.jsx)(v.sA,{id:"collective.address.label",defaultMessage:"Address"})}),(0,a.jsx)(em.L9,{mr:2,lineHeight:"0",children:(0,a.jsx)(ty.A,{className:"text-muted-foreground"})}),(0,a.jsx)(eM.A,{my:"16px",borderColor:"black.300",width:"100%"})]}),(0,a.jsxs)(eu.A,{type:"info",children:[(0,a.jsx)("h1",{className:"font-bold",children:(0,a.jsx)(v.sA,{defaultMessage:"Address Requirement",id:"Mc7YHZ"})}),(0,a.jsx)("p",{children:g?(0,a.jsx)(v.sA,{defaultMessage:"{isSelfHosted, select, true {{collectiveName}} other {{hostLink}, the legal entity that provides {collectiveName} with financial services,}} requires your legal address for legal and compliance purposes.",id:"address.requirement.noThreshold",values:{collectiveName:l.name,hostName:l.host.name,hostLink:(0,a.jsx)(er.A,{href:`/${l.host.slug}`,children:l.host.name}),isSelfHosted:l.id===l.host.id}}):(0,a.jsx)(v.sA,{defaultMessage:"Your total contributions in the current fiscal year to {isSelfHosted, select, true {{collectiveName}} other {{hostLink}, the legal entity that provides {collectiveName} with financial services,}} exceeds {amount}. Therefore, {hostName} requires your legal address.",id:"/Lrubf",values:{amount:(0,E.vv)(l.policies.CONTRIBUTOR_INFO_THRESHOLDS.address,l.currency),collectiveName:l.name,hostName:l.host.name,hostLink:(0,a.jsx)(er.A,{href:`/${l.host.slug}`,children:l.host.name}),isSelfHosted:l.id===l.host.id}})}),(0,a.jsx)("p",{className:"mt-2",children:(0,a.jsx)(v.sA,{defaultMessage:"<PrivacyPolicyLink>Read our privacy policy</PrivacyPolicyLink>.",id:"ReadOurPrivacyPolicy",values:{PrivacyPolicyLink:(0,ea.lv)({href:"/privacypolicy",openInNewTab:!0,as:er.A})}})})]}),(0,a.jsx)(tb.A,{autoDetectCountry:!0,location:s?.location,onChange:e=>u("location",e),labelFontSize:"16px",labelFontWeight:"700"})]}),(0,et.AO)()&&(0,a.jsx)(ei.so,{justifyContent:"center",children:(0,a.jsx)(et.Ay,{onVerify:e=>u("captcha",e)})}),(0,a.jsx)(em.P,{color:"black.500",fontSize:"12px","data-cy":"join-conditions",children:(0,a.jsx)(v.sA,{defaultMessage:"By contributing, you agree to our <TOSLink>Terms of Service</TOSLink> and <PrivacyPolicyLink>Privacy Policy</PrivacyPolicyLink>.",id:"Amj+Gh",values:ea.Ay})})]})};
362var tj=s(83968),tT=s(89021),tS=s(84550);let{ORGANIZATION:tC,COLLECTIVE:tI,FUND:tN,EVENT:tP,PROJECT:tw,INDIVIDUAL:tM}=N.Td,tE=(e,t,s)=>{let i=e.value;return(0,a.jsxs)(ei.so,{alignItems:"center",children:[(0,a.jsx)(eI.Ay,{collective:i,radius:32}),(0,a.jsxs)(tR,{flexDirection:"column",ml:3,children:[(0,a.jsx)(em.L9,{fontSize:"14px",fontWeight:"500",lineHeight:"20px",color:"black.900",children:i.isIncognito?s.formatMessage({id:"profile.incognito",defaultMessage:"Incognito"}):(0,eC.A)(i.name,{length:40})}),i.isIncognito?(0,a.jsx)(em.L9,{fontSize:"12px",lineHeight:"18px",color:"black.700",children:(0,a.jsx)(v.sA,{defaultMessage:"Private contribution - Check privacy box for info",id:"104ECN"})}):(0,a.jsxs)(em.L9,{fontSize:"12px",lineHeight:"18px",color:"black.700",children:[i.type===N.Td.INDIVIDUAL&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(v.sA,{id:"ContributionFlow.PersonalProfile",defaultMessage:"Personal profile"})," - "]}),i.slug?`@${i.slug}`:i.email||""]})]})]})},tO=({profiles:e,tier:t,selectedProfile:s,onChange:i})=>{let n=[(0,v.tz)(),e,t],o=r.useMemo(()=>((e,t,s)=>{let i=e=>({[tS.Wy]:!0,value:e.account,label:e.account.name}),n=e=>(0,tj.A)(e,"value.name"),a=t.map(i),r=(0,tT.A)(a,e=>e.value.type),o=r[tM]||[],l=n(r[tC]||[]);!t.some(e=>e.account.type===N.Td.INDIVIDUAL&&e.account.isIncognito)&&(0,ej.Le)(s)&&o.push(i({account:{id:ej.BZ,type:N.Td.INDIVIDUAL,isIncognito:!0,name:e.formatMessage({id:"profile.incognito",defaultMessage:"Incognito"})}})),l.push({label:e.formatMessage({id:"organization.create",defaultMessage:"Create Organization"}),value:null,isDisabled:!0,[tS.rK]:!0,types:[N.Td.ORGANIZATION],__background__:"white"});let c=[{options:o,label:e.formatMessage({defaultMessage:"Myself",id:"YjO/0+"})},{options:l,label:e.formatMessage({id:"organization",defaultMessage:"My Organizations"})}];return r[tI]?.length&&c.push({options:n(r[tI]),label:e.formatMessage({id:"collective",defaultMessage:"My Collectives"})}),r[tN]?.length&&c.push({options:n(r[tN]),label:e.formatMessage({id:"funds",defaultMessage:"My Funds"})}),r[tw]?.length&&c.push({options:n(r[tw]),label:e.formatMessage({defaultMessage:"My Projects",id:"FVO2wx"})}),r[tP]?.length&&c.push({options:n(r[tP]),label:e.formatMessage({id:"events",defaultMessage:"My Events"})}),c})(...n),n);return(0,a.jsx)(tS.Ay,{"data-cy":"contribute-profile-picker",inputId:"contribute-profile-picker",collective:s,addLoggedInUserAsAdmin:!0,options:o,isSearchable:e.length>8,creatable:!0,excludeAdminFields:!0,types:[N.Td.ORGANIZATION],formatOptionLabel:tE,onChange:({value:e})=>i(e),styles:{menu:{borderRadius:"16px"},menuList:{padding:"8px"},control:{padding:"14px 16px",borderRadius:"8px"}}})};var tR=(0,j.Ay)(ei.so).withConfig({componentId:"sc-34757ee3-0"})({whiteSpace:"initial"});let t_=({profiles:e,onChange:t,collective:s,tier:i,data:n,stepDetails:o})=>{let l=r.useMemo(()=>((e,t)=>{if(!e?.isIncognito)return{name:e?.name||"",legalName:e?.legalName||"",location:e?.location||{}};{let s=e.location||{},i=!s.address&&!s.country&&!s.structured;return{name:"",legalName:e.legalName??(t[0].legalName||t[0].name||""),location:(i?t[0].location:e.location)||{}}}})(n,e),[n,e]),c=r.useMemo(()=>(0,ej.C)(n,o,s,e,i),[n,o,e,s,i]),d=i?.type===_.Y.TICKET||i?.requireAddress||!s.policies.CONTRIBUTOR_INFO_THRESHOLDS?.legalName,u=i?.type===_.Y.TICKET||i?.requireAddress||!s.policies.CONTRIBUTOR_INFO_THRESHOLDS?.address;return(0,a.jsx)(r.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)(eu.A,{type:"info",children:[(0,a.jsx)("h1",{className:"font-bold",children:(0,a.jsx)(v.sA,{defaultMessage:"Privacy Information",id:"AyQ5sz"})}),(0,a.jsx)("p",{children:(0,a.jsx)(v.sA,{defaultMessage:"When you contribute to {collectiveName}, your email address will be shared with its administrators.{isSelfHosted, select, false { It will also be shared with {hostName}, the legal entity that provides {collectiveName} with financial services and will be receiving this contribution on their behalf.} other {}}",id:"iVRVyA",values:{collectiveName:s.name,hostName:(0,a.jsx)(er.A,{href:`/${s.host.slug}`,children:s.host.name}),isSelfHosted:s.id===s.host.id}})}),(0,a.jsx)("p",{className:"mt-2",children:(0,a.jsx)(v.sA,{defaultMessage:"<PrivacyPolicyLink>Read our privacy policy</PrivacyPolicyLink>.",id:"ReadOurPrivacyPolicy",values:{PrivacyPolicyLink:(0,ea.lv)({href:"/privacypolicy",openInNewTab:!0,as:er.A})}})})]}),(0,a.jsx)(tO,{profiles:e,tier:i,selectedProfile:n,onChange:e=>t({stepProfile:e,stepPayment:null})}),c.legalName&&(0,a.jsxs)(r.Fragment,{children:[!n?.isIncognito&&(0,a.jsx)(eB.A,{htmlFor:"name",label:(0,a.jsx)(v.sA,{defaultMessage:"Your name",id:"vlKhIl"}),labelFontSize:"16px",labelFontWeight:"700",hint:(0,a.jsx)(v.sA,{defaultMessage:"This is your display name or alias.",id:"kFLEBd"}),children:e=>(0,a.jsx)(e0.A,{...e,"data-cy":"input-name",value:l.name,placeholder:"Thomas Anderson",onChange:e=>t({stepProfile:{...n,name:e.target.value}}),maxLength:"255"})}),(0,a.jsx)(eB.A,{htmlFor:"legalName",label:(0,a.jsx)(v.sA,{defaultMessage:"Legal name",id:"OozR1Y"}),required:!l.name||c.legalName,hideOptionalLabel:c.legalName,labelFontSize:"16px",labelFontWeight:"700",isPrivate:!0,hint:d?(0,a.jsx)(v.sA,{defaultMessage:"Required by {isSelfHosted, select, true {{collectiveName}} other {{hostName}}} for legal and compliance purposes.",id:"legalName.hint.noThreshold",values:{hostName:s.host.name,collectiveName:s.name,isSelfHosted:s.id===s.host.id}}):(0,a.jsx)(v.sA,{defaultMessage:"Required by {isSelfHosted, select, true {{collectiveName}} other {{hostName}, the legal entity that provides {collectiveName} with financial services,}} as total contributions in the current fiscal year exceeds {amount}.",id:"0FWFFg",values:{amount:(0,E.vv)(s.policies.CONTRIBUTOR_INFO_THRESHOLDS.legalName,s.currency),hostName:s.host.name,collectiveName:s.name,isSelfHosted:s.id===s.host.id}}),children:e=>(0,a.jsx)(e0.A,{...e,"data-cy":"input-legalName",value:l.legalName,placeholder:l.name,onChange:e=>t({stepProfile:{...n,legalName:e.target.value}}),maxLength:"255"})})]}),c.address&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(ei.so,{alignItems:"center",mt:2,children:[(0,a.jsx)(em.P,{fontSize:"24px",lineHeight:"32px",fontWeight:"500",mr:2,children:(0,a.jsx)(v.sA,{id:"collective.address.label",defaultMessage:"Address"})}),(0,a.jsx)(em.L9,{mr:2,lineHeight:"0",children:(0,a.jsx)(ty.A,{})}),(0,a.jsx)(eM.A,{my:"16px",borderColor:"black.300",width:"100%"})]}),(0,a.jsxs)(eu.A,{type:"info",children:[(0,a.jsx)("h1",{className:"font-bold",children:(0,a.jsx)(v.sA,{defaultMessage:"Address Requirement",id:"Mc7YHZ"})}),(0,a.jsx)("p",{children:u?(0,a.jsx)(v.sA,{defaultMessage:"{isSelfHosted, select, true {{collectiveName}} other {{hostLink}, the legal entity that provides {collectiveName} with financial services,}} requires your legal address for legal and compliance purposes.",id:"address.requirement.noThreshold",values:{collectiveName:s.name,hostName:s.host.name,hostLink:(0,a.jsx)(er.A,{href:`/${s.host.slug}`,children:s.host.name}),isSelfHosted:s.id===s.host.id}}):(0,a.jsx)(v.sA,{defaultMessage:"Your total contributions in the current fiscal year to {isSelfHosted, select, true {{collectiveName}} other {{hostLink}, the legal entity that provides {collectiveName} with financial services,}} exceeds {amount}. Therefore, {hostName} requires your legal address.",id:"/Lrubf",values:{amount:(0,E.vv)(s.policies.CONTRIBUTOR_INFO_THRESHOLDS.address,s.currency),collectiveName:s.name,hostName:s.host.name,hostLink:(0,a.jsx)(er.A,{href:`/${s.host.slug}`,children:s.host.name}),isSelfHosted:s.id===s.host.id}})}),(0,a.jsx)("p",{className:"mt-2",children:(0,a.jsx)(v.sA,{defaultMessage:"<PrivacyPolicyLink>Read our privacy policy</PrivacyPolicyLink>.",id:"ReadOurPrivacyPolicy",values:{PrivacyPolicyLink:(0,ea.lv)({href:"/privacypolicy",openInNewTab:!0,as:er.A})}})})]}),(0,a.jsx)(tb.A,{autoDetectCountry:!0,location:l.location,onChange:e=>t({stepProfile:{...n,location:e}}),labelFontSize:"16px",labelFontWeight:"700"})]})]})})},tk=({collective:e,tier:t,stepDetails:s,profiles:i,onChange:n,data:r,onSignInClick:o,isEmbed:l})=>{let{LoggedInUser:c}=(0,eL.A)();return(0,a.jsx)(ei.az,{width:1,children:c?(0,a.jsx)(t_,{profiles:i,onChange:n,collective:e,tier:t,data:r,stepDetails:s}
362):(0,a.jsx)(tv,{stepDetails:s,data:r,collective:e,onChange:n,onSignInClick:o,isEmbed:l,tier:t})})};var tL=s(37701),tF=s(16750),tD=s(92850),tU=s(23968),tz=s(38605);let tB=new Set([M.GG.PREPAID,M.GG.COLLECTIVE]);var tH=s(21057),t$=s(61270);let tq=j.I4.div.attrs({"data-cy":"ContributionSummary-AmountLine"}).withConfig({componentId:"sc-d3002b92-0"})(["display:flex;justify-content:space-between;font-weight:400;padding:7px 0;line-height:18px;color:#4e5052;"," ",""],tU.yW,tU.Il),tW=(0,j.I4)(em.L9).attrs(e=>({fontWeight:e.fontWeight??400})).withConfig({componentId:"sc-d3002b92-1"})(["margin-right:4px;color:inherit;flex:0 1 70%;margin-right:8px;word-break:break-word;",""],tU.Uu),tG=(0,j.I4)(em.L9).withConfig({componentId:"sc-d3002b92-2"})(["flex:1 1 30%;text-align:right;"]),tV=({collective:e,stepDetails:t,stepSummary:s,stepPayment:i,currency:n,tier:o,renderTax:l})=>{let c=(0,v.tz)(),u=t.amount,p=(0,ej.dv)(t,s),h=((e,t,s)=>{let i={fee:0,feePercent:0,isExact:!1};if(!e)return i;let n=e.sourcePaymentMethod||e,a=n.balance?.currency||e.balance?.currency;if(n.type===M.GG.CREDITCARD){let e=.029;if("EUR"===a)e=.014;else if(!a){let t=(0,x.A)(n,"data.country");t&&(0,d.isMemberOfTheEuropeanUnion)(t)&&(e=.014)}let i=t*e+30;return{name:"Stripe",fee:i,feePercent:i/t*100,aboutURL:"https://stripe.com/pricing",isExact:a===s}}if(tB.has(n.type))return{...i,isExact:!0};if(n.service===M.ju.PAYPAL){let e=.039*t+30;return{name:"PayPal",fee:e,feePercent:e/t*100,isExact:!1,aboutURL:"https://www.paypal.com/webapps/mpp/paypal-fees"}}return i})(i?.paymentMethod,p,n),m=(0,x.A)(t,"platformTip",0),g=t.quantity>1||["TICKET","PRODUCT"].includes(o?.type),f=o?.name?`${e.name} - "${o.name}"`:e.name;return(0,a.jsxs)(es.A,{"data-cy":"contribution-summary",children:[(0,a.jsxs)(r.Fragment,{children:[g&&(0,a.jsxs)(tq,{color:"black.700",children:[(0,a.jsx)(tW,{children:(0,a.jsx)(v.sA,{id:"contribution.quantity",defaultMessage:"Quantity"})}),(0,a.jsx)(tG,{children:t.quantity})]}),(0,a.jsxs)(tq,{color:"black.700",children:[(0,a.jsx)(tW,{children:(0,a.jsx)(v.sA,{id:"ContributionToProject",defaultMessage:"Contribution to {projectName}",values:{projectName:f}})}),(0,a.jsx)(tG,{children:(0,a.jsx)(eV.A,{amount:u||0,currency:n})})]}),!!s?.taxType&&(l?l({AmountLine:tq,Amount:tG,Label:tW}):(0,a.jsxs)(tq,{color:"black.700",children:[(0,a.jsxs)(tW,{children:[(0,tH.k)(c,s.taxType)," ",s.percentage,"%"]}),(0,a.jsx)(tG,{children:(0,a.jsx)(eV.A,{amount:s.amount,currency:n})})]})),!!m&&(0,a.jsxs)(tq,{color:"black.700",children:[(0,a.jsx)(tW,{children:(0,a.jsx)(v.sA,{defaultMessage:"Contribution to the Platform",id:"platformTip.summaryLabel"})}),(0,a.jsx)(tG,{"data-cy":"ContributionSummary-Tip",children:(0,a.jsx)(eV.A,{amount:m,currency:n})})]})]}),(0,a.jsx)(eM.A,{borderColor:"black.500",my:1}),(0,a.jsxs)(tq,{color:"black.800",fontWeight:"500",children:[(0,a.jsx)(tW,{fontWeight:"500",children:t.interval&&t.interval!==P.Ay.oneTime?t.interval===P.Ay.year?(0,a.jsx)(v.sA,{id:"YearlyCharge",defaultMessage:"Yearly charge"}):(0,a.jsx)(v.sA,{id:"MonthlyCharge",defaultMessage:"Monthly charge"}):(0,a.jsx)(v.sA,{id:"TotalCharge",defaultMessage:"Total charge"})}),(0,a.jsx)(tG,{fontWeight:"700","data-cy":"ContributionSummary-TodaysCharge",children:(0,a.jsx)(eV.A,{amount:p,currency:n})})]}),!!h.fee&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(tq,{color:"black.700",children:[(0,a.jsx)(tW,{children:h.name?(0,a.jsx)(v.sA,{id:"PaymentProviderFees.Label",defaultMessage:"{isExact, select, false {Estimated } other {}}{providerName} fees",values:{providerName:h.name,isExact:h.isExact}}):(0,a.jsx)(v.sA,{id:"contribution.paymentFee",defaultMessage:"Payment processor fee"})}),(0,a.jsxs)(tG,{children:[!h.isExact&&(0,a.jsx)(ei.az,{display:"inline-block",mr:1,verticalAlign:"text-bottom",children:(0,a.jsx)(t$.A,{verticalAlign:"top",content:(0,a.jsxs)(em.L9,{children:[(0,a.jsx)(v.sA,{id:"Fees.ApproximationDisclaimer",defaultMessage:"This amount can vary due to currency exchange rates or depending on the selected service."}),h.aboutURL&&(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("br",{}),(0,a.jsx)(eo.A,{href:h.aboutURL,openInNewTab:!0,children:(0,a.jsx)(v.sA,{id:"LearnMoreAboutServiceFees",defaultMessage:"Learn more about {service} fees",values:{service:h.name}})})]})]}),children:(0,a.jsx)(tD.d,{size:"16px",color:"#76777A"})})}),(0,a.jsx)(eV.A,{amount:h.fee||null,currency:n})]})]}),(0,a.jsxs)(tq,{color:"black.700",children:[(0,a.jsx)(tW,{children:(0,a.jsx)(v.sA,{id:"NetAmountFor",defaultMessage:"Net amount for {name}",values:{name:e.name}})}),(0,a.jsxs)(tG,{children:[!h.isExact&&(0,a.jsx)(ei.az,{display:"inline-block",mr:1,verticalAlign:"text-bottom",children:(0,a.jsx)(t$.A,{verticalAlign:"top",content:(0,a.jsx)(v.sA,{defaultMessage:"Net Amount = Total charge - Payment processor fee - Platform tip",id:"netAmountFormula"}),children:(0,a.jsx)(tD.d,{size:"16px",color:"#76777A"})})}),(0,a.jsx)(eV.A,{amount:p-h.fee-m,currency:n})]})]})]}),(0,a.jsx)(eM.A,{borderColor:"black.500",my:1}),t.interval&&t.interval!==P.Ay.oneTime&&(0,a.jsx)(es.A,{color:"black.800",fontSize:"12px",mt:3,children:!i||i.isKeyOnly?(0,a.jsx)(v.sA,{id:"ContributionSummary.NextCharge",defaultMessage:"If you select PayPal, you will be charged on the same day each month. Otherwise the next charge will be on {date} and then the first day of {interval, select, month {each month} year {the same month each year} other {}}. You can cancel or edit this contribution by going to 'Manage Contributions'.",values:{date:(0,a.jsx)(v.XU,{value:(0,tz.yv)(new Date,t.interval),day:"numeric",month:"long",year:"numeric"}),interval:t.interval}}):(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(v.sA,{id:"withColon",defaultMessage:"{item}:",values:{item:(0,a.jsx)(v.sA,{defaultMessage:"Next charge date",id:"1u4k2w"})}})," ",(0,a.jsx)(v.XU,{value:(0,tz.yv)(new Date,t.interval,i?.paymentMethod?.service),day:"numeric",month:"long",year:"numeric"}),(0,a.jsx)(ei.az,{display:"inline-block",ml:1,verticalAlign:"text-bottom",children:(0,a.jsx)(t$.A,{verticalAlign:"top",content:(0,a.jsx)(v.sA,{id:"ContributionSummary.NextCharge",defaultMessage:"If you select PayPal, you will be charged on the same day each month. Otherwise the next charge will be on {date} and then the first day of {interval, select, month {each month} year {the same month each year} other {}}. You can cancel or edit this contribution by going to 'Manage Contributions'.",values:{date:(0,a.jsx)(v.XU,{value:(0,tz.yv)(new Date,t.interval),day:"numeric",month:"long",year:"numeric"}),interval:t.interval}}),children:(0,a.jsx)(tD.d,{size:"15px",color:"#76777A"})})})]})})]})},tK=(0,j.I4)(es.A).attrs({display:"inline-block",borderBottom:"1px dashed",borderColor:"black.400",fontSize:"13px",color:"black.500",cursor:"pointer",mb:2}).withConfig({componentId:"sc-37231b52-0"})([""]),tY=(e,t,s,i,n,a)=>({...t,taxType:e[0]?.type,percentage:n,amount:Math.round(s*i*(n/100)),isReady:!!(!a&&s&&(0,x.A)(t,"countryISO"))}),tQ=(e,t,s,i,n)=>{if(e.some(({type:e})=>e===d.TaxType.VAT)){let e=(0,d.getVatOriginCountry)(t,s,i);return(0,d.getVatPercentage)(t,e,(0,x.A)(n,"countryISO"),(0,x.A)(n,"number"))}return e.some(({type:e})=>e===d.TaxType.GST)?(0,d.getGstPercentage)(t,s,(0,x.A)(n,"countryISO")):0},tX={dropdownIndicator:{paddingTop:0,paddingBottom:0},option:{fontSize:"12px",color:"red"},control:{minHeight:"32px"}},tJ=({AmountLine:e,Amount:t,Label:s,currency:i,taxInfo:n,dispatchChange:r,setFormState:o,formState:l})=>{let c=n.number&&n.isReady,u=(0,a.jsx)(v.sA,{id:"tax.vatShort",defaultMessage:"VAT"});return(0,a.jsxs)(e,{my:3,children:[(0,a.jsxs)(ei.so,{flexDirection:"column",children:[(0,a.jsxs)(ei.so,{alignItems:"center",flexWrap:"wrap",children:[(0,a.jsx)(s,{mr:2,flex:"1 1 auto",whiteSpace:"nowrap",children:u}),(0,a.jsx)(ei.az,{flex:"1 1 180px",children:(0,a.jsx)(tF.A,{inputId:"step-summary-location",minWidth:100,maxWidth:190,maxMenuHeight:150,onChange:e=>r({countryISO:e,number:null}),value:n.countryISO,error:!n.countryISO,styles:tX,fontSize:"12px",autoDetect:!0})})]}),n.countryISO&&(0,a.jsxs)(ei.az,{mt:2,children:[c&&!l.isEnabled?(0,a.jsxs)(ei.so,{children:[(0,a.jsx)(em.L9,{mr:3,children:n.number}),(0,a.jsx)(tK,{onClick:()=>{o({isEnabled:!0,error:!1}),r(null,!0)},children:(0,a.jsx)(v.sA,{id:"contribute.changeTaxNumber",defaultMessage:"Change {taxName} number",values:{taxName:u}})})]}):(0,a.jsx)(tK,{onClick:()=>{l.isEnabled||(o({isEnabled:!0,error:!1}),r(null,!0))},children:(0,a.jsx)(v.sA,{id:"contribute.enterTaxNumber",defaultMessage:"Enter {taxName} number (if you have one)",values:{taxName:u}})}),l.isEnabled&&(0,a.jsxs)(ei.so,{flexDirection:"column",className:"cf-tax-form",children:[(0,a.jsxs)(es.A,{display:"flex",alignItems:"center",ml:[null,null,"-24px"],children:[(0,a.jsx)(tL.b,{"data-cy":"remove-vat-btn",size:16,color:"#333333",cursor:"pointer","aria-label":"Remove",onClick:()=>{o({isEnabled:!1,error:!1}),r({number:null},!1)}}),(0,a.jsx)(e0.A,{value:n.number||"",name:"taxIdNumber",mx:[1,2],px:2,py:1,autoFocus:!0,fontSize:"13px",required:!0,maxWidth:180,error:l.error,onBlur:e=>{let t=e.target.value,s=!1,i=(0,d.checkVATNumberFormat)(t);i.isValid?(0,x.A)(i,"country.isoCode.short")!==n.countryISO&&(s="bad_country"):(i=(0,d.checkVATNumberFormat)(`${n.countryISO}${t}`)).isValid||(s="invalid");let a=s?t:i.value,l=!!s;o({isEnabled:!0,error:s}),r({number:a},l)},onChange:e=>{o({isEnabled:!0,error:!1}),r({number:e.target.value})}}),(0,a.jsx)(ev.A,{buttonSize:"tiny",disabled:l.error,onClick:()=>{o({isEnabled:!1})},children:(0,a.jsx)(v.sA,{id:"save",defaultMessage:"Save"})})]}),"invalid"===l.error&&(0,a.jsx)(em.L9,{mt:1,fontSize:"12px",color:"red.500",children:(0,a.jsx)(v.sA,{id:"contribute.taxInfoInvalid",defaultMessage:"Invalid {taxName} number",values:{taxName:u}})}),"bad_country"===l.error&&(0,a.jsx)(em.L9,{mt:1,fontSize:"12px",color:"red.500",children:(0,a.jsx)(v.sA,{id:"contribute.vatBadCountry",defaultMessage:"The 
362VAT number doesn't match the country"})})]})]})]}),(0,a.jsx)(t,{pt:2,ml:2,"data-cy":"VAT-amount",color:"black.700",fontWeight:400,children:(0,a.jsx)(eV.A,{amount:n.amount,currency:i})})]})},tZ=({AmountLine:e,Amount:t,Label:s,currency:i,taxInfo:n,dispatchChange:r})=>{let o=(0,a.jsx)(v.sA,{id:"tax.gstShort",defaultMessage:"GST"});return(0,a.jsxs)(e,{my:3,children:[(0,a.jsx)(ei.so,{flexDirection:"column",width:"100%",children:(0,a.jsxs)(ei.so,{alignItems:"center",flexWrap:"wrap",children:[(0,a.jsx)(s,{mr:2,flex:"0 1 30px",whiteSpace:"nowrap",children:o}),(0,a.jsx)(ei.az,{flex:"1 1 auto",children:(0,a.jsx)(tF.A,{inputId:"step-summary-location",minWidth:100,maxWidth:190,maxMenuHeight:150,value:n.countryISO,error:!n.countryISO,styles:tX,fontSize:"12px",autoDetect:!0,onChange:e=>r({countryISO:e,number:null})})})]})}),(0,a.jsx)(t,{pt:2,ml:2,"data-cy":"GST-amount",color:"black.700",fontWeight:400,children:(0,a.jsx)(eV.A,{amount:n.amount,currency:i})})]})},t0=({stepProfile:e,stepDetails:t,collective:s,stepPayment:i,applyTaxes:n,taxes:o,data:l,onChange:c,tier:u})=>{let{amount:p,quantity:h}=t,m=u?.type,f=(0,x.A)(s.host,"location.country"),y=s.location?.country||(0,x.A)(s.parent,"location.country"),b=u?.amount.currency||s.currency,[A,v]=(0,r.useState)({isEnabled:!1,error:!1}),j=tQ(o,m,f,y,l),T=tY(o,l,p,h,j,A.isEnabled),S=null;n&&p>0&&T.taxType&&(T.taxType===d.TaxType.VAT?S=tJ:T.taxType===d.TaxType.GST&&(S=tZ));let C=(e,t)=>{if(c){let s={...T,...e},i=tQ(o,m,f,y,s);return c({stepSummary:tY(o,s,p,h,i,void 0===t?A.isEnabled:t)})}};return(0,r.useEffect)(()=>{(0,g.A)(o)?l?.isReady||c({stepSummary:{isReady:!0}}):C({countryISO:l?.countryISO||(0,x.A)(e,"location.country"),number:l?.number||(0,x.A)(e,"settings.VAT.number")})},[o]),(0,a.jsx)(ei.az,{width:"100%",px:[0,null,null,2],children:(0,a.jsx)(tV,{collective:s,stepDetails:t,stepSummary:l,stepPayment:i,currency:b,tier:u,renderTax:S&&(({Amount:e,Label:t,AmountLine:s})=>(0,a.jsx)(S,{currency:b,dispatchChange:C,setFormState:v,formState:A,taxInfo:T,Amount:e,Label:t,AmountLine:s}))})})};class t1 extends r.Component{static{this.propTypes={intl:l().object,LoggedInUser:l().object,collective:l().object,contributorProfiles:l().arrayOf(l().object),tier:l().object,onChange:l().func,showPlatformTip:l().bool,isOscTipExperiment:l().bool,onNewCardFormReady:l().func,onSignInClick:l().func,isEmbed:l().bool,disabledPaymentMethodTypes:l().array,isSubmitting:l().bool,hideCreditCardPostalCode:l().bool,taxes:l().array,step:l().shape({name:l().string}),mainState:l().shape({stepDetails:l().object,stepProfile:l().shape({contributorRejectedCategories:l().array}),stepSummary:l().object,stepPayment:l().object})}}constructor(e){super(e),this.renderHeader=(e,t)=>{let{intl:s}=this.props;return"profile"!==e||t?"payment"===e&&this.props.mainState.stepProfile.contributorRejectedCategories?s.formatMessage(this.headerMessages.blockedContributor):this.headerMessages[e]?s.formatMessage(this.headerMessages[e]):e:s.formatMessage(this.headerMessages["profile.guest"])},this.renderStep=e=>{let{collective:t,mainState:s,tier:i,isEmbed:n,showPlatformTip:r,isOscTipExperiment:o}=this.props,{stepProfile:l,stepDetails:c,stepSummary:d,stepPayment:u}=s;switch(e){case"details":return(0,a.jsx)(te,{collective:t,tier:i,onChange:this.props.onChange,stepDetails:c,stepPayment:u,showPlatformTip:r,isOscTipExperiment:o});case"profile":return(0,a.jsx)(tk,{profiles:this.props.contributorProfiles,collective:t,tier:i,stepDetails:c,onChange:this.props.onChange,data:l,onSignInClick:this.props.onSignInClick,isEmbed:n});case"payment":return(0,a.jsx)(tf,{collective:this.props.collective,showPlatformTip:this.props.showPlatformTip,isOscTipExperiment:this.props.isOscTipExperiment,stepDetails:this.props.mainState.stepDetails,stepProfile:this.props.mainState.stepProfile,stepSummary:this.props.mainState.stepSummary,onChange:this.props.onChange,stepPayment:u,onNewCardFormReady:this.props.onNewCardFormReady,isSubmitting:this.props.isSubmitting,isEmbed:n,disabledPaymentMethodTypes:this.props.disabledPaymentMethodTypes,hideCreditCardPostalCode:this.props.hideCreditCardPostalCode||!!t.settings?.hideCredit
362CardPostalCode});case"summary":return(0,a.jsx)(t0,{collective:t,tier:i,stepProfile:l,stepDetails:c,stepPayment:u,data:d,onChange:this.props.onChange,taxes:this.props.taxes,applyTaxes:!0});default:return null}},this.headerMessages=(0,v.YK)({details:{id:"NewContributionFlow.ContributionDetailsTitle",defaultMessage:"Contribution details"},profile:{id:"contribute.step.contributeAs",defaultMessage:"Contribute as"},"profile.guest":{id:"NewContributionFlow.step.contributeAsGuest",defaultMessage:"Contribute as a guest"},payment:{id:"NewContributionFlow.ChoosePaymentMethod",defaultMessage:"Choose payment method"},summary:{id:"Summary",defaultMessage:"Summary"},blockedContributor:{id:"NewContributionFlow.BlockedContributor.Header",defaultMessage:"Unable to contribute"}})}render(){let{LoggedInUser:e,step:t,isEmbed:s,showPlatformTip:i}=this.props,{tier:n,collective:r,mainState:o}=this.props,{stepDetails:l}=o,c=n?.amount.currency||r.currency,d=(l.amount||0)*(l.quantity||1);return(0,a.jsxs)(ei.az,{children:[(0,a.jsx)(ew.A,{p:[16,32],mx:[16,"none"],borderRadius:15,children:(0,a.jsxs)(ei.so,{flexDirection:"column",alignItems:"center",children:["checkout"!==t.name&&(0,a.jsxs)(ei.so,{width:"100%",mb:3,alignItems:"center",children:[(0,a.jsx)(ei.so,{alignItems:"center",children:(0,a.jsx)(em.H4,{fontSize:["20px","24px"],fontWeight:500,py:2,children:this.renderHeader(t.name,e)})}),(0,a.jsx)(ei.so,{flexGrow:1,alignItems:"center",justifyContent:"center",children:(0,a.jsx)(eM.A,{width:"100%",ml:3,borderColor:"black.300"})}),!s&&(0,a.jsx)(ei.az,{ml:2,children:(0,a.jsx)(ek,{})})]}),this.renderStep(t.name)]})}),i&&(l.isNewPlatformTip?(0,a.jsx)(eE.e,{step:t.name,collectiveName:r.name,amount:d,currency:c,selectedOption:l.platformTipOption,value:l.platformTip,onChange:(e,t)=>
362{this.props.onChange({stepDetails:{...l,platformTip:t,platformTipOption:e}})}}):(0,a.jsx)(eO.u,{step:t.name,amount:d,currency:c,selectedOption:l.platformTipOption,value:l.platformTip,onChange:(e,t)=>{this.props.onChange({stepDetails:{...l,platformTip:t,platformTipOption:e}})}}))]})}}let t2=(0,Z.A)((0,eg.Cb)(t1));var t4=s(37788),t3=s(90220);let t5=(0,j.I4)(em.L9).withConfig({componentId:"sc-74b8531b-0"})(["text-transform:uppercase;text-align:center;font-weight:500;font-size:14px;line-height:16px;letter-spacing:0.06em;margin-top:8px;margin-bottom:4px;"]),t6=({stepDetails:e,currency:t,isFreeTier:s})=>{if(e.amount){let s=(0,x.A)(e,"amount",0)+(0,x.A)(e,"platformTip",0);return(0,a.jsx)(eV.A,{interval:e.interval,currency:t,amount:s,abbreviateInterval:!0})}return 0===e.amount&&s?(0,a.jsx)(v.sA,{id:"Amount.Free",defaultMessage:"Free"}):null},t9=({step:e,stepProfile:t,stepDetails:s,stepPayment:i,stepSummary:n,isFreeTier:o,currency:l})=>{if(e.name===ey.UT.PROFILE){if(t){let e=t.id&&t.name||(t.email??t.name),s=[t.name,t.email].filter(Boolean).join(" \xb7 ");return(0,a.jsx)(t8,{title:s,fontSize:"inherit",lineHeight:"inherit",truncateOverflow:!0,children:e})}}else if(e.name===ey.UT.DETAILS){if(s)return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(t6,{stepDetails:s,currency:l,isFreeTier:o}),!isNaN(s.quantity)&&s.quantity>1&&` x ${s.quantity}`]})}else if(e.name===ey.UT.PAYMENT)if(o&&0===(0,ej.dv)(s,n))return(0,a.jsx)(v.sA,{id:"noPaymentRequired",defaultMessage:"No payment required"});else if(i?.key===ej.om)return(0,a.jsx)(v.sA,{id:"contribute.newcreditcard",defaultMessage:"New credit/debit card"});else return i?.paymentMethod&&(0,t4.jR)(i.paymentMethod)||null;else if(e.name===ey.UT.SUMMARY)return n?.countryISO||null;return null},t7=({stepProfile:e,stepDetails:t,stepPayment:s,stepSummary:i,isSubmitted:n,loading:r,steps:o,currentStep:l,lastVisitedStep:c,goToStep:d,currency:u,isFreeTier:p})=>(0,a.jsx)(t3.A,{steps:o,focus:l,allCompleted:n,onStepSelect:r||n?void 0:d,loadingStep:r?l:void 0,disabledStepNames:o.slice(c.index+1,o.length).map(e=>e.name),children:({step:n})=>(0,a.jsxs)(ei.so,{flexDirection:"column",alignItems:"center",children:[(0,a.jsx)(t5,{color:l.name===n.name?"primary.600":"black.700",children:n.label||n.name}),(0,a.jsx)(es.A,{fontSize:"13px",lineHeight:"20px",textAlign:"center",wordBreak:"break-word",children:n.isVisited&&(0,a.jsx)(t9,{step:n,stepProfile:e,stepDetails:t,stepPayment:s,stepSummary:i,isFreeTier:p,currency:u})})]})});var t8=(0,j.I4)(em.P).withConfig({componentId:"sc-74b8531b-1"})({maxWidth:150}),se=s(47509),st=s(6636),ss=s(17460),si=s(36559),sn=s(87480),sa=s(90354),sr=s(87278),so=s(49294),sl=s(1509),sc=s(80207),sd=s(64177),su=s(46525),sp=s(72240);let sh=(0,j.I4)(es.A).withConfig({componentId:"sc-ba487ac7-0"})(["display:flex;flex-direction:column;background:",";border:1px solid ",";border-radius:10px;"],(0,tn.y)("colors.white.full"),(0,tn.y)("colors.black.400")),sm=(0,G.J1)`
363  mutation NewContributionFlowEditPublicMessage(
364    $fromAccount: AccountReferenceInput!
365    $toAccount: AccountReferenceInput!
366    $message: String
367  ) {
368    editPublicMessage(fromAccount: $fromAccount, toAccount: $toAccount, message: $message) {
369      id
370      publicMessage
371    }
372  }
373`,sg=(0,v.YK)({publicMessagePlaceholder:{id:"contribute.publicMessage.placeholder",defaultMessage:"Motivate others to contribute in 140 characters :) ..."}}),sf=({order:e,publicMessage:t})=>{let s=(0,v.tz)(),i=e.toAccount,n=e.fromAccount,[o,l]=r.useState(!0),[c]=(0,sd.n)(sm),d=async e=>{let{publicMessage:t}=e;await c({variables:{fromAccount:{id:n.id},toAccount:{id:i.id},message:t}}).then(()=>{l(!0),(0,sp.p)(3e3)})};return(0,a.jsx)(sh,{width:[1,"400px"],flexShrink:1,height:112,mt:2,children:(0,a.jsx)(su.l1,{initialValues:{publicMessage:t||""},onSubmit:d,children:e=>{let{values:t,handleSubmit:i,isSubmitting:r,dirty:c}=e;return(0,a.jsxs)(su.lV,{children:[(0,a.jsx)(eB.A,{name:"publicMessage",htmlFor:"publicMessage",disabled:r,children:i=>(0,a.jsx)(su.D0,{as:e5.A,...i,resize:"none",border:"none",withOutline:!1,maxLength:140,minHeight:75,fontSize:"14px",value:t.publicMessage,placeholder:s.formatMessage(sg.publicMessagePlaceholder),onChange:t=>{e.setFieldValue("publicMessage",t.target.value),o&&l(!1)}})}),(0,a.jsxs)(ei.so,{flexGrow:1,mt:1,px:3,justifyContent:"space-between",children:[(0,a.jsxs)(ei.so,{alignItems:"center",justifyContent:"flex-start",minWidth:0,mr:1,children:[(0,a.jsx)(eI.Ay,{collective:n,radius:24}),(0,a.jsxs)(ei.so,{flexDirection:"column",ml:2,children:[(0,a.jsx)(em.P,{fontSize:"10px",children:(0,a.jsx)(v.sA,{id:"contribute.publicMessage.postingAs",defaultMessage:"Posting as"})}),(0,a.jsx)(ei.az,{minWidth:0,children:(0,a.jsx)(em.P,{fontSize:"12px",truncateOverflow:!0,title:n.name,children:(0,eC.A)(n.name,{length:25}
373)})})]})]}),(0,a.jsx)(ei.so,{alignItems:"center",justifyContent:"flex-end",children:(0,a.jsx)(ev.A,{buttonSize:"tiny",loading:r,type:"submit",onSubmit:i,disabled:o,children:o&&c?(0,a.jsx)(v.sA,{id:"saved",defaultMessage:"Saved"}):(0,a.jsx)(v.sA,{id:"contribute.publicMessage.post",defaultMessage:"Post message"})})})]})]})}})})};var sx=s(45333),sy=s(74143);let sb=(0,eg.Cb)(({contribution:e,...t})=>{let s=e.toAccount,i=e.status===st.w.PENDING,n={[st.w.PENDING]:(0,a.jsx)(v.sA,{id:"ExpectedFunds",defaultMessage:"Expected Funds"}),[st.w.PROCESSING]:(0,a.jsx)(v.sA,{id:"NewContributionFlow.ProcessingContribution",defaultMessage:"Processing Payment"})};return(0,a.jsx)(sx.A,{...t,collective:s,tag:n[e.status]?(0,a.jsx)(sy.A,{display:"inline-block",textTransform:"uppercase",my:2,type:"warning",children:n[e.status]}):null,bodyHeight:306,children:(0,a.jsxs)(ei.so,{flexDirection:"column",flexGrow:1,justifyContent:"space-around",children:[(0,a.jsx)(ei.az,{px:3,children:(0,a.jsx)(em.P,{fontSize:"14px",lineHeight:"20px",fontWeight:"400",color:"black.900",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.NumberOfFinancialContributors",defaultMessage:"{contributors} financial contributors",values:{contributors:(0,a.jsx)("span",{style:{color:"black.900"},children:(0,a.jsx)("b",{children:s.stats?.contributorsCount||1})})}})})}),(0,a.jsx)(eM.A,{width:"100%",mt:3}),(0,a.jsxs)(es.A,{display:"flex",flexDirection:"column",height:150,flexGrow:+!!i,justifyContent:"center",px:3,children:[(0,a.jsxs)(ei.az,{mb:3,children:[(0,a.jsx)(em.P,{textTransform:"uppercase",fontSize:"11px",lineHeight:"14px",fontWeight:"400",color:"black.700",mb:1,children:(0,a.jsx)(v.sA,{id:"membership.totalDonations.title",defaultMessage:"Amount contributed"})}),(0,a.jsxs)(ei.so,{flexWrap:"wrap",gridGap:"4px",children:[(0,a.jsx)(em.P,{fontSize:"14px",lineHeight:"20px",fontWeight:"bold",children:(0,a.jsx)(eV.A,{amount:(0,m.A)(e.platformTipAmount?.valueInCents)?e.amount.valueInCents:e.amount.valueInCents+e.platformTipAmount.valueInCents,currency:e.amount.currency,frequency:e.frequency})}),!!e.platformTipAmount?.valueInCents&&(0,a.jsx)(t$.A,{content:()=>(0,a.jsx)(v.sA,{id:"Subscriptions.FeesOnTopTooltip",defaultMessage:"Contribution plus Platform Tip"}),children:(0,a.jsxs)(em.P,{display:"flex",fontSize:"12px",lineHeight:"20px",color:"black.700",children:["(",(0,a.jsx)(eV.A,{amount:e.amount.valueInCents,currency:e.amount.currency,showCurrencyCode:!1,precision:2}),(0,a.jsx)(em.L9,{mx:"1px",children:" + "}),(0,a.jsx)(eV.A,{amount:e.platformTipAmount.valueInCents,currency:e.amount.currency,showCurrencyCode:!1,precision:2}),")"]})})]})]}),(0,a.jsxs)(ei.az,{mb:3,children:[(0,a.jsx)(em.P,{textTransform:"uppercase",fontSize:"11px",lineHeight:"14px",fontWeight:"400",color:"black.700",mb:1,children:(0,a.jsx)(v.sA,{id:"To",defaultMessage:"To"})}),(0,a.jsx)(em.P,{fontSize:"13px",fontWeight:"bold",color:"black.900",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.CollectiveAndTier",defaultMessage:"{collective} - {tier}",values:{collective:s.name,tier:(0,F.ZH)(e.tier?.name)||(0,a.jsx)(v.sA,{id:"Contributor",defaultMessage:"Contributor"})}})})]})]})]})})});var sA=s(26385);let sv="NEWSLETTER",sj="BLOG",sT="JOIN",sS="SIGN_IN",sC="GO_TO_PROFILE",sI=(0,v.YK)({[sT]:{id:"collective.create.join",defaultMessage:"Join Open Collective"},[sS]:{id:"signIn",defaultMessage:"Sign In"},[sj]:{id:"ReadOurStories",defaultMessage:"Read our stories"},[sv]:{id:"NewContributionFlow.Success.CTA.Newsletter.Header",defaultMessage:"Subscribe to the Open{nbsp}Collective newsletter"},[sC]:{defaultMessage:"Go to {accountName}'s page",id:"iPy92R"}}),sN=(0,v.YK)({[sT]:{id:"NewContributionFlow.Success.CTA.Join.Content",defaultMessage:"Create an account and show all your contributions."},[sS]:{id:"NewContributionFlow.Success.CTA.SignIn.Content",defaultMessage:"Sign in with your Open Collective account to edit your profile and manage your contributions."},[sj]:{id:"NewContributionFlow.Success.CTA.Read.Content",defaultMessage:"Open Collective aims to foster transparency and sustainability in communities around the world. Here's how y
373ou can participate."},[sv]:{id:"home.joinUsSection.weNeedUpdate",defaultMessage:"We send updates once a month."},[sC]:{defaultMessage:"Go to the public page of {accountName} on Open Collective",id:"/aBz/1"}}),sP=(0,j.Ay)(es.A).withConfig({componentId:"sc-6c406400-0"})(["display:flex;justify-content:space-between;border:1px solid ",";border-radius:10px;background-color:white;"," ",""],(0,tn.y)("colors.black.400"),e=>e.$isPrimary&&(0,j.AH)(["border:1px solid ",";h3,span{color:",";word-break:break-word;}"],(0,tn.y)("colors.primary.500"),(0,tn.y)("colors.primary.800")),e=>e.hoverable&&(0,j.AH)(["&:hover{border:1px solid ",";cursor:pointer;h3,span{color:",";}}"],(0,tn.y)("colors.primary.500"),(0,tn.y)("colors.primary.800"))),sw=({type:e,email:t,account:s,...i})=>{switch(e){case sT:return(0,a.jsx)(eo.A,{as:er.A,display:"block","data-cy":"join-opencollective-link",href:{pathname:"/signup",query:{email:t}},color:"black.800",...i});case sS:return(0,a.jsx)(eo.A,{as:er.A,display:"block",color:"black.800","data-cy":"success-signin-link",href:{pathname:"/signin",query:{email:t}},...i});case sj:return(0,a.jsx)(eo.A,{href:"https://blog.opencollective.com",openInNewTab:!0,color:"black.800",...i});case sC:return(0,a.jsx)(eo.A,{as:er.A,href:(0,J.bl)(s),color:"black.800",...i});default:return(0,a.jsx)(r.Fragment,{...i})}},sM=({type:e,email:t,account:s,isPrimary:i})=>{let{formatMessage:n}=(0,v.tz)(),o=e===sv;return(0,a.jsx)(es.A,{px:[3,0],my:3,maxWidth:600,children:(0,a.jsx)(sw,{account:s,type:e,email:t,children:(0,a.jsxs)(sP,{px:4,py:2,hoverable:!o,$isPrimary:i,children:[(0,a.jsxs)(ei.so,{flexDirection:"column",alignItems:"left",justifyContent:"center",width:[o?1:.8,.8],my:3,children:[(0,a.jsx)(em.H3,{mb:3,color:"black.800",children:n(sI[e],{accountName:s.name,nbsp:(0,a.jsx)(r.Fragment,{children:"\xa0"})})}),(0,a.jsx)(em.P,{fontSize:"14px",lineHeight:"24px",fontWeight:300,color:"black.700",children:n(sN[e],{accountName:s.name})}),o&&(0,a.jsx)(ei.az,{mt:2,children:(0,a.jsx)(sA.A,{defaultEmail:t})})]}),!o&&(0,a.jsx)(ei.so,{alignItems:"center",justifyContent:"center",children:(0,a.jsx)(em.L9,{fontSize:40,children:"→"})})]})})})},sE=(0,j.I4)(eo.A).attrs({buttonStyle:"standard",buttonSize:"small",minWidth:130,target:"_blank"}).withConfig({componentId:"sc-ccb250ff-0"})(["display:flex;justify-content:center;align-items:center;svg{margin-right:8px;}"]),sO=(0,v.YK)({default:{id:"order.created.tweet",defaultMessage:"I've just contributed to {collective}. Consider supporting them too — every little helps!"},event:{id:"order.created.tweet.event",defaultMessage:"I'm attending {event}. Join me!"}}),sR=e=>e&&(e.tags?.includes("mastodon")||e.tags?.includes("fediverse")||(e.socialLinks||[]).map(e=>e.type).includes("MASTODON"));class s_ extends r.Component{async componentDidMount(){if(this.trackSuccess(),this.props.router.query.payment_intent_client_secret){let e=await (0,Y.C)(null,this.props.router.query.stripeAccount),t=await e.retrievePaymentIntent(this.props.router.query.payment_intent_client_secret);this.setState({paymentIntentResult:t})}this.setState({loaded:!0})}componentDidUpdate(){let{router:{query:e},data:{order:t},intl:s,LoggedInUser:i}=this.props;this.trackSuccess(),i&&t&&t.status!==st.w.PENDING&&!this.state?.surveyShown&&(this.setState({surveyShown:!0}),(0,sc.o)({message:(0,a.jsx)(sr.BN,{surveyKey:sr.JJ.CONTRIBUTION_COMPLETED}),duration:2e4}));let n=this.state?.paymentIntentResult;if(t&&n){let i=n.error?n.error.message:["succeeded","processing"].includes(n.paymentIntent.status)?null:n.paymentIntent.last_payment_error?.message??s.formatMessage({defaultMessage:"An unknown error has occurred",id:"UZEPLR"});if(i){let s=t.tier?.slug,n=new URL(s?`/${t.toAccount.slug}/contribute/${s}-${t.tier.legacyId}/checkout/payment`:`/${t.toAccount.slug}/donate/payment`,window.location.origin);n.searchParams.set("error",i),n.searchParams.set("interval",(0,P.WE)(t.frequency)),n.searchParams.set("amount",t.amount.value.toString()),n.searchParams.set("contributeAs",t.fromAccount.slug),e.redirect&&!Array.isArray(e.redirect)&&(n.searchParams.set("redirect",e.redirect),n.searchParams.set("shouldRedirectParent",(0,F.RR)(e.shouldRedirectParent)?"true":"false")),this.props.router.push(n.toString());return}}t&&e.redirect&&(0,ee.isValidExternalRedirect)(e.redirect)&&(0,J.jp)(this.props.router,this.props.collective,t,e.redirect,{shouldRedirectParent:(0,F.RR)(e.shouldRedirectParent)})}trackSuccess(){if(this.state?.successTracked)return;let e=this.props.data?.order;e&&((0,S.u)(T.X.CONTRIBUTION_SUCCESS,{props:{[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:e.data?.isNewPlatformTipFlow?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:!!e.platformTipEligible,[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:H(e.toAccount,e.tier),[C.CONTRIBUTION_HOST_SLUG]:(0,x.A)(e,"toAccount.host.slug")}}),this.setState({successTracked:!0}))}renderPendingView(){let{data:e}=this.props,{order:t}=e,s=t.manualPaymentProvider,i=t.amount.valueInCents,n=t.platformTipAmount.valueInCents,r=t.amount.currency,o=s&&(0,sa.w)(s);return(0,a.jsxs)("div",{className:"relative isolate flex min-h-[calc(100vh-64px)] w-full flex-col items-center justify-center","data-cy":"order-success",children:[(0,a.jsx)("div",{className:"absolute inset-0 -z-10 bg-[url('/static/images/new-contribution-flow/NewContributionFlowSuccessPageBackgroun
373dMobile.png')] bg-cover bg-no-repeat lg:bg-[url('/static/images/new-contribution-flow/NewContributionFlowSuccessPageBackgroundDesktop.png')] lg:bg-cover lg:bg-[position:0%_0%] xl:bg-[position:0%_-60vw] xl:bg-repeat"}),(0,a.jsxs)("div",{className:"flex w-full max-w-xl flex-col items-center px-4 py-6 lg:py-12",children:[(0,a.jsxs)("div",{className:"mb-5 w-full overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-lg",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center border-b border-gray-100 bg-gray-50 px-6 py-6",children:[(0,a.jsx)(eI.Ay,{className:"mb-3",collective:t.toAccount,radius:64}),(0,a.jsx)("h1",{className:"mb-1 text-center text-xl font-bold text-gray-900 sm:text-2xl",children:(0,a.jsx)(v.sA,{defaultMessage:"Contribution request received",id:"pd8V15"})}),(0,a.jsx)("p",{className:"mb-4 text-center text-sm text-gray-600",children:(0,a.jsx)(v.sA,{defaultMessage:"Please follow the instructions below to complete your payment. These instructions have also been sent to your email. We’ll notify you once your contribution has been received, processed, and credited to {collective}.",id:"n5a/81",values:{collective:(0,a.jsx)("strong",{children:t.toAccount.name})}})})]}),s&&(0,a.jsxs)("div",{className:"px-2 py-8 sm:px-4 lg:px-6",children:[(0,a.jsxs)("div",{className:"mb-5 flex w-full flex-col items-center gap-1 px-1 lg:flex-row lg:justify-between",children:[(0,a.jsx)("h2",{className:"flex items-center text-lg font-semibold text-gray-900",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.PaymentInstructions",defaultMessage:"Payment instructions"})}),(0,a.jsxs)(so.E,{children:[(0,a.jsx)(o,{className:"mr-1 h-4 w-4"})," ",(0,a.jsx)("span",{children:s.name})]})]}),(0,a.jsx)("div",{children:(0,a.jsx)(sn.q,{instructions:s.instructions,values:{amount:{valueInCents:i+n,currency:r},collectiveSlug:(0,x.A)(e,"order.toAccount.slug",""),OrderId:(0,x.A)(e,"order.legacyId",0),accountDetails:s.accountDetails}})})]})]}),(0,a.jsx)("div",{className:"mt-6 flex justify-center",children:(0,a.jsx)(er.A,{href:(0,J.bl)(t.toAccount),children:(0,a.jsxs)(sl.$n,{variant:"secondary",children:[(0,a.jsx)(v.sA,{id:"NewContributionFlow.Pending.VisitCollective",defaultMessage:"Visit {collective}'s page",values:{collective:t.toAccount.name}}),(0,a.jsx)("span",{children:"→"})]})})})]})]})}render(){var e,t,s;let i,{LoggedInUser:n,collective:o,data:l,isEmbed:c}=this.props,{order:d}=l,u=`${(0,F.$x)()}/${o.slug}`,p=d?.status===st.w.PROCESSING,h=d?.status===st.w.PENDING&&!d.paymentMethod,m=l.loading||!this.state?.loaded;return l.loading||d?!m&&h?this.renderPendingView():(0,a.jsxs)(r.Fragment,{children:[!c&&p&&(0,a.jsxs)("div",{className:"flex h-[120px] flex-col items-center justify-center bg-[#FFFFC2] text-[#0C2D66]",children:[(0,a.jsx)("p",{className:"text-sm leading-5 font-bold",children:(0,a.jsx)(v.sA,{defaultMessage:"Your Contribution is processing!",id:"RTyy4V"})}),(0,a.jsx)("div",{className:"mt-1 max-w-[672px]",children:(0,a.jsx)("p",{className:"text-center text-sm leading-5 font-normal",children:(0,a.jsx)(v.sA,{defaultMessage:"Your contribution will remain in processing state until it is completed from the payment processor's end. You will receive an email when it goes through successfully. No further action is required from your end.",id:"R1RQBD"})})}),(0,a.jsx)(eo.A,{href:`${(0,J.bl)(d.fromAccount)}/transactions`,className:"mt-1 text-sm leading-5 font-bold text-[#0C2D66] underline",children:(0,a.jsx)(v.sA,{defaultMessage:"View Contribution!",id:"zG2d9i"})})]}),(0,a.jsx)("div",{className:"flex h-full min-h-[calc(100vh-64px)] w-full flex-col md:justify-center lg:flex-row","data-cy":"order-success",children:m?(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(ed.A,{})}):(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)("div",{className:"relative flex w-full shrink-0 items-center justify-center max-lg:mb-4 lg:w-1/2","data-cy":`contribution-id-${d.legacyId}`,children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-[url('/static/images/new-contribution-flow/NewContributionFlowSuccessPageBackgroundMobile.png')] bg-[length:100%_auto] bg-top bg-no-repeat lg:bg-[url('/static/images/new-contribution-flow/NewContributionFlowSuccessPageBackgroun
373dDesktop.png')] lg:bg-cover lg:bg-left lg:bg-no-repeat"}),(0,a.jsxs)("div",{className:"relative z-10 my-4 flex w-full flex-col items-center justify-center",children:[(0,a.jsx)("h3",{className:"mb-4 text-3xl font-bold",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.Success.Header",defaultMessage:"Thank you! \uD83C\uDF89"})}),(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)("p",{className:"text-center text-xl font-medium text-gray-700",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.Success.NowSupporting",defaultMessage:"You are now supporting <link>{collective}</link>.",values:{collective:d.toAccount.name,link:c?ea.UW:(0,ea.lv)({href:(0,J.bl)(d.toAccount),as:er.A})}})})}),c?(0,a.jsx)(sb,{width:250,height:380,contribution:d,my:2,useLink:!1}):(0,a.jsx)(eo.A,{as:er.A,color:"black.800",href:(0,J.bl)(d.toAccount),children:(0,a.jsx)(sb,{width:250,height:380,contribution:d,my:2,useLink:!1})}),!c&&(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(er.A,{href:{pathname:"/search",query:{show:(e=d.toAccount,e.host?.slug==="opensource"||e.tags?.includes("open source")?"open source":e.tags?.includes("covid-19")?"covid-19":void 0)}},children:(0,a.jsxs)("p",{className:"text-center font-medium text-gray-800",children:[(0,a.jsx)(v.sA,{id:"NewContributionFlow.Success.DiscoverMore",defaultMessage:"Discover more Collectives like {collective}",values:{collective:d.toAccount.name}}),"\xa0→"]})})}),(0,a.jsx)("div",{className:"my-3 flex max-w-[500px] flex-wrap justify-center",children:(t=d.toAccount,s=this.getShareSuccessMessage(),i=[...t?.socialLinks||[],...t?.parent?.socialLinks||[]],(sR(t)||sR(t?.parent))&&i.push({type:V._xK.MASTODON}),(0,se.A)(i,"type").map(e=>((e,t,s)=>{switch(e){case V._xK.TWITTER:return{name:"X",Icon:(0,ss.G)(V._xK.TWITTER),url:(0,J.Zz)({url:t,text:s})};case V._xK.MASTODON:return{name:"Mastodon",Icon:(0,ss.G)(V._xK.MASTODON),url:(0,J.cw)({text:`${s} ${t}`})};case V._xK.BLUESKY:return{name:"Bluesky",Icon:(0,ss.G)(V._xK.BLUESKY),url:(0,J._z)({text:`${s} ${t}`})};case V._xK.LINKEDIN:return{name:"Linkedin",Icon:(0,ss.G)(V._xK.LINKEDIN),url:(0,J.Nf)({text:`${s} ${t}`})};case V._xK.THREADS:return{name:"Threads",Icon:(0,ss.G)(V._xK.THREADS),url:(0,J.MQ)({text:`${s} ${t}`})};default:return null}})(e.type,u,s)).filter(Boolean)).map(e=>(0,a.jsxs)(sE,{href:e.url,className:"mx-2 mb-2",children:[(0,a.jsx)(e.Icon,{size:16}),(0,a.jsx)(v.sA,{defaultMessage:"Share on {serviceName}",id:"45jyHl",values:{serviceName:e.name}})]},e.url))}),n&&(0,a.jsx)("div",{className:"px-1",children:(0,a.jsx)(sf,{order:d,publicMessage:(0,x.A)(d,"membership.publicMessage")})})]})]}),(0,a.jsx)("div",{className:"z-10 flex w-full flex-col items-center justify-center px-3 shadow-[0_-35px_5px_0px_#fff] sm:sh
373adow-[-15px_0_15px_-15px_#fff]",children:this.renderCallsToAction()})]})})]}):(0,a.jsx)("div",{className:"flex justify-center py-5 sm:py-6",children:(0,a.jsx)(eu.A,{type:"warning",withIcon:!0,children:(0,a.jsx)(v.sA,{id:"Order.NotFound",defaultMessage:"This contribution doesn't exist"})})})}constructor(...e){super(...e),this.state={paymentIntentResult:null,loaded:!1,surveyShown:!1,successTracked:!1},this.getEmailFromQueryParams=()=>{let{router:e}=this.props,t=e.query.email;return(Array.isArray(t)?t[0]:t)??null},this.renderCallsToAction=()=>{let{LoggedInUser:e,data:t,isEmbed:s}=this.props,i=[],n=(0,x.A)(t,"order.fromAccount.isGuest"),r=this.getEmailFromQueryParams();return s||(e?i.unshift(sC,sj,sv):n?i.unshift(sT,sC,sv):i.unshift(sS,sC,sv)),(0,a.jsxs)("div",{className:"flex flex-col justify-center p-2",children:[i.length>=2&&(0,a.jsx)("div",{className:"mx-auto mb-4 max-w-full",children:(0,a.jsx)(si.A,{alt:"",width:216,height:152,src:"/static/images/success-illustration.jpg"})}),i.map((e,s)=>(0,a.jsx)(sM,{type:e,email:r,account:(0,x.A)(t,"order.toAccount"),isPrimary:0===s},e))]})},this.getShareSuccessMessage=()=>{let e=this.props.data?.order?.toAccount;return e?this.props.intl.formatMessage("EVENT"===e.type?sO.event:sO.default,{collective:e.name,event:e.name}):null}}}let sk=(0,G.J1)`
374  query NewContributionFlowOrderSuccess($order: OrderReferenceInput!) {
375    order(order: $order) {
376      id
377      ...OrderSuccessFragment
378    }
379  }
380  ${ef.oW}
381`,sL=(0,c.U)(sk,{options:e=>({variables:{order:{id:e.router.query.OrderId}}})}),sF=(0,A.withRouter)(sL((0,Z.A)((0,eg.Cb)(s_))));var sD=s(82393),sU=s(5592);let sz=j.I4.div.withConfig({componentId:"sc-8837b27-0"})(["border-radius:8px;background-color:",";border:1px solid ",";padding:16px 12px;width:100%;"],(0,tn.y)("colors.blue.50"),(0,tn.y)("colors.blue.600")),sB=(0,j.I4)(sU.u).withConfig({componentId:"sc-8837b27-1"})(["color:",";"],(0,tn.y)("colors.blue.500")),sH=()=>(0,a.jsx)(sz,{children:(0,a.jsxs)(ei.so,{alignItems:"center",children:[(0,a.jsx)(ei.az,{children:(0,a.jsx)(sB,{size:30})}),(0,a.jsxs)(ei.so,{flexDirection:"column",ml:22,children:[(0,a.jsx)(em.P,{fontWeight:"bold",fontSize:"12px",lineHeight:"20px",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.ProtectTransactionTitle",defaultMessage:"We protect your transaction:"})}),(0,a.jsx)(em.P,{fontSize:"12px",lineHeight:"18px",fontWeight:"500",children:(0,a.jsx)(v.sA,{id:"NewContributionFlow.ProtectTransactionDetails",defaultMessage:"Open Collective keeps your transaction safe. <link>Learn more</link>.",values:{link:(0,ea.lv)({href:"https://documentation.opencollective.com/advanced/security-for-accounts",openInNewTab:!0})}})})]})]})});var s$=s(266);let sq=({onCancel:e,...t})=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(ev.A,{type:"button",isBorderless:!0,buttonStyle:"secondary",mb:3,onClick:e,children:["←"," ",(0,a.jsx)(v.sA,{id:"ContributionFlow.goBackToGuest",defaultMessage:"Go back to contribute as a guest"})]}),(0,a.jsx)(s$.A,{...t,defaultForm:"signin",createProfileLabels:{personal:(0,a.jsx)(v.sA,{id:"ContributionFlow.CreateUserLabel",defaultMessage:"Contribute as an individual"}),organization:(0,a.jsx)(v.sA,{id:"ContributionFlow.CreateOrganizationLabel",defaultMessage:"Contribute as an organization"})}})]}),sW=(0,j.I4)(ei.az).withConfig({componentId:"sc-d0767e4c-0"})(["min-height:120px;max-width:450px;@media screen and (max-width:640px){width:100%;max-width:100%;}"]),sG=(0,v.YK)({profile:{id:"menu.profile",defaultMessage:"Profile"},details:{id:"Details",defaultMessage:"Details"},payment:{id:"contribute.step.payment",defaultMessage:"Payment info"},summary:{id:"Summary",defaultMessage:"Summary"}}),sV=(0,v.YK)({tipAmountContributionWarning:{id:"Warning.TipAmountContributionWarning",defaultMessage:"You are about to make a contribution of {contributionAmount} to {accountName} that includes a {tipAmount} tip to the Open Collective platform. The tip amount looks unusually high.{newLine}{newLine}Are you sure you want to do this?"},pastEventWarning:{id:"Warning.PastEvent",defaultMessage:"You're contributing to a past event."}});class sK extends r.Component{static{this.propTypes={collective:l().shape({slug:l().string.isRequired,name:l().string.isRequired,type:l().string.isRequired,currency:l().string.isRequired,platformContributionAvailable:l().bool,host:l().shape({slug:l().string,legacyId:l().number}),parent:l().shape({slug:l().string})}).isRequired,contributorProfiles:l().arrayOf(l().object),host:l().object.isRequired,tier:l().object,intl:l().object,createOrder:l().func.isRequired,confirmOrder:l().func.isRequired,loadingLoggedInUser:l().bool,isEmbed:l().bool,error:l().string,refetchLoggedInUser:l().func,LoggedInUser:l().object,createIncognitoProfile:l().func.isRequired,router:l().object,onStepChange:l().func,onSuccess:l().func}}constructor(e){super(e),this.updateRouteFromState=async()=>
381{if(this.state.isNavigating)return;let e=this.getCurrentStepName();if(e!==ey.UT.SUCCESS){let{stepDetails:t,stepProfile:s,stepPayment:i}=this.state,n=this.getQueryParams(),a=(0,sD.iQ)(this.props.LoggedInUser,n,t,s,i,this.props.isEmbed);if(!(0,p.A)(n,(0,h.A)(a,m.A))){let t=this.getRoute(e),s=this.getQueryHelper();this.setState({isNavigating:!0},async()=>{await this.props.router.replace({pathname:t,query:(0,h.A)(s.encode(a),m.A)},null,{scroll:!1,shallow:!0}),this.setState({isNavigating:!1})})}}},this._getQueryParams=(0,b.A)(e=>this.getQueryHelper().decode(e)),this.getQueryParams=()=>this._getQueryParams(this.props.router.query),this.submitOrder=async()=>{let e,t,{collective:s,host:i,tier:n}=this.props,{stepDetails:a,stepProfile:r,stepSummary:o}=this.state;this.setState({error:null,isSubmitting:!0}),r.isGuest?t=(0,ej.Cm)(r):e="string"==typeof r.id?{id:r.id}:{legacyId:r.id};let l=a.amount*a.quantity,c={[C.CONTRIBUTION_HAS_PLATFORM_TIP]:a.amount&&a.platformTip>0,[C.CONTRIBUTION_PLATFORM_TIP_PERCENTAGE]:l&&a.platformTip>0?a.platformTip/l:0,[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:a.isNewPlatformTip?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:this.canHavePlatformTips(),[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:this.isOscTipExperiment(),[C.CONTRIBUTION_HOST_SLUG]:this.props.collective?.host?.slug};(0,S.u)(T.X.CONTRIBUTION_SUBMITTED,{props:c});try{let l=!(0,ej.dv)(a,o)||(0,g.A)(this.getApplicableTaxes(s,i,n?.type)),c=await this.props.createOrder({variables:{order:{quantity:a.quantity,amount:{valueInCents:a.amount},frequency:(0,P.GC)(a.interval),guestInfo:t,fromAccount:e,fromAccountInfo:{location:(0,f.A)(r.location,["name","address","country","structured"]),legalName:r.legalName,name:r.name},toAccount:(0,f.A)(this.props.collective,["id"]),customData:a.customData,paymentMethod:await this.getPaymentMethod(),platformTipAmount:(0,ej.rW)(a.platformTip,void 0),tier:this.props.tier&&{legacyId:this.props.tier.legacyId},context:{isEmbed:this.props.isEmbed||!1,isNewPlatformTipFlow:a.isNewPlatformTip,platformTipOffered:this.canHavePlatformTips()},tags:this.getQueryParams().tags,taxes:l?null:[{type:o.taxType,amount:(0,ej.rW)(o.amount,0),country:o.countryISO,idNumber:o.number}]}}});return this.handleOrderResponse(c.data.createOrder,r.email)}catch(e){this.handleError(),this.showError((0,O.P1)(e))}},this.handleOrderResponse=async({order:e,stripeError:t,guestToken:s},i)=>{let{stepPayment:n}=this.state;if(s&&e&&(0,K.i)(i,e.id,s),n?.paymentMethod?.service===M.ju.STRIPE&&(n?.key===ej.S7||n.paymentMethod.type===M.GG.US_BANK_ACCOUNT||n.paymentMethod.type===M.GG.SEPA_DEBIT)){let{stripeData:t}=n,s=this.props.collective.parent?.slug?`${window.location.origin}/${this.props.collective.parent?.slug}/${(0,I.B9)(this.props.collective)}/${this.props.collective.slug}`:`${window.location.origin}/${this.props.collective.slug}`,i=new URL(`${s}/donate/success`);i.searchParams.set("OrderId",e.id),i.searchParams.set("stripeAccount",t?.stripe?.stripeAccount);let a=this.getQueryParams();a.redirect&&(i.searchParams.set("redirect",a.redirect),a.shouldRedirectParent&&i.searchParams.set("shouldRedirectParent",a.shouldRedirectParent));try{return await (0,Q.T)(t?.stripe,t?.paymentIntentClientSecret,{returnUrl:i.href,elements:t?.elements,type:n.paymentMethod?.type,paymentMethodId:n.paymentMethod?.data?.stripePaymentMethodId}),this.setState({isSubmitted:!0,isSubmitting:!1}),this.handleSuccess(e)}catch(e){this.setState({isSubmitting:!1,error:e.message,stepPayment:{...this.state.stepPayment,chargeAttempt:(this.state.stepPayment?.chargeAttempt||0)+1}})}}else if(t)return this.handleStripeError(e,t,i,s);else return this.handleSuccess(e)},this.handleError=e=>{(0,S.u)(T.X.CONTRIBUTION_ERROR),this.setState({isSubmitting:!1,error:e})},this.handleStripeError=async(e,t,s,i)=>{let{message:n,account:a,response:r}=t;if(r){if(r.paymentIntent){let t="alipay"===r.paymentIntent.allowed_source_types[0],n=await (0,Y.C)(null,a),o=t?await n.confirmAlipayPayment(r.paymentIntent.client_secret,{return_url:`${window.location.origin}/api/services/stripe/alipay/callback?OrderId=${e.id}`}):await n.handleCardAction(r.paymentIntent.client_secret);
381if(o.error)this.handleError(o.error.message);else if(o.paymentIntent&&"requires_confirmation"===o.paymentIntent.status){this.setState({isSubmitting:!0,error:null});try{let t=await this.props.confirmOrder({variables:{order:{id:e.id},guestToken:i}});return this.handleOrderResponse(t.data.confirmOrder,s)}catch(e){this.handleError(e.message)}}}}else this.handleError(n)},this.handleSuccess=async e=>{this.setState({isSubmitted:!0,isSubmitting:!1}),this.props.refetchLoggedInUser();let t=this.getQueryParams();if(this.props.onSuccess?.(e),(0,ee.isValidExternalRedirect)(t.redirect))(0,J.jp)(this.props.router,this.props.collective,e,t.redirect,{shouldRedirectParent:t.shouldRedirectParent});else{let t=this.state.stepProfile?.email;return this.pushStepRoute("success",{replace:!1,query:{OrderId:e.id,email:t}})}},this.showError=e=>{this.setState({error:e}),this.scrollToTop()},this.getPaymentMethod=async()=>{let{stepPayment:e,stripe:t,stripeElements:s}=this.state;if(!e?.paymentMethod)return null;let i=(0,f.A)(e.paymentMethod,["service","type","manualPaymentProvider"]);if(e.paymentMethod.id)i.id=e.paymentMethod.id;else if(e.key===ej.om){let n=s.getElement(u.CardElement),{token:a}=await t.createToken(n),r=(0,Y.P)(a);i.name=r.name,i.isSavedForLater=e.paymentMethod.isSavedForLater,i.creditCardInfo={token:r.token,...r.data}}else e.paymentMethod.service===M.ju.PAYPAL&&(i.paypalInfo=(0,f.A)(e.paymentMethod.paypalInfo,["token","data","orderId","subscriptionId"]),i.paypalInfo.subscriptionId&&(i.type=M.GG.SUBSCRIPTION));return(e.paymentMethod.type===M.GG.US_BANK_ACCOUNT||e.paymentMethod.type===M.GG.SEPA_DEBIT||e.paymentMethod.type===M.GG.BACS_DEBIT||e.paymentMethod.type===M.GG.PAYMENT_INTENT)&&(i.stripePaymentIntentId=e.paymentMethod.stripePaymentIntentId,i.isSavedForLater=e.paymentMethod.isSavedForLater),i},this.validateStepProfile=async e=>{let{stepProfile:t,stepDetails:s,error:i}=this.state;if(i&&this.setState({error:null}),!this.checkFormValidity())return!1;if(!t)return"prev"===e;if(t.isGuest)return(0,et.AO)()&&!t.captcha?(this.setState({error:this.props.intl.formatMessage({defaultMessage:"Captcha is required.",id:"Rpq6pU"})}),window.scrollTo(0,0),!1):tA(t,s,this.props.tier,this.props.collective);if("incognito"===t.id){this.setState({isSubmitting:!0});try{let{data:e}=await this.props.createIncognitoProfile(),t=e.createIncognitoProfile;await this.props.refetchLoggedInUser(),this.setState({stepProfile:t,isSubmitting:!1})}catch(e){return this.setState({error:e.message,isSubmitting:!1}),window.scrollTo(0,0),!1}}let n=this.getContributorRejectedCategories(t);return(0,g.A)(n)||this.setState({stepProfile:{...this.state.stepProfile,contributorRejectedCategories:n}}),!0},this.getContributorRejectedCategories=e=>{let t=(0,x.A)(this.props.collective,"settings.moderation.rejectedCategories",[]),s=(0,x.A)(e,"categories",[]);if(0===t.length||0===s.length)return[];let i=Object.keys(w.x).filter(e=>s.includes(e)||0!==(0,y.A)(w.x[e],s).length);return(0,y.A)(t,i)},this.onStepChange=async e=>{this.setState({showSignIn:!1}),this.state.error||(await this.pushStepRoute(e.name),this.props.onStepChange?.(e.name))},this.pushStepRoute=async(e,{query:t,replace:s=!1}={})=>{this.setState({error:null,isNavigating:!0});let{router:i}=this.props,n=this.getQueryParams(),a=this.getQueryHelper(),r=t||a.encode(n),o=this.getRoute("details"===e?"":e),l=s?i.replace:i.push;await l({pathname:o,query:(0,h.A)(r,e=>!e)},null,{shallow:!0}),this.setState({isNavigating:!1}),this.scrollToTop(),"success"===e&&this.setState({isSubmitted:!1,isSubmitting:!1,stepPayment:null})},this.getQueryHelper=()=>this.props.isEmbed?sD.H_:sD.__,this.getRoute=e=>{let{collective:t,tier:s,isEmbed:i,router:n}=this.props,a=n.query.verb||"donate",r=e&&e!==ey.UT.DETAILS?`/${e}`:"";if(i)if(s)return`/embed${(0,J.bl)(t)}/contribute/${s.slug}-${s.legacyId}${r}`;else return`/embed${(0,J.bl)(t)}/donate${r}`;if(s)if("TICKET"===s.type&&t.parent)return`${(0,J.bl)(t)}/order/${s.legacyId}${r}`;else return`${(0,J.bl)(t)}/contribute/${s.slug}-${s.legacyId}/checkout${r}`;return"contribute"===a||"new-contribute"===a?`${(0,J.bl)(t)}/donate${r}`:`${(0,J.bl)(t)}/${a}${r}`},this.getRedirectUrlForSignIn=()=>`${window.location.pathname}${window.location.search||""}`,this.scrollToTop=()=>{this.mainContainerRef.current?this.mainContainerRef.current.scrollIntoView({behavior:"smooth"}):window.scrollTo(0,0)},this.isFixedContribution=(0,b.A)(X.Tg),this.getTierMinAmount=(0,b.A)(X.jT),this.getApplicableTaxes=(0,b.A)(d.getApplicableTaxes),this.checkFormValidity=()=>(0,F.Jn)(this.formRef.current),this.getCurrentStepName=()=>this.props.router.query.step||ey.UT.DETAILS,this.mainContainerRef
381=r.createRef(),this.formRef=r.createRef();const{collective:t,tier:s,LoggedInUser:i}=e,n=this.getQueryParams(),a=s?.amount?.currency||t.currency,o=n.amount||(0,X.Cc)(s,t,a),l=n.quantity||1;this.platformTipDisabledByExperiment=z(t?.host)&&W(D.OPENSOURCE_PLATFORM_TIP_AB,i,{collective:t}),this.state={error:null,stripe:null,stripeElements:null,isSubmitted:!1,isSubmitting:!1,isInitializing:!0,isNavigating:!1,showSignIn:!1,createdOrder:null,forceSummaryStep:this.getCurrentStepName()!==ey.UT.DETAILS,stepProfile:this.getDefaultStepProfile(),stepPayment:{key:n.paymentMethod,isKeyOnly:!0},stepSummary:null,stepDetails:{quantity:l,interval:(0,ej.kZ)(t,s,i,n.interval)?n.interval:(0,X.Lj)(e.tier),amount:o,platformTip:this.canHavePlatformTips()?(0,E._1)(o*l*ey.dD,a):0,platformTipOption:eO.m.FIFTEEN_PERCENT,isNewPlatformTip:W(D.NEW_PLATFORM_TIP_FLOW,i,{collective:t}),currency:a}}}async componentDidMount(){!this.props.loadingLoggedInUser&&this.state.isInitializing&&(await this.updateRouteFromState(),this.setState({isInitializing:!1}));let e=this.getCurrentStepName();"success"!==e&&"details"!==e&&((0,S.u)(T.X.CONTRIBUTION_STARTED,{props:{[C.CONTRIBUTION_STEP]:this.getCurrentStepName(),[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:this.state.stepDetails.isNewPlatformTip?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:this.canHavePlatformTips(),[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:this.isOscTipExperiment(),[C.CONTRIBUTION_HOST_SLUG]:this.props.collective?.host?.slug}}),"details"!==e&&(0,S.u)(T.X.CONTRIBUTION_DETAILS_STEP_COMPLETED,{props:{[C.CONTRIBUTION_PLATFORM_TIP_VARIANT]:this.state.stepDetails.isNewPlatformTip?"new":"old",[C.CONTRIBUTION_PLATFORM_TIP_ENABLED]:this.canHavePlatformTips(),[C.CONTRIBUTION_IS_OSC_TIP_EXPERIMENT]:this.isOscTipExperiment(),[C.CONTRIBUTION_HOST_SLUG]:this.props.collective?.host?.slug}}))}async componentDidUpdate(e){if(e.LoggedInUser&&!this.props.LoggedInUser)this.setState({stepProfile:null,stepSummary:null,stepPayment:null}),this.pushStepRoute(ey.UT.PROFILE);else if(!e.LoggedInUser&&this.props.LoggedInUser||0===e.contributorProfiles.length&&this.props.contributorProfiles.length>0){if(this.setState({stepProfile:this.getDefaultStepProfile()}),this.state.stepProfile.isGuest){let e=this.state.stepProfile.email,t=this.getDefaultStepProfile(),s=e&&e!==t.email;this.setState({stepProfile:t,stepSummary:null,stepPayment:null}),s&&![ey.UT.DETAILS,ey.UT.PROFILE].includes(this.state.step)&&this.pushStepRoute(ey.UT.PROFILE)}}else e.loadingLoggedInUser&&!this.props.loadingLoggedInUser?this.setState({stepProfile:this.getDefaultStepProfile()}):!this.props.loadingLoggedInUser&&this.state.isInitializing&&(await this.updateRouteFromState(),this.setState({isInitializing:!1}))}getDefaultStepProfile(){let e,{contributorProfiles:t}=this.props,s=t||[],i=this.getQueryParams();return(i.contributeAs&&i.contributeAs!==ey.YP&&(e=i.contributeAs===ey.qo?s.find(({account:{isIncognito:e}})=>e):"me"===i.contributeAs?s.find(({account:{type:e}})=>e===V.COF.INDIVIDUAL):s.find(({account:{slug:e}})=>e===i.contributeAs)),e)?e.account:s[0]?.account?s[0].account:{isGuest:!0,email:i.email||"",name:i.name||"",legalName:i.legalName||""}}getEmailRedirectURL(){let e=window.location.pathname;return window.location.search?e+=window.location.search:e=`${e}?`,encodeURIComponent(e)}canHavePlatformTips(){return!this.platformTipDisabledByExperiment&&B(this.props.collective,this.props.tier)}isOscTipExperiment(){return H(this.props.collective,this.props.tier)}getSteps(){let{intl:e,collective:t,host:s,tier:i,LoggedInUser:n}=this.props,{stepDetails:a,stepProfile:r,stepPayment:o,stepSummary:l}=this.state,c=this.isFixedContribution(i),d=i?.amount.currency||t.currency,u=this.getTierMinAmount(i,d),p=0===u&&(c||a?.amount===0),h=!!(r&&n||r?.isGuest&&tA(r,a,i,t)),g=[{name:"details",label:e.formatMessage(sG.details),isCompleted:!!a,validate:()=>!!this.checkFormValidity()&&!!a&&!(a.amount<u)&&!!a.quantity&&(!!(0,m.A)(i?.availableQuantity)||!(a.quantity>i.availableQuantity))&&(!a.amount||!a.platformTip||!(a.platformTip/(a.amount*a.quantity)>=.5)||confirm(e.formatMessage(sV.tipAmountContributionWarning,{contributionAmount:(0,E.vv)((0,ej.dv)(a,l),d,{locale:e.locale}),tipAmount:(0,E.vv)(a.platformTip,d,{locale:e.locale}),accountName:t.name,newLine:"\n"})))},{name:"profile",label:e.formatMessage(sG.profile),isCompleted:h,validate:this.validateStepProfile}];return!p&&(this.getApplicableTaxes(t,s,i?.type).length||this.state.forceSummaryStep)&&g.push({name:"summary",label:e.formatMessage(sG.summary),isCompleted:(0,x.A)(l,"isReady",!1)}),p||g.push({name:"payment",label:e.formatMessage(sG.payment),isCompleted:!r?.contributorRejectedCategories&&o?.isCompleted,validate:t=>{if("prev"===t)return!0;{if(o?.isKeyOnly)return!1;if(o?.key===ej.S7)return o.isCompleted;let t=!!(p||o);return!r.captcha&&(0,et.AO)()&&!n&&o?.key===ej.om?(this.showError(e.formatMessage({defaultMessage:"Captcha is required.",id:"Rpq6pU"})),!1):t&&o?.key===ej.om?o.paymentMethod?.stripeData?.complete:t}}}),g}getPaypalButtonProps({currency:e}){let{stepPayment:t,stepDetails:s,stepSummary:i}=this.state;if(t?.paymentMethod?.service===M.ju.PAYPAL){let{host:t,collective:n,tier:a}=this.props;return{host:t,collective:n,tier:a,currency:e,style:{size:"responsive",height:47},totalAmount:(0,ej.dv)(s,i),interval:s?.interval,onClick:()=>this.setState({isSubmitting:!0}),onCancel:()=>this.setState({isSubmitting:!1}),onError:e=>this.setState({isSubmitting:!1,error:e.message}),onSuccess:e=>{this.setState(t=>({stepPayment:{...t.stepPayment,paymentMethod:{service:M.ju.PAYPAL,type:M.GG.PAYMENT,paypalInfo:e}}}),this.submitOrder)}}}}render(){let{collective:e,host:t,tier:s,LoggedInUser:i,loadingLoggedInUser:n,isEmbed:r,error:o}=this.props,{error:l,isSubmitted:c,isSubmitting:d,stepDetails:u,stepSummary:p,stepProfile:h,stepPayment:m}=this.state,g=c||d,f=e.type===N.Td.EVENT&&(0,R.r2)(e),x=this.getQueryParams(),y=s?.amount.currency||e.currency,b=this.getCurrentStepName();return b===ey.UT.SUCCESS?(0,a.jsx)(sF,{collective:e}):(0,a.jsx)(eh,{steps:this.getSteps(),currentStepName:b,onStepChange:this.onStepChange,onComplete:this.submitOrder,delayCompletionCheck:!!(n&&h),children:({steps:c,currentStep:d,lastVisitedStep:A,goNext:j,goBack:T,goToStep:S,prevStep:C,nextStep:I,isValidating:N,isValidStep:P})=>(0,a.jsxs)(es.A,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:[3,4,5],mb:4,"data-cy":"cf-content",ref:this.mainContainerRef,children:[!this.getQueryParams().hideHeader&&(0,a.jsx)(ei.az,{px:[2,3],mb:4,children:(0,a.jsx)(eP,{collective:e,isEmbed:r})}),!x.hideSteps&&(0,a.jsx)(sW,{mb:3,width:[1,.8],children:(0,a.jsx)(t7,{steps:c,currentStep:d,lastVisitedStep:A,goToStep:S,stepProfile:h,stepDetails:u,stepPayment:m,stepSummary:p,isSubmitted:this.state.isSubmitted,loading:N||g,currency:y,isFreeTier:0===this.getTierMinAmount(s,y)})}),d.name!==ey.UT.DETAILS&&n||!P?(0,a.jsx)(ei.az,{py:[4,5],children:(0,a.jsx)(ed.A,{})}):d.name===ey.UT.PROFILE&&!i&&this.state.showSignIn?(0,a.jsx)(sq,{defaultEmail:h?.email,redirect:this.getRedirectUrlForSignIn(),onCancel:()=>this.setState({showSignIn:!1})}):(0,a.jsxs)(ei.xA,{px:[2,3],gridTemplateColumns:["minmax(200px, 600px)",null,"0fr minmax(300px, 600px) 1fr","1fr minmax(300px, 600px) 1fr"],children:[(0,a.jsx)(ei.az,{}),(0,a.jsxs)(ei.az,{as:"form",ref:this.formRef,onSubmit:e=>e.preventDefault(),maxWidth:"100%",children:[(l||o)&&(0,a.jsx)(eu.A,{type:"error",withIcon:!0,mb:3,"data-cy":"contribution-flow-error",children:(0,O.NR)(this.props.intl,l)||o}),f&&(0,a.jsx)(eu.A,{type:"warning",withIcon:!0,mb:3,"data-cy":"contribution-flow-warning",children:this.props.intl.formatMessage(sV.pastEventWarning)}),(0,a.jsx)(t2,{collective:e,tier:s,mainState:this.state,onChange:e=>{e.stepPayment&&e.stepPayment.key!==this.state.stepPayment?.key?this.setState({...e,error:null},this.updateRouteFromState):this.setState(e,this.updateRouteFromState)},step:d,showPlatformTip:this.canHavePlatformTips(),isOscTipExperiment:this.isOscTipExperiment(),onNewCardFormReady:({stripe:e,stripeElements:t})=>this.setState({stripe:e,stripeElements:t}),taxes:this.getApplicableTaxes(e,t,s?.type),onSignInClick:()=>this.setState({showSignIn:!0}),isEmbed:r,isSubmitting:N||g,disabledPaymentMethodTypes:x.disabledPaymentMethodTypes,hideCredit
381CardPostalCode:x.hideCreditCardPostalCode,contributorProfiles:this.props.contributorProfiles}),(0,a.jsx)(ei.az,{mt:40,children:(0,a.jsx)(eS,{goNext:j,goBack:x.hideSteps&&d.name===ey.UT.PAYMENT?null:T,step:d,prevStep:C,nextStep:I,isValidating:N||g,paypalButtonProps:I?null:this.getPaypalButtonProps({currency:y}),currency:y,tier:s,stepDetails:u,stepSummary:p,disabled:this.state.isInitializing||this.state.isNavigating,showPlatformTip:this.canHavePlatformTips(),isOscTipExperiment:this.isOscTipExperiment(),hostSlug:this.props.collective?.host?.slug})}),!r&&(0,a.jsx)(ei.az,{textAlign:"center",mt:5,children:(0,a.jsx)(ex,{collective:e,useLink:!0,children:(0,a.jsx)(v.sA,{id:"ContributionFlow.backToCollectivePage",defaultMessage:"Back to {accountName}'s Page",values:{accountName:e.name}})})})]}),!x.hideFAQ&&(0,a.jsx)(ei.az,{minWidth:[null,"300px"],mt:[4,null,0],ml:[0,3,4,5],children:(0,a.jsxs)(ei.az,{maxWidth:["100%",null,300],px:[1,null,0],children:[(0,a.jsx)(sH,{}),b!==ey.UT.SUMMARY&&(0,a.jsxs)(es.A,{fontSize:"12px",mt:4,children:[(0,a.jsx)(em.P,{fontWeight:"500",fontSize:"inherit",mb:3,children:(0,a.jsx)(v.sA,{id:"ContributionSummary",defaultMessage:"Contribution Summary"})}),(0,a.jsx)(tV,{collective:e,stepDetails:u,stepSummary:p,stepPayment:m,currency:y,tier:s})]}),(0,a.jsx)(ec,{collective:e,mt:4,titleProps:{mb:2}})]})})]})]})})}}let sY=(0,c.U)((0,G.J1)`
382    mutation CreateIncognitoProfile {
383      createIncognitoProfile {
384        id
385        name
386        slug
387        type
388        isIncognito
389      }
390    }
391  `,{name:"createIncognitoProfile"}),sQ=(0,c.U)((0,G.J1)`
392    mutation CreateOrder($order: OrderCreateInput!) {
393      createOrder(order: $order) {
394        ...OrderResponseFragment
395      }
396    }
397    ${ef.qk}
398  `,{name:"createOrder"}),sX=(0,c.U)((0,G.J1)`
399    mutation ConfirmOrder($order: OrderReferenceInput!, $guestToken: String) {
400      confirmOrder(order: $order, guestToken: $guestToken) {
401        ...OrderResponseFragment
402      }
403    }
404    ${ef.qk}
405  `,{name:"confirmOrder"}),sJ=(0,Z.A)((0,eg.Cb)(sX(sQ(sY((0,A.withRouter)(sK))))))}}]);
406//# sourceMappingURL=1295-f07f5e29e11f45b8.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.