PageSourceSearch

https://shop.bodyform.co.uk/cdn/shopifycloud/checkout-web/assets/c1/helpers-derivations.Dug6X2_v.js

js bodyform.co.uk collected 2026-09-26 00:00:16 UTC 2,991 bytes, 1 lines download raw bytes

1import{o as h}from"./esnext-vendor.B9Da21W6.js";import{aN as m,aO as P,aP as v,aQ as y,aR as S,aS as b}from"./addresses-is-address-empty.Bn2lNY_L.js";import{i as M}from"./redemption-promotions.DicFJEgz.js";function C(e,i){return Object.keys(i).every(s=>{const o=i[s]??"",d=e[s]??"";return o===d})}function w(e,i){if(!e)return!1;const[r=0,s=0,o=0]=A(e),[d=0,l=0,t=0]=A(i);return r!==d?r>d:s!==l?s>l:o>=t}function A(e){return e.split(".").map(i=>parseInt(i,10)||0)}const B="2.251.0",_=new Set(["mobilepay","bancontact","blik","bizum","mb","multibanco","mbway","eps","swish","twint","przelewy24","alipay","wechatpay","oxxo","satispay","vipps"]);function E(e){return w(e,B)}function I({brand:e,isShopAppLayout:i=!1,shopAppVersion:r}){if(i&&!E(r))return!1;const s=e.toLowerCase();return _.has(s)}function O(e,{identity:i,installmentsSelected:r,isApplePayAvailable:s,idealEnabled:o,isBareCardOnly:d,isShopAppLayout:l=!1,shopAppVersion:t}){return d?e.filter(a=>a.type==="direct"):i.current.value!=="shopPay"?e:r?e.filter(a=>a.type==="direct"):e.filter(a=>{if(a.type==="direct")return!0;if(a.type==="customOnsite"){const u=a.paymentBrands??[];return u.includes("bogus_app_coin")||u.includes("usdc")||o&&u.includes("ideal")?!0:M(a.uiExtension?.appId)?u.some(n=>I({brand:n,isShopAppLayout:l,shopAppVersion:t})):!1}return m(a)?s:!1})}function D(e){return typeof e=="boolean"?e:e.value}function N(e,{isApplePayAvailable:i}){const{identity:r,shopPay:s,negotiatedFields:o}=e;return h(()=>{const d=o.paymentMethods.value??[];return O(d,{identity:r,installmentsSelected:!1,isApplePayAvailable:D(i),idealEnabled:b({managedByMarketsPro:o.managedByMarketsPro.value}),isBareCardOnly:!1,isShopAppLayout:S(s.app.config),shopAppVersion:s.app.config.version})})}function R({checkout:e,shopPay:i,observability:r,shippingAddress:s,billingAddress:o,fallbackPhoneNumber:d,buyerAddresses:l}){if(!s&&!o)return{};const t=e.proposal.proposed,a=e.proposal.negotiated.fields,u=P({canUpdateDeliveryAddress:a.canUpdateDeliveryAddress.value,mustSelectProvidedAddress:a.mustSelectProvidedAddress.value,proposedAddress:t.shippingAddress.value,buyerAddresses:l}),n=s&&u?s:void 0,p=o;if(!n&&!p)return{};const f=e.configuration.addressSettings.nonBillingAddressSettings.value;if(n){const c=f.isRequired("phone",{countryCode:n.countryCode,useMerchantSettings:!0})&&!n.phone?d:n.phone;r.log("wallets_shipping_address_update","update with Shop Pay vaulted address",{isPostalCodePadded:v(n.postalCode,n.countryCode),countryCode:n.countryCode}),t.shippingAddress.value={...n,phone:c,oneTimeUse:n.oneTimeUse||!1}}if(p){const c=f.isRequired("phone",{countryCode:p.countryCode,useMerchantSettings:!0})&&!p.phone?d:p.phone;t.billingAddress.value={...p,phone:c}}n&&y(t.shippingAddress),p&&y(t.billingAddress);const g=C(n??t.shippingAddress.value,p??t.billingAddress.value);return i.user.hasCreditCards.value&&(t.billingAddressOption.value=g?"shipping":"custom"),{shippingAddress:n,billingAddress:p}}export{w as a,R as b,O as f,C as i,N as s};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.