@anker-in/headless-ui 1.1.9-alpha.1765532456638 → 1.1.9-alpha.1765794787092

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var b=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var r in o)b(t,r,{get:o[r],enumerable:!0})},j=(t,o,r,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of W(o))!_.call(t,l)&&l!==r&&b(t,l,{get:()=>o[l],enumerable:!(i=B(o,l))||i.enumerable});return t};var q=t=>j(b({},"__esModule",{value:!0}),t);var M={};G(M,{canSearch:()=>L,default:()=>H});module.exports=q(M);var e=require("react/jsx-runtime"),a=require("../../components/index.js"),h=require("../HeaderNavigation/icons/index.js"),p=require("react"),w=require("../AiuiProvider/index.js"),m=require("./types.js"),C=require("es-toolkit"),c=require("../../helpers/utils.js");const L=t=>!(t.metafields?.global?.HideSearch||t.metafields?.seo?.hidden||t.metafields?.seo?.setting?.noindex),z=(0,p.forwardRef)(({data:t,onSearch:o,onClose:r,searchResult:i,isSearching:l,keywords:d},D)=>{const{locale:g="us",copyWriting:V}=(0,w.useAiuiContext)(),[n,F]=(0,p.useState)(""),[f,N]=(0,p.useState)(!1),$=(0,C.debounce)(s=>{o(s)},300),P=(0,p.useCallback)(s=>{s.key==="Enter"&&!f&&o(n)},[f,n,o]),S=(0,p.useMemo)(()=>Array.isArray(d)&&d?.length?d.map(s=>s.search_term):Array.isArray(t?.popularWords)&&t?.popularWords?.length?t?.popularWords.map(s=>s.popularWord):[],[d,t?.popularWords]),E=(0,p.useCallback)(s=>{switch(s.type){case"Product":return`/products${s.path}?q=${n.toLowerCase()}`;case"Article":return`/blogs/${s.blog.handle}/${s.handle.replace("storefront-","")}?q=${n.toLowerCase()}`;default:break}},[n]),k=(0,p.useMemo)(()=>{if(n){if(i?.totalCount)return m.SearchStatus.Predict;if(!l)return m.SearchStatus.Empty}else return m.SearchStatus.Default},[i?.totalCount,n]);return(0,e.jsxs)(a.Container,{childClassName:"!bg-white",className:"relative",ref:D,children:[(0,e.jsx)("style",{jsx:!0,global:!0,children:`
1
+ "use strict";var b=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var q=(t,a)=>{for(var r in a)b(t,r,{get:a[r],enumerable:!0})},G=(t,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of _(a))!W.call(t,l)&&l!==r&&b(t,l,{get:()=>a[l],enumerable:!(i=B(a,l))||i.enumerable});return t};var j=t=>G(b({},"__esModule",{value:!0}),t);var M={};q(M,{canSearch:()=>C,default:()=>H});module.exports=j(M);var e=require("react/jsx-runtime"),s=require("../../components/index.js"),h=require("../HeaderNavigation/icons/index.js"),p=require("react"),w=require("../AiuiProvider/index.js"),g=require("./types.js"),L=require("es-toolkit"),c=require("../../helpers/utils.js");const C=t=>!(t.metafields?.global?.HideSearch||t.metafields?.seo?.hidden||t.metafields?.seo?.setting?.noindex),z=(0,p.forwardRef)(({data:t,onSearch:a,onClose:r,searchResult:i,isSearching:l,keywords:m},$)=>{const{locale:d="us",copyWriting:V}=(0,w.useAiuiContext)(),[n,D]=(0,p.useState)(""),[f,N]=(0,p.useState)(!1),F=(0,L.debounce)(o=>{a(o)},300),S=(0,p.useCallback)(o=>{o.key==="Enter"&&!f&&window.open(`${d==="us"?"":d}${t?.moreLink}?q=${n.toLowerCase()}`,"_self")},[f,n,d,t?.moreLink]),P=(0,p.useMemo)(()=>Array.isArray(m)&&m?.length?m.map(o=>o.search_term):Array.isArray(t?.popularWords)&&t?.popularWords?.length?t?.popularWords.map(o=>o.popularWord):[],[m,t?.popularWords]),E=(0,p.useCallback)(o=>{switch(o.type){case"Product":return`/products${o.path}?q=${n.toLowerCase()}`;case"Article":return`/blogs/${o.blog.handle}/${o.handle.replace("storefront-","")}?q=${n.toLowerCase()}`;default:break}},[n]),k=(0,p.useMemo)(()=>{if(n){if(i?.totalCount)return g.SearchStatus.Predict;if(!l)return g.SearchStatus.Empty}else return g.SearchStatus.Default},[i?.totalCount,n,l]);return(0,e.jsxs)(s.Container,{childClassName:"!bg-white",className:"relative",ref:$,children:[(0,e.jsx)("style",{jsx:!0,global:!0,children:`
2
2
  .navigation-search-component input:-webkit-autofill,
3
3
  .navigation-search-component input:-webkit-autofill:hover,
4
4
  .navigation-search-component input:-webkit-autofill:focus {
@@ -7,5 +7,5 @@
7
7
  transition: background-color 9999s ease-in-out 0s !important;
8
8
  caret-color: #000;
9
9
  }
10
- `}),(0,e.jsxs)("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between border-b border-b-gray-200 py-4 text-black",children:[(0,e.jsx)("input",{value:n,onCompositionStart:()=>N(!0),onCompositionEnd:()=>N(!1),onKeyDown:P,onChange:s=>{F(s.target.value),s.target.value&&$(s.target.value)},type:"text",className:"basis-[200px] bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none",placeholder:t?.placeholder}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(h.Search,{className:"size-5 cursor-pointer",onClick:()=>o(n)}),(0,e.jsx)("div",{className:"h-[20px] w-px bg-[#E4E5E6]"}),(0,e.jsx)(h.Close,{className:"size-5 cursor-pointer",onClick:r})]})]}),(0,e.jsx)("div",{className:"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black",children:k===m.SearchStatus.Predict?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(a.Text,{html:t?.suggestText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),i?.items?.length>6&&(0,e.jsx)(a.Button,{as:"a",href:`${g==="us"?"":g}${t?.moreLink}?q=${n.toLowerCase()}`,className:"!p-0 !text-sm font-bold leading-[1.2]",variant:"link",children:t?.moreText})]}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:i?.items?.filter(s=>L(s)).slice(0,6)?.map(s=>(0,e.jsx)(a.Link,{className:"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current",href:E(s),children:(0,e.jsx)(a.Text,{html:(0,c.highlightSearchWord)(s.title,n),className:"cursor-pointer text-sm font-bold leading-[1.4]"})},s.id))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(a.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[(0,e.jsx)(a.Link,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(a.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(a.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:(0,c.cn)("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),(0,e.jsx)(a.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:(0,c.cn)("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),i?.items?.filter(s=>s.type.toLowerCase()==="product").slice(0,7)?.map(s=>{const u=s?.variants?.[0],v=`${u?.image?.url||s?.images?.[0]?.url}`,x=s?.title||s?.name,I=s?.description,T=s?.badge||"",A=`/products/${s?.handle}?variant=${(0,c.atobID)(u?.id)}`;return(0,e.jsx)(y,{productImage:v,productName:x,productDesc:I,productBadge:T,listingLink:A},s.id)})]})]})]}):(0,e.jsxs)(e.Fragment,{children:[k===m.SearchStatus.Empty&&(0,e.jsx)(a.Text,{html:t?.noResultText,as:"p",className:"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(a.Text,{html:t?.popularText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)(K,{data:t,keywords:S,locale:g}),Array.isArray(t?.popularPages)&&!!t?.popularPages?.length&&(0,e.jsx)(a.Grid,{className:"laptop:gap-4 laptop:mt-4 mt-3 gap-3",children:t?.popularPages?.map(s=>(0,e.jsx)(a.GridItem,{className:"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]",children:(0,e.jsx)("a",{href:`${g==="us"?"":g}${t?.moreLink}?q=${s?.popularPage.toLowerCase()}`,className:"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]",children:s?.popularPage})},s?.id))})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(a.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[(0,e.jsx)(a.Link,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:(0,e.jsxs)("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[(0,e.jsx)(a.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(a.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:"font-bold text-white"}),(0,e.jsx)(a.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),t?.hotProducts?.slice(0,7)?.map(s=>{const u=s?.custom_description,v=s?.badge||"",x=`/products/${s?.handle}?variant=${(0,c.atobID)(s?.shopify_id)}`;return(0,e.jsx)(y,{productImage:s?.image,productName:s?.name,productDesc:u,productBadge:v,listingLink:x},s.id)})]})]})]})})]})}),y=({productImage:t,productName:o,productDesc:r,productBadge:i,className:l,listingLink:d})=>(0,e.jsxs)("div",{className:(0,c.cn)("flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",l),children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)(a.Picture,{source:t,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:" h-[24px] ",children:i&&(0,e.jsx)(a.Text,{as:"p",html:i,className:"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(a.Link,{href:d,className:"no-underline hover:text-current",children:(0,e.jsx)(a.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:o})}),r&&(0,e.jsx)(a.Text,{as:"p",html:r,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})]}),K=({data:t,keywords:o,locale:r})=>(0,e.jsx)("div",{className:"laptop:gap-4 flex flex-wrap gap-3",children:o?.map((i,l)=>(0,e.jsx)("a",{href:`${r==="us"?"":r}${t?.moreLink}?q=${i?.toLowerCase()}`,className:"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]",children:i},l))});var H=z;
10
+ `}),(0,e.jsxs)("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between border-b border-b-gray-200 py-4 text-black",children:[(0,e.jsx)("input",{value:n,onCompositionStart:()=>N(!0),onCompositionEnd:()=>N(!1),onKeyDown:S,onChange:o=>{D(o.target.value),o.target.value&&F(o.target.value)},type:"text",className:"basis-[200px] bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none",placeholder:t?.placeholder}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(h.Search,{className:"size-5 cursor-pointer",onClick:()=>a(n)}),(0,e.jsx)("div",{className:"h-[20px] w-px bg-[#E4E5E6]"}),(0,e.jsx)(h.Close,{className:"size-5 cursor-pointer",onClick:r})]})]}),(0,e.jsx)("div",{className:"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black",children:k===g.SearchStatus.Predict?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(s.Text,{html:t?.suggestText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),i?.items?.length>6&&(0,e.jsx)(s.Button,{as:"a",href:`${d==="us"?"":d}${t?.moreLink}?q=${n.toLowerCase()}`,className:"!p-0 !text-sm font-bold leading-[1.2]",variant:"link",children:t?.moreText})]}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:i?.items?.filter(o=>C(o)).slice(0,6)?.map(o=>(0,e.jsx)(s.Link,{className:"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current",href:E(o),children:(0,e.jsx)(s.Text,{html:(0,c.highlightSearchWord)(o.title,n),className:"cursor-pointer text-sm font-bold leading-[1.4]"})},o.id))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[(0,e.jsx)(s.Link,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(s.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(s.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:(0,c.cn)("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),(0,e.jsx)(s.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:(0,c.cn)("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),i?.items?.filter(o=>o.type.toLowerCase()==="product").slice(0,7)?.map(o=>{const u=o?.variants?.[0],v=`${u?.image?.url||o?.images?.[0]?.url}`,x=o?.title||o?.name,I=o?.description,T=o?.badge||"",A=`/products/${o?.handle}?variant=${(0,c.atobID)(u?.id)}`;return(0,e.jsx)(y,{productImage:v,productName:x,productDesc:I,productBadge:T,listingLink:A},o.id)})]})]})]}):(0,e.jsxs)(e.Fragment,{children:[k===g.SearchStatus.Empty&&(0,e.jsx)(s.Text,{html:t?.noResultText,as:"p",className:"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{html:t?.popularText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)(K,{data:t,keywords:P,locale:d}),Array.isArray(t?.popularPages)&&!!t?.popularPages?.length&&(0,e.jsx)(s.Grid,{className:"laptop:gap-4 laptop:mt-4 mt-3 gap-3",children:t?.popularPages?.map(o=>(0,e.jsx)(s.GridItem,{className:"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]",children:(0,e.jsx)("a",{href:`${d==="us"?"":d}${t?.moreLink}?q=${o?.popularPage.toLowerCase()}`,className:"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]",children:o?.popularPage})},o?.id))})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[(0,e.jsx)(s.Link,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:(0,e.jsxs)("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[(0,e.jsx)(s.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(s.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:"font-bold text-white"}),(0,e.jsx)(s.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),t?.hotProducts?.slice(0,7)?.map(o=>{const u=o?.custom_description,v=o?.badge||"",x=`/products/${o?.handle}?variant=${(0,c.atobID)(o?.shopify_id)}`;return(0,e.jsx)(y,{productImage:o?.image,productName:o?.name,productDesc:u,productBadge:v,listingLink:x},o.id)})]})]})]})})]})}),y=({productImage:t,productName:a,productDesc:r,productBadge:i,className:l,listingLink:m})=>(0,e.jsxs)("div",{className:(0,c.cn)("flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",l),children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)(s.Picture,{source:t,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:" h-[24px] ",children:i&&(0,e.jsx)(s.Text,{as:"p",html:i,className:"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Link,{href:m,className:"no-underline hover:text-current",children:(0,e.jsx)(s.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:a})}),r&&(0,e.jsx)(s.Text,{as:"p",html:r,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})]}),K=({data:t,keywords:a,locale:r})=>(0,e.jsx)("div",{className:"laptop:gap-4 flex flex-wrap gap-3",children:a?.map((i,l)=>(0,e.jsx)("a",{href:`${r==="us"?"":r}${t?.moreLink}?q=${i?.toLowerCase()}`,className:"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]",children:i},l))});var H=z;
11
11
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/NavigationSearch/index.tsx"],
4
- "sourcesContent": ["import { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n onSearch(searchValue)\n }\n },\n [isComposing, searchValue, onSearch]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n switch (item.type) {\n case 'Product':\n return `/products${item.path}?q=${searchValue.toLowerCase()}`\n case 'Article':\n return `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`\n default:\n break\n }\n },\n [searchValue]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue])\n\n return (\n <Container childClassName=\"!bg-white\" className=\"relative\" ref={ref}>\n <style jsx global>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between border-b border-b-gray-200 py-4 text-black\">\n <input\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"basis-[200px] bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none\"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-2\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, 7)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className=\"font-bold text-white\"\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className=\"text-sm font-bold text-white\"\n />\n </div>\n </div>\n </Link>\n {data?.hotProducts?.slice(0, 7)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <div className={cn('flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110', className)}>\n <div className=\"shrink-0\">\n <Picture\n source={productImage}\n width={90}\n height={90}\n className=\"size-[96px]\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]\"\n />\n )}\n </div>\n <div>\n <Link href={listingLink} className=\"no-underline hover:text-current\">\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n </Link>\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${keyword?.toLowerCase()}`}\n key={index}\n className=\"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GA8EQ,IAAAK,EAAA,6BA9ERC,EAAgF,qCAChFC,EAAyD,8CACzDC,EAA2D,iBAE3DC,EAA+B,oCAE/BC,EAA6B,sBAE7BC,EAAyB,sBACzBC,EAAgD,kCAEzC,MAAMV,EAAaW,GACjB,EACLA,EAAO,YAAY,QAAQ,YAC3BA,EAAO,YAAY,KAAK,QACxBA,EAAO,YAAY,KAAK,SAAS,SAI/BC,KAAmB,cACvB,CAAC,CAAE,KAAAC,EAAM,SAAAC,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,WACb,mBAAC,WACC,OAAQP,EACR,MAAO,GACP,OAAQ,GACR,UAAU,cACV,aAAa,wBACf,EACF,KACA,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,UAAU,aACZ,SAAAG,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,gIACZ,EAEJ,KACA,QAAC,OACC,oBAAC,QAAK,KAAMC,EAAa,UAAU,kCACjC,mBAAC,QACC,UAAU,iGACV,KAAMH,EACR,EACF,EACCC,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,sFACZ,GAEJ,GACF,GACF,EAIEI,EAAgB,CAAC,CAAE,KAAAhC,EAAM,SAAAK,EAAU,OAAAE,CAAO,OAE5C,OAAC,OAAI,UAAU,oCACZ,SAAAF,GAAU,IAAI,CAACa,EAAcgB,OAC5B,OAAC,KACC,KAAM,GAAG3B,IAAW,KAAO,GAAKA,CAAM,GAAGP,GAAM,QAAQ,MAAMkB,GAAS,YAAY,CAAC,GAEnF,UAAU,+FAET,SAAAA,GAHIgB,CAIP,CACD,EACH,EAIJ,IAAO9C,EAAQW",
4
+ "sourcesContent": ["import { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n window.open(`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`, '_self')\n }\n },\n [isComposing, searchValue, locale, data?.moreLink]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n switch (item.type) {\n case 'Product':\n return `/products${item.path}?q=${searchValue.toLowerCase()}`\n case 'Article':\n return `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`\n default:\n break\n }\n },\n [searchValue]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue, isSearching])\n\n return (\n <Container childClassName=\"!bg-white\" className=\"relative\" ref={ref}>\n <style jsx global>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between border-b border-b-gray-200 py-4 text-black\">\n <input\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"basis-[200px] bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none\"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-2\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, 7)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className=\"font-bold text-white\"\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className=\"text-sm font-bold text-white\"\n />\n </div>\n </div>\n </Link>\n {data?.hotProducts?.slice(0, 7)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <div className={cn('flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110', className)}>\n <div className=\"shrink-0\">\n <Picture\n source={productImage}\n width={90}\n height={90}\n className=\"size-[96px]\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]\"\n />\n )}\n </div>\n <div>\n <Link href={listingLink} className=\"no-underline hover:text-current\">\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n </Link>\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${keyword?.toLowerCase()}`}\n key={index}\n className=\"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GA8EQ,IAAAK,EAAA,6BA9ERC,EAAgF,qCAChFC,EAAyD,8CACzDC,EAA2D,iBAE3DC,EAA+B,oCAE/BC,EAA6B,sBAE7BC,EAAyB,sBACzBC,EAAgD,kCAEzC,MAAMV,EAAaW,GACjB,EACLA,EAAO,YAAY,QAAQ,YAC3BA,EAAO,YAAY,KAAK,QACxBA,EAAO,YAAY,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EJ,CACF,EAEMU,EAAgB,CAAC,CACrB,aAAAL,EACA,YAAAC,EACA,YAAAC,EACA,aAAAC,EACA,UAAAI,EACA,YAAAH,CACF,OASI,QAAC,OAAI,aAAW,MAAG,qEAAsEG,CAAS,EAChG,oBAAC,OAAI,UAAU,WACb,mBAAC,WACC,OAAQP,EACR,MAAO,GACP,OAAQ,GACR,UAAU,cACV,aAAa,wBACf,EACF,KACA,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,UAAU,aACZ,SAAAG,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,gIACZ,EAEJ,KACA,QAAC,OACC,oBAAC,QAAK,KAAMC,EAAa,UAAU,kCACjC,mBAAC,QACC,UAAU,iGACV,KAAMH,EACR,EACF,EACCC,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,sFACZ,GAEJ,GACF,GACF,EAIEI,EAAgB,CAAC,CAAE,KAAAhC,EAAM,SAAAK,EAAU,OAAAE,CAAO,OAE5C,OAAC,OAAI,UAAU,oCACZ,SAAAF,GAAU,IAAI,CAACa,EAAcgB,OAC5B,OAAC,KACC,KAAM,GAAG3B,IAAW,KAAO,GAAKA,CAAM,GAAGP,GAAM,QAAQ,MAAMkB,GAAS,YAAY,CAAC,GAEnF,UAAU,+FAET,SAAAA,GAHIgB,CAIP,CACD,EACH,EAIJ,IAAO9C,EAAQW",
6
6
  "names": ["NavigationSearch_exports", "__export", "canSearch", "NavigationSearch_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_icons", "import_react", "import_AiuiProvider", "import_types", "import_es_toolkit", "import_utils", "target", "NavigationSearch", "data", "onSearch", "onClose", "searchResult", "isSearching", "keywords", "ref", "locale", "copyWriting", "searchValue", "setSearchValue", "isComposing", "setIsComposing", "debouncedFunction", "value", "handleKeyDown", "e", "searchKeywords", "keyword", "word", "getLink", "item", "searchStatus", "SearchIcon", "CloseIcon", "variant", "productImage", "productName", "productDesc", "productBadge", "listingLink", "SearchProduct", "SearchKeyword", "className", "index"]
7
7
  }
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { HeaderNavigationProps } from './types.js';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<HeaderNavigationProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
4
- className?: string | undefined;
5
- data?: Record<string, any> | undefined;
6
- }, "ref"> & React.RefAttributes<any>>;
7
- export default _default;
3
+ declare const HeaderNavigation: React.ForwardRefExoticComponent<HeaderNavigationProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default HeaderNavigation;
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as X,jsx as e,jsxs as n}from"react/jsx-runtime";import we,{forwardRef as ee,useCallback as K,useEffect as H,useImperativeHandle as Ce,useMemo as M,useRef as F,useState as D}from"react";import{Picture as Q,Text as y,Button as T,Container as te,Link as O,Heading as ce}from"../../components/index.js";import{withLayout as Se}from"../../shared/Styles.js";import{cn as N,atobID as Le}from"../../helpers/utils.js";import Me,{useNavContext as I}from"./NavProvider.js";import{HeaderNavigationMenu as $,HeaderNavigationBlockType as W,HeaderNavigationActionBlockType as _}from"./types.js";import"react-responsive";import{debounce as De}from"es-toolkit";import Pe from"jump.js";import{useGSAP as se}from"@gsap/react";import{gsap as ie}from"gsap";import{WithSidebar as de,WithSupports as ue,WithMulticol as me,WithGroupCategory as pe}from"./withCategory.js";import{Menu as ze,Close as be,User as Ee,RightArrow as He,LeftArrow as Be,DownArrow as ae,Polygon as Te}from"./icons/index.js";import $e from"../NavigationSearch/index.js";const Re=ee((t,a)=>{const{data:{headerNavigation:l}={},buildProps:c,event:r,profile:b,theme:d="light",isTop:u=!1,searchResult:i,onSearch:k,isSearching:s,keywords:w,onPrimaryNavClick:x,onSeriesProductClick:f,onSidebarNavClick:v,headerId:g,cartCount:m}=t,o=F(null),[p,C]=D(!1),[S,z]=D(!1),[L,U]=D(!1),[J,P]=D(!1),R=F(null),A=()=>{const G=document?.querySelector("body")?.offsetWidth||0;P(G<=1440)};H(()=>(A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]),Ce(a,()=>R.current),H(()=>{R.current&&u&&Pe(R.current,{duration:0,offset:R.current?.getBoundingClientRect()?.bottom||0})},[u]),H(()=>{r&&(r.search=()=>C(!0))},[r]),se(()=>{o?.current&&p&&ie.fromTo(o.current,{height:0},{height:"auto",duration:.3})},[p]),H(()=>{document.documentElement.style.overflow=p?"hidden":"auto"},[p]);const ne=M(()=>l?.headerBar?.actions?.find(G=>G?.blockType===_.Search)?.searchBar?.[0]||{},[l]);return e(Me,{buildProps:c,profile:b,isMobile:J,event:r,payloadData:l,onSidebarNavClick:v,onSeriesProductClick:f,cartCount:m,children:e("header",{id:g||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:R,children:n("div",{className:N("hover:bg-white hover:text-black",d==="light"?"text-black":"text-white",{}),onClick:()=>U(!0),children:[e(Ae,{data:l,className:"desktop:block hidden !bg-white",theme:d,onNavItemClick:()=>U(!0),onPrimaryNavClick:x}),e(Oe,{data:l,className:"desktop:hidden block !bg-white",onPrimaryNavClick:x}),p&&n("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${R?.current?.getBoundingClientRect()?.top}px)`},children:[e("div",{ref:o,className:N("overflow-y-auto",{}),children:e($e,{data:ne,keywords:w,isSearching:s,searchResult:i,onSearch:G=>{k?.(G)},onClose:()=>{k?.(),C(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>C(!1)})]})]})})})}),Ae=ee((t,a)=>{const{data:l,onNavItemClick:c,className:r,theme:b,onPrimaryNavClick:d}=t,{event:u,profile:i}=I(),[k,s]=D(!1),w=M(()=>pe(l?.categories?.filter(h=>h?.pcShow)),[l]),[x,f]=D(null),[v,g]=D([]),m=F(null),[o,p]=D(!1),C=F(null),S=F(null),z=F(w.map(h=>Array(h?.length||0).fill(null)));H(()=>{w?.length&&g(w?.map((h,E)=>h?.map((B,j)=>({groupIndex:E,index:j,open:!1}))))},[w]);const L=M(()=>{let h=null;for(const E of v){for(const B of E)if(B.open){h=B;break}if(h)break}return h},[v]);H(()=>{document.documentElement.style.overflow=L?.open||o?"hidden":"auto"},[L?.open,o]);const U=(h,E,B)=>{if(p(!1),x?.components?.[0]?.blockType===W.Links)x?.components?.[0]?.url&&window.open(x?.components?.[0]?.url);else{const j=w?.flat()||[],q=j?.findIndex(re=>re?.id===w[E][B]?.id);h.stopPropagation(),c?.(),d?.(j[q],q),f(w[E][B]),g(re=>re.map(ke=>ke.map(Y=>Y.groupIndex===E&&Y.index===B?{...Y,open:!Y.open}:{...Y,open:!1})))}},J=()=>{g(h=>h.map(E=>E.map(B=>({...B,open:!1}))))},P=M(()=>{if(x)return x?.components?.[0]?.blockType},[x]),R=de(je,x),A=me(Fe,x),ne=ue(_e,{categoriesItem:x,currentNavItemRef:z.current?.[L?.groupIndex||0]?.[L?.index||0]}),G=M(()=>{switch(P){case W.Sidebar:return e(R,{});case W.Supports:return e(ne,{});case W.Multicol:return e(A,{});default:return null}},[P,x]),le=M(()=>l?.headerBar?.actions?.filter(h=>h?.pcShow),[l]),V=M(()=>le?.find(h=>h?.blockType===_.Profile),[le]),oe=K(()=>{p(h=>!h)},[]);return H(()=>{if(m?.current){const h=m.current;return h.addEventListener("click",oe),()=>{h.removeEventListener("click",oe)}}},[oe]),se(()=>{L?.open&&ie.fromTo(S?.current,{height:0},{height:"auto"})},[L?.open]),n(te,{className:N("relative h-[96px]",r),children:[n("div",{ref:C,onClick:J,className:"flex h-full flex-col justify-end gap-4",children:[n("div",{className:"flex items-center justify-between",children:[e(ye,{}),e(xe,{ref:m,actions:le,activeStatus:o})]}),e("div",{className:"flex justify-between",children:w?.map((h,E)=>e("div",{className:"flex gap-3",children:h?.map((B,j)=>e("div",{ref:q=>{z.current[E][j]=q},className:"group cursor-pointer",children:n("div",{className:"relative",children:[n("div",{className:"flex items-center gap-1 pb-4",onClick:q=>U(q,E,j),children:[e(y,{html:B.text,className:"text-sm font-bold leading-[1.4]"}),e(ae,{className:N("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":L?.groupIndex===E&&L?.index===j,"opacity-100":k&&L?.groupIndex===E&&L?.index===j})})]}),e("div",{className:N("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":L?.groupIndex===E&&L?.index===j},b==="dark"?"bg-white":"bg-[#080A0F]")})]})},B.id))},`groupCategory-${E}`))})]}),n("div",{className:N("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(L?.open&&x)}),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{height:`calc(100dvh - ${C?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:S,className:N("relative z-50",{"overflow-hidden":P!==W.Supports}),children:G}),e("div",{className:"flex-1 bg-transparent",onClick:J})]}),o&&n("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",children:[e("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${m?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:i?.email?n(X,{children:[e(y,{html:i?.nick_name||V?.welcome,className:"text-sm font-bold"}),e("div",{className:"mt-2 h-px bg-[#D9D9D9]"}),e("div",{className:"mt-2",children:V?.profiles?.map(h=>e(Z,{className:"py-2",label:h?.title,href:h?.url},h.id))})]}):n(X,{children:[e(Te,{className:"absolute -top-2 right-[46px] z-30 text-white"}),e(y,{html:V?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:V?.benefits?.map(h=>n("div",{className:"flex items-center gap-[6px]",children:[e(Q,{source:h.benefitIcon?.url,className:"size-4",alt:h.benefit,width:16,height:16}),e(y,{html:h.benefit,className:"text-sm font-bold leading-[1.4]"})]},h.id))}),n("div",{className:"mt-4 flex items-center gap-2",children:[e(T,{variant:"secondary",size:"lg",onClick:()=>u?.join?.(),children:e(y,{html:V?.primaryButton||"Join Now",className:"font-bold"})}),e(T,{variant:"primary",size:"lg",onClick:()=>u?.login?.(),children:e(y,{html:V?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>p(!1)})]})]})}),je=we.memo(({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{buildProps:l,onSidebarNavClick:c}=I(),[r,b]=D([]),[d,u]=D(-1),i=F(null),k=K(()=>{const f=t?.subcategories;if(!f?.length)return;const v=f.findIndex(o=>!!o?.subSubCategories),g=f.findIndex(o=>!o?.subSubCategories),m=f.map((o,p)=>({index:p,open:v===p||g===p}));b(m)},[t]);H(()=>{k()},[k]);const s=M(()=>{const f=t?.subcategories?.[r?.find(g=>g.open)?.index||0],v=a?.find(g=>g?.label?.toLowerCase()===f?.label?.toLowerCase())||{};if(f?.collections){const g=l?.categories?.[f?.collections]||{};return{label:v?.label,isCollection:!0,banner:v?.banner,primary:v?.primary,series:[{products:g?.products}]}}else if(f?.subSubCategories){const g=f?.subSubCategories?.[d],m=a?.find(o=>o?.label?.toLowerCase()===g?.label?.toLowerCase())||{};if(g?.collections){const o=l?.categories?.[g?.collections]||{};return{label:m?.label,isCollection:!0,banner:m?.banner,primary:m?.primary,series:[{products:o?.products}]}}else return m}else return v},[t,r,d,a]),w=K((f,v)=>{if(v?.subSubCategories?.length>0?u(0):u(-1),v?.subSubCategories?.length>0)b(g=>g.map(m=>m.index===f?{...m,open:!0}:{...m,open:!1}));else{const m=t?.subcategories?.findIndex(o=>!!o?.subSubCategories);b(o=>o.map(p=>({...p,open:p.index===f||p.index===m})))}},[t,k]),x=(f,v)=>{b(g=>g.map(m=>m.index===f?{...m,open:!0}:{...m,open:!1})),u(v)};return n(te,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[n("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:i,children:[e("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((f,v)=>{const g=Array.isArray(f?.subSubCategories)&&f?.subSubCategories?.length>0;return n("div",{children:[n("div",{className:N("flex cursor-pointer items-center justify-between",{"bg-[#F5F5F7]":!g&&r?.find(m=>m.index===v)?.open}),onClick:()=>{w(v,f),c?.(f,v)},children:[e(y,{html:f.label,className:"p-4 text-sm font-bold leading-[1.4]"}),g&&e(ae,{className:N("size-4",{"rotate-180":r?.find(m=>m.index===v)?.open})})]}),r?.find(m=>m.index===v)?.open&&e("div",{className:"flex flex-col",children:f.subSubCategories?.map((m,o)=>e(y,{html:m.label,onClick:()=>{x(v,o),c?.(m,o)},className:N("cursor-pointer px-6 py-4 text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":d===o})},`subSubItem-${v}-${o}`))})]},`subcategoryItem-${v}`)})}),t&&e("div",{className:"flex",children:n("div",{className:"flex flex-col gap-4",children:[t?.primary&&e(T,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&e(T,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),n("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(s).length>0&&n("div",{className:"mb-4 flex items-center justify-between",children:[n("div",{className:"flex items-center gap-2",children:[e(y,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&e(T,{as:"a",href:`${s?.primary?.url}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm font-bold leading-[1.2] no-underline",children:s?.primary?.label})]}),e(O,{href:s?.guide?.url,className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:s?.guide?.label})]}),e("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((f,v)=>n("div",{children:[f.label&&e(y,{html:f.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),n("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&e(O,{asChild:!s?.banner?.href,href:s?.banner?.href,children:n("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(Q,{source:s?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),n("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(ce,{size:2,html:s?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),e(y,{html:s?.banner?.desc||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),f.products?.map((g,m)=>e(fe,{seriesLabel:s?.label,product:g,isCollection:s?.isCollection},`seriesProductItem-${m}`))]})]},`seriesItem-${v}`))})]})]})}),Fe=({multicolMetadata:t})=>{const a=F(null);return e("div",{ref:a,children:e(te,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((l,c)=>e("div",{className:"w-1/4",children:e(ve,{item:l})},`multicolItem-${l?.label}-${c}`))})})})},_e=({supportsMetadata:t,currentNavItemRef:a})=>{const l=F(null),[c,r]=D(null),[b,d]=D(0);H(()=>{if(l?.current){const i=l?.current?.getBoundingClientRect();d(i.height)}},[l]);const u=De(()=>{if(a){const i=a.getBoundingClientRect();r(i)}},500);return H(()=>(u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[u]),H(()=>{if(a){const i=a.getBoundingClientRect();r(i)}},[a]),e("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${c?.right}px)`,height:b},children:e("div",{ref:l,className:"p-4",children:t?.map(i=>e("div",{className:"py-2",children:e(O,{href:i.url,className:"text-sm font-bold leading-[1.4] no-underline",children:i.label})},i.id))})})},fe=({product:t,isCollection:a,position:l,seriesLabel:c})=>{const{buildProps:r,onSeriesProductClick:b}=I();let d=a?t:r?.products?.find(s=>s.handle===t.handle);const u=d?.variants?.find(s=>s.sku===t.sku)||d?.variants?.[0],i=M(()=>`/products/${d?.handle}?variant=${Le(u?.id)}`,[d?.handle,u?.id]),k=M(()=>d?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,2),[d?.tags]);return u?.availableForSale?e(O,{href:i,onClick:s=>{s.preventDefault(),window.open(i),b?.(d,l||0,c)},className:"no-underline hover:text-current",children:n("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",children:[e("div",{className:"shrink-0",children:e(Q,{source:`${u?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),n("div",{className:"relative",children:[e("div",{className:"flex gap-1",children:Array.isArray(k)&&k?.map(s=>e(y,{as:"p",html:s,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"}))}),e(y,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:d?.title||t?.name}),t?.desc&&e(y,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null},ve=({item:t,allPicture:a})=>n(X,{children:[t?.columns&&n(X,{children:[e(y,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(l=>n("div",{className:"flex items-center gap-1 py-2",children:[e(O,{href:`${l.url}?ref=navMenu`,asChild:!l.url,className:"text-sm font-bold leading-[1.4] no-underline",children:l.label}),l?.badge&&e(y,{as:"p",html:l?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},l.label))})]}),t?.imageUrl&&e("div",{className:N("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":a}),children:n(O,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[e(Q,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),n("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(y,{html:t.title,className:N("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&e(y,{html:t.subtitle,className:N("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&e(T,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:N("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),Oe=ee(({data:t,className:a,onPrimaryNavClick:l},c)=>{const r=M(()=>pe(t?.categories?.filter(P=>P?.mobileShow)),[t]),{currentMenu:b,setCurrentMenu:d,subSubCategory:u}=I(),[i,k]=D(!1),[s,w]=D(0),[x,f]=D(null),v=F(null);H(()=>{if(v?.current&&i){const P=v?.current?.getBoundingClientRect();w(window?.innerHeight-(P?.bottom||0))}},[i]),se(()=>{ie.fromTo(v.current,{height:0},{height:s,duration:.3})},[s]),H(()=>{document.documentElement.style.overflow=i?"hidden":"auto"},[i]);const g=M(()=>x?.components?.[0]?.blockType,[x]),m=ue(Ue,{categoriesItem:x}),o=de(We,x),p=me(Ge,x),C=M(()=>{switch(g){case W.Sidebar:return e(o,{});case W.Supports:return e(m,{});case W.Multicol:return e(p,{});default:return null}},[g,x,m]),S=K(()=>{k(!1),w(0),d&&d($.Primary)},[k,w,d]),z=M(()=>t?.headerBar?.actions?.filter(P=>P?.mobileShow&&P?.blockType!==_.Profile),[t]),L=M(()=>t?.headerBar?.actions?.find(P=>P?.mobileShow&&P?.blockType===_.Profile)||{},[t]),U=M(()=>{switch(b){case $.Primary:return e(Je,{actions:z,menuOpen:i,onMenuOpenClose:()=>{k(!1),w(0)},onMenuOpenClick:()=>k(!0)});case $.Secondary:return e(Ne,{title:x?.text,onMenuOpenClose:S,onMenuBackClick:()=>d?.($.Primary)});case $.Third:return e(Ne,{title:u?.label,onMenuOpenClose:S,onMenuBackClick:()=>d?.($.Secondary)});default:return null}},[i,b,d,x,z,u,S]),J=K((P,R)=>{const A=Array.isArray(r)?Array.isArray(r[P])?r[P][R]:{}:{};f(A),A?.components?.[0]?.blockType===W.Links?A?.components?.[0]?.url&&window.open(A?.components?.[0]?.url):d?.($.Secondary)},[r,d]);return n(te,{className:N("relative h-[52px]",a),children:[U,i&&e("div",{ref:v,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:s},children:b===$.Primary?e(Ie,{categories:r,onPrimaryMenuClick:J,onPrimaryNavClick:l,profileAction:L}):C})]})}),Ie=({categories:t,onPrimaryMenuClick:a,profileAction:l,onPrimaryNavClick:c})=>{const{onSidebarNavClick:r}=I();return n("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((b,d)=>n("div",{className:"",children:[b?.map((u,i)=>e(Z,{label:u.text,onClick:()=>{const s=(t?.flat()||[])?.findIndex(w=>w?.id===t[d][i]?.id);a(d,i),c?.(u,s)},icon:u.components?.[0]?.icon},u.id)),e("div",{className:N("my-2 h-px w-full bg-[#E5E5E7]",{hidden:d===t.length-1})})]},`groupCategory-${d}`))}),e(Ke,{profileAction:l})]})},We=({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{currentMenu:l,setCurrentMenu:c,subSubCategory:r,setSubSubCategory:b,setCurrentSeriesMetadata:d,currentSeriesMetadata:u,buildProps:i,onSidebarNavClick:k}=I(),[s,w]=D([]),[x,f]=D([]);H(()=>{t?.subcategories?.length&&w(t?.subcategories?.map((o,p)=>({index:p,open:!1})))},[t]),H(()=>{r?.subSubCategories?.length&&f(r?.subSubCategories?.map((o,p)=>({index:p,open:p===0})))},[r]);const v=K((o,p)=>{c&&c($.Third),b?.(o);const C=a?.find(S=>p!==void 0?o?.subSubCategories?.[p]?.label?.toLowerCase()===S.label?.toLowerCase():o?.label?.toLowerCase()===S.label?.toLowerCase())||{};if(o?.collections){const S=i?.categories?.[o?.collections]||{};d?.({label:C?.label,isCollection:!0,banner:C?.banner,primary:C?.primary,series:[{products:S?.products}]})}else d?.(C)},[a,t,c,b,d]),g=M(()=>a?.find(o=>!!o?.guide)?.guide,[a,t]);return M(()=>{switch(l){case $.Secondary:return n("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[e("div",{children:t?.subcategories?.map((o,p)=>e("div",{children:e(Z,{label:o?.label,active:s.find(C=>C.index===p)?.open,onClick:()=>{v(o),k?.(o,p)}})},`${o.label}-${p}`))}),n("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&e(T,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&e(T,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case $.Third:return n("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[r?.subSubCategories?r?.subSubCategories?.map((o,p)=>{const C=a?.find(z=>z.label.toLowerCase()===o?.label?.toLowerCase())||{};let S={};if(o?.collections){const z=i?.categories?.[o?.collections]||{};S={label:C?.label,isCollection:!0,banner:C?.banner,primary:C?.primary,series:[{products:z?.products}]}}else S=C;return n("div",{children:[Reflect.ownKeys(o).length>0&&e(ge,{matchSeriesMetadata:S,onSubSubCategoryItemClick:()=>{k?.(o,p),f(z=>z.map((L,U)=>({...L,open:U===p?!L.open:L.open})))},expanded:!!x?.find(z=>z.index===p)?.open}),x?.find(z=>z.index===p)?.open&&n(X,{children:[e(he,{matchSeriesMetadata:S}),S?.primary&&e("div",{className:"my-4 text-center",children:e(T,{as:"a",href:S?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:S?.primary?.label})})]})]},`${o.label}-${p}`)}):n(X,{children:[Reflect.ownKeys(u).length>0&&e(ge,{matchSeriesMetadata:u}),e(he,{matchSeriesMetadata:u}),u?.primary&&e("div",{className:"my-4 text-center ",children:e(T,{as:"a",href:`${u?.primary?.url}?ref=${u?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:u?.primary?.label})})]}),g&&e(O,{href:g?.url,children:e("div",{className:"mt-4",children:e(y,{html:g?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[l,t,c,a,s,x,b,r,d,u])},ge=({matchSeriesMetadata:t,onSubSubCategoryItemClick:a,expanded:l})=>n("div",{className:"tablet:pt-0 flex items-center justify-between py-4",onClick:a,children:[t?.label&&e(y,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&e(ae,{className:N("size-5",{"rotate-180":l})})]}),he=({matchSeriesMetadata:t})=>e("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((a,l)=>n("div",{children:[a.label&&e(y,{html:a.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),n("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&e(O,{asChild:!t?.banner?.href,href:t?.banner?.href,children:n("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(Q,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),n("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(ce,{size:2,html:t?.banner?.title||"Buy in Guide",className:N("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),e(y,{html:t?.banner?.desc||"20.000mAh",className:N("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),a.products?.map((c,r)=>e(fe,{position:r,product:c,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${l}-${r}`))]})]},`seriesItem-${l}`))}),Ue=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(a=>e(Z,{href:a.url,label:a.label,onClick:()=>{}},a.id))}),Ge=({multicolMetadata:t})=>{const a=M(()=>!t?.some(l=>!!l.columns),[t]);return e("div",{className:N("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":a}),children:t?.map((l,c)=>e("div",{children:e(ve,{item:l,allPicture:a})},`multicolItem-${l?.label}-${c}`))})},Ke=({profileAction:t})=>{const[a,l]=D(!1),{profile:c,event:r}=I();return n("div",{className:N("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":a}),children:[n("div",{className:"flex items-center justify-between",onClick:()=>l(!a),children:[n("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Ee,{})}),e(y,{html:c?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&e(ae,{className:N("laptop:size-4 size-5",{"rotate-180":a})})]}),c?.email&&e("div",{className:"mt-4",children:t?.profiles?.map(b=>e(Z,{label:b?.title,href:b?.url},b.id))}),a&&!c?.email&&n("div",{className:"mt-4",children:[e(y,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(b=>n("div",{className:"flex items-center gap-[6px]",children:[e(Q,{source:b.benefitIcon?.url,className:"size-4",alt:b.benefit,width:16,height:16}),e(y,{html:b.benefit,className:"text-sm font-bold leading-[1.4]"})]},b.id))})]}),!c?.email&&n("div",{className:"mt-4 flex items-center gap-3",children:[e(T,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>r?.join?.(),children:e(y,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(T,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>r?.login?.(),children:e(y,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Je=({menuOpen:t,onMenuOpenClose:a,onMenuOpenClick:l,actions:c})=>n("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ye,{}),n("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(xe,{actions:c}),t?e(be,{className:"size-5",onClick:()=>a()}):e(ze,{className:"size-5",onClick:()=>l()})]})]}),ye=()=>{const{payloadData:t,isMobile:a}=I();return e("div",{className:"hover:text-brand-0 cursor-pointer [&>svg]:w-full",onClick:()=>{window.location.href="/"},dangerouslySetInnerHTML:{__html:a?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},xe=ee(({actions:t,activeStatus:a=!1},l)=>{const{event:c,cartCount:r}=I(),[b,d]=D(null),u=K((i,k)=>{switch(d(k),i?.blockType){case _.Search:c?.search?.();break;case _.Cart:c?.cart?.();break;case _.Profile:c?.profile?.();break;case _.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((i,k)=>n("div",{className:"relative",ref:i.blockType===_.Profile?l:null,onClick:()=>u(i,k),children:[e(y,{html:i.icon,className:N("size-5 cursor-pointer",{"text-brand-0":a&&b===k})}),i.blockType===_.Cart&&r>0&&e("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]",children:e(y,{html:r?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},i.id))})}),Ne=({title:t,onMenuOpenClose:a,onMenuBackClick:l})=>n("div",{className:"flex h-full items-center gap-3",children:[e(Be,{className:"size-5",onClick:()=>l()}),e(y,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e(be,{className:"size-5",onClick:()=>a()})]}),Z=({label:t,href:a,onClick:l,active:c,icon:r,className:b})=>e("div",{className:N("flex cursor-pointer items-center justify-between py-4",b),onClick:l,children:n(O,{href:a,asChild:!a,className:"flex w-full items-center justify-between no-underline",children:[n("div",{className:"flex items-center gap-4",children:[e(y,{html:t,className:N("text-sm font-bold leading-[1.4]",{underline:r})}),r&&e(y,{html:r})]}),e(He,{className:N("laptop:size-4 size-5",{"rotate-90":c})})]})});var ut=Se(Re);export{ut as default};
1
+ "use client";import{Fragment as K,jsx as e,jsxs as l}from"react/jsx-runtime";import Ce,{forwardRef as ee,useCallback as G,useEffect as H,useImperativeHandle as Se,useMemo as M,useRef as j,useState as B}from"react";import{Picture as q,Text as x,Button as $,Container as te,Link as O,Heading as se}from"../../components/index.js";import"../../shared/Styles.js";import{cn as w,atobID as De}from"../../helpers/utils.js";import Le,{useNavContext as W}from"./NavProvider.js";import{HeaderNavigationMenu as R,HeaderNavigationBlockType as I,HeaderNavigationActionBlockType as T}from"./types.js";import{debounce as Me}from"es-toolkit";import Pe from"jump.js";import{useGSAP as re}from"@gsap/react";import{gsap as oe}from"gsap";import{WithSidebar as ie,WithSupports as ce,WithMulticol as de,WithGroupCategory as ue}from"./withCategory.js";import{Menu as Ee,Close as pe,User as Be,RightArrow as ze,LeftArrow as He,DownArrow as ae,Polygon as Te}from"./icons/index.js";import $e from"../NavigationSearch/index.js";const Re=ee((t,a)=>{const{data:{headerNavigation:n}={},buildProps:c,event:i,profile:p,theme:d="light",isTop:b=!1,searchResult:f,onSearch:y,isSearching:o,keywords:D,onPrimaryNavClick:N,onSeriesProductClick:v,onSidebarNavClick:h,headerId:m,cartCount:g}=t,[r,u]=B(!1),[P,S]=B(!1),L=j(null),C=j(null),A=()=>{const k=document?.querySelector("body")?.offsetWidth||0;S(k<=1440)};H(()=>(A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]),Se(a,()=>C.current),H(()=>{C.current&&b&&Pe(C.current,{duration:0,offset:C.current?.getBoundingClientRect()?.bottom||0})},[b]),H(()=>{i&&(i.search=()=>u(!0))},[i]),re(()=>{L?.current&&r&&oe.fromTo(L.current,{height:0},{height:"auto",duration:.3})},[r]),H(()=>{document.documentElement.style.overflow=r?"hidden":"auto"},[r]);const Q=M(()=>n?.headerBar?.actions?.find(k=>k?.blockType===T.Search)?.searchBar?.[0]||{},[n]);return e(Le,{buildProps:c,profile:p,isMobile:P,event:i,payloadData:n,onSidebarNavClick:h,onSeriesProductClick:v,cartCount:g,children:e("header",{id:m||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:C,children:l("div",{className:w("hover:bg-white hover:text-black",d==="light"?"text-black":"text-white",{}),children:[e(Ae,{data:n,className:"desktop:block hidden !bg-white",theme:d,onPrimaryNavClick:N}),e(Oe,{data:n,className:"desktop:hidden block !bg-white",onPrimaryNavClick:N}),r&&l("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${C?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:L,className:w("overflow-y-auto",{}),children:e($e,{data:Q,keywords:D,isSearching:o,searchResult:f,onSearch:k=>{y?.(k)},onClose:()=>{y?.(),u(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>u(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:k=>{(k.key==="Enter"||k.key===" "||k.key==="Escape")&&(k.preventDefault(),u(!1))}})]})]})})})}),Ae=ee((t,a)=>{const{data:n,onNavItemClick:c,className:i,theme:p,onPrimaryNavClick:d}=t,{event:b,profile:f}=W(),[y,o]=B(!1),D=M(()=>ue(n?.categories?.filter(s=>s?.pcShow)),[n]),[N,v]=B(null),[h,m]=B([]),g=j(null),[r,u]=B(!1),P=j(null),S=j(null),L=j(D.map(s=>Array(s?.length||0).fill(null)));H(()=>{D?.length&&m(D?.map((s,E)=>s?.map((z,F)=>({groupIndex:E,index:F,open:!1}))))},[D]);const C=M(()=>{let s=null;for(const E of h){for(const z of E)if(z.open){s=z;break}if(s)break}return s},[h]);H(()=>{document.documentElement.style.overflow=C?.open||r?"hidden":"auto"},[C?.open,r]);const A=(s,E,z)=>{if(u(!1),N?.components?.[0]?.blockType===I.Links)N?.components?.[0]?.url&&window.open(N?.components?.[0]?.url);else{const F=D?.flat()||[],U=F?.findIndex(_=>_?.id===D[E][z]?.id);s.stopPropagation(),c?.(),d?.(F[U],U),v(D[E][z]),m(_=>_.map(we=>we.map(Y=>Y.groupIndex===E&&Y.index===z?{...Y,open:!Y.open}:{...Y,open:!1})))}},Q=(s,E,z)=>{s.key==="Enter"||s.key===" "?(s.preventDefault(),A(s,E,z)):s.key==="Escape"&&C?.groupIndex===E&&C?.index===z&&(s.preventDefault(),k())},k=()=>{m(s=>s.map(E=>E.map(z=>({...z,open:!1}))))},X=M(()=>{if(N)return N?.components?.[0]?.blockType},[N]),J=ie(je,N),xe=de(Fe,N),Ne=ce(_e,{categoriesItem:N,currentNavItemRef:L.current?.[C?.groupIndex||0]?.[C?.index||0]}),ke=M(()=>{switch(X){case I.Sidebar:return e(J,{});case I.Supports:return e(Ne,{});case I.Multicol:return e(xe,{});default:return null}},[X,N]),ne=M(()=>n?.headerBar?.actions?.filter(s=>s?.pcShow),[n]),V=M(()=>ne?.find(s=>s?.blockType===T.Profile),[ne]),le=G(()=>{u(s=>!s)},[]);return H(()=>{if(g?.current){const s=g.current;return s.addEventListener("click",le),()=>{s.removeEventListener("click",le)}}},[le]),re(()=>{C?.open&&oe.fromTo(S?.current,{height:0},{height:"auto"})},[C?.open]),l(te,{className:w("relative h-[96px]",i),children:[l("div",{ref:P,onClick:k,className:"flex h-full flex-col justify-end gap-4",children:[l("div",{className:"flex items-center justify-between",children:[e(ge,{}),e(he,{ref:g,actions:ne,activeStatus:r})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:D?.map((s,E)=>e("div",{className:"flex gap-3",children:s?.map((z,F)=>{const U=C?.groupIndex===E&&C?.index===F;return e("div",{ref:_=>{L.current[E][F]=_},className:"group cursor-pointer",children:l("div",{className:"relative",children:[l("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:_=>A(_,E,F),onKeyDown:_=>Q(_,E,F),"aria-expanded":U,"aria-haspopup":"true","aria-label":z.text,children:[e(x,{html:z.text,className:"text-sm font-bold leading-[1.4]"}),e(ae,{"aria-hidden":"true",className:w("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":U,"opacity-100":y&&U})})]}),e("div",{className:w("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":U},p==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},z.id)})},`groupCategory-${E}`))})]}),l("div",{role:"menu","aria-hidden":!(C?.open&&N),className:w("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(C?.open&&N)}),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{height:`calc(100dvh - ${P?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:S,className:w("relative z-50",{"overflow-hidden":X!==I.Supports}),children:ke}),e("div",{className:"flex-1 bg-transparent",onClick:k,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:s=>{(s.key==="Enter"||s.key===" "||s.key==="Escape")&&(s.preventDefault(),k())}})]}),r&&l("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[e("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${g?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:f?.email?l(K,{children:[e(x,{html:f?.nick_name||V?.welcome,className:"text-sm font-bold"}),e("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),e("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:V?.profiles?.map(s=>e(Z,{className:"py-2",label:s?.title,href:s?.url},s.id))})]}):l(K,{children:[e(Te,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(x,{html:V?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:V?.benefits?.map(s=>l("div",{className:"flex items-center gap-[6px]",children:[e(q,{source:s.benefitIcon?.url,className:"size-4",alt:s.benefit,width:16,height:16}),e(x,{html:s.benefit,className:"text-sm font-bold leading-[1.4]"})]},s.id))}),l("div",{className:"mt-4 flex items-center gap-2",children:[e($,{variant:"secondary",size:"lg",onClick:()=>b?.join?.(),children:e(x,{html:V?.primaryButton||"Join Now",className:"font-bold"})}),e($,{variant:"primary",size:"lg",onClick:()=>b?.login?.(),children:e(x,{html:V?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>u(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:s=>{(s.key==="Enter"||s.key===" "||s.key==="Escape")&&(s.preventDefault(),u(!1))}})]})]})}),je=Ce.memo(({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{buildProps:n,onSidebarNavClick:c}=W(),[i,p]=B([]),[d,b]=B(-1),f=j(null),y=G(()=>{const v=t?.subcategories;if(!v?.length)return;const h=v.findIndex(r=>!!r?.subSubCategories),m=v.findIndex(r=>!r?.subSubCategories),g=v.map((r,u)=>({index:u,open:h===u||m===u}));p(g)},[t]);H(()=>{y()},[y]);const o=M(()=>{const v=t?.subcategories?.[i?.find(m=>m.open)?.index||0],h=a?.find(m=>m?.label?.toLowerCase()===v?.label?.toLowerCase())||{};if(v?.collections){const m=n?.categories?.[v?.collections]||{};return{label:h?.label,isCollection:!0,banner:h?.banner,primary:h?.primary,series:[{products:m?.products}]}}else if(v?.subSubCategories){const m=v?.subSubCategories?.[d],g=a?.find(r=>r?.label?.toLowerCase()===m?.label?.toLowerCase())||{};if(m?.collections){const r=n?.categories?.[m?.collections]||{};return{label:g?.label,isCollection:!0,banner:g?.banner,primary:g?.primary,series:[{products:r?.products}]}}else return g}else return h},[t,i,d,a,n]),D=G((v,h)=>{if(h?.subSubCategories?.length>0?b(0):b(-1),h?.subSubCategories?.length>0)p(m=>m.map(g=>g.index===v?{...g,open:!0}:{...g,open:!1}));else{const g=t?.subcategories?.findIndex(r=>!!r?.subSubCategories);p(r=>r.map(u=>({...u,open:u.index===v||u.index===g})))}},[t]),N=(v,h)=>{p(m=>m.map(g=>g.index===v?{...g,open:!0}:{...g,open:!1})),b(h)};return l(te,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[l("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:f,children:[e("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((v,h)=>{const m=Array.isArray(v?.subSubCategories)&&v?.subSubCategories?.length>0,g=i?.find(r=>r.index===h)?.open;return l("div",{children:[l("button",{className:w("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!m&&g}),onClick:()=>{D(h,v),c?.(v,h)},"aria-expanded":m?g:void 0,"aria-haspopup":m?"true":void 0,children:[e(x,{html:v.label,className:"p-4 text-sm font-bold leading-[1.4]"}),m&&e(ae,{"aria-hidden":"true",className:w("size-4",{"rotate-180":g})})]}),g&&e("div",{className:"flex flex-col",role:"menu",children:v.subSubCategories?.map((r,u)=>e("button",{onClick:()=>{N(h,u),c?.(r,u)},className:w("w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left",{"bg-[#F5F5F7]":d===u}),role:"menuitem","aria-label":r.label,children:e(x,{html:r.label,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]"})},`subSubItem-${h}-${u}`))})]},`subcategoryItem-${h}`)})}),t&&e("div",{className:"flex",children:l("div",{className:"flex flex-col gap-4",children:[t?.primary&&e($,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&e($,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),l("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(o).length>0&&l("div",{className:"mb-4 flex items-center justify-between",children:[l("div",{className:"flex items-center gap-2",children:[e(x,{html:o?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),o?.primary&&!o?.primary?.hide&&e($,{as:"a",href:`${o?.primary?.url}?ref=${o?.label}_viewmore`,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm font-bold leading-[1.2] no-underline",children:o?.primary?.label})]}),e(O,{href:o?.guide?.url,className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:o?.guide?.label})]}),e("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:o?.series?.map((v,h)=>l("div",{children:[v.label&&e(x,{html:v.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),l("div",{className:"grid grid-cols-3 gap-4",children:[!!o?.banner&&e(O,{asChild:!o?.banner?.href,href:o?.banner?.href,children:l("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(q,{source:o?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(se,{size:2,html:o?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),e(x,{html:o?.banner?.desc||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),v.products?.map((m,g)=>e(me,{seriesLabel:o?.label,product:m,isCollection:o?.isCollection},`seriesProductItem-${g}`))]})]},`seriesItem-${h}`))})]})]})}),Fe=({multicolMetadata:t})=>{const a=j(null);return e("div",{ref:a,children:e(te,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((n,c)=>e("div",{className:"w-1/4",children:e(be,{item:n})},`multicolItem-${n?.label}-${c}`))})})})},_e=({supportsMetadata:t,currentNavItemRef:a})=>{const n=j(null),[c,i]=B(null),[p,d]=B(0);H(()=>{if(n?.current){const f=n?.current?.getBoundingClientRect();d(f.height)}},[n]);const b=Me(()=>{if(a){const f=a.getBoundingClientRect();i(f)}},500);return H(()=>(b(),window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}),[b]),H(()=>{if(a){const f=a.getBoundingClientRect();i(f)}},[a]),e("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${c?.right}px)`,height:p},children:e("div",{ref:n,className:"p-4",children:t?.map(f=>e("div",{className:"py-2",children:e(O,{href:f.url,className:"text-sm font-bold leading-[1.4] no-underline",children:f.label})},f.id))})})},me=({product:t,isCollection:a,position:n,seriesLabel:c})=>{const{buildProps:i,onSeriesProductClick:p}=W();let d=a?t:i?.products?.find(o=>o.handle===t.handle);const b=d?.variants?.find(o=>o.sku===t.sku)||d?.variants?.[0],f=M(()=>`/products/${d?.handle}?variant=${De(b?.id)}`,[d?.handle,b?.id]),y=M(()=>d?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,2),[d?.tags]);return b?.availableForSale?e(O,{href:f,onClick:o=>{o.preventDefault(),window.open(f,"_self"),p?.(d,n||0,c)},className:"no-underline hover:text-current",children:l("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",children:[e("div",{className:"shrink-0",children:e(q,{source:`${b?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),l("div",{className:"relative",children:[e("div",{className:"flex gap-1",children:Array.isArray(y)&&y?.map(o=>e(x,{as:"p",html:o,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"}))}),e(x,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:d?.title||t?.name}),t?.desc&&e(x,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null},be=({item:t,allPicture:a})=>l(K,{children:[t?.columns&&l(K,{children:[e(x,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(n=>l("div",{className:"flex items-center gap-1 py-2",children:[e(O,{href:`${n.url}?ref=navMenu`,asChild:!n.url,className:"text-sm font-bold leading-[1.4] no-underline",children:n.label}),n?.badge&&e(x,{as:"p",html:n?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},n.label))})]}),t?.imageUrl&&e("div",{className:w("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":a}),children:l(O,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[e(q,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),l("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(x,{html:t.title,className:w("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&e(x,{html:t.subtitle,className:w("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&e($,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:w("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),Oe=ee(({data:t,className:a,onPrimaryNavClick:n},c)=>{const i=M(()=>ue(t?.categories?.filter(k=>k?.mobileShow)),[t]),{currentMenu:p,setCurrentMenu:d,subSubCategory:b}=W(),[f,y]=B(!1),[o,D]=B(0),[N,v]=B(null),h=j(null);H(()=>{if(h?.current&&f){const k=h?.current?.getBoundingClientRect();D(window?.innerHeight-(k?.bottom||0))}},[f]),re(()=>{oe.fromTo(h.current,{height:0},{height:o,duration:.3})},[o]),H(()=>{document.documentElement.style.overflow=f?"hidden":"auto"},[f]);const m=M(()=>N?.components?.[0]?.blockType,[N]),g=ce(Ke,{categoriesItem:N}),r=ie(We,N),u=de(Ue,N),P=M(()=>{switch(m){case I.Sidebar:return e(r,{});case I.Supports:return e(g,{});case I.Multicol:return e(u,{});default:return null}},[m,N,g]),S=G(()=>{y(!1),D(0),d&&d(R.Primary)},[y,D,d]),L=M(()=>t?.headerBar?.actions?.filter(k=>k?.mobileShow&&k?.blockType!==T.Profile),[t]),C=M(()=>t?.headerBar?.actions?.find(k=>k?.mobileShow&&k?.blockType===T.Profile)||{},[t]),A=M(()=>{switch(p){case R.Primary:return e(Je,{actions:L,menuOpen:f,onMenuOpenClose:()=>{y(!1),D(0)},onMenuOpenClick:()=>y(!0)});case R.Secondary:return e(ye,{title:N?.text,onMenuOpenClose:S,onMenuBackClick:()=>d?.(R.Primary)});case R.Third:return e(ye,{title:b?.label,onMenuOpenClose:S,onMenuBackClick:()=>d?.(R.Secondary)});default:return null}},[f,p,d,N,L,b,S]),Q=G((k,X)=>{const J=Array.isArray(i)?Array.isArray(i[k])?i[k][X]:{}:{};v(J),J?.components?.[0]?.blockType===I.Links?J?.components?.[0]?.url&&window.open(J?.components?.[0]?.url):d?.(R.Secondary)},[i,d]);return l(te,{className:w("relative h-[52px]",a),children:[A,f&&e("nav",{ref:h,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:o},role:"navigation","aria-label":"Mobile navigation menu",children:p===R.Primary?e(Ie,{categories:i,onPrimaryMenuClick:Q,onPrimaryNavClick:n,profileAction:C}):P})]})}),Ie=({categories:t,onPrimaryMenuClick:a,profileAction:n,onPrimaryNavClick:c})=>l("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((i,p)=>l("div",{className:"",children:[i?.map((d,b)=>e(Z,{label:d.text,onClick:()=>{const y=(t?.flat()||[])?.findIndex(o=>o?.id===t[p][b]?.id);a(p,b),c?.(d,y)},icon:d.components?.[0]?.icon},d.id)),e("div",{className:w("my-2 h-px w-full bg-[#E5E5E7]",{hidden:p===t.length-1})})]},`groupCategory-${p}`))}),e(Ge,{profileAction:n})]}),We=({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{currentMenu:n,setCurrentMenu:c,subSubCategory:i,setSubSubCategory:p,setCurrentSeriesMetadata:d,currentSeriesMetadata:b,buildProps:f,onSidebarNavClick:y}=W(),[o,D]=B([]),[N,v]=B([]);H(()=>{t?.subcategories?.length&&D(t?.subcategories?.map((r,u)=>({index:u,open:!1})))},[t]),H(()=>{i?.subSubCategories?.length&&v(i?.subSubCategories?.map((r,u)=>({index:u,open:u===0})))},[i]);const h=G((r,u)=>{c&&c(R.Third),p?.(r);const P=a?.find(S=>u!==void 0?r?.subSubCategories?.[u]?.label?.toLowerCase()===S.label?.toLowerCase():r?.label?.toLowerCase()===S.label?.toLowerCase())||{};if(r?.collections){const S=f?.categories?.[r?.collections]||{};d?.({label:P?.label,isCollection:!0,banner:P?.banner,primary:P?.primary,series:[{products:S?.products}]})}else d?.(P)},[a,c,p,d,f?.categories]),m=M(()=>a?.find(r=>!!r?.guide)?.guide,[a]);return M(()=>{switch(n){case R.Secondary:return l("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[e("div",{children:t?.subcategories?.map((r,u)=>e("div",{children:e(Z,{label:r?.label,active:o.find(P=>P.index===u)?.open,onClick:()=>{h(r),y?.(r,u)}})},`${r.label}-${u}`))}),l("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&e($,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&e($,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case R.Third:return l("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[i?.subSubCategories?i?.subSubCategories?.map((r,u)=>{const P=a?.find(L=>L.label.toLowerCase()===r?.label?.toLowerCase())||{};let S={};if(r?.collections){const L=f?.categories?.[r?.collections]||{};S={label:P?.label,isCollection:!0,banner:P?.banner,primary:P?.primary,series:[{products:L?.products}]}}else S=P;return l("div",{children:[Reflect.ownKeys(r).length>0&&e(fe,{matchSeriesMetadata:S,onSubSubCategoryItemClick:()=>{y?.(r,u),v(L=>L.map((C,A)=>({...C,open:A===u?!C.open:C.open})))},expanded:!!N?.find(L=>L.index===u)?.open}),N?.find(L=>L.index===u)?.open&&l(K,{children:[e(ve,{matchSeriesMetadata:S}),S?.primary&&e("div",{className:"my-4 text-center",children:e($,{as:"a",href:S?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:S?.primary?.label})})]})]},`${r.label}-${u}`)}):l(K,{children:[Reflect.ownKeys(b).length>0&&e(fe,{matchSeriesMetadata:b}),e(ve,{matchSeriesMetadata:b}),b?.primary&&e("div",{className:"my-4 text-center ",children:e($,{as:"a",href:`${b?.primary?.url}?ref=${b?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:b?.primary?.label})})]}),m&&e(O,{href:m?.url,children:e("div",{className:"mt-4",children:e(x,{html:m?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[n,t,a,o,N,i,b,f?.categories,m,h,y])},fe=({matchSeriesMetadata:t,onSubSubCategoryItemClick:a,expanded:n})=>{const c=l(K,{children:[t?.label&&e(x,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&e(ae,{"aria-hidden":"true",className:w("size-5",{"rotate-180":n})})]});return a?e("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:a,"aria-expanded":n,children:c}):e("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:c})},ve=({matchSeriesMetadata:t})=>e("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((a,n)=>l("div",{children:[a.label&&e(x,{html:a.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),l("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&e(O,{asChild:!t?.banner?.href,href:t?.banner?.href,children:l("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(q,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(se,{size:2,html:t?.banner?.title||"Buy in Guide",className:w("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),e(x,{html:t?.banner?.desc||"20.000mAh",className:w("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),a.products?.map((c,i)=>e(me,{position:i,product:c,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n}-${i}`))]})]},`seriesItem-${n}`))}),Ke=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(a=>e(Z,{href:a.url,label:a.label,onClick:()=>{}},a.id))}),Ue=({multicolMetadata:t})=>{const a=M(()=>!t?.some(n=>!!n.columns),[t]);return e("div",{className:w("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":a}),children:t?.map((n,c)=>e("div",{children:e(be,{item:n,allPicture:a})},`multicolItem-${n?.label}-${c}`))})},Ge=({profileAction:t})=>{const[a,n]=B(!1),{profile:c,event:i}=W();return l("div",{className:w("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":a}),children:[l("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>n(!a),"aria-expanded":a,"aria-label":c?.nick_name||t?.welcome,children:[l("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Be,{"aria-hidden":"true"})}),e(x,{html:c?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&e(ae,{"aria-hidden":"true",className:w("laptop:size-4 size-5",{"rotate-180":a})})]}),c?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:t?.profiles?.map(p=>e(Z,{label:p?.title,href:p?.url},p.id))}),a&&!c?.email&&l("div",{className:"mt-4",children:[e(x,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(p=>l("div",{className:"flex items-center gap-[6px]",children:[e(q,{source:p.benefitIcon?.url,className:"size-4",alt:p.benefit,width:16,height:16}),e(x,{html:p.benefit,className:"text-sm font-bold leading-[1.4]"})]},p.id))})]}),!c?.email&&l("div",{className:"mt-4 flex items-center gap-3",children:[e($,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>i?.join?.(),children:e(x,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e($,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>i?.login?.(),children:e(x,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Je=({menuOpen:t,onMenuOpenClose:a,onMenuOpenClick:n,actions:c})=>l("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ge,{}),l("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(he,{actions:c}),t?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>a(),"aria-label":"Close menu","aria-expanded":"true",children:e(pe,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Ee,{className:"size-5","aria-hidden":"true"})})]})]}),ge=()=>{const{payloadData:t,isMobile:a}=W();return e("a",{href:"/",className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:a?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},he=ee(({actions:t,activeStatus:a=!1},n)=>{const{event:c,cartCount:i}=W(),[p,d]=B(null),b=y=>{switch(y){case T.Search:return"Search";case T.Cart:return`Shopping cart${i>0?` (${i} items)`:""}`;case T.Profile:return"User profile";case T.Livestream:return"Livestream";default:return"Action"}},f=G((y,o)=>{switch(d(o),y?.blockType){case T.Search:c?.search?.();break;case T.Cart:c?.cart?.();break;case T.Profile:c?.profile?.();break;case T.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((y,o)=>l("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:y.blockType===T.Profile?n:null,onClick:()=>f(y,o),"aria-label":b(y.blockType),"aria-pressed":a&&p===o,children:[e(x,{html:y.icon,className:w("size-5",{"text-brand-0":a&&p===o}),"aria-hidden":"true"}),y.blockType===T.Cart&&i>0&&e("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:e(x,{html:i?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},y.id))})}),ye=({title:t,onMenuOpenClose:a,onMenuBackClick:n})=>l("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Back to previous menu",children:e(He,{className:"size-5","aria-hidden":"true"})}),e(x,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>a(),"aria-label":"Close menu",children:e(pe,{className:"size-5","aria-hidden":"true"})})]}),Z=({label:t,href:a,onClick:n,active:c,icon:i,className:p})=>{const d=l(K,{children:[l("div",{className:"flex items-center gap-4",children:[e(x,{html:t,className:w("text-sm font-bold leading-[1.4]",{underline:i})}),i&&e(x,{html:i,"aria-hidden":"true"})]}),e(ze,{className:w("laptop:size-4 size-5",{"rotate-90":c}),"aria-hidden":"true"})]});return a?e(O,{href:a,className:w("flex cursor-pointer items-center justify-between py-4 no-underline",p),children:d}):e("button",{className:w("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",p),onClick:n,"aria-expanded":c,children:d})};var it=Re;export{it as default};
2
2
  //# sourceMappingURL=index.js.map