@tuwaio/payments-sdk 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +76 -2
  3. package/dist/OwnConnection-ET76SUMX-4JFMOO7Z.cjs +1 -0
  4. package/dist/OwnConnection-ET76SUMX-G7ZHJN57.js +1 -0
  5. package/dist/checkout-C05-kSiE.d.cts +1616 -0
  6. package/dist/checkout-C05-kSiE.d.ts +1616 -0
  7. package/dist/checkout.cjs +1 -0
  8. package/dist/checkout.d.cts +2 -0
  9. package/dist/checkout.d.ts +2 -0
  10. package/dist/checkout.js +1 -0
  11. package/dist/chunk-LB2KDA4M.js +2 -0
  12. package/dist/chunk-MJOZIUWN.cjs +1 -0
  13. package/dist/chunk-NQ26UU24.cjs +1 -0
  14. package/dist/chunk-TN5VGRRA.cjs +2 -0
  15. package/dist/chunk-UJ2TJGKY.js +1 -0
  16. package/dist/chunk-VTOKR3DS.js +1 -0
  17. package/dist/de-53SSE6O2-GWJEBBVJ.js +1 -0
  18. package/dist/de-53SSE6O2-SX2QT2XZ.cjs +1 -0
  19. package/dist/es-LP3HJ4KB-7RFRVGPQ.cjs +1 -0
  20. package/dist/es-LP3HJ4KB-JN7LQABB.js +1 -0
  21. package/dist/evm.cjs +1 -0
  22. package/dist/evm.d.cts +34 -0
  23. package/dist/evm.d.ts +34 -0
  24. package/dist/evm.js +1 -0
  25. package/dist/i18n.cjs +1 -0
  26. package/dist/i18n.d.cts +10 -0
  27. package/dist/i18n.d.ts +10 -0
  28. package/dist/i18n.js +1 -0
  29. package/dist/index.cjs +2 -0
  30. package/dist/index.d.cts +2979 -0
  31. package/dist/index.d.ts +2979 -0
  32. package/dist/index.js +2 -0
  33. package/dist/it-JJ5Z5EUF-2BNC5I2D.cjs +1 -0
  34. package/dist/it-JJ5Z5EUF-HOA77BWJ.js +1 -0
  35. package/dist/locales-DzMinYsr.d-DzMinYsr.d.cts +1221 -0
  36. package/dist/locales-DzMinYsr.d-DzMinYsr.d.ts +1221 -0
  37. package/dist/solana.cjs +1 -0
  38. package/dist/solana.d.cts +42 -0
  39. package/dist/solana.d.ts +42 -0
  40. package/dist/solana.js +1 -0
  41. package/dist/styles.css +1324 -0
  42. package/dist/types-Bp6JUt56.d-ByIsb1F7.d.cts +350 -0
  43. package/dist/types-Bp6JUt56.d-C5vQkYhR.d.ts +350 -0
  44. package/dist/uk-EI4N5BMM-5PL2AYKV.js +1 -0
  45. package/dist/uk-EI4N5BMM-UN76BFNO.cjs +1 -0
  46. package/dist/zhCN-BZBMKUUA-E7M3WG4Q.js +1 -0
  47. package/dist/zhCN-BZBMKUUA-VSNNE3YC.cjs +1 -0
  48. package/package.json +136 -3
  49. package/socket.json +17 -0
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import {c}from'./chunk-LB2KDA4M.js';import {h,g,b,d,c as c$1,e,f,i}from'./chunk-UJ2TJGKY.js';import {b as b$1,a}from'./chunk-VTOKR3DS.js';export{a as PaymentWalletError,b as walletErrorKind}from'./chunk-VTOKR3DS.js';import {getChainName,cn as cn$1,DrawnCheck,MorphText,WalletIcon,Dialog,DialogContent,DialogTitle,TokenIcon,QuasarLoader,StatusEdge,NetworkIcon,DrawnCross,CopyIcon}from'@tuwaio/sdk/nova-core';import {createContext,lazy,useState,useEffectEvent,useEffect,useContext,useId,useRef,useMemo,Fragment as Fragment$1,useCallback,Suspense}from'react';import {formatBaseUnits,parseCaip2ChainId,toCaip2ChainId,formatCaip10AccountId,toEvmChainId,parseCaip19AssetId,parseCaip10AccountId,shortAddress,OrbitAdapter,getAdapterFromConnectorType,getConnectorTypeFromName,formatConnectorName,getSolanaCluster,isSameAddress,delay}from'@tuwaio/sdk/orbit';export{shortAddress}from'@tuwaio/sdk/orbit';import {TxStatusVisual,TxProgressIndicator,HashLink}from'@tuwaio/sdk/nova-transactions';import {useLabels,NovaTransactionsLabelsProvider}from'@tuwaio/sdk/nova-transactions/providers';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {ChevronDownIcon,LockClosedIcon,ClockIcon,GlobeAltIcon,XMarkIcon,FingerPrintIcon,WalletIcon as WalletIcon$1,QrCodeIcon,DevicePhoneMobileIcon,NoSymbolIcon,ArrowPathRoundedSquareIcon,ArrowUturnLeftIcon,MagnifyingGlassIcon,ExclamationTriangleIcon,DocumentTextIcon,ArrowDownTrayIcon,InformationCircleIcon}from'@heroicons/react/24/outline';import {MotionConfig}from'framer-motion';import {useStore}from'zustand';import {SatelliteStoreContext}from'@tuwaio/sdk/satellite/react';import {createStore}from'zustand/vanilla';import {NovaConnectProviderContext}from'@tuwaio/sdk/nova-connect/hooks';import {encode}from'uqr';function fa(e,a){let[r,n]=useState(null),o=useEffectEvent(a);return useEffect(()=>{if(e===null)return;let l=true,i;try{i=Promise.resolve(o());}catch(c){i=Promise.reject(c);}return i.then(c=>l&&n({key:e,value:c}),()=>l&&n({key:e,value:null})),()=>{l=false;}},[e]),r&&r.key===e?r.value:void 0}function St(e,a,r){let[n,o]=useState(0),[l,i]=useState(null),c=useEffectEvent(a);return useEffect(()=>{if(e===null||typeof window>"u")return;let p=()=>{document.visibilityState!=="hidden"&&o(h=>h+1);},u=window,y=document;return u.addEventListener("focus",p),y.addEventListener("visibilitychange",p),()=>{u.removeEventListener("focus",p),y.removeEventListener("visibilitychange",p);}},[e]),useEffect(()=>{if(e===null)return;let p=true,u;try{u=Promise.resolve(c());}catch(y){u=Promise.reject(y);}return u.then(y=>p&&i({key:e,value:y}),()=>p&&i({key:e,value:null})),()=>{p=false;}},[e,n,r]),l&&l.key===e?l.value:void 0}var bn=createContext(null),zr=bn.Provider;function Y(){let e=useContext(bn);if(!e)throw new Error("useCheckoutContext must be used inside PaymentCheckout");return e}function Ae(){return useContext(bn)}function Ct(e){return e.closest("[data-novapay-scroll]")??null}function Gr(e,a){let r=a?.offsetHeight;return r&&r>0?Math.min(e,r):e}function jr(e){let a=e.offsetHeight;return a>0?Gr(a,Ct(e)):null}function gn(e){let[a,r]=useState(null),[n,o]=useState(null),[l,i]=useState(null);return useEffect(()=>{if(!a)return;let c=Ct(a),p=()=>{if(!e){let h=jr(a);h!==null&&o(h);}let y=c?.offsetHeight;i(y&&y>0?y:null);};if(p(),typeof ResizeObserver>"u")return;let u=new ResizeObserver(p);return e||u.observe(a),c&&u.observe(c),()=>u.disconnect()},[a,e]),!e||n===null?[r,null]:[r,l?Math.min(n,l):n]}function Ie(e,a=2){let r=e.startsWith("-"),n=(r?e.slice(1):e).padStart(a+1,"0");return `${r?"-":""}${n.slice(0,-a)}.${n.slice(-a)}`}var It=e=>new Intl.NumberFormat(e).formatToParts(1.1).find(a=>a.type==="decimal")?.value??".";function ye(e,a){let[r="0",n=""]=(typeof e=="number"?e.toFixed(2):e.trim()).split("."),o=r.startsWith("-"),l=new Intl.NumberFormat(a).format(BigInt(o?r.slice(1):r));return `${o?"-":""}${l}${It(a)}${n.padEnd(2,"0").slice(0,2)}`}function ue(e,a,r){let n=BigInt(e),o=n<0n,l=o?-n:n,i=10n**BigInt(a),c=new Intl.NumberFormat(r).format(l/i),p=(l%i).toString().padStart(a,"0").replace(/0+$/,"").padEnd(2,"0");return `${o?"-":""}${c}${It(r)}${p}`}function Tt(e,a,r){let n=10n**BigInt(Math.max(a-6,0)),o=(BigInt(e)+n/2n)/n*n;return o===0n?null:ue(o.toString(),a,r)}function _t(e,a){return formatBaseUnits(e,a)??"0"}var je=e=>String(e).padStart(2,"0");function Qe(e){let a=Math.max(0,Math.floor(e/1e3)),r=Math.floor(a/86400),n=Math.floor(a%86400/3600),o=Math.floor(a%3600/60),l=a%60;return r>0?`${r}d ${je(n)}:${je(o)}`:n>0?`${je(n)}:${je(o)}:${je(l)}`:`${je(o)}:${je(l)}`}var Gn={metamask:"MetaMask",walletconnect:"WalletConnect",coinbase:"Coinbase Wallet",okx:"OKX Wallet",trust:"Trust Wallet",injected:"Browser wallet"};function Qr(e,a){let r=e.slice(e.indexOf(":")+1).toLowerCase();return r==="injected"?Gn.injected:a?.trim()||Gn[r]||r.charAt(0).toUpperCase()+r.slice(1)}var At=e=>/^data:image\//i.test(e)||/^https:\/\//i.test(e),ln=e=>{let a=typeof e=="string"?e.trim():"";return a&&At(a)?a:void 0};function Vr(e,a,r){let n=getAdapterFromConnectorType(a),o=e[n];if(!Array.isArray(o))return;let l=o.filter(i=>typeof i=="object"&&i!==null&&typeof i.name=="string"&&getConnectorTypeFromName(n,formatConnectorName(i.name))===a);return r&&l.find(i=>ln(i.icon)===r)||l[0]}var Nn=e=>{let a=parseCaip2ChainId(e)?.namespace;return a==="eip155"||a==="solana"?a:null};function Yr(e,a){if(!e?.address)return null;let r=toCaip2ChainId(e.chainId),n=r?Nn(r):null;if(!r||!n)return null;let o=ln(e.icon),l=a?Vr(a,e.connectorType,o):void 0;return {address:e.address,chainId:r,family:n,connectorType:e.connectorType,walletId:e.connectorType.slice(e.connectorType.indexOf(":")+1).toLowerCase(),name:Qr(e.connectorType,typeof l?.name=="string"?l.name:void 0),icon:o??ln(l?.icon),connection:e}}function We(e){return Nn(e.chainId)}function ze(e,a){return !e||e.family!==We(a)?null:formatCaip10AccountId(a.chainId,e.address)??null}function Zr(e,a){let r=We(e);return r==="solana"||r==="eip155"&&!!a}function qt(e){let a=r=>String(Number((r/100).toFixed(2)));return e.discountBps>0?{kind:"discount",percent:a(e.discountBps)}:e.markupBps>0?{kind:"markup",percent:a(e.markupBps)}:null}function ve(e){return getChainName(toEvmChainId(e)??e).name}function Jr(e){let a=e.assetId?parseCaip19AssetId(e.assetId):void 0;return !a||a.assetNamespace==="slip44"?"native":a.assetReference}var Xr="too_many_payments",eo=e=>e==="selectMethod"||e==="awaitingPayment",jn=e=>e?.status==="active"&&!!e.replacement;function ao(e,a={}){if(a.labelsReady===false&&e.phase!=="error")return "loading";if(a.autoPayOff&&e.checkout?.autoCharge?.status==="active")return "autoPayOff";if(e.phase==="unconfirmed")return ba(e.error)==="retrying"?"confirm":"unconfirmed";let r=e.payerProof==="required"||e.payerProof==="confirming"||e.payerProof==="confirmed"&&!e.error,n=!!(a.confirmWallet&&r);switch(e.phase){case "selectMethod":return a.autoPay&&jn(e.checkout?.autoCharge)?"autoPay":n&&!(a.handoff&&a.payWith==="qr")?"confirmWallet":a.handoff&&a.payWith==="qr"?"qr":"method";case "underpaid":return n?"confirmWallet":"underpaid";case "quoting":return e.quote?a.payWith==="qr"||e.quote.payer===null?"qr":"pay":a.confirmWallet?"confirmWallet":"method";case "awaitingPayment":if(a.autoPay&&jn(e.checkout?.autoCharge))return "autoPay";case "submitting":return e.phase==="submitting"&&!e.quote?"confirm":a.payWith==="qr"||e.quote?.payer===null?"qr":"pay";case "confirming":return "confirm";case "paid":return a.autoPay&&e.checkout?.autoCharge?.status==="available"?"autoPay":"paid";case "cancelled":return e.checkout?.invoice.replacedBy?"replaced":"cancelled";default:return e.phase}}var no={buyer:"details",method:"method",confirmWallet:"method",pay:"pay",qr:"pay",underpaid:"pay",confirm:"confirm",unconfirmed:"confirm",autoPay:"autoPay"};function to(e,a={}){let r=no[e];if(!r)return null;let n=[...a.withDetails||r==="details"?["details"]:[],"method","pay","confirm",...r==="autoPay"?["autoPay"]:[]],o=n.indexOf(r);return n.map((l,i)=>({key:l,state:i<o?"done":i===o?"current":"upcoming"}))}function ro(e={}){return [...e.withDetails?["details"]:[],"method","pay","confirm"].map(a=>({key:a,state:"done"}))}function oo(e,a){let r=i=>i.chainId===a?0:i.featured?1:2,n=new Map;for(let i of e)n.set(i.symbol,[...n.get(i.symbol)??[],i]);let o=[...n].map(([i,c])=>{let p=[...c].sort((u,y)=>r(u)-r(y));return {symbol:i,methods:p,featured:c.some(u=>u.featured),inWallet:!!a&&c.some(u=>u.chainId===a)}}),l=i=>i.inWallet?0:i.featured?1:2;return o.sort((i,c)=>l(i)-l(c))}var lo=new Set(["open","processing","underpaid"]),io=new Set(["loading","error","buyer","method","confirmWallet","pay","qr","underpaid","blocked"]);function kn(e,a,r){return lo.has(e)?a==="confirm"||a==="unconfirmed"?"confirming":io.has(a)?e==="underpaid"&&r===false?"closed":"paying":null:null}var so=[10,5,1];function co(e,a,r=so){if(e===null||a<=0)return null;let n=r.filter(o=>e>o*6e4&&a<=o*6e4);return n.length?Math.min(...n):null}var $t=6e4;function po(e){let{autoPayOffOpen:a,phase:r,quotePayer:n,payer:o}=e;return a||r!=="awaitingPayment"||!n||o===n?"keep":o?"lock":"release"}function uo(e){let{open:a,storePayer:r,payer:n,paysRest:o}=e;return !a||n===r?"keep":n&&o?"follow":"leave"}function yo(e){return e>0&&e<=$t}function vo(e){return e.amlScreening!==false}function ea(e){return e.paymentOnTheWay??!!(e.txKey||e.txHash)}function xa(e,a){let r=a?.invoice?.pendingPayments??0;return e.invoicePaymentOnTheWay??r>0}function mo({state:e,checkout:a,handedOverAt:r,dueAt:n}){let o=e.paymentSentInTime,l=ea({paymentOnTheWay:e.paymentOnTheWay,txKey:e.txKey??null,txHash:e.txHash??null});if(typeof o=="boolean"&&l)return o;let i=a.invoice.paymentCountsUntil;return i===void 0?r!==null&&r<n:r!==null&&r>=n?false:(e.paymentCountsUntil===void 0?i:e.paymentCountsUntil)!==null}var Pn="settlement_failed",Rt="tx_already_used";function ho(e){let a=e?.code,r=e?.reason;return (a==="payment_failed"||a==="payment_mismatch")&&!!r&&r!==Pn}var fo=new Set(["no_matching_transfer","reference_missing","too_early","tx_already_used","payer_mismatch","payer_unconfirmed","quote_changed","too_many_parts","too_many_transfers","below_minimum","native_from_contract_unverifiable","invoice_not_payable"]);function Ve(e){let a=e?.code,r=e?.reason;return r===Pn?false:a==="payment_mismatch"?true:a==="payment_failed"&&r!==void 0&&fo.has(r)}function xo(e){let a=e?.reason;return Ve(e)&&a===Rt}function Ma(e,a){let r=a?.invoice?.unresolvedPayments??0;return e.invoicePaymentUnresolved??r>0}function ba(e){let a=e?.code,{reason:r,rechecked:n,stillRead:o}=e??{};return a==="payment_failed"&&r==="unresolved_after_24h"?"closed":r===Pn&&(a==="payment_unconfirmed"||a==="payment_mismatch")?n===true?"settlementRetrying":"settlementFailed":a!=="payment_unconfirmed"?null:r==="nonce_spent_unexplained"?"nonceSpent":r==="unmined_after_24h"||o===true?"unmined":r===Rt?"takenElsewhere":r==="submit_retrying"?"retrying":r==="submit_failed"?"notReceived":r===Xr?"invoiceFull":n===true?"rechecked":"contact"}function wo(e,a){let{txKey:r}=e.error??{};if(r)return r;let n=a?.invoice?.rejectedPayments;return e.txHash??e.txKey??n?.[0]?.txKey??null}function bo(e,a){return e.supportEmail?`mailto:${e.supportEmail}?subject=${encodeURIComponent(a)}`:e.website??null}var Mt={nonceSpent:"unconfirmedNonceSpent",closed:"unconfirmedClosed",takenElsewhere:"unconfirmedTakenElsewhere",settlementRetrying:"unconfirmedSettlementRetrying",settlementFailed:"unconfirmedSettlementFailed",invoiceFull:"unconfirmedInvoiceFull"},go=new Set(["payer_mismatch","payer_unconfirmed"]);function va(e,a,r=""){if(Ve(e)){let l=e.reason??"",i=e.held===true;if(l==="quote_changed")return h(a.pay.mismatchChargeHeld,{merchant:r});if(l==="too_many_parts")return h(a.pay.mismatchTooManyParts,{merchant:r});let c=go.has(l)?i?a.pay.mismatchOtherWalletHeld:a.pay.mismatchOtherWallet:i?a.pay.mismatchHeldElsewhere:xo(e)?a.pay.mismatchTakenElsewhere:a.pay.mismatch;return h(c,{merchant:r})}let n=ba(e),o=n?Mt[n]:void 0;return o?h(a.outcome[o],{merchant:r}):null}var No=["buyer","selectMethod","quoting","awaitingPayment"];function Qn(e,a,r){if(r==="underpaid")return false;let n=ba(a);return No.includes(e)&&!Ve(a)&&!(n&&Mt[n])}function Sn(e,a,r=""){let n=va(e,a,r);if(n!==null)return n;switch(e.code){case "screening_unavailable":return a.pay.screeningUnavailable;case "request_failed":return a.pay.noAnswer;case "amount_out_of_range":case "method_not_found":case "testnet_required":return a.method.methodUnavailable;case "payer_not_expected":return a.method.payerNotExpected;case "too_many_payments":return h(a.method.tooManyPayments,{merchant:r});case "too_many_payers":return h(a.method.tooManyPayers,{merchant:r});case "native_from_contract":return a.method.nativeFromSmartWallet;case "rate_limited":return a.method.rateLimited;case "price_unavailable":case "price_no_rpc":return a.method.priceUnavailable;case "consent_required":return a.method.consentRequired;case "payer_proof_required":case "payer_proof_declined":return a.payerProof.text;case "payer_proof_invalid":return a.payerProof.invalid;case "payer_proof_unavailable":return a.payerProof.unavailable;case "payment_failed":return a.method.paymentFailed;case "rest_method_mismatch":return a.method.restSameMethod;default:return a.error.generic}}function Et(e){return e?.status==="available"?e:e?.status==="active"?e.replacement??null:null}function ko(e,a){let r=Et(e);if(!r)return null;let n=a.find(c=>c.id===r.methodId);if(!n)return null;let{request:o}=r,l=o.rules.find(c=>c.type==="expiry")?.data,i=o.rules.find(c=>c.type==="payee")?.data;return {chainId:`eip155:${Number.parseInt(o.chainId,16)}`,to:i?.addresses?.[0]??o.to,limit:BigInt(o.permission.data.periodAmount).toString(),decimals:n.decimals,symbol:n.symbol,periodSeconds:o.permission.data.periodDuration,expiresAt:l?.timestamp?l.timestamp*1e3:null}}function Wt(e,a){let r=e%86400===0;return new Intl.NumberFormat(a,{style:"unit",unit:r?"day":"hour",unitDisplay:"long"}).format(r?e/86400:Math.round(e/3600))}function Po(e,a){if(!e||a===null)return null;let r=BigInt(e.cryptoAmountExpected)-BigInt(a);return r>0n?r.toString():null}function Cn(e,a,r,n,o,l=r.pay.restRateEnded){let i=e?.rateHeldUntil?Date.parse(e.rateHeldUntil):null;if(i===null)return null;if(i<=a)return h(l,{merchant:n});let c=new Intl.DateTimeFormat(o,{dateStyle:"medium",timeStyle:"short"}).format(i);return h(r.pay.restRateUntil,{time:c,merchant:n})}function aa(e){return parseCaip10AccountId(e)?.address??e}function Da(e,a){let r=aa(e),n=aa(a);return r.startsWith("0x")?r.toLowerCase()===n.toLowerCase():r===n}function So(e){return e&&/^\d+$/.test(e)&&BigInt(e)>0n?e:null}function Co(e){let a=BigInt(e.cryptoAmount),r=e.received?BigInt(e.received):null;if(r&&a>r&&(a-r)*200n>=r)return true;if(!e.atPaymentRate)return false;let n=BigInt(e.atPaymentRate);return n===0n?false:(a>n?a-n:n-a)*200n>=n}var Io=new Set(["held","refunded","expired","cancelled","blocked","error"]);function To(e,a,r){return r?e==="paid"?a!==0:!Io.has(e):true}var _o=new Set(["evm:coinbase","evm:baseaccount","evm:porto"]);function Ot(e){return !!(e&&_o.has(e.connectorType.toLowerCase()))}function Ao(e,a){return e==="required"||e==="confirming"?true:e==="unless_relayed"&&a!=="relay"}async function qo(e,a){let{payerProof:r}=e.getState();if(r==="required"||r==="confirming")return a(true),null;a(false);let n=await e.getState().requestQuote();return !n&&e.getState().error?.code==="payer_proof_required"&&a(true),n}var $o=new Set(["payer_chain_mismatch","too_many_payers"]);function Ea(e){let a=e?.code;return a!==void 0&&(a.startsWith("payer_proof_")||$o.has(a))}var Ro=new Set(["rate_limited","request_failed","origin_required","invoice_not_payable"]);function sn(e){let a=e?.code;return Ea(e)||a!==void 0&&Ro.has(a)}function In(e,a,r,n){if(a==="declined")return h(r.payerProof.declined,n);if(a==="switchDeclined")return h(r.payerProof.switchDeclined,n);if(a==="unsupported")return h(r.payerProof.unsupported,n);if(a==="wrongNetwork"||a==="switchFailed")return h(r.payerProof.wrongNetwork,n);if(a==="notAuthorized")return h(r.pay.notAuthorized,n);if(a==="alreadyPending")return h(r.walletPrompt.stillWaiting,n);if(a)return h(r.payerProof.failed,n);switch(e?.code){case void 0:case "payer_proof_required":return null;case "payer_proof_declined":return h(r.payerProof.declined,n);case "payer_proof_invalid":return r.payerProof.invalid;case "payer_proof_unavailable":return r.payerProof.unavailable;case "payer_chain_mismatch":return h(r.payerProof.wrongNetwork,n);case "too_many_payers":return h(r.payerProof.tooManyWallets,n);case "rate_limited":return r.method.rateLimited;case "request_failed":return r.pay.noAnswer;default:return r.error.generic}}var Gi=6e5;async function Ut(e,a){let r,n=new Promise(o=>{r=setTimeout(()=>o(false),a);});try{return await Promise.race([e.then(()=>!0),n])}finally{clearTimeout(r);}}var ie="novapay:focus-visible:outline-2 novapay:focus-visible:outline-offset-2 novapay:focus-visible:outline-[var(--tuwa-text-accent)]",Fa=`novapay:inline-flex novapay:h-7 novapay:min-w-7 novapay:items-center novapay:justify-center novapay:gap-1 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-1.5 novapay:text-[var(--tuwa-text-primary)] novapay:cursor-pointer novapay:transition-colors novapay:hover:bg-[var(--tuwa-bg-muted)] ${ie}`,F="novapay:font-mono novapay:tabular-nums",ga=`novapay-title ${F} novapay:m-0 novapay:text-base novapay:font-bold novapay:text-balance novapay:outline-none`,Ba={tabIndex:-1,"data-novapay-heading":""},La=`${F} novapay:inline-flex novapay:h-11 novapay:w-full novapay:cursor-pointer novapay:items-center novapay:justify-center novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border-0 novapay:bg-[var(--tuwa-button-primary-bg)] novapay:text-sm novapay:font-bold novapay:text-[var(--tuwa-text-on-accent)] novapay:no-underline novapay:transition-colors novapay:hover:bg-[var(--tuwa-button-primary-bg-hover)] novapay:disabled:cursor-not-allowed novapay:disabled:opacity-70 ${ie}`,Dt=`novapay:cursor-pointer novapay:border-0 novapay:bg-transparent novapay:p-0 novapay:text-[length:inherit] novapay:font-semibold novapay:text-[var(--tuwa-text-accent)] novapay:underline ${ie}`,Tn=`${F} novapay:inline-flex novapay:h-11 novapay:w-full novapay:cursor-pointer novapay:items-center novapay:justify-center novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:text-sm novapay:font-bold novapay:text-[var(--tuwa-text-primary)] novapay:no-underline novapay:transition-colors novapay:hover:bg-[var(--tuwa-bg-muted)] novapay:disabled:cursor-not-allowed novapay:disabled:opacity-70 ${ie}`;function _n(e){return e==="modal"?{frame:"novapay:sm:w-[min(760px,calc(100vw_-_2rem_-_2px))]",section:""}:{frame:"",section:`novapay:box-border ${e==="page"?"novapay:w-[880px]":"novapay:w-[760px]"} novapay:max-w-full`}}var Mo={default:{frame:"novapay:relative novapay:box-border novapay:flex novapay:w-full novapay:flex-col novapay:overflow-hidden novapay:bg-[var(--tuwa-bg-primary)] novapay:text-[var(--tuwa-text-primary)] novapay:sm:h-[680px] novapay:sm:flex-row",aside:"novapay:hidden novapay:w-[286px] novapay:shrink-0 novapay:border-r novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-secondary)] novapay:p-5 novapay:sm:block",main:"novapay:flex novapay:min-h-0 novapay:min-w-0 novapay:flex-1 novapay:flex-col",area:"novapay:@container novapay:flex novapay:min-h-0 novapay:flex-1 novapay:flex-col novapay:overflow-y-auto"},page:{frame:"novapay:relative novapay:box-border novapay:flex novapay:w-full novapay:flex-1 novapay:flex-col novapay:bg-[var(--tuwa-bg-primary)] novapay:text-[var(--tuwa-text-primary)] novapay:sm:min-h-[calc(var(--novapay-page-floor)_-_2px)] novapay:sm:flex-row",aside:"novapay-page-aside novapay:hidden novapay:w-[clamp(260px,36.4%,320px)] novapay:shrink-0 novapay:flex-col novapay:border-r novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:p-5 novapay:sm:flex",main:"novapay:flex novapay:min-w-0 novapay:flex-1 novapay:flex-col",area:"novapay:@container novapay:flex novapay:flex-1 novapay:flex-col"}};function Eo(e){return e.length<=7?"novapay:text-[36px]":e.length<=10?"novapay:text-[30px]":e.length<=13?"novapay:text-[24px]":"novapay:text-[20px]"}function se(e,a,r){let n=e.customization.classNames?.[a];return n?.({screen:e.screen,checkoutState:e.state,checkout:e.checkout,...r})}function Ha({children:e,labels:a}){let r=Ae(),n=a??r?.labels,o=useLabels(),l=useMemo(()=>({...o,trackingModal:{...o.trackingModal,progressIndicator:{created:n.confirm.sent,processing:n.confirm.confirming,succeed:n.confirm.paid}},statuses:{...o.statuses,confirmed:n.confirm.confirmed,failed:n.confirm.failed},actions:{...o.actions,viewOnExplorer:n.confirm.viewOnExplorer,copy:n.confirm.copyHash},txError:{...o.txError,copied:n.pay.copied}}),[o,n]);return jsx(NovaTransactionsLabelsProvider,{labels:l,children:e})}var Ye=(e,a)=>e?se(e,a):void 0;function An({walletId:e,icon:a}){let[r,n]=useState(null);return a&&a!==r&&At(a)?jsx("img",{src:a,alt:"",onError:()=>n(a),className:"novapay:block novapay:h-full novapay:w-full novapay:object-contain"}):jsx(WalletIcon,{walletName:e})}function Pe({hash:e,chainId:a,explorerUrl:r,labels:n}){let o=Ae(),l=r??(a?o?.adapterFor(a.startsWith("solana:")?"solana":"eip155")?.explorerAddressUrl?.({chainId:a,address:e}):void 0);return jsx(Ha,{labels:n,children:jsx(HashLink,{hash:e,explorerUrl:l,variant:"compact",...o?.customization.childCustomizations?.hashLink})})}function Ft({walletId:e,walletIcon:a}){return !e&&!a?jsx(QuasarLoader,{size:48,accent:"var(--tuwa-pending-icon)"}):jsxs("span",{className:"novapay:relative novapay:flex novapay:h-20 novapay:w-20 novapay:items-center novapay:justify-center novapay:rounded-full novapay:border-2 novapay:border-[var(--tuwa-border-primary)]",children:[jsx("span",{className:"novapay:block novapay:h-11 novapay:w-11",children:jsx(An,{walletId:e??"",icon:a})}),jsx("span",{"aria-hidden":true,className:"novapay:absolute novapay:-inset-0.5 novapay:animate-spin novapay:rounded-full novapay:border-2 novapay:border-transparent novapay:border-t-[var(--tuwa-pending-text)] novapay:motion-reduce:animate-none"})]})}function me({title:e,subtitle:a,children:r}){let n=Ae(),o=n?.display==="page";return jsxs("section",{className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col novapay:gap-2.5 novapay:px-5 novapay:py-4",o&&"novapay-page-screen",Ye(n,"screen")),children:[jsxs("div",{children:[jsx("h2",{...Ba,className:ga,children:typeof e=="string"?jsx(MorphText,{wrap:true,children:e}):e}),a&&jsx("p",{className:cn$1("novapay:m-0 novapay:mt-1 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",o&&"novapay-page-subtitle"),children:a})]}),r]})}function ce({children:e}){let a=Ae(),r=useRef(null),n=a?.display==="page";return useEffect(()=>{let o=r.current,l=n?o?.ownerDocument.documentElement:o?.closest("[data-novapay-scroll]");if(!o||!l||typeof ResizeObserver>"u")return;let i=()=>l.style.scrollPaddingBottom=!n||getComputedStyle(o).position==="sticky"?`${o.offsetHeight+8}px`:"";i();let c=new ResizeObserver(i);return c.observe(o),()=>{c.disconnect(),l.style.scrollPaddingBottom="";}},[n]),jsx("footer",{ref:r,className:cn$1("novapay:empty:hidden novapay:sticky novapay:bottom-0 novapay:z-10 novapay:flex novapay:flex-col novapay:gap-2 novapay:border-t novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-5 novapay:pb-3.5 novapay:pt-3 novapay:text-center",n&&"novapay-page-footer",Ye(a,"footer")),children:e})}function qa({children:e,id:a}){let r=Ae()?.display==="page";return jsx("span",{id:a,className:cn$1(F,"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",r&&"novapay-page-group"),children:e})}function oe({busy:e,children:a,className:r,...n}){let o=Ae(),l=Ye(o,"primaryButton"),i=o?.customization.components?.PrimaryButton;return i?jsx(i,{busy:e,className:cn$1(r,l),...n,children:a}):jsxs("button",{type:"button","aria-busy":e||void 0,...n,disabled:n.disabled||e,className:cn$1(La,r,l),children:[e&&jsx(QuasarLoader,{size:16,accent:"currentColor"}),typeof a=="string"?jsx(MorphText,{children:a}):a]})}function pe({children:e,className:a,...r}){let n=Ae();return jsx("button",{type:"button",...r,className:cn$1(Tn,a,Ye(n,"secondaryButton")),children:e})}function ge({children:e}){return jsx("p",{className:"novapay:m-0 novapay:text-center novapay:text-[11px] novapay:leading-snug novapay:text-[var(--tuwa-text-secondary)]",children:e})}function xe({children:e,className:a}){let r=Ae();return jsx("dl",{className:cn$1("novapay:m-0 novapay:flex novapay:w-full novapay:flex-col novapay:divide-y novapay:divide-[var(--tuwa-border-primary)] novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-3 novapay:text-left",a,Ye(r,"detailsCard")),children:e})}function te({children:e}){let a=Ae();return jsx("p",{role:"alert",className:cn$1("novapay:m-0 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:bg-[var(--tuwa-error-bg)] novapay:px-3 novapay:py-2 novapay:text-xs novapay:text-[var(--tuwa-error-text)]",Ye(a,"error")),children:e})}function qn({text:e,label:a,copiedLabel:r,children:n}){let[o,l]=useState(false);return useEffect(()=>{if(!o)return;let i=setTimeout(()=>l(false),2e3);return ()=>clearTimeout(i)},[o]),jsxs(Fragment,{children:[jsxs("button",{type:"button","aria-label":n?void 0:a,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>l(true),()=>{});},className:cn$1(Fa,"novapay:min-h-6 novapay:min-w-6 novapay:text-xs"),children:[jsx(CopyIcon,{copied:o,className:"novapay:h-3.5 novapay:w-3.5"}),n]}),jsx("span",{role:"status",className:"novapay:sr-only",children:o?r:""})]})}function z({name:e,children:a}){let r=Ae();return jsxs("div",{className:cn$1("novapay:flex novapay:items-baseline novapay:justify-between novapay:gap-3 novapay:py-2 novapay:text-xs",r?.display==="page"&&"novapay-page-row",Ye(r,"detailRow")),children:[jsx("dt",{className:"novapay:shrink-0 novapay:text-[var(--tuwa-text-secondary)]",children:e}),jsx("dd",{className:cn$1(F,"novapay:m-0 novapay:min-w-0 novapay:text-right novapay:break-words"),children:a})]})}function wa({children:e,onClick:a,disabled:r}){return jsx("button",{type:"button",onClick:a,disabled:r,className:cn$1("novapay:disabled:cursor-default novapay:disabled:opacity-50 novapay:min-h-6 novapay:cursor-pointer novapay:border-0 novapay:bg-transparent novapay:p-0 novapay:text-xs novapay:text-[var(--tuwa-text-accent)] novapay:underline novapay:hover:no-underline",ie),children:e})}function Wa({kind:e,walletName:a,walletId:r,walletIcon:n,amount:o,merchant:l,network:i,to:c,priceTime:p,onRetry:u,text:y,details:h$1,hint:g,onCancel:N,stepHeight:w}){let{labels:v,display:C}=Y(),b=useId(),k=useRef(null);useEffect(()=>k.current?.focus(),[e]);let[x]=useState(()=>typeof document>"u"?null:document.activeElement);useEffect(()=>()=>{let f=x?.ownerDocument;if(!x||!f||x===f.body||!x.isConnected)return;let I=f.activeElement;I&&I!==f.body&&!I.contains(x)||x.focus();},[x]);let S={wallet:a,amount:o,merchant:l,network:i},T=e==="sign"||e==="proof"?v.walletPrompt.signIn:e==="switch"?v.walletPrompt.switchIn:e==="submitting"?v.walletPrompt.submitting:e==="permission"?v.autoPay.approveIn:v.walletPrompt.confirmIn;return jsxs("section",{"aria-labelledby":b,style:w?{"--novapay-step-height":`${w}px`}:void 0,className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col novapay:items-center novapay:justify-center-safe novapay:gap-3 novapay:bg-[var(--tuwa-bg-primary)] novapay:px-6 novapay:py-5 novapay:text-center",w&&(C==="page"?"novapay:min-h-[var(--novapay-step-height)]":"novapay:max-sm:min-h-[var(--novapay-step-height)]")),children:[jsx(Ft,{walletId:r,walletIcon:n}),jsx("h2",{id:b,ref:k,tabIndex:-1,className:ga,children:h(T,S)}),(e==="sign"||e==="confirm"||e==="proof")&&jsxs(Fragment,{children:[jsx("p",{className:"novapay:m-0 novapay:max-w-sm novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:y??h(e==="confirm"?v.walletPrompt.confirmText:v.walletPrompt.signText,S)}),g&&jsx("p",{className:"novapay:m-0 novapay:max-w-sm novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:g}),jsxs("div",{className:"novapay:flex novapay:w-full novapay:max-w-xs novapay:flex-col novapay:gap-1.5 novapay:text-left",children:[jsx("span",{className:"novapay:text-[11px] novapay:font-semibold",children:h(v.walletPrompt.check,S)}),jsx(xe,{children:h$1?h$1.map(f=>jsx(z,{name:f.name,children:f.value},f.name)):jsxs(Fragment,{children:[jsx(z,{name:v.walletPrompt.amount,children:o}),jsx(z,{name:v.walletPrompt.to,children:c}),jsx(z,{name:v.walletPrompt.network,children:i}),p&&jsx(z,{name:v.walletPrompt.priceLocked,children:p})]})})]}),u?jsxs("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:[v.walletPrompt.notOpened," ",jsx(wa,{onClick:u,children:v.walletPrompt.tryAgain})]}):jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(v.walletPrompt.stillWaiting,S)})]}),e==="permission"&&jsx("p",{className:"novapay:m-0 novapay:max-w-sm novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:v.autoPay.walletNote}),e!=="submitting"&&jsx(pe,{onClick:N,className:"novapay:max-w-xs",children:v.walletPrompt.cancel})]})}var Vn=class extends Error{};function Wo(){let{checkout:e,state:a,store:r,labels:n,locale:o,wallet:l,adapterFor:i,setAutoPay:c,connectFamily:p}=Y(),[u,y]=useState("idle"),[h$1,g]=useState(null),N=l?.address,[w,v]=useState(N);w!==N&&(v(N),g(null),y("idle"));let C=useRef(0);useEffect(()=>{C.current++;let{error:$,clearError:O}=r.getState();$&&(Ea($)||$.code==="permission_invalid")&&O();},[N]);let b=useRef(null),k=useRef(null),x=useRef(null),S=u!=="idle"&&l!==null,[T,f]=gn(S),I=Et(e?.autoCharge??null),_=I?e?.methods.find($=>$.id===I.methodId):void 0,R=_?We(_):null,P=R?i(R):void 0,E=e?ko(e.autoCharge,e.methods):null,[B,W]=useState(null),ne=fa(E&&l&&P?.smartAccountStatus&&B!==l.address?`${E.chainId}:${l.address}`:null,()=>P.smartAccountStatus({chainId:E.chainId,account:l.address}));if(!e)return null;let L=e.merchant.name,Q=ne==="upgradable"&&!!P?.upgradeToSmartAccount,Z=async()=>{if(!I||!E||!l||!P?.requestPermission)return g("unsupported");let{requestPermission:$}=P,O=++C.current,M=()=>C.current===O,K=l.address;g(null),r.getState().clearError();try{if(l.chainId!==E.chainId&&P.switchChain&&(y("switching"),await P.switchChain(E.chainId),!M()))return;if(Q){y("upgrading");try{if(k.current?.account!==K){let j={account:K,done:P.upgradeToSmartAccount({chainId:E.chainId,account:K}).then(le=>(W(K),le))};k.current=j;let ae=()=>{k.current===j&&(k.current=null);};j.done.then(ae,ae);}await k.current?.done;}catch(j){throw b$1(j)==="failed"?new Vn:j}if(!M())return}y("permission");let G=x.current?.account===K?x.current.granted:null;if(!G){if(b.current?.account!==K){let le=$({request:I.request,account:K}),de={account:K,asked:le};b.current=de;let he=()=>{b.current===de&&(b.current=null);};le.then(he,he);}let j=b.current,ae=null;if(!await Ut(j.asked.then(le=>{ae=le;}),6e5)||!ae){b.current===j&&(b.current=null),M()&&g("alreadyPending");return}G=ae,x.current={account:K,granted:G};}if(await r.getState().grantPermission({payer:`${E.chainId}:${K}`,...G},P.signMessage&&((j,ae)=>(M()&&y("proof"),P.signMessage({message:j,account:K,chainId:ae.chainId}))))){x.current=null,M()&&c(!1);return}r.getState().error?.code==="permission_invalid"&&(x.current=null);}catch(G){if(!M())return;g(G instanceof Vn?"smartAccount":b$1(G));}finally{M()&&y("idle");}},V={wallet:l?.name??"",network:E?ve(E.chainId):"",merchant:L},A=a.error,U=A?A.code==="permission_invalid"?A.reason==="wallet_unknown"?h(n.autoPay.smartAccountNeeded,V):n.autoPay.invalid:Ea(A)?In(A,null,n,V):Sn(A,n,L):null,J=h$1==="declined"?h(n.pay.declined,V):h$1==="unsupported"?h(n.autoPay.unavailable,V):h$1==="smartAccount"?h(n.autoPay.smartAccountNeeded,V):h$1==="wrongNetwork"||h$1==="switchFailed"?h(n.pay.switchFailed,V):h$1==="notAuthorized"?h(n.pay.notAuthorized,V):h$1==="alreadyPending"?h(n.walletPrompt.stillWaiting,V):h$1==="cannotConnect"?n.pay.connectUnavailable:h$1?h(n.autoPay.notGranted,V):U;return jsxs("div",{className:"novapay:relative novapay:flex novapay:flex-1 novapay:flex-col",children:[jsxs("div",{ref:T,inert:S,className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col",S&&"novapay:hidden"),children:[jsxs(me,{title:n.autoPay.title,subtitle:n.autoPay.subtitle,children:[E&&jsxs(Fragment,{children:[jsxs("div",{className:"novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:px-3 novapay:py-2",children:[jsx("span",{className:"novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(n.autoPay.allow,{merchant:L})}),jsxs("p",{className:cn$1(F,"novapay:m-0 novapay:text-lg novapay:font-bold"),children:[h(n.autoPay.limit,{amount:`${ue(E.limit,E.decimals,o)} ${E.symbol}`})," ",jsx("span",{className:"novapay:text-sm novapay:font-normal",children:h(n.autoPay.every,{period:Wt(E.periodSeconds,o)})})]})]}),jsxs(xe,{children:[l&&jsx(z,{name:n.autoPay.from,children:jsxs("span",{className:"novapay:inline-flex novapay:items-center novapay:gap-1",children:[jsx(Pe,{hash:l.address,chainId:E.chainId})," \xB7 ",ve(E.chainId)]})}),jsxs(z,{name:n.autoPay.to,children:[jsx(Pe,{hash:E.to,chainId:E.chainId}),jsx("span",{className:"novapay:font-sans novapay:text-[var(--tuwa-text-secondary)]",children:L})]}),E.expiresAt&&jsx(z,{name:n.autoPay.validUntil,children:h(n.autoPay.validUntilValue,{date:new Intl.DateTimeFormat(o,{dateStyle:"medium"}).format(E.expiresAt)})})]}),jsxs("ul",{className:"novapay:m-0 novapay:flex novapay:list-disc novapay:flex-col novapay:gap-1 novapay:pl-4 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:[jsx("li",{children:h(n.autoPay.collector,{merchant:L})}),jsx("li",{children:n.autoPay.invoices}),jsx("li",{children:h(n.autoPay.cap,{merchant:L})}),jsx("li",{children:h(n.autoPay.turnOff,{merchant:L})})]})]}),Q&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-primary)]",children:h(n.autoPay.smartAccountNote,V)}),J&&jsx(te,{children:J})]}),jsxs(ce,{children:[l?jsx(oe,{busy:S,disabled:!E,onClick:()=>{Z();},children:n.autoPay.confirm}):jsx(oe,{disabled:!R,onClick:()=>{R&&!p(R)&&g("cannotConnect");},children:n.pay.connect}),jsx(pe,{onClick:()=>c(false),children:n.autoPay.skip}),jsx(ge,{children:n.autoPay.walletNote})]})]}),S&&l&&jsx(Wa,{kind:u==="switching"?"switch":u==="upgrading"?"confirm":u==="proof"?"proof":"permission",walletName:l.name,walletId:l.walletId,walletIcon:l.icon,amount:"",merchant:L,network:V.network,to:"",priceTime:null,text:u==="upgrading"?h(n.autoPay.smartAccountPrompt,V):u==="proof"?h(n.payerProof.promptText,{...V,invoice:e.invoice.number??e.invoice.id}):void 0,details:u==="upgrading"?[{name:n.autoPay.from,value:shortAddress(l.address)},{name:n.walletPrompt.network,value:V.network}]:u==="proof"?[{name:n.payerProof.invoice,value:e.invoice.number??e.invoice.id},{name:n.payerProof.merchant,value:L}]:void 0,onCancel:()=>{C.current++,y("idle");},stepHeight:f})]})}var Oo=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Bt="AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "),Uo=new Set(Bt);function Lt(e,a){let r=e==="full"||a,n=[{name:"email",required:true,autoComplete:"email",type:"email"}];return r?[...n,{name:"name",required:true,autoComplete:a?"organization":"name",type:"text"},{name:"country",required:true,autoComplete:"country",type:"country"},{name:"addressLine1",required:true,autoComplete:"address-line1",type:"text"},{name:"addressLine2",required:false,autoComplete:"address-line2",type:"text"},{name:"postalCode",required:false,autoComplete:"postal-code",type:"text"},{name:"city",required:false,autoComplete:"address-level2",type:"text"},...a?Do():[]]:n}var Do=()=>[{name:"taxId",required:true,autoComplete:"off",type:"text"},{name:"registrationNumber",required:false,autoComplete:"off",type:"text"}];function Fo(e,a,r){let n={};for(let o of Lt(a,r)){let l=e[o.name]?.trim()??"";l?o.type==="email"&&!Oo.test(l)?n[o.name]="email":o.type==="country"&&!Uo.has(l.toUpperCase())&&(n[o.name]="country"):o.required&&(n[o.name]="required");}return n}function Bo(e){let a={};for(let[r,n]of Object.entries(e)){let o=n?.trim();o&&(a[r]=r==="country"?o.toUpperCase():o);}return a}function Lo(e){let a=new Intl.DisplayNames([e],{type:"region"});return Bt.map(r=>({code:r,name:a.of(r)??r})).sort((r,n)=>r.name.localeCompare(n.name,e))}var Ho=(e,a,r)=>a==="name"&&r?e.buyer.companyName:e.buyer[a]??a,Ko=(e,a)=>a==="email"?e.buyer.invalidEmail:a==="country"?e.buyer.invalidCountry:e.buyer.required,zo=new Set(["postalCode","city","taxId","registrationNumber"]),Go=new Set(["name","country","addressLine1","addressLine2"]),Yn=e=>cn$1("novapay:h-10 novapay:w-full novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:bg-[var(--tuwa-bg-primary)] novapay:px-3 novapay:text-[13px] novapay:text-[var(--tuwa-text-primary)] novapay:transition-colors novapay:focus:border-[var(--tuwa-text-accent)]",e?"novapay:border-[var(--tuwa-error-icon)]":"novapay:border-[var(--tuwa-text-secondary)] novapay:hover:border-[var(--tuwa-text-primary)]",ie);function jo(){let{checkout:e,state:a,store:r,labels:n,locale:o,display:l}=Y(),[i,c]=useState({}),[p,u]=useState(false),[y,h]=useState(false),[g,N]=useState(false),w=useId(),v=useMemo(()=>Lo(o),[o]);if(!e||e.buyer.collect==="off")return null;let C=e.buyer.collect,b=Lt(C,p),k=Fo(i,C,p),x=(T,f)=>c(I=>({...I,[T]:f})),S=async T=>{if(T.preventDefault(),h(true),Object.keys(k).length>0){document.getElementById(`${w}-${Object.keys(k)[0]}`)?.focus();return}N(true),await r.getState().setBuyer(Bo(i),{company:p}),N(false);};return jsxs("form",{noValidate:true,onSubmit:T=>{S(T);},className:"novapay:flex novapay:flex-1 novapay:flex-col",children:[jsxs(me,{title:n.buyer.title,subtitle:n.buyer.subtitle,children:[jsx("div",{className:"novapay:grid novapay:grid-cols-1 novapay:gap-x-3 novapay:gap-y-3.5 novapay:pt-1 novapay:sm:grid-cols-2",children:b.map((T,f)=>{let I=`${w}-${T.name}`,_=y?k[T.name]:void 0,R=T.type==="country"?jsxs("div",{className:"novapay:relative",children:[jsxs("select",{id:I,autoComplete:T.autoComplete,required:T.required,"aria-invalid":!!_,"aria-describedby":_?`${I}-error`:void 0,value:i.country??"",onChange:P=>x("country",P.target.value),className:cn$1(Yn(!!_),"novapay:cursor-pointer novapay:appearance-none novapay:pr-9",!i.country&&"novapay:text-[var(--tuwa-text-secondary)]"),children:[jsx("option",{value:"",children:n.buyer.chooseCountry}),v.map(P=>jsx("option",{value:P.code,children:P.name},P.code))]}),jsx(ChevronDownIcon,{"aria-hidden":true,className:"novapay:pointer-events-none novapay:absolute novapay:top-1/2 novapay:right-3 novapay:h-4 novapay:w-4 novapay:-translate-y-1/2 novapay:text-[var(--tuwa-text-secondary)]"})]}):jsx("input",{id:I,type:T.type,autoComplete:T.autoComplete,required:T.required,"aria-invalid":!!_,"aria-describedby":_?`${I}-error`:void 0,value:i[T.name]??"",onChange:P=>x(T.name,P.target.value),className:Yn(!!_)});return jsxs(Fragment$1,{children:[jsxs("div",{className:cn$1("novapay:flex novapay:flex-col novapay:gap-1.5",!zo.has(T.name)&&(l==="page"&&Go.has(T.name)?"novapay:sm:@max-[519px]:col-span-2":"novapay:sm:col-span-2")),children:[jsxs("label",{htmlFor:I,className:"novapay:text-xs novapay:font-medium novapay:text-[var(--tuwa-text-primary)]",children:[Ho(n,T.name,p),T.required&&jsxs("span",{"aria-hidden":"true",className:"novapay:text-[var(--tuwa-error-text)]",children:[" ","*"]}),!T.required&&jsxs("span",{className:"novapay:font-normal novapay:text-[var(--tuwa-text-secondary)]",children:[" ","(",n.buyer.optional,")"]})]}),R,_&&jsx("span",{id:`${I}-error`,className:"novapay:text-[11px] novapay:text-[var(--tuwa-error-text)]",children:Ko(n,_)})]}),f===0&&e.buyer.companyInvoice&&jsxs("label",{className:cn$1("novapay:flex novapay:cursor-pointer novapay:items-center novapay:gap-2.5 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:px-3 novapay:py-2.5 novapay:text-[13px] novapay:transition-colors novapay:sm:col-span-2",p?"novapay:border-[var(--tuwa-text-accent)] novapay:bg-[var(--tuwa-bg-primary)] novapay:ring-1 novapay:ring-[var(--tuwa-text-accent)]":"novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-secondary)] novapay:hover:border-[var(--tuwa-text-secondary)]"),children:[jsx("input",{type:"checkbox",checked:p,onChange:P=>u(P.target.checked),className:cn$1("novapay:h-4 novapay:w-4 novapay:shrink-0 novapay:accent-[var(--tuwa-text-accent)]",ie)}),jsx("span",{className:"novapay:font-semibold",children:n.buyer.companyInvoice})]})]},T.name)})}),a.error&&a.phase==="buyer"&&jsx(te,{children:n.buyer.refused})]}),jsx(ce,{children:jsx(oe,{type:"submit",busy:g,children:n.buyer.continue})})]})}function Qo({steps:e,labels:a,className:r,stepClassName:n}){let o=e.findIndex(y=>y.state==="current"),l=e.map(y=>a.steps[y.key]).join(""),i=useRef(null),c=useRef(null),[p,u]=useState(false);return useEffect(()=>{let y=i.current,h=c.current;if(!y||!h||typeof ResizeObserver>"u")return;let g=()=>u(h.offsetWidth+e.length*32+(e.length-1)*24>y.clientWidth);g();let N=new ResizeObserver(g);return N.observe(y),()=>N.disconnect()},[l,e.length]),jsxs("nav",{ref:i,"aria-label":a.steps.label,className:cn$1("novapay:relative novapay:min-w-0 novapay:flex-1",r),children:[jsx("span",{"aria-hidden":true,className:"novapay:invisible novapay:absolute novapay:h-0 novapay:w-0 novapay:overflow-hidden",children:jsx("span",{ref:c,className:cn$1(F,"novapay:whitespace-nowrap novapay:text-[11px] novapay:font-bold"),children:l})}),jsx("ol",{className:"novapay:m-0 novapay:flex novapay:list-none novapay:items-center novapay:gap-1.5 novapay:p-0",children:e.map((y,h$1)=>{let g=a.steps[y.key];return jsxs("li",{"aria-current":y.state==="current"?"step":void 0,className:cn$1("novapay:flex novapay:min-w-0 novapay:items-center novapay:gap-1.5",h$1>0&&"novapay:flex-auto",n?.(y,h$1)),children:[h$1>0&&jsx("span",{"aria-hidden":true,className:cn$1("novapay:h-0.5 novapay:min-w-2 novapay:flex-1 novapay:rounded-full novapay:transition-colors novapay:duration-300 novapay:motion-reduce:transition-none",y.state==="upcoming"?"novapay:bg-[var(--tuwa-border-primary)]":"novapay:bg-[var(--tuwa-success-icon)]")}),jsx("span",{"aria-hidden":true,className:cn$1(F,"novapay:flex novapay:h-5 novapay:w-5 novapay:shrink-0 novapay:items-center novapay:justify-center novapay:rounded-full novapay:text-[10px] novapay:font-bold",y.state==="done"&&"novapay:bg-[var(--tuwa-success-icon)] novapay:text-white",y.state==="current"&&"novapay:border-2 novapay:border-[var(--tuwa-text-accent)] novapay:text-[var(--tuwa-text-accent)]",y.state==="upcoming"&&"novapay:border-2 novapay:border-[var(--tuwa-border-primary)] novapay:text-[var(--tuwa-text-secondary)]"),children:y.state==="done"?jsx(DrawnCheck,{className:"novapay:h-3 novapay:w-3"}):h$1+1}),jsx("span",{className:cn$1(F,"novapay:truncate novapay:text-[11px]",y.state==="current"?"novapay:font-bold novapay:text-[var(--tuwa-text-primary)]":"novapay:text-[var(--tuwa-text-secondary)]",p&&y.state!=="current"&&"novapay:sr-only"),children:y.state==="current"?jsxs(Fragment,{children:[jsx("span",{className:"novapay:sr-only",children:h(a.steps.progress,{current:o+1,total:e.length,name:g})}),jsx("span",{"aria-hidden":true,children:g})]}):g})]},y.key)})})]})}function Na(e){let a=e.lineItems.reduce((l,i)=>l+BigInt(i.netMinor),0n),r=BigInt(e.totalMinor??a.toString()),n=r-a,o=[...new Set(e.lineItems.filter(l=>Number(l.taxRate)>0).map(l=>l.taxRate))];return {subtotal:Ie(a.toString()),tax:n>0n?Ie(n.toString()):null,rate:o.length===1?String(Number(o[0])):null,total:Ie(r.toString())}}var Vo=e=>{try{return new URL(e).host}catch{return e}};function $n({compact:e=false}){let{checkout:a,state:r,labels:n,display:o}=Y(),[l,i]=useState(false);if(!a)return null;let{merchant:c,invoice:p}=a,u=e?"novapay:h-8 novapay:w-8":"novapay:h-9 novapay:w-9";return jsxs("div",{className:"novapay:flex novapay:min-w-0 novapay:items-center novapay:gap-2.5",children:[r.logoUrl&&!l?jsx("img",{src:r.logoUrl,alt:"",onError:()=>i(true),className:cn$1(u,"novapay:shrink-0 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:object-contain")}):jsx("span",{"aria-hidden":true,className:cn$1(u,F,"novapay:flex novapay:shrink-0 novapay:items-center novapay:justify-center novapay:rounded-[var(--tuwa-rounded-corners)] novapay:bg-[var(--tuwa-text-primary)] novapay:text-[15px] novapay:font-bold novapay:text-[var(--tuwa-bg-primary)]"),children:c.name.trim().charAt(0).toUpperCase()}),jsxs("div",{className:"novapay:flex novapay:min-w-0 novapay:flex-col",children:[jsx("span",{className:cn$1("novapay:text-sm novapay:font-semibold",o==="page"&&!e?"novapay:line-clamp-2 novapay:break-words":"novapay:truncate"),children:c.name}),e?p.number&&jsx("span",{className:cn$1(F,"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:p.number}):c.website&&jsx("a",{href:c.website,target:"_blank",rel:"noopener noreferrer",className:cn$1("novapay:truncate novapay:text-xs novapay:text-[var(--tuwa-text-secondary)] novapay:hover:underline",ie),children:Vo(c.website)})]}),p.environment==="test"&&jsxs("span",{title:n.summary.testHint,className:cn$1(F,"novapay:ml-auto novapay:shrink-0 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:bg-[var(--tuwa-pending-bg)] novapay:px-1.5 novapay:py-0.5 novapay:text-[10px] novapay:font-bold novapay:uppercase novapay:tracking-wider novapay:text-[var(--tuwa-pending-text)]"),children:[n.summary.test,jsxs("span",{className:"novapay:sr-only",children:[": ",n.summary.testHint]})]})]})}function Rn({checkout:e,labels:a}){let{merchant:r}=e,n=r.seller,o=[[a.summary.terms,r.links.terms],[a.summary.refundPolicy,r.links.refundPolicy],[a.summary.privacy,r.links.privacy]].filter(l=>!!l[1]);return jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-1 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-3 novapay:py-2.5 novapay:text-[11px] novapay:leading-snug novapay:text-[var(--tuwa-text-secondary)]",children:[n?.legalName&&jsx("span",{className:"novapay:text-xs novapay:font-semibold novapay:text-[var(--tuwa-text-primary)]",children:n.legalName}),(n?.address||n?.country)&&jsx("span",{children:[n.address,n.country].filter(Boolean).join(", ")}),n?.registrationNumber&&jsxs("span",{children:[a.summary.registration," ",n.registrationNumber]}),n?.taxId&&jsxs("span",{children:[a.summary.taxId," ",n.taxId]}),r.supportEmail&&jsx("a",{href:`mailto:${r.supportEmail}`,className:cn$1("novapay:text-[var(--tuwa-text-accent)] novapay:underline",ie),children:r.supportEmail}),o.length>0&&jsx("span",{className:"novapay:flex novapay:flex-wrap novapay:gap-x-3",children:o.map(([l,i])=>jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:cn$1("novapay:text-[var(--tuwa-text-accent)] novapay:underline",ie),children:l},l))}),jsx("span",{children:h(a.summary.sellerRole,{seller:n?.legalName||r.name})})]})}function Ht(){let{checkout:e,labels:a,locale:r,now:n,screen:o,display:l}=Y(),i=e?.invoice.dueAt,c=e&&kn(e.invoice.status,o,e.invoice.restPayable);if(!e||!i||!c)return null;let p=new Intl.DateTimeFormat(r,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i));return jsxs("div",{className:cn$1("novapay:flex novapay:items-center novapay:justify-between novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-3 novapay:py-2.5",l==="page"&&"novapay-page-deadline"),children:[jsxs("div",{className:"novapay:flex novapay:min-w-0 novapay:flex-col novapay:gap-0.5",children:[jsx("span",{className:cn$1(F,"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:c==="closed"?a.summary.refundAfter:a.summary.payWithin}),jsx("span",{className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:c==="closed"?p:h(a.summary.until,{date:p})})]}),jsx("span",{role:"timer",className:cn$1(F,"novapay:shrink-0 novapay:whitespace-nowrap novapay:text-lg novapay:font-bold"),children:Qe(Date.parse(i)-n)})]})}function Kt(){let{checkout:e,labels:a,locale:r}=Y();if(!e)return null;let{invoice:n}=e,o=Na(n);return jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-3.5",children:[jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-2.5",children:[n.number&&jsxs("div",{className:cn$1(F,"novapay:flex novapay:justify-between novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:[jsx("span",{children:a.summary.invoice}),jsx("span",{children:n.number})]}),jsx("ul",{className:"novapay:m-0 novapay:flex novapay:list-none novapay:flex-col novapay:gap-2.5 novapay:p-0",children:n.lineItems.map((l,i)=>jsxs("li",{className:"novapay:flex novapay:justify-between novapay:gap-2 novapay:text-[13px]",children:[jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-col",children:[jsx("span",{className:"novapay:break-words",children:l.name}),l.description&&jsx("span",{className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:l.description}),jsx("span",{className:cn$1(F,"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:h(a.summary.quantity,{quantity:l.quantity,price:ye(l.unitPrice,r)})})]}),jsx("span",{className:F,children:ye(Ie(l.netMinor),r)})]},i))})]}),o.tax&&jsxs("dl",{className:"novapay:m-0 novapay:flex novapay:flex-col novapay:gap-1.5 novapay:border-t novapay:border-dashed novapay:border-[var(--tuwa-border-primary)] novapay:pt-2.5 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:[jsxs("div",{className:"novapay:flex novapay:justify-between",children:[jsx("dt",{children:a.summary.subtotal}),jsx("dd",{className:cn$1(F,"novapay:m-0"),children:ye(o.subtotal,r)})]}),jsxs("div",{className:"novapay:flex novapay:justify-between",children:[jsx("dt",{children:o.rate?h(a.summary.taxRate,{rate:o.rate}):a.summary.tax}),jsx("dd",{className:cn$1(F,"novapay:m-0"),children:ye(o.tax,r)})]})]})]})}function Yo(){let e=Y(),{checkout:a,labels:r,locale:n}=e;return a?jsxs("div",{className:cn$1("novapay:flex novapay:items-baseline novapay:justify-between",se(e,"total")),children:[jsx("span",{className:cn$1(F,"novapay:text-xs novapay:font-bold"),children:r.summary.total}),jsxs("span",{className:cn$1(F,"novapay:text-[22px] novapay:font-bold"),children:[ye(Na(a.invoice).total,n)," ",jsx("span",{className:"novapay:text-[13px] novapay:font-normal novapay:text-[var(--tuwa-text-secondary)]",children:a.invoice.currency})]})]}):null}function zt(){let{checkout:e,labels:a}=Y();return jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-1 novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:[jsxs("span",{className:"novapay:flex novapay:items-center novapay:gap-1.5",children:[jsx(LockClosedIcon,{"aria-hidden":true,className:"novapay:h-3 novapay:w-3"}),a.summary.secured]}),e?.merchant.supportEmail&&jsxs("span",{children:[a.summary.help,":"," ",jsx("a",{href:`mailto:${e.merchant.supportEmail}`,className:cn$1("novapay:text-[var(--tuwa-text-accent)] novapay:underline",ie),children:e.merchant.supportEmail})]})]})}function Ka({label:e,children:a,className:r,buttonClassName:n,growsUp:o=false}){let[l,i]=useState(false),c=useId();return jsxs("div",{className:cn$1("novapay:flex novapay:flex-col novapay:gap-2",r),children:[jsxs("button",{type:"button","aria-expanded":l,"aria-controls":c,onClick:()=>i(p=>!p),className:cn$1("novapay:inline-flex novapay:cursor-pointer novapay:items-center novapay:gap-1 novapay:self-start novapay:border-0 novapay:bg-transparent novapay:p-0 novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)] novapay:hover:text-[var(--tuwa-text-primary)]",ie,n),children:[e,jsx(ChevronDownIcon,{"aria-hidden":true,className:cn$1("novapay:h-3 novapay:w-3 novapay:transition-transform novapay:motion-reduce:transition-none",l!==o&&"novapay:rotate-180")})]}),jsx("div",{id:c,hidden:!l,children:a})]})}var Zn=5;function Zo(){let e=Y(),{checkout:a,labels:r,locale:n}=e;if(!a)return null;let o=ye(Na(a.invoice).total,n);return jsxs("div",{className:cn$1("novapay:flex novapay:flex-col novapay:gap-1.5",se(e,"total")),children:[jsx("span",{className:cn$1(F,"novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]"),children:r.summary.total}),jsxs("span",{className:cn$1(F,"novapay:flex novapay:flex-wrap novapay:items-baseline novapay:gap-x-2 novapay:gap-y-1 novapay:font-bold",Eo(o)),children:[jsx("span",{children:o}),jsx("span",{className:"novapay:text-[15px] novapay:font-normal novapay:text-[var(--tuwa-text-secondary)]",children:a.invoice.currency})]})]})}var Gt="novapay:flex novapay:justify-between novapay:gap-3 novapay:px-3 novapay:py-2";function Jn({line:e}){let{labels:a,locale:r}=Y(),n=ye(Ie(e.netMinor),r),o=ye(e.unitPrice,r);return jsxs("li",{className:cn$1(Gt,"novapay:text-[13px]"),children:[jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-col",children:[jsx("span",{className:"novapay:break-words",children:e.name}),e.description&&jsx("span",{className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:e.description}),(Number(e.quantity)!==1||o!==n)&&jsx("span",{className:cn$1(F,"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:h(a.summary.quantity,{quantity:e.quantity,price:o})})]}),jsx("span",{className:cn$1(F,"novapay:shrink-0"),children:n})]})}function Jo(){let{checkout:e,labels:a,locale:r}=Y();if(!e)return null;let{invoice:n}=e,o=Na(n),l=o.tax?Zn-1:Zn,i=n.lineItems,c=i.length>l?i.slice(0,l-1):i,p=i.slice(c.length);return !n.number&&i.length===0?null:jsxs("div",{className:"novapay:flex novapay:flex-col novapay:divide-y novapay:divide-[var(--tuwa-border-primary)] novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)]",children:[n.number&&jsxs("div",{className:cn$1(F,Gt,"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:[jsx("span",{children:a.summary.invoice}),jsx("span",{className:"novapay:min-w-0 novapay:break-all novapay:text-right",children:n.number})]}),c.length>0&&jsx("ul",{className:"novapay:m-0 novapay:flex novapay:list-none novapay:flex-col novapay:divide-y novapay:divide-[var(--tuwa-border-primary)] novapay:p-0",children:c.map((u,y)=>jsx(Jn,{line:u},y))}),p.length>0&&jsx(Ka,{label:`+${p.length} \xB7 ${a.summary.showOrder}`,className:"novapay:px-3 novapay:py-2",buttonClassName:"novapay:min-h-6",children:jsx("ul",{className:"novapay:-mx-3 novapay:m-0 novapay:flex novapay:list-none novapay:flex-col novapay:divide-y novapay:divide-[var(--tuwa-border-primary)] novapay:p-0",children:p.map((u,y)=>jsx(Jn,{line:u},y))})}),o.tax&&jsxs("dl",{className:"novapay:m-0 novapay:flex novapay:flex-col novapay:gap-1.5 novapay:px-3 novapay:py-2 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:[jsxs("div",{className:"novapay:flex novapay:justify-between",children:[jsx("dt",{children:a.summary.subtotal}),jsx("dd",{className:cn$1(F,"novapay:m-0"),children:ye(o.subtotal,r)})]}),jsxs("div",{className:"novapay:flex novapay:justify-between",children:[jsx("dt",{children:o.rate?h(a.summary.taxRate,{rate:o.rate}):a.summary.tax}),jsx("dd",{className:cn$1(F,"novapay:m-0"),children:ye(o.tax,r)})]})]})]})}function Xo(){let{checkout:e,labels:a}=Y();return e?jsxs("div",{className:"novapay:flex novapay:min-w-0 novapay:flex-1 novapay:flex-col",children:[jsx($n,{}),jsx("div",{className:"novapay:mt-6",children:jsx(Zo,{})}),jsx("div",{className:"novapay:mt-5",children:jsx(Jo,{})}),jsxs("div",{className:"novapay:mt-auto novapay:flex novapay:flex-col novapay:gap-3 novapay:pt-5",children:[jsx(Ht,{}),jsx(Ka,{label:a.summary.sellerDetails,buttonClassName:"novapay:min-h-6",growsUp:true,children:jsx(Rn,{checkout:e,labels:a})}),jsx(zt,{})]})]}):null}function el(){let{checkout:e,labels:a,display:r}=Y();return e?r==="page"?jsx(Xo,{}):jsxs("div",{className:"novapay:flex novapay:h-full novapay:flex-col novapay:gap-3.5",children:[jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-1.5",children:[jsx($n,{}),jsx(Ka,{label:a.summary.sellerDetails,children:jsx(Rn,{checkout:e,labels:a})})]}),jsx(Ht,{}),jsx("div",{className:"novapay:-mr-2.5 novapay:min-h-0 novapay:flex-1 novapay:overflow-y-auto novapay:pr-2.5",children:jsx(Kt,{})}),jsx(Yo,{}),jsx(zt,{})]}):null}function al({className:e}={}){let{checkout:a,labels:r,locale:n,now:o,screen:l}=Y();if(!a)return null;let{invoice:i}=a,c=Na(i),p=i.dueAt&&kn(i.status,l)?Date.parse(i.dueAt):null;return jsxs("div",{className:cn$1("novapay:mx-4 novapay:flex novapay:flex-col novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-secondary)] novapay:p-3",e),children:[jsxs("div",{className:"novapay:flex novapay:items-baseline novapay:justify-between",children:[jsxs("span",{className:cn$1(F,"novapay:text-[22px] novapay:font-bold"),children:[ye(c.total,n)," ",jsx("span",{className:"novapay:text-xs novapay:font-normal novapay:text-[var(--tuwa-text-secondary)]",children:i.currency})]}),p&&jsxs("span",{role:"timer",className:cn$1(F,"novapay:flex novapay:items-center novapay:gap-1 novapay:whitespace-nowrap novapay:text-xs novapay:font-bold"),children:[jsx(ClockIcon,{"aria-hidden":true,className:"novapay:h-3.5 novapay:w-3.5 novapay:text-[var(--tuwa-text-secondary)]"}),Qe(p-o)]})]}),jsx(Ka,{label:`${g(c.tax?{one:r.summary.compactOne,other:r.summary.compact}:{one:r.summary.compactNoTaxOne,other:r.summary.compactNoTax},i.lineItems.length,n,c.tax?{tax:ye(c.tax,n)}:{})} \xB7 ${r.summary.showOrder}`,children:jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-3 novapay:pt-1",children:[jsx(Kt,{}),jsx(Rn,{checkout:a,labels:r})]})})]})}function nl({locale:e,labels:a,receiptIssued:r,onSelect:n,className:o}){let[l,i]=useState(false),c=b.find(k=>k.code===e)??b[0],[p,u]=useState(0),y=useId(),h$1=useRef(null),g=useRef(null),N=useRef(null);useEffect(()=>{if(!l)return;N.current?.focus();let k=x=>{h$1.current?.contains(x.target)||i(false);};return document.addEventListener("pointerdown",k),()=>document.removeEventListener("pointerdown",k)},[l]);let w=()=>{u(Math.max(0,b.indexOf(c))),i(true);},v=()=>{i(false),g.current?.focus();},C=k=>{v(),k!==c.code&&n(k);},b$1=k=>{let x=b.length-1,S={ArrowDown:()=>Math.min(x,p+1),ArrowUp:()=>Math.max(0,p-1),Home:()=>0,End:()=>x};S[k.key]?(k.preventDefault(),u(S[k.key]())):k.key==="Enter"||k.key===" "?(k.preventDefault(),C(b[p].code)):(k.key==="Escape"||k.key==="Tab")&&(k.preventDefault(),k.stopPropagation(),v());};return jsxs("div",{ref:h$1,className:cn$1("novapay:relative",o),children:[jsxs("button",{ref:g,type:"button","aria-haspopup":"listbox","aria-expanded":l,"aria-controls":l?`${y}-list`:void 0,className:cn$1(Fa,F,"novapay:text-[11px] novapay:font-semibold"),onClick:()=>l?v():w(),onKeyDown:k=>{k.key==="ArrowDown"&&!l&&(k.preventDefault(),w());},children:[jsx(GlobeAltIcon,{"aria-hidden":true,className:"novapay:h-3.5 novapay:w-3.5"}),jsx("span",{children:c.short}),jsxs("span",{className:"novapay:sr-only",children:[", ",h(a.language.button,{language:c.name})]}),jsx(ChevronDownIcon,{"aria-hidden":true,className:"novapay:h-3 novapay:w-3"})]}),l&&jsxs("div",{className:"novapay:absolute novapay:right-0 novapay:top-full novapay:z-20 novapay:mt-1.5 novapay:w-60 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:p-1.5 novapay:shadow-xl",children:[jsx("span",{id:`${y}-title`,className:cn$1(F,"novapay:block novapay:px-2.5 novapay:py-1 novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:a.language.title}),jsx("ul",{ref:N,id:`${y}-list`,role:"listbox",tabIndex:-1,"aria-labelledby":`${y}-title`,"aria-activedescendant":`${y}-${b[p].code}`,onKeyDown:b$1,className:cn$1("novapay:m-0 novapay:flex novapay:list-none novapay:flex-col novapay:gap-0.5 novapay:p-0",ie),children:b.map((k,x)=>{let S=k.code===c.code;return jsxs("li",{id:`${y}-${k.code}`,role:"option","aria-selected":S,lang:k.code,onClick:()=>C(k.code),onPointerMove:()=>u(x),className:cn$1("novapay:flex novapay:h-8 novapay:cursor-pointer novapay:items-center novapay:gap-2.5 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:px-2.5 novapay:text-[13px]",x===p&&"novapay:bg-[var(--tuwa-bg-muted)]","novapay:text-[var(--tuwa-text-primary)]",S&&"novapay:font-semibold"),children:[jsx("span",{"aria-hidden":true,className:cn$1(F,"novapay:w-5 novapay:text-[11px]"),children:k.short}),jsx("span",{children:k.name}),S&&jsx(DrawnCheck,{className:"novapay:ml-auto novapay:h-3.5 novapay:w-3.5 novapay:text-[var(--tuwa-text-accent)]"})]},k.code)})}),jsx("p",{className:"novapay:m-0 novapay:mt-1 novapay:border-t novapay:border-[var(--tuwa-border-primary)] novapay:px-2.5 novapay:pb-1 novapay:pt-2 novapay:text-[11px] novapay:leading-snug novapay:text-[var(--tuwa-text-secondary)]",children:r?a.language.noteAfterPaid:a.language.note})]})]})}var jt=(e,a)=>to(e.screen,{withDetails:a})??(e.display==="page"&&e.screen==="paid"?ro({withDetails:a}):null);function Qt(e,a,r){let n=e.customization.components?.Stepper??Qo;return jsx(n,{steps:a,labels:e.labels,className:cn$1(r,se(e,"stepper")),stepClassName:(o,l)=>se(e,"step",{step:o,index:l})})}function tl({title:e,withDetails:a}){let r=Y(),{labels:n,locale:o,store:l,close:i,state:c}=r,p=r.display==="page",u=r.customization.config?.showSteps===false?null:jt(r,a),y=se(r,"header"),h=r.customization.handlers?.onLocaleChange,g=async w=>{await l.getState().setLocale(w);},N=jsxs("div",{className:"novapay:ml-auto novapay:flex novapay:shrink-0 novapay:items-center novapay:gap-2",children:[jsx(nl,{locale:o,labels:n,receiptIssued:!!c.receiptUrl,onSelect:w=>{h?h({locale:w,proceed:()=>g(w)}):g(w);}}),i&&jsx("button",{type:"button","aria-label":n.common.close,onClick:i,className:Fa,children:jsx(XMarkIcon,{"aria-hidden":true,className:"novapay:h-3.5 novapay:w-3.5"})})]});return jsxs(Fragment,{children:[jsxs("header",{className:cn$1("novapay:hidden novapay:items-center novapay:gap-3 novapay:border-b novapay:border-[var(--tuwa-border-primary)] novapay:py-3.5 novapay:pl-5 novapay:pr-4 novapay:sm:flex",p&&"novapay-page-header",y),children:[u?Qt(r,u):e&&jsx("h2",{className:cn$1(F,"novapay:m-0 novapay:flex-1 novapay:text-[15px] novapay:font-bold"),children:e}),N]}),jsxs("header",{className:cn$1("novapay:flex novapay:items-center novapay:gap-2.5 novapay:px-4 novapay:pb-3 novapay:pt-1.5 novapay:sm:hidden",p&&"novapay-page-header-phone",y),children:[jsx($n,{compact:true}),N]})]})}function rl({withDetails:e}){let a=Y();if(a.customization.config?.showSteps===false)return null;let r=jt(a,e);return r?Qt(a,r,"novapay:px-4 novapay:pt-3.5"):null}function ol(e,a){return a.withGas||!e.gasless?"transfer":e.gasless.paymaster&&a.canSponsorCalls?"paymaster":e.gasless.relay?"relay":"transfer"}function ll(e){let a=BigInt(e.amountToSend),r=BigInt(e.amountDue);return !e.transferFee||a<=r?{send:e.amountToSend,receives:e.amountDue,fee:null}:{send:e.amountToSend,receives:e.amountDue,fee:{amount:String(a-r),percent:String(e.transferFee.bps/100)}}}var Ta=10000n,Xn=8n;function il(e,a){let r=BigInt(e.cryptoAmountExpected);if(!a||r<=0n)return null;let n=BigInt(a)*(Ta+BigInt(e.markupBps))*(Ta-BigInt(e.discountBps))*10n**BigInt(e.decimals)*10n**Xn/(100n*Ta*Ta*r);return Number(n)/10**Number(Xn)}function sl(e,a,r=0n){let n=BigInt(a.amountToSend)+r;return e>=n?null:{have:String(e),need:String(n),short:String(n-e)}}function Te(e){return e.family==="eip155"?`eip155:${e.chainId}`:e.chainId}var cl=new Set(["paid","held","refunded","partially_refunded"]);function Vt(){let{state:e,locale:a,adapterFor:r}=Y(),n=(e.invoiceStatus&&cl.has(e.invoiceStatus)?e.checkout?.quote:null)??e.quote,o=n?Te(n.instructions):null,l=e.txHash??e.txKey,i=n?.payer?parseCaip10AccountId(n.payer)?.address:void 0;return {network:o?ve(o):null,amount:n?`${ue(n.amountToSend,n.decimals,a)} ${n.instructions.symbol}`:null,paidAmount:n?`${ue(n.amountDue===n.cryptoAmountExpected?n.amountToSend:n.cryptoAmountExpected,n.decimals,a)} ${n.instructions.symbol}`:null,txKey:l,lastOfParts:n?n.amountDue!==n.cryptoAmountExpected:false,explorerUrl:n&&o&&l?r(n.instructions.family)?.explorerUrl?.({chainId:o,txKey:l}):void 0,from:i?shortAddress(i):null,fromAddress:i??null,fromUrl:n&&o&&i?r(n.instructions.family)?.explorerAddressUrl?.({chainId:o,address:i}):void 0}}var et=new WeakMap,pl=500;function Mn({children:e,className:a}){let{store:r}=Y(),[n,o]=useState(()=>{let l=et.get(r);return l&&Date.now()-l.leftAt<pl?l.title:e});return useEffect(()=>(o(e),()=>{et.set(r,{title:e,leftAt:Date.now()});}),[r,e]),jsx("h2",{...Ba,"aria-label":e,className:cn$1(ga,a),children:jsx(MorphText,{wrap:true,children:n})})}var dl=new Set(["open","underpaid"]);function ul(){let{checkout:e,state:a,labels:r,close:n,customization:o,now:l,handedOverAt:i,display:c}=Y(),p=c==="page",u=o.childCustomizations,y=Vt(),h$1=e?.invoice.dueAt?Date.parse(e.invoice.dueAt):null,g=a.invoiceStatus??e?.invoice.status,N=ea(a),w=!N&&xa(a,e),v=e!==null&&(N||w)&&dl.has(g??"")&&h$1!==null&&l>=h$1,C=v&&mo({state:a,checkout:e,handedOverAt:i,dueAt:h$1}),b=ba(a.error)==="retrying";return jsxs(Ha,{children:[jsxs("section",{className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col novapay:items-center novapay:gap-3 novapay:px-5 novapay:py-5 novapay:text-center",p&&"novapay-page-status"),children:[jsx(TxStatusVisual,{isProcessing:true,...u?.statusVisual,className:p?cn$1("novapay-page-visual",u?.statusVisual?.className):u?.statusVisual?.className}),jsxs("div",{children:[jsx(Mn,{children:r.confirm.title}),p&&y.amount&&jsx("p",{className:cn$1(F,"novapay-page-amount novapay:m-0 novapay:mt-2 novapay:text-2xl novapay:font-bold"),children:y.amount}),y.network&&jsx("p",{className:"novapay:m-0 novapay:mt-1 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(r.confirm.hint,{network:y.network})})]}),jsx(TxProgressIndicator,{isProcessing:true,...u?.progressIndicator,className:cn$1("novapay:max-w-sm",u?.progressIndicator?.className)}),jsxs(xe,{className:"novapay:max-w-sm",children:[y.network&&jsx(z,{name:r.confirm.network,children:y.network}),!p&&y.amount&&jsx(z,{name:r.confirm.amount,children:y.amount}),y.txKey&&jsx(z,{name:r.confirm.transaction,children:jsx(HashLink,{hash:y.txKey,explorerUrl:y.explorerUrl,variant:"compact",...u?.hashLink})}),y.fromAddress&&jsx(z,{name:r.confirm.from,children:jsx(HashLink,{hash:y.fromAddress,explorerUrl:y.fromUrl,variant:"compact",...u?.hashLink})})]}),jsx("p",{role:"status",className:cn$1("novapay:m-0 novapay:max-w-sm novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",p&&"novapay:mt-auto"),children:jsx(MorphText,{wrap:true,children:b?r.outcome.unconfirmedRetrying:v?h(C?r.confirm.afterDeadline:r.confirm.pastDeadline,{merchant:e.merchant.name}):w?r.confirm.invoicePayment:r.confirm.canClose})})]}),n&&jsx(ce,{children:jsx(pe,{onClick:n,children:r.common.close})})]})}function Yt({adapter:e,store:a,wallet:r,chainId:n}){let[o,l]=useState("idle"),[i,c]=useState(null),[p,u]=useState(null),y=useRef(0),h=r?.address,g=useRef(h);useEffect(()=>{g.current!==h&&(g.current=h,y.current++,l("idle"),c(null),u(null));},[h]);let N=useRef(false);return useEffect(()=>(N.current=false,()=>{N.current=true;}),[]),{step:o,problem:i,request:p,confirm:async({quote:w=false}={})=>{let v=++y.current,C=()=>y.current===v;c(null);let b=e?.signMessage;if(!b||!r)return c("unsupported"),false;if(r.chainId!==n&&e.switchChain){l("switching");try{await e.switchChain(n);}catch(T){if(C()){let f=b$1(T);c(f==="declined"?"switchDeclined":f==="failed"?"switchFailed":f),l("idle");}return false}if(!C())return false}C()&&l("signing");let k=a.getState().payer,x=null,S=await a.getState().confirmPayer(async(T,f)=>{C()&&u(f);try{return await b({message:T,account:r.address,chainId:f.chainId})}catch(I){throw x=b$1(I),I}});return C()&&(c(x),l("idle")),S&&w&&!N.current&&a.getState().payer===k&&await a.getState().requestQuote(),S},dismiss:()=>{y.current++,l("idle"),a.getState().abandonConfirmation();}}}function yl(){let{checkout:e,state:a,store:r,labels:n,locale:o,wallet:l,adapterFor:i,connectWallet:c,setConfirmWallet:p}=Y(),u=e?.methods.find(Z=>Z.id===a.methodId)??null,y=u?We(u):null,h$1=Yt({adapter:y?i(y):void 0,store:r,wallet:l,chainId:u?.chainId??""}),[g,N]=useState(false),w=useRef(null),v=h$1.step!=="idle",[C,b]=gn(v),k=useRef(false);if(useEffect(()=>{k.current&&!v&&w.current?.querySelector("[data-novapay-heading]")?.focus(),k.current=v;},[v]),!e||!u)return null;let x=e.merchant.name,S=l?.name??"",T=ve(u.chainId),f=e.invoice.number??e.invoice.id,I=e.invoice.totalMinor?`${ye(Ie(e.invoice.totalMinor),o)} ${e.invoice.currency}`:null,_=Ot(l),R=a.phase==="quoting",P=v,E=In(!R&&sn(a.error)?a.error:null,h$1.problem,n,{wallet:S,network:T,merchant:x}),B={wallet:S,invoice:f,merchant:x},W=ze(l,u),ne=()=>{W&&a.payer!==W&&r.getState().setPayer(W),h$1.confirm({quote:true});},L=()=>{p(false),r.getState().clearError();},Q=W?a.confirmedWallets?.find(Z=>!Da(Z,W)):void 0;return jsxs("div",{ref:w,className:"novapay:relative novapay:flex novapay:flex-1 novapay:flex-col",children:[jsxs("div",{ref:C,inert:v,className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col",v&&"novapay:hidden"),children:[jsxs(me,{title:n.payerProof.title,subtitle:n.payerProof.text,children:[l&&jsxs("div",{className:"novapay:flex novapay:items-center novapay:gap-2.5 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:px-3 novapay:py-2",children:[jsx("span",{className:"novapay:h-7 novapay:w-7 novapay:shrink-0",children:jsx(WalletIcon,{walletName:l.walletId})}),jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-1 novapay:flex-col",children:[jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:S}),jsx("span",{className:cn$1(F,"novapay:truncate novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:h(n.pay.walletLine,{address:shortAddress(l.address),network:ve(l.chainId)})})]}),jsx("button",{type:"button","aria-label":n.pay.changeWallet,onClick:()=>{c(u)||N(true);},className:cn$1("novapay:min-h-6 novapay:cursor-pointer novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-transparent novapay:px-2.5 novapay:py-1 novapay:text-xs novapay:font-semibold novapay:text-[var(--tuwa-text-primary)] novapay:hover:bg-[var(--tuwa-bg-muted)]",ie),children:n.pay.change})]}),jsx(qa,{children:n.payerProof.summary}),jsxs(xe,{children:[jsx(z,{name:n.payerProof.invoice,children:f}),jsx(z,{name:n.payerProof.merchant,children:x}),I&&jsx(z,{name:n.payerProof.amount,children:I}),l&&jsx(z,{name:n.payerProof.wallet,children:jsx(Pe,{hash:l.address,chainId:l.chainId})})]}),jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:n.payerProof.why}),_&&jsxs("p",{className:"novapay:m-0 novapay:flex novapay:items-start novapay:gap-2 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:[jsx(FingerPrintIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4 novapay:shrink-0"}),jsx("span",{children:h(n.payerProof.passkey,B)})]}),l&&y==="eip155"&&l.chainId!==u.chainId&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(n.payerProof.willSwitch,{current:ve(l.chainId),network:T})}),Q&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-primary)]",children:h(n.payerProof.alreadyConfirmed,{wallet:shortAddress(aa(Q))})}),E&&jsx(te,{children:E}),g&&jsx(te,{children:n.pay.connectUnavailable})]}),jsxs(ce,{children:[jsx(oe,{busy:P||R,onClick:ne,children:R?n.method.quoting:P?h(n.payerProof.waiting,B):h(n.payerProof.confirm,B)}),jsx(pe,{disabled:R,onClick:L,children:(a.invoiceStatus??e?.invoice.status)==="underpaid"?n.pay.backFromRest:n.pay.back}),jsx(ge,{children:_?n.payerProof.noteSmart:n.payerProof.note})]})]}),v&&jsx(Wa,{kind:h$1.step==="switching"?"switch":"proof",walletName:S,walletId:l?.walletId??"",walletIcon:l?.icon,amount:I??"",merchant:x,network:T,to:"",priceTime:null,text:h(_?n.payerProof.promptPasskey:n.payerProof.promptText,B),details:[...h$1.request?[{name:n.payerProof.site,value:h$1.request.domain}]:[],{name:n.payerProof.invoice,value:f},{name:n.payerProof.merchant,value:x},...I?[{name:n.payerProof.amount,value:I}]:[]],hint:h$1.request?h(n.payerProof.signInRequest,{wallet:S,site:h$1.request.domain}):void 0,onRetry:ne,onCancel:h$1.dismiss,stepHeight:b})]})}function vl({onStay:e,onLeave:a}){let{checkout:r,labels:n,locale:o}=Y(),l=useId(),i=useId(),c=useRef(null),p=r?.invoice.dueAt?new Intl.DateTimeFormat(o,{dateStyle:"medium",timeStyle:"short"}).format(Date.parse(r.invoice.dueAt)):null;return jsx(Dialog,{open:true,onOpenChange:u=>{u||e();},children:jsxs(DialogContent,{role:"alertdialog","aria-labelledby":l,"aria-describedby":i,onOpenAutoFocus:u=>{u.preventDefault(),c.current?.focus();},className:"novapay:w-full novapay:sm:w-[24rem]",children:[jsx(DialogTitle,{"aria-hidden":true,className:"novapay:sr-only",children:n.leave.title}),jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-3 novapay:p-5 novapay:text-center",children:[jsx("h2",{id:l,ref:c,tabIndex:-1,className:ga,children:n.leave.title}),jsx("p",{id:i,className:"novapay:m-0 novapay:text-xs",children:p?h(n.leave.text,{date:p}):n.leave.textNoDate}),jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:n.leave.price}),jsx(oe,{onClick:e,children:n.leave.stay}),jsx(pe,{onClick:a,children:n.leave.leave})]})]})})}function En(){let{checkout:e,labels:a,autoPayOff:r,setAutoPayOff:n}=Y(),o=e?.autoCharge;return r==="done"?jsx(ge,{children:h(a.paid.autoPayTurnedOff,{merchant:e?.merchant.name??""})}):o?.status!=="active"||!o.revocation?null:jsxs(ge,{children:[a.paid.autoPayActive," ",jsx("button",{type:"button",onClick:()=>n("open"),className:Dt,children:a.paid.autoPayOff})]})}function $a({label:e,items:a,value:r,getKey:n,onChange:o,children:l,className:i,itemClassName:c}){let p=useRef([]),u=Math.max(0,a.findIndex(h=>n(h)===r)),y=(h,g)=>{let N=a.length-1,w={ArrowRight:g+1,ArrowDown:g+1,ArrowLeft:g-1,ArrowUp:g-1,Home:0,End:N}[h.key];if(w===void 0)return;h.preventDefault();let v=w<0?N:w>N?0:w;o(n(a[v])),p.current[v]?.focus();};return jsx("div",{role:"radiogroup","aria-label":e,className:i,children:a.map((h,g)=>{let N=n(h),w=N===r;return jsx("button",{ref:v=>{p.current[g]=v;},type:"button",role:"radio","aria-checked":w,tabIndex:g===u?0:-1,onClick:()=>o(N),onKeyDown:v=>y(v,g),className:cn$1("novapay:cursor-pointer novapay:rounded-[var(--tuwa-rounded-corners)] novapay:text-left novapay:text-[var(--tuwa-text-primary)] novapay:transition-colors","novapay:border",w?"novapay:border-[var(--tuwa-text-accent)] novapay:bg-[var(--tuwa-bg-primary)] novapay:ring-1 novapay:ring-[var(--tuwa-text-accent)]":"novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-secondary)] novapay:hover:border-[var(--tuwa-text-secondary)]",ie,c?.(w,h)),children:l(h,w)},N)})})}function ma({tone:e,children:a}){return jsx("span",{className:cn$1("novapay:shrink-0 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:px-1.5 novapay:py-0.5 novapay:text-[11px]",e==="neutral"&&"novapay:bg-[var(--tuwa-bg-muted)] novapay:text-[var(--tuwa-text-primary)]",e==="accent"&&"novapay:border novapay:border-[var(--tuwa-text-accent)] novapay:text-[var(--tuwa-text-accent)]",e==="success"&&"novapay:bg-[var(--tuwa-success-bg)] novapay:text-[var(--tuwa-success-text)]"),children:a})}function at({method:e,labels:a}){let r=qt(e);return r?r.kind==="discount"?jsx(ma,{tone:"success",children:h(a.method.discount,{percent:r.percent})}):jsx(ma,{tone:"neutral",children:h(a.method.markup,{percent:r.percent})}):null}function ml({selected:e}){return jsx("span",{"aria-hidden":true,className:cn$1("novapay:h-3.5 novapay:w-3.5 novapay:shrink-0 novapay:rounded-full novapay:box-border",e?"novapay:border-4 novapay:border-[var(--tuwa-text-accent)]":"novapay:border novapay:border-[var(--tuwa-text-secondary)]")})}function hl({labels:e,terms:a,refundPolicy:r}){let n=(l,i)=>jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:cn$1("novapay:text-[var(--tuwa-text-accent)] novapay:underline",ie),children:i},l),o=a&&r?i(e.method.agreeBoth,{terms:n(a,e.summary.terms),refundPolicy:n(r,e.summary.refundPolicy)}):a||r?i(e.method.agreeOne,{link:a?n(a,e.summary.terms):n(r,e.summary.refundPolicy)}):null;return o?jsx("p",{className:"novapay:m-0 novapay:text-center novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:o}):null}function fl(){let e=Y(),{checkout:a,state:r,store:n,labels:o,wallet:l,payWith:i,setPayWith:c,payUrl:p,connectWallet:u,adapterFor:y,setHandoff:h$1,lockPrice:g}=e,{TokenOption:N,NetworkOption:w}=e.customization.components??{},v=useMemo(()=>a?.methods??[],[a]),C=useMemo(()=>oo(v,l?.chainId),[v,l?.chainId]),b=v.find($=>$.id===r.methodId)??null,k=C.find($=>$.symbol===b?.symbol)??null,x=b?Zr(b,p):false,S=b?We(b):null,T=[...S&&y(S)?["wallet"]:[],...x?["qr"]:[]],f=T.includes(i)?i:T[0]??null,[I,_]=useState(false),R=useId(),P=useId(),E=useEffectEvent(()=>{let $=C[0]?.methods[0];!r.methodId&&$&&n.getState().selectMethod($.id,{keepError:true});});if(useEffect(()=>E(),[C]),!a)return null;if(v.length===0)return jsx(me,{title:o.method.title,children:jsx(te,{children:o.method.noMethods})});let B=e.display==="page",W=C.reduce(($,O)=>O.methods.length>$.methods.length?O:$,C[0]),ne=r.phase==="quoting",L=a.consent??null,Q=!!r.consentGiven,Z=!!(L?.required&&!Q),V=e.customization.handlers,A=$=>{let O=()=>n.getState().selectMethod($.id);V?.onMethodSelect?V.onMethodSelect({method:$,select:O}):O();},U=async()=>{if(!b||!f)return;if(_(false),f==="qr"){if(i!=="qr"&&c("qr"),S!=="solana")return h$1(true);n.getState().setPayer(null),await n.getState().requestQuote();return}i!=="wallet"&&c("wallet");let $=ze(l,b);if(!$)return _(!u(b));n.getState().setPayer($),await g();},J=$=>jsxs(Fragment,{children:[jsx(qa,{children:h(o.method.network,{symbol:$.symbol})}),jsx($a,{label:h(o.method.network,{symbol:$.symbol}),items:$.methods,value:b?.id??null,getKey:O=>O.id,onChange:O=>{let M=$.methods.find(K=>K.id===O);M&&A(M);},className:B&&$.methods.length>1?"novapay:grid novapay:grid-cols-1 novapay:gap-1.5 novapay:@min-[520px]:grid-cols-2":"novapay:flex novapay:flex-col novapay:gap-1.5",itemClassName:(O,M)=>cn$1("novapay:flex novapay:items-center novapay:gap-2.5 novapay:px-3 novapay:py-2.5",se(e,"networkOption",{method:M,selected:O})),children:(O,M)=>w?jsx(w,{method:O,selected:M}):jsxs(Fragment,{children:[jsx("span",{className:"novapay:h-5 novapay:w-5 novapay:shrink-0",children:jsx(NetworkIcon,{chainId:toEvmChainId(O.chainId)??O.chainId})}),jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-1 novapay:flex-col novapay:gap-1",children:[jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:ve(O.chainId)}),jsxs("span",{className:"novapay:flex novapay:flex-wrap novapay:items-center novapay:gap-1.5",children:[l?.chainId===O.chainId&&jsx(ma,{tone:"neutral",children:o.method.yourWallet}),O.featured&&jsx(ma,{tone:"accent",children:o.method.popular}),jsx(at,{method:O,labels:o}),O.gasless==="auto"?jsx(ma,{tone:"success",children:o.method.noGasFee}):jsx("span",{className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:o.method.buyerPaysGas})]})]}),jsx(ml,{selected:M})]})})]});return jsxs(Fragment,{children:[jsxs(me,{title:o.method.title,subtitle:h(o.method.subtitle,{minutes:Math.round(a.quoteTtlSeconds/60)}),children:[jsx(qa,{children:o.method.token}),jsx($a,{label:o.method.token,items:C,value:k?.symbol??null,getKey:$=>$.symbol,onChange:$=>{let O=C.find(M=>M.symbol===$)?.methods[0];O&&A(O);},className:"novapay:grid novapay:grid-cols-[repeat(auto-fit,minmax(5.5rem,1fr))] novapay:gap-2",itemClassName:($,O)=>cn$1("novapay:flex novapay:min-w-0 novapay:flex-col novapay:items-center novapay:gap-1 novapay:px-2 novapay:py-2",B&&"novapay-page-token",se(e,"tokenOption",{group:O,selected:$})),children:($,O)=>N?jsx(N,{group:$,selected:O}):jsxs(Fragment,{children:[jsx("span",{className:"novapay:h-6.5 novapay:w-6.5",children:jsx(TokenIcon,{symbol:$.symbol})}),jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:$.symbol}),jsx("span",{className:"novapay:max-w-full novapay:truncate novapay:text-[10px] novapay:text-[var(--tuwa-text-secondary)]",children:$.methods.length>1?h(o.method.networks,{count:$.methods.length}):qt($.methods[0])?jsx(at,{method:$.methods[0],labels:o}):ve($.methods[0].chainId)})]})}),B&&k?jsxs("div",{className:cn$1("novapay:grid",k.methods.length===1&&"novapay:max-sm:hidden"),children:[W!==k&&jsx("div",{inert:true,"aria-hidden":true,className:"novapay:invisible novapay:flex novapay:flex-col novapay:gap-2.5 novapay:[grid-area:1/1] novapay:max-sm:hidden",children:J(W)}),jsx("div",{className:"novapay:flex novapay:min-w-0 novapay:flex-col novapay:gap-2.5 novapay:[grid-area:1/1]",children:J(k)})]}):k&&k.methods.length>1&&J(k),jsx(qa,{children:o.method.payWith}),jsx($a,{label:o.method.payWith,items:T,value:f,getKey:$=>$,onChange:$=>{_(false),c($);},className:cn$1("novapay:grid novapay:gap-2",T.length>1&&"novapay:grid-cols-2"),itemClassName:($,O)=>cn$1("novapay:flex novapay:items-center novapay:gap-2.5 novapay:px-2.5 novapay:py-2",B&&"novapay-page-way",se(e,"payWithOption",{payWith:O,selected:$})),children:$=>$==="wallet"?jsxs(Fragment,{children:[l?jsx("span",{className:"novapay:h-5 novapay:w-5 novapay:shrink-0",children:jsx(An,{walletId:l.walletId,icon:l.icon})}):jsx(WalletIcon$1,{"aria-hidden":true,className:"novapay:h-5 novapay:w-5 novapay:shrink-0 novapay:text-[var(--tuwa-text-accent)]"}),jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-col",children:[jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:o.method.wallet}),jsx("span",{className:cn$1("novapay:truncate novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",l&&F),children:l?`${l.name} \xB7 ${shortAddress(l.address)}`:o.method.walletHint})]})]}):jsxs(Fragment,{children:[b&&We(b)==="solana"?jsx(QrCodeIcon,{"aria-hidden":true,className:"novapay:h-5 novapay:w-5 novapay:shrink-0"}):jsx(DevicePhoneMobileIcon,{"aria-hidden":true,className:"novapay:h-5 novapay:w-5 novapay:shrink-0"}),jsxs("span",{className:"novapay:flex novapay:flex-col",children:[jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:o.method.qr}),jsx("span",{className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:o.method.qrHint})]})]})}),L&&jsxs("label",{className:cn$1("novapay:flex novapay:cursor-pointer novapay:items-start novapay:gap-2.5 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:px-3 novapay:py-2.5 novapay:transition-colors",Q?"novapay:border-[var(--tuwa-text-accent)] novapay:bg-[var(--tuwa-bg-primary)] novapay:ring-1 novapay:ring-[var(--tuwa-text-accent)]":"novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-secondary)] novapay:hover:border-[var(--tuwa-text-secondary)]",se(e,"consentOption",{checked:Q,required:L.required})),children:[jsx("input",{type:"checkbox",checked:Q,required:L.required,"aria-labelledby":R,"aria-describedby":L.required?P:void 0,onChange:$=>n.getState().setConsentGiven($.target.checked),className:cn$1("novapay:mt-0.5 novapay:h-4 novapay:w-4 novapay:shrink-0 novapay:accent-[var(--tuwa-text-accent)]",ie)}),jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-col novapay:gap-1",children:[jsx("span",{id:R,className:"novapay:whitespace-pre-line novapay:break-words novapay:text-[12px] novapay:leading-snug",children:L.text}),L.required&&jsx("span",{id:P,className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:o.method.consentRequired})]})]}),b&&!f&&jsx(te,{children:o.method.methodUnavailable}),I&&jsx(te,{children:x?o.pay.connectUnavailable:o.method.methodUnavailable}),r.error&&r.phase==="selectMethod"&&jsx(te,{children:Sn(r.error,o,a.merchant.name)})]}),jsxs(ce,{children:[jsx(oe,{busy:ne,disabled:!b||!f||Z,onClick:()=>{b&&f&&V?.onQuote?V.onQuote({method:b,payWith:f,proceed:U}):U();},children:ne?o.method.quoting:o.method.continue}),jsx(hl,{labels:o,terms:a.merchant.links.terms,refundPolicy:a.merchant.links.refundPolicy}),jsx(En,{})]})]})}var xl=/^0x[0-9a-fA-F]{64}$/,wl=/^[1-9A-HJ-NP-Za-km-z]{64,90}$/;function _a(){let{store:e,state:a,checkout:r,labels:n,wallet:o}=Y(),[l,i]=useState(false),[c,p]=useState(""),[u,y]=useState(false),[h,g]=useState(null),N=useId(),w=a.quote??r?.quote;if(!w)return null;let v=n.outcome;if(!l)return jsx(wa,{onClick:()=>i(true),children:v.nameHash});let C=async b=>{b.preventDefault();let k=c.trim();if(!(w.instructions.family==="solana"?wl:xl).test(k))return g(v.nameHashInvalid);g(null),y(true);let x=await e.getState().submit({txKey:k,...o?{from:o.address}:{}});y(false),x||g(v.nameHashRefused);};return jsxs("form",{onSubmit:b=>{C(b);},className:"novapay:flex novapay:w-full novapay:max-w-sm novapay:flex-col novapay:gap-2 novapay:text-left",children:[jsx("label",{htmlFor:N,className:"novapay:text-xs novapay:font-semibold",children:v.nameHashField}),jsx("input",{id:N,value:c,autoComplete:"off",spellCheck:false,"aria-invalid":h?true:void 0,onChange:b=>p(b.target.value),className:cn$1(F,"novapay:box-border novapay:h-10 novapay:w-full novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-3 novapay:text-xs novapay:text-[var(--tuwa-text-primary)]",ie)}),h&&jsx(te,{children:h}),jsx(pe,{type:"submit",disabled:u||!c.trim(),children:v.nameHashSend})]})}var nt=e=>e?.code==="payment_unconfirmed",bl={nonceSpent:"unconfirmedNonceSpent",unmined:"unconfirmedUnmined",rechecked:"unconfirmedNote",retrying:"unconfirmedRetrying",notReceived:"unconfirmedNotReceived",contact:"unconfirmedContact",closed:"unconfirmedClosed",takenElsewhere:"unconfirmedTakenElsewhere",settlementRetrying:"unconfirmedSettlementRetrying",settlementFailed:"unconfirmedSettlementFailed",invoiceFull:"unconfirmedInvoiceFull"},tt=new Set(["nonceSpent","unmined","notReceived","contact","closed","takenElsewhere","settlementRetrying","settlementFailed","invoiceFull"]),rt=new Set(["nonceSpent","takenElsewhere","settlementRetrying","settlementFailed","invoiceFull"]),gl=({className:e})=>jsx(DrawnCross,{variant:"disc",className:e}),Nl={unconfirmed:{Icon:ExclamationTriangleIcon,tone:"novapay:text-[var(--tuwa-pending-icon)]"},underpaid:{Icon:ExclamationTriangleIcon,tone:"novapay:text-[var(--tuwa-pending-icon)]"},held:{Icon:MagnifyingGlassIcon,tone:"novapay:text-[var(--tuwa-info-icon)]"},refunded:{Icon:ArrowUturnLeftIcon,tone:"novapay:text-[var(--tuwa-info-icon)]"},expired:{Icon:ClockIcon,tone:"novapay:text-[var(--tuwa-text-secondary)]"},cancelled:{Icon:gl,tone:"novapay:text-[var(--tuwa-text-secondary)]"},replaced:{Icon:ArrowPathRoundedSquareIcon,tone:"novapay:text-[var(--tuwa-info-icon)]"},blocked:{Icon:NoSymbolIcon,tone:"novapay:text-[var(--tuwa-error-icon)]"}},ee=({children:e,muted:a})=>jsx("p",{className:cn$1("novapay:m-0 novapay:max-w-sm novapay:text-xs",a?"novapay:text-[var(--tuwa-text-secondary)]":"novapay:text-[var(--tuwa-text-primary)]"),children:e});function kl(){let e=Y(),{checkout:a,labels:r,onContact:n}=e;if(!a)return null;let o=h(r.outcome.contact,{merchant:a.merchant.name}),l=cn$1(Tn,se(e,"secondaryButton"));if(n)return jsx("button",{type:"button",onClick:n,className:l,children:o});let i=bo(a.merchant,h(r.outcome.contactSubject,{number:a.invoice.number??a.invoice.id}));return i?jsx("a",{href:i,target:i.startsWith("mailto:")?void 0:"_blank",rel:"noopener noreferrer",className:l,children:o}):null}function Pl({kind:e}){let[a,r]=useState(false),n=Y(),{checkout:o,state:l,store:i,labels:c,locale:p,now:u,wallet:y,connectWallet:h$1,openInvoice:g,qrShown:N,paymentSent:w,adapterFor:v,lockPrice:C}=n;if(!o)return null;let b=o.merchant.name,{Icon:k,tone:x}=Nl[e],S=n.customization.components?.StatusIcon,T=se(n,"statusIcon",{kind:e}),f=l.quote,I=o.methods.find(A=>A.id===(l.methodId??f?.methodId)),_=o.invoice.dueAt&&!o.invoice.closed?new Intl.DateTimeFormat(p,{dateStyle:"medium",timeStyle:"short"}).format(Date.parse(o.invoice.dueAt)):null,R=(A,U=f)=>U?`${ue(A,U.decimals,p)} ${U.instructions.symbol}`:A,P=ba(l.error),E=A=>h(c.outcome[bl[A]],{merchant:b}),B=l.followingUntil??null,W=B?jsx(ee,{muted:true,children:h(c.outcome.followingUntil,{time:new Intl.DateTimeFormat(p,{timeStyle:"short"}).format(Date.parse(B))})}):null,ne=wo(l,o),L=A=>{if(!ne||A!=="mismatch"&&(!A||!tt.has(A)))return null;let U=f??o.quote,J=U?Te(U.instructions):null,$=U&&J?v(U.instructions.family)?.explorerUrl?.({chainId:J,txKey:ne}):void 0;return jsx(Ha,{children:jsx(xe,{className:"novapay:w-full novapay:max-w-sm",children:jsx(z,{name:c.confirm.transaction,children:jsx(HashLink,{hash:ne,explorerUrl:$,variant:"compact",...n.customization.childCustomizations?.hashLink})})})})},Q,Z=null,V=null;switch(e){case "unconfirmed":{if(Q=c.outcome.unconfirmedTitle,Ve(l.error))Z=jsxs(Fragment,{children:[jsx(ee,{children:va(l.error,c,b)}),L("mismatch")]});else if(P&&rt.has(P))Z=jsxs(Fragment,{children:[jsx(ee,{children:E(P)}),L(P),P==="nonceSpent"&&jsx(_a,{})]});else {let J=P??"contact";Z=jsxs(Fragment,{children:[jsx(ee,{children:c.outcome.unconfirmedText}),jsx(ee,{muted:true,children:E(J)}),L(J),jsx(_a,{})]});}let{payAgain:A}=i.getState(),U=l.invoiceStatus??o.invoice.status;A&&(U==="open"||U==="underpaid")&&!(P&&rt.has(P))&&(V=Ve(l.error)?l.error.held===true?jsx(oe,{onClick:()=>A(),children:c.pay.payAgain}):jsx(pe,{onClick:()=>A(),children:c.pay.payAgain}):jsx(pe,{onClick:()=>A(),children:c.outcome.unconfirmedPayAgain}));break}case "underpaid":{let A=f??o.quote,U=o.invoice.amountPaid,J=Po(A,U);Q=c.outcome.underpaidTitle;let $=A&&U&&jsx(ee,{children:h(c.outcome.underpaidText,{received:R(U,A),total:R(A.cryptoAmountExpected,A)})});if(o.invoice.status==="underpaid"&&o.invoice.restPayable===false||l.error?.code==="method_not_found"){Z=jsxs(Fragment,{children:[$,jsx(ee,{children:c.outcome.underpaidClosed}),_&&jsx(ee,{children:h(c.outcome.underpaidClosedRefund,{merchant:b,date:_})})]});break}let O=Cn(A,u,c,b,p,c.outcome.underpaidRateEnded),M=o.methods.find(qe=>qe.id===A?.methodId)??I??o.methods[0],K=l.error?.code==="payer_blocked"?h(c.outcome.underpaidBlocked,{merchant:b}):l.error&&l.error.code!=="payer_mismatch"?Sn(l.error,c,b):null;Z=jsxs(Fragment,{children:[$,A&&J&&jsx(ee,{children:h(c.outcome.underpaidRest,{rest:R(J,A),network:ve(Te(A.instructions))})}),_&&jsx(ee,{muted:true,children:h(c.outcome.underpaidNote,{merchant:b,date:_})}),O&&jsx(ee,{muted:true,children:O}),K&&jsx(te,{children:K})]});let G=M&&y?ze(y,M):null,j=l.error?.code==="payer_mismatch"?l.error.originWallet??null:null,ae=j??o.invoice.originWallet??A?.payer??null,le=ae?aa(ae):void 0,de=G?parseCaip10AccountId(G)?.address:void 0,he=A?.payer!==null&&!!(le&&(de?!Da(de,le):j)),Oe=()=>{if(!M)return;if(he)return void h$1(M);let qe=A?.payer===null?null:G;if(A?.payer!==null&&!qe)return void h$1(M);l.methodId!==M.id&&i.getState().selectMethod(M.id),i.getState().setPayer(qe),C();};he&&le&&(Z=jsxs(Fragment,{children:[Z,jsx(ee,{children:h(c.outcome.payRestFirstWallet,{wallet:shortAddress(le)})})]})),V=jsx(oe,{busy:l.phase==="quoting",onClick:Oe,children:c.outcome.payRest});break}case "held":{Q=h(c.outcome.heldTitle,{merchant:b});let A=o.invoice.review?.reason,U=A==="late"?c.outcome.heldLate:A==="overpaid"?c.outcome.heldOverpaid:A==="quote_expired"?c.outcome.heldQuoteExpired:c.outcome.heldScreening;Z=jsxs(Fragment,{children:[jsx(ee,{children:h(U,{merchant:b})}),jsx(ee,{muted:true,children:c.outcome.heldNote})]});break}case "refunded":{Q=c.outcome.refundedTitle;let A=o.invoice.refundedTotalMinor??o.invoice.totalMinor;Z=A&&jsx(ee,{children:h(c.outcome.refundedText,{merchant:b,amount:ye(Ie(A),p),currency:o.invoice.currency})});break}case "expired":{Q=c.outcome.expiredTitle;let A=So(o.invoice.amountPaid),U=f??o.quote,J=ea(l)||xa(l,o),$=nt(l.error)||P==="settlementFailed"||P==="settlementRetrying",O=$||!J&&Ma(l,o),M=!O&&P==="closed",K=!O&&!M&&(J||w),G=!O&&!M&&!K&&Ve(l.error),j=K||O||M||G||N,ae=$?P??"contact":"rechecked";Z=jsxs(Fragment,{children:[A?jsxs(Fragment,{children:[_&&jsx(ee,{children:U?h(c.outcome.expiredPartText,{date:_,amount:R(A,U)}):h(c.outcome.expiredPartNoAmount,{date:_})}),!_&&U&&jsx(ee,{children:h(c.outcome.closedPartText,{merchant:b,amount:R(A,U)})}),jsx(ee,{children:h(c.outcome.expiredPartRefund,{merchant:b})})]}):!j&&_&&jsx(ee,{children:h(c.outcome.expiredText,{date:_,merchant:b})}),O?jsxs(Fragment,{children:[jsx(ee,{children:ae==="rechecked"?h(c.outcome.expiredUnconfirmed,{merchant:b}):E(ae)}),L(ae),ae==="nonceSpent"&&jsx(_a,{})]}):M?jsxs(Fragment,{children:[jsx(ee,{children:E("closed")}),L("closed")]}):K?jsxs(Fragment,{children:[jsx(ee,{children:h(c.outcome.expiredWhileConfirming,{merchant:b})}),W]}):G?jsxs(Fragment,{children:[jsx(ee,{children:va(l.error,c,b)}),L("mismatch")]}):N?jsx(ee,{children:h(c.outcome.expiredAfterQr,{merchant:b})}):jsx(ee,{muted:true,children:c.outcome.expiredNote})]});break}case "cancelled":{if(Q=c.outcome.cancelledTitle,P&&tt.has(P)){Z=jsxs(Fragment,{children:[jsx(ee,{children:E(P)}),L(P),P==="nonceSpent"&&jsx(_a,{})]});break}let A=nt(l.error)||P==="closed"||ea(l)||xa(l,o)||Ma(l,o)||w,U=!A&&Ve(l.error),J=A?h(c.outcome.cancelledWhilePaying,{merchant:b}):U?va(l.error,c,b):h(N?c.outcome.cancelledAfterQr:c.outcome.cancelledText,{merchant:b});Z=jsxs(Fragment,{children:[jsx(ee,{children:J}),U&&L("mismatch"),P==="retrying"&&jsx(ee,{muted:true,children:c.outcome.unconfirmedRetrying}),A&&W]});break}case "replaced":{let A=o.invoice.replacedBy,U=A?.number??"";if(Q=h(c.outcome.replacedTitle,{merchant:b}),Z=jsxs(Fragment,{children:[jsx(ee,{children:h(c.outcome.replacedText,{number:U})}),jsx(ee,{muted:true,children:c.outcome.replacedPaid})]}),A?.checkoutToken){let J=A.checkoutToken;V=jsx(oe,{onClick:()=>g(J),children:h(c.outcome.openReplacement,{number:U})});}break}case "blocked":{Q=c.outcome.blockedTitle;let A=l.payer?parseCaip10AccountId(l.payer)?.address:void 0;Z=jsxs(Fragment,{children:[jsx(ee,{children:l.error?.code==="payer_not_expected"?c.method.payerNotExpected:h(c.outcome.blockedText,{merchant:b})}),A&&jsx(Pe,{hash:A,chainId:f??o.quote?Te((f??o.quote).instructions):null})]}),I&&(V=jsx(oe,{onClick:()=>{h$1(I)||r(true);},children:c.outcome.useAnotherWallet}));break}}return jsxs(Fragment,{children:[jsxs("section",{role:e==="blocked"?"alert":void 0,className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col novapay:items-center novapay:justify-center novapay:gap-3 novapay:px-5 novapay:py-6 novapay:text-center",n.display==="page"&&"novapay-page-screen"),children:[S?jsx(S,{kind:e,className:T}):jsx(k,{"aria-hidden":true,className:cn$1("novapay:h-12 novapay:w-12",x,T)}),jsx(Mn,{className:"novapay:max-w-sm",children:Q}),Z,a&&jsx(te,{children:c.pay.connectUnavailable})]}),jsxs(ce,{children:[V,jsx(kl,{}),jsx(En,{})]})]})}function Sl(e,a,r,n=false){let o=useRef(null),l=a?.id??null,i=useEffectEvent(()=>{a&&r?.({...a,status:"paid"});});useEffect(()=>{e!=="paid"||!l||o.current===l||(o.current=l,n||i());},[e,l,n]);}function Cl({url:e,seconds:a,now:r,navigate:n=o=>window.location.assign(o)}){let[o,l]=useState(a>0?r:null);a>0!=(o!==null)&&l(a>0?r:null);let i=a>0?o??r:r,[c,p]=useState(false),u=e&&a>0&&!c?Math.max(0,a-Math.floor((r-i)/1e3)):null,y=useEffectEvent(()=>{e&&n(e);});return useEffect(()=>{u===0&&y();},[u]),{left:u,stay:()=>p(true)}}function Il(){let e=Y(),{checkout:a,state:r,labels:n,locale:o,now:l,close:i,wallet:c,adapterFor:p,setAutoPay:u,autoPayOff:y,setAutoPayOff:h$1,autoReturnSeconds:g,openedPaid:N,display:w}=e,v=e.customization.childCustomizations,C=Vt(),[b]=useState(l),k=a?.merchant.name??"",x=w==="modal"&&g===0?null:a?.invoice.successUrl??null,S=a?.autoCharge??null,T=S?.status==="available"?a?.methods.find(ne=>ne.id===S.methodId):void 0,f=T?We(T):null,I=y!=="done"&&!!(c&&f&&p(f)?.requestPermission),_=I||N||S?.status==="active",R=Cl({url:x,seconds:_?0:g,now:l});if(!a)return null;let P=a.invoice.totalMinor?ye(Ie(a.invoice.totalMinor),o):null,E=a.invoice.refundedTotalMinor&&BigInt(a.invoice.refundedTotalMinor)>0n?ye(Ie(a.invoice.refundedTotalMinor),o):null,B=a.invoice.paidAt?Date.parse(a.invoice.paidAt):b,W=new Intl.DateTimeFormat(o,{dateStyle:"medium",timeStyle:"short"}).format(B);return jsxs(Ha,{children:[jsxs("section",{className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col novapay:items-center novapay:gap-3 novapay:px-5 novapay:py-5 novapay:text-center",e.display==="page"&&"novapay-page-status"),children:[jsx(TxStatusVisual,{isSucceed:true,...v?.statusVisual,className:e.display==="page"?cn$1("novapay-page-visual",v?.statusVisual?.className):v?.statusVisual?.className}),jsx(Mn,{children:n.paid.title}),jsxs("div",{children:[jsx("p",{className:cn$1(F,"novapay:m-0 novapay:text-2xl novapay:font-bold",e.display==="page"&&"novapay-page-amount"),children:C.paidAmount??(P&&`${P} ${a.invoice.currency}`)}),jsx("p",{className:"novapay:m-0 novapay:mt-1 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:C.network?h(n.paid.summary,{network:C.network,date:W}):W})]}),jsx(TxProgressIndicator,{isSucceed:true,isConfirmed:true,...v?.progressIndicator,className:cn$1("novapay:max-w-sm",v?.progressIndicator?.className)}),(C.network||C.txKey||C.from)&&jsxs(xe,{className:"novapay:max-w-sm",children:[C.network&&jsx(z,{name:n.confirm.network,children:C.network}),C.txKey&&jsx(z,{name:C.lastOfParts?n.confirm.lastTransfer:n.confirm.transaction,children:jsx(HashLink,{hash:C.txKey,explorerUrl:C.explorerUrl,variant:"compact",...v?.hashLink})}),C.fromAddress&&jsx(z,{name:n.confirm.from,children:jsx(HashLink,{hash:C.fromAddress,explorerUrl:C.fromUrl,variant:"compact",...v?.hashLink})})]}),E&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(n.paid.refunded,{amount:E,currency:a.invoice.currency})}),r.receiptUrl&&jsxs("div",{className:"novapay:flex novapay:w-full novapay:max-w-sm novapay:items-center novapay:gap-3 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:px-3 novapay:py-2 novapay:text-left",children:[jsx(DocumentTextIcon,{"aria-hidden":true,className:"novapay:h-6 novapay:w-6 novapay:shrink-0 novapay:text-[var(--tuwa-text-secondary)]"}),jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-1 novapay:flex-col",children:[jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:n.paid.receipt}),jsx("span",{className:"novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:n.paid.receiptHint})]}),jsxs("a",{href:r.receiptUrl,target:"_blank",rel:"noopener noreferrer",className:cn$1("novapay:inline-flex novapay:min-h-6 novapay:items-center novapay:gap-1 novapay:text-xs novapay:font-semibold novapay:text-[var(--tuwa-text-accent)]",ie),children:[jsx(ArrowDownTrayIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4"}),n.paid.download]})]}),S?.status==="active"&&jsxs("p",{className:"novapay:m-0 novapay:flex novapay:items-center novapay:gap-1.5 novapay:text-xs novapay:text-[var(--tuwa-success-text)]",children:[jsx(DrawnCheck,{variant:"disc",className:"novapay:h-4 novapay:w-4"}),n.paid.autoPayActive,S.revocation&&jsx("button",{type:"button",onClick:()=>h$1("open"),className:Dt,children:n.paid.autoPayOff})]}),y==="done"&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(n.paid.autoPayTurnedOff,{merchant:k})})]}),jsxs(ce,{children:[I&&jsx(oe,{onClick:()=>u(true),children:n.paid.autoPayOffer}),x?jsxs(Fragment,{children:[jsx("a",{href:x,className:I?cn$1(Tn,se(e,"secondaryButton")):cn$1(La,se(e,"primaryButton")),children:h(n.paid.back,{merchant:k})}),R.left!==null&&jsxs(ge,{children:[jsx("span",{role:"timer","aria-live":"off",children:h(n.paid.returning,{merchant:k,seconds:R.left})})," ","\xB7 ",jsx(wa,{onClick:R.stay,children:n.paid.stay})]})]}):i&&(I?jsx(pe,{onClick:i,children:n.common.close}):jsx(oe,{onClick:i,children:n.common.close}))]})]})}function Tl({state:e,screen:a,now:r,handlers:n}){let o=e.checkout?.invoice.status??null,{phase:l,error:i}=e,c=e.quote?.expiresAt?Date.parse(e.quote.expiresAt):null,p=c!==null&&r>=c,u=useEffectEvent(()=>n?.onStatusChange?.({phase:l,status:o,screen:a}));useEffect(()=>u(),[l,o]);let y=useEffectEvent(()=>{i&&n?.onError?.({error:i,screen:a});});useEffect(()=>y(),[i]);let h=useRef({quote:false,invoice:false}),g=useEffectEvent(N=>n?.onExpire?.({kind:N,paymentOnTheWay:ea(e)||xa(e,e.checkout)||Ma(e,e.checkout)}));useEffect(()=>{p&&!h.current.quote&&g("quote"),h.current.quote=p;},[p]),useEffect(()=>{let N=o==="expired";N&&!h.current.invoice&&g("invoice"),h.current.invoice=N;},[o]);}var He=()=>new Promise(()=>{}),_l={view:He,quote:He,buyer:He,locale:He,submit:He,relay:He,permission:He,permissionRevoked:He,url:()=>""},Al=c({token:"idle",api:_l,EventSource:null});function ql(e){let{token:a,baseUrl:r,api:n,EventSource:o,pollMs:l,enabled:i=true}=e,[c$1,p]=useState(Al),u=useEffectEvent(()=>c({token:a,baseUrl:r,api:n,EventSource:o,pollMs:l}));return useEffect(()=>{if(!i)return;let y=u();return p(y),y.getState().load(),()=>y.getState().destroy()},[a,r,i]),c$1}function $l(e,a){return useStore(e,a)}var Rl=createStore(()=>({}));function Zt(){let e=useContext(SatelliteStoreContext)??Rl,a=useStore(e,u=>u.activeConnection),r=useStore(e,u=>u.getConnectors),n=useStore(e,u=>u.watchConnectors),[o,l]=useState(0);useEffect(()=>n?.(()=>l(u=>u+1)),[n]);let i=useMemo(()=>Yr(a,r?.()),[a,r,o]),c=i?.name,p=i?.icon;return useMemo(()=>i,[a,c,p])}function Ml(e){let[a,r]=useState({store:e,at:null});return useEffect(()=>e.subscribe((n,o)=>{n.phase!==o.phase&&(n.phase==="confirming"?r({store:e,at:o.phase==="submitting"?Date.now():null}):o.phase==="confirming"&&r({store:e,at:null}));}),[e]),a.store===e?a.at:null}var ot=Symbol.for("tuwaio.nova-payments.context"),lt=globalThis,cn=lt[ot]??(lt[ot]=createContext({}));function ka(){return useContext(cn)}function El(e,a=true){let[r,n]=useState(()=>Date.now());return useEffect(()=>{if(!a)return;let o=setInterval(()=>n(Date.now()),e);return ()=>clearInterval(o)},[e,a]),r}var pn="nova-payments:sponsoredBatches",dn=()=>{try{return globalThis.sessionStorage??null}catch{return null}},Wn=()=>{try{let e=JSON.parse(dn()?.getItem(pn)??"[]");return Array.isArray(e)?e:[]}catch{return []}},Jt=e=>{try{e.length>0?dn()?.setItem(pn,JSON.stringify(e)):dn()?.removeItem(pn);}catch{}},an=e=>Jt(Wn().filter(a=>a.invoiceId!==e)),Wl=e=>Jt([...Wn().filter(a=>a.invoiceId!==e.invoiceId),e]),it=e=>Wn().find(a=>a.invoiceId===e&&Date.now()-a.at<21e5)??null,st=e=>new a("unsupported",`${e} is not available`);async function Ol({adapter:e,store:a,quote:r,wallet:n,path:o,paymasterUrl:l,onWalletDone:i,onBatchAccepted:c,onSent:p}){let u=n.address;if(o==="relay"){let h=r.gasless?.relay?.typedData;if(!h||!e.signTransferAuthorization)throw st("A gasless signature");let g=await e.signTransferAuthorization({typedData:h,account:u});return i?.(),a.getState().relay(g)}if(o==="paymaster"){let h=r.gasless?.paymaster?.calls;if(!h||!l||!e.sendSponsoredCalls)throw st("A sponsored payment");let g=Te(r.instructions),N=await e.sendSponsoredCalls({calls:h,paymasterUrl:l,chainId:g,account:u,onSent:i,onAccepted:c,onLate:w=>{p?.(w),a.getState().submit({txKey:w,connectorType:n.connectorType,methodId:r.methodId});}});return i?.(),p?.(N),a.getState().submit({txKey:N,connectorType:n.connectorType,methodId:r.methodId})}let y=await e.sendTransfer({instructions:r.instructions,account:u,connection:n.connection});return i?.(),p?.(y),a.getState().submit({txKey:y,connectorType:n.connectorType,methodId:r.methodId})}var Ke=new WeakMap;function nn(e){let a=Ke.get(e);return !!(a?.accepted&&Date.now()<a.until)}function Ul({adapter:e,store:a$1,quote:r,wallet:n,path:o,paymasterUrl:l,invoiceId:i,onSent:c}){let[p,u]=useState("idle"),[y,h]=useState(()=>{let x=Ke.get(a$1),S=x?.unconfirmed&&x.account===n?.address&&Date.now()<x.until,T=i?it(i):null;return S||T?"sentUnconfirmed":null}),g=useEffectEvent(x=>c?.(x));useEffect(()=>{if(!i||Ke.has(a$1))return;let x=it(i);if(!x)return;let S=Promise.reject(new a("sentUnconfirmed","The sponsored payment is not confirmed yet"));S.catch(()=>{});let T=x.at+21e5;Ke.set(a$1,{account:x.account,path:"paymaster",paying:S,until:T,unconfirmed:true,instructions:x.instructions,accepted:true}),e?.followSponsoredCalls?.({batchId:x.batchId,until:T,onLate:f=>{an(i),g({txKey:f,instructions:x.instructions,account:x.account,connectorType:x.connectorType}),a$1.getState().submit({txKey:f,connectorType:x.connectorType,methodId:x.methodId});}});},[i,e,a$1]);let N=useRef(0),[w,v]=useState(null),[C,b]=useState(null),k=async(x,S)=>{let T=++N.current,f=()=>N.current===T;h(null),u(x);try{await S(f);}catch(I){f()&&h(b$1(I));}finally{f()&&u("idle");}};return {status:p,problem:y,askedWallet:w,askedInstructions:C,pay:()=>k("wallet",async x=>{if(!e||!r||!n)return h("unsupported");v(n);let S=Ke.get(a$1),T=S?.path==="relay"&&o==="relay";if(S?.account===n.address&&!T&&Date.now()<S.until){b(S.instructions),await S.paying;return}b(r.instructions);let f={account:n.address,path:o,paying:Promise.resolve(),until:Date.now()+6e5,unconfirmed:!1,instructions:r.instructions,accepted:!1};Ke.set(a$1,f);let I=Ol({adapter:e,store:a$1,quote:r,wallet:n,path:o,paymasterUrl:l,onWalletDone:()=>{o==="paymaster"&&(f.accepted=!0),x()&&u("submitting");},onBatchAccepted:R=>{i&&Wl({invoiceId:i,batchId:R,account:n.address,instructions:r.instructions,connectorType:n.connectorType,methodId:r.methodId,at:Date.now()});},onSent:R=>{i&&an(i),c?.({txKey:R,instructions:r.instructions,account:n.address,connectorType:n.connectorType});}});f.paying=I;let _=()=>{Ke.get(a$1)===f&&Ke.delete(a$1),i&&an(i);};I.then(_,R=>{if(b$1(R)!=="sentUnconfirmed")return _();f.unconfirmed=!0,f.until=Date.now()+21e5;}),await I;}),switchNetwork:()=>k("switching",async()=>{if(!e?.switchChain||!r)return h("unsupported");await e.switchChain(Te(r.instructions));}),dismiss:()=>{N.current++,u("idle");}}}var Dl=100,Fl=300,ct=(e,a)=>e.length>a?`${e.slice(0,a-1)}\u2026`:e,Bl=["paid","underpaid","held","refunded","expired","cancelled","blocked"];function Ll(e){let a=e.error?.code;return !Bl.includes(e.phase)&&a!=="payment_failed"&&a!=="payment_mismatch"}async function Hl({adapter:e,pulsar:a,payment:r,labels:n,merchant:o,invoice:l,amount:i}){if(!a||!e?.pulsarTransaction)return false;let c=l.number?h(n.pay.txDescription,{amount:i,invoice:l.number}):i,p=e.pulsarTransaction({...r,title:ct(h(n.pay.txTitle,{merchant:o}),Dl),description:ct(c,Fl),payload:{quasarInvoice:l.id}});return await a.injectExternalPendingTxs([p]),true}function Kl({store:e,open:a,adapterFor:r,pulsar:n,labels:o,locale:l}){let i=useRef(null),c=useRef(!a),p=useRef({adapterFor:r,pulsar:n,labels:o,locale:l});useEffect(()=>{p.current={adapterFor:r,pulsar:n,labels:o,locale:l};});let u=useCallback(h=>{let{phase:g,error:N,checkout:w}=e.getState();if(!w||!Ll({phase:g,error:N}))return;let{adapterFor:v,pulsar:C,labels:b,locale:k}=p.current,{amount:x,decimals:S,symbol:T}=h.instructions;Hl({adapter:v(h.instructions.family),pulsar:C,payment:h,labels:b,merchant:w.merchant.name,invoice:{id:w.invoice.id,number:w.invoice.number},amount:`${ue(x,S,k)} ${T}`}).catch(()=>{});},[e]),y=useCallback(()=>{c.current=true,i.current&&u(i.current),i.current=null;},[u]);return useEffect(()=>{a?c.current=false:y();},[a,y]),useEffect(()=>y,[y]),useCallback(h=>{c.current?u(h):i.current=h;},[u])}function zl({store:e,state:a,walletTxKey:r=null}){let[n,o]=useState(null),[l,i]=useState(null),c=r!==null&&r!==l;c&&i(r);let p=a.phase,u=c||ea(a)||xa(a,a.checkout)||Ma(a,a.checkout)||p==="confirming"||p==="unconfirmed",y=n?.store===e?n:null,h=u?y&&y.error===a.error?y:{store:e,error:a.error}:y&&ho(a.error)&&a.error!==y.error?null:n;return h!==n&&o(h),h?.store===e}function On(e$1){let{labels:a,customization:r}=ka(),n=r?.labels?.transform,[o,l]=useState(()=>d(e$1)),i=c$1(e$1);i&&o!==d(e$1)&&l(d(e$1));let c=i?d(e$1):o;return useEffect(()=>{if(c$1(e$1))return;let p=true;return e(e$1).then(u=>p&&l(u)),()=>{p=false;}},[e$1]),useMemo(()=>{let p=f(c,a);return n?n(p,{locale:e$1}):p},[c,e$1,a,n])}function Gl({store:e,screen:a}){let[r,n]=useState(null),o=a==="qr";return o&&r!==e&&n(e),o||r===e}function Xt(e){let a=useContext(NovaConnectProviderContext),r=ka(),n=e??r.onConnectWallet;return {canConnect:!!(a||n),connecting:a?.isConnectModalOpen??false,connect:o=>a?(a.setIsConnectModalOpen(true,{adapter:o==="solana"?OrbitAdapter.SOLANA:OrbitAdapter.EVM}),true):n?(n(o),true):false}}var pt=5,jl=2e3;function Ql(){let{checkout:e,state:a$1,store:r,labels:n,locale:o,wallet:l,adapterFor:i,connectFamily:c,setAutoPayOff:p,setAutoPay:u,revokeSent:y,setRevokeSent:h$1}=Y(),[g,N]=useState("idle"),[w,v]=useState(null),C=l?.address,[b,k]=useState(C);b!==C&&(k(C),v(null));let x=e?.autoCharge,S=x?.status==="active"&&!!x.replacement&&eo(a$1.phase);if(!e||x?.status!=="active"||!x.permission||!x.revocation)return null;let{permission:T,revocation:f}=x,I=e.merchant.name,_=T.chainId??"",R=ve(_),P=aa(T.payer??""),E=e.methods.find(A=>A.id===T.methodId),B=i("eip155"),W=!!(l&&Da(l.address,P)),ne=async()=>{N("network");let A=false;for(let U=0;U<pt;U++){let J=await r.getState().permissionRevoked();if(J===true)return p("done");A||=J===false,U<pt-1&&await delay(void 0,jl);}v(A?"notYet":"notAsked");},L=async()=>{if(!l)return;v(null);let A=false;try{if(!y){N("network");let U=await r.getState().permissionRevoked();if(U===!0)return p("done");if(U===null)return v("notAsked");if(!B?.revokePermission)return v("unsupported");if(N("wallet"),!await Ut(B.revokePermission({revocation:f,chainId:_,account:l.address,onSent:()=>{A=!0,h$1(!0),N("network");}}),6e5)&&!A)return v("alreadyPending")}await ne();}catch(U){A?(U instanceof a&&U.kind==="failed"&&h$1(false),await ne().catch(()=>v("notYet"))):v(b$1(U));}finally{N("idle");}},Q={wallet:l?.name??"",network:R},Z=w==="notYet"?n.autoPayOff.notYet:w==="declined"?h(n.pay.declined,Q):w==="unsupported"?h(n.autoPayOff.unsupported,Q):w==="wrongNetwork"||w==="switchFailed"?h(n.pay.switchFailed,Q):w==="notAuthorized"?h(n.pay.notAuthorized,Q):w==="alreadyPending"?h(n.walletPrompt.stillWaiting,Q):w==="failed"?h(n.pay.walletFailed,Q):w?n.error.generic:null,V=E?Number(E.decimals):null;return jsxs(Fragment,{children:[jsxs(me,{title:n.autoPayOff.title,subtitle:h(n.autoPayOff.subtitle,{merchant:I}),children:[jsxs(xe,{children:[jsx(z,{name:n.autoPayOff.wallet,children:jsxs("span",{className:"novapay:inline-flex novapay:items-center novapay:gap-1",children:[jsx(Pe,{hash:P,chainId:_})," \xB7 ",R]})}),T.periodAmount&&V!==null&&E&&jsxs(z,{name:n.autoPayOff.allowed,children:[h(n.autoPay.limit,{amount:`${ue(T.periodAmount,V,o)} ${E.symbol}`})," ",h(n.autoPay.every,{period:Wt(T.periodSeconds??0,o)})]})]}),jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:W?h(n.autoPayOff.fee,{network:R}):h(n.autoPayOff.otherWallet,{wallet:shortAddress(P)})}),Z&&jsx(te,{children:Z})]}),jsxs(ce,{children:[W?jsx(oe,{busy:g!=="idle",onClick:()=>{L();},children:g==="wallet"?h(n.autoPayOff.inWallet,Q):g==="network"?n.autoPayOff.waiting:y?n.autoPayOff.checkAgain:h(n.autoPayOff.confirm,Q)}):jsx(oe,{onClick:()=>{c("eip155");},children:n.autoPayOff.connect}),!W&&l&&S&&jsx(pe,{onClick:()=>{p(null),u(true);},children:n.autoPayOff.useThisWallet}),jsx(pe,{onClick:()=>p(null),children:n.autoPayOff.keep})]})]})}var Vl=e=>e.charAt(0).toUpperCase()+e.slice(1);function Yl(e,a,r){let n=e.startsWith("solana:")?getSolanaCluster(e):void 0;if(!n||n==="mainnet")return null;let o={network:ve(e),cluster:Vl(n),wallet:a?.name??""},l=a?.family!=="solana"?void 0:a.walletId==="phantom"?r.pay.solanaHintPhantom:a.walletId==="solflare"?r.pay.solanaHintSolflare:r.pay.solanaHintOther;return {title:h(r.pay.solanaNetwork,o),text:h(r.pay.solanaNetworkText,o),...l?{hint:h(l,o)}:{}}}function Zl(e,a){let r=e.startsWith("solana:")?getSolanaCluster(e):void 0;return !r||a?.family!=="solana"||getSolanaCluster(a.chainId)===r?null:e}function Jl(e,a){let r=useContext(SatelliteStoreContext),n=Zl(e,a);useEffect(()=>{n&&r?.getState().switchNetwork?.(n);},[r,n]);}function Xl(e,a){return e>=1?ye(e,a):new Intl.NumberFormat(a,{maximumSignificantDigits:6}).format(e)}function ei(e,a,r,n){let o=n?.code;if(r==="declined")return h(e.pay.declined,a);if(r==="unsupported")return h(e.pay.unsupported,a);if(r==="wrongNetwork")return h(e.pay.wrongCluster,a);if(r==="switchFailed")return h(e.pay.switchFailed,a);if(r==="notAuthorized")return h(e.pay.notAuthorized,a);if(r==="alreadyPending")return h(e.walletPrompt.stillWaiting,a);if(r==="sentUnconfirmed")return h(e.pay.sentUnconfirmed,a);let l=r?null:va(n,e,a.merchant);return l!==null?l:r==="failed"?h(e.pay.walletFailed,a):o==="payment_failed"?h(e.pay.failed,a):o==="screening_unavailable"?e.pay.screeningUnavailable:o==="request_failed"?e.pay.noAnswer:o==="price_unavailable"||o==="price_no_rpc"?e.method.priceUnavailable:o==="rate_limited"?e.method.rateLimited:o==="method_not_found"||o==="amount_out_of_range"||o==="testnet_required"?e.method.methodUnavailable:n&&!Ea(n)?e.error.generic:null}var ai=(...e)=>e.reduce((a,r)=>a&&!/[。!?]$/.test(a)?`${a} ${r}`:`${a}${r}`,"");function ni(e,a,r){let{wallet:n,adapterFor:o}=Y(),l=a?.instructions.family,i=l?o(l):void 0,c=e.filter(u=>u.id!==a?.methodId&&We(u)===l),p=fa(r&&i&&n&&c.length?`${n.address}:${c.map(u=>u.id).join()}`:null,()=>Promise.all(c.map(u=>i.getBalance({chainId:u.chainId,account:n.address,token:Jr(u)}).catch(()=>0n))));return p?c.map((u,y)=>({method:u,balance:p[y]})).filter(u=>u.balance>0n):[]}function ti(){let{checkout:e,state:a,store:r,labels:n,locale:o,now:l,wallet:i,adapterFor:c,connectWallet:p,backToMethods:u,onPaymentSent:y,customization:h$1,lockPrice:g,display:N}=Y(),w=h$1.config?.balanceCheck!==false,v=a.quote,C=e?.methods??[],b=C.find(fe=>fe.id===v?.methodId),k=v?.instructions.family??"eip155",x=c(k),S=v?Te(v.instructions):"",T=i?.address??"",[f,I]=useState(false),_=fa(v?.gasless?.paymaster&&x?.canSponsorCalls&&i?`${S}:${T}`:null,()=>x.canSponsorCalls({chainId:S,account:T})),R=v?ol(v,{withGas:f,canSponsorCalls:_===true}):"transfer",P=St(w&&v&&x&&i?`${S}:${T}:${v.instructions.token}`:null,()=>x.getBalance({chainId:S,account:T,token:v.instructions.token}),v?.expiresAt),E=fa(v&&R==="transfer"&&x?.estimateFee&&i?`${S}:${T}:${v.amountToSend}`:null,()=>x.estimateFee({instructions:v.instructions,account:T})),B=Ul({adapter:x,store:r,quote:v,wallet:i,path:R,paymasterUrl:a.paymasterUrl,invoiceId:e?.invoice.id,onSent:y}),W=Yt({adapter:x,store:r,wallet:i,chainId:S});Jl(S,i);let ne=v?.instructions.token==="native",L=v&&typeof P=="bigint"?sl(P,v,ne&&E?E.amount:0n):null,Q=(a.invoiceStatus??e?.invoice.status)==="underpaid",Z=ni(C,v,w&&!!L&&!Q),[V,A]=useState(false),U=W.step==="switching"||W.step==="signing"||B.status==="switching"||B.status==="submitting"||B.status==="wallet"||a.phase==="submitting",[J,$]=gn(U);if(e&&v&&!b)return jsxs(Fragment,{children:[jsx(me,{title:n.method.methodUnavailable,children:null}),jsx(ce,{children:jsx(pe,{onClick:u,children:n.pay.back})})]});if(!e||!v||!b)return null;let O=e.merchant.name,M=ve(S),K=fe=>`${ue(fe,v.decimals,o)} ${v.instructions.symbol}`,G=ll(v),j=B.askedInstructions,ae=j&&j.amount!==v.instructions.amount?`${ue(j.amount,j.decimals,o)} ${j.symbol}`:K(G.send),le=v.expiresAt?Date.parse(v.expiresAt)-l:Number.POSITIVE_INFINITY,de=le<=0,he=yo(le),Oe=a.phase==="quoting",qe=e.invoice.amountPaid?null:il(v,e.invoice.totalMinor),$e=(a.invoiceStatus??e.invoice.status)==="underpaid",na=N==="page",ta=E?Tt(String(E.amount),E.decimals,o):null,Ue=$e?Cn(v,l,n,O,o):null,ra=e.invoice.totalMinor?ye(Ie(e.invoice.totalMinor),o):null,De=!!(i&&v.payer&&ze(i,b)===v.payer),oa=k==="eip155"&&i&&i.chainId!==S&&!!x?.switchChain,Fe=B.status!=="idle"||a.phase==="submitting"||Oe||W.step!=="idle",Be=Yl(S,i,n),la=()=>{r.getState().requestQuote();},Ge=a.payerProof,Re=Ao(Ge,R),Pa=Re?In(sn(a.error)?a.error:null,W.problem,n,{wallet:i?.name??"",network:M,merchant:O}):null,Sa=ei(n,{wallet:i?.name??"",network:M,merchant:O},B.problem,a.phase==="awaitingPayment"&&!(Re&&sn(a.error))?a.error:void 0),ia=()=>{p(b)||A(true);},Se;de?Se={label:$e?n.outcome.payRest:n.pay.newPrice,run:la}:De?oa?Se={label:h(n.pay.switchTo,{network:M}),run:()=>{B.switchNetwork();}}:Re?Se={label:n.payerProof.confirmToPay,run:()=>{W.confirm();}}:Se={label:h(R==="transfer"?n.pay.payAmount:n.pay.signToPay,{amount:K(G.send)}),run:()=>{h$1.handlers?.onSubmit?h$1.handlers.onSubmit({quote:v,method:b,proceed:B.pay}):B.pay();},disabled:!!L||B.problem==="sentUnconfirmed"}:Se={label:n.pay.connect,run:ia};let Ze=W.step==="switching"?"switch":W.step==="signing"?"proof":B.status==="switching"?"switch":B.status==="submitting"||a.phase==="submitting"?"submitting":B.status==="wallet"?R==="transfer"?"confirm":"sign":null,sa=e.invoice.number??e.invoice.id,Ne=i??B.askedWallet,Ga={wallet:Ne?.name??"",invoice:sa,merchant:O};return jsxs("div",{className:"novapay:relative novapay:flex novapay:flex-1 novapay:flex-col",children:[jsxs("div",{ref:J,inert:U,className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col",U&&"novapay:hidden"),children:[jsxs("section",{className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col novapay:gap-3 novapay:px-5 novapay:py-4",na&&"novapay-page-screen novapay-page-pay"),children:[jsx("h2",{...Ba,className:"novapay:sr-only",children:n.pay.title}),i&&jsxs("div",{className:"novapay:flex novapay:items-center novapay:gap-2.5 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:px-3 novapay:py-2",children:[jsx("span",{className:"novapay:h-7 novapay:w-7 novapay:shrink-0",children:jsx(An,{walletId:i.walletId,icon:i.icon})}),jsxs("span",{className:"novapay:flex novapay:min-w-0 novapay:flex-1 novapay:flex-col",children:[jsx("span",{className:"novapay:text-[13px] novapay:font-semibold",children:i.name}),jsx("span",{className:cn$1(F,"novapay:truncate novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]"),children:h(n.pay.walletLine,{address:shortAddress(i.address),network:ve(i.chainId)})})]}),jsx("button",{type:"button","aria-label":n.pay.changeWallet,onClick:ia,className:cn$1("novapay:min-h-6 novapay:cursor-pointer novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-transparent novapay:px-2.5 novapay:py-1 novapay:text-xs novapay:font-semibold novapay:text-[var(--tuwa-text-primary)] novapay:hover:bg-[var(--tuwa-bg-muted)]",ie),children:n.pay.change})]}),oa&&De&&!de&&jsxs("div",{role:"status",className:"novapay:flex novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:bg-[var(--tuwa-pending-bg)] novapay:px-3 novapay:py-2 novapay:text-xs novapay:text-[var(--tuwa-pending-text)]",children:[jsx(ExclamationTriangleIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4 novapay:shrink-0"}),jsxs("span",{children:[jsx("strong",{className:"novapay:block",children:n.pay.wrongNetwork}),h(n.pay.wrongNetworkText,{current:ve(i.chainId),network:M})," ",n.pay.switchHint]})]}),Be&&!de&&jsxs("div",{className:"novapay:flex novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:px-3 novapay:py-2 novapay:text-xs",children:[jsx(InformationCircleIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4 novapay:shrink-0 novapay:text-[var(--tuwa-text-secondary)]"}),jsxs("span",{className:"novapay:flex novapay:flex-col novapay:gap-0.5",children:[jsx("strong",{children:Be.title}),jsx("span",{children:Be.text}),Be.hint&&jsx("span",{className:"novapay:text-[var(--tuwa-text-secondary)]",children:Be.hint})]})]}),jsxs("div",{children:[jsx("span",{className:"novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:$e?n.pay.youSendRest:n.pay.youSend}),jsxs("div",{className:cn$1("novapay:flex novapay:items-baseline novapay:gap-2",na&&"novapay-page-amount-row"),children:[jsx("span",{className:cn$1(F,"novapay:text-[28px] novapay:font-bold novapay:leading-tight",na&&"novapay-page-amount"),children:ue(G.send,v.decimals,o)}),jsx("span",{className:cn$1(F,"novapay:text-sm novapay:font-semibold"),children:v.instructions.symbol}),jsx(qn,{text:_t(G.send,v.decimals),label:n.pay.copyAmount,copiedLabel:n.pay.copied})]}),jsxs("span",{className:"novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:[h(n.pay.onNetwork,{network:M}),ra&&!G.fee&&!$e&&jsxs(Fragment,{children:[" \xB7 ",h(n.pay.fiatValue,{amount:ra,currency:e.invoice.currency})]})]})]}),G.fee&&jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-1.5",children:[jsxs(xe,{children:[jsx(z,{name:$e?n.pay.invoiceRest:n.pay.invoiceTotal,children:ue(G.receives,v.decimals,o)}),jsx(z,{name:h(n.pay.transferFee,{percent:G.fee.percent}),children:ue(G.fee.amount,v.decimals,o)}),jsx(z,{name:h(n.pay.merchantReceives,{merchant:O}),children:K(G.receives)})]}),jsx("p",{className:"novapay:m-0 novapay:text-[11px] novapay:text-[var(--tuwa-text-secondary)]",children:n.pay.transferFeeNote})]}),!de&&jsxs("div",{className:"novapay:flex novapay:items-center novapay:gap-2 novapay:text-xs",children:[jsx(ClockIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4 novapay:text-[var(--tuwa-text-secondary)]"}),jsx("span",{role:"timer","aria-live":"off",className:"novapay:flex-1",children:h(Ue?n.pay.restTimeLeft:n.pay.priceLocked,{time:Qe(le)})}),!$e&&jsx(wa,{disabled:Oe,onClick:la,children:n.pay.refreshPrice})]}),he&&!Ue&&jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-text-accent)] novapay:px-3 novapay:py-2",children:[jsx("span",{"aria-hidden":true,className:"novapay:text-xs",children:h(n.pay.priceEnding,{time:Qe(le)})}),jsx("span",{role:"status",className:"novapay:sr-only",children:h(n.pay.priceEnding,{time:Qe($t)})}),jsx("button",{type:"button",onClick:la,disabled:Oe,className:cn$1(F,"novapay:min-h-8 novapay:cursor-pointer novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border-0 novapay:bg-[var(--tuwa-button-primary-bg)] novapay:px-3 novapay:text-xs novapay:font-bold novapay:text-[var(--tuwa-text-on-accent)] novapay:disabled:opacity-70",ie),children:h(n.pay.keepPrice,{minutes:Math.round(e.quoteTtlSeconds/60)})})]}),de&&jsx(te,{children:n.pay.priceExpired}),Ue&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:Ue}),L&&!de&&jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:px-3 novapay:py-2 novapay:text-xs",children:[jsxs("div",{role:"alert",children:[jsx("strong",{className:"novapay:block",children:n.pay.notEnough}),h(n.pay.walletHas,{amount:K(L.have),network:M}),"."," ",h(n.pay.shortBy,{short:K(L.short),need:K(L.need)})]}),Z.length>0&&jsxs("div",{className:"novapay:flex novapay:flex-col novapay:gap-1.5",children:[jsx("span",{className:"novapay:text-[var(--tuwa-text-secondary)]",children:n.pay.payFromBalance}),Z.map(({method:fe,balance:ja})=>jsxs("button",{type:"button",onClick:()=>{let Qa=i?ze(i,fe):null;r.getState().selectMethod(fe.id),r.getState().setPayer(Qa),g();},className:cn$1("novapay:flex novapay:cursor-pointer novapay:items-center novapay:justify-between novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-transparent novapay:px-2.5 novapay:py-1.5 novapay:text-left novapay:text-xs novapay:text-[var(--tuwa-text-primary)] novapay:hover:bg-[var(--tuwa-bg-muted)]",ie),children:[jsxs("span",{className:"novapay:font-semibold",children:[fe.symbol," \xB7 ",ve(fe.chainId)]}),jsx("span",{className:cn$1(F,"novapay:text-[var(--tuwa-text-secondary)]"),children:h(n.pay.youHave,{amount:`${ue(String(ja),fe.decimals,o)} ${fe.symbol}`})})]},fe.id))]}),e.merchant.fundingUrl&&jsxs("span",{children:[h(n.pay.topUp,{symbol:v.instructions.symbol})," ",jsxs("a",{href:e.merchant.fundingUrl,target:"_blank",rel:"noopener noreferrer",className:cn$1("novapay:text-[var(--tuwa-text-accent)] novapay:underline",ie),children:[h(n.pay.getToken,{symbol:v.instructions.symbol})," \u2197"]})]})]}),jsxs(xe,{children:[qe!==null&&jsx(z,{name:n.pay.rate,children:h(n.pay.rateValue,{symbol:v.instructions.symbol,price:Xl(qe,o),currency:e.invoice.currency})}),jsx(z,{name:n.pay.networkFee,children:jsxs("span",{className:"novapay:inline-flex novapay:flex-col novapay:items-end novapay:gap-0.5",children:[R!=="transfer"?jsx("span",{className:"novapay:text-[var(--tuwa-success-text)]",children:h(n.pay.merchantPaysGas,{merchant:O})}):ta?h(n.pay.gasEstimate,{amount:`${ta} ${E?.symbol}`}):n.pay.gasFromWallet,v.gasless&&jsx(wa,{onClick:()=>I(!f),children:f?h(n.pay.payGasless,{merchant:O}):n.pay.payWithGas})]})}),jsxs(z,{name:n.pay.to,children:[jsx(Pe,{hash:v.instructions.to,chainId:S}),jsx("span",{className:"novapay:font-sans novapay:text-[var(--tuwa-text-secondary)]",children:O})]})]}),Re&&!de&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:n.payerProof.payNote}),Pa&&jsx(te,{children:Pa}),Sa&&jsx(te,{children:Sa}),V&&jsx(te,{children:n.pay.connectUnavailable})]}),jsxs(ce,{children:[jsx(oe,{busy:Fe,disabled:Se.disabled,onClick:Se.run,children:Se.label}),jsx(pe,{disabled:Oe,onClick:u,children:$e?n.pay.backFromRest:n.pay.back}),jsx(ge,{children:ai(h(n.pay.disclaimer,{merchant:O}),...vo(e)?[h(n.pay.disclaimerScreening,{merchant:O})]:[])}),jsx(En,{})]})]}),Ze==="proof"&&jsx(Wa,{kind:"proof",walletName:Ne?.name??"",walletId:Ne?.walletId??"",walletIcon:Ne?.icon,amount:ae,merchant:O,network:M,to:shortAddress(v.instructions.to),priceTime:null,text:h(Ot(i)?n.payerProof.promptPasskey:n.payerProof.promptText,Ga),details:[...W.request?[{name:n.payerProof.site,value:W.request.domain}]:[],{name:n.payerProof.invoice,value:sa},{name:n.payerProof.merchant,value:O}],hint:W.request?h(n.payerProof.signInRequest,{wallet:Ne?.name??"",site:W.request.domain}):void 0,onRetry:()=>{W.confirm();},onCancel:W.dismiss,stepHeight:$}),Ze&&Ze!=="proof"&&jsx(Wa,{kind:Ze,walletName:Ne?.name??"",walletId:Ne?.walletId??"",walletIcon:Ne?.icon,amount:ae,merchant:O,network:M,to:shortAddress(v.instructions.to),priceTime:de?null:Qe(le),onRetry:R==="relay"?()=>{B.pay();}:void 0,onCancel:W.step==="switching"?W.dismiss:B.dismiss,stepHeight:$})]})}var tn=4;function ri(e){let{size:a,data:r}=encode(e,{ecc:"M",border:0}),n="";return r.forEach((o,l)=>o.forEach((i,c)=>{i&&(n+=`M${c+tn} ${l+tn}h1v1h-1z`);})),{size:a+tn*2,path:n}}function er({value:e,label:a,className:r}){let n=Y(),o=cn$1(r,se(n,"qrCode")),{size:l,path:i}=useMemo(()=>ri(e),[e]),c=n.customization.components?.QrCode;return c?jsx(c,{value:e,label:a,className:o}):jsxs("svg",{role:"img","aria-label":a,viewBox:`0 0 ${l} ${l}`,shapeRendering:"crispEdges",className:cn$1("novapay:block novapay:rounded-[var(--tuwa-rounded-corners)]",o),children:[jsx("rect",{width:l,height:l,fill:"#ffffff"}),jsx("path",{d:i,fill:"#111827"})]})}function oi({payUrl:e}){let{labels:a,backToMethods:r,display:n}=Y();return jsxs(Fragment,{children:[jsx(me,{title:a.qr.handoffTitle,subtitle:a.qr.handoffHint,children:jsxs("div",{className:"novapay:flex novapay:flex-col novapay:items-center novapay:gap-3 novapay:py-2",children:[jsx(er,{value:e,label:a.qr.handoffCode,className:cn$1("novapay:h-48 novapay:w-48",n==="page"&&"novapay-page-qr-handoff")}),jsx(qn,{text:e,label:a.qr.copyLink,copiedLabel:a.pay.copied,children:a.qr.copyLink}),jsx("p",{className:"novapay:m-0 novapay:max-w-xs novapay:text-center novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:a.qr.handoffNote})]})}),jsx(ce,{children:jsx(pe,{onClick:r,children:a.qr.back})})]})}function li(){let e=Y(),{checkout:a,state:r,store:n,labels:o,locale:l,now:i,payUrl:c,backToMethods:p}=e,u=r.quote;if(!a)return null;if(!u||u.instructions.family!=="solana")return c?jsx(oi,{payUrl:c}):null;let{instructions:y}=u,h$1=ve(Te(y)),g=`${ue(u.amountToSend,u.decimals,l)} ${y.symbol}`,N=u.expiresAt?Date.parse(u.expiresAt)-i:Number.POSITIVE_INFINITY,w=N<=0,v=r.phase==="quoting",C=(r.invoiceStatus??a.invoice.status)==="underpaid",b=C?Cn(u,i,o,a.merchant.name,l):null,k=C?a.invoice.originWallet:null,x=k?h(o.qr.restHint,{wallet:shortAddress(aa(k))}):o.qr.solanaHint;return jsxs(Fragment,{children:[jsxs(me,{title:o.qr.solanaTitle,subtitle:x,children:[jsxs("div",{className:"novapay:flex novapay:flex-col novapay:items-center novapay:gap-4 novapay:@min-[440px]:flex-row novapay:@min-[440px]:items-start",children:[jsx(er,{value:y.solanaPayUrl,label:h(o.qr.solanaCode,{amount:g}),className:cn$1("novapay:h-44 novapay:w-44 novapay:shrink-0",e.display==="page"&&"novapay-page-qr",w&&"novapay:opacity-30")}),jsxs("div",{className:"novapay:flex novapay:min-w-0 novapay:flex-col novapay:gap-2 novapay:self-stretch novapay:text-xs novapay:@min-[440px]:self-auto",children:[jsxs("ol",{className:"novapay:m-0 novapay:flex novapay:list-decimal novapay:flex-col novapay:gap-1 novapay:pl-4",children:[jsx("li",{children:o.qr.scanStep}),jsx("li",{children:o.qr.approveStep})]}),C&&jsx("span",{className:"novapay:text-[var(--tuwa-text-secondary)]",children:o.pay.youSendRest}),jsxs("div",{className:"novapay:flex novapay:items-baseline novapay:gap-2",children:[jsx("span",{className:cn$1(F,"novapay:text-2xl novapay:font-bold"),children:ue(u.amountToSend,u.decimals,l)}),jsx(qn,{text:_t(u.amountToSend,u.decimals),label:o.pay.copyAmount,copiedLabel:o.pay.copied})]}),jsxs("div",{className:cn$1(F,"novapay:flex novapay:items-center novapay:gap-1 novapay:text-[var(--tuwa-text-secondary)]"),children:[y.symbol," \xB7 ",h$1," \xB7"," ",jsx(Pe,{hash:y.to,chainId:Te(y)})]}),!w&&jsxs(Fragment,{children:[jsxs("span",{role:"status",className:"novapay:flex novapay:items-center novapay:gap-1.5",children:[jsx(QuasarLoader,{size:14,accent:"var(--tuwa-pending-icon)"}),o.qr.waiting]}),jsx("span",{role:"timer","aria-live":"off",className:"novapay:text-[var(--tuwa-text-secondary)]",children:h(b?o.pay.restTimeLeft:o.pay.priceLocked,{time:Qe(N)})})]})]})]}),w&&jsx(te,{children:o.pay.priceExpired}),b&&jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:b}),jsxs("p",{className:"novapay:m-0 novapay:flex novapay:gap-2 novapay:rounded-[var(--tuwa-rounded-corners)] novapay:bg-[var(--tuwa-pending-bg)] novapay:px-3 novapay:py-2 novapay:text-xs novapay:text-[var(--tuwa-pending-text)]",children:[jsx(ExclamationTriangleIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4 novapay:shrink-0"}),o.qr.exchangeWarning]})]}),jsxs(ce,{children:[w?jsx(oe,{busy:v,onClick:()=>{n.getState().requestQuote();},children:C?o.outcome.payRest:o.pay.newPrice}):jsx("a",{href:y.solanaPayUrl,className:cn$1(La,se(e,"primaryButton")),children:o.qr.openInWallet}),jsx(pe,{onClick:p,children:C?o.pay.backFromRest:o.qr.back})]})]})}function ii(e){switch(e){case "confirm":return "pending";case "unconfirmed":case "underpaid":return "warning";case "paid":return "success";case "blocked":case "error":return "error";case "held":case "refunded":case "expired":case "cancelled":case "replaced":return "neutral";default:return null}}function si(){let{labels:e}=Y();return jsxs("div",{role:"status",className:"novapay:flex novapay:flex-1 novapay:flex-col novapay:items-center novapay:justify-center novapay:gap-3 novapay:p-8 novapay:text-sm novapay:text-[var(--tuwa-text-secondary)]",children:[jsx(QuasarLoader,{size:48}),e.common.loading]})}function ci(){let{labels:e,state:a,store:r}=Y(),n=a.error?.code==="checkout_not_found";return jsxs("div",{role:"alert",className:"novapay:flex novapay:flex-1 novapay:flex-col novapay:items-center novapay:justify-center novapay:gap-3 novapay:p-8 novapay:text-center",children:[jsx(ExclamationTriangleIcon,{"aria-hidden":true,className:"novapay:h-7 novapay:w-7 novapay:text-[var(--tuwa-error-icon)]"}),jsx("h2",{...Ba,className:ga,children:e.error.title}),jsx("p",{className:"novapay:m-0 novapay:max-w-sm novapay:text-[13px] novapay:text-[var(--tuwa-text-secondary)]",children:n?e.error.notFound:e.error.generic}),!n&&jsx(pe,{onClick:()=>{r.getState().load();},className:"novapay:w-auto novapay:px-6",children:e.common.retry})]})}var pi=new Set(["paid","partially_refunded","refunded"]);function dt(){let{screen:e,customization:a}=Y(),r=a.components?.screens?.[e];return r?jsx(r,{screen:e}):e==="loading"?jsx(si,{}):e==="error"?jsx(ci,{}):e==="buyer"?jsx(jo,{}):e==="method"?jsx(fl,{}):e==="confirmWallet"?jsx(yl,{}):e==="pay"?jsx(ti,{}):e==="qr"?jsx(li,{}):e==="confirm"?jsx(ul,{}):e==="paid"?jsx(Il,{}):e==="autoPay"?jsx(Wo,{}):e==="autoPayOff"?jsx(Ql,{}):jsx(Pl,{kind:e})}function di({className:e,withDetails:a,leave:r}){let n=Y(),{checkout:o,locale:l,labels:i,now:c,customization:p,display:u}=n,{Header:y=tl,Summary:h$1=el,CompactSummary:g=al}=p.components??{},N=p.config?.deadlineAnnouncements,{screen:w}=n,v=useRef(null),C=useRef(w);useEffect(()=>{let P=C.current;C.current=w;let E=v.current;if(!E||P===w||P==="loading")return;let B=E.ownerDocument.activeElement;if(B&&B!==E.ownerDocument.body&&!E.contains(B))return;let W=E.querySelector("[data-novapay-scroll] [data-novapay-heading]");if(u!=="page")return W?.focus();E.getBoundingClientRect().top<0&&E.scrollIntoView({block:"start"}),W?.focus({preventScroll:true});},[w,u]);let[b,k]=useState(""),x=useRef(null),S=o?.invoice.dueAt?Date.parse(o.invoice.dueAt):null,T=o?kn(o.invoice.status,w,o.invoice.restPayable)==="paying":false;useEffect(()=>{if(S===null)return;let P=S-c,E=co(x.current,P,N);x.current=P,E!==null&&T&&k(E===1?i.summary.oneMinuteLeft:h(i.summary.minutesLeft,{minutes:E}));},[S,c,i,N,T]);let f=u==="page",I=Mo[f?"page":"default"],_=ii(w),R=p.components?.StatusEdge??StatusEdge;return jsxs("div",{ref:v,lang:l,className:cn$1(I.frame,_n(u).frame,e),children:[o&&jsx("aside",{inert:!!r,className:cn$1(I.aside,se(n,"summary")),children:jsx(h$1,{})}),jsxs("div",{inert:!!r,className:cn$1("novapay:relative",I.main),children:[_&&jsx(R,{tone:_,className:cn$1("novapay:z-20",se(n,"statusEdge",{tone:_}))}),jsx(y,{withDetails:a}),jsxs("div",{className:"novapay:sm:hidden",children:[o&&jsx(g,{className:se(n,"compactSummary")}),jsx(rl,{withDetails:a})]}),jsx("div",{"data-novapay-scroll":"",className:cn$1(I.area,se(n,"body")),children:f?jsx("div",{className:cn$1("novapay:flex novapay:flex-1 novapay:flex-col",!p.config?.animation?.disabled&&"novapay-page-fade"),children:jsx(dt,{})},_?"status":w):jsx(dt,{})})]}),jsx("div",{role:"status","aria-live":"polite",className:"novapay:sr-only",children:b}),r&&jsx(vl,{onStay:r.onStay,onLeave:r.onLeave})]})}function ji({token:e,display:a="modal",open:r=true,onOpenChange:n,onClose:o,baseUrl:l,api:i,EventSource:c,pollMs:p,payUrl:u,onConnectWallet:y,onPaid:h$1,autoReturnSeconds:g,onContact:N,className:w,customization:v}){let C=ka(),[b,k]=useState({from:e,token:e}),x=b.from===e?b.token:e,[S,T]=useState(a!=="modal"||r);!S&&(a!=="modal"||r)&&T(true);let f=ql({token:x,baseUrl:l??C.baseUrl,api:i,EventSource:c,pollMs:p,enabled:S}),I=$l(f,re=>re),_=I.checkout,R=I.locale??_?.invoice.locale??"en",P=On(R),E=!!_&&S&&To(I.phase,g,c$1(R)),B=El(1e3,E)-(I.clockSkewMs??0),W=Zt(),ne=Xt(y),L=C.adapters,[Q,Z]=useState("wallet"),[V,A]=useState(false),[U,J]=useState(false),[$,O]=useState(null),[M,K]=useState(false),[G,j]=useState(null);_&&G?.store!==f&&j({store:f,paid:pi.has(_.invoice.status)});let[ae,le]=useState(false),[de,he]=useState(false),[Oe,qe]=useState(x);Oe!==x&&(qe(x),A(false),J(false),O(null),K(false),Z("wallet"),he(false));let $e=I.payerProof==="confirmed"&&!!I.error,na=I.error?.code==="payer_mismatch";de&&(I.phase==="awaitingPayment"||$e||na)&&he(false);let ta=(I.invoiceStatus??_?.invoice.status)==="underpaid"?_?.invoice.originWallet??null:null,Ue=re=>!ta||Da(re,ta),ra=_?.methods.find(re=>re.id===I.methodId),De=ra?ze(W,ra):null,oa=uo({open:de,storePayer:I.payer,payer:De,paysRest:!De||Ue(De)});oa==="leave"&&he(false);let Fe=useRef(null),[Be,la]=useState(false);!Be&&_&&c$1(R)&&la(true);let Ge=ao(I,{payWith:Q,handoff:V,autoPay:U,autoPayOff:$==="open",confirmWallet:de,labelsReady:Be||!_}),Re=async()=>{await qo(f,he);},Pa=Ml(f),Sa=Gl({store:f,screen:Ge}),[ia,Se]=useState(null),Ze=zl({store:f,state:I,walletTxKey:ia?.store===f?ia.txKey:null});Sl(I.phase,_?.invoice,h$1,G?.store===f&&G.paid),Tl({state:I,screen:Ge,now:B,handlers:v?.handlers});let sa=re=>L?.find(Me=>Me.family===re),Ne=Kl({store:f,open:a!=="modal"||r,adapterFor:sa,pulsar:C.pulsar,labels:P,locale:R}),Ga=useCallback(re=>{Se({store:f,txKey:re.txKey}),Ne(re);},[f,Ne]),fe=useEffectEvent(()=>{if(!_)return;let{quote:re,phase:Me}=f.getState();if(W&&Fe.current){let Ia=_.methods.find(sr=>sr.id===Fe.current),Ja=Ia?ze(W,Ia):null;if(!Ja)return;Fe.current=null,f.getState().setPayer(Ja),Ue(Ja)&&Re();return}if(Me==="selectMethod"||Me==="underpaid"||Me==="blocked"){if(I.payer===null||De===I.payer)return;f.getState().setPayer(De),oa==="follow"&&Re();return}if(!W)return;let ca=_.methods.find(Ia=>Ia.id===re?.methodId),Ca=ca?ze(W,ca):null,Bn=po({autoPayOffOpen:$==="open",phase:Me,quotePayer:re?.payer,payer:Ca});if(Bn==="release")return f.getState().releaseQuote();Bn==="keep"||!Ca||(f.getState().setPayer(Ca),Ue(Ca)&&Re());}),ja=I.quote?.payer,Qa=!!_;useEffect(()=>fe(),[W?.address,W?.chainId,W?.connectorType,$,I.phase,ja,Qa]),useEffect(()=>{ne.connecting||(Fe.current=null);},[ne.connecting]);let[Un,rr]=useState(false);Ge==="buyer"&&!Un&&rr(true);let Va=useMemo(()=>a==="modal"?()=>{n?.(false),o?.();}:o,[a,n,o]),or=Va&&(()=>Qn(f.getState().phase,f.getState().error,f.getState().invoiceStatus)&&!nn(f)?le(true):Va()),lr=ae?{onStay:()=>le(false),onLeave:()=>{le(false),f.getState().releaseQuote(),Va?.();}}:null,Dn=v??{},ir={store:f,state:I,checkout:_,screen:Ge,locale:R,labels:P,now:B,handedOverAt:Pa,qrShown:Sa,paymentSent:Ze||nn(f),close:or,wallet:W,payWith:Q,setPayWith:Z,payUrl:u,connectWallet:re=>{let Me=We(re);Fe.current=re.id;let ca=Me!==null&&ne.connect(Me);return ca||(Fe.current=null),ca},connectFamily:re=>ne.connect(re),openedPaid:G?.store===f&&G.paid,revokeSent:M,setRevokeSent:K,adapterFor:sa,handoff:V,setHandoff:A,backToMethods:()=>{A(false),he(false),f.getState().releaseQuote();},confirmWallet:de,setConfirmWallet:he,lockPrice:Re,onPaymentSent:Ga,autoPay:U,setAutoPay:J,autoPayOff:$,setAutoPayOff:O,openInvoice:re=>k({from:e,token:re}),onContact:N,autoReturnSeconds:g??(a==="modal"?0:5),display:a,customization:Dn},Ya=cn$1(w,se({customization:Dn,screen:Ge,state:I,checkout:_},"container")),Za=jsx(zr,{value:ir,children:jsx(MotionConfig,{reducedMotion:v?.config?.animation?.disabled?"always":"user",children:jsx(di,{withDetails:Un,leave:lr,className:a==="modal"?Ya:void 0})})});if(a==="modal")return jsx(Dialog,{open:r,onOpenChange:re=>{if(!re&&ae)return le(false);if(!re&&Qn(f.getState().phase,f.getState().error,f.getState().invoiceStatus)&&!nn(f))return le(true);n?.(re),re||o?.();},children:jsxs(DialogContent,{className:"novapay:w-full novapay:sm:w-auto",children:[jsx(DialogTitle,{className:"novapay:sr-only",children:h(P.common.dialogTitle,{merchant:_?.merchant.name??""})}),Za]})});let Fn=h(P.common.dialogTitle,{merchant:_?.merchant.name??""});return a==="page"?jsx(ui,{label:Fn,className:Ya,children:Za}):jsx("section",{"aria-label":Fn,className:cn$1("novapay:overflow-hidden novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)]",_n(a).section,Ya),children:Za})}function ui({label:e,className:a,children:r}){return jsx("div",{className:"novapay-page",children:jsx("section",{"aria-label":e,className:cn$1(_n("page").section,"novapay-page-block",a),children:r})})}function yi(e){if(!e.to)return null;let a=parseCaip19AssetId(e.assetId),r={to:e.to,token:!a||a.assetNamespace==="slip44"?"native":a.assetReference,amount:e.amount,decimals:e.decimals,symbol:e.symbol},n=Nn(e.chainId);if(n==="solana")return {family:n,chainId:e.chainId,...r,reference:"",solanaPayUrl:""};let o=n==="eip155"?toEvmChainId(e.chainId):void 0;return o===void 0?null:{family:"eip155",chainId:o,...r}}function ut(e){let a=b$1(e);return a==="switchFailed"?"wrongNetwork":a==="notAuthorized"||a==="alreadyPending"||a==="sentUnconfirmed"?"failed":a}var rn=new WeakMap,Je=new WeakMap;function vi({store:e,invoiceId:a,invoice:r,params:n,open:o,labels:l,locale:i,onConnectWallet:c}){let p=useStore(e),{adapters:u,pulsar:y}=ka(),h$1=Zt(),g=Xt(c),[N,w]=useState("idle"),[v,C]=useState(null),[,b]=useState(0),k=Je.has(e),x=useRef(0),S=useRef(o),T=p.sentTransaction?.txHash??p.refund?.txHash??null,f=p.instructions?yi(p.instructions):null,I=f?.family??null,_=f?Te(f):p.instructions?.chainId??null,R=u?.find(M=>M.family===I),P=h$1&&h$1.family===I?h$1:null,E=_?ve(_):"",B=v&&v.account===P?.address?v.problem:null,W=M=>C(M?{problem:M,account:P?.address}:null),ne=!!(P&&I==="eip155"&&_&&P.chainId!==_),L=p.instructions,Q=L?`${ue(L.amount,L.decimals,i)} ${L.symbol}`:"",Z=St(f&&P&&R?`balance|${_}|${P.address}|${f.token}`:null,()=>R.getBalance({chainId:_,account:P.address,token:f.token}),p.refund?.id),V=fa(f&&P&&R?.estimateFee?`fee|${_}|${P.address}|${f.token}`:null,()=>R.estimateFee({instructions:f,account:P.address}));useEffect(()=>{!n||rn.get(e)===a||e.getState().phase!=="idle"||(rn.set(e,a),e.getState().start(a,n));},[n,e,a]),useEffect(()=>{o&&!S.current&&!n&&e.getState().phase==="confirmed"&&e.getState().reset(),S.current=o;},[o,n,e]),useEffect(()=>(e.getState().keepFollowing(),()=>e.getState().stopFollowing()),[e]),useEffect(()=>{let M=true;return Je.get(e)?.settled.then(()=>{M&&b(K=>K+1);}),()=>{M=false;}},[e]);let A=async(M,K,G)=>{if(!y||!R?.pulsarTransaction||!p.refund)return;let j={invoice:r??a,amount:Q};try{await y.injectExternalPendingTxs([R.pulsarTransaction({txKey:M,instructions:G,account:K.address,connectorType:K.connectorType,title:h(l.refund.txTitle,j),description:h(p.refund.heldTransfer?l.refund.txDescriptionSender:l.refund.txDescription,j),payload:{quasarRefund:p.refund.id}})]);}catch{}},U=async()=>{if(W(null),!(!ne||!R?.switchChain))try{w("switching"),await R.switchChain(_);}catch(M){W(ut(M));}finally{w("idle");}},J=async()=>{if(W(null),!f)return W("noRecipient");if(!P||!R)return W("unsupported");if(p.sentTransaction){await e.getState().submit(p.sentTransaction);return}let M=BigInt(f.amount)+(f.token==="native"&&V?V.amount:0n);if(typeof Z=="bigint"&&Z<M)return W("notEnough");if(I&&f.to&&isSameAddress(I,P.address,f.to))return W("fromBuyer");if(!await e.getState().recheck()){let j=e.getState(),ae=j.error?.code==="refund_repriced";j.phase==="awaitingTransfer"&&!j.sentTransaction&&!ae&&W("unreachable");return}let K=++x.current,G=()=>x.current===K;try{ne&&R.switchChain&&(w("switching"),await R.switchChain(_)),G()&&w("wallet");let j=await R.sendTransfer({instructions:f,account:P.address,connection:P.connection});G()?w("idle"):C(null),A(j,P,f),await e.getState().submit({txHash:j,from:P.address});}catch(j){G()?(w("idle"),W(ut(j))):C(null);}},$=async()=>{if(Je.has(e))return;let M,K={settled:new Promise(ae=>M=ae)},G=()=>{Je.get(e)===K&&Je.delete(e),M(),b(ae=>ae+1);},j=setTimeout(G,6e5);Je.set(e,K),b(ae=>ae+1);try{await J();}finally{clearTimeout(j),G();}},O=N!=="idle"?N:P?"confirm":"connect";return {step:p.phase==="idle"?n&&!p.error&&rn.get(e)!==a?"requesting":"amount":p.phase==="awaitingTransfer"?O:p.phase,phase:p.phase,refund:p.refund,error:p.error,transfer:f,chainId:_,network:E,amount:Q,wallet:P,wrongNetwork:ne,balance:Z,fee:V,problem:B??(p.instructions&&!f?"noRecipient":null),txKey:T,transactionUrl:M=>_?R?.explorerUrl?.({chainId:_,txKey:M}):void 0,addressUrl:M=>_?R?.explorerAddressUrl?.({chainId:_,address:M}):void 0,canConnect:g.canConnect,connecting:g.connecting,preview:async M=>await e.getState().preview(a,M)||(e.getState().error?"refused":null),start:async M=>{W(null),await e.getState().start(a,M);},connect:()=>{I&&g.connect(I);},switchNetwork:U,send:$,dismiss:()=>{x.current++,w("idle"),W("stillInWallet");},sending:k}}function Qi({label:e,className:a,disabled:r,...n}){let[o,l]=useState(false),i=On(n.locale??"en");return jsxs(Fragment,{children:[jsx("button",{type:"button",disabled:r,onClick:()=>l(true),className:cn$1(La,"novapay:w-auto novapay:px-4",a),children:e??i.refund.button}),jsx(mi,{...n,open:o,onOpenChange:l})]})}function mi({open:e,onOpenChange:a,locale:r="en",onRefunded:n,...o}){let l=On(r),i=vi({store:o.store,invoiceId:o.invoiceId,invoice:o.invoice,params:e?o.params:void 0,open:e,labels:l,locale:r,onConnectWallet:o.onConnectWallet}),c=useEffectEvent(y=>n?.(y)),p=i.phase==="confirmed"?i.refund:null;useEffect(()=>{p&&c(p);},[p]);let u=o.invoice?h(l.refund.title,{invoice:o.invoice}):l.refund.button;return jsx(Dialog,{open:e,onOpenChange:a,children:jsxs(DialogContent,{className:"novapay:w-full novapay:sm:w-[440px]",children:[jsxs("div",{className:"novapay:flex novapay:items-center novapay:justify-between novapay:gap-3 novapay:border-b novapay:border-[var(--tuwa-border-primary)] novapay:px-5 novapay:py-3",children:[jsx(DialogTitle,{className:cn$1(F,"novapay:m-0 novapay:truncate novapay:text-sm novapay:font-bold"),children:u}),jsx("button",{type:"button","aria-label":l.refund.close,onClick:()=>a(false),className:Fa,children:jsx(XMarkIcon,{"aria-hidden":true,className:"novapay:h-4 novapay:w-4"})})]}),jsx(hi,{flow:i,labels:l,locale:r,close:()=>a(false),...o})]})})}function hi({flow:e,labels:a,locale:r,close:n,currency:o="USD",refundable:l,details:i,onRecord:c}){let p=a.refund,u={network:e.network,symbol:e.transfer?.symbol??e.refund?.assetId??"",amount:e.amount,wallet:e.wallet?.name??""},y=e.refund?.txHash??e.txKey,h$1=c&&jsxs(Fragment,{children:[jsx(pe,{onClick:c,children:p.record}),jsx(ge,{children:p.recordHint})]});switch(e.step){case "amount":return jsx(Pi,{flow:e,labels:a,locale:r,currency:o,refundable:l});case "requesting":case "submitting":return jsx(ht,{children:e.step==="requesting"?p.requesting:p.submitting});case "switching":case "wallet":return jsxs(Fragment,{children:[jsxs(ht,{walletId:e.wallet?.walletId,walletIcon:e.wallet?.icon,children:[jsx("strong",{className:cn$1(F,"novapay:text-sm"),children:h(e.step==="switching"?p.switchTitle:p.walletTitle,u)}),e.step==="wallet"&&jsx("span",{children:h(p.walletText,u)})]}),jsx(ce,{children:jsx(pe,{onClick:e.dismiss,children:a.walletPrompt.cancel})})]});case "connect":return jsxs(Fragment,{children:[jsxs(me,{title:p.connectTitle,subtitle:h(p.connectText,u),children:[e.problem==="noRecipient"&&jsx(te,{children:p.noRecipient}),!e.canConnect&&jsx(te,{children:p.connectUnavailable})]}),jsxs(ce,{children:[e.canConnect&&e.problem!=="noRecipient"&&jsx(oe,{busy:e.connecting,onClick:e.connect,children:p.connect}),h$1]})]});case "confirm":return jsx(Si,{flow:e,labels:a,locale:r,values:u,details:i?.confirm,recordAction:h$1});case "confirming":return jsxs(Fragment,{children:[jsxs(me,{title:p.onItsWay,children:[jsxs(xe,{children:[jsx(z,{name:p.status,children:p.pending}),y&&jsx(z,{name:p.transaction,children:jsx(Pe,{hash:y,explorerUrl:e.transactionUrl(y),labels:a})}),jsx(z,{name:p.network,children:h(p.waiting,u)})]}),mt(e.refund)&&jsx(ge,{children:p.slowNote})]}),jsxs(ce,{children:[jsx(pe,{onClick:n,children:p.close}),mt(e.refund)?h$1:jsx(ge,{children:p.canClose})]})]});case "confirmed":return jsxs(Fragment,{children:[jsx(me,{title:p.refunded,children:jsxs(xe,{children:[e.refund?.creditNoteNumber&&jsx(z,{name:p.creditNote,children:e.refund.creditNoteNumber}),y&&jsx(z,{name:p.transaction,children:jsx(Pe,{hash:y,explorerUrl:e.transactionUrl(y),labels:a})}),i?.done]})}),jsx(ce,{children:jsx(oe,{onClick:n,children:p.done})})]});case "failed":return jsx(ki,{flow:e,labels:a,locale:r,values:u,recordAction:h$1,close:n})}}var fi={amount_short:"failedShort",over_limit:"failedByHand",tx_of_another_refund:"failedByHand",refund_from_buyer:"failedFromBuyer",transaction_failed:"failedNotFound",dropped:"failedDropped",too_early:"failedTooEarly",no_matching_transfer:"failedNoTransfer",withdrawn:"failedWithdrawn",cancelled:"failedCancelling",cancelled_final:"failedCancelled",resend_confirmed:"failedResendConfirmed"},yt=(e,a,r)=>{let n=e?.failureReason?fi[e.failureReason]:void 0;return n?a[n]:h(a.failedText,r)},xi={withdrawn:"failedWithdrawnTitle",cancelled:"failedCancelledTitle",cancelled_final:"failedCancelledTitle"},vt=(e,a)=>a[e?.failureReason&&xi[e.failureReason]||"failedTitle"],wi={refund_repriced:"movedTitle",request_failed:"unreachable",amount_exceeds_refundable:"refusedAmount",invoice_not_refundable:"refusedNotRefundable",payment_unknown:"refusedNotRefundable",held_transfer_not_refundable:"refusedNotRefundable",held_refund_must_be_whole:"refusedWhole",sender_blocked:"refusedBlocked",refund_not_waiting:"refusedNotWaiting",refund_may_have_landed:"refusedMayHaveLanded",refund_from_buyer:"failedFromBuyer",method_not_priced:"refusedPrice",price_no_rpc:"refusedPrice",price_unavailable:"refusedPrice",mainnet_disabled_on_node:"refusedTestOnly"},bi=600*1e3,mt=e=>{let a=e?.updatedAt??e?.createdAt;return !!a&&Date.now()-Date.parse(a)>bi},za=(e,a)=>e.text??a[wi[e.code]??"refusedOther"],gi=e=>e?.failureReason==="over_limit"||e?.failureReason==="tx_of_another_refund",Ni=e=>{let a=e.mode==="fiat_value"||e.failureReason==="amount_short";return {mode:a?"fiat_value":e.mode,...a&&{amount:e.amount},...e.reason&&{reason:e.reason}}};function ar(e){let[a,r]=useState(false),[n,o]=useState(null),l=useRef(false);return useEffect(()=>(l.current=false,()=>{l.current=true;}),[]),{ask:async(i,c)=>{if(i?.mode==="fiat_value"){r(true);let p=await e.preview(i);if(l.current||(r(false),p==="refused"))return;if(p&&Co(c?{cryptoAmount:p.cryptoAmount,atPaymentRate:c.cryptoAmount}:p))return o({preview:p,request:i})}o(null),e.start(i);},checking:a,moved:n,back:()=>o(null)}}function nr({preview:e,request:a},r,n,o,l,i){let c=o.refund,p=u=>`${ue(u,e.decimals,l)} ${e.symbol}`;return jsxs(Fragment,{children:[jsxs(me,{title:c.movedTitle,children:[jsx("p",{className:"novapay:m-0 novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:h(c.movedText,{symbol:e.symbol})}),jsxs(xe,{children:[jsx(z,{name:c.movedSend,children:p(e.cryptoAmount)}),e.atPaymentRate&&jsx(z,{name:c.movedAtPayment,children:p(e.atPaymentRate)}),e.received&&jsx(z,{name:c.movedReceived,children:p(e.received)})]}),i&&e.exactPossible&&jsx(ge,{children:h(c.movedExact,{exact:c.modeExact})}),n.error&&jsx(te,{children:za(n.error,c)})]}),jsxs(ce,{children:[jsx(oe,{busy:r.checking,onClick:()=>{r.ask(a,e);},children:c.movedContinue}),jsx(pe,{disabled:r.checking,onClick:r.back,children:c.movedBack})]})]})}function ki({flow:e,labels:a,locale:r,values:n,recordAction:o,close:l}){let i=a.refund,c=ar(e);return e.refund?.heldTransfer?jsxs(Fragment,{children:[jsxs(me,{title:vt(e.refund,i),children:[jsx(te,{children:yt(e.refund,i,n)}),jsx(ge,{children:i.failedHeldNote})]}),jsx(ce,{children:jsx(oe,{onClick:l,children:i.close})})]}):c.moved?nr(c.moved,c,e,a,r,false):jsxs(Fragment,{children:[jsxs(me,{title:vt(e.refund,i),children:[jsx(te,{children:yt(e.refund,i,n)}),e.error&&jsx(te,{children:za(e.error,i)})]}),jsxs(ce,{children:[gi(e.refund)?jsx(oe,{onClick:l,children:i.close}):jsx(oe,{busy:c.checking,onClick:()=>e.refund&&void c.ask(Ni(e.refund)),children:i.sendRefund}),o]})]})}function ht({walletId:e,walletIcon:a,children:r}){return jsxs("section",{role:"status",className:"novapay:flex novapay:min-h-56 novapay:flex-col novapay:items-center novapay:justify-center novapay:gap-3 novapay:px-5 novapay:py-6 novapay:text-center",children:[jsx(Ft,{walletId:e,walletIcon:a}),r]})}function Pi({flow:e,labels:a,locale:r,currency:n,refundable:o}){let l=a.refund,i=useId(),c=useId(),[p,u]=useState("fiat_value"),[y,h$1]=useState(""),[g,N]=useState(""),w=ar(e),v=p==="exact_received"||y.trim()===""||/^\d{1,12}(\.\d{1,2})?$/.test(y.trim()),C=[{key:"fiat_value",title:l.modeFiat,hint:h(l.modeFiatText,{currency:n})},{key:"exact_received",title:l.modeExact,hint:l.modeExactText}],b="novapay:h-10 novapay:w-full novapay:rounded-[var(--tuwa-rounded-corners)] novapay:border novapay:border-[var(--tuwa-border-primary)] novapay:bg-[var(--tuwa-bg-primary)] novapay:px-3 novapay:text-sm novapay:text-[var(--tuwa-text-primary)]",k={mode:p,...p==="fiat_value"&&y.trim()&&{amount:y.trim()},...g.trim()&&{reason:g.trim()}};return w.moved?nr(w.moved,w,e,a,r,true):jsxs(Fragment,{children:[jsxs(me,{title:l.amountTitle,children:[jsxs("fieldset",{disabled:w.checking,className:"novapay:contents",children:[jsx($a,{label:l.amountTitle,items:[...C],value:p,getKey:x=>x.key,onChange:x=>u(x),className:"novapay:flex novapay:flex-col novapay:gap-2",itemClassName:()=>"novapay:flex novapay:flex-col novapay:gap-0.5 novapay:px-3 novapay:py-2.5",children:x=>jsxs(Fragment,{children:[jsx("span",{className:"novapay:text-sm novapay:font-semibold",children:x.title}),jsx("span",{className:"novapay:text-xs novapay:text-[var(--tuwa-text-secondary)]",children:x.hint})]})}),p==="fiat_value"&&jsxs("label",{htmlFor:i,className:"novapay:flex novapay:flex-col novapay:gap-1 novapay:text-xs",children:[jsxs("span",{children:[h(l.amount,{currency:n}),jsxs("span",{"aria-hidden":"true",className:"novapay:text-[var(--tuwa-error-text)]",children:[" ","*"]})]}),jsx("input",{id:i,required:true,inputMode:"decimal",value:y,placeholder:"0.00","aria-invalid":!v||void 0,onChange:x=>h$1(x.target.value.replace(",",".")),className:cn$1(F,b)}),o&&jsx("span",{className:"novapay:text-[var(--tuwa-text-secondary)]",children:h(l.amountHint,{amount:o})})]}),jsxs("label",{htmlFor:c,className:"novapay:flex novapay:flex-col novapay:gap-1 novapay:text-xs",children:[jsx("span",{children:l.reason}),jsx("input",{id:c,value:g,maxLength:500,onChange:x=>N(x.target.value),className:b})]})]}),e.error&&jsx(te,{children:za(e.error,l)})]}),jsx(ce,{children:jsx(oe,{busy:w.checking,disabled:!v,onClick:()=>{w.ask(k);},children:l.continue})})]})}function ft(e,a){return jsxs("span",{className:"novapay:flex novapay:flex-col novapay:items-end novapay:gap-1",children:[e,a&&jsx("span",{className:"novapay:text-[var(--tuwa-text-secondary)]",children:a})]})}function Si({flow:e,labels:a,locale:r,values:n,details:o,recordAction:l}){let i=a.refund,c=e.transfer,p=typeof e.balance=="bigint"&&c?`${ue(e.balance.toString(),c.decimals,r)} ${c.symbol}`:null,u=e.fee?Tt(e.fee.amount.toString(),e.fee.decimals,r):null,y=e.fee&&u?`${u} ${e.fee.symbol}`:null,h$1={notEnough:h(i.notEnough,{...n,address:e.wallet?shortAddress(e.wallet.address):"",balance:p??""}),declined:h(i.declined,n),unsupported:h(i.unsupported,n),wrongNetwork:h(i.wrongNetwork,n),failed:i.failed,noRecipient:i.noRecipient,fromBuyer:i.failedFromBuyer,stillInWallet:h(a.walletPrompt.stillWaiting,n),unreachable:i.unreachable},g=!!e.problem,N=!!e.txKey;return jsxs(Fragment,{children:[jsxs(me,{title:g?i.notSent:i.confirmTitle,children:[jsxs(xe,{children:[jsx(z,{name:i.send,children:n.amount}),jsx(z,{name:i.network,children:n.network}),c&&jsx(z,{name:i.to,children:ft(jsx(Pe,{hash:c.to,explorerUrl:e.addressUrl(c.to),labels:a}),e.refund?.heldTransfer?i.theSender:i.thePayer)}),e.wallet&&jsx(z,{name:i.from,children:ft(jsx(Pe,{hash:e.wallet.address,explorerUrl:e.addressUrl(e.wallet.address),labels:a}),p&&h(i.balance,{amount:p}))}),y&&jsx(z,{name:i.networkFee,children:h(i.feeEstimate,{amount:y})}),o]}),e.problem&&jsx(te,{children:h$1[e.problem]}),e.problem&&!["noRecipient","unreachable","stillInWallet"].includes(e.problem)&&jsx(ge,{children:i.nothingSent}),N&&e.error&&jsx(te,{children:i.notHandedOver}),!N&&e.error&&e.problem!=="unreachable"&&jsx(te,{children:za(e.error,i)})]}),jsxs(ce,{children:[e.problem!=="noRecipient"&&(e.wrongNetwork&&!N?jsx(oe,{onClick:()=>{e.switchNetwork();},children:h(i.switchTo,n)}):jsx(oe,{busy:e.sending,onClick:()=>{e.send();},children:N?i.handOver:i.sendRefund})),(g||N)&&l,!g&&!N&&e.wallet&&jsx(pe,{onClick:e.connect,children:a.pay.changeWallet})]})]})}function Ci(e){return e.appStore?e.novaConnect?"app":"appStore":e.ownConnection?"own":"none"}function tr(e){let a=useContext(SatelliteStoreContext),r=useContext(NovaConnectProviderContext);return Ci({appStore:a!=null,novaConnect:r!==void 0,ownConnection:e})}function Vi(){let e=ka(),a=tr(false);return e.connection??a}var Ii=()=>import('./OwnConnection-ET76SUMX-G7ZHJN57.js').then(e=>({default:e.OwnConnection})),Ti=lazy(Ii),_i=()=>process.env.NODE_ENV==="development";function Yi({baseUrl:e,labels:a,customization:r,adapters:n,pulsar:o,ownConnection:l,onConnectWallet:i,children:c}){let p=useContext(cn),u=tr(!!l),[y]=useState(u),[h]=useState(l),g=y==="own"?l??h:void 0,N=(y==="app"||y==="appStore")&&p.connection!==void 0&&p.connection!=="none",w=g?g.adapters:n??(N?p.adapters:void 0),v=useMemo(()=>({baseUrl:e,labels:a,customization:r,adapters:w,pulsar:o,connection:y,onConnectWallet:i}),[e,a,r,w,o,y,i]),C=useRef(null),b=!!l,k=!!w;return useEffect(()=>{if(!_i())return;C.current??=new Set;let x=C.current,S=(T,f)=>{x.has(T)||(x.add(T),console.warn(`[NovaPaymentsProvider] ${f}`));};u!==y&&S("connection",`it keeps the wallet connection it chose on its first render ("${y}"), though the providers above now call for "${u}". Render it inside the app's SatelliteConnectProvider and NovaConnectProvider from the start.`),b&&y==="appStore"&&S("appStore","it is inside the app's SatelliteConnectProvider without NovaConnectProvider: it uses the app's wallet and never adds a second store, so `ownConnection` is not used. Connect wallets with `onConnectWallet`, or render it inside NovaConnectProvider."),b&&!k&&(y==="app"||y==="appStore")&&S("adapters","it uses the app's wallet connection, so the adapters of `ownConnection` are not used: pass `adapters` on the app's wagmi config to pay from the app's wallet.");},[u,y,b,k]),jsx(cn.Provider,{value:v,children:g?jsx(Suspense,{fallback:null,children:jsx(Ti,{own:g,children:c})}):c})}
2
+ export{Pi as AmountStep,Wo as AutoPayScreen,jo as BuyerScreen,bn as CheckoutContext,zr as CheckoutContextProvider,di as CheckoutFrame,tl as CheckoutHeader,ui as CheckoutPageRoot,Qo as CheckoutStepper,el as CheckoutSummary,al as CompactSummary,ul as ConfirmScreen,Si as ConfirmStep,yl as ConfirmWalletScreen,so as DEADLINE_ANNOUNCEMENTS,Ht as DeadlineTimer,Ka as Disclosure,ki as FailedStep,vl as LeaveDialog,nl as LocaleSwitcher,$n as MerchantBadge,fl as MethodScreen,rl as MobileSteps,cn as NovaPaymentsContext,Yi as NovaPaymentsProvider,Gi as OPEN_REQUEST_MS,Kt as OrderLines,Yo as OrderTotal,Pl as OutcomeScreen,Il as PaidScreen,ti as PayScreen,ji as PaymentCheckout,$t as QUOTE_WARNING_MS,li as QrScreen,Qi as RefundButton,mi as RefundDialog,hi as RefundSteps,dt as ScreenBody,Rn as SellerDetailsContent,zt as SummaryFooter,Wa as WalletPrompt,aa as addressOfWallet,ko as autoPayTerms,sl as balanceShortfall,_t as baseUnitsToDecimal,Lt as buyerFields,Fo as buyerIssues,Zr as canPayWithQr,se as checkoutClassName,ao as checkoutScreen,to as checkoutSteps,Bo as cleanBuyer,Yr as connectedWallet,bo as contactHref,Lo as countryOptions,co as deadlineAnnouncement,kn as deadlineState,Nn as familyOf,Qe as formatCountdown,Tt as formatFeeAmount,ye as formatFiat,Wt as formatPeriod,ue as formatTokenAmount,Et as grantableOffer,oo as groupMethodsByToken,Hl as handOverPayment,Te as instructionsChainId,Na as invoiceTotals,sn as isConfirmationError,ho as isFinalPaymentFailure,xa as isInvoicePaymentOnTheWay,Ma as isInvoicePaymentUnresolved,Ve as isMovedMoneyFailure,xo as isPaidElsewhere,Ea as isPayerProofError,nn as isPaymentAccepted,ea as isPaymentOnTheWay,yo as isQuoteEnding,Da as isSameWallet,mt as isSlow,Ot as isSmartWallet,At as isWalletIconUrl,va as leftTheWalletText,qo as lockPrice,po as lockedPriceOnWallet,Sn as methodErrorText,We as methodFamily,Jr as methodToken,Ie as minorToDecimal,Qn as needsLeaveConfirm,Ao as needsPayerProof,To as needsTheClock,ve as networkName,ro as paidSteps,Ol as payInvoice,ol as payPath,ze as payerFor,In as payerProofErrorText,qt as priceAdjustment,ri as qrPath,ll as quoteAmounts,il as quoteRate,So as receivedAmount,Co as refundRateMoved,yi as refundTransfer,za as refusalText,Cn as restRateText,vo as screensPayingWallets,mo as sentBeforeDeadline,Ll as shouldHandOver,eo as takeOverOpens,ba as unconfirmedFollowUp,wo as unconfirmedTxKey,Po as underpaidRest,fa as useAsyncValue,Cl as useAutoReturn,Y as useCheckoutContext,Tl as useCheckoutEvents,$l as useCheckoutState,ql as useCheckoutStore,Zt as useConnectedWallet,ka as useNovaPayments,El as useNow,Ae as useOptionalCheckoutContext,Sl as usePaidCallback,Yt as usePayerProof,Ul as usePayment,Vt as usePaymentFacts,Kl as usePaymentHandOver,Vi as usePaymentsConnection,On as usePaymentsLabels,vi as useRefund,St as useRereadValue,Xt as useWalletConnection,Qr as walletLabel,uo as walletOnConfirmStep};
@@ -0,0 +1 @@
1
+ 'use strict';var a={common:{close:"Chiudi",retry:"Riprova",loading:"Caricamento del pagamento\u2026",dialogTitle:"Paga {merchant}"},error:{title:"Impossibile aprire il pagamento",notFound:"Questo link di pagamento \xE8 errato o non funziona pi\xF9. Chiedine uno nuovo al venditore.",generic:"Qualcosa \xE8 andato storto. Riprova tra un momento."},steps:{details:"Dati",method:"Metodo",pay:"Pagamento",confirm:"Conferma",autoPay:"Pagamento automatico",progress:"Passaggio {current} di {total}: {name}",label:"Passaggi del pagamento"},language:{button:"Lingua: {language}",title:"Lingua",note:"Anche la fattura e la ricevuta usano questa lingua.",noteAfterPaid:"La ricevuta resta nella lingua in cui \xE8 stata emessa."},method:{title:"Scegli come pagare",subtitle:"Quando continui, il prezzo resta bloccato per {minutes} minuti.",token:"Token",networks:"{count} reti",network:"Rete {symbol}",yourWallet:"Il tuo wallet",popular:"Popolare",noGasFee:"Senza gas",buyerPaysGas:"La commissione di rete la paghi tu",discount:"Sconto {percent}%",markup:"Maggiorazione {percent}%",payWith:"Paga con",wallet:"Wallet",walletHint:"MetaMask, Rabby, Phantom\u2026",qr:"Codice QR",qrHint:"Wallet sul telefono",continue:"Continua",quoting:"Calcolo del prezzo\u2026",agreeBoth:"Continuando accetti i {terms} e la {refundPolicy} del venditore.",agreeOne:"Continuando accetti le condizioni del venditore: {link}.",consentRequired:"Obbligatorio per continuare.",noMethods:"Al momento questa fattura non si pu\xF2 pagare con nessun metodo. Contatta il venditore.",methodUnavailable:"Questa pagina non accetta questo metodo. Scegline un altro.",tooManyPayers:"Troppi wallet hanno provato questa fattura. Chiedi a {merchant} un nuovo link di pagamento.",tooManyPayments:"Questa fattura non pu\xF2 pi\xF9 ricevere un pagamento qui. Contatta {merchant}.",nativeFromSmartWallet:"Uno smart wallet non pu\xF2 pagare con questa moneta: scegli un token.",payerNotExpected:"Il venditore ha chiesto di pagare questa fattura da un altro wallet. Collega quel wallet.",rateLimited:"Troppi tentativi. Attendi un minuto e riprova.",paymentFailed:"Il pagamento non \xE8 riuscito. \xC8 stata spesa solo la commissione di rete; la fattura resta aperta.",restSameMethod:"Il resto si paga con lo stesso token e sulla stessa rete della prima parte.",priceUnavailable:"Al momento non \xE8 possibile leggere il prezzo di questo metodo. Scegli un altro metodo o riprova tra un minuto."},buyer:{title:"I tuoi dati",subtitle:"Il venditore ne ha bisogno per la fattura e la ricevuta.",email:"Email",name:"Nome",companyName:"Azienda",addressLine1:"Indirizzo",addressLine2:"Indirizzo, riga 2",postalCode:"CAP",city:"Citt\xE0",country:"Paese",chooseCountry:"Scegli un paese",taxId:"Partita IVA o codice fiscale",registrationNumber:"Numero di registrazione",optional:"facoltativo",companyInvoice:"Mi serve una fattura intestata alla mia azienda",required:"Obbligatorio",invalidEmail:"Inserisci un indirizzo email come nome@esempio.com",invalidCountry:"Scegli un paese dall'elenco",refused:"Non \xE8 stato possibile salvare i tuoi dati. Controllali e riprova.",continue:"Continua"},pay:{title:"Paga",walletLine:"{address} \xB7 {network}",change:"Cambia",changeWallet:"Cambia wallet",youSend:"Invii",youSendRest:"Invii il resto",copyAmount:"Copia l'importo",copied:"Copiato",onNetwork:"su {network}",fiatValue:"= {amount} {currency}",priceLocked:"Prezzo bloccato per {time}",refreshPrice:"Aggiorna il prezzo",priceEnding:"Questo prezzo scade tra {time}. Vuoi mantenerlo?",keepPrice:"Mantieni questo prezzo \xB7 +{minutes} min",priceExpired:"Il blocco del prezzo \xE8 scaduto.",newPrice:"Ottieni un nuovo prezzo",rate:"Tasso di cambio",rateValue:"1 {symbol} = {price} {currency}",networkFee:"Commissione di rete",merchantPaysGas:"Paga {merchant} \xB7 tu firmi soltanto",gasEstimate:"\u2248 {amount} \xB7 dal tuo wallet",gasFromWallet:"Pagata dal tuo wallet",to:"A",invoiceTotal:"Totale fattura",invoiceRest:"Resto della fattura",backFromRest:"Indietro",restRateUntil:"Questo tasso vale fino a {time}. Un pagamento successivo attende che {merchant} lo accetti.",restRateEnded:"Questo tasso \xE8 stato bloccato in precedenza, quindi questo pagamento attende che {merchant} lo accetti.",restTimeLeft:"Tempo rimasto per l'invio: {time}",transferFee:"Commissione di trasferimento del token {percent}%",merchantReceives:"{merchant} riceve",transferFeeNote:"Il contratto del token trattiene una commissione su ogni trasferimento, quindi invii un po' di pi\xF9 perch\xE9 la fattura sia pagata per intero.",signToPay:"Firma per pagare {amount}",payAmount:"Paga {amount}",switchTo:"Passa a {network}",connect:"Collega un wallet",back:"Torna ai metodi",payWithGas:"Paga tu il gas",payGasless:"Lascia che il gas lo paghi {merchant}",disclaimer:"I pagamenti vanno direttamente a {merchant} e non sono reversibili; i rimborsi li effettua il venditore.",disclaimerScreening:"{merchant} controlla i wallet che pagano nelle liste delle sanzioni e, dove disponibili, in base ad altri segnali di rischio.",wrongNetwork:"Rete sbagliata",wrongNetworkText:"Il tuo wallet \xE8 su {current}. Questo pagamento avviene su {network}.",switchHint:"Il tuo wallet ti chieder\xE0 di approvare il cambio.",solanaNetwork:"Paga su {network}",solanaNetworkText:"I wallet Solana scelgono la rete da soli: passa il tuo a {network} prima di pagare.",solanaHintPhantom:"In Phantom: Impostazioni \u203A Impostazioni sviluppatore \u203A Modalit\xE0 testnet, poi {network}.",solanaHintSolflare:"In Solflare: Impostazioni \u203A Generali \u203A Rete \u203A {cluster}.",solanaHintOther:"Scegli la rete nelle impostazioni di {wallet}.",notEnough:"Saldo insufficiente",walletHas:"Il tuo wallet ha {amount} su {network}",shortBy:"Mancano {short} per arrivare a {need}.",payFromBalance:"Paga con ci\xF2 che ha questo wallet",youHave:"Hai {amount}",topUp:"Oppure aggiungi {symbol} a questo wallet e torna qui:",getToken:"Ottieni {symbol}",connectUnavailable:"Questa pagina non pu\xF2 collegare un wallet. Paga con un codice QR.",switchFailed:"{wallet} non \xE8 passato a {network}. Cambia rete nel wallet e riprova.",notAuthorized:"{wallet} non ha consentito questo account qui. Controlla in {wallet} che questo account sia collegato a questo sito e riprova.",walletFailed:"{wallet} non ha eseguito la richiesta e non \xE8 stato inviato nulla. Riprova.",sentUnconfirmed:"{wallet} ha inviato il pagamento, che non \xE8 ancora confermato. Non pagare di nuovo: questa pagina si aggiorna appena arriva.",declined:"Hai rifiutato la richiesta in {wallet}.",tryAgain:"Riprova",failed:"Il pagamento non \xE8 riuscito su {network}. \xC8 stata spesa solo la commissione di rete; la fattura \xE8 ancora aperta.",mismatch:"Questa transazione non paga la fattura. Se dal tuo wallet sono usciti dei fondi, contatta {merchant}.",mismatchTakenElsewhere:"Questa transazione paga un'altra fattura. Se era il tuo pagamento per questa, contatta {merchant} indicando l'hash della transazione.",mismatchHeldElsewhere:"Questa transazione \xE8 legata a un'altra fattura, che la trattiene per rimborsarla al wallet che l'ha inviata. Non vale per questa fattura. Se era il tuo pagamento per questa, contatta {merchant} con l'hash della transazione.",mismatchOtherWallet:"Questo trasferimento \xE8 arrivato da un wallet che non ha confermato questa fattura, quindi non la paga. Se dal tuo wallet sono usciti dei fondi, contatta {merchant}.",mismatchOtherWalletHeld:"Questo trasferimento \xE8 arrivato da un wallet che non ha confermato questa fattura, quindi non la paga. {merchant} lo restituisce al wallet che l'ha inviato, e puoi ancora pagare questa fattura dal wallet che l'ha confermata.",mismatchChargeHeld:"Questo pagamento \xE8 stato inviato o addebitato a un prezzo precedente di questa fattura, quindi non la paga. {merchant} lo restituisce al tuo wallet e puoi ancora pagare la fattura.",mismatchTooManyParts:"Questa fattura ha ricevuto tutti i pagamenti parziali che accetta, quindi questo trasferimento non la paga. {merchant} lo restituisce al tuo wallet; invia tutto il resto in una volta.",payAgain:"Paga di nuovo",unsupported:"{wallet} non pu\xF2 effettuare questo pagamento.",wrongCluster:"{wallet} \xE8 su un'altra rete, quindi non \xE8 stato pagato nulla. Passalo a {network} e paga di nuovo.",screeningUnavailable:"Il controllo del wallet non \xE8 disponibile al momento.",retryLater:"Riprova tra un minuto",noAnswer:"Il server dei pagamenti non ha risposto. Controlla la connessione e riprova.",txTitle:"Pagamento a {merchant}",txDescription:"{amount} \xB7 {invoice}"},walletPrompt:{signIn:"Firma in {wallet}",confirmIn:"Conferma in {wallet}",switchIn:"Approva il cambio in {wallet}",signText:"Firma il trasferimento di {amount} a {merchant} su {network}. Niente gas: la commissione di rete la paga {merchant}.",confirmText:"Conferma il trasferimento di {amount} a {merchant} su {network}.",check:"Controlla in {wallet} prima di firmare",amount:"Importo",to:"A",network:"Rete",priceLocked:"Prezzo bloccato",notOpened:"La finestra del wallet non si \xE8 aperta?",tryAgain:"Riprova",stillWaiting:"Nessuna finestra? Apri {wallet}: la richiesta ti aspetta l\xEC.",cancel:"Annulla",submitting:"Consegna del pagamento a Quasar\u2026"},payerProof:{title:"Conferma il tuo wallet",text:"Conferma questo wallet: \xE8 gratuito e non sposta fondi.",summary:"Cosa firmi",invoice:"Fattura",merchant:"Venditore",amount:"Importo",wallet:"Wallet",site:"Sito",alreadyConfirmed:"Questa fattura \xE8 gi\xE0 confermata da {wallet}. Passa a quell'account nel tuo wallet per saltare la firma.",why:"I pagamenti da questo wallet contano per questa fattura appena firma. Il wallet mostra un messaggio da firmare, non un pagamento: nessuna commissione, nulla esce dal wallet.",passkey:"{wallet} potrebbe chiederti la passkey o l\u2019impronta per firmare.",confirm:"Conferma in {wallet}",waiting:"In attesa di {wallet}\u2026",note:"Una firma per wallet per questa fattura: un nuovo prezzo, token o rete non ne richiede un\u2019altra.",noteSmart:"Una firma per wallet per questa fattura: un nuovo prezzo o token non ne richiede un\u2019altra; un\u2019altra rete la chiede di nuovo.",promptText:"Firma il messaggio che conferma che questo wallet paga la fattura {invoice} di {merchant}. \xC8 gratuito e non sposta fondi.",promptPasskey:"Conferma con la passkey in {wallet}. Cos\xEC firmi il messaggio che conferma che questo wallet paga la fattura {invoice} di {merchant}; \xE8 gratuito e non sposta fondi.",declined:"Hai rifiutato la firma in {wallet}. \xC8 gratuita e non sposta fondi: firmala per pagare da questo wallet, oppure scegli un altro wallet o metodo.",unsupported:"{wallet} non pu\xF2 firmare questa conferma. Scegli un altro wallet o metodo.",failed:"{wallet} non ha firmato la conferma. Riprova.",invalid:"Non \xE8 stato possibile verificare la firma. Riprova oppure paga da un altro wallet.",unavailable:"Al momento la rete non pu\xF2 verificare la firma di questo wallet. Riprova tra un minuto.",wrongNetwork:"Passa {wallet} a {network}, poi conferma di nuovo.",tooManyWallets:"Troppi wallet hanno confermato questa fattura. Paga da uno di questi oppure chiedi a {merchant} una nuova fattura.",switchDeclined:"Hai rifiutato il passaggio a {network} in {wallet}. Approvalo per confermare questo wallet o scegli un altro metodo.",willSwitch:"Il tuo wallet \xE8 su {current}: prima chieder\xE0 di passare a {network}.",confirmToPay:"Conferma questo wallet per pagare",payNote:"Per pagare da questo wallet serve prima una firma gratuita: conferma che il wallet paga questa fattura e non sposta fondi.",signInRequest:"{wallet} potrebbe mostrarla come una richiesta di accesso per {site}."},qr:{solanaTitle:"Scansiona con un wallet Solana",solanaHint:"Apri Phantom, Solflare o Backpack",restHint:"Scansiona con il wallet che ha pagato per primo, {wallet}.",scanStep:"Scansiona il codice (Solana Pay)",approveStep:"Approva l'importo qui sotto",solanaCode:"Codice QR di una richiesta Solana Pay per {amount}",waiting:"In attesa del pagamento\u2026",exchangeWarning:"Invia dal tuo wallet, non da un exchange: un exchange elimina il riferimento del pagamento, che resterebbe in attesa di un controllo manuale.",openInWallet:"Apri nell'app del wallet",handoffTitle:"Paga sul telefono",handoffHint:"Scansiona con la fotocamera del telefono: questo pagamento si apre l\xEC e paghi con il wallet del telefono.",handoffCode:"Codice QR che apre questo pagamento sul telefono",handoffNote:"Questa pagina segue il pagamento e mostra la ricevuta quando arriva.",copyLink:"Copia il link",back:"Torna ai metodi"},confirm:{title:"Conferma del pagamento in corso",hint:"Di solito meno di due minuti su {network}.",sent:"Inviato",confirming:"In conferma",confirmed:"Confermato",paid:"Pagato",failed:"Non riuscito",network:"Rete",amount:"Importo",transaction:"Transazione",lastTransfer:"Ultimo trasferimento",from:"Da",canClose:"Puoi chiudere questa finestra: il pagamento prosegue e il venditore invia la ricevuta.",afterDeadline:"Il pagamento \xE8 stato inviato prima del termine ed \xE8 in fase di conferma.",pastDeadline:"Il pagamento \xE8 in fase di conferma. Se arriva dopo la chiusura della fattura, {merchant} lo accetta o lo restituisce.",invoicePayment:"Un pagamento di questa fattura \xE8 gi\xE0 in arrivo. Attendi che venga confermato prima di pagare di nuovo.",viewOnExplorer:"Vedi nell'explorer",copyHash:"Copia la transazione"},paid:{title:"Pagamento ricevuto",summary:"su {network} \xB7 {date}",receipt:"Ricevuta",receiptHint:"PDF del pagamento, conservato anche dal venditore",download:"Scarica",refunded:"Rimborsati {amount} {currency}",back:"Torna a {merchant}",returning:"Ritorno a {merchant} tra {seconds} s",stay:"Resta qui",autoPayOffer:"Paga automaticamente i prossimi periodi",autoPayActive:"I pagamenti automatici sono attivi.",autoPayOff:"Disattiva",autoPayTurnedOff:"I pagamenti automatici sono disattivati. {merchant} non pu\xF2 pi\xF9 addebitare questo wallet."},autoPay:{title:"Pagare automaticamente i prossimi periodi?",subtitle:"Facoltativo. Altrimenti ricevi una fattura a ogni periodo e la paghi tu.",allow:"Consenti a {merchant} di addebitare",limit:"fino a {amount}",every:"ogni {period}",from:"Da",to:"A",validUntil:"Valido fino al",validUntilValue:"{date}, o finch\xE9 non li disattivi",collector:"Quasar esegue ogni addebito per {merchant}, solo verso il wallet di {merchant} ed entro questo limite.",invoices:"Ogni addebito arriva con fattura e ricevuta via email.",cap:"{merchant} non pu\xF2 addebitare pi\xF9 di questo limite in un periodo.",turnOff:"Puoi disattivarli in qualsiasi momento dalla pagina di una di queste fatture: il tuo wallet invia una transazione. Per annullare l'abbonamento, contatta {merchant}.",confirm:"Consenti i pagamenti automatici",skip:"Non ora, pagher\xF2 ogni fattura",walletNote:"Il tuo wallet mostra questo permesso (ERC-7715) prima che tu lo approvi.",approveIn:"Approva in {wallet}",unavailable:"{wallet} non pu\xF2 consentire i pagamenti automatici.",smartAccountNote:"I pagamenti automatici richiedono uno smart account. {wallet} ti chieder\xE0 prima di passarci: una transazione su {network}, di cui paghi la commissione di rete. Il tuo indirizzo non cambia.",smartAccountPrompt:"{wallet} ti chiede di passare questo account a uno smart account. Indirizzo e fondi restano gli stessi.",smartAccountNeeded:"I pagamenti automatici richiedono uno smart account. In {wallet}, apri i dettagli di questo account, attiva lo smart account per {network} e riprova.",notGranted:"{wallet} non ha dato il permesso. Riprova o paga tu ogni fattura.",invalid:"Questo permesso non pu\xF2 essere usato. Riprova o paga tu ogni fattura."},autoPayOff:{title:"Disattivare i pagamenti automatici?",subtitle:"{merchant} non potr\xE0 pi\xF9 addebitare questo wallet. L'abbonamento continua: i periodi successivi arrivano come fatture che paghi tu. Per annullarlo, contatta {merchant}.",wallet:"Wallet",allowed:"Autorizzato ora",fee:"Il tuo wallet invia una transazione su {network} e paghi tu la commissione di rete.",confirm:"Disattiva in {wallet}",checkAgain:"Controlla di nuovo",keep:"Lasciali attivi",connect:"Collega quel wallet",otherWallet:"Solo il wallet che li ha autorizzati, {wallet}, pu\xF2 disattivarli.",useThisWallet:"Usa invece questo wallet",inWallet:"Conferma in {wallet}\u2026",waiting:"In attesa della rete\u2026",notYet:"La rete non lo mostra ancora. Se il wallet ha inviato la transazione, controlla di nuovo tra un minuto.",unsupported:"{wallet} non pu\xF2 inviare questa transazione."},outcome:{underpaidTitle:"\xC8 arrivata una parte del pagamento",underpaidText:"Ricevuti {received} su {total}.",underpaidRest:"Invia il resto, {rest}, dallo stesso wallet su {network}.",underpaidNote:"Finch\xE9 non arriva il resto, {merchant} vede la fattura come pagata in parte. Si pu\xF2 pagare fino al {date}.",underpaidClosed:"Il resto di questa fattura non pu\xF2 pi\xF9 essere pagato qui.",underpaidClosedRefund:"Dopo il {date}, {merchant} pu\xF2 rimborsare quanto ricevuto.",underpaidRateEnded:"Il tasso di questa fattura \xE8 terminato, quindi il resto pagato ora attende che {merchant} lo accetti.",underpaidBlocked:"Questo wallet non ha superato il controllo, quindi non pu\xF2 pagare il resto. Contatta {merchant}.",payRestFirstWallet:"Solo il wallet che ha pagato per primo, {wallet}, pu\xF2 pagare il resto. Collega quel wallet per pagarlo.",payRest:"Paga il resto",heldTitle:"Pagamento ricevuto, {merchant} lo sta verificando",heldScreening:"{merchant} verifica il pagamento prima di confermare l'ordine.",heldLate:"Il pagamento \xE8 arrivato dopo la chiusura della fattura. {merchant} lo accetta o lo restituisce.",heldOverpaid:"Hai inviato pi\xF9 dell'importo della fattura. {merchant} conferma l'ordine o restituisce la differenza al tuo wallet.",heldQuoteExpired:"Il pagamento \xE8 arrivato dopo la scadenza del blocco del prezzo. {merchant} lo accetta o lo restituisce.",heldNote:"Il venditore ti contatter\xE0 se serve qualcosa.",refundedTitle:"Rimborsato",refundedText:"{merchant} ha rimborsato questa fattura: {amount} {currency}.",expiredTitle:"Questa fattura \xE8 scaduta",expiredText:"Si poteva pagare fino al {date}. Chiedine una nuova a {merchant}; non ti \xE8 stato addebitato nulla.",expiredPartText:"Si poteva pagare fino al {date}. \xC8 arrivata una parte del pagamento: {amount}.",expiredPartNoAmount:"Si poteva pagare fino al {date}. \xC8 arrivata una parte del pagamento.",closedPartText:"{merchant} ha chiuso questa fattura. Sono arrivati {amount} del pagamento.",expiredPartRefund:"{merchant} pu\xF2 rimborsarla al wallet che ha pagato; contatta {merchant}.",expiredNote:"Un pagamento inviato dopo la scadenza resta in sospeso finch\xE9 il venditore non lo rimborsa o lo accetta.",expiredWhileConfirming:"La fattura si \xE8 chiusa mentre il pagamento veniva confermato. Se arriva, viene registrato e mostrato a {merchant}, che lo accetta o lo restituisce.",expiredAfterQr:"Se hai pagato con il codice QR, {merchant} accetta il pagamento quando arriva o lo restituisce.",expiredUnconfirmed:"Non \xE8 stato ancora possibile confermare il pagamento. Controlla il wallet: se il pagamento \xE8 partito, Quasar lo ricontrolla per 24 ore. Se arriva, viene registrato e mostrato a {merchant}, che lo accetta o lo restituisce.",unconfirmedTitle:"Non \xE8 stato possibile confermare il pagamento",unconfirmedText:"Controlla il wallet prima di pagare di nuovo: il pagamento potrebbe essere ancora in arrivo.",unconfirmedNote:"Quasar ricontrolla il tuo pagamento per 24 ore. Se arriva, viene registrato e mostrato a {merchant}.",unconfirmedContact:"Quasar non ricontrolla pi\xF9 questo pagamento. Se \xE8 partito dal tuo wallet, contatta {merchant} indicando l'hash della transazione.",unconfirmedNotReceived:"Quasar non ha ricevuto questo pagamento. Se \xE8 partito dal tuo wallet, contatta {merchant} indicando l'hash della transazione.",unconfirmedClosed:"Quasar non ha trovato questo pagamento sulla rete entro 24 ore e non lo controlla pi\xF9. Se \xE8 partito dal tuo wallet, contatta {merchant} indicando l'hash della transazione.",unconfirmedRetrying:"Questa pagina continua a consegnare il pagamento a Quasar. Tienila aperta finch\xE9 il pagamento non compare qui.",unconfirmedInvoiceFull:"Questa fattura non accetta altri pagamenti e Quasar non segue questo. Non pagare di nuovo; se \xE8 uscito dal tuo wallet, contatta {merchant} con l'hash della transazione.",unconfirmedTakenElsewhere:"Questa transazione \xE8 stata consegnata prima per un'altra fattura. Quasar la accredita alla fattura confermata dal wallet che l'ha inviata, e questa pagina mostra il risultato finch\xE9 segue il pagamento. Non pagare di nuovo; se il tuo pagamento non compare qui, contatta {merchant} indicando l'hash della transazione.",unconfirmedUnmined:"Quasar legge questo pagamento per una settimana da quando ne \xE8 venuto a conoscenza e lo registra se va a buon fine. Controlla il tuo wallet; se \xE8 uscito e hai bisogno di aiuto, contatta {merchant} indicando l\u2019hash di questa transazione.",unconfirmedNonceSpent:"Il tuo wallet ha usato il numero di questa transazione per un\u2019altra che Quasar non \xE8 riuscito a trovare, quindi potrebbe essere uscito denaro dal wallet. Per ora non pagare di nuovo. Se l\u2019hai accelerata, indica il suo hash qui sotto; altrimenti contatta {merchant} con questo hash di transazione.",unconfirmedSettlementFailed:"La rete ha confermato il tuo pagamento, ma Quasar non l'ha registrato. Non pagare di nuovo; contatta {merchant} indicando l'hash della transazione.",unconfirmedSettlementRetrying:"La rete ha confermato il tuo pagamento, ma Quasar non l'ha ancora registrato. Quasar riprova ogni giorno per 30 giorni da quando ha saputo del pagamento. Non pagare di nuovo; contatta {merchant} indicando l'hash della transazione.",followingUntil:"Questa pagina segue il pagamento fino a {time}. Pi\xF9 tardi, ricaricala per vedere l\u2019esito.",nameHash:"Il tuo wallet mostra un'altra transazione?",nameHashField:"Hash della transazione",nameHashSend:"Controlla questa transazione",nameHashInvalid:"Questa non \xE8 una transazione di questa rete.",nameHashRefused:"Quasar non ha potuto accettare questa transazione. Contatta il venditore con il suo hash.",unconfirmedPayAgain:"Il pagamento non \xE8 partito dal mio wallet",cancelledTitle:"Questa fattura \xE8 stata annullata",cancelledText:"{merchant} l'ha annullata; non ti \xE8 stato addebitato nulla.",cancelledWhilePaying:"{merchant} l'ha annullata. Se il tuo pagamento arriva, viene registrato e mostrato a {merchant}, che lo accetta o lo restituisce.",cancelledAfterQr:"{merchant} l'ha annullata. Se hai pagato con il codice QR, {merchant} accetta il pagamento quando arriva o lo restituisce.",replacedTitle:"{merchant} ha corretto questa fattura",replacedText:"La sostituisce {number}. Questa fattura non si pu\xF2 pi\xF9 pagare.",replacedPaid:"Hai gi\xE0 pagato? Il tuo pagamento \xE8 passato alla nuova fattura.",openReplacement:"Apri {number}",blockedTitle:"Questo wallet non pu\xF2 pagare questa fattura",blockedText:"Il wallet non ha superato il controllo. Non \xE8 stato inviato nulla. Collega un altro wallet o contatta {merchant}.",useAnotherWallet:"Usa un altro wallet",contact:"Contatta {merchant}",contactSubject:"Fattura {number}"},leave:{title:"Uscire dal pagamento?",text:"Non \xE8 ancora stato inviato nulla. La fattura resta aperta fino al {date}: riaprila dal link nella tua email o dal sito del venditore.",textNoDate:"Non \xE8 ancora stato inviato nulla. La fattura resta aperta: riaprila dal link nella tua email o dal sito del venditore.",price:"Il prezzo bloccato viene rilasciato; al ritorno ne ottieni uno nuovo.",stay:"Resta e paga",leave:"Esci"},summary:{test:"Prova",testHint:"Fattura di prova: si paga su una rete di test.",sellerDetails:"Dati del venditore",registration:"Numero di registrazione",taxId:"Partita IVA",terms:"Termini",refundPolicy:"Politica di rimborso",privacy:"Privacy",sellerRole:"{seller} \xE8 il venditore. Quasar \xE8 il software di pagamento: non detiene mai i tuoi fondi e non \xE8 parte di questo acquisto.",payWithin:"Termine di pagamento",refundAfter:"Rimborso possibile dopo",until:"fino al {date}",minutesLeft:"Restano {minutes} minuti per pagare",oneMinuteLeft:"Resta 1 minuto per pagare",invoice:"Fattura",quantity:"{quantity} \xD7 {price}",subtotal:"Imponibile",taxRate:"IVA {rate}%",tax:"IVA",total:"Totale",secured:"Protetto da Quasar",help:"Aiuto",compact:"{count} articoli \xB7 IVA incl. {tax}",compactOne:"{count} articolo \xB7 IVA incl. {tax}",compactNoTax:"{count} articoli",compactNoTaxOne:"{count} articolo",showOrder:"Dettagli"},refund:{button:"Rimborsa",title:"Rimborso di {invoice}",amountTitle:"Cosa rimborsare",modeFiat:"Un importo",modeFiatText:"In {currency}, convertito al cambio attuale",modeExact:"Tutto quanto ricevuto",modeExactText:"I token arrivati con il pagamento, cos\xEC come sono",amount:"Importo, {currency}",amountHint:"Fino a {amount}",reason:"Motivo (facoltativo)",continue:"Continua",movedTitle:"Il prezzo \xE8 cambiato",movedText:"Il prezzo di {symbol} \xE8 cambiato dopo il pagamento, quindi questo importo richiede un numero diverso di token.",movedSend:"Questo rimborso invia",movedAtPayment:"Al tasso del pagamento",movedReceived:"Il pagamento ha portato",movedExact:"Per restituire i token cos\xEC come sono arrivati, torna indietro e scegli \xAB{exact}\xBB.",movedContinue:"Continua con questo importo",movedBack:"Indietro",requesting:"Richiesta del rimborso a Quasar\u2026",connectTitle:"Collega un wallet",connectText:"Il rimborso parte su {network}, la rete del pagamento. Qualsiasi wallet con {symbol} su quella rete pu\xF2 inviarlo.",connect:"Collega wallet",connectUnavailable:"Questa pagina non pu\xF2 collegare un wallet. Invia il rimborso dal tuo wallet, poi registralo.",confirmTitle:"Conferma il rimborso",send:"Invia",to:"A",thePayer:"chi ha pagato",theSender:"chi ha inviato questo trasferimento",from:"Da",balance:"Contiene {amount}",networkFee:"Commissione di rete",feeEstimate:"\u2248 {amount} \xB7 dal tuo wallet",sendRefund:"Invia rimborso",switchTo:"Passa a {network}",walletTitle:"Conferma in {wallet}",walletText:"Conferma il trasferimento di {amount} su {network}.",switchTitle:"Approva il cambio in {wallet}",submitting:"Consegna del rimborso a Quasar\u2026",onItsWay:"In arrivo",status:"Stato",pending:"In attesa",transaction:"Transazione",network:"Rete",waiting:"{network} \xB7 in attesa di conferma",canClose:"Puoi chiudere questa finestra: la fattura mostra come procede il rimborso.",refunded:"Rimborsato",creditNote:"Nota di credito",done:"Fatto",failedShort:"Parte del rimborso \xE8 arrivata all'acquirente. Invia di nuovo il rimborso: parte solo ci\xF2 che manca.",failedTitle:"Il rimborso non \xE8 riuscito",failedWithdrawnTitle:"Hai ritirato il rimborso",failedCancelledTitle:"Hai annullato il rimborso",failedByHand:"La transazione di questo rimborso non pu\xF2 chiuderlo: verificala a mano con i rimborsi della fattura.",failedText:"La transazione non \xE8 riuscita su {network}; \xE8 stata spesa solo la commissione di rete. Invia di nuovo il rimborso.",failedFromBuyer:"\xC8 stato inviato dal wallet a cui doveva tornare o da un wallet che ha pagato la fattura, quindi non \xE8 stato restituito nulla. Invialo di nuovo da un altro wallet.",failedNotFound:"La sua transazione non \xE8 stata trovata in tempo o \xE8 stata sostituita: potrebbe comunque essere arrivata.",failedDropped:"La sua transazione non \xE8 stata trovata sulla rete: potrebbe comunque essere arrivata.",failedTooEarly:"La sua transazione \xE8 precedente al pagamento: non \xE8 questo rimborso.",failedNoTransfer:"La sua transazione non ha inviato nulla che Quasar possa vedere al wallet di destinazione.",failedWithdrawn:"L'hai ritirato prima dell'invio.",failedCancelling:"L'hai annullato nel tuo wallet. Potrai inviarlo di nuovo quando l'annullamento sar\xE0 definitivo, di solito in pochi minuti.",failedCancelled:"L'hai annullato nel tuo wallet, quindi non \xE8 stato inviato nulla. Puoi inviarlo di nuovo.",failedResendConfirmed:"Hai confermato che non \xE8 uscito dal tuo wallet: pu\xF2 essere inviato di nuovo.",failedHeldNote:"Il trasferimento resta trattenuto. Chiudi questa finestra: la sua riga indica cosa fare dopo.",notSent:"Non inviato",notEnough:"{symbol} insufficienti su {address}: contiene {balance}.",declined:"Hai rifiutato la richiesta in {wallet}.",unsupported:"{wallet} non pu\xF2 inviare questo rimborso.",wrongNetwork:"{wallet} \xE8 su un'altra rete, quindi non \xE8 stato inviato nulla. Passa a {network} e invia di nuovo.",failed:"Il wallet non ha inviato il rimborso. Riprova.",noRecipient:"Il wallet di chi ha pagato non \xE8 noto, quindi questo rimborso non pu\xF2 essere inviato da qui.",unreachable:"Quasar non risponde, quindi non \xE8 stato inviato nulla. Riprova tra poco.",refusedAmount:"L'importo supera quanto resta da rimborsare.",refusedNotRefundable:"Questo pagamento non pu\xF2 pi\xF9 essere rimborsato.",refusedWhole:"Un trasferimento trattenuto si restituisce per intero.",refusedBlocked:"Un controllo di conformit\xE0 blocca il wallet da rimborsare. Non \xE8 possibile inviargli nulla.",refusedNotWaiting:"Questo rimborso non attende pi\xF9 una transazione. Non \xE8 stato inviato nulla.",refusedMayHaveLanded:"Una transazione precedente di questo rimborso potrebbe essere andata a buon fine. Controllala prima di richiederlo di nuovo.",refusedPrice:"Al momento non \xE8 possibile leggere il prezzo. Riprova tra poco.",refusedTestOnly:"Questo nodo accetta solo reti di test.",refusedOther:"Quasar ha rifiutato questo rimborso. Non \xE8 stato inviato nulla.",slowNote:"Quasar non vede ancora questa transazione in rete. Se il wallet mostra un altro hash, perch\xE9 \xE8 stata accelerata o annullata l\xEC, registralo.",nothingSent:"Non \xE8 stato inviato nulla: il rimborso attende la sua transazione.",notHandedOver:"Il rimborso \xE8 stato inviato, ma Quasar non ha ancora ricevuto la transazione. Consegnala di nuovo: nulla viene inviato due volte.",handOver:"Consegnala di nuovo",record:"Registra rimborso",recordHint:"L'hai inviato in un altro modo? Registra il rimborso con la sua transazione: Quasar la verifica on-chain.",close:"Chiudi",txTitle:"Rimborso di {invoice}",txDescription:"{amount} a chi ha pagato",txDescriptionSender:"{amount} a chi ha inviato il trasferimento"}};exports.itLabels=a;