PageSourceSearch

https://www.sees.com/mobify/bundle/1731/client/assets/mod-82589aa1-B-Ni4qoZ.js

js sees.com collected 2026-10-01 11:47:32 UTC 4,487 bytes, 1 lines download raw bytes

1import{r as c}from"./mod-1bc04b52-LZlvPb-j.js";import{u as E}from"./mod-b79606fb-vtMp_OjH.js";import{u as M}from"./mod-bee74ff1-C1jWcvEj.js";import{g as B}from"./mod-6fd89734-DWHvss_h.js";import{u as j}from"./mod-bdf49c3c-DecpRkK7.js";import{u as F}from"./mod-fbc373d5-BZXx-L_F.js";import{O as N}from"./mod-84de5335-B_x7-maV.js";import{i as W}from"./mod-edbd804e-sxU84gG9.js";import{e as H}from"./mod-7150b8be-ClpOO9iO.js";import"./mod-04ce686a-RPK1-APr.js";function Z(e){const i=e.imageGroups?.[0]?.images?.[0],n=e.id||e.productId||"",g=e.name||e.productName||"",I=(e.variants??[]).map(t=>t.price).filter(t=>typeof t=="number"&&t>0),a=I.length?Math.min(...I):void 0,b=e.price??a??e.priceMax??0,d=!!e.type?.master,w=e.variants&&e.variants.length>0?e.variants:void 0,C=e.variationAttributes?e.variationAttributes.map(t=>({productId:n,variationValues:t.values?.reduce((k,A)=>(t.id&&A.value&&(k[t.id]=A.value),k),{})})):void 0,u=typeof e.orderable=="boolean"?e.orderable:typeof e.inventory?.orderable=="boolean"?e.inventory.orderable:e.variants?.some(t=>t.orderable===!0)?!0:void 0,h={productId:n,productName:g,price:b,priceMax:e.priceMax,priceRanges:e.priceRanges,tieredPrices:e.tieredPrices,currency:e.currency,hitType:d?"master":void 0,image:i?{disBaseLink:i.disBaseLink||i.link||"",link:i.disBaseLink||i.link||"",alt:i.alt||e.name||""}:void 0,imageGroups:e.imageGroups,variationAttributes:e.variationAttributes,variants:w??C,orderable:u,inStock:u!==void 0?u:e.inventory?.ats!==void 0?e.inventory.ats>0:!0,promotions:[],customProperties:e.customProperties,primaryCategoryId:e.primaryCategoryId,slugUrl:e.slugUrl},l=e,v=h;for(const t of Object.keys(l))t.startsWith("c_")&&v[t]===void 0&&(v[t]=l[t]);const S=e.variants??[],y=l.c_defaultVariantId,R=(typeof y=="string"&&y.length>0?y:void 0)??S.find(t=>t.orderable!==!1)?.productId??S[0]?.productId??n;return R&&(v.representedProduct={id:R}),e.master?.masterId&&(v.master={masterId:e.master.masterId}),h}function $(){let e;try{e=H("root")}catch{e=void 0}return e?.selectedStoreInfo?.id??null}function se(e){const s=e?.recoUUID??"";return{trackingId:s||e?.decisionId||null,recommenderId:s}}function L(e,s){if(!e.recs?.length||!s.length)return e;const i=e.recs.map(n=>{const g=s.find(b=>b.id===n.id);if(!g)return null;const I=Z(g);if(!I.productId)return null;const a=I.productId||g.id||n.id||"";return{...I,productId:a,id:g.id||a,image_url:n.image_url,product_name:n.product_name,product_url:n.product_url,decisionId:n.decisionId,slotId:n.slotId}}).filter(n=>n!==null);return{...e,recs:i}}const ne=(e=!0)=>{const s=M(),i=j(),n=E(),{hasCategoryConsent:g}=F(),[I,a]=c.useState(!1),[b,d]=c.useState({}),[w,C]=c.useState(null),u=W(n)||g(N.FUNCTIONAL),h=c.useRef(u);h.current=u;let l=null;l=$();const v=i?.usid,S=i?.userType,y=i?.customerId,R=c.useCallback(()=>{const r={};return v&&(r.cookieId=v),S==="registered"&&y&&(r.userId=y),r},[v,S,y]),t=c.useCallback(async r=>{if(!r.length)return[];try{const p=`${B()}/resource/recommendation-products?ids=${r.map(encodeURIComponent).join(",")}`,m=await fetch(p);return m.ok?(await m.json()).data?.data??[]:[]}catch{return[]}},[]),k=c.useRef(null),A=c.useRef(l);c.useEffect(()=>{if(A.current===l)return;A.current=l;const r=k.current,p=r?.recs?.map(o=>o.id)??[];if(!r||p.length===0)return;let m=!1;return(async()=>{const o=await t(p);m||k.current!==r||!h.current||o.length===0||d(L(r,o))})(),()=>{m=!0}},[l,t]);const O=c.useCallback(async()=>!e||!s?{}:s.getRecommenders(),[s,e]),G=c.useCallback(async(r,p,m)=>{if(!(!e||!s)){if(!u){d({recommenderName:r,recs:[]});return}a(!0),C(null);try{const o=R(),_={...m,...o},f={...await s.getRecommendations(r,p,_),recommenderName:r};k.current=f;let T=f;if(f.recs&&f.recs.length>0){const U=f.recs.map(x=>x.id),D=await t(U);T=L(f,D)}if(!h.current){d({recommenderName:r,recs:[]}),a(!1);return}d(T),a(!1)}catch(o){C(o instanceof Error?o:new Error("Failed to fetch recommendations")),a(!1)}}},[s,e,t,R,u]),V=c.useCallback(async(r,p,m)=>{if(!(!e||!s)){if(!u){d({recs:[]});return}a(!0),C(null);try{const o=R(),_={...m,...o},P=await s.getZoneRecommendations(r,p,_);k.current=P;let f=P;if(P.recs&&P.recs.length>0){const T=P.recs.map(D=>D.id),U=await t(T);f=L(P,U)}if(!h.current){d({recs:[]}),a(!1);return}d(f),a(!1)}catch(o){C(o instanceof Error?o:new Error("Failed to fetch zone recommendations")),a(!1)}}},[s,e,t,R,u]);return{isLoading:I,isEnabled:e,recommendations:b,error:w,getRecommenders:O,getRecommendations:G,getZoneRecommendations:V}};export{$ as a,se as g,ne 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.