1import{q as e}from"./2c1ab0fe.qpvfywqb.js";import{b4 as t,e as o,y as n}from"./4b4bc88f.DkycdxSK.js";import{bq as c,br as r,aR as a}from"./164ad2e3.DcJn775M.js";const i=new Map([[6167201,"hydrogen"],[12875497473,"headless"],[88312,"buy_button"],[1354745,"draft_order"]]);function s(e,o,n){const c=new Set([129785,6517121,757165]),r=new Set([3890849,3850711,5198245]);return i.has(e)?i.get(e):c.has(e)?"retail":r.has(e)?"shop_app":o===t.CartPermalink?"permalink":580111===e?"online_store":n}function u({eventName:t,checkoutType:i,walletName:u,progressionStepName:d,redirectSource:p,trackingUnique:k,trackingVisit:y}){const{client:m,checkout:h,consentManager:g,i18n:f,observability:_,userEvents:v,shop:b,source:I}=o(),{id:N}=b,w=h.negotiator.current.fields.buyerIdentity.value?.customerProfile,T=c(t),S=r(),P=S?.config?.type,A=parseInt(n(N),10),C=m.unstable_getSerialization("apiClientId")??0,M=k??(m.cookies.get("_shopify_y")||void 0),O=y??(m.cookies.get("_shopify_s")||void 0);return e(()=>{const e=g.analyticsProcessingAllowed.value,o=g.marketingAllowed.value,c=Boolean(e||o),r={eventName:t,buyerConsentAnalyticsAllowed:e,buyerConsentMarketingAllowed:o,progressionStepName:d,userToken:M,walletName:u};if(!("checkout_started"===t&&"ShopifyPay"===u||c)||!T)return _.counter({name:"checkout_lifecycle_events_blocked_by_privacy",value:1,attributes:{eventName:t,application:"checkout-web"}}),void _.log("checkout_lifecycle_events_not_emitting_event","checkout_lifecycle_events.not_emitting_event",{logPayload:r});const k="contact_information"===d?1:void 0,y=l(I.type),m=y?I.sourceId:void 0,b=h.configuration.profileId.value,N=function({eventName:e,walletName:t,shopId:o,checkoutSessionIdentifier:n="default",checkoutProfileId:c,trackingVisitToken:r,userToken:i,sourceId:u,sourceType:l,customerId:d,apiClientId:p=0,checkoutType:k,currency:y,locale:m,progressionStepName:h,progressionStepNumber:g,redirectSource:f,checkoutProtocolType:_,consentManager:v}){const b=a(),I="MERCHANT"===_?{apiName:"mobile_checkout_sdk_merchant",checkoutType:s(p,f,"api")}:{};return{schemaId:"checkout_lifecycle_events/7.7",payload:{checkoutChainToken:n||"default",checkoutProfileId:c,eventName:e,checkoutType:s(p,f),checkoutExperience:t?"wallet":"web",entryPoint:"checkout",checkoutPlatform:"checkout_one",checkoutVersion:[k],walletName:t,apiClientId:p||0,currency:y||b?.currency,shopId:o,customerId:d,sourceId:u,sourceType:l,userToken:i||b?.uniqToken,deprecatedVisitToken:r||b?.visitToken,referrer:b?.referer,userAgent:navigator.userAgent,contentLanguage:m,eventTime:(new Date).toISOString(),progressionStepName:h,progressionStepNumber:g,buyerConsentAnalyticsAllowed:v.analyticsProcessingAllowed.value,buyerConsentSaleOfDataAllowed:v.saleOfDataAllowed.value,buyerConsentMarketingAllowed:v.marketingAllowed.value,...I}}}({eventName:t,walletName:u,shopId:A,checkoutSessionIdentifier:I.checkoutSessionIdentifier,checkoutProfileId:b?parseInt(n(b),10):void 0,trackingVisitToken:O,userToken:M,sourceId:m,sourceType:y,customerId:w?.id?parseInt(n(w.id),10):void 0,apiClientId:C,checkoutType:i,currency:f.currency,locale:f.locale,progressionStepName:d,progressionStepNumber:k,redirectSource:p,checkoutProtocolType:P,consentManager:g}),S=N.payload.entryPoint;_.log("checkout_lifecycle_events_emitting_event","checkout_lifecycle_events.emitting_event",{...r,progressionStepNumber:k,"context.sourceType":I.type,"context.sourceId":I.sourceId,checkoutType:i,entryPoint:S}),v.monorailEvent(N),_.counter({name:"checkout_lifecycle_events_emitted",value:1,attributes:{application:"checkout-web",eventName:t,checkoutType:I.type,isWallet:u?"true":"false",...u?{walletName:u}:{}}})},[t,d,M,u,A,I,h.configuration.profileId,O,w?.id,C,i,f,p,_,v,T,P,g])}function l(e){const t={orderEdit:"order",paymentCollection:"paymentCollection",cartNext:"cart",checkout:"checkout",abandonedCart:"abandoned_cart",simulated:"simulated",draftOrder:"draft_order",buyItNow:void 0,shopPayExternal:void 0,other:void 0};return Object.keys(t).includes(e)?t[e]:void 0}function d(e){return u({eventName:"checkout_progression",checkoutType:o().checkout.configuration.layout.isOnePage.value?"one_page":"three_page",walletName:e,progressionStepName:"contact_information"})}function p(e,t,n,c){return u({eventName:"checkout_started",checkoutType:o().checkout.configuration.layout.isOnePage.value?"one_page":"three_page",walletName:e,redirectSource:t,trackingUnique:n,trackingVisit:c})}export{s as a,d as b,l as m,p 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.