1import{r as g}from"./chunk-QFMPRPBF-DAGQ_QGM.js";function B(e){var u;const t=(u=e.variants)==null?void 0:u.nodes;if(!t||t.length===0)return I(e);const r=[];for(const o of t){if(!o.compareAtPrice)continue;const n=parseFloat(o.compareAtPrice.amount),a=parseFloat(o.price.amount);if(n>a&&n>0){const i=F(n,a);i>0&&r.push(i)}}if(r.length===0)return{type:"none",percentage:0};const c=Math.max(...r),s=Math.min(...r);return c===s?{type:"exact",percentage:c}:{type:"upto",percentage:c}}function I(e){var o,n,a,i;const t=(n=(o=e.compareAtPriceRange)==null?void 0:o.minVariantPrice)==null?void 0:n.amount,r=(i=(a=e.priceRange)==null?void 0:a.minVariantPrice)==null?void 0:i.amount;if(!t||!r)return{type:"none",percentage:0};const c=parseFloat(t),s=parseFloat(r);return c<=s||c<=0?{type:"none",percentage:0}:{type:"upto",percentage:F(c,s)}}function F(e,t){if(e<=t||e<=0)return 0;const r=(e-t)/e*100;return Math.round(r)}function $(e){if(!(e!=null&&e.compareAtPrice))return 0;const t=parseFloat(e.compareAtPrice.amount),r=parseFloat(e.price.amount);return t<=r||t<=0?0:F(t,r)}function j(e){let t=0;for(const r of e)r.variants.nodes.some(s=>{if(!s.availableForSale||!s.compareAtPrice)return!1;const u=parseFloat(s.compareAtPrice.amount),o=parseFloat(s.price.amount);return u>o})&&t++;return t}var A=new Map,h=new WeakMap,D=0,w;function V(e){return e?(h.has(e)||(D+=1,h.set(e,D.toString())),h.get(e)):"0"}function z(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?V(e.root):e[t]}`).toString()}function O(e){const t=z(e);let r=A.get(t);if(!r){const c=new Map;let s;const u=new IntersectionObserver(o=>{o.forEach(n=>{var a;const i=n.isIntersecting&&s.some(p=>n.intersectionRatio>=p);e.trackVisibility&&typeof n.isVisible>"u"&&(n.isVisible=i),[...(a=c.get(n.target))!=null?a:[]].forEach(p=>{p(i,n)})})},e);s=u.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:u,elements:c},A.set(t,r)}return r}function T(e,t,r={},c=w){if(typeof window.IntersectionObserver>"u"&&c!==void 0){const a=e.getBoundingClientRect();return t(c,{isIntersecting:c,target:e,intersectionRatio:typeof r.threshold=="number"?r.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:s,observer:u,elements:o}=O(r),n=o.get(e)||[];return o.has(e)||o.set(e,n),n.push(t),u.observe(e),function(){n.splice(n.indexOf(t),1),n.length===0&&(o.delete(e),u.unobserve(e)),o.size===0&&(u.disconnect(),A.delete(s))}}function C({threshold:e,delay:t,trackVisibility:r,rootMargin:c,root:s,triggerOnce:u,skip:o,initialInView:n,fallbackInView:a,onChange:i}={}){var p;const[m,M]=g.useState(null),b=g.useRef(i),l=g.useRef(n),[P,S]=g.useState({inView:!!n,entry:void 0});b.current=i,g.useEffect(()=>{if(l.current===void 0&&(l.current=n),o||!m)return;let d;return d=T(m,(v,y)=>{const E=l.current;l.current=v,!(E===void 0&&!v)&&(S({inView:v,entry:y}),b.current&&b.current(v,y),y.isIntersecting&&u&&d&&(d(),d=void 0))},{root:s,rootMargin:c,threshold:e,trackVisibility:r,delay:t},a),()=>{d&&d()}},[Array.isArray(e)?e.toString():e,m,s,c,u,o,r,a,t]);const R=(p=P.entry)==null?void 0:p.target,x=g.useRef(void 0);!m&&R&&!u&&!o&&x.current!==R&&(x.current=R,S({inView:!!n,entry:void 0}),l.current=n);const f=[M,P.inView,P.entry];return f.ref=f[0],f.inView=f[1],f.entry=f[2],f}export{B as a,$ as b,j as c,F as d,C 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.