PageSourceSearch

https://www.heidicarey.com/cdn/shopifycloud/checkout-web/assets/c1…ayButton-StickyPayButton.module.C7bJOHW4.js

js heidicarey.com collected 2026-09-26 20:59:49 UTC 12,964 bytes, 1 lines download raw bytes

1import{u as h,S as N,f as y,q as f,T as x,l as R}from"./esnext-vendor.B9Da21W6.js";import{P as U,l as G,dJ as q,Z as K,B as k,dK as J,dL as Y,bX as M,bx as $,dM as F,n as V,J as H,f as j,bq as X}from"./hydrate.DZ4YTm7p.js";import{S as c,a4 as Z,T as I,dr as z,bC as Q,ds as w,dt as ee,du as O,a3 as te,c0 as ne,dv as se,ae as A,au as oe,aB as re,dw as ae,aA as ie,dx as le,dy as ue,dz as E,dA as ce}from"./addresses-is-address-empty.Bn2lNY_L.js";import{S as de}from"./Switch.jEKUIqPZ.js";import{u as pe,c as he,d as Pe,e as me}from"./hooks-useWalletsTimeout.CS-oFfve.js";import{s as ye}from"./PayButton-helpers.Cc_ffyKs.js";import{a as fe}from"./app.DbSrjjlA.js";import{g as ge,a as _e,b as Se}from"./cvv-cvvBridge.B-VIACTq.js";import{S as ve}from"./graphql-PaymentSessionMutation.CAXCwUvV.js";import{v as be,a as Ee,u as ke}from"./useShopPayButtonClassName.FG1djxr9.js";import{u as Ce}from"./AddressPresenter.BIgrto4P.js";import{u as Ie,a as L}from"./hooks-payment-button.CEm7ZXVs.js";function Et({line:e}){const{i18n:t,source:s}=c(),n=s.type==="paymentCollection",{title:o,lineAmount:r}=e,a=r.amount===0?t.translate("shipping.free_rate_label"):t.formatCurrency(r.amount,{currency:r.currencyCode,form:"short"}),i=r.amount===0?"uppercase":void 0;return h(U,{children:[o,n?null:h(N,{children:[" · ",h(G,{type:"strong",letterCase:i,children:a})]})]},o)}const C="shop-pay-hsa-details",T=`${C}-description`;function Ae(){const{checkout:e,shop:t,shopPay:s}=c(),n=Z().paymentMethods,{paymentLines:o}=I();return y(()=>{if(!(t.hasFlagEnabled(z)&&Be({identity:e.identity})&&Q(n.value))||s.session.isInstallmentsSelected.value)return!1;const a=s.session.selectedPaymentMethod.value;if(a)return a.paymentMethod==="CREDIT_CARD";const i=o.value[0]?.method,l=i?.type==="wallet"&&i.name==="SHOP_PAY"?i.walletContent:void 0,u=l!=null&&"paymentMethod"in l&&l.paymentMethod==="CREDIT_CARD";return i?.type==="direct"||u})}function Be({identity:e}){return e.current.value==="shopPay"}function kt(){const{shopPay:e}=c(),t=Ae();return y(()=>t.value&&e.session.hsaRequested.value)}function Ct(){const{i18n:e,shopPay:t}=c(),s=y(()=>t.session.hsaRequested.value),n=e.translate("payment.shop_pay_hsa.description"),o=f(r=>{t.session.unstable_setHsaRequested(r)},[t.session]);return h(k,{background:"base",colorLayer:"control",border:"base",borderRadius:"base",children:[h("span",{id:T,hidden:!0,children:n}),h(q,{id:C,open:s.value,summary:h(k,{padding:"base",children:h(de,{label:e.translate("payment.shop_pay_hsa.label"),checked:s.value,onChange:o,icon:"none","aria-controls":`${C}-content`,"aria-describedby":T})}),content:h(N,{children:[h(K,{}),h(k,{padding:"base",children:h(U,{type:"small",color:"subdued",children:n})})]})})]})}function It(e){return x(()=>e.some(t=>{if(t.kind==="customField")return w(t).required.peek();const s=w(t);return s.behaviors.peek().blockProgress&&s.capabilities.blockProgress}),[e])}function Re(){const{shop:e,shopPay:{user:t}}=c();return e.hasFlagEnabled(ee)?!1:t.getExperimentAssignment(O)===O.variants.treatment}function D(){const e=c(),{shop:t}=e,s=pe(),n=te(),o=t.hasFlagEnabled(ne);return y(()=>se(e.checkout,{showPayWithApplePayButton:s.value,paymentFullyCoveredByRedeemablesAndGiftCards:n.value,isApplePayInShopPayKillswitched:o}))}function we(){return J()?.config?.payActionType==="NATIVE"}function Oe(){const{persistedGooglePaySignal:e}=A(),{checkout:t}=c();return y(()=>{const s=e.value?.receiptIdForPaymentFailure,n=t.latestReceipt.value;return!!(n?.status==="failed"&&n?.failure?.type==="payment"&&s&&n?.id===s)})}function Te(){const{checkout:{identity:e}}=c(),{paymentLines:t}=I(),{inMemoryGooglePayParts:{paymentSheetOpenPromise:s}}=A(),n=Oe();return y(()=>e.current.value!=="googlePay"||!oe(t.value,"GOOGLE_PAY")?!1:s?.value!==void 0?!0:n.value)}function Ne(){const e=c(),{checkout:t,shopPay:s}=e,n=t.identity.current.value==="shopPay",o=he().value,r=Te().value,a=Pe().value,i=!n&&o&&!a,l=!n&&r,{showApplePay:u,isApplePayInShopPay:d}=D().value,m=me(),p=we(),g=Y(),_=Re();return{kind:ye(t,{showPayWithPayPal:i,showApplePay:u&&!a,showPayWithGooglePay:l,isEmbeddedCheckout:m,shouldRenderCheckoutProtocolButton:p,isInstallmentsSupported:g!=null,isInstallmentsSelected:s.session.isInstallmentsSelected.value,isInstallmentsUkHoldoutTreatment:_}),showPayWithPayPal:i,isApplePayInShopPay:d,shouldDeferWalletToReview:a}}function xe(){const{source:e,checkout:t,shop:s,shopPay:n,observability:o,userEvents:r}=c(),a=n.installments,i=n.user.installments;return f(()=>{i.isRejected.value&&!i.isRetryable.value||(a.unstable_setModalOpen(!0,"checkout_button"),o.log("installments_modal_opened","[Installments] Modal opened"),r.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...re(e,t,s),action:"continue_with_installments"}}))},[a,i,o,r,e,t,s])}function Ue({existing:e,scope:t,next:s}){return[...e.filter(n=>!Me(n.target,t)),...s]}function Me(e,t){return e?e===t||e.startsWith(`${t}.`):!1}var P=(e=>(e.BlankEmail="blank_email",e.BlankPhone="blank_phone",e.InvalidEmail="invalid_email",e.InvalidPhone="invalid_phone",e.ShopAccountsInvali
1dEmail="shop_accounts_invalid_email",e.ShopAccountsInvalidPhone="shop_accounts_invalid_phone",e.ShopAccountsPhoneLimitReached="shop_accounts_phone_limit_reached",e))(P||{});function Fe(){const{email:e}=I(),{shopPay:t}=c();return y(()=>{const s=e.value.trim(),n=t.userVerification.value,o=be(s,P.BlankEmail),r=Ee(s,P.InvalidEmail),a=n.status==="invalid"&&n.email===s?P.InvalidEmail:void 0;return{email:s,emailError:o||r||a}})}const He=()=>{const{shopPay:e}=c(),t=e.signup.phoneNumber,s=e.signup.phoneCountryCode,n=Ce(),o=R(n.isPhoneNumberUtilLoaded),r=R(n.validatePhoneNumber),a=e.user.isAuthenticatedUser;return y(()=>({missingRequiredMobilePhoneNumber:!!(!a.value&&(!t.value||o.value&&!r.value(t.value,s.value,!0)))}))},Le="Mobile phone number is missing or invalid";function De(){const e=Fe(),{source:{checkoutSessionIdentifier:t},url:s,shopPay:n}=c(),o=n.user.phoneNumber,r=n.user.unstable_setPhoneNumber,{transactionParams:a}=n.config,i=n.user.isAuthenticatedUser,l=He(),u=f(async(d=!0)=>{const{email:m,emailError:p}=e.value;if(i.value||o.value)return{status:"skipped"};if(!a)return{status:"failed",errors:[{field:[],code:"missing_content",message:"Transaction params are missing"}]};const g=[];if(p&&g.push({field:["email"],code:p,message:"email is blank or invalid"}),l.value.missingRequiredMobilePhoneNumber&&g.push({field:["phone"],code:P.InvalidPhone,message:Le}),g.length>0)return{status:"failed",errors:g};let _=d?n.signup.hcaptchaToken.value:void 0;if(!_)try{const B=await n.signup.captchaRef.value?.execute({async:!0});B&&(_=B.response)}catch(b){return b==="challenge-closed"?{status:"failed",errors:[]}:{status:"failed",errors:[{field:["hcaptcha"],code:String(b),message:"A captcha error was caught and handled"}]}}let S=null;try{const b=n.signup.phoneNumber.value||"";S=await fetch(s.shopPayCreateUnverifiedUser(),{method:"POST",body:JSON.stringify({email:m,phone:b,hcaptcha_token:_,origin:"c1_unverified_user_signup",checkout_token:t,transaction_params:a}),headers:{"Content-Type":"application/json",accept:"application/json"}})}catch{return{status:"failed",errors:[{field:[],code:"unknown_error",message:"An error was caught and handled during API request"}]}}const v=await S.json();return S.status!==200?Array.isArray(v?.errors)&&v?.errors.length===1&&v?.errors[0].code==="further_authorization_required"&&d?(n.signup.unstable_setHcaptchaToken(void 0),u(!1)):{status:"failed",errors:v?.errors||[{field:[],code:`response_with_http_error_${S.status}`,message:"Failed to create user"}]}:(r(v.parsed_phone),n.user.unstable_setEmail(m),n.user.unstable_updateFlow("authenticated_user"),{status:"success"})},[i,o,a,e,l,r,n,s,t]);return{createUnverifiedUser:u}}function We(){const{i18n:e,shopPay:t,checkout:{validation:{contactErrors:{emailInputError:s}}}}=c(),n=M(),{openModal:o}=ke(),r={[P.BlankEmail]:e.translate("field_errors.email_blank"),[P.InvalidEmail]:e.translate("field_errors.email_invalid"),[P.ShopAccountsInvalidEmail]:e.translate("field_errors.email_invalid")},a={[P.BlankPhone]:e.translate("mobile_phone_number.mobile_phone_invalid"),[P.InvalidPhone]:e.translate("mobile_phone_number.mobile_phone_invalid"),[P.ShopAccountsInvalidPhone]:e.translate("mobile_phone_number.mobile_phone_invalid"),[P.ShopAccountsPhoneLimitReached]:e.translate("mobile_phone_number.phone_limit_reached")};return{handleCreateUnverifiedUserErrors:l=>{if(l.length===0)return;const u=l.map(p=>p.code),d=r[u.find(p=>p in r)],m=a[u.find(p=>p in a)];return d||m?(s.value=d,t.signup.unstable_setPhoneError(m)):o({type:ae.Generic}),Promise.resolve().then(()=>n())}}}function W(){const{source:e,observability:t,shopPay:{progressInterceptor:s}}=c(),n=ie(),{createUnverifiedUser:o}=De(),{handleCreateUnverifiedUserErrors:r}=We(),a=M();return{progressContinue:f(async()=>{try{const l=await o(),u=await s.runInterceptors();n.validationErrors.value=Ue({existing:n.validationErrors.value,scope:$,next:ge(u)});const d=_e(u);if(!d){const m=Se(u);t.log("shop_pay_progress_interceptor_error_reported","Shop Pay progress interceptor reported an error in useShopPayProgressContinue",{interceptorErrors:m})}if(l?.status==="failed")return r(l.errors),!1;if(!d)return qe(a),!1}catch(l){const u=l;
1return!le(u.message)&&!Ge(u)&&t.error(u,{errorClass:ve.ShopPayProgressIntercept,severity:"error",metadata:{source:{type:e.type},checkout:{token:e.checkoutSessionIdentifier??"checkout_identifier_undefined"}}}),!1}return!0},[o,a,r,s,n,t,e])}}function Ge(e){return fe.includes(e.name)}function qe(e){return Promise.resolve().then(()=>e())}function Ke(){const{checkout:{identity:e},shopPay:t,observability:s}=c(),n=F(),{progressContinue:o}=W(),r=xe(),a=f(async()=>{t.session.unstable_setButtonProgressing(!0),s.log("installments_cta_clicked","[Installments] Continue to purchase button clicked");try{await o()&&r()}finally{t.session.unstable_setButtonProgressing(!1)}},[t.session,s,o,r]);return n||e.current.value!=="shopPay"||!t.session.isInstallmentsSelected.value?null:a}function Je(){const{observability:e,source:t,router:s}=c(),{currentDetour:n,currentPage:o}=V().value,{nextPage:r,previousPage:a}=H();return x(()=>({ensureShopPayURL:()=>{o||s.navigate("/shoppay",{replace:!0})},logError:(i,{result:l}={})=>{e.error(new ue(i,{groupingHash:"ShopPayError::InvalidPageLogger"}),{severity:"error",metadata:{source:{type:t.type},checkout:{token:t.checkoutSessionIdentifier||t.sourceId},event:{currentDetour:JSON.stringify(n),currentPage:JSON.stringify(o),nextPage:JSON.stringify(r),previousPage:JSON.stringify(a),result:JSON.stringify(l)}}})}}),[n,o,e,r,a,s,t.checkoutSessionIdentifier,t.sourceId,t.type])}function Ye(){const{checkout:{identity:e},observability:t,shopPay:s}=c(),n=F(),{nextPage:o}=H(),{progress:r}=j(),{progressContinue:a}=W(),i=Je(),l=X(),u=Ie(),d=L({breadcrumbPrefix:E}),m=f(async()=>{if(d()){u();try{s.session.unstable_setButtonProgressing(!0),await a()?(t.leaveErrorBreadcrumb(`${E} - progress`),await r("shop-pay-progress-button-press",p=>{t.leaveErrorBreadcrumb(`${E} - progression`,{status:p.status,nextPageId:o.id}),o.id!=="thankYou"&&i.logError("Shop Pay button triggered progression when next page is not `thankYou`",{result:p})},{onProgressBlocked:()=>{t.leaveErrorBreadcrumb(`${E} - progress blocked`,{nextPageId:o.id}),i.ensureShopPayURL()}}),l.notify({checkout_in_progress:!0})):(t.leaveErrorBreadcrumb(`${E} - progress continue failed`,{nextPageId:o.id}),o.id!=="thankYou"&&(i.logError("Shop Pay button is pressed when next page is not `thankYou`"),i.ensureShopPayURL()))}finally{s.session.unstable_setButtonProgressing(!1)}}},[d,u,s.session,a,t,r,o,i,l]);return e.current.value!=="shopPay"||n?null:m}function $e(){const{showApplePay:e}=D().value,s=A().applePaySessionHandler.value?.onClickHandler??null,n=L({breadcrumbPrefix:ce,isApplePay:!0}),o=f(()=>{s?.({validateButtonPress:n})},[s,n]);return e&&s?o:null}function At(e){const{kind:t}=Ne(),s=$e(),n=Ye(),o=Ke();return t==="applePay"&&s?s:t==="installments"&&o?o:(t==="default"||t==="checkoutProtocol")&&n?n:e}const Ve="liLqL",je="b71fw",Bt={Button:Ve,Sparkles:je},Xe="OJbFq",Ze="wNUaA",Rt={Button:Xe,"Button-prefersDarkMode":"LhoYl",WalletLogoContainer:Ze},ze="XR3sZ",Qe="_4fPUS",et="_5FRe7",tt="ZDqoP",nt="zANgR",st="_3A6oJ",ot="K8y4t",rt="_7S3NK",at="SdyJr",wt={StickyFooter:ze,StickyFooterExperiment:Qe,StickyFooterAtBottom:et,StickyFooterBuffer:tt,SDKStickyFooterBuffer:nt,EmbedStickyFooterBuffer:st,ButtonContainer:ot,SDKButtonContainer:rt,EmbedButtonContainer:at},it="GsMGr",lt="eDhAI",ut="P0xJW",ct="COpTB",Ot={Wrapper:it,Container:lt,Section:ut,"Container-fixed":"iRlFp","Container-fixed-entering":"_24aJk","Container-fixed-exiting":"ktbnR","Container-fixed-enter":"PCKgT","Container-fixed-exited":"DvZWz",Shadow:ct,"Shadow-enter":"_0hDB9","Shadow-exiting":"P1NPi","Shadow-exited":"lQN1j"};export{Et as D,Ct as H,Re as a,Ae as b,Rt as c,wt as d,kt as e,W as f,xe as g,Ne as h,D as i,It as j,Ot as k,Ue as r,Bt as s,At 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.