PageSourceSearch

https://counterculturecoffee.com/cdn/shopifycloud/checkout-web/assets/c1/component-ApplePayButton.FD3NxrjC.js

js counterculturecoffee.com collected 2026-09-24 18:22:09 UTC 8,482 bytes, 1 lines download raw bytes

1import{u as e,i as A,A as z,q as y,h as G,e as F,g as O,f as N,p as D,G as U,l as Q,S as Z}from"./esnext-vendor.BBoIVOQW.js";import{T as V,aq as ee,bE as te,ag as ne,cw as ae,b3 as oe,cx as se,aN as ie}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{k as J,bR as _,a5 as le,bS as re,bT as ce,i as ue,aN as pe,B as q,P as de,L as me,l as ye,j as ve,ax as be,I as he,n as Pe,bi as Se,a4 as fe,bU as _e,bV as ge,C as Ae,F as Ce}from"./hydrate.Tsur0pib.js";import{A as we}from"./app.CUBUOQtX.js";import{T as ke}from"./TransitionHeight.BCpWGRvL.js";import{S as $,b as Le}from"./hooks-useWalletsTimeout.BmMXm9Gc.js";import{c as xe}from"./localization-index.P2wbDjPJ.js";import{s as j}from"./components-DeliveryTransition.Dys1ZJbh.js";import"./shared-permissions.DW7FOCqf.js";import"./hooks-useShopPayExternalAppContext.YLtTu3k6.js";import"./Page.B9pV9lua.js";import"./useShopPayButtonClassName.BGKzXWjH.js";import"./shared-shop-theme.Bl1CDyC7.js";import"./hooks-useShowShopPayOptin.BPTq9EIX.js";import"./AddressPresenter.Ce4uWLSc.js";import"./hooks-useShouldRevealCustomization.1KSlt0eq.js";import"./shop-pay-installments-types._vopm3yK.js";import"./hooks-useForceShopPayUrl.z4AJBm7B.js";import"./ChangeCompanyLocationLink.a6EWibK9.js";import"./BillingAddressForm.BMqAGUql.js";import"./shipping-methods-grouping.S_i1LuzE.js";import"./amazon-pay-useAmazonPayPaymentLine.CMgi35Fb.js";import"./PhoneField.D8EvZ0Pm.js";import"./hooks-useSuppressShopPayModalOnLoad.CwH45iIp.js";import"./components-RedirectionNotice.module.qsrQCJ0v.js";import"./Choice.18syyoW7.js";import"./Checkbox.dqdh-9I_.js";import"./ImpressionEventCapture.IVS9ZWTI.js";import"./ShopPayLogo.DdN9PLvG.js";import"./cross-border-hooks.BN4C-Hww.js";import"./shop-pay-installments-monorail.wQxzDho3.js";import"./hooks-useShopPayNewSignupLoginExperiment.CXtCCSeF.js";import"./IncentiveBadge.DttARc72.js";import"./Section-SectionStyleOverride.DC78UZTk.js";import"./AutocompleteField-hooks.Cs2Bn4N3.js";import"./PendingShipping.B15tiX3F.js";function Ee({body:v}){return e(re,{children:e(le,{dangerouslySetInnerHTML:{__html:v.value??""},scrollableContent:"all"})})}function Me({body:v,loading:C,error:w}){const{i18n:S}=V();return e(A,{when:w,fallback:e(A,{when:C,fallback:e(Ee,{body:v}),children:e(J,{gap:"base",children:[e(_,{lines:2,lastLineSize:"large"}),e(_,{lines:3,lastLineSize:"small"}),e(_,{lines:2,lastLineSize:"base"}),e(_,{size:"extraLarge",lastLineSize:"large",lines:1}),e(_,{lines:7,lastLineSize:"small"}),e(_,{lines:3,lastLineSize:"base"})]})}),children:S.translate("bad_request.title")})}const He="VqsW7",Ie="c1X76",Re="JtAjb",g={SubscriptionConsentModal:He,Views:Ie,Pane:Re,"Pane-outgoing":"otCH1"};function Be({id:v,canConfirm:C,onConfirm:w,onHide:S,onShow:r}){const{i18n:b,shop:i}=V(),{checkoutProtocolModalEventSignal:c}=ee(),k=b.translate("payment.purchase_options_cancellation_policy_label"),L=i.merchantPolicies.find(({handle:m})=>m===$),a={handle:$,shopId:i.id,shopName:i.name,squareLogo:i.brandSettings?.squareLogo,name:k,url:L?.url??""},o=te(ce,{defaultPolicy:a,policies:[a]}),f=z(!1),s=y(()=>{f.current&&c.value==="applePaySubscriptionConsent"&&(c.value="none"),f.current=!1},[c]);G(()=>s,[s]);const n=F(!1),u=F(!1),I=z(null),h=ue(),p=pe(n.value,"slow"),l=n.value||u.value,T=!n.value||u.value,x=y(m=>{I.current=m,m&&(m.dataset.inertSupported=String("inert"in m))},[]),E=b.translate("wallets.continue_with",{walletName:b.translate("brand.apple_pay")}),M=n.value?xe(k):b.translate("payment.purchase_options_subscription_confirmation_title"),R=y(()=>{o.show(),n.value=!0},[o,n]),P=y(()=>{o.hide(),n.value=!1},[o,n]),B=y(()=>{u.value=!0,o.hide(),s(),S()},[u,o,s,S]),W=y(()=>{n.value=!1,u.value=!1,f.current=!0,c.value="applePaySubscriptionConsent",r()},[n,u,c,r]);return e(Se,{id:v,heading:e(J,{direction:"inline",alignItems:"center",gap:"base",children:[e(A,{when:n,children:e(be,{type:"button",padding:"small-400",borderRadius:"base",accessibilityLabel:b.translate("account_management.back"),onClick:P,children:e(he,{type:"arrow-left",size:"base"})})}),e(Pe,{level:1,autoFocus:!0,children:M},n.value?"policy":"consent")]}),accessibilityLabel:M,onShow:W,onHide:B,actionLayout:"stacked",primaryAction:e(ve,{variant:"primary",type:"button",inlineSize:"fill",disabled:!C.value,onClick:w,children:E}),children:e(q,{className:g.SubscriptionConsentModal,children:e(ke,{c
1ontentRef:I,children:e(q,{ref:x,className:g.Views,padding:"small-200",overflow:"hidden",children:[e(A,{when:()=>h?!n.value:p!=="entered",children:e(q,{className:O(g.Pane,n.value&&g["Pane-outgoing"]),"data-side":"backward","data-visible":!n.value&&(h||p!=="exit"),position:n.value?"absolute":"relative",inert:l,children:e(de,{children:e(Le,{buttonLabel:E,cancellationPolicyLink:L?e(me,{tone:"monochrome",onClick:R,children:e(ye,{children:k})}):void 0})})})}),e(A,{when:()=>h?n.value:p!=="exited",children:e(q,{className:O(g.Pane,!n.value&&g["Pane-outgoing"]),"data-side":"forward","data-visible":n.value&&(h||p!=="enter"),position:n.value?"relative":"absolute",inert:T,children:e(Me,{body:o.policyBody,loading:o.loading,error:o.error})})})]})})})})}const Ne=Ce("ApplePaySubscriptionConsentModal");function Pt({supportedNetworks:v,color:C}){const{acceleratedWalletPaymentMethods:w,applePaySessionHandler:S,inMemoryApplePayParts:{buttonStatus:r,paymentSheetError:b}}=ne(),i=N(()=>{const t=S.value;return t?.createSession==null||t.showApplePayPaymentSheet==null?null:{createSession:t.createSession,openApplePayPaymentSheet:t.showApplePayPaymentSheet}}),c=z({status:"rendered"});D(()=>{const t=i.value!=null,H=r.value;t&&H.status==="not_rendered"?U(()=>{r.value=c.current}):!t&&H===c.current&&U(()=>{r.value={status:"not_rendered"}})}),G(()=>()=>{r.value===c.current&&(r.value={status:"not_rendered"})},[r]);const k=fe(),L=z(null),{observability:a,i18n:o,checkout:f}=V(),{wallets:s}=f,n=Q(_e()),u=N(()=>ae({hasSubscription:oe({checkout:f}),isApplePayAvailable:w.value.some(({name:t})=>t==="APPLE_PAY"),variant:n.value})),{showOverlay:I,hideOverlay:h}=ge(),p=Ae(void 0,Ne),l=F(!1),T=y(()=>{l.value=!0,a.log("apple_pay_subscription_consent_modal_opened","Apple Pay subscription consent modal opened")},[l,a]),x=y((t="dismissed")=>{l.value&&(l.value=!1,a.log("apple_pay_subscription_consent_modal_closed","Apple Pay subscription consent modal closed",{reason:t}))},[l,a]),E=()=>{a.log("apple_pay_button_clicked_while_loading","Apple Pay button clicked while already loading the payment sheet. Ignoring click.")},M=()=>{a.error(new we("Apple Pay button clicked without a ready session handler."))},R=t=>{if(s.activeSession.value?.wallet==="APPLE_PAY"){E();return}const Y=i.value;if(!Y){M();return}try{Y.openApplePayPaymentSheet(Y.createSession({supportedNetworks:v,...t&&{subscriptionConsent:t}}).session),t==="explicit_modal"&&s.activeSession.value?.wallet==="APPLE_PAY"&&a.log("apple_pay_subscription_consent_session_started","Apple Pay session started after subscription consent")}catch(d){const K={error:d,errorName:d instanceof Error?d.name:"Unknown",errorMessage:d instanceof Error?d.message:String(d),...d instanceof Error&&d.stack&&{errorStack:d.stack}};a.leaveErrorBreadcrumb("Failed to create Apple Pay session",K),b.value={type:"failed_to_create_session"},s.activeSession.value?.wallet==="APPLE_PAY"&&s.clearActiveSession({invokingWallet:"APPLE_PAY"})}},P=N(()=>u.value==="explicit_modal"),B=N(()=>l.value&&P.value&&i.value!=null&&s.activeSession.value==null);D(()=>{if(!l.value)return;(!P.value||i.value==null||s.activeSession.value!=null)&&(x("invalidated"),h(p))});const W=()=>{const t=s.activeSession.value;if(t?.wallet==="APPLE_PAY"){E();return}const H=u.value;if(P.value){if(t){a.log("apple_pay_subscription_consent_blocked_by_active_wallet","Apple Pay subscription consent blocked by another active wallet.",{activeWallet:t.wallet,requestedWallet:"APPLE_PAY"});return}if(!i.value){M();return}L.current?.focus({preventScroll:!0}),I(p);return}R(H)},m=()=>{B.value&&(a.log("apple_pay_subscription_consent_confirmed","Apple Pay subscription consent confirmed"),x("confirmed"),h(p),R("explicit_modal"))},X=i.value!=null;return e(Z,{children:[e("button",{ref:t=>{L.current=t,k("apple_pay")(t)},className:O(j.ApplePayButton,j[C],ie.borderRadius,se({focusRing:"base"})),lang:o.locale,disabled:!X,onClick:W,type:"button","aria-label":o.translate("brand.apple_pay"),"aria-haspopup":P.value?"dialog":void 0}),e(A,{when:()=>P.value||l.value,children:e(Be,{id:p,canConfirm:B,onShow:T,onHide:x,onConfirm:m})})]})}export{Pt as ApplePayButton};

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.