1import{e,aa as o,W as a,oU as r,no as t,al as n,b3 as s}from"./4b4bc88f.DkycdxSK.js";import{q as i,s as c,k as u}from"./2c1ab0fe.qpvfywqb.js";import{Z as l,hT as p,fK as d,p as h}from"./164ad2e3.DcJn775M.js";function y(){const{shopPay:o}=e();return o}const f=()=>{const{shop:{hasStorefront:o,partnerStorefrontUrl:a},observability:r,url:t}=e();return{replaceShopPayInHistory:i(e=>{"undefined"!=typeof window&&(e?window.location.replace(e):o?(r.log("shop_pay_in_history_storefront_redirected","[Shop Pay] Redirecting to storefront url, as replacementUrl is not provided"),window.location.replace(a??t.storefront())):(r.counter({name:"shop_pay_cannot_replace_browser_history",value:1}),r.log("shop_pay_cannot_replace_browser_history","[Shop Pay] Unable to replace Shop Pay in browser history",{replacementUrl:e,storefrontUrl:t.storefront()})))},[o,a,r,t])}};function m(){const{clearForcedCheckoutLayout:e}=l(),{inMemoryAmazonPayParts:{serializedAmazonParams:t,buyerDetails:n}}=o(),s=i(()=>{e({wallet:a.AmazonPay}),r(t),n.value={loading:!1,error:!1,details:void 0}},[e,t,n]);return p({shouldResetCustomerInfo:!0,skipRedirect:!0,shouldRemovePaymentLine:!0,onClick:s})}function _(){const{isOnePage:o}=e().checkout.configuration.layout,a=t(),r=d();return i(()=>{o.value?r({shouldResetCustomerInfo:!0}):a()},[o,a,r])}const b=()=>{const{checkout:o}=e(),a=o.configuration.visibility.showAside,r=n(),t=h({base:!0,medium:!1}),s=c(a),i=c(t);return u(()=>!(s.value&&!i.value&&r.value))};var v=(e=>(e.Generic="generic",e.SignInFailed="sign_in_failed",e.ContinueWithShopPay="continue_with_shop_pay",e))(v||{});function w(){const{observability:o,source:a,shopPay:r}=e();return{openModal:i(e=>{r.user.isUnauthenticatedUser.value?r.session.unstable_setUnauthenticatedErrorModal(e):o.error(new s("Cannot open an unauthenticated error modal outside of the unauthenticated flow",{groupingHash:"ShopPayError::UnauthenticatedErrorModal"}),{severity:"error",metadata:{source:{type:a.type},checkout:{token:a.checkoutSessionIdentifier||a.sourceId},event:{modalType:e.type,shopPayFlow:r.user.flow.value}}})},[o,a,r])}}export{v as U,y as a,w as b,b as c,m as d,_ as e,f 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.