PageSourceSearch

https://www.dubideli.com/cdn/shopifycloud/checkout-web/assets/c1/PaymentOptionSelector.i9lMvZXD.js

js dubideli.com collected 2026-09-30 09:52:14 UTC 11,829 bytes, 1 lines download raw bytes

1import{l as K,e as X,f as B,u as e,S as H,i as ee,k,h as w,q as v,T,A as I,o as me,G as pe,g as he,D as ge}from"./esnext-vendor.7EcvH7tF.js";import{d4 as te,d5 as ve,cZ as ne,d as se,d6 as ye,k as C,m as ae,P as x,aD as fe,aF as be,aG as _e,l as V,d7 as Se,U as Pe,I as Ae,B as ie,bo as Ie,f as Ce,bG as Me,b as Oe}from"./hydrate.DbBIWEk-.js";import{j as Be,h as we,i as Le,B as j}from"./components-PaymentMethodProgressionHost.DEHkO1Jd.js";import{Q as f,a2 as q,S as Ne,cY as Te,V as Ee,cZ as ke,aY as De,cA as Re,c_ as Fe,ax as xe,c$ as Ve}from"./utilities-previous.C42MP_Mw.js";import{f as He,D as qe}from"./useAddressMutationsWithNegotiation.ryiEffHM.js";import{b as Ye}from"./hooks-useGeneralPaymentErrorMessage.Boc21OFt.js";import{u as We}from"./hooks-useShopPayProgressIntercepts.DqGa6PRI.js";import{B as ze}from"./BillingAddressSelector.G91Nhhik.js";import{a as Ue,C as E,b as Ge}from"./Choice.BnQD4sDK.js";import{u as je,P as $e}from"./components-VatNumberValidationField.CaETE5xt.js";import{S as $}from"./ChangeCompanyLocationLink.C1XeDCDi.js";import{u as Ze}from"./hooks-useUpdateCheckoutAddress.C3DAjrtU.js";import{C as Je}from"./localization-index.DeoiIICN.js";import{C as Qe}from"./crypto-constants.BBKCG06j.js";import{u as Ke,a as Xe}from"./OnePage.CMKEepyV.js";import{g as et}from"./shop-pay-installments-monorail.DGxC6lQT.js";import{S as tt}from"./redemption-promotions.Dh9kbNQB.js";import{I as nt}from"./hooks-useStableHostMethodsReferences.Gbfqh2hO.js";function qt({selectorShowsTiles:s,afterPaymentSelector:t,renderVaultingAgreementInline:a}){const l=Ye(),o=te(),{checkout:n,i18n:r,shopPay:i,source:d}=f(),u=ve(),m=ne(),c=se(),{paymentMethods:g}=q(),p=i.user.creditCards,y=K(We().creditCardDisabled),h=X(null),b=B(()=>!(u.value||ye({checkout:n,source:d})?.pickupAddress)&&!m.value&&n.isShippingRequired.value),_=B(()=>at({identity:n.identity},{billingPosition:o,vaultedSections:c,showBillingAddressInContext:b})),M=B(()=>He({paymentMethods:g.value})),O=B(()=>st({identity:n.identity,i18n:r},{paymentMethodMustSupportInterestBearingLoans:n.installments.paymentMethodMustSupportInterestBearingLoans.value,supportedCountryOptions:n.installments.supportedCountryOptions.value,creditCards:p.value,creditCardDisabled:y.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:s,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:s,i18n:t},{paymentMethodMustSupportInterestBearingLoans:a,supportedCountryOptions:l,creditCards:o,creditCardDisabled:n}){if(s.current.value!=="shopPay"||!a||!o.every(i=>n(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:s},{billingPosition:t,vaultedSections:a,showBillingAddressInContext:l}){switch(s.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:s=!1}={}){const{i18n:t}=f(),a=fe(),{billingAddressOption:l}=Ne(),o=be(),n=l.value==="shipping"?R:Z,[r,i]=k([n]),{isBilling:d}=je().value,u=d?e($e,{}):null;w(()=>{i([n])},[n]);const m=v(p=>{const y=p[0]===R?"shipping":"custom";l.value=y,i(p),y==="shipping"&&o()},[l,o]);_e();const c=v(({billing:p})=>{p.value=!0},[]),g=v(({billing:p})=>{p.value=!1},[]);return e(ee,{when:()=>!s&&a.value!=="form",fallback:e($,{onValid:c,onInvalid:g,children:e(j,{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(j,{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:s,checkout:{identity:t}}=f(),a=rt({identity:t});return e(C,{accessibilityRole:"group",accessibilityLabelledBy:"billingAddress",gap:"base",children:[e(ae,{id:"billingAddress",level:2,children:s.translate("payment.billing_address_title")}),e(a,{})]})};function Yt({dynamicPaymentExtensions:s=[],children:t}){Se();const a=te(),l=ne(),{checkout:o}=f(),n=se(),r=Te({checkout:o}),i=n.value.payment&&n.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:s})]})]})}function rt({identity:s}){return s.current.value==="businessCustomer"?ze:lt}function ct(){const{checkout:{identity:s},shopPay:t}=f(),a=ke(),l=q().paymentMethods;return B(()=>{const o=a.value,n=t.user.installments.prequalifiedAmount.value,r=t.user.installments.credential.value,i=l.value?.find(m=>m.type==="wallet"&&m.name==="SHOPIFY_INSTALLMENTS"),d=s.current.value==="shopPay"&&o!=null&&i!=null&&o.amount>=Math.max(i.minPrice.amount,50)&&o.currencyCode===i.minPrice.currencyCode,u=n!=null&&o!=null&&(!i?.cbtEnabled||n.currencyCode===o.currencyCode)&&(r?.requiresAdditionalInformation&&o.amount<=n.amount||!r?.requiresAdditionalInformation);return d&&u})}function dt({selectable:s}){const{userEvents:t,source:a,checkout:l,shop:o,shopPay:n,embed:r}=f(),{ineligibilityReasons:i}=l.installments,{isServiceAvailable:d}=n.installments,{isRejected:u}=n.user.installments,{isLoading:m}=n.session,c=X(null),g=I(!1),p=K(s);function y(){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:{...et(a,l,o,{embedPlatform:r?.platform,shopAppSurface:n.app.c
1onfig.surface}),eventType:tt.OptionImpression,success:h,errorMessage:b}})}return me(()=>{const h=c.value;if(!h||m.value||g.current)return;const b=()=>{g.current=!0,pe(y)};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:s,serviceAvailable:t,userRejected:a}){return s.length>0?s: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:s}){const t=I(null),a=I(),[l,o]=k(!1),{environment:{services:{shopServer:n}},observability:r}=f(),i=I(performance.now()),d=v(c=>{s(c),o(!0),a.current=c},[s]),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",n.url).href,style:{display:"none"},onLoad:m})}function ht(s){const t=I(null),a=I(!1);return w(()=>{if(a.current)return;if(!window.IntersectionObserver){a.current=!0,s();return}const l=new IntersectionObserver(n=>{const r=n.some(({isIntersecting:i})=>i);o&&r&&(a.current=!0,l.unobserve(o),s())},{threshold:1}),o=t.current;return o&&l.observe(o),()=>{o&&l.unobserve(o)}},[s]),t}const gt="Pdl91",vt="n7rut",yt="_4PVkL",ft="a3kZU",bt="F1g68",_t="Wkh24",A={Wrapper:gt,Active:vt,NoAnimation:yt,Badge:ft,Icon:bt,Label:_t};function St(){const{prequalifiedAnimatedBadgeShowCounter:s}=De(),[t,a]=k(!1),{i18n:l}=f(),o=l.translate("installments.installments_prequalified_status_badge"),n=ht(v(()=>{a(!0),s.value+=1},[s]));return e("div",{className:he(A.Wrapper,{[A.Active]:t},{[A.NoAnimation]:s.value>1}),ref:n,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 Q=ge(function({title:t,subtitle:a,disabled:l,badge:o},n){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:n,gap:"small-100",children:[e(C,{direction:"inline",gap:"base",children:[r,e(St,{})]}),i]}):e(ie,{ref:n,children:[r,i]})});function Wt({ineligibilityReason:s}){const{observability:t,userEvents:a,i18n:l,source:o,checkout:n,shop:r,shopPay:i}=f(),[d,u]=k(!1),m=Ie(),{recordRetailEvent:c}=Ke(),{negotiate:g}=Ce(),{paymentMethods:p}=q(),y=Re(i),h=ct(),b=Xe(),{payNowLabel:_,payNowSubtitle:M,installmentsLabel:O,installmentsSubtitle:L}=b.value,N=i.user.installments.prequalifiedAmount.value,Y=i.installments.isServiceAvailable.value,D=i.session.paymentMethodOption.value,oe=T(()=>D?[D.name]:[],[D]),W=i.user.installments.isRetryable.value,z=n.installments.isUnavailable.value,S=T(()=>!Y||z&&!W,[Y,z,W]),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(()=>{y==="SHOPIFY_INSTALLMENTS"&&U()},[U,y]);const ce=v(([P="SHOPIFY_INSTALLMENTS"])=>{const de=Fe(p.value)?.availableLoanTypes,{action:G,method:ue}=Pt({paymentMethodName:P,availableLoanTypes:de});i.session.unstable_updatePaymentMethodOption(ue),m.value&&c(G),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,n,r),action:G}})},[p,i.session,m,t,a,o,n,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:s||l.translate("payment.payment_option.installments_temporarily_unavailable")}),e(Oe,{blockSize:"base"})]}),e(Je.Provider,{value:!0,children:e(Ge,{presentation:"base",children:e(Qe,{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(Q,{title:_,subt
1itle:M})}),e(E,{value:"SHOPIFY_INSTALLMENTS",disabled:S,children:[!S&&e(pt,{onComplete:i.setDeviceFingerprint}),e(Q,{ref:le,title:O,subtitle:L,disabled:S,badge:re})]})]})})})]})}function Pt({paymentMethodName:s,availableLoanTypes:t}){if(s==="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,Yt as W,Wt 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.