PageSourceSearch

https://lavenderhillclothing.com/cdn/shopifycloud/checkout-web/assets/c1/711bf263.MCfI959u.js

js lavenderhillclothing.com collected 2026-10-02 18:04:13 UTC 30,594 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["9c523c9d.i8UDTV45.js","2c1ab0fe.GMbxnz74.js","4c290a1e.2OXqqQwu.js","app.iZwEIta_.js","assets/app.BuSMBobh.css","assets/previous.Cyrg41An.css","21cc90a2.BYvnDDaS.js","e477f96c.C25EBhFr.js","6f5bd14f.5bkScn73.js","0a7dffce.BIRsKacx.js","e592f8b9.DUn4Te8e.js","5c5c2e96.BLV8mUtf.js","61f4c83d.BfWyeOrb.js","24dc440e.BDUakuji.js","bff2ff9b.dZiLBpKk.js","aec7053c.CCucehPE.js","d1f3d1ce.C8Aezcqz.js"])))=>i.map(i=>d[i]);
2var e,t,s=e=>{throw TypeError(e)},r=(e,t,r)=>t.has(e)||s("Cannot "+r),i=(e,t,s)=>(r(e,t,"read from private field"),s?s.call(e):t.get(e)),o=(e,t,r)=>t.has(e)?s("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),n=(e,t,s,i)=>(r(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s);import{y as a,G as c,n as d,j as l,f as u}from"./2c1ab0fe.GMbxnz74.js";import{c as h}from"./21cc90a2.BYvnDDaS.js";import{fS as p,ao as m,an as g,fO as b,fQ as v,a2 as f,fT as y,fU as _,fV as w,fW as k,fX as C,fY as S,fZ as P,f_ as E,f$ as T,g0 as q,ap as I,cE as R}from"./4c290a1e.2OXqqQwu.js";import{_ as A}from"./app.iZwEIta_.js";import{T as L,f as M,g as U}from"./5c5c2e96.BLV8mUtf.js";function D(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function O(){const e=globalThis.crypto;return e?.randomUUID?e.randomUUID():Math.random().toString(36).slice(2)}function j(e){if(function(e){return"unstable"!==e&&(m.has(e)||g.has(e))}(e))return"legacy";switch(e){case"2025-10":return"2025-10";case"2026-01-11":case"2026-01-23":return"2026-01-23";case"2026-04-08":return"2026-04-08";case"2026-08-25":case"unstable":return"2026-08-25";default:return}}async function F(e){switch(e){case"legacy":{const{LegacyClient:e}=await A(async()=>{const{LegacyClient:e}=await import("./9c523c9d.i8UDTV45.js").then(e=>e.l);return{LegacyClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7]));return t=>new e(t)}case"2025-10":{const{ShopifyEcp2025_10Client:e}=await A(async()=>{const{ShopifyEcp2025_10Client:e}=await(import("./6f5bd14f.5bkScn73.js"));return{ShopifyEcp2025_10Client:e}},__vite__mapDeps([8,1,2,3,4,5,7,9,0,6,10,11]));return t=>new e(t)}case"2026-01-23":{const{Ucp2026_01_23Client:e}=await A(async()=>{const{Ucp2026_01_23Client:e}=await(import("./61f4c83d.BfWyeOrb.js"));return{Ucp2026_01_23Client:e}},__vite__mapDeps([12,1,2,3,4,5,13,11,14,7,9,0,6,10]));return t=>new e(t)}case"2026-04-08":{const{Ucp2026_04_08Client:e}=await A(async()=>{const{Ucp2026_04_08Client:e}=await(import("./aec7053c.CCucehPE.js"));return{Ucp2026_04_08Client:e}},__vite__mapDeps([15,1,2,3,4,5,13,11,14,7,9,0,6,10]));return t=>new e(t)}case"2026-08-25":{const{Ucp2026_08_25Client:e}=await A(async()=>{const{Ucp2026_08_25Client:e}=await(import("./d1f3d1ce.C8Aezcqz.js"));return{Ucp2026_08_25Client:e}},__vite__mapDeps([16,1,2,3,4,5,13,11,14,7,9,0,6,10]));return t=>new e(t)}}}class N{#e=a(new Set);#t=c(()=>this.#e.value.size>0);get active(){return this.#t}acquire(){const e=Symbol("embed presentation");return this.#e.value=new Set([...this.#e.value,e]),()=>{if(!this.#e.value.has(e))return;const t=new Set(this.#e.value);t.delete(e),this.#e.value=t}}}function B(e,t){return t in e&&"string"==typeof e[t]}function x(e){return null!==e&&"object"==typeof e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}class V{#s;constructor(e){this.#s=e,Object.freeze(this)}postMessage(e){this.#s(e)}}function W(e){return new Promise(t=>{setTimeout(t,e)})}function K(){if(!document.referrer)return"";try{return new URL(document.referrer).origin}catch{return""}}class H{#r;#i;#o;#n;#a;#c;#d=!1;get embedderOrigin(){return this.#a}get isLoopback(){return"loopback"===this.#i}get isDisposed(){return this.#d}get isIframe(){return"iframe"===this.#i}get environmentSnapshot(){return"undefined"==typeof window?{hasParent:!1,hasOpener:!1,referrerOrigin:"",origin:"",hasAndroidConsumer:!1,hasWebkitConsumer:!1}:{hasParent:window.parent!==window,hasOpener:Boolean(window.opener),referrerOrigin:K(),origin:window.location.origin,hasAndroidConsumer:Boolean(window.EmbeddedCheckoutProtocolConsumer),hasWebkitConsumer:Boolean(window.webkit?.messageHandlers?.EmbeddedCheckoutProtocolConsumer)}}get targetType(){return this.#i}#l=new Map;#u=new Map;#h;constructor({observability:e}){this.#n=e;const t=this.#p();this.#r=t.target,this.#i=t.type,this.#m(),e.log("embed_transport_initialized","Transport initialized",{targetType:this.#i})}async request(e,t){t?.singleFlight&&(this.#g(e.method),this.#u.set(e.method,e.
2id));try{const[s]=await this.#b({request:e,timeoutMs:t?.timeoutMs});return s}finally{t?.singleFlight&&this.#u.get(e.method)===e.id&&this.#u.delete(e.method)}}async requestBatch(e,t){return await this.#b({requests:e,timeoutMs:t?.timeoutMs})}notify(e){this.#v({notification:e})}notifyBatch(e){this.#v({notifications:e})}onRequest(e){this.#h=e}send(e){try{"android"===this.#i||"webkit"===this.#i?this.#r.postMessage(JSON.stringify(e)):"messageport"===this.#i?this.#r.postMessage(e):this.#r.postMessage(e,"*"),this.#n.log("embed_transport_message_sent","Message sent through transport",{targetType:this.#i})}catch(t){throw this.#n.log("embed_transport_send_error","Failed to send message through transport",{targetType:this.#i,error:t instanceof Error?t.message:"Unknown error"}),t}}upgrade(e){this.#n.log("embed_transport_upgrade","Upgrading transport to MessagePort");const t=this.#h;this.#f(),this.#r=e,this.#i="messageport",this.#h=t,this.#m(),e.start()}async waitForTarget({timeoutMs:e=250}={}){if(!this.isLoopback)return this.#i;const t=Date.now(),s=t+e;let r=0,i=this.#y({polls:r,waitedMs:0});for(;!i&&!this.#d&&Date.now()<s&&(await W(25),!this.#d);)r+=1,i=this.#y({polls:r,waitedMs:Date.now()-t});return this.#i}cleanup(){this.#d=!0;for(const e of this.#l.values())e.reject(new L("Transport cleanup"));this.#l.clear(),this.#u.clear(),this.#c=void 0,this.#f()}#v(e){const t=void 0!==e.notifications,s=t?e.notifications:[e.notification];if(0!==s.length){try{this.send(t?e.notifications:e.notification)}catch(r){return void this.#n.counter({name:"embed_checkout_event",value:1,attributes:{error:"send_failed",error_message:r instanceof Error?r.message:"Unknown error"}})}for(const e of s)this.#_(this.#w(e))}}#_(e){"ec.start"===e&&void 0!==this.#c&&(this.#n.histogram({name:"embed_checkout_ready_to_start_duration",value:performance.now()-this.#c,attributes:{messagePortUpgrade:"messageport"===this.#i}}),this.#c=void 0),this.#n.counter({name:"embed_checkout_event",value:1,attributes:e?{type:e}:{}}),this.#n.log("embed_checkout_event","Embed checkout event sent",{method:e})}#k(e){if(Array.isArray(e))for(const t of e)this.#k(t);else{if(function(e){return x(e)&&B(e,"id")&&("result"in e||"error"in e)}(e)){const t=e,s=this.#l.get(t.id);return s?void this.#C(t,s):void this.#n.log("message_bus_unexpected_response","Received response for unknown request",{responseId:t.id})}(function(e){return x(e)&&B(e,"method")&&B(e,"id")})(e)&&this.#h&&this.#h(e)}}#C(e,t){const{id:s}=e;this.#l.delete(s);const r=Date.now()-t.startTime;if(this.#n.log("embed_checkout_event_received","Embed checkout event received",{requestId:s,method:t.method}),"error"in e&&e.error){const i=e.error;return this.#n.log("message_bus_request_error","Request failed with error",{requestId:s,method:t.method,errorCode:i.code,errorMessage:i.message,durationMs:r}),void t.reject(new b(s,i.code,i.message))}if("result"in e){const i=function(e){if(null==e||"object"!=typeof e)return;const t=e.ucp;if(null==t||"object"!=typeof t)return;if("error"!==t.status)return;const s=e.messages;if(!Array.isArray(s))return{code:"unknown_error",content:"Unknown error"};const r=s.find(e=>null!=e&&"object"==typeof e);return r?{code:"string"==typeof r.code?r.code:"unknown_error",content:"string"==typeof r.content?r.content:"",severity:"string"==typeof r.severity?r.severity:void 0}:{code:"unknown_error",content:"Unknown error"}}(e.result);return i?(this.#n.log("message_bus_request_error","Request failed via UCP envelope error",{requestId:s,method:t.method,errorCode:i.code,errorMessage:i.content,severity:i.severity,durationMs:r}),void t.reject(new b(s,i.code,i.content))):(this.#n.log("message_bus_request_duration","Request completed",{requestId:s,method:t.method,durationMs:r}),void t.resolve(e.result))}this.#n.log("message_bus_missing_result","Response missing result data",{requestId:s}),t.reject(new M(s))}async#b(e){const{timeoutMs:t}=e,s=void 0!==e.requests,r=s?e.requests:[e.request];if(0===r.length)return[];const i=r.map(e=>this.#S(e));try{this.send(s?e.requests:e.request)}catch{for(const e of r)this.#P(e,new U(e.id,e.method));return await Promise.all(i)}for(const o of r)this.#E(o);return await Promise.all(i.map((e,s)=>t?this.#T(r[s],e,t):e))}#S(e){return new Promise((t,s)=>{this.#l.set(e.id,{resolve:t,reject:s,startTime:Date.now(),method:e.method})})}#E(e){try{"ec.ready"===e.method&&void 0===this.#c&&(this.#c=performance.now()),this.#n.counter({name:"embed_checkout_event",value:1,attributes:{type:e.method}}),this.#n.log("embed_checkout_event","Embed checkout event sent",{requestId:e.id,method:e.method})}catch{}}#P(e,t){const s=this.#l.get(e.id);s&&(this.#l.delete(e.id),s.reject(t))}
2async#T(e,t,s){let r;try{return await Promise.race([t,new Promise((t,i)=>{r=setTimeout(()=>{this.#l.delete(e.id),this.#n.log("message_bus_request_timeout","Request timed out",{requestId:e.id,timeoutMs:s,method:e.method}),i(new v(e.id,s))},s)})])}finally{clearTimeout(r)}}#g(e){const t=this.#u.get(e);if(!t)return;const s=this.#l.get(t);s&&(this.#l.delete(t),this.#n.log("embedded_checkout_event_request_superseded","Previous request superseded by new request",{requestId:t,method:e,ageMs:Date.now()-s.startTime}),this.#n.counter({name:"embedded_checkout_event_request_superseded",value:1,attributes:{method:e}}),s.resolve(void 0)),this.#u.delete(e)}#m(){"messageport"===this.#i?(this.#o=e=>{const t=e;this.#n.log("embed_transport_message_received","Message received through transport",{targetType:this.#i}),this.#k(t.data)},this.#r.addEventListener("message",this.#o)):"android"===this.#i||"webkit"===this.#i?this.#q():(this.#o=e=>{const t=e;t.isTrusted?"iframe"!==this.#i&&"popup"!==this.#i||t.source===this.#r?(!this.#a&&t.origin&&(this.#a=t.origin,this.#n.log("embed_transport_embedder_origin_captured","Captured embedder origin from first message",{origin:t.origin})),this.#n.log("embed_transport_message_received","Message received through transport",{targetType:this.#i}),this.#k(t.data)):this.#n.log("embed_transport_rejected_wrong_source","Rejected message from wrong source",{targetType:this.#i,origin:t.origin}):this.#n.log("embed_transport_rejected_untrusted_event","Rejected synthetic event (isTrusted = false)",{targetType:this.#i,origin:t.origin})},window.addEventListener("message",this.#o))}#f(){this.#o&&("messageport"===this.#i?this.#r?.removeEventListener("message",this.#o):window.removeEventListener("message",this.#o),this.#o=void 0),this.#h=void 0,this.#n.log("embed_transport_cleanup","Transport cleaned up",{targetType:this.#i})}#y({polls:e,waitedMs:t}){if(this.#d)return!1;const s=this.#p();if("loopback"===s.type)return!1;const r=this.#h;return this.#f(),this.#r=s.target,this.#i=s.type,this.#h=r,this.#m(),this.#n.log("embed_transport_target_redetected","Adopted a transport target that appeared after initialization",{targetType:this.#i,polls:e,waitedMs:t}),!0}#p(){return"undefined"==typeof window?{target:null,type:"iframe"}:window.EmbeddedCheckoutProtocolConsumer?{target:window.EmbeddedCheckoutProtocolConsumer,type:"android"}:window.webkit?.messageHandlers?.EmbeddedCheckoutProtocolConsumer?{target:window.webkit.messageHandlers.EmbeddedCheckoutProtocolConsumer,type:"webkit"}:window.parent!==window?{target:window.parent,type:"iframe"}:window.opener?{target:window.opener,type:"popup"}:{target:window.parent,type:"loopback"}}#q(){return window.EmbeddedCheckoutProtocol instanceof V||(Object.defineProperty(window,"EmbeddedCheckoutProtocol",{value:new V(e=>{this.#n.log("embed_transport_message_received","Message received from native",{targetType:this.#i}),this.#k(e)}),writable:!1,configurable:!1}),Object.freeze(V.prototype)),window.EmbeddedCheckoutProtocol}#w(e){if(null!=e&&"object"==typeof e&&"method"in e&&"string"==typeof e.method)return e.method}}class z extends f{constructor(e){super(`Request cancelled: ${e}`,{reason:e}),this.name="UniversalCheckoutClientDisposedError"}}class $ extends f{constructor(e){super(`Request cancelled: ${e}`,{reason:e}),this.name="UniversalCheckoutProtocolDisposedError"}}class Y extends Error{constructor(e){super("Universal Checkout protocol failed",{cause:e}),this.name="UniversalCheckoutProtocolFailureError"}}class G extends Error{constructor(e){super(`Universal Checkout requires a positive integer resource count, received ${e}`),this.name="UniversalCheckoutInvalidResourceCountError"}}
2class Z extends Error{constructor(){super(...arguments),this.name="UniversalCheckoutNoTransportError"}}function J(e){return"shopPay"===e.checkout.identity.current.value&&!y(e.embed.embedder)}function Q({context:e,targetType:t}){if("popup"===t)return{redactPII:!0,redactIdKey:!0};const s=e.embed.isFlagshipPartner;return{redactPII:!s||J(e),redactIdKey:!s}}function X({context:e,targetType:t}){const s=Q({context:e,targetType:t});if("popup"===t)return s;const{embed:r}=e,i=r.isFlagshipPartner||function(e){return Boolean(e.configuration?.features.isBuyerEventsEnabled)}(r);return{...s,redactPII:s.redactPII&&!i}}function ee(e){const t=e.indexOf("?");if(-1===t)return e;const s=e.slice(0,t),r=new URLSearchParams(e.slice(t+1));r.delete("key");const i=r.toString();return i?`${s}?${i}`:s}function te(e){if(!D(e)||!Array.isArray(e.methods))throw new re("Invalid checkout fulfillment");return{...e,methods:e.methods.map(e=>{if(!D(e))throw new re("Invalid checkout fulfillment method");const{destinations:t,selected_destination_id:s,...r}=e;return r})}}function se(e){if(!D(e))throw new re("Invalid checkout order");return{...e,permalink_url:"about:blank"}}class re extends Error{constructor(){super(...arguments),this.name="CheckoutRedactionError"}}const ie=class s{constructor({delegations:r,createRequestId:i=O}){o(this,e),o(this,t),this.version=s.version,n(this,e,new Set(r)),n(this,t,i)}mapEvent(s){switch(s.type){case"checkout.ready":return Array.from({length:s.resourceCount},()=>({jsonrpc:"2.0",id:i(this,t).call(this),method:"ec.ready",params:{delegate:Array.from(i(this,e))}}));case"checkout.error":return s.errors.map(({shopId:e,error:t})=>({jsonrpc:"2.0",method:"ec.error",params:{context:{session_id:s.sessionId,revision:s.revision,shop_id:e},error:t}}));case"checkout.start":case"checkout.update":case"checkout.complete":{const e={"checkout.start":"ec.start","checkout.update":"ec.update","checkout.complete":"ec.complete"}[s.type];return s.resources.map(({shopId:t,checkout:r})=>({jsonrpc:"2.0",method:e,params:{context:{session_id:s.sessionId,revision:s.revision,shop_id:t},checkout:this.mapCheckout(r)}}))}default:return[]}}mapCheckout(e){return function(e,{redactPII:t,redactIdKey:s}){const r=t?function(e){const t={...e};delete t.buyer,delete t.payment;for(const s of Object.keys(t))void 0===t[s]&&delete t[s];return{...t,...Boolean(e.fulfillment)&&{fulfillment:te(e.fulfillment)},...Boolean(e.order)&&{order:se(e.order)}}}(e):e;return s&&"string"==typeof r.id?{...r,id:ee(r.id)}:r}(e,{redactPII:!0,redactIdKey:!0})}};e=new WeakMap,t=new WeakMap,ie.version="2026-08-25";let oe=ie;const ne=[{Client:class{#I;#R;constructor(e,t){this.version=e.version,this.#I=e,this.#R=t}get isDisposed(){return this.#R.isDisposed}async waitForTransport(){this.#A(),this.#R.isLoopback&&await this.#R.waitForTarget(),this.#L()}async ready({resourceCount:e}){if(this.#L(),!Number.isInteger(e)||e<1)throw new G(e);await this.#M({type:"checkout.ready",resourceCount:e},{timeoutMs:1e4})}mapResources(e){return e.map(({shopId:e,checkout:t})=>({shopId:e,checkout:this.#I.mapCheckout(t)}))}start(e){this.#U({...e,type:"checkout.start"})}update(e){this.#U({...e,type:"checkout.update"})}complete(e){this.#U({...e,type:"checkout.complete"})}error(e){this.#U({...e,type:"checkout.error"})}cleanup(){this.isDisposed||this.#R.cleanup()}#L(){if(this.#A(),this.#R.isLoopback)throw new Z("No Universal Checkout host transport was detected.")}#A(){if(this.isDisposed)throw new z("Universal Checkout client disposed")}async#M(e,t){this.#A();const s=this.#I.mapEvent(e);return this.#R.requestBatch(s,t)}#U(e){if(this.isDisposed)return;const t=this.#I.mapEvent(e);this.#R.notifyBatch(t)}},MessageMapper:oe}];class ae extends Error{constructor(){super(...arguments),this.name="UniversalCheckoutProtocolConfigurationError"}}class ce extends Error{constructor(e){const t=ne.map(({MessageMapper:e})=>e.version);super(`Unsupported Universal Checkout protocol version "${e}". Supported versions: ${t.join(", ")}`),this.name="UniversalCheckoutProtocolUnsupportedVersionError",this.requestedVersion=e,this.supportedVersions=t}}const de=new Map([["inline","INLINE"],["sheet","SHEET"],["wallet-button/apple-pay","WALLET_BUTTON_APPLE_PAY"],["wallet-button/google-pay","WALLET_BUTTON_GOOGLE_PAY"],["wallet-button/sh
2op-pay","WALLET_BUTTON_SHOP_PAY"]]),le=new Set(de.values());const ue=new Map([["android","ANDROID"],["react-native-android","REACT_NATIVE_ANDROID"],["react-native-swift","REACT_NATIVE_SWIFT"],["swift","SWIFT"],["web","WEB"]]),he=new Set(ue.values());class pe extends Error{constructor(e){super(`Embed preload start failed while waiting for document visibility: ${String(e)}`),this.name="EmbedPreloadStartError"}}function me(e,t){if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every((e,s)=>me(e,t[s]));if(D(e)){if(!D(t))return!1;const s=Object.keys(e);return s.length===Object.keys(t).length&&s.every(s=>Object.hasOwn(t,s)&&me(e[s],t[s]))}return e===t}class ge{constructor(e,t){this.presentation=new N,this.#D=a(null);const s=e.embed,r=t.protocolVersion??fe(s.library,s.protocol?.version??void 0,t.observability),{createEmbedClient:i}=t,o=new P(r,s.protocol?.type),n=s.library?.name&&s.library?.version?{name:s.library.name,version:s.library.version}:void 0,c=s.configuration?{...s.configuration,features:{...s.configuration.features,isBuyerEventsEnabled:s.protocol?.isBuyerEventsEnabled??!1}}:void 0,d=s.isAuthenticated,l={colorScheme:s.ui?.colorScheme??"AUTOMATIC",branding:s.ui?.branding??"SHOP"};this.isAuthenticated=d,this.isFlagshipPartner=s.isFlagshipPartner,this.isPreload=s.isPreload,this.library=n,this.protocol=o,this.authentication=void 0,this.delegations=function(e,{checkout:t,requestedDelegations:s}){if(!e.isUcpEcp)return q([]);const r=s??[],i=r.filter(e=>{switch(e){case"fulfillment.address_change":return t.configuration.isAddressDelegationEnabled;case"payment.instruments_change":return t.configuration.isPaymentInstrumentsDelegationEnabled;case"payment.credential":return t.configuration.isPaymentCredentialDelegationEnabled;case"window.open":return t.configuration.isWindowOpenDelegationEnabled;default:return!1}});return q(r,i)}(o,t),this.ui=l,t.observability.log("embed_for_browser_creation","Protocol information and delegations",{protocolVersion:o.version,isUcpEcp:o.isUcpEcp,requestedDelegations:t.requestedDelegations??[],allowedDelegations:[...this.delegations.allowed]}),this.entry=function(e){var t;if(null!=e)return t=e,le.has(t)?e:de.get(e.toLowerCase())??void 0}(s?.entry),this.platform=function(e){var t;if(null!=e)return t=e,he.has(t)?e:ue.get(e.toLowerCase())??void 0}(s?.platform);const u=t.userAgent??"";this.platformCategory=E(u),this.configuration=c,this.shopClientUuid=s.shopClientUuid??void 0;const h=t.client.unstable_getSerialization("embed");this.embedder=h?.embedder,this.apiClientId=h?.flagshipPartnerApiClientId,this.interstitialPartnerDisplayName=h?.interstitialPartnerDisplayName,this.interstitialPartnerProfileIconUrl=h?.interstitialPartnerProfileIconUrl,this.embedderProposalSnapshot=this.#D,this.#O=t.mobileCheckoutSdk,this.mobileCheckoutSdkConfig=e.mobileCheckoutSdkConfig??null,this.checkoutSheetProtocolConfig=e.checkoutSheetProtocolConfig??null,this.#n=t.observability,this.client=i({...t,embed:{protocol:o,library:n,isAuthenticated:d,isFlagshipPartner:this.isFlagshipPartner,configuration:c,embedder:this.embedder,delegations:this.delegations}});const p=t.router.currentUrl.value.normalizedPath;this.isCheckoutKit({includeLegacyCsk:!1})&&("/processing"===p||"/thank-you"===p)&&function(e){switch(e?.status){case"polling_for_order":case"processed":case"processing":case"processing_remote_checkouts":return!0;default:return!1}}(t.checkout.latestReceipt.peek())?t.events.addEventListener("bootloader:hydrate-end",e=>{e.waitUntil(this.client.resumeFromReceipt())}):(t.events.addEventListener("bootloader:hydrate-start",e=>{e.waitUntil(this.client.ready())}),t.events.addEventListener("bootloader:hydrate-end",e=>{const t=this.#j(),s=this.#F(t);"wait_for_visible"!==t.kind?e.waitUntil(s):s.catch(e=>{this.#n.error(e instanceof Error?e:new pe(e),{metadata:{event:{name:"embed_preload_start",outcome:"error_waiting_for_visible"}}})})})),this.#N(t),this.#B(t)}#O;#D;#n;#x;#V;#W;static isAvailable(e){return T(e)}static from(e,t){if(!ge.isAvailable(e))return;const s=e,r=new P(s.embed.protocol.version,s.embed.protocol.type).isUcpEcp?C(t.client.initialRequest.url.searchParams.get(S)):[];return new ge({embed:s.embed,mobileCheckoutSdkConfig:s.mobileCheckoutSdkConfig??null,checkoutSheetProtocolConfig:s.checkoutSheetProtocolConfig??null},{...t,requestedDelegations:r,mobileCheckoutSdk:t.mobileCheckoutSdk})}static async loadClient(e,t){const s=fe(e.library,e.protocol?.version??void 0,t);return{createEmbedClient:await async function(e){const t=j(e)??"2026-08-25",s=await F(t);return"legacy"===t?t=>(t.observability.log("embed_client_legacy_protocol",`Using legacy client for protocol version ${e}`),s(t)):"unstable"===e?e=>(e.observability.log("embed_client_unstable_version","Using unstable version, mapping to latest (2026-08-25)",{mappedTo:"2026-08-25"}
2),s(e)):j(e)?s:t=>(t.observability.log("embed_client_version_fallback",`Unknown version ${e}, falling back to latest (2026-08-25)`),s(t))}(s),protocolVersion:s}}cleanup(){this.#x?.(),this.#x=void 0,this.#W?.(),this.#W=void 0,this.client?.cleanup()}async#F(e){if("start"===e.kind)return this.#K();if("start_embed_preload"===e.kind)return this.#n.counter({name:"embed_preload_start",value:1,attributes:{outcome:e.outcome}}),this.#K({markPresented:!0});const t=function(){let e=()=>{};const t=new Promise(t=>{let s=!1;const r=()=>{"visible"===ye()&&e(!0)};e=e=>{s||(s=!0,document.removeEventListener("visibilitychange",r),t(e))},document.addEventListener("visibilitychange",r),r()});return{promise:t,cancel:()=>e(!1)}}();this.#W=t.cancel;const s=await t.promise,r=this.#W===t.cancel;if(r&&(this.#W=void 0),!s||!r)return void this.#n.counter({name:"embed_preload_start",value:1,attributes:{outcome:"cancelled"}});const i=performance.now()-e.waitStartedAtMs;return this.#n.counter({name:"embed_preload_start",value:1,attributes:{outcome:"started_after_visible"}}),this.#n.histogram({name:"embed_preload_duration",value:i}),this.#n.log("embed_preload_start","Starting Checkout Kit preload after document became visible",{outcome:"started_after_visible",timeToVisibleMs:i}),this.#K({markPresented:!0})}#K({markPresented:e=!1}={}){return e&&this.#V&&(this.#V.checkoutProtocolPresentedSignal.value=!0),this.client.start()}#j(){if(!this.isPreload||!this.isCheckoutKit({includeLegacyCsk:!1}))return{kind:"start"};const e=ye();return"visible"===e?{kind:"start_embed_preload",outcome:"started_immediately"}:"hidden"===e?(this.#n.counter({name:"embed_preload_start",value:1,attributes:{outcome:"waiting_for_visible"}}),this.#n.log("embed_preload_start","Waiting to start Checkout Kit preload until document is visible",{outcome:"waiting_for_visible"}),{kind:"wait_for_visible",waitStartedAtMs:performance.now()}):(this.#n.log("embed_preload_start","Starting Checkout Kit preload because document visibility state is unavailable",{outcome:"api_not_supported_started"}),{kind:"start_embed_preload",outcome:"api_not_supported_started"})}unstable_providePreactContext(e){this.#V=e.negotiationContext,this.client.unstable_providePreactContext(e)}get isCheckoutSheetKit(){return this.protocol.isCheckoutSheetKit||be(this.library)}isCheckoutKit({includeLegacyCsk:e=!0}={}){return!this.isFlagshipPartner&&(this.protocol.isUcpEcp&&ve(this.library)||e&&this.isCheckoutSheetKit)}get isCheckoutSheetProtocol(){return this.protocol.isCheckoutSheetProtocol}getEmbedCheckoutType(){const e="NATIVE"===this.checkoutSheetProtocolConfig?.payActionType,t=this.isCheckoutSheetProtocol&&!0===this.configuration?.features?.isNativePayActionEnabled,s=this.#O.enabled&&this.#O.variant.isPartner();if(e||t||s||this.isCheckoutSheetProtocol)return p.CheckoutSheetProtocolNative;if(this.isFlagshipPartner)return p.FlagshipPartner;const r=this.#O.enabled&&this.#O.variant.isStandard();return this.isCheckoutKit({includeLegacyCsk:!1})?p.CheckoutKit:this.isCheckoutSheetKit||r?p.CheckoutSheetKit:p.None}getEmbedPayButtonConfig(e){const{stickyFooterEnabled:t,isPaymentDelegationEnabled:s}=e;return function(e,t,s){switch(e){case p.CheckoutSheetProtocolNative:return{type:p.CheckoutSheetProtocolNative,stickyFooterEnabled:!1,delegatedPaymentEnabled:!1};case p.FlagshipPartner:return{type:p.FlagshipPartner,stickyFooterEnabled:t,delegatedPaymentEnabled:s};case p.CheckoutSheetKit:return{type:p.CheckoutSheetKit,stickyFooterEnabled:t,delegatedPaymentEnabled:!1};case p.CheckoutKit:return{type:p.CheckoutKit,stickyFooterEnabled:t,delegatedPaymentEnabled:s};case p.None:default:return{type:p.None,stickyFooterEnabled:!1,delegatedPaymentEnabled:!1}}}(this.getEmbedCheckoutType(),t,s)}isEmbeddedCheckout(){return this.getEmbedCheckoutType()!==p.None}#B({checkout:e,events:t}){if(!this.isFlagshipPartner)return;if(!e.configuration.isPaymentInstrumentsDelegationEnabled)return;const s=t=>{e.proposal.proposed.billingAddressOption.value=t};s("custom"),t.addEventListener("wallet:enter",()=>{d(()=>{s("shipping"),e.proposal.proposed.billingAddress.value=h(e.proposal.proposed.billingAddress.value),this.#V&&(this.#V.delegatedPaymentInstrument.value=void 0)})}),t.addEventListener("wallet:exit",()=>s("custom"))}#N({checkout:e,wallets:t}){const s=this.isFlagshipPartner&&e.configuration.isPaymentInstrumentsDelegationEnabled;this.#x=l(()=>{if(!this.isFlagshipPartner||this.#D.peek())return;if(null==t.activeSessionSignal.value)return;const r=e.proposal.proposed;this.#D.value={email:r.email.peek(),phone:r.phone.peek(),shippingAddress:r.shippingAddress.peek(),billingAddress:r.billingAddress.peek(),...s?{}:{billingAddressOption:r.billingAddressOption.peek()},paymentLines:r.paymentLines.peek(),tipLines:r.tipLines.peek(),discountLines:r.discountLines.peek(),cartMetafields:r.cartMetafields.peek()}})}}function be(e){return"CheckoutSheetKit"===e?.name}function ve(e){return"CheckoutKit"===e?.name}function fe(e,t,s){if(t){if("2026-01-11"===t)return s.log("embed_for_browser_ucp_version_aliased","Aliasing removed UCP ECP version 2026-01-11 to 2026-01-23",{rawVersion:t,resolvedVersion:"2026-01-23"}),"2026-01-23";if(function(e){return g.has(e)}(t)||function(e){return m.has(e)&&"2025-10"!==e}(t)||function(e){return I.has(e)}(t))return t;if(function(e){return"2025-10"===e||"unstable"===e}(t))return t}let r;
2return r=be(e)?R:ve(e)?"2026-08-25":"2025-04",s.log("embed_for_browser_fallback_version_used","Missing or unsupported embed protocol version, using fallback",{rawVersion:t,resolvedVersion:r,library:e?.name??"unspecified",libraryVersion:e?.version??"unspecified"}),r}function ye(){if("undefined"==typeof document)return;const{visibilityState:e}=document;return"visible"===e||"hidden"===e?e:void 0}const _e=Object.freeze(Object.defineProperty({__proto__:null,EmbedForBrowser:ge,UniversalCheckoutProtocolForBrowser:class{#H;#n;#z;#$;#Y;#G=a("initial");#Z=c(()=>"initial"!==this.#G.value);#J=0;#Q=new Map;#X=new Set;#ee;constructor({url:e,observability:t,resourceCount:s,sessionId:r}){this.#H=e,this.#n=t,this.#z=s,this.#$=r}get isDisposed(){return this.#Y?.isDisposed??!1}observeSessionState(e,t){if(!this.#Y||this.isDisposed)return;this.#ee?.();const s=l(()=>{const s=e.value;this.#Z.value&&u(()=>this.#te(e=>t(s,e)))},{name:"Emit ec.start once settled, ec.update on changes, then ec.complete"});return this.#ee=s,s}async connect(){if(this.#A(),this.#H.searchParams.has(_))try{this.#Y=function({url:e,observability:t,createRequestId:s}){const r=e.searchParams.get(_);if(!r?.trim())throw new ae("Universal Checkout requires a non-empty ec_version");const i=e.searchParams.get(w);if(!k(i))throw new ae("Universal Checkout requires a valid ck_version");const o=ne.find(({MessageMapper:e})=>e.version===r);if(!o)throw new ce(r);const{Client:n,MessageMapper:a}=o;return new n(new a({delegations:C(e.searchParams.get(S)),createRequestId:s}),new H({observability:t}))}({url:this.#H,observability:this.#n}),await this.#Y.waitForTransport(),await this.#Y.ready({resourceCount:this.#z}),this.#A(),this.#G.value="readied"}catch(e){throw this.cleanup(),this.#se(e)}}cleanup(){this.#ee?.(),this.#ee=void 0,this.isDisposed||this.#Y?.cleanup()}#te(e){const t=this.#Y;if(t&&!this.isDisposed&&"final"!==this.#G.value)try{const s=e({version:t.version}),r=t.mapResources(s.resources);if("readied"===this.#G.value){if(!s.isStartupSettled||0===r.length)return;this.#re("start",r)}if("started"!==this.#G.value)return;if(!s.isComplete){const e=r.filter(e=>!me(this.#Q.get(e.shopId),e));e.length>0&&this.#re("update",e)}const i=s.errors.filter(({shopId:e})=>this.#Q.has(e)&&!this.#X.has(e));i.length>0&&this.#ie(i),s.isComplete&&this.#re("complete",r)}catch(s){this.#n.error(this.#oe(s),{severity:"warning"})}}#re(e,t){if(!this.#Y)return;for(const i of t)this.#Q.set(i.shopId,i);this.#J+=1;const s={sessionId:this.#$,revision:this.#J,resources:t};switch(e){case"start":try{this.#Y.start(s)}catch(r){throw this.#G.value="final",r}this.#G.value="started";break;case"update":this.#Y.update(s);break;case"complete":this.#G.value="final",this.#Y.complete(s)}}#ie(e){if(this.#Y){for(const{shopId:t}of e)this.#X.add(t);this.#J+=1,this.#Y.error({sessionId:this.#$,revision:this.#J,errors:e})}}#A(){if(this.isDisposed)throw new $("Universal Checkout protocol disposed")}#oe(e){return e instanceof Error?e:new Y(e)}#se(e){const t=this.#oe(e);return this.#n.log("universal_checkout_protocol_failure","Failed to initialize the Universal Checkout host connection",{errorName:t.name,errorMessage:t.message}),t}},preloadEmbedClient:function(e){return async function(e){if(!e)return;const t=j(e);t&&await F(t)}(e)}},Symbol.toStringTag,{value:"Module"}));export{H as P,X as a,Q as b,O as c,_e as d,J as i,ee as s};

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.