Module 6151

1,649 characters · in b724cb40e5042ef0.js, a3921770772213f8.js
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,l){l.d(t,{a:()=>g,v:()=>C}),l(321073);var n=l(627968),r=l(64700),a=l(355522),i=l(885574),s=l(691885),u=l(834730),o=l(939249),c=l(661531),d=l(990078),m=l(46054),x=l(812745),f=l(327105),h=l(375708),p=l(643892);let g="new_payment_source_id";function C(e){let{value:t,options:l,onChange:C,onNew:v,noticeMessage:y,newPaymentMethodOptionLabel:b,disabled:j=!1,error:A}=e,T=r.useMemo(()=>{let e=l.map(e=>{let t=null!=e.icon?e.icon===x.Be.BANK?(0,n.jsx)(a.M,{className:p.s7}):(0,n.jsx)("img",{src:(0,x.Nj)(e.icon),alt:"",className:p.s7}):void 0,l=null!=e.tooltipText?(0,n.jsx)(d.m,{text:e.tooltipText,asContainer:!0,children:(0,n.jsx)(i.m,{size:"xs",color:c.A.colors.TEXT_MUTED})}):void 0;return{id:e.id,value:e.id,label:e.label,leading:t,trailing:l,description:e.description,disabled:e.disabled}});return e.push({id:g,value:g,label:b??h.intl.string(f.default.rNF29q),leading:void 0,description:void 0}),e},[l,b]),N=r.useCallback(e=>{e===g?v():null!=e&&C(e)},[v,C]),L=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.l,{label:h.intl.string(h.t["u+Cw58"]),hideLabel:!0,placeholder:h.intl.string(f.default.rNF29q),value:t,options:T,onSelectionChange:N,selectionMode:"single",disabled:j||0===l.length,errorMessage:A,fullWidth:!0,variant:"unsupported_payment_modal_card"}),null!=y?(0,n.jsxs)("div",{className:p.T4,children:[(0,n.jsx)(i.m,{size:"xs",color:c.A.colors.TEXT_FEEDBACK_INFO}),(0,n.jsx)(u.E,{variant:"text-xs/normal",color:"text-feedback-info",children:"string"==typeof y?m.A.parse(y,!1,{allowLinks:!0}):y})]}):null]});return 0!==l.length||j?L:(0,n.jsx)(o.D,{onClick:v,"aria-label":h.intl.string(f.default.rNF29q),className:p.OV,children:L})}}