1import{q as e}from"./2c1ab0fe.Bf8FS-kA.js";import{aE as r,aF as o,aG as t,aH as n,c as s,aI as a,aJ as i}from"./4b4bc88f.DcJe9bVW.js";import{g as l}from"./f67abd2c.CMIDVCe_.js";import{a as c}from"./24773686.CjazS6o8.js";const u=/\.(shop\.dev|shop\.test|tunnel\.shopifycloud\.tech)$/,d=/-prod\.tunnel\.shopifycloud\.tech$/,p=[75664294112,62390304886,85847245104,86752461117,58033635374,66379940012,70551503014,70463455488,93853155640,80263414008,69293637654];function h(e){const s=function(){const e=l();return e?e&&p.includes(e)?String(e):"other":void 0}();return{flow_version:n()?"iframe":"popup",...s&&{shopId:s},debugMode:!(!/debug=yes/.test(window.location.href)&&!/debug=true/.test(window.location.href)&&!/debug=1/.test(window.location.href)&&(/debug=no/.test(window.location.href)||/debug=false/.test(window.location.href)||/debug=0/.test(window.location.href)||!function(){if("undefined"==typeof window)return!1;const e=window.location.host;return u.test(e)&&!d.test(e)}())),os:t(),browser:o().name,entrypoint:r,...e&&{client_source:e}}}const f={shippingAddressError:"$.cart.deliveryGroups[0].deliveryAddress",discountCodeError:void 0,generalError:"$.cart"};function b({breadcrumbPrefix:r,isApplePay:o=!1}){const{observability:t,source:n,i18n:a,checkout:{identity:i,validation:l},shopPay:c}=s(),u="simulated"===n.type,d="shopPay"===i.current.value&&!c?.user.phoneNumber.value?.trim(),p=e(()=>{const e=l.missingFields.phone.isValid.value;if(!e){const e=l.missingFields.phone.input.value;l.missingFields.phone.error.value=e?a.translate("field_errors.shipping_line_phone_invalid"):a.translate("field_errors.phone_blank")}return e},[l,a]);return e(()=>u?(t.leaveErrorBreadcrumb(`${r} - simulated`),!1):d&&o&&!p()?(t.leaveErrorBreadcrumb(`${r} - requires phone`),!1):(t.leaveErrorBreadcrumb(r),!0),[r,t,u,d,o,p])}function y(){const{userEvents:r,source:o,checkout:t,shop:n,observability:l,shopPay:u}=s(),d=function(){const{observability:r,source:o,checkout:{negotiator:t}}=s(),n="shopPayExternal"===o.type,a=c();return e(()=>{if(!n)return;let e=!1,o=!1;for(const r of t.validationErrors.value)r.target===f.generalError?e=!0:r.target===f.shippingAddressError&&(o=!0);(e||o)&&r.counter({name:"shop_pay_external_checkout_with_address_errors",value:1,attributes:{hasGeneralError:e,hasDeliveryAddressError:o,...h(a?.clientSource)}})},[n,a?.clientSource,r,t.validationErrors])}(),p="shopPayExternal"===o.type&&n.hasFlagEnabled(a),b=u&&"clientSource"in u?u.clientSource:void 0;return e(()=>{d(),p&&l.counter({name:"shop_pay_external_pay_now_clicked",value:1,attributes:h(b)}),r.monorailEvent({schemaId:"shopify_pay_payment_page_pay_now/2.1",payload:{...i(o,t,n),clientTimestampMs:Date.now()}})},[r,o,t,n,d,p,l,b])}function v(){const{source:r,shop:o,observability:t,shopPay:n}=s(),i="shopPayExternal"===r.type&&o.hasFlagEnabled(a),l=n&&"clientSource"in n?n.clientSource:void 0;return e(e=>{i&&t.counter({name:"shop_pay_external_completion_blocked",value:1,attributes:{...h(l),stage:e,reason:"none"}})},[i,t,l])}Object.values(f).filter(Boolean);export{v as a,b,y 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.