'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Link=require("next/link");const DesktopMenuItem=({id:e,menu:t,arrow:l,textColor:r,menuTextColor:p,depth:s=0,maxDepth:i=2,menuBg:o,typo:n,typography:g,enableHoverEffect:a,enableDropdownHoverEffect:c})=>{let u=t?.[e];if(!u||s>i)return null;let m=s===i,x=core.composeTypographyStyle(n,g),d=!!u?.childrens?.length&&!m,h=d&&!!l,f=core.getGlobalColorStateStyle("c",0===s?r:p),v=0===s&&a||0!==s&&c?f:core.filterHoverVariables(f);return jsxRuntime.jsxs("li",{className:core.cls("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===s,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":s>0}),style:{...x,...v},children:[u?.link?jsxRuntime.jsx(Link,{href:u.link,title:u.title,className:"gp-w-full",children:u.title}):jsxRuntime.jsx("span",{children:u?.title}),h&&jsxRuntime.jsx("span",{dangerouslySetInnerHTML:{__html:l},className:core.cls("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===s})}),d&&jsxRuntime.jsx("div",{className:core.cls("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===s,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===s}),children:jsxRuntime.jsx("ul",{className:core.cls("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===s}),style:{...core.getGlobalColorResponsiveStyle("bgc",o)},children:u?.childrens?.map(e=>jsxRuntime.jsx(DesktopMenuItem,{id:e,menu:t,depth:s+1,maxDepth:i,arrow:l,menuTextColor:p,menuBg:o,typo:n,typography:g,enableHoverEffect:a,enableDropdownHoverEffect:c},e))})})]})};exports.default=DesktopMenuItem;
