PageSourceSearch

https://braun-bueffel.com/cdn/shopifycloud/checkout-web/assets/c1/utils-useViolationsHandler.BE3Ij9oJ.js

js braun-bueffel.com collected 2026-09-28 05:54:31 UTC 2,439 bytes, 1 lines download raw bytes

1import{T as S,u as d,X as f,x as i,h as T,f as _,q as u}from"./esnext-vendor.B9Da21W6.js";import{P as p,ap as P,a6 as c,aq as v,ar as O,as as w,S as h,T as L,at as g,au as M}from"./addresses-is-address-empty.Bn2lNY_L.js";const k=p("CheckoutSheetProtocolSchemaContext");function V(e,o){e.postMessageToConsumer(o)}var x=(e=>(e.Continue="continue",e.Cancel="cancel",e))(x||{});class A{constructor(){this.listeners=new Set}listen(o){return this.listeners.add(o),()=>{this.listeners.delete(o)}}emit(o="continue"){this.listeners.forEach(t=>t(o))}}const y=f(void 0);function b(){const e=i(y);if(e==null)throw new P("Missing CheckoutProtocolEventContext");return e}function K(e){const o=b();T(()=>o.listen(e),[e,o])}function Y({children:e}){const o=S(()=>new A,[]);return d(y.Provider,{value:o,children:e})}const H=p("MobileCheckoutSdkSchemaContext");function I(){const e=i(k),o=i(H);if(!e&&!o)throw new P("No Checkout Sheet Protocol or Mobile Checkout SDK Schema context found");return e||o}const N=[{brand:"APPLE_PAY",flowType:"applePay"},{brand:"GOOGLE_PAY",flowType:"googlePay"},{brand:"PAYPAL_EXPRESS",flowType:"payPal"},{brand:"SHOPIFY_INSTALLMENTS",flowType:"shopifyInstallments"},{brand:c.AmazonPay,flowType:"amazonPay"},{brand:c.BuyWithPrime,flowType:"buyWithPrime"}];[...v,...O,...w];function D(e){return Object.values(c).includes(e)}function j(){const{checkout:{identity:e},router:o,shopPay:t}=h(),r=L().paymentLines;return _(()=>{const n=e.current.value==="shopPay",s=o.currentUrlMatches("/shoppay_login"),l=r.value,m=t.session.paymentMethodOption.value?.name.toUpperCase()==="SHOPIFY_INSTALLMENTS",E=N.map(({brand:a,flowType:C})=>({condition:D(a)?!!g(l,a):!!M(l,a),flowType:C}));return[{condition:s,flowType:"shopPayLogin"},{condition:m,flowType:"shopifyInstallments"},{condition:n,flowType:"shopPay"},...E].find(({condition:a})=>a)?.flowType??"regular"})}const B=()=>{const{schema:{postMessageHandler:e}}=I(),{observability:o}=h(),t=u((n,s)=>{o.log("checkout_sheet_protocol_violation_event_emitted","Emitting event: `violation`."),e({type:"violation",flowType:s,violationErrors:n})},[e,o]),r=u((n,s)=>{o.log("checkout_sheet_protocol_journey_progression_error_event_emitted","Emitting event: `journeyProgressionError`."),e({type:"journeyProgressionError",flowType:s,reasons:n})},[e,o]);return{handleViolationEvent:t,handleJourneyProgressionErrorEvent:r}};export{k as C,x as E,H as M,Y as P,I as a,j as b,B as c,K as d,V as p,b 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.