PageSourceSearch

https://lmk.today/_next/static/chunks/89117-8a8a7912ce2b36a0.js

js lmk.today collected 2026-09-24 12:08:02 UTC 99,003 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[89117],{50392:(e,t,a)=>{a.d(t,{I5:()=>l,W5:()=>s});let n=new(a(86726)).d,r=["sex","porn","xxx","adult","erotic","nude","naked","sex doll","sex toy","adult toy","lingerie","masturbator","masturbation","vibrator","dildo","pornography","pornographic","explicit","nsfw","fetish","bdsm","kink","orgasm","p0rn","p0rno","s3x","s3xy","xxx","x-rated","adult entertainment","adult content","adult video","onlyfans","only fans","cam girl","webcam","hookup","hook up","one night stand","threesome","orgy","gangbang","milf","cougar","sugar daddy","sugar baby","breast","boob","boobs","butt","ass","asshole","penis","dick","cock","vagina","pussy","clit","nipple","nipples","tits","titties","titty","buttocks","anus","anal","oral","blowjob","cum","sperm","semen","ejaculation","strip","stripper","escort","prostitute","hooker","nudity","naked","bare","topless","bottomless","nude","nudist","naturist","sexy","horny","lust","desire","sex toy","adult toy","pleasure toy","intimate toy","masturbator","masturbation","fleshlight","pocket pussy","vibrator","dildo","butt plug","anal plug","cock ring","penis ring","chastity","bondage","whip","collar","gag","restraint","lubricant","lube","condom","contraceptive","bong","bongs","water pipe","smoking pipe","grinder","rolling papers","vaporizer","dab rig","cannabis","marijuana","weed","hemp","cocaine","heroin","meth","methamphetamine","crack","lsd","mushroom","psychedelic","hallucinogen","mdma","ecstasy","molly","ketamine","opioid","fentanyl","oxy","oxycodone","adderall","xanax","dabs","wax","shatter","thc","cbd","smoke","smoking","joint","blunt","spliff","gun","rifle","pistol","firearm","ammunition","ammo","bullet","holster","tactical","knife","blade","dagger","machete","scope","gun part","AR-15","AK-47","shotgun","revolver","sword","katana","nunchaku","brass knuckles","handgun","revolver","glock","beretta","crossbow","bow","arrow","quiver","bomb","explosive","grenade","firework","pepper spray","mace","taser","stun gun","suicide","self harm","cutting","razor blade","murder","kill","killing","assassination","torture","torture device","breeding","dog breeding","animal breeding","taxidermy","hunting trophy","snuff","gore","extreme violence","poker chip","casino","slot machine","roulette","blackjack","poker","texas holdem","craps","baccarat","lottery","scratch off","betting","sportsbook","hate","racist","nazi","kkk","klan","white supremacy","supremacist","extremist","counterfeit","fake","replica","knockoff","stolen","theft","burglary","illegal","contraband","pyramid scheme","ponzi","scam","fraud","fake id","fake passport","fake driver license"];function l(e){return!!e&&n.isProfane(e.toLowerCase())}function s(e){return e&&Array.isArray(e)?e.filter(e=>!function(e){if(!e)return!1;let t=e.toLowerCase();return!!l(t)||r.some(e=>RegExp("\\b".concat(e,"\\b"),"i").test(t))}(e.query)):[]}},89117:(e,t,a)=>{a.r(t),a.d(t,{default:()=>te});var n=a(95155),r=a(12115),l=a(35695),s=a(21868),i=a(44677),o=a(9697),c=a(59434),d=a(66766);let u=[{name:"Amazon",domain:"amazon.com"},{name:"Target",domain:"target.com"},{name:"Walmart",domain:"walmart.com"},{name:"Nike",domain:"nike.com"},{name:"Best Buy",domain:"bestbuy.com"},{name:"Nordstrom",domain:"nordstrom.com"},{name:"Adidas",domain:"adidas.com"},{name:"Apple",domain:"apple.com"}];function p(){var e;let[t,a]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=setInterval(()=>{a(e=>(e+1)%u.length)},1100);return()=>clearInterval(e)},[]);let l=u[t];return(0,n.jsxs)("div",{className:"pl-7 h-7 flex items-center","aria-live":"polite",children:[(0,n.jsx)("span",{className:"text-[11px] text-slate-400 mr-2",children:"Checking"}),(0,n.jsxs)("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 bg-white rounded-full border border-slate-100 shadow-sm animate-in fade-in slide-in-from-bottom-1 duration-300",children:[(0,n.jsx)(d.default,{src:(e=l.domain,"https://www.google.com/s2/favicons?domain=".concat(e,"&sz=32")),alt:"",width:16,height:16,className:"rounded-sm",unoptimized:!0}),(0,n.jsx)("span",{className:"text-[11px] font-medium text-slate-600",children:l.name})]},l.name)]})}function h(e){let{message:t,showMerchants:a,className:r}=e;
1return(0,n.jsxs)("div",{className:(0,c.cn)("space-y-3 py-2",r),children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-brand animate-[bounce_1.4s_ease-in-out_infinite]"}),(0,n.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-brand animate-[bounce_1.4s_ease-in-out_0.2s_infinite]"}),(0,n.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-brand animate-[bounce_1.4s_ease-in-out_0.4s_infinite]"})]}),(0,n.jsx)("span",{className:"text-sm text-slate-500",children:t})]}),a&&(0,n.jsx)(p,{})]})}function m(e){let{count:t=4,variant:a="grid"}=e;return"carousel"===a?(0,n.jsx)("div",{className:"-mx-4 overflow-hidden",children:(0,n.jsx)("div",{className:"flex gap-2.5 px-4",children:Array.from({length:t}).map((e,t)=>(0,n.jsxs)("div",{className:"shrink-0 w-[160px] sm:w-[176px] bg-white rounded-xl border border-slate-100 overflow-hidden animate-pulse",children:[(0,n.jsx)("div",{className:"aspect-square bg-slate-100"}),(0,n.jsxs)("div",{className:"p-2.5 space-y-2",children:[(0,n.jsx)("div",{className:"h-3 bg-slate-100 rounded w-3/4"}),(0,n.jsx)("div",{className:"h-3 bg-slate-100 rounded w-1/3"})]})]},t))})}):(0,n.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Array.from({length:t}).map((e,t)=>(0,n.jsxs)("div",{className:"bg-white rounded-xl border border-slate-100 overflow-hidden animate-pulse",children:[(0,n.jsx)("div",{className:"aspect-square bg-slate-100"}),(0,n.jsxs)("div",{className:"p-3 space-y-2",children:[(0,n.jsx)("div",{className:"h-3 bg-slate-100 rounded w-3/4"}),(0,n.jsx)("div",{className:"h-4 bg-slate-100 rounded w-1/3"}),(0,n.jsx)("div",{className:"h-3 bg-slate-100 rounded w-1/2"})]})]},t))})}var g=a(62395),f=a(6874),b=a.n(f);function x(e){let{count:t=3,className:a}=e,r=["w-[7.5rem]","w-[9rem]","w-[6.5rem]","w-[8rem]"];return(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap gap-2 mt-3",a),"aria-busy":"true","aria-label":"Loading suggestions",children:Array.from({length:t},(e,t)=>(0,n.jsx)("span",{className:(0,c.cn)("h-8 rounded-full border border-slate-200/80 bg-slate-100/90","animate-pulse shadow-sm",r[t%r.length])},t))})}function v(e){let{suggestions:t,onSelect:a,className:r}=e;return 0===t.length?null:(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap gap-2 mt-3",r),children:t.map(e=>{let t="string"==typeof e?{label:e,type:"action"}:e,r="response"===t.type&&t.context?"".concat(t.context,": ").concat(t.label):t.label,l=(0,c.cn)("px-3 py-1.5 text-sm rounded-full transition-all duration-150 shadow-sm inline-block","action"===t.type?"bg-white border border-slate-200 text-slate-700 hover:border-brand hover:text-brand hover:bg-brand-light":"bg-slate-100 border border-slate-100 text-slate-700 hover:bg-slate-200 hover:border-slate-200");return t.href?/^https?:\/\//i.test(t.href)||t.openInNewTab?(0,n.jsx)("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:l,children:t.label},t.label):(0,n.jsx)(b(),{href:t.href,className:l,children:t.label},t.label):(0,n.jsx)("button",{onClick:()=>a(r,t.label),className:l,children:t.label},t.label)})})}function y(e){let{plain:t}=e,a=(0,n.jsxs)("div",{className:"flex items-center gap-1.5 py-0.5",children:[(0,n.jsx)("span",{className:"h-2 w-2 rounded-full bg-slate-400 animate-[bounce_1.4s_ease-in-out_infinite]"}),(0,n.jsx)("span",{className:"h-2 w-2 rounded-full bg-slate-400 animate-[bounce_1.4s_ease-in-out_0.2s_infinite]"}),(0,n.jsx)("span",{className:"h-2 w-2 rounded-full bg-slate-400 animate-[bounce_1.4s_ease-in-out_0.4s_infinite]"})]});return t?a:(0,n.jsx)("div",{className:"flex justify-start",children:(0,n.jsx)("div",{className:"bg-slate-100 rounded-2xl rounded-bl-sm px-4 py-3",children:a})})}var w=a(965),k=a(73158);function j(e){let{badge:t,product:a}=e,r=a.on_sale&&!!a.sale_discount;return!t||r?null:t.isNearLowest?(0,n.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide bg-emerald-500 text-white rounded-full shadow-sm",children:"Low price"}):t.wishlistCount&&t.wishlistCount>=5?(0,n.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide bg-rose-500 text-white rounded-full shadow-sm",children:"Popular"}):null}function N(e){let{products:t,onProductClick:a,searchQuery:l,productIntelligence:s}=e,i=(0,r.useRef)(null),[o,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>{d(e.scrollLeft>4),p(e.scrollLeft+e.clientWidth<e.scrollWidth-4)};t(),e.addEventListener("scroll",t,{passive:!0});let a=new ResizeObserver(t);return a.observe(e),()=>{e.removeEventListener("scroll",t),a.disconnect()}},[t.length]);let h=e=>{let t=i.current;if(!t)return;let a=Math.max(180,.85*t.clientWidth);t.scrollBy({left:"left"===e?-a:a,behavior:"smooth"})};return(0,n.jsxs)("div",{className:"relative -mx-4",children:[(0,n.jsx)("div",{ref:i,className:"flex gap-2.5 overflow-x-auto snap-x snap-mandatory scroll-smooth pb-1 px-4 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",children:t.map((e,t)=>{var r;return(0,n.jsxs)("div",{className:"snap-start shrink-0 w-[160px] sm:w-[176px] relative",style:{animationDelay:"".concat(30*t,"ms"),animation:"fadeIn 0.35s ease forwards",opacity:0}
1,children:[(0,n.jsx)(j,{badge:null==s?void 0:s[e.id],product:e}),(0,n.jsx)(g.ProductCard,{id:e.id,title:e.title,price:e.price,original_price:e.original_price,image_urls:e.image_urls,rating:e.rating,review_count:e.review_count,brand:e.brand,merchant:e.merchant||(null===(r=e.metadata)||void 0===r?void 0:r.merchant_name),affiliate_url:e.affiliate_url,direct_url:e.direct_url,slug:e.slug,on_sale:e.on_sale,sale_discount:e.sale_discount,external_id:e.external_id,integration_type:e.integration_type,category:e.category,metadata:e.metadata,buyingOptions:e.buyingOptions,disableWishlistChecks:!0,className:"[&_.aspect-square]:p-2 [&>div:last-child]:!p-2.5 [&_h3]:!text-[12px] [&_span.text-lg]:!text-sm",searchContext:l?{query:l,position:t+1}:void 0,openLinksInNewTab:!0,multiStoreSummaryOnly:!0,onCardClick:a})]},"".concat(e.id,"-").concat(t))})}),(0,n.jsx)("button",{type:"button",onClick:()=>h("left"),"aria-label":"Scroll left",className:(0,c.cn)("flex absolute left-1 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-white/95 shadow-md border border-slate-200 items-center justify-center text-slate-600 hover:text-brand hover:border-brand transition-all z-10 touch-manipulation",o?"opacity-100":"opacity-0 pointer-events-none"),children:(0,n.jsx)(w.A,{className:"w-5 h-5"})}),(0,n.jsx)("button",{type:"button",onClick:()=>h("right"),"aria-label":"Scroll right",className:(0,c.cn)("flex absolute right-1 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-white/95 shadow-md border border-slate-200 items-center justify-center text-slate-600 hover:text-brand hover:border-brand transition-all z-10 touch-manipulation",u?"opacity-100":"opacity-0 pointer-events-none"),children:(0,n.jsx)(k.A,{className:"w-5 h-5"})})]})}var _=a(90792);function S(e){let{badge:t,product:a}=e;return t?t.isNearLowest?(0,n.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide bg-emerald-500 text-white rounded-full shadow-sm",children:"Low price"}):t.wishlistCount&&t.wishlistCount>=5?(0,n.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide bg-rose-500 text-white rounded-full shadow-sm",children:"Popular"}):a.on_sale&&a.sale_discount&&a.sale_discount>=20?(0,n.jsxs)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide bg-amber-500 text-white rounded-full shadow-sm",children:[a.sale_discount,"% off"]}):null:null}function C(e){let{thinkingStage:t,isLoading:a,products:l,isComplete:s,suggestedFollowups:i,onFollowup:o,textContent:d,isStreaming:u,className:p,searchQuery:f,productIntelligence:b,assistantTintUsesPartnerTheme:w=!1,onBoldPhraseSuggest:k,chipsPending:j=!1,showSearchingMerchantTags:C=!0,useCarousel:I=!1,onProductClick:A}=e,T=l&&l.length>0,P=a&&(null==t?void 0:t.stage)==="searching",L=void 0!==a&&!d,[O,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{E(!1)},[null==l?void 0:l.length]);let R=!!l&&l.length>4&&!O,B=R?l.slice(0,3):l;return(0,n.jsxs)("div",{className:(0,c.cn)("space-y-4",p),children:[a&&(0,n.jsx)(h,{message:(null==t?void 0:t.message)||"Understanding what you're looking for...",showMerchants:P&&C}),a&&(I&&A?(0,n.jsx)(m,{count:3,variant:"carousel"}):(0,n.jsx)(m,{count:4})),(d||u&&!d)&&(0,n.jsx)("div",{className:"flex justify-start w-full min-w-0",children:(0,n.jsxs)("div",{className:"assistant-chat-bubble w-full min-w-0 rounded-2xl rounded-bl-md border border-solid px-2.5 py-2 sm:px-3 sm:py-2.5 shadow-sm",style:w?void 0:{backgroundColor:"color-mix(in srgb, #FF9900 10%, white)",borderColor:"color-mix(in srgb, #FF9900 22%, white)"},children:[u&&!d&&(0,n.jsx)(y,{plain:!0}),d&&(0,n.jsxs)("div",{className:"text-sm text-slate-800 leading-relaxed",children:[(0,n.jsx)(_.oz,{components:{p:e=>{let{children:t}=e;return(0,n.jsx)("p",{className:"mb-2 last:mb-0",children:t})},strong:e=>{let{children:t}=e,a=(function e(t){return null==t||!1===t?"":"string"==typeof t||"number"==typeof t?String(t):Array.isArray(t)?t.map(e).join(""):(0,r.isValidElement)(t)?e(t.props.children):""})(t).trim();return k&&a.length>=2&&!/^\d{1,3}(,\d{3})*(\.\d+)?$/.test(a)&&!/^\d+(\.\d+)?$/.test(a)?(0,n.jsx)("button",{type:"button",className:"inline align-baseline p-0 mx-0 font-semibold text-brand bg-transparent border-0 cursor-pointer underline decoration-brand/40 underline-offset-[3px] rounded px-0.5 -mx-0.5 hover:bg-brand/15 focu
1s:outline-none focus-visible:ring-2 focus-visible:ring-brand/35 touch-manipulation",onClick:()=>k(a),title:"Send this as your message","aria-label":"Send message: ".concat(a),children:t}):(0,n.jsx)("strong",{className:"font-semibold text-slate-900",children:t})},ul:e=>{let{children:t}=e;return(0,n.jsx)("ul",{className:"list-disc list-inside mb-2 space-y-1",children:t})},ol:e=>{let{children:t}=e;return(0,n.jsx)("ol",{className:"list-decimal list-inside mb-2 space-y-1",children:t})},li:e=>{let{children:t}=e;return(0,n.jsx)("li",{children:t})},a:e=>{let{href:t,children:a}=e;return(0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline font-medium",children:a})}},children:d.split("\n").filter(e=>!e.startsWith(">> ")).join("\n").trim().replace(/\[([^\]\n]+)\](?!\()/g,"$1")}),u&&!j&&(0,n.jsx)("span",{className:"inline-block w-1.5 h-4 bg-brand animate-pulse ml-0.5 align-text-bottom rounded-sm"})]})]})}),T&&s&&I&&A&&(0,n.jsxs)("div",{className:"space-y-2",children:[L&&(0,n.jsxs)("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wider",children:[l.length," ",1===l.length?"result":"results"]}),(0,n.jsx)(N,{products:l,onProductClick:A,searchQuery:f,productIntelligence:b})]}),T&&s&&!(I&&A)&&(0,n.jsxs)("div",{className:"space-y-3",children:[L&&(0,n.jsxs)("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wider",children:[l.length," ",1===l.length?"result":"results"]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[B.map((e,t)=>{var a;return(0,n.jsxs)("div",{className:"relative min-w-0",style:{animationDelay:"".concat(40*t,"ms"),animation:"fadeIn 0.35s ease forwards",opacity:0}
1,children:[(0,n.jsx)(S,{badge:null==b?void 0:b[e.id],product:e}),(0,n.jsx)(g.ProductCard,{id:e.id,title:e.title,price:e.price,original_price:e.original_price,image_urls:e.image_urls,rating:e.rating,review_count:e.review_count,brand:e.brand,merchant:e.merchant||(null===(a=e.metadata)||void 0===a?void 0:a.merchant_name),affiliate_url:e.affiliate_url,direct_url:e.direct_url,slug:e.slug,on_sale:e.on_sale,sale_discount:e.sale_discount,external_id:e.external_id,integration_type:e.integration_type,category:e.category,metadata:e.metadata,buyingOptions:e.buyingOptions,disableWishlistChecks:!0,className:"[&_.aspect-square]:p-1.5 [&>div:last-child]:!p-2 [&_h3]:!text-[11px] [&_span.text-lg]:!text-sm",searchContext:f?{query:f,position:t+1}:void 0,openLinksInNewTab:!0,multiStoreSummaryOnly:!0})]},"".concat(e.id,"-").concat(t))}),R&&(0,n.jsx)("div",{className:"min-w-0 flex",children:(0,n.jsxs)("button",{type:"button",onClick:()=>E(!0),className:"w-full flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-slate-200 bg-slate-50/80 px-2 py-3 min-h-[140px] hover:border-brand hover:bg-brand/5 transition-colors text-center touch-manipulation",children:[(0,n.jsxs)("span",{className:"text-sm font-semibold text-brand leading-tight",children:["View ",l.length-3," more"]}),(0,n.jsx)("span",{className:"text-[10px] text-slate-500 mt-1",children:"Show all in this chat"})]})})]}),l.length>4&&O&&(0,n.jsx)("button",{type:"button",onClick:()=>E(!1),className:"text-xs font-medium text-brand hover:underline touch-manipulation pt-1",children:"Show less"})]}),T&&s&&L&&(0,n.jsx)("p",{className:"text-xs text-slate-400",children:"Tap any product to see buying options and add to a wishlist"}),i&&i.length>0&&s&&o&&(0,n.jsx)(v,{suggestions:i,onSelect:o}),j&&!(i&&i.length>0)&&s&&(0,n.jsx)(x,{count:3})]})}var I=a(47650),A=a(54165),T=a(30285),P=a(10518),L=a(50172),O=a(61840),E=a(19968),R=a(68098),B=a(7390),z=a(25318),D=a(16962),U=a(60268),W=a(5445),M=a(82549),q=a(62003),F=a(82158),H=a(79992),K=a(94251),G=a(56539),$=a(30440),J=a(20782),Y=a(25601);let Q="outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:ring-offset-0";function Z(e){var t,a,l,s,i;let{isOpen:o,onClose:d,product:u,searchContext:p,initialAlternatives:h,partnerThemeAttr:m,presentation:g="flyout"}=e,f="contained"===g,[b,x]=(0,r.useState)(0),[v,y]=(0,r.useState)([]),[j,N]=(0,r.useState)(null),[_,S]=(0,r.useState)(!1),[C,z]=(0,r.useState)(!1),[M,Z]=(0,r.useState)(!1),[X,ee]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),en=(0,r.useRef)(null),er=(0,r.useRef)(null),el=(0,r.useRef)(null),{trackOutboundClick:es}=(0,G.J)(),ei=(null==u?void 0:null===(t=u.image_urls)||void 0===t?void 0:t.filter(Boolean))||[],eo=(null==u?void 0:u.currency_code)||"USD",ec=u?(0,F.MJ)({affiliate_url:u.affiliate_url,direct_url:u.direct_url,metadata:u.metadata,integration_type:u.integration_type,merchant_id:u.merchant_id,brand:u.brand}):"",ed=(null==u?void 0:u.rating)!=null&&Number(u.rating)>0?Number(u.rating):null,eu=(null==u?void 0:u.review_count)!=null&&Number(u.review_count)>0?Number(u.review_count):null,ep=(0,r.useCallback)(()=>{var e;if(!u)return!1;let t=(null===(e=u.metadata)||void 0===e?void 0:e.source_integration)||"",a="80239aea-1182-4daa-947a-2a09d880ffab"===u.merchant_id;return"pa_api"===t||"rainforest"===t||a},[u]),eh=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t||eo}).format(e),em=!!u&&null!=u.original_price&&u.original_price>u.price,eg=!!(null==u?void 0:u.on_sale)&&(null==u?void 0:u.sale_discount)!=null&&Number(u.sale_discount)>0,ef=em||eg,eb=!!u&&ep()&&u.price>0&&(ef||!0===u.on_sale);(0,r.useEffect)(()=>{o&&(x(0),y([]),N(null),z(!1),S(!!(null==u?void 0:u.slug)),Z(!1),ea(!1))},[o,null==u?void 0:u.id,null==u?void 0:u.slug]);let ex=(0,r.useCallback)(async()=>{if((null==u?void 0:u.slug)&&!C){S(!0);try{let t=await fetch("/api/products/".concat(u.slug,"/buying-options"));if(t.ok){let a=await t.json();if(a.success){var e;(null===(e=a.options)||void 0===e?void 0:e.length)>0&&y(a.options),a.productUrl&&"string"==typeof a.productUrl&&N(a.productUrl)}}}catch(e){}finally{S(!1),z(!0)}}},[null==u?void 0:u.slug,C]);(0,r.useEffect)(()=>{o&&!C&&ex()},[o,C,ex]);let ev=u&&(u.affiliate_url||u.direct_url||j||(0,F.QZ)(u))||null,ey=(0,r.useMemo)(()=>u?(h||[]).map((e,t)=>({id:"alt-".concat(t,"-").concat(e.merchantName),merchantName:e.merchantName,merchantId:parseInt(e.merchantId||"0"),price:e.price,currency:eo,url:e.directUrl||(0,q.LA)(e.affiliateUrl),wrappedUrl:e.affiliateUrl,availability:e.availability||"InStock",provider:e.integrationType})):[],[h,eo,u]),ew=(0,r.useMemo)(()=>{let e=u&&ev?{id:"primary-".concat(u.id),merchantName:ec||"Store",merchantId:0,price:u.price||0,currency:eo,url:(0,q.LA)(ev),wrappedUrl:(0,Y.sp)(ev,u.id,ec||void 0,u.affiliate_url||void 0),availability:"InStock",provider:"primary"}:null;return(0,Y.Xi)(v,ey,e)},[v,ey,u,ev,ec,eo]),ek=Math.max(0,ew.length-4),ej=et||ew.length<=4?ew:ew.slice(0,4),eN=ew.filter(e=>e.price>0).length>1?Math.min(...ew.filter(e=>e.price>0).map(e=>e.price)):null,e_=e=>{var t,a;if(!u)return;let n=(0,Y.BL)(e,u.id,e.merchantName);n&&((0,$.c)($.l.BOT_PRODUCT_CLICK_OUT,{product_id:u.id,merchant_name:e.merchantName,merchant_id:e.merchantId||null,price:e.price||null,provider:e.provider||null,search_query:(null==p?void 0:p.query
1)||null,position:null!==(t=null==p?void 0:p.position)&&void 0!==t?t:null},{partner:null!==(a=null==m?void 0:m["data-partner-theme"])&&void 0!==a?a:null}),(0,K.BY)()?window.location.href=n:window.open(n,"_blank","noopener,noreferrer"),es(u).catch(()=>{}),(null==p?void 0:p.query)&&fetch("/api/search/track-click",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({searchQuery:p.query,searchQueryId:p.queryId,productId:u.id,position:p.position,clickType:"merchant_click"})}).catch(()=>{}))},eS=u?function(e){let t=window.location.origin;return e.slug?"".concat(t,"/product/").concat(e.slug):t}(u):"";(0,r.useEffect)(()=>{if(!M)return;let e=e=>{er.current&&!er.current.contains(e.target)&&en.current&&!en.current.contains(e.target)&&Z(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[M]);let eC=async()=>{if(u){if(u.slug){window.open("/product/".concat(u.slug),"_blank","noopener,noreferrer");return}if(u.title){ee(!0);try{let t=await fetch("/api/products/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({external_id:u.external_id||u.id,integration_type:u.integration_type||"affiliate.com",title:u.title,description:u.description,price:u.price,original_price:u.original_price,currency_code:u.currency_code||"USD",image_urls:u.image_urls,rating:u.rating,review_count:u.review_count,brand:u.brand,merchant:u.merchant,affiliate_url:u.affiliate_url,direct_url:u.direct_url,on_sale:u.on_sale,sale_discount:u.sale_discount,category:u.category,metadata:u.metadata})});if(t.ok){var e;let a=await t.json(),n=a.slug||(null===(e=a.product)||void 0===e?void 0:e.slug);if(n){window.open("/product/".concat(n),"_blank","noopener,noreferrer");return}}(u.direct_url||u.affiliate_url)&&window.open(u.direct_url||u.affiliate_url,"_blank","noopener,noreferrer")}catch(e){(u.direct_url||u.affiliate_url)&&window.open(u.direct_url||u.affiliate_url,"_blank","noopener,noreferrer")}finally{ee(!1)}}}},eI=null!==(i=null!==(s=null!==eN?ew.find(e=>e.price===eN&&e.price>0):void 0)&&void 0!==s?s:ew[0])&&void 0!==i?i:null;if(!u)return null;let eA=(null==eI?void 0:eI.merchantName)&&"Store"!==eI.merchantName?eI.merchantName:ec||null,eT=(null==eI?void 0:eI.price)&&eI.price>0?eI.price:u.price>0?u.price:0,eP=eT>0?eh(eT,null==eI?void 0:eI.currency):null,eL=function(e){var t,a,n,r,l;for(let s of[e.description,null===(a=e.metadata)||void 0===a?void 0:null===(t=a.product_details)||void 0===t?void 0:t.normalized_description,null===(r=e.metadata)||void 0===r?void 0:null===(n=r.product_details)||void 0===n?void 0:n.overview,null===(l=e.metadata)||void 0===l?void 0:l.description])if("string"==typeof s&&s.trim().length>4)return s.trim();return null}(u),eO=function(e){var t,a,n;let r=(null===(t=e.metadata)||void 0===t?void 0:t.category_full_path)||(null===(a=e.metadata)||void 0===a?void 0:a.category_name)||e.category||(null===(n=e.metadata)||void 0===n?void 0:n.category);return"string"==typeof r&&r.trim().length>0?r.trim():null}(u),eE=function(e){var t,a,n;let r=null===(a=e.metadata)||void 0===a?void 0:null===(t=a.product_details)||void 0===t?void 0:t.features;if(Array.isArray(r)&&r.length>0)return r.filter(e=>"string"==typeof e&&e.trim().length>0).slice(0,8);let l=null===(n=e.metadata)||void 0===n?void 0:n.features;return Array.isArray(l)&&l.length>0?l.filter(e=>"string"==typeof e&&e.trim().length>0).slice(0,8):[]}(u),eR=function(e){var t;let a=(null===(t=e.metadata)||void 0===t?void 0:t.availability)||void 0;if(!a)return null;let n=a.toLowerCase();return n.includes("out")?"Out of stock":n.includes("preorder")||n.includes("pre-order")?"Pre-order":n.includes("limited")?"Limited stock":n.includes("in")||n.includes("available")||"instock"===n?"In Stock":null}(u);return(0,n.jsxs)(A.lG,{open:o,onOpenChange:e=>!e&&d(),children:[(0,n.jsxs)(A.Cf,{overlayClassName:f?"z-[11002]":void 0,className:(0,c.cn)("p-0 gap-0 overflow-hidden",f?(0,c.cn)("z-[11003] max-w-[850px] w-[95vw] md:w-full max-h-[90vh] md:max-h-[85vh] flex flex-col","rounded-2xl border border-slate-200 shadow-2xl"):(0,c.cn)("fixed top-0 right-0 left-auto bottom-0 z-[11001] w-[92vw] sm:w-[440px] md:w-[480px] max-w-none h-full max-h-none","translate-x-0 translate-y-0 rounded-none border-0 border-l border-l-slate-200 shadow-2xl","data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right","data-[state=open]:zoom-in-100 data-[state=closed]:zoom-out-100","data-[state=open]:slide-in-from-top-0 data-[state=closed]:slide-out-to-top-0")),"aria-describedby":void 0,...m||{},children:[(0,n.jsx)(A.L3,{className:"sr-only",children:u.title}
1),(0,n.jsxs)("div",{className:(0,c.cn)("flex flex-col min-h-0",f?"max-h-[90vh] md:max-h-[85vh]":"h-full"),children:[(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto overscroll-contain",children:[(0,n.jsxs)("div",{className:"relative bg-white border-b border-slate-100",children:[(0,n.jsxs)("div",{className:"relative w-full max-md:h-[min(34vh,260px)] md:aspect-square",children:[ei.length>0?(0,n.jsx)(D.SafeImage,{src:ei[b],alt:u.title,fill:!0,className:"object-contain p-3 md:p-6",sizes:"(max-width: 768px) 92vw, 480px"}):(0,n.jsx)(U.z,{title:u.title}),eg&&(0,n.jsxs)("div",{className:"absolute top-3 left-3 z-20 bg-red-500 text-white text-xs font-bold px-2 py-1 rounded-full shadow-sm",children:[Math.floor(Number(u.sale_discount)),"% OFF"]}),ei.length>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>x(e=>0===e?ei.length-1:e-1),className:"absolute left-3 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-white/95 shadow-md flex items-center justify-center hover:bg-white transition-colors","aria-label":"Previous image",children:(0,n.jsx)(w.A,{className:"w-4 h-4"})}),(0,n.jsx)("button",{onClick:()=>x(e=>e===ei.length-1?0:e+1),className:"absolute right-3 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-white/95 shadow-md flex items-center justify-center hover:bg-white transition-colors","aria-label":"Next image",children:(0,n.jsx)(k.A,{className:"w-4 h-4"})})]})]}),ei.length>1&&(0,n.jsx)("div",{className:"flex justify-center gap-1.5 px-4 pb-2 pt-1",children:ei.map((e,t)=>(0,n.jsx)("button",{onClick:()=>x(t),className:(0,c.cn)("w-2 h-2 rounded-full transition-colors",t===b?"bg-gray-800":"bg-gray-300"),"aria-label":"Image ".concat(t+1)},t))})]}),(0,n.jsxs)("div",{className:"p-3.5 md:p-5 space-y-2.5 md:space-y-4",children:[u.brand&&(0,n.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-widest text-slate-500",children:u.brand}),(0,n.jsx)("h2",{className:"text-sm md:text-lg font-bold text-gray-900 leading-snug line-clamp-2",children:u.title}),ef&&!ep()&&u.price>0&&(0,n.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,n.jsx)("span",{className:"text-xl md:text-2xl font-bold text-gray-900",children:eh(u.price)}),em&&(0,n.jsx)("span",{className:"text-sm md:text-base text-gray-500 line-through",children:eh(u.original_price)}),eg&&(0,n.jsxs)("span",{className:"text-xs md:text-sm font-semibold text-red-600",children:[Math.floor(Number(u.sale_discount)),"% off"]})]}),!ef&&!ep()&&u.price>0&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:"text-xl md:text-2xl font-bold text-gray-900",children:eh(u.price)})}),eb&&(0,n.jsx)("div",{children:(0,n.jsx)(H.Y,{price:u.price,originalPrice:u.original_price||void 0,lastSync:(null===(a=u.metadata)||void 0===a?void 0:a.last_sync)||new Date().toISOString(),currencyCode:eo})}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[eR&&(0,n.jsxs)("span",{className:(0,c.cn)("inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1 rounded-full border","In Stock"===eR?"text-emerald-700 bg-emerald-50 border-emerald-200":"Out of stock"===eR?"text-red-700 bg-red-50 border-red-200":"text-amber-700 bg-amber-50 border-amber-200"),children:["In Stock"===eR&&(0,n.jsx)(P.A,{className:"w-3 h-3"}),eR]}),ed&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-slate-700",children:[(0,n.jsx)("span",{className:"text-yellow-400 text-sm",children:"★"}),ed.toFixed(1),eu&&(0,n.jsxs)("span",{className:"text-slate-500",children:["(",eu.toLocaleString(),")"]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-gray-700 uppercase tracking-widest mb-2",children:"Buying Options"}),(0,n.jsxs)("div",{className:"rounded-xl border border-gray-200 overflow-hidden divide-y divide-gray-100 bg-white",children:[(_||!!u.slug&&!C)&&0===ew.length&&!ev&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-6 text-gray-400",children:[(0,n.jsx)(L.A,{className:"w-4 h-4 animate-spin mr-2"}),(0,n.jsx)("span",{className:"text-sm",children:"Finding best prices..."})]}),ej.map(e=>{let t=null!==eN&&e.price===eN&&e.price>0;return(0,n.jsxs)("button",{type:"button",onClick:()=>
1e_(e),className:(0,c.cn)(Q,"w-full flex items-center gap-3 px-3.5 py-3 text-left transition-colors group",t?"bg-green-50/70 hover:bg-green-50 border-l-[3px] border-l-green-500":"hover:bg-gray-50 border-l-[3px] border-l-transparent"),children:[(0,n.jsx)(W.MerchantLogo,{imageUrl:(0,Y.K6)(e.logo,e.merchantName),name:e.merchantName,size:"sm",border:!0,className:"flex-shrink-0"}),(0,n.jsx)("span",{className:"flex-1 text-sm font-medium text-gray-800 truncate",children:e.merchantName}),t&&(0,n.jsx)("span",{className:"text-[10px] font-bold text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full uppercase tracking-wide flex-shrink-0",children:"Best"}),(0,n.jsx)("span",{className:"text-sm font-bold text-gray-900 flex-shrink-0",children:e.price>0?eh(e.price,e.currency):"See Price"}),(0,n.jsx)(O.A,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-gray-500 flex-shrink-0 transition-colors"})]},e.id)}),!et&&ek>0&&(0,n.jsxs)("button",{type:"button",onClick:()=>ea(!0),className:(0,c.cn)(Q,"w-full px-4 py-2.5 text-sm font-medium text-brand hover:bg-gray-50 text-center border-t border-gray-100"),children:["Show more (",ek," more ",1===ek?"store":"stores",")"]}),!_&&0===ew.length&&ev&&(0,n.jsxs)("button",{type:"button",onClick:()=>e_({id:"fallback-".concat(u.id),merchantName:ec||"Store",merchantId:0,price:u.price||0,currency:eo,url:(0,q.LA)(ev),wrappedUrl:(0,Y.sp)(ev,u.id,ec||void 0,u.affiliate_url||void 0),availability:"InStock",provider:"primary"}),className:(0,c.cn)(Q,"w-full flex items-center gap-3 px-3.5 py-3 text-left hover:bg-gray-50 group"),children:[(0,n.jsx)(W.MerchantLogo,{imageUrl:(0,Y.K6)(void 0,ec||"Store"),name:ec||"Store",size:"sm",border:!0,className:"flex-shrink-0"}),(0,n.jsx)("span",{className:"flex-1 text-sm font-medium text-gray-800 truncate",children:ec||"Store"}),(0,n.jsx)("span",{className:"text-sm font-bold text-gray-900 flex-shrink-0",children:u.price>0?eh(u.price):"See Price"}),(0,n.jsx)(O.A,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-gray-500 flex-shrink-0 transition-colors"})]}),!_&&C&&0===ew.length&&!ev&&(0,n.jsxs)("button",{type:"button",onClick:eC,disabled:X,className:(0,c.cn)(Q,"w-full flex items-center gap-3 px-3.5 py-3 text-left hover:bg-gray-50 group disabled:opacity-60"),children:[(0,n.jsx)(W.MerchantLogo,{imageUrl:(0,Y.K6)(void 0,ec||"Store"),name:ec||"Store",size:"sm",border:!0,className:"flex-shrink-0"}),(0,n.jsx)("span",{className:"flex-1 text-sm font-medium text-gray-800 truncate",children:ec||"See where to buy"}),(0,n.jsx)("span",{className:"text-sm font-bold text-gray-900 flex-shrink-0",children:u.price>0?eh(u.price):"See Price"}),X?(0,n.jsx)(L.A,{className:"w-3.5 h-3.5 text-gray-400 animate-spin flex-shrink-0"}):(0,n.jsx)(E.A,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-gray-500 flex-shrink-0 transition-colors"})]})]})]}),eL&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-gray-700 uppercase tracking-widest mb-1.5",children:"Description"}),(0,n.jsx)("p",{className:"text-sm text-slate-700 leading-relaxed whitespace-pre-line",children:eL})]}),eO&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-gray-700 uppercase tracking-widest mb-1.5",children:"Categories"}),(0,n.jsx)("span",{className:"inline-block text-xs text-slate-700 bg-slate-100 rounded-full px-2.5 py-1",children:eO})]}),eE.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-gray-700 uppercase tracking-widest mb-1.5",children:"Key Features"}),(0,n.jsx)("ul",{className:"space-y-1.5",children:eE.map((e,t)=>(0,n.jsxs)("li",{className:"text-sm text-slate-700 leading-snug flex gap-2",children:[(0,n.jsx)("span",{className:"text-brand mt-1 leading-none",children:"•"}),(0,n.jsx)("span",{children:e})]},t))})]}),(0,n.jsx)("div",{className:"h-2"})]})]}),(0,n.jsxs)("div",{className:"border-t border-gray-200 bg-white p-3 flex flex-col gap-2 flex-shrink-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(T.$,{onClick:()=>{if(eI){e_(eI);return}eC()},disabled:X,className:"flex-1 min-w-0 bg-brand hover:bg-brand-hover text-white font-semibold h-11 rounded-xl",children:X?(0,n.jsx)(L.A,{className:"w-4 h-4 animate-spin"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.A,{className:"w-4 h-4 mr-1.5 flex-shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:eA?"Buy at ".concat(eA):"Buy now"}),eP&&(0,n.jsxs)("span",{className:"ml-1.5 font-bold flex-shrink-0",children:["\xb7 ",eP]})]})}),(0,n.jsx)(T.$,{variant:"outline",onClick:()=>{var e;null===(e=el.current)||void 0===e||e.openModal()},"aria-label":"Save to a wishlist",title:"Save to a wishlist",className:"h-11 w-11 p-0 rounded-xl border-gray-300 flex-shrink-0",children:(0,n.jsx)(R.A,{className:"w-4 h-4"})})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsxs)("button",{ref:en,type:"button",onClick:()=>
1Z(!M),className:(0,c.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border transition-colors",M?"border-brand text-brand bg-brand/5":"border-gray-200 text-gray-500 hover:text-gray-800 hover:border-gray-300"),children:[(0,n.jsx)(B.A,{className:"w-3.5 h-3.5"}),"Share"]}),(0,n.jsxs)("button",{type:"button",onClick:eC,disabled:X,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border border-gray-200 text-gray-500 hover:text-gray-800 hover:border-gray-300 transition-colors disabled:opacity-60",children:[X?(0,n.jsx)(L.A,{className:"w-3.5 h-3.5 animate-spin"}):(0,n.jsx)(E.A,{className:"w-3.5 h-3.5"}),"More details"]})]}),(0,n.jsx)("button",{type:"button",onClick:d,className:"text-xs text-slate-400 hover:text-slate-600 px-2 py-1.5",children:"Close"})]})]})]}),(0,n.jsx)("div",{className:"hidden",children:(0,n.jsx)(J.A,{ref:el,productId:u.id,compact:!0,hideCount:!0,title:u.title,description:u.description,price:u.price,original_price:u.original_price,currency_code:u.currency_code||"USD",image_urls:u.image_urls||void 0,rating:ed,category:u.category,affiliate_url:u.affiliate_url,integration_type:u.integration_type,external_id:u.external_id,brand:u.brand||(null===(l=u.metadata)||void 0===l?void 0:l.brand),on_sale:u.on_sale,sale_discount:u.sale_discount,review_count:eu,slug:u.slug,merchant_id:u.merchant_id,merchant:u.merchant,direct_url:u.direct_url,metadata:u.metadata})})]}),M&&"undefined"!=typeof document&&(0,I.createPortal)((0,n.jsx)("div",{className:(0,c.cn)("fixed inset-0",f?"z-[11004]":"z-[11002]"),onClick:()=>Z(!1),children:(0,n.jsx)(V,{ref:er,anchorRef:en,title:u.title,imageUrl:ei[0],url:eS,onClose:()=>Z(!1)})}),document.body)]})}let V=(0,r.forwardRef)(function(e,t){let{anchorRef:a,title:l,imageUrl:s,url:i,onClose:o}=e,[c,d]=(0,r.useState)(null);return((0,r.useEffect)(()=>{if(!a.current)return;let e=a.current.getBoundingClientRect();d({top:e.top-8,left:Math.max(8,Math.min(e.left,window.innerWidth-280-8))});let t=()=>{if(!a.current)return;let e=a.current.getBoundingClientRect();d({top:e.top-8,left:Math.max(8,Math.min(e.left,window.innerWidth-280-8))})};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[a]),c)?(0,n.jsx)("div",{ref:t,onClick:e=>e.stopPropagation(),className:"fixed animate-in fade-in slide-in-from-bottom-2 duration-200 z-[11003]",style:{bottom:"".concat(window.innerHeight-c.top,"px"),left:"".concat(c.left,"px")},children:(0,n.jsxs)("div",{className:"bg-white rounded-xl shadow-xl border border-gray-200 p-4 w-[280px]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-gray-800",children:"Share this product"}),(0,n.jsx)("button",{onClick:o,className:"w-6 h-6 flex items-center justify-center rounded-full hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition-colors",children:(0,n.jsx)(z.A,{className:"w-3.5 h-3.5"})})]}),(0,n.jsx)(M.R,{title:l,imageUrl:s,url:i,showQRCode:!1})]})}):null}),X=[/\bwhat (should|do|would) i (pack|wear|bring|need|get)\b/i,/\b(help me )?(pack|packing)\b/i,/\bwhat to (wear|pack|bring)\b/i,/\b(outfit|attire|dress code|what to wear)\b/i,/\b(going|travel(l)?ing|trip|vacation|getaway|honeymoon|road trip)\s+(to|on|for|this|next)\b/i,/\b(weekend|week|trip)\s+in\b/i,/\bgetting ready for\b/i],ee=/\b(new )?(clothes|clothing|outfit|outfits|wardrobe|attire|something to wear)\b/i,et=/\b(trip|vacation|getaway|travel(l)?ing|honeymoon|cruise|holiday|abroad|wedding|interview|party|festival|funeral|date night|reunion|conference|to [A-Z][a-z]+|in [A-Z][a-z]+)\b/i,ea=[{key:"wedding",re:/\bwedding\b/i},{key:"interview",re:/\b(job )?interview\b/i},{key:"beach",re:/\bbeach\b/i},{key:"hiking",re:/\b(hike|hiking|trail)\b/i},{key:"camping",re:/\bcamp(ing)?\b/i},{key:"ski",re:/\bski(ing)?|snowboard\b/i},{key:"festival",re:/\bfestival|concert\b/i},{key:"party",re:/\bparty|birthday\b/i},{key:"gym",re:/\bgym|workout|fitness\b/i}],en=/\b(beach|island|coast|cape|keys|hamptons|miami|hawaii|maui|cancun|maldives|bahamas|malibu|long island|jersey shore|outer banks)\b/i,er=/\b(ski|as
1pen|tahoe|alps|alaska|whistler|vail|reykjavik|iceland)\b/i;function el(e){return e<=1||11===e?"winter":e<=4?"spring":e<=7?"summer":"fall"}let es={winter:"usually cold — layers and a warm jacket are smart",spring:"usually mild and a bit unpredictable — pack layers",summer:"usually warm — light, breathable pieces work best",fall:"usually cool and crisp — a light jacket helps"},ei=[{key:"beach",label:"Beach / Pool"},{key:"casual",label:"Sightseeing"},{key:"dining",label:"Dining out"},{key:"nightlife",label:"Nightlife"},{key:"outdoors",label:"Hiking / Outdoors"},{key:"workout",label:"Workout"}],eo={beach:[{label:"Swimwear",term:"swimsuit",gendered:!0,dept:"apparel"},{label:"Sandals",term:"sandals",gendered:!0,dept:"shoes"},{label:"Beach essentials",term:"beach towel",gendered:!1}],casual:[{label:"Tops",term:"t-shirt",gendered:!0,dept:"apparel"},{label:"Bottoms",term:"chino pants",gendered:!0,dept:"apparel"},{label:"Sneakers",term:"sneakers",gendered:!0,dept:"shoes"}],dining:[{label:"Dress shirts",term:"button down shirt",gendered:!0,dept:"apparel"},{label:"Dress shoes",term:"dress shoes",gendered:!0,dept:"shoes"}],nightlife:[{label:"Going-out tops",term:"going out top",gendered:!0,dept:"apparel"},{label:"Jackets",term:"blazer jacket",gendered:!0,dept:"apparel"}],outdoors:[{label:"Trail shoes",term:"hiking shoes",gendered:!0,dept:"shoes"},{label:"Outdoor layers",term:"moisture wicking shirt",gendered:!0,dept:"apparel"},{label:"Daypack",term:"hiking daypack",gendered:!1}],workout:[{label:"Activewear",term:"athletic shirt",gendered:!0,dept:"apparel"},{label:"Running shoes",term:"running shoes",gendered:!0,dept:"shoes"}]},ec={women:"women's",men:"men's",kids:"kids",neutral:""},ed=[{value:"women",label:"Women's"},{value:"men",label:"Men's"},{value:"kids",label:"Kids"},{value:"neutral",label:"Mixed"}],eu=[{value:"25",label:"Under $25"},{value:"50",label:"Under $50"},{value:"100",label:"Under $100"},{value:"250",label:"Under $250"}];function ep(e){let{active:t,children:a,onClick:r}=e;return(0,n.jsx)("button",{type:"button",onClick:r,"aria-pressed":t,className:(0,c.cn)("px-3 py-1.5 rounded-full text-[13px] font-medium border transition-colors touch-manipulation",t?"bg-brand text-white border-brand":"bg-slate-50 text-slate-700 border-slate-200 hover:border-brand hover:text-brand"),children:a})}function eh(e){let{gender:t,activities:a,budget:r,onGender:l,onToggleActivity:s,onBudget:i,onBuild:o,onSkip:d,busy:u=!1,className:p}=e;return(0,n.jsxs)("div",{className:(0,c.cn)("rounded-2xl border border-slate-200 bg-white/90 p-3 shadow-sm space-y-3",u&&"opacity-70",p),"aria-busy":u,children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium text-slate-500",children:"Who's this for?"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ed.map(e=>(0,n.jsx)(ep,{active:t===e.value,onClick:()=>l(e.value),children:e.label},e.value))})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium text-slate-500",children:"What will you be doing? (pick any)"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ei.map(e=>(0,n.jsx)(ep,{active:a.includes(e.key),onClick:()=>s(e.key),children:e.label},e.key))})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium text-slate-500",children:"Budget per item"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:eu.map(e=>(0,n.jsx)(ep,{active:r===e.value,onClick:()=>i(r===e.value?"":e.value),children:e.label},e.value))})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-0.5",children:[(0,n.jsx)("button",{type:"button",onClick:d,className:"text-[11px] font-medium text-slate-400 hover:text-brand transition-colors touch-manipulation",children:"Just chat instead"}),(0,n.jsx)("button",{type:"button",onClick:o,disabled:!t||u,className:"px-4 py-2 rounded-xl bg-brand text-white text-sm font-semibold shadow-sm hover:bg-brand-hover disabled:bg-slate-200 disabled:text-slate-400 transition-colors touch-manipulation",children:u?"Building…":"Build my list"})]})]})}let em=[{label:"Under $25",value:"25"},{label:"Under $50",value:"50"},{label:"Under $100",value:"100"},{label:"Under $250",value:"250"}],eg=[{label:"On sale only",value:"true"}],ef=[{label:"Black",value:"black"},{label:"White",value:"white"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Red",value:"red"},{label:"Pink",value:"pink"},{label:"Neutral",value:"beige"}],eb=[{label:"Women's",value:"women's"},{label:"Men's",value:"men's"},{label:"Kids",value:"kids"}],ex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{id:"budget",label:"Budget",options:em,applyAs:"maxPrice",priority:e}},ev=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;return{id:"onSale",label:"Deals",options:eg,applyAs:"onSale",priority:e}};ex(4),ex(2),ev(),ex(2),ev(),ex(1),ev(2),ex(1),ev(2),ex(1),ev(2),ex(1),ev(2),ex(1),ev(2),ex(1),ev(2);var ey=a(76030),ew=a(6462),ek=a(60794),ej=a(74601),eN=a(19689),e_=a(18186),eS=a(90848),eC=a(2160),eI=a(42625),eA=a(91721),eT=a(17104),eP=a(75074),eL=a(73672),eO=a(33134),eE=a(73926),eR=a(50392);let eB=[/\bn[i1]gg[ae3]r?s?\b/i,/\bk[i1]k[e3]s?\b/i,/\bw[e3]tb[a@]cks?\b/i,/\bg[o0]{2}ks?\b/i,/\bf[a@]gg?[o0]ts?\b/i,/\br[e3]t[a@]rds?\b/i,/\bf+u+c+k+\s*(you|off|this|that|u|yourself|yourselves|urself|yr?self)\b/i,/\bgo\s+f+u+c+k\b/i,/\bs+h+i+t+\s*(head|face|bag|stain)\b/i,/\bstfu\b/i,/\bkys\b/i,/\b(kill|murder|shoot|bomb)\s+(you|your|him|her|them|myself)\b/i,/\bbomb\s+threat\b/i,/\b(p[o0]rn|h[e3]nt[a@][i1]|xxx)\b/i],ez="That language isn't okay here. All sessions are logged and this violates our Terms of Service. Let's keep it friendly — what product are you looking for?";function eD(e){let t=new URLSearchParams;return e&&t.set("source",e),t.set("redirect","/bot-shopper"),{label:"Open sign up or log in",type:"action",href:"/auth/login?".concat(t.toString()),openInNewTab:!0}}eD();let eU=["gift","birthday","christmas","wedding","baby shower","anniversary","graduation","housewarming","for my","for him","for her","for mom","for dad","for wife","for husband","present"];var eW=a(69001);let eM="Just show me options",eq={label:eM,type:"action"};var eF=a(44303),eH=a(2180),eK=a(333);let eG={classification:(0,eK.N)("gpt-5-nano"),fast:(0,eK.N)("gpt-5-mini"),augmentation:(0,eK.N)("gpt-5-mini"),copy:(0,eK.N)("gpt-4o-mini"),content:(0,eK.N)("gpt-5-mini")},e$={classification:{maxTokens:500},content:{maxTokens:{short:2e3,medium:8e3,long:15e3,xlarge:25e3}}},eJ={classification:"You are a product categorization expert. Analyze product information and assign the most appropriate category. Respond only with the exact category ID.",contentWriter:"You are an expert content creator specializing in product reviews and buying guides. Write engaging, informative content that helps users make informed purchasing decisions.",casualWriter:"You are a friendly, casual writer creating engaging content for LMK.today. Use a conversational tone with internet slang when appropriate for a US audience.",productReviewer:"You are an expert product reviewer. Provide honest, detailed analysis focusing on features, pros/cons, and value propositions.",buyingGuideExpert:"You are a shopping advisor creating comprehensive buying guides. Focus on helping users understand what to look for and how to choose the best option for their needs.",merchantResearcher:"You are a research assistant providing accurate, factual information about retail companies and brands. Focus on verifiable facts that would be helpful for shoppers."},eY=(eG.copy,e$.content.maxTokens.short,eJ.casualWriter,eG.copy,e$.content.maxTokens.medium,eJ.contentWriter,eG.copy,e$.content.maxTokens.medium,eJ.productReviewer,eG.content,e$.content.maxTokens.long,eJ.buyingGuideExpert,eG.content,e$.content.maxTokens.xlarge,eJ.contentWriter,eG.classification,e$.classification.maxTokens,eJ.classification,eG.copy,e$.content.maxTokens.medium,eJ.merchantResearcher,eH.Ik({recipient:eH.k5(["self","humans","pet","home","vehicle","plant","unknown"]).describe("Who/what the purchase is for"),recipientLifeStage:eH.k5(["baby","kid","tween","teen","young_adult","adult","senior","unknown"]).optional().describe("Age stage of the human recipient (if any)"),recipientGender:eH.k5(["women","men","unisex","girl","boy","unknown"]).optional().describe("Gender bucket for the recipient (if known)"),relationship:eH.k5(["self","parent","partner","child","sibling","friend","colleague","other","unknown"]).optional().describe("Recipient's relationship to the shopper"),intent:eH.k5(["gift","self_purchase","household","replacement","browse","unknown"]).describe("Why they're shopping"),occasion:eH.k5(["birthday","anniversary","holiday","wedding","baby_shower","graduation","thank_you","just_because","travel","
1work","home_setup","unknown"]).optional().describe("Event driving the purchase"),category:eH.Yj().optional().describe('Product noun the user has converged on, e.g. "gourmet treats", "dark jeans", "storage bin"'),attributes:eH.YO(eH.Yj()).optional().describe('Free-form descriptors that should ride along on every search ("dark", "slim fit", "waterproof")'),budget:eH.Ik({min:eH.ai().optional(),max:eH.ai().optional()}).optional().describe("Hard price ceiling/floor in USD"),excludes:eH.YO(eH.Yj()).optional().describe('Tokens that disqualify a result, e.g. ["dog", "pet"] when shopping for human gifts')})),eQ={recipient:"unknown",intent:"unknown"},eZ=new Set(["in stock","instock","stock","in-stock","available","availability","available now","on sale","onsale","on-sale","sale","sale items","discount","discounted","discounts","deal","deals","clearance","markdown","reduced","bargain","free shipping","fast shipping","shipping","ships free","free delivery","us only","us-only","usa","us","united states","domestic","in the us","cheap","cheapest","affordable","budget","low price","lowest price","best","best price","top rated","highly rated","popular","trending","new","newest"]);eY.partial();let eV={baby:"baby",kid:"kid",tween:"tween",teen:"teen",young_adult:"young adult",adult:"adult",senior:"senior",unknown:""},eX={self:"themself",parent:"parent",partner:"partner",child:"child",sibling:"sibling",friend:"friend",colleague:"colleague",other:"someone",unknown:""};var e0=a(52643);function e1(e,t){var a;let n=e.trim();if(!n||0===t.length)return null;let r=n.match(/^save to (.+)$/i),l=(null!==(a=null==r?void 0:r[1])&&void 0!==a?a:n).trim(),s=t.find(e=>e.title.toLowerCase()===l.toLowerCase());return s&&(r||n.toLowerCase()===s.title.toLowerCase())?{id:s.id,title:s.title,slug:s.slug}:null}async function e2(e){var t,a,n,r;if(e.integration_type&&"internal"!==e.integration_type&&e.external_id){let r=e.merchant&&e.merchant.trim()||(null===(t=e.metadata)||void 0===t?void 0:t.merchant_name)||(0,F.MJ)({affiliate_url:e.affiliate_url,direct_url:e.direct_url,metadata:e.metadata,integration_type:e.integration_type,merchant_id:e.merchant_id,brand:e.brand}),l=await fetch("/api/products/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({external_id:e.external_id,integration_type:e.integration_type,title:e.title,description:e.description,price:e.price,original_price:e.original_price,currency_code:e.currency_code||"USD",image_urls:e.image_urls,affiliate_url:e.affiliate_url,direct_url:e.direct_url,rating:e.rating,review_count:e.review_count||0,brand:e.brand,merchant:r,merchant_name:r,metadata:{...e.metadata,category:e.category,source_integration:e.integration_type,merchant_name:r||(null===(a=e.metadata)||void 0===a?void 0:a.merchant_name)},on_sale:e.on_sale,sale_discount:e.sale_discount,merchant_id:e.merchant_id})});return l.ok&&null!==(n=(await l.json()).id)&&void 0!==n?n:null}return null!==(r=e.id)&&void 0!==r?r:null}async function e5(e,t){let a=await e2(e);if(!a)return"failed";let n=(0,e0.createClient)(),{data:{user:r}}=await n.auth.getUser();if(!r)return"failed";let{data:l}=await n.from("wishlist_products").select("id").eq("wishlist_id",t).eq("product_id",a).maybeSingle();if(l)return"skipped";let{data:s,error:i}=await n.from("wishlist_products").insert({wishlist_id:t,product_id:a,position:0,requested_quantity:1}).select("id").single();return i?"failed":((null==s?void 0:s.id)&&fetch("/api/internal/queue-watch-creation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({wishlist_product_id:s.id,product_id:a,user_id:r.id,metadata:{source:"bot_shopper_save"}})}).catch(()=>{}),"saved")}async function e4(e,t){let a={savedCount:0,skippedCount:0,failedCount:0};for(let n of e){let e=await e5(n,t);"saved"===e?a.savedCount+=1:"skipped"===e?a.skippedCount+=1:a.failedCount+=1}return a}function e3(e){return e.slug?[{label:"View list",type:"action",href:"/wishlists/".concat(e.slug)}]:[]}var e8=a(90010);let e9=[{label:"On sale",message:"On sale only"},{label:"Cheaper",message:"Show cheaper options"},{label:"Best rated",message:"Best rated only"},{label:"Compare",message:"Compare the top picks",minProducts:2}],e6=[{label:"Clothing",query:"women's Nike sneakers Zara dress Gap jeans",Icon:ey.A},{label:"Shoes",query:"Nike sneakers Adidas running New Balance Vans",Icon:ew.A},{label:"Electronics",query:"Apple AirPods Sony headphones Samsung Galaxy",Icon:ek.A},{label:"Beauty",query:"CeraVe serum The Ordinary moisturizer Sephora skincare",Icon:ej.A},{label:"Kitchen",query:"KitchenAid mixer Ninja blender Le Creuset",Icon:eN.A},{label:"Home",query:"West Elm decor Pottery Barn lamp Target home",Icon:e_.A},{label:"Toys",query:"LEGO set Melissa & Doug Hasbro board game",Icon:eS.A},{label:"Gifts",query:"gift ideas under $50 Apple AirPods jewelry perfume",Icon:eC.A}];function e7(e){let{user:t,variant:a="light",authSource:r}=e,l="header"===a?"p-1.5 rounded-lg text-slate-500 hover:text-brand hover:bg-slate-100 transition-colors":"p-2 rounded-xl text-slate-400 hover:text-brand hover:bg-white/80 transition-colors",s=r?"/auth/login?source=".concat(encodeURIComponent(r)):"/auth/login";return t?(0,n.jsxs)("nav",{className:"flex items-center gap-1",children:[(0,n.jsx)(b(),{href:"/products",className:l,title:"Browse Products",children:(0,n.jsx)(eI.A,{className:"w-4 h-4"})}),(0,n.jsx)(b(),{href:"/dashboard",className:l,title:"My Wishlists",children:(0,n.jsx)(R.A,{className:"w-4 h-4"})}),(0,n.jsx)(b(),{href:"/dashboard/settings",className:l,title:"Account",children:(0,n.jsx)(eA.A,{className:"w-4 h-4"})})]}):(0,n.jsxs)("nav",{className:"flex items-center gap-1",children:[(0,n.jsx)(b(),{href:"/products",className:l,title:"Browse Products",children:(0,n.jsx)(eI.A,{className:"w-4 h-4"})}),(0,n.jsx)(b(),{href:"/wishlists/browse",className:l,title:"Browse Wishlists",children:(0,n.jsx)(R.A,{className:"w-4 h-4"})}),(0,n.jsx)(b(),{href:s,className:l,title:"Sign In",children:(0,n.jsx)(eT.A,{className:"w-4 h-4"})})]})}function te(){var e,t,a,c,u,p,h,m,g,f,b,x,w,k;let{variant:j="page",onClose:_}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},S="modal"===j,I=(0,l.useSearchParams)(),A=null!==(p=I.get("mode"))&&void 0!==p?p:"shopping",[T]=(0,r.useState)("wishlist"===A?"wishlist":"shopping"),P=I.get("brand"),O=I.get("partner"),E=(0,eW.RG)(O)?O:(0,eW.RG)(P)?P:null,R=(0,eW.$r)(E),B=(0,r.useMemo)(()=>(0,eF.v)(I),[I]),D=(0,r.useMemo)(()=>
1{if("1"===I.get("embed"))return"embed";let e=I.get("_ext-src")||I.get("src")||"";return e.startsWith("blzr")?"blazer":"extension"===(I.get("utm_source")||"")||"lmk-ext"===e?"extension":"bot-shopper"},[I]),U="1"===I.get("embed"),W=(I.get("accent")||"").trim(),M=/^#[0-9a-fA-F]{3,8}$/.test(W)?W:"",q="gap"===E?"Searching over 50k Gap products…":"Finding options for you…",[F,H]=(0,r.useState)([]),[K,G]=(0,r.useState)(""),[J,Y]=(0,r.useState)(!1),[Q,V]=(0,r.useState)(!1),{user:ei,refreshSession:ed}=(0,s.A)(),[eu,ep]=(0,r.useState)(!1),[em,eg]=(0,r.useState)(null),[ef,eb]=(0,r.useState)(!1),[ex,ev]=(0,r.useState)(null),[ey,ew]=(0,r.useState)(!1),ek=(0,r.useRef)(null),ej=(0,r.useRef)(null),eN=(0,r.useRef)(null),e_=(0,r.useRef)(null),eS=(0,r.useRef)(!0),eC=(0,r.useRef)(0),[eI,eA]=(0,r.useState)(!1),eT=(0,r.useRef)(null),[eH,eK]=(0,r.useState)(()=>crypto.randomUUID()),eG=(0,r.useRef)(""),e$=(0,r.useRef)([]),eJ=(0,r.useRef)(null),eY=(0,r.useRef)(!1),eZ=(0,r.useRef)(!1),eV=(0,r.useRef)(null),eX=(0,r.useRef)(eQ),e0=(0,r.useRef)(null),e2=(0,r.useRef)(new Set);(0,r.useEffect)(()=>{fetch("/api/bot-shopper/context").then(e=>e.json()).then(eg).catch(()=>{})},[ei]);let te=(0,r.useCallback)((e,t,a)=>{eH&&fetch("/api/bot-shopper/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:eH,content:t,message_type:e,metadata:a})}).catch(()=>{})},[eH]),tt=(0,r.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,$.c)(e,{session_id:eH,...t},{partner:B,isAuthenticated:!!ei})},[eH,B,ei]),ta=(0,r.useCallback)(e=>{ev(e),ew(!0),tt($.l.BOT_PRODUCT_CLICKED,{product_id:e.id,merchant:e.merchant})},[tt]),tn=(0,r.useMemo)(()=>{for(let e=F.length-1;e>=0;e--){let t=F[e];if("assistant"===t.role&&t.products&&t.products.length>0)return t.products}return[]},[F]),tr=tn.length>0,tl=(0,r.useCallback)(()=>{let e=eN.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;eS.current=t,t&&eA(!1)},[]);(0,r.useLayoutEffect)(()=>{let e=F.filter(e=>"user"===e.role).length;e>eC.current&&(eC.current=e,eA(!1),eS.current=!1,requestAnimationFrame(()=>{var e;null===(e=e_.current)||void 0===e||e.scrollIntoView({block:"start",behavior:"auto"})}))},[F]),(0,r.useEffect)(()=>{var e,t;let a=eN.current,n=ek.current;if(!a||!n)return;if(eS.current){n.scrollIntoView({block:"end",behavior:"auto"});return}let r=F[F.length-1];if((null==r?void 0:r.role)==="assistant"&&(null!==(t=null===(e=r.products)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0)n.getBoundingClientRect().top>a.getBoundingClientRect().bottom-4&&eA(!0)},[F,J,Q]);let ts=(0,r.useCallback)(()=>{var e;null===(e=ek.current)||void 0===e||e.scrollIntoView({block:"end",behavior:"smooth"}),eA(!1)},[]);(0,r.useEffect)(()=>{if(!J&&!Q&&F.length>0){var e;null===(e=ej.current)||void 0===e||e.focus()}},[J,Q,F.length]);let ti=(0,r.useCallback)(e=>{e2.current.size>=1||(V(!0),setTimeout(()=>{if(e.templateId){if(e2.current.has(e.templateId)){V(!1);return}e2.current.add(e.templateId)}V(!1),H(t=>[...t,{id:"proactive-".concat(Date.now()),role:"assistant",content:e.text,followups:e.chips}]),(e.text.includes("Sign up")||e.text.includes("sign up"))&&(eY.current=!0),(e.text.includes("wishlist")||e.text.includes("Wishlist"))&&(eZ.current=!0),requestAnimationFrame(()=>{var e;return null===(e=ej.current)||void 0===e?void 0:e.focus()})},e.delay))},[]),to=(0,r.useCallback)(()=>{e0.current&&clearTimeout(e0.current),0!==F.length&&(e2.current.size>=1||(e0.current=setTimeout(()=>{if(J||Q||e2.current.size>=1)return;let e=function(e){var t,a,n,r;let l=[];if(e.isLoggedIn||e.hasAskedSignup||l.push({templateId:"idle-signup-free",text:"Did you know you can save products, track prices, and get deal alerts? **Sign up free** to unlock everything.",chips:[eD(e.authSource),{label:"Maybe later",type:"response",context:"I'll"}],delay:800}),e.isLoggedIn&&e.hasResults&&!e.hasAskedWishlist){let t=null===(r=e.shopperProfile)||void 0===r?void 0:null===(n=r.wishlists)||void 0===n?void 0:n[0];l.push({templateId:t?"idle-wishlist-save-existing":"idle-wishlist-create",text:t?"Don't lose track of what you found! Save your favorites to **".concat(t.title,"** and we'll watch the prices for you."):"Want to save anything you found? **Build My List** and we'll track prices and notify you when they drop.",chips:t?[{label:"Save to ".concat(t.title),type:"action"},{label:"Keep browsing",type:"response",context:"I'll"}]:[{label:"Start a wishlist",type:"action"},{label:"Keep browsing",type:"response",context:"I'll"}],delay:800})}
1else e.isLoggedIn||!e.hasResults||e.hasAskedWishlist||l.push({templateId:"idle-account-from-results",text:"Like what you see? **Create a free account** to save products to a wishlist and get price drop alerts.",chips:[eD(e.authSource),{label:"Just browsing",type:"response",context:"I'm"}],delay:800});if(l.push({templateId:"idle-inspiration-trending",text:"Need some inspiration? I can show you what's **trending** right now or help you find gifts for any occasion.",chips:[{label:"Show me trending",type:"action"},{label:"Gift ideas",type:"action"}],delay:800}),e.hasResults&&l.push({templateId:"idle-compare-or-cheaper",text:"Want me to **compare** any of these products, check price history, or find cheaper alternatives?",chips:[{label:"Compare top picks",type:"action"},{label:"Find cheaper options",type:"action"}],delay:800}),null===(a=e.shopperProfile)||void 0===a?void 0:null===(t=a.upcomingEvents)||void 0===t?void 0:t.length){let t=e.shopperProfile.upcomingEvents[0];l.push({templateId:"idle-upcoming-event",text:"Reminder: **".concat(t.title,"** is ").concat(t.daysAway," days away! Need help finding the perfect gift?"),chips:[{label:"Shop for ".concat(t.title),type:"action"},{label:"Something else",type:"response",context:"I'm looking for"}],delay:800})}l.push({templateId:"idle-any-product-stores",text:"I can search **any product** across 20+ stores -- electronics, fashion, home, beauty, sports, toys, you name it!",chips:[{label:"Search for something",type:"action"},{label:"Show me deals",type:"action"}],delay:800});let s=l.filter(t=>!t.templateId||!e.shownTemplateIds.has(t.templateId));return 0===s.length?null:s[Math.floor(Math.random()*s.length)]}({isLoggedIn:!!ei,shopperProfile:(null==em?void 0:em.profile)||null,hasResults:tr,hasAskedSignup:eY.current,hasAskedWishlist:eZ.current,shownTemplateIds:e2.current,authSource:D});e&&ti(e)},3e4)))},[F.length,J,Q,ei,em,tr,ti]);(0,r.useEffect)(()=>(to(),()=>{e0.current&&clearTimeout(e0.current)}),[to]);let tc=(0,r.useCallback)(async(e,t)=>{to(),eZ.current=!0,H(e=>[...e,{id:"user-".concat(Date.now()),role:"user",content:t}]),V(!0),tt($.l.BOT_CHIP_TAPPED,{chip_text:t,turn_number:F.filter(e=>"user"===e.role).length});try{if(0===tn.length){H(e=>[...e,{id:"save-".concat(Date.now()),role:"assistant",content:"I don't have any products to save yet — search for something first, then try again."}]);return}let t=await e4(tn,e.id);H(a=>[...a,{id:"save-".concat(Date.now()),role:"assistant",content:function(e,t){let a=e.slug?"[View list](/wishlists/".concat(e.slug,")"):"";if(t.savedCount>0){let n=1===t.savedCount?"1 product":"".concat(t.savedCount," products");return"Saved ".concat(n," to **").concat(e.title,"**! ").concat(a).trim()}return t.skippedCount>0&&0===t.failedCount?"Those products are already on **".concat(e.title,"**. ").concat(a).trim():"Sorry, I couldn't save those products right now. Try adding from the product card instead."}(e,t),followups:e3(e)}])}finally{V(!1)}},[tn,F,to,tt]),td=(0,r.useCallback)(async(e,t)=>{var a,n,r,l,s,o,c,d,u,p,h,m,g,f,b,x;let v=e.trim();if(!v||J)return;if(to(),!R&&!(null==t?void 0:t.forceSearch)&&!(null==t?void 0:t.finalize)&&!(null==t?void 0:t.bypassPlanning)&&!tr){let e=function(e){var t;let a=(e||"").trim();if(!a||!(X.some(e=>e.test(a))||ee.test(a)&&et.test(a)))return{isPlanning:!1};let n=null===(t=ea.find(e=>{let{re:t}=e;return t.test(a)}))||void 0===t?void 0:t.key;return{isPlanning:!0,destination:function(e){let t=e.match(/\b(?:to|in|at|for)\s+([A-Z][a-zA-Z]+(?:\s+[A-Z][a-zA-Z]+){0,2})/);if(t)return t[1].trim();let a=e.match(en);return a?a[0]:void 0}(a),occasion:n}}(v);if(e.isPlanning){let t=0===F.length,a="plan-".concat(Date.now()),n=null!==(l=null==em?void 0:null===(r=em.profile)||void 0===r?void 0:r.gender)&&void 0!==l?l:null;H(t=>[...t,{id:"user-".concat(Date.now()),role:"user",content:v},{id:a,role:"assistant",content:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date,a=el(t.getMonth()),n=e.destination?e.destination.replace(/\b\w/g,e=>e.toUpperCase()):"where you’re headed",r=!!e.destination&&en.test(e.destination),l=!!e.destination&&er.test(e.destination),s=es[a];return r&&"summer"===a&&(s="usually warm and beach-friendly — think light layers and swimwear"),l&&(s="cold and snowy — warm, waterproof layers are a must"),"Got it — ".concat(n," this time of year is ").concat(s,". Tell me a couple quick things and I’ll build your list:")}(e),planning:{baseQuery:v,gender:n,activities:[],budget:""}}]),G(""),e$.current=[...e$.current,v],te("planning",v,{}),t&&tt($.l.BOT_SESSION_STARTED,{entry_point:"direct",initial_query:v}),tt($.l.BOT_MESSAGE_SENT,{message_length:v.length,turn_number:F.filter(e=>"user"===e.role).length+1,planning:!0}),tt($.l.BOT_INTAKE_SHOWN,{category:"planning",query:v});return}}let y=e1(v,null!==(s=null==em?void 0:null===(a=em.profile)||void 0===a?void 0:a.wishlists)&&void 0!==s?s:[]);if(y){if(!ei){if(!await (0,i.$)()){ep(!0),tt($.l.BOT_AUTH_INITIATED,{trigger_source:"save_to_wishlist_text"});return}ed()}tc(y,v);return}null===(n=eV.current)||void 0===n||n.abort();let w=new AbortController;eV.current=w;let k=function(e){let t=e.trim();if(!t)return{allowed:!1,blocked:!0,reason:"clean",message:"Please enter a search query."};if((0,eR.I5)(t))return{allowed:!1,blocked:!0,reason:"profanity",message:ez};for(let e of eB)if(e.test(t))return{allowed:!1,blocked:!0,reason:"profanity",message:ez};return{allowed:!0,blocked:!1,reason:"clean"}}(v);if(k.blocked){H(e=>[...e,{id:"user-".concat(Date.now()),role:"user",content:v},{id:"mod-".concat(Date.now()),role:"assistant",content:k.message}]),G(""),te("moderation",v,{reason:k.reason});return}let j={id:"user-".concat(Date.now()),role:"user",content:v},N="bot-".concat(Date.now());eJ.current=N;let _={id:N,role:"assistant",content:"",searchPending:!!(null==t?void 0:t.forceSearch),triggeredForceSearch:!!(null==t?void 0:t.forceSearch)},S=0===F.length,C=F.filter(e=>e.content).slice(-6).map(e=>({role:e.role,content:e.content}));H(e=>[...e,j,_]),G(""),Y(!0),V(!1),e$.current=[...e$.current,v],te((null==t?void 0:t.forceSearch)?"search":"chat",v,{...R?{brand_partner:R.slug}:{},...(null==t?void 0:t.forceSearch)?{force_search:!0}:{}}),S&&tt($.l.BOT_SESSION_STARTED,{entry_point:R?"partner":"direct",initial_query:v}),tt($.l.BOT_MESSAGE_SENT,{message_length:v.length,turn_number:F.filter(e=>"user"===e.role).length+1,has_product_context:tr});try{let e=await fetch("/api/bot-shopper/chat",{method:"POST",headers:{"Content-Type":"application/json"},signal:w.signal,body:JSON.stringify({query:v,session_id:eH,forceSearch:(null==t?void 0:t.forceSearch)||!1,finalize:(null==t?void 0:t.finalize)||!1,isFirstMessage:S,lastSearchQuery:eG.current||void 0,products:tn.slice(0,10).map(e=>{var t,a,n,r,l,s;return{id:e.id,title:e.title,brand:e.brand,price:e.price,original_price:e.original_price||(null===(t=e.metadata)||void 0===t?void 0:t.original_price),merchant:e.merchant||(null===(a=e.metadata)||void 0===a?void 0:a.merchant_name),slug:e.slug,on_sale:null!==(l=e.on_sale)&&void 0!==l?l:null===(n=e.metadata)||void 0===n?void 0:n.on_sale,sale_discount:null!==(s=e.sale_discount)&&void 0!==s?s:null===(r=e.metadata)||void 0===r?void 0:r.sale_discount,rating:e.rating,affiliate_url:e.affiliate_url,direct_url:e.direct_url}}),conversationHistory:C,shopperContext:{mode:T,searchHistory:e$.current},shopperProfile:(null==em?void 0:em.profile)||null,shopperBrief:eX.current,...R?{brand:R.slug}:{}})});if(!e.ok){if(422===e.status){let t=await e.json();H(e=>{let a=[...e],n=a.findLastIndex(e=>e.id===N);return n>=0&&(a[n]={...a[n],content:t.message||"Please rephrase your question.",searchPending:!1}),a}),Y(!1);return}throw Error("Chat failed")}let a=null===(o=e.body)||void 0===o?void 0:o.getReader(),n=new TextDecoder,r="",l=[],s=null,i="",y=!1,k=null,j=e=>{null!==k&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{H(t=>{let a=[...t],n=a.findLastIndex(e=>e.id===N);return n>=0&&(a[n]={...a[n],content:e}),a})})},_=()=>{y||0===l.length||(y=!0,H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);if(a>=0){let e=t[a];t[a]={...e,products:l,searchPending:!1,statusMessage:void 0,statusStage:void 0,content:e.content&&e.content.length>0?e.content:i}}return t}))};if(a){for(;;){let{done:e,value:o}=await a.read();if(e)break;for(let e of n.decode(o).split("\n"))if(e.startsWith("data: "))try{let a=JSON.parse(e.slice(6));if("text"===a.type){let e=0===r.length&&a.text.trim().length>0;r+=a.text,e&&eJ.current===N&&H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);return a>=0&&(t[a]={...t[a],searchPending:!1,statusMessage:void 0,statusStage:void 0}),t}),j(r)}if("tool_result"===a.type){if(("searchProducts"===a.toolName||"filterInPlace"===a.toolName)&&(null===(d=a.result)||void 0===d?void 0:null===(c=d.products)||void 0===c?void 0:c.length)&&(l=a.result.products,"searchProducts"!==a.toolName||(null==t?void 0:t.finalize)||(s=v),i=(null===(g=a.result)||void 0===g?void 0:g.intro)||i),(null===(u=a.result)||void 0===u?void 0:u.action)==="clarifier"){let e=a.result.question,t=a.result.context||"Pick one",n=a.result.chips||[],r=[eq,...n.map(e=>({label:e.label,type:"response",context:t}))];H(t=>{let a=[...t],n=a.findLastIndex(e=>e.id===N);return n>=0&&(a[n]={...a[n],content:e,followups:r,searchPending:!1}),a})}if((null===(p=a.result)||void 0===p?void 0:p.action)==="suggest_multi_merchant"){let e=(a.result.chips||[]).map(e=>({label:e.label,type:"action",href:e.href,openInNewTab:!!e.href&&!e.href.startsWith("/bot-shopper")}));H(t=>{let n=[...t],r=n.findLastIndex(e=>e.id===N);return r>=0&&(n[r]={...n[r],content:a.result.reason||n[r].content,followups:e,searchPending:!1}),n})}if((null===(h=a.result)||void 0===h?void 0:h.action)==="add_to_wishlist"){let{productId:e,wishlistId:t}=a.result;if(ei&&e){let a=tn.find(t=>
1t.id===e)||l.find(t=>t.id===e),n=null!==(x=t?null==em?void 0:null===(f=em.profile)||void 0===f?void 0:f.wishlists.find(e=>e.id===t):null==em?void 0:null===(b=em.profile)||void 0===b?void 0:b.wishlists[0])&&void 0!==x?x:null;a&&n&&e5(a,n.id).then(e=>{if("failed"===e)return;let t={id:n.id,title:n.title,slug:n.slug},a=e3(t);H(e=>{var t;let n=[...e],r=n.findLastIndex(e=>e.id===N);if(r<0)return e;let l=null!==(t=n[r].followups)&&void 0!==t?t:[];return n[r]={...n[r],followups:[...l,...a]},n})})}}null===(m=a.result)||void 0===m||m.action}"status"===a.type&&a.message&&eJ.current===N&&H(e=>{var t;let n=[...e],r=n.findLastIndex(e=>e.id===N);return!(r>=0)||(null===(t=n[r].products)||void 0===t?void 0:t.length)||(n[r]={...n[r],statusMessage:a.message,statusStage:a.stage}),n}),"brief_update"===a.type&&a.brief&&(eX.current=a.brief),"text_complete"===a.type&&(eJ.current===N&&Y(!1),_(),H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);if(a>=0){let e=t[a],n=e.products&&e.products.length>0,r=e.followups&&e.followups.length>0;n||r?r||(t[a]={...e,chipsPending:!0}):t[a]={...e,followups:[eq],chipsPending:!0}}return t})),"suggested_followups"===a.type&&a.followups&&(eJ.current!==N?H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);return a>=0&&(t[a]={...t[a],chipsPending:!1}),t}):H(e=>{let t=[...e],n=t.findLastIndex(e=>e.id===N);return n>=0&&(t[n]={...t[n],followups:a.followups,chipsPending:!1}),t}))}catch(e){}}null!==k&&(cancelAnimationFrame(k),H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);return a>=0&&(t[a]={...t[a],content:r}),t})),_()}if(H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);return a>=0&&(t[a]={...t[a],chipsPending:!1,searchPending:!1,statusMessage:void 0,statusStage:void 0}),t}),s&&(eG.current=s,te("search_result",s,{result_count:l.length,...R?{brand_partner:R.slug}:{}})),tt($.l.BOT_RESPONSE_RECEIVED,{turn_number:F.filter(e=>"user"===e.role).length+1,product_count:l.length,has_followups:r.length>0}),l.length>0&&l.slice(0,10).forEach((e,t)=>{var a;tt($.l.BOT_PRODUCT_SHOWN,{product_id:e.id,merchant:e.merchant||(null===(a=e.metadata)||void 0===a?void 0:a.merchant_name),position:t})}),l.length>0){let e=function(e){var t,a,n,r;if(!e.hasResults)return{templateId:"proactive-zero-results",text:"I couldn't find exactly what you're looking for. Can you give me a bit more detail -- like a brand, product type, or price range?",chips:[{label:"Try different words",type:"action"},{label:"Show me popular products",type:"action"}],delay:600};let l=e.lastQuery.toLowerCase();if((null===(t=e.shopperProfile)||void 0===t?void 0:t.upcomingEvents.length)&&1===e.searchCount){let t=e.shopperProfile.upcomingEvents[0];return{templateId:"proactive-upcoming-event-search",text:"Found ".concat(e.productCount," results! By the way, your **").concat(t.title,"** is coming up in ").concat(t.daysAway," days -- want to add any of these?"),chips:[{label:"Save to ".concat(t.title),type:"action"},{label:"Just browsing",type:"response",context:"I'm"}],delay:800}}if((null===(a=e.shopperProfile)||void 0===a?void 0:a.favoriteBrands.length)&&e.searchCount<=2){let t=e.shopperProfile.favoriteBrands.find(t=>e.productBrands.some(e=>e.toLowerCase()===t.toLowerCase()));if(t)return{templateId:"proactive-brand-affinity",text:"Found ".concat(e.productCount," results! I see some **").concat(t,"** options -- I know you like that brand. Want me to filter for just ").concat(t,"?"),chips:[{label:"Show only ".concat(t),type:"action"},{label:"Show me everything",type:"response",context:"I want to see"}],delay:800}}if(eU.some(e=>l.includes(e))){if(null===(r=e.shopperProfile)||void 0===r?void 0:r.wishlists.length){let t=e.shopperProfile.wishlists.find(e=>eU.some(t=>{var a;return e.title.toLowerCase().includes(t)||(null===(a=e.eventType)||void 0===a?void 0:a.toLowerCase().includes(t))}));if(t)return{templateId:"proactive-gift-matching-wishlist",text:"Great picks for a gift! Want to save any to your **".concat(t.title,"** wishlist?"),chips:[{label:"Save to ".concat(t.title),type:"action"},{label:"No thanks",type:"response",context:"I'm"}],delay:800}}if(!e.hasAskedWishlist)return{templateId:"proactive-gift-create-wishlist",text:"Looks like you're shopping for a gift! Want to create a wishlist to keep track of your ideas? We'll even track prices for you.",chips:[{label:"Start a wishlist",type:"action"},{label:"Just browsing",type:"response",context:"I'm"}],delay:800}}
1if(1===e.searchCount&&e.productCount>3)return{templateId:"proactive-first-search-clarify",text:"Found ".concat(e.productCount," options for you! Anything specific you're looking for -- like a price range, brand, or use case?"),chips:[{label:"Under $50",type:"response",context:"My budget is"},{label:"Best rated",type:"action"},{label:"On sale only",type:"action"}],delay:800};if(!e.isLoggedIn&&e.searchCount>=2&&!e.hasAskedSignup)return{templateId:"proactive-signup-after-search",text:"Enjoying the search? Sign up for **LMK.today** to save products to wishlists, track prices, and get deal alerts -- it's free!",chips:[eD(e.authSource),{label:"Maybe later",type:"response",context:"I'll"}],delay:1e3};if(e.isLoggedIn&&2===e.searchCount&&(null===(n=e.shopperProfile)||void 0===n?void 0:n.wishlists.length)&&!e.hasAskedWishlist){let t=e.shopperProfile.wishlists[0];return{templateId:"proactive-wishlist-second-search",text:"Want to save any favorites to **".concat(t.title,"**? We'll track prices and let you know about deals."),chips:[{label:"Save to ".concat(t.title),type:"action"},{label:"Keep shopping",type:"response",context:"I'll"}],delay:800}}return null}({searchCount:e$.current.length,isLoggedIn:!!ei,shopperProfile:(null==em?void 0:em.profile)||null,hasAskedSignup:eY.current,hasAskedWishlist:eZ.current,lastQuery:v,productCount:l.length,productBrands:[...new Set(l.map(e=>e.brand).filter(Boolean))],hasResults:!0,authSource:D});e&&ti(e)}}catch(e){e instanceof DOMException&&"AbortError"===e.name?H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);return a>=0&&(t[a]={...t[a],searchPending:!1,chipsPending:!1}),t}):H(e=>{let t=[...e],a=t.findLastIndex(e=>e.id===N);return a>=0&&(t[a]={...t[a],content:"Sorry, something went wrong. Try again.",searchPending:!1,chipsPending:!1}),t})}finally{eJ.current===N&&Y(!1)}},[J,F,tn,eH,T,em,R,ei,te,to,ti,tt,tr,tc]),tu=(0,r.useCallback)((e,t)=>{var a,n;if(!e.trim())return;to();let r=e1(e,null!==(n=null==em?void 0:null===(a=em.profile)||void 0===a?void 0:a.wishlists)&&void 0!==n?n:[]);if(r){if(!ei){(async()=>{if(!await (0,i.$)()){ep(!0),tt($.l.BOT_AUTH_INITIATED,{trigger_source:"save_to_wishlist_chip"});return}ed(),tc(r,t||e)})();return}tc(r,t||e);return}if(tt($.l.BOT_CHIP_TAPPED,{chip_text:t||e,turn_number:F.filter(e=>"user"===e.role).length}),e.trim()===eM){te("finalize_tap",e,{displayLabel:t}),td(e,{forceSearch:!0,finalize:!0,displayLabel:t});return}if(e.toLowerCase().includes("sign me up")){ep(!0),eY.current=!0,tt($.l.BOT_AUTH_INITIATED,{trigger_source:"sign_me_up_chip"});return}if(e.toLowerCase().includes("start a wishlist")){ei||(ep(!0),tt($.l.BOT_AUTH_INITIATED,{trigger_source:"start_wishlist_chip"}));return}if(e.toLowerCase().includes("popular products")){td("popular trending products",{forceSearch:!0,displayLabel:t});return}td(e,{displayLabel:t})},[ei,to,td,te,tt,F,em,tc]),tp=(0,r.useCallback)(e=>{var t,a;let n=e.trim();if(!n)return;let r=(null!==(a=null==em?void 0:null===(t=em.profile)||void 0===t?void 0:t.wishlists)&&void 0!==a?a:[]).find(e=>e.title.toLowerCase()===n.toLowerCase());tu(r?"Save to ".concat(r.title):n,n)},[em,tu]),th=(0,r.useCallback)((e,t)=>{H(a=>{let n=[...a],r=n.findLastIndex(t=>t.id===e);return r>=0&&n[r].planning&&(n[r]={...n[r],planning:{...n[r].planning,...t}}),n})},[]),tm=(0,r.useCallback)((e,t)=>{to(),th(e,{gender:t}),tt($.l.BOT_INTAKE_FIELD_ANSWERED,{field:"gender",value:t,category:"planning"}),("women"===t||"men"===t)&&(eX.current={...eX.current,recipientGender:t}),fetch("/api/bot-shopper/profile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gender:t})}).catch(()=>{})},[to,th,tt]),tg=(0,r.useCallback)((e,t)=>{to(),H(a=>{let n=[...a],r=n.findLastIndex(t=>t.id===e);if(r>=0&&n[r].planning){let e=n[r].planning.activities,a=e.includes(t)?e.filter(e=>e!==t):[...e,t];n[r]={...n[r],planning:{...n[r].planning,activities:a}}}return n})},[to]),tf=(0,r.useCallback)((e,t)=>{th(e,{budget:t})},[th]),tb=(0,r.useCallback)(async(e,t,a,n)=>{let r=function(e,t){var a;let n=new URLSearchParams;return n.set("query",e.query),n.set("limit",String(null!==(a=null==t?void 0:t.limit)&&void 0!==a?a:24)),e.filters.maxPrice&&n.set("maxPrice",String(e.filters.maxPrice)),e.filters.onSale&&n.set("onSale","true"),e.filters.genderDept&&n.set("genderDept",e.filters.genderDept),e.filters.fit&&n.set("fit",e.filters.fit),e.filters.rise&&n.set("rise",e.filters.rise),e.filters.material&&n.set("material",e.filters.material),e.filters.categoryGroup&&n.set("categoryGroup",e.filters.categoryGroup),(null==t?void 0:t.partnerSlug)&&n.set("partner",t.partnerSlug),n}({query:e,filters:{...t?{maxPrice:parseFloat(t)}:{},...n?{categoryGroup:n}:{}}},{limit:8}),l=[];try{let e=await fetch("/api/bot-shopper/search?".concat(r.toString()),{signal:a});if(!e.ok||!e.body)return[];let t=e.body.getReader(),n=new TextDecoder,s="",i="";for(;;){let{done:e,value:a}=await t.read();if(e)break;let r=(s+=n.decode(a,{stream:!0})).split("\n");for(let e of(s=r.pop()||"",r)){if(e.startsWith("event: ")){i=e.slice(7).trim();continue}if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));("partial"===i||"complete"===i)&&Array.isArray(t.products)&&t.products.length&&(l=t.products)}catch(e){}}}}catch(e){}return l.slice(0,8)},[]),tx=(0,r.useCallback)(async e=>{var t;to();let a=F.find(t=>
1t.id===e),n=null==a?void 0:a.planning;if(!n||!n.gender)return;null===(t=eT.current)||void 0===t||t.abort();let r=new AbortController;eT.current=r,H(t=>{let a=[...t],n=a.findLastIndex(t=>t.id===e);return n>=0&&(a[n]={...a[n],building:!0}),a});let l=function(e){var t,a,n,r;let{activities:l,gender:s}=e,i=el((null!==(t=e.now)&&void 0!==t?t:new Date).getMonth()),o=null!==(a=ec[s])&&void 0!==a?a:"",c=null!==(n=e.max)&&void 0!==n?n:6,d=l.length>0?l:["casual"],u=[];for(let e of d)for(let t of null!==(r=eo[e])&&void 0!==r?r:[])u.push(t);"summer"===i&&u.push({label:"Sun protection",term:"sunglasses sun hat",gendered:!1}),"winter"===i&&u.push({label:"Cold-weather layers",term:"insulated jacket beanie",gendered:!1});let p=function(e){switch(e){case"women":return"womens-clothing";case"men":return"mens-clothing";case"kids":return"kids-baby";case"neutral":return"mens-clothing,womens-clothing"}}(s),h=new Set,m=[];for(let e of u){if(h.has(e.label))continue;h.add(e.label);let t=e.gendered&&o?"".concat(o," ").concat(e.term):e.term,a="apparel"===e.dept?p:"shoes"===e.dept?"shoes-footwear":void 0;if(m.push({label:e.label,query:t.trim(),categoryGroup:a}),m.length>=c)break}return m}({activities:n.activities,gender:n.gender});tt($.l.BOT_INTAKE_SUBMITTED,{category:"planning",gender:n.gender,activities:n.activities,bucket_count:l.length});try{let t=await Promise.all(l.map(e=>tb(e.query,n.budget,r.signal,e.categoryGroup))),a=l.map((e,a)=>({label:e.label,products:t[a]})).filter(e=>e.products.length>0);H(t=>{let n=[...t],r=n.findLastIndex(t=>t.id===e);return r>=0&&(n[r]={...n[r],building:!1,planSections:a,content:a.length?"Here's your packing list — tap anything to see buying options or save it.":"I couldn't pull solid matches for that mix. Try different activities or a higher budget."}),n})}catch(t){H(t=>{let a=[...t],n=a.findLastIndex(t=>t.id===e);return n>=0&&(a[n]={...a[n],building:!1}),a})}},[F,to,tb,tt]),tv=(0,r.useCallback)(e=>{var t;null===(t=eT.current)||void 0===t||t.abort(),tt($.l.BOT_INTAKE_SKIPPED,{category:"planning"});let a="";H(t=>{let n=[...t],r=n.findLastIndex(t=>t.id===e);if(r>=0){var l,s;a=null!==(s=null===(l=n[r].planning)||void 0===l?void 0:l.baseQuery)&&void 0!==s?s:"",n[r]={...n[r],planning:void 0}}return n}),a&&td(a,{bypassPlanning:!0})},[tt]),ty=(0,r.useCallback)(()=>{!J&&K.trim()&&td(K)},[J,K,td]),tw=(0,r.useRef)(!1),tk=I.get("q"),tj="1"===I.get("autoSearch");(0,r.useEffect)(()=>{tk&&tj&&!tw.current&&!J&&(tw.current=!0,td(tk,{forceSearch:!0}))},[tk,tj]);let tN=(0,r.useCallback)(()=>{let e=F.filter(e=>"user"===e.role).length;eb(!1),window.setTimeout(()=>{var t,a;tt($.l.BOT_NEW_CHAT,{previous_turn_count:e}),null===(t=eV.current)||void 0===t||t.abort(),eV.current=null,null===(a=eT.current)||void 0===a||a.abort(),eT.current=null,eJ.current=null,eC.current=0,H([]),G(""),Y(!1),V(!1),eA(!1),ew(!1),ev(null),eG.current="",e$.current=[],eY.current=!1,eZ.current=!1,eX.current=eQ,e2.current.clear(),e0.current&&clearTimeout(e0.current),eK(crypto.randomUUID())},0)},[tt,F]),t_=F.length>0,tS=F.reduce((e,t)=>"user"===t.role?t.id:e,""),tC=R?R.suggestedStarterChips:((null==em?void 0:null===(t=em.trending)||void 0===t?void 0:null===(e=t.trendingSearches)||void 0===e?void 0:e.length)?em.trending.trendingSearches:["wireless headphones under $100","best coffee maker","nike running shoes","laptop bag for work"]).slice(0,3),tI=null!==(h=null==em?void 0:em.profile)&&void 0!==h?h:null,tA=null!==(m=null==tI?void 0:null===(a=tI.displayName)||void 0===a?void 0:a.split(" ")[0])&&void 0!==m?m:null,tT=null!==(g=null==tI?void 0:null===(c=tI.upcomingEvents)||void 0===c?void 0:c[0])&&void 0!==g?g:null,tP=null!==(f=null==tI?void 0:null===(u=tI.wishlists)||void 0===u?void 0:u.filter(e=>e.slug&&e.productCount>0).slice(0,2).map(e=>({label:"Open ".concat(e.title),type:"action",href:"/wishlists/".concat(e.slug)})))&&void 0!==f?f:[],tL=R?(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:'\n        [data-partner-theme="'.concat(R.slug,'"] .bg-brand { background-color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .hover\\:bg-brand-hover:hover { background-color: ').concat(R.theme.primary,' !important; filter: brightness(0.92); }\n        [data-partner-theme="').concat(R.slug,'"] .text-brand { color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .hover\\:text-brand:hover { color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .border-brand { border-color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .hover\\:border-brand:hover { border-color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .focus\\:border-brand:focus { border-color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .focus\\:ring-brand:focus { --tw-ring-color: ').concat(R.theme.primary,' !important; }\n        [data-partner-theme="').concat(R.slug,'"] .assistant-chat-bubble {\n          background-color: color-mix(in srgb, ').concat(R.theme.primary," 10%, white) !important;\n          color: rgb(15 23 42) !important;\n          border-color: color-mix(in srgb, ").concat(R.theme.primary," 22%, white) !important;\n        }\n      ")}}):null,tO=U&&M?(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:'\n        [data-embed-brand="1"] .bg-brand { background-color: '.concat(M,' !important; }\n        [data-embed-brand="1"] .hover\\:bg-brand-hover:hover { background-color: ').concat(M,' !important; filter: brightness(0.92); }\n        [data-embed-brand="1"] .text-brand { color: ').concat(M,' !important; }\n        [data-embed-brand="1"] .hover\\:text-brand:hover { color: ').concat(M,' !important; }\n        [data-embed-brand="1"] .border-brand { border-color: ').concat(M,' !important; }\n        [data-embed-brand="1"] .hover\\:border-brand:hover { border-color: ').concat(M,' !important; }\n        [data-embed-brand="1"] .focus\\:border-brand:focus { border-color: ').concat(M,' !important; }\n        [data-embed-brand="1"] .focus\\:ring-brand:focus { --tw-ring-color: ').concat(M,' !important; }\n        [data-embed-brand="1"] .assistant-chat-bubble {\n          background-color: color-mix(in srgb, ').concat(M," 10%, white) !important;\n          color: rgb(15 23 42) !important;\n          border-color: color-mix(in srgb, ").concat(M," 22%, white) !important;\n        }\n      ")}}
1):null,tE=R?{"data-partner-theme":R.slug}:U&&M?{"data-embed-brand":"1"}:{},tR=(0,n.jsx)(o.n,{isOpen:eu,onClose:()=>ep(!1)}),tB=S?"h-full min-h-0":"h-screen",tz=S&&_?(0,n.jsx)("button",{type:"button",onClick:_,title:"Close","aria-label":"Close AI assistant",className:"flex shrink-0 items-center justify-center w-9 h-9 text-slate-500 rounded-xl transition-colors border border-slate-200 bg-white/90 hover:bg-slate-100 hover:text-slate-700",children:(0,n.jsx)(z.A,{className:"w-4 h-4"})}):null;return t_?(0,n.jsxs)("div",{className:"relative flex flex-col ".concat(tB," min-h-0 bg-slate-50"),...tE,children:[tL,tO,(0,n.jsx)("header",{className:"flex-shrink-0 bg-white border-b border-slate-200 ".concat(S?"":"pt-safe"),children:(0,n.jsxs)("div",{className:"max-w-2xl mx-auto px-4 py-2 flex items-center gap-2",children:[(0,n.jsx)("a",{href:R?R.homepageUrl:"/",target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0",children:(0,n.jsx)(d.default,{src:R?R.theme.logoSrc:"/images/logos/lmk.today.icon.png",alt:R?R.theme.logoAlt:"lmk.today",width:null!==(w=null==R?void 0:R.theme.logoWidth)&&void 0!==w?w:28,height:null!==(k=null==R?void 0:R.theme.logoHeight)&&void 0!==k?k:28,className:R?"h-7 w-auto":"rounded"})}),(0,n.jsx)("span",{className:"text-sm font-semibold text-slate-900",children:R?"".concat(R.displayName," Shopping Assistant"):"Shopping Assistant"}),R&&(0,n.jsxs)("a",{href:"https://lmk.today",target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex items-center gap-1 text-[10px] font-medium text-slate-400 hover:text-slate-600 transition-colors",children:[(0,n.jsx)("span",{children:"Powered by"}),(0,n.jsx)(d.default,{src:"/images/logos/LMK.only.png",alt:"LMK",width:27,height:12,className:"h-3 w-auto"})]}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,n.jsx)("button",{type:"button",onClick:()=>eb(!0),title:"Start new chat","aria-label":"Start new chat",className:"flex shrink-0 items-center justify-center w-9 h-9 text-slate-500 rounded-xl transition-colors border border-slate-200 bg-slate-50/80 hover:bg-slate-100 hover:text-brand hover:border-slate-300",children:(0,n.jsx)(eO.A,{className:"w-4 h-4"})}),S?tz:U?null:(0,n.jsx)(e7,{user:ei,variant:"header",authSource:D})]})]})}),(0,n.jsx)("main",{ref:eN,onScroll:tl,className:"flex-1 min-h-0 overflow-y-auto overscroll-contain",children:(0,n.jsxs)("div",{className:"max-w-2xl mx-auto px-4 py-6 space-y-6",children:[F.map((e,t)=>{var a,r,l,s,i,o;if("user"===e.role)return(0,n.jsx)("div",{ref:e.id===tS?e_:void 0,className:"flex justify-end scroll-mt-4",children:(0,n.jsx)("div",{className:"max-w-[80%] bg-brand text-white rounded-2xl rounded-br-sm px-4 py-2.5 shadow-sm",children:(0,n.jsx)("p",{className:"text-sm",children:e.content})})},e.id);let c=null===(a=F.slice(0,t).reverse().find(e=>"user"===e.role))||void 0===a?void 0:a.content,d=e.id===(null===(r=F[F.length-1])||void 0===r?void 0:r.id),u=J&&d,p=t<F.length-1&&F.slice(t+1).some(e=>"user"===e.role),h=u&&!(null===(l=e.products)||void 0===l?void 0:l.length)&&(!!e.searchPending||!!e.statusMessage),m=e.statusMessage||q,g=e.statusStage||"searching",f=d&&!u&&!!(null===(s=e.products)||void 0===s?void 0:s.length)&&!(null===(i=e.planSections)||void 0===i?void 0:i.length)&&!p,b=!!e.planning&&!p;return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(C,{textContent:e.content,products:e.products,isComplete:!!e.products||!!e.content||!u,isStreaming:u,isLoading:h,thinkingStage:h?{stage:g,message:m}:null,showSearchingMerchantTags:"gap"!==E,chipsPending:!!d&&!p&&!!e.chipsPending,suggestedFollowups:d&&!p?e.followups:void 0,onFollowup:tu,searchQuery:c,assistantTintUsesPartnerTheme:!!R,onBoldPhraseSuggest:tp,useCarousel:!0,onProductClick:ta}),f&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 px-1",children:e9.filter(t=>{var a,n,r;return(null!==(n=t.minProducts)&&void 0!==n?n:0)<=(null!==(r=null===(a=e.products)||void 0===a?void 0:a.length)&&void 0!==r?r:0)}).map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>tu(e.message,e.label),className:"px-3 py-1.5 rounded-full text-[13px] font-medium border border-slate-200 bg-white text-slate-700 hover:border-brand hover:text-brand transition-colors touch-manipulation",children:e.label},e.label))}),b&&(0,n.jsx)(eh,{gender:e.planning.gender,activities:e.planning.activities,budget:e.planning.budget,busy:!!e.building,onGender:t=>tm(e.id,t),onToggleActivity:t=>tg(e.id,t),onBudget:t=>tf(e.id,t),onBuild:()=>tx(e.id),onSkip:()=>tv(e.id)}),e.building&&(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-500 px-1",children:[(0,n.jsx)(L.A,{className:"w-4 h-4 animate-spin"}),"Building your packing list…"]}),!!(null===(o=e.planSections)||void 0===o?void 0:o.length)&&(0,n.jsx)("div",{className:"space-y-4",children:e.planSections.map(e=>(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 px-1",children:e.label}),(0,n.jsx)(N,{products:e.products,onProductClick:ta,searchQuery:e.label})]},e.label))})]},e.id)}),Q&&(0,n.jsx)(y,{}),(0,n.jsx)("div",{ref:ek})]})}),eI&&(0,n.jsxs)("button",{type:"button",onClick:ts,className:"absolute left-1/2 -translate-x-1/2 bottom-24 z-20 flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-brand text-white text-xs font-medium shadow-lg hover:bg-brand-hover transition-colors touch-manipulation",children:[(0,n.jsx)(eE.A,{className:"w-3.5 h-3.5"}),"New results"]}),(0,n.jsx)("footer",{className:"flex-shrink-0 bg-white border-t border-slate-200 pb-safe",children:(0,n.jsx)("div",{className:"max-w-2xl mx-auto px-4 py-3",children:(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ty()},className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)("input",{ref:ej,type:"text",value:K,onChange:e=>{G(e.target.value),to()},placeholder:tr?"Ask about these, refine, or search new...":"Ask anything or search for a product...",className:"flex-1 min-w-0 px-4 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm focus:outline-none focus:border-brand focus:bg-white transition-colors",disabled:J}),(0,n.jsx)("button",{type:"button",onClick:ty,disabled:J||!K.trim(),className:"relative z-10 flex shrink-0 items-center justify-center w-10 h-10 bg-brand text-white rounded-xl touch-manipulation hover:bg-brand-hover disabled:bg-slate-200 disabled:text-slate-400 disabled:cursor-not-allowed transition-colors",children:(0,n.jsx)(eL.A,{className:"w-4 h-4 pointer-events-none"})})]})})}),(0,n.jsx)(e8.Lt,{open:ef,onOpenChange:eb,children:(0,n.jsxs)(e8.EO,{className:S?"z-[11002]":void 0,overlayClassName:S?"z-[11002]":void 0,children:[(0,n.jsxs)(e8.wd,{children:[(0,n.jsx)(e8.r7,{children:"Start a new chat?"}),(0,n.jsx)(e8.$v,{children:"This clears your current conversation and search results. You can't undo this."})]}),(0,n.jsxs)(e8.ck,{children:[(0,n.jsx)(e8.Zr,{children:"Cancel"}),(0,n.jsx)(e8.Rx,{onClick:tN,children:"Start new chat"})]})]})}),(0,n.jsx)(Z,{isOpen:ey,onClose:()=>ew(!1),product:ex,partnerThemeAttr:tE,presentation:S?"contained":"flyout"}),tR]}):(0,n.jsxs)("div",{className:"flex flex-col ".concat(tB," bg-slate-50 ").concat(S?"":"pt-safe pb-safe"),...tE,children:[tL,tO,S?(0,n.jsx)("div",{className:"absolute top-3 right-3 z-10",children:tz}):U?null:(0,n.jsx)("div",{className:"absolute top-3 right-3 z-10 pt-safe",children:(0,n.jsx)(e7,{user:ei,variant:"light",authSource:D})}),(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center px-4",children:(0,n.jsxs)("div",{className:"w-full max-w-xl text-center space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,n.jsx)(d.default,{src:R?R.theme.logoSrc:"/images/logos/lmk.today.icon.png",alt:R?R.theme.logoAlt:"lmk.today",width:null!==(b=null==R?void 0:R.theme.logoWidth)&&void 0!==b?b:56,height:null!==(x=null==R?void 0:R.theme.logoHeight)&&void 0!==x?x:56,className:R?"h-14 w-auto":"rounded-2xl shadow-lg",priority:!0}),(0,n.jsx)("span",{className:"text-[11px] font-semibold tracking-widest text-slate-400 uppercase",children:R?"".concat(R.displayName," Shopping"):"AI Shopping"}),R&&(0,n.jsxs)("a",{href:"https://lmk.today",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] font-medium text-slate-400 hover:text-slate-600 transition-colors",children:[(0,n.jsx)("span",{children:"Powered by"}),(0,n.jsx)(d.default,{src:"/images/logos/LMK.only.png",alt:"LMK",width:32,height:14,className:"h-3.5 w-auto"})]})]}),(0,n.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-slate-900",children:R?"How can I help you at ".concat(R.displayName,"?"):tA?"Hey ".concat(tA," — what can I help you find?"):tI?"Hey you — what can I help you find?":"Hi, I'm your shopping assistant. What can I help you find?"}),(0,n.jsx)("p",{className:"text-slate-500 text-sm",children:R?R.welcomeCopy:tT?"Your ".concat(tT.title," is ").concat(tT.daysAway," days away — need help finding gifts?"):"Ask me anything — I can search 20+ retailers, compare options, or just help you think it through."}),(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),td(K)},className:"relative max-w-lg mx-auto",children:[(0,n.jsx)(eP.A,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400 pointer-events-none"}),(0,n.jsx)("input",{ref:ej,type:"text",value:K,onChange:e=>G(e.target.value),placeholder:"Ask anything, or search for a product...",className:"w-full pl-10 pr-12 py-3 bg-white border border-slate-200 rounded-2xl text-sm shadow-sm focus:outline-none focus:border-brand focus:ring-2 focus:ring-brand transition-all",autoFocus:!0}),(0,n.jsx)("button",{type:"button",onClick:()=>td(K),disabled:!K.trim(),className:"absolute right-2 top-1/2 -translate-y-1/2 z-10 w-8 h-8 flex items-center justify-center bg-brand text-white rounded-xl touch-manipulation hover:bg-brand-hover disabled:bg-slate-200 disabled:text-slate-400 transition-colors",children:(0,n.jsx)(eL.A,{className:"w-3.5 h-3.5 pointer-events-none"})})]}),!R&&tP.length>0&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-xs text-slate-400",children:"Your wishlists:"}),(0,n.jsx)(v,{suggestions:tP,onSelect:()=>{}})]}),R?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-xs text-slate-400",children:"Popular right now:"}),(0,n.jsx)("div",{className:"grid grid-cols-2 gap-2",children:tC.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>{tt($.l.BOT_QUICK_START_TAPPED,{label:e,partner:!0}),td(e,{forceSearch:!0})},className:"flex items-center justify-center px-3 py-3 rounded-xl border border-slate-200 bg-white text-sm font-medium text-slate-700 shadow-sm hover:border-brand hover:text-brand transition-colors touch-manipulation text-center",children:e},e))})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-xs text-slate-400",children:"Or jump in:"}),(0,n.jsx)("div",{className:"grid grid-cols-4 gap-2",children:e6.map(e=>{let{label:t,query:a,Icon:r}=e;return(0,n.jsxs)("button",{type:"button",onClick:()=>{tt($.l.BOT_QUICK_START_TAPPED,{label:t,query:a}),td(a,{forceSearch:!0})},className:"flex flex-col items-center gap-1.5 px-1.5 py-3 rounded-xl border border-slate-200 bg-white shadow-sm hover:border-brand hover:text-brand text-slate-600 transition-colors touch-manipulation",children:[(0,n.jsx)(r,{className:"w-5 h-5"}),(0,n.jsx)("span",{className:"text-[11px] font-medium leading-none",children:t})]},t)})})]})]})}),(0,n.jsxs)("div",{className:"text-center pb-4 px-4 space-y-1",children:[(0,n.jsxs)("p",{className:"text-[11px] text-slate-400",children:["By using AI Shopping you agree to the"," ",(0,n.jsx)("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-slate-600",children:"Terms"})," ","and"," ",(0,n.jsx)("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-slate-600",children:"Privacy Policy"}),"."]}),(0,n.jsx)("p",{className:"text-[10px] text-slate-400",children:"We may earn a commission when you shop through our links."})]}),tR]})}},90010:(e,t,a)=>{a.d(t,{$v:()=>g,EO:()=>u,Lt:()=>o,Rx:()=>f,Zr:()=>b,ck:()=>h,r7:()=>m,wd:()=>p});var n=a(95155),r=a(12115),l=a(17649),s=a(59434),i=a(30285);let o=l.bL;l.l9;let c=l.ZL,d=r.forwardRef((e,t)=>
1{let{className:a,...r}=e;return(0,n.jsx)(l.hJ,{className:(0,s.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r,ref:t})});d.displayName=l.hJ.displayName;let u=r.forwardRef((e,t)=>{let{className:a,overlayClassName:r,...i}=e;return(0,n.jsxs)(c,{children:[(0,n.jsx)(d,{className:r}),(0,n.jsx)(l.UC,{ref:t,className:(0,s.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...i})]})});u.displayName=l.UC.displayName;let p=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};p.displayName="AlertDialogHeader";let h=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,s.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};h.displayName="AlertDialogFooter";let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(l.hE,{ref:t,className:(0,s.cn)("text-lg font-semibold",a),...r})});m.displayName=l.hE.displayName;let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(l.VY,{ref:t,className:(0,s.cn)("text-sm text-muted-foreground",a),...r})});g.displayName=l.VY.displayName;let f=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(l.rc,{ref:t,className:(0,s.cn)((0,i.r)(),a),...r})});f.displayName=l.rc.displayName;let b=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(l.ZD,{ref:t,className:(0,s.cn)((0,i.r)({variant:"outline"}),"mt-2 sm:mt-0",a),...r})});b.displayName=l.ZD.displayName}}]);

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.