PageSourceSearch

https://www.autowin.com/cdn/shopifycloud/checkout-web/assets/c1/PaymentOptionSelector.BniHd_t2.js

js autowin.com collected 2026-09-25 10:42:50 UTC 11,766 bytes, 1 lines download raw bytes

1import{l as K,e as Q,f as B,u as e,S as H,i as ee,k,h as w,q as v,T,A as I,p as me,G as pe,g as he,D as ge}from"./esnext-vendor.B9Da21W6.js";import{cZ as te,c_ as ve,cV as ne,d as se,c$ as fe,k as C,m as ae,P as x,aC as ye,aE as be,aF as _e,l as V,d0 as Se,U as Pe,I as Ae,B as ie,bh as Ie,f as Ce,bN as Me,b as Oe}from"./hydrate.CF3IlSyD.js";import{f as Be,d as we,e as Le,B as G}from"./components-PaymentMethodProgressionHost.DuKCuovc.js";import{S as y,a4 as q,T as Ne,cV as Te,V as Ee,cW as ke,cX as De,ao as Re,cY as Fe,aC as xe,cZ as Ve}from"./addresses-is-address-empty.BGrWgv25.js";import{f as He,D as qe}from"./useAddressMutationsWithNegotiation.BjJX2eLL.js";import{b as We}from"./hooks-useGeneralPaymentErrorMessage.a1mWTtsp.js";import{u as Ye}from"./hooks-useShopPayProgressIntercepts.7mx5Z_fd.js";import{B as ze}from"./BillingAddressSelector.DEEbwyai.js";import{a as Ue,C as E,b as je}from"./Choice.CCbxO-pR.js";import{u as Ge,P as $e}from"./components-VatNumberValidationField.6vGvCkF7.js";import{S as $}from"./ChangeCompanyLocationLink.BmWzR-vM.js";import{u as Ze}from"./hooks-useUpdateCheckoutAddress.DsrnUraV.js";import{C as Je}from"./localization-index.D3RV3cdP.js";import{C as Xe}from"./IncentiveBadge.DLkTuDX2.js";import{u as Ke,a as Qe}from"./OnePage.CoACQMeL.js";import{g as et}from"./app.DVBC5YLc.js";import{g as tt}from"./shop-pay-installments-monorail.D_xeQ-tY.js";import{I as nt}from"./hooks-useStableHostMethodsReferences.C8Jv9pLs.js";function qt({selectorShowsTiles:n,afterPaymentSelector:t,renderVaultingAgreementInline:a}){const l=We(),o=te(),{checkout:s,i18n:r,shopPay:i,source:d}=y(),u=ve(),m=ne(),c=se(),{paymentMethods:g}=q(),p=i.user.creditCards,f=K(Ye().creditCardDisabled),h=Q(null),b=B(()=>!(u.value||fe({checkout:s,source:d})?.pickupAddress)&&!m.value&&s.isShippingRequired.value),_=B(()=>at({identity:s.identity},{billingPosition:o,vaultedSections:c,showBillingAddressInContext:b})),M=B(()=>He({paymentMethods:g.value})),O=B(()=>st({identity:s.identity,i18n:r},{paymentMethodMustSupportInterestBearingLoans:s.installments.paymentMethodMustSupportInterestBearingLoans.value,supportedCountryOptions:s.installments.supportedCountryOptions.value,creditCards:p.value,creditCardDisabled:f.value})),L=e(qe,{blurValidationFieldDenylist:M.value,onSetFieldErrors:l,children:[e(Be,{vaultHandle:h}),e(C,{gap:"base",children:[e(it,{}),e(we,{billingAddressInContext:_.value,vaultHandle:h,selectorShowsTiles:n,afterPaymentSelector:t,renderVaultingAgreementInline:a})]})]});return e(ee,{when:O,fallback:L,children:N=>e(H,{children:[e(C,{gap:"small-400",children:[e(ae,{level:2,children:r.translate("credit_card_form.add_debit_card")}),e(x,{color:"subdued",children:N})]}),L]})})}function st({identity:n,i18n:t},{paymentMethodMustSupportInterestBearingLoans:a,supportedCountryOptions:l,creditCards:o,creditCardDisabled:s}){if(n.current.value!=="shopPay"||!a||!o.every(i=>s(i)))return null;const r=l.map(i=>i.label).join(", ");return r?t.translate("installments.installments_debit_cards_supported_countries",{countries:r}):t.translate("installments.installments_valid_debit_cards_fallback")}function at({identity:n},{billingPosition:t,vaultedSections:a,showBillingAddressInContext:l}){switch(n.current.value){case"shopPay":return t.value==="inContext"&&!a.value.payment;case"businessCustomer":return!0;default:return l.value}}function it(){return Le(),null}const ot="billing_address_selector",R="shipping_address",Z="custom_billing_address";function lt({renderFormOnly:n=!1}={}){const{i18n:t}=y(),a=ye(),{billingAddressOption:l}=Ne(),o=be(),s=l.value==="shipping"?R:Z,[r,i]=k([s]),{isBilling:d}=Ge().value,u=d?e($e,{}):null;w(()=>{i([s])},[s]);const m=v(p=>{const f=p[0]===R?"shipping":"custom";l.value=f,i(p),f==="shipping"&&o()},[l,o]);_e();const c=v(({billing:p})=>{p.value=!0},[]),g=v(({billing:p})=>{p.value=!1},[]);return e(ee,{when:()=>!n&&a.value!=="form",fallback:e($,{onValid:c,onInvalid:g,children:e(G,{children:u})}),children:e(Ue,{name:ot,values:r,onChange:m,variant:"block",children:[e(E,{value:R,accessibilityLabel:t.translate("payment.same_billing_address_label"),children:e(V,{type:"strong",children:t.translate("payment.same_billing_address_label")})}),e(E,{value:Z,selectedContent:e($,{onValid:c,onInvalid:g,children:e(G,{children:u})}),accessibilityLabel:t.translate("payment.different_billing_address_label"),children:e(V,{type:"strong",children:t.translate("payment.different_billing_address_label")})})]})})}const J=()=>{const{i18n:n,checkout:{identity:t}}=y(),a=rt({identity:t});return e(C,{accessibilityRole:"group",accessibilityLabelledBy:"billingAddress",gap:"base",children:[e(ae,{id:"billingAddress",level:2,children:n.translate("payment.billing_address_title")}),e(a,{})]})};function Wt({dynamicPaymentExtensions:n=[],children:t}){Se();const a=te(),l=ne(),{checkout:o}=y(),s=se(),r=Te({checkout:o}),i=s.value.payment&&s.value.billing&&!r,[d]=Ze(),u=T(()=>Object.values(Ee).some(c=>d===c),[d]),m=!i&&!l.value&&!u;return e(C,{gap:"base",children:[a.value==="beforePayment"&&m&&e(J,{}),t,a.value==="afterPayment"&&!u&&e(H,{children:[m&&e(J,{}),e(Pe,{customizations:n})]})]})}function rt({identity:n}){return n.current.value==="businessCustomer"?ze:lt}function ct(){const{checkout:{identity:n},shopPay:t}=y(),a=ke(),l=q().paymentMethods;return B(()=>{const o=a.value,s=t.user.installments.prequalifiedAmount.value,r=t.user.installments.credential.value,i=l.value?.find(m=>m.type==="wallet"&&m.name==="SHOPIFY_INSTALLMENTS"),d=n.current.value==="shopPay"&&o!=null&&i!=null&&o.amount>=Math.max(i.minPrice.amount,50)&&o.currencyCode===i.minPrice.currencyCode,u=s!=null&&o!=null&&(r?.requiresAdditionalInformation&&o.amount<=s.amount||!r?.requiresAdditionalInformation);return d&&u})}function dt({selectable:n}){const{userEvents:t,source:a,checkout:l,shop:o,shopPay:s,embed:r}=y(),{ineligibilityReasons:i}=l.installments,{isServiceAvailable:d}=s.installments,{isRejected:u}=s.user.installments,{isLoading:m}=s.session,c=Q(null),g=I(!1),p=K(n);function f(){const h=p.value,b=h?void 0:JSON.stringify(ut({ineligibilityReasons:i.value,serviceAvailable:d.value,userRejected:u.value}));t.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...tt(a,l,o,{embedPlatform:r?.platform,shopAppSurface:s.app.c
1onfig.surface}),eventType:De.OptionImpression,success:h,errorMessage:b}})}return me(()=>{const h=c.value;if(!h||m.value||g.current)return;const b=()=>{g.current=!0,pe(f)};if(!window.IntersectionObserver){b();return}const _=new IntersectionObserver(M=>{M.some(({isIntersecting:O})=>O)&&(_.disconnect(),b())},{threshold:1});return _.observe(h),()=>_.disconnect()}),v(h=>{c.value=h},[c])}function ut({ineligibilityReasons:n,serviceAvailable:t,userRejected:a}){return n.length>0?n:t?a?["user_rejected"]:["unknown"]:["installments_unavailable"]}const mt=1e4,F={error:"iovation_sandbox_error",init:"iovation_sandbox_initialize",fingerprint:"iovation_sandbox_fingerprint"};function pt({onComplete:n}){const t=I(null),a=I(),[l,o]=k(!1),{environment:{services:{shopServer:s}},observability:r}=y(),i=I(performance.now()),d=v(c=>{n(c),o(!0),a.current=c},[n]),u=v(({data:c,origin:g,source:p})=>{if(g==="null"&&p===t.current?.contentWindow&&typeof c.payload=="string"&&c.payload!=="")switch(c.action){case F.error:r.leaveErrorBreadcrumb("[Iovation] Fingerprint error",{error:c.payload}),d("");break;case F.fingerprint:r.histogram({name:"iovation_fingerprint_load_time",value:performance.now()-i.current}),d(c.payload);break}},[d,r]),m=v(()=>{t.current?.contentWindow&&t.current.contentWindow.postMessage({action:F.init},"*")},[]);return w(()=>(window.addEventListener("message",u),()=>{window.removeEventListener("message",u)}),[u]),w(()=>{const c=setTimeout(()=>{a.current===void 0&&(r.histogram({name:"iovation_fingerprint_load_time",value:performance.now()-i.current}),d(""))},mt);return()=>clearTimeout(c)},[d,r]),l?null:e(nt,{ref:t,id:"iovation_sandbox_iframe",sandbox:"allow-scripts",src:new URL("/pay/iovation",s.url).href,style:{display:"none"},onLoad:m})}function ht(n){const t=I(null),a=I(!1);return w(()=>{if(a.current)return;if(!window.IntersectionObserver){a.current=!0,n();return}const l=new IntersectionObserver(s=>{const r=s.some(({isIntersecting:i})=>i);o&&r&&(a.current=!0,l.unobserve(o),n())},{threshold:1}),o=t.current;return o&&l.observe(o),()=>{o&&l.unobserve(o)}},[n]),t}const gt="Pdl91",vt="n7rut",ft="_4PVkL",yt="a3kZU",bt="F1g68",_t="Wkh24",A={Wrapper:gt,Active:vt,NoAnimation:ft,Badge:yt,Icon:bt,Label:_t};function St(){const{prequalifiedAnimatedBadgeShowCounter:n}=Re(),[t,a]=k(!1),{i18n:l}=y(),o=l.translate("installments.installments_prequalified_status_badge"),s=ht(v(()=>{a(!0),n.value+=1},[n]));return e("div",{className:he(A.Wrapper,{[A.Active]:t},{[A.NoAnimation]:n.value>1}),ref:s,children:e("span",{className:A.Badge,children:[e("span",{className:A.Icon,children:e(Ae,{type:"check-circle",size:"fill"})}),e("span",{className:A.Label,children:o})]})})}const X=ge(function({title:t,subtitle:a,disabled:l,badge:o},s){const r=e(x,{color:l?"subdued":void 0,children:e(V,{type:"strong",children:t})}),i=e(x,{children:a});return o?e(C,{ref:s,gap:"small-100",children:[e(C,{direction:"inline",gap:"base",children:[r,e(St,{})]}),i]}):e(ie,{ref:s,children:[r,i]})});function Yt({ineligibilityReason:n}){const{observability:t,userEvents:a,i18n:l,source:o,checkout:s,shop:r,shopPay:i}=y(),[d,u]=k(!1),m=Ie(),{recordRetailEvent:c}=Ke(),{negotiate:g}=Ce(),{paymentMethods:p}=q(),f=et(i),h=ct(),b=Qe(),{payNowLabel:_,payNowSubtitle:M,installmentsLabel:O,installmentsSubtitle:L}=b.value,N=i.user.installments.prequalifiedAmount.value,W=i.installments.isServiceAvailable.value,D=i.session.paymentMethodOption.value,oe=T(()=>D?[D.name]:[],[D]),Y=i.user.installments.isRetryable.value,z=s.installments.isUnavailable.value,S=T(()=>!W||z&&!Y,[W,z,Y]),le=dt({selectable:!S}),re=T(()=>{if(h.value&&N&&!S)return"prequalified"},[h.value,S,N]),U=v(async()=>{d||(u(!0),await g({force:!1,fieldsToResolve:["taxes","paymentMethods"],include:["paymentLines"],customizeNegotiation:P=>(P.payment?.paymentLines.push({amount:{any:!0},paymentMethod:{walletPaymentMethodConfig:{name:"SHOPIFY_INSTALLMENTS"}}}),P)}))},[g,d]);w(()=>{f==="SHOPIFY_INSTALLMENTS"&&U()},[U,f]);const ce=v(([P="SHOPIFY_INSTALLMENTS"])=>{const de=Fe(p.value)?.availableLoanTypes,{action:j,method:ue}=Pt({paymentMethodName:P,availableLoanTypes:de});i.session.unstable_updatePaymentMethodOption(ue),m.value&&c(j),P==="SHOPIFY_INSTALLMENTS"&&t.log("payment_method_selected","[Installments] Payment method selected",{paymentMethodName:P}),a.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...xe(o,s,r),action:j}})},[p,i.session,m,t,a,o,s,r,c]);return e(H,{children:[S&&e(ie,{children:[e(Me,{heading:l.translate("payment_ux.payment.payment_option.installments_unavailable"),tone:"info",children:n||l.translate("payment.payment_option.installments_temporarily_unavailable")}),e(Oe,{blockSize:"base"})]}),e(Je.Provider,{value:!0,children:e(je,{presentation:"base",children:e(Xe,{name:"payment_method_options",title:l.translate("payment.payment_option.accessibility_label"),titleHidden:!0,onChange:ce,values:oe,children:[e(E,{value:"SHOP_PAY",children:e(X,{title:_,subt
1itle:M})}),e(E,{value:"SHOPIFY_INSTALLMENTS",disabled:S,children:[!S&&e(pt,{onComplete:i.setDeviceFingerprint}),e(X,{ref:le,title:O,subtitle:L,disabled:S,badge:re})]})]})})})]})}function Pt({paymentMethodName:n,availableLoanTypes:t}){if(n==="SHOP_PAY")return{action:"payment_method_pay_now",method:{type:"wallet",name:"SHOP_PAY"}};const a={type:"wallet",name:"SHOPIFY_INSTALLMENTS"};return Ve(t)?{action:"payment_method_interest_bearing_installments",method:a}:{action:"payment_method_installments",method:a}}export{qt as P,Wt as W,Yt as a,rt as g};

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.