PageSourceSearch

https://tiptopjar.com/_next/static/chunks/pages/payments-27d73d664bae99eb.js

js tiptopjar.com collected 2026-10-02 05:14:49 UTC 111,652 bytes, 21 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e2f5b92b-2dbe-4f17-a49a-236ad4a980c8",e._sentryDebugIdIdentifier="sentry-dbid-e2f5b92b-2dbe-4f17-a49a-236ad4a980c8")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6053],{55742:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/payments",function(){return n(95894)}])},92394:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(74848),i=n(14953);let a=n.n(i)()(()=>Promise.all([Promise.resolve().then(n.t.bind(n,18051,23)),n.e(1239).then(n.t.bind(n,51239,19))]).then(e=>{let[{default:t},{default:n}]=e;return function(){return(0,r.jsx)(t,{animationData:n,loop:!0,style:{height:100}})}}),{loadableGenerated:{webpack:()=>[51239]},ssr:!1})},19074:(e,t,n)=>{"use strict";n.d(t,{A:()=>_});var r=n(74848),i=n(96540),a=n(16774),o=n(30447),s=n(95256),l=n(9792),d=n(94159),c=n(60949),p=n(57201),x=n(91672),h=n(33087),u=n(37323),g=n(80431),f=n(55466),b=n(54679),m=n(86354),j=n(45050),C=n(75942),y=n(31787),w=n(61654),k=n(86715),v=n(42669),S=n(61190);let L=new Intl.DateTimeFormat("en-US",{month:"short",year:"2-digit"}),D=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"2-digit"}),P=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"2-digit"}),M=e=>{let{active:t,payload:n}=e;if(t&&n&&n.length){let{fullDate:e,currency:t,isMonthly:i,isWeekly:s,tipsCount:l}=n[0].payload,[d,c,p]=e.split("/"),x=new Date(parseInt(p,10),parseInt(d,10)-1,parseInt(c,10)),h=i?L.format(x):s?P.format(x):D.format(x);return(0,r.jsxs)("div",{style:{backgroundColor:"white",borderColor:"rgba(0, 0, 0, 0.2)",borderWidth:"1px",boxShadow:"0px 15px 87px rgba(0, 0, 0, 0.06), 0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 0.997515px 5.78559px rgba(0, 0, 0, 0.0242336)",borderRadius:"20px",padding:"8px 10px"},children:[(0,r.jsx)(a.E,{fontSize:"sm",children:(0,r.jsxs)(o.z,{gap:"5px",children:[(0,r.jsx)("svg",{width:"11",height:"12",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M2.41818 20.3726C1.63574 20.3528 0.911235 19.9616 0.464694 19.3188C0.00102191 18.6826 -0.124119 17.8593 0.127478 17.1137L0.464694 16.0309C1.33802 13.8193 1.90444 11.4984 2.15077 9.13252H23.9288C23.6891 11.7288 23.0832 14.2791 22.1308 16.7054L21.4709 18.6865C21.1376 19.6929 20.1971 20.3726 19.138 20.3726H2.41818ZM19.1249 22.4802H2.26273C2.43134 23.6868 3.46143 24.5865 4.67989 24.5878H21.5407C22.8961 24.5812 23.9921 23.4839 24 22.1298V17.717L23.452 19.3188C22.8474 21.1998 21.0994 22.4775 19.1235 22.4802L19.1249 22.4802ZM21.5407 1.4042H19.7848V1.0538C19.7848 0.471565 19.312 2.25116e-06 18.731 2.25116e-06C18.1488 2.25116e-06 17.6772 0.471565 17.6772 1.0538V1.40552H14.1641V1.0538C14.1641 0.471565 13.6926 2.25116e-06 13.1103 2.25116e-06C12.5281 2.25116e-06 12.0565 0.471565 12.0565 1.0538V1.40552L8.54341 1.4042V1.0538C8.54341 0.471562 8.07184 0 7.48961 0C6.90869 0 6.43581 0.471562 6.43581 1.0538V1.40552L4.67993 1.4042C3.32449 1.4121 2.22853 2.50804 2.22061 3.86351V7.02491H23.9987L24 3.86351C23.9921 2.50807 22.8962 1.41213 21.5407 1.4042Z",fill:"black"})}),(0,r.jsx)("strong",{children:h})]})}),(0,r.jsx)(a.E,{fontSize:"sm",children:(0,r.jsxs)("strong",{children:[w.zA[t],n[0].value]})}),(0,r.jsx)(a.E,{fontSize:"sm",children:(0,r.jsxs)("strong",{children:[l," ",1===l?"tipper":"tippers"," "]})})]})}return null},_=i.memo(e=>{let{dateSelection:t}=e,[n,_]=(0,m.hD)(j.j2),{data:I}=(0,C.useQuery)(["userDocument",n,_],(0,y.Q)(n,_)),{tipJarMap:z,selectableTipJarSlugs:T,selectedTipJarSlugs:E}=(0,S.MZ)(),H=(0,i.useMemo)(()=>(0,v.Bl)(I?.tips,E,z,T),[I?.tips,E,z,T]),W=(0,k.useRouter)(),[V,R]=i.useState(!1),{preset:A,range:B}=t,F=(0,i.useMemo)(()=>{let e=new Date;return e.setHours(0,0,0,0),e},[]),O=I?.user?.accountInfo?.creationTime,$=(0,i.useMemo)(()=>O?new Date(O):null,[O]),{effectiveStartDate:U,days:Z}=(0,i.useMemo)(()=>{let e,t;return"allTime"===A?(e=$||new Date(F.getTime()-31536e6),(t=Math.max(1,Math.ceil((F.getTime()-e.getTime())/864e5)))<7&&((e
1=new Date(F.getTime()-6048e5)).setHours(0,0,0,0),t=7)):"custom"===A&&B.from&&B.to||B.from&&B.to?(t=Math.max(1,Math.ceil((B.to.getTime()-B.from.getTime())/864e5)),e=B.from):(e=new Date(F.getTime()-6048e5),t=7),t<2&&((e=new Date(e.getTime()-864e5)).setHours(0,0,0,0),t=2),{effectiveStartDate:e,days:t}},[A,B,$,F]),N=(0,i.useMemo)(()=>"custom"===A&&B.to||B.to?B.to:new Date,[A,B]),G=(0,v.aq)(I,H),J=w.zA[G],Y=Z>90,q=Z>14&&Z<=90,{data:Q,chartTitle:K}=(0,i.useMemo)(()=>{let e=Object.keys(H).filter(e=>{let t=H[e].tipInfo?.timestamp;if(!t)return!1;let n=new Date(t);return n>=U&&n<=N}).sort((e,t)=>H[t].tipInfo.timestamp-H[e].tipInfo.timestamp).map(e=>{let t=H[e],n=t.tipInfo?.timestamp?new Date(t.tipInfo.timestamp):new Date;return{name:t.tipperInfo?.name||"Tipper",tip:t.tipInfo?.amount?t.tipInfo.amount/100:0,fullDate:`${n.getMonth()+1}/${n.getDate()}/${n.getFullYear()}`,month:n.getMonth()+1,year:n.getFullYear()}}),t=[],n="Daily earnings";return Y?(n="Monthly earnings",t=((e,t)=>{let n=[],r=new Date(e.getFullYear(),e.getMonth(),1),i=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(r);for(;a<=i;){let e=a.getMonth()+1,t=a.getFullYear();n.push({fullDate:`${e}/1/${t}`,month:e,year:t}),a.setMonth(a.getMonth()+1)}return n})(U,N).map(t=>{let{fullDate:n,month:r,year:i}=t,a=e.filter(e=>e.month===r&&e.year===i);return{fullDate:n,tip:a.reduce((e,t)=>e+t.tip,0),tipsCount:a.length,currency:G,isMonthly:!0,isWeekly:!1}})):q?(n="Weekly earnings",t=((e,t)=>{let n=[],r=new Date(e);for(;r<=t;){let e=new Date(r),i=new Date(e);i.setDate(i.getDate()+6),i>t&&i.setTime(t.getTime());let a=e.getMonth()+1,o=e.getDate(),s=e.getFullYear();n.push({fullDate:`${a}/${o}/${s}`,start:new Date(e),end:new Date(i)}),r.setDate(r.getDate()+7)}return n})(U,N).map(t=>{let{fullDate:n,start:r,end:i}=t,a=e.filter(e=>{let[t,n,a]=e.fullDate.split("/"),o=new Date(parseInt(a,10),parseInt(t,10)-1,parseInt(n,10));return o>=r&&o<=i});return{fullDate:n,tip:a.reduce((e,t)=>e+t.tip,0),tipsCount:a.length,currency:G,isMonthly:!1,isWeekly:!0}})):t=((e,t)=>{let n=[],r=new Date(e);r.setHours(0,0,0,0);let i=new Date(t);for(i.setHours(23,59,59,999);r<=i;){let e=r.getMonth()+1,t=r.getDate(),i=r.getFullYear();n.push({fullDate:`${e}/${t}/${i}`}),r.setDate(r.getDate()+1)}return n})(U,N).map(t=>{let{fullDate:n}=t,r=e.filter(e=>e.fullDate===n);return{fullDate:n,tip:r.reduce((e,t)=>e+t.tip,0),tipsCount:r.length,currency:G,isMonthly:!1,isWeekly:!1}}),{data:t,chartTitle:n,tipsThisPeriod:e}},[H,U,N,Y,q,G]),X=(0,i.useMemo)(()=>{if(0===Q.length||0===Q.filter(e=>e.tipsCount>0).length)return 0;let e=Q.reduce((e,t)=>e+t.tip,0),t=Q.reduce((e,t)=>e+t.tipsCount,0);return t>0?Math.ceil(e/t):0},[Q]),ee=(0,i.useMemo)(()=>new Intl.NumberFormat("en-US",{style:"currency",currency:G,minimumFractionDigits:0,maximumFractionDigits:0}).format(X),[X,G]);return(0,r.jsxs)(s.a,{padding:{base:"20px 20px 0px 0px",md:"20px 26px 0px 0px"},width:"100%",boxShadow:"0px 15px 87px rgba(0, 0, 0, 0.06), 0px 6.26664px 36.3465px rgba(0, 0, 0, 0.0431313), 0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 1.87823px 10.8938px rgba(0, 0, 0, 0.03), 0px 0.997515px 5.78559px rgba(0, 0, 0, 0.0242336), 0px 0.415088px 2.40751px rgba(0, 0, 0, 0.0168687)",borderRadius:"20px",backgroundColor:"white",minH:"157px",children:[(0,r.jsx)(l.s,{pl:{base:"20px",md:"26px"},justifyContent:"space-between",marginBottom:"10px",children:(0,r.jsxs)(o.z,{w:"100%",justify:"space-between",children:[(0,r.jsx)(d.D,{variant:"dashboardCardTitle",children:K}),V?(0,r.jsx)(s.a,{opacity:"0.8",borderColor:"black",bg:"black",borderWidth:"1px",borderRadius:"100%",padding:"5px",cursor:"pointer",onClick:()=>R(!V),children:(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M2.12123 21.021L8.38462 14.7582V19.1035C8.38462 19.9114 9.19231 19.9114 9.19231 19.1035V12.8078C9.19231 12.5936 9.10721 12.3882 8.95574 12.2367C8.80427 12.0853 8.59883 12.0002 8.38462 12.0002H2.08838C1.28048 12.0002 1.28048 12.8078 2.08838 12.8078H7.24254L0.979154 19.0711C0.391512 19.6587 1.37053 20.6377 1.95817 20.0501L8.38462 13.6237V19.1035C8.38462 19.9114 9.19231 19.9114 9.19231 19.1035V12.8078C9.19231 12.5936 9.10721 12.3882 8.95574 12.2367C8.80427 12.0853 8.59883 12.0002 8.38462 12.0002H2.08838C1.28048 12.0002 1.28048 12.8078 2.08838 12.8078H7.24254L0.979154 19.0711C0.391512 19.6587 1.37053 20.6377 1.95817 20.0501Z",fill:"white"}),(0,r.jsx)("path",{d:"M12.8075 10V2.89662C12.8075 2.08872 13.6152 2.08872 13.6152 2.89662V8.3846L19.8785 2.12123C20.4661 1.53358 19.4871 0.554565 18.8995 1.14221L12.8075 7.23426V2.89662C12.8075 2.08872 13.6152 2.08872 13.6152 2.89662V9.19231C13.6152 9.40652 13.5301 9.61196 13.3786 9.76343C13.2271 9.9149 13.0217 10 12.8075 10H20.1923C21 10 21 9.19231 20.1923 9.19231H13.8977L20.1605 2.92946C20.7482 2.34182 19.7691 1.3628 19.1815 1.95044L12.8075 8.32442V2.89662C12.8075 2.08872 13.6152 2.08872 13.6152 2.89662V9.19231C13.6152 9.40652 13.5301 9.61196 13.3786 9.76343C13.2271 9.9149 13.0217 10 12.8075 10Z",fill:"white"})]})}):(0,r.jsx)(s.a,{opacity:"0.3",borderColor:"black",bg:"black",borderWidth:"1px",borderRadius:"100%",padding:"5px",cursor:"pointer",onClick:()=>R(!V),children:(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M20.1923 1.15696e-08C20.4065 1.15696e-08 20.612 0.0850959 20.7634 0.236568C20.9149 0.388039 21 0.593479 21 0.807692V7.10338C21 7.3176 20.9149 7.52304 20.7634 7.67451C20.612 7.82598 20.4065 7.91108 20.1923 7.91108C19.9781 7.91108 19.7727 7.82598 19.6212 7.67451C19.4697 7.52304 19.3846 7.3176 19.3846 7.10338V2.758L13.1212 9.02085C13.0463 9.09589 12.9574 9.15541 12.8594 9.19597C12.7615 9.23654 12.6565 9.25736 12.5505 9.25723C12.3908 9.2572 12.2347 9.20983 12.1019 9.12111C11.9691 9.03239 11.8656 8.9063 11.8045 8.75878C11.7433 8.61126 11.7273 8.44893 11.7584 8.29229C11.7895 8.13566 11.8663 7.99176 11.9792 7.87877L18.2431 1.61538H13.8977C13.7916 1.6154 13.6866 1.59452 13.5886 1.55394C13.4905 1.51336 13.4015 1.45387 13.3265 1.37887C13.2515 1.30386 13.192 1.21482 13.1514 1.11681C13.1108 1.01881 13.0899 0.913771 13.0899 0.807692C13.0899 0.701613 13.1108 0.596573 13.1514 0.49857C13.192 0.400568 13.2515 0.311522 13.3265 0.236519C13.4015 0.161516 13.4905 0.102025 13.5886 0.0614426C13.6866 0.0208603 13.7916 -1.79424e-05 13.8977 1.15696e-08H20.1923ZM7.87877 11.9792C7.95328 11.902 8.0424 11.8405 8.14094 11.7981C8.23948 11.7558 8.34547 11.7335 8.45271 11.7326C8.55996 11.7317 8.66632 11.7521 8.76558 11.7927C8.86484 11.8333 8.95502 11.8933 9.03086 11.9691C9.10669 12.045 9.16667 12.1352 9.20728 12.2344C9.24789 12.3337 9.26833 12.44 9.26739 12.5473C9.26646 12.6545 9.24418 12.7605 9.20185 12.8591C9.15952 12.9576 9.09799 13.0467 9.02085 13.1212L2.75746 19.3846H7.10392C7.31814 19.3846 7.52358 19.4697 7.67505 19.6212C7.82652 19.7727 7.91162 19.9781 7.91162 20.1923C7.91162 20.4065 7.82652 20.612 7.67505 20.7634C7.52358 20.9149 7.31814 21 7.10392 21H0.807692C0.593479 21 0.388039 20.9149 0.236568 20.7634C0.0850959 20.612 1.15696e-08 20.4065 1.15696e-08 20.1923V13.8966C-1.79424e-05 13.7905 0.0208603 13.6855 0.0614426 13.5875C0.102025 13.4895 0.161516 13.4004 0.236519 13.3254C0.311522 13.2504 0.400568 13.1909 0.49857 13.1503C0.596573 13.1097 0.701613 13.0888 0.807692 13.0888C0.913771 13.0888 1.01881 13.1097 1.11681 13.1503C1.21482 13.1909 1.30386 13.2504 1.37887 13.3254C1.45387 13.4004 1.51336 13.4895 1.55394 13.5875C1.59452 13.6855 1.6154 13.7905 1.61538 13.8966V18.242L7.87877 11.9797V11.9792Z",fill:"white"})})})]})}),V?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.a,{pb:"10px",children:(0,r.jsx)(c.u,{width:"100%",height:200,children:(0,r.jsxs)(p.b,{data:Q,margin:{left:0,right:20,top:10,bottom:10},children:[(0,r.jsx)(x.W,{opacity:"0.6",dataKey:"fullDate",axisLine
1:{stroke:"#000",strokeWidth:.15},tickLine:!0,tickSize:2,tickMargin:10,tick:{fill:"#000",fontSize:10,fontWeight:600},tickFormatter:e=>{let[t,n,r]=e.split("/"),i=new Date(parseInt(r,10),parseInt(t,10)-1,parseInt(n,10));return Y?L.format(i):q?P.format(i):D.format(i)}}),(0,r.jsx)(h.h,{opacity:"0.6",domain:["auto","auto"],axisLine:{stroke:"#000",strokeWidth:.15},tickLine:!1,tickSize:2,tick:{fill:"#000",fontSize:12,fontWeight:600},tickFormatter:e=>`${J}${e}`}),(0,r.jsx)(u.d,{opacity:"0.6",stroke:"#E0E0E0",strokeDasharray:"2 2"}),(0,r.jsx)(g.N,{type:"monotone",dataKey:"tip",stroke:"black",dot:!1}),(0,r.jsx)(f.m,{content:(0,r.jsx)(M,{})}),(0,r.jsx)(b.v,{dataKey:"fullDate",height:15,stroke:"dark",travellerWidth:15,fontSize:10,tickFormatter:()=>""})]})})}),"/dashboard"!==W.asPath&&X>0&&(0,r.jsxs)(a.E,{padding:{base:"0px 20px 20px 20px",md:"0px 26px 20px 26px"},fontWeight:"600",fontSize:"sm",children:["Your average tip was ",ee]})]}):(0,r.jsx)(s.a,{onClick:()=>R(!0),cursor:"pointer",children:(0,r.jsx)(c.u,{width:"100%",height:150,children:(0,r.jsxs)(p.b,{data:Q,margin:{left:26,right:0,top:5,bottom:20},children:[(0,r.jsx)(g.N,{type:"monotone",dataKey:"tip",stroke:"black",opacity:"0.6",dot:!1}),(0,r.jsx)(f.m,{content:(0,r.jsx)(M,{})})]})})})]})})},83e3:(e,t,n)=>{"use strict";n.d(t,{N:()=>s,e:()=>o});var r=n(45904),i=n(8122),a=n(45050);let o=async(e,t,n,o)=>{if(!e||!t)return null;try{let n=e;e.type.startsWith("image/")&&(n=await (0,i.A)(e,{maxSizeMB:.8,maxWidthOrHeight:1e3,useWebWorker:!0}));let s=(0,r.KR)(a.IG,`documents/${t.uid}/${o}`);return await (0,r.D)(s,n),await (0,r.qk)(s)}catch(e){return n("Error uploading the document. Please try later."),null}},s=async(e,t,n)=>{if(!e)return!1;try{let n=(0,r.KR)(a.IG,`documents/${e.uid}/${t}`);return await (0,r.XR)(n),!0}catch(e){return n("Error deleting the document. Please try later."),!1}}},95894:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>tw});var r=n(74848),i=n(96540),a=n(13368),o=n.n(a),s=n(95256),l=n(44457),d=n(94159),c=n(9792),p=n(27387),x=n(19074),h=n(22363),u=n(87360),g=n(30447),f=n(16774),b=n(50364),m=n(21786),j=n(19461),C=n(17437),y=n(77280),w=n(89541),k=n(51695),v=n(75819),S=n(69593),L=n(96620),D=n(41972),P=n(69390),M=n(8495),_=n(84728),I=n(12369),z=n(5285),T=n(47555);let E=(0,C.keyframes)`
2  0%   { box-shadow: 0 0 0 0 rgba(29, 155, 240, 0); }
3  35%  { box-shadow: 0 0 16px 3px rgba(29, 155, 240, 0.5); }
4  100% { box-shadow: 0 0 0 0 rgba(29, 155, 240, 0); }
5`,H=(0,C.keyframes)`
6  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
7  35%  { box-shadow: 0 0 16px 3px rgba(239, 68, 68, 0.5); }
8  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
9`,W=(0,T.P)(s.a);function V(e){let{viewKey:t,children:n}=e,a=i.useRef(null),[o,l]=i.useState("auto");return i.useLayoutEffect(()=>{let e=a.current;if(!e)return;let t=()=>l(e.offsetHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,r.jsx)(W,{animate:{height:o},transition:{duration:.28,ease:[.4,0,.2,1]},overflow:"hidden",children:(0,r.jsx)(s.a,{ref:a,px:1,pb:1,children:(0,r.jsx)(W,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut"},children:n},t)})})}let R={stripe:{fullName:"Stripe",color:"rgba(123, 97, 255, 1)",backgroundColor:"linear-gradient(92.46deg, #b6ade0 0%, rgba(123, 97, 255, 1) 100%)",integrationLink:"/api/payment/onboarding?processor=stripe",dashboardLink:"https://dashboard.stripe.com/dashboard",Logo:e=>{let{color:t}=e;return(0,r.jsxs)("svg",{width:"48",height:"21",viewBox:"0 0 48 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_583_12544)",children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47.3012 10.8559C47.3012 7.48829 45.6743 4.83105 42.5647 4.83105C39.4421 4.83105 37.5527 7.48829 37.5527 10.8296C37.5527 14.7891 39.7832 16.7886 42.9846 16.7886C44.5459 16.7886 45.7267 16.4334 46.6189 15.9335V13.3026C45.7267 13.7499 44.7034 14.0261 43.4044 14.0261C42.1318 14.0261 41.0034 13.5789 40.8591 12.0266H47.275C47.275 11.8556 47.3012 11.1716 47.3012 10.8559ZM40.8197 9.60618C40.8197 8.11971 41.725 7.50144 42.5516 7.50144C43.3519 7.50144 44.2048 8.11971 44.2048 9.60618H40.8197Z",fill:t||"#7B61FF"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.488 4.83105C31.2022 4.83105 30.3756 5.43617 29.9164 5.85711L29.7459 5.04153H26.8594V20.3798L30.1395 19.6826L30.1526 15.9599C30.6249 16.3019 31.3203 16.7886 32.4749 16.7886C34.8235 16.7886 36.9621 14.8943 36.9621 10.7243C36.949 6.90948 34.7841 4.83105 32.488 4.83105ZM31.7008 13.8946C30.9267 13.8946 30.4675 13.6183 30.1526 13.2763L30.1395 8.39595C30.4806 8.01447 30.9529 7.75138 31.7008 7.75138C32.8948 7.75138 33.7213 9.09315 33.7213 10.8164C33.7213 12.5791 32.9079 13.8946 31.7008 13.8946Z",fill:t||"#7B61FF"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.3457 4.05456L25.6389 3.34421V0.673828L22.3457 1.37102V4.05456Z",fill:t||"#7B61FF"}),(0,r.jsx)("path",{d:"M25.6389 5.05469H22.3457V16.565H25.6389V5.05469Z",fill:t||"#7B61FF"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.8164 6.02738L18.6065 5.05394H15.7725V16.5642H19.0526V8.76354C19.8267 7.75064 21.1387 7.9348 21.5454 8.0795V5.05394C21.1256 4.89609 19.5905 4.60668 18.8164 6.02738Z",fill:t||"#7B61FF"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2565 2.2002L9.05511 2.88424L9.04199 13.4211C9.04199 15.368 10.4984 16.8018 12.4402 16.8018C13.5161 16.8018 14.3033 16.6045 14.7362 16.3677V13.6973C14.3164 13.8683 12.2434 14.4734 12.2434 12.5266V7.85668H14.7362V5.05475H12.2434L12.2565 2.2002Z",fill:t||"#7B61FF"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.38685 8.39595C3.38685 7.88292 3.8067 7.68561 4.50208 7.68561C5.49923 7.68561 6.75879 7.98816 7.75594 8.5275V5.43617C6.66695 5.00206 5.59107 4.83105 4.50208 4.83105C1.83864 4.83105 0.0673828 6.22544 0.0673828 8.55381C0.0673828 12.1845 5.05314 11.6057 5.05314 13.1711C5.05314 13.7762 4.52832 13.9735 3.79358 13.9735C2.70459 13.9735 1.31382 13.5263 0.211707 12.9211V16.0519C1.43191 16.5781 2.66522 16.8018 3.79358 16.8018C6.52262 16.8018 8.39884 15.4468 8.39884 13.0921C8.38572 9.17208 3.38685 9.86927 3.38685 8.39595Z",fill:t||"#7B61FF"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_583_12544",children:(0,r.jsx)("rect",{width:"47.3684",height:"20",fill:"white",transform:"translate(0 0.5)"})})})]})},unlinkedMessage:"Receive tips via Debit or Credit card, Apple Pay, and Google Pay. Link a Stripe account",modalPaymentMethod:"via Debit or Credit card, Apple Pay, and Google Pay"},paypal:{fullName:"PayPal",color:"#253B80",backgroundColor:"linear-gradient(92.46deg, #253B80 0%, #4C7FD6 100%)",integrationLink:"/api/payment/onboarding?processor=paypal",dashboardLink:"https://www.paypal.com/mep/dashboard",Logo:e=>{let{color:t}=e;return(0,r.jsx)("svg",{width:"59",height:"20",viewBox:"0 0 59 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M58.82 
90V14.7409H55.4659V0H58.82ZM54.2311 4.975V14.7679H51.2497V13.9237C50.8726 14.2919 50.4415 14.5703 49.9656 14.7679C49.4851 14.9744 48.9643 15.0822 48.4075 15.0822C47.7071 15.0822 47.056 14.952 46.4588 14.6915C45.8616 14.4176 45.3408 14.045 44.9008 13.578C44.4563 13.1065 44.106 12.5587 43.8456 11.9346C43.5986 11.297 43.4774 10.61 43.4774 9.87816C43.4774 9.14628 43.5986 8.46828 43.8456 7.84416C44.106 7.20657 44.4563 6.6498 44.9008 6.17834C45.3398 5.71047 45.87 5.33759 46.4588 5.08276C47.056 4.80887 47.7071 4.66967 48.4075 4.66967C48.9643 4.66967 49.4851 4.77294 49.9656 4.98398C50.446 5.18154 50.8771 5.45993 51.2497 5.82811V4.98398H54.2311V4.975ZM48.9463 12.1008C49.557 12.1008 50.0554 11.8942 50.446 11.4721C50.8501 11.0546 51.0522 10.5202 51.0522 9.86919C51.0522 9.21813 50.8501 8.67932 50.446 8.26623C50.0554 7.84865 49.5525 7.63762 48.9463 7.63762C48.3402 7.63762 47.8283 7.84416 47.4242 8.26623C47.0335 8.68381 46.8405 9.21813 46.8405 9.86919C46.8405 10.5202 47.038 11.0591 47.4242 11.4721C47.8283 11.8897 48.3357 12.1008 48.9463 12.1008ZM38.691 0C39.5755 0 40.3299 0.125722 40.954 0.372677C41.5781 0.619631 42.1035 0.965367 42.5345 1.40988C42.9745 1.86787 43.3203 2.38872 43.5672 2.97692C43.8142 3.56512 43.9354 4.19822 43.9354 4.87623C43.9354 5.55423 43.8142 6.18733 43.5672 6.77553C43.3248 7.3583 42.9744 7.88999 42.5345 8.34257C42.1079 8.78708 41.5781 9.13282 40.954 9.37977C40.3299 9.62673 39.5755 9.75245 38.691 9.75245H37.0746V14.7634H33.6621V0H38.691ZM38.2016 6.71715C38.6596 6.71715 39.0053 6.67225 39.2567 6.57796C39.5172 6.47469 39.7327 6.33999 39.8988 6.18732C40.2491 5.85955 40.4242 5.42401 40.4242 4.87622C40.4242 4.32843 40.2491 3.89289 39.8988 3.56512C39.7282 3.40797 39.5172 3.28224 39.2567 3.19244C39.0098 3.08917 38.6596 3.03529 38.2016 3.03529H37.0701V6.71715H38.2016ZM21.0899 4.975H24.7942L27.3087 9.67162H27.3491L29.5896 4.975H33.02L25.6698 19.7384H22.2573L25.6114 12.9853L21.0899 4.975ZM20.4298 4.975V14.7679H17.4484V13.9237C17.0713 14.2919 16.6402 14.5703 16.1643 14.7679C15.6838 14.9744 15.163 15.0822 14.6062 15.0822C13.9058 15.0822 13.2547 14.952 12.6575 14.6915C12.0603 14.4176 11.5395 14.045 11.0995 13.578C10.6594 13.1065 10.3047 12.5587 10.0443 11.9346C9.79734 11.297 9.67611 10.61 9.67611 9.87816C9.67611 9.14628 9.79734 8.46828 10.0443 7.84416C10.3047 7.20657 10.6549 6.6498 11.0995 6.17834C11.5376 5.70949 12.0681 5.33647 12.6575 5.08276C13.2547 4.80887 13.9058 4.66967 14.6062 4.66967C15.163 4.66967 15.6838 4.77294 16.1643 4.98398C16.6447 5.18154 17.0758 5.45993 17.4484 5.82811V4.98398H20.4298V4.975ZM15.145 12.1008C15.7557 12.1008 16.2541 11.8942 16.6492 11.4721C17.0533 11.0546 17.2554 10.5202 17.2554 9.86919C17.2554 9.21813 17.0533 8.67932 16.6492 8.26623C16.2586 7.84865 15.7557 7.63762 15.145 7.63762C14.5344 7.63762 14.027 7.84416 13.6229 8.26623C13.2323 8.68381 13.0392 9.21813 13.0392 9.86919C13.0392 10.5202 13.2367 11.0591 13.6229 11.4721C14.027 11.8897 14.5344 12.1008 15.145 12.1008ZM5.02888 0C5.91343 0 6.66776 0.125722 7.29188 0.372677C7.916 0.619631 8.44134 0.965367 8.87239 1.40988C9.31242 1.86787 9.65816 2.38872 9.90511 2.97692C10.1521 3.56512 10.2733 4.19822 10.2733 4.87623C10.2733 5.55423 10.1521 6.18733 9.90511 6.77553C9.66273 7.3583 9.31233 7.88999 8.87239 8.34257C8.44583 8.78708 7.916 9.13282 7.29188 9.37977C6.66776 9.62673 5.91343 9.75245 5.02888 9.75245H3.41246V14.7634H0V0H5.02888ZM4.54396 6.71715C5.00194 6.71715 5.34768 6.67225 5.59912 6.57796C5.85955 6.47469 6.07507 6.33999 6.2412 6.18732C6.59143 5.85955 6.76654 5.42401 6.76654 4.87622C6.76654 4.32843 6.59143 3.89289 6.2412 3.56512C6.07058 3.40797 5.85955 3.28224 5.59912 3.19244C5.35217 3.08917 5.00194 3.03529 4.54396 3.03529H3.41246V6.71715H4.54396Z",fill:t||"white"})})},unlinkedMessage:"Receive tip payouts through a connected PayPal Business account.",modalPaymentMethod:"via Apple Pay, Google Pay, PayPal, Venmo, and more"}},A=e=>{let{fullName:t,email:n,merchantId:i,lastUpdatedAt:a}=e,o=a?new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null;return(0,r.jsxs)(s.a,{px:2,pt:1.5,pb:2,children:[(0,r.jsxs)(f.E,{fontFamily:"ui",fontSize:"xs",fontWeight:500,color:"text.muted",lineHeight:"1.2",children:["Linked ",t," account"]}),(0,r.jsx)(f.E,{mt:.5,fontFamily:"ui",fontSize:"sm",fontWeight:500,color:"text.secondary",noOfLines:2,overflowWrap:"anywhere",title:n??void 0,children:n||"Connected"}),i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.E,{mt:2,fontFamily:"ui",fontSize:"xs",fontWeight:500,color:"text.muted",lineHeight:"1.2",children:"Merchant ID"}),(0,r.jsx)(f.E,{mt:.5,fontFamily:"metric",fontSize:"xs",fontWeight:500,color:"text.secondary",overflowWrap:"anywhere",children:i})]}),o&&(0,r.jsxs)(f.E,{mt:2,fontFamily:"ui",fontSize:"xs",fontWeight:500,color:"text.muted",lineHeight:"1.2",children:["Last updated ",o]})]})},B=e=>{let{isIntegrated:t,unlinkedMessage:n}=e;return t?null:(0,r.jsx)(s.a,{pt:"10px",w:{base:"auto",md:"210px",lg:"auto"},children:(0,r.jsx)(f.E,{color:"gray.600",fontSize:"xs",fontWeight:"500",children:n})})};function F(){return(0,r.jsxs)(s.a,{as:"svg",width:"20px",height:"20px",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,
9children:[(0,r.jsx)("circle",{cx:"10",cy:"4",r:"1.6",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"10",cy:"10",r:"1.6",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"10",cy:"16",r:"1.6",fill:"currentColor"})]})}function O(){return(0,r.jsxs)(s.a,{as:"svg",width:"18px",height:"18px",viewBox:"0 0 20 21",fill:"none","aria-hidden":!0,children:[(0,r.jsx)("path",{d:"M16.6663 13.4163V15.3886C16.6663 15.8601 16.479 16.3122 16.1456 16.6456C15.8122 16.979 15.3601 17.1663 14.8886 17.1663H5.11079C4.63929 17.1663 4.1871 16.979 3.85371 16.6456C3.52031 16.3122 3.33301 15.8601 3.33301 15.3886V5.61079C3.33301 5.13929 3.52031 4.6871 3.85371 4.35371C4.1871 4.02031 4.63929 3.83301 5.11079 3.83301H7.08301",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10.833 3.83301H16.6663V9.66634",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10 10.4997L16.6667 3.83301",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $(){return(0,r.jsxs)(s.a,{as:"svg",width:"16px",height:"16px",viewBox:"0 0 21 22",fill:"none","aria-hidden":!0,children:[(0,r.jsx)("path",{d:"M20.1782 20.156H6.17822C5.97931 20.156 5.78854 20.235 5.64789 20.3757C5.50724 20.5163 5.42822 20.7071 5.42822 20.906C5.42822 21.1049 5.50724 21.2957 5.64789 21.4363C5.78854 21.577 5.97931 21.656 6.17822 21.656H20.1782C20.3771 21.656 20.5679 21.577 20.7086 21.4363C20.8492 21.2957 20.9282 21.1049 20.9282 20.906C20.9282 20.7071 20.8492 20.5163 20.7086 20.3757C20.5679 20.235 20.3771 20.156 20.1782 20.156Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M19.2379 5.17601C19.5854 4.84162 19.7928 4.38761 19.8179 3.90601C19.8253 3.72145 19.7945 3.53734 19.7274 3.36525C19.6603 3.19316 19.5583 3.03681 19.4279 2.90601L16.9179 0.386008C16.7562 0.247802 16.5686 0.143021 16.3662 0.0777203C16.1637 0.0124195 15.9503 -0.0121059 15.7383 0.00556144C15.5263 0.0232288 15.3199 0.0827385 15.131 0.180651C14.9421 0.278564 14.7745 0.412938 14.6379 0.576008L12.3579 2.90601L16.9579 7.50601L19.2379 5.17601Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M1.4481 13.776C1.17231 14.048 0.984237 14.3962 0.908098 14.776L0.0280985 18.546C-0.0124725 18.722 -0.00906222 18.9054 0.038028 19.0798C0.0851182 19.2542 0.174439 19.4143 0.298098 19.546C0.500451 19.7384 0.768903 19.8458 1.0481 19.846C1.13783 19.8558 1.22837 19.8558 1.3181 19.846L5.0881 18.906C5.46664 18.8265 5.814 18.6389 6.0881 18.366L15.9481 8.51601L11.2981 3.90601L1.4481 13.776Z",fill:"currentColor"})]})}function U(e){let{onClick:t}=e;return(0,r.jsx)(s.a,{as:"button",type:"button","aria-label":"Close",onClick:t,position:"absolute",top:3,right:3,zIndex:4,w:"32px",h:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"full",bg:"rgba(255, 255, 255, 0.32)",color:"rgba(255, 255, 255, 0.96)",borderWidth:"1px",borderStyle:"solid",borderColor:"rgba(255, 255, 255, 0.45)",backdropFilter:"blur(14px) saturate(180%)",boxShadow:"0 4px 14px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55)",transition:"background 0.15s ease, transform 0.15s ease, border-color 0.15s ease",_hover:{bg:"rgba(255, 255, 255, 0.5)",borderColor:"rgba(255, 255, 255, 0.7)"},_active:{transform:"scale(0.94)"},_focusVisible:{outline:"2px solid",outlineColor:"border.brand",outlineOffset:"2px"},children:(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})}let Z=e=>{let{label:t,icon:n,onClick:i,href:a}=e,o={display:"flex",alignItems:"center",justifyContent:"space-between",w:"100%",px:2,py:2.5,gap:3,borderRadius:"lg",color:"text.primary",transition:"background-color 120ms ease",_hover:{bg:"blackAlpha.100"},_dark:{_hover:{bg:"whiteAlpha.100"}},_focusVisible:{outline:"2px solid",outlineColor:"border.brand",outlineOffset:"2px"}},l=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.E,{fontFamily:"metric",fontSize:"sm",fontWeight:600,children:t}),n]});return a?(0,r.jsx)(s.a,{as:"a",href:a,target:"_blank",rel:"noopener noreferrer",...o,children:l}):(0,r.jsx)(s.a,{as:"button",type:"button",onClick:i,...o,children:l})},N=e=>{let{provider:t,isIntegrated:n,paymentInfo:a,onRemove:o}=e,{color:d,integrationLink:p,dashboardLink:x,Logo:h,backgroundColor:u,fullName:b,unlinkedMessage:m}=R[t],[j,C]=i.useState(!1),[T,W]=i.useState(!1),[N,G]=i.useState(!1),[J,Y]=i.useState("hub"),[q,Q]=i.useState(""),K="remove"===q.trim().toLowerCase(),[X,ee]=i.useState(!1),et="paypal"===t?a?.paypal?.primary_email:a?.stripeEmail,en="paypal"===t?a?.paypalLastUpdatedAt:a?.stripeLastUpdatedAt,er=en?new Date(en).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,ei={};n?ei.color="white":ei.color=d;let ea={};n||(ea.href=p,ea.target="_blank",ea.rel="noopener noreferrer");let eo=()=>{C(!1),Y("hub"),Q("")};return(0,r.jsx)(s.a,{width:"100%",borderRadius:"12px",as:n?"div":"a",display:"block",background:u,padding:"2px",...ea,children:(0,r.jsxs)(s.a,{background:n?u:"white",borderRadius:"10px",padding:"10px 14px",boxShadow:n?"inset 0 0 0 1px rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.55)":void 0,children:[(0,r.jsx)(D.A,{isOpen:X,onClose:()=>ee(!1)}),(0,r.jsxs)(P.aF,{isOpen:j,onClose:eo,size:"sm",motionPreset:"scale",hideCloseButton:!0,blockScrollOnMount:!0,contentProps:{position:"relative",overflow:"hidden",borderRadius:"20px",borderWidth:"1px",borderStyle:"solid",borderColor:"rgba(255, 255, 255, 0.65)",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06), 0 24px 60px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9)",_dark:{borderColor:"rgba(255, 255, 255, 0.12)",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.6), 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08)"}},children:[(0,r.jsx)(U,{onClick:eo}),(0,r.jsxs)(s.a,{position:"relative",overflow:"hidden",px:6,py:7,display:"flex",justifyContent:"center",alignItems:"center",bgGradient:"linear(to-br, brand.400, brand.600)",children:[(0,r.jsx)(s.a,{position:"absolute",top:"-40%",left:"50%",transform:"translateX(-50%)",w:"280px",h:"280px",borderRadius:"full",bg:"whiteAlpha.300",filter:"blur(48px)","aria-hidden":!0}),(0,r.jsx)(M.D,{level:"h2",color:"white",position:"relative",zIndex:1,children:"remove"===J?`Remove ${b}`:`Change ${b}`})]}),(0,r.jsx)(P.cw,{pt:6,pb:2,children:(0,r.jsx)(V,{viewKey:J,children:"remove"===J?(0,r.jsxs)(l.T,{spacing:4,align:"stretch",children:[(0,r.jsx)(_.E,{size:"bodySm",tone
9:"primary",fontWeight:400,children:"Your tip jar will stop accepting new tips until PayPal is linked again."}),(0,r.jsx)(s.a,{bg:"bg.surface",borderWidth:"1px",borderColor:"border.subtle",borderRadius:"lg",px:4,py:3,children:(0,r.jsxs)(l.T,{spacing:2,align:"stretch",children:[(0,r.jsxs)(g.z,{spacing:2.5,align:"flex-start",children:[(0,r.jsx)(L.S,{color:"text.success",boxSize:3,mt:"4px",flexShrink:0}),(0,r.jsx)(_.E,{size:"bodySm",tone:"secondary",children:"Your existing tips and tipper data stay safe"})]}),(0,r.jsxs)(g.z,{spacing:2.5,align:"flex-start",children:[(0,r.jsx)(L.S,{color:"text.success",boxSize:3,mt:"4px",flexShrink:0}),(0,r.jsx)(_.E,{size:"bodySm",tone:"secondary",children:"You can link another payout account anytime"})]})]})}),(0,r.jsxs)(s.a,{w:"100%",children:[(0,r.jsxs)(_.E,{size:"caption",tone:"muted",mb:2,children:["To confirm, type"," ",(0,r.jsx)(s.a,{as:"span",fontWeight:700,color:"text.primary",children:"REMOVE"})," ","below."]}),(0,r.jsx)(z.p,{value:q,onChange:e=>Q(e.target.value),autoComplete:"off",size:"lg",borderColor:"border.default",_hover:{borderColor:"border.strong"},placeholder:"REMOVE","aria-label":`Type REMOVE to remove ${b}`})]})]}):"change"===J?(0,r.jsxs)(l.T,{spacing:3,textAlign:"start",children:[(0,r.jsx)(_.E,{size:"bodySm",tone:"secondary",children:"You’ll be taken to PayPal to sign in and connect a different account."}),(0,r.jsxs)(_.E,{size:"bodySm",tone:"secondary",children:["Your current ",b," stays linked until the new account is ready. If you cancel, nothing changes."]})]}):(0,r.jsxs)(l.T,{spacing:2.5,textAlign:"start",children:[(0,r.jsxs)(_.E,{size:"bodySm",tone:"secondary",children:["Switch to a different ",b," account, or remove it entirely."]}),et&&(0,r.jsxs)(_.E,{size:"bodySm",tone:"secondary",children:["PayPal:"," ",(0,r.jsx)(s.a,{as:"span",fontWeight:600,color:"text.primary",children:et}),er&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),"Last updated:"," ",(0,r.jsx)(s.a,{as:"span",fontWeight:600,color:"text.primary",children:er})]})]})]})})}),(0,r.jsx)(P.jl,{flexDirection:"column",justifyContent:"center",gap:2.5,pt:4,children:"remove"===J?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.$,{intent:K?"danger":"ghost",size:"lg",shape:"pill",edge:K,w:"100%",position:"relative",sx:K?{"&::after":{content:'""',position:"absolute",inset:0,borderRadius:"inherit",animation:`${H} 1.5s ease-out`,pointerEvents:"none"}}:void 0,...K?{}:{color:"text.danger"},isLoading:T,loadingText:"Removing…",disabled:!K||T,onClick:async()=>{W(!0);try{await o(),C(!1)}catch{}finally{W(!1)}},children:["Remove ",b]}),(0,r.jsx)(I.$,{intent:"ghost",size:"md",shape:"pill",w:"100%",_hover:{bg:"transparent"},_active:{bg:"transparent"},disabled:N,onClick:()=>Y("hub"),children:"Go back"}),(0,r.jsx)(y.c,{borderColor:"border.subtle",my:-1}),(0,r.jsx)(I.$,{intent:"ghost",size:"sm",shape:"pill",w:"100%",mb:-3,color:"text.muted",_hover:{bg:"transparent"},_active:{bg:"transparent"},disabled:T,onClick:()=>{eo(),ee(!0)},children:"Need help? Contact support"})]}):"change"===J?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.$,{intent:"primary",size:"lg",shape:"pill",edge:!0,w:"100%",position:"relative",isLoading:N,loadingText:"Taking you to PayPal…",disabled:N,sx:N?void 0:{"&::after":{content:'""',position:"absolute",inset:0,borderRadius:"inherit",animation:`${E} 1.5s ease-out`,pointerEvents:"none"}},onClick:()=>{G(!0),window.location.href=p},children:["Continue to PayPal",(0,r.jsx)(s.a,{as:"span",display:"inline-flex",ml:2,"aria-hidden":!0,children:(0,r.jsx)(O,{})})]}),(0,r.jsx)(I.$,{intent:"ghost",size:"md",shape:"pill",w:"100%",_hover:{bg:"transparent"},_active:{bg:"transparent"},disabled:N,onClick:()=>Y("hub"),children:"Go back"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.$,{intent:"primary",size:"lg",shape:"pill",edge:!0,w:"100%",onClick:()=>Y("change"),children:["Change linked ",b," account"]}),(0,r.jsxs)(I.$,{intent:"ghost",size:"md",shape:"pill",w:"100%",_hover:{bg:"transparent"},_active:{bg:"transparent"},onClick:()=>{Q(""),Y("remove")},children:["Remove ",b," account"]})]})})]}),(0,r.jsxs)(c.s,{justifyContent:"space-between",alignItems:"center",children:[(0,r.jsxs)(g.z,{gap:"10px",children:[(0,r.jsx)(h,{...ei}),n&&(0,r.jsxs)(g.z,{spacing:"5px",h:"18px",px:"7px",borderRadius:"full",bg:"whiteAlpha.800",flexShrink:0,cursor:"default",children:[(0,r.jsx)(s.a,{w:"6px",h:"6px",borderRadius:"full",bg:"success.600",flexShrink:0}),(0,r.jsx)(f.E,{fontFamily:"ui",fontSize:"2xs",fontWeight:600,color:"success.600",lineHeight:"1",children:"Connected"})]})]}),n?(0,r.jsxs)(w.A,{placement:"bottom-end",gutter:8,isLazy:!0,children:[(0,r.jsx)(k.W,{children:(0,r.jsx)(s.a,{as:"button",type:"button","aria-label":`${b} account options`,display:"flex",alignItems:"center",justifyContent:"center",h:"28px",w:"28px",borderRadius:"md",color:"white",cursor:"pointer",transition:"background-color 120ms ease",_hover:{bg:"whiteAlpha.300"},_active:{bg:"whiteAlpha.400"}
9,_focusVisible:{outline:"2px solid",outlineColor:"whiteAlpha.700",outlineOffset:"2px"},children:(0,r.jsx)(F,{})})}),(0,r.jsx)(v.h,{w:"240px",borderRadius:"xl",borderWidth:"1px",borderColor:"border.subtle",bg:"bg.surface",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06)",_dark:{borderColor:"rgba(255, 255, 255, 0.12)",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3)"},_focusVisible:{outline:"none"},children:(0,r.jsxs)(S.e,{p:1,children:[(0,r.jsx)(A,{fullName:b,email:"paypal"===t?a?.paypal?.primary_email:a?.stripeEmail,merchantId:"paypal"===t?a?.paypal?.merchant_id:a?.stripe?.id,lastUpdatedAt:"paypal"===t?a?.paypalLastUpdatedAt:a?.stripeLastUpdatedAt}),(0,r.jsx)(y.c,{mb:1,borderColor:"border.subtle",_dark:{borderColor:"whiteAlpha.200"}}),(0,r.jsx)(Z,{label:`Visit ${b} dashboard`,icon:(0,r.jsx)(O,{}),href:x}),(0,r.jsx)(Z,{label:`Change ${b} account`,icon:(0,r.jsx)($,{}),onClick:()=>C(!0)})]})})]}):(0,r.jsxs)(g.z,{cursor:"pointer",h:"25px",gap:"2px",p:"5px",borderRadius:"5px",children:[(0,r.jsx)(f.E,{color:d,fontSize:"15px",fontWeight:"600",children:"Connect"}),(0,r.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M16.6663 13.4163V15.3886C16.6663 15.8601 16.479 16.3122 16.1456 16.6456C15.8122 16.979 15.3601 17.1663 14.8886 17.1663H5.11079C4.63929 17.1663 4.1871 16.979 3.85371 16.6456C3.52031 16.3122 3.33301 15.8601 3.33301 15.3886V5.61079C3.33301 5.13929 3.52031 4.6871 3.85371 4.35371C4.1871 4.02031 4.63929 3.83301 5.11079 3.83301H7.08301",stroke:d,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10.833 3.83301H16.6663V9.66634",stroke:d,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10 10.4997L16.6667 3.83301",stroke:d,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]}),(0,r.jsx)(B,{isIntegrated:n,unlinkedMessage:m})]})})};var G=n(91106),J=n.n(G);let Y="linear-gradient(92.46deg, #065F46 0%, #12A17B 100%)",q={in_review:{label:"In review",color:"blue.500"},approved:{label:"Connected",color:"success.600"},action_needed:{label:"Action needed",color:"orange.600"}},Q={not_started:"Get paid directly into your bank account. Available to registered US and Canadian businesses.",in_progress:null,in_review:"Your ACH payout request is under review. We’ll email you when it’s ready or if more information is needed.",approved:null,action_needed:"We need a few more details to finish verifying your business"};function K(e){let{color:t="white"}=e;return(0,r.jsx)(s.a,{as:"svg",width:"15px",height:"15px",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:(0,r.jsx)("path",{d:"M6 3.5 10.5 8 6 12.5",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}let X=e=>{let{status:t,bankLast4:n,bankNickname:i,lastUpdatedAt:a,progressPercent:o}=e,l=q[t],d=Q[t],p="not_started"===t,x=p?"#065F46":"white",h=a?new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,u=Math.round(Math.max(0,Math.min(100,o??0))/100*4),b=(0,r.jsx)(s.a,{width:"100%",borderRadius:"12px",display:"block",background:Y,padding:"2px",children:(0,r.jsxs)(s.a,{background:p?"white":Y,borderRadius:"10px",padding:"10px 14px",boxShadow:"approved"===t?"inset 0 0 0 1px rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.55)":void 0,children:[(0,r.jsxs)(c.s,{justifyContent:"space-between",alignItems:"center",children:[(0,r.jsxs)(g.z,{gap:"10px",children:[(0,r.jsx)(f.E,{color:x,fontSize:"19px",fontWeight:"700",lineHeight:"21px",letterSpacing:"-0.02em",whiteSpace:"nowrap",flexShrink:0,children:"Bank account"}),l&&(0,r.jsxs)(g.z,{spacing:"5px",h:"18px",px:"7px",borderRadius:"full",bg:"whiteAlpha.800",flexShrink:0,cursor:"default",children:[(0,r.jsx)(s.a,{w:"6px",h:"6px",borderRadius:"full",bg:l.color,flexShrink:0}),(0,r.jsx)(f.E,{fontFamily:"ui",fontSize:"2xs",fontWeight:600,color:l.color,lineHeight:"1",whiteSpace:"nowrap",children:l.label})]})]}),"approved"===t?(0,r.jsxs)(w.A,{placement:"bottom-end",gutter:8,isLazy:!0,children:[(0,r.jsx)(k.W,{children:(0,r.jsx)(s.a,{as:"button",type:"button","aria-label":"Bank account options",display:"flex",alignItems:"center",justifyContent:"center",h:"28px",w:"28px",borderRadius:"md",color:"white",cursor:"pointer",transition:"background-color 120ms ease",_hover:{bg:"whiteAlpha.300"},_active:{bg:"whiteAlpha.400"}
9,_focusVisible:{outline:"2px solid",outlineColor:"whiteAlpha.700",outlineOffset:"2px"},children:(0,r.jsx)(F,{})})}),(0,r.jsx)(v.h,{w:"240px",borderRadius:"xl",borderWidth:"1px",borderColor:"border.subtle",bg:"bg.surface",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06)",_dark:{borderColor:"rgba(255, 255, 255, 0.12)",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3)"},_focusVisible:{outline:"none"},children:(0,r.jsx)(S.e,{p:1,children:(0,r.jsxs)(s.a,{px:2,pt:1.5,pb:2,children:[(0,r.jsx)(f.E,{fontFamily:"ui",fontSize:"xs",fontWeight:500,color:"text.muted",lineHeight:"1.2",children:"Linked bank account"}),(0,r.jsxs)(f.E,{mt:.5,fontFamily:"ui",fontSize:"sm",fontWeight:500,color:"text.secondary",overflowWrap:"anywhere",children:[i||"Business account",n?` •••• ${n}`:""]}),(0,r.jsxs)(f.E,{mt:2,fontFamily:"ui",fontSize:"xs",fontWeight:500,color:"text.muted",lineHeight:"1.2",children:["Last updated ",h||"—"]})]})})})]}):"not_started"===t?(0,r.jsxs)(g.z,{cursor:"pointer",h:"25px",gap:"2px",p:"5px",borderRadius:"5px",flexShrink:0,children:[(0,r.jsx)(f.E,{color:x,fontSize:"15px",fontWeight:"600",children:"Set up"}),(0,r.jsx)(K,{color:x})]}):"in_review"===t?null:(0,r.jsx)(s.a,{display:"flex",alignItems:"center",justifyContent:"center",h:"28px",w:"28px",flexShrink:0,children:(0,r.jsx)(K,{})})]}),"in_progress"===t&&(0,r.jsxs)(s.a,{pt:"10px",w:{base:"auto",md:"210px",lg:"auto"},children:[(0,r.jsx)(g.z,{spacing:"3px",children:Array.from({length:4},(e,t)=>(0,r.jsx)(s.a,{flex:"1",h:"4px",borderRadius:"full",bg:t<u?"white":"whiteAlpha.400"},t))}),(0,r.jsxs)(c.s,{mt:"6px",justifyContent:"space-between",alignItems:"baseline",gap:"8px",children:[(0,r.jsx)(f.E,{color:"white",fontSize:"xs",fontWeight:"600",children:"In progress"}),(0,r.jsxs)(f.E,{color:"rgba(255, 255, 255, 0.9)",fontSize:"xs",fontWeight:"500",children:[u," of ",4," steps done"]})]})]}),d&&(0,r.jsx)(s.a,{pt:"10px",w:{base:"auto",md:"210px",lg:"auto"},children:(0,r.jsx)(f.E,{color:p?"gray.600":"rgba(255, 255, 255, 0.9)",fontSize:"xs",fontWeight:"500",children:d})})]})});return"approved"===t||"in_review"===t?b:(0,r.jsx)(J(),{href:"/business-onboarding",style:{display:"block"},"aria-label":"Bank account payouts",children:b})};var ee=n(51447),et=n(163),en=n(86354),er=n(45050),ei=n(71536);let ea=async e=>{(0,ei.setCookie)(null,"idtoken",`Bearer ${await e?.getIdToken()}`,{maxAge:3600,path:"/",sameSite:"strict",secure:!0})},eo=async()=>{(0,ei.setCookie)(null,"idtoken","",{maxAge:3600,path:"/",sameSite:"strict",secure:!0})};var es=n(75942),el=n(31787),ed=n(38539),ec=n(86715),ep=n(42669);let ex=()=>(0,r.jsx)(s.a,{alignSelf:"center",children:(0,r.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M15.8333 9.16699H4.16667C3.24619 9.16699 2.5 9.91318 2.5 10.8337V16.667C2.5 17.5875 3.24619 18.3337 4.16667 18.3337H15.8333C16.7538 18.3337 17.5 17.5875 17.5 16.667V10.8337C17.5 9.91318 16.7538 9.16699 15.8333 9.16699Z",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5.83398 9.16699V5.83366C5.83398 4.72859 6.27297 3.66878 7.05437 2.88738C7.83577 2.10598 8.89558 1.66699 10.0007 1.66699C11.1057 1.66699 12.1655 2.10598 12.9469 2.88738C13.7283 3.66878 14.1673 4.72859 14.1673 5.83366V9.16699",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})});var eh=n(67707),eu=n(83963),eg=n(56989),ef=n(89300),eb=n(17389),em=n(82515),ej=n(83e3),eC=n(97707),ey=n(12024),ew=n(1982),ek=n(17824),ev=n(75886),eS=n.n(ev);let eL=()=>(0,r.jsx)(eS(),{color:"#ffffff",loading:!0,size:9});var eD=n(32158),eP=n(95461),eM=n(92581),e_=n(3290);let eI=e=>{let{height:t,width:n}=e;return(0,r.jsx)("svg",{width:n,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M13.7798 4.22032C13.9203 4.36094 13.9992 4.55157 13.9992 4.75032C13.9992 4.94907 13.9203 5.13969 13.7798 5.28032L6.52982 12.5303C6.3892 12.6708 6.19857 12.7497 5.99982 12.7497C5.80107 12.7497 5.61045 12.6708 5.46982 12.5303L2.21982 9.28032C2.08741 9.13805 2.01531 8.95 2.01867 8.75569C2.02202 8.56137 2.100
958 8.37592 2.23782 8.23832C2.37543 8.10107 2.56087 8.02252 2.75519 8.01916C2.94951 8.0158 3.13756 8.08791 3.27982 8.22032L5.99982 10.9403L12.7198 4.22032C12.8604 4.07987 13.0511 4.00098 13.2498 4.00098C13.4486 4.00098 13.6392 4.07987 13.7798 4.22032Z",fill:"#238636"})})};var ez=n(85950);let eT=e=>{let{uploadLater:t,selectedCountry:n,setSelectedCountry:a}=e,[o,l]=i.useState(""),[d,c]=i.useState([]),[p,x]=i.useState(-1),h=i.useRef(null),u=i.useRef(null),[g,f]=i.useState("");i.useEffect(()=>{n&&l(n)},[n]);let b=e=>{l(e),a(e),c([]),x(-1),h.current&&h.current.blur()},m=["United States","United Kingdom","New Zealand","France","Germany","Ireland","Canada","Australia"];return i.useEffect(()=>{p>=0&&u.current&&u.current.children[p].scrollIntoView({block:"nearest"})},[p]),(0,r.jsxs)(s.a,{position:"relative",width:"100%",children:[(0,r.jsx)(ey.p,{ref:h,value:o,onChange:e=>{let t=e.target.value;l(t),f(t);let r=Object.keys(ed.x8).find(e=>e.toLowerCase()===t.toLowerCase());if(r)b(r);else if(t!==n&&a(""),t){let e=t.toLowerCase(),n=m.filter(t=>t.toLowerCase().startsWith(e)||t.toLowerCase().includes(e));c(Array.from(new Set([...n,...Object.keys(ed.x8).filter(t=>t.toLowerCase().startsWith(e)),...Object.keys(ed.x8).filter(t=>!t.toLowerCase().startsWith(e)&&t.toLowerCase().includes(e)),...Object.keys(ed.x8).filter(t=>ed.x8[t].aliases?.some(t=>t.toLowerCase().includes(e)))]))),x(-1)}else a(""),c([]),x(-1)},onKeyDown:e=>{if("Enter"===e.key&&p>=0){e.preventDefault(),b(d[p]);return}"ArrowDown"===e.key?(e.preventDefault(),x(e=>Math.min(e+1,d.length-1))):"ArrowUp"===e.key?(e.preventDefault(),x(e=>Math.max(e-1,0))):"Enter"===e.key&&o===g&&e.preventDefault()},placeholder:n?"":"Country",bg:"rgba(0, 0, 0, 0.06)",height:"53px",borderRadius:"10px",color:"rgba(0, 0, 0, 0.8)",fontWeight:"500",_hover:{backgroundColor:"rgba(0, 0, 0, 0.1)"},outline:"2px solid transparent",outlineOffset:"2px",_focus:{boxShadow:"none",border:"none"},autoComplete:"off",autoCorrect:"off",name:"new-country",type:"search",required:!t}),d.length>0&&(0,r.jsx)(ez.B8,{ref:u,position:"absolute",bg:"white",width:"100%",maxHeight:"200px",overflowY:"auto",boxShadow:"md",zIndex:4,borderRadius:"10px",children:d.map((e,t)=>(0,r.jsx)(ez.ck,{padding:"8px",cursor:"pointer",backgroundColor:p===t?"rgba(0, 0, 0, 0.06)":"transparent",color:"rgba(0, 0, 0, 0.8)",fontWeight:"500",_hover:{backgroundColor:"rgba(0, 0, 0, 0.1)"},borderRadius:"10px",onClick:()=>b(e),children:`${ed.x8[e].emoji} ${e}`},e))})]})},eE=()=>(0,r.jsx)(s.a,{alignSelf:"center",children:(0,r.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M15 9H18M15 12H18M15 15H18M12 16C11.6936 15.3871 11.0672 15 10.382 15H7.61803C6.93283 15 6.30643 15.3871 6 16M4 5H20C20.5523 5 21 5.44772 21 6V18C21 18.5523 20.5523 19 20 19H4C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5ZM11 10C11 11.1046 10.1046 12 9 12C7.89543 12 7 11.1046 7 10C7 8.89543 7.89543 8 9 8C10.1046 8 11 8.89543 11 10Z",stroke:"#383838",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),eH=e=>{let{selectedCountry:t,setSelectedCountry:n,uploadLater:a,isUploadingBack:o,backIDURL:d,onFrontIDDelete:x,onBackIDDelete:h,userIdRejected:u,isUploadingFront:m,frontID:j,backID:C,frontIDURL:y,onFrontIDChange:w,onBackIDChange:k,idVerificationStatus:v,userCanSubmitID:S}=e,L=(0,p.S)(),D=i.useRef(null),[P,M]=i.useState(!1);i.useEffect(()=>{j||y||m?M(!0):M(!1)},[y,j,u,m]);let[_,I]=i.useState(!1);i.useEffect(()=>{C||d||o?I(!0):I(!1)},[d,C,o]);let z=i.useRef(null),T="rejected"===v?(0,r.jsx)(eD.A,{}):"approved"===v?(0,r.jsx)(eP.A,{}):"submitted"===v?(0,r.jsx)(eM.A,{}):(0,r.jsx)(e_.A,{});return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(s.a,{children:[(0,r.jsxs)(g.z,{justifyContent:"space-between",alignItems:"center",mb:"12px",spacing:"5px",w:"100%",children:[(0,r.jsx)(eC.l,{fontSize:"sm",fontWeight:"600",lineHeight:"normal",margin:"0",children:(0,r.jsxs)(c.s,{alignItems:"center",children:[(0,r.jsx)(eE,{}),(0,r.jsx)(s.a,{mx:"4px",children:"Government ID"})]})}),T]}),(0,r.jsx)(eC.l,{pb:"12px",mb:"12px",w:"100%",color:"rejected"===v?"red.500":"#626262",fontSize:"sm",fontWeight:"600",lineHeight:"normal",margin:"0",children:"approved"===v?"Great news! Your documents have been successfully verified.":"submitted"===v?"Your documents have been received and are now under review.":"rejected"===v?"Your documents did not meet the requirements. Please resubmit a passport, driver's license, national ID, residency permit, military ID, or any government-issued ID with your photo and name.":"Please submit your documents for verification to proceed"}),S&&(0,r.jsxs)(s.a,{children:[(0,r.jsxs)(g.z,{pb:"12px",gap:"5px",children:[(0,r.jsx)(f.E,{textAlign:"center",fontWeight:600,fontSize:"sm",children:"ID issuing country"}),(0,r.jsx)(b.S,{in:!!t,animateOpacity:!0,children:(0,r.jsx)(eI,{width:"15",height:"15"})})]}),(0,r.jsx)(eT,{uploadLater:a,selectedCountry:t,setSelectedCountry:n})]}),S&&(0,r.jsxs)(g.z,{pt:"16px",pb:"8px",spacing:5,flexDirection:{base:"column",md:"row"},children:[(0,r.jsxs)(l.T,{w:"100%",children:[(0,r.jsxs)(s.a,{position:"relative",width:"100%",h:"128px",borderWidth:"1.5px",borderRadius:"xl",bg:P?"green.300":"",borderColor:P?"black":"gray.300",onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault();let t=e.dataTransfer.files[0];if(t){if(!["image/jpeg","image/png","application/pdf"].includes(t.type)){L.info("Unsupported file type. Only JPG, JPEG, PNG, and PDF are supported");return}w({target:{files:e.dataTransfer.files}})}},_focus:{background:P?"":"rgba(0, 0, 0, 0.6)"},cursor:"pointer",_hover:{background:P?"":"rgba(0, 0, 0, 0.09)",transition:"0.3s"},_loading:{background:"rgba(256, 256, 256, 0.7)"},children:[(0,r.jsx)(ey.p,{ref:D,type:"file",accept:"image/*,.pdf",onChange:w,onClick:e=>{P&&e.preventDefault()},position:"absolute",top:"0",left:"0",zIndex:2,w:"100%",h:"100%",opacity:"0",cursor:P?"default":"pointer","aria-label":"File Upload",required:!a&&!y}),P?(0,r.jsxs)(l.T,{gap:"10px",w:"100%",justify:"center",h:"100%",children:[(0,r.jsx)(s.a,{w:"100%",display:"flex",alignItems:"center",justifyContent:"center",h:"45px",children:m?(0,r.jsx)(eL,{}):(0,r.jsxs)("svg",{width:"45",height:"45",viewBox:"0 0 27 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M13 26C13.75 26 14.479 25.923 15.194 25.801C13.838 24.444 13 22.57 13 20.5C13 17.243 15.079 14.48 17.978 13.443C18.078 13.206 18.168 12.94 18.239 12.648C18.507 11.563 18.436 10.61 18.078 10.521C18.043 10.512 18.008 10.518 17.972 10.526C18.053 9.649 18.028 8.819 17.779 8.459C17.003 7.349 16.937 6.37 15.761 5.947C14.588 5.523 16 4 16 4C16 4 10.976 4.141 9.905 5.945C9.276 7 8.972 7.348 8.197 8.458C7.947 8.819 7.94 9.651 8.047 10.527C8.002 10.515 7.959 10.51 7.917 10.521C7.558 10.61 7.486 11.563 7.754 12.648C8.008 13.671 8.471 14.435 8.82 14.444C9.036 15.649 9.39 16.761 9.997 17.375C11.497 18.893 8.497 20.411 8.497 20.411C8.497 20.411 7.56 20.806 7.455 20.849C6.795 21.134 5.903 21.532 5.039 21.954C2.568 19.755 1 16.561 1 13C1 6.383 6.383 1 13 1C19.617 1 25 6.383 25 13C25 13.488 24.965 13.968 24.907 14.44C25.222 14.671 25.525 14.918 25.801 15.194C25.923 14.479 26 13.75 26 13C26 5.82 20.18 0 13 0C5.82 0 0 5.82 0 13C0 20.18 5.82 26 13 26Z",fill:"white"}),(0,r.jsx)("path",{d:"M20.5 14C16.91 14 14 16.91 14 20.5C14 24.09 16.91 27 20.5 27C24.09 27 27 24.09 27 20.5C27 16.91 24.09 14 20.5 14ZM24.59 20.898L23.858 21.58L21 18.505V24H20V18.507L17.144 21.58L16.411 20.898L20.501 16.5L24.59 20.898Z",fill:"white"})]})}),(0,r.jsx)(f.E,{w:"100%",color:"white",textAlign:"center",fontWeight:600,fontSize:"sm",children:j?`Secure ${"application/pdf"===j.type?"PDF":"Image"}
9 Encrypted`:"Secure Upload Encrypted"}),(0,r.jsx)(ew.K,{icon:(0,r.jsx)(ek.U,{}),size:"xs",display:y?"flex":"none",position:"absolute",top:"-8px",right:"-8px",zIndex:3,borderRadius:"50%",bg:"black",_hover:{cursor:"pointer",backgroundColor:"rgba(0, 0, 0, 0.80)"},color:"white",onClick:()=>{D.current&&(D.current.value=""),x(),M(!1),w({target:{files:null}})},"aria-label":"Remove image"})]}):(0,r.jsxs)(l.T,{justify:"center",opacity:"0.6",spacing:"2px",h:"100%",mt:"5px",children:[(0,r.jsx)(s.a,{w:"100%",display:"flex",alignItems:"center",justifyContent:"center",mb:"20px",children:(0,r.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M19.25 13.75V17.4167C19.25 17.9029 19.0568 18.3692 18.713 18.713C18.3692 19.0568 17.9029 19.25 17.4167 19.25H4.58333C4.0971 19.25 3.63079 19.0568 3.28697 18.713C2.94315 18.3692 2.75 17.9029 2.75 17.4167V13.75",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M15.5834 7.33333L11.0001 2.75L6.41675 7.33333",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M11 2.75V13.75",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),(0,r.jsxs)(f.E,{w:"100%",display:{base:"none",md:"block"},textAlign:"center",fontWeight:600,fontSize:"sm",children:[(0,r.jsx)(s.a,{as:"span",textDecoration:"underline",children:"Click to upload"})," ","or drag & drop"]}),(0,r.jsx)(f.E,{w:"100%",display:{base:"block",md:"none"},textAlign:"center",fontWeight:600,fontSize:"sm",children:"Click to upload"}),(0,r.jsx)(f.E,{fontSize:"xs",color:"gray.600",mt:"0",children:"Accepted file types: JPG, JPEG, PNG, and PDF"})]})]}),(0,r.jsxs)(g.z,{gap:"5px",children:[(0,r.jsx)(f.E,{textAlign:"center",fontWeight:600,fontSize:"sm",children:"Front of document"}),(0,r.jsx)(b.S,{in:P,animateOpacity:!0,children:(0,r.jsx)(eI,{width:"15",height:"15"})})]})]}),(0,r.jsxs)(l.T,{w:"100%",children:[(0,r.jsxs)(s.a,{position:"relative",width:"100%",h:"128px",borderWidth:"1.5px",borderRadius:"xl",bg:_?"green.300":"",borderColor:_?"black":"gray.300",onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault();let t=e.dataTransfer.files[0];if(t){if(!["image/jpeg","image/png","application/pdf"].includes(t.type)){L.info("Unsupported file type. Only JPG, JPEG, PNG, and PDF are supported");return}k({target:{files:e.dataTransfer.files}})}},_focus:{background:_?"":"rgba(0, 0, 0, 0.6)"},cursor:"pointer",_hover:{background:_?"":"rgba(0, 0, 0, 0.09)",transition:"0.3s"},_loading:{background:"rgba(256, 256, 256, 0.7)"},children:[(0,r.jsx)(ey.p,{ref:z,type:"file",accept:"image/*,.pdf",onChange:k,onClick:e=>{_&&e.preventDefault()},position:"absolute",top:"0",left:"0",zIndex:2,w:"100%",h:"100%",opacity:"0",cursor:_?"default":"pointer","aria-label":"File Upload",required:!a&&!d}),_?(0,r.jsxs)(l.T,{gap:"10px",w:"100%",justify:"center",h:"100%",children:[(0,r.jsx)(s.a,{w:"100%",display:"flex",alignItems:"center",justifyContent:"center",h:"45px",children:o?(0,r.jsx)(eL,{}):(0,r.jsxs)("svg",{width:"45",height:"45",viewBox:"0 0 27 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M13 26C13.75 26 14.479 25.923 15.194 25.801C13.838 24.444 13 22.57 13 20.5C13 17.243 15.079 14.48 17.978 13.443C18.078 13.206 18.168 12.94 18.239 12.648C18.507 11.563 18.436 10.61 18.078 10.521C18.043 10.512 18.008 10.518 17.972 10.526C18.053 9.649 18.028 8.819 17.779 8.459C17.003 7.349 16.937 6.37 15.761 5.947C14.588 5.523 16 4 16 4C16 4 10.976 4.141 9.905 5.945C9.276 7 8.972 7.348 8.197 8.458C7.947 8.819 7.94 9.651 8.047 10.527C8.002 10.515 7.959 10.51 7.917 10.521C7.558 10.61 7.486 11.563 7.754 12.648C8.008 13.671 8.471 14.435 8.82 14.444C9.036 15.649 9.39 16.761 9.997 17.375C11.497 18.893 8.497 20.411 8.497 20.411C8.497 20.411 7.56 20.806 7.455 20.849C6.795 21.134 5.903 21.532 5.039 21.954C2.568 19.755 1 16.561 1 13C1 6.383 6.383 1 13 1C19.617 1 25 6.383 25 13C25 13.488 24.965 13.968 24.907 14.44C25.222 14.671 25.525 14.918 25.801 15.194C25.923 14.479 26 13.75 26 13C26 5.82 20.18 0 13 0C5.82 0 0 5.82 0 13C0 20.18 5.82 26 13 26Z",fill:"white"}),(0,r.jsx)("path",{d:"M20.5 14C16.91 14 14 16.91 14 20.5C14 24.09 16.91 27 20.5 27C24.09 27 27 24.09 27 20.5C27 16.91 24.09 14 20.5 14ZM24.59 20.898L23.858 21.58L21 18.505V24H20V18.507L17.144 21.58L16.411 20.898L20.501 16.5L24.59 20.898Z",fill:"white"})]})}),(0,r.jsx)(f.E,{w:"100%",color:"white",textAlign:"center",fontWeight:600,fontSize:"sm",children:C?`Secure ${"application/pdf"===C.type?"PDF":"Image"}
9 Encrypted`:"Secure Upload Encrypted"}),(0,r.jsx)(ew.K,{icon:(0,r.jsx)(ek.U,{}),size:"xs",display:d?"flex":"none",position:"absolute",top:"-8px",right:"-8px",zIndex:3,borderRadius:"50%",bg:"black",_hover:{cursor:"pointer",backgroundColor:"rgba(0, 0, 0, 0.80)"},color:"white",onClick:()=>{z.current&&(z.current.value=""),h(),I(!1),k({target:{files:null}})},"aria-label":"Remove image"})]}):(0,r.jsxs)(l.T,{justify:"center",opacity:"0.6",spacing:"2px",h:"100%",mt:"5px",children:[(0,r.jsx)(s.a,{w:"100%",display:"flex",alignItems:"center",justifyContent:"center",mb:"20px",children:(0,r.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M19.25 13.75V17.4167C19.25 17.9029 19.0568 18.3692 18.713 18.713C18.3692 19.0568 17.9029 19.25 17.4167 19.25H4.58333C4.0971 19.25 3.63079 19.0568 3.28697 18.713C2.94315 18.3692 2.75 17.9029 2.75 17.4167V13.75",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M15.5834 7.33333L11.0001 2.75L6.41675 7.33333",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M11 2.75V13.75",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),(0,r.jsxs)(f.E,{w:"100%",display:{base:"none",md:"block"},textAlign:"center",fontWeight:600,fontSize:"sm",children:[(0,r.jsx)(s.a,{as:"span",textDecoration:"underline",children:"Click to upload"})," ","or drag & drop"]}),(0,r.jsx)(f.E,{w:"100%",display:{base:"block",md:"none"},textAlign:"center",fontWeight:600,fontSize:"sm",children:"Click to upload"}),(0,r.jsx)(f.E,{fontSize:"xs",color:"gray.600",mt:"0",children:"Accepted file types: JPG, JPEG, PNG, and PDF"})]})]}),(0,r.jsxs)(g.z,{gap:"5px",children:[(0,r.jsx)(f.E,{textAlign:"center",fontWeight:600,fontSize:"sm",children:"Back of document"}),(0,r.jsx)(b.S,{in:_,animateOpacity:!0,children:(0,r.jsx)(eI,{width:"15",height:"15"})})]})]})]})]})})},eW=(0,T.P)(s.a),eV=e=>{let{isOpen:t,onClose:n}=e,[a,o]=(0,en.hD)(er.j2),c=(0,es.useQueryClient)(),x=(0,p.S)(),h=(0,ec.useRouter)(),{data:u}=(0,es.useQuery)(["userDocument",a,o],(0,el.Q)(a,o)),b=u?.user?.accountInfo?.verification,m=u?.user?.accountInfo?.creationTime,C=b?.idVerificationStatus??"awaiting",[y,w]=i.useState(null),[k,v]=i.useState(null),[S,L]=i.useState(""),[D,P]=i.useState(""),[M,_]=i.useState(""),[I,z]=i.useState(!1),[T,E]=i.useState(!1),[H,W]=i.useState(""),V=i.useRef(!1),R=i.useRef(!1),A=i.useRef(null),B=i.useRef(null);i.useEffect(()=>{if(!t){V.current=!1,R.current=!1,A.current=null,B.current&&(B.current.abort(),B.current=null);return}if(u&&!V.current){let e=b?.idCountry??"";_(e),L(b?.idUrlFront??""),P(b?.idUrlBack??""),w(null),v(null),A.current=e,V.current=!0}},[t,u,b?.idCountry,b?.idUrlFront,b?.idUrlBack]),i.useEffect(()=>{if(!t||!a||!V.current||!M||M===A.current)return;A.current=M,B.current&&B.current.abort();let e=new AbortController;B.current=e,(async()=>{try{let t=await fetch("/api/user/setup",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await a.getIdToken()}`},body:JSON.stringify({profile:{},accountInfo:{verification:{idCountry:M}},paymentInfo:{}}),signal:e.signal});if(!t.ok)throw Error(`HTTP error! status: ${t.status}`);c.setQueryData(["userDocument",a,o],e=>e?{...e,user:{...e.user,accountInfo:{...e.user?.accountInfo??{},verification:{...e.user?.accountInfo?.verification??{},idCountry:M}}}}:e)}catch(e){if("AbortError"===e.name)return;console.error("Failed to persist idCountry:",e),A.current=null}finally{B.current===e&&(B.current=null)}})()},[t,a,M,c,o]);let F=async(e,t)=>{if(a)try{let n=await fetch("/api/user/updateDocumentID",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await a.getIdToken()}`},body:JSON.stringify({downloadURL:e,documentType:t})});if(!n.ok)throw Error(`HTTP error! status: ${n.status}`)}catch(e){console.error("Failed to update ID URL in Firestore:",e),W("Failed to update ID URL in Firestore")}finally{"id_front"===t?(L(e),z(!1)):(P(e),E(!1))}},O=async e=>{if(a)try{let t=await fetch("/api/user/updateDocumentID",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await a.getIdToken()}`},body:JSON.stringify({downloadURL:"",documentType:e})});if(!t.ok)throw Error(`HTTP error! status: ${t.status}`)}catch(e){console.error("Failed to delete ID URL in Firestore:",e),W("Failed to delete ID URL in Firestore")}},$=async e=>{if(e.target.files&&e.target.files.length>0){let t=e.target.files[0],n=t.type;if(t.size>5242880){x.info("File size exceeds 5 MB. Please upload a smaller file"),w(null);return}if(!["image/jpeg","image/png","application/pdf"].includes(n)){x.info("Unsupported file type. Only JPG, JPEG, PNG, and PDF are supported"),w(null);return}z(!0),w(t);let r=await (0,ej.e)(t,a,W,"id_front");r?F(r,"id_front"):(console.log({title:"Error uploading front ID.",description:H}),z(!1))}else z(!1),w(null)},U=async e=>{if(e.target.files&&e.target.files.length>0){let t=e.target.files[0],n=t.type;if(t.size>5242880){x.info("File size exceeds 5 MB. Please upload a smaller file"),v(null);return}if(!["image/jpeg","image/png","application/pdf"].includes(n)){x.info("Unsupported file type. Only JPG, JPEG, PNG, and PDF are supported"),v(null);return}E(!0),v(t);let r=await (0,ej.e)(t,a,W,"id_back");r?F(r,"id_back"):(console.log({title:"Error uploading back ID.",description:H}),E(!1))}else E(!1),v(null)},Z=async()=>{a&&await (0,ej.N)(a,"id_front",W)&&(O("id_front"),w(null),L(""),R.current=!1)},N=async()=>{a&&await (0,ej.N)(a,"id_back",W)&&(O("id_back"),v(null),P(""),R.current=!1)},[G,J]=i.useState(!1),Y=!!S&&!!D&&!!M&&!I&&!T&&"submitted"!==C&&"approved"!==C,q=async()=>
9{if(a&&Y&&!R.current){R.current=!0,J(!0);try{let e=await fetch("/api/user/setup",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await a.getIdToken()}`},body:JSON.stringify({profile:{},accountInfo:{verification:{idCountry:M,idVerificationStatus:"submitted",idUploadLocation:"payments.id-modal"}},paymentInfo:{}})});if(!e.ok)throw Error(`HTTP error! status: ${e.status}`);c.setQueryData(["userDocument",a,o],e=>e?{...e,user:{...e.user,accountInfo:{...e.user?.accountInfo??{},verification:{...e.user?.accountInfo?.verification??{},idVerificationStatus:"submitted",idUploadLocation:"payments.id-modal"}}}}:e),c.invalidateQueries(["userDocument",a,o]).catch(()=>{})}catch(e){console.error("Failed to submit ID verification:",e),x.error("Failed to submit ID for verification. Please try again."),R.current=!1}finally{J(!1)}}},Q="submitted"===C||"approved"===C,K=Q?"You’re all set":"Verify your identity",X=Q?"We’ve received your documents and are reviewing them. You are now able to link a payout method.":ed.zQ.personalIDTooltip;return(0,r.jsxs)(eh.aF,{blockScrollOnMount:!0,isOpen:t,onClose:n,isCentered:!0,motionPreset:"slideInBottom",children:[(0,r.jsx)(eu.m,{backdropFilter:"blur(2px)"}),(0,r.jsxs)(eg.$,{alignSelf:"center",borderRadius:"24px",maxW:"720px",bg:"white",maxH:"95vh",overflow:"hidden",mx:{base:"16px",md:0},children:[(0,r.jsx)(ef.s,{top:"22px",right:"22px",size:"lg",borderRadius:"full"}),(0,r.jsx)(eb.c,{paddingTop:{base:"24px",md:"32px"},paddingBottom:{base:"20px",md:"28px"},paddingX:{base:"20px",md:"44px"},overflowY:"auto",children:(0,r.jsxs)(l.T,{align:"stretch",spacing:{base:"18px",md:"22px"},children:[(0,r.jsxs)(l.T,{align:"stretch",spacing:"10px",pr:{base:"32px",md:"40px"},children:[(0,r.jsxs)(g.z,{spacing:"12px",align:"center",children:[(0,r.jsx)(s.a,{display:"flex",alignItems:"center",justifyContent:"center",w:"40px",h:"40px",borderRadius:"full",bg:"rgba(48, 202, 54, 0.12)",flexShrink:0,children:(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M15.8333 9.16699H4.16667C3.24619 9.16699 2.5 9.91318 2.5 10.8337V16.667C2.5 17.5875 3.24619 18.3337 4.16667 18.3337H15.8333C16.7538 18.3337 17.5 17.5875 17.5 16.667V10.8337C17.5 9.91318 16.7538 9.16699 15.8333 9.16699Z",stroke:"#1b731e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5.83398 9.16699V5.83366C5.83398 4.72859 6.27297 3.66878 7.05437 2.88738C7.83577 2.10598 8.89558 1.66699 10.0007 1.66699C11.1057 1.66699 12.1655 2.10598 12.9469 2.88738C13.7283 3.66878 14.1673 4.72859 14.1673 5.83366V9.16699",stroke:"#1b731e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),(0,r.jsx)(s.a,{flex:"1",minH:"28px",position:"relative",children:(0,r.jsx)(em.N,{exitBeforeEnter:!0,initial:!1,children:(0,r.jsx)(eW,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.22,ease:"easeOut"},children:(0,r.jsx)(d.D,{as:"h2",fontWeight:"700",fontSize:{base:"20px",md:"22px"},lineHeight:"1.2",letterSpacing:"-0.01em",m:"0",children:K})},K)})})]}),(0,r.jsx)(s.a,{position:"relative",children:(0,r.jsx)(em.N,{exitBeforeEnter:!0,initial:!1,children:(0,r.jsx)(eW,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.22,ease:"easeOut"},children:(0,r.jsx)(f.E,{fontSize:{base:"13px",md:"14px"},color:"rgba(0, 0, 0, 0.55)",lineHeight:"1.45",children:X})},X)})})]}),(0,r.jsx)(s.a,{backgroundColor:"rgba(0, 0, 0, 0.025)",padding:{base:"16px 16px 12px 16px",md:"20px 24px 14px 24px"},borderRadius:"18px",borderWidth:"1px",borderStyle:"solid",borderColor:"rgba(0, 0, 0, 0.04)",children:(0,r.jsx)(eH,{frontID:y,backID:k,onFrontIDChange:$,onBackIDChange:U,onFrontIDDelete:Z,onBackIDDelete:N,idVerificationStatus:C,userCanSubmitID:"rejected"===C||"awaiting"===C||!!m&&m<1725634521e3&&"submitted"!==C,frontIDURL:S,backIDURL:D,isUploadingFront:I,isUploadingBack:T,selectedCountry:M,setSelectedCountry:_,uploadLater:!1,userIdRejected:"rejected"===C})}),(0,r.jsxs)(g.z,{spacing:"8px",justify:"center",pointerEvents:"none",children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_idmodal_lock)",children:[(0,r.jsx)("path",{d:"M9.5 5.5H2.5C1.94772 5.5 1.5 5.94772 1.5 6.5V10C1.5 10.5523 1.94772 11 2.5 11H9.5C10.0523 11 10.5 10.5523 10.5 10V6.5C10.5 5.94772 10.0523 5.5 9.5 5.5Z",stroke:"#30CA36",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M3.5 5.5V3.5C3.5 2.83696 3.76339 2.20107 4.23223 1.73223C4.70107 1.26339 5.33696 1 6 1C6.
966304 1 7.29893 1.26339 7.76777 1.73223C8.23661 2.20107 8.5 2.83696 8.5 3.5V5.5",stroke:"#30CA36",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_idmodal_lock",children:(0,r.jsx)("rect",{width:"12",height:"12",fill:"white"})})})]}),(0,r.jsx)(f.E,{color:"rgba(0, 0, 0, 0.5)",fontSize:"11px",fontWeight:500,letterSpacing:"0.01em",children:"Secured with end-to-end HTTPS encryption"})]}),(0,r.jsx)(s.a,{position:"relative",children:(0,r.jsx)(em.N,{exitBeforeEnter:!0,initial:!1,children:Q?(0,r.jsx)(eW,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.22,ease:"easeOut"},children:(0,r.jsx)(j.$,{variant:"textIconButtonWithBackgroundBlack",w:"100%",h:"46px",fontSize:"14px",fontWeight:600,onClick:()=>{n();let{pathname:e,query:t}=h;h.replace({pathname:e,query:{...t,linkPayout:"true"}},void 0,{shallow:!0})},children:"Continue to link payouts"})},"continue"):(0,r.jsx)(eW,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.22,ease:"easeOut"},children:(0,r.jsx)(j.$,{variant:"textIconButtonWithBackgroundBlack",w:"100%",h:"46px",fontSize:"14px",fontWeight:600,onClick:q,isLoading:G,loadingText:"Submitting",spinnerPlacement:"end",isDisabled:!Y,opacity:G||Y?1:.35,transition:"opacity 0.2s",_hover:{bg:"rgba(0, 0, 0, 0.8)"},_loading:{bg:"rgba(0, 0, 0, 1)",opacity:1,_hover:{bg:"rgba(0, 0, 0, 1)"}},_disabled:{opacity:G?1:.35,cursor:G?"wait":"not-allowed",background:"rgba(0, 0, 0, 1)"},children:"Submit for verification"})},"submit")})})]})})]})]})};var eR=n(74323);let eA=(0,C.keyframes)`
10  0% { border-color: rgba(48, 202, 54, 1); }
11  10% { border-color: white; }
12  20% { border-color: rgba(48, 202, 54, 1); }
13  30% { border-color: white; }
14  40% { border-color: rgba(48, 202, 54, 1); }
15  50% { border-color: white; }
16  60% { border-color: rgba(48, 202, 54, 1); }
17  70% { border-color: white; }
18  80% { border-color: rgba(48, 202, 54, 1); }
19  90% { border-color: white; }
20  100% { border-color: rgba(48, 202, 54, 1); }
21`,eB={email_not_confirmed:"Confirm your email on PayPal",payments_not_receivable:"Complete your verification on PayPal",product_not_active:"Complete your account setup on PayPal",individual_account:"Upgrade to a PayPal Business account"},eF=e=>{let{userAllowedToLinkPayouts:t,isPayPalLinked:n,paypalHasIssues:a,paypalLinkingIssues:o,paymentInfo:p,onRemove:x,onUploadID:C,showPointer:y=!1,finixStatus:w,bankPayoutsActive:k,finixProgressPercent:v}=e,[S,L]=i.useState(!1),[D,P]=i.useState(!1),M=(0,h.j)()?void 0:`${eA} 5s ease-in-out 1`,_=n||k,I=_&&"not_started"===w,z=_&&!n&&!a,T=I||z,E="in_review"===w||"action_needed"===w,H=n&&k?"PayPal and ACH bank account payouts are both connected.":n?"Tip payouts are set up through your connected PayPal account.":k?"Tip payouts are set up by ACH deposit to your connected bank account.":E?"Your bank account payout application is underway.":ed.zQ.linkPaymentsTooltip,W=w&&(0,r.jsx)(X,{status:w,bankLast4:p?.finix?.bankLast4,bankNickname:p?.finix?.bankNickname,lastUpdatedAt:p?.finixLastUpdatedAt,progressPercent:v}),V=(0,r.jsx)(N,{provider:"paypal",isIntegrated:n,paymentInfo:p,onRemove:x});return(0,r.jsxs)(s.a,{padding:{base:"20px",md:"20px 26px"},boxShadow:"0px 15px 87px rgba(0, 0, 0, 0.06), 0px 6.26664px 36.3465px rgba(0, 0, 0, 0.0431313), 0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 1.87823px 10.8938px rgba(0, 0, 0, 0.03), 0px 0.997515px 5.78559px rgba(0, 0, 0, 0.0242336), 0px 0.415088px 2.40751px rgba(0, 0, 0, 0.0168687);",borderRadius:"20px",backgroundColor:"white",minH:"157px",borderWidth:"2px",borderStyle:"solid",borderColor:"white",animation:y?M:void 0,children:[(0,r.jsxs)(c.s,{justifyContent:"space-between",alignItems:"center",marginBottom:"5px",children:[(0,r.jsx)(d.D,{variant:"dashboardCardTitle",children:(0,r.jsx)(s.a,{display:"flex",alignItems:"center",children:"Payout accounts"})}),!t&&(0,r.jsx)(ex,{}),t&&!_&&!E&&(0,r.jsx)(u.E,{alignSelf:"left",variant:"subtle",colorScheme:"red",children:"Required"})]}),(0,r.jsx)(s.a,{pt:"6px",display:"block",children:t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.D,{lineHeight:"20px",mb:"12px",variant:"tooltipHelperText",children:H}),a&&(0,r.jsxs)(s.a,{mb:"12px",bg:"orange.50",border:"1px solid",borderColor:"orange.200",borderRadius:"10px",overflow:"hidden",cursor:"pointer",onClick:()=>L(!S),transition:"all 0.2s",_hover:{borderColor:"orange.300"},children:[(0,r.jsxs)(g.z,{justify:"space-between",px:"12px",py:"10px",children:[(0,r.jsxs)(g.z,{spacing:"8px",children:[(0,r.jsx)(s.a,{w:"6px",h:"6px",borderRadius:"full",bg:"orange.400",flexShrink:0}),(0,r.jsx)(f.E,{fontSize:"13px",fontWeight:"500",color:"gray.700",children:"Action needed"})]}),(0,r.jsx)(s.a,{transform:S?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",children:(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,r.jsx)("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"#A0AEC0",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,r.jsx)(b.S,{in:S,animateOpacity:!0,children:(0,r.jsxs)(s.a,{px:"12px",pb:"12px",pt:"0",children:[(0,r.jsx)(s.a,{h:"1px",bg:"orange.200",mb:"10px"}),(0,r.jsxs)(l.T,{align:"flex-start",spacing:"6px",children:[o.map(e=>eB[e]?(0,r.jsx)(f.E,{fontSize:"12px",color:"gray.600",fontWeight:"400",children:eB[e]},e):null),(0,r.jsx)(m.N,{href:"https://www.paypal.com/mep/dashboard",target:"_blank",rel:"noopener noreferrer",fontSize:"12px",fontWeight:"500",color:"orange.500",pt:"4px",_hover:{color:"orange.600"},children:"Resolve on PayPal →"})]})]})})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.D,{lineHeight:"20px",variant:"tooltipHelperText",children:"To link your payout method, please upload a valid ID. This is required by our payment processors."}
21),(0,r.jsx)(j.$,{mt:"20px",variant:"textIconButtonWithBackgroundBlack",onClick:C,w:"100%",children:"Upload ID"})]})}),t&&(0,r.jsxs)(s.a,{children:[(0,r.jsxs)(l.T,{spacing:"12px",align:"stretch",children:[!I&&W,!z&&V]}),T&&(0,r.jsxs)(s.a,{mt:"6px",children:[(0,r.jsx)(s.a,{h:"1px",bg:"gray.100",mb:"1px"}),(0,r.jsxs)(c.s,{as:"button",type:"button",onClick:()=>P(!D),w:"100%",alignItems:"center",justifyContent:"space-between",py:"4px",color:"gray.500",transition:"color 0.15s ease",_hover:{color:"gray.700"},_focusVisible:{outline:"2px solid",outlineColor:"gray.400",outlineOffset:"2px"},children:[(0,r.jsx)(f.E,{fontSize:"12px",fontWeight:"500",lineHeight:"1.4",children:"More payout methods"}),(0,r.jsx)(s.a,{transform:D?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",children:(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":!0,children:(0,r.jsx)("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,r.jsx)(b.S,{in:D,animateOpacity:!0,children:(0,r.jsxs)(l.T,{spacing:"12px",align:"stretch",pt:"8px",children:[I&&W,z&&V]})})]})]})]})},eO=()=>{let[e,t]=(0,en.hD)(er.j2),{data:n,refetch:a}=(0,es.useQuery)(["userDocument",e,t],(0,el.Q)(e,t)),o=(0,eR.n)(),[s,l]=i.useState(!1),[d,c]=i.useState(!1),p=n?.user?.paymentInfo,x=!!p?.linkedPayPal,h=p?.paypalLinkingStatus==="issues",u=(0,ep.Un)(n),g=p?.finix?.onboardingState,f=(0,ep.Jh)(n),{data:b,status:m}=(0,es.useQuery)(["finixOnboardingDraft",e?.uid],()=>e?(0,ee._0)(e):Promise.resolve(null),{enabled:!!e&&(0,ep.iI)(n)&&!g}),j=p?.finix?.remediationSubmittedAt,C=et.Cw.filter(e=>(b?.completedScreens??[]).includes(e)).length,y=Math.round(C/et.Cw.length*100),w=null;f?g?w="UPDATE_REQUESTED"===g&&j?"in_review":({PROVISIONING:"in_review",APPROVED:"approved",UPDATE_REQUESTED:"action_needed",REJECTED:null})[g]:"success"===m&&(w=b&&b.createdAt>0&&"submitted"===b.status?"in_review":b&&b.createdAt>0&&C>0?"in_progress":"not_started"):w=null,i.useEffect(()=>(!t&&e&&ea(e),function(){eo()}),[e,t]);let k=(0,ec.useRouter)(),v=k.query.linkPayout;i.useEffect(()=>{n&&v&&l(!0)},[v,n]),i.useEffect(()=>{if("true"===k.query.uploadID){c(!0);let{pathname:e,query:t}=k,n={...t};delete n.uploadID,k.replace({pathname:e,query:n},void 0,{shallow:!0})}},[k.query.uploadID,k]);let S=async()=>{try{let t=await fetch("/api/user/payment-account?processor=paypal",{method:"DELETE",headers:{Authorization:`Bearer ${await e?.getIdToken()}`}});if(!t.ok)throw Error(`Remove failed (${t.status})`)}catch(e){throw o.error("Couldn’t remove your PayPal account. Please try again."),e}a()};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eF,{userAllowedToLinkPayouts:u,isPayPalLinked:x,paypalHasIssues:h,paypalLinkingIssues:p?.paypalLinkingIssues||[],paymentInfo:p,onRemove:S,onUploadID:()=>c(!0),showPointer:s,finixStatus:w,bankPayoutsActive:(0,ep.Uf)(n),finixProgressPercent:y}),(0,r.jsx)(eV,{isOpen:d,onClose:()=>c(!1)})]})};var e$=n(96628),eU=n(84846),eZ=n(47727);let eN=(0,eU.R)((e,t)=>{let n=(0,e$.k)();return(0,r.jsx)(eZ.B.thead,{...e,ref:t,__css:n.thead})});var eG=n(51014);let eJ=(0,eU.R)((e,t)=>{let{isNumeric:n,...i}=e,a=(0,e$.k)();return(0,r.jsx)(eZ.B.th,{...i,ref:t,__css:a.th,"data-is-numeric":n})});var eY=n(44340),eq=n(89096),eQ=n(84941),eK=n(64391);let eX=()=>(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M10 4.16699V15.8337",stroke:"rgba(0, 0, 0, 0.5)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M15.834 10L10.0007 15.8333L4.16732 10",stroke:"rgba(0, 0, 0, 0.5)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});var e0=n(67743);let e1=e=>{let{height:t,width:n}=e;return(0,r.jsxs)("svg",{width:n,height:t,viewBox:"0 0 47 47",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("g",{clipPath:"url(#clip0_5014_1258)",children:(0,r.jsx)("path",{d:"M24.6584 20.4318C24.6584 21.8359 23.8021 22.6437 22.2922 22.6437H20.3094V18.2213H22.301C23.8021 18.2213 24.6584 19.0203 24.6584 20.4318ZM28.5344 25.5401C28.5344 26.2172 29.1219 26.6578 30.0443 26.6578C31.2193 26.6578 32.1005 25.9161 32.1005 24.8703V24.2417L30.1823 24.3636C29.0969 24.4371 28.5344 24.838 28.5344 25.5401ZM46.9995 9.05778V37.7807C46.9995 39.9427 45.2458 41.6978 43.0824 41.6978H3.9152C1.7532 41.6978 -0.00195312 39.9441 -0.00195312 37.7807V9.05778C-0.00195312 6.89578 1.75173 5.14062 3.9152 5.14062H43.0824C45.2444 5.14062 46.9995 6.89431 46.9995 9.05778ZM10.4276 18.7016C11.1135 18.7589 11.798 18.3594 12.2313 17.8527C12.6557 17.3298 12.9333 16.6292 12.8599 15.9183C12.2562 15.9433 11.5057 16.3178 11.0724 16.8407C10.6803 17.2901 10.3469 18.0157 10.4276 18.7016ZM15.3729 24.7807C15.3568 24.7646 13.7735 24.1609 13.7573 22.3323C13.7411 20.8063 15.0057 20.0719 15.063 20.0308C14.3448 18.9704 13.2344 18.8558 12.8511 18.8308C11.8553 18.7736 11.0063 19.3934 10.5334 19.3934C10.0516 19.3934 9.33342 18.8543 8.55058 18.872C7.53127 18.8881 6.57658 19.4683 6.06252 20.3892C4.99327 22.2339 5.78492 24.9585 6.82186 26.4595C7.32711 27.2012 7.93958 28.0179 8.74005 27.9856C9.49792 27.9533 9.80048 27.4965 10.714 27.4965C11.6364 27.4965 11.8979 27.9856 12.6969 27.9782C13.5296 27.9621 14.0437 27.2365 14.5578 26.4933C15.1203 25.6444 15.3568 24.8292 15.3744 24.7793L15.3729 24.7807ZM26.4209 20.4244C26.4209 18.2536 24.911 16.7687 22.7563 16.7687H18.5792V27.8989H20.3094V24.0963H22.7005C24.8875 24.0963 26.4209 22.5953 26.4209 20.4244ZM33.7646 22.3573C33.7646 20.7505 32.475 19.7136 30.501 19.7136C28.6651 19.7136 27.3109 20.7667 27.261 22.2016H28.8193C28.95 21.5157 29.586 21.0677 30.4511 21.0677C31.5115 21.0677 32.099 21.5568 32.099 22.4719V23.0843L29.9444 23.2151C27.9366 23.337 26.8527 24.1624 26.8527 25.59C26.8527 27.0338 27.9704 27.9885 29.5772 27.9885C30.6626 27.9885 31.6658 27.4421 32.1225 26.5682H32.1549V27.9062H33.7543V22.3573H33.7646ZM42.1042 19.8193H40.3505L38.3192 26.3964H38.2869L36.2556 19.8193H34.4358L37.3645 27.9224L37.2103 28.4115C36.9489 29.2443 36.517 29.5703 35.7504 29.5703C35.6108 29.5703 35.3509 29.5542 35.2436 29.5454V30.8834C35.342 30.9157 35.7739 30.9245 35.9046 30.9245C37.5936 30.9245 38.3853 30.2798 39.0785 28.3293L42.1042 19.8193Z",fill:"black"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_5014_1258",children:(0,r.jsx)("rect",{width:"47",height:"47",fill:"white"})})})]})},e2=e=>{let{height:t,width:n}=e;return(0,r.jsxs)("svg",{width:n,height:t,viewBox:"0 0 46 46",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M21.7561 22.7921V28.1449H20.0566V14.9228H24.5616C25.6484 14.8997 26.6985 15.312 27.4789 16.0674C28.2689 16.7784 28.714 17.7958 28.6967 18.8575C28.7198 19.9269 28.2747 20.952 27.4789 21.6649C26.6908 22.4164 25.7178 22.7921 24.5616 22.7902L21.7561 22.7921ZM21.7561 16.551V21.1678H24.604C25.236 21.187 25.8449 20.9385 26.2843 20.4837C27.1764 19.6166 27.1976 18.1888 26.3286 17.2967C26.3132 17.2813 26.2997 17.2659 26.2843 17.2524C25.8507 16.788 25.238 16.5337 24.604 16.551H21.7561ZM32.6121 18.8035C33.8684 18.8035 34.8588 19.1388 35.5852 19.8093C36.3117 20.4799 36.6739 21.4009 36.6739 22.5686V28.1449H35.0496V26.8886H34.9763C34.273 27.9233 33.3366 28.4397 32.1689 28.4397C31.1727 28.4397 30.3384 28.1449 29.6678 27.5534C29.0166 27.0042 28.6466 26.1911 28.662 25.3375C28.662 24.401 29.0166 23.6573 29.7237 23.1043C30.4309 22.5512 31.375 22.2738 32.5581 22.2738C33.5659 22.2738 34.3983 22.4588 35.0496 22.8268V22.4376C35.0534 21.8557 34.7952 21.3046 34.3482 20.9346C33.8992 20.53 33.3135 20.3084 32.7084 20.3161C31.7604 20.3161 31.0089 20.7169 30.4559 21.5165L28.9607 20.5743C29.7815 19.3931 30.9993 18.8035 32.6121 18.8035ZM30.4135 25.376C30.4116 25.8154 30.6216 26.2277 30.9762 26.484C31.3519 26.7788 31.8182 26.9368 32.2961 26.9272C33.0129 26.9252 33.7008 26.6401 34.2075 26.1333C34.7702 25.6034 35.0515 24.9829 35.0515 24.2681C34.5216 23.8461 33.7836 23.6341 32.8356 23.6341C32.1458 23.6341 31.5696 23.7999 31.1091 24.1332C30.6448 24.4723 30.4135 24.8828 30.4135 25.376ZM45.9999 19.0983L40.3292 32.1335H38.5757L40.6799 27.5727L36.9494 19.0983H38.7954L41.4911 25.5976H41.5277L44.1501 19.0983H45.9999Z",fill:"#5F6368"}),(0,r.jsx)("path",{d:"M14.8908 21.6362C14.8908 21.1178 14.8484 20.6014 14.7598 20.0908H7.5957V23.0158H11.698C11.5284 23.96 10.9812 24.7943 10.1816 25.3242V27.2241H12.6306C14.0642 25.9042 14.8908 23.9484 14.8908 21.6362Z",fill:"#4285F4"}),(0,r.jsx)("path",{d:"M7.59501 29.0598C9.64519 29.0598 11.3717 28.3874 12.6299 27.2255L10.1809 25.3256C9.49875 25.788 8.62202 26.052 7.59501 26.052C5.61419 26.052 3.93204 24.7167 3.33086 22.917H0.808594V24.8747C2.09767 27.4413 4.72398 29.0598 7.59501 29.0598Z",fill:"#34A853"}),(0,r.jsx)("path",{d:"M3.33155 22.9171C3.01361 21.9749 3.01361 20.9517 3.33155 20.0095V18.0518H0.809282C-0.269761 20.1983 -0.269761 22.7283 0.809282 24.8748L3.33155 22.9171Z",fill:"#FBBC04"}),(0,r.jsx)("path",{d:"M7.59501 16.8745C8.6779 16.8572 9.72419 17.2657 10.5084 18.0133L12.6781 15.8456C11.3023 14.5546 9.4814 13.8455 7.59501 13.8667C4.72398 13.8667 2.09767 15.4872 0.808594 18.0518L3.33086 20.0095C3.93204 18.2098 5.61419 16.8745 7.59501 16.8745Z",fill:"#EA4335"})]})};var e5=n(61654),e3=n(787),e8=n(61190),e6=n(71449),e4=n(54168),e9=n(42378);let e7={pending:"warning",declined:"danger",failed:"danger",reversed:"danger",refunded:"neutral",partially_refunded:"neutral"},te=e=>{let{dateSelection:t}=e,[n,a]=(0,en.hD)(er.j2),{data:o,isLoading:l}=(0,es.useQuery)(["userDocument",n,a],(0,el.Q)(n,a)),{tipJarMap:d,selectableTipJarSlugs:p,selectedTipJarSlugs:x,hasMultipleTipJars:h,hasOrphanTipJar:u}=(0,e8.MZ)(),b=i.useMemo(()=>(0,ep.dJ)(o?.tips,x,d,p),[o?.tips,x,d,p]),[m,C]=i.useState(e5.UE.desc),[y,w]=i.useState(!1),k=h||u,v=i.useMemo(()=>
21(0,ep.vd)(d,Object.keys(d)),[d]),S=i.useCallback(e=>(0,ep.v$)(e,d,v),[d,v]),L=i.useMemo(()=>{let e;if(!o?.tips)return{asc:[],desc:[],countedAsc:[],countedDesc:[]};if("today"===t.preset){let t=o?.user?.accountInfo?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}),r=n.format(new Date);e=Object.values(b).filter(e=>{let t=e.tipInfo?.timestamp;return!!t&&n.format(new Date(t))===r})}else e=Object.values((0,ep.lt)(b,t.range));let n=[...e].sort((e,t)=>(e.tipInfo?.timestamp??0)-(t.tipInfo?.timestamp??0)),r=[...n].reverse(),i=n.filter(e=>(0,e3.wC)(e)),a=[...i].reverse();return{asc:n,desc:r,countedAsc:i,countedDesc:a}},[o,b,t]),D=L.asc.length-L.countedAsc.length,P=i.useMemo(()=>y?{asc:L.asc,desc:L.desc}:{asc:L.countedAsc,desc:L.countedDesc},[L,y]),M=i.useMemo(()=>m===e5.UE.desc?P.desc:P.asc,[m,P]),_=i.useMemo(()=>new Set(P.desc.map(e=>e.tipInfo?.currency).filter(Boolean)).size>1,[P]),I=i.useMemo(()=>Object.values(o?.tips??{}).some(e=>(0,e3.wC)(e)),[o?.tips]),z=i.useMemo(()=>{let e=(0,e6.QL)(P,o);return[["Date","Tipper",...k?["Tip Jar"]:[],"Tip","Currency","Deposit","Type","Source","Location","Device","Status"],...k?e.map((e,t)=>{let n=P.asc[t];return[e[0],e[1],S(n),...e.slice(2)]}):e]},[P,o,k,S]),T=new Date,E="custom"===t.preset?"Custom":ed.CJ[t.preset].replace(/\s+/g,"_"),H=Object.keys(o?.tipJars||{}).length>1,W=ep.fZ(o)?.slugCasePreserved||(o?.tipJars?Object.keys(o.tipJars)[0]:"")||"user",V=H?`${E}_tip_data_${T.getFullYear()}-${T.getMonth()+1}-${T.getDate()}.csv`:`${E}_tip_data_@${W}_${T.getFullYear()}-${T.getMonth()+1}-${T.getDate()}.csv`;return(0,r.jsxs)(s.a,{children:[D>0&&(0,r.jsx)(c.s,{justifyContent:"flex-end",marginBottom:"10px",children:(0,r.jsxs)(e9.S,{size:"md",isChecked:y,onChange:e=>w(e.target.checked),sx:{"& .chakra-checkbox__label":{fontSize:"sm"}},children:["Show declined tips (",D,")"]})}),(0,r.jsx)(s.a,{maxHeight:"650px",overflowY:"scroll",borderRadius:"10px",boxShadow:"0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 1.87823px 10.8938px rgba(0, 0, 0, 0.03), 0px 0.415088px 2.40751px rgba(0, 0, 0, 0.0168687);",children:(0,r.jsxs)(e$.X,{variant:"unstyled",backgroundColor:"white",size:{base:"sm",md:"md",lg:"lg"},overflow:"hidden",sx:{tableLayout:"auto","> thead > tr > th":{paddingInline:"8px",paddingBlock:"12px",whiteSpace:"nowrap",fontSize:"10px"},"> tbody > tr > td":{paddingInline:"8px",paddingBlock:"12px",whiteSpace:"nowrap",fontSize:"12px"},"@media screen and (min-width: 425px)":{"> thead > tr > th":{paddingInline:"10px"},"> tbody > tr > td":{paddingInline:"10px"}},"@media screen and (min-width: 1280px)":{"> thead > tr > th":{paddingInline:"14px"},"> tbody > tr > td":{paddingInline:"14px"}}},children:[(0,r.jsx)(()=>(0,r.jsx)(eN,{backgroundColor:"yellow.500",children:(0,r.jsxs)(eG.Tr,{fontSize:"10px",textColor:"black",children:[(0,r.jsx)(eJ,{children:(0,r.jsxs)(g.z,{children:[(0,r.jsx)(s.a,{children:"Date"}),(0,r.jsx)(j.$,{type:"button",marginInlineStart:"5px",background:"transparent",_hover:{background:"transparent"},transform:m===e5.UE.asc?"rotate(180deg)":"none",onClick:()=>{C(m===e5.UE.asc?e5.UE.desc:e5.UE.asc)},children:(0,r.jsx)(eX,{})})]})}),(0,r.jsx)(eJ,{children:"Tipper"}),k&&(0,r.jsx)(eJ,{children:"Tip jar"}),(0,r.jsx)(eJ,{isNumeric:!0,children:"Tip"}),(0,r.jsx)(eJ,{isNumeric:!0,display:{base:"none",xl:"table-cell"},children:"Deposit"}),(0,r.jsx)(eJ,{display:{base:"none",xl:"table-cell"},children:"Type"}),(0,r.jsx)(eJ,{display:{base:"none",xl:"table-cell"},children:"Source"}),(0,r.jsx)(eJ,{display:{base:"none",xl:"table-cell"},children:"Location"}),(0,r.jsx)(eJ,{display:{base:"none",xl:"table-cell"},children:"Device"})]})}),{}),(0,r.jsxs)(eY.N,{fontSize:{md:"sm"},color:{base:"rgba(0, 0, 0, 0.75)",xsm:"rgba(0, 0, 0, 0.6)"},fontWeight:{xsm:"500",smd:"600"},height:!a&&z.length<2?"300px":"auto",children:[(a||l)&&(0,r.jsx)(e0.A,{}),(0,r.jsx)(eG.Tr,{children:!a&&!l&&z.length<2&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eq.Td,{display:{base:"table-cell",xl:"none"},colSpan:k?4:3,textAlign:"center",fontWeight:"700",sx:{fontSize:"15px !important"},height:"300px",color:"rgba(0, 0, 0, 0.4)",children:I?"No tips received for this timeframe":"Tips data will appear here"}),(0,r.jsx)(eq.Td,{display:{base:"none",xl:"table-cell"},colSpan:k?9:8,textAlign:"center",fontWeight:"700",sx:{fontSize:"15px !important"},height:"300px",color:"rgba(0, 0, 0, 0.4)",children:I?"No tips received for this timeframe":"Tips data will appear here"})]})}),o&&o.tips?M.map((e,t)=>{let{timestamp:n,date:i,tipperName:a,readableAmount:o,currency:l,currencySymbol:c,finalAmount:p,paymentMethod:x,walletPaymentType:h,tipSource:u,location:b,device:m,captureStatus:j}=(0,e6.S0)(e),C=j?e7[j]:void 0;return(0,r.jsxs)(eG.Tr,{backgroundColor:(t+1)%2==0?"rgba(255, 224, 20, 0.2)":"white",borderBottom:"1px solid rgba(0, 0, 0, 0.06",children:[(0,r.jsx)(eq.Td,{children:i}),(0,r.jsxs)(eq.Td,{children:[a,C&&(0,r.jsx)(e4.E,{tone:C,variant:"tinted",size:"xs",marginLeft:"6px",children:(0,e3.fn)(j)})]}
21),k&&(()=>{let t=(0,ep.TR)(e,d,v);return(0,r.jsx)(eq.Td,{children:(0,r.jsxs)(f.E,{as:"span",display:"inline-block",whiteSpace:"nowrap",color:t.isDeleted?"rgba(153, 27, 27, 0.85)":void 0,bg:t.isDeleted?"rgba(220, 38, 38, 0.08)":"transparent",borderRadius:t.isDeleted?"5px":void 0,px:t.isDeleted?"7px":void 0,py:t.isDeleted?"3px":void 0,children:[(0,r.jsx)(f.E,{as:"span",children:t.label?`@${t.label}`:"—"}),t.isDeleted&&(0,r.jsx)(f.E,{as:"span",ml:"6px",color:"rgba(153, 27, 27, 0.75)",fontWeight:"500",children:"(deleted tip jar)"})]})})})(),(0,r.jsxs)(eq.Td,{children:[c,o,_?` ${l}`:""]}),(0,r.jsxs)(eq.Td,{display:{base:"none",xl:"table-cell"},children:[c,p,_?` ${l}`:""]}),(0,r.jsx)(eq.Td,{display:{base:"none",xl:"table-cell"},children:(0,r.jsxs)(s.a,{display:"flex",alignItems:"center",gap:"5px",children:["apple-pay"===h?(0,r.jsx)(g.z,{children:(0,r.jsxs)(s.a,{position:"relative",children:[(0,r.jsx)(e1,{width:"28",height:"28"}),(0,r.jsx)("span",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",userSelect:"all",cursor:"text"},children:"Apple Pay"})]})}):"google-pay"===h?(0,r.jsx)(g.z,{children:(0,r.jsxs)(s.a,{position:"relative",children:[(0,r.jsx)(e2,{width:"35",height:"35"}),(0,r.jsx)("span",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",userSelect:"all",cursor:"text"},children:"Google Pay"})]})}):null,!h&&x]})}),(0,r.jsx)(eq.Td,{display:{base:"none",xl:"table-cell"},children:u}),(0,r.jsx)(eq.Td,{display:{base:"none",xl:"table-cell"},children:b}),(0,r.jsx)(eq.Td,{display:{base:"none",xl:"table-cell"},children:m})]},n)}):[]]})]})}),(0,r.jsx)(s.a,{marginTop:"22px",children:(0,r.jsx)(eQ.CSVLink,{data:z,target:"_blank",filename:V,children:(0,r.jsx)(eK.A,{})})})]})};var tt=n(69076),tn=n(98835),tr=n(51666),ti=n(69168),ta=n(67906),to=n(11229);let ts=e=>{let{isLoadingUser:t,isPaymentMethodsSaving:n,paymentMethodsGroup:a,selectedPaymentMethods:o,handlePaymentMethodChange:l}=e,[d,p]=i.useState({}),[x,h]=i.useState(!1),u=e=>{p(t=>({...t,[e]:!t[e]}))};return(0,r.jsx)(s.a,{borderRadius:"md",mt:"10px",children:(0,r.jsx)(tt.B,{spacing:0,children:e5.RC.filter(e=>e.group===a).map(e=>{let i="paypal"===e.id,a=o[e.id]?.isSelected||!1,p=d[e.id]||!1;return(0,r.jsxs)(s.a,{py:"8px",children:[(0,r.jsxs)(c.s,{alignItems:"center",justifyContent:"space-between",children:[(0,r.jsx)(s.a,{cursor:"pointer",onClick:()=>u(e.id),children:e.svg?(0,r.jsx)(s.a,{dangerouslySetInnerHTML:{__html:e.svg}}):(0,r.jsx)(f.E,{fontWeight:"700",children:e.paymentMethodName})}),(0,r.jsx)(tn.m,{isOpen:!!i&&x,openDelay:100,closeOnScroll:!0,shouldWrapChildren:!0,maxW:"260px",label:ed.zQ.disablePayPalTooltip,backgroundColor:"gray",borderRadius:"5px",placement:"top",hasArrow:!0,children:(0,r.jsx)(s.a,{pr:"5px",onPointerEnter:()=>i&&h(!0),onPointerLeave:()=>i&&h(!1),children:(0,r.jsx)(tr.d,{id:e.id,isChecked:!!i||a,isDisabled:!!i||t||n,onChange:t=>l(t,e.group),colorScheme:"green"})})})]}),(0,r.jsxs)(c.s,{alignItems:"center",cursor:"pointer",mt:1,onClick:()=>u(e.id),width:"fit-content",children:[(0,r.jsx)(ti.I,{as:p?ta.M:to.D,w:4,h:4,color:"blue.600"}),(0,r.jsx)(f.E,{fontSize:"sm",color:"blue.600",children:"Details"})]}),(0,r.jsx)(b.S,{in:p,animateOpacity:!0,children:(0,r.jsxs)(s.a,{mt:2,fontSize:"sm",children:[(0,r.jsxs)(f.E,{children:[(0,r.jsx)("strong",{children:"Supported countries:"})," ",e.supportedCountries]}),(0,r.jsxs)(f.E,{mt:1,children:[(0,r.jsx)("strong",{children:"Description:"})," ",e.description]})]})}),(0,r.jsx)(y.c,{mt:"5px"})]},e.id)})})})},tl=e=>{let{userData:t,isLoadingUser:n,slug:a}=e,[o]=(0,en.hD)(er.j2),[x,h]=i.useState(!1),[u,m]=i.useState(!1),[C,w]=i.useState(!1),k=(0,p.S)(),v=(()=>{let e={},t=["venmo","card","applepay","googlepay"];return e5.RC.forEach(n=>{e[n.id]={group:n.group,isSelected:t.includes(n.id)}}),e})(),[S,L]=i.useState(v),D=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h(!0);let t=a?`/api/tip-jar/${a}`:"/api/user";(await fetch(t,{method:a?"PUT":"POST",headers:{Authorization:`Bearer ${await o?.getIdToken()}`,"Content-Type":"application/json"},body:JSON.stringify({paymentInfo:{paymentMethodsSelected:S}})})).ok?e||(w(!1),k.saved()):e||k.genericError(),h(!1)},P=async e=>{e.preventDefault(),await D()},M=(e,t)=>{L({...S,[e.target.id]:{group:t,isSelected:e.target.checked}})},_=e=>{n||(e?L(e):D(!0))};i.useEffect(()=>{_(a?t?.tipJars?.[a]?.paymentInfo?.paymentMethodsSelected:void 0)},[n]);let I=()=>{w(!1),m(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eh.aF,{blockScrollOnMount:!1,isOpen:C,onClose:I,children:[(0,r.jsx)(eu.m,{backdropFilter:"blur(2px)"}),(0,r.jsx)(eg.$,{alignSelf:"center",borderRadius:"12px",width:"350px",maxW:"421px",maxH:"700px",bg:"white",overflowY:"auto",children:(0,r.jsxs)(eb.c,{py:"25px",pb:"30px",children:[(0,r.jsxs)(c.s,{justifyContent:"space-between",alignItems:"center",mb:"11px",children:[(0,r.jsx)(s.a,{w:"20px",height:"20px"}),(0,r.jsx)(d.D,{as:"h2",fontWeight:"700",fontSize:"16px",textAlign:"center",children:"Manage payment methods"}),(0,r.jsx)(j.$,{display:"flex",justifyContent:"center",alignItems:"center",variant:"unstyled",_hover:{opacity:"0.6"},onClick:I,_focus:{boxShadow:"none"},children:(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M15 5L5 15",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5 5L15 15",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}),(0,r.jsx)(f.E,{fontSize:"13px",color:"black",fontWeight:"400",mb:2,children:ed.zQ.paymentMethodsHeader}),(0,r.jsx)(f.E,{fontSize:"13px",color:"black",fontWeight:"400",mb:2,children:ed.zQ.paymentMethodsFooter}),(0,r.jsx)("form",{onSubmit:P,children:(0,r.jsxs)(l.T,{gap:"0",width:"100%",align:"stretch",children:[(0,r.jsx)(y.c,{mt:"5px"}),(0,r.jsx)(ts,{isLoadingUser:n,isPaymentMethodsSaving:x,paymentMethodsGroup:"core",selectedPaymentMethods:S,handlePaymentMethodChange:M}),!u&&(0,r.jsxs)(j.$,{margin:"5px auto",variant:"textIconButtonWithBackgroun
21dNoBorder",bg:"white",onClick:()=>m(!0),children:["Show 8 more",(0,r.jsx)("svg",{style:{marginInlineStart:"10px"},width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),(0,r.jsx)(b.S,{in:u,animateOpacity:!0,children:(0,r.jsx)(ts,{isLoadingUser:n,isPaymentMethodsSaving:x,paymentMethodsGroup:"additional",selectedPaymentMethods:S,handlePaymentMethodChange:M})}),(0,r.jsxs)(g.z,{mt:"15px",justifyContent:"space-between",children:[(0,r.jsx)(j.$,{minWidth:"45%",isDisabled:n||x,variant:"textButtonWithBackgroundWhite",onClick:I,children:"Close"}),(0,r.jsx)(j.$,{type:"submit",variant:"textButtonWithBackgroundYellow",minWidth:"45%",isDisabled:n||x,children:"Save"})]})]})})]})})]}),(0,r.jsx)(s.a,{width:"100%",minH:"50px",boxShadow:"0px 15px 87px rgba(0, 0, 0, 0.06), 0px 6.26664px 36.3465px rgba(0, 0, 0, 0.0431313), 0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 1.87823px 10.8938px rgba(0, 0, 0, 0.03), 0px 0.997515px 5.78559px rgba(0, 0, 0, 0.0242336), 0px 0.415088px 2.40751px rgba(0, 0, 0, 0.0168687);",borderRadius:"15px",backgroundColor:"white",display:"flex",justifyContent:"end",children:(0,r.jsx)(j.$,{_hover:{opacity:"0.6",background:"white"},w:"100%",h:"100%",onClick:()=>w(!0),py:{base:"20px",xl:"20px"},borderRadius:"15px",bg:"white",children:(0,r.jsxs)(g.z,{gap:"5px",children:[(0,r.jsx)("svg",{width:"15",height:"12",viewBox:"0 0 15 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M0.700855 0H14.2991C14.686 0 15 0.313819 15 0.700855V2.98784H0V0.700855C0 0.313819 0.313819 0 0.700855 0ZM15 4.40935V10.4051C15 10.7919 14.686 11.1059 14.2991 11.1059H0.700855C0.313819 11.1059 0 10.7919 0 10.4051V4.40935H15Z",fill:"black"})}),(0,r.jsx)(f.E,{children:"Manage payment methods"})]})})})]})};var td=n(92394),tc=n(96080),tp=n(11867);let tx=e=>{let{dateSelection:t}=e,[n,a]=(0,en.hD)(er.j2),{data:o,isLoading:l}=(0,es.useQuery)(["userDocument",n,a],(0,el.Q)(n,a)),{tipJarMap:c,selectableTipJarSlugs:p,selectedTipJarSlugs:x}=(0,e8.MZ)(),h=i.useMemo(()=>(0,ep.Bl)(o?.tips,x,c,p),[o?.tips,x,c,p]),u=e=>{let t=Object.values(ed.Ce).reduce((e,t)=>(e[t]={amount:0,nTips:0},e),{});return e.forEach(e=>{let n=e.tipInfo?.currency||ed.Ce.USD,r=e.tipInfo?.amount||0;t[n]&&(t[n].amount+=r,t[n].nTips+=1)}),t},b=i.useMemo(()=>{if(!o?.tips)return{};let e=[];
21if("today"===t.preset){let t=o?.user?.accountInfo?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}),r=n.format(new Date);e=Object.values(h).filter(e=>{let t=e.tipInfo?.timestamp;return!!t&&n.format(new Date(t))===r})}else e=Object.values((0,ep.lt)(h,t.range));return u(e)},[o,h,t]),m=(0,ep.aq)(o,h),[C,y]=i.useState(m);i.useEffect(()=>{y((0,ep.aq)(o,h))},[o,h]);let w=Object.keys(b).filter(e=>e===m||(b[e]?.amount??0)>0);return w.includes(m)||w.unshift(m),i.useEffect(()=>{w.includes(C)||y(m)},[w,C,m]),(0,r.jsxs)(s.a,{padding:{base:"20px",md:"20px 26px"},width:"100%",boxShadow:"0px 15px 87px rgba(0, 0, 0, 0.06), 0px 6.26664px 36.3465px rgba(0, 0, 0, 0.0431313), 0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 1.87823px 10.8938px rgba(0, 0, 0, 0.03), 0px 0.997515px 5.78559px rgba(0, 0, 0, 0.0242336), 0px 0.415088px 2.40751px rgba(0, 0, 0, 0.0168687);",borderRadius:"20px",backgroundColor:"white",minH:"157px",children:[(0,r.jsxs)(g.z,{justify:"space-between",h:"100%",children:[(0,r.jsxs)(d.D,{variant:"dashboardCardTitle",children:["Total ",w.length>1?`${C} tips`:"tips"]}),w.length>1&&(0,r.jsx)(j.$,{variant:"unstyled",display:"flex",h:"18px",borderRadius:"5px",onClick:()=>{let e=(w.indexOf(C)+1)%w.length;y(w[e])},children:(0,r.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M15 14.167H3.75",stroke:"black",strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M3.33398 5.83301L14.584 5.83301",stroke:"black",strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M3.33398 14.1667L7.08398 17.5",stroke:"black",strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M3.33398 14.167L7.08398 10.8337",stroke:"black",strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M15.834 5.83333L12.084 2.5",stroke:"black",strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M15.834 5.83301L12.084 9.16634",stroke:"black",strokeWidth:"2",strokeLinecap:"round"})]})})]}),(0,r.jsx)(f.E,{fontWeight:"bold",color:"rgba(0, 0, 0, 1)",fontSize:"xxxl",margin:"14px 0 9px 0",children:!C||a||l?(0,r.jsx)(tp.A,{}):(0,r.jsx)(f.E,{children:`${e5.zA[C]}${((b[C]?.amount??0)/100).toLocaleString()}`})}),(0,r.jsx)(f.E,{fontWeight:"600",fontSize:"sm",children:!l&&(b[C]?.nTips??0)>1?`From ${b[C]?.nTips} tippers`:b[C]?.nTips===1?`From ${b[C]?.nTips} tipper`:"Your total tips"})]})};var th=n(6493),tu=n(50163),tg=n(75227);let tf={email_not_confirmed:{label:"Confirm your email on PayPal",url:"https://www.paypal.com/mep/dashboard"},payments_not_receivable:{label:"Complete your verification on PayPal",url:"https://www.paypal.com/mep/dashboard"},product_not_active:{label:"Complete your account setup on PayPal",url:"https://www.paypal.com/mep/dashboard"},individual_account:{label:"Upgrade to a PayPal Business account",url:"https://www.paypal.com/bizsignup"}},tb=(0,r.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M9 18L15 12L9 6",stroke:"#A0AEC0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),tm=(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M1 4V10H7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M23 20V14H17",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M20.49 9A9 9 0 0 0 5.64 5.64L1 10M23 14L18.36 18.36A9 9 0 0 1 3.51 15",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),tj=()=>{let[e,t]=(0,en.hD)(er.j2),{data:n,refetch:a}=(0,es.useQuery)(["userDocument",e,t],(0,el.Q)(e,t)),o=n?.user?.paymentInfo?.paypalLinkingStatus,c=n?.user?.paymentInfo?.paypalLinkingIssues,x=n?.user?.paymentInfo?.linkedPayPal,[h,u]=i.useState(!1),[b,m]=i.useState(!1),C=i.useRef(0),w=(0,p.S)(),k=async()=>{let t=Date.now();if(t-C.current<5e3){w.info("Please wait a moment before checking again");return}C.current=t,m(!0);try{let t=await e?.getIdToken(),n=await fetch("/api/payment/onboarding/paypal/refresh",{headers:{Authorization:`Bearer ${t}`}}),r=await n.json();await a(),"linked"===r.status?w.success("PayPal is fully connected"):w.info("PayPal still has outstanding issues. Resolve them on PayPal and try again")}catch(e){console.error("Failed to refresh PayPal status",e),w.genericError()}finally{m(!1)}};if("issues"!==o)return null;let v=c?.includes("individual_account")&&!x,S=(c||[]).filter(e=>tf[e]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D.A,{isOpen:h,onClose:()=>u(!1)}),(0,r.jsxs)(s.a,{padding:{base:"20px",md:"20px 26px"},boxShadow:"0px 15px 87px rgba(0, 0, 0, 0.06), 0px 6.26664px 36.3465px rgba(0, 0, 0, 0.0431313), 0px 3.35045px 19.4326px rgba(0, 0, 0, 0.0357664), 0px 1.87823px 10.8938px rgba(0, 0, 0, 0.03), 0px 0.997515px 5.78559px rgba(0, 0, 0, 0.0242336), 0px 0.415088px 2.40751px rgba(0, 0, 0, 0.0168687)",borderRadius:"20px",backgroundColor:"white",mb:{base:"20px"},w:"100%",children:[(0,r.jsxs)(g.z,{justify:"space-between",mb:"12px",children:[(0,r.jsxs)(g.z,{spacing:"10px",children:[(0,r.jsx)(s.a,{w:"8px",h:"8px",borderRadius:"full",bg:"orange.400",flexShrink:0}),(0,r.jsx)(d.D,{variant:"dashboardCardTitle",mb:"0",children:v?"PayPal linking incomplete":"Action needed"})]}),(0,r.jsxs)(f.E,{fontSize:"12px",color:"gray.400",children:[S.length," ",1===S.length?"issue":"issues"]})]}),(0,r.jsx)(f.E,{fontSize:"13px",color:"gray.500",fontWeight:"400",mb:"16px",lineHeight:"1.5",children:v?"Your PayPal account could not be linked. Complete the following to re
21ceive payouts:":"Your PayPal is linked but needs the following resolved before you can receive payouts:"}),(0,r.jsx)(l.T,{align:"stretch",spacing:"0",mb:"16px",children:S.map((e,t)=>{let n=tf[e];return(0,r.jsxs)(i.Fragment,{children:[t>0&&(0,r.jsx)(y.c,{}),(0,r.jsxs)(g.z,{as:"a",href:n.url,target:"_blank",rel:"noopener noreferrer",py:"12px",px:{base:"0px",md:"10px"},justify:"space-between",cursor:"pointer",borderRadius:"8px",_hover:{bg:"gray.50"},transition:"background 0.15s",children:[(0,r.jsx)(f.E,{fontSize:"14px",fontWeight:"500",color:"gray.700",children:n.label}),tb]})]},e)})}),(0,r.jsx)(y.c,{mb:"16px"}),(0,r.jsxs)(g.z,{spacing:"10px",flexWrap:"wrap",children:[v?(0,r.jsx)(j.$,{as:"a",href:"/api/payment/onboarding?processor=paypal",variant:"textIconButtonWithBackgroundBlack",fontSize:"12px",h:"32px",px:"16px",children:"Try linking again"}):(0,r.jsxs)(j.$,{variant:"textIconButtonWithBackgroundBlack",fontSize:"12px",h:"32px",px:"16px",gap:"6px",onClick:k,isLoading:b,loadingText:"Checking",disabled:b,_disabled:{opacity:.6},_hover:{bg:"gray.800"},children:[tm,"Refresh PayPal status"]}),(0,r.jsx)(f.E,{as:"u",fontSize:"12px",color:"gray.500",cursor:"pointer",fontWeight:"500",_hover:{color:"gray.700"},onClick:()=>u(!0),children:"Need help?"})]})]})]})};var tC=n(43344);let ty=()=>{let{userData:e,isLoading:t,tipJarMap:n,hasOrphanTipJar:a,selectableTipJarSlugs:h,selectedTipJarSlugs:u,isTipJarSelectionCurrentlyPinned:g,onTipJarSelectionChange:f,onPinTipJarSelection:b,onUnpinTipJarSelection:m}=(0,e8.MZ)(),j=h.length>1,{viewingUsername:C}=(0,tC.b)(),y=(0,tg.Z3)(),w=(0,tg.v0)(),[k,v]=i.useState(()=>(0,ep.aT)()??ed.i8),[S,L]=i.useState(()=>w),D=i.useMemo(()=>(0,ep.j$)(k,y),[k,y]),P=i.useMemo(()=>{let t=(0,ep.uM)(e?.tips);return{preset:t,range:(0,ep.wT)(t)}},[e?.tips]),M=i.useRef(!1);i.useEffect(()=>{M.current=!1,L(!1)},[C]),i.useEffect(()=>{!M.current&&e?.tips&&!t&&(M.current=!0,w||v(P),L(!0))},[e?.tips,t,P,w]);let _=i.useCallback(e=>{(0,ep.Od)(e),v(e)},[]),I=i.useCallback(()=>{(0,ep.nx)()},[]),z=(0,p.S)(),T=(0,ec.useRouter)();return(i.useEffect(()=>{if("true"===T.query.linkedPayPal){z.success("PayPal linked successfully");let{pathname:e,query:t}=T;delete t.linkedPayPal,T.replace({pathname:e,query:t},void 0,{shallow:!0})}if("true"===T.query.paypalIssues){z.info("Your PayPal account is connected but requires additional steps. Check the details on this page");let{pathname:e,query:t}=T;delete t.paypalIssues,T.replace({pathname:e,query:t},void 0,{shallow:!0})}if("true"===T.query.finixDraftSaved){z.info("Your bank account application was saved. Pick up where you left off anytime");let{pathname:e,query:t}=T;delete t.finixDraftSaved,T.replace({pathname:e,query:t},void 0,{shallow:!0})}},[T,z]),S)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o(),{children:[(0,r.jsx)("meta",{name:"robots",content:"noindex"}),(0,r.jsx)("meta",{name:"title",content:"Payments - Tip Top Jar"}),(0,r.jsx)("meta",{name:"description",content:"Payments - Tip Top Jar"}),(0,r.jsx)("title",{children:"Payments • Tip Top Jar"})]}),(0,r.jsxs)(l.T,{w:"100%",align:"stretch",children:[(0,r.jsx)(s.a,{display:{base:"flex",md:"none"},justifyContent:"center",alignItems:"start",pos:"sticky",top:"0",bg:"whiteAlpha.900",pt:{base:"25px",smd:"10px"},zIndex:"5",width:"100vw",children:(0,r.jsx)(d.D,{textAlign:"center",variant:"dashboardTitle",marginBottom:"16px",children:"Payments"})}),j&&(0,r.jsx)(s.a,{display:{base:"flex",md:"none"},justifyContent:"center",width:"100%",mb:"8px",children:(0,r.jsx)(tu.A,{tipJars:n,selectedSlugs:u,onChange:f,isPinned:g,onPin:b,onUnpin:m,hasOrphanTipJar:a})}),(0,r.jsx)(tj,{}),(0,r.jsxs)(c.s,{direction:{base:"column",md:"row-reverse"},gap:{base:"25px",xl:"40px"},w:"100%",children:[(0,r.jsxs)(s.a,{w:{md:"290px",lg:"300px",xl:"410px"},flexShrink:0,children:[(0,r.jsx)(s.a,{display:"flex",justifyContent:"end",mb:{base:"0px",smd:"12px"},children:(0,r.jsx)(th.A,{value:k,onChange:v,accountCreationTime:e?.user?.accountInfo?.creationTime,isPinned:D,onPin:_,onUnpin:I,defaultSelection:P})}),(0,r.jsx)(s.a,{display:{base:"flex"},marginTop:{base:"20px",md:"22px"},marginBottom:"12px",children:(0,r.jsx)(x.A,{hideRange:!0,dateSelection:k})}),(0,r.jsx)(s.a,{marginY:"16px",children:(0,r.jsx)(tx,{dateSelection:k})}),(0,r.jsx)(s.a,{marginY:"16px",children:(0,r.jsx)(tl,{userData:e,isLoadingUser:t,slug:e?.tipJars?Object.keys(e.tipJars)[0]:void 0})}),(0,r.jsx)(s.a,{id:"linked-payment-providers",scrollMarginTop:"16px",marginBottom:{base:"20px",md:"40px"},children:(0,r.jsx)(eO,{})})]}),(0,r.jsxs)(s.a,{flex:"1",minW:"0",children:[(0,r.jsx)(d.D,{display:{base:"none",md:"block"}
21,variant:"dashboardTitle",marginBottom:"16px",children:"Payments"}),j&&(0,r.jsx)(s.a,{display:{base:"none",md:"flex"},mb:"16px",children:(0,r.jsx)(tu.A,{tipJars:n,selectedSlugs:u,onChange:f,isPinned:g,onPin:b,onUnpin:m,hasOrphanTipJar:a})}),(0,r.jsx)(d.D,{display:{base:"block",md:"none"},width:"100%",variant:"dashboardSubtitle",marginBottom:"16px",children:"Tip data"}),(0,r.jsx)(s.a,{id:"payments-history-details",marginBottom:{md:"40px"},children:(0,r.jsx)(te,{dateSelection:k})})]})]})]})]}):(0,r.jsx)(tc.n,{children:(0,r.jsx)(s.a,{marginTop:"20vh",justifyContent:"center",alignItems:"center",children:(0,r.jsx)(td.A,{})})})};ty.getLayout=e8.L6;let tw=ty},75886:function(e,t,n){"use strict";var r,i,a,o,s=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},l=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),p=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&d(t,e,n);return c(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var x=p(n(96540)),h=n(17437),u=n(28731),g=h.keyframes(i||(i=s(["\n  0% {transform: scale(1)}\n  50% {transform: scale(0.5); opacity: 0.7}\n  100% {transform: scale(1);opacity: 1}\n"],["\n  0% {transform: scale(1)}\n  50% {transform: scale(0.5); opacity: 0.7}\n  100% {transform: scale(1);opacity: 1}\n"]))),f=function(e){return Math.random()*e},b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.style=function(e){var n=t.props,r=n.color,i=n.size,o=n.margin,l=n.speedMultiplier;return h.css(a||(a=s(["\n      display: inline-block;\n      background-color: ",";\n      width: ",";\n      height: ",";\n      margin: ",';\n      border-radius: 100%;\n      animation-fill-mode: "both";\n      animation: '," ","s ","s infinite ease;\n    "],["\n      display: inline-block;\n      background-color: ",";\n      width: ",";\n      height: ",";\n      margin: ",';\n      border-radius: 100%;\n      animation-fill-mode: "both";\n      animation: '," ","s ","s infinite ease;\n    "])),r,u.cssValue(i),u.cssValue(i),u.cssValue(o),g,(e/100+.6)/l,e/100-.2)},t.wrapper=function(){var e=t.props,n=e.size,r=e.margin,i=u.parseLengthAndUnit(n),a=u.parseLengthAndUnit(r),l=""+(3*parseFloat(i.value.toString())+6*parseFloat(a.value.toString()))+i.unit;return h.css(o||(o=s(["\n      width: ",";\n      font-size: 0;\n    "],["\n      width: ",";\n      font-size: 0;\n    "])),l)},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.loading,n=e.css;return t?h.jsx("span",{css:[this.wrapper(),n]},h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))}),h.jsx("span",{css:this.style(f(100))})):null},t.defaultProps=u.sizeMarginDefaults(15),t}(x.PureComponent);t.default=b},17824:(e,t,n)=>{"use strict";n.d(t,{U:()=>r});let r=(0,n(76211).w)({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,
2111.823a.25.25,0,0,1,0,.354Z"})},97707:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});var r=n(74848),i=n(27692),a=n(35270),o=n(99942),s=n(84846),l=n(17921),d=n(47727);let c=(0,s.R)(function(e,t){let n=(0,l.V)("FormLabel",e),s=(0,i.M)(e),{className:c,children:x,requiredIndicator:h=(0,r.jsx)(p,{}),optionalIndicator:u=null,...g}=s,f=(0,o.Uc)(),b=f?.getLabelProps(g,t)??{ref:t,...g};return(0,r.jsxs)(d.B.label,{...b,className:(0,a.cx)("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...n},children:[x,f?.isRequired?h:u]})});c.displayName="FormLabel";let p=(0,s.R)(function(e,t){let n=(0,o.Uc)(),i=(0,o.TP)();if(!n?.isRequired)return null;let s=(0,a.cx)("chakra-form__required-indicator",e.className);return(0,r.jsx)(d.B.span,{...n?.getRequiredIndicatorProps(e,t),__css:i.requiredIndicator,className:s})});p.displayName="RequiredIndicator"},22363:(e,t,n)=>{"use strict";n.d(t,{j:()=>i});var r=n(96354);function i(e){let[t]=(0,r.U)("(prefers-reduced-motion: reduce)",e);return t}}},e=>{var t=t=>e(e.s=t);e.O(0,[9965,1668,5866,2455,6384,6980,8327,9764,5675,797,1654,2669,4604,1190,6493,687,163,2659,1972,6143,636,6593,8792],()=>t(55742)),_N_E=e.O()}]);

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.