1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["cf517225.CvvV_UjN.js","4c290a1e.DMQ9xOwP.js","2c1ab0fe.GMbxnz74.js","app.DGSHpWaV.js","assets/app.BuSMBobh.css","assets/previous.Cyrg41An.css","66338e00.BFkksh37.js","0a7dffce.BcNpdEJk.js","164ad2e3.B4L1MRYB.js","9f047e05.DwjCPgK0.js","5fda1420.BLaDhoyL.js","60a453ce.Cg9T1Gj2.js","21cc90a2.Ccyorzx_.js","bb728e1c.CHt2JlPY.js","assets/helpers.CWAfD7H_.css","2210eadb.DF0gIp_2.js","28ac86c0.52eUFLJ9.js","3e6029dd.B7hwoFu9.js","assets/QRCode.XhNv4hkB.css","30074413.D6ocfG5D.js","assets/Pressable.D9SfDfsb.css","efa0389a.ZcaEqvMP.js","assets/Choice.CIaVEvsx.css","9f57d2aa.FdiYumpp.js","8574876b.DlqSeZRL.js","064f6ac1.DPGuEQ9h.js","assets/Popover.Bi1nHaU-.css","assets/DateField.BkE3n11i.css","598fef4e.Blg5kMTg.js","assets/PaymentIcon.DUuFvlux.css","33d2e4fc.99-2I_X4.js","assets/NumberField.C0qMELBD.css","39921a74.BMGPgeDG.js","assets/Switch.CxvbvO76.css","27f09e31.DahwbqDd.js","137622f3.BPoTw3JS.js","54bf0ebb.SmHxAfrv.js","assets/Sheet.CVSBHI9d.css","1ed8f5e3.DkmKdCgD.js","assets/floating-layer.DfWUBaTh.css","2fdb3dd3.DyNzUnPi.js","53bbdad9.oGVvLPt2.js","47b970b2.C6dKnXeF.js","29034f35.DARWjbfB.js","ac5a19ff.BchXgW63.js","0727407f.DihGPUji.js","assets/PhoneField.-WW1pYgW.css","assets/AnnouncementRuntimeExtensions.54OByf3e.css","413b21e2.DZZRDa_s.js","9c384ce8.CFjjgE6K.js"])))=>i.map(i=>d[i]); 2import{A as e,i as t,t as n,g as s,e as i}from"./60a453ce.Cg9T1Gj2.js";import{G as a,t as o,T as r,q as c,m as d,n as l,j as u,y as p,r as m,a4 as f,aw as y,p as h}from"./2c1ab0fe.GMbxnz74.js";import{b8 as g,j2 as v,S as b,fR as C,aN as I,dz as A,g as S,J as E,dT as _,dX as T,bk as k,cg as w,bm as D,bj as x,j3 as N,cn as R,dg as O,j4 as L,bD as M,bp as P,h as V,c9 as U,ca as Y,ia as F,aF as G}from"./4c290a1e.DMQ9xOwP.js";import{o as B,p as $,q as H,r as j,s as q,d as J,U as z,S as Q,t as W,I as K,D as Z,u as X,O as ee}from"./66338e00.BFkksh37.js";import{e2 as te,de as ne,g8 as se,g6 as ie,ha as ae,hb as oe,hc as re,hd as ce,he as de,e1 as le,bY as ue,bZ as pe,hf as me,dX as fe,hg as ye,h0 as he,hh as ge}from"./164ad2e3.B4L1MRYB.js";import{b as ve,i as be,d as Ce}from"./0a7dffce.BcNpdEJk.js";import{g as Ie,b as Ae,a as Se}from"./28ac86c0.52eUFLJ9.js";import{_ as Ee}from"./app.DGSHpWaV.js";import{p as _e,c as Te,b as ke,q as we,a as De,g as xe}from"./413b21e2.DZZRDa_s.js";import{e as Ne}from"./9c384ce8.CFjjgE6K.js";import{m as Re}from"./21cc90a2.Ccyorzx_.js";import{v as Oe}from"./2210eadb.DF0gIp_2.js";const Le=e=>e??[];function Me(e){const t=e.merchantVisitorConsent();return{allowedProcessing:e.merchantAllowedProcessing(),visitorConsent:{analytics:Te(t.analytics),marketing:Te(t.marketing),preferences:Te(t.preferences),saleOfData:Te(t.sale_of_data)},shouldShowBanner:e.shouldShowBanner.value,saleOfDataRegion:e.saleOfDataRegion.value,region:_e(e.getRegion.value),metafields:Le(e.merchantMetafields())}}const Pe={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 Ve({customerPrivacySignal:t,createSubscribableFromSignal:n,extension:s,storefrontTokens:i,applyChange:o,extensionInstance:r,checkout:c,consentManager:d}){const l=!0===s.capabilities.collectBuyerConsent?.customerPrivacy,u=te(s.approvalScopes,e.CustomerPersonalData);return{applyTrackingConsentChange:async function(e){return o({unknownChange:e,extension:s,extensionInstanceId:r.id,allowChangeAfterJourneyCompletion:!0,allowChangeDuringAcceleratedWallet:!0,handlers:{async changeVisitorConsent({change:e}){if(!l)throw new g("Capability not specified: Please declare this in your config: collect_buyer_consent.customer_privacy = true.");if(!u)throw new g("Personal data approval scope missing");if("shopPay"===c.identity.current.value)throw new g("The Customer Privacy API is not supported in Shop Pay.");const n=(e.metafields||[]).filter(e=>void 0!==e.value);if(!Boolean(n.length)&&void 0===e.analytics&&void 0===e.marketing&&void 0===e.preferences&&void 0===e.saleOfData)return{type:"success"};const a=await i.get(s.appId,s.type,"customerPrivacy"),o=t.peek();return new Promise((s,i)=>{d.setTrackingConsent({analytics:e.analytics,marketing:e.marketing,preferences:e.preferences,saleOfData:e.saleOfData,isExtensionToken:!0,storefrontAccessToken:a??void 0,...n.length&&{metafields:n}},(...[n,a])=>{if(a)t.value={...o,allowedProcessing:d.merchantAllowedProcessing(),metafields:Le(d.merchantMetafields()),visitorConsent:{analytics:e.analytics,marketing:e.marketing,preferences:e.preferences,saleOfData:e.saleOfData}},s({type:"success"});else if(n instanceof Error)i(new g(`Failed to set tracking consent: ${n.message}`));else if(n&&"error"in n){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 H(n):null!=t&&t>
2=400?new j(n):"undefined"!=typeof navigator&&v(navigator.userAgent)&&e.includes("The string did not match the expected pattern")?new B(n):new $(n)}(String(n.error),n.statusCode);i(e)}else i(new $("Received unexpected callback from setTrackingConsent()"))})})}},errorResult:e=>e instanceof g||e instanceof B||e instanceof $||e instanceof H||e instanceof j?{type:"error",message:e.message}:{type:"error",message:`Failed to set tracking consent: ${e.message}`}})},customerPrivacy:n(a(()=>{const{region:e,...n}=t.value,{countryCode:s,provinceCode:i}=e||{};return{...n,region:s||i?{countryCode:u?s:void 0,provinceCode:u?i:void 0}:void 0}}))}}function Ue(){const{source:e,checkout:t}=b(),n=ne();return o(()=>{const s=t.addressManager.shipping.value.applyAddressChangeBlockReason("ui-extension");return function({sourceType:e="checkout",canUpdateDiscountCodes:t,canSelectCustomAddress:n}){const s="draftOrder"===e;return{attributes:{canUpdateAttributes:!0},delivery:{canSelectCustomAddress:n},discounts:{canUpdateDiscountCodes:t},lines:{canAddCartLine:!s,canRemoveCartLine:!s,canUpdateCartLine:!s},metafields:{canSetCartMetafields:!0,canDeleteCartMetafield:!0},notes:{canUpdateNote:!s}}}({sourceType:e.type,canUpdateDiscountCodes:n.value,canSelectCustomAddress:!s.value})})}function Ye(e,t){return`${e} is not supported on this checkout. Consider checking "instructions.${t}" first.`}function Fe(e){const t=r(()=>new Map,[]),n=c(t);return d(()=>{Ge(t,e)},[e,t]),n}function Ge(e,t){for(const n of t)Be(e,n.id)}function Be(e,t){const n=e.get(t);if(n)return n;let s=()=>{};const i={promise:new Promise(e=>{s=e}),resolve:s};return e.set(t,i),i}function $e(e,t,n){e.get(t)===n&&e.delete(t)}function He(e){const n="local"===e.type?void 0:e.registrationId;return{appId:e.appId,appName:e.appName,extensionId:ie(e),extensionRegistrationId:n,extensionName:e.name,extensionVersion:e.version,extensionApiVersion:e.apiVersion,extensionTarget:e.extensionPoint.target,extensionPlacement:e.placementReference,extensionType:e.type,isHighValueExtension:null!=n&&se.has(n),isRemoteDom:!!e.apiVersion&&t(e.apiVersion)}}function je(e,t=Je){let n,s=!1;return a(()=>{const i=e();return s?t(n,i)?n:(n=i,i):(s=!0,n=i,i)})}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(!Je(e[n],t[n]))return!1;return!0}function Je(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),s=Object.keys(t);return n.length===s.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&e[n]===t[n])}const ze={name:e.CustomerName,firstName:e.CustomerName,lastName:e.CustomerName,company:void 0,address1:e.CustomerAddress,address2:e.CustomerAddress,city:void 0,zip:e.CustomerAddress,countryCode:e.CustomerPersonalData,provinceCode:void 0,phone:e.CustomerPhone,oneTimeUse:void 0},Qe={firstName:["DELIVERY_FIRST_NAME_REQUIRED","DELIVERY_FIRST_NAME_TOO_LONG","DELIVERY_FIRST_NAME_CONTAINS_EMOJIS","DELIVERY_FIRST_NAME_CONTAINS_HTML_TAGS","DELIVERY_FIRST_NAME_CONTAINS_URL","DELIVERY_FIRST_NAME_CONTAINS_MATHEMATICAL_SYMBOLS"],lastName:["DELIVERY_LAST_NAME_REQUIRED","DELIVERY_LAST_NAME_TOO_LONG","DELIVERY_LAST_NAME_CONTAINS_EMOJIS","DELIVERY_LAST_NAME_CONTAINS_HTML_TAGS","DELIVERY_LAST_NAME_CONTAINS_URL","DELIVERY_LAST_NAME_CONTAINS_MATHEMATICAL_SYMBOLS"],company:["DELIVERY_COMPANY_REQUIRED","DELIVERY_COMPANY_TOO_LONG","DELIVERY_COMPANY_CONTAINS_EMOJIS","DELIVERY_COMPANY_CONTAINS_HTML_TAGS","DELIVERY_COMPANY_CONTAINS_MATHEMATICAL_SYMBOLS"],address1:["DELIVERY_ADDRESS1_REQUIRED","DELIVERY_ADDRESS1_TOO_LONG","DELIVERY_ADDRESS1_CONTAINS_EMOJIS","DELIVERY_ADDRESS1_CONTAINS_HTML_TAGS","DELIVERY_ADDRESS1_CONTAINS_MATHEMATICAL_SYMBOLS"],address2:["DELIVERY_ADDRESS2_REQUIRED","DELIVERY_ADDRESS2_TOO_LONG","DELIVERY_ADDRESS2_CONTAINS_EMOJIS","DELIVERY_ADDRESS2_CONTAINS_HTML_TAGS","DELIVERY_ADDRESS2_CONTAINS_MATHEMATICAL_SYMBOLS"],city:["DELIVERY_CITY_REQUIRED","DELIVERY_CITY_TOO_LONG","DELIVERY_CITY_CONTAINS_EMOJIS","DELIVERY_CITY_CONTAINS_HTML_TAGS","DELIVERY_CITY_CONTAINS_MATHEMATICAL_SYMBOLS"],provinceCode:["DELIVERY_ZONE_REQUIRED_FOR_COUNTRY","DELIVERY_ZONE_NOT_FOUND"],zip:["DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY","DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE","DELIVERY_POSTAL_CODE_CONTAINS_EMOJIS","DELIVERY_POSTAL_CODE_REQUIRED","DELIVERY_POSTAL_CODE_NOT_SUPPORTED","DELIVERY_POSTAL_CODE_CONTAINS_MATHEMATICAL_SYMBOLS"],phone:["DELIVERY_PHONE_NUMBER_REQUIRED","DELIVERY_PHONE_NUMBER_CONTAINS_EMOJIS","DELIVERY_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"],countryCode:["DELIVERY_COUNTRY_REQUIRED"],oneTimeUse:[]},We=new Map(Object.entries(Qe).flatMap(([e,t])=>t.map(t=>[t,e])));function Ke({createSubscribableFromSignal:t,extension:n,negotiated:s,proposed:i,journeyCompletedSignal:a,cartInstructionsSignal:o,applyChange:r,extensionInstance:c,captureEvent:d,observability:u,checkout:p,deliveryMethodsAddressErrors:m}){if(!te(n.approvalScopes,e.CustomerPersonalData))return{billingAddress:void 0,shippingAddress:void 0};const f=(e,t)=>te(n.approvalScopes,t)?e:void 0;let y;const h=je(()=>{const t=t=>
2{if(void 0===t||function(e){return 0===Object.keys(e).length}(t))return;const{address1:n,address2:s,city:i,company:a,countryCode:o,firstName:r,lastName:c,name:d,phone:l,oneTimeUse:u,zoneCode:p,postalCode:m}=t;return{address1:f(n,e.CustomerAddress),address2:f(s,e.CustomerAddress),city:i,company:a,countryCode:f(o,e.CustomerPersonalData),firstName:f(r,e.CustomerName),lastName:f(c,e.CustomerName),name:f(d,e.CustomerName),phone:f(l,e.CustomerPhone),provinceCode:p,zip:f(m,e.CustomerAddress),oneTimeUse:u}};if(!1===s.fields.isShippingRequired.value)return;if(a.value)return t(s.fields.shippingAddress.peek());const n=t(i.shippingAddress.value),o=i.shippingAddress.value?.countryCode,r=y?.countryCode;return i.shippingAddress.dirtyFields.value.has("countryCode")&&r&&o!==r?y:(y=n,n)});return{billingAddress:t(je(()=>{const t=t=>{if(void 0===t)return;const{address1:n,address2:s,city:i,company:a,countryCode:o,firstName:r,lastName:c,name:d,phone:l,zoneCode:u,postalCode:p}=t;return{address1:f(n,e.CustomerAddress),address2:f(s,e.CustomerAddress),city:i,company:a,countryCode:f(o,e.CustomerPersonalData),firstName:f(r,e.CustomerName),lastName:f(c,e.CustomerName),name:f(d,e.CustomerName),phone:f(l,e.CustomerPhone),provinceCode:u,zip:f(p,e.CustomerAddress)}};if(a.value)return t(s.fields.billingAddress.peek());const n=i.billingAddress.value;switch(i.billingAddressOption.value){case"shipping":{const e=s.fields.buyerIdentity.value?.purchasingCompany;if(e)return t(e?.location?.shippingAddress??n);if(h.value){const{oneTimeUse:e,...t}=h.value;return t}return t(n)}case"billing":{const e=s.fields.buyerIdentity.value?.purchasingCompany?.location.billingAddress;return t(e??n)}default:return t(n)}})),shippingAddress:t(h),applyShippingAddressChange:async function(e){return r({unknownChange:e,extension:n,extensionInstanceId:c.id,handlers:{async updateShippingAddress({change:e,negotiate:t}){if(!o.peek().delivery.canSelectCustomAddress){const e=p.addressManager.shipping.value.a
2pplyAddressChangeBlockReason("ui-extension").value,t=e?et[e]:Ye("applyShippingAddressChange","delivery");throw new q(t,{cause:{errors:[{message:t}]}})}const s=function(e){return"object"!=typeof e.address||null===e.address?'Missing "address" property value.':e.address.countryCode&&!A(e.address.countryCode)?"Invalid country code.":null}(e);if(s)throw new q(s,{cause:{errors:[{message:s}]}});const a=new Set,r={...i.shippingAddress.peek()};let f=!1,y=!1;for(const i of Object.keys(e.address)){const t=e.address[i];if("oneTimeUse"!==i){if(void 0!==t&&"string"!=typeof t){const e=`Invalid shipping address value for property "${i}". Expected type string or undefined.`;throw new q(e,{cause:{errors:[{message:e}]}})}}else if(void 0!==t&&"boolean"!=typeof t){const e=`Invalid shipping address value for property "${i}". Expected type boolean or undefined.`;throw new q(e,{cause:{errors:[{message:e}]}})}Qe[i]&&Qe[i].forEach(e=>a.add(e));const s=ze[i];s&&!te(n.approvalScopes,s)||("zip"===i?r.postalCode=t:"provinceCode"===i?r.zoneCode=t:"countryCode"===i?r.countryCode=t:"oneTimeUse"===i?r.oneTimeUse=t:(r[i]=t,"address1"===i?f=!0:"address2"===i&&(y=!0)))}f&&(delete r.streetName,delete r.streetNumber),y&&(delete r.line2,delete r.neighborhood),i.shippingAddress.value?.countryCode!==r?.countryCode&&d("extensionInteraction",{interaction:"marketDriverChangeShippingAddressCountryCode",extension:n,section:"extension",extensionInstanceId:c.id,timestamp:new Date}),u.log("wallets_shipping_address_update","Extensions: update to proposed shipping address",{extensionInstanceId:c.id,isPostalCodePadded:I(r.postalCode,r.countryCode),isPreviousPostalCodePadded:I(i.shippingAddress.value?.postalCode,i.shippingAddress.value?.countryCode),countryCode:r.countryCode});const h=p.addressManager.shipping.value,g=l(()=>{const e={...i.shippingAddress.peek()},t=h.applyAddressChange({source:"ui-extension",address:r});return function(e,t,n){Object.keys(n).filter(e=>!Ze.includes(e)).filter(n=>Xe(e[n])!==Xe(t?.[n])).flatMap(e=>{switch(e){case"countryCode":return[e,"zoneCode","postalCode"];case"zoneCode":return[e,"postalCode"];default:return[e]}}).forEach(e=>{n[e].value=void 0})}(e,i.shippingAddress.peek(),m),t}),v=await g;if("failure"===v.type){const e=et[v.reason];throw new q(e,{cause:{errors:[{message:e}]}})}const b=await t({silenceViolations:["non-delivery-address"],runListenersOnError:!1});if("error"===b.status||"success"===b.status){const e=b.errors.reduce((e,t)=>{if(!a.has(t.code))return e;const n=We.get(t.code);return e.concat({message:nt(t),field:n})},[]);if(e.length>0)throw new q(e.map(({message:e})=>e).join(", "),{cause:{errors:e}})}return{type:"success",errors:null}}},errorResult:e=>({type:"error",errors:e instanceof q?e.cause?.errors??[{message:e.message}]:[{message:e.message}]})})}}}const Ze=["coordinates","handle","oneTimeUse"];function Xe(e){return"string"==typeof e&&""===e.trim()?void 0:e}const et={MUST_SELECT_PROVIDED_ADDRESS:"Could not apply shipping address changes: the buyer must use the provided shipping address",ADDRESS_CHANGES_UNAVAILABLE:"Could not apply shipping address changes: current checkout state does not allow address changes",DELIVERY_ADDRESS_NOT_EDITABLE:Ye("applyShippingAddressChange","delivery"),ADDRESS_COUNTRY_NOT_SUPPORTED:"Could not apply shipping address changes: this checkout cannot ship to the address country"},tt=new Map([["DELIVERY_ZONE_NOT_FOUND","The specified province was not found within the country"],["DELIVERY_ZONE_REQUIRED_FOR_COUNTRY","The specified country requires a province"]]);function nt(e){return tt.get(e.code)??e.localizedMessage??e.nonLocalizedMessage}async function st(e){try{return await e()}catch(t){if(function(e){return e instanceof J&&"object"==typeof e.cause&&null!==e.cause&&"code"in e.cause&&"INVALID_NEGOTIATION"===e.cause.code}(t))return;throw t}}function it({proposed:e,negotiated:t,createSubscribableFromSignal:n,cartInstructionsSignal:s,extension:i,extensionInstance:a,applyChange:o}){return{applyAttributeChange:async function(n){return o({unknownChange:n,extension:i,extensionInstanceId:a.id,handlers:{async updateAttribute({negotiate:n,change:i,markChangeAsNoOp:a}
2){if(at(i),!s.peek().attributes.canUpdateAttributes)throw new g(Ye("applyAttributeChange","attributes"));const o=e.attributes.peek();return function(e,t,n){const s=t=>{const n=t?.find(t=>t.key===e.key);return void 0!==n&&n.value===e.value},i=s(n),a=void 0===t?i:s(t);return i&&a}(i,o,t.fields.customAttributes.peek())?(a(),{type:"success"}):(e.attributes.value=ot(o,i),await st(()=>n({silenceViolations:["all"]})),{type:"success"})},async removeAttribute({negotiate:t,change:n}){if(at(n),!s.peek().attributes.canUpdateAttributes)throw new g(Ye("applyAttributeChange","attributes"));const i=e.attributes.peek();if(!i?.find(e=>e.key===n.key))throw new g(`Invalid AttributeChange: no attribute with specified key found: "${n.key}"`);return e.attributes.value=ot(i,n),await st(()=>t({silenceViolations:["all"]})),{type:"success"}}},errorResult:e=>({type:"error",message:`Could not apply attribute changes. Error: ${e.message}`})})},attributes:n((r=()=>(e.attributes.value||t.fields.customAttributes.value?.map(({key:e,value:t})=>({key:e,value:t})))??[],je(r,qe)))};var r}function at(e){if("string"!=typeof e.key||e.key.length<3||e.key.length>30)throw new g('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 g('Invalid AttributeChange: attribute value must be of type "string"')}function ot(e,t){const n=e?[...e]:[],s=n.findIndex(({key:e})=>e===t.key);return"updateAttribute"===t.type&&(s>-1?n[s]={key:t.key,value:t.value}:n.push({key:t.key,value:t.value})),"removeAttribute"===t.type&&n.splice(s,1),n}const rt=/^\$app|^app--\d+--/,ct=/^app--\d+--/,dt=/^app--\d+$/,lt="$app";function ut(e,t){if(e.trim()===lt)return`app--${t}`;const n=lt+":";return e.trim().startsWith(n)?`app--${t}--${e.slice(5)}`:e}const pt="2026-01";function mt({proposed:e,createSubscribableFromSignal:t,extension:s,cartInstructionsSignal:i,applyChange:o,extensionInstance:r,checkout:c}){const{extensibility:d}=c,l="local"===s.type&&n(s.apiVersion).equalTo(pt);return{metafields:t(a(()=>{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:s})=>({key:e,namespace:t,value:n,valueType:s}))})),applyMetafieldChange:async t=>o({unknownChange:t,extension:s,extensionInstanceId:r.id,handlers:{async updateMetafield({change:e}){if(!ht(s.apiVersion))throw new g("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:s,valueType:i}=e;if("string"!=typeof t||t.length<3||t.length>30)throw new g(`Invalid property key: "${t}". It must be between 3 and 30 characters in length (inclusive).`);if("string"!=typeof n)throw new g(`Invalid property namespace: "${n}". It must be a string between 2 and 20 characters (inclusive).`);if(n.length<2||n.length>20)throw new g(`Invalid property namespace: "${n}". It must be between 2 and 20 characters in length (inclusive).`);if(rt.test(n))throw new g(`Invalid property namespace: "${n}". App reserved namespaces not supported.`);switch(i){case"integer":if("number"!=typeof s)throw new g(`Invalid property value: "${s}". It must be a number.`);break;case"string":if("string"!=typeof s)throw new g(`Invalid property value: "${s}". It must be a string.`);if(s.length<=0)throw new g(`Invalid property value: "${s}". 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}(s))throw new g(`Invalid property value: "${s}". It must be a json_string.`);break;default:throw new g(`Invalid property valueType: "${i}". It must be in one of these values: integer, string, json_string.`)}}(e);const{key:t,namespace:n,value:i,valueType:a}=e,o=d.ui.metafields.value,r=o.findIndex(e=>e.key===t&&e.namespace===n),c=[...o],u=c[r];return u?c[r]={...u,value:i,valueType:a,appId:s.appId}:c.push({key:t,namespace:n,value:i,valueType:a,appId:s.appId}),d.ui.updateMetafields(c),{type:"success"}},async removeMetafield({change:e}){if(!ht(s.apiVersion))throw new g("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,i=d.ui.metafields.value.filter(e=>e.key!==t||e.namespace!==n);return d.ui.updateMetafields(i),{type:"success"}},async updateCartMetafield({change:t,negotiate:n}){ft(t.type,i.peek().metafields),function(e){const{metafield:t}=e;if(null==t)throw new g(`Invalid property metafield: "${t}". It must be an object.`);const{key:n,namespace:s,value:i,type:a}=t;if("string"!=typeof n||n.length<2||n.length>64)throw new g(`Invalid property key: "${n}". It must be between 2 and 64 characters in length (inclusive).`);if(null!==s&&"string"!=typeof s&&void 0!==s)throw new g(`Invalid property namespace: "${s}". namespace must be null, undefined, or a string between 3 and 255 characters (inclusive).`);if("string"==typeof s&&(s.length<3||s.length>255))throw new g(`Invalid property namespace: "${s}". It must be between 3 and 255 characters in length (inclusive).`);if("string"!=typeof a)throw new g(`Invalid property type: "${a}". It must be a string. Received type: ${typeof a}.`);if("integer"===a){if("number"!=typeof i&&"string"!=typeof i)throw new g(`Invalid property value: "${i}". It must be a number or a string when type is "integer". Received type: ${typeof i}.`)}else if("string"!=typeof i)throw new g(`Invalid property value: "${i}". It must be a string when type ("${a}") is not "integer". Received type: ${typeof i}.`)}(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:s.appId}}],yt(await n({fieldsToResolve:["cartMetafields"],silenceViolations:["all"]}),e,t),{type:"success"}},removeCartMetafield:async({change:t,negotiate:n})=>(ft(t.type,i.peek().metafields),function(e){const{key:t,namespace:n}=e;if("string"!=typeof t)throw new g(`Invalid property key: "${t}". It must be a string.`);if(null!=n&&"string"!=typeof n)throw new g(`Invalid property namespace: "${n}". The namespace must be either null, undefined, or a string.`)}(t),e.cartMetafields.value=[...e.cartMetafields.peek(),{delete:{appId:s.appId,key:t.key,namespace:t.namespace}}],yt(await n({fieldsToResolve:["cartMetafields"],silenceViolations:["all"]}),e,t),{type:"success"})},errorResult:e=>({type:"error",message:e.message})})}}function ft(e,{canSetCartMetafields:t,canDeleteCartMetafield:n}){const s=`applyMetafieldChange with type ${e}`;if("updateCartMetafield"===e&&!t)throw new g(Ye(s,"metafields"));if("removeCartMetafield"===e&&!n)throw new g(Ye(s,"metafields"))}function yt(e,t,n){const s=[...t.cartMetafields.peek()],i=e.errors.filter(e=>ae.has(e.code));if(0===i.length)return;const a=i.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},{}),o=s.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)),r=a[o];if(o>-1&&r)throw t.cartMetafields.value=s.slice(0,o),new g(r.nonLocalizedMessage,{cause:{code:r.code}})}function ht(e){return!n(e).laterThan(pt)}function gt({webPixels:e,extension:t}){const n=S(t.appId)||"unknown-app",s=S(ie(t))||"unknown-extension";return{analytics:{publish:(i,a={})=>e.publishCustomEvent(i,a,{extension:{extensionId:s,appId:n,type:t.type||"unknown-type"}}),visitor:t=>e.visitor(t,{apiClientId:n})}}}const vt={id:"be4fa5a8e92c26d115e34073b486a58fc317388a2eedddb82d02eeccb9573278",type:"query",name:"ExtensionMetafields",source:""},bt=async({withCache:e=!0,coreGraphql:t,extension:n,observability:s,negotiated:i,checkoutProfileId:a,appMetafieldsSignal:o})=>{let r=[];const c=ke(i),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 s={resourceIds:c};"local"===n.type?s.extensionHandles=[{handle:n.handle,apiKey:n.appApiKey}]:s.extensionIds=[`gid://shopify/UiExtension/${n.extensionId}`];const{data:i}=await t.staticQuery(vt,{variables:s,cache:e});i?.extensionMetafields&&(m=i?.extensionMetafields)}r=function({queryResult:e,metafields:t,observability:n,extension:s}){if(e.error)return n.leaveErrorBreadcrumb("Extensions::GraphQL",{reason:"Failed to fetch extension metafields.",message:String(e.error),extensionId:s.id,extensionVersion:"persisted"===s.type?s.version:void 0}),[];const i=[];for(const a of t){if(!St(s,a.ownerType)||!At(s,a))continue;const e=It(s.apiVersion,a.namespace);i.push({target:Et(a.ownerId,a.ownerType),metafield:{key:a.key,namespace:e,value:a.value,type:a.type.toLowerCase(),valueType:a.valueType.toLowerCase()}})}return i}({extension:n,queryResult:d,metafields:m,observability:s}),o.value={...o.peek(),[n.id]:r}};function Ct({coreGraphql:e,extension:t,extensionInstance:n,negotiated:s,observability:i,createSubscribableFromSignal:o,sourceId:r,checkout:c,appMetafieldsSignal:d}){const l=u(()=>{bt({withCache:!0,coreGraphql:e,extension:t,observability:i,negotiated:s,appMetafieldsSignal:d,checkoutProfileId:c.configuration.profileId.value})});n.on("destroy",()=>{l()});const p={type:"extension",extension:t,instanceId:n.id};return(async()=>{Ne.markStarted("app-metafields-load",p);try{await bt({withCache:!0,coreGraphql:e,extension:t,observability:i,negotiated:s,appMetafieldsSignal:d,checkoutProfileId:c.configuration.profileId.value})}finally{Ne.markFinished("app-metafields-load",p)}})(),{appMetafields:o(a(()=>{const e=d.value[t.id]??[],n=t.extensionPoint.metafields??[],i=s.fields.buyerIdentity.value,a=i?.shopUser?.metafields??[],o=i?.shopUser?.publicId??"",c=a.flatMap(e=>e&&o&&n.some(t=>t.key===e.key&&t.namespace===e.namespace)?[{target:{type:"shopUser",id:o},metafield:{key:e.key,namespace:It(t.apiVersion,e.namespace??""),value:e.value,type:e.type,valueType:e.valueType.toLowerCase()}}]:[]),l=s.fields.cartMetafields.value,u=E(t.appId);return[...e,...l?l?.flatMap(e=>e&&null!=e.ownerType&&n.some(n=>!(n.key!==e.key||ut(n.namespace,u)!==e.namespace||n.ownerType&&n.ownerType!==e.ownerType||e.namespaceAppId&&t.appId!==e.namespaceAppId))?[{target:{type:"cart",id:r},metafield:{key:e.key,namespace:It(t.apiVersion,e.namespace??""),value:e.value,type:e.type,valueType:e.valueType.toLowerCase()}}]:[]):[],...c]}))}}function It(e,t){return n(e).laterThan("2025-01")?function(e){return dt.test(e)?lt:e.replace(ct,lt+":")}(t):t}function At(e,t){const n=E(e.appId),s=e.extensionPoint.metafields.filter(e=>e.key===t.key&&ut(e.namespace,n)===t.namespace);return 0===s.length||s.some(e=>!e.ownerType||e.ownerType===t.ownerType)}function St(t,n){switch(n){case"CART":case"PRODUCT":case"PRODUCTVARIANT":case"SHOP":case"SHOPUSER":return!0;case"CUSTOMER":case"COMPANY":case"COMPANYLOCATION":return te(t.approvalScopes,e.CustomerPersonalData);default:return!1}}function Et(e,t){const n=E(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 z(`Metafield ownerType "${t}" with id "${e}" cannot be resolved`)})()}}function _t({publicCheckoutSessionId:e,createSubscribableFromSignal:t}){return{checkoutToken:t(p(e))}}function Tt(e){return{initial:e.current,subscribe(t){m(t);const n=e.subscribe((n=e.current)=>t(n));return[()=>{n(),f(t)},e.current]}}}function kt({extension:e,extensionInstance:t,createSubscribableFromSignal:n,isCheckoutEditor:s,observability:i}){const o=a(()=>{const t=e.behaviors.value,n=new Set;return t.blockProgress||n.add("blockProgress"),function(e,t){const n=[];return Object.keys(e).forEach(s=>{const i=s;i in e&&("object"!=typeof e[i]&&!t.has(i)&&Boolean(e[i])&&n.push(oe(i)),"object"==typeof e[i]&&Object.entries(e[i]).forEac
2h(([e,t])=>{if(Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t){const t=`${oe(s)}.${oe(e)}`;n.push(t)}}))}),n}(e.capabilities,n)}),r=Tt({get current(){return t.rendered},subscribe:e=>{const n=t.on("render",()=>{e(t.rendered)}),s=t.on("remove",()=>{try{e(t.rendered)}catch(n){throw i.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(),s(),a(),o()};return r}});return{scriptUrl:e.scriptUrl,version:"persisted"===e.type?e.version:void 0,apiVersion:e.apiVersion,rendered:r,capabilities:n(o),editor:s?{type:"checkout"}:void 0,target:t.target}}function wt({locale:e,currencySignal:t,timezone:n,extension:s,createSubscribableFromSignal:i,negotiated:o}){return{localization:{language:i(p({isoCode:e})),extensionLanguage:i(p({isoCode:s.extensionLocale})),currency:i(t),timezone:i(p(n??(new Intl.DateTimeFormat).resolvedOptions().timeZone)),country:i(a(()=>{const e=o.fields.buyerIdentity.value?.countryCode;if(e)return{isoCode:e}})),market:i(a(()=>{const e=o.fields.buyerIdentity.value?.market;if(!e)return;const{id:t,handle:n}=e;return{id:t,handle:n}}))}}}function Dt({captureEvent:e,extension:t,locale:n,shop:i,storefrontTokens:a,extensionInstance:o}){const r=t.capabilities.apiAccess;async function c(e,o=!1,d){if(!r)throw new g('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 l=await a.get(t.appId,t.type,"fetchWithToken");if(!l)throw new T(`Could not get a storefront token for app ${t.appId} to query ${e}`);try{const r=await fetch(`https://${i.myshopifyDomain}/api/${d?.version??s(t.apiVersion)}/graphql.json`,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":n,"Shopify-Storefront-Extension-Token":l},body:JSON.stringify({query:e,variables:d?.variables})});return 401===r?.status&&o?(a.cache.delete(a.cacheKey(t.appId,t.type)),c(e,!1,d)):r}catch(u){if("BreadcrumbsPluginFetchError"===u.name&&o)return c(e,!1,d);throw new _(`An error occurred when attempting to fetch the extension api: ${u}`,{cause:u})}}return{query:async(n,s)=>{if(!t.capabilities.apiAccess)throw new g('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 i=performance.now();e("extensionInteraction",{interaction:"storefrontApiQueryStart",extension:t,section:"extension",timestamp:new Date,extensionInstanceId:o.id});try{const r=await c(n,!0,s);if(r&&r.ok){e("extensionInteraction",{interaction:"storefrontApiQuerySuccess",extension:t,section:"extension",timestamp:new Date,duration:performance.now()-i,extensionInstanceId:o.id});try{return await r.json()}catch(a){throw new Q("Failed to parse Storefront API response",{cause:a})}}throw new _(`Failed to query storefront API: status=${r?.status} ${r?.statusText}`.trim())}catch(a){let n="storefrontApiQueryError";throw a instanceof _&&a?.cause instanceof Error&&"BreadcrumbsPluginFetchError"===a.cause?.name?n="storefrontApiQuerySuccess":a instanceof Q&&(n="storefrontResponseParseError"),e("extensionInteraction",{interaction:n,extension:t,section:"extension",timestamp:new Date,duration:performance.now()-i,error:a instanceof Error?a:void 0,extensionInstanceId:o.id}),a}}}}function xt({extension:{configuration:e},createSubscribableFromSignal:t}){return t(e)}function Nt(e){return{id:e.id,name:e.name,storefrontUrl:e.storefrontUrl??void 0,myshopifyDomain:e.myshopifyDomain}}function Rt(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 Ot({extension:e}){return Mt(`v1-${ie(e)}-${e.extensionPoint.target}`)}function Lt({extension:e}){return Mt(`v1-${e.appId}-${e.extensionId}`)}function Mt(e){const t=k.ExtensionStorage,n=t=>`${e}-${t}`,s=()=>x(t)??{};return{async read(e){re("string"==typeof e,'Missing "key" argument. Please pass a key to read from to storage.');const t=n(e),i=s();return Object.keys(i).length&&i[t]||null},async write(e,i){re("string"==typeof e,'Missing "key" argument. Please pass a key to write to to storage.'),re(arguments.length>1,`Missing "data" argument. Please pass a value to write to "${e}" `);const a=n(e),o=s();o[a]=i,D(t,o)},async delete(e){re("string"==typeof e,'Missing "key" argument. Please pass a key to delete from storage.');const i=n(e),a=s();delete a[i],0===Object.keys(a).length?w(t):D(t,a)}}}function Pt(e){return e}const Vt=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_USAG
2E_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 Ut({negotiated:e,proposed:t,extension:n,createSubscribableFromSignal:s,cartInstructionsSignal:i,applyChange:o,extensionInstance:r,currentDiscountCodeAttemptSignal:c}){const d=s(a(()=>{const t=e.fields.discountLines.value?.lines;return t?t.filter(e=>"code"===e.discount.type).map(e=>({code:e.title})):[]})),l=s(a(()=>{const t=e.fields.discountLines.value?.lines;return t?function(e){return e.filter(e=>be(e)&&"CART"===e.discount.presentationLevel).map(e=>{const{discount:t,amount:n,title:s}=e;return"code"===t.type?{type:"code",code:s,discountedAmount:n}:"automatic"===t.type?{type:"automatic",title:s,discountedAmount:n}:{type:"custom",title:s,discountedAmount:n}})}(t):[]})),u=["non-merchandise"];return{discountCodes:d,discountAllocations:l,async applyDiscountCodeChange(e){return o({unknownChange:e,extension:n,extensionInstanceId:r.id,handlers:{addDiscountCode:async({negotiate:e,change:t})=>(s(),Yt(t),Ft(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}){s(),Yt(n);const i=t.discountLines.peek(),a=n.code.toUpperCase(),o=i.find(({discount:e})=>"code"===e.type&&e.title.toUpperCase()===a);if(!o)throw new g(`The discount code "${n.code}" is not allocated to this checkout and cannot be removed.`,{cause:{code:"DISCOUNT_NOT_FOUND"}});return t.discountLines.value=i.filter(({discount:e})=>
2e.title.toUpperCase()!==o.title.toUpperCase()),Ft(await e({fieldsToResolve:[...ce],silenceViolations:u}),n.code),{type:"success"}}},errorResult:e=>({type:"error",message:`Could not apply discount code changes. Error: ${e.message}`})});function s(){if(!i.peek().discounts.canUpdateDiscountCodes)throw new g(Ye("applyDiscountCodeChange","discounts"))}}}}function Yt(e){if("string"!=typeof e.code)throw new g('Discount code must be of type "string"')}function Ft(e,t){const n=e.errors.find(e=>{if("RemoveTermViolation"!==e.type||Ce(e.targetEntity)?.title===t)return Vt.has(e.code)});if(n)throw new g(n.nonLocalizedMessage,{cause:{code:n.code}})}const Gt=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 Bt({negotiated:e,proposed:t,extension:n,createSubscribableFromSignal:s,shop:i,applyChange:o,extensionInstance:r}){return{appliedGiftCards:s(a(()=>{const t=e.fields.paymentLines.value;return t?t.lines.filter(e=>"giftCard"===e.method.type).map(e=>({lastCharacters:R(e.method),amountUsed:e.cost,balance:e.method.balance})):[]})),applyGiftCardChange:async s=>o({unknownChange:s,extension:n,extensionInstanceId:r.id,handlers:{async addGiftCard({negotiate:t,change:n}){$t(n);const s=e.fields.paymentMethods.peek()?.some(e=>"giftCard"===e.type);if(!s)throw new g("the `applyGiftCardChange` API is disabled");return jt(await t({customizeNegotiation:e=>({...e,reduction:{code:n.code}})})),{type:"success"}},async removeGiftCard({negotiate:e,change:n}){$t(n);const s=t.paymentLines.peek(),a=i.hasFlagEnabled(N);let o=s;return a?n.code.split(",").forEach(e=>{o=Ht(o,e)}):o=Ht(o,n.code),t.paymentLines.value=o,jt(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 g("Gift card code must be a string")}function Ht(e,t){const n=t.replace(/[\s-]/g,"").toLowerCase(),s=e.findIndex(({method:e})=>"giftCard"===e.type&&(4===t.length?R(e).toLowerCase()===n.slice(-4):"code"in e&&e.code.toLowerCase()===n));if(-1===s)return e;const i=[...e];return i.splice(s,1),i}function jt(e){const t=e.errors.find(e=>Gt.has(e.code));if(t)throw new g(t.nonLocalizedMessage,{cause:{code:t.code}})}function qt(e){const{lineAllocation:t}=e,n="parentRelationship"in e?e.parentRelationship?.parent?.lineAllocations?.[0]:void 0;return{id:(i=t.stableId,`gid://shopify/CartLine/${i}`),quantity:t.quantity,cost:{totalAmount:t.checkoutPriceAfterDiscounts},merchandise:Jt(e),attributes:e.properties.map(e=>({key:e.name,value:String(e.value)})),discountAllocations:(s=t.allocations,s.filter(e=>ve(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:Qt(e.lineAllocation.stableId),merchandise:Jt(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:Qt(n.stableId)}}:null};var s,i}function Jt(e){if(!e.variantId)throw new O("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}
2)),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 zt(e){const{lineAllocation:t,image:n}=e;return{id:(s=t.stableId,`gid://shopify/PresentmentCartLine/${s}`),title:e.title,subtitle:e.subtitle,lines:[qt(e)],quantity:t.quantity,cost:{totalAmount:t.checkoutPriceAfterDiscounts},image:n?{url:n.four,altText:n.altText}:void 0};var s}function Qt(e){return`gid://shopify/CartLineComponent/${e}`}const Wt="merchandiseError:",Kt=function(e){let t,n=!1;function s(){return t??=h(e).catch(e=>{throw t=void 0,e}),t}return{load:s,preload(){n||(n=!0,y(()=>{s().catch(()=>{})}))}}}(()=>Ee(()=>import("./cf517225.CvvV_UjN.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])));function Zt({negotiated:e,proposed:t,createSubscribableFromSignal:n,extension:s,stableDetourSignal:i,cartInstructionsSignal:a,cartLineChangeLoadingSignal:o,observability:r,applyChange:c,extensionInstance:d,isCheckoutEditor:l,shop:u,refusedMerchandise:p}){const m=u.hasFlagEnabled(L)?p:void 0;async function f(n,s){return o.value=!0,(await Kt.load()).applyCartLineChange({change:n,negotiated:e,proposed:t,stableDetourSignal:i,cartInstructionsSignal:a,negotiate:s,isCheckoutEditor:l,observability:r,refusedMerchandise:m})}return Kt.preload(),{lines:n((y=()=>{const t=e.fields.merchandiseLines.value,n=e.fields.remoteMerchandiseDetails?.value;return t?t.lines.filter(e=>!M(e.stableId,n)).flatMap(e=>null==e.productId?[]:e.variantId?de(e).map(qt):(r.error(new O("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.")),[])):[]},je(y,C))),applyCartLinesChange:async e=>c({unknownChange:e,extension:s,extensionInstanceId:d.id,handlers:{addCartLine:async({negotiate:e,change:t})=>f(t,e),removeCartLine:async({negotiate:e,change:t})=>f(t,e),updateCartLine:async({negotiate:e,change:t})=>f(t,e)},errorResult:e=>e.message.startsWith(Wt)?{type:"error",message:e.message}:{type:"error",message:`Could not apply line item changes. Error: ${e.message}`}}).finally(()=>{o.value=!1})};var y}function Xt({proposed:e,negotiated:t,createSubscribableFromSignal:n,extension:s,cartInstructionsSignal:i,applyChange:a,extensionInstance:o}){return{note:n(e.note),applyNoteChange:async n=>a({unknownChange:n,extension:s,extensionInstanceId:o.id,handlers:{async updateNote({negotiate:n,change:s,markChangeAsNoOp:i}){if(r(),"string"!=typeof s.note)throw new g('Invalid NoteChange: note must be of type "string"');if(s.note&&s.note.length>5e3)throw new g("Invalid NoteChange: note must be less than or equal to 5000 characters");return function(e,t,n){const s=e||void 0;return t===s&&(n||void 0)===s}(s.note,e.note.peek(),t.fields.note.peek())?(i(),{type:"success"}):(e.note.value=s.note||void 0,await st(()=>n({silenceViolations:["all"]})),{type:"success"})},async removeNote({negotiate:n,markChangeAsNoOp:s}){return r(),i=e.note.peek(),a=t.fields.note.peek(),void 0===i&&void 0===(a||void 0)?(s(),{type:"success"}):(e.note.value=void 0,await st(()=>n({silenceViolations:["all"]})),{type:"success"});var i,a}},errorResult:e=>({type:"error",message:e.message})})};function r(){if(!i.peek().notes.canUpdateNote)throw new g(Ye("applyNoteChange","notes"))}}function en(e){const{extension:t}=e,{applyAttributeChange:n}=it(e),{applyCartLinesChange:s}=Zt(e),{applyNoteChange:a}=Xt(e),{applyMetafieldChange:o}=mt(e),{applyDiscountCodeChange:r}=Ut(e),{applyGiftCardChange:c}=Bt(e),{applyShippingAddressChange:d}=Ke(e),{experimentalIsShopAppStyle:l}=function({extension:e,checkout:t}){return{experimentalIsShopAppStyle:Ie({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":case"2026-10":case"2027-01":return{applyAttributeChange:n,applyCartLinesChange:s,applyNoteChange:a,applyMetafieldChange:o,applyDiscountCodeChange:r,applyGiftCardChange:c,applyShippingAddressChange:d,experimentalIsShopAppStyle:l};default:i(t.apiVersion)}}function tn(e){const{createSubscribableFromSignal:t}=e,{apiVersion:s}=e.extension;return n(s).equalTo("unstable")?{order:t(p(void 0))}:n(s).laterThan("2025-07")?{}:{order:t(p(void 0))}}function nn({negotiated:t,createSubscribableFromSignal:n,proposed:s,extension:i}){return te(i.approvalScopes,e.CustomerPersonalData)?{buyerIdentity:{customer:n(a(()=>{const n=t.fields.buyerIdentity.value?.customerProfile;if("CustomerProfile"===n?.__typename||"BusinessCustomerProfile"===n?.__typename){const t=te(i.approvalScopes,e.CustomerEmail),s=te(i.approvalScopes,e.CustomerPhone),a=te(i.approvalScopes,e.CustomerName),o="CustomerProfile"===n?.__typename?n.storeCreditAccounts.map(e=>({...e,balance:e.balance})):[];return{id:n.id,email:t?n.email??void 0:void 0,phone:s?n.phone??void 0:void 0,fullName:a?n.fullName??void 0:void 0,firstName:a?n.firstName??void 0:void 0,lastName:a?n.lastName??void 0:void 0,image:{url:n.imageUrl},acceptsMarketing:n.acceptsEmailMarketing,acceptsEmailMarketing:n.acceptsEmailMarketing,acceptsSmsMarketing:n.acceptsSmsMarketing,storeCreditAccounts:o,ordersCount:n.ordersCount??0}}})),email:n(a(()=>
2{if(!te(i.approvalScopes,e.CustomerEmail))return;const n=s.email.value,a=t.fields.buyerIdentity.value?.customerProfile?.email,o=t.fields.contactInfo.value?.email;return n||a||o})),phone:n(a(()=>{if(!te(i.approvalScopes,e.CustomerPhone))return;const n=s.phone.value,a=t.fields.buyerIdentity.value?.customerProfile?.phone,o=t.fields.contactInfo.value?.phone;return n||a||o})),purchasingCompany:n(a(()=>{const e=t.fields.buyerIdentity.value?.purchasingCompany;if(e)return{company:{id:e.company.id,name:e.company.name,externalId:e.company?.externalId},location:{id:e.location.id,name:e.location.name,externalId:e.location?.externalId}}}))}}:{buyerIdentity:void 0}}const sn={behavior:"allow"};function an({extension:e,extensionInstance:t,proposal:n,captureEvent:s,journeyCompletedSignal:i,sourceType:o,createSubscribableFromSignal:r,journeyStateSignal:c,pageBeforeDetourSignal:d,negotiated:l,cartPageSignal:u,checkout:p,interceptorRegistrationResolversSignal:y,observability:h,negotiationRateLimiter:v}){let b=0;const C=y.peek(),I=C.get(e.id);return{intercept(i){const a=String(b++);m(i);let r=!1;const c=[],d={interceptorKey:a,extension:e,captureEvent:s,sourceType:o,observability:h,activeRaces:c,extensionInstance:t,suppressMalformedInterceptionErrors:"persisted"===e.type||"global"===e.type},l=function(e,t){return async({requiresRenderToBlock:n})=>{const{interceptorKey:s,extension:i,captureEvent:a,sourceType:o,observability:r,activeRaces:c,extensionInstance:d,suppressMalformedInterceptionErrors:l}=t;if(n&&!d.rendered)return d.markNotBlocking(s),{isBlocking:!1,interceptorRunResponse:sn};const u=i.capabilities.blockProgress&&i.behaviors.value.blockProgress,p=on((async()=>{try{return await e({canBlockProgress:u})}catch(t){return r.error(new W(`Error in buyer journey interceptor callback: ${t}`,{cause:t}),{metadata:{extension:le(i),source:{type:o}}}),{behavior:"allow",perform:()=>{}}}})(),{captureEvent:a,extension:i,onTimeout:()=>(r.error(new g("buyer journey interceptor callback timed out"),{metadata:{extension:le(i),source:{type:o}}}),sn)},d.id);let m;c.push(p);try{m=await p.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 K(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')}(i,m)}catch(f){if(l){const e=f;return console.warn(`${e.name}: ${e.message}`),d.markNotBlocking(s),null}throw f instanceof TypeError&&r.leaveErrorBreadcrumb("BuyerJourneryIntercept: Cannot block progress",{extension:i,interceptorRequest:m}),f}return u&&"block"===m.behavior?(d.markBlocking(s),{isBlocking:!0,interceptorRunResponse:m}):(d.markNotBlocking(s),{isBlocking:!1,interceptorRunResponse:m})}}(i,d),u=async n=>{switch(n){case"registration":return await l({requiresRenderToBlock:!1}),sn;case"negotiation":{const e=await l({requiresRenderToBlock:!0});if(!e)return sn;const{perform:t}=e.interceptorRunResponse;return e.isBlocking?{behavior:"allow",errors:e.interceptorRunResponse.errors,perform:t&&rn(()=>t({behavior:"allow"}),d)}:{behavior:"allow",perform:t&&rn(()=>t({behavior:"allow"}),d)}}case"progression":case"completion":{const n=await l({requiresRenderToBlock:!0});if(!n)return sn;const{perform:i}=n.interceptorRunResponse;if(n.isBlocking){if(v.isThrottled(e.id)){if(!r){r=!0;const t=He(e),{isRemoteDom:n,isHighValueExtension:s}=t;h.log("extension_throttled_buyer_journey_block_attempt","[Extensions::BuyerJourneyIntercept] Throttled extension attempted to block checkout progress",{...t,enforced:!0}),h.counter({name:"extension_throttled_buyer_journey_block_attempt",value:1,attributes:{isRemoteDom:n,isHighValueExtension:s,enforced:!0}})}return t.markNotBlocking(a),{behavior:"allow",errors:n.interceptorRunResponse.errors,perform:i&&rn(()=>i({behavior:"block"}),d)}}return s("extensionBuyerJourneyBlock",{behavior:"block",reason:n.interceptorRunResponse.reason,extension:e,section:"extension",timestamp:new Date,validationErrors:n.interceptorRunResponse.errors??[]}),h.debug("extensions_buyer_journey_intercepted","[Extensions::BuyerJourneyIntercept] Blocked checkout progress",{...He(e),errors:n.interceptorRunResponse.errors,reason:n.interceptorRunResponse.reason}),{behavior:"block",reason:P.InvalidExtensionState,errors:n.interceptorRunResponse.errors,perform:i&&rn(()=>i({behavior:"block"}),d),context:{extension:le(e)}}}return{behavior:"allow",perform:i&&rn(()=>i({behavior:"allow"}),d)}}default:return n}},y=n.intercept(({reason:e})=>u(e));!function({interceptorRegistrationResolvers:e,interceptorRegistration:t,extension:n,sourceType:s,observability:i}){if(t)return a=e,o=n.id,void((r=t)&&a.get(o)===r&&r.resolve());var a,o,r;i.error(new W("Error registering interceptor resolver. No corresponding extension found in interceptorRegistrationResolversSignal."),{metadata:{extension:le(n),source:{type:s}}})}({interceptorRegistrationResolvers:C,interceptorRegistration:I,extension:e,sourceType:o,observability:h}),u("registration").then(async()=>
2{if(!p.isCheckoutLayoutForcedToOnePage.value||!p.wallets.isAcceleratedWalletEscalation.value||!t.rendered)return;const e=await l({requiresRenderToBlock:!0});if(!e?.isBlocking)return;const{perform:n}=e.interceptorRunResponse;n&&await rn(()=>n({behavior:"block"}),d)()}).catch(t=>{h.error(t,{metadata:{extension:le(e),source:{type:o}}})});const A=t.on("restart",()=>{E()}),S=t.on("destroy",()=>{E()}),E=()=>{t.markNotBlocking(a);for(const e of c)e.abort();y(),A(),S(),f(i)};return E},completed:r(i),steps:r(a(()=>{if(i.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,s=u.value,a=e.filter(({skipOverPage:e})=>!e||!e(n)),o=a.findIndex(e=>e.id===t?.id),r=a.map((e,t)=>cn({page:e,disabled:o>=0&&t>o}));return s&&r.unshift(cn({page:s,disabled:!1})),r})),activeStep:r(a(()=>{if(i.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:dn(t).handle}}))}}function on(e,t,n){const s={finished:Promise.resolve(),abort:()=>{}},{captureEvent:i,extension:a}=t,o=t.duration??3e4,r=performance.now();let c,d;return s.abort=()=>{clearTimeout(d),c(void 0)},s.finished=Promise.race([new Promise(e=>{c=e,d=setTimeout(()=>{c(t.onTimeout())},o)}),e.finally(()=>{i("extensionInteraction",{interaction:"buyerJourneyInterceptor",extension:a,section:"extension",timestamp:new Date,duration:performance.now()-r,extensionInstanceId:n}),clearTimeout(d)})]),s}function rn(e,t){const{observability:n,captureEvent:s,extension:i,sourceType:a,activeRaces:o,extensionInstance:r}=t,c=(async()=>{try{return await e()}catch(t){n.error(new g(`${t} (in buyer journey interceptor)`,{cause:t}),{metadata:{extension:le(i),source:{type:a}}})}})();return async()=>{const e=on(c,{captureEvent:s,extension:i,onTimeout:()=>{n.error(new g("perform() in buyer journey interceptor timed out"),{metadata:{extension:le(i),source:{type:a}}})}},r.id);o.push(e),await e.finished}}function cn({page:e,disabled:t}){const{handle:n,route:s}=dn(e),{label:i}=e;return{handle:n,to:s,label:i,disabled:t}}function dn({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 ln({cartInstructionsSignal:e,createSubscribableFromSignal:t}){return{instructions:t(e)}}function un({negotiated:e,createSubscribableFromSignal:t}){return{checkoutSettings:t(a(()=>{const t=e.fields.buyerIdentity.value?.customerProfile,n=e.fields.paymentFlexibilityPaymentTermsTemplate.value,s=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:s}}))}}function pn(e,t){return e&&0!==e.length&&t?e.filter(e=>{const{targetMerchandiseLines:n}=e;return!n||0===n.length||!n.some(e=>M(e.stableId,t))}):e}function mn({negotiated:e,isOnePageCheckout:t,createSubscribableFromSignal:n}){return{cost:{subtotalAmount:n(e.fields.subtotal),totalShippingAmount:n(a(()=>{const n=e.fields.deliveryNext.value,s=e.fields.remoteMerchandiseDetails.value;if("filled"!==n?.status)return;const i=pn(n.lines,s),a=(o=!t,i.reduce((e,t)=>{if("not_required"===t.status)return e;const{methods:n,selectedDeliveryMethodHandle:s}=t,i=n.find(({handle:e})=>s===e);if(!i)return e;const a=i?.priceBreakdown?.length&&i.priceBreakdown.every(e=>e.excludeFromDeliveryOptionPrice),r=i?.priceBreakdown?.every(e=>!Boolean(e.targetMerchandiseLines[0]?.sellingPlan?.prepaid));return a&&r&&o||e.push({costAfterDiscounts:i.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(a(()=>{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}`))}
2)),totalAmount:n(e.fields.runningTotal)}}}function fn(e,t){const n=t?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,type:(s=e.methodType,"LOCAL"===s?"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:yn(e),code:e.code||"",metafields:n||[]};var s}function yn(e){return{timeInTransit:hn(e.estimatedTimeInTransit)}}function hn(e){if(e)return"number"==typeof e?{lower:e,upper:e}:{lower:e.lower,upper:e.upper}}function gn(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 vn(e,t,n){if(0===t.length)return;const s=e.methods.map(e=>e.handle),i=n.find(e=>e&&s.includes(e))||e.selectedDeliveryMethodHandle;return i?{handle:i}:void 0}function bn({pickupLocation:e}){if("PickupPointLocation"===e?.type)return e.carrierName}function Cn({pickupLocation:e}){if("PickupPointLocation"===e?.type)return e.carrierCode}function In(e){const t=e?.coordinates;return null==t?.latitude||null==t.longitude?{}:{latitude:t.latitude,longitude:t.longitude}}function An(e){if(e)return V("DeliveryGroup",E(e))}
2class Sn extends Error{constructor(e){super(e),this.name="DeliveryError"}}class En{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 En?t:new En(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=le(this.extension)),this.observability.error(e,n)}leaveBreadcrumb(e,t,n){this.observability.leaveErrorBreadcrumb(e,t,n)}}class _n{constructor(e){this.extension=e}filterMetafieldsByExtensionId(e){return e.filter(e=>{const t=e.namespace.split("--");return"app"===t[0]&&t[1]===E(this.extension.appId)||"app"!==t[0]})}}function Tn({line:e,extension:t,observability:n,proposedSelectedDeliveryMethodHandles:s,lines:i}){return function({line:e,extensionContext:t,observability:n,proposedSelectedDeliveryMethodHandles:s,lines:i}){if("available"===e.status){const a=function(e,t,n){return e.map(e=>{switch(e.methodType){case"SHIPPING":case"LOCAL":return fn(e,n);case"PICK_UP":return function(e,t,n){const s=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,...In(t)}}}const s=`Invalid pickupLocation type ${e?.type} for ${t} delivery method`;n?.error(new Sn(s))}(e,t);if(null==s)return;const i=n?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickup",location:s,metafields:i||[]}}(e,t,n);case"PICKUP_POINT":return function(e,t,n){const s=function({pickupLocation:e,methodType:t},n){if("PickupPointLocation"===e?.type){const{name:t,address:n,handle:s}=e;return{name:t,handle:s,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,...In(n)}}}const s=`Invalid pickupLocation type ${e?.type} for ${t} delivery method`;n?.error(new Sn(s))}(e,t);if(null==s)return;const i=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:bn(e),code:Cn(e)},location:s,metafields:i||[]}}(e,t,n);case"RETAIL":case"NONE":return;default:{const n=`Unknown delivery method type: ${e.methodType}`;return void t?.error(new Sn(n),{metadata:{deliveryMethod:{type:e.methodType,handle:e.handle}}})}}}).filter(e=>null!=e)}(e.methods,n,t);return{targetedCartLines:gn(e.targetMerchandiseLines??[],i),deliveryOptions:a,selectedDeliveryOption:vn(e,a,s),groupType:Re(e.type),isDeliveryRequired:!0,id:An(e.id)}}return{targetedCartLines:gn(e.targetMerchandiseLines,i),deliveryOptions:[],selectedDeliveryOption:void 0,groupType:Re(e.type),isDeliveryRequired:!1,id:An(e.id)}}({line:e,extensionContext:t?new _n(t):void 0,observability:En.wrapClient(t,n),proposedSelectedDeliveryMethodHandles:s,lines:i})}function kn({extension:e,negotiated:t,proposed:n,observability:s,createSubscribableFromSignal:i}){return{deliveryGroups:i(a(()=>{const i=t.fields.deliveryNext.value;if(!i)return[];const a=i.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 pn(i.lines,r).map(n=>Tn({line:n,extension:e,observability:s,proposedSelectedDeliveryMethodHandles:o,lines:t.fields.merchandiseLines.value?.lines}));const c=`Unknown delivery status: ${a}`;return s.error(new Z(c),{metadata:{extension:le(e)}}),[]}))}}function wn({createSubscribableFromSignal:t,proposed:n,extension:s,negotiated:i}){return te(s.approvalScopes,e.CustomerPersonalData)?{localizedFields:t(a(()=>{const e=n.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 Dn({negotiated:e,proposed:t,createSubscribableFromSignal:n}){return{availablePaymentOptions:n(a(()=>{const n=e.fields.paymentMethods.value,s=t.paymentLines.value,i=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=U(c),l=Y(d,s,n,{negotiatedPaymentLines:i?.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:pe(e.method.type,t,n),type:ue(e.method.type)}}).concat(r&&!u?[{handle:pe(o),type:ue(o)}]:[])})),selectedPaymentOptions:n(a(()=>{const n=t.paymentLines.value,s=e.fields.paymentMethods.value,i=e.fields.paymentLines.value,a=e.fields.deferredTotal.value;if(!s)return[];const o=U(n);return Y(o,n,s,{negotiatedPaymentLines:i?.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:pe(e.method.type,t,n),type:ue(e.method.type)}})}))}}function xn({extension:e,ui:t}){return{ui:{overlay:{close(n){Ae(e,n)&&t.overlay.close(n)}}}}}function Nn(e){const{shop:t,extension:n,extensionInstance:s}=e;switch(n.apiVersion){case"2023-04":{const i=kt(e),{attributes:o}=it(e),{lines:r}=Zt(e),{presentmentLines:c}=function({negotiated:e,createSubscribableFromSignal:t,observability:n}){return{presentmentLines:t(a(()=>{const t=e.fields.merchandiseLines.value;return t?t.lines.flatMap(e=>e.variantId?de(e).map(e=>zt(e)):(n.error(new O("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.")),[])):[]}))}}(e),{note:d}=Xt(e),{metafields:l}=mt(e),{discountAllocations:u,discountCodes:p}=Ut(e),{appliedGiftCards:m}=Bt(e),{shippingAddress:f}=Ke(e);return{version:n.apiVersion,extensionPoint:s.target,extension:{...i,apiVersion:i.apiVersion,target:i.target,capabilities:i.capabilities},settings:xt(e),shop:Rt(t),appliedGiftCards:m,attributes:o,discountAllocations:u,discountCodes:p,lines:r,metafields:l,note:d,presentmentLines:c,shippingAddress:f,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Ot(e),...gt(e),...Se(e),...Dt(e),...xn(e)}}case"2023-07":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target,capabilities:s.capabilities},settings:xt(e),shop:Rt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Ot(e),...gt(e),...Se(e),...Dt(e),...xn(e)}}case"2023-10":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target,capabilities:s.capabilities},settings:xt(e),shop:Rt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e)}}case"2024-01":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target,capabilities:s.capabilities},settings:xt(e),shop:Rt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e)}}case"2024-04":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target,capabilities:s.capabilities},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e)}}case"2024-07":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target,capabilities:s.capabilities},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e)}}case"2024-10":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e)}}case"2025-01":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2025-04":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2025-07":case"unstable":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2025-10":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2026-01":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{metafields:r}=mt(e),{discountAllocations:c,discountCodes:d}=Ut(e),{appliedGiftCards:l}=Bt(e),{shippingAddress:u,billingAddress:p}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:l,attributes:i,discountAllocations:c,discountCodes:d,lines:a,metafields:r,note:o,shippingAddress:u,billingAddress:p,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),...xn(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2026-04":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{discountAllocations:r,discountCodes:c}=Ut(e),{appliedGiftCards:d}=Bt(e),{shippingAddress:l,billingAddress:u}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:d,attributes:i,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2026-07":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{discountAllocations:r,discountCodes:c}=Ut(e),{appliedGiftCards:d}=Bt(e),{shippingAddress:l,billingAddress:u}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:d,attributes:i,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2026-10":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{discountAllocations:r,discountCodes:c}=Ut(e),{appliedGiftCards:d}=Bt(e),{shippingAddress:l,billingAddress:u}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,exte
2nsion:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:d,attributes:i,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}case"2027-01":{const s=kt(e),{attributes:i}=it(e),{lines:a}=Zt(e),{note:o}=Xt(e),{discountAllocations:r,discountCodes:c}=Ut(e),{appliedGiftCards:d}=Bt(e),{shippingAddress:l,billingAddress:u}=Ke(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...s,apiVersion:s.apiVersion,target:s.target},settings:xt(e),shop:Nt(t),appliedGiftCards:d,attributes:i,discountAllocations:r,discountCodes:c,lines:a,note:o,shippingAddress:l,billingAddress:u,buyerJourney:an(e),...un(e),...wt(e),...nn(e),...mn(e),...Dn(e),...kn(e),...Ct(e),storage:Lt(e),...gt(e),...Se(e),...Dt(e),..._t(e),...Ve(e),...ln(e),...wn(e)}}default:i(n.apiVersion)}}function Rn(e,{stableId:t}){const{extension:n}=e;switch(n.apiVersion){case"2023-04":return{...Ln(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{...On(e,t)};default:i(n.apiVersion)}}function On({createSubscribableFromSignal:e,negotiated:t},n){let s;return{target:e(a(()=>{const e=t.fields.merchandiseLines.value,i=me({stableId:n,merchandiseLines:e?.lines??[]});if(null===i&&!s)throw new X("No merchandise item found");return null!==i&&(s=qt(i)),s}))}}function Ln({createSubscribableFromSignal:e,negotiated:t},n){let s;return{target:e(a(()=>{const e=t.fields.merchandiseLines.value,i=fe(n,e?.lines??[]);if(null===i&&!s)throw new X("No merchandise item found");if(null!==i){const{parent:e,index:t}=i;s=zt(ye(e,t))}return s}))}}function Mn({applyChange:t,extension:n,proposed:s,createSubscribableFromSignal:i,extensionInstance:o,bankIdNumberSignal:r},{paymentMethodIdentifier:c}){const d=te(n.approvalScopes,e.CheckoutExtensionPayments);return{applyPaymentMethodAttributesChange:async function(e){return t({unknownChange:e,extension:n,extensionInstanceId:o.id,handlers:{async updatePaymentMethodAttributes({change:e}){if(!d)throw new g(Pn);e.attributes.forEach(e=>{if("string"==typeof e.value&&e.value.length>64)throw new g(`Value length exceeded threshold 64 for key ${e.key}`)});const t=s.paymentLines.peek();return s.paymentLines.value=t.map(t=>"customOnsite"!==t.method.type&&"direct"!==t.method.type||t.method.paymentMethodIdentifier!==c?t:{...t,method:{...t.method,paymentAttributes:JSON.stringify(e.attributes)}}),{type:"success"}}},errorResult:e=>({type:"error",message:e.message})})},paymentMethodAttributes:d?i(a(()=>{const e=s.paymentLines.value.find(({method:e})=>{if("direct"===e.type||"customOnsite"===e.type)return e.paymentMethodIdentifier===c&&e.paymentAttributes});if(e){const{paymentAttributes:t}=e.method;if(t)return JSON.parse(t)}})):void 0,bankIdNumber:d?i(r):void 0}}const Pn="Access denied: the extension does not have the required approval scopes";function Vn({createSubscribableFromSignal:e,extension:t,negotiated:n,proposal:s},i){let o;const r=i?.handle;return{target:e(a(()=>{const e=n.fields.deliveryNext.value;if(!e)return o;if("filled"!==e.status)return o;const s=e.lines.filter(e=>"available"===e.status).flatMap(e=>e.methods).find(e=>e.handle===r);if(s){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,...In(e.pickupLocation?.address)}},metafields:n||[]}}(e,new _n(t))}(s,t);o=C(o,e)?o:e}return o}
2)),isTargetSelected:e(a(()=>s.parts.deliveryLines.value.some(({fields:{deliveryMethodHandle:e}})=>r===e.value)))}}function Un({createSubscribableFromSignal:e},{isLocationFormVisible:t}){return{isLocationFormVisible:e(p(t))}}function Yn({createSubscribableFromSignal:e},{isLocationFormVisible:t}){return{isLocationFormVisible:e(p(t))}}function Fn({extension:t,negotiated:n,applyChange:s,extensionInstance:i},{paymentMethodIdentifier:a,submitRedeemablePaymentLine:o}){return{applyRedeemableChange:async r=>s({unknownChange:r,extension:t,extensionInstanceId:i.id,handlers:{async redeemableAddChange({negotiate:s,change:i}){if("local"!==t.type&&!te(t.approvalScopes,e.CheckoutExtensionRedeemables))throw new g("Access denied: the extension does not have the required approval scopes");const r=n.fields.availableRedeemables.peek()?.map(e=>({paymentMethod:De(e.paymentMethod)}))??[],c={paymentMethod:{type:"redeemable",redemptionSource:"CUSTOM",redemptionContent:{paymentMethodIdentifier:a,maskedIdentifier:(d=i.identifier,d.slice(0,-4).replace(/./g,"â¢")+d.slice(-4)),redemptionAttributes:i.attributes}}};var d;const l=xe(c),u=await s({customizeNegotiation:e=>({...e,availableRedeemables:{availableRedeemables:r.concat(l)}}),fieldsToResolve:["availableRedeemables"]}),p="error"===u.status&&u.violations.some(he),m=u.violations.find(he);if(p)throw new g("Could not apply redeemable",{cause:{code:m?.code}});if(o){const e=u.negotiated.availableRedeemables?.find(e=>ge(c.paymentMethod,e.paymentMethod)),t=u.negotiated.paymentDue;if(!e||!t)throw new g("Could not apply redeemable",{cause:{code:m?.code}});const n=await o(e,t),s=n&&("error"===n.status&&n.violations.some(F)||"error"!==n.status&&"success"!==n.status);if(!n||s)throw new g("Could not submit redeemable as a payment line")}return{type:"success"}}},errorResult:e=>({type:"error",message:e.message})})}}function Gn({createSubscribableFromSignal:e,extension:t,negotiated:n,proposal:s},{handle:i,isInModal:o}){let r;return{target:e(a(()=>{const e=t?new _n(t):void 0,s=n.fields.deliveryNext.value;if(!s)return r;if("filled"!==s.status)return r;const a=s.lines.filter(e=>"available"===e.status).flatMap(e=>e.methods).find(e=>e.handle===i);if(a){const t=fn(a,e);r=C(r,t)?r:t}return r})),isTargetSelected:e(a(()=>s.parts.deliveryLines.value.some(e=>i===e.fields.deliveryMethodHandle.value))),renderMode:{overlay:o??!1}}}function Bn(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:s,negotiated:i},{groupType:o}){return{target:e(a(()=>{const e=i.fields.deliveryNext.value;if(!o||"filled"!==e?.status)return;const a=i.fields.remoteMerchandiseDetails.value,r=pn(e.lines.filter(G),a).filter(({type:e})=>Re(e)===o),c=s.deliveryLines.value.filter(e=>Re(e.fields.type.value)===o).map(e=>e.fields.deliveryMethodHandle.value),d=i.fields.merchandiseLines.value?.lines,[l]=r;return l?Tn({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:s,negotiated:i},{includeDeliverySelectionGroups:o,groupType:r}){return{target:e(a(()=>{const e=i.fields.deliveryNext.value;if(!r||"filled"!==e?.status)return;const a=i.fields.remoteMerchandiseDetails.value,o=pn(e.lines.filter(G),a).filter(({type:e})=>Re(e)===r),c=s.deliveryLines.value.filter(e=>Re(e.fields.type.value)===r).map(e=>e.fields.deliveryMethodHandle.value),d=i.fields.merchandiseLines.value?.lines,l=o.map(e=>Tn({line:e,extension:n,observability:t,proposedSelectedDeliveryMethodHandles:c,lines:d}));return l.length>0?{groupType:r,deliveryGroups:l}:void 0})),deliverySelectionGroups:e(a(()=>{const e=s.deliveryMacros.value,t=s.deliveryLines.value.map(e=>e.value).filter(({type:e,deliveryMethodTypes:t})=>"ONE_TIME_PURCHASE"===e&&t.some(e=>"SHIPPING"===e||"LOCAL"===e));if(!o||!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 Hn={name:"Checkout::Dynamic::Render",api:e=>({...Nn(e),...en(e),...tn(e)})},jn={name:"Checkout::Actions::RenderBefore",api:e=>({...Nn(e),...en(e)})},qn={name:"Checkout::CartLineDetails::RenderAfter",api:(e,t)=>({...Nn(e),...en(e),...Rn(e,t),...tn(e)})},Jn={name:"Checkout::CartLineDetails::RenderLineComponents",api:(e,t)=>({...Nn(e),...Rn(e,t)})},zn={name:"Checkout::CartLines::RenderAfter",api:e=>({...Nn(e),...en(e),...tn(e)})},Qn={name:"Checkout::Contact::RenderAfter",api:e=>({...Nn(e),...en(e)})},Wn={name:"Checkout::CustomerInformation::RenderAfter",api:e=>({...Nn(e),...en(e),...tn(e)})},Kn={name:"Checkout::DeliveryAddress::RenderBefore",api:e=>({...Nn(e),...en(e)})},Zn={name:"purchase.checkout.delivery-address.render-after",api:e=>({...Nn(e),...en(e)})},Xn={name:"Checkout::GiftCard::Render",api:(e,t)=>({...Nn(e),...en(e),...Fn(e,t)})},es={name:"Checkout::PaymentMethod::Render",api:(e,t)=>({...Nn(e),...en(e),...Mn(e,t)})},ts={name:"Checkout::PaymentMethod::HostedFields::RenderAfter",api:(e,t)=>({...Nn(e),...en(e),...Mn(e,t)})},ns={name:"Checkout::PaymentMethod::RenderRequiredAction",api:e=>({...Nn(e),...en(e)})},ss={name:"purchase.checkout.payment-method-list.render-before",api:e=>({...Nn(e),...en(e)})},is={name:"purchase.checkout.payment-method-list.render-after",api:e=>({...Nn(e),...en(e)})},as={name:"Checkout::PickupLocations::RenderBefore",api:(e,t)=>({...Nn(e),...en(e),...Un(e,t)})},os={name:"Checkout::PickupLocations::RenderAfter",api:(e,t)=>({...Nn(e),...en(e),...Un(e,t)})},rs={name:"Checkout::PickupPoints::RenderBefore",api:(e,t)=>({...Nn(e),...en(e),...Yn(e,t)})},cs={name:"Checkout::PickupPoints::RenderAfter",api:(e,t)=>({...Nn(e),...en(e),...Yn(e,t)})},ds={name:"purchase.checkout.pickup-location-option-item.render-after",api:(e,t)=>({...Nn(e),...en(e),...Vn(e,t)})},ls={name:"Checkout::Reductions::RenderBefore",api:e=>({...Nn(e),...en(e)})},us={name:"Checkout::Reductions::RenderAfter",api:e=>({...Nn(e),...en(e)})},ps={name:"Checkout::ShippingMethodDetails::RenderAfter",api:(e,t)=>({...Nn(e),...en(e),...Gn(e,t)})},ms={name:"Checkout::ShippingMethodDetails::RenderExpanded",api:(e,t)=>({...Nn(e),...en(e),...Gn(e,t)})},fs={name:"Checkout::ShippingMethods::RenderBefore",api:(e,t)=>({...Nn(e),...en(e),...Bn(e,t)})},ys={name:"Checkout::ShippingMethods::RenderAfter",api:(e,t)=>({...Nn(e),...en(e),...Bn(e,t)})},hs={name:"purchase.checkout.header.render-after",api:e=>({...Nn(e),...en(e)})},gs={name:"purchase.checkout.footer.render-after",api:e=>({...Nn(e),...en(e)})},vs={name:"purchase.checkout.chat.render",api:e=>({...Nn(e),...en(e)})};function bs({extensionInstance:e,announcementEmitter:t}){return"purchase.thank-you.announcement.render"!==e.target||(e.on("destroy",()=>{t.removeAllListeners()}),e.on("restart",()=>{t.removeAllListeners()})),{}}function Cs({createSubscribableFromSignal:e,checkout:t,isCheckoutEditor:n,journeyCompletedSignal:s,observability:i}){return{orderConfirmation:e(a(()=>{const e=t.latestReceipt.value,a=!e||"processed"!==e.status;if(a&&n)return{order:{id:V("Order","0")},number:Oe().substring(0,10),isFirstOrder:!0};if(a){const t=s.peek()?"No receipt available on thankYou page":"No receipt available";throw e&&i.leaveErrorBreadcrumb("Receipt (OrderConfirmationApi):",{status:e.status,keys:Object.keys(e)}),new ee(t)}return{order:{id:e.orderIdentity.id},number:e.orderIdentity.buyerIdentifier??void 0,isFirstOrder:e.isFirstOrder??!0}}))}}const Is={name:"Checkout::ThankYou::Dynamic::Render",api:e=>({...Nn(e),...Cs(e)})},As={name:"Checkout::ThankYou::CartLineDetails::RenderAfter",api:(e,t)=>({...Nn(e),...Rn(e,t),...Cs(e)})},Ss={name:"Checkout::ThankYou::CartLines::RenderAfter",api:e=>({...Nn(e),...Cs(e)})},Es={name:"Checkout::ThankYou::CustomerInformation::RenderAfter",api:e=>({...Nn(e),...Cs(e)})},_s={name:"purchase.thank-you.header.render-after",api:e=>({...Nn(e),...Cs(e)})},Ts={name:"purchase.thank-you.footer.render-after",api:e=>({...Nn(e),...Cs(e)})},ks={name:"purchase.thank-you.chat.render",api:e=>({...Nn(e),...Cs(e)})},ws={name:"purchase.thank-you.announcement.render",api:e=>({...Nn(e),...Cs(e),...bs(e)})},Ds={[Hn.name]:Hn,[jn.name]:jn,[qn.name]:qn,[Jn.name]:Jn,[zn.name]:zn,[Qn.name]:Qn,[Wn.name]:Wn,[Kn.name]:Kn,[Zn.name]:Zn,[Xn.name]:Xn,[es.name]:es,[ts.name]:ts,[ss.name]:ss,[is.name]:is,[as.name]:as,[os.name]:os,[ds.name]:ds,[rs.name]:rs,[cs.name]:cs,[ns.name]:ns,[ls.name]:ls,[us.name]:us,[ps.name]:ps,[fs.name]:fs,[ys.name]:ys,[ms.name]:ms,[hs.name]:hs,[gs.name]:gs,[vs.name]:vs,[Is.name]:Is,[As.name]:As,[Ss.name]:Ss,[Es.name]:Es,[_s.name]:_s,[Ts.name]:Ts,[ks.name]:ks,[ws.name]:ws},xs=[vs.name,ks.name,ws.name],Ns=[vs.name,ks.name,ws.name];export{xs as D,Wt as M,Ds as R,Ns as a,Ke as b,it as c,mt as d,He as e,Ct as f,Lt as g,Nt as h,Ye as i,xt as j,kt as k,Dt as l,wt as m,_t as n,gt as o,Pt as p,Tt as q,Be as r,ht as s,$e as t,Fe as u,Ue as v,Me as w,Ge as x,Pe 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.