@anker-in/headless-ui 1.3.34 → 1.3.35

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.
Files changed (85) hide show
  1. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  2. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
  3. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +2 -1
  4. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
  5. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
  6. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  7. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
  8. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  9. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js.map +2 -2
  10. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  12. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +12 -0
  13. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  14. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  15. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  16. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  17. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  18. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  19. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +0 -1
  20. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  21. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  22. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
  23. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +3 -3
  24. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.d.ts +1 -2
  25. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js +1 -1
  26. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js.map +1 -1
  27. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  28. package/dist/cjs/biz-components/NavigationSearch/index.js.map +3 -3
  29. package/dist/cjs/biz-components/SearchPage/index.d.ts +1 -1
  30. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  31. package/dist/cjs/biz-components/SearchPage/index.js.map +3 -3
  32. package/dist/cjs/biz-components/SearchPage/types.d.ts +2 -0
  33. package/dist/cjs/biz-components/SearchPage/types.js +1 -1
  34. package/dist/cjs/biz-components/SearchPage/types.js.map +2 -2
  35. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  36. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  37. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  38. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
  39. package/dist/cjs/biz-components/Title/index.js +1 -1
  40. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  41. package/dist/cjs/components/link.js +1 -1
  42. package/dist/cjs/components/link.js.map +2 -2
  43. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  44. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
  45. package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +2 -1
  46. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
  47. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
  48. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  49. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
  50. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  51. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js.map +2 -2
  52. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  53. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  54. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +12 -0
  55. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  56. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  57. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  58. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  59. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  60. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  61. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +0 -1
  62. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  63. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  64. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
  65. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +3 -3
  66. package/dist/esm/biz-components/MultiLayoutGraphicBlock/types.d.ts +1 -2
  67. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  68. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  69. package/dist/esm/biz-components/SearchPage/index.d.ts +1 -1
  70. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  71. package/dist/esm/biz-components/SearchPage/index.js.map +3 -3
  72. package/dist/esm/biz-components/SearchPage/types.d.ts +2 -0
  73. package/dist/esm/biz-components/SearchPage/types.js +1 -1
  74. package/dist/esm/biz-components/SearchPage/types.js.map +2 -2
  75. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  76. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  77. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  78. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
  79. package/dist/esm/biz-components/Title/index.js +1 -1
  80. package/dist/esm/biz-components/Title/index.js.map +2 -2
  81. package/dist/esm/components/link.js +1 -1
  82. package/dist/esm/components/link.js.map +2 -2
  83. package/dist/tokens/oneAnker.css +14 -0
  84. package/package.json +1 -1
  85. package/style.css +9 -20
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as Se,jsx as e,jsxs as n}from"react/jsx-runtime";import{forwardRef as ee,useCallback as te,useEffect as U,useImperativeHandle as De,useMemo as P,useRef as G,useState as D}from"react";import{Picture as me,Text as x,Button as ae,Container as pe,BrandStrip as Ee}from"../../components/index.js";import{withLayout as Te}from"../../shared/Styles.js";import{cn as E,getLocalizedPath as re}from"../../helpers/utils.js";import He,{useNavContext as Z}from"./NavProvider.js";import{HeaderNavigationMenu as j,HeaderNavigationBlockType as H,HeaderNavigationActionBlockType as C}from"./types.js";import Le from"jump.js";import{useGSAP as ie}from"@gsap/react";import{gsap as le}from"gsap";import{WithSidebar as fe,WithSupports as be,WithMulticol as ve,WithGroupCategory as ge,WithResource as he}from"./withCategory.js";import{Menu as ze,Close as ye,User as Be,LeftArrow as Re,DownArrow as Ne,Polygon as Ie}from"./icons/index.js";import Ae from"../NavigationSearch/index.js";import{ResourceSidebarDropdown as Oe}from"./ResourceSidebarDropdown.js";import{MobileResourceSidebarMenu as je}from"./MobileResourceSidebarMenu.js";import{SidebarDropdown as _e}from"./SidebarDropdown.js";import{useScrollLock as se}from"./useScrollLock.js";import{MulticolDropdown as We}from"./MulticolDropdown.js";import{SupportsDropdown as $e}from"./SupportsDropdown.js";import{MobileSidebarMenu as Ke}from"./MobileSidebarMenu.js";import{MobileSupportMenu as Fe}from"./MobileSupportMenu.js";import{MobileMulticolMenu as Ue}from"./MobileMulticolMenu.js";import{MenuItem as ce}from"./MobileMenuComponents.js";import{useAiuiContext as ue}from"../AiuiProvider/index.js";import Ge from"../../shared/throttle.js";const ke=ee((a,l)=>{const{data:{header:r}={},buildProps:s,event:b,profile:w,theme:o="light",isTop:c=!1,searchResult:h,onSearch:p,isSearching:f,keywords:_,onPrimaryNavClick:y,onSeriesProductClick:v,onSidebarNavClick:M,onMobileMenuToggle:J,headerId:L,cartCount:R,menuData:I,render:W,...Y}=a,[A,O]=D(!1),[d,z]=D(!1),[q,T]=D(!1),[K,N]=D(!1),F=G(null),k=G(null),V=()=>{const m=document?.querySelector("body")?.offsetWidth||0;N(m<=1440)};U(()=>(V(),window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}),[]),De(l,()=>k.current),U(()=>{k.current&&c&&Le(k.current,{duration:0,offset:k.current?.getBoundingClientRect()?.bottom||0})},[c]),U(()=>{if(c){z(!1),T(!1);return}let m=0,$=0,t=0;const i=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,u=i();m=u,z(u>300),T(u>30);const g=Ge(()=>{const B=i(),S=B-m;T(B>30),S>0?($=0,t+=S,t>=300&&B>300&&z(!0)):S<0&&(t=0,$+=Math.abs(S),$>=300&&(z(!1),$=0)),m=B},100);return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[c]),U(()=>{b&&(b.search=()=>O(!0))},[b]),ie(()=>{F?.current&&A&&le.fromTo(F.current,{height:0},{height:"auto",duration:.3})},[A]),se(A);const oe=P(()=>r?.bar?.actions?.find(m=>m?.blockType===C.Search)?.searchBar?.[0]||{},[r]),Q=W?.mobileHeaderNavigation;return e(He,{buildProps:s,profile:w,isMobile:K,event:b,payloadData:r,onSidebarNavClick:M,onSeriesProductClick:v,cartCount:R,children:e("header",{...Y,id:L||"header","data-ui-component-id":"HeaderNavigation",className:c?"relative z-[100] bg-white":E("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":d}),ref:k,children:n("div",{className:E("hover:bg-white hover:text-black",o==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!c&&q},{"hover:!text-black":o==="dark","!text-black":!c&&q}),onClick:()=>!c&&T(!0),children:[e(xe,{data:r,className:"desktop:block hidden !bg-white",theme:o,onNavItemClick:()=>!c&&T(!0),onPrimaryNavClick:y}),Q?e(Q,{className:"desktop:hidden block !bg-white",menuData:I,data:r,onPrimaryNavClick:y}):e(Ce,{menuData:I,data:r,className:"desktop:hidden block !bg-white",onPrimaryNavClick:y,onMobileMenuToggle:J}),A&&n("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${k?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:F,className:E("overflow-y-auto",{}),children:e(Ae,{data:oe,keywords:_,isSearching:f,searchResult:h,onSearch:m=>{p?.(m)},onClose:()=>{p?.(),O(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>O(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:m=>{(m.key==="Enter"||m.key===" "||m.key==="Escape")&&(m.preventDefault(),O(!1))}})]})]})})})}),xe=ee((a,l)=>{const{data:r,onNavItemClick:s,className:b,theme:w,onPrimaryNavClick:o}=a,{event:c,profile:h}=Z(),[p,f]=D(!1),{locale:_="us"}=ue(),y=P(()=>ge(r?.categories?.filter(t=>t?.pcShow)),[r]),[v,M]=D(null),[J,L]=D([]),R=G(null),[I,W]=D(!1),Y=G(null),A=G(null),O=G(y.map(t=>Array(t?.length||0).fill(null)));U(()=>{y?.length&&L(y?.map((t,i)=>t?.map((u,g)=>({groupIndex:i,index:g,open:!1}))))},[y]);const d=P(()=>{let t=null;for(const i of J){for(const u of i)if(u.open){t=u;break}if(t)break}return t},[J]);se(!!d?.open||I);const z=(t,i,u)=>{W(!1);const g=y[i][u];if(g?.components?.[0]?.blockType===H.Links)g?.components?.[0]?.url&&window.open(g?.components?.[0]?.url,g?.components?.[0]?.target??"_blank");else{const B=y?.flat()||[],S=B?.findIndex(ne=>ne?.id===y[i][u]?.id);t.stopPropagation(),s?.(),o?.(B[S],S),M(g),L(ne=>ne.map(Pe=>Pe.map(X=>X.groupIndex===i&&X.index===u?{...X,open:!X.open}:{...X,open:!1})))}},q=(t,i,u)=>{t.key==="Enter"||t.key===" "?(t.preventDefault(),z(t,i,u)):t.key==="Escape"&&d?.groupIndex===i&&d?.index===u&&(t.preventDefault(),T())},T=()=>{L(t=>t.map(i=>i.map(u=>({...u,open:!1}))))},K=P(()=>{if(v)return v?.components?.[0]?.blockType},[v]),N=fe(_e,v),F=he(Oe,v),k=ve(We,v),V=be($e,{categoriesItem:v,currentNavItemRef:O.current?.[d?.groupIndex||0]?.[d?.index||0]}),oe=P(()=>{switch(K){case H.Sidebar:return e(N,{});case H.Resource:return e(F,{});case H.Supports:return e(V,{});case H.Multicol:return e(k,{});default:return null}},[K,v]),Q=P(()=>r?.bar?.actions?.filter(t=>t?.pcShow),[r]),m=P(()=>Q?.find(t=>t?.blockType===C.Profile),[Q]),$=te(()=>{W(t=>!t)},[]);return U(()=>{if(R?.current){const t=R.current;return t.addEventListener("click",$),()=>{t.removeEventListener("click",$)}}},[$]),ie(()=>{d?.open&&le.fromTo(A?.current,{height:0},{height:"auto"})},[d?.open]),n(pe,{className:E("relative h-[96px]",b),children:[n("div",{ref:Y,onClick:T,className:"flex h-full flex-col justify-end gap-4",children:[n("div",{className:"flex items-center justify-between",children:[e(we,{}),e(de,{ref:R,actions:Q,activeStatus:I})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:y?.map((t,i)=>e("div",{className:"flex gap-3",children:t?.map((u,g)=>{const B=d?.groupIndex===i&&d?.index===g;return e("div",{ref:S=>{O.current[i][g]=S},className:"group",children:n("div",{className:"relative",children:[n("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:S=>z(S,i,g),onKeyDown:S=>q(S,i,g),"aria-expanded":B,"aria-haspopup":"true","aria-label":u.text,children:[e(x,{html:u.text,className:"text-sm font-bold leading-[1.4]"}),e(Ne,{className:E("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":d?.groupIndex===i&&d?.index===g,"opacity-100":p&&d?.groupIndex===i&&d?.index===g,invisible:!u?.components?.length||u?.components?.[0]?.blockType===H.Links})})]}),e("div",{className:E("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":B},w==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},u.id)})},`groupCategory-${i}`))})]}),n("div",{role:"menu","aria-hidden":!(d?.open&&v),className:E("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:!(d?.open&&v)}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{height:`calc(100dvh - ${Y?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:A,className:E("relative z-50",{"overflow-hidden":K!==H.Supports}),children:oe}),e("div",{className:"flex-1 bg-transparent",onClick:T,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),T())}})]}),I&&n("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:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${R?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:h?.email?n(Se,{children:[e(x,{html:h?.nick_name||m?.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:m?.profiles?.map(t=>e(ce,{className:"py-2",label:t?.title,href:re(t?.url,_)},t.id))})]}):n(Se,{children:[e(Ie,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(x,{html:m?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:m?.benefits?.map(t=>n("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:t.benefitIcon?.url,className:"size-4",alt:t.benefit,width:16,height:16}),e(x,{html:t.benefit,className:"text-sm font-bold leading-[1.4]"})]},t.id))}),n("div",{className:"mt-4 flex items-center gap-2",children:[e(ae,{variant:"secondary",size:"lg",onClick:()=>c?.join?.(),children:e(x,{html:m?.primaryButton||"Join Now",className:"font-bold"})}),e(ae,{variant:"primary",size:"lg",onClick:()=>c?.login?.(),children:e(x,{html:m?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>W(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),W(!1))}})]})]})}),Ce=ee(({data:a,menuData:l,className:r,onPrimaryNavClick:s,onMobileMenuToggle:b},w)=>{const o=P(()=>ge(a?.categories?.filter(N=>N?.mobileShow)),[a]),{currentMenu:c,setCurrentMenu:h,subSubCategory:p}=Z(),[f,_]=D(!1),[y,v]=D(0),[M,J]=D(null),L=G(null);U(()=>{if(L?.current&&f){const N=L?.current?.getBoundingClientRect();v(window?.innerHeight-(N?.bottom||0))}b?.({open:f})},[f,b]),ie(()=>{le.fromTo(L.current,{height:0},{height:y,duration:.3})},[y]),se(f);const R=P(()=>M?.components?.[0]?.blockType,[M]),I=be(Fe,{categoriesItem:M}),W=fe(Ke,M),Y=he(je,M),A=ve(Ue,M),O=P(()=>{switch(R){case H.Sidebar:return e(W,{});case H.Resource:return e(Y,{});case H.Supports:return e(I,{});case H.Multicol:return e(A,{});default:return null}},[R,M,I]),d=te(()=>{_(!1),v(0),h&&h(j.Primary)},[_,v,h]),z=P(()=>a?.bar?.actions?.filter(N=>N?.mobileShow&&N?.blockType!==C.Profile),[a]),q=P(()=>a?.bar?.actions?.find(N=>N?.mobileShow&&N?.blockType===C.Profile)||{},[a]),T=P(()=>{switch(c){case j.Primary:return e(qe,{actions:z,menuOpen:f,onMenuOpenClose:()=>{_(!1),v(0)},onMenuOpenClick:()=>_(!0)});case j.Secondary:return e(Me,{title:M?.text,onMenuOpenClose:d,onMenuBackClick:()=>h?.(j.Primary)});case j.Third:return e(Me,{title:p?.label,onMenuOpenClose:d,onMenuBackClick:()=>h?.(j.Secondary)});default:return null}},[f,c,h,M,z,p,d]),K=te((N,F)=>{const k=Array.isArray(o)?Array.isArray(o[N])?o[N][F]:{}:{};J(k),k?.components?.[0]?.blockType===H.Links?k?.components?.[0]?.url&&window.open(k?.components?.[0]?.url,k?.components?.[0]?.target??"_blank"):h?.(j.Secondary)},[o,h]);return n(pe,{className:E("relative h-[52px]",r),children:[T,f&&n("nav",{ref:L,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:y},role:"navigation","aria-label":"Mobile navigation menu",children:[c===j.Primary&&l?e("div",{className:"pt-4",children:e(Ee,{data:l})}):null,c===j.Primary?e(Je,{categories:o,onPrimaryMenuClick:K,onPrimaryNavClick:s,profileAction:q}):O]})]})}),Je=({categories:a,onPrimaryMenuClick:l,profileAction:r,onPrimaryNavClick:s})=>n("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map((b,w)=>n("div",{className:"",children:[e("div",{className:E("my-2 h-px w-full bg-[#E5E5E7]")}),b?.map((o,c)=>e(ce,{label:o.text,onClick:()=>{const p=(a?.flat()||[])?.findIndex(f=>f?.id===a[w][c]?.id);l(w,c),s?.(o,p)},icon:o.components?.[0]?.icon},o.id))]},`groupCategory-${w}`))}),e(Ye,{profileAction:r})]}),Ye=({profileAction:a})=>{const[l,r]=D(!1),{profile:s,event:b}=Z(),{locale:w="us"}=ue();return n("div",{className:E("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":l}),children:[n("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>r(!l),"aria-expanded":l,"aria-label":s?.nick_name||a?.welcome,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(Be,{"aria-hidden":"true"})}),e(x,{html:s?.nick_name||a?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!s?.email&&e(Ne,{"aria-hidden":"true",className:E("laptop:size-4 size-5",{"rotate-180":l})})]}),s?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:a?.profiles?.map(o=>e(ce,{label:o?.title,href:re(o?.url,w)},o.id))}),l&&!s?.email&&n("div",{className:"mt-4",children:[e(x,{html:a?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:a?.benefits?.map(o=>n("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:o.benefitIcon?.url,className:"size-4",alt:o.benefit,width:16,height:16}),e(x,{html:o.benefit,className:"text-sm font-bold leading-[1.4]"})]},o.id))})]}),!s?.email&&n("div",{className:"mt-4 flex items-center gap-3",children:[e(ae,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>b?.join?.(),children:e(x,{html:a?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(ae,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>b?.login?.(),children:e(x,{html:a?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},qe=({menuOpen:a,onMenuOpenClose:l,onMenuOpenClick:r,actions:s})=>n("div",{className:"flex h-full items-center justify-between gap-4",children:[e(we,{}),n("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(de,{actions:s}),a?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu","aria-expanded":"true",children:e(ye,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(ze,{className:"size-5","aria-hidden":"true"})})]})]}),we=()=>{const{payloadData:a,isMobile:l}=Z(),{locale:r="us"}=ue();return e("a",{href:re("/",r),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:l?a?.bar?.mobileLogo:a?.bar?.desktopLogo}})},de=ee(({actions:a,activeStatus:l=!1},r)=>{const{event:s,cartCount:b}=Z(),[w,o]=D(null),c=p=>{switch(p){case C.Search:return"Search";case C.Cart:return`Shopping cart${b>0?` (${b} items)`:""}`;case C.Profile:return"User profile";case C.Livestream:return"Livestream";default:return"Action"}},h=te((p,f)=>{switch(o(f),p?.blockType){case C.Search:s?.search?.();break;case C.Cart:s?.cart?.();break;case C.Profile:s?.profile?.();break;case C.Livestream:s?.livestream?.();break;default:return()=>{}}},[s]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(a)&&a?.map((p,f)=>n("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:p.blockType===C.Profile?r:null,onClick:()=>h(p,f),"aria-label":c(p.blockType),"aria-pressed":l&&w===f,children:[e(x,{html:p.icon,className:E("size-5",{"text-brand-0":l&&w===f}),"aria-hidden":"true"}),p.blockType===C.Cart&&b>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:b?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},p.id))})}),Me=({title:a,onMenuOpenClose:l,onMenuBackClick:r})=>n("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Back to previous menu",children:e(Re,{className:"size-5","aria-hidden":"true"})}),e(x,{html:a,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu",children:e(ye,{className:"size-5","aria-hidden":"true"})})]});Ce.displayName="MobileNavigation",de.displayName="Actions",ke.displayName="HeaderNavigation",xe.displayName="DesktopNavigation";var kt=Te(ke);export{kt as default};
1
+ "use client";import{Fragment as Pe,jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as ae,useCallback as ne,useEffect as G,useImperativeHandle as Ee,useMemo as D,useRef as J,useState as E}from"react";import{Picture as me,Text as w,Button as oe,Container as pe,BrandStrip as Te}from"../../components/index.js";import{withLayout as He}from"../../shared/Styles.js";import{cn as T,getLocalizedPath as ie}from"../../helpers/utils.js";import Le,{useNavContext as te}from"./NavProvider.js";import{HeaderNavigationMenu as W,HeaderNavigationBlockType as H,HeaderNavigationActionBlockType as x}from"./types.js";import ze from"jump.js";import{useGSAP as le}from"@gsap/react";import{gsap as re}from"gsap";import{WithSidebar as fe,WithSupports as be,WithMulticol as ve,WithGroupCategory as ge,WithResource as he}from"./withCategory.js";import{Menu as Re,Close as ye,User as Be,LeftArrow as Ie,DownArrow as Ne,Polygon as Ae}from"./icons/index.js";import Oe from"../NavigationSearch/index.js";import{ResourceSidebarDropdown as je}from"./ResourceSidebarDropdown.js";import{MobileResourceSidebarMenu as _e}from"./MobileResourceSidebarMenu.js";import{SidebarDropdown as We}from"./SidebarDropdown.js";import{useScrollLock as se}from"./useScrollLock.js";import{MulticolDropdown as $e}from"./MulticolDropdown.js";import{SupportsDropdown as Ke}from"./SupportsDropdown.js";import{MobileSidebarMenu as Fe}from"./MobileSidebarMenu.js";import{MobileSupportMenu as Ue}from"./MobileSupportMenu.js";import{MobileMulticolMenu as Ge}from"./MobileMulticolMenu.js";import{MenuItem as ce}from"./MobileMenuComponents.js";import{useAiuiContext as ue}from"../AiuiProvider/index.js";import ke from"../../shared/throttle.js";const we=ae((a,l)=>{const{data:{header:r}={},buildProps:s,event:f,profile:C,theme:n="light",isTop:c=!1,searchResult:N,onSearch:p,isSearching:u,keywords:$,onPrimaryNavClick:y,onSeriesProductClick:v,onSidebarNavClick:M,onMobileMenuToggle:Y,headerId:S,cartCount:z,menuData:R,render:B,componentOverrides:q,...Q}=a,[I,d]=E(!1),[K,A]=E(!1),[O,L]=E(!1),[V,b]=E(!1),j=J(null),k=J(null),X=()=>{const g=document?.querySelector("body")?.offsetWidth||0;b(g<=1440)};G(()=>(X(),window.addEventListener("resize",X),()=>{window.removeEventListener("resize",X)}),[]),Ee(l,()=>k.current),G(()=>{k.current&&c&&ze(k.current,{duration:0,offset:k.current?.getBoundingClientRect()?.bottom||0})},[c]),G(()=>{if(c){A(!1),L(!1);return}let g=0,t=0,i=0;const m=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,h=m();g=h,A(h>300),L(h>30);const F=ke(()=>{const P=m(),U=P-g;L(P>30),U>0?(t=0,i+=U,i>=300&&P>300&&A(!0)):U<0&&(i=0,t+=Math.abs(U),t>=300&&(A(!1),t=0)),g=P},100);return window.addEventListener("scroll",F,{passive:!0}),()=>window.removeEventListener("scroll",F)},[c]),G(()=>{f&&(f.search=()=>d(!0))},[f]),le(()=>{j?.current&&I&&re.fromTo(j.current,{height:0},{height:"auto",duration:.3})},[I]),se(I);const Z=D(()=>r?.bar?.actions?.find(g=>g?.blockType===x.Search)?.searchBar?.[0]||{},[r]),_=B?.mobileHeaderNavigation;return e(Le,{buildProps:s,profile:C,isMobile:V,event:f,payloadData:r,onSidebarNavClick:M,onSeriesProductClick:v,cartCount:z,componentOverrides:q,children:e("header",{...Q,id:S||"header","data-ui-component-id":"HeaderNavigation",className:c?"relative z-[100] bg-white":T("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":K}),ref:k,children:o("div",{className:T("hover:bg-white hover:text-black",n==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!c&&O},{"hover:!text-black":n==="dark","!text-black":!c&&O}),onClick:()=>!c&&L(!0),children:[e(xe,{data:r,className:"desktop:block hidden !bg-white",theme:n,onNavItemClick:()=>!c&&L(!0),onPrimaryNavClick:y}),_?e(_,{className:"desktop:hidden block !bg-white",menuData:R,data:r,onPrimaryNavClick:y}):e(Ce,{menuData:R,data:r,className:"desktop:hidden block !bg-white",onPrimaryNavClick:y,onMobileMenuToggle:Y}),I&&o("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${k?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:j,className:T("overflow-y-auto",{}),children:e(Oe,{data:Z,keywords:$,isSearching:u,searchResult:N,onSearch:g=>{p?.(g)},onClose:()=>{p?.(),d(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>d(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:g=>{(g.key==="Enter"||g.key===" "||g.key==="Escape")&&(g.preventDefault(),d(!1))}})]})]})})})}),xe=ae((a,l)=>{const{data:r,onNavItemClick:s,className:f,theme:C,onPrimaryNavClick:n}=a,{event:c,profile:N}=te(),[p,u]=E(!1),{locale:$="us"}=ue(),y=D(()=>ge(r?.categories?.filter(t=>t?.pcShow)),[r]),[v,M]=E(null),[Y,S]=E([]),z=J(null),[R,B]=E(!1),q=J(null),Q=J(null),I=J(y.map(t=>Array(t?.length||0).fill(null)));G(()=>{y?.length&&S(y?.map((t,i)=>t?.map((m,h)=>({groupIndex:i,index:h,open:!1}))))},[y]);const d=D(()=>{let t=null;for(const i of Y){for(const m of i)if(m.open){t=m;break}if(t)break}return t},[Y]);se(!!d?.open||R);const K=(t,i,m)=>{B(!1);const h=y[i][m];if(h?.components?.[0]?.blockType===H.Links)h?.components?.[0]?.url&&window.open(h?.components?.[0]?.url,h?.components?.[0]?.target??"_blank");else{const F=y?.flat()||[],P=F?.findIndex(U=>U?.id===y[i][m]?.id);t.stopPropagation(),s?.(),n?.(F[P],P),M(h),S(U=>U.map(De=>De.map(ee=>ee.groupIndex===i&&ee.index===m?{...ee,open:!ee.open}:{...ee,open:!1})))}},A=(t,i,m)=>{t.key==="Enter"||t.key===" "?(t.preventDefault(),K(t,i,m)):t.key==="Escape"&&d?.groupIndex===i&&d?.index===m&&(t.preventDefault(),O())},O=()=>{S(t=>t.map(i=>i.map(m=>({...m,open:!1}))))},L=D(()=>{if(v)return v?.components?.[0]?.blockType},[v]),V=fe(We,v),b=he(je,v),j=ve($e,v),k=be(Ke,{categoriesItem:v,currentNavItemRef:I.current?.[d?.groupIndex||0]?.[d?.index||0]}),X=D(()=>{switch(L){case H.Sidebar:return e(V,{});case H.Resource:return e(b,{});case H.Supports:return e(k,{});case H.Multicol:return e(j,{});default:return null}},[L,v]),Z=D(()=>r?.bar?.actions?.filter(t=>t?.pcShow),[r]),_=D(()=>Z?.find(t=>t?.blockType===x.Profile),[Z]),g=ne(()=>{B(t=>!t)},[]);return G(()=>{if(z?.current){const t=z.current;return t.addEventListener("click",g),()=>{t.removeEventListener("click",g)}}},[g]),le(()=>{d?.open&&re.fromTo(Q?.current,{height:0},{height:"auto"})},[d?.open]),o(pe,{className:T("relative h-[96px]",f),children:[o("div",{ref:q,onClick:O,className:"flex h-full flex-col justify-end gap-4",children:[o("div",{className:"flex items-center justify-between",children:[e(Me,{}),e(de,{ref:z,actions:Z,activeStatus:R})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:y?.map((t,i)=>e("div",{className:"flex gap-3",children:t?.map((m,h)=>{const F=d?.groupIndex===i&&d?.index===h;return e("div",{ref:P=>{I.current[i][h]=P},className:"group",children:o("div",{className:"relative",children:[o("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:P=>K(P,i,h),onKeyDown:P=>A(P,i,h),"aria-expanded":F,"aria-haspopup":"true","aria-label":m.text,children:[e(w,{html:m.text,className:"text-sm font-bold leading-[1.4]"}),e(Ne,{className:T("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":d?.groupIndex===i&&d?.index===h,"opacity-100":p&&d?.groupIndex===i&&d?.index===h,invisible:!m?.components?.length||m?.components?.[0]?.blockType===H.Links})})]}),e("div",{className:T("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":F},C==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},m.id)})},`groupCategory-${i}`))})]}),o("div",{role:"menu","aria-hidden":!(d?.open&&v),className:T("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:!(d?.open&&v)}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{height:`calc(100dvh - ${q?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:Q,className:T("relative z-50",{"overflow-hidden":L!==H.Supports}),children:X}),e("div",{className:"flex-1 bg-transparent",onClick:O,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),O())}})]}),R&&o("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:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${z?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:N?.email?o(Pe,{children:[e(w,{html:N?.nick_name||_?.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:_?.profiles?.map(t=>e(ce,{className:"py-2",label:t?.title,href:ie(t?.url,$)},t.id))})]}):o(Pe,{children:[e(Ae,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(w,{html:_?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:_?.benefits?.map(t=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:t.benefitIcon?.url,className:"size-4",alt:t.benefit,width:16,height:16}),e(w,{html:t.benefit,className:"text-sm font-bold leading-[1.4]"})]},t.id))}),o("div",{className:"mt-4 flex items-center gap-2",children:[e(oe,{variant:"secondary",size:"lg",onClick:()=>c?.join?.(),children:e(w,{html:_?.primaryButton||"Join Now",className:"font-bold"})}),e(oe,{variant:"primary",size:"lg",onClick:()=>c?.login?.(),children:e(w,{html:_?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>B(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),B(!1))}})]})]})}),Ce=ae(({data:a,menuData:l,className:r,onPrimaryNavClick:s,onMobileMenuToggle:f},C)=>{const n=D(()=>ge(a?.categories?.filter(b=>b?.mobileShow)),[a]),{currentMenu:c,setCurrentMenu:N,subSubCategory:p}=te(),[u,$]=E(!1),[y,v]=E(0),[M,Y]=E(null),S=J(null),z=J(!1);G(()=>{if(S?.current&&u){const b=S?.current?.getBoundingClientRect();v(window?.innerHeight-(b?.top||0))}f?.({open:u})},[u,f]),G(()=>{if(!u)return;const b=ke(()=>{if(S?.current){const j=S.current.getBoundingClientRect();z.current=!0,v(window?.innerHeight-(j?.top||0))}},100);return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[u]),le(()=>{if(z.current){re.set(S.current,{height:y}),z.current=!1;return}re.fromTo(S.current,{height:0},{height:y,duration:.3})},[y]),se(u);const R=D(()=>M?.components?.[0]?.blockType,[M]),B=be(Ue,{categoriesItem:M}),q=fe(Fe,M),Q=he(_e,M),I=ve(Ge,M),d=D(()=>{switch(R){case H.Sidebar:return e(q,{});case H.Resource:return e(Q,{});case H.Supports:return e(B,{});case H.Multicol:return e(I,{});default:return null}},[R,M,B]),K=ne(()=>{$(!1),v(0),N&&N(W.Primary)},[$,v,N]),A=D(()=>a?.bar?.actions?.filter(b=>b?.mobileShow&&b?.blockType!==x.Profile),[a]),O=D(()=>a?.bar?.actions?.find(b=>b?.mobileShow&&b?.blockType===x.Profile)||{},[a]),L=D(()=>{switch(c){case W.Primary:return e(qe,{actions:A,menuOpen:u,onMenuOpenClose:()=>{$(!1),v(0)},onMenuOpenClick:()=>$(!0)});case W.Secondary:return e(Se,{title:M?.text,onMenuOpenClose:K,onMenuBackClick:()=>N?.(W.Primary)});case W.Third:return e(Se,{title:p?.label,onMenuOpenClose:K,onMenuBackClick:()=>N?.(W.Secondary)});default:return null}},[u,c,N,M,A,p,K]),V=ne((b,j)=>{const k=Array.isArray(n)?Array.isArray(n[b])?n[b][j]:{}:{};Y(k),k?.components?.[0]?.blockType===H.Links?k?.components?.[0]?.url&&window.open(k?.components?.[0]?.url,k?.components?.[0]?.target??"_blank"):N?.(W.Secondary)},[n,N]);return o(pe,{className:T("relative h-[52px]",r),children:[L,u&&o("nav",{ref:S,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:y},role:"navigation","aria-label":"Mobile navigation menu",children:[c===W.Primary&&l?e("div",{className:"pt-4",children:e(Te,{data:l})}):null,c===W.Primary?e(Je,{categories:n,onPrimaryMenuClick:V,onPrimaryNavClick:s,profileAction:O}):d]})]})}),Je=({categories:a,onPrimaryMenuClick:l,profileAction:r,onPrimaryNavClick:s})=>o("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map((f,C)=>o("div",{className:"",children:[e("div",{className:T("my-2 h-px w-full bg-[#E5E5E7]")}),f?.map((n,c)=>e(ce,{label:n.text,onClick:()=>{const p=(a?.flat()||[])?.findIndex(u=>u?.id===a[C][c]?.id);l(C,c),s?.(n,p)},icon:n.components?.[0]?.icon},n.id))]},`groupCategory-${C}`))}),e(Ye,{profileAction:r})]}),Ye=({profileAction:a})=>{const[l,r]=E(!1),{profile:s,event:f}=te(),{locale:C="us"}=ue();return o("div",{className:T("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":l}),children:[o("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>r(!l),"aria-expanded":l,"aria-label":s?.nick_name||a?.welcome,children:[o("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(w,{html:s?.nick_name||a?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!s?.email&&e(Ne,{"aria-hidden":"true",className:T("laptop:size-4 size-5",{"rotate-180":l})})]}),s?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:a?.profiles?.map(n=>e(ce,{label:n?.title,href:ie(n?.url,C)},n.id))}),l&&!s?.email&&o("div",{className:"mt-4",children:[e(w,{html:a?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:a?.benefits?.map(n=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:n.benefitIcon?.url,className:"size-4",alt:n.benefit,width:16,height:16}),e(w,{html:n.benefit,className:"text-sm font-bold leading-[1.4]"})]},n.id))})]}),!s?.email&&o("div",{className:"mt-4 flex items-center gap-3",children:[e(oe,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>f?.join?.(),children:e(w,{html:a?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(oe,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>f?.login?.(),children:e(w,{html:a?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},qe=({menuOpen:a,onMenuOpenClose:l,onMenuOpenClick:r,actions:s})=>o("div",{className:"flex h-full items-center justify-between gap-4",children:[e(Me,{}),o("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(de,{actions:s}),a?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu","aria-expanded":"true",children:e(ye,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Re,{className:"size-5","aria-hidden":"true"})})]})]}),Me=()=>{const{payloadData:a,isMobile:l}=te(),{locale:r="us"}=ue();return e("a",{href:ie("/",r),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:l?a?.bar?.mobileLogo:a?.bar?.desktopLogo}})},de=ae(({actions:a,activeStatus:l=!1},r)=>{const{event:s,cartCount:f}=te(),[C,n]=E(null),c=p=>{switch(p){case x.Search:return"Search";case x.Cart:return`Shopping cart${f>0?` (${f} items)`:""}`;case x.Profile:return"User profile";case x.Livestream:return"Livestream";default:return"Action"}},N=ne((p,u)=>{switch(n(u),p?.blockType){case x.Search:s?.search?.();break;case x.Cart:s?.cart?.();break;case x.Profile:s?.profile?.();break;case x.Livestream:s?.livestream?.();break;default:return()=>{}}},[s]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(a)&&a?.map((p,u)=>o("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:p.blockType===x.Profile?r:null,onClick:()=>N(p,u),"aria-label":c(p.blockType),"aria-pressed":l&&C===u,children:[e(w,{html:p.icon,className:T("size-5",{"text-brand-0":l&&C===u}),"aria-hidden":"true"}),p.blockType===x.Cart&&f>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(w,{html:f?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},p.id))})}),Se=({title:a,onMenuOpenClose:l,onMenuBackClick:r})=>o("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Back to previous menu",children:e(Ie,{className:"size-5","aria-hidden":"true"})}),e(w,{html:a,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu",children:e(ye,{className:"size-5","aria-hidden":"true"})})]});Ce.displayName="MobileNavigation",de.displayName="Actions",we.displayName="HeaderNavigation",xe.displayName="DesktopNavigation";var kt=He(we);export{kt as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n onMobileMenuToggle,\n headerId,\n cartCount,\n menuData,\n render,\n ...rest\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n // \u5982\u679C isTop \u4E3A true\uFF0C\u4E0D\u9700\u8981\u6EDA\u52A8\u76D1\u542C\u548C\u52A8\u6548\n if (isTop) {\n setHeaderHidden(false)\n setChangeHeaderBackground(false)\n return\n }\n\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [isTop])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n const CustomMobileHeaderNavigation = render?.mobileHeaderNavigation\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n >\n <header\n {...rest}\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={\n isTop\n ? 'relative z-[100] bg-white'\n : cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })\n }\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: !isTop && changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: !isTop && changeHeaderBackground,\n }\n )}\n onClick={() => !isTop && setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => !isTop && setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {CustomMobileHeaderNavigation ? (\n <CustomMobileHeaderNavigation\n className=\"desktop:hidden block !bg-white\"\n menuData={menuData}\n data={header}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n ) : (\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n onMobileMenuToggle={onMobileMenuToggle}\n />\n )}\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url &&\n window.open(\n currentCategoriesItem?.components?.[0]?.url,\n currentCategoriesItem?.components?.[0]?.target ?? '_blank'\n )\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\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',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex items-center gap-2\">\n <Button variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick, onMobileMenuToggle }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.bottom || 0))\n }\n\n onMobileMenuToggle?.({ open: mobileMenuOpen })\n }, [mobileMenuOpen, onMobileMenuToggle])\n\n useGSAP(() => {\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url &&\n window.open(categoriesItem?.components?.[0]?.url, categoriesItem?.components?.[0]?.target ?? '_blank')\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n 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]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
5
- "mappings": "aA6NU,OA4VI,YAAAA,GA5VJ,OAAAC,EAwBE,QAAAC,MAxBF,oBA5NV,OAAgB,cAAAC,GAAY,eAAAC,GAAa,aAAAC,EAAW,uBAAAC,GAAqB,WAAAC,EAA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CAAC2C,EAAazD,IACzBrH,EAAC,UACC,UAAU,sDAEV,IAAK8K,EAAO,YAAc1J,EAAgC,QAAU8B,EAAM,KAC1E,QAAS,IAAM2H,EAAkBC,EAAQzD,CAAK,EAC9C,aAAYsD,EAAeG,EAAO,SAAS,EAC3C,eAAcN,GAAgBC,IAAiBpD,EAE/C,UAAAtH,EAACU,EAAA,CACC,KAAMqK,EAAO,KACb,UAAWhK,EAAG,SAAU,CAAE,eAAgB0J,GAAgBC,IAAiBpD,CAAM,CAAC,EAClF,cAAY,OACd,EACCyD,EAAO,YAAc1J,EAAgC,MAAQ8C,EAAY,GACxEnE,EAAC,OACC,UAAU,uIACV,cAAY,OAEZ,SAAAA,EAACU,EAAA,CAAK,KAAMyD,GAAW,SAAS,EAAG,UAAU,6CAA6C,EAC5F,IAjBG4G,EAAO,EAmBd,CACD,EACL,CAEJ,CACF,EAEMjB,GAAkB,CAAC,CAAE,MAAAkB,EAAO,gBAAAV,EAAiB,gBAAAW,CAAgB,IAE/DhL,EAAC,OAAI,UAAU,iCACb,UAAAD,EAAC,UACC,UAAU,6CACV,QAAS,IAAMiL,EAAgB,EAC/B,aAAW,wBAEX,SAAAjL,EAACiC,GAAA,CAAU,UAAU,SAAS,cAAY,OAAO,EACnD,EACAjC,EAACU,EAAA,CAAK,KAAMsK,EAAO,UAAU,uDAAuD,EACpFhL,EAAC,UACC,UAAU,6CACV,QAAS,IAAMsK,EAAgB,EAC/B,aAAW,aAEX,SAAAtK,EAAC+B,GAAA,CAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJgE,GAAiB,YAAc,mBAC/B0C,GAAQ,YAAc,UACtBxF,GAAiB,YAAc,mBAC/B6C,GAAkB,YAAc,oBAEhC,IAAOoF,GAAQpK,GAAWmC,EAAgB",
6
- "names": ["Fragment", "jsx", "jsxs", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "Picture", "Text", "Button", "Container", "BrandStrip", "withLayout", "cn", "getLocalizedPath", "NavProvider", "useNavContext", "HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType", "jump", "useGSAP", "gsap", "WithSidebar", "WithSupports", "WithMulticol", "WithGroupCategory", "WithResource", "Menu", "Close", "User", "LeftArrow", "DownArrow", "Polygon", "NavigationSearch", "ResourceSidebarDropdown", "MobileResourceSidebarMenu", "SidebarDropdown", "useScrollLock", "MulticolDropdown", "SupportsDropdown", "MobileSidebarMenu", "MobileSupportMenu", "MobileMulticolMenu", "MenuItem", "useAiuiContext", "throttle", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "onMobileMenuToggle", "headerId", "cartCount", "menuData", "render", "rest", "searchOpen", "setSearchOpen", "headerHidden", "setHeaderHidden", "changeHeaderBackground", "setChangeHeaderBackground", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "lastScrollY", "upwardDistance", "downwardDistance", "getScrollTop", "initialScrollTop", "handleScroll", "currentScrollY", "delta", "searchPage", "item", "CustomMobileHeaderNavigation", "DesktopNavigation", "MobileNavigation", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "rect", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "title", "onMenuBackClick", "HeaderNavigation_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n onMobileMenuToggle,\n headerId,\n cartCount,\n menuData,\n render,\n componentOverrides,\n ...rest\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n // \u5982\u679C isTop \u4E3A true\uFF0C\u4E0D\u9700\u8981\u6EDA\u52A8\u76D1\u542C\u548C\u52A8\u6548\n if (isTop) {\n setHeaderHidden(false)\n setChangeHeaderBackground(false)\n return\n }\n\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [isTop])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n const CustomMobileHeaderNavigation = render?.mobileHeaderNavigation\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n componentOverrides={componentOverrides}\n >\n <header\n {...rest}\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={\n isTop\n ? 'relative z-[100] bg-white'\n : cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })\n }\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: !isTop && changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: !isTop && changeHeaderBackground,\n }\n )}\n onClick={() => !isTop && setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => !isTop && setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {CustomMobileHeaderNavigation ? (\n <CustomMobileHeaderNavigation\n className=\"desktop:hidden block !bg-white\"\n menuData={menuData}\n data={header}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n ) : (\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n onMobileMenuToggle={onMobileMenuToggle}\n />\n )}\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url &&\n window.open(\n currentCategoriesItem?.components?.[0]?.url,\n currentCategoriesItem?.components?.[0]?.target ?? '_blank'\n )\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\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',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex items-center gap-2\">\n <Button variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick, onMobileMenuToggle }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n // resize \u89E6\u53D1\u7684\u9AD8\u5EA6\u66F4\u65B0\u53EA\u9700\u76F4\u63A5\u540C\u6B65\uFF0C\u4E0D\u9700\u8981\u91CD\u653E\u5C55\u5F00\u52A8\u753B\n const skipOpenAnimationRef = useRef(false)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n\n onMobileMenuToggle?.({ open: mobileMenuOpen })\n }, [mobileMenuOpen, onMobileMenuToggle])\n\n // \u79FB\u52A8\u7AEF\u83DC\u5355\u5C55\u5F00\u65F6\uFF0C\u76D1\u542C\u7A97\u53E3\u5C3A\u5BF8\u53D8\u5316\uFF0C\u9632\u6B62\u7528\u6237\u8C03\u6574\u6D4F\u89C8\u5668\u7A97\u53E3\u5927\u5C0F\u540E\u83DC\u5355\u9AD8\u5EA6\u4E0D\u540C\u6B65\n useEffect(() => {\n if (!mobileMenuOpen) return\n\n const handleResize = throttle(() => {\n if (mobileMenuRef?.current) {\n const rect = mobileMenuRef.current.getBoundingClientRect()\n skipOpenAnimationRef.current = true\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n }, 100)\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n if (skipOpenAnimationRef.current) {\n // resize \u5F15\u8D77\u7684\u9AD8\u5EA6\u53D8\u5316\uFF1A\u76F4\u63A5\u540C\u6B65\u9AD8\u5EA6\uFF0C\u4E0D\u64AD\u653E\u5C55\u5F00\u52A8\u753B\n gsap.set(mobileMenuRef.current, { height: menuInnerHeight })\n skipOpenAnimationRef.current = false\n return\n }\n\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url &&\n window.open(categoriesItem?.components?.[0]?.url, categoriesItem?.components?.[0]?.target ?? '_blank')\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n 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]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
5
+ "mappings": "aA+NU,OA4VI,YAAAA,GA5VJ,OAAAC,EAwBE,QAAAC,MAxBF,oBA9NV,OAAgB,cAAAC,GAAY,eAAAC,GAAa,aAAAC,EAAW,uBAAAC,GAAqB,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAE1G,OAAS,WAAAC,GAAS,QAAAC,EAAM,UAAAC,GAAQ,aAAAC,GAAW,cAAAC,OAAkB,4BAE7D,OAAS,cAAAC,OAAkB,yBAE3B,OAAS,MAAAC,EAAI,oBAAAC,OAAwB,yBASrC,OAAOC,IAAe,iBAAAC,OAAqB,mBAE3C,OAAS,wBAAAC,EAAsB,6BAAAC,EAA2B,mCAAAC,MAAuC,aAEjG,OAAOC,OAAU,UAEjB,OAAS,WAAAC,OAAe,cACxB,OAAS,QAAAC,OAAY,OAErB,OAAS,eAAAC,GAAa,gBAAAC,GAAc,gBAAAC,GAAc,qBAAAC,GA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forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "Picture", "Text", "Button", "Container", "BrandStrip", "withLayout", "cn", "getLocalizedPath", "NavProvider", "useNavContext", "HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType", "jump", "useGSAP", "gsap", "WithSidebar", "WithSupports", "WithMulticol", "WithGroupCategory", "WithResource", "Menu", "Close", "User", "LeftArrow", "DownArrow", "Polygon", "NavigationSearch", "ResourceSidebarDropdown", "MobileResourceSidebarMenu", "SidebarDropdown", "useScrollLock", "MulticolDropdown", "SupportsDropdown", "MobileSidebarMenu", "MobileSupportMenu", "MobileMulticolMenu", "MenuItem", "useAiuiContext", "throttle", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "onMobileMenuToggle", "headerId", "cartCount", "menuData", "render", "componentOverrides", "rest", "searchOpen", "setSearchOpen", "headerHidden", "setHeaderHidden", "changeHeaderBackground", "setChangeHeaderBackground", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "lastScrollY", "upwardDistance", "downwardDistance", "getScrollTop", "initialScrollTop", "handleScroll", "currentScrollY", "delta", "searchPage", "item", "CustomMobileHeaderNavigation", "DesktopNavigation", "MobileNavigation", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "skipOpenAnimationRef", "rect", "handleResize", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "title", "onMenuBackClick", "HeaderNavigation_default"]
7
7
  }
@@ -1,5 +1,15 @@
1
1
  import type React from 'react';
2
2
  import type { Product } from '../../cpn-components/CpnProductCard/types.js';
3
+ /**
4
+ * 导航组件覆写配置
5
+ */
6
+ export interface NavigationComponentOverrides {
7
+ /** Badge 组件配置 */
8
+ badge?: {
9
+ /** Badge 样式变体 */
10
+ variant?: 'outline' | 'fill';
11
+ };
12
+ }
3
13
  export interface HeaderNavigationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className'> {
4
14
  data: any;
5
15
  menuData: any;
@@ -35,6 +45,8 @@ export interface HeaderNavigationProps extends Omit<React.HTMLAttributes<HTMLEle
35
45
  profile?: UserProfile;
36
46
  theme?: string;
37
47
  isTop?: boolean;
48
+ /** 组件覆写配置,用于定制导航子组件的样式(如 Badge variant) */
49
+ componentOverrides?: NavigationComponentOverrides;
38
50
  render?: {
39
51
  mobileHeaderNavigation?: (props: MobileNavigationProps) => React.ReactNode;
40
52
  };
@@ -1,2 +1,2 @@
1
- var r=(e=>(e.Primary="primary",e.Secondary="secondary",e.Third="third",e))(r||{}),o=(n=>(n.Sidebar="ipc-navigation-sidebar",n.Supports="ipc-navigation-supports",n.Multicol="ipc-navigation-multicol",n.Links="ipc-navigation-links",n.Resource="ipc-navigation-resource",n))(o||{}),t=(i=>(i.Search="ipc-navigation-action-search",i.Cart="ipc-navigation-action-cart",i.Profile="ipc-navigation-action-profile",i.Livestream="ipc-navigation-action-livestream",i))(t||{});export{t as HeaderNavigationActionBlockType,o as HeaderNavigationBlockType,r as HeaderNavigationMenu};
1
+ var o=(e=>(e.Primary="primary",e.Secondary="secondary",e.Third="third",e))(o||{}),r=(n=>(n.Sidebar="ipc-navigation-sidebar",n.Supports="ipc-navigation-supports",n.Multicol="ipc-navigation-multicol",n.Links="ipc-navigation-links",n.Resource="ipc-navigation-resource",n))(r||{}),t=(i=>(i.Search="ipc-navigation-action-search",i.Cart="ipc-navigation-action-cart",i.Profile="ipc-navigation-action-profile",i.Livestream="ipc-navigation-action-livestream",i))(t||{});export{t as HeaderNavigationActionBlockType,r as HeaderNavigationBlockType,o as HeaderNavigationMenu};
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/types.ts"],
4
- "sourcesContent": ["import type React from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className'> {\n data: any\n menuData: any\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number) => void\n onSeriesProductClick?: (_product: any, _position: number, _seriesLabel?: string) => void\n onMobileMenuToggle?: (data: { open?: boolean }) => void\n searchResult?: any\n onSearch?: (_value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n headerId?: string\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n isTop?: boolean // \u662F\u5426\u5728\u9876\u90E8\n render?: {\n mobileHeaderNavigation?: (props: MobileNavigationProps) => React.ReactNode\n }\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n Resource = 'ipc-navigation-resource',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n menuData: any\n className?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onMobileMenuToggle?: (data: { open?: boolean }) => void\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n className?: string\n theme?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
5
- "mappings": "AAsDO,IAAKA,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAC,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBACRA,EAAA,SAAW,0BALDA,OAAA,IAQAC,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
4
+ "sourcesContent": ["import type React from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\n/**\n * \u5BFC\u822A\u7EC4\u4EF6\u8986\u5199\u914D\u7F6E\n */\nexport interface NavigationComponentOverrides {\n /** Badge \u7EC4\u4EF6\u914D\u7F6E */\n badge?: {\n /** Badge \u6837\u5F0F\u53D8\u4F53 */\n variant?: 'outline' | 'fill'\n }\n}\n\nexport interface HeaderNavigationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className'> {\n data: any\n menuData: any\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number) => void\n onSeriesProductClick?: (_product: any, _position: number, _seriesLabel?: string) => void\n onMobileMenuToggle?: (data: { open?: boolean }) => void\n searchResult?: any\n onSearch?: (_value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n headerId?: string\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n isTop?: boolean // \u662F\u5426\u5728\u9876\u90E8\n /** \u7EC4\u4EF6\u8986\u5199\u914D\u7F6E\uFF0C\u7528\u4E8E\u5B9A\u5236\u5BFC\u822A\u5B50\u7EC4\u4EF6\u7684\u6837\u5F0F\uFF08\u5982 Badge variant\uFF09 */\n componentOverrides?: NavigationComponentOverrides\n render?: {\n mobileHeaderNavigation?: (props: MobileNavigationProps) => React.ReactNode\n }\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n Resource = 'ipc-navigation-resource',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n menuData: any\n className?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onMobileMenuToggle?: (data: { open?: boolean }) => void\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n className?: string\n theme?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
5
+ "mappings": "AAmEO,IAAKA,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAC,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBACRA,EAAA,SAAW,0BALDA,OAAA,IAQAC,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
6
6
  "names": ["HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as e,jsxs as d}from"react/jsx-runtime";import he,{useImperativeHandle as ge,useRef as g,useState as v,useEffect as Q}from"react";import{Heading as y,Picture as S,Text as M,Link as U}from"../../components/index.js";import{cn as r,getLocalizedPath as X}from"../../helpers/utils.js";import{withLayout as ve}from"../../shared/Styles.js";import{useExposure as be}from"../../hooks/useExposure.js";import{useIntersectionObserverDelay as we}from"../../hooks/useIntersectionObserver.js";import{useAiuiContext as _e}from"../AiuiProvider/index.js";import{motion as Y,AnimatePresence as ee}from"framer-motion";const ye="image",ke="image_with_text",te=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),ie=he.forwardRef(({data:ae,className:oe},le)=>{const{title:b,subtitle:k,desc:f,descIcon:P,image:w,padImage:D,mobileImage:z,theme:se="dark",items:E=[],layout:re="left",mediaType:ne="image",datalist:s=[],video:H,padVideo:j,mobVideo:R,button:u,textAlign:l="left"}=ae,i=re,{locale:W="us"}=_e(),V=g(null),N=g(null),T=g(null),I=g(null),C=g(null),[p,me]=v(0),A=g([]),[q,de]=v({left:0,width:0}),[h,$]=v(""),[B,F]=v(""),[O,Z]=v(""),n=s.length>0,_=ne==="video";be(V,{componentType:ye,componentName:ke,componentTitle:b,componentDescription:k}),ge(le,()=>V.current),Q(()=>{if(s.length>0){const t=A.current[p];if(t){const{offsetLeft:o,offsetWidth:a}=t;de({left:o,width:a})}}},[p,s.length]);const[G,pe]=v(!1);we(C,{once:!0,threshold:.01,callback:()=>{pe(!0)}}),Q(()=>{if(!G||!_)return;let t="",o="",a="";if(n&&s[p]){const c=s[p];t=c.video?.url||"",o=c.padVideo?.url||t,a=c.mobVideo?.url||t}else t=H?.url||"",o=j?.url||t,a=R?.url||t;t&&$(t),o&&F(o),a&&Z(a),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},200)},[G,_,n,p,s,H?.url,j?.url,R?.url]);const ce=(t,o)=>{if(me(t),o.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),_&&n&&s[t]){const a=s[t];a.video?.url&&$(a.video.url),a.padVideo?.url&&F(a.padVideo.url),a.mobVideo?.url&&Z(a.mobVideo.url),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},300)}},xe=()=>!L||!u?.text||i==="top"||i==="bottom"?null:e("div",{className:r("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":l==="center","flex justify-start":l==="left"}),children:e(U,{href:X(u.link||"",W),className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:te,children:u.text})}),m=E.length>0,L=!!u,J=()=>{if(n&&s[p]){const t=s[p];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return w?`${w?.url},${D?.url||w?.url} 1024, ${z?.url||w?.url} 768`:""},K=()=>{if(n){const c=s[p],x=c.image?.url,ue=c.imgPad?.url||x,fe=c.imageMob?.url||x;return e(ee,{mode:"wait",children:e(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:d("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:x,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ue,src:B||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:fe,src:O||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},c.video?.url||c.image?.url)})}const t=w?.url,o=D?.url||t,a=z?.url||t;return d("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:B||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:a,src:O||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return d("section",{ref:V,"data-ui-component-id":"ImageWithText",className:r("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!n,"flex-col":!n&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!n&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":n,"aiui-dark":se==="dark"},oe),children:[n&&(b||f||s.length>0)&&d("div",{className:r("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":l==="left","text-center":l==="center"}),children:[d("div",{className:"image-with-text__header",children:[e(y,{as:"h3",size:4,html:b,className:"image-with-text__title"}),e(M,{as:"p",size:1,html:f,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),e("div",{className:r("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":l==="center"}),children:d("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[e("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:q.left,width:q.width}}),s.map((t,o)=>e("div",{ref:a=>{A.current[o]=a},onClick:a=>ce(o,a),className:r("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",p===o?"image-with-text__tab--active text-black":"text-white"),children:e(y,{as:"h1",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},o))]})})]}),!n&&(b||k||f)&&d("div",{className:r("image-with-text__content flex w-full flex-col",{"justify-center":!L,"justify-between":L,"items-start":l==="left"&&m,"items-center":l==="center"&&m,"text-left":l==="left","text-center":l==="center","laptop:order-1":i==="left"}),children:[d("div",{className:r("image-with-text__main-content",{"flex flex-col":L}),children:[d("div",{className:r("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&u?.text}),children:[d("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[e(y,{as:"h2",size:4,html:b,className:r("image-with-text__title",{"text-left":m&&l==="left","text-center":m&&l==="center"})}),k&&e(M,{as:"p",size:m?4:3,html:k,className:r("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!m,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":m,"text-left":m&&l==="left","text-center":m&&l==="center"})})]}),(i==="top"||i==="bottom")&&u?.text&&e(U,{href:X(u.link||"",W),className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:te,children:u.text})]}),!m&&(f||P)&&d("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[P&&e("img",{src:P,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),f&&e(y,{as:"h4",size:5,html:f,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),m&&e("div",{className:r("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:E.map((t,o)=>d("div",{className:r("image-with-text__item",{"text-center":l==="center"}),children:[d("div",{className:r("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":l==="center","justify-start":l==="left"}),children:[e(S,{source:t.icon?.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),e(y,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),e(M,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},o))})]}),xe()]}),e("div",{ref:C,className:r("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":m,"laptop:basis-[63%] desktop:basis-[57%]":m&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":n,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:n?_?K():e(ee,{mode:"wait",children:e(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:e(S,{source:J(),alt:s[p].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},s[p].image?.url)}):_?K():e(S,{source:J(),className:r("image-with-text__image rounded-box laptop:rounded-box")})})]})});ie.displayName="ImageWithText";var De=ve(ie);export{De as default};
1
+ "use client";import{jsx as e,jsxs as d}from"react/jsx-runtime";import he,{useImperativeHandle as ge,useRef as g,useState as v,useEffect as Q}from"react";import{Heading as y,Picture as S,Text as M,Link as U}from"../../components/index.js";import{cn as r,getLocalizedPath as X}from"../../helpers/utils.js";import{withLayout as ve}from"../../shared/Styles.js";import{useExposure as be}from"../../hooks/useExposure.js";import{useIntersectionObserverDelay as we}from"../../hooks/useIntersectionObserver.js";import{useAiuiContext as _e}from"../AiuiProvider/index.js";import{motion as Y,AnimatePresence as ee}from"framer-motion";const ye="image",ke="image_with_text",te=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),ie=he.forwardRef(({data:ae,className:oe},le)=>{const{title:b,subtitle:k,desc:f,descIcon:P,image:w,padImage:D,mobileImage:z,theme:se="dark",items:E=[],layout:re="left",mediaType:ne="image",datalist:s=[],video:H,padVideo:j,mobVideo:R,button:u,textAlign:l="left"}=ae,i=re,{locale:W="us"}=_e(),V=g(null),N=g(null),T=g(null),I=g(null),C=g(null),[p,me]=v(0),A=g([]),[q,de]=v({left:0,width:0}),[h,$]=v(""),[B,F]=v(""),[O,Z]=v(""),n=s.length>0,_=ne==="video";be(V,{componentType:ye,componentName:ke,componentTitle:b,componentDescription:k}),ge(le,()=>V.current),Q(()=>{if(s.length>0){const t=A.current[p];if(t){const{offsetLeft:o,offsetWidth:a}=t;de({left:o,width:a})}}},[p,s.length]);const[G,pe]=v(!1);we(C,{once:!0,threshold:.01,callback:()=>{pe(!0)}}),Q(()=>{if(!G||!_)return;let t="",o="",a="";if(n&&s[p]){const c=s[p];t=c.video?.url||"",o=c.padVideo?.url||t,a=c.mobVideo?.url||t}else t=H?.url||"",o=j?.url||t,a=R?.url||t;t&&$(t),o&&F(o),a&&Z(a),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},200)},[G,_,n,p,s,H?.url,j?.url,R?.url]);const ce=(t,o)=>{if(me(t),o.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),_&&n&&s[t]){const a=s[t];a.video?.url&&$(a.video.url),a.padVideo?.url&&F(a.padVideo.url),a.mobVideo?.url&&Z(a.mobVideo.url),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},300)}},xe=()=>!L||!u?.text||i==="top"||i==="bottom"?null:e("div",{className:r("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":l==="center","flex justify-start":l==="left"}),children:e(U,{href:X(u.link||"",W),className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:te,children:u.text})}),m=E.length>0,L=!!u,J=()=>{if(n&&s[p]){const t=s[p];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return w?`${w?.url},${D?.url||w?.url} 1024, ${z?.url||w?.url} 768`:""},K=()=>{if(n){const c=s[p],x=c.image?.url,ue=c.imgPad?.url||x,fe=c.imageMob?.url||x;return e(ee,{mode:"wait",children:e(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:d("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:x,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ue,src:B||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:fe,src:O||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},c.video?.url||c.image?.url)})}const t=w?.url,o=D?.url||t,a=z?.url||t;return d("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:B||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:a,src:O||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return d("section",{ref:V,"data-ui-component-id":"ImageWithText",className:r("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!n,"flex-col":!n&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!n&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":n,"aiui-dark":se==="dark"},oe),children:[n&&(b||f||s.length>0)&&d("div",{className:r("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":l==="left","text-center":l==="center"}),children:[d("div",{className:"image-with-text__header",children:[e(y,{as:"h3",size:4,html:b,className:"image-with-text__title"}),e(M,{as:"p",size:1,html:f,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),e("div",{className:r("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":l==="center"}),children:d("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[e("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:q.left,width:q.width}}),s.map((t,o)=>e("div",{ref:a=>{A.current[o]=a},onClick:a=>ce(o,a),className:r("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",p===o?"image-with-text__tab--active text-black":"text-white"),children:e(y,{as:"h1",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},o))]})})]}),!n&&(b||k||f)&&d("div",{className:r("image-with-text__content flex w-full flex-col",{"justify-center":!L,"justify-between":L,"items-start":l==="left"&&m,"items-center":l==="center"&&m,"text-left":l==="left","text-center":l==="center","laptop:order-1":i==="left"}),children:[d("div",{className:r("image-with-text__main-content",{"flex flex-col":L}),children:[d("div",{className:r("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&u?.text}),children:[d("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[e(y,{as:"h2",size:4,html:b,className:r("image-with-text__title",{"text-left":m&&l==="left","text-center":m&&l==="center"})}),k&&e(M,{as:"p",size:m?4:3,html:k,className:r("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!m,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":m,"text-left":m&&l==="left","text-center":m&&l==="center"})})]}),(i==="top"||i==="bottom")&&u?.text&&e(U,{href:X(u.link||"",W),className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:te,children:u.text})]}),!m&&(f||P)&&d("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[P&&e("img",{src:P,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),f&&e(y,{as:"h4",size:5,html:f,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),m&&e("div",{className:r("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:E.map((t,o)=>d("div",{className:r("image-with-text__item",{"text-center":l==="center"}),children:[d("div",{className:r("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":l==="center","justify-start":l==="left"}),children:[t.icon?.url&&e(S,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),e(y,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),e(M,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},o))})]}),xe()]}),e("div",{ref:C,className:r("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":m,"laptop:basis-[63%] desktop:basis-[57%]":m&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":n,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:n?_?K():e(ee,{mode:"wait",children:e(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:e(S,{source:J(),alt:s[p].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},s[p].image?.url)}):_?K():e(S,{source:J(),className:r("image-with-text__image rounded-box laptop:rounded-box")})})]})});ie.displayName="ImageWithText";var De=ve(ie);export{De as default};
2
2
  //# sourceMappingURL=ImageWithText.js.map