PageSourceSearch

https://myintent.org/cdn/shopifycloud/checkout-web/assets/c1/shipp…g-methods-consolidated-included.BE_t6ovz.js

js myintent.org collected 2026-09-25 21:07:38 UTC 3,448 bytes, 1 lines download raw bytes

1import{f as S}from"./esnext-vendor.B9Da21W6.js";import{b0 as c,n as C,S as I,a4 as T,aA as k,b1 as x,aL as B}from"./addresses-is-address-empty.Bn2lNY_L.js";import{aB as G,ad as D}from"./hydrate.DZ4YTm7p.js";import{p as w,s as A,a as E,b as P}from"./EstimatedDeliveryContent.BuJLi-Ww.js";function $(t){if(t===void 0)return;if(typeof t=="number")return{lower:t,upper:t};const{lower:n,upper:e}=t;if(!(n===void 0||e===void 0))return{lower:n,upper:e}}function N(t){let n,e;for(const{estimatedTimeInTransit:o}of t){const r=$(o);if(!r)return;n=n===void 0?r.lower:Math.min(n,r.lower),e=e===void 0?r.upper:Math.max(e,r.upper)}if(!(n===void 0||e===void 0))return n===e?n:{lower:n,upper:e}}function g(t,n,e){const o=t.targetMerchandiseLines?.[0]?.stableId;return o&&n?.stableIdToShopId.get(o)||e}function F({line:t,localShopId:n,marketDrivenShippingEnabled:e,remoteShopsConfigMap:o,remoteMerchandiseDetails:r}){const s=g(t,r,n);if(s===n)return e;const i=o?.get(s);return i?i.marketDrivenShippingEnabled:t.methods.some(a=>!!c(a))}function O({line:t,method:n,localShopId:e,marketDrivenShippingEnabled:o,remoteShopsConfigMap:r,remoteMerchandiseDetails:s}){const i=c(n);if(!i)return;const a=g(t,s,e);if(R({lineShopId:a,localShopId:e,marketDrivenShippingEnabled:o,remoteShopsConfigMap:r,method:n}))return`${a}:${i}`}function R({lineShopId:t,localShopId:n,marketDrivenShippingEnabled:e,remoteShopsConfigMap:o,method:r}){if(t===n)return e;const s=o?.get(t);return s?s.marketDrivenShippingEnabled:r?!!c(r):!1}function H(t,n){if(!t)return`unresolved:${n}`;const e=t.deliveryPresentationGroupToken;return e?`token:${e}`:`no-token:${n}:${t.handle}`}function v(t){const n=new Map;return t.forEach(({line:e,method:o},r)=>{const s=H(o,e.id??`index-${r}`);let i=n.get(s);i||(i={key:s,methods:[],merchandiseLines:[],mergedTimeInTransit:void 0,availableOn:e.availableOn},n.set(s,i)),o&&i.methods.push(o),e.targetMerchandiseLines&&i.merchandiseLines.push(...e.targetMerchandiseLines)}),[...n.values()].map(e=>({...e,merchandiseLines:G(e.merchandiseLines),mergedTimeInTransit:N(e.methods)}))}function j(t){const n=t.map(o=>({line:o,method:C(o)})),e=n.filter(L);return{groups:v(e),nonShippableCount:n.length-e.length}}function L({line:t,method:n}){return n?n.methodType==="SHIPPING"||n.methodType==="LOCAL":t.methods.length===0||t.methods.some(({methodType:e})=>e==="SHIPPING"||e==="LOCAL")}function q(t){return{...t,included:!0}}function J(t,n){return[...t.filter(e=>!n(e)),...t.filter(n)]}function Q(){const{shop:{id:t,marketDrivenShippingEnabled:n,remoteShopsConfigMap:e}}=I(),{deliveryNext:o,remoteMerchandiseDetails:r}=T(),{parts:s}=k();return S(()=>{const i={includedMethods:new Set,total:void 0,presentsConsolidatedShipping:!1,groups:[]},a=o.value;if(!a||a.status!=="filled")return i;const{oneTimePurchaseLines:d}=D(x(a).filter(B));if(d.length<2)return i;const f=(u,l)=>O({line:u,method:l,localShopId:t,marketDrivenShippingEnabled:n,remoteShopsConfigMap:e,remoteMerchandiseDetails:r.value}),h=d.some(u=>F({line:u,localShopId:t,marketDrivenShippingEnabled:n,remoteShopsConfigMap:e,remoteMerchandiseDetails:r.value}));if(!h)return i;const b=w(s.deliveryLines.value),p=A(d,b),m=p.filter(u=>!!u.method),M=m.length===d.length?E(m.map(({line:u,method:l})=>({...l,amountCombinabilityToken:f(u,l)}))):void 0,y=v(p.filter(L));return{includedMethods:P(d,p,f),total:M,presentsConsolidatedShipping:h,groups:y}})}export{q as a,j as b,v as c,L as i,N as m,J as o,O as r,H as s,Q as u};

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