PageSourceSearch

https://www.cozey.com/_next/static/chunks/dcdaa27dc18c2473.js?dpl=dpl_B4FM3fJ8QCGj5Ay1brRHnZ7xCUHJ

js cozey.com collected 2026-09-26 00:44:13 UTC 44,048 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="101cd240-d213-0f96-2b9c-eecb690698ac")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,954772,e=>{"use strict";var t=e.i(687449);function r(e,r){let a=(0,t.sanitizeString)(e,{retainCase:!0});return a||(0,t.sanitizeString)(r,{retainCase:!0})||void 0}e.s(["resolveMasonryMediaAlt",()=>r])},18681,e=>{"use strict";e.s(["isVideo",0,e=>!!e&&["mp4","mov","webm","ogg","m4v"].includes(e.split("?")[0].split(".").pop()?.toLowerCase()??"")])},508638,e=>{"use strict";var t=e.i(317224);e.s(["default",()=>t.Button])},371372,e=>{"use strict";var t=e.i(719885);let r=e=>"object"==typeof e&&null!==e&&!Array.isArray(e);e.s(["getShopifyVariantIdForLocale",0,(e,a)=>{if(!r(e)||Array.isArray(e))return null;let i=e.shopifyVariantIds;return r(i)?(0,t.getLocalizedMainVariantId)(i,a):null}])},151239,e=>{"use strict";let t=Object.freeze({"en-ca":{filterBarLabels:{applyFilters:"Apply",clearFilters:"Clear",popularTopicsDropdown:"Popular Topics",sortDropdown:"Sort",starRatingDropdown:"Star Rating"},popularTopicsLabels:{accuracy:"Accuracy",assembly:"Assembly",color:"Color",comfort:"Comfort",delivery:"Delivery / Shipping",function:"Function",material:"Material",petFriendly:"Pet Friendly",quality:"Quality",size:"Size",sleeper:"Sleeper",storage:"Storage",style:"Style",value:"Value",washable:"Washable"},reviewsLabels:{aiSummaryTitle:"AI Summary",noResultsMessage:"Maybe your perfect piece is hiding behind another filter. Refine your filters to discover more results.",noResultsTitle:"No results found!"},sortOptionsLabels:{priority:"Most Relevant",imagesFirst:"Images First",newestFirst:"Newest First",oldestFirst:"Oldest First"},starRatingLabels:{fiveStars:"5★",fourStars:"4★",oneStar:"1★",threeStars:"3★",twoStars:"2★"},stickyHeaderLabels:{aiSummaryTitle:"AI Summary",closeButton:"Close"}},"en-us":{filterBarLabels:{applyFilters:"Apply",clearFilters:"Clear",popularTopicsDropdown:"Popular Topics",sortDropdown:"Sort",starRatingDropdown:"Star Rating"},popularTopicsLabels:{accuracy:"Accuracy",assembly:"Assembly",color:"Color",comfort:"Comfort",delivery:"Delivery / Shipping",function:"Function",material:"Material",petFriendly:"Pet Friendly",quality:"Quality",size:"Size",sleeper:"Sleeper",storage:"Storage",style:"Style",value:"Value",washable:"Washable"},reviewsLabels:{aiSummaryTitle:"AI Summary",noResultsMessage:"Maybe your perfect piece is hiding behind another filter. Refine your filters to discover more results.",noResultsTitle:"No results found!"},sortOptionsLabels:{priority:"Most Relevant",imagesFirst:"Images First",newestFirst:"Newest First",oldestFirst:"Oldest First"},starRatingLabels:{fiveStars:"5★",fourStars:"4★",oneStar:"1★",threeStars:"3★",twoStars:"2★"},stickyHeaderLabels:{aiSummaryTitle:"AI Summary",closeButton:"Close"}},"en-au":{filterBarLabels:{applyFilters:"Apply",clearFilters:"Clear",popularTopicsDropdown:"Popular Topics",sortDropdown:"Sort",starRatingDropdown:"Star Rating"},popularTopicsLabels:{accuracy:"Accuracy",assembly:"Assembly",color:"Colour",comfort:"Comfort",delivery:"Delivery / Shipping",function:"Function",material:"Material",petFriendly:"Pet Friendly",quality:"Quality",size:"Size",sleeper:"Sleeper",storage:"Storage",style:"Style",value:"Value",washable:"Washable"},reviewsLabels:{aiSummaryTitle:"AI Summary",noResultsMessage:"Maybe your perfect piece is hiding behind another filter. Refine your filters to discover more results.",noResultsTitle:"No results found!"},sortOptionsLabels:{priority:"Most Relevant",imagesFirst:"Images First",newestFirst:"Newest First",oldestFirst:"Oldest First"},starRatingLabels:{fiveStars:"5★",fourStars:"4★",oneStar:"1★",threeStars:"3★",twoStars:"2★"},stickyHeaderLabels:{aiSummaryTitle:"AI Summary",closeButton:"Close"}},"fr-ca":{filterBarLabels:{applyFilters:"Appliquer",clearFilters:"Effacer",popularTopicsDropdown:"Thèmes populaires",sortDropdown:"Trier par",starRatingDropdown:"Nombre d'étoiles"},popularTopicsLabels:{accuracy:"Ressemblance",assembly:"Assemblage",color:"Couleur",comfort:"Confort",delivery:"Livraison",function:"Fonction",material:"Matériaux",petFriendly:"Adapté aux animaux",quality:"Qualité",size:"Taille",sleeper:"Divan lit",storage:"Rangement",style:"Style",value:"Valeur",washable:"Lavable"},reviewsLabels:{aiSummaryTitle:"Résumé AI",noResultsMessage:"Peut-être que votre pièce parfaite est cachée derrière un autre filtre. Refinez vos filtres pour découvrir plus de résultats.",noResultsTitle:"Aucun résultat trouvé!"},sortOptionsLabels:{priority:"Les plus pertinents",imagesFirst:"Avec images",newestFirst:"Les plus récents",oldestFirst:"Les plus anciens"},starRatingLabels:{fiveStars:"5★",fourStars:"4★",oneStar:"1★",threeStars:"3★",twoStars:"2★"},stickyHeaderLabels:{aiSummaryTitle:"Résumé AI",closeButton:"Fermer"}}});function r(e){return t["en-ca"===e||"en-us"===e||"en-au"===e||"fr-ca"===e?e:"en-ca"]}e.s(["getShopFiltersFallback",()=>r,"shopFiltersFallback",0,t])},117718,e=>{"use strict";var t=e.i(151239);function r({reviewSummaryTemplate:e,avgRating:t,totalReviewCount:r,ratingDistribution:a,attributeAverages:i,constants:l,onCTAClick:s}){if(!e)return{showSummary:!1,showBreakdown:!1,showAttributes:!1,showPolicy:!1,showCTA:!1,summaryData:{averageRating:0,totalReviews:0,totalRatingText:"",trustpilotLogoUrl:""},breakdownData:{title:"",ratings:[]},attributesData:{title:"",attributes:[{label:"",rating:0}]},policyData:{text:"",linkLabel:"",linkUrl:""},ctaData:{label:"",onClick:()=>{}}};let o=i?.filter(e=>!!e?.name)??[],{ctaLabel:n,detailedReviewsLabel:u,policyText:c,linkLabel:p,linkUrl:d}=l?.reviewSummaryLabels??{};return{showSummary:!!e.showSummary,showBreakdown:!!e.showBreakdown,showAttributes:o?.length>0,showPolicy:!0,showCTA:!0,summaryData:{averageRating:t??0,totalReviews:r??0,totalRatingText:e.summaryData?.totalRatingText??"",trustpilotLogoUrl:"/Trustpilot-logo.png"},breakdownData:{title:e.breakdownData?.title??"",ratings:a??[]},attributesData:{title:u||"DETAILED REVIEWS",attributes:o.map(e=>({label:e.name,rating:e.rating}))},policyData:{text:c||"Read our",linkLabel:p||"Review policy",linkUrl:d||"/privacy"},ctaData:{label:n||"Leave a Review",onClick:s??(()=>{})}}}function a({reviews:e,totalPages:t,currentPage:r,setCurrentPage:a,isLoading:i=!1}){return{reviews:e||[],desktopCardLimit:8,mobileCardLimit:5,totalPages:t,currentPage:r,setCurrentPage:a,isLoading:i}}function i({reviewsAiSummary:e,constants:r,locale:a}){if(e&&"reviewAISummary"===e._type)return{label:r?.stickyHeaderLabels?.aiSummaryTitle??(0,t.getShopFiltersFallback)(a).stickyHeaderLabels.aiSummaryTitle,closeButtonLabel:r?.stickyHeaderLabels?.closeButton??(0,t.getShopFiltersFallback)(a).stickyHeaderLabels.closeButton,content:e.overallSummary??""}}function l({reviewsAiSummary:e,filteredTotalCount:r,constants:a,locale:i}){return 0===r?{variant:"no-results",title:a?.reviewsLabels?.noResultsTitle??(0,t.getShopFiltersFallback)(i).reviewsLabels.noResultsTitle,icon:"search-icon",animate:!0,animateSpeed:"fast",content:a?.reviewsLabels?.noResultsMessage??(0,t.getShopFiltersFallback)(i).reviewsLabels.noResultsMessage}:e&&"reviewAISummary"===e._type?{variant:"ai-summary",title:a?.reviewsLabels?.aiSummaryTitle??(0,t.getShopFiltersFallback)(i).reviewsLabels.aiSummaryTitle,icon:"ai-star",animate:!0,animateSpeed:"fast",content:e.overallSummary??""}:void 0}function s({onFilterChange:e,onSortChange:r,constants:a,locale:i,hasImages:l}){let s,o=[{type:"filter",name:"rating",label:a?.filterBarLabels?.starRatingDropdown??(0,t.getShopFiltersFallback)(i).filterBarLabels.starRatingDropdown,multiSelect:!1,options:[{label:a?.starRatingLabels?.fiveStars??(0,t.getShopFiltersFallback)(i).starRatingLabels.fiveStars,value:"5-stars"},{label:a?.starRatingLabels?.fourStars??(0,t.getShopFiltersFallback)(i).starRatingLabels.fourStars,value:"4-stars"},{label:a?.starRatingLabels?.threeStars??(0,t.getShopFiltersFallback)(i).starRatingLabels.threeStars,value:"3-stars"},{label:a?.starRatingLabels?.twoStars??(0,t.getShopFiltersFallback)(i).starRatingLabels.tw
2oStars,value:"2-stars"},{label:a?.starRatingLabels?.oneStar??(0,t.getShopFiltersFallback)(i).starRatingLabels.oneStar,value:"1-star"}]},{type:"filter",name:"tags",label:a?.filterBarLabels?.popularTopicsDropdown??(0,t.getShopFiltersFallback)(i).filterBarLabels.popularTopicsDropdown,multiSelect:!1,options:[{label:a?.popularTopicsLabels?.comfort??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.comfort,value:"comfort"},{label:a?.popularTopicsLabels?.quality??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.quality,value:"quality"},{label:a?.popularTopicsLabels?.material??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.material,value:"material"},{label:a?.popularTopicsLabels?.value??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.value,value:"value"},{label:a?.popularTopicsLabels?.size??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.size,value:"size"},{label:a?.popularTopicsLabels?.style??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.style,value:"style"},{label:a?.popularTopicsLabels?.color??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.color,value:"color"},{label:a?.popularTopicsLabels?.accuracy??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.accuracy,value:"accuracy"},{label:a?.popularTopicsLabels?.assembly??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.assembly,value:"assembly"},{label:a?.popularTopicsLabels?.delivery??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.delivery,value:"delivery-shipping"},{label:a?.popularTopicsLabels?.function??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.function,value:"function"},{label:a?.popularTopicsLabels?.sleeper??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.sleeper,value:"sleeper"},{label:a?.popularTopicsLabels?.storage??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.storage,value:"storage"},{label:a?.popularTopicsLabels?.washable??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.washable,value:"washable"},{label:a?.popularTopicsLabels?.petFriendly??(0,t.getShopFiltersFallback)(i).popularTopicsLabels.petFriendly,value:"pet-friendly"}]}],n=(s=[{type:"sort",label:a?.sortOptionsLabels?.priority??(0,t.getShopFiltersFallback)(i).sortOptionsLabels.priority,value:"priority",sortFn:()=>0},{type:"sort",label:a?.sortOptionsLabels?.newestFirst??(0,t.getShopFiltersFallback)(i).sortOptionsLabels.newestFirst,value:"newest",sortFn:()=>0},{type:"sort",label:a?.sortOptionsLabels?.oldestFirst??(0,t.getShopFiltersFallback)(i).sortOptionsLabels.oldestFirst,value:"oldest",sortFn:()=>0}],l&&s.push({type:"sort",label:a?.sortOptionsLabels?.imagesFirst??(0,t.getShopFiltersFallback)(i).sortOptionsLabels.imagesFirst,value:"images-first",sortFn:()=>0}),s),u={sortOptions:a?.filterBarLabels?.sortDropdown??(0,t.getShopFiltersFallback)(i).filterBarLabels.sortDropdown,clearFilters:a?.filterBarLabels?.clearFilters??(0,t.getShopFiltersFallback)(i).filterBarLabels.clearFilters,applyFilters:a?.filterBarLabels?.applyFilters??(0,t.getShopFiltersFallback)(i).filterBarLabels.applyFilters},c=(0,t.getShopFiltersFallback)(i).sortOptionsLabels.priority,p=n.find(e=>"sort"===e.type&&e.label===c);return{options:[...o,...n],mobileLabels:u,onApply:t=>{e(t)},onSortChange:e=>{r(e?.value)},defaultSort:p?{label:p.label,value:p.value}:null}}e.s(["buildAiCardProps",()=>l,"buildCardLayoutProps",()=>a,"buildReviewsAiSummaryTooltip",()=>i,"buildShopFilterProps",()=>s,"buildSummaryProps",()=>r])},73500,951946,e=>{"use strict";var t=e.i(22616),r=e.i(461410);class a extends t.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}state={hasError:!1,error:null};previousResetKeys=this.props.resetKeys;componentDidCatch(e,t){let{loggerMetadata:a,onError:i}=this.props,{tags:l,...s}=a??{},{feature:o,function_name:n,...u}=l??{};(0,r.captureError)(e,{...s,extra:{componentStack:t.componentStack,...a?.extra},tags:{feature:o??"add-to-cart",function_name:n??"GenericErrorBoundary",boundary:"true",...u}}),i?.(e,t)}componentDidUpdate(){this.state.hasError&&this.haveResetKeysChanged()&&this.resetErrorBoundary()}haveResetKeysChanged(){let{resetKeys:e}=this.props;if(!e||!this.previousResetKeys)return!1;if(e.length!==this.previousResetKeys.length)return this.previousResetKeys=e,!0;let t=e.some((e,t)=>!Object.is(e,this.previousResetKeys[t]));return t&&(this.previousResetKeys=e),t}resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({hasError:!1,error:null})};renderFallback(){let{fallback:e}=this.props,{error:t}=this.state;return e?"function"==typeof e?e({error:t??Error("Unknown error"),reset:this.resetErrorBoundary}):e:null}render(){return this.state.hasError?this.renderFallback():this.props.children}}e.s(["ErrorBoundaryWrapper",()=>a],73500);var i=e.i(882918);function l({onRetry:e,message:t="Community content is temporarily unavailable. Please try again soon."}){return(0,i.jsxs)("div",{className:"mt-8 rounded border border-gray-200 bg-white/80 p-6 text-center text-sm text-gray-600",children:[(0,i.jsx)("p",{className:"text-base font-semibold text-gray-900",children:"Unable to load UGC content"}),(0,i.jsx)("p",{className:"mt-2",children:t}),e?(0,i.jsx)("button",{type:"button",className:"mt-4 inline-flex items-center rounded border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-50",onClick:e,children:"Try again"}):null]})}e.s(["UGCErrorFallback",()=>l],951946)},849164,e=>{"use strict";e.s(["richTextVariantMapper",0,e=>{if(e?.includes("warranty"))return"warranty";if(e?.includes("terms-and-conditions"))return"terms-and-conditions";if(e?.includes("cozey-care-plus"))return"cozey-care-plus";if(e?.includes("privacy-policy"))return"privacy-policy";if(e?.includes("compare-section"))return"compare-section";else if(e?.includes("feature-card"))return"feature-card";else if(e?.includes("infoBanner"))return"infoBanner";else if(e?.includes("productCard"))return"productCard";else if(e?.includes("benefitsBanner"))return"benefitsBanner";else if(e?.includes("refurbished"))return"refurbished";else if(e?.includes("consultation"))return"consultation";else if(e?.includes("faq"))return"faq";else return"default"}])},50476,e=>{"use strict";var t=e.i(687449);function r(e,r){if("string"!=typeof e)return;let a=(0,t.sanitizeString)(e,{retainCase:!0});return r.includes(a)?a:void 0}e.s(["sanitizeEnum",()=>r,"stripInvisibles",0,e=>e.replace(/[\u200B-\u200D\u2060\uFEFF\u00A0\u202A-\u202E\u2066-\u2069]/g,"")])},663285,e=>{"use strict";var t=e.i(461410),r=e.i(946815);let a=new Map;function i(e,t){let r=e.join(",");return`tagged-items-${r}-${t||""}`}async function l(e,s=null){let o,n;if(0===e.length)return[];let u=(o=i(e,s),(n=a.get(o))?Date.now()-n.timestamp>3e5?(a.delete(o),null):n.data:null);if(u)return u;try{let t,l=(0,r.encodePayload)({urlPaths:e,actionButton:s}),o=await fetch(`/api/algolia/tagged-items?payload=${l}`);if(!o.ok)throw Error(`API request failed: ${o.status}`);let n=(await o.json()).results;return t=i(e,s),a.set(t,{data:n,timestamp:Date.now()}),n}catch(r){return(0,t.logEvent)({error:r,tags:{function_name:"fetchTaggedItemsResults",feature:"UGC"},extra:{urlPaths:e,urlPathsCount:e.length,actionButton:s}}),e.map(()=>null)}}e.s(["fetchTaggedItemsResults",()=>l])},348935,e=>{"use strict";var t=e.i(736145);let r=[...new Set(Object.values(t.localeToCountry))],a=RegExp(`\\w-(${r.join("|")})$`);
2function i(e,r,i){let l=e.map(e=>e.trim()).filter(Boolean),s=t.localeToCountry[r.trim().toLowerCase()];return s?i&&i.length>0?new Set(i.map(e=>e.trim().toLowerCase()).filter(Boolean)).has(s)?[...l.map(e=>a.test(e)?e:`${e}-${s}`),s]:[...l,s]:[...l,s]:l}e.s(["buildLocalizedRuleContexts",()=>i])},997506,720032,e=>{"use strict";var t=e.i(22616),r=e.i(911038),a=e.i(500623),i=e.i(461410),l=e.i(977032),s=e.i(972770);let o=(e,t,r,a)=>{console.error(e,r),(0,i.logEvent)({error:r,tags:{feature:"marketing-analytics",function_name:t},extra:{items:a}})},n=(e,t)=>{let r=[],a=[],i=(0,l.getCurrencyCode)(t);return e.slice(0,9).forEach((e,i)=>{let o=e.shopifyVariant??null,n=e.hit??null,u=o?.product.id?o.product.id.split("Product/")[1]:"",c=o?.id?o.id.split("ProductVariant/")[1]:"";u&&c&&(a.push(c),r.push({id:o?.sku??n?.objectID??"",name:o?.product.title??(n?(0,s.resolveProductTitle)(n,t):""),brand:"Cozey Inc",category:n?.productType||n?.category?.[0]||"Furniture",variant:o?.title??(n&&(n.color?.nameEn||n.color?.nameFr)||""),price:o?.price.amount?String(o.price.amount):n?(0,l.getBasePrice)(n,t):"",product_id:u,variant_id:c,position:i+1,list:window.location.pathname}))}),{impressions:r,currencyCode:i,itemIds:a}},u=async(e,t)=>{try{let{itemIds:r}=n(e,t);if(0===r.length)return;let i=`${window.location.origin}${window.location.pathname}`;await (0,a.waitForWunderkindSDK)(),(0,a.wunderkindSDK)("viewCategory",{"items:ids":r,"page:url":i})}catch(t){o("Error sending Wunderkind view list item data:","sendViewListItemWunderkind",t,e)}},c=async(e,t)=>{try{window.ElevarDataLayer=window.ElevarDataLayer??[];let{impressions:r,currencyCode:a}=n(e,t);window.ElevarDataLayer.push({event:"dl_view_item_list",user_properties:{visitor_type:"guest"},ecommerce:{currencyCode:a,impressions:r}})}catch(t){o("Error sending view list item data:","sendViewListItemDataLayer",t,e)}await u(e,t)};var p=e.i(649927),d=e.i(395188);let g=(e,t)=>{let r=e.variantIds;if(!r)return"";let a=(0,d.getAlgoliaVariantIdsKey)(t);return(0,p.normalizeVariantId)(r[a])};function m(e,t){let r="string"==typeof t&&""!==t.trim()?t:void 0;if(null!==e&&"object"==typeof e){let t=e.hit;if(null!==t&&"object"==typeof t){let e=t.variantSlug;if("string"==typeof e&&""!==e.trim())return e}}return r}async function b(e,t,r){let a=e?g(e,t):"";return a?`gid://shopify/ProductVariant/${a}`:r()}e.s(["buildViewListItems",0,({shopifyItems:e,hits:t,maxItems:a=9,locale:i=r.LOCALE_EN_CA})=>{let l=Array.from({length:a},(e,r)=>({shopifyVariant:null,hit:t[r]??null}));return e.forEach(e=>{let r,s=e.shopifyVariant??null;if(!s)return;let o=(r=s?.id)?(r.includes("ProductVariant/")?r.split("ProductVariant/")[1]:r).trim():"",n=o.length>0?t.slice(0,a).findIndex(e=>g(e,i)===o):-1;if(-1!==n&&l[n]?.shopifyVariant==null){l[n]={shopifyVariant:s,hit:l[n]?.hit??t[n]??null};return}let u="number"==typeof e.sourceIndex?e.sourceIndex:-1;u>=0&&u<a&&l[u]?.shopifyVariant==null&&(l[u]={shopifyVariant:s,hit:l[u]?.hit??t[u]??null})}),l},"getLocaleVariantId",0,g,"useViewItemListTracking",0,({locale:e,pathname:r,elevarUserDataSuccessful:a,setListPage:i,listItems:l,resetKey:s,shouldTrack:o=!0,trackingKey:n})=>{let p=(0,t.useRef)(!1),d=(0,t.useRef)(!1);(0,t.useEffect)(()=>{p.current=!1,d.current=!1},[s]),(0,t.useEffect)(()=>{if(!o||!a||r.includes("product")||p.current)return;let t=n??`view_list:${r}`,s=window;if(s.__elevarViewListSeen||(s.__elevarViewListSeen=new Set),s.__elevarViewListSeen.has(t)){l.length>0&&!d.current&&(d.current=!0,u(l,e));return}0===l.length||(p.current=!0,s.__elevarViewListSeen.add(t),i(window.location.pathname),(async()=>{await c(l,e)})())},[a,l,e,r,i,o,n])}],997506),e.s(["getHitVariantSlug",()=>m,"resolveVariantGid",()=>b],720032)},105531,520332,e=>{"use strict";let t=({carouselTitle:e,itemName:t,itemPosition:r,clickUrl:a,pagePath:i})=>{try{window.ElevarDataLayer=window.ElevarDataLayer??[];let l=(({carouselTitle:e,itemName:t,itemPosition:r,clickUrl:a,pagePath:i})=>({event:"dl_carousel_click",carousel_title:e,item_name:t,item_position:r,...a?{click_url:a}:{},...i?{page_path:i}:{}}))({carouselTitle:e,itemName:t,itemPosition:r,clickUrl:a,pagePath:i});window.ElevarDataLayer.push(l)}
2catch(e){console.error("Error sending carousel click data:",e)}};e.s(["sendCarouselClickData",0,t],520332),e.s(["trackCarouselItemClick",0,({carouselTitle:e,itemName:r,itemPosition:a,clickUrl:i})=>{t({carouselTitle:e??"",itemName:r??"",itemPosition:a>=0?a:0,clickUrl:i??void 0,pagePath:window.location.pathname})}],105531)},373410,e=>{"use strict";function t(e,t){var r;if(t?.variantSlug===e.variantSlug&&t&&e.colors?.[t.colorIndex]?.productLinkUrl)return e.colors[t.colorIndex].productLinkUrl;let a=(r=e.colors)&&0!==r.length&&r.find(e=>e.defaultColor)||null;return a?.productLinkUrl?a.productLinkUrl:e.shopUrl||""}e.s(["getTargetUrl",()=>t])},293847,912799,477725,e=>{"use strict";var t=e.i(694474);function r(e,r){let a=(0,t.normalizeProductSlug)(r.productSlug||""),i=r.variantSlug||"";return(!!a||!!i)&&(a&&i?e.some(e=>(0,t.normalizeProductSlug)(e.productSlug||"")===a&&e.variantSlug===i):i?e.some(e=>e.variantSlug===i):!!a&&e.some(e=>(0,t.normalizeProductSlug)(e.productSlug||"")===a))}e.s(["shouldExcludeCard",()=>r],293847);let a=({processedSlugQuery:e,isOptimized:t=!1,optimizationType:r,isPDP:a=!1,pathname:i})=>{if(!e)return;let l=i?.includes("/shelves/themis"),s=i?.includes("landing/sleep-kits"),o=i?.includes("innovations/aquaforte"),{category:n,colorFamily:u,size:c,productType:p,collection:d}=e,g=[],m=(e,t,r=!0)=>{t&&g.push({field:e,value:t,quoted:r})},b=()=>{c&&"seating"===p&&"sofa-bed"!==n&&m("facetIds.size",c,!1),"seating"===p&&m("hasExtraSeatingConfig","false",!1)},y=()=>{"bedroom"===p&&c&&m("facetIds.size",c)},h=["accessories","bedroom"];if(!d||a&&!l||s||o||m("collection",d),t)switch(r){case"department-based":p&&m("department",s||o?"":p),b(),y(),u&&!h.includes(p)&&m("facetIds.primaryColor",u.toLowerCase());break;case"category-based":n&&"default"!==n&&m("category",n),b(),y();break;default:p&&m("department",p),u&&!h.includes(p)&&m("facetIds.primaryColor",u.toLowerCase())}else n&&"default"!==n&&!l&&m("category",n),u&&!h.includes(p)&&m("facetIds.primaryColor",u.toLowerCase()),b(),y();if(0!==g.length)return g.map(({field:e,value:t,quoted:r})=>r?`${e}:"${t}"`:`${e}:${t}`).join(" AND ")};e.s(["buildDynamicFilters",0,a],912799);var i=e.i(977032);function l(e){var t;let r=(0,i.getRegionKey)(e.locale);return(t=e.environment)&&(t.includes("staging")||"development"===t)?`(availability.${r}:"in_stock" OR availability.${r}:"out_of_stock")`:`availability.${r}:"in_stock"`}let s=["/seating/mistral","/seating/shinuk","/modules/mistral","/modules/shinuk","/tables/shinuk"];function o(e){return!!e&&"string"==typeof e&&s.some(t=>e.includes(t))}function n(e){return e&&o(e)?e.includes("/mistral")?"Mistral":e.includes("/shinuk")?"Shinuk":"":""}function u(e,t){if(!e||!o(e))return"";let r="string"==typeof t?t.trim():"";if(!r)return'_collections:"Outdoor"';let a=r.replace(/"/g,'\\"');return`_collections:"Outdoor" AND collection:"${a}"`}function c(e){let t=l({locale:e.locale,environment:e.environment}),r=e.processedSlugQuery?.collection?.trim()||n(e.pathname),i=u(e.pathname,r||void 0),s=a({processedSlugQuery:o(e.pathname)&&e.processedSlugQuery?{...e.processedSlugQuery,collection:""}:e.processedSlugQuery,isOptimized:e.isOptimized??!1,optimizationType:e.optimizationType,isPDP:e.isPDP,pathname:e.pathname});return`${t}${s?` AND ${s}`:""}${i?` AND ${i}`:""}`}e.s(["buildAvailabilityFilter",()=>l,"buildCollectionSwiperFilters",()=>c,"getOutdoorCollectionFilter",()=>u,"getOutdoorCollectionNameFromPath",()=>n],477725)},668524,e=>{"use strict";e.s(["getSourceIndexByVariantSlug",0,(e,t)=>{if(!t)return;let r=e.findIndex(e=>e.variantSlug===t);return r>=0?r:void 0}])},288738,e=>{"use strict";e.i(557549);var t=e.i(882918),r=e.i(22616),a=e.i(911038),i=e.i(972770),l=e.i(234377),s=e.i(874669),o=e.i(548564),n=e.i(217549),u=e.i(656815),c=e.i(442915),p=e.i(873305),d=e.i(307953),g=e.i(193e3),m=e.i(844284),b=e.i(410125),y=e.i(799131),h=e.i(346619),f=e.i(340275),v=e.i(135066),S=e.i(339264),w=e.i(333404),F=e.i(717335),L=e.i(657583),C=e.i(254502),k=e.i(152702),x=e.i(954492),T=e.i(171462),R=e.i(348935),A=e.i(371372),z=e.i(997506),P=e.i(720032),I=e.i(275898),E=e.i(105531),D=e.i(373410),_=e.i(293847),V=e.i(928407),M=e.i(60406
27),O=e.i(912799),j=e.i(477725),B=e.i(668524),N=e.i(461410);let U=e=>{(0,N.captureError)(e instanceof Error?e:Error(String(e)),{tags:{feature:"marketing-analytics",component:"collection-swiper",flow:"carousel-select-item"}})},$=({targetUrl:e,isPDP:t,router:r})=>{if(e){if(t)return void window.location.assign(e);r.push(e)}},q=(0,f.createServerCachedSearchClient)(),W=r.default.memo(({title:e,titleVariant:l="ugc",subtitle:s,isProgressBarEnabled:f,processedSlugQuery:v,onFiltersUpdate:R,variant:j,hitsPerPage:N,isPDP:q=!1,backgroundColor:W="",gridContainer:H,gridCol:K,titleSemanticTag:G,enableViewItemListTracking:Q=!0})=>{let{items:J,results:Y}=(0,o.useHits)(),{elevarUserDataSuccessful:Z,setListPage:X}=(0,x.useElevarCreateContext)(),[ee,et]=r.default.useState([]),[er,ea]=r.default.useState(null),ei=(0,r.useRef)(!1),{locale:el}=(0,w.useLocale)(),es=(0,S.usePathname)(),eo=(0,F.useLocaleRouter)(),en=(0,L.isWashableRugsLandingPath)(es),eu=es?.includes("product/rugs"),ec=(0,k.useIsMobile)(600),ep=(0,S.useSearchParams)().get("config"),ed=eu&&ep?.includes("3-x-5"),eg=es?.includes("landing/sleep-kits"),em=es?.includes("innovations/aquaforte"),{constants:eb}=(0,M.useAppData)(),ey=(0,V.useFeatureFlagEnabled)("rebrand-product-content-cards-enabled"),{shopCards:eh,newProductCards:ef}=(0,C.useProductCards)(J,{locale:el,useSanityColors:!0,isRugsPage:en,isRebrandProductAndContentCardsEnabled:ey,productCardLabels:eb?.productCardLabels??void 0}),{status:ev}=(0,n.useInstantSearch)(),[eS,ew]=(0,r.useState)(!1),eF=(0,r.useRef)(void 0),eL=(0,r.useRef)(null);(0,r.useEffect)(()=>{eL.current!==v&&(ew(!1),eL.current=v)},[v]),(0,r.useEffect)(()=>{if(Y&&v&&"loading"!==ev&&"stalled"!==ev)return eF.current&&clearTimeout(eF.current),eF.current=setTimeout(()=>{let e=(Y?._rawResults?.[0]?.appliedRules||[]).length>0,t=J?.length||0;if(!eS){let r,a=!1;if(0!==t&&e?t>0&&t<6&&v?.colorFamily!=="red"&&(a=!0,r="category-based"):(a=!0,r="department-based"),a){let e=(0,O.buildDynamicFilters)({processedSlugQuery:v,isOptimized:!0,optimizationType:r,isPDP:q,pathname:es});e&&(R?.(e),ew(!0))}else ew(!0)}},500),()=>{eF.current&&clearTimeout(eF.current)}},[Y,J,v,eS,ev,R,q,es]);let eC=(0,r.useMemo)(()=>{if(ey)return[];let e=eh.filter(e=>null!==e),t=new Set,r=new Set,a=[],i=[];e.forEach(e=>{let l=e.productSlug||"";l&&t.has(l)?(r.add(l),i.push(e)):l&&(t.add(l),a.push(e))});let l=a.length>0?a:e;return v?.variantSlug||v?.productSlug?l.filter(e=>{let t=[{productSlug:e.productSlug,variantSlug:e.variantSlug}];return!(0,_.shouldExcludeCard)(t,{productSlug:v.productSlug,variantSlug:v.variantSlug})}).slice(0,N):l?.slice(0,N)},[eh,v,N,ey]),ek=(0,r.useMemo)(()=>{if(!ey)return[];let e=(ef||[]).filter(e=>!!e),t=new Set,r=new Set,a=[],i=[];e.forEach(e=>{let l=e.slugs?.[0]?.productSlug||"";l&&t.has(l)?(r.add(l),i.push(e)):l&&(t.add(l),a.push(e))});let l=a.length>0?a:e;return v?.variantSlug||v?.productSlug?l.filter(e=>{let t=e.slugs||[];return!(0,_.shouldExcludeCard)(t,{productSlug:v.productSlug,variantSlug:v.variantSlug})}).slice(0,N):l.slice(0,N)},[ef,ey,v,N]),ex=(0,r.useCallback)(t=>{try{let r=eC.findIndex(e=>e.variantSlug===t.variantSlug),i=ee.find(e=>e.content.props.variantSlug===t.variantSlug);if(t.shopUrl?.includes("product")){let l=(0,D.getTargetUrl)(t,er);(0,E.trackCarouselItemClick)({carouselTitle:e,itemName:t.title,itemPosition:r,clickUrl:l}),i?(0,I.sendSelectItemData)(i,r,el??a.LOCALE_EN_CA,l||""):(0,I.sendBackFallSelectItemData)(l,el??a.LOCALE_EN_CA,r),$({targetUrl:l,isPDP:q,router:eo})}}catch(e){U(e)}},[er,q,el,ee,eo,e,eC]),eT=(0,r.useCallback)((t,r,l)=>{{let s=t.slugs?.find(e=>e.swatchId===r)?.productSlug||(l?.productSlug??""),o=ek.findIndex(e=>e.hit.variantSlug===t.hit.variantSlug);(0,E.trackCarouselItemClick)({carouselTitle:e,itemName:(0,i.resolveProductTitle)(t.hit,el??a.LOCALE_EN_CA),itemPosition:o,clickUrl:s||void 0});try{let e=ee.find(e=>e.content.props.hit.variantSlug===t.hit.variantSlug);if(e){let t=e.content.props,r={shopifyVariant:e.shopifyVariant,data:{hit:t.hit,variantSlug:t.hit.variantSlug}};(0,I.sendSelectItemData)(r,o,el??a.LOCALE_EN_CA,s||"")}else(0,I.sendBackFallSelectItemData)(s,el??a.LOCALE_EN_CA,o)}catch(e){U(e)}eo&&$({targetUrl:s,isPDP:q,router:eo})}},[q,el,ee,eo,e,ek]),eR=(0,r.useMemo)(()=>ey?ek.map(e=>{let r=e.slugs?.[0];return{content:(0,t.jsx)(m.ProductCardV2,{...e,productHref:e.productHref,onCardClick:t=>eT(e,t,r),onSwatchClick:t=>{let r=e.slugs?.find(e=>e.swatchId===t)?.productSlug;eo&&$({targetUrl:r,isPDP:q,router:eo})},hasFlexibleHeight:!em&&!eg})}}):eC.map(e=>({content:(0,t.jsx)(p.ShopCard,{...e,key:e.title,useImageSwatches:e.useImageSwatches,variant:(0,L.isWashableRugsLandingPath)(es)||Array.isArray(e.department)&&e.department.includes("washable rugs")&&!es?.includes("product/rugs")?"rugs":"default",previewColors:ec?4:5,isUsedIndependent:!1,handleImageClick:()=>ex(e),onHover:t=>{let r=e.colors?.findIndex(e=>e.colorTitle===t.colorTitle&&e.colorCode===t.colorCode)??0;ea({variantSlug:e.variantSlug||"",colorIndex:r})},zoomScale:ec&&eu?ed?2.2:1.5:1})})),[eC,ek,es,ey,ec,eu,ed,q,eo,ex,eT,em,eg]);(0,r.useEffect)(()=>{ei.current=!1},[es]),(0,r.useEffect)(()=>{ei.current=!1},[eR.length]),(0,r.useEffect)(()=>{let e=async()=>{let e=eR.slice(0,9),t=e.map(e=>ey?e.content.props.hit?.variantSlug??e.content.props.slugs?.[0]?.variantSlug??"":e.content.props.variantSlug??""),r=await (0,T.fetchVariantMapsWithSlugs)(t,null,void 0,el);et((await Promise.all(e.map(async e=>{let t=ey?e.content.props.hit?.variantSlug??e.content.props.slugs?.[0]?.variantSlug:e.content.props.variantSlug,a=t?J.find(e=>e.variantSlug===t):void 0,i=ey?e.content.props.hit:void 0,l=await (0,P.resolveVariantGid)(a??i,el,async()=>{let e=t?r[t]:null;return e?(0,A.getShopifyVariantIdForLocale)(e,el):null});if(!l)return null;let s=await (0,T.fetchShopifyVariant)(l,el,t);return{...e,sourceIndex:(0,B.getSourceIndexByVariantSlug)(J,t),shopifyVariant:s}}))).filter(e=>null!==e)),ei.current=!0};eR.length>0&&!ei.current&&e()},[eR,es,ey,J,el]);let eA=(0,z.buildViewListItems)({shopifyItems:ee,hits:J,maxItems:9,locale:el}),ez=eA.some(e=>e?.shopifyVariant!=null&&e?.hit!=null),eP=Q&&ez&&J.length>0;return((0,z.useViewItemListTracking)({locale:el,pathname:es,elevarUserDataSuccessful:Z,setListPage:X,listItems:eA,shouldTrack:eP,resetKey:`${es}-${J.length}`}),"loading"===ev||"stalled"===ev)?(0,t.jsx)(u.SectionWrapper,{spacing:"none",type:"fullWidth",className:"pt-8 pb-6 lg:py-12",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-b-2 border-gray-900"})})}):!ey&&0===eC.length||ey&&0===ek.length?null:(0,t.jsx)(u.SectionWrapper,{spacing:"none",type:"fullWidth",bg
2:W,children:"pdp"!==j&&ec?(0,t.jsxs)("div",{className:"px-6 py-4",children:[s&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)(g.Text,{text:s.toUpperCase(),variant:"body3-reg"})}),e&&(0,t.jsx)("div",{className:"mb-2 flex flex-col gap-2",children:"rugs"===l?(0,t.jsx)(g.Text,{text:e,variant:"custom-rug-shop"}):(0,t.jsx)(g.Text,{text:e,variant:"h2",semanticTag:G??"h2"})}),ey?(0,t.jsx)(b.GridContainer,{...(0,h.serializeGridContainer)(H),children:eR.map(e=>(0,t.jsx)(y.GridCol,{...(0,h.serializeGridCol)(K),children:e.content},e.content.key))}):(0,t.jsx)(d.ResponsiveContainer,{className:"pb-0!",children:eR.map(e=>(0,t.jsx)("div",{children:e.content},e.content.key))})]}):(0,t.jsx)(c.SwiperContainer,{items:eR,title:(0,t.jsx)(g.Text,{text:e,variant:"h2",semanticTag:G??"h2"}),subtitle:ec?(0,t.jsx)(g.Text,{text:s?.toUpperCase(),variant:"body3-reg"}):s,variant:l??"ugc",breakPoints:{sm:{width:ey?"220px":"235px",gap:ey?"8px":"12px"},md:{width:ey?"324px":"235px",gap:"16px"},lg:{width:ey?"324px":(0,L.isWashableRugsLandingPath)(es)?"250px":"400px",gap:ey?"16px":"20px"},xl:{width:ey?"324px":(0,L.isWashableRugsLandingPath)(es)?"250px":"400px",gap:ey?"16px":"20px"}},isProgressBarEnabled:f??!0,invertTitleSubtitle:!0})})});W.displayName="ProductHits";let H=r.default.memo(({ruleContexts:e,indexName:a="cozey-headless-product-index",title:i,titleVariant:o="ugc",subtitle:n,hitsPerPage:u=12,isProgressBarEnabled:c,processedSlugQuery:p,locale:d,variant:g="default",isPDP:m=!1,backgroundColor:b,gridContainer:y,gridCol:h,titleSemanticTag:f,enableViewItemListTracking:w=!0,ruleContextLocaleOverrides:F})=>{let C=(0,S.usePathname)(),k="production",x=(0,r.useMemo)(()=>(0,j.buildAvailabilityFilter)({locale:d,environment:k}),[d,k]),T=(0,r.useMemo)(()=>(0,j.buildCollectionSwiperFilters)({processedSlugQuery:p,isOptimized:!1,isPDP:m,pathname:C,locale:d,environment:k}),[p,m,C,d,k]),[A,z]=(0,r.useState)(()=>({sourceFilters:T,currentFilters:T}));A.sourceFilters!==T&&z({sourceFilters:T,currentFilters:T});let P=A.currentFilters,I=(0,r.useMemo)(()=>{let e=p?.collection?.trim()||(0,j.getOutdoorCollectionNameFromPath)(C);return(0,j.getOutdoorCollectionFilter)(C,e||void 0)},[C,p?.collection]),E=(0,r.useMemo)(()=>{let t=(0,R.buildLocalizedRuleContexts)((e??[]).map(e=>(0,v.sanitizeField)(e)),d??"",F),r=(0,v.sanitizeField)(a),i=C.split("/").filter(Boolean),l=i.findIndex(e=>["collections","materials","landing","innovations"].includes(e)),s="";return -1!==l&&i[l+1]?s=i[l+1]:(0,L.isWashableRugsLandingPath)(C)?s="rug-8-x-10":i.includes("product")&&(i.includes("dining")||i.some(e=>e.includes("dining")))&&(s="Dining Collection"),{sanitizedRuleContext:t,sanitizedIndexName:r,query:s,useHitsPerPage:u+5}},[e,a,C,u,d,F]),D=(0,r.useCallback)(e=>{let t=`${x}${e?` AND ${e}`:""}${I?` AND ${I}`:""}`;z(e=>e.currentFilters===t?e:{...e,currentFilters:t})},[x,I]);return(0,t.jsxs)(l.InstantSearch,{searchClient:q,indexName:E.sanitizedIndexName,future:{preserveSharedStateOnUnmount:!0},stalledSearchDelay:300,children:[(0,t.jsx)(s.Configure,{getRankingInfo:!0,hitsPerPage:E.useHitsPerPage,query:E.query,filters:P,ruleContexts:E.sanitizedRuleContext,distinct:!0,clickAnalytics:!0}),(0,t.jsx)(W,{title:i,titleVariant:o,subtitle:n,isProgressBarEnabled:c,processedSlugQuery:p,onFiltersUpdate:D,variant:g,hitsPerPage:u,isPDP:m,backgroundColor:b,gridContainer:y,gridCol:h,titleSemanticTag:f,enableViewItemListTracking:w})]})});e.s(["default",0,H],288738)},893001,387194,449646,e=>{"use strict";var t=e.i(461410),r=e.i(321083),a=e.i(733140),i=e.i(694474),l=e.i(719885);let s=async({variantMap:e,locale:s,addItems:o,removeItems:n,cart:u,onAddSucceeded:c})=>{try{let p;if(!e)return;if(!(p="string"==typeof e?await (0,a.fetchVariantMap)(e)??void 0:e))return void(0,t.logEvent)({error:Error("Variant map missing for mini add-to-cart"),tags:{feature:"add-to-cart",function_name:"handleAddToCartMini"},extra:{locale:s,variantMapSlug:"string"==typeof e?e:void 0}});let d=(0,l.getLocalizedMainVariantId)(p.shopifyVariantIds,s),g=p.hasAddOns?(p.additionalVariants||[]).map(e=>(0,l.getLocalizedAddOnVariantId)(e.variantIds,s)):[],m=[d,...g].filter(
2Boolean),b=await Promise.all(m.map(async e=>{let[t]=await Promise.all([(0,r.isCpPlusEligible)(e,s)]),a=[...t?[{key:"_cpPlusEligible",value:"true"}]:[],{key:"ugcUpsell",value:"true"}];return{merchandiseId:e,quantity:1,attributes:a}}));if(b.some(e=>u?.lines.edges.some(({node:t})=>t.merchandise.id===e.merchandiseId))){let e=b.map(e=>e.merchandiseId),t=u?.lines.edges.filter(({node:t})=>e.includes(t.merchandise.id)).map(({node:e})=>e.id);t?.length&&await n(t,s)}else{let e=await o(b,s),t=(0,i.toVariantGid)(b[0]?.merchandiseId);e&&t&&c?.(t)}}catch(e){(0,t.logEvent)({error:e,tags:{feature:"add-to-cart",function_name:"handleAddToCartMini"},extra:{locale:s}})}};e.s(["handleAddToCartMini",0,s],893001);var o=e.i(22616),n=e.i(135066),u=e.i(687449),c=e.i(832356);let p=c.z.object({_id:c.z.string(),_type:c.z.literal("customerReviewV2"),_createdAt:c.z.string(),_updatedAt:c.z.string(),_rev:c.z.string(),language:c.z.string().nullable().optional(),customerName:c.z.string().nullable().optional(),customerLocation:c.z.string().nullable().optional(),publishDate:c.z.string().nullable().optional(),review:c.z.string().nullable().optional(),rating:c.z.number().nullable().optional(),productFamily:c.z.string().nullable().optional(),productVariant:c.z.string().nullable().optional(),baseProductRef:c.z.string().nullable().optional(),reviewSource:c.z.preprocess(e=>{if("string"!=typeof e)return;let t=(0,u.sanitizeString)(e,{retainCase:!0});return""===t?void 0:t},c.z.enum(["junip","manual","manual-import","trustpilot"]).optional()),attributes:c.z.array(c.z.object({_key:c.z.string(),name:c.z.preprocess(e=>e??void 0,c.z.string().optional()),rating:c.z.preprocess(e=>e??void 0,c.z.number().optional())})).nullable().optional(),images:c.z.array(c.z.string()).nullable().optional()}),d=c.z.object({name:c.z.string(),rating:c.z.number(),displayOrder:c.z.number()}),g=c.z.object({avg:c.z.number(),total:c.z.number(),counts:c.z.record(c.z.enum(["1","2","3","4","5"]),c.z.number()),attributeAverages:c.z.array(d)}),m={sort:"priority",userFilters:{},includeAggregates:!1},b=c.z.object({reviews:c.z.array(p),total:c.z.number(),numImages:c.z.number(),bumpedIds:c.z.array(c.z.string()).optional(),aggregates:g.optional()});async function y(e,r,a,i,l=m,s="en-ca"){let o=new URLSearchParams;o.set("start",String(e)),o.set("end",String(r)),a&&i&&(o.set("scopeField",(0,n.sanitizeField)(a)),o.set("scopeValue",(0,n.sanitizeField)(i))),o.set("sort",l.sort??"priority"),o.set("locale",s),o.set("userFilters",JSON.stringify(l.userFilters)),l.includeAggregates&&o.set("includeAggregates","true");let u=await fetch(`/api/reviews?${o.toString()}`);if(!u.ok){let e=Error(`Failed to fetch reviews: ${u.status} ${u.statusText}`);throw(0,t.logEvent)({tags:{feature:"reviews",function_name:"fetchPaginatedReviews"},error:e,extra:{context:"API response not ok",status:u.status,statusText:u.statusText,scopeField:a,scopeValue:i,locale:s,sort:l.sort}}),e}let c=await u.json(),p=b.safeParse(c);if(!p.success){let e=Error(`Invalid reviews response format: ${p.error.message}`);throw(0,t.logEvent)({tags:{feature:"reviews",function_name:"fetchPaginatedReviews"},error:e,extra:{context:"Zod validation failed",zodError:p.error.flatten(),scopeField:a,scopeValue:i,locale:s}}),e}return{reviews:p.data.reviews,total:p.data.total,numImages:p.data.numImages,bumpedIds:p.data.bumpedIds??[],aggregates:p.data.aggregates}}let h=(e={})=>Object.keys(e).sort((e,t)=>e.localeCompare(t)).reduce((t,r)=>{let a=((e=[])=>[...e].sort((e,t)=>e.localeCompare(t)))(e[r]);return a.length>0&&(t[r]=a),t},{}),f=({reviewSectionFilter:e,reviewSectionValue:t,sortOption:r,userFilters:a={},reviewsPerPage:i,locale:l})=>JSON.stringify({reviewSectionFilter:e??null,reviewSectionValue:t??null,sortOption:r??null,userFilters:h(a),reviewsPerPage:i,locale:l});e.s(["areUserFiltersEqual",0,(e={},t={})=>
2JSON.stringify(h(e))===JSON.stringify(h(t)),"normalizeUserFilters",0,h,"serializeReviewRequestKey",0,f],387194);var v=e.i(251312);function S({reviewSectionFilter:e,reviewSectionValue:r,totalReviewCount:a,locale:i,sortOption:l="",userFilters:s={}}){let[n,u]=(0,o.useState)([]),[c,p]=(0,o.useState)(a),[d,g]=(0,o.useState)(!1),[m,b]=(0,o.useState)(!0),[S,w]=(0,o.useState)(1),[F,L]=(0,o.useState)(""),C=(()=>{let[e,t]=(0,o.useState)(8);return(0,o.useEffect)(()=>{let e=()=>{t(window.innerWidth<600?5:8)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e})(),k=(0,o.useRef)(0),x=(0,o.useRef)(""),T=(0,o.useMemo)(()=>"all"!==e&&e?e:void 0,[e]),R=(0,o.useMemo)(()=>h(s),[s]),A=(0,o.useMemo)(()=>f({reviewSectionFilter:e,reviewSectionValue:r,sortOption:l,userFilters:R,reviewsPerPage:C,locale:i}),[e,r,l,R,C,i]),z=(0,o.useMemo)(()=>F!==A?1:S,[A,F,S]),P=(0,o.useMemo)(()=>Math.ceil(c/C),[c,C]),I=(0,o.useCallback)(e=>{w(e),L(A)},[A]);return(0,o.useEffect)(()=>{let e=!1;return(async()=>{let{numImages:t}=await y(0,1,T,r??void 0,{sort:"priority",userFilters:{}},i);e||g(t>0)})(),()=>{e=!0}},[T,r,i]),(0,o.useEffect)(()=>{let e=(z-1)*C,a=e+C,s=JSON.stringify({filterKey:A,currentPage:z,startIndex:e,endIndex:a});if(e>=c&&c>0||x.current===s)return;x.current=s,b(!0),k.current+=1;let o=k.current;y(e,a,T,r??void 0,{sort:l,userFilters:R},i).then(({reviews:e,total:t})=>{if(o!==k.current)return;let r=e.map(e=>{let t=e.publishDate,r=t;if(t)try{r=(0,v.default)(t).locale(i).format("DD MMMM, YYYY")}catch{r=t}return{...e,publishDate:r}});p(t),u(r)}).catch(r=>{o===k.current&&(x.current="",(0,t.logEvent)({tags:{feature:"reviews",function_name:"usePaginatedReviews"},error:r,extra:{filterKey:A,page:z,startIndex:e,endIndex:a}}))}).finally(()=>{o===k.current&&b(!1)})},[z,C,T,r,i,l,R,A,c]),{clientReviews:n,currentPage:z,setCurrentPage:I,totalPages:P,filteredTotalCount:c,hasImages:d,isLoading:m}}e.s(["usePaginatedReviews",()=>S],449646)},585684,e=>{"use strict";var t=e.i(882918),r=e.i(22616),a=e.i(717335),i=e.i(142354),l=e.i(449646),s=e.i(56584),o=e.i(117718),n=e.i(237111),u=e.i(387194);let c=(0,r.memo)(function({section:e,avgRating:c,totalReviewCount:p,ratingDistribution:d,attributeAverages:g,reviewsAiSummary:m,productFamily:b,locale:y,constants:h}){let f=(0,a.useLocaleRouter)(),v=(0,s.useHasSession)(),[S,w]=(0,r.useState)("priority"),[F,L]=(0,r.useState)({}),C=(0,r.useCallback)(e=>{L(t=>(0,u.areUserFiltersEqual)(t,e)?t:e)},[]),{clientReviews:k,currentPage:x,setCurrentPage:T,totalPages:R,filteredTotalCount:A,hasImages:z,isLoading:P}=(0,l.usePaginatedReviews)({reviewSectionFilter:e.filter??void 0,reviewSectionValue:e.filterValue??b,totalReviewCount:p,locale:y,sortOption:S,userFilters:F}),I=(0,r.useCallback)(()=>{v?f.push("/customers/items"):f.push("/customers/auth/login?from=reviews")},[v,f]),E=(0,r.useMemo)(()=>((e,t)=>{if(!e.showNoReviewsState||!e.noReviewsState)return;let r=e.noReviewsState,a=window.matchMedia("(max-width: 600px)").matches,i=!a&&!!r.showPrimaryAction||void 0,l=!!a&&!!r.showPrimaryActionLink||void 0,s=!!a&&!!r.showSecondaryAction||void 0;return{description:r.description??"",showPrimaryAction:i,primaryAction:i&&r.primaryAction?.label&&r.primaryAction?.url?{label:r.primaryAction.label,onClick:()=>{r.primaryAction?.url&&(window.location.href=(0,n.resolveLocalePath)(r.primaryAction.url,t))}}:void 0,showPrimaryActionLink:l,primaryActionLink:l&&r.primaryActionLink?.label&&r.primaryActionLink?.url?{label:r.primaryActionLink.label,url:(0,n.resolveLocalePath)(r.primaryActionLink.url,t)}:void 0,showSecondaryAction:s,secondaryAction:s&&r.secondaryAction?.label&&r.secondaryAction?.url?{label:r.secondaryAction.label,url:(0,n.resolveLocalePath)(r.secondaryAction.url,t)}:void 0}})(e,y),[e,y]),D=(0,r.useMemo)(()=>(0,o.buildSummaryProps)({reviewSummaryTemplate:e.reviewSummaryTemplate,avgRating:c,totalReviewCount:p,ratingDistribution:d,attributeAverages:g,constants:h,onCTAClick:I}),[e.reviewSummaryTemplate,c,p,d,g,h,I]),_=(0,r.useMemo)(()=>k.map(e=>({_id:e._id??"",_type:e._type??"customerReviewV2",_createdAt:e._createdAt??"",_updatedAt:e._updatedAt??"",_rev:e._rev??"",language:e.language??void 0,customerName:e.customerName??"Anonymous",customerLocation:e.customerLocation??void 0,publishDate:e.publishDate??"",rating:e.rating??0,review:e.review??"",reviewTitle:e?.baseProductRef??e.productVariant??e.productFamily??"Customer Review",product:e.productVariant??"",source:e.reviewSource??"",baseProductRef:e.baseProductRef??void 0,attributes:e.attributes||[],images:e.images||[]})),[k]),V=(0,r.useMemo)(()=>(0,o.buildCardLayoutProps)({reviews:_,totalPages:R,currentPage:x,setCurrentPage:T,isLoading:P}),[_,R,x,T,P]),M=(0,r.useMemo)(()=>(0,o.buildAiCardProps)({reviewsAiSummary:m??null,filteredTotalCount:A,constants:h,locale:y}),[m,A,h,y]),O=(0,r.useMemo)(()=>(0,o.buildShopFilterProps)({onFilterChange:C,onSortChange:w,constants:h,locale:y,hasImages:z}),[h,y,z,C]);return(0,t.jsx)("div",{id:"reviews-section",children:(0,t.jsx)(i.ReviewsSection,{header:e.header||"",showNoReviewsState:e.showNoReviewsState,noReviewsStateProps:E,summaryProps:D,cardLayoutProps:V,aiCardProps:M,shopFilterProps:O})})});e.s(["ReviewsSectionWrapper",0,c],585684)},902058,e=>{"use strict";var t=e.i(736145);function r(e,r){let a=t.localeToCountry[r];return a?e.filter(e=>{let t=e.availableMarkets;return!t||0===t.length||t.includes(a)}):e}e.s(["filterUgcByMarket",()=>r])}]);
3
4//# debugId=101cd240-d213-0f96-2b9c-eecb690698ac
5//# sourceMappingURL=14fa03afa3c4a09c.js.map

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.