1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="850b95e7-e314-7531-4f61-494552aa2df7")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,303996,106175,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(767080),s=e.i(380750),a=e.i(779668),o=e.i(207670),i=e.i(768951),l=e.i(731876),u=e.i(284517);function c(e){let n,s,a,c,p,m,f,h,y,x,g,v,b,w,j,N,S=(0,r.c)(48),{option:C,isSelected:O,onSelect:k,disabled:E}=e,R=void 0!==E&&E,P=C.currencyName||C.currencySymbol||"Unknown Token",_=C.currencySymbol||"???";S[0]!==R||S[1]!==k||S[2]!==C?(n=()=>{R||k(C)},S[0]=R,S[1]=k,S[2]=C,S[3]=n):n=S[3];let T=n,I=O?"default":"outline",A=O&&"bg-primary text-primary-foreground hover:bg-primary/80 dark:hover:bg-primary/80",D=R&&"opacity-50 cursor-not-allowed";S[4]!==A||S[5]!==D?(s=(0,l.cn)("w-full justify-start p-4 h-auto rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800",A,D),S[4]=A,S[5]=D,S[6]=s):s=S[6],S[7]!==P||S[8]!==_||S[9]!==C.currencyLogoUrl?(a=(0,t.jsx)("div",{className:"w-11 h-11 rounded-sm flex-shrink-0",children:C.currencyLogoUrl?(0,t.jsx)("img",{src:C.currencyLogoUrl,alt:P,className:"w-11 h-11 rounded-sm",onError:d}):(0,t.jsx)("div",{className:"w-11 h-11 bg-gray-200 rounded-sm flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-500",children:_.slice(0,3)})})}),S[7]=P,S[8]=_,S[9]=C.currencyLogoUrl,S[10]=a):a=S[10],S[11]!==P?(c=(0,t.jsx)("div",{className:"font-medium text-sm",children:P}),S[11]=P,S[12]=c):c=S[12];let U=O&&"text-white/70";S[13]!==U?(p=(0,o.default)("text-sm text-muted-foreground",U),S[13]=U,S[14]=p):p=S[14],S[15]!==C.chainName||S[16]!==p?(m=(0,t.jsxs)("div",{className:p,children:["on ",C.chainName]}),S[15]=C.chainName,S[16]=p,S[17]=m):m=S[17],S[18]!==m||S[19]!==c?(f=(0,t.jsxs)("div",{className:"flex flex-col items-start pl-1",children:[c,m]}),S[18]=m,S[19]=c,S[20]=f):f=S[20],S[21]!==f||S[22]!==a?(h=(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[a,f]}),S[21]=f,S[22]=a,S[23]=h):h=S[23],S[24]!==C.balanceUSD?(y=(0,u.formatUSDBalance)(C.balanceUSD),S[24]=C.balanceUSD,S[25]=y):y=S[25],S[26]!==y?(x=(0,t.jsx)("div",{className:"text-sm font-medium",children:y}),S[26]=y,S[27]=x):x=S[27];let L=O&&"text-white/70";return S[28]!==L?(g=(0,o.default)("text-sm text-muted-foreground",L),S[28]=L,S[29]=g):g=S[29],S[30]!==C.balance?(v=(0,u.formatAmount)(C.balance),S[30]=C.balance,S[31]=v):v=S[31],S[32]!==_||S[33]!==g||S[34]!==v?(b=(0,t.jsxs)("div",{className:g,children:[v," ",_]}),S[32]=_,S[33]=g,S[34]=v,S[35]=b):b=S[35],S[36]!==x||S[37]!==b?(w=(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[x,b]}),S[36]=x,S[37]=b,S[38]=w):w=S[38],S[39]!==h||S[40]!==w?(j=(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[h,w]}),S[39]=h,S[40]=w,S[41]=j):j=S[41],S[42]!==R||S[43]!==T||S[44]!==j||S[45]!==I||S[46]!==s?(N=(0,t.jsx)(i.Button,{variant:I,className:s,onClick:T,disabled:R,children:j}),S[42]=R,S[43]=T,S[44]=j,S[45]=I,S[46]=s,S[47]=N):N=S[47],N}function d(e){e.currentTarget.style.display="none"}var p=e.i(619089);function m(){let e,n=(0,r.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"space-y-2 overflow-hidden",children:Array.from({length:5}).map(f)}),n[0]=e):e=n[0],e}function f(e,r){return(0,t.jsx)("div",{className:"p-4 border rounded-lg",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(p.Skeleton,{className:"h-11 w-11 rounded-sm"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(p.Skeleton,{className:"h-4 w-24 mb-2"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-16"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)(p.Skeleton,{className:"h-4 w-16 mb-1"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-20"})]})]})},r)}e.s(["PaymentOptionsDialogContent",0,function(e){let o,i,l,u,d=(0,r.c)(10),{payment:p}=e;d[0]!==p?(o=e=>{p.handlePaymentOptionChange(e),p.handleCancelBridge()},d[0]=p,d[1]=o):o=d[1];let f=o;d[2]!==f||d[3]!==p.glideLoading||d[4]!==p.paymentOptions||d[5]!==p.selectedPaymentOption?(i=()=>p.glideLoading?(0,t.jsx)(m,{}):0===p.paymentOptions.length?(0,t.jsx)("p",{className:"text-center py-8 text-muted-foreground",children:"You don't have any tokens in your wallet that can be used to support. Try connecting a wallet that has Ethereum, USDC, or any other tokens that can be used for support."}):(0,t.jsx)("div",{className:"flex flex-col gap-4",children:p.paymentOptions.map(e=>(0,t.jsx)(c,{option:e,isSelected:!!p.selectedPaymentOption&&(0,a.getPaymentOptionId)(p.selectedPaymentOption)===(0,a.getPaymentOptionId)(e),onSelect:f},(0,a.getPaymentOptionId)(e)))}),d[2]=f,d[3]=p.glideLoading,d[4]=p.paymentOptions,d[5]=p.selectedPaymentOption,d[6]=i):i=d[6];let h=i;return d[7]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(s.DialogHeader,{className:"flex-shrink-0",children:(0,t.jsx)(s.DialogTitle,{className:"font-body",children:"Choose a coin to use"})}),d[7]=l):l=d[7],d[8]!==h?(u=(0,t.jsxs)(t.Fragment,{children:[l,(0,t.jsx)("div",{className:"flex-shrink-0 max-h-[40vh] overflow-hidden",children:(0,t.jsx)(n.Card,{className:"border-none shadow-none",children:(0,t.jsx)(n.CardContent,{className:"p-0",children:(0,t.jsx)("div",{className:"max-h-[35vh] overflow-y-auto",children:h()})})})})]}),d[8]=h,d[9]=u):u=d[9],u}],303996);var h=e.i(445216),y=e.i(85035),x=e.i(619273),g=e.i(266027),v=e.i(271645),b=e.i(846696),w=e.i(889362),j=e.i(715571),N=e.i(966127),S=e.i(802099),C=e.i(954616),O=e.i(907062),k=e.i(810521),E=e.i(481770);function R(e){return(0,E.captureProductEvent)("support_transaction_signed",e)}var P=e.i(805998),_=e.i(788991),T=e.i(868713);let I=["USDC","USDT","DAI"];function A(e){if(!e||0===e.length)return null;if(1===e.length)return e[0];let t=e.map(e=>{let t,r,n,s,a,o,i;return{option:e,priority:(t=(e.chainName?.toLowerCase()||"").includes("base"),n=(r=e.chainName?.toLowerCase()||"").includes("ethereum")||r.includes("mainnet")||"eth"===r,s=e.currencySymbol?.toUpperCase()||"",a=I.some(e=>s.includes(e)),i="ETH"===(o=e.currencySymbol?.toUpperCase()||"")||"W
2ETH"===o,t&&a?1:t&&i?2:n&&a?3:n&&i?4:t?5:n?6:7)}});return t.sort((e,t)=>{if(e.priority!==t.priority)return e.priority-t.priority;let r=Number(e.option.balanceUSD)||0;return(Number(t.option.balanceUSD)||0)-r}),t[0].option}var D=e.i(368075),U=e.i(643005),L=e.i(477470),M=e.i(142455),F=e.i(582475),q=e.i(205595),Q=e.i(87220);e.s(["useSupportPayment",0,function({type:e,coinId:t,isOpen:r,onTransactionSigned:n,onTransactionRejected:s}){let{ethPrice:o}=(0,L.useEthPrice)(),{ensureEOA:i}=(0,U.useEnsureEOA)(),{switchChainAsync:l}=(0,k.useSwitchChain)(),{invalidateTiers:u,invalidateAll:c}=(0,Q.useInvalidateSupporters)(e,t),{address:d}=(0,j.useAccount)(),{wallets:p}=(0,y.useWallets)(),m=p.some(e=>"privy"===e.walletClientType&&e.address.toLowerCase()===d?.toLowerCase()),f=("post"===e?D.supportTiers:D.writerTiers)[1].value,[I,W]=(0,v.useState)("support"),[H,V]=(0,v.useState)(f),[B,G]=(0,v.useState)(null),[K,$]=(0,v.useState)(!1),[z,X]=(0,v.useState)(!1),Y=(0,v.useRef)(!1),Z=function(e){let{address:t}=(0,j.useAccount)(),[r,n]=(0,v.useState)({paymentOptions:null,selectedPaymentOption:null,session:null,loading:!1}),s=(0,v.useCallback)(async(r,s)=>{if(!t)throw Error("Wallet not connected");n(e=>({...e,loading:!0}));try{let o=await (0,q.getGlideEvm)({coinId:e,amount:r,address:t,recipientAddress:s}),i=await (0,h.listPaymentOptions)(a.glideConfig,{chainId:8453===M.COIN_CHAIN?F.base.id:F.baseSepolia.id,account:t,evm:o});return n(e=>({...e,paymentOptions:i,loading:!1})),i}catch(e){throw n(e=>({...e,loading:!1})),e}},[t,e]),o=(0,v.useCallback)(async(r,s,o)=>{if(!t)throw Error("Wallet not connected");n(e=>({...e,loading:!0,selectedPaymentOption:r}));try{let i=await (0,q.getGlideEvm)({coinId:e,amount:s,address:t,recipientAddress:o}),l=await (0,h.createSession)(a.glideConfig,{preferGaslessPayment:!0,paymentCurrency:r.paymentCurrency,chainId:8453===M.COIN_CHAIN?F.base.id:F.baseSepolia.id,account:t,evm:i});return n(e=>({...e,session:l,loading:!1})),l}catch(e){throw n(e=>({...e,loading:!1})),e}},[t,e]),i=(0,v.useCallback)(()=>{n({paymentOptions:null,selectedPaymentOption:null,session:null,loading:!1})},[]);return{...r,getPaymentOptions:s,createGlideSession:o,resetState:i}}(t),J=(0,N.useChainId)(),{signTypedDataAsync:ee}=function(e={}){var t;let{mutation:r}=e,n=(t=(0,S.useConfig)(e),{mutationFn:e=>(0,O.signTypedData)(t,e),mutationKey:["signTypedData"]}),{mutate:s,mutateAsync:a,...o}=(0,C.useMutation)({...r,...n});return{...o,signTypedData:s,signTypedDataAsync:a}}(),et=(0,S.useConfig)(),{data:er=[],isLoading:en}=(0,g.useQuery)({queryKey:["paymentOptions",t,H,d],queryFn:()=>{let e=(0,w.parseEther)(String(Number(H)/o));return(0,T.getPaymentOptionsForAmount)(t,e,d)},enabled:r&&!!d&&o>0,staleTime:3e4,placeholderData:x.keepPreviousData});(0,v.useEffect)(()=>{r&&(W("support"),X(!1),Y.current=!1)},[r]),(0,v.useEffect)(()=>{if(!en){if(0===er.length)return void G(null);if(K){if(B){let e=er.find(e=>(0,a.getPaymentOptionId)(e)===(0,a.getPaymentOptionId)(B));e?G(e):(G(A(er)),$(!1))}}else G(A(er))}},[er,en]);let es=(0,v.useCallback)(async r=>{let p;try{let e=o>0?(0,w.parseEther)(String(Number(H)/o)):0n;if(0n===e)throw Error("Invalid amount");p=await Z.createGlideSession(r,e)}catch(e){throw W("support"),b.toast.error("Error in payment",{description:e instanceof Error?e.message:"Unknown error occurred"}),console.error(e),e}if(p){m||W("wallet"),X(!1);try{await i();let r=(0,_.createWalletSendTransaction)(et),o=async s=>{let a=await r(s);return Y.current||(Y.current=!0,R({coin_id:t,support_value:H,type:e}),n?.()),a},m=async r=>{let s=await ee({...r,domain:r.domain});return Y.current||(Y.current=!0,R({coin_id:t,support_value:H,type:e}),n?.()),s};(0,h.executeEVMSession)(a.glideConfig,{session:p,currentChainId:J,switchChainAsync:l,sendTransactionAsync:o,signTypedDataAsync:m}).then(async r=>{var n;if(Z.resetState(),await Promise.all([u(),c()]),n={coin_id:t,support_value:H,type:e,transaction_hash:r.sponsoredTransactionHash||""},(0,E.captureProductEvent)("support_success",n),"writer"===e&&d){let e=r.sponsoredTransactionHash;e&&await (0,P.notifyWriterCoinPurchase)({coinId:t,buyerWalletAddress:d,usdcAmount:H,transactionHash:e})}}).catch(r=>{var n;
2(console.error("Background execution error:",r),/User rejected the request/.test(String(r)))?s?.():(n={coin_id:t,type:e,error_message:r instanceof Error?r.message:"Unknown error"},(0,E.captureProductEvent)("support_error",n),X(!0),b.toast.error("Failed to process payment",{description:r instanceof Error?r.message:"Unknown error occurred"}))})}catch(e){if(/User rejected the request/.test(String(e))){console.error("User rejected the request"),s?.();return}X(!0),b.toast.error("Failed to process payment",{description:e instanceof Error?e.message:"Unknown error occurred"}),console.error(e)}}},[o,H,Z,i,ee,J,l,n,s,u,c,e,d,t,m,et]),ea=(0,v.useCallback)(async()=>{var r;if(!B)return void b.toast.error("No payment option selected");r={coin_id:t,support_value:H,type:e,payment_option_id:(0,a.getPaymentOptionId)(B)},(0,E.captureProductEvent)("support_submitted",r);try{await es(B)}catch(e){console.error(e),b.toast.error("Failed to process payment",{description:e instanceof Error?e.message:"Unknown error occurred"})}},[B,es,t,H,e]),eo=(0,v.useCallback)(e=>{var r;r={coin_id:t,payment_option_id:(0,a.getPaymentOptionId)(e)},(0,E.captureProductEvent)("support_payment_option_changed",r),G(e),$(!0)},[t]),ei=(0,v.useCallback)(()=>{W("bridge")},[]),el=(0,v.useCallback)(()=>{Z.resetState(),W("support")},[Z]),eu=(0,v.useCallback)(()=>{(0,E.captureProductEvent)("support_retry_clicked",{coin_id:t,type:e}),X(!1),W("support")},[t,e]),ec=(0,v.useCallback)(()=>{W("support"),V(f),G(null),$(!1),X(!1),Y.current=!1,Z.resetState()},[f,Z]);return{stage:I,setStage:W,supportValue:H,setSupportValue:V,selectedPaymentOption:B,paymentOptionsLoading:en,transactionError:z,paymentOptions:er,glideLoading:en,handleSupport:ea,handlePaymentOptionChange:eo,handleOpenPaymentModal:ei,handleCancelBridge:el,handleRetry:eu,resetState:ec}}],106175)},311991,667152,e=>{"use strict";var t=e.i(843476),r=e.i(500932),n=e.i(807930),s=e.i(380750),a=e.i(271645);function o(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function i(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function l(...e){return t=>{let r=!1,n=e.map(e=>{let n=i(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():i(e[t],null)}}}}function u(...e){return a.useCallback(l(...e),e)}function c(e,r=[]){let n=[],s=()=>{let t=n.map(e=>a.createContext(e));return function(r){let n=r?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return s.scopeName=e,[function(r,s){let o=a.createContext(s),i=n.length;n=[...n,s];let l=r=>{let{scope:n,children:s,...l}=r,u=n?.[e]?.[i]||o,c=a.useMemo(()=>l,Object.values(l));return(0,t.jsx)(u.Provider,{value:c,children:s})};return l.displayName=r+"Provider",[l,function(t,n){let l=n?.[e]?.[i]||o,u=a.useContext(l);if(u)return u;if(void 0!==s)return s;throw Error(`\`${t}\` must be used within \`${r}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let s=r(e)[`__scope${n}`];return{...t,...s}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(s,...r)]}e.i(174080);var d=a.forwardRef((e,r)=>{let{children:n,...s}=e,o=a.Children.toArray(n),i=o.find(f);if(i){let e=i.props.children,n=o.map(t=>t!==i?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,t.jsx)(p,{...s,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,t.jsx)(p,{...s,ref:r,children:n})});d.displayName="Slot";var p=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var s;let e,o,i=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),u=function(e,t){let r={...t};for(let n in t){let s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...e)=>{a(...e),s(...e)}:s&&(r[n]=s):"style"===n?r[n]={...s,...a}
2:"className"===n&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(u.ref=t?l(t,i):i),a.cloneElement(r,u)}return a.Children.count(r)>1?a.Children.only(null):null});p.displayName="SlotClone";var m=({children:e})=>(0,t.jsx)(t.Fragment,{children:e});function f(e){return a.isValidElement(e)&&e.type===m}var h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,r)=>{let n=a.forwardRef((e,n)=>{let{asChild:s,...a}=e,o=s?d:r;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o,{...a,ref:n})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),y=globalThis?.document?a.useLayoutEffect:()=>{},x=a["useId".toString()]||(()=>void 0),g=0,v=e.i(30207),b=e.i(369340),w=a.createContext(void 0);function j(e){let t=a.useContext(w);return e||t||"ltr"}var N="rovingFocusGroup.onEntryFocus",S={bubbles:!1,cancelable:!0},C="RovingFocusGroup",[O,k,E]=function(e){let r=e+"CollectionProvider",[n,s]=c(r),[o,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{let{scope:r,children:n}=e,s=a.default.useRef(null),i=a.default.useRef(new Map).current;return(0,t.jsx)(o,{scope:r,itemMap:i,collectionRef:s,children:n})};l.displayName=r;let p=e+"CollectionSlot",m=a.default.forwardRef((e,r)=>{let{scope:n,children:s}=e,a=u(r,i(p,n).collectionRef);return(0,t.jsx)(d,{ref:a,children:s})});m.displayName=p;let f=e+"CollectionItemSlot",h="data-radix-collection-item",y=a.default.forwardRef((e,r)=>{let{scope:n,children:s,...o}=e,l=a.default.useRef(null),c=u(r,l),p=i(f,n);return a.default.useEffect(()=>(p.itemMap.set(l,{ref:l,...o}),()=>void p.itemMap.delete(l))),(0,t.jsx)(d,{...{[h]:""},ref:c,children:s})});return y.displayName=f,[{Provider:l,Slot:m,ItemSlot:y},function(t){let r=i(e+"CollectionConsumer",t);return a.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},s]}(C),[R,P]=c(C,[E]),[_,T]=R(C),I=a.forwardRef((e,r)=>(0,t.jsx)(O.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(O.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(A,{...e,ref:r})})}));I.displayName=C;var A=a.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:f=!1,...y}=e,x=a.useRef(null),g=u(r,x),w=j(l),[C=null,O]=(0,b.useControllableState)({prop:c,defaultProp:d,onChange:p}),[E,R]=a.useState(!1),P=(0,v.useCallbackRef)(m),T=k(n),I=a.useRef(!1),[A,D]=a.use
2State(0);return a.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(N,P),()=>e.removeEventListener(N,P)},[P]),(0,t.jsx)(_,{scope:n,orientation:s,dir:w,loop:i,currentTabStopId:C,onItemFocus:a.useCallback(e=>O(e),[O]),onItemShiftTab:a.useCallback(()=>R(!0),[]),onFocusableItemAdd:a.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>D(e=>e-1),[]),children:(0,t.jsx)(h.div,{tabIndex:E||0===A?-1:0,"data-orientation":s,...y,ref:g,style:{outline:"none",...e.style},onMouseDown:o(e.onMouseDown,()=>{I.current=!0}),onFocus:o(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!E){let t=new CustomEvent(N,S);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===C),...e].filter(Boolean).map(e=>e.ref.current),f)}}I.current=!1}),onBlur:o(e.onBlur,()=>R(!1))})})}),D="RovingFocusGroupItem",U=a.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:l,...u}=e,c=function(){let[e,t]=a.useState(x());return y(()=>{t(e=>e??String(g++))},[void 0]),e?`radix-${e}`:""}(),d=l||c,p=T(D,n),m=p.currentTabStopId===d,f=k(n),{onFocusableItemAdd:v,onFocusableItemRemove:b}=p;return a.useEffect(()=>{if(s)return v(),()=>b()},[s,v,b]),(0,t.jsx)(O.ItemSlot,{scope:n,id:d,focusable:s,active:i,children:(0,t.jsx)(h.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:r,onMouseDown:o(e.onMouseDown,e=>{s?p.onItemFocus(d):e.preventDefault()}),onFocus:o(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:o(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let s=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(s))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(s)))return L[s]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let s=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)s.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&s.reverse();let a=s.indexOf(e.currentTarget);s=p.loop?(r=s,n=a+1,r.map((e,t)=>r[(n+t)%r.length])):s.slice(a+1)}setTimeout(()=>M(s))}})})})});U.displayName=D;var L={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var F=e.i(635804),q=e.i(999682),Q=e=>{var t;let r,n,{present:s,children:o}=e,i=function(e){var t,r;let[n,s]=a.useState(),o=a.useRef({}),i=a.useRef(e),l=a.useRef("none"),[u,c]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},a.useReducer((e,t)=>r[e][t]??e,t));return a.useEffect(()=>{let e=W(o.current);l.current="mounted"===u?e:"none"},[u]),y(()=>
2{let t=o.current,r=i.current;if(r!==e){let n=l.current,s=W(t);e?c("MOUNT"):"none"===s||t?.display==="none"?c("UNMOUNT"):r&&n!==s?c("ANIMATION_OUT"):c("UNMOUNT"),i.current=e}},[e,c]),y(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let s=W(o.current).includes(r.animationName);if(r.target===n&&s&&(c("ANIMATION_END"),!i.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(l.current=W(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:a.useCallback(e=>{e&&(o.current=getComputedStyle(e)),s(e)},[])}}(s),l="function"==typeof o?o({present:i.isPresent}):a.Children.only(o),c=u(i.ref,(t=l,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||i.isPresent?a.cloneElement(l,{ref:c}):null};function W(e){return e?.animationName||"none"}Q.displayName="Presence";var H="Radio",[V,B]=c(H),[G,K]=V(H),$=a.forwardRef((e,r)=>{let{__scopeRadio:n,name:s,checked:i=!1,required:l,disabled:c,value:d="on",onCheck:p,form:m,...f}=e,[y,x]=a.useState(null),g=u(r,e=>x(e)),v=a.useRef(!1),b=!y||m||!!y.closest("form");return(0,t.jsxs)(G,{scope:n,checked:i,disabled:c,children:[(0,t.jsx)(h.button,{type:"button",role:"radio","aria-checked":i,"data-state":Z(i),"data-disabled":c?"":void 0,disabled:c,value:d,...f,ref:g,onClick:o(e.onClick,e=>{i||p?.(),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&(0,t.jsx)(Y,{control:y,bubbles:!v.current,name:s,value:d,checked:i,required:l,disabled:c,form:m,style:{transform:"translateX(-100%)"}})]})});$.displayName=H;var z="RadioIndicator",X=a.forwardRef((e,r)=>{let{__scopeRadio:n,forceMount:s,...a}=e,o=K(z,n);return(0,t.jsx)(Q,{present:s||o.checked,children:(0,t.jsx)(h.span,{"data-state":Z(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})})});X.displayName=z;var Y=e=>{let{control:r,checked:n,bubbles:s=!0,...o}=e,i=a.useRef(null),l=(0,q.usePrevious)(n),u=(0,F.useSize)(r);return a.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(l!==n&&t){let r=new Event("click",{bubbles:s});t.call(e,n),e.dispatchEvent(r)}},[l,n,s]),(0,t.jsx)("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Z(e){return e?"checked":"unchecked"}var J=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ee="RadioGroup",[et,er]=c(ee,[P,B]),en=P(),es=B(),[ea,eo]=et(ee),ei=a.forwardRef((e,r)=>{let{__scopeRadioGroup:n,name:s,defaultValue:a,value:o,required:i=!1,disabled:l=!1,orientation:u,dir:c,loop:d=!0,onValueChange:p,...m}=e,f=en(n),y=j(c),[x,g]=(0,b.useControllableState)({prop:o,defaultProp:a,onChange:p});return(0,t.jsx)(ea,{scope:n,name:s,required:i,disabled:l,value:x,onValueChange:g,children:(0,t.jsx)(I,{asChild:!0,...f,orientation:u,dir:y,loop:d,children:(0,t.jsx)(h.div,{role:"radiogroup","aria-required":i,"aria-orientation":u,"data-disabled":l?"":void 0,dir:y,...m,ref:r})})})});ei.displayName=ee;var el="RadioGroupItem",eu=a.forwardRef((e,r)=>{let{__scopeRadioGroup:n,disabled:s,...i}=e,l=eo(el,n),c=l.disabled||s,d=en(n),p=es(n),m=a.useRef(null),f=u(r,m),h=l.value===i.value,y=a.useRef(!1);return a.useEffect(()=>{let e=e=>{J.includes(e.key)&&(y.current=!0)},t=()=>y.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,t.jsx)(U,{asChild:!0,...d,focusable:!c,active:h,children:(0,t.jsx)($,{disabled:c,required:l.required,
2checked:h,...p,...i,name:l.name,ref:f,onCheck:()=>l.onValueChange(i.value),onKeyDown:o(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:o(i.onFocus,()=>{y.current&&m.current?.click()})})})});eu.displayName=el,a.forwardRef((e,r)=>{let{__scopeRadioGroup:n,...s}=e,a=es(n);return(0,t.jsx)(X,{...a,...s,ref:r})}).displayName="RadioGroupIndicator";var ec=e.i(619273);e.i(247167);var ed=e.i(540143),ep=e.i(869230),em=e.i(915823);function ef(e,t){let r=new Set(t);return e.filter(e=>!r.has(e))}var eh=class extends em.Subscribable{#e;#t;#r;#n;#s;#a;#o;#i;#l;#u=[];constructor(e,t,r){super(),this.#e=e,this.#n=r,this.#r=[],this.#s=[],this.#t=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#s.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#n=t,ed.notifyManager.batch(()=>{let e=this.#s,t=this.#d(this.#r);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),n=r.map(e=>e.getCurrentResult()),s=e.length!==r.length,a=r.some((t,r)=>t!==e[r]),o=s||a,i=!!o||n.some((e,t)=>{let r=this.#t[t];return!r||!(0,ec.shallowEqualObjects)(e,r)});(o||i)&&(o&&(this.#u=t,this.#s=r),this.#t=n,this.hasListeners()&&(o&&(ef(e,r).forEach(e=>{e.destroy()}),ef(r,e).forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){let r=this.#d(e),n=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),s=r.map(e=>e.defaultedQueryOptions.queryHash);return[n,e=>this.#m(e??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{let s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#m(e,t,r){if(t){let n=this.#l,s=void 0!==r&&void 0!==n&&(n.length!==r.length||r.some((e,t)=>e!==n[t]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,void 0!==r&&(this.#l=r),this.#a=(0,ec.replaceEqualDeep)(this.#a,t(e))),this.#a}return e}#h(){return this.#n?.combine!==void 0&&this.#s.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#d(e){let t=new Map;this.#s.forEach(e=>{let r=e.options.queryHash;if(!r)return;let n=t.get(r);n?n.push(e):t.set(r,[e])});let r=[];return e.forEach(e=>{let n=this.#e.defaultQueryOptions(e),s=t.get(n.queryHash)?.shift()??new ep.QueryObserver(this.#e,n);r.push({defaultedQueryOptions:n,observer:s})}),r}#c(e,t){let r=this.#s.indexOf(e);if(-1!==r){var n;let e;this.#t=(n=this.#t,(e=n.slice(0))[r]=t,e),this.#p()}}#p(){if(this.hasListeners()){let e=this.#f(this.#t,this.#u),t=this.#h(),r=this.#a,n=t?r:this.#m(e,this.#n?.combine);(t||r!==n)&&ed.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},ey=e.i(912598),ex=e.i(381384),eg=e.i(673664),ev=e.i(427001),eb=e.i(254440),ew=e.i(672464),ej=e.i(149887),eN=e.i(522016),eS=e.i(846696),eC=e.i(889362),eO=e.i(715571),ek=e.i(583425),eE=e.i(611263),eR=e.i(68688),eP=e.i(891268),e_=e.i(779668),eT=e.i(284517),eI=e.i(487810);function eA(e){let n,s,a,o,i,l,u,c,d,p=(0,r.c)(28),{localSelectedOption:m,supportValue:f,coinsPerUSD:h,paymentOptions:y,onPaymentOptionChange:x,ticker:g,isLoading:v}=e;p[0]!==y?(n=void 0===y?[]:y,p[0]=y,p[1]=n):n=p[1];let b=n,w=void 0!==v&&v,j=m&&f&&h,N=m?.currencySymbol||"tokens",S=Number(f),C=j?Math.floor(S*h):0;p[2]!==m?(s=m?(0,eT.formatAmount)(m.paymentAmount):"â",p[2]=m,p[3]=s):s=p[3];let O=s,k=b.length>1;p[4]!==x||p[5]!==b?(a=e=>{let t=b.find(t=>(0,e_.getPaymentOptionId)(t)===e);t&&x&&x(t)},p[4]=x,p[5]=b,p[6]=a):a=p[6];let E=a;return p[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(eI.default,{className:"mb-2"}),p[7]=o):o=p[7],p[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Supporting with"}),p[8]=i):i=p[8],p[9]!==h||p[10]!==N||p[11]!==E||p[12]!==j||p[13]!==k||p[14]!==w||p[15]!==m||p[16]!==b||p[17]!==f||p[18]!==O?(l=(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[i,w?(0,t.jsx)(eR.Loader2,{className:"h-4 w-4 animate-spin"}):!m&&f&&h?(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Insufficient funds"}):j?k?(0,t.jsxs)(eP.Select,{value:(0,e_.getPaymentOptionId)(m),onValueChange:E,children:[(0,t.jsx)(eP.SelectTrigger,{className:"h-auto py-0 px-0 border-0 bg-transparent w-auto gap-1 text-sm font-medium",children:(0,t.jsx)(eP.SelectValue,{children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[m.currencyLogoUrl&&(0,t.jsx)("img",{src:m.currencyLogoUrl,alt:N,className:"w-4 h-4 rounded-sm"}),O," ",N]})})}),(0,t.jsx)(eP.SelectContent,{children:b.map(eD)})]}):(0,t.jsxs)("span",{className:"text-sm font-medium flex items-center gap-1.5",children:[m.currencyLogoUrl&&(0,t.jsx)("img",{src:m.currencyLogoUrl,alt:N,className:"w-4 h-4 rounded-sm"}),O," ",N]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"â"})]}),p[9]=h,p[10]=N,p[11]=E,p[12]=j,p[13]=k,p[14]=w,p[15]=m,p[16]=b,p[17]=f,p[18]=O,p[19]=l):l=p[19],p[20]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Receive"}),p[20]=u):u=p[20],p[21]!==C||p[22]!==j||p[23]!==g?(c=(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[u,j?(0,t.jsxs)("span",{className:"text-sm font-medium",children:["~",(0,eT.formatAmou
2nt)(C)," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:g?`$${g}`:"coins"})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"â"})]}),p[21]=C,p[22]=j,p[23]=g,p[24]=c):c=p[24],p[25]!==c||p[26]!==l?(d=(0,t.jsxs)("div",{className:"flex-shrink-0 p-4 bg-muted rounded-xl",children:[o,l,c]}),p[25]=c,p[26]=l,p[27]=d):d=p[27],d}function eD(e){return(0,t.jsx)(eP.SelectItem,{value:(0,e_.getPaymentOptionId)(e),children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[e.currencyLogoUrl&&(0,t.jsx)("img",{src:e.currencyLogoUrl,alt:e.currencySymbol||"",className:"w-5 h-5 rounded-sm"}),(0,t.jsxs)("span",{className:"flex flex-col",children:[(0,t.jsxs)("span",{children:[(0,eT.formatAmount)(e.paymentAmount)," ",e.currencySymbol]}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.currencyName," on ",e.chainName]})]})]})},(0,e_.getPaymentOptionId)(e))}var eU=e.i(619089);function eL(){let e,n,s,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(eI.default,{className:"mb-2"}),a[0]=e):e=a[0],a[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Supporting with"}),(0,t.jsx)(eU.Skeleton,{className:"h-4 w-28"})]}),a[1]=n):n=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("div",{className:"flex-shrink-0 p-4 bg-muted rounded-xl",children:[e,n,(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Receive"}),(0,t.jsx)(eU.Skeleton,{className:"h-4 w-32"})]})]}),a[2]=s):s=a[2],s}var eM=e.i(768951),eF=e.i(700281),eq=e.i(477470),eQ=e.i(87220),eW=e.i(868713),eH=e.i(481770),eV=e.i(909069),eB=e.i(368075),eG=e.i(578374),eK=e.i(275599),e$=e.i(731876);function ez(e){let n,s,o,i,l,u,c,d,p=(0,r.c)(20),{option:m,isTopTier:f,showInput:h,supportValue:y,onSupportValueChange:x,affordable:g}=e,v=(0,a.useRef)(null);p[0]!==h?(n=()=>{if(h&&v.current){v.current.focus();let e=v.current.value.length;v.current.setSelectionRange(e,e)}},s=[h],p[0]=h,p[1]=n,p[2]=s):(n=p[1],s=p[2]),(0,a.useEffect)(n,s);let b=h?y:m.value,w=m.value,j=m.type,N=!(void 0===g||g)&&"opacity-40";return p[3]!==N?(o=(0,e$.cn)("border border-border rounded-xl flex-1 px-3 py-5 ring-inset data-[state=checked]:ring-2 data-[state=checked]:ring-accent-foreground cursor-pointer touch-manipulation flex flex-col items-center justify-center gap-2 text-center text-muted-foreground data-[state=checked]:text-card-foreground",N),p[3]=N,p[4]=o):o=p[4],p[5]===Symbol.for("react.memo_cache_sentinel")?(i={touchAction:"manipulation"},p[5]=i):i=p[5],p[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(eG.DollarSign,{size:22,strokeWidth:3,className:"text-muted-foreground opacity-50 flex-shrink-0"}),p[6]=l):l=p[6],p[7]!==b||p[8]!==f||p[9]!==x||p[10]!==m.value||p[11]!==h?(u=(0,t.jsxs)("div",{className:"flex items-center gap-0.5 text-2xl font-semibold w-full justify-center",children:[l,f?(0,t.jsx)("div",{"data-vaul-no-drag":!0,onPointerDownCapture:eY,children:(0,t.jsx)(eK.Input,{ref:v,value:b,onChange:e=>{isNaN(Number(e.target.value))||x?.(e.target.value)},readOnly:!h,onFocus:eX,className:"text-2xl font-semibold border-0 shadow-none p-0 h-auto bg-transparent rounded-none focus-visible:ring-0",style:{width:`${String(b).length}ch`}})}):(0,t.jsx)("span",{children:m.value})]}),p[7]=b,p[8]=f,p[9]=x,p[10]=m.value,p[11]=h,p[12]=u):u=p[12],p[13]!==u||p[14]!==o?(c=(0,t.jsx)("div",{className:o,style:i,children:u}),p[13]=u,p[14]=o,p[15]=c):c=p[15],p[16]!==m.type||p[17]!==m.value||p[18]!==c?(d=(0,t.jsx)(eu,{asChild:!0,value:j,children:c},w),p[16]=m.type,p[17]=m.value,p[18]=c,p[19]=d):d=p[19],d}function eX(e){let t=e.target.value.length;e.target.setSelectionRange(t,t)}function eY(e){return e.stopPropagation()}var eZ=e.i(350753);function eJ({type:e,coinId:r,payment:n,ticker:o}){let{coinsPerUSD:i}=(0,eF.useCoinsPerUsd)(r),{address:l}=(0,eO.useAccount)(),{ethPrice:u}=(0,eq.useEthPrice)(),c=(0,ew.useSetAtom)(eE.supportModalAtom),d="post"===e,p=d?eB.supportTiers:eB.writerTiers,m=d?eB.topSupporterTier:eB.topWriterTier,[f,h]=(0,a.useState)(p[1].type),[y,x]=(0,a.useState)(!1),g=function({queries:e,...t}){let r=(0,ey.useQueryClient)(void 0),n=(0,ex.useIsRestoring)(),s=(0,eg.useQueryErrorResetBoundary)(),o=a.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=n?"isRestoring":"optimistic",t}),[e,r,n]);
2o.forEach(e=>{(0,eb.ensureSuspenseTimers)(e);let t=r.getQueryCache().get(e.queryHash);(0,ev.ensurePreventErrorBoundaryRetry)(e,s,t)}),(0,ev.useClearResetErrorBoundary)(s);let[i]=a.useState(()=>new eh(r,o,t)),[l,u,c]=i.getOptimisticResult(o,t.combine),d=!n&&!1!==t.subscribed;a.useSyncExternalStore(a.useCallback(e=>d?i.subscribe(ed.notifyManager.batchCalls(e)):ec.noop,[i,d]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a.useEffect(()=>{i.setQueries(o,t)},[o,t,i]);let p=l.some((e,t)=>(0,eb.shouldSuspend)(o[t],e))?l.flatMap((e,t)=>{let n=o[t];if(n&&(0,eb.shouldSuspend)(n,e)){let e=new ep.QueryObserver(r,n);return(0,eb.fetchOptimistic)(n,e,s)}return[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=o[t];return n&&(0,ev.getHasError)({result:e,errorResetBoundary:s,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m?.error)throw m.error;return u(c())}({queries:p.map(e=>({queryKey:["paymentOptions",r,e.value,l],queryFn:()=>{let t=(0,eC.parseEther)(String(Number(e.value)/u));return(0,eW.getPaymentOptionsForAmount)(r,t,l)},enabled:!!l&&u>0,staleTime:3e4,placeholderData:ec.keepPreviousData}))}),{allSupporters:v}=(0,eQ.useAllSupporters)({initialData:void 0,coinId:r}),{allAvatarSupporters:b}=(0,eQ.useAllAvatarSupporters)({initialData:void 0,coinId:r,limit:6}),w=(0,eV.getAvatars)(b,v,6),j=function(e,t,r){if(!("string"==typeof e&&!isNaN(e)&&!isNaN(parseFloat(e))))return!1;let n=parseFloat(e);return!(e.split(".")[1]?.length>2)&&!(n<=0)&&(!t||n>=r)}(n.supportValue,f===m.type,parseFloat(m.value)),N=async()=>{if(!j)return void eS.toast.error("Invalid support value");x(!0);try{await n.handleSupport()}finally{x(!1)}};return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[!d&&(0,t.jsxs)(s.DialogDescription,{className:"text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:["Support this publication to show your appreciation, help it reach more readers, and share in its long-term growth."," ",(0,t.jsx)(eZ.default,{delayDuration:250,triggerClassName:"inline-block cursor-help focus:outline-none touch-none",contentClassName:"max-w-[280px]",content:(0,t.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:"What are coins?"}),(0,t.jsx)("p",{children:"When you support this publication, you receive coins in return. They're a way to show the writer you care about their work, signal you were early, and express your taste."}),(0,t.jsx)(eM.Button,{variant:"outline",size:"sm",className:"w-full mt-2",asChild:!0,children:(0,t.jsx)(eN.default,{target:"_blank",href:"https://paragraph.com/docs/earn/writer-coins",children:"Learn more about coins"})})]}),children:(0,t.jsx)(ej.InfoIcon,{size:14,className:"text-muted-foreground mb-1 inline-block"})})]}),(0,t.jsx)("br",{})]}),d&&(0,t.jsx)("h3",{className:"text-sm text-muted-foreground font-normal",children:"How much would you like to support?"}),(0,t.jsx)("div",{className:"min-h-6",children:v&&v.totalSupporterCount>0&&w?(0,t.jsx)(ek.default,{avatars:w,supporters:v,coinId:r,coinsPerUSD:i}):v?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Be the first one to support"}):null}),(0,t.jsx)(ei,{value:f,className:"flex flex-row w-full gap-2 my-4","data-vaul-no-drag":!0,onPointerDownCapture:e=>e.stopPropagation(),onValueChange:t=>{let s=p.find(e=>e.type===t);s&&(n.setSupportValue(s.value),h(t),(0,eH.captureProductEvent)("support_tier_selected",{coinId:r,tier:t,supportValue:s.value,type:e}))},children:p.map((e,r)=>{let s=e.type===m.type,a=g[r],o=s&&f===m.type?!a.data||n.paymentOptions.length>0:!a.data||a.data.length>0;return(0,t.jsx)(ez,{option:e,isTopTier:s,showInput:s&&f===m.type,supportValue:n.supportValue,onSupportValueChange:n.setSupportValue,affordable:o},e.type)})}),(0,t.jsx)("div",{children:n.paymentOptionsLoading&&!n.selectedPaymentOption?(0,t.jsx)(eL,{}):(0,t.jsx)(eA,{localSelectedOption:n.selectedPaymentOption,supportValue:n.supportValue,coinsPerUSD:i,paymentOptions:n.paymentOptions,onPaymentOptionChange:n.handlePaymentOptionChange,ticker:o})}),n.selectedPaymentOption||n.paymentOptionsLoading?(0,t.jsx)(eM.Button,{className:"w-full",onClick:N,disabled:y,children:y?"Processing...":d?"Support":"Buy"}):(0,t.jsx)(eM.Button,{className:"w-full",asChild:!0,children:(0,t.jsx)(eN.default,{href:"/wallet/deposit",onClick:()=>c({isOpen:!1}),children:"Go to Top up"})})]})}
2function e0(e){let n,s=(0,r.c)(5),{type:a,coinId:o,payment:i,ticker:l}=e;return s[0]!==o||s[1]!==i||s[2]!==l||s[3]!==a?(n=(0,t.jsx)(eJ,{type:a,coinId:o,payment:i,ticker:l}),s[0]=o,s[1]=i,s[2]=l,s[3]=a,s[4]=n):n=s[4],n}e.s(["SupportStageContent",0,function(e){let a,o,i,l=(0,r.c)(27),{type:u,blog:c,popularity:d,headerContent:p,children:m,coinId:f,payment:h,ticker:y}=e;l[0]!==c?.name||l[1]!==y?(a=y||c?.name?.toUpperCase().slice(0,4)||"COIN",l[0]=c?.name,l[1]=y,l[2]=a):a=l[2];let x=a;if("writer"===u&&c){let e,r,a,o,i,u;return l[3]!==c?(e=(0,t.jsx)(n.WriterCoinLogo,{blog:c,size:48}),l[3]=c,l[4]=e):e=l[4],l[5]!==c.name?(r=(0,t.jsx)(s.DialogTitle,{className:"text-lg text-foreground",children:c.name}),l[5]=c.name,l[6]=r):r=l[6],l[7]!==d||l[8]!==r?(a=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[r,d]}),l[7]=d,l[8]=r,l[9]=a):a=l[9],l[10]!==e||l[11]!==a?(o=(0,t.jsxs)(s.DialogHeader,{className:"flex gap-2 flex-row items-center space-y-0 flex-shrink-0",children:[e,a]}),l[10]=e,l[11]=a,l[12]=o):o=l[12],l[13]!==f||l[14]!==x||l[15]!==h?(i=(0,t.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:(0,t.jsx)(e0,{type:"writer",coinId:f,payment:h,ticker:x})}),l[13]=f,l[14]=x,l[15]=h,l[16]=i):i=l[16],l[17]!==o||l[18]!==i?(u=(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[o,i]}),l[17]=o,l[18]=i,l[19]=u):u=l[19],u}return l[20]!==f||l[21]!==h?(o=(0,t.jsx)(e0,{type:"post",coinId:f,payment:h}),l[20]=f,l[21]=h,l[22]=o):o=l[22],l[23]!==m||l[24]!==p||l[25]!==o?(i=(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[p,o,m]}),l[23]=m,l[24]=p,l[25]=o,l[26]=i):i=l[26],i}],311991);var e1=e.i(339027),e1=e1,e2=e.i(384868),e2=e2;e.s(["WalletStageContent",0,function(e){let n,s,a,o,i,l=(0,r.c)(14),{transactionError:u,onRetry:c}=e;l[0]!==u?(n=(0,t.jsx)("div",{className:"flex justify-center mb-4",children:u?(0,t.jsx)(e2.default,{className:"w-16 h-16 text-destructive"}):(0,t.jsx)(e1.default,{className:"w-16 h-16 text-primary"})}),l[0]=u,l[1]=n):n=l[1];let d=u?"Transaction failed":"Please check your wallet";l[2]!==d?(s=(0,t.jsx)("h2",{className:"text-2xl font-semibold",children:d}),l[2]=d,l[3]=s):s=l[3];let p=u?"The transaction was cancelled or failed. Would you like to try again?":"Confirm the transaction in your wallet to complete your support.";return l[4]!==p?(a=(0,t.jsx)("p",{className:"text-muted-foreground max-w-sm",children:p}),l[4]=p,l[5]=a):a=l[5],l[6]!==c||l[7]!==u?(o=u&&(0,t.jsx)(eM.Button,{onClick:c,className:"mt-4",children:"Try again"}
2),l[6]=c,l[7]=u,l[8]=o):o=l[8],l[9]!==n||l[10]!==s||l[11]!==a||l[12]!==o?(i=(0,t.jsx)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:(0,t.jsxs)("div",{className:"text-center space-y-4",children:[n,s,a,o]})}),l[9]=n,l[10]=s,l[11]=a,l[12]=o,l[13]=i):i=l[13],i}],667152)}]); 3 4//# debugId=850b95e7-e314-7531-4f61-494552aa2df7
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.