@w3payments/react 1.6.0 → 1.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"W3PaymentWidget.d.ts","sourceRoot":"","sources":["../../src/components/W3PaymentWidget.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAOlD,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,kCAAkC;IAClC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,0BAA0B;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,iDAAiD;IACjD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAu9B1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"W3PaymentWidget.d.ts","sourceRoot":"","sources":["../../src/components/W3PaymentWidget.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAOlD,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,kCAAkC;IAClC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,0BAA0B;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,iDAAiD;IACjD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAi+B1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -22,4 +22,4 @@ Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},hr=n,h
22
22
  The chosen QR Code version cannot contain this amount of data.
23
23
  Minimum version required to store current data is: `+D+`.
24
24
  `);const I=x(A,C,j),L=t.getSymbolSize(A),B=new r(L);return h(B,A),m(B),y(B,A),v(B,C,0),A>=7&&b(B,A),w(B,I),isNaN(R)&&(R=o.getBestMask(B,v.bind(null,B,C))),o.applyMask(R,B),v(B,C,R),{modules:B,version:A,errorCorrectionLevel:C,maskPattern:R,segments:j}}return Xn.create=function(A,C){if(typeof A=="undefined"||A==="")throw new Error("No input text");let R=e.M,j,D;return typeof C!="undefined"&&(R=e.from(C.errorCorrectionLevel,e.M),j=l.from(C.version),D=o.from(C.maskPattern),C.toSJISFunc&&t.setToSJISFunction(C.toSJISFunc)),M(A,j,R,D)},Xn}var pr={},gr={},Zo;function hl(){return Zo||(Zo=1,(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin=="undefined"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},t.getImageWidth=function(r,i){const s=t.getScale(r,i);return Math.floor((r+i.margin*2)*s)},t.qrToImageData=function(r,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),l=Math.floor((o+s.margin*2)*c),u=s.margin*c,f=[s.color.light,s.color.dark];for(let d=0;d<l;d++)for(let h=0;h<l;h++){let m=(d*l+h)*4,y=s.color.light;if(d>=u&&h>=u&&d<l-u&&h<l-u){const b=Math.floor((d-u)/c),v=Math.floor((h-u)/c);y=f[a[b*o+v]?1:0]}r[m++]=y.r,r[m++]=y.g,r[m++]=y.b,r[m]=y.a}}})(gr)),gr}var Jo;function $0(){return Jo||(Jo=1,(function(t){const e=hl();function n(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch(i){throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,l=o;typeof c=="undefined"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=r()),c=e.getOptions(c);const u=e.getImageWidth(s.modules.size,c),f=l.getContext("2d"),d=f.createImageData(u,u);return e.qrToImageData(d.data,s,c),n(f,l,u),f.putImageData(d,0,0),l},t.renderToDataURL=function(s,o,a){let c=a;typeof c=="undefined"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=t.render(s,o,c),u=c.type||"image/png",f=c.rendererOpts||{};return l.toDataURL(u,f.quality)}})(pr)),pr}var yr={},Qo;function O0(){if(Qo)return yr;Qo=1;const t=hl();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function n(i,s,o){let a=i+s;return typeof o!="undefined"&&(a+=" "+o),a}function r(i,s,o){let a="",c=0,l=!1,u=0;for(let f=0;f<i.length;f++){const d=Math.floor(f%s),h=Math.floor(f/s);!d&&!l&&(l=!0),i[f]?(u++,f>0&&d>0&&i[f-1]||(a+=l?n("M",d+o,.5+h+o):n("m",c,0),c=0,l=!1),d+1<s&&i[f+1]||(a+=n("h",u),u=0)):c++}return a}return yr.render=function(s,o,a){const c=t.getOptions(o),l=s.modules.size,u=s.modules.data,f=l+c.margin*2,d=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",h="<path "+e(c.color.dark,"stroke")+' d="'+r(u,l,c.margin)+'"/>',m='viewBox="0 0 '+f+" "+f+'"',b='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+m+' shape-rendering="crispEdges">'+d+h+`</svg>
