PageSourceSearch

https://www.birchbox.com/_next/static/chunks/4868-7c8f212cf8989ef7.js

js birchbox.com collected 2026-10-02 02:49:14 UTC 17,143 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4868],{584:(n,e,t)=>{t.d(e,{A:()=>a});function a(){return async(n,e)=>{"remove"===e?fetch("/api/shopify/update-favorites",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n,action:"remove"})}):"add"===e&&fetch("/api/shopify/update-favorites",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n,dateAdded:Date.now(),action:"add"})})}}},17171:n=>{n.exports=JSON.parse('{"N":{"WQ":"Add to cart","YF":"Adding...","qk":"Coming soon"},"q":{"OA":"How to use it","Yq":"Reviews","fy":"Ingredients","eq":"Highlights","pt":"View all","UJ":"Read more","ap":"Collapse","vh":"Subscribed","OL":"You\'re subscribed to another plan.","Jl":{"D":"You may also like"}}}')},33568:(n,e,t)=>{t.d(e,{If:()=>i,ts:()=>l});var a=t(93890);let i='\n	fragment collectionProduct on Product {\n		id\n		title\n		vendor\n		handle\n		productType\n		avgRating: metafield(namespace: "loox", key: "avg_rating") {\n			...metafield\n		}\n		numReviews: metafield(namespace: "loox", key: "num_reviews") {\n			...metafield\n		}\n		priceRange {\n			minVariantPrice {\n				amount\n				currencyCode\n			}\n			maxVariantPrice {\n				amount\n				currencyCode\n			}\n		}\n		variants(first: 100) {\n			nodes {\n				id\n				quantityAvailable\n				sku\n				title\n				priceV2 {\n					amount\n					currencyCode\n				}\n				compareAtPriceV2 {\n					amount\n					currencyCode\n				}\n				isSample: metafield(namespace: "my_fields", key: "is_sample") {\n					...metafield\n				}\n				isNMC: metafield(namespace: "custom", key: "nmc_visible_") {\n					...metafield\n				}\n				isRMC: metafield(namespace: "custom", key: "rmc_visable") {\n					...metafield\n				}\n				hide: metafield(namespace: "custom", key: "hide") {\n					...metafield\n				}\n				image {\n				url\n				altText\n				width\n				height\n				}\n			}\n		}\n		images(first: 1) {\n			edges {\n				node {\n					id\n					url\n					altText\n					width\n					height\n				}\n			}\n		}\n		collections(first: 10) {\n			edges {\n				node {\n					handle\n				}\n			}\n		}\n	}\n',l="\n	query getCollectionProducts(\n		$collectionHandle: String\n		$first: Int = 250\n		$sortKey: ProductCollectionSortKeys = COLLECTION_DEFAULT\n		$reverse: Boolean = false\n		$after: String = null\n		$filters: [ProductFilter!] = []\n	) {\n		collection(handle: $collectionHandle) {\n			id\n			title\n			handle\n			descriptionHtml\n			seo {\n				description\n				title\n			}\n			image {\n				id\n				url\n				altText\n				width\n				height\n			}\n			products(\n				first: $first\n				sortKey: $sortKey\n				reverse: $reverse\n				after: $after\n				filters: $filters\n			) {\n				filters {\n					id\n					label\n					type\n					values {\n						id\n						label\n						count\n						input\n					}\n				}\n				pageInfo {\n					hasNextPage\n					hasPreviousPage\n					endCursor\n				}\n				edges {\n					node {\n						...collectionProduct\n					}\n				}\n			}\n		}\n	}\n\n	".concat(i,"\n	").concat(a.G,"\n")},37214:(n,e,t)=>{t.d(e,{M$:()=>s,Vu:()=>o,pF:()=>d});var a=t(85391),i=t(57629),l=t(73196),r=t(51725);let s=async function(n){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{product:t}=await (0,a.Ay)({variables:{slug:n},query:i.II});return t?(0,r.RT)(t,{shouldOmitHiddenVariants:e}):null},d=async n=>{let{nodes:e}=await (0,a.Ay)({query:i.Kh,variables:{productVariants:n}})||{};return e.map(n=>{if(!n)return null;let{product:e,...t}=n||{};return{...e,...t}})},o=async(n,e)=>{let{nodes:t}=await (0,a.Ay)({variables:{variantIds:n},query:l.mD});return t&&t.length?(0,r.oi)(t.filter(n=>!!n).map(n=>({node:n.product})),e):[]}},39673:(n,e,t)=>{t.d(e,{SY:()=>d,oU:()=>o});var a=t(85391),i=t(33568),l=t(93890);let r="\n	query getCustomerFavoritesWithDetails($ids: [ID!]!) {\n		nodes(ids: $ids) {\
1n			... on Product {\n				...collectionProduct\n			}\n		}\n	}\n\n	".concat(l.G,"\n	").concat(i.If,"\n");var s=t(51725);async function d(n){var e,t,i,l;if(!n)return null;let r=await (0,a.Ay)({variables:{customerAccessToken:n},query:'\n	query getCustomerFavorites($customerAccessToken: String!) {\n		customer(customerAccessToken: $customerAccessToken) {\n			id\n			email\n\n			favorites: metafield(namespace: "my_fields", key: "favorites") {\n				id\n				value\n			}\n		}\n	}\n'});return(null==r||null==(t=r.customer)||null==(e=t.favorites)?void 0:e.value)?function(n){let e=JSON.parse(n).map(n=>"gid://shopify/Product/".concat(n.p));return e.length?e:null}(null==r||null==(l=r.customer)||null==(i=l.favorites)?void 0:i.value):null}async function o(n){if(!n)return null;let e=await d(n);if(!e)return null;let t=await (0,a.Ay)({variables:{ids:e},query:r});return(null==t?void 0:t.nodes)?(0,s.S4)(null==t?void 0:t.nodes.map(n=>({node:n}))):null}},57533:(n,e,t)=>{t.d(e,{A:()=>i});var a=t(37876);function i(n){let{avgRating:e}=n,t=(n,t)=>"number"!=typeof e?null:e<=n?"fa-regular fa-star text-bbx-spark":e>n&&e<=t?"fa-solid fa-star-half-stroke text-bbx-spark":"fa-solid fa-star text-bbx-spark";return e&&e>=1?(0,a.jsxs)("div",{className:"flex text-xs space-x-0.5",children:[(0,a.jsx)("i",{className:"fa-solid fa-star text-bbx-spark"}),(0,a.jsx)("i",{className:"".concat(t(1,1.5))}),(0,a.jsx)("i",{className:"".concat(t(2,2.5))}),(0,a.jsx)("i",{className:"".concat(t(3,3.5))}),(0,a.jsx)("i",{className:"".concat(t(4,4.9))})]}):null}},57629:(n,e,t)=>{t.d(e,{ts:()=>r.ts,II:()=>a.Ay,Kh:()=>l});var a=t(73196),i=t(93890);"\n	query getProductRecommendationsById($id: ID!) {\n		productRecommendations(productId: $id) {\n			...productFields\n		}\n	}\n\n	".concat('\n	fragment productFields on Product {\n		id\n		title\n		vendor\n		handle\n		priceRange {\n			minVariantPrice {\n				amount\n				currencyCode\n			}\n		}\n		images(first: 1) {\n			edges {\n				node {\n					id\n					url\n					altText\n					width\n					height\n				}\n			}\n		}\n		avgRating: metafield(namespace: "loox", key: "avg_rating") {\n			...metafield\n		}\n		numReviews: metafield(namespace: "loox", key: "num_reviews") {\n			...metafield\n		}\n		variants(first: 250) {\n			pageInfo {\n				hasNextPage\n				hasPreviousPage\n			}\n			nodes {\n				id\n\n				priceV2 {\n					amount\n					currencyCode\n				}\n\n				isSample: metafield(namespace: "my_fields", key: "is_sample") {\n					...metafield\n				}\n\n				hide: metafield(namespace: "custom", key: "hide") {\n					...metafield\n				}\n			}\n		}\n	}\n',"\n	").concat(i.G,"\n");let l='\n	query getProductsByVariantId($productVariants: [ID!]!) {\n		nodes(ids: $productVariants) {\n			... on ProductVariant {\n				title\n				availableForSale\n				quantityAvailable\n				weight\n				weightUnit\n				price {\n					amount\n					currencyCode\n				}\n				id\n				image {\n					...imageFields\n				}\n				fullSizeVariantId: metafield(namespace: "productvariant", key: "fz_variant_id") {\n					value\n				}\n				product {\n					vendor\n					handle\n					isProductAvailableForSale: availableForSale\n					planDetails: metafield(namespace: "bb_subscriptions_api", key: "plan_details") {\n					...metafield\n					}\n					productId: id\n					description\n					howToUse: metafield(namespace: "product", key: "how_to_use") {\n						...metafield\n					}\n					avgRating: metafield(namespace: "loox", key: "avg_rating") {\n						value\n					}\n					numReviews: metafield(namespace: "loox", key: "num_reviews") {\n						value\n					}\n				}\n			}\n		}\n	}\n	'.concat(a.sI,"\n	").concat(i.G,"\n");var r=t(33568)},73196:(n,e,t)=>{t.d(e,{Ay:()=>d,mD:()=>s,sI:()=>l});var a=t(33568),i=t(93890);let l="\n	fragment imageFields on Image {\n		id\n		altText\n		height\n		width\n		url\n	}\n";"\n	query getProductById($id: ID!) {\n		product(id: $id) {\n			...collectionProduct\n		}\n	}\n\n	".concat(a.If,"\n	").concat(i.G,"\n"),i.G;let r="\n	query getProductBySlug($slug: String!) {\n		product(handle: $slug) {\n			...productFields\n		}\n	}\n\n	".concat('\n	fragment productFields on Product {\n		id\n		handle\n		availableForSale\n		title\n		productType\n		vendor\n		tags\n		description\n		descriptionHtml\n		options {\n			id\n			name\n			values\n		}\n		priceRange {\n			maxVariantPrice {\n				amount\n				currencyCode\n			}\n			minVariantPrice {\n				amount\n				currencyCode\n			}\n		}
1\n		requiresSellingPlan\n\n		collections(first: 250) {\n			nodes {\n				id\n				title\n				handle\n			}\n		}\n\n		...sellingPlanFields\n\n		notForSale: metafield(namespace: "custom", key: "not_for_sale") {\n			...metafield\n		}\n		howToUse: metafield(namespace: "product", key: "how_to_use") {\n			...metafield\n		}\n		brand: metafield(namespace: "my_fields", key: "brand") {\n			...metafield\n		}\n		highlights: metafield(namespace: "my_fields", key: "highlights") {\n			...metafield\n		}\n		promotionalDescription: metafield(namespace: "my_fields", key: "promotional_description") {\n			...metafield\n		}\n\n		ingredients: metafield(namespace: "product", key: "ingredients") {\n			...metafield\n		}\n		avgRating: metafield(namespace: "loox", key: "avg_rating") {\n			...metafield\n		}\n		numReviews: metafield(namespace: "loox", key: "num_reviews") {\n			...metafield\n		}\n\n		videos: media(first: 250) {\n			nodes {\n				...videosFields\n			}\n		}\n\n		images(first: 250) {\n			pageInfo {\n				hasNextPage\n				hasPreviousPage\n			}\n			edges {\n				node {\n					...imageFields\n				}\n			}\n		}\n\n		variants(first: 250) {\n			pageInfo {\n				hasNextPage\n				hasPreviousPage\n			}\n			nodes {\n				id\n				title\n				sku\n				weight\n				weightUnit\n				availableForSale\n				requiresShipping\n				quantityAvailable\n				selectedOptions {\n					name\n					value\n				}\n\n				compareAtPriceV2 {\n					amount\n					currencyCode\n				}\n\n				priceV2 {\n					amount\n					currencyCode\n				}\n\n				image {\n					...imageFields\n				}\n\n				isSample: metafield(namespace: "my_fields", key: "is_sample") {\n					...metafield\n				}\n\n				hide: metafield(namespace: "custom", key: "hide") {\n					...metafield\n				}\n\n				swatch: metafield(namespace: "my_fields", key: "swatch") {\n					id\n					key\n					type\n					reference {\n						... on MediaImage {\n							image {\n								url\n							}\n						}\n					}\n				}\n			}\n		}\n	}\n\n	'.concat("\n	fragment sellingPlanFields on Product {\n		sellingPlanGroups(first: 100) {\n			edges {\n				node {\n					name\n					sellingPlans(first: 100) {\n						edges {\n							node {\n								id\n								name\n								description\n								options {\n									name\n									value\n								}\n								priceAdjustments {\n									adjustmentValue {\n										... on SellingPlanFixedPriceAdjustment {\n											price {\n												amount\n												currencyCode\n											}\n										}\n										... on SellingPlanPercentagePriceAdjustment {\n											adjustmentPercentage\n										}\n										... on SellingPlanFixedAmountPriceAdjustment {\n											adjustmentAmount {\n												amount\n												currencyCode\n											}\n										}\n									}\n								}\n							}\n						}\n					}\n				}\n			}\n		}\n	}\n","\n"),"\n	").concat(i.G,"\n	").concat("\n	fragment videosFields on Media {\n		... on ExternalVideo {\n			id\n			host\n			originUrl\n			embedUrl\n			previewImage {\n				id\n				url\n				altText\n				width\n				height\n			}\n		}\n	}\n","\n	").concat(l,"\n"),s="\n	query getProductList($variantIds: [ID!]!) {\n		nodes(ids: $variantIds) {\n			... on ProductVariant {\n				id\n				product {\n					id\n					title\n					handle\n					...collectionProduct\n				}\n			}\n		}\n	}\n\n	".concat(a.If,"\n	").concat(i.G,"\n"),d=r},81560:(n,e,t)=>{t.d(e,{A:()=>l});var a=t(37876),i=t(78799);function l(n){let{classes:e=""}=n;return(0,a.jsx)("div",{className:"spinner ".concat(e),children:(0,a.jsxs)("span",{className:"sr-only",children:["es-es"===i.vV?"Cargando. Espere por favor":"Loading. Please wait","…"]})})}},86920:(n,e,t)=>{t.d(e,{A:()=>s});var a=t(20542),i=t(58149),l=t(78799),r=t(60272);function s(n){let{product:e,variant:t}=n,{canAddSubscriptionBoxToCart:s,subscriptionBoxInCart:d,alreadyPurchasedSubscriptionBox:o}=(0,a.A)(),{data:c}=(0,i.Ay)([o,e,t,s,d],()=>(function(n){var e;let{product:t,variant:a,canAddSubscriptionBoxToCart:i,subscriptionBoxInCart:s,alreadyPurchasedSubscriptionBox:d}=n;if(!(null==a?void 0:a.id))return!1;let o=(0,r.B)(a.id),c=i||(null==s?void 0:s.productId)!==t.id;return!!(!o&&l.PI&&t.availableForSale&&a.availableForSale&&(null!=(e=a.quantityAvailable)?e:1)>0||o&&c)})({alreadyPurchasedSubscriptionBox:o,product:e,variant:t,canAddSubscriptionBoxToCart:s,subscriptionBoxInCart:d}));return c}},94144:(n,e,t)=>{t.d(e,{A:()=>g});var a=t(37876),i=t(20542),l=t(17171),r=t(36854),s=t(36595),d=t(7293),o=t(19467),c=t(49018),u=t(36710),m=t(94444),p=t(86920),f=t(74380),v=t(78799),y=t(60272);function g(n){var e;
1let{product:t,variant:g,loading:h,setLoading:b,sellingPlanId:x,priceText:P,ctaText:k=l.N.WQ,onAddToCart:w,className:A="button button-primary whitespace-nowrap",renderSoldOutButton:_=!0,icon:I,breadcrumbs:N=null,lineItemAttributes:S}=n,C=(0,m.A)(),{subscriptionBoxInCart:q,alreadyPurchasedSubscriptionBox:j}=(0,i.A)(),F=(0,y.B)(null==g?void 0:g.id),{items:$,revalidate:T}=(0,f.Ay)(),V=(0,p.A)({product:t,variant:g}),R=h?l.N.YF:k,D=async()=>{var n,e,a,i,l,m,p,f,v,h,P,k,A,_;b(!0);let I=null==$||null==(n=$.find(n=>(0,y.B)(n.merchandise.id)))?void 0:n.id;if(!x&&t.requiresSellingPlan)throw Error("Product requires a selling plan, but none was selected.");let q=$||[],j=q.filter(n=>{var e;return!n.sellingPlanAllocation&&!n.merchandise.sku.startsWith("bb-box")&&!n.merchandise.sku.startsWith("signature-box")&&!(null==(e=n.attributes)?void 0:e.some(n=>"source"===n.key&&"get_started_gift"===n.value))}),V=q.filter(n=>n.sellingPlanAllocation||n.merchandise.sku.startsWith("bb-box")||n.merchandise.sku.startsWith("signature-box"));async function R(n,e){try{await n(),null==e||e()}catch(n){console.error("Error during revalidate or onAddToCart:",n)}}async function D(){F?(j.length>0&&await (0,u.A)(j.filter(n=>void 0!==n.id).map(n=>({id:n.id}))),I?await (0,c.A)({id:I,quantity:1,variantId:g.id,sellingPlanId:x||void 0}):await C({variantId:g.id||"",quantity:1,sellingPlanId:x,attributes:S})):F||(I&&await (0,u.A)(V.map(n=>({id:n.id||""}))),await C({variantId:null==g?void 0:g.id,quantity:1,sellingPlanId:x,attributes:S})),await R(T,w),b(!1)}await D();let O=(0,s.A)({product:t,price:(null==g||null==(e=g.price)?void 0:e.amount)||(null==t||null==(a=t.price)?void 0:a.amount),productBreadcrumb:N,isSubscriptionBox:!!F});(0,d.h)({event:"analytics_event",data:{eventData:{category:"ecommerce",action:"addToCart",label:null==t?void 0:t.name},ecommerce:{currencyCode:(null==g||null==(i=g.price)?void 0:i.currencyCode)||(null==t||null==(l=t.price)?void 0:l.currencyCode),add:{actionField:{list:(null==N||null==(m=N[0])?void 0:m.title)||"membership"},products:[O]}}}}),t&&t.id&&g&&g.id&&(0,o.zM)(t,1,(null==N||null==(A=N[0])?void 0:A.title)||"membership");let B=null!=(_=null==g||null==(p=g.price)?void 0:p.amount)?_:null==t||null==(f=t.price)?void 0:f.amount,G=null==S||null==(v=S.find(n=>"source"===n.key))?void 0:v.value;r.Ay.capture("add_to_cart",{product_id:null==t?void 0:t.id,product_name:null==t?void 0:t.name,variant_id:null==g?void 0:g.id,quantity:1,value:null!=B?parseFloat(String(B)):void 0,currency:(null==g||null==(h=g.price)?void 0:h.currencyCode)||(null==t||null==(P=t.price)?void 0:P.currencyCode),is_subscription_box:!!F,list:(null==N||null==(k=N[0])?void 0:k.title)||"membership",...G&&{source:G}})};if((null==g?void 0:g.price)&&(null==(e=g.price)?void 0:e.amount)==="0")return null;if(V)return(0,a.jsxs)("button",{className:A,type:"button",disabled:h,onClick:D,children:[I&&(0,a.jsx)("i",{className:I}),R," ",P&&(0,a.jsxs)("span",{className:"md:hidden",children:["(",P,")"]})]});let O="button button-primary";if((null==t?void 0:t.requiresSellingPlan)&&!x)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:O,type:"button",disabled:!0,children:l.N.WQ}),(0,a.jsx)("p",{className:"mt-2 text-xs",children:"This product requires a subscription to be selected."})]});if(F){if(j&&j.productId===t.id&&j.variantId===g.id)return(0,a.jsxs)("button",{type:"button",className:O,disabled:!0,children:[(0,a.jsx)("i",{className:"mr-1 fa fa-check"})," ",l.q.vh]});if(j)return(0,a.jsxs)("div",{className:"relative flex flex-col justify-end pb-2",children:[(0,a.jsx)("button",{className:O,type:"button",disabled:!0,children:"es-es"===v.vV?"Suscr\xedbete":"Subscribe"}),(0,a.jsx)("p",{className:"absolute inset-x-0 mt-1 text-xs text-center",style:{transform:"translate(0, calc(100% + 4px))"},children:l.q.OL})]});if(q&&q.productId===t.id)return(0,a.jsxs)("button",{className:O,type:"button",disabled:!0,children:[(0,a.jsx)("i",{className:"mr-2 fa fa-check"}),"es-es"===v.vV?"Adicional":"Added"]})}return _?(0,a.jsx)("div",{className:"button button-primary disabled",title:"This product is currently out of stock.",children:l.N.qk}):null}},94444:(n,e,t)=>{t.d(e,{A:()=>l});var a=t(74380),i=t(27022);function l(){let{revalidate:n}=(0,a.Ay)();return async e=>{let{variantId:t,quantity:a,sellingPlanId:l,attributes:r}=e;await (0,i.A)({variantId:t,quantity:a,sellingPlanId:l,attributes:r}),await n()}}}}]);
2//# sourceMappingURL=4868-7c8f212cf8989ef7.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.