PageSourceSearch

https://webshop.mymobilex.com/cdn/shopifycloud/checkout-web/assets/c1/PaymentErrorBanner.BNtKSHks.js

js mymobilex.com collected 2026-09-24 10:26:42 UTC 5,946 bytes, 1 lines download raw bytes

1import{h as J,u as v,f as me,T as q,A as X}from"./esnext-vendor.D7ldIee_.js";import{W as _e,e as Pe,bM as c,D as he,bN as Ee,bO as ve,bP as fe,bQ as be,bR as ge,bS as Se,bT as Ae,bU as Me,bV as Ce,bW as Re}from"./hydrate.ByRIsqvd.js";import{N as f,$ as j,aV as Te,cd as K,bC as N,ce as Ve,_ as Oe,cf as Ie,T as z,cg as Ne,ch as Be,an as Le,ac as Fe,a0 as De,ab as Ye,ci as we,cj as Ue,ck as Ge,cl as He,cm as ke,cn as xe,co as We,O as Qe,cp as qe,cq as ze,cr as Je,cs as Xe,ct as je,bb as Ke,cu as $e,cv as Ze}from"./addresses-is-address-empty.-MuOhIyI.js";import{h as ea,a as aa,u as ra}from"./hooks-useGeneralPaymentErrorMessage.CXe06B2R.js";function ta({bannerId:e,errorType:r,children:t,...n}){const{observability:i}=f(),{tone:y,...p}=n;return J(()=>{i.log("error_log_banner_error_banner_rendered","[Displayed Error] Error banner was rendered",{bannerId:e})},[e,i]),v(_e,{errorType:r,id:e,tone:y,...p,children:t})}function na(){const{checkout:e,i18n:r,shopPay:t}=f(),n=j(),{value:i}=n.paymentMethods,{value:y}=n.managedByMarketsPro,p=Ne({managedByMarketsPro:y}),s=me(()=>Te({checkout:e})),b=Pe(),{value:m}=n.deferredTotal,o=t.session.selectedPaymentMethod.value,g=t.session.paymentMethodOption.value,{hasViolations:S}=c(K),u=o&&N(o)?Ve(o.paymentAttributes.brand):void 0,A=Oe(),_=q(()=>{if(g?.name!=="SHOPIFY_INSTALLMENTS"){if(A.value||!o||b.value&&!m?.amount.amount)return!0;if(N(o)){if(S)return!1;const P=i?.filter(l=>l.type==="direct").flatMap(l=>l.paymentBrands);if(P&&P.length>0){const l=Ie(o.paymentAttributes);return l?P.includes(l):void 0}}return z(o)?oa(s.value,p,i):!0}},[g?.name,A.value,o,b.value,m?.amount.amount,S,i,s.value,p]),R=q(()=>{if(o&&_===!1){if(N(o))return u?r.translate("payment.brand_not_available",{brand:u}):r.translate("payment.generic_incorrect_card_info");if(z(o))return s.value?r.translate("payment_errors.payment_method_unavailable_with_subscriptions"):r.translate("payment.shop_pay_ideal_unavailable_error")}},[_,o,u,r,s.value]);return{paymentMethods:i,isSelectedPaymentMethodSupported:_,notSupportedError:R,label:u}}function oa(e,r,t){return!e&&r&&t?.some(n=>Be(n,["ideal"]))}function sa(e){const{i18n:r}=f();if(e&&e.code!=="SURVEY_EXITED")return r.translate("hsa_qualification_errors",{scope:e.code.toLowerCase()})}function ia(){const{i18n:e,checkout:r,embed:t,shop:n,shopPay:i}=f(),{delegatedPaymentInstrument:y,inventoryRecoverySignal:p}=Le(),{lastJourneyProgression:s}=Fe(),{progressing:b}=De(),{walletUsedForSubmissionSignal:m,inMemoryApplePayParts:{asPaymentMethod:o},receiptErrorSignal:g}=Ye(),{paymentMethods:S}=j(),{notSupportedError:u}=na(),{hasViolations:A,violations:_}=c(K),{hasViolations:R}=c(we),{hasViolations:P}=c(Ue),{hasViolations:l}=c(Ge),{hasViolations:$}=c(He),{violations:B}=c(ke),Z=!(s.value.type==="success"||s.value.type==="error"?s.value.negotiationStage==="completion":!1)&&B.size===1&&B.values().next().value.code==="PAYMENTS_METHOD",{hasViolations:ee}=c(xe),T=ve(),{hasError:ae,error:M}=fe(We),{hasError:re,error:te}=be(),{hasError:L}=ge(),{hasError:ne}=Se(),F=Ae(M?{type:"payment",code:M}:void 0),D=sa(te),C=Qe(),oe=C.generalPaymentError.value,h=C.generalPaymentErrorCode.value,se=ea(C.directPaymentErrors),Y=aa(C.directPaymentErrors),d=X(!1),ie=Me(),w=ra(oe,h),U=w&&!qe(h)&&!ze(h)&&!Je(h)&&!Xe(h),G=e.translate("order_errors.inventory_reservation_failure"),{hasViolations:H}=Ce(Ze),le=!!je(S.value).length,ce=Ke("billingAddress").value,ue=Re().value,de=m.value==="APPLE_PAY"||ue,pe=M==="INCORRECT_CVC"&&i?.session.selectedPaymentMethod.value?.paymentMethod==="CREDIT_CARD",V=n.hasFlagEnabled($e),O=V?p.value:void 0,k=O!=null&&O.receiptId===r.latestReceipt.value?.id,x=s.value.type==="failed"&&s.value.negotiationStage==="completion",W=!!(U||Y||T||x),I=k&&!O.dismissed&&!W;if(b.value)return{message:void 0,tone:"auto"};let a,E="critical";if(t&&r.configuration.isPaymentInstrumentsDelegationEnabled&&y.value&&H&&!ce&&(a=e.translate("payment_errors.payment_method_billing_address")),U&&(d.current=!0,E="warning",a=w),T&&(d.current=!0,a=T),(se||Y&&(d.current||V&&L))&&(a=e.translate("payment.generic_incorrect_card_info")),ae&&M&&F&&!
1d.current&&m.value!=="GOOGLE_PAY"&&(!de||o.value)&&!g.value&&!ie&&!pe&&(a=F),x&&s.value.type==="failed"&&(s.value.fetchFailed?a=e.translate("order_errors.network_failure"):s.value.reason==="decision_rule_block"?a=e.translate("payment_errors.generic_error"):a=e.translate("order_errors.creation_failure")),ne&&!d.current&&(a=e.translate("order_errors.creation_failure")),L&&(!V||!W)&&(k?I:!d.current)&&(a=G,I&&(E="critical")),re&&D&&!d.current&&(a=D),ee&&(a=e.translate("store_credit_errors.generic_error")),R&&(a=e.translate("payment.expired_payment_method")),A){const Q=[..._][0]?.nonLocalizedMessage?.split(":")[1]?.toLowerCase().trim();Q?a=e.translate("payment.brand_not_available",{brand:e.translate("payment_brand",{scope:Q})}):a=e.translate("payment.generic_incorrect_card_info")}l&&(a=e.translate("payment.generic_incorrect_card_info")),$&&(a=e.translate("payment_errors.method_not_available")),P&&(a=e.translate("payment_errors.generic_error")),Z&&(a=e.translate("payment_errors.available_methods_updated"),E="info"),u&&(a=u,E="critical"),le&&H&&(a=e.translate("address_management.invalid_billing_address_selected"));const ye=I&&a===G?r.latestReceipt.value?.id:void 0;return{message:a,tone:E,inventoryRecoveryReceiptId:ye}}function la({message:e,tone:r,inventoryRecoveryReceiptId:t}){const{observability:n}=f(),i=X(!!t).current;return J(()=>{t&&n.counter({name:"inventory_recovery_error_banner_displayed",value:1})},[t,n]),v(ca,{identifier:"PaymentErrorBanner",tone:r,suppressAutoFocus:i,children:e})}function Pa(){const e=ia();return e.message?v(la,{...e}):null}function ca({children:e,identifier:r,tone:t,suppressAutoFocus:n=!1}){return t==="critical"||t==="warning"?v(ta,{errorType:he.PaymentError,bannerId:r,tone:t,autoFocus:!n,focusable:n,children:e}):v(Ee,{tone:t,children:e})}export{ta as E,Pa as P,na as a,la as b,ca as c,ia as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.