25
- `;return typeof a=="function"&&a(null,b),b},yr}var ta;function F0(){if(ta)return se;ta=1;const t=x0(),e=B0(),n=$0(),r=O0();function i(s,o,a,c,l){const u=[].slice.call(arguments,1),f=u.length,d=typeof u[f-1]=="function";if(!d&&!t())throw new Error("Callback required as last argument");if(d){if(f<2)throw new Error("Too few arguments provided");f===2?(l=a,a=o,o=c=void 0):f===3&&(o.getContext&&typeof l=="undefined"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(a=o,o=c=void 0):f===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(h,m){try{const y=e.create(a,c);h(s(y,o,c))}catch(y){m(y)}})}try{const h=e.create(a,c);l(null,s(h,o,c))}catch(h){l(h)}}return se.create=e.create,se.toCanvas=i.bind(null,n.render),se.toDataURL=i.bind(null,n.renderToDataURL),se.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),se}var _0=F0();const z0=wl(_0);function U0(i,s,o){return zt(this,arguments,function*(t,e,n,r={}){var a,c;try{let l=t;e&&n&&(l=`${e.toLowerCase()}:${t}?amount=${n}`);const u={errorCorrectionLevel:r.errorCorrectionLevel||"M",type:r.type||"image/png",quality:r.quality||.92,margin:r.margin||2,color:{dark:((a=r.color)==null?void 0:a.dark)||"#000000",light:((c=r.color)==null?void 0:c.light)||"#FFFFFF"},width:r.width||256};return yield z0.toDataURL(l,u)}catch(l){throw new Error(`Failed to generate QR code: ${l instanceof Error?l.message:"Unknown error"}`)}})}function W0(t){return zt(this,null,function*(){try{if(navigator.clipboard&&window.isSecureContext)return yield navigator.clipboard.writeText(t),!0;{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();const n=document.execCommand("copy");return document.body.removeChild(e),n}}catch(e){return!1}})}const H0="_widget_1upbe_3",ea={widget:H0},G0=({endpoint:t,currency:e,network:n,destinations:r,amount:i="",title:s="bits",description:o,subtitle:a="CHOOSE A PAYMENT METHOD",logo:c,theme:l="default",appearance:u,showAmount:f=!0,showUsdConversion:d=!1,usdRate:h,enableDirect:m=!0,transactionId:y,qrPaymentLabel:b="Paying:",qrReceivingLabel:v="Receiving:",qrReceivingAmount:w,qrDescription:x,customerId:T,idempotencyKey:M,callbackUrl:P,onInitiate:A,onComplete:C,onError:R,onClose:j})=>{var Q;const D=d0(l,u),[I]=S.useState(i),[L,B]=S.useState([]),[et,dt]=S.useState(!0),[G,X]=S.useState(null),[rt,it]=S.useState(!1),[E,O]=S.useState(""),[U,H]=S.useState(""),[ht,wt]=S.useState(!1);S.useEffect(()=>{zt(null,null,function*(){var W;try{const at=new URLSearchParams({currency:e,network:n}),gt=((W=(yield(yield window.fetch(`${t}/payment-methods?${at}`)).json()).methods)==null?void 0:W.filter(yt=>yt.to===e&&yt.network===n))||[],Ct=[];m&&Ct.push({vendor:"direct",source:"wallet",from:e,to:e,network:n,name:"Direct Payment"}),Ct.push(...gt),B(Ct)}catch(at){console.error("Failed to fetch payment methods:",at),R==null||R(new Error("Failed to load payment methods"))}finally{dt(!1)}})},[t,e,n,m,R]),S.useEffect(()=>{rt?zt(null,null,function*(){try{const W=r.find(mt=>mt.currency===e&&mt.network===n);if(!W){H("No destination address found");return}const at=yield U0(W.address,n,I,{width:176,margin:1});O(at),H("")}catch(W){H("Failed to generate QR code"),console.error("QR generation error:",W)}}):(O(""),H(""))},[rt,e,n,I,r]);const _=N=>zt(null,null,function*(){var at,mt;if(G)return;const W=L.find(K=>(K.exchange?`${K.vendor}-${K.source}-${K.exchange}-${K.from}-${K.to}`:`${K.vendor}-${K.source}-${K.from}-${K.to}`)===N);if(W){X(N);try{const K=r.find(Ct=>Ct.currency===e&&Ct.network===n);if(!K)throw new Error(`No destination address found for ${e} on ${n}`);const gt={amount:parseFloat(I),currency:W.from,customerId:T,address:K.address,transactionId:y,idempotencyKey:M,callbackUrl:P};if(yield A==null?void 0:A(gt),W.vendor==="direct"){it(!0);return}else{const Ct=yield window.fetch(`${t}/payments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:gt,method:W})}),yt=yield Ct.json();if(Ct.ok)if((at=yt.session)!=null&&at.id&&((mt=yt.session)!=null&&mt.vendor))try{const Se=window.atob(yt.session.id),Pn=(window.screen.width-500)/2,An=(window.screen.height-700)/2;window.open(Se,`${W.vendor}-checkout`,`width=500,height=700,left=${Pn},top=${An}`),C==null||C(yt)}catch(Se){console.error("Failed to decode checkout URL:",Se),C==null||C(yt)}else C==null||C(yt);else throw new Error(yt.message||"Payment failed")}}catch(K){R==null||R(K instanceof Error?K:new Error("Payment failed"))}finally{X(null)}}});return et?g.jsx(xr,{cssVariablesSelector:"[data-w3-payment-widget]",children:g.jsx(oe,{className:ea.widget,style:D,children:g.jsxs(Rt,{align:"center",justify:"center",h:"600px",children:[g.jsx(pe,{}),g.jsx(q,{children:"Loading..."})]})})}):g.jsx(xr,{cssVariablesSelector:"[data-w3-payment-widget]",children:g.jsx(oe,{shadow:"md",radius:"xl",p:0,className:ea.widget,style:p({height:"600px",backgroundColor:"var(--w3-mainBackground)"},D),"data-w3-payment-widget":!0,children:g.jsxs(F,{style:{position:"relative",overflow:"hidden",height:"100%",display:"flex",flexDirection:"column"},children:[j&&g.jsx(qt,{variant:"subtle",onClick:j,style:{position:"absolute",top:"16px",right:"16px",zIndex:20,color:"var(--w3-amountText, #000000)",backgroundColor:"var(--w3-innerBackground, #ffffff)",border:"1px solid var(--w3-borderColor, rgba(0, 0, 0, 0.1))",borderRadius:"50%",width:"24px",height:"24px",transition:"all 0.2s ease",minWidth:"24px",minHeight:"24px"},size:"sm",onMouseEnter:N=>{N.currentTarget.style.opacity="0.8",N.currentTarget.style.transform="scale(1.05)"},onMouseLeave:N=>{N.currentTarget.style.opacity="1",N.currentTarget.style.transform="scale(1)"},children:g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),g.jsx(F,{style:{flex:1,position:"relative",overflow:"hidden"},children:g.jsx(Sh,{mode:"wait",children:rt?g.jsx(e0.div,{initial:{opacity:0,x:100},animate:{opacity:1,x:0},exit:{opacity:0,x:100},transition:{duration:.3,ease:"easeOut"},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"var(--w3-mainBackground)",borderTopLeftRadius:"var(--mantine-radius-xl)",borderTopRightRadius:"var(--mantine-radius-xl)",zIndex:10,overflow:"auto"},children:g.jsxs(F,{style:{height:"100%",display:"flex",flexDirection:"column",backgroundColor:"var(--w3-mainBackground)"},children:[g.jsxs(ot,{justify:"space-between",px:"xs",pt:"md",pb:"sm",style:{flexShrink:0},children:[g.jsx(F,{style:{width:"40px"}}),g.jsxs(q,{fw:700,size:"sm",style:{textAlign:"center",flex:1,color:"var(--w3-primaryText)"},children:["Send ",e," to Complete Payment"]}),g.jsx(qt,{variant:"subtle",onClick:()=>it(!1),style:{width:"40px",height:"40px",color:"var(--w3-primaryText)"},children:"→"})]}),g.jsx(F,{style:{flex:1,overflow:"auto",backgroundColor:"var(--w3-mainBackground)",display:"flex",flexDirection:"column",padding:"32px 24px 24px 24px"},children:g.jsxs(F,{w:"100%",style:{backgroundColor:"var(--w3-innerBackground)",borderRadius:"24px",padding:"24px",flex:1,display:"flex",flexDirection:"column"},children:[x&&g.jsx(q,{fw:600,size:"xs",ta:"center",mb:"xs",style:{color:"var(--w3-amountText)"},children:x}),g.jsxs(ot,{w:"100%",gap:"sm",justify:"space-between",wrap:"nowrap",children:[g.jsx(oe,{radius:"lg",p:"sm",style:{flex:"0 0 60%",backgroundColor:"var(--w3-qrCardBackground)",border:"1px solid var(--w3-borderColor)",height:"140px",display:"flex",flexDirection:"column",justifyContent:"center"},children:g.jsxs(Rt,{gap:2,children:[g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:"Network"}),g.jsx(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:n.toUpperCase()})]}),g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:"Token"}),g.jsx(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:e})]}),g.jsx(F,{style:{height:"1px",backgroundColor:"var(--w3-borderColor)",margin:"4px 0"}}),g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:b}),g.jsxs(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:[I," ",e]})]}),w&&g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:v}),g.jsx(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:w})]})]})}),g.jsx(oe,{radius:"lg",p:"xs",style:{flex:"0 0 40%",backgroundColor:"var(--w3-qrCardBackground)",border:"1px solid var(--w3-borderColor)",height:"140px",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(F,{style:{width:"100%",aspectRatio:"1",maxWidth:"120px",margin:"0 auto"},children:g.jsx(si,{style:{width:"100%",height:"100%"},children:U?g.jsx(q,{size:"xs",style:{color:"var(--w3-danger)"},children:"Error"}):E?g.jsx(he,{src:E,alt:"Payment QR Code",style:{width:"100%",height:"100%"}}):g.jsx(pe,{})})})})]}),g.jsxs(Rt,{w:"100%",gap:2,style:{marginTop:"auto",marginBottom:"8px"},children:[g.jsxs(q,{fw:700,tt:"uppercase",style:{letterSpacing:"0.05em",fontSize:"10px",color:"var(--w3-secondaryText)"},children:[e," Address"]}),g.jsx(F,{px:"xs",py:4,style:{backgroundColor:"var(--w3-qrAddressBackground)",borderRadius:"12px",border:"1px solid var(--w3-borderColor)"},children:g.jsxs(ot,{gap:"xs",children:[g.jsx(q,{style:{flex:1,fontFamily:"monospace",fontSize:"9px",color:"var(--w3-qrAddressText)",wordBreak:"break-all",lineHeight:1.2},children:(Q=r.find(N=>N.currency===e&&N.network===n))==null?void 0:Q.address}),g.jsx(qt,{variant:"outline",radius:"lg",size:"lg",style:{backgroundColor:"transparent",border:"none",color:ht?"var(--w3-success)":"var(--w3-qrAddressText)"},onClick:()=>zt(null,null,function*(){const N=r.find(W=>W.currency===e&&W.network===n);N!=null&&N.address&&(yield W0(N.address))&&(wt(!0),setTimeout(()=>wt(!1),2e3))}),children:ht?g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g.jsx("polyline",{points:"20,6 9,17 4,12"})}):g.jsx(u0,{size:14})})]})})]}),g.jsx(F,{p:"md",style:{backgroundColor:"var(--w3-qrInstructionsBackground)",borderRadius:"12px",width:"100%"},children:g.jsxs(ot,{gap:"md",align:"flex-start",children:[g.jsx("div",{style:{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:g.jsx(f0,{size:16,style:{color:"var(--w3-qrInstructionsText)"}})}),g.jsxs(q,{size:"xs",style:{lineHeight:1.5,flex:1,color:"var(--w3-qrInstructionsText)"},children:["Send exactly"," ",g.jsxs(q,{component:"span",fw:700,style:{color:"var(--w3-text)"},children:[I," ",e]})," ","to complete your payment. The transaction will be confirmed automatically."]})]})})]})})]})},"qr-screen"):g.jsxs(F,{style:{height:"100%",display:"flex",flexDirection:"column",padding:"32px 24px 24px 24px",zIndex:1},children:[(c||s)&&g.jsx(Rt,{align:"center",gap:"xs",mb:"lg",style:{paddingLeft:"24px",paddingRight:"24px"},children:c?g.jsx(F,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx("div",{style:{height:"24px",width:"auto",color:"var(--w3-primaryText)"},dangerouslySetInnerHTML:{__html:c.startsWith("data:image/svg+xml;base64,")?atob(c.replace("data:image/svg+xml;base64,","")):`<img src="${c}" alt="Logo" style="height: 24px; width: auto;" />`}})}):s?g.jsxs(Rt,{align:"center",gap:4,children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--w3-text)"}}),g.jsx(q,{size:"lg",fw:700,style:{letterSpacing:"-0.02em",color:"var(--w3-primaryText)"},children:s})]}):null}),o&&g.jsx(F,{mb:"lg",style:{paddingLeft:"24px",paddingRight:"24px"},children:g.jsx(q,{size:"xs",fw:500,style:{color:"var(--w3-descriptionText)",textAlign:"center",maxWidth:"280px",lineHeight:1.5,margin:"0 auto"},children:o})}),g.jsxs(F,{style:{backgroundColor:"var(--w3-innerBackground)",borderRadius:"24px",padding:"24px",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[f&&g.jsxs(Rt,{align:"center",gap:4,mb:"xl",children:[g.jsxs(ot,{gap:"xs",align:"baseline",children:[g.jsx(q,{style:{fontSize:"32px",fontWeight:"bold",letterSpacing:"-0.02em",lineHeight:1,color:"var(--w3-amountText)"},children:I||"0"}),g.jsx(q,{size:"xl",fw:500,style:{letterSpacing:"-0.01em",color:"var(--w3-amountText)"},children:e})]}),d&&h&&g.jsxs(q,{size:"sm",style:{color:"var(--w3-usdText)"},children:["≈ $",(parseFloat(I||"0")*h).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})," ","USD"]})]}),g.jsxs(Rt,{gap:"xs",style:{flex:1,minHeight:0},children:[g.jsx(q,{size:"xs",fw:700,tt:"uppercase",style:{letterSpacing:"0.1em",fontSize:"11px",color:"var(--w3-subtitleText)",flexShrink:0},children:a}),g.jsx(F,{className:"w3-payment-methods-container",style:{overflow:"auto",flex:1},children:g.jsx(Rt,{gap:"xs",children:L.map(N=>{const W=N.exchange?`${N.vendor}-${N.source}-${N.exchange}-${N.from}-${N.to}`:`${N.vendor}-${N.source}-${N.from}-${N.to}`;let at="",mt="";if(N.vendor==="direct")at="Direct Payment",mt=`Send ${N.from} directly`;else if(N.exchange)at=`${N.name||N.exchange}`,mt=`Exchange via ${N.vendor.charAt(0).toUpperCase()+N.vendor.slice(1)}`;else{if(m)return null;at=`${N.name||N.source}`,mt="Wallet"}let K;if(N.vendor==="direct"&&N.from&&N.from in Gr)K=g.jsx(Ao,{currency:N.from,size:32});else if(N.exchange){const gt=N.exchange.toLowerCase();(gt==="coinbase"||gt==="binance"||gt==="kraken")&&(K=g.jsx(b0,{exchange:gt,size:32}))}else N.from&&N.from in Gr&&(K=g.jsx(Ao,{currency:N.from,size:32}));return g.jsx(h0,{id:W,name:at,description:mt,icon:K,fallbackText:at.substring(0,2).toUpperCase(),avatarColor:N.vendor==="direct"?"green":"blue",disabled:G===W,onClick:()=>_(W)},W)}).filter(Boolean)})})]})]})]},"payment-form")})}),g.jsx(y0,{})]})})})},ml="1.0.0",q0={W3_PAYMENTS_REACT_VERSION:ml};exports.W3PaymentWidget=G0;exports.W3_PAYMENTS_REACT_VERSION=ml;exports.default=q0;
25
+ `;return typeof a=="function"&&a(null,b),b},yr}var ta;function F0(){if(ta)return se;ta=1;const t=x0(),e=B0(),n=$0(),r=O0();function i(s,o,a,c,l){const u=[].slice.call(arguments,1),f=u.length,d=typeof u[f-1]=="function";if(!d&&!t())throw new Error("Callback required as last argument");if(d){if(f<2)throw new Error("Too few arguments provided");f===2?(l=a,a=o,o=c=void 0):f===3&&(o.getContext&&typeof l=="undefined"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(a=o,o=c=void 0):f===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(h,m){try{const y=e.create(a,c);h(s(y,o,c))}catch(y){m(y)}})}try{const h=e.create(a,c);l(null,s(h,o,c))}catch(h){l(h)}}return se.create=e.create,se.toCanvas=i.bind(null,n.render),se.toDataURL=i.bind(null,n.renderToDataURL),se.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),se}var _0=F0();const z0=wl(_0);function U0(i,s,o){return zt(this,arguments,function*(t,e,n,r={}){var a,c;try{let l=t;e&&n&&(l=`${e.toLowerCase()}:${t}?amount=${n}`);const u={errorCorrectionLevel:r.errorCorrectionLevel||"M",type:r.type||"image/png",quality:r.quality||.92,margin:r.margin||2,color:{dark:((a=r.color)==null?void 0:a.dark)||"#000000",light:((c=r.color)==null?void 0:c.light)||"#FFFFFF"},width:r.width||256};return yield z0.toDataURL(l,u)}catch(l){throw new Error(`Failed to generate QR code: ${l instanceof Error?l.message:"Unknown error"}`)}})}function W0(t){return zt(this,null,function*(){try{if(navigator.clipboard&&window.isSecureContext)return yield navigator.clipboard.writeText(t),!0;{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();const n=document.execCommand("copy");return document.body.removeChild(e),n}}catch(e){return!1}})}const H0="_widget_1upbe_3",ea={widget:H0},G0=({endpoint:t,currency:e,network:n,destinations:r,amount:i="",title:s="bits",description:o,subtitle:a="CHOOSE A PAYMENT METHOD",logo:c,theme:l="default",appearance:u,showAmount:f=!0,showUsdConversion:d=!1,usdRate:h,enableDirect:m=!0,transactionId:y,qrPaymentLabel:b="Paying:",qrReceivingLabel:v="Receiving:",qrReceivingAmount:w,qrDescription:x,customerId:T,idempotencyKey:M,callbackUrl:P,onInitiate:A,onComplete:C,onError:R,onClose:j})=>{var Q;const D=d0(l,u),[I]=S.useState(i),[L,B]=S.useState([]),[et,dt]=S.useState(!0),[G,X]=S.useState(null),[rt,it]=S.useState(!1),[E,O]=S.useState(""),[U,H]=S.useState(""),[ht,wt]=S.useState(!1);S.useEffect(()=>{zt(null,null,function*(){var W;try{const at=new URLSearchParams({currency:e,network:n}),gt=((W=(yield(yield window.fetch(`${t}/payment-methods?${at}`)).json()).methods)==null?void 0:W.filter(yt=>yt.to===e&&yt.network===n))||[],Ct=[];m&&Ct.push({vendor:"direct",source:"wallet",from:e,to:e,network:n,name:"Direct Payment"}),Ct.push(...gt),B(Ct)}catch(at){console.error("Failed to fetch payment methods:",at),R==null||R(new Error("Failed to load payment methods"))}finally{dt(!1)}})},[t,e,n,m,R]),S.useEffect(()=>{rt?zt(null,null,function*(){try{const W=r.find(mt=>mt.currency===e&&mt.network===n);if(!W){H("No destination address found");return}const at=yield U0(W.address,n,I,{width:176,margin:1});O(at),H("")}catch(W){H("Failed to generate QR code"),console.error("QR generation error:",W)}}):(O(""),H(""))},[rt,e,n,I,r]);const _=N=>zt(null,null,function*(){var at,mt;if(G)return;const W=L.find(K=>(K.exchange?`${K.vendor}-${K.source}-${K.exchange}-${K.from}-${K.to}`:`${K.vendor}-${K.source}-${K.from}-${K.to}`)===N);if(W){X(N);try{const K=r.find(Ct=>Ct.currency===e&&Ct.network===n);if(!K)throw new Error(`No destination address found for ${e} on ${n}`);const gt={amount:parseFloat(I),currency:W.from,customerId:T,address:K.address,transactionId:y,idempotencyKey:M,callbackUrl:P};if(yield A==null?void 0:A(gt),W.vendor==="direct"){it(!0);return}else{const Ct=yield window.fetch(`${t}/payments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:gt,method:W})}),yt=yield Ct.json();if(Ct.ok)if((at=yt.session)!=null&&at.id&&((mt=yt.session)!=null&&mt.vendor))try{const Se=window.atob(yt.session.id),Pn=(window.screen.width-500)/2,An=(window.screen.height-700)/2;window.open(Se,`${W.vendor}-checkout`,`width=500,height=700,left=${Pn},top=${An}`),C==null||C(yt)}catch(Se){console.error("Failed to decode checkout URL:",Se),C==null||C(yt)}else C==null||C(yt);else throw new Error(yt.message||"Payment failed")}}catch(K){R==null||R(K instanceof Error?K:new Error("Payment failed"))}finally{X(null)}}});return et?g.jsx(xr,{cssVariablesSelector:"[data-w3-payment-widget]",children:g.jsx(oe,{className:ea.widget,style:D,children:g.jsxs(Rt,{align:"center",justify:"center",h:"600px",children:[g.jsx(pe,{}),g.jsx(q,{children:"Loading..."})]})})}):g.jsx(xr,{cssVariablesSelector:"[data-w3-payment-widget]",children:g.jsx(oe,{shadow:"md",radius:"xl",p:0,className:ea.widget,style:p({height:"600px",backgroundColor:"var(--w3-mainBackground)"},D),"data-w3-payment-widget":!0,children:g.jsxs(F,{style:{position:"relative",overflow:"hidden",height:"100%",display:"flex",flexDirection:"column"},children:[j&&g.jsx(qt,{variant:"subtle",onClick:j,style:{position:"absolute",top:"16px",right:"16px",zIndex:20,color:"var(--w3-amountText, #000000)",backgroundColor:"var(--w3-innerBackground, #ffffff)",border:"1px solid var(--w3-borderColor, rgba(0, 0, 0, 0.1))",borderRadius:"50%",width:"24px",height:"24px",transition:"all 0.2s ease",minWidth:"24px",minHeight:"24px"},size:"sm",onMouseEnter:N=>{N.currentTarget.style.opacity="0.8",N.currentTarget.style.transform="scale(1.05)"},onMouseLeave:N=>{N.currentTarget.style.opacity="1",N.currentTarget.style.transform="scale(1)"},children:g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),g.jsx(F,{style:{flex:1,position:"relative",overflow:"hidden"},children:g.jsx(Sh,{mode:"wait",children:rt?g.jsx(e0.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:"easeInOut"},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"var(--w3-mainBackground)",borderRadius:"var(--mantine-radius-xl)",zIndex:10,overflow:"auto"},children:g.jsxs(F,{style:{height:"100%",display:"flex",flexDirection:"column",backgroundColor:"var(--w3-mainBackground)"},children:[g.jsxs(ot,{justify:"space-between",px:"xs",pt:"md",pb:"sm",style:{flexShrink:0},children:[g.jsx(qt,{variant:"subtle",onClick:()=>it(!1),style:{width:"40px",height:"40px",color:"var(--w3-primaryText)"},children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("polyline",{points:"15,18 9,12 15,6"})})}),g.jsxs(q,{fw:700,size:"sm",style:{textAlign:"center",flex:1,color:"var(--w3-primaryText)"},children:["Send ",e," to Complete Payment"]}),g.jsx(F,{style:{width:"40px"}})]}),g.jsx(F,{style:{flex:1,overflow:"auto",backgroundColor:"var(--w3-mainBackground)",display:"flex",flexDirection:"column",padding:"32px 24px 24px 24px"},children:g.jsxs(F,{w:"100%",style:{backgroundColor:"var(--w3-innerBackground)",borderRadius:"24px",padding:"24px",flex:1,display:"flex",flexDirection:"column"},children:[x&&g.jsx(q,{fw:600,size:"xs",ta:"center",mb:"xs",style:{color:"var(--w3-amountText)"},children:x}),g.jsxs(ot,{w:"100%",gap:"sm",justify:"space-between",wrap:"nowrap",children:[g.jsx(oe,{radius:"lg",p:"sm",style:{flex:"0 0 60%",backgroundColor:"var(--w3-qrCardBackground)",border:"1px solid var(--w3-borderColor)",height:"140px",display:"flex",flexDirection:"column",justifyContent:"center"},children:g.jsxs(Rt,{gap:2,children:[g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:"Network"}),g.jsx(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:n.toUpperCase()})]}),g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:"Token"}),g.jsx(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:e})]}),g.jsx(F,{style:{height:"1px",backgroundColor:"var(--w3-borderColor)",margin:"4px 0"}}),g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:b}),g.jsxs(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:[I," ",e]})]}),w&&g.jsxs(ot,{justify:"space-between",align:"baseline",children:[g.jsx(q,{fw:600,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:v}),g.jsx(q,{fw:700,style:{color:"var(--w3-qrCardText)",fontSize:"11px"},children:w})]})]})}),g.jsx(oe,{radius:"lg",p:"xs",style:{flex:"0 0 40%",backgroundColor:"var(--w3-qrCardBackground)",border:"1px solid var(--w3-borderColor)",height:"140px",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(F,{style:{width:"100%",aspectRatio:"1",maxWidth:"120px",margin:"0 auto"},children:g.jsx(si,{style:{width:"100%",height:"100%"},children:U?g.jsx(q,{size:"xs",style:{color:"var(--w3-danger)"},children:"Error"}):E?g.jsx(he,{src:E,alt:"Payment QR Code",style:{width:"100%",height:"100%"}}):g.jsx(pe,{})})})})]}),g.jsxs(Rt,{w:"100%",gap:2,style:{marginTop:"auto",marginBottom:"8px"},children:[g.jsxs(q,{fw:700,tt:"uppercase",style:{letterSpacing:"0.05em",fontSize:"10px",color:"var(--w3-secondaryText)"},children:[e," Address"]}),g.jsx(F,{px:"xs",py:4,style:{backgroundColor:"var(--w3-qrAddressBackground)",borderRadius:"12px",border:"1px solid var(--w3-borderColor)"},children:g.jsxs(ot,{gap:"xs",children:[g.jsx(q,{style:{flex:1,fontFamily:"monospace",fontSize:"9px",color:"var(--w3-qrAddressText)",wordBreak:"break-all",lineHeight:1.2},children:(Q=r.find(N=>N.currency===e&&N.network===n))==null?void 0:Q.address}),g.jsx(qt,{variant:"outline",radius:"lg",size:"lg",style:{backgroundColor:"transparent",border:"none",color:ht?"var(--w3-success)":"var(--w3-qrAddressText)"},onClick:()=>zt(null,null,function*(){const N=r.find(W=>W.currency===e&&W.network===n);N!=null&&N.address&&(yield W0(N.address))&&(wt(!0),setTimeout(()=>wt(!1),2e3))}),children:ht?g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g.jsx("polyline",{points:"20,6 9,17 4,12"})}):g.jsx(u0,{size:14})})]})})]}),g.jsx(F,{p:"md",style:{backgroundColor:"var(--w3-qrInstructionsBackground)",borderRadius:"12px",width:"100%"},children:g.jsxs(ot,{gap:"md",align:"flex-start",children:[g.jsx("div",{style:{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:g.jsx(f0,{size:16,style:{color:"var(--w3-qrInstructionsText)"}})}),g.jsxs(q,{size:"xs",style:{lineHeight:1.5,flex:1,color:"var(--w3-qrInstructionsText)"},children:["Send exactly"," ",g.jsxs(q,{component:"span",fw:700,style:{color:"var(--w3-text)"},children:[I," ",e]})," ","to complete your payment. The transaction will be confirmed automatically."]})]})})]})})]})},"qr-screen"):g.jsxs(F,{style:{height:"100%",display:"flex",flexDirection:"column",padding:"32px 24px 24px 24px",zIndex:1},children:[(c||s)&&g.jsx(Rt,{align:"center",gap:"xs",mb:"lg",style:{paddingLeft:"24px",paddingRight:"24px"},children:c?g.jsx(F,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx("div",{style:{height:"24px",width:"auto",color:"var(--w3-primaryText)"},dangerouslySetInnerHTML:{__html:c.startsWith("data:image/svg+xml;base64,")?atob(c.replace("data:image/svg+xml;base64,","")):`<img src="${c}" alt="Logo" style="height: 24px; width: auto;" />`}})}):s?g.jsxs(Rt,{align:"center",gap:4,children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--w3-text)"}}),g.jsx(q,{size:"lg",fw:700,style:{letterSpacing:"-0.02em",color:"var(--w3-primaryText)"},children:s})]}):null}),o&&g.jsx(F,{mb:"lg",style:{paddingLeft:"24px",paddingRight:"24px"},children:g.jsx(q,{size:"xs",fw:500,style:{color:"var(--w3-descriptionText)",textAlign:"center",maxWidth:"280px",lineHeight:1.5,margin:"0 auto"},children:o})}),g.jsxs(F,{style:{backgroundColor:"var(--w3-innerBackground)",borderRadius:"24px",padding:"24px",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[f&&g.jsxs(Rt,{align:"center",gap:4,mb:"xl",children:[g.jsxs(ot,{gap:"xs",align:"baseline",children:[g.jsx(q,{style:{fontSize:"32px",fontWeight:"bold",letterSpacing:"-0.02em",lineHeight:1,color:"var(--w3-amountText)"},children:I||"0"}),g.jsx(q,{size:"xl",fw:500,style:{letterSpacing:"-0.01em",color:"var(--w3-amountText)"},children:e})]}),d&&h&&g.jsxs(q,{size:"sm",style:{color:"var(--w3-usdText)"},children:["≈ $",(parseFloat(I||"0")*h).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})," ","USD"]})]}),g.jsxs(Rt,{gap:"xs",style:{flex:1,minHeight:0},children:[g.jsx(q,{size:"xs",fw:700,tt:"uppercase",style:{letterSpacing:"0.1em",fontSize:"11px",color:"var(--w3-subtitleText)",flexShrink:0},children:a}),g.jsx(F,{className:"w3-payment-methods-container",style:{overflow:"auto",flex:1},children:g.jsx(Rt,{gap:"xs",children:L.map(N=>{const W=N.exchange?`${N.vendor}-${N.source}-${N.exchange}-${N.from}-${N.to}`:`${N.vendor}-${N.source}-${N.from}-${N.to}`;let at="",mt="";if(N.vendor==="direct")at="Direct Payment",mt=`Send ${N.from} directly`;else if(N.exchange)at=`${N.name||N.exchange}`,mt=`Exchange via ${N.vendor.charAt(0).toUpperCase()+N.vendor.slice(1)}`;else{if(m)return null;at=`${N.name||N.source}`,mt="Wallet"}let K;if(N.vendor==="direct"&&N.from&&N.from in Gr)K=g.jsx(Ao,{currency:N.from,size:32});else if(N.exchange){const gt=N.exchange.toLowerCase();(gt==="coinbase"||gt==="binance"||gt==="kraken")&&(K=g.jsx(b0,{exchange:gt,size:32}))}else N.from&&N.from in Gr&&(K=g.jsx(Ao,{currency:N.from,size:32}));return g.jsx(h0,{id:W,name:at,description:mt,icon:K,fallbackText:at.substring(0,2).toUpperCase(),avatarColor:N.vendor==="direct"?"green":"blue",disabled:G===W,onClick:()=>_(W)},W)}).filter(Boolean)})})]})]})]},"payment-form")})}),g.jsx(y0,{})]})})})},ml="1.0.0",q0={W3_PAYMENTS_REACT_VERSION:ml};exports.W3PaymentWidget=G0;exports.W3_PAYMENTS_REACT_VERSION=ml;exports.default=q0;