PageSourceSearch

https://nataliemartin.com/cdn/shopifycloud/checkout-web/assets/c1/c610ba76.D5HkYGh_.js

js nataliemartin.com collected 2026-10-09 18:17:10 UTC 84,833 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["9f28056f.BLjliJB1.js","4b4bc88f.DkycdxSK.js","2c1ab0fe.qpvfywqb.js","app.DH8n-1bp.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BJvF0-q4.css","66338e00.ClCcLcum.js","3a2aad00.DPLA4eWL.js","f67abd2c.CNaB0QaR.js","164ad2e3.DcJn775M.js","d0bb51ec.CWfbNPnY.js","e12db40c.DhbHW8sF.js","9dba8418.4R19B40l.js","60a453ce.DBFo6PRx.js","assets/hydrate.DDB053YN.css","2210eadb.DF0gIp_2.js","f58f39d8.z0CUAjnp.js","e03065ab.V1fBuv4e.js","28ac86c0.Bqxr0lQy.js","3e6029dd.CzD4uDEq.js","assets/QRCode.BZ_m5G5a.css","30074413.CFLdnyrE.js","assets/Pressable.D9SfDfsb.css","efa0389a.BiVLFqoF.js","22345fd4.Bc95vVsB.js","assets/Choice.CrYuHUmO.css","9f57d2aa.CWVDsc-j.js","8574876b.DO_JQrVo.js","064f6ac1.BoVb1opw.js","assets/Popover.Bi1nHaU-.css","assets/DateField.CFFsBmUK.css","598fef4e.C71uub5O.js","assets/PaymentIcon.gzvCNwz_.css","33d2e4fc.BYSXPXJF.js","assets/NumberField.CRpcZnVJ.css","39921a74.C0GzP1-7.js","assets/Switch.BS8yVgoP.css","27f09e31.B5qg3Kcy.js","137622f3.dz4lSUSx.js","54bf0ebb.hjCERqmO.js","assets/Sheet.CpR5hiDV.css","1ed8f5e3.DIMgWfc5.js","assets/floating-layer.DfWUBaTh.css","2fdb3dd3.BI5ol3i8.js","47b970b2.Bc5Vmfq5.js","a9fa9fda.BO9gwssW.js","ca3e798e.XLlup-KR.js","assets/PhoneField.uZEuHncj.css","1444e6bd.DTqbRn9m.js","29034f35.C5vHFLlG.js","assets/AnnouncementRuntimeExtensions.DbBB6lBJ.css","e77d135d.Dz0RetrO.js","051149c8.lHD9iIAq.js","21cc90a2.DHzOO82q.js","413b21e2.B8hOJrbg.js"])))=>i.map(i=>d[i]);
2import{i as e,t,g as n,a as i}from"./e03065ab.V1fBuv4e.js";import{iL as s,iM as a,E as o,iN as r,e as c,f9 as d,bu as l,y as u,aX as p,dy as m,dC as f,b8 as y,r as h,s as g,q as v,iO as b,da as C,cc as A,bm as I,bb as k,f3 as w,bZ as x,b_ as S,hR as T,aw as D}from"./4b4bc88f.DkycdxSK.js";import{v as P,k as N,T as R,o as _,h as M,w as E,y as O,r as L,ad as U,aA as V,j as F}from"./2c1ab0fe.qpvfywqb.js";import{h as $,dr as G,fV as B,gV as j,gW as q,gX as H,gY as Y,ef as z,gZ as J,ch as W,ci as Q,g_ as K,ct as X,g$ as Z,gL as ee,h0 as te}from"./164ad2e3.DcJn775M.js";import{p as ne,q as ie,r as se,s as ae,t as oe,e as re,U as ce,u as de,S as le,a as ue,v as pe,I as me,D as fe,w as ye,O as he}from"./66338e00.ClCcLcum.js";import{b as ge,a as ve,e as be}from"./f67abd2c.CNaB0QaR.js";import{g as Ce,b as Ae,a as Ie}from"./28ac86c0.Bqxr0lQy.js";import{g as ke,q as we,_ as xe}from"./app.DH8n-1bp.js";import{A as Se}from"./60a453ce.DBFo6PRx.js";import{s as Te,b as De,f as Pe}from"./f58f39d8.z0CUAjnp.js";import{e as Ne}from"./e77d135d.Dz0RetrO.js";import{H as Re}from"./051149c8.lHD9iIAq.js";import{m as _e}from"./21cc90a2.DHzOO82q.js";import{t as Me}from"./29034f35.C5vHFLlG.js";import{a as Ee,g as Oe}from"./413b21e2.B8hOJrbg.js";import{v as Le}from"./2210eadb.DF0gIp_2.js";const Ue=e=>e??[];function Ve(e){const t=e.merchantVisitorConsent();return{allowedProcessing:e.merchantAllowedProcessing(),visitorConsent:{analytics:a(t.analytics),marketing:a(t.marketing),preferences:a(t.preferences),saleOfData:a(t.sale_of_data)},shouldShowBanner:e.shouldShowBanner.value,saleOfDataRegion:e.saleOfDataRegion.value,region:s(e.getRegion.value),metafields:Ue(e.merchantMetafields())}}const Fe={allowedProcessing:{analytics:!1,marketing:!1,preferences:!1,saleOfData:!1},visitorConsent:{analytics:void 0,marketing:void 0,preferences:void 0,saleOfData:void 0},shouldShowBanner:!1,saleOfDataRegion:!1,region:void 0,metafields:[]};function $e({customerPrivacySignal:e,createSubscribableFromSignal:t,extension:n,storefrontTokens:i,applyChange:s,extensionInstance:a,checkout:c,consentManager:d}){const l=!0===n.capabilities.collectBuyerConsent?.customerPrivacy,u=$(n.approvalScopes,Se.CustomerPersonalData);return{applyTrackingConsentChange:async function(t){return s({unknownChange:t,extension:n,extensionInstanceId:a.id,allowChangeAfterJourneyCompletion:!0,allowChangeDuringAcceleratedWallet:!0,handlers:{async changeVisitorConsent({change:t}){if(!l)throw new o("Capability not specified: Please declare this in your config: collect_buyer_consent.customer_privacy = true.");if(!u)throw new o("Personal data approval scope missing");if("shopPay"===c.identity.current.value)throw new o("The Customer Privacy API is not supported in Shop Pay.");const s=function(e=[]){return e.flatMap(({key:e,value:t})=>void 0===t?[]:""===t?[{key:e,value:null}]:[{key:e,value:t}])}(t.metafields),a=s.length>0;if(!a&&void 0===t.analytics&&void 0===t.marketing&&void 0===t.preferences&&void 0===t.saleOfData)return{type:"success"};const p=await i.get(n.appId,n.type,"customerPrivacy"),m=e.peek();return new Promise((n,i)=>{d.setTrackingConsent({analytics:t.analytics,marketing:t.marketing,preferences:t.preferences,saleOfData:t.saleOfData,isExtensionToken:!0,storefrontAccessToken:p??void 0,...a&&{metafields:s}},(...[s,a])=>{if(a)e.value={...m,allowedProcessing:d.merchantAllowedProcessing(),metafields:Ue(d.merchantMetafields()),visitorConsent:{analytics:t.analytics,marketing:t.marketing,preferences:t.preferences,saleOfData:t.saleOfData}},n({type:"success"});else if(s instanceof Error)i(new o(`Failed to set tracking consent: ${s.message}`));else if(s&&"error"in s){const e=function(e,t){const n=null!=t&&t>=400?`Failed to set tracking consent: ${e} (HTTP ${t})`:`Failed to set tracking consent: ${e}`;return 401===t?new ae(n):null!=t&&t>
2=400?new oe(n):e.includes("GraphQL error:")||e.includes("GraphQL response missing consentManagement")?new se(n):"undefined"!=typeof navigator&&r(navigator.userAgent)&&e.includes("The string did not match the expected pattern")?new ne(n):new ie(n)}(String(s.error),s.statusCode);i(e)}else i(new ie("Received unexpected callback from setTrackingConsent()"))})})}},errorResult:e=>e instanceof o||e instanceof ne||e instanceof ie||e instanceof se||e instanceof ae||e instanceof oe?{type:"error",message:e.message}:{type:"error",message:`Failed to set tracking consent: ${e.message}`}})},customerPrivacy:t(P(()=>{const{region:t,...n}=e.value,{countryCode:i,provinceCode:s}=t||{};return{...n,region:i||s?{countryCode:u?i:void 0,provinceCode:u?s:void 0}:void 0}}))}}function Ge(){const{source:e,checkout:t}=c(),n=G();return N(()=>{const i=t.addressManager.shipping.value.applyAddressChangeBlockReason("ui-extension");return function({sourceType:e="checkout",canUpdateDiscountCodes:t,canSelectCustomAddress:n}){const i="draftOrder"===e;return{attributes:{canUpdateAttributes:!0},delivery:{canSelectCustomAddress:n},discounts:{canUpdateDiscountCodes:t},lines:{canAddCartLine:!i,canRemoveCartLine:!i,canUpdateCartLine:!i},metafields:{canSetCartMetafields:!0,canDeleteCartMetafield:!0},notes:{canUpdateNote:!i}}}({sourceType:e.type,canUpdateDiscountCodes:n.value,canSelectCustomAddress:!i.value})})}function Be(e,t){return`${e} is not supported on this checkout. Consider checking "instructions.${t}" first.`}function je(e){const t=R(()=>new Map,[]),n=_(t);return M(()=>{qe(t,e)},[e,t]),n}function qe(e,t){for(const n of t)He(e,n.id)}function He(e,t){const n=e.get(t);if(n)return n;let i=()=>{};const s={promise:new Promise(e=>{i=e}),resolve:i};return e.set(t,s),s}function Ye(e,t,n){e.get(t)===n&&e.delete(t)}function ze(t){const n="local"===t.type?void 0:t.registrationId;return{appId:t.appId,appName:t.appName,extensionId:B(t),extensionRegistrationId:n,extensionName:t.name,extensionVersion:t.version,extensionApiVersion:t.apiVersion,extensionTarget:t.extensionPoint.target,extensionPlacement:t.placementReference,extensionType:t.type,isHighValueExtension:null!=n&&Re.has(n),isRemoteDom:!!t.apiVersion&&e(t.apiVersion)}}function Je(e,t=Ke){let n,i=!1;return P(()=>{const s=e();return i?t(n,s)?n:(n=s,s):(i=!0,n=s,s)})}function We(e){return Je(e,d)}function Qe(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ke(e[n],t[n]))return!1;return!0}function Ke(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&e[n]===t[n])}function Xe({checkout:e,createSubscribableFromSignal:t,extension:n,negotiated:i,proposed:s,journeyCompletedSignal:a}){if(!$(n.approvalScopes,Se.CustomerPersonalData))return{billingAddress:void 0,shippingAddress:void 0};const o=(e,t)=>$(n.approvalScopes,t)?e:void 0,r=()=>{let t;return i=>{const s={address1:o(i.address1,Se.CustomerAddress),address2:o(i.address2,Se.CustomerAddress)};if(!Te(n.apiVersion))return s;const{countryCode:a}=i,r=e.address.extendedAddressMode.get(a);if(!a||"dedicated"!==r)return s;const c=De({country:e.address.countryDetails.get(a),extendedAddressMode:e.address.extendedAddressMode});if(!c)return s;const{streetName:l,streetNumber:u,line2:p,district:m,subdistrict:f}=i,y=(e,t)=>(e=>c.includes(e))(e)&&void 0!==t,h={...y("streetName",l)?{streetName:l}:{},...y("streetNumber",u)?{streetNumber:u}:{},...y("additionalInformation",p)?{additionalInformation:p}:{},...y("district",m)?{district:m}:{},...y("subdistrict",f)?{subdistrict:f}:{}},g=0===Object.keys(h).length?void 0:o(h,Se.CustomerAddress);return g?{...s,addressLineComponents:(v=g,t&&d(t,v)?t:(t=v,v))}:s;var v}},c=r(),l=r();let u;const p=Je(()=>{const e=e=>{if(void 0===e||function(e){return 0===Object.keys(e).length}(e))return;const{city:t,company:n,countryCode:i,firstName:s,lastName:a,name:r,phone:d,oneTimeUse:l,zoneCode:u,postalCode:p}=e;return{...c(e),city:t,company:n,countryCode:o(i,Se.CustomerPersonalData),firstName:o(s,Se.CustomerName),lastName:o(a,Se.CustomerName),name:o(r,Se.CustomerName),phone:o(d,Se.CustomerPhone),provinceCode:u,z
2ip:o(p,Se.CustomerAddress),oneTimeUse:l}};if(!1===i.fields.isShippingRequired.value)return;if(a.value)return e(i.fields.shippingAddress.peek());const t=e(s.shippingAddress.value),n=s.shippingAddress.value?.countryCode,r=u?.countryCode;return s.shippingAddress.dirtyFields.value.has("countryCode")&&r&&n!==r?u:(u=t,t)});return{billingAddress:t(Je(()=>{const e=e=>{if(void 0===e)return;const{city:t,company:n,countryCode:i,firstName:s,lastName:a,name:r,phone:c,zoneCode:d,postalCode:u}=e;return{...l(e),city:t,company:n,countryCode:o(i,Se.CustomerPersonalData),firstName:o(s,Se.CustomerName),lastName:o(a,Se.CustomerName),name:o(r,Se.CustomerName),phone:o(c,Se.CustomerPhone),provinceCode:d,zip:o(u,Se.CustomerAddress)}};if(a.value)return e(i.fields.billingAddress.peek());const t=s.billingAddress.value;switch(s.billingAddressOption.value){case"shipping":{const n=i.fields.buyerIdentity.value?.purchasingCompany;if(n)return e(n?.location?.shippingAddress??t);if(p.value){const{oneTimeUse:e,...t}=p.value;return t}return e(t)}case"billing":{const n=i.fields.buyerIdentity.value?.purchasingCompany?.location.billingAddress;return e(n??t)}default:return e(t)}})),shippingAddress:t(p)}}async function Ze(e){try{return await e()}catch(t){if(function(e){return e instanceof re&&"object"==typeof e.cause&&null!==e.cause&&"code"in e.cause&&"INVALID_NEGOTIATION"===e.cause.code}(t))return;throw t}}function et({proposed:e,negotiated:t,createSubscribableFromSignal:n,cartInstructionsSignal:i,extension:s,extensionInstance:a,applyChange:r}){return{applyAttributeChange:async function(n){return r({unknownChange:n,extension:s,extensionInstanceId:a.id,handlers:{async updateAttribute({negotiate:n,change:s,markChangeAsNoOp:a}){if(tt(s),!i.peek().attributes.canUpdateAttributes)throw new o(Be("applyAttributeChange","attributes"));const r=e.attributes.peek();return function(e,t,n){const i=t=>{const n=t?.find(t=>t.key===e.key);return void 0!==n&&n.value===e.value},s=i(n),a=void 0===t?s:i(t);return s&&a}(s,r,t.fields.customAttributes.peek())?(a(),{type:"success"}):(e.attributes.value=nt(r,s),await Ze(()=>n({silenceViolations:["all"]})),{type:"success"})},async removeAttribute({negotiate:t,change:n}){if(tt(n),!i.peek().attributes.canUpdateAttributes)throw new o(Be("applyAttributeChange","attributes"));const s=e.attributes.peek();if(!s?.find(e=>e.key===n.key))throw new o(`Invalid AttributeChange: no attribute with specified key found: "${n.key}"`);return e.attributes.value=nt(s,n),await Ze(()=>t({silenceViolations:["all"]})),{type:"success"}}},errorResult:e=>({type:"error",message:`Could not apply attribute changes. Error: ${e.message}`})})},attributes:n((c=()=>(e.attributes.value||t.fields.customAttributes.value?.map(({key:e,value:t})=>({key:e,value:t})))??[],Je(c,Qe)))};var c}function tt(e){if("string"!=typeof e.key||e.key.length<3||e.key.length>30)throw new o('Invalid AttributeChange: attribute key must be of type "string" and between 3 and 30 characters in length (inclusive)');if("updateAttribute"===e.type&&"string"!=typeof e.value)throw new o('Invalid AttributeChange: attribute value must be of type "string"')}function nt(e,t){const n=e?[...e]:[],i=n.findIndex(({key:e})=>e===t.key);return"updateAttribute"===t.type&&(i>-1?n[i]={key:t.key,value:t.value}:n.push({key:t.key,value:t.value})),"removeAttribute"===t.type&&n.splice(i,1),n}const it=/^\$app|^app--\d+--/,st=/^app--\d+--/,at=/^app--\d+$/,ot="$app";function rt(e,t){if(e.trim()===ot)return`app--${t}`;const n=ot+":";return e.trim().startsWith(n)?`app--${t}--${e.slice(5)}`:e}const ct="2026-01";function dt({proposed:e,createSubscribableFromSignal:n,extension:i,cartInstructionsSignal:s,applyChange:a,extensionInstance:r,checkout:c}){const{extensibility:d}=c,l="local"===i.type&&t(i.apiVersion).equalTo(ct);return{metafields:n(P(()=>{const e="processed"===c.latestReceipt.value?.status?c.latestReceipt.value?.purchaseOrder.metafields:[];return(e&&e.length>0?e:d.ui.metafields.value).map(({key:e,namespace:t,value:n,valueType:i})=>({key:e,namespace:t,value:n,valueType:i}))})),applyMetafieldChange:async t=>a({unknownChange:t,extension:i,extensionInstanceId:r.id,handlers:{async updateMetafield({change:e}){if(!pt(i.apiVersion))throw new o("Change type `updateMetafield` is no longer supported. Use `updateCartMetafield` instead.");l&&console.warn("Change type `updateMetafield` is deprecated and will be removed in a future API version. Use `updateCartMetafield` instead. See https://shopify.dev/docs/api/checkout-ui-extensions/2026-01/apis/metafields#methods-propertydetail-applymetafieldchange for more details."),function(e){const{key:t,namespace:n,value:i,valueType:s}=e;if("string"!=typeof t||t.length<3||t.length>30)throw new o(`Invalid property key: "${t}". It must be between 3 and 30 characters in length (inclusive).`);if("string"!=typeof n)throw new o(`Invalid property namespace: "${n}". It must be a string between 2 and 20 characters (inclusive).`);if(n.length<2||n.length>20)throw new o(`Invalid property namespace: "${n}". It must be between 2 and 20 characters in length (inclusive).`);if(it.test(n))throw new o(`Invalid property namespace: "${n}". App reserved namespaces not supported.`);switch(s){case"integer":if("number"!=typeof i)throw new o(`Invalid property value: "${i}". It must be a number.`);break;case"string":if("string"!=typeof i)throw new o(`Invalid property value: "${i}". It must be a string.`);if(i.length<=0)throw new o(`Invalid property value: "${i}". It must not be empty.`);break;case"json_string":if(!function(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch{}return!1}(i))throw new o(`Invalid property value: "${i}". It must be a json_string.`);break;default:throw new o(`Invalid property valueType: "${s}". It must be in one of these values: integer, string, json_string.`)}}(e);const{key:t,namespace:n,value:s,valueType:a}=e,r=d.ui.metafields.value,c=r.findIndex(e=>e.key===t&&e.namespace===n),u=[...r],p=u[c];return p?u[c]={...p,value:s,valueType:a,appId:i.appId}:u.push({key:t,namespace:n,value:s,valueType:a,appId:i.appId}),d.ui.updateMetafields(u),{type:"success"}},async removeMetafield({change:e}){if(!pt(i.apiVersion))throw new o("Change type `removeMetafield` is no longer supported. Use `removeCartMetafield` instead.");l&&console.warn("Change type `removeMetafield` is deprecated and will be removed in a future API version. Use `removeCartMetafield` instead. See https://shopify.dev/docs/api/checkout-ui-extensions/2026-01/apis/metafields#methods-propertydetail-applymetafieldchange for more details.");const{key:t,namespace:n}=e,s=d.ui.metafields.value.filter(e=>e.key!==t||e.namespace!==n);return d.ui.updateMetafields(s),{type:"success"}},async updateCartMetafield({change:t,negotiate:n}){lt(t.type,s.peek().metafields),function(e){const{metafield:t}=e;if(null==t)throw new o(`Invalid property metafield: "${t}". It must be an object.`);const{key:n,namespace:i,value:s,type:a}=t;if("string"!=typeof n||n.length<2||n.length>64)throw new o(`Invalid property key: "${n}". It must be between 2 and 64 characters in length (inclusive).`);if(null!==i&&"string"!=typeof i&&void 0!==i)throw new o(`Invalid property namespace: "${i}". namespace must be null, undefined, or a string between 3 and 255 characters (inclusive).`);if("string"==typeof i&&(i.length<3||i.length>255))throw new o(`Invalid property namespace: "${i}". It must be between 3 and 255 characters in length (inclusive).`);if("string"!=typeof a)throw new o(`Invalid property type: "${a}". It must be a string. Received type: ${typeof a}.`);if("integer"===a){if("number"!=typeof s&&"string"!=typeof s)throw new o(`Invalid property value: "${s}". It must be a number or a string when type is "integer". Received type: ${typeof s}.`)}else if("string"!=typeof s)throw new o(`Invalid property value: "${s}". It must be a string when type ("${a}") is not "integer". Received type: ${typeof s}.`)}(t);const a="string"==typeof t.metafield.value?t.metafield.value:String(t.metafield.value);return e.cartMetafields.value=[...e.cartMetafields.peek(),{update:{key:t.metafield.key,namespace:t.metafield.namespace,value:a,type:t.metafield.type,appId:i.appId}}],ut(await n({fieldsToResolve:["cartMetafields"],silenceViolations:["all"]}),e,t),{type:"success"}},removeCartMetafield:async({change:t,negotiate:n})=>(lt(t.type,s.peek().metafields),function(e){const{key:t,namespace:n}=e;if("string"!=typeof t)throw new o(`Invalid property key: "${t}". It must be a string.`);if(null!=n&&"string"!=typeof n)throw new o(`Invalid property namespace: "${n}". The namespace must be either null, undefined, or a string.`)}(t),e.cartMetafields.value=[...e.cartMetafields.peek(),{delete:{appId:i.appId,key:t.key,namespace:t.namespace}}],ut(await n({fieldsToResolve:["cartMetafields"],silenceViolations:["all"]}),e,t),{type:"success"})},errorResult:e=>({type:"error",message:e.message})})}}function lt(e,{canSetCartMetafields:t,canDeleteCartMetafield:n}){const i=`applyMetafieldChange with type ${e}`;if("updateCartMetafield"===e&&!t)throw new o(Be(i,"metafields"));if("removeCartMetafield"===e&&!n)throw new o(Be(i,"metafields"))}function ut(e,t,n){const i=[...t.cartMetafields.peek()],s=e.errors.filter(e=>j.has(e.code));if(0===s.length)return;const a=s.reduce((e,t)=>
2{if("target"in t){const n=function(e){const t=e.match(/\[(\d+)\]$/),n=t?.[1];return void 0!==n?parseInt(n,10):-1}(t.target);n>=0&&!e[n]&&(e[n]=t)}return e},{}),r=i.findIndex((e,t)=>!!a[t]&&("updateCartMetafield"===n.type&&e.update?.key===n.metafield.key&&e.update?.namespace===n.metafield.namespace&&e.update?.value===n.metafield.value||"removeCartMetafield"===n.type&&e.delete?.key===n.key&&e.delete?.namespace===n.namespace)),c=a[r];if(r>-1&&c)throw t.cartMetafields.value=i.slice(0,r),new o(c.nonLocalizedMessage,{cause:{code:c.code}})}function pt(e){return!t(e).laterThan(ct)}function mt({webPixels:e,extension:t}){const n=l(t.appId)||"unknown-app",i=l(B(t))||"unknown-extension";return{analytics:{publish:(s,a={})=>e.publishCustomEvent(s,a,{extension:{extensionId:i,appId:n,type:t.type||"unknown-type"}}),visitor:t=>e.visitor(t,{apiClientId:n})}}}const ft={id:"be4fa5a8e92c26d115e34073b486a58fc317388a2eedddb82d02eeccb9573278",type:"query",name:"ExtensionMetafields",source:""},yt=async({withCache:e=!0,coreGraphql:t,extension:n,observability:i,negotiated:s,checkoutProfileId:a,appMetafieldsSignal:o})=>{let r=[];const c=ke(s),d=await we({withCache:e,coreGraphql:t,resourceIds:c,
2checkoutProfileId:a}),l=d.data?.globalCheckoutUiExtensions??[],u=[...d.data?.checkoutProfile?.activatedExtensions??[],...l].map(({extension:e})=>e),p=u?.find(e=>e.uuid===n.extensionId);let m=p?.metafields??[];if(!p){const i={resourceIds:c};"local"===n.type?i.extensionHandles=[{handle:n.handle,apiKey:n.appApiKey}]:i.extensionIds=[`gid://shopify/UiExtension/${n.extensionId}`];const{data:s}=await t.staticQuery(ft,{variables:i,cache:e});s?.extensionMetafields&&(m=s?.extensionMetafields)}r=function({queryResult:e,metafields:t,observability:n,extension:i}){if(e.error)return n.leaveErrorBreadcrumb("Extensions::GraphQL",{reason:"Failed to fetch extension metafields.",message:String(e.error),extensionId:i.id,extensionVersion:"persisted"===i.type?i.version:void 0}),[];const s=[];for(const a of t){if(!bt(i,a.ownerType)||!vt(i,a))continue;const e=gt(i.apiVersion,a.namespace);s.push({target:Ct(a.ownerId,a.ownerType),metafield:{key:a.key,namespace:e,value:a.value,type:a.type.toLowerCase(),valueType:a.valueType.toLowerCase()}})}return s}({extension:n,queryResult:d,metafields:m,observability:i}),o.value={...o.peek(),[n.id]:r}};function ht({coreGraphql:e,extension:t,extensionInstance:n,negotiated:i,observability:s,createSubscribableFromSignal:a,sourceId:o,checkout:r,appMetafieldsSignal:c}){const d=E(()=>{yt({withCache:!0,coreGraphql:e,extension:t,observability:s,negotiated:i,appMetafieldsSignal:c,checkoutProfileId:r.configuration.profileId.value})});n.on("destroy",()=>{d()});const l={type:"extension",extension:t,instanceId:n.id};return(async()=>{Ne.markStarted("app-metafields-load",l);try{await yt({withCache:!0,coreGraphql:e,extension:t,observability:s,negotiated:i,appMetafieldsSignal:c,checkoutProfileId:r.configuration.profileId.value})}finally{Ne.markFinished("app-metafields-load",l)}})(),{appMetafields:a(P(()=>{const e=c.value[t.id]??[],n=t.extensionPoint.metafields??[],s=i.fields.buyerIdentity.value,a=s?.shopUser?.metafields??[],r=s?.shopUser?.publicId??"",d=a.flatMap(e=>e&&r&&n.some(t=>t.key===e.key&&t.namespace===e.namespace&&(!t.ownerType||"SHOPUSER"===t.ownerType))?[{target:{type:"shopUser",id:r},metafield:{key:e.key,namespace:gt(t.apiVersion,e.namespace??""),value:e.value,type:e.type,valueType:e.valueType.toLowerCase()}}]:[]),l=i.fields.cartMetafields.value,p=u(t.appId);return[...e,...l?l?.flatMap(e=>e&&null!=e.ownerType&&n.some(n=>!(n.key!==e.key||rt(n.namespace,p)!==e.namespace||n.ownerType&&n.ownerType!==e.ownerType||e.namespaceAppId&&t.appId!==e.namespaceAppId))?[{target:{type:"cart",id:o},metafield:{key:e.key,namespace:gt(t.apiVersion,e.namespace??""),value:e.value,type:e.type,valueType:e.valueType.toLowerCase()}}]:[]):[],...d]}))}}function gt(e,n){return t(e).laterThan("2025-01")?function(e){return at.test(e)?ot:e.replace(st,ot+":")}(n):n}function vt(e,t){const n=u(e.appId),i=e.extensionPoint.metafields.filter(e=>e.key===t.key&&rt(e.namespace,n)===t.namespace);return 0===i.length||i.some(e=>!e.ownerType||e.ownerType===t.ownerType)}function bt(e,t){switch(t){case"ORDER":default:return!1;case"CART":case"PRODUCT":case"PRODUCTVARIANT":case"SHOP":case"SHOPUSER":return!0;case"CUSTOMER":case"COMPANY":case"COMPANYLOCATION":return $(e.approvalScopes,Se.CustomerPersonalData)}}function Ct(e,t){const n=u(e);switch(t){case"CUSTOMER":return{type:"customer",id:n};case"PRODUCT":return{type:"product",id:n};case"PRODUCTVARIANT":return{type:"variant",id:n};case"SHOP":return{type:"shop",id:n};case"COMPANY":return{type:"company",id:n};case"COMPANYLOCATION":return{type:"companyLocation",id:n};case"CART":return{type:"cart",id:n};case"SHOPUSER":return{type:"shopUser",id:n};default:return(()=>{throw new ce(`Metafield ownerType "${t}" with id "${e}" cannot be resolved`)})()}}function At({publicCheckoutSessionId:e,createSubscribableFromSignal:t}){return{checkoutToken:t(O(e))}}function It(e){return{initial:e.current,subscribe(t){L(t);const n=e.subscribe((n=e.current)=>t(n));return[()=>{n(),U(t)},e.current]}}}function kt({extension:e,extensionInstance:t,createSubscribableFromSignal:n,isCheckoutEditor:i,observability:s}){const a=P(()=>{const t=e.behaviors.value,n=new Set;return t.blockProgress||n.add("blockProgress"),function(e,t){const n=[];return Object.keys(e).forEach(i=>
2{const s=i;s in e&&("object"!=typeof e[s]&&!t.has(s)&&Boolean(e[s])&&n.push(Me(s)),"object"==typeof e[s]&&Object.entries(e[s]).forEach(([e,t])=>{if(Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t){const t=`${Me(i)}.${Me(e)}`;n.push(t)}}))}),n}(e.capabilities,n)}),o=It({get current(){return t.rendered},subscribe:e=>{const n=t.on("render",()=>{e(t.rendered)}),i=t.on("remove",()=>{try{e(t.rendered)}catch(n){throw s.leaveErrorBreadcrumb("Error removing rendered subscription on remove event",{isDestroyed:t.isDestroyed,rendered:t.rendered,extensionId:t.id}),n}}),a=t.on("restart",()=>{r()}),o=t.on("destroy",()=>{r()}),r=()=>{n(),i(),a(),o()};return r}});return{scriptUrl:e.scriptUrl,version:"persisted"===e.type?e.version:void 0,apiVersion:e.apiVersion,rendered:o,capabilities:n(a),editor:i?{type:"checkout"}:void 0,target:t.target}}function wt(e){const{checkout:t,createSubscribableFromSignal:n,negotiated:i,shop:s}=e,{localization:a}=xt(e);return{localization:{...a,country:n(We(()=>{const e=i.fields.buyerIdentity.value?.countryCode;if(e)return{isoCode:e,acceptedAddressInputFields:De({country:t.address.countryDetails.get(e),extendedAddressMode:t.address.extendedAddressMode})}})),acceptedAddressInputFieldsForCountry:async e=>{if(!function({countryCode:e,shippingCountries:t,isShippingRequired:n,deliveryNext:i}){return!n||p(i)||0===t.length||t.some(({value:t})=>t===e)}({countryCode:e,shippingCountries:s.shippingCountries,isShippingRequired:t.isShippingRequired.peek(),deliveryNext:i.fields.deliveryNext.peek()}))return[];const n=await Pe({countryCode:e,countryDetails:t.address.countryDetails,extendedAddressMode:t.address.extendedAddressMode});if(!n)throw new de(`Accepted address input fields for country "${e}" could not be loaded.`);return n}}}}function xt({locale:e,currencySignal:t,timezone:n,extension:i,createSubscribableFromSignal:s,negotiated:a}){return{localization:{language:s(O({isoCode:e})),extensionLanguage:s(O({isoCode:i.extensionLocale})),currency:s(t),timezone:s(O(n??(new Intl.DateTimeFormat).resolvedOptions().timeZone)),country:s(P(()=>{const e=a.fields.buyerIdentity.value?.countryCode;if(e)return{isoCode:e}})),market:s(P(()=>{const e=a.fields.buyerIdentity.value?.market;if(!e)return;const{id:t,handle:n}=e;return{id:t,handle:n}}))}}}function St({captureEvent:e,extension:t,locale:i,shop:s,storefrontTokens:a,extensionInstance:r}){const c=t.capabilities.apiAccess;async function d(e,r=!1,l){if(!c)throw new o('permission to access the storefront API must be specified under [capabilities] with flag "api_access = true"; this can be done within your extension\'s configuration. View the docs for more information:\n\nhttps://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access');const u=await a.get(t.appId,t.type,"fetchWithToken");if(!u)throw new f(`Could not get a storefront token for app ${t.appId} to query ${e}`);try{const o=await fetch(`https://${s.myshopifyDomain}/api/${l?.version??n(t.apiVersion)}/graphql.json`,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":i,"Shopify-Storefront-Extension-Token":u},body:JSON.stringify({query:e,variables:l?.variables})});return 401===o?.status&&r?(a.cache.delete(a.cacheKey(t.appId,t.type)),d(e,!1,l)):o}catch(p){if("BreadcrumbsPluginFetchError"===p.name&&r)return d(e,!1,l);throw new m(`An error occurred when attempting to fetch the extension api: ${p}`,{cause:p})}}return{query:async(n,i)=>{if(!t.capabilities.apiAccess)throw new o('Extension is not allowed to use the Storefront API; permission to use the Storefront API must be specified under [capabilities] with:"api_access = true; see:\n\nhttps://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access');const s=performance.now();e("extensionInteraction",{interaction:"storefrontApiQueryStart",extension:t,section:"extension",timestamp:new Date,extensionInstanceId:r.id});try{const o=await d(n,!0,i);if(o&&o.ok){e("extensionInteraction",{interaction:"storefrontApiQuerySuccess",extension:t,section:"extension",timestamp:new Date,duration:performance.now()-s,extensionInstanceId:r.id});try{return await o.json()}catch(a){throw new le("Failed to parse Storefront API response",{cause:a})}}
2throw new m(`Failed to query storefront API: status=${o?.status} ${o?.statusText}`.trim())}catch(a){let n="storefrontApiQueryError";throw a instanceof m&&a?.cause instanceof Error&&"BreadcrumbsPluginFetchError"===a.cause?.name?n="storefrontApiQuerySuccess":a instanceof le&&(n="storefrontResponseParseError"),e("extensionInteraction",{interaction:n,extension:t,section:"extension",timestamp:new Date,duration:performance.now()-s,error:a instanceof Error?a:void 0,extensionInstanceId:r.id}),a}}}}function Tt({extension:{configuration:e},createSubscribableFromSignal:t}){return t(e)}function Dt(e){return{id:e.id,name:e.name,storefrontUrl:e.storefrontUrl??void 0,myshopifyDomain:e.myshopifyDomain}}function Pt(e){return{id:e.id,name:e.name,storefrontUrl:e.storefrontUrl?(t=e.storefrontUrl,t.endsWith("/")?t:`${t}/`):void 0,myshopifyDomain:e.myshopifyDomain};var t}function Nt({extension:e}){return _t(`v1-${B(e)}-${e.extensionPoint.target}`)}function Rt({extension:e}){return _t(`v1-${e.appId}-${e.extensionId}`)}function _t(e){const t=y.ExtensionStorage,n=t=>`${e}-${t}`,i=()=>v(t)??{};return{async read(e){q("string"==typeof e,'Missing "key" argument. Please pass a key to read from to storage.');const t=n(e),s=i();return Object.keys(s).length&&s[t]||null},async write(e,s){q("string"==typeof e,'Missing "key" argument. Please pass a key to write to to storage.'),q(arguments.length>1,`Missing "data" argument. Please pass a value to write to "${e}" `);const a=n(e),o=i();o[a]=s,g(t,o)},async delete(e){q("string"==typeof e,'Missing "key" argument. Please pass a key to delete from storage.');const s=n(e),a=i();delete a[s],0===Object.keys(a).length?h(t):g(t,a)}}}function Mt(e){return e}const Et=new Set(["DISCOUNTS_ONLY_EMPTY_TERMS_ACCEPTED","DISCOUNTS_DISCOUNTS_NOT_ALLOWED_FOR_B2B","DISCOUNTS_DISCOUNT_CODE_NOT_HONOURED","DISCOUNTS_CUSTOM_DISCOUNT_NOT_HONOURED","DISCOUNTS_UNSUPPORTED_EXPECTATION","DISCOUNTS_ALLOCATIONS_MISMATCH","DISCOUNTS_ADDITIONAL_REQUESTED_DISCOUNT_CODE_DISCARDED","DISCOUNTS_NOT_FOUND","DISCOUNTS_CURRENTLY_INACTIVE","DISCOUNTS_USAGE_LIMIT_REACHED","DISCOUNTS_CUSTOMER_USAGE_LIMIT_REACHED","DISCOUNTS_CUSTOMER_NOT_ELIGIBLE","DISCOUNTS_QUANTITY_NOT_IN_RANGE","DISCOUNTS_PURCHASE_NOT_IN_RANGE","DISCOUNTS_NO_ENTITLED_LINE_ITEMS","DISCOUNTS_NO_ENTITLED_SHIPPING_LINES","DISCOUNTS_INCOMPATIBLE_PURCHASE_TYPE","DISCOUNTS_DISCOUNT_ALREADY_APPLIED","DISCOUNTS_HIGHER_VALUE_DISCOUNT_APPLIED","DISCOUNTS_MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED","DISCOUNTS_INVALID_SIGNATURE","REDUCTION_INVALID_CODE","REDUCTION_INVALID_DISCOUNT_CODE"]);function Ot({negotiated:e,proposed:t,extension:n,createSubscribableFromSignal:i,cartInstructionsSignal:s,applyChange:a,extensionInstance:r,currentDiscountCodeAttemptSignal:c}){const d=i(P(()=>{const t=e.fields.discountLines.value?.lines;return t?t.filter(e=>"code"===e.discount.type).map(e=>({code:e.title})):[]})),l=i(P(()=>{const t=e.fields.discountLines.value?.lines;return t?function(e){return e.filter(e=>ve(e)&&"CART"===e.discount.presentationLevel).map(e=>{const{discount:t,amount:n,title:i}=e;return"code"===t.type?{type:"code",code:i,discountedAmount:n}:"automatic"===t.type?{type:"automatic",title:i,discountedAmount:n}:{type:"custom",title:i,discountedAmount:n}})}(t):[]})),u=["non-merchandise"];return{discountCodes:d,discountAllocations:l,async applyDiscountCodeChange(e){return a({unknownChange:e,extension:n,extensionInstanceId:r.id,handlers:{addDiscountCode:async({negotiate:e,change:t})=>(i(),Lt(t),Ut(await e({customizeNegotiation:e=>(c.value=t.code,{...e,reduction:{code:t.code}}),silenceViolations:u}),t.code),c.value=null,{type:"success"}),async removeDiscountCode({negotiate:e,change:n}){i(),Lt(n);const s=t.discountLines.peek(),a=n.code.toUpperCase(),r=s.find(({discount:e})=>"code"===e.type&&e.title.toUpperCase()===a);if(!r)throw new o(`The discount code "${n.code}" is not allocated to this checkout and cannot be removed.`,{cause:{code:"DISCOUNT_NOT_FOUND"}});return t.discountLines.value=s.filter(({discount:e})=>e.title.toUpperCase()!==r.title.toUpperCase()),Ut(await e({fieldsToResolve:[...H],silenceViolations:u}),n.code),{type:"success"}}},errorResult:e=>({type:"error",message:`Could not apply discount code changes. Error: ${e.message}`})});function i(){if(!s.peek().discounts.canUpdateDiscountCodes)throw new o(Be("applyDiscountCodeChange","discounts"))}}}}function Lt(e){if("string"!=typeof e.code)throw new o('Discount code must be of type "string"')}function Ut(e,t){const n=e.errors.find(e=>{if("RemoveTermViolation"!==e.type||be(e.targetEntity)?.title===t)return Et.has(e.code)});if(n)throw new o(n.nonLocalizedMessage,{cause:{code:n.code}})}
2const Vt=new Set(["REDUCTION_INVALID_CODE","PAYMENT_GIFT_CARDS_NOT_ALLOWED_FOR_B2B","PAYMENT_GIFT_CARDS_NOT_ALLOWED_FOR_FIXED_SELLING_PLANS","PAYMENTS_GIFT_CARD_ALREADY_APPLIED","PAYMENTS_GIFT_CARD_BUYING_GIFT_CARD","PAYMENTS_GIFT_CARD_CURRENCY_MISMATCH","PAYMENTS_GIFT_CARD_DISABLED","PAYMENTS_GIFT_CARD_NON_SUFFICIENT_FUNDS","PAYMENTS_GIFT_CARD_NOT_FOUND","REDUCTION_GIFT_CARD_ALREADY_APPLIED","PAYMENTS_SHOP_CASH_GIFT_CARD_NOT_ALLOWED","REDUCTION_INVALID_GIFT_CARD_CODE","PAYMENTS_INSTALLMENTS_GIFT_CARD_NOT_ALLOWED","PAYMENTS_GIFT_CARDS_UNAVAILABLE"]);function Ft({negotiated:e,proposed:t,extension:n,createSubscribableFromSignal:i,shop:s,applyChange:a,extensionInstance:r}){return{appliedGiftCards:i(P(()=>{const t=e.fields.paymentLines.value;return t?t.lines.filter(e=>"giftCard"===e.method.type).map(e=>({lastCharacters:C(e.method),amountUsed:e.cost,balance:e.method.balance})):[]})),applyGiftCardChange:async i=>a({unknownChange:i,extension:n,extensionInstanceId:r.id,handlers:{async addGiftCard({negotiate:t,change:n}){$t(n);const i=e.fields.paymentMethods.peek()?.some(e=>"giftCard"===e.type);if(!i)throw new o("the `applyGiftCardChange` API is disabled");return Bt(await t({customizeNegotiation:e=>({...e,reduction:{code:n.code}})})),{type:"success"}},async removeGiftCard({negotiate:e,change:n}){$t(n);const i=t.paymentLines.peek(),a=s.hasFlagEnabled(b);let o=i;return a?n.code.split(",").forEach(e=>{o=Gt(o,e)}):o=Gt(o,n.code),t.paymentLines.value=o,Bt(await e({})),{type:"success"}}},errorResult:e=>({type:"error",message:`Could not apply gift card changes. Error: ${e.message}`})})}}function $t(e){if("string"!=typeof e?.code)throw new o("Gift card code must be a string")}function Gt(e,t){const n=t.replace(/[\s-]/g,"").toLowerCase(),i=e.findIndex(({method:e})=>"giftCard"===e.type&&(4===t.length?C(e).toLowerCase()===n.slice(-4):"code"in e&&e.code.toLowerCase()===n));if(-1===i)return e;const s=[...e];return s.splice(i,1),s}function Bt(e){const t=e.errors.find(e=>Vt.has(e.code));if(t)throw new o(t.nonLocalizedMessage,{cause:{code:t.code}})}function jt(e){const{lineAllocation:t}=e,n="parentRelationship"in e?e.parentRelationship?.parent?.lineAllocations?.[0]:void 0;return{id:(s=t.stableId,`gid://shopify/CartLine/${s}`),quantity:t.quantity,cost:{totalAmount:t.checkoutPriceAfterDiscounts},merchandise:qt(e),attributes:e.properties.map(e=>({key:e.name,value:String(e.value)})),discountAllocations:(i=t.allocations,i.filter(e=>ge(e.discountDetails.discount)&&"LINE"===e.discountDetails.discount.presentationLevel).map(e=>{const{discount:t,title:n}=e.discountDetails;return"code"===t.type?{type:"code",code:n,discountedAmount:e.amount}:"automatic"===t.type?{type:"automatic",title:n,discountedAmount:e.amount}:{type:"custom",title:n,discountedAmount:e.amount}})),lineComponents:e.lineComponents.map(e=>({type:"bundle",id:Yt(e.lineAllocation.stableId),merchandise:qt(e),quantity:e.lineAllocation.quantity,cost:{totalAmount:e.lineAllocation.checkoutPriceAfterDiscounts},attributes:e.properties.map(e=>({key:e.name,value:String(e.value)}))})),parentRelationship:n?{parent:{id:Yt(n.stableId)}}:null};var i,s}function qt(e){if(!e.variantId)throw new A("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.");return{type:"variant",id:e.variantId.replace("ProductVariantMerchandise","ProductVariant"),title:e.title,subtitle:e.subtitle,image:e.image?{url:e.image.four,altText:e.image.altText}:void 0,selectedOptions:e.options.map(e=>({name:e.name,value:e.value})),product:{id:e.productId,vendor:e.vendor,productType:e.productType},requiresShipping:e.requiresShipping,sellingPlan:e.sellingPlan?{id:e.sellingPlan.id,recurringDeliveries:Boolean(e.sellingPlan.subscriptionDetails)}:void 0,sku:e.sku??void 0}}function Ht(e){const{lineAllocation:t,image:n}=e;return{id:(i=t.stableId,`gid://shopify/PresentmentCartLine/${i}`),title:e.title,subtitle:e.subtitle,lines:[jt(e)],quantity:t.quantity,cost:{totalAmount:t.checkoutPriceAfterDiscounts},image:n?{url:n.four,altText:n.altText}:void 0};var i}function Yt(e){return`gid://shopify/CartLineComponent/${e}`}const zt="merchandiseError:",Jt=function(e){let t,n=!1;function i(){return t??=F(e).catch(e=>{throw t=void 0,e}),t}return{load:i,preload(){n||(n=!0,V(()=>{i().catch(()=>{})}))}}}(()=>xe(()=>import("./9f28056f.BLjliJB1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54])));function Wt({negotiated:e,proposed:t,createSubscribableFromSignal:n,extension:i,stableDetourSignal:s,cartInstructionsSignal:a,cartLineChangeLoadingSignal:o,observability:r,applyChange:c,extensionInstance:d,isCheckoutEditor:l,refusedMerchandise:u}){async function p(n,i){o.value=!0;const{mutations:c}=await Jt.load();return c.applyCartLineChange({change:n,negotiated:e,proposed:t,stableDetourSignal:s,cartInstructionsSignal:a,negotiate:i,isCheckoutEditor:l,observability:r,refusedMerchandise:u})}return Jt.preload(),{lines:n(We(()=>{const t=e.fields.merchandiseLines.value,n=e.fields.remoteMerchandiseDetails?.value;return t?t.lines.filter(e=>!I(e.stableId,n)).flatMap(e=>null==e.productId?[]:e.variantId?Y(e).map(jt):(r.error(new A("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.")),[])):[]})),applyCartLinesChange:async e=>c({unknownChange:e,extension:i,extensionInstanceId:d.id,handlers:{addCartLine:async({negotiate:e,change:t})=>p(t,e),removeCartLine:async({negotiate:e,change:t})=>p(t,e),updateCartLine:async({negotiate:e,change:t})=>p(t,e)},errorResult:e=>e.message.startsWith(zt)?{type:"error",message:e.message}:{type:"error",message:`Could not apply line item changes. Error: ${e.message}`}}).finally(()=>{o.value=!1})}}function Qt({proposed:e,negotiated:t,createSubscribableFromSignal:n,extension:i,cartInstructionsSignal:s,applyChange:a,extensionInstance:r}){return{note:n(e.note),applyNoteChange:async n=>a({unknownChange:n,extension:i,extensionInstanceId:r.id,handlers:{async updateNote({negotiate:n,change:i,markChangeAsNoOp:s}){if(c(),"string"!=typeof i.note)throw new o('Invalid NoteChange: note must be of type "string"');if(i.note&&i.note.length>5e3)throw new o("Invalid NoteChange: note must be less than or equal to 5000 characters");return function(e,t,n){const i=e||void 0;return t===i&&(n||void 0)===i}
2(i.note,e.note.peek(),t.fields.note.peek())?(s(),{type:"success"}):(e.note.value=i.note||void 0,await Ze(()=>n({silenceViolations:["all"]})),{type:"success"})},async removeNote({negotiate:n,markChangeAsNoOp:i}){return c(),s=e.note.peek(),a=t.fields.note.peek(),void 0===s&&void 0===(a||void 0)?(i(),{type:"success"}):(e.note.value=void 0,await Ze(()=>n({silenceViolations:["all"]})),{type:"success"});var s,a}},errorResult:e=>({type:"error",message:e.message})})};function c(){if(!s.peek().notes.canUpdateNote)throw new o(Be("applyNoteChange","notes"))}}const Kt=new Set(["firstName","lastName","name","company","address1","address2","city","provinceCode","countryCode","zip","phone"]);function Xt(e){const{extension:t}=e,{applyAttributeChange:n}=et(e),{applyCartLinesChange:s}=Wt(e),{applyNoteChange:a}=Qt(e),{applyMetafieldChange:o}=dt(e),{applyDiscountCodeChange:r}=Ot(e),{applyGiftCardChange:c}=Ft(e),{applyShippingAddressChange:d}=function(e){const{extension:t,extensionInstance:n,applyChange:i}=e;return Jt.preload(),$(t.approvalScopes,Se.CustomerPersonalData)?{applyShippingAddressChange:async function(s){return i({unknownChange:s,extension:t,extensionInstanceId:n.id,handlers:{async updateShippingAddress(t){const{mutations:n}=await Jt.load();return n.applyShippingAddressChange(t,e)}},errorResult:e=>({type:"error",errors:e instanceof ue?e.cause?.errors??[{message:e.message}]:[{message:e.message}]})})}}:{applyShippingAddressChange:void 0}}(e),{applyShippingAddressChange:l}=function(e){return e?{applyShippingAddressChange:async t=>{const n=await e(function(e){const t=e?.address;if("object"!=typeof t||null===t)return e;const{addressCode:n,...i}=t;return{...e,address:i}}(t));return"error"!==n.type?n:{type:"error",errors:n.errors.map(({message:e,field:t})=>function(e){return void 0!==e&&Kt.has(e)}(t)?{message:e,field:t}:{message:e})}}}:{applyShippingAddressChange:void 0}}(d),{experimentalIsShopAppStyle:u}=function({extension:e,checkout:t}){return{experimentalIsShopAppStyle:Ce({allowLocal:!0,extension:e})?"shopPay"===t.identity.current.value:void 0}}(e);switch(t.apiVersion){case"2023-04":return{applyAttributeChange:n,applyCartLinesChange:s,applyNoteChange:a,applyMetafieldChange:o,applyDiscountCodeChange:r,applyGiftCardChange:c};case"2023-07":case"2023-10":case"2024-01":case"2024-04":case"2024-07":case"2024-10":case"2025-01":case"2025-04":case"2025-07":case"unstable":case"2025-10":case"2026-01":case"2026-04":case"2026-07":return{applyAttributeChange:n,applyCartLinesChange:s,applyNoteChange:a,applyMetafieldChange:o,applyDiscountCodeChange:r,applyGiftCardChange:c,applyShippingAddressChange:l,experimentalIsShopAppStyle:u};case"2026-10":case"2027-01":return{applyAttributeChange:n,applyCartLinesChange:s,applyNoteChange:a,applyMetafieldChange:o,applyDiscountCodeChange:r,applyGiftCardChange:c,applyShippingAddressChange:d,experimentalIsShopAppStyle:u};default:i(t.apiVersion)}}function Zt(e){const{createSubscribableFromSignal:n}=e,{apiVersion:i}=e.extension;return t(i).equalTo("unstable")?{order:n(O(void 0))}:t(i).laterThan("2025-07")?{}:{order:n(O(void 0))}}function en({negotiated:e,createSubscribableFromSignal:t,proposed:n,extension:i}){return $(i.approvalScopes,Se.CustomerPersonalData)?{buyerIdentity:{customer:t(P(()=>{const t=e.fields.buyerIdentity.value?.customerProfile;if("CustomerProfile"===t?.__typename||"BusinessCustomerProfile"===t?.__typename){const e=$(i.approvalScopes,Se.CustomerEmail),n=$(i.approvalScopes,Se.CustomerPhone),s=$(i.approvalScopes,Se.CustomerName),a="CustomerProfile"===t?.__typename?t.storeCreditAccounts.map(e=>({...e,balance:e.balance})):[];return{id:t.id,email:e?t.email??void 0:void 0,phone:n?t.phone??void 0:void 0,fullName:s?t.fullName??void 0:void 0,firstName:s?t.firstName??void 0:void 0,lastName:s?t.lastName??void 0:void 0,image:{url:t.imageUrl},acceptsMarketing:t.acceptsEmailMarketing,acceptsEmailMarketing:t.acceptsEmailMarketing,acceptsSmsMarketing:t.acceptsSmsMarketing,storeCreditAccounts:a,ordersCount:t.ordersCount??0}}})),email:t(P(()=>{if(!$(i.approvalScopes,Se.CustomerEmail))return;const t=n.email.value,s=e.fields.buyerIdentity.value?.customerProfile?.email,a=e.fields.contactInfo.value?.email;return t||s||a})),phone:t(P(()=>{if(!$(i.approvalScopes,Se.CustomerPhone))return;const t=n.phone.value,s=e.fields.buyerIdentity.value?.customerProfile?.phone,a=e.fields.contactInfo.value?.phone;return t||s||a})),purchasingCompany:t(P(()=>{const t=e.fields.buyerIdentity.value?.purchasingCompany;if(t)return{company:{id:t.company.id,name:t.company.name,externalId:t.company?.externalId},location:{id:t.location.id,name:t.location.name,externalId:t.location?.externalId}}}))}}:{buyerIdentity:void 0}}const tn={behavior:"allow"};function nn({extension:e,extensionInstance:t,proposal:n,captureEvent:i,journeyCompletedSignal:s,sourceType:a,createSubscribableFromSignal:r,journeyStateSignal:c,pageBeforeDetourSignal:d,negotiated:l,cartPageSignal:u,checkout:p,interceptorRegistrationResolversSignal:m,observability:f,negotiationRateLimiter:y}){let h=0;const g=m.peek(),v=g.get(e.id);return{intercept(s){const r=String(h++);L(s);let c=!1;const d=[],l={interceptorKey:r,extension:e,captureEvent:i,sourceType:a,observability:f,activeRaces:d,extensionInstance:t,suppressMalformedInterceptionErrors:"persisted"===e.type||"global"===e.type},u=function(e,t){return async({requiresRenderToBlock:n})=>{const{interceptorKey:i,extension:s,captureEvent:a,sourceType:r,observability:c,activeRaces:d,extensionInstance:l,suppressMalformedInterceptionErrors:u}=t;if(n&&!l.rendered)return l.markNotBlocking(i),{isBlocking:!1,interceptorRunResponse:tn};const p=s.capabilities.blockProgress&&s.behaviors.value.blockProgress,m=sn((async()=>{try{return await e({canBlockProgress:p})}catch(t){return c.error(new pe(`Error in buyer journey interceptor callback: ${t}`,{cause:t}),{metadata:{extension:z(s),source:{type:r}}}),{behavior:"allow",perform:()=>{}}}})(),{captureEvent:a,extension:s,onTimeout:()=>
2(c.error(new o("buyer journey interceptor callback timed out"),{metadata:{extension:z(s),source:{type:r}}}),tn)},l.id);let f;d.push(m);try{f=await m.finished,function(e,t){const n=[];if(Object.entries(t||{}).length||n.push("interceptor result cannot be empty or undefined"),t?.behavior&&["block","allow"].includes(t.behavior)||n.push(`behavior must be either "block" or "allow", received "${t?.behavior}"`),t?.hasOwnProperty("perform")&&"function"!=typeof t?.perform&&n.push("perform must be a function: received type "+typeof t?.perform),"block"===t?.behavior&&"string"!=typeof t.reason&&n.push("reason must be a string: received type "+typeof t?.reason),n.length)throw new me(n.join("; "));"local"!==e.type||e.capabilities.blockProgress||"block"!==t?.behavior||console.warn('CannotBlockProgressWarning: extension is not allowed to block checkout progress; permission to block checkout progress must be specified under [capabilities] with flag "block_progress = true; see:\n\nhttps://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress')}(s,f)}catch(y){if(u){const e=y;return console.warn(`${e.name}: ${e.message}`),l.markNotBlocking(i),null}throw y instanceof TypeError&&c.leaveErrorBreadcrumb("BuyerJourneryIntercept: Cannot block progress",{extension:s,interceptorRequest:f}),y}return p&&"block"===f.behavior?(l.markBlocking(i),{isBlocking:!0,interceptorRunResponse:f}):(l.markNotBlocking(i),{isBlocking:!1,interceptorRunResponse:f})}}(s,l),m=async n=>{switch(n){case"registration":return await u({requiresRenderToBlock:!1}),tn;case"negotiation":{const e=await u({requiresRenderToBlock:!0});if(!e)return tn;const{perform:t}=e.interceptorRunResponse;return e.isBlocking?{behavior:"allow",errors:e.interceptorRunResponse.errors,perform:t&&an(()=>t({behavior:"allow"}),l)}:{behavior:"allow",perform:t&&an(()=>t({behavior:"allow"}),l)}}case"progression":case"completion":{const n=await u({requiresRenderToBlock:!0});if(!n)return tn;const{perform:s}=n.interceptorRunResponse;if(n.isBlocking){if(y.isThrottled(e.id)){if(!c){c=!0;const t=ze(e),{isRemoteDom:n,isHighValueExtension:i}=t;f.log("extension_throttled_buyer_journey_block_attempt","[Extensions::BuyerJourneyIntercept] Throttled extension attempted to block checkout progress",{...t,enforced:!0}),f.counter({name:"extension_throttled_buyer_journey_block_attempt",value:1,attributes:{isRemoteDom:n,isHighValueExtension:i,enforced:!0}})}return t.markNotBlocking(r),{behavior:"allow",errors:n.interceptorRunResponse.errors,perform:s&&an(()=>s({behavior:"block"}),l)}}return i("extensionBuyerJourneyBlock",{behavior:"block",reason:n.interceptorRunResponse.reason,extension:e,section:"extension",timestamp:new Date,validationErrors:n.interceptorRunResponse.errors??[]}),f.debug("extensions_buyer_journey_intercepted","[Extensions::BuyerJourneyIntercept] Blocked checkout progress",{...ze(e),errors:n.interceptorRunResponse.errors,reason:n.interceptorRunResponse.reason}),{behavior:"block",reason:k.InvalidExtensionState,errors:n.interceptorRunResponse.errors,perform:s&&an(()=>s({behavior:"block"}),l),context:{extension:z(e)}}}return{behavior:"allow",perform:s&&an(()=>s({behavior:"allow"}),l)}}default:return n}},b=n.intercept(({reason:e})=>m(e));!function({interceptorRegistrationResolvers:e,interceptorRegistration:t,extension:n,sourceType:i,observability:s}){if(t)return a=e,o=n.id,void((r=t)&&a.get(o)===r&&r.resolve());var a,o,r;s.error(new pe("Error registering interceptor resolver. No corresponding extension found in interceptorRegistrationResolversSignal."),{metadata:{extension:z(n),source:{type:i}}})}({interceptorRegistrationResolvers:g,interceptorRegistration:v,extension:e,sourceType:a,observability:f}),m("registration").then(async()=>{if(!p.isCheckoutLayoutForcedToOnePage.value||!p.wallets.isAcceleratedWalletEscalation.value||!t.rendered)return;const e=await u({requiresRenderToBlock:!0});if(!e?.isBlocking)return;const{perform:n}=e.interceptorRunResponse;n&&await an(()=>n({behavior:"block"}),l)()}).catch(t=>{f.error(t,{metadata:{extension:z(e),source:{type:a}}})});const C=t.on("restart",()=>{I()}),A=t.on("destroy",()=>{I()}),I=()=>{t.markNotBlocking(r);for(const e of d)e.abort();b(),C(),A(),U(s)};return I},completed:r(s),steps:r(P(()=>{if(s.value)return[{handle:"thank-you",to:"shopify:checkout/thank-you",label:"thank-you",disabled:!1}];const{plan:{greenPath:e}}=c.value,t=d.value,n=l.value,i=u.value,a=e.filter(({skipOverPage:e})=>!e||!e(n)),o=a.findIndex(e=>
2e.id===t?.id),r=a.map((e,t)=>on({page:e,disabled:o>=0&&t>o}));return i&&r.unshift(on({page:i,disabled:!1})),r})),activeStep:r(P(()=>{if(s.value)return{handle:"thank-you"};const{plan:{greenPath:e}}=c.value,t=d.value;if(!t||!e.some(({id:e})=>e===t.id))return;const n=l.value;return t.skipOverPage?.(n)?void 0:{handle:rn(t).handle}}))}}function sn(e,t,n){const i={finished:Promise.resolve(),abort:()=>{}},{captureEvent:s,extension:a}=t,o=t.duration??3e4,r=performance.now();let c,d;return i.abort=()=>{clearTimeout(d),c(void 0)},i.finished=Promise.race([new Promise(e=>{c=e,d=setTimeout(()=>{c(t.onTimeout())},o)}),e.finally(()=>{s("extensionInteraction",{interaction:"buyerJourneyInterceptor",extension:a,section:"extension",timestamp:new Date,duration:performance.now()-r,extensionInstanceId:n}),clearTimeout(d)})]),i}function an(e,t){const{observability:n,captureEvent:i,extension:s,sourceType:a,activeRaces:r,extensionInstance:c}=t,d=(async()=>{try{return await e()}catch(t){n.error(new o(`${t} (in buyer journey interceptor)`,{cause:t}),{metadata:{extension:z(s),source:{type:a}}})}})();return async()=>{const e=sn(d,{captureEvent:i,extension:s,onTimeout:()=>{n.error(new o("perform() in buyer journey interceptor timed out"),{metadata:{extension:z(s),source:{type:a}}})}},c.id);r.push(e),await e.finished}}function on({page:e,disabled:t}){const{handle:n,route:i}=rn(e),{label:s}=e;return{handle:n,to:i,label:s,disabled:t}}function rn({id:e,route:t}){switch(e){case"information":case"shipping":case"payment":case"review":return{handle:e,route:`shopify:checkout${t}`};case"onePage":case"shopPay":return{handle:"checkout",route:`shopify:checkout${t}`};case"cart":return{handle:"cart",route:"shopify:cart"};default:return{handle:"unknown",route:"#"}}}function cn({cartInstructionsSignal:e,createSubscribableFromSignal:t}){return{instructions:t(e)}}function dn({negotiated:e,createSubscribableFromSignal:t}){return{checkoutSettings:t(P(()=>{const t=e.fields.buyerIdentity.value?.customerProfile,n=e.fields.paymentFlexibilityPaymentTermsTemplate.value,i=n?{id:n.id,name:n.translatedName,dueDate:n.dueDate||void 0,dueInDays:n.dueInDays||void 0}:void 0;return{orderSubmission:e.fields.checkoutCompletionTarget.value||"ORDER",shippingAddress:{isEditable:"BusinessCustomerProfile"!==t?.__typename||!t.checkoutExperienceConfiguration||t.checkoutExperienceConfiguration.editableShippingAddress},paymentTermsTemplate:i}}))}}function ln(e,t){return e&&0!==e.length&&t?e.filter(e=>{const{targetMerchandiseLines:n}=e;return!n||0===n.length||!n.some(e=>I(e.stableId,t))}):e}function un({negotiated:e,isOnePageCheckout:t,createSubscribableFromSignal:n}){return{cost:{subtotalAmount:n(e.fields.subtotal),totalShippingAmount:n(P(()=>{const n=e.fields.deliveryNext.value,i=e.fields.remoteMerchandiseDetails.value;if("filled"!==n?.status)return;const s=ln(n.lines,i),a=(o=!t,s.reduce((e,t)=>{if("not_required"===t.status)return e;const{methods:n,selectedDeliveryMethodHandle:i}=t,s=n.find(({handle:e})=>i===e);if(!s)return e;const a=s?.priceBreakdown?.length&&s.priceBreakdown.every(e=>e.excludeFromDeliveryOptionPrice),r=s?.priceBreakdown?.every(e=>!Boolean(e.targetMerchandiseLines[0]?.sellingPlan?.prepaid));return a&&r&&o||e.push({costAfterDiscounts:s.costAfterDiscounts}),e},[]));var o;return 0!==a.length?{amount:a.reduce((e,{costAfterDiscounts:t})=>e+t.amount,0),currencyCode:a[0]?.costAfterDiscounts.currencyCode}:void 0})),totalTaxAmount:n(P(()=>{const t=e.fields.taxes.value;return"available_total"===t?.status?t.totalTax:"available_total_included"===t?.status?t.totalIncludedInTarget:void("unavailable"===t?.status&&console.error(`Taxes are unavailable: ${t.reason}`))})),totalAmount:n(e.fields.runningTotal)}}}function pn(e,t){const n=t?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,type:(i=e.methodType,"LOCAL"===i?"local":"shipping"),carrier:{name:e.carrierName||void 0},cost:{amount:e.cost.amount,currencyCode:e.cost.currencyCode},costAfterDiscounts:{amount:e.costAfterDiscounts.amount,currencyCode:e.costAfterDiscounts.currencyCode},deliveryEstimate:mn(e),code:e.code||"",metafields:n||[]};var i}function mn(e){return{timeInTransit:fn(e.estimatedTimeInTransit)}}function fn(e){if(e)return"number"==typeof e?{lower:e,upper:e}:{lower:e.lower,upper:e.upper}}function yn(e,t){return t?t.filter(t=>e.some(e=>e.stableId===t.stableId)).flatMap(({lineAllocations:e})=>e.map(e=>({id:`gid://shopify/CartLine/${e.stableId}`}))):[]}function hn(e,t,n){if(0===t.length)return;const i=e.methods.map(e=>e.handle),s=n.find(e=>e&&i.includes(e))||e.selectedDeliveryMethodHandle;return s?{handle:s}:void 0}function gn({pickupLocation:e}){if("PickupPointLocation"===e?.type)return e.carrierName}function vn({pickupLocation:e}){if("PickupPointLocation"===e?.type)return e.carrierCode}function bn(e){const t=e?.coordinates;return null==t?.latitude||null==t.longitude?{}:{latitude:t.latitude,longitude:t.longitude}}function Cn(e){if(e)return w("DeliveryGroup",u(e))}class An{constructor(e,t){this.measureAsync=({functionToMeasure:e})=>Promise.resolve(e()),this.measureSync=({functionToMeasure:e})=>e(),this.observability=t,this.extension=e}static wrapClient(e,t){return t instanceof An?t:new An(e,t)}counter(...e){this.observability.counter(...e)}gauge(...e){this.observability.gauge(...e)}histogram(...e){this.observability.histogram(...e)}debug(...e){this.observability.debug(...e)}log(...e){this.observability.log(...e)}addErrorMetadata(...e){this.observability.addErrorMetadata(...e)}leaveErrorBreadcrumb(...e){this.observability.leaveErrorBreadcrumb(...e)}addOnError(...e){this.observability.addOnError(...e)}removeOnError(...e){this.observability.removeOnError(...e)}async exportMetrics(){await this.observability.exportMetrics()}async exportLogs(){await this.observability.exportLogs()}addAttributesForLogs(...e){this.observability.addAttributesForLogs(...e)}enableKeepAlive(){return this.observability.enableKeepAlive()}error(e,t){const n={...t};n.metadata||(n.metadata={}),n.metadata.extension||(n.metadata.extension=z(this.extension)),this.observability.error(e,n)}leaveBreadcrumb(e,t,n){this.observability.leaveErrorBreadcrumb(e,t,n)}}class In{constructor(e){this.extension=e}filterMetafieldsByExtensionId(e){return e.filter(e=>{const t=e.namespace.split("--");return"app"===t[0]&&t[1]===u(this.extension.appId)||"app"!==t[0]})}}function kn({line:e,extension:t,observability:n,proposedSelectedDeliveryMethodHandles:i,lines:s}){return function({line:e,extensionContext:t,observability:n,proposedSelectedDeliveryMethodHandles:i,lines:s}){if("available"===e.status){const a=function(e,t,n){return e.map(e=>{switch(e.methodType){case"SHIPPING":case"LOCAL":return pn(e,n);case"PICK_UP":return function(e,t,n){const i=function({pickupLocation:e,methodType:t},n){if("PickupInStoreLocation"===e?.type){const{address:t}=e;return{name:e?.name,address:{name:t.name,firstName:t.firstName,lastName:t.lastName,company:t.company,address1:t.address1,address2:t.address2,city:t.city,zip:t.postalCode,countryCode:t.countryCode,provinceCode:t.zoneCode,phone:t.phone,...bn(t)}}}const i=`Invalid pickupLocation type ${e?.type} for ${t} delivery method`;n?.error(new J(i))}(e,t);if(null==i)return;const s=n?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickup",location:i,metafields:s||[]}}
2(e,t,n);case"PICKUP_POINT":return function(e,t,n){const i=function({pickupLocation:e,methodType:t},n){if("PickupPointLocation"===e?.type){const{name:t,address:n,handle:i}=e;return{name:t,handle:i,address:{name:n.name,firstName:n.firstName,lastName:n.lastName,company:n.company,address1:n.address1,address2:n.address2,city:n.city,zip:n.postalCode,countryCode:n.countryCode,provinceCode:n.zoneCode,phone:n.phone,...bn(n)}}}const i=`Invalid pickupLocation type ${e?.type} for ${t} delivery method`;n?.error(new J(i))}(e,t);if(null==i)return;const s=n?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickupPoint",cost:{amount:e.cost.amount,currencyCode:e.cost.currencyCode},costAfterDiscounts:{amount:e.costAfterDiscounts.amount,currencyCode:e.costAfterDiscounts.currencyCode},carrier:{name:gn(e),code:vn(e)},location:i,metafields:s||[]}}(e,t,n);case"RETAIL":case"NONE":return;default:{const n=`Unknown delivery method type: ${e.methodType}`;return void t?.error(new J(n),{metadata:{deliveryMethod:{type:e.methodType,handle:e.handle}}})}}}).filter(e=>null!=e)}(e.methods,n,t);return{targetedCartLines:yn(e.targetMerchandiseLines??[],s),deliveryOptions:a,selectedDeliveryOption:hn(e,a,i),groupType:_e(e.type),isDeliveryRequired:!0,id:Cn(e.id)}}return{targetedCartLines:yn(e.targetMerchandiseLines,s),deliveryOptions:[],selectedDeliveryOption:void 0,groupType:_e(e.type),isDeliveryRequired:!1,id:Cn(e.id)}}({line:e,extensionContext:t?new In(t):void 0,observability:An.wrapClient(t,n),proposedSelectedDeliveryMethodHandles:i,lines:s})}function wn({extension:e,negotiated:t,proposed:n,observability:i,createSubscribableFromSignal:s}){return{deliveryGroups:s(P(()=>{const s=t.fields.deliveryNext.value;if(!s)return[];const a=s.status;if("unavailable"===a)return[];const o=n.deliveryLines.value.map(e=>e.fields.deliveryMethodHandle.value),r=t.fields.remoteMerchandiseDetails.value;if("filled"===a||"partial"===a)return ln(s.lines,r).map(n=>kn({line:n,extension:e,observability:i,proposedSelectedDeliveryMethodHandles:o,lines:t.fields.merchandiseLines.value?.lines}));const c=`Unknown delivery status: ${a}`;return i.error(new fe(c),{metadata:{extension:z(e)}}),[]}))}}function xn({createSubscribableFromSignal:e,proposed:t,extension:n,negotiated:i}){return $(n.approvalScopes,Se.CustomerPersonalData)?{localizedFields:e(P(()=>{const e=t.localizationExtensions.value;return e?e.map(({fields:e})=>({key:e.key.value,title:e.title.value,value:e.value.value??""})):(i.value.localizationExtensions||[]).map(({key:e,title:t,value:n})=>({key:e,title:t,value:n??""}))}))}:{localizedFields:void 0}}function Sn({negotiated:e,proposed:t,createSubscribableFromSignal:n}){return{availablePaymentOptions:n(P(()=>{const n=e.fields.paymentMethods.value,i=t.paymentLines.value,s=e.fields.paymentLines.value,a=e.fields.deferredTotal.value,o="giftCard";if(!n)return[];let r=!1;const c=n?.filter(e=>e.type!==o||(r=!0,!1)).map(e=>({method:e}));if(!c&&!r)return[];const d=x(c),l=S(d,i,n,{negotiatedPaymentLines:s?.lines,deferredTotal:a}),u=l.some(e=>e.method.type===o);return l.map(e=>{const t="name"in e.method?e.method.name:void 0,n="paymentMethodIdentifier"in e.method&&e.method.paymentMethodIdentifier||void 0;return{handle:Q(e.method.type,t,n),type:W(e.method.type)}}).concat(r&&!u?[{handle:Q(o),type:W(o)}]:[])})),selectedPaymentOptions:n(P(()=>{const n=t.paymentLines.value,i=e.fields.paymentMethods.value,s=e.fields.paymentLines.value,a=e.fields.deferredTotal.value;if(!i)return[];const o=x(n);return S(o,n,i,{negotiatedPaymentLines:s?.lines,deferredTotal:a}).map(e=>{const t="name"in e.method?e.method.name:void 0,n="paymentMethodIdentifier"in e.method&&e.method.paymentMethodIdentifier||void 0;return{handle:Q(e.method.type,t,n),type:W(e.method.type)}})}))}}function Tn({extension:e,ui:t}){return{ui:{overlay:{close(n){Ae(e,n)&&t.overlay.close(n)}}}}}function Dn(e){const{shop:t,extension:n,extensionInstance:s}=e;switch(n.apiVersion){case"2023-04":{const i=kt(e),{attributes:a}=et(e),{lines:o}=Wt(e),{presentmentLines:r}=function({negotiated:e,createSubscribableFromSignal:t,observability:n}){return{presentmentLines:t(P(()=>{const t=e.fields.merchandiseLines.value;return t?t.lines.flatMap(e=>e.variantId?Y(e).map(e=>Ht(e)):(n.error(new A("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.")),[])):[]}))}}(e),{note:c}=Qt(e),{metafields:d}=dt(e),{discountAllocations:l,discountCodes:u}=Ot(e),{appliedGiftCards:p}=Ft(e),{shippingAddress:m}=Xe(e);return{version:n.apiVersion,extensionPoint:s.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:Tt(e),shop:Pt(t),appliedGiftCards:p,attributes:a,discountAllocations:l,discountCodes:u,lines:o,metafields:d,note:c,presentmentLines:r,shippingAddress:m,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Nt(e),...mt(e),...Ie(e),...St(e),...Tn(e)}}case"2023-07":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:Tt(e),shop:Pt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Nt(e),...mt(e),...Ie(e),...St(e),...Tn(e)}}case"2023-10":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:Tt(e),shop:Pt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e)}}case"2024-01":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:Tt(e),shop:Pt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e)}}case"2024-04":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e)}}case"2024-07":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e)}}case"2024-10":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e)}}case"2025-01":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2025-04":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2025-07":case"unstable":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2025-10":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2026-01":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{metafields:r}=dt(e),{discountAllocations:c,discountCodes:d}=Ot(e),{appliedGiftCards:l}=Ft(e),{shippingAddress:u,billingAddress:p}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:l,attributes:s,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...Tn(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2026-04":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{discountAllocations:r,discountCodes:c}=Ot(e),{appliedGiftCards:d}=Ft(e),{shippingAddress:l,billingAddress:u}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:d,attributes:s,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2026-07":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{discountAllocations:r,discountCodes:c}=Ot(e),{appliedGiftCards:d}=Ft(e),{shippingAddress:l,billingAddress:u}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:d,attributes:s,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:nn(e),...dn(e),...xt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2026-10":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{discountAllocations:r,discountCodes:c}=Ot(e),{appliedGiftCards:d}=Ft(e),{shippingAddress:l,billingAddress:u}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:d,attributes:s,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:nn(e),...dn(e),...wt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...At(e),...$e(e),...cn(e),...xn(e)}}case"2027-01":{const i=kt(e),{attributes:s}=et(e),{lines:a}=Wt(e),{note:o}=Qt(e),{discountAllocations:r,discountCodes:c}=Ot(e),{appliedGiftCards:d}=Ft(e),{shippingAddress:l,billingAddress:u}=Xe(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...i,apiVersion:i.apiVersion,target:i.target},settings:Tt(e),shop:Dt(t),appliedGiftCards:d,attributes:s,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:nn(e),...dn(e),...wt(e),...en(e),...un(e),...Sn(e),...wn(e),...ht(e),storage:Rt(e),...mt(e),...Ie(e),...St(e),...At(e),...$e(e),...cn(e),...xn(e)}}default:i(n.apiVersion)}}function Pn(e,{stableId:t}){const{extension:n}=e;switch(n.apiVersion){case"2023-04":return{...Rn(e,t)};case"2023-07":case"2023-10":case"2024-01":case"2024-04":case"2024-07":case"2024-10":case"2025-01":case"2025-04":case"2025-07":case"unstable":case"2025-10":case"2026-01":case"2026-04":case"2026-07":case"2026-10":case"2027-01":return{...Nn(e,t)};default:i(n.apiVersion)}}function Nn({createSubscribableFromSignal:e,negotiated:t},n){let i;return{target:e(P(()=>{const e=t.fields.merchandiseLines.value,s=K({stableId:n,merchandiseLines:e?.lines??[]});if(null===s&&!i)throw new ye("No merchandise item found");return null!==s&&(i=jt(s)),i}))}}function Rn({createSubscribableFromSignal:e,negotiated:t},n){let i;return{target:e(P(()=>{const e=t.fields.merchandiseLines.value,s=X(n,e?.lines??[]);if(null===s&&!i)throw new ye("No merchandise item found");if(null!==s){const{parent:e,index:t}=s;i=Ht(Z(e,t))}return i}))}}function _n({applyChange:e,extension:t,proposed:n,createSubscribableFromSignal:i,extensionInstance:s,bankIdNumberSignal:a},{paymentMethodIdentifier:r}){const c=$(t.approvalScopes,Se.CheckoutExtensionPayments);return{applyPaymentMethodAttributesChange:async function(i){return e({unknownChange:i,extension:t,extensionInstanceId:s.id,handlers:{async updatePaymentMethodAttributes({change:e}){if(!c)throw new o(Mn);
2e.attributes.forEach(e=>{if("string"==typeof e.value&&e.value.length>64)throw new o(`Value length exceeded threshold 64 for key ${e.key}`)});const t=n.paymentLines.peek();return n.paymentLines.value=t.map(t=>"customOnsite"!==t.method.type&&"direct"!==t.method.type||t.method.paymentMethodIdentifier!==r?t:{...t,method:{...t.method,paymentAttributes:JSON.stringify(e.attributes)}}),{type:"success"}}},errorResult:e=>({type:"error",message:e.message})})},paymentMethodAttributes:c?i(P(()=>{const e=n.paymentLines.value.find(({method:e})=>{if("direct"===e.type||"customOnsite"===e.type)return e.paymentMethodIdentifier===r&&e.paymentAttributes});if(e){const{paymentAttributes:t}=e.method;if(t)return JSON.parse(t)}})):void 0,bankIdNumber:c?i(a):void 0}}const Mn="Access denied: the extension does not have the required approval scopes";function En({createSubscribableFromSignal:e,extension:t,negotiated:n,proposal:i},s){let a;const o=s?.handle;return{target:e(P(()=>{const e=n.fields.deliveryNext.value;if(!e)return a;if("filled"!==e.status)return a;const i=e.lines.filter(e=>"available"===e.status).flatMap(e=>e.methods).find(e=>e.handle===o);if(i){const e=function(e,t){return function(e,t){const n=t?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickup",location:{address:{address1:e.pickupLocation?.address.address1,address2:e.pickupLocation?.address.address2,city:e.pickupLocation?.address.city,countryCode:e.pickupLocation?.address.countryCode,phone:e.pickupLocation?.address.phone,zip:e.pickupLocation?.address.postalCode,provinceCode:e.pickupLocation?.address.zoneCode,...bn(e.pickupLocation?.address)}},metafields:n||[]}}(e,new In(t))}(i,t);a=d(a,e)?a:e}return a})),isTargetSelected:e(P(()=>i.parts.deliveryLines.value.some(({fields:{deliveryMethodHandle:e}})=>o===e.value)))}}function On({createSubscribableFromSignal:e},{isLocationFormVisible:t}){return{isLocationFormVisible:e(O(t))}}function Ln({createSubscribableFromSignal:e},{isLocationFormVisible:t}){return{isLocationFormVisible:e(O(t))}}function Un({extension:e,negotiated:t,applyChange:n,extensionInstance:i},{paymentMethodIdentifier:s,submitRedeemablePaymentLine:a}){return{applyRedeemableChange:async r=>n({unknownChange:r,extension:e,extensionInstanceId:i.id,handlers:{async redeemableAddChange({negotiate:n,change:i}){if("local"!==e.type&&!$(e.approvalScopes,Se.CheckoutExtensionRedeemables))throw new o("Access denied: the extension does not have the required approval scopes");const r=t.fields.availableRedeemables.peek()?.map(e=>({paymentMethod:Ee(e.paymentMethod)}))??[],c={paymentMethod:{type:"redeemable",redemptionSource:"CUSTOM",redemptionContent:{paymentMethodIdentifier:s,maskedIdentifier:(d=i.identifier,d.slice(0,-4).replace(/./g,"•")+d.slice(-4)),redemptionAttributes:i.attributes}}};var d;const l=Oe(c),u=await n({customizeNegotiation:e=>({...e,availableRedeemables:{availableRedeemables:r.concat(l)}}),fieldsToResolve:["availableRedeemables"]}),p="error"===u.status&&u.violations.some(ee),m=u.violations.find(ee);if(p)throw new o("Could not apply redeemable",{cause:{code:m?.code}});if(a){const e=u.negotiated.availableRedeemables?.find(e=>te(c.paymentMethod,e.paymentMethod)),t=u.negotiated.paymentDue;if(!e||!t)throw new o("Could not apply redeemable",{cause:{code:m?.code}});const n=await a(e,t),i=n&&("error"===n.status&&n.violations.some(T)||"error"!==n.status&&"success"!==n.status);if(!n||i)throw new o("Could not submit redeemable as a payment line")}return{type:"success"}}},errorResult:e=>({type:"error",message:e.message})})}}function Vn({createSubscribableFromSignal:e,extension:t,negotiated:n,proposal:i},{handle:s,isInModal:a}){let o;return{target:e(P(()=>{const e=t?new In(t):void 0,i=n.fields.deliveryNext.value;if(!i)return o;if("filled"!==i.status)return o;const a=i.lines.filter(e=>"available"===e.status).flatMap(e=>e.methods).find(e=>e.handle===s);if(a){const t=pn(a,e);o=d(o,t)?o:t}return o})),isTargetSelected:e(P(()=>i.parts.deliveryLines.value.some(e=>s===e.fields.deliveryMethodHandle.value))),renderMode:{overlay:a??!1}}}function Fn(e,t){const{extension:{apiVersion:n}}=e;switch(n){case"2023-04":case"2023-07":case"2023-10":return{};case"2024-01":case"2024-04":return function({createSubscribableFromSignal:e,observability:t,extension:n,proposed:i,negotiated:s},{groupType:a}){return{target:e(P(()=>{const e=s.fields.deliveryNext.value;if(!a||"filled"!==e?.status)return;const o=s.fields.remoteMerchandiseDetails.value,r=ln(e.lines.filter(D),o).filter(({type:e})=>_e(e)===a),c=i.deliveryLines.value.filter(e=>_e(e.fields.type.value)===a).map(e=>e.fields.deliveryMethodHandle.value),d=s.fields.merchandiseLines.value?.lines,[l]=r;return l?kn({line:l,extension:n,observability:t,proposedSelectedDeliveryMethodHandles:c,lines:d}):void 0}))}}(e,t??{});case"2024-07":case"2024-10":case"2025-01":case"2025-04":case"2025-07":case"unstable":case"2025-10":case"2026-01":case"2026-04":case"2026-07":case"2026-10":case"2027-01":return $n(e,t??{});default:i(n)}}function $n({createSubscribableFromSignal:e,observability:t,extension:n,proposed:i,negotiated:s},{includeDeliverySelectionGroups:a,groupType:o}){return{target:e(P(()=>{const e=s.fields.deliveryNext.value;if(!o||"filled"!==e?.status)return;const a=s.fields.remoteMerchandiseDetails.value,r=ln(e.lines.filter(D),a).filter(({type:e})=>_e(e)===o),c=i.deliveryLines.value.filter(e=>_e(e.fields.type.value)===o).map(e=>e.fields.deliveryMethodHandle.value),d=s.fields.merchandiseLines.value?.lines,l=r.map(e=>kn({line:e,extension:n,observability:t,proposedSelectedDeliveryMethodHandles:c,lines:d}));return l.length>0?{groupType:o,deliveryGroups:l}:void 0})),deliverySelectionGroups:e(P(()=>{const e=i.deliveryMacros.value,t=i.deliveryLines.value.map(e=>e.value).filter(({type:e,deliveryMethodTypes:t})=>"ONE_TIME_PURCHASE"===e&&t.some(e=>"SHIPPING"===e||"LOCAL"===e));if(!a||!e.length||!t.length)return;const n=new Set(t.map(({deliveryMethodHandle:e})=>e).filter(e=>Boolean(e)));return e.map(e=>{const t=Object.values(e.deliveryMethodHandles).filter(e=>Boolean(e));return{handle:e.id,selected:t.length===n.size&&t.every(e=>n.has(e)),title:e.title,associatedDeliveryOptions:t.map(e=>({handle:e})),cost:{amount:e.cost.amount,currencyCode:e.cost.currencyCode},costAfterDiscounts:{amount:e.costAfterDiscounts.amount,currencyCode:e.costAfterDiscounts.currencyCode}}})}))}}const Gn={name:"Checkout::Dynamic::Render",api:e=>({...Dn(e),...Xt(e),...Zt(e)})},Bn={name:"Checkout::Actions::RenderBefore",api:e=>({...Dn(e),...Xt(e)})},jn={name:"Checkout::CartLineDetails::RenderAfter",api:(e,t)=>({...Dn(e),...Xt(e),...Pn(e,t),...Zt(e)})},qn={name:"Checkout::CartLineDetails::RenderLineComponents",api:(e,t)=>({...Dn(e),...Pn(e,t)})},Hn={name:"Checkout::CartLines::RenderAfter",api:e=>({...Dn(e),...Xt(e),...Zt(e)})}
2,Yn={name:"Checkout::Contact::RenderAfter",api:e=>({...Dn(e),...Xt(e)})},zn={name:"Checkout::CustomerInformation::RenderAfter",api:e=>({...Dn(e),...Xt(e),...Zt(e)})},Jn={name:"Checkout::DeliveryAddress::RenderBefore",api:e=>({...Dn(e),...Xt(e)})},Wn={name:"purchase.checkout.delivery-address.render-after",api:e=>({...Dn(e),...Xt(e)})},Qn={name:"Checkout::GiftCard::Render",api:(e,t)=>({...Dn(e),...Xt(e),...Un(e,t)})},Kn={name:"Checkout::PaymentMethod::Render",api:(e,t)=>({...Dn(e),...Xt(e),..._n(e,t)})},Xn={name:"Checkout::PaymentMethod::HostedFields::RenderAfter",api:(e,t)=>({...Dn(e),...Xt(e),..._n(e,t)})},Zn={name:"Checkout::PaymentMethod::RenderRequiredAction",api:e=>({...Dn(e),...Xt(e)})},ei={name:"purchase.checkout.payment-method-list.render-before",api:e=>({...Dn(e),...Xt(e)})},ti={name:"purchase.checkout.payment-method-list.render-after",api:e=>({...Dn(e),...Xt(e)})},ni={name:"Checkout::PickupLocations::RenderBefore",api:(e,t)=>({...Dn(e),...Xt(e),...On(e,t)})},ii={name:"Checkout::PickupLocations::RenderAfter",api:(e,t)=>({...Dn(e),...Xt(e),...On(e,t)})},si={name:"Checkout::PickupPoints::RenderBefore",api:(e,t)=>({...Dn(e),...Xt(e),...Ln(e,t)})},ai={name:"Checkout::PickupPoints::RenderAfter",api:(e,t)=>({...Dn(e),...Xt(e),...Ln(e,t)})},oi={name:"purchase.checkout.pickup-location-option-item.render-after",api:(e,t)=>({...Dn(e),...Xt(e),...En(e,t)})},ri={name:"Checkout::Reductions::RenderBefore",api:e=>({...Dn(e),...Xt(e)})},ci={name:"Checkout::Reductions::RenderAfter",api:e=>({...Dn(e),...Xt(e)})},di={name:"Checkout::ShippingMethodDetails::RenderAfter",api:(e,t)=>({...Dn(e),...Xt(e),...Vn(e,t)})},li={name:"Checkout::ShippingMethodDetails::RenderExpanded",api:(e,t)=>({...Dn(e),...Xt(e),...Vn(e,t)})},ui={name:"Checkout::ShippingMethods::RenderBefore",api:(e,t)=>({...Dn(e),...Xt(e),...Fn(e,t)})},pi={name:"Checkout::ShippingMethods::RenderAfter",api:(e,t)=>({...Dn(e),...Xt(e),...Fn(e,t)})},mi={name:"purchase.checkout.header.render-after",api:e=>({...Dn(e),...Xt(e)})},fi={name:"purchase.checkout.footer.render-after",api:e=>({...Dn(e),...Xt(e)})},yi={name:"purchase.checkout.chat.render",api:e=>({...Dn(e),...Xt(e)})};function hi({extensionInstance:e,announcementEmitter:t}){return"purchase.thank-you.announcement.render"!==e.target||(e.on("destroy",()=>{t.removeAllListeners()}),e.on("restart",()=>{t.removeAllListeners()})),{}}function gi({createSubscribableFromSignal:e,checkout:t,isCheckoutEditor:n,journeyCompletedSignal:i,observability:s}){return{orderConfirmation:e(P(()=>{const e=t.latestReceipt.value,a=!e||"processed"!==e.status;if(a&&n)return{order:{id:w("Order","0")},number:Le().substring(0,10),isFirstOrder:!0};if(a){const t=i.peek()?"No receipt available on thankYou page":"No receipt available";throw e&&s.leaveErrorBreadcrumb("Receipt (OrderConfirmationApi):",{status:e.status,keys:Object.keys(e)}),new he(t)}return{order:{id:e.orderIdentity.id},number:e.orderIdentity.buyerIdentifier??void 0,isFirstOrder:e.isFirstOrder??!0}}))}}const vi={name:"Checkout::ThankYou::Dynamic::Render",api:e=>({...Dn(e),...gi(e)})},bi={name:"Checkout::ThankYou::CartLineDetails::RenderAfter",api:(e,t)=>({...Dn(e),...Pn(e,t),...gi(e)})},Ci={name:"Checkout::ThankYou::CartLines::RenderAfter",api:e=>({...Dn(e),...gi(e)})},Ai={name:"Checkout::ThankYou::CustomerInformation::RenderAfter",api:e=>({...Dn(e),...gi(e)})},Ii={name:"purchase.thank-you.header.render-after",api:e=>({...Dn(e),...gi(e)})},ki={name:"purchase.thank-you.footer.render-after",api:e=>({...Dn(e),...gi(e)})},wi={name:"purchase.thank-you.chat.render",api:e=>({...Dn(e),...gi(e)})},xi={name:"purchase.thank-you.announcement.render",api:e=>({...Dn(e),...gi(e),...hi(e)})},Si={[Gn.name]:Gn,[Bn.name]:Bn,[jn.name]:jn,[qn.name]:qn,[Hn.name]:Hn,[Yn.name]:Yn,[zn.name]:zn,[Jn.name]:Jn,[Wn.name]:Wn,[Qn.name]:Qn,[Kn.name]:Kn,[Xn.name]:Xn,[ei.name]:ei,[ti.name]:ti,[ni.name]:ni,[ii.name]:ii,[oi.name]:oi,[si.name]:si,[ai.name]:ai,[Zn.name]:Zn,[ri.name]:ri,[ci.name]:ci,[di.name]:di,[ui.name]:ui,[pi.name]:pi,[li.name]:li,[mi.name]:mi,[fi.name]:fi,[yi.name]:yi,[vi.name]:vi,[bi.name]:bi,[Ci.name]:Ci,[Ai.name]:Ai,[Ii.name]:Ii,[ki.name]:ki,[wi.name]:wi,[xi.name]:xi},Ti=[yi.name,wi.name,xi.name],Di=[yi.name,wi.name,xi.name];export{Ti as D,zt as M,Si as R,Di as a,Xe as b,et as c,dt as d,ze as e,ht as f,Rt as g,Dt as h,Be as i,Tt as j,kt as k,St as l,xt as m,At as n,mt as o,Mt as p,It as q,He as r,pt as s,Ye as t,je as u,Ge as v,Ve as w,qe as x,Fe as y};

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.