@devstgo/stgo-salta-components-react 0.1.2 → 0.1.4

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.
@@ -83,15 +83,15 @@ export interface Item {
83
83
  title: string;
84
84
  subtitle?: string | null;
85
85
  homeButton?: string | null;
86
- playButton?: string | null;
86
+ playMedia?: Media | null;
87
87
  nodesId?: number | null;
88
88
  cards?: ItemCard[] | null;
89
89
  simulation?: ItemDetail | null;
90
90
  webUrl?: string | null;
91
91
  links?: LinkItem[] | null;
92
- thumb?: string | null;
93
- background?: string | null;
94
- videoBackground?: string | null;
92
+ thumbMedia?: Media | null;
93
+ backgroundMedia?: Media | null;
94
+ videoBackgroundMedia?: Media | null;
95
95
  ppts?: PptItem[] | null;
96
96
  tab?: Tab[] | null;
97
97
  }
@@ -11346,7 +11346,7 @@ function cy(e, t, n, s) {
11346
11346
  tagColor: e.tagName ? "bg-cyan-500/20 text-cyan-300 border-cyan-400/30" : void 0,
11347
11347
  tagUrl: e.tagUrl,
11348
11348
  keyPoints: e.features.map((i) => i.text ?? i.description ?? "").filter(Boolean),
11349
- images: e?.images?.map((i) => `https://atlas-cms.stgo.es${i.url}`),
11349
+ images: e?.images?.map((i) => i.url),
11350
11350
  width: e.width
11351
11351
  };
11352
11352
  }
@@ -11488,7 +11488,7 @@ function wu({ item: e, onClose: t }) {
11488
11488
  exit: { opacity: 0 },
11489
11489
  transition: { duration: 0.5 },
11490
11490
  children: [
11491
- e.items[n].videoBackground && /* @__PURE__ */ a.jsx(
11491
+ e.items[n].videoBackgroundMedia && /* @__PURE__ */ a.jsx(
11492
11492
  w.video,
11493
11493
  {
11494
11494
  autoPlay: !0,
@@ -11499,10 +11499,10 @@ function wu({ item: e, onClose: t }) {
11499
11499
  initial: { opacity: 0, scale: 1.1 },
11500
11500
  animate: { opacity: 1, scale: 1 },
11501
11501
  transition: { duration: 0.8 },
11502
- poster: e.items[n].background ?? "",
11503
- children: /* @__PURE__ */ a.jsx("source", { src: e.items[n].videoBackground, type: "video/webm" })
11502
+ poster: e.items[n].backgroundMedia?.url ?? "",
11503
+ children: /* @__PURE__ */ a.jsx("source", { src: e.items[n].videoBackgroundMedia.url, type: "video/webm" })
11504
11504
  },
11505
- e.items[n].videoBackground
11505
+ e.items[n].videoBackgroundMedia.documentId
11506
11506
  ),
11507
11507
  /* @__PURE__ */ a.jsx(
11508
11508
  w.div,
@@ -11687,11 +11687,11 @@ function wu({ item: e, onClose: t }) {
11687
11687
  layout: { type: "spring", stiffness: 210, damping: 28 }
11688
11688
  },
11689
11689
  children: [
11690
- T(e.items[n].playButton) && /* @__PURE__ */ a.jsx(
11690
+ T(e.items[n]?.playMedia?.url) && /* @__PURE__ */ a.jsx(
11691
11691
  w.button,
11692
11692
  {
11693
11693
  onClick: () => {
11694
- u(e.items[n].playButton.trim()), l(!0);
11694
+ u(e.items[n].playMedia.url.trim()), l(!0);
11695
11695
  },
11696
11696
  className: "inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/25 border border-cyan-400/30 hover:border-cyan-400/60",
11697
11697
  whileHover: { scale: 1.05 },
@@ -11723,7 +11723,7 @@ function wu({ item: e, onClose: t }) {
11723
11723
  "cards-icon"
11724
11724
  ),
11725
11725
  (e.items[n]?.ppts?.length ?? 0) > 0 && e.items[n].ppts.map((z, fe) => {
11726
- const xe = z.image.map((_e) => `https://atlas-cms.stgo.es${_e.url}`), Ae = {
11726
+ const xe = z.image.map((_e) => _e.url), Ae = {
11727
11727
  icon: z.icon ?? "Presentation",
11728
11728
  text: z.name,
11729
11729
  transparent: !1,
@@ -11868,7 +11868,7 @@ function wu({ item: e, onClose: t }) {
11868
11868
  /* @__PURE__ */ a.jsx(
11869
11869
  "img",
11870
11870
  {
11871
- src: z.thumb || "/placeholder.svg",
11871
+ src: z?.thumbMedia?.url || "/placeholder.svg",
11872
11872
  alt: z.title,
11873
11873
  className: "w-full h-full object-cover"
11874
11874
  }
@@ -15151,7 +15151,7 @@ function Mu({ home: e, item: t }) {
15151
15151
  l(!1), r(!0);
15152
15152
  }, C = (T) => {
15153
15153
  F(T), te && H && D({ ...vn });
15154
- }, _ = (T) => !!T?.trim(), M = (T) => T.endsWith(".webm") || T.endsWith(".mp4");
15154
+ }, _ = (T) => !!T?.trim(), M = (T) => T?.endsWith(".webm") || T?.endsWith(".mp4");
15155
15155
  return /* @__PURE__ */ a.jsxs(ke, { children: [
15156
15156
  i && /* @__PURE__ */ a.jsx(
15157
15157
  w.div,
@@ -15183,8 +15183,8 @@ function Mu({ home: e, item: t }) {
15183
15183
  }
15184
15184
  ),
15185
15185
  t?.simulation && /* @__PURE__ */ a.jsx(Cg, { onClick: () => m(!0) }),
15186
- _(t?.playButton) && /* @__PURE__ */ a.jsx(Kr, { Icon: md, onClick: () => {
15187
- h(t.playButton.trim()), u(!0);
15186
+ _(t?.playMedia?.url) && /* @__PURE__ */ a.jsx(Kr, { Icon: md, onClick: () => {
15187
+ h(t.playMedia.url), u(!0);
15188
15188
  } }),
15189
15189
  t?.webUrl && /* @__PURE__ */ a.jsx(Kr, { Icon: pd, onClick: () => y(!0) }),
15190
15190
  (t?.links?.length ?? 0) > 0 && t?.links?.map((T) => /* @__PURE__ */ a.jsx(gi, { item: T, onClick: () => {
@@ -15,7 +15,7 @@ React keys must be passed directly to JSX without using spread:
15
15
  ${t?"bg-slate-900/70 border-cyan-400/40 shadow-[0_25px_80px_-12px_rgba(34,211,238,0.35)]":"border-slate-400/20 hover:border-cyan-400/40 hover:shadow-[0_20px_60px_-15px_rgba(34,211,238,0.3)]"}
16
16
  ${t?"max-h-[calc(100vh-18rem)] md:max-h-[calc(100vh-20rem)] overflow-hidden":""}
17
17
  transition-all duration-300 ease-out
18
- `,whileHover:t?{}:{scale:1.015,y:-3},transition:ob,children:[a.jsxs("div",{className:"flex items-center justify-center mb-5 relative",children:[e.tagUrl?a.jsx("a",{href:e.tagUrl,target:"_blank",rel:"noopener noreferrer",className:`px-3 py-1 text-xs font-semibold rounded-full border hover:scale-105 transition-transform ${e.tagColor||"bg-cyan-500/20 text-cyan-300 border-cyan-400/30"}`,onClick:C=>C.stopPropagation(),children:e.tag}):a.jsx("span",{className:`px-3 py-1 text-xs font-semibold rounded-full border ${e.tagColor||"bg-cyan-500/20 text-cyan-300 border-cyan-400/30"}`,children:e.tag}),t&&a.jsx(S.button,{initial:{scale:0},animate:{scale:1},className:"absolute right-0 p-1 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors",onClick:C=>{C.stopPropagation(),r()},children:a.jsx(F.X,{className:"w-4 h-4 text-cyan-300"})})]}),a.jsx("h3",{className:`text-2xl font-bold mb-3 transition-colors duration-300 ${t?"text-cyan-300":"text-white"}`,children:a.jsxs("span",{className:"relative inline-block",children:[e.title,a.jsx(S.span,{className:"absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-cyan-400 to-teal-400",initial:{width:0},animate:{width:t?"100%":0},transition:{duration:.5,ease:[.22,1,.36,1],delay:t?.2:0}})]})}),a.jsx(S.p,{className:`text-base text-slate-300 leading-relaxed ${t?"shrink-0":"grow"}`,animate:{opacity:t?.9:1,marginBottom:t?"1.5rem":"1rem"},children:e.description}),a.jsx(Ne,{mode:"wait",children:t&&a.jsxs(S.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.25,ease:[.4,0,.2,1]},className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden pr-1",children:[e.images&&e.images.length>0&&a.jsx(S.div,{className:"mt-6 pt-6 border-t border-cyan-400/30",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},children:e.images.length>6?a.jsxs("div",{className:"relative",children:[h&&a.jsx("button",{onClick:C=>{C.stopPropagation(),M("left")},className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 w-12 h-12 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg","aria-label":"Anterior",children:a.jsx(F.ChevronLeft,{className:"w-6 h-6"})}),a.jsx("div",{ref:f,className:"flex gap-4 overflow-x-auto scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.images.map((C,w)=>a.jsxs(S.div,{className:"relative aspect-video rounded-lg overflow-hidden border border-cyan-400/20 hover:border-cyan-400/40 transition-colors cursor-pointer group/image shrink-0 w-64",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.15+Math.min(w,6)*.05,duration:.3},onClick:I=>{I.stopPropagation(),v(w)},whileHover:{scale:1.05},children:[a.jsx("img",{src:C.url||C,alt:C.alt||`Imagen ${w+1}`,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover/image:bg-black/20 transition-colors flex items-center justify-center",children:a.jsx("span",{className:"opacity-0 group-hover/image:opacity-100 text-white text-sm font-medium transition-opacity",children:"Ver imagen"})})]},`${e.id}-img-${C.url||w}`))}),p&&a.jsx("button",{onClick:C=>{C.stopPropagation(),M("right")},className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 w-12 h-12 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg","aria-label":"Siguiente",children:a.jsx(F.ChevronRight,{className:"w-6 h-6"})})]}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:e.images.map((C,w)=>a.jsxs(S.div,{className:"relative aspect-video rounded-lg overflow-hidden border border-cyan-400/20 hover:border-cyan-400/40 transition-colors cursor-pointer group/image",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.15+w*.05,duration:.3},onClick:I=>{I.stopPropagation(),v(w)},whileHover:{scale:1.05},children:[a.jsx("img",{src:C.url||C,alt:C.alt||`Imagen ${w+1}`,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover/image:bg-black/20 transition-colors flex items-center justify-center",children:a.jsx("span",{className:"opacity-0 group-hover/image:opacity-100 text-white text-sm font-medium transition-opacity",children:"Ver imagen"})})]},`${e.id}-img-${C.url||w}`))})}),e.keyPoints&&e.keyPoints.length>0&&a.jsxs(S.div,{className:"mt-6 pt-6 border-t border-cyan-400/30",initial:{opacity:0},animate:{opacity:1},transition:{delay:.15,duration:.3},children:[a.jsxs("h4",{className:"text-lg font-bold text-cyan-300 mb-4 flex items-center gap-2",children:[a.jsx(F.Check,{className:"w-5 h-5"}),"Puntos Clave"]}),a.jsx("ul",{className:"space-y-3",children:e.keyPoints.map((C,w)=>a.jsxs(S.li,{className:"flex items-start gap-3 text-slate-200",initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.2+w*.05,duration:.25},children:[a.jsx("span",{className:"mt-1.5 w-2 h-2 rounded-full bg-cyan-400 shrink-0"}),a.jsx("span",{children:C})]},`${e.id}-kp-${w}-${C.slice(0,20)}`))})]}),o&&a.jsx(S.div,{className:"mt-6 pt-6 border-t border-cyan-400/30",initial:{opacity:0},animate:{opacity:1},transition:{delay:.15,duration:.3},children:o})]})})]})}),typeof document<"u"&&vo.createPortal(a.jsx(Ne,{children:u!==null&&e.images&&a.jsxs(S.div,{className:"absolute inset-0 z-12000 flex items-center justify-center bg-black",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:x,children:[a.jsx(S.button,{className:"absolute top-4 right-4 p-2 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors z-10",onClick:C=>{C.stopPropagation(),x()},initial:{scale:0},animate:{scale:1},transition:{delay:.2},children:a.jsx(F.X,{className:"w-6 h-6 text-cyan-300"})}),e.images.length>1&&a.jsxs(a.Fragment,{children:[a.jsx(S.button,{className:"absolute left-4 p-3 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors z-10",onClick:C=>{C.stopPropagation(),N()},initial:{x:-20,opacity:0},animate:{x:0,opacity:1},transition:{delay:.3},children:a.jsx(F.ChevronLeft,{className:"w-6 h-6 text-cyan-300"})}),a.jsx(S.button,{className:"absolute right-4 p-3 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors z-10",onClick:C=>{C.stopPropagation(),E()},initial:{x:20,opacity:0},animate:{x:0,opacity:1},transition:{delay:.3},children:a.jsx(F.ChevronRight,{className:"w-6 h-6 text-cyan-300"})})]}),a.jsxs(S.div,{className:"relative w-screen h-screen p-6 md:p-10",initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{type:"spring",stiffness:300,damping:30},onClick:C=>C.stopPropagation(),children:[a.jsx("div",{className:"w-full h-full overflow-hidden flex items-center justify-center",children:a.jsx("img",{src:e.images[u].url||e.images[u],alt:e.images[u].alt||`Imagen ${u+1}`,className:"w-full h-full object-contain"})}),e.images[u].alt&&a.jsx(S.div,{className:"absolute bottom-0 left-0 right-0 bg-linear-to-t from-black/80 to-transparent p-6 rounded-b-lg",initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},children:a.jsx("p",{className:"text-white text-center text-lg font-medium",children:e.images[u].alt})}),e.images.length>1&&a.jsx(S.div,{className:"absolute top-4 left-1/2 -translate-x-1/2 px-4 py-2 bg-slate-800/80 rounded-full border border-cyan-400/30",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},children:a.jsxs("span",{className:"text-cyan-300 text-sm font-medium",children:[u+1," / ",e.images.length]})})]})]})}),document.body)]})}function ab(e){return e&&rs[e]||F.Layers}function lb(e,t,n,s){return{id:`tab-${n}-card-${s}`,title:e.title,description:e.subtitle,icon:ab(t),tag:e.tagName||"Info",tagColor:e.tagName?"bg-cyan-500/20 text-cyan-300 border-cyan-400/30":void 0,tagUrl:e.tagUrl,keyPoints:e.features.map(i=>i.text??i.description??"").filter(Boolean),images:e?.images?.map(i=>`https://atlas-cms.stgo.es${i.url}`),width:e.width}}function cb(e){return e.some(n=>n.width==="third")?"grid-cols-1 md:grid-cols-3":"grid-cols-1 md:grid-cols-2"}function pu({tab:e,tabIndex:t=0,expandedCardId:n,setExpandedCardId:s}){const i=u=>{s(n===u?null:u)},r=()=>{s(null)};if(!e?.cards||e.cards.length===0)return a.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"text-slate-400 text-lg",children:"No hay contenido disponible para esta vista"})});const o=e.cards.map((u,d)=>lb(u,e.icon,t,d)),l=n?o.find(u=>u.id===n):void 0,c=`grid ${cb(e.cards)} gap-4 items-start`;return a.jsx(S.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4,ease:[.4,0,.2,1]},className:"space-y-6",children:a.jsx(Ne,{mode:"wait",initial:!1,children:l?a.jsx(S.div,{initial:{opacity:0,y:14,scale:.995},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.995,transition:{duration:.16,ease:[.4,0,1,1]}},transition:{duration:.34,ease:[.22,1,.36,1]},children:a.jsx(ao,{card:l,delay:0,isExpanded:!0,isOtherExpanded:!1,collapsedUniformHeight:!1,onToggle:()=>i(l.id),onClose:r,gridSpan:!0},l.id)},`expanded-${l.id}`):a.jsx(S.div,{className:c,initial:{opacity:0,y:10,scale:.998},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.998,transition:{duration:.14,ease:[.4,0,1,1]}},transition:{duration:.26,ease:[.22,1,.36,1]},children:o.map((u,d)=>a.jsx(ao,{card:u,delay:d,isExpanded:!1,isOtherExpanded:!1,collapsedUniformHeight:!0,onToggle:()=>i(u.id),onClose:r,gridSpan:!0},u.id))},"collapsed-grid")})})}function gu({item:e,onClose:t}){const[n,s]=b.useState(0),[i,r]=b.useState(0),[o,l]=b.useState(!1),[c,u]=b.useState(""),[d,f]=b.useState(!1),[h,m]=b.useState(""),[p,y]=b.useState(!1),[v,x]=b.useState(!1),[N,E]=b.useState(),[j,M]=b.useState(.3),[k,C]=b.useState(null),[w,I]=b.useState(null),$=b.useRef(null),[z,J]=b.useState(!1),[R,se]=b.useState(!1),K=6,te=Math.max(0,e?.items.length-K),V=e?.items[n]?.cards??[];b.useEffect(()=>{const W=document.body.style.overflow,me=document.documentElement.style.overflow;return document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",()=>{document.body.style.overflow=W,document.documentElement.style.overflow=me}},[]);const P=()=>{i>0&&r(W=>Math.max(0,W-K))},_=()=>{i<te&&r(W=>Math.min(te,W+K))},A=()=>{M(W=>W===0?.3:W===.3?.6:W===.6?.9:0)},T=W=>!!W?.trim(),O=W=>W.endsWith(".webm")||W.endsWith(".mp4"),ne=W=>{T(W)&&(m(W.trim()),f(!0))},ie=()=>{const W=$.current;if(!W)return;const{scrollLeft:me,scrollWidth:ve,clientWidth:Le}=W;J(me>0),se(me<ve-Le-10)},re=W=>{const me=$.current;if(!me)return;const ve=300;me.scrollBy({left:W==="left"?-ve:ve,behavior:"smooth"})},ae=e?.items[n]?.tab||[];b.useEffect(()=>{ie();const W=$.current;if(W)return W.addEventListener("scroll",ie),window.addEventListener("resize",ie),()=>{W.removeEventListener("scroll",ie),window.removeEventListener("resize",ie)}},[ae]),b.useEffect(()=>{M(.3);const W=globalThis.setTimeout(()=>{M(.9)},1e4);return()=>globalThis.clearTimeout(W)},[n]);const le=W=>W&&rs[W]||F.Layers,be=W=>{if(!(W<0||W>=ae.length))return ae[W]},ce=k!=null;return a.jsxs(a.Fragment,{children:[a.jsxs(S.div,{className:"fixed inset-0 z-[10000] bg-black",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},children:[e.items[n].videoBackground&&a.jsx(S.video,{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed inset-0 w-full h-full object-cover z-[101]",initial:{opacity:0,scale:1.1},animate:{opacity:1,scale:1},transition:{duration:.8},poster:e.items[n].background??"",children:a.jsx("source",{src:e.items[n].videoBackground,type:"video/webm"})},e.items[n].videoBackground),a.jsx(S.div,{className:"fixed inset-0 bg-black z-[102]",initial:{opacity:0},animate:{opacity:j},transition:{duration:.5,ease:"easeInOut"}}),a.jsx("div",{className:"relative z-[105] h-full overflow-y-auto overflow-x-hidden scrollbar-hide overscroll-contain",children:a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center px-8 pb-64",children:[a.jsxs("div",{className:"relative w-full flex justify-center mb-8 mt-24 md:mt-28",children:[z&&a.jsx(S.button,{onClick:W=>{W.stopPropagation(),re("left")},className:"absolute left-4 top-1/2 -translate-y-1/2 z-20 w-10 h-10 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileHover:{scale:1.1},whileTap:{scale:.9},children:a.jsx(F.ChevronLeft,{className:"w-5 h-5"})}),a.jsxs(S.div,{ref:$,className:"flex items-center justify-center gap-3 overflow-x-auto scrollbar-hide max-w-full px-2 py-2",initial:{opacity:0,y:-30,scale:.9},animate:{opacity:1,y:0,scale:1},transition:{delay:.3,duration:.7,ease:[.22,1,.36,1]},children:[a.jsx("div",{className:"w-11 h-11 shrink-0","aria-hidden":"true"}),ae.map((W,me)=>{const ve=le(W.icon),Le=k===me;return a.jsxs(S.button,{onClick:()=>{C(me),I(null)},className:`relative px-6 py-3 rounded-full font-medium text-sm transition-all duration-300 flex items-center gap-2 shrink-0 ${Le?"bg-gradient-to-r from-cyan-500 to-blue-600 text-white border border-cyan-400":"bg-slate-800/60 text-cyan-400 border border-slate-600/50 hover:text-white hover:border-cyan-400/60"}`,whileHover:{scale:1.05},whileTap:{scale:.95},children:[a.jsx(ve,{className:"w-4 h-4"}),W.name,Le&&a.jsx(S.div,{layoutId:"activeTab",className:"absolute inset-0 bg-cyan-400/20 rounded-full -z-10",transition:{type:"spring",stiffness:300,damping:30}})]},`${W.name}-${me}`)}),a.jsx("div",{className:"w-11 h-11 shrink-0 flex items-center justify-center",children:a.jsx(S.button,{onClick:()=>{k!==null&&(C(null),I(null))},className:"relative p-3 rounded-full bg-slate-800/60 hover:bg-slate-700/80 text-cyan-300 hover:text-cyan-200 border border-slate-600/50 hover:border-cyan-400/60 transition-all duration-300 shadow-lg hover:shadow-cyan-500/30 disabled:pointer-events-none",initial:!1,animate:{opacity:ce?1:0,scale:ce?1:.75,x:ce?0:-6},transition:{type:"spring",stiffness:300,damping:25},whileHover:ce?{scale:1.1,rotate:90}:{},whileTap:ce?{scale:.9}:{},disabled:!ce,"aria-hidden":!ce,tabIndex:ce?0:-1,children:a.jsx(F.X,{className:"w-5 h-5"})})})]}),R&&a.jsx(S.button,{onClick:W=>{W.stopPropagation(),re("right")},className:"absolute right-4 top-1/2 -translate-y-1/2 z-20 w-10 h-10 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileHover:{scale:1.1},whileTap:{scale:.9},children:a.jsx(F.ChevronRight,{className:"w-5 h-5"})})]}),a.jsxs(S.div,{layout:!0,className:"text-center max-w-6xl w-full",initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,ease:[.22,1,.36,1]},style:{willChange:"transform, opacity",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[a.jsxs(S.div,{layout:"position",initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.6,duration:1,ease:[.22,1,.36,1]},style:{backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},children:[a.jsx(S.h1,{className:"text-6xl sm:text-7xl md:text-8xl font-bold mb-6 leading-tight uppercase font-tomorrow text-cyan-300 line-clamp-2",style:{letterSpacing:"3px",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},initial:{opacity:0,y:30,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{delay:.8,duration:.6,ease:[.22,1,.36,1]},children:e.items[n].title},e.items[n].title),a.jsx(Ne,{mode:"popLayout",initial:!1,children:k===null&&a.jsx(S.p,{layout:"position",className:"text-sm sm:text-base text-white/90 uppercase tracking-tighter font-medium md:text-base text-center px-[100px] mt-[-5px] shadow-none",style:{textShadow:"0 2px 10px rgba(0, 0, 0, 0.8)",fontFamily:"system-ui, -apple-system, sans-serif",letterSpacing:"0.2em",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},initial:{opacity:0,y:12,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-8,filter:"blur(3px)"},transition:{duration:.28,ease:[.22,1,.36,1]},children:e.items[n].subtitle},`subtitle-${n}`)}),a.jsxs(S.div,{layout:"position",className:"flex items-center justify-center gap-4 mt-8",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1.3,duration:.6,ease:[.22,1,.36,1],layout:{type:"spring",stiffness:210,damping:28}},children:[T(e.items[n].playButton)&&a.jsx(S.button,{onClick:()=>{u(e.items[n].playButton.trim()),l(!0)},className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/25 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.4+0*.1,duration:.4},children:a.jsx(F.Play,{className:"w-5 h-5"})},"play-icon"),(e.items[n]?.links?.length??0)>0&&e.items[n]?.links?.map(W=>a.jsx(Un,{item:W,onClick:()=>{O(W.url)?(u(W.url.trim()),l(!0)):ne(W.url)}})),(V?.length??0)>0&&a.jsx(S.button,{onClick:()=>y(!0),className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/25 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.6,duration:.4},children:a.jsx(F.Grid2x2,{className:"w-5 h-5"})},"cards-icon"),(e.items[n]?.ppts?.length??0)>0&&e.items[n].ppts.map((W,me)=>{const ve=W.image.map(Fe=>`https://atlas-cms.stgo.es${Fe.url}`),Le={icon:W.icon??"Presentation",text:W.name,transparent:!1,url:""};return a.jsx(Un,{item:Le,onClick:()=>{E(ve),x(!0)}},`ppt-${W.name}-${me}`)}),a.jsxs(S.button,{onClick:A,className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-slate-400 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-slate-500/25 border border-slate-400/30 hover:border-slate-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.4+1*.1,duration:.4},children:[a.jsx(F.Layers,{className:"w-5 h-5"}),a.jsxs("span",{className:"text-xs",children:[j===0&&"0%",j===.3&&"30%",j===.6&&"60%",j===.9&&"90%"]})]})]},`buttons-${n}`)]}),a.jsx(Ne,{mode:"popLayout",initial:!1,children:k!==null&&typeof k=="number"&&a.jsx(S.div,{layout:"position",className:`w-full transition-[margin] duration-300 ${w?"mt-20 md:mt-24":"mt-16"}`,style:{perspective:"2000px"},initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3,ease:[.22,1,.36,1],layout:{type:"spring",stiffness:200,damping:30}},children:a.jsx(pu,{tab:be(k),tabIndex:k,expandedCardId:w,setExpandedCardId:I})},`tab-${k}-view`)})]})]})}),a.jsxs(S.button,{onClick:()=>{t(),s(0),r(0)},className:"fixed top-8 left-1/2 -translate-x-1/2 z-[110] px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 rounded-full transition-all duration-300 border-2 border-cyan-400/50 hover:border-cyan-400/80 shadow-lg hover:shadow-cyan-500/50 font-medium flex items-center gap-2",initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-50,scale:.8},transition:{delay:.3,duration:.4,ease:[.34,1.56,.64,1]},whileHover:{scale:1.05,boxShadow:"0 0 30px rgba(34, 211, 238, 0.6)"},whileTap:{scale:.95},children:[a.jsx(F.X,{className:"w-5 h-5"}),a.jsx("span",{children:"Cerrar"})]}),e.items.length>1&&a.jsx(S.div,{className:"fixed bottom-0 left-0 right-0 z-[110] py-8",initial:{y:200,opacity:0},animate:{y:0,opacity:1},exit:{y:200,opacity:0},transition:{delay:.5,duration:.6,ease:[.34,1.56,.64,1]},children:a.jsx("div",{className:"max-w-7xl mx-auto px-6",children:a.jsxs("div",{className:"flex items-center justify-center gap-6",children:[a.jsx(S.button,{onClick:P,disabled:i===0,className:"p-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 rounded-full transition-all duration-300 border-2 border-cyan-400/30 hover:border-cyan-400/60 shadow-lg hover:shadow-cyan-500/50 disabled:opacity-30 disabled:cursor-not-allowed",whileHover:{scale:1.1,x:-3},whileTap:{scale:.9},initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:.7,duration:.4},children:a.jsx(F.ChevronLeft,{className:"w-6 h-6"})}),a.jsx("div",{className:"flex-1 max-w-7xl overflow-hidden",children:a.jsx(S.div,{className:"flex gap-4",animate:{x:`calc(-${i*(100/K)}% - ${i/K*16}px)`},transition:{type:"spring",stiffness:300,damping:30,mass:.8},children:e.items.map((W,me)=>{const ve=n===me;return a.jsxs(S.div,{onClick:()=>{s(me),C(null),I(null),y(!1),M(.3)},className:`relative flex-shrink-0 h-32 cursor-pointer rounded-xl overflow-hidden transition-all duration-300 ${ve?"shadow-2xl shadow-cyan-500/50":"shadow-lg hover:shadow-cyan-400/30"}`,style:{width:"calc(16.666% - 13.33px)"},whileHover:{scale:1.05,y:-5},whileTap:{scale:.98},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.6+me*.03,duration:.3},children:[a.jsx("img",{src:W.thumb||"/placeholder.svg",alt:W.title,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/30 via-30% to-transparent"}),a.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-3",children:a.jsx("h3",{className:"text-white font-semibold text-sm text-center drop-shadow-lg",children:W.title})}),ve&&a.jsx(S.div,{className:"absolute top-2 right-2 w-8 h-8 bg-cyan-400 rounded-full flex items-center justify-center shadow-lg",initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:200,damping:15},children:a.jsx(F.Check,{className:"w-5 h-5 text-slate-900 stroke-[3]"})}),ve&&a.jsx(S.div,{className:"absolute inset-0 border-4 border-cyan-400 rounded-xl pointer-events-none",animate:{opacity:[.5,0,.5],scale:[1,1.05,1]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]},W.title)})})}),a.jsx(S.button,{onClick:_,disabled:i>=te,className:"p-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 rounded-full transition-all duration-300 border-2 border-cyan-400/30 hover:border-cyan-400/60 shadow-lg hover:shadow-cyan-500/50 disabled:opacity-30 disabled:cursor-not-allowed",whileHover:{scale:1.1,x:3},whileTap:{scale:.9},initial:{opacity:0,x:50},animate:{opacity:1,x:0},transition:{delay:.7,duration:.4},children:a.jsx(F.ChevronRight,{className:"w-6 h-6"})})]})})})]}),o&&a.jsx(mu,{source:c,onClose:()=>l(!1)}),d&&a.jsx(Ht,{src:h,onClose:()=>{f(!1),m("")}}),p&&(V?.length??0)>0&&a.jsx(vc,{cards:V,onClose:()=>y(!1)}),v&&a.jsx(ib,{images:N,onClose:()=>x(!1)})]})}function ub({showLinkModal:e,setShowLinkModal:t,modalUrl:n}){const s=()=>{t(!1)};return a.jsx(Ne,{children:e&&a.jsx(Ht,{onClose:s,src:n})})}function db({isOpen:e,onClose:t,type:n,itemName:s}){if(!e)return null;const i=n==="inner"?"Esta propuesta de valor todavía no está asociada a una familia o producto tractor":"Este desarrollo tecnológico todavía no está asociado a una familia o producto tractor";return a.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 w-full max-w-md overflow-y-auto rounded-xl",style:{background:"rgba(13, 25, 48, 0.9)",backdropFilter:"blur(10px)",border:"1px solid rgba(59, 130, 246, 0.3)",boxShadow:"0 0 30px rgba(0, 120, 255, 0.4)",animation:"fadeIn 0.3s ease-out",fontFamily:"'Manrope', sans-serif"},children:a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h2",{className:"text-2xl font-bold text-blue-100",children:s}),a.jsx("button",{onClick:t,className:"p-2 rounded-full bg-blue-900/50 text-blue-300 hover:bg-blue-800 hover:text-blue-100 transition-all",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),a.jsx("div",{className:"grid grid-cols-1 gap-6",children:a.jsx("div",{children:a.jsx("div",{className:"p-4 rounded-lg",style:{background:"rgba(30, 64, 175, 0.3)",border:"1px solid rgba(59, 130, 246, 0.3)",boxShadow:"0 0 15px rgba(0, 120, 255, 0.2)"},children:a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-full mr-4 flex items-center justify-center",style:{background:"rgba(30, 64, 175, 0.4)",border:"2px solid rgba(59, 130, 246, 0.5)",boxShadow:"0 0 15px rgba(0, 120, 255, 0.3)"},children:a.jsx("span",{className:"text-xl font-bold text-blue-100",children:n==="inner"?"PV":"DT"})}),a.jsx("div",{className:"text-yellow-300 italic",children:i})]})})})})]})})}const fb=`
18
+ `,whileHover:t?{}:{scale:1.015,y:-3},transition:ob,children:[a.jsxs("div",{className:"flex items-center justify-center mb-5 relative",children:[e.tagUrl?a.jsx("a",{href:e.tagUrl,target:"_blank",rel:"noopener noreferrer",className:`px-3 py-1 text-xs font-semibold rounded-full border hover:scale-105 transition-transform ${e.tagColor||"bg-cyan-500/20 text-cyan-300 border-cyan-400/30"}`,onClick:C=>C.stopPropagation(),children:e.tag}):a.jsx("span",{className:`px-3 py-1 text-xs font-semibold rounded-full border ${e.tagColor||"bg-cyan-500/20 text-cyan-300 border-cyan-400/30"}`,children:e.tag}),t&&a.jsx(S.button,{initial:{scale:0},animate:{scale:1},className:"absolute right-0 p-1 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors",onClick:C=>{C.stopPropagation(),r()},children:a.jsx(F.X,{className:"w-4 h-4 text-cyan-300"})})]}),a.jsx("h3",{className:`text-2xl font-bold mb-3 transition-colors duration-300 ${t?"text-cyan-300":"text-white"}`,children:a.jsxs("span",{className:"relative inline-block",children:[e.title,a.jsx(S.span,{className:"absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-cyan-400 to-teal-400",initial:{width:0},animate:{width:t?"100%":0},transition:{duration:.5,ease:[.22,1,.36,1],delay:t?.2:0}})]})}),a.jsx(S.p,{className:`text-base text-slate-300 leading-relaxed ${t?"shrink-0":"grow"}`,animate:{opacity:t?.9:1,marginBottom:t?"1.5rem":"1rem"},children:e.description}),a.jsx(Ne,{mode:"wait",children:t&&a.jsxs(S.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.25,ease:[.4,0,.2,1]},className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden pr-1",children:[e.images&&e.images.length>0&&a.jsx(S.div,{className:"mt-6 pt-6 border-t border-cyan-400/30",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},children:e.images.length>6?a.jsxs("div",{className:"relative",children:[h&&a.jsx("button",{onClick:C=>{C.stopPropagation(),M("left")},className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 w-12 h-12 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg","aria-label":"Anterior",children:a.jsx(F.ChevronLeft,{className:"w-6 h-6"})}),a.jsx("div",{ref:f,className:"flex gap-4 overflow-x-auto scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.images.map((C,w)=>a.jsxs(S.div,{className:"relative aspect-video rounded-lg overflow-hidden border border-cyan-400/20 hover:border-cyan-400/40 transition-colors cursor-pointer group/image shrink-0 w-64",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.15+Math.min(w,6)*.05,duration:.3},onClick:I=>{I.stopPropagation(),v(w)},whileHover:{scale:1.05},children:[a.jsx("img",{src:C.url||C,alt:C.alt||`Imagen ${w+1}`,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover/image:bg-black/20 transition-colors flex items-center justify-center",children:a.jsx("span",{className:"opacity-0 group-hover/image:opacity-100 text-white text-sm font-medium transition-opacity",children:"Ver imagen"})})]},`${e.id}-img-${C.url||w}`))}),p&&a.jsx("button",{onClick:C=>{C.stopPropagation(),M("right")},className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 w-12 h-12 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg","aria-label":"Siguiente",children:a.jsx(F.ChevronRight,{className:"w-6 h-6"})})]}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:e.images.map((C,w)=>a.jsxs(S.div,{className:"relative aspect-video rounded-lg overflow-hidden border border-cyan-400/20 hover:border-cyan-400/40 transition-colors cursor-pointer group/image",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.15+w*.05,duration:.3},onClick:I=>{I.stopPropagation(),v(w)},whileHover:{scale:1.05},children:[a.jsx("img",{src:C.url||C,alt:C.alt||`Imagen ${w+1}`,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover/image:bg-black/20 transition-colors flex items-center justify-center",children:a.jsx("span",{className:"opacity-0 group-hover/image:opacity-100 text-white text-sm font-medium transition-opacity",children:"Ver imagen"})})]},`${e.id}-img-${C.url||w}`))})}),e.keyPoints&&e.keyPoints.length>0&&a.jsxs(S.div,{className:"mt-6 pt-6 border-t border-cyan-400/30",initial:{opacity:0},animate:{opacity:1},transition:{delay:.15,duration:.3},children:[a.jsxs("h4",{className:"text-lg font-bold text-cyan-300 mb-4 flex items-center gap-2",children:[a.jsx(F.Check,{className:"w-5 h-5"}),"Puntos Clave"]}),a.jsx("ul",{className:"space-y-3",children:e.keyPoints.map((C,w)=>a.jsxs(S.li,{className:"flex items-start gap-3 text-slate-200",initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.2+w*.05,duration:.25},children:[a.jsx("span",{className:"mt-1.5 w-2 h-2 rounded-full bg-cyan-400 shrink-0"}),a.jsx("span",{children:C})]},`${e.id}-kp-${w}-${C.slice(0,20)}`))})]}),o&&a.jsx(S.div,{className:"mt-6 pt-6 border-t border-cyan-400/30",initial:{opacity:0},animate:{opacity:1},transition:{delay:.15,duration:.3},children:o})]})})]})}),typeof document<"u"&&vo.createPortal(a.jsx(Ne,{children:u!==null&&e.images&&a.jsxs(S.div,{className:"absolute inset-0 z-12000 flex items-center justify-center bg-black",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:x,children:[a.jsx(S.button,{className:"absolute top-4 right-4 p-2 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors z-10",onClick:C=>{C.stopPropagation(),x()},initial:{scale:0},animate:{scale:1},transition:{delay:.2},children:a.jsx(F.X,{className:"w-6 h-6 text-cyan-300"})}),e.images.length>1&&a.jsxs(a.Fragment,{children:[a.jsx(S.button,{className:"absolute left-4 p-3 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors z-10",onClick:C=>{C.stopPropagation(),N()},initial:{x:-20,opacity:0},animate:{x:0,opacity:1},transition:{delay:.3},children:a.jsx(F.ChevronLeft,{className:"w-6 h-6 text-cyan-300"})}),a.jsx(S.button,{className:"absolute right-4 p-3 rounded-full bg-slate-800/80 hover:bg-slate-700/80 border border-cyan-400/30 hover:border-cyan-400/60 transition-colors z-10",onClick:C=>{C.stopPropagation(),E()},initial:{x:20,opacity:0},animate:{x:0,opacity:1},transition:{delay:.3},children:a.jsx(F.ChevronRight,{className:"w-6 h-6 text-cyan-300"})})]}),a.jsxs(S.div,{className:"relative w-screen h-screen p-6 md:p-10",initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{type:"spring",stiffness:300,damping:30},onClick:C=>C.stopPropagation(),children:[a.jsx("div",{className:"w-full h-full overflow-hidden flex items-center justify-center",children:a.jsx("img",{src:e.images[u].url||e.images[u],alt:e.images[u].alt||`Imagen ${u+1}`,className:"w-full h-full object-contain"})}),e.images[u].alt&&a.jsx(S.div,{className:"absolute bottom-0 left-0 right-0 bg-linear-to-t from-black/80 to-transparent p-6 rounded-b-lg",initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},children:a.jsx("p",{className:"text-white text-center text-lg font-medium",children:e.images[u].alt})}),e.images.length>1&&a.jsx(S.div,{className:"absolute top-4 left-1/2 -translate-x-1/2 px-4 py-2 bg-slate-800/80 rounded-full border border-cyan-400/30",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},children:a.jsxs("span",{className:"text-cyan-300 text-sm font-medium",children:[u+1," / ",e.images.length]})})]})]})}),document.body)]})}function ab(e){return e&&rs[e]||F.Layers}function lb(e,t,n,s){return{id:`tab-${n}-card-${s}`,title:e.title,description:e.subtitle,icon:ab(t),tag:e.tagName||"Info",tagColor:e.tagName?"bg-cyan-500/20 text-cyan-300 border-cyan-400/30":void 0,tagUrl:e.tagUrl,keyPoints:e.features.map(i=>i.text??i.description??"").filter(Boolean),images:e?.images?.map(i=>i.url),width:e.width}}function cb(e){return e.some(n=>n.width==="third")?"grid-cols-1 md:grid-cols-3":"grid-cols-1 md:grid-cols-2"}function pu({tab:e,tabIndex:t=0,expandedCardId:n,setExpandedCardId:s}){const i=u=>{s(n===u?null:u)},r=()=>{s(null)};if(!e?.cards||e.cards.length===0)return a.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"flex items-center justify-center py-20",children:a.jsx("div",{className:"text-slate-400 text-lg",children:"No hay contenido disponible para esta vista"})});const o=e.cards.map((u,d)=>lb(u,e.icon,t,d)),l=n?o.find(u=>u.id===n):void 0,c=`grid ${cb(e.cards)} gap-4 items-start`;return a.jsx(S.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4,ease:[.4,0,.2,1]},className:"space-y-6",children:a.jsx(Ne,{mode:"wait",initial:!1,children:l?a.jsx(S.div,{initial:{opacity:0,y:14,scale:.995},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.995,transition:{duration:.16,ease:[.4,0,1,1]}},transition:{duration:.34,ease:[.22,1,.36,1]},children:a.jsx(ao,{card:l,delay:0,isExpanded:!0,isOtherExpanded:!1,collapsedUniformHeight:!1,onToggle:()=>i(l.id),onClose:r,gridSpan:!0},l.id)},`expanded-${l.id}`):a.jsx(S.div,{className:c,initial:{opacity:0,y:10,scale:.998},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.998,transition:{duration:.14,ease:[.4,0,1,1]}},transition:{duration:.26,ease:[.22,1,.36,1]},children:o.map((u,d)=>a.jsx(ao,{card:u,delay:d,isExpanded:!1,isOtherExpanded:!1,collapsedUniformHeight:!0,onToggle:()=>i(u.id),onClose:r,gridSpan:!0},u.id))},"collapsed-grid")})})}function gu({item:e,onClose:t}){const[n,s]=b.useState(0),[i,r]=b.useState(0),[o,l]=b.useState(!1),[c,u]=b.useState(""),[d,f]=b.useState(!1),[h,m]=b.useState(""),[p,y]=b.useState(!1),[v,x]=b.useState(!1),[N,E]=b.useState(),[j,M]=b.useState(.3),[k,C]=b.useState(null),[w,I]=b.useState(null),$=b.useRef(null),[z,J]=b.useState(!1),[R,se]=b.useState(!1),K=6,te=Math.max(0,e?.items.length-K),V=e?.items[n]?.cards??[];b.useEffect(()=>{const W=document.body.style.overflow,me=document.documentElement.style.overflow;return document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",()=>{document.body.style.overflow=W,document.documentElement.style.overflow=me}},[]);const P=()=>{i>0&&r(W=>Math.max(0,W-K))},_=()=>{i<te&&r(W=>Math.min(te,W+K))},A=()=>{M(W=>W===0?.3:W===.3?.6:W===.6?.9:0)},T=W=>!!W?.trim(),O=W=>W.endsWith(".webm")||W.endsWith(".mp4"),ne=W=>{T(W)&&(m(W.trim()),f(!0))},ie=()=>{const W=$.current;if(!W)return;const{scrollLeft:me,scrollWidth:ve,clientWidth:Le}=W;J(me>0),se(me<ve-Le-10)},re=W=>{const me=$.current;if(!me)return;const ve=300;me.scrollBy({left:W==="left"?-ve:ve,behavior:"smooth"})},ae=e?.items[n]?.tab||[];b.useEffect(()=>{ie();const W=$.current;if(W)return W.addEventListener("scroll",ie),window.addEventListener("resize",ie),()=>{W.removeEventListener("scroll",ie),window.removeEventListener("resize",ie)}},[ae]),b.useEffect(()=>{M(.3);const W=globalThis.setTimeout(()=>{M(.9)},1e4);return()=>globalThis.clearTimeout(W)},[n]);const le=W=>W&&rs[W]||F.Layers,be=W=>{if(!(W<0||W>=ae.length))return ae[W]},ce=k!=null;return a.jsxs(a.Fragment,{children:[a.jsxs(S.div,{className:"fixed inset-0 z-[10000] bg-black",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},children:[e.items[n].videoBackgroundMedia&&a.jsx(S.video,{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed inset-0 w-full h-full object-cover z-[101]",initial:{opacity:0,scale:1.1},animate:{opacity:1,scale:1},transition:{duration:.8},poster:e.items[n].backgroundMedia?.url??"",children:a.jsx("source",{src:e.items[n].videoBackgroundMedia.url,type:"video/webm"})},e.items[n].videoBackgroundMedia.documentId),a.jsx(S.div,{className:"fixed inset-0 bg-black z-[102]",initial:{opacity:0},animate:{opacity:j},transition:{duration:.5,ease:"easeInOut"}}),a.jsx("div",{className:"relative z-[105] h-full overflow-y-auto overflow-x-hidden scrollbar-hide overscroll-contain",children:a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center px-8 pb-64",children:[a.jsxs("div",{className:"relative w-full flex justify-center mb-8 mt-24 md:mt-28",children:[z&&a.jsx(S.button,{onClick:W=>{W.stopPropagation(),re("left")},className:"absolute left-4 top-1/2 -translate-y-1/2 z-20 w-10 h-10 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileHover:{scale:1.1},whileTap:{scale:.9},children:a.jsx(F.ChevronLeft,{className:"w-5 h-5"})}),a.jsxs(S.div,{ref:$,className:"flex items-center justify-center gap-3 overflow-x-auto scrollbar-hide max-w-full px-2 py-2",initial:{opacity:0,y:-30,scale:.9},animate:{opacity:1,y:0,scale:1},transition:{delay:.3,duration:.7,ease:[.22,1,.36,1]},children:[a.jsx("div",{className:"w-11 h-11 shrink-0","aria-hidden":"true"}),ae.map((W,me)=>{const ve=le(W.icon),Le=k===me;return a.jsxs(S.button,{onClick:()=>{C(me),I(null)},className:`relative px-6 py-3 rounded-full font-medium text-sm transition-all duration-300 flex items-center gap-2 shrink-0 ${Le?"bg-gradient-to-r from-cyan-500 to-blue-600 text-white border border-cyan-400":"bg-slate-800/60 text-cyan-400 border border-slate-600/50 hover:text-white hover:border-cyan-400/60"}`,whileHover:{scale:1.05},whileTap:{scale:.95},children:[a.jsx(ve,{className:"w-4 h-4"}),W.name,Le&&a.jsx(S.div,{layoutId:"activeTab",className:"absolute inset-0 bg-cyan-400/20 rounded-full -z-10",transition:{type:"spring",stiffness:300,damping:30}})]},`${W.name}-${me}`)}),a.jsx("div",{className:"w-11 h-11 shrink-0 flex items-center justify-center",children:a.jsx(S.button,{onClick:()=>{k!==null&&(C(null),I(null))},className:"relative p-3 rounded-full bg-slate-800/60 hover:bg-slate-700/80 text-cyan-300 hover:text-cyan-200 border border-slate-600/50 hover:border-cyan-400/60 transition-all duration-300 shadow-lg hover:shadow-cyan-500/30 disabled:pointer-events-none",initial:!1,animate:{opacity:ce?1:0,scale:ce?1:.75,x:ce?0:-6},transition:{type:"spring",stiffness:300,damping:25},whileHover:ce?{scale:1.1,rotate:90}:{},whileTap:ce?{scale:.9}:{},disabled:!ce,"aria-hidden":!ce,tabIndex:ce?0:-1,children:a.jsx(F.X,{className:"w-5 h-5"})})})]}),R&&a.jsx(S.button,{onClick:W=>{W.stopPropagation(),re("right")},className:"absolute right-4 top-1/2 -translate-y-1/2 z-20 w-10 h-10 bg-slate-900/80 hover:bg-slate-900/95 backdrop-blur-sm border border-cyan-400/30 hover:border-cyan-400/60 rounded-full flex items-center justify-center text-cyan-400 hover:text-cyan-300 transition-all shadow-lg",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileHover:{scale:1.1},whileTap:{scale:.9},children:a.jsx(F.ChevronRight,{className:"w-5 h-5"})})]}),a.jsxs(S.div,{layout:!0,className:"text-center max-w-6xl w-full",initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,ease:[.22,1,.36,1]},style:{willChange:"transform, opacity",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[a.jsxs(S.div,{layout:"position",initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.6,duration:1,ease:[.22,1,.36,1]},style:{backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},children:[a.jsx(S.h1,{className:"text-6xl sm:text-7xl md:text-8xl font-bold mb-6 leading-tight uppercase font-tomorrow text-cyan-300 line-clamp-2",style:{letterSpacing:"3px",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},initial:{opacity:0,y:30,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{delay:.8,duration:.6,ease:[.22,1,.36,1]},children:e.items[n].title},e.items[n].title),a.jsx(Ne,{mode:"popLayout",initial:!1,children:k===null&&a.jsx(S.p,{layout:"position",className:"text-sm sm:text-base text-white/90 uppercase tracking-tighter font-medium md:text-base text-center px-[100px] mt-[-5px] shadow-none",style:{textShadow:"0 2px 10px rgba(0, 0, 0, 0.8)",fontFamily:"system-ui, -apple-system, sans-serif",letterSpacing:"0.2em",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},initial:{opacity:0,y:12,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-8,filter:"blur(3px)"},transition:{duration:.28,ease:[.22,1,.36,1]},children:e.items[n].subtitle},`subtitle-${n}`)}),a.jsxs(S.div,{layout:"position",className:"flex items-center justify-center gap-4 mt-8",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1.3,duration:.6,ease:[.22,1,.36,1],layout:{type:"spring",stiffness:210,damping:28}},children:[T(e.items[n]?.playMedia?.url)&&a.jsx(S.button,{onClick:()=>{u(e.items[n].playMedia.url.trim()),l(!0)},className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/25 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.4+0*.1,duration:.4},children:a.jsx(F.Play,{className:"w-5 h-5"})},"play-icon"),(e.items[n]?.links?.length??0)>0&&e.items[n]?.links?.map(W=>a.jsx(Un,{item:W,onClick:()=>{O(W.url)?(u(W.url.trim()),l(!0)):ne(W.url)}})),(V?.length??0)>0&&a.jsx(S.button,{onClick:()=>y(!0),className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/25 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.6,duration:.4},children:a.jsx(F.Grid2x2,{className:"w-5 h-5"})},"cards-icon"),(e.items[n]?.ppts?.length??0)>0&&e.items[n].ppts.map((W,me)=>{const ve=W.image.map(Fe=>Fe.url),Le={icon:W.icon??"Presentation",text:W.name,transparent:!1,url:""};return a.jsx(Un,{item:Le,onClick:()=>{E(ve),x(!0)}},`ppt-${W.name}-${me}`)}),a.jsxs(S.button,{onClick:A,className:"inline-flex items-center gap-2 px-6 py-3 bg-slate-800/80 hover:bg-slate-700/80 text-slate-400 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-slate-500/25 border border-slate-400/30 hover:border-slate-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.4+1*.1,duration:.4},children:[a.jsx(F.Layers,{className:"w-5 h-5"}),a.jsxs("span",{className:"text-xs",children:[j===0&&"0%",j===.3&&"30%",j===.6&&"60%",j===.9&&"90%"]})]})]},`buttons-${n}`)]}),a.jsx(Ne,{mode:"popLayout",initial:!1,children:k!==null&&typeof k=="number"&&a.jsx(S.div,{layout:"position",className:`w-full transition-[margin] duration-300 ${w?"mt-20 md:mt-24":"mt-16"}`,style:{perspective:"2000px"},initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3,ease:[.22,1,.36,1],layout:{type:"spring",stiffness:200,damping:30}},children:a.jsx(pu,{tab:be(k),tabIndex:k,expandedCardId:w,setExpandedCardId:I})},`tab-${k}-view`)})]})]})}),a.jsxs(S.button,{onClick:()=>{t(),s(0),r(0)},className:"fixed top-8 left-1/2 -translate-x-1/2 z-[110] px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 rounded-full transition-all duration-300 border-2 border-cyan-400/50 hover:border-cyan-400/80 shadow-lg hover:shadow-cyan-500/50 font-medium flex items-center gap-2",initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-50,scale:.8},transition:{delay:.3,duration:.4,ease:[.34,1.56,.64,1]},whileHover:{scale:1.05,boxShadow:"0 0 30px rgba(34, 211, 238, 0.6)"},whileTap:{scale:.95},children:[a.jsx(F.X,{className:"w-5 h-5"}),a.jsx("span",{children:"Cerrar"})]}),e.items.length>1&&a.jsx(S.div,{className:"fixed bottom-0 left-0 right-0 z-[110] py-8",initial:{y:200,opacity:0},animate:{y:0,opacity:1},exit:{y:200,opacity:0},transition:{delay:.5,duration:.6,ease:[.34,1.56,.64,1]},children:a.jsx("div",{className:"max-w-7xl mx-auto px-6",children:a.jsxs("div",{className:"flex items-center justify-center gap-6",children:[a.jsx(S.button,{onClick:P,disabled:i===0,className:"p-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 rounded-full transition-all duration-300 border-2 border-cyan-400/30 hover:border-cyan-400/60 shadow-lg hover:shadow-cyan-500/50 disabled:opacity-30 disabled:cursor-not-allowed",whileHover:{scale:1.1,x:-3},whileTap:{scale:.9},initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:.7,duration:.4},children:a.jsx(F.ChevronLeft,{className:"w-6 h-6"})}),a.jsx("div",{className:"flex-1 max-w-7xl overflow-hidden",children:a.jsx(S.div,{className:"flex gap-4",animate:{x:`calc(-${i*(100/K)}% - ${i/K*16}px)`},transition:{type:"spring",stiffness:300,damping:30,mass:.8},children:e.items.map((W,me)=>{const ve=n===me;return a.jsxs(S.div,{onClick:()=>{s(me),C(null),I(null),y(!1),M(.3)},className:`relative flex-shrink-0 h-32 cursor-pointer rounded-xl overflow-hidden transition-all duration-300 ${ve?"shadow-2xl shadow-cyan-500/50":"shadow-lg hover:shadow-cyan-400/30"}`,style:{width:"calc(16.666% - 13.33px)"},whileHover:{scale:1.05,y:-5},whileTap:{scale:.98},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.6+me*.03,duration:.3},children:[a.jsx("img",{src:W?.thumbMedia?.url||"/placeholder.svg",alt:W.title,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/30 via-30% to-transparent"}),a.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-3",children:a.jsx("h3",{className:"text-white font-semibold text-sm text-center drop-shadow-lg",children:W.title})}),ve&&a.jsx(S.div,{className:"absolute top-2 right-2 w-8 h-8 bg-cyan-400 rounded-full flex items-center justify-center shadow-lg",initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:200,damping:15},children:a.jsx(F.Check,{className:"w-5 h-5 text-slate-900 stroke-[3]"})}),ve&&a.jsx(S.div,{className:"absolute inset-0 border-4 border-cyan-400 rounded-xl pointer-events-none",animate:{opacity:[.5,0,.5],scale:[1,1.05,1]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]},W.title)})})}),a.jsx(S.button,{onClick:_,disabled:i>=te,className:"p-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 rounded-full transition-all duration-300 border-2 border-cyan-400/30 hover:border-cyan-400/60 shadow-lg hover:shadow-cyan-500/50 disabled:opacity-30 disabled:cursor-not-allowed",whileHover:{scale:1.1,x:3},whileTap:{scale:.9},initial:{opacity:0,x:50},animate:{opacity:1,x:0},transition:{delay:.7,duration:.4},children:a.jsx(F.ChevronRight,{className:"w-6 h-6"})})]})})})]}),o&&a.jsx(mu,{source:c,onClose:()=>l(!1)}),d&&a.jsx(Ht,{src:h,onClose:()=>{f(!1),m("")}}),p&&(V?.length??0)>0&&a.jsx(vc,{cards:V,onClose:()=>y(!1)}),v&&a.jsx(ib,{images:N,onClose:()=>x(!1)})]})}function ub({showLinkModal:e,setShowLinkModal:t,modalUrl:n}){const s=()=>{t(!1)};return a.jsx(Ne,{children:e&&a.jsx(Ht,{onClose:s,src:n})})}function db({isOpen:e,onClose:t,type:n,itemName:s}){if(!e)return null;const i=n==="inner"?"Esta propuesta de valor todavía no está asociada a una familia o producto tractor":"Este desarrollo tecnológico todavía no está asociado a una familia o producto tractor";return a.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50 w-full max-w-md overflow-y-auto rounded-xl",style:{background:"rgba(13, 25, 48, 0.9)",backdropFilter:"blur(10px)",border:"1px solid rgba(59, 130, 246, 0.3)",boxShadow:"0 0 30px rgba(0, 120, 255, 0.4)",animation:"fadeIn 0.3s ease-out",fontFamily:"'Manrope', sans-serif"},children:a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h2",{className:"text-2xl font-bold text-blue-100",children:s}),a.jsx("button",{onClick:t,className:"p-2 rounded-full bg-blue-900/50 text-blue-300 hover:bg-blue-800 hover:text-blue-100 transition-all",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),a.jsx("div",{className:"grid grid-cols-1 gap-6",children:a.jsx("div",{children:a.jsx("div",{className:"p-4 rounded-lg",style:{background:"rgba(30, 64, 175, 0.3)",border:"1px solid rgba(59, 130, 246, 0.3)",boxShadow:"0 0 15px rgba(0, 120, 255, 0.2)"},children:a.jsxs("div",{className:"flex items-center mb-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-full mr-4 flex items-center justify-center",style:{background:"rgba(30, 64, 175, 0.4)",border:"2px solid rgba(59, 130, 246, 0.5)",boxShadow:"0 0 15px rgba(0, 120, 255, 0.3)"},children:a.jsx("span",{className:"text-xl font-bold text-blue-100",children:n==="inner"?"PV":"DT"})}),a.jsx("div",{className:"text-yellow-300 italic",children:i})]})})})})]})})}const fb=`
19
19
 
20
20
  * {
21
21
  font-family: 'Manrope', sans-serif;
@@ -516,4 +516,4 @@ React keys must be passed directly to JSX without using spread:
516
516
  bottom: 0;
517
517
  z-index: 999999;
518
518
  }
519
- `})]})})}const bu="app-font-size",bb="100",yb=()=>{const[e,t]=we.useSearchParams(),n=e.get("size"),s=localStorage.getItem(bu);let i=bb;return n&&!isNaN(parseInt(n))?i=n:s&&!isNaN(parseInt(s))&&(i=s),b.useEffect(()=>{document.documentElement.style.fontSize=`${i}%`,n&&localStorage.setItem(bu,n)},[i,n,e,t]),null},yu=b.createContext(void 0),xb=({children:e})=>{const[t,n]=b.useState(!1),s=()=>n(i=>!i);return a.jsx(yu.Provider,{value:{isAutoMode:t,setIsAutoMode:n,toggleAutoMode:s},children:e})},lo=()=>{const e=b.useContext(yu);if(!e)throw new Error("useShowcase debe usarse dentro de un ShowcaseProvider");return e};function co(){const[e,t]=b.useState("physical"),[n,s]=b.useState(!1),[i,r]=b.useState(!1),[o,l]=b.useState("Navantia Global"),[c,u]=b.useState("high"),[d,f]=b.useState("es"),[h,m]=b.useState(!0),p=Se().controlPanelLevels,y=["physical","hybrid","digital"],v=["high","medium","low"],{t:x,i18n:N}=jt.useTranslation(),E=we.useNavigate(),j=we.useLocation(),{sendMessage:M}=Ut(),k=Se().wsRoom,{isAutoMode:C,toggleAutoMode:w}=lo();b.useEffect(()=>{N.changeLanguage(d)},[d]),b.useEffect(()=>{if(console.log("Location en control-panel: "+j.pathname),j.pathname!=="/"){const P=p.filter(_=>_.slug.length>1).find(_=>j.pathname.startsWith(_.slug));P&&(console.log("Se va a seleccionar "+P.title),l(P.title))}},[j]),b.useEffect(()=>{M({type:"publish",room:k,payload:{type:"layer",target:e}})},[e]);const I=()=>{t(P=>{const A=(y.indexOf(P)+1)%y.length;return y[A]})},$=()=>{f(P=>P==="es"?"en":"es")},z=()=>{w()},J=()=>{switch(e){case"physical":return F.Box;case"hybrid":return F.GitMerge;case"digital":return F.Cpu;default:return F.Layers}},R=P=>{switch(P){case"low":return F.Zap;case"medium":return F.Scale;case"high":return F.Flame;default:return F.Gauge}},se=P=>{switch(P){case"Navantia Global":return F.Globe;case"Smart Catalogue":return F.BookOpen;case"Coex":return F.Network;case"Plataformas Navales":return F.Ship;case"Desarrollos tecnológicos":return F.Zap;default:return F.Layers}},K=()=>{switch(e){case"physical":return{bg:"bg-slate-700/90 hover:bg-slate-600/90",text:"text-blue-200",border:"border-slate-400/30 hover:border-slate-400/60",shadow:"shadow-lg hover:shadow-slate-500/50",badgeBg:"bg-slate-600/20",badgeText:"text-blue-200",badgeBorder:"border-slate-400/30"};case"hybrid":return{bg:"bg-teal-900/90 hover:bg-teal-800/90",text:"text-teal-300",border:"border-teal-400/30 hover:border-teal-400/60",shadow:"shadow-lg hover:shadow-teal-500/50",badgeBg:"bg-teal-500/20",badgeText:"text-teal-300",badgeBorder:"border-teal-400/30"};case"digital":return{bg:"bg-sky-900/90 hover:bg-sky-800/90",text:"text-sky-300",border:"border-sky-400/30 hover:border-sky-400/60",shadow:"shadow-lg hover:shadow-sky-500/50",badgeBg:"bg-sky-500/20",badgeText:"text-sky-300",badgeBorder:"border-sky-400/30"};default:return{bg:"bg-slate-800/90 hover:bg-slate-700/90",text:"text-cyan-300",border:"border-cyan-400/30 hover:border-cyan-400/60",shadow:"shadow-lg hover:shadow-cyan-500/50",badgeBg:"bg-cyan-500/20",badgeText:"text-cyan-300",badgeBorder:"border-cyan-400/30"}}},te=J(),V=K();return a.jsxs(a.Fragment,{children:[a.jsxs(S.div,{className:"fixed bottom-8 left-8 z-40",initial:{opacity:0,y:50},animate:{opacity:h?0:1,y:0,x:h?-400:0,pointerEvents:h?"none":"auto"},transition:{delay:h?0:.3,duration:.6,ease:[.34,1.56,.64,1]},children:[a.jsx(Ne,{children:i&&a.jsx(S.div,{className:"absolute bottom-full left-0 mb-3 w-80",initial:{opacity:0,y:20,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.9},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsxs("div",{className:"relative",children:[a.jsx(S.div,{className:"absolute inset-0 bg-gradient-to-t from-red-500/20 via-amber-500/10 to-transparent rounded-3xl blur-xl",animate:{opacity:[.5,.8,.5],scale:[1,1.05,1]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative bg-gradient-to-b from-slate-900/98 via-slate-800/95 to-slate-900/98 backdrop-blur-xl rounded-3xl border border-red-400/40 shadow-2xl overflow-hidden",children:[a.jsx("div",{className:"px-6 py-4 border-b border-red-400/20 bg-gradient-to-r from-red-500/10 to-amber-500/10",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-red-300 font-semibold text-sm tracking-wider",children:"MODO DE RENDERIZADO"}),a.jsx(S.div,{className:"w-2 h-2 rounded-full bg-red-400",animate:{boxShadow:["0 0 10px rgba(248, 113, 113, 0.5)","0 0 20px rgba(248, 113, 113, 1)","0 0 10px rgba(248, 113, 113, 0.5)"]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]})}),a.jsx("div",{className:"p-4 space-y-3",children:v.map((P,_)=>{const A=c===P,T=R(P),O=(()=>{switch(P){case"low":return{bg:A?"bg-gradient-to-r from-green-500/30 via-emerald-500/30 to-green-500/30":"bg-slate-800/60",border:A?"border-2 border-green-400":"border border-green-400/20 hover:border-green-400/50",shadow:A?"shadow-lg shadow-green-500/50":"",iconBg:A?"bg-green-500":"bg-slate-700/80 group-hover:bg-slate-700",iconText:A?"text-slate-900":"text-green-300 group-hover:text-green-200",text:A?"text-white":"text-green-200 group-hover:text-green-100",indicator:"bg-green-400",glowColor:"rgba(34, 197, 94, 0.5)"};case"medium":return{bg:A?"bg-gradient-to-r from-amber-500/30 via-yellow-500/30 to-amber-500/30":"bg-slate-800/60",border:A?"border-2 border-amber-400":"border border-amber-400/20 hover:border-amber-400/50",shadow:A?"shadow-lg shadow-amber-500/50":"",iconBg:A?"bg-amber-500":"bg-slate-700/80 group-hover:bg-slate-700",iconText:A?"text-slate-900":"text-amber-300 group-hover:text-amber-200",text:A?"text-white":"text-amber-200 group-hover:text-amber-100",indicator:"bg-amber-400",glowColor:"rgba(251, 191, 36, 0.5)"};case"high":return{bg:A?"bg-gradient-to-r from-red-500/30 via-orange-500/30 to-red-500/30":"bg-slate-800/60",border:A?"border-2 border-red-400":"border border-red-400/20 hover:border-red-400/50",shadow:A?"shadow-lg shadow-red-500/50":"",iconBg:A?"bg-red-500":"bg-slate-700/80 group-hover:bg-slate-700",iconText:A?"text-slate-900":"text-red-300 group-hover:text-red-200",text:A?"text-white":"text-red-200 group-hover:text-red-100",indicator:"bg-red-400",glowColor:"rgba(239, 68, 68, 0.5)"}}})();return a.jsx(S.button,{onClick:()=>{u(P),r(!1)},className:`w-full text-left relative group ${A?"z-10":"z-0"}`,initial:{opacity:0,x:-50,rotateY:-20},animate:{opacity:1,x:0,rotateY:0},transition:{delay:_*.08,duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.02,x:8},whileTap:{scale:.98},children:a.jsxs("div",{className:`relative rounded-2xl transition-all duration-500 ${O.bg} ${O.border} ${O.shadow} hover:bg-slate-800/80`,children:[A&&a.jsx(S.div,{className:"absolute inset-0 rounded-2xl",style:{background:`radial-gradient(circle at center, ${O.glowColor} 0%, transparent 70%)`},animate:{opacity:[.3,.6,.3]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative flex items-center gap-4 px-4 py-3",children:[a.jsxs(S.div,{className:`flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center font-bold text-lg relative ${O.iconBg} ${O.iconText}`,animate:A?{boxShadow:[`0 0 15px ${O.glowColor}`,`0 0 25px ${O.glowColor}`,`0 0 15px ${O.glowColor}`]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:[a.jsx(T,{className:"w-5 h-5"}),A&&a.jsxs(a.Fragment,{children:[a.jsx(S.div,{className:"absolute inset-0 border-2 rounded-xl opacity-50",style:{borderColor:O.glowColor},animate:{scale:[1,1.3,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}}),a.jsx(S.div,{className:"absolute inset-0 border-2 rounded-xl opacity-50",style:{borderColor:O.glowColor},animate:{scale:[1,1.5,1],opacity:[.5,0,.5]},transition:{duration:2,delay:.5,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(S.p,{className:`font-semibold text-sm transition-colors duration-300 ${O.text}`,animate:A?{textShadow:[`0 0 10px ${O.glowColor}`,`0 0 20px ${O.glowColor}`,`0 0 10px ${O.glowColor}`]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:P}),A&&a.jsx(S.div,{className:"mt-1.5 h-1 bg-slate-700/50 rounded-full overflow-hidden",initial:{width:0},animate:{width:"100%"},transition:{duration:.5,delay:.2},children:a.jsx(S.div,{className:`h-full ${O.indicator}`,initial:{x:"-100%"},animate:{x:"0%"},transition:{duration:.8,delay:.3,ease:"easeOut"}})})]}),a.jsx(S.div,{className:`flex-shrink-0 w-3 h-3 rounded-full ${A?O.indicator:"bg-slate-600 group-hover:bg-slate-500"}`,animate:A?{scale:[1,1.3,1],boxShadow:[`0 0 10px ${O.glowColor}`,`0 0 20px ${O.glowColor}`,`0 0 10px ${O.glowColor}`]}:{},transition:{duration:1.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]}),a.jsx(S.div,{className:"absolute inset-0 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`radial-gradient(circle at center, ${O.glowColor} 0%, transparent 70%)`}})]})},P)})}),a.jsx(S.div,{className:"px-6 py-3 border-t border-red-400/20 bg-gradient-to-r from-slate-900/50 to-slate-800/50",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:a.jsxs("p",{className:"text-xs text-red-300/80 text-center",children:[v.length," modos disponibles"]})})]})]})})}),a.jsx(Ne,{children:n&&a.jsx(S.div,{className:"absolute bottom-full left-0 mb-3 w-80",initial:{opacity:0,y:20,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.9},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsxs("div",{className:"relative",children:[a.jsx(S.div,{className:"absolute inset-0 bg-gradient-to-t from-cyan-500/20 via-teal-500/10 to-transparent rounded-3xl blur-xl",animate:{opacity:[.5,.8,.5],scale:[1,1.05,1]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative bg-gradient-to-b from-slate-900/98 via-slate-800/95 to-slate-900/98 backdrop-blur-xl rounded-3xl border border-cyan-400/40 shadow-2xl overflow-hidden",children:[a.jsx("div",{className:"px-6 py-4 border-b border-cyan-400/20 bg-gradient-to-r from-cyan-500/10 to-teal-500/10",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-cyan-300 font-semibold text-sm tracking-wider",children:"SELECCIONAR NIVEL"}),a.jsx(S.div,{className:"w-2 h-2 rounded-full bg-cyan-400",animate:{boxShadow:["0 0 10px rgba(34, 211, 238, 0.5)","0 0 20px rgba(34, 211, 238, 1)","0 0 10px rgba(34, 211, 238, 0.5)"]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]})}),a.jsxs("div",{className:"p-4 space-y-3 relative",children:[a.jsx(S.div,{className:"absolute left-10 top-8 bottom-8 w-0.5 bg-gradient-to-b from-cyan-500/50 via-teal-500/50 to-cyan-500/50",initial:{scaleY:0},animate:{scaleY:1},transition:{duration:.8,ease:"easeOut"}}),p.map((P,_)=>{const A=o===P.title,T=se(P.title);return a.jsx(S.button,{onClick:()=>{E(P.slug),l(P.title),s(!1)},className:`w-full text-left relative group ${A?"z-10":"z-0"}`,initial:{opacity:0,x:-50,rotateY:-20},animate:{opacity:1,x:0,rotateY:0},transition:{delay:_*.08,duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.02,x:8},whileTap:{scale:.98},children:a.jsxs("div",{className:`relative rounded-2xl transition-all duration-500 ${A?"bg-gradient-to-r from-cyan-500/30 via-teal-500/30 to-cyan-500/30 border-2 border-cyan-400 shadow-lg shadow-cyan-500/50":"bg-slate-800/60 border border-cyan-400/20 hover:border-cyan-400/50 hover:bg-slate-800/80"}`,children:[A&&a.jsx(S.div,{className:"absolute inset-0 bg-gradient-to-r from-cyan-500/20 via-teal-500/20 to-cyan-500/20 rounded-2xl",animate:{opacity:[.5,.8,.5]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative flex items-center gap-4 px-4 py-3",children:[a.jsxs(S.div,{className:`flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center font-bold text-lg relative ${A?"bg-cyan-500 text-slate-900":"bg-slate-700/80 text-cyan-300 group-hover:bg-slate-700 group-hover:text-cyan-200"}`,animate:A?{boxShadow:["0 0 15px rgba(34, 211, 238, 0.5)","0 0 25px rgba(34, 211, 238, 0.8)","0 0 15px rgba(34, 211, 238, 0.5)"]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:[a.jsx(T,{className:"w-5 h-5"}),A&&a.jsxs(a.Fragment,{children:[a.jsx(S.div,{className:"absolute inset-0 border-2 border-cyan-400/50 rounded-xl",animate:{scale:[1,1.3,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}}),a.jsx(S.div,{className:"absolute inset-0 border-2 border-teal-400/50 rounded-xl",animate:{scale:[1,1.5,1],opacity:[.5,0,.5]},transition:{duration:2,delay:.5,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(S.p,{className:`font-semibold text-sm transition-colors duration-300 ${A?"text-white":"text-cyan-200 group-hover:text-cyan-100"}`,animate:A?{textShadow:["0 0 10px rgba(34, 211, 238, 0.3)","0 0 20px rgba(34, 211, 238, 0.6)","0 0 10px rgba(34, 211, 238, 0.3)"]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:P.title}),A&&a.jsx(S.div,{className:"mt-1.5 h-1 bg-slate-700/50 rounded-full overflow-hidden",initial:{width:0},animate:{width:"100%"},transition:{duration:.5,delay:.2},children:a.jsx(S.div,{className:"h-full bg-gradient-to-r from-cyan-400 to-teal-400",initial:{x:"-100%"},animate:{x:"0%"},transition:{duration:.8,delay:.3,ease:"easeOut"}})})]}),a.jsx(S.div,{className:`flex-shrink-0 w-3 h-3 rounded-full ${A?"bg-cyan-400":"bg-slate-600 group-hover:bg-cyan-500/50"}`,animate:A?{scale:[1,1.3,1],boxShadow:["0 0 10px rgba(34, 211, 238, 0.5)","0 0 20px rgba(34, 211, 238, 1)","0 0 10px rgba(34, 211, 238, 0.5)"]}:{},transition:{duration:1.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]}),a.jsx(S.div,{className:"absolute inset-0 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:"radial-gradient(circle at center, rgba(34, 211, 238, 0.1) 0%, transparent 70%)"}})]})},P.title)})]}),a.jsx(S.div,{className:"px-6 py-3 border-t border-cyan-400/20 bg-gradient-to-r from-slate-900/50 to-slate-800/50",initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},children:a.jsxs("p",{className:"text-xs text-cyan-300/80 text-center",children:[p.length," niveles disponibles"]})})]})]})})}),a.jsxs(S.button,{onClick:()=>s(!n),className:"flex items-center gap-3 px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/50 border border-cyan-400/30 hover:border-cyan-400/60 mb-3 w-60",whileHover:{scale:1.02},whileTap:{scale:.98},animate:{borderColor:n?["rgba(34, 211, 238, 0.3)","rgba(34, 211, 238, 0.6)","rgba(34, 211, 238, 0.3)"]:"rgba(34, 211, 238, 0.3)"},transition:{borderColor:{duration:2,repeat:n?Number.POSITIVE_INFINITY:0,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(F.Layers,{className:"w-5 h-5"})},n?"open":"closed")}),a.jsx("span",{children:x("control-panel.nivel")}),a.jsx(S.span,{className:"px-3 py-1 bg-cyan-500/20 text-cyan-300 rounded-full text-xs font-semibold border border-cyan-400/30 leading-3",initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:o},`level-badge-${o}`)]}),a.jsxs(S.button,{onClick:I,className:`flex items-center gap-3 px-6 py-3 ${V.bg} ${V.text} font-medium text-sm rounded-full transition-all duration-300 ${V.shadow} border ${V.border} mb-3`,whileHover:{scale:1.05},whileTap:{scale:.95,rotate:15},animate:{scale:[1,1.02,1]},transition:{scale:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(te,{className:"w-5 h-5"})},e)}),a.jsx("span",{children:"Layer Switch"}),a.jsx(S.span,{className:`px-3 py-1 ${V.badgeBg} ${V.badgeText} rounded-full text-xs font-semibold border ${V.badgeBorder}`,initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:x(`control-panel.layer.${e}`)},`badge-${e}`)]}),a.jsxs(S.button,{onClick:$,className:"flex items-center gap-3 px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/50 border border-cyan-400/30 hover:border-cyan-400/60 mb-3",whileHover:{scale:1.05},whileTap:{scale:.95,rotate:15},animate:{scale:[1,1.02,1]},transition:{scale:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(F.Languages,{className:"w-5 h-5"})},d)}),a.jsx("span",{children:x("control-panel.idioma")}),a.jsx(S.span,{className:"px-3 py-1 bg-cyan-500/20 text-cyan-300 rounded-full text-xs font-semibold border border-cyan-400/30",initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:d==="es"?"Español":"English"},`language-badge-${d}`)]}),a.jsxs(S.button,{onClick:z,className:"flex items-center gap-3 px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/50 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95,rotate:15},animate:{scale:[1,1.02,1]},transition:{scale:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(F.Presentation,{className:"w-5 h-5"})},d)}),a.jsx("span",{children:x("control-panel.showcasemode")}),a.jsx(S.span,{className:"px-3 py-1 bg-cyan-500/20 text-cyan-300 rounded-full text-xs font-semibold border border-cyan-400/30",initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:C?"ON":"OFF"},`showcase-badge-${C}`)]}),a.jsx(S.button,{onClick:()=>m(!h),className:"mt-3 p-2.5 bg-white/30 hover:bg-white/40 text-white rounded-full transition-all duration-300 backdrop-blur-md border-2 border-white/40 hover:border-white/60 z-[60] shadow-xl",animate:{x:[0,5,0]},transition:{x:{repeat:Number.POSITIVE_INFINITY,duration:1.5,ease:"easeInOut"}},whileHover:{scale:1.15},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{rotate:h?180:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsx(F.ChevronLeft,{className:"w-5 h-5"})})})]}),a.jsx(Ne,{children:h&&a.jsx(S.button,{onClick:()=>m(!1),className:"fixed bottom-8 left-8 p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all duration-300 backdrop-blur-sm border border-white/10 hover:border-white/30 z-40",initial:{opacity:0,x:-50,scale:0},animate:{opacity:.6,x:0,scale:1},exit:{opacity:0,x:-50,scale:0},transition:{duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.1,opacity:1,x:5},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{x:[0,8,0]},transition:{repeat:Number.POSITIVE_INFINITY,duration:1.5,ease:"easeInOut"},children:a.jsx(F.ChevronRight,{className:"w-6 h-6"})})})})]})}function uo(){const{isConnected:e,reconnect:t}=Ut(),s={connected:{color:"bg-emerald-500",ringColor:"ring-emerald-500/30",label:"Conectado",animate:!0},connecting:{color:"bg-amber-500",ringColor:"ring-amber-500/30",label:"Conectando...",animate:!0},disconnected:{color:"bg-red-500",ringColor:"ring-red-500/30",label:"Desconectado",animate:!1}}[e?"connected":"disconnected"],i=!e&&t;return a.jsxs("div",{className:bn("fixed z-50 flex items-center gap-2 rounded-full bg-background/80 backdrop-blur-sm px-3 py-2 shadow-lg","top-1 right-2",i&&"cursor-pointer hover:bg-accent transition-colors"),onClick:i?t:void 0,role:i?"button":void 0,"aria-label":i?"Reconectar WebSocket":`Estado: ${s.label}`,children:[a.jsxs("div",{className:"relative flex items-center justify-center",children:[a.jsx("div",{className:bn("w-2.5 h-2.5 rounded-full",s.color,s.animate&&"animate-pulse")}),s.animate&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:bn("absolute w-2.5 h-2.5 rounded-full ring-2",s.ringColor,"animate-ping")}),a.jsx("div",{className:bn("absolute w-4 h-4 rounded-full ring-1",s.ringColor)})]})]}),a.jsx("div",{className:"flex items-center gap-1",children:a.jsx("div",{className:"h-0.5 w-8 relative overflow-hidden transition-all duration-500 bg-emerald-500",children:a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-green-300 to-transparent animate-flow-right"})})}),a.jsx("div",{className:"relative flex items-center justify-center",children:a.jsx("div",{className:"w-2.5 h-2.5"})}),!1,!1]})}function fo({children:e}){const t=Ii();if(!t)return a.jsx(a.Fragment,{children:e});const{isMinimized:n}=t;return a.jsxs(a.Fragment,{children:[a.jsx(S.div,{className:"relative w-full h-full",initial:!1,animate:{scaleY:n?0:1,opacity:n?0:1},transition:{duration:.6,ease:[.4,0,.2,1]},style:{transformOrigin:"bottom"},children:e}),a.jsx(Ep,{})]})}const ho=()=>{const{isAutoMode:e}=lo(),{pathname:t}=we.useLocation(),n=we.useNavigate(),s=b.useRef(null),i=Se()?.showcasesUrl??[],r=Se().showcasesWait??12e4,o=()=>{const d=(i.indexOf(t)+1)%i.length;n(i[d])},l=()=>{s.current&&clearInterval(s.current),s.current=setInterval(o,r)},c=()=>{s.current&&(clearInterval(s.current),s.current=null)};b.useEffect(()=>(e?l():c(),()=>c()),[e]),b.useEffect(()=>{e&&l()},[t,e])};function vb({showControlPanel:e=!0,iframeSrc:t=""}){return ho(),a.jsxs("div",{className:"relative w-full h-screen overflow-hidden bg-transparent",children:[a.jsx("div",{className:"z-1 fixed inset-0",children:a.jsx("iframe",{id:"vagonFrame",allow:"microphone *; clipboard-read *; clipboard-write *; encrypted-media *; fullscreen *;",className:"z-1 w-full h-screen",src:t})}),a.jsx(fo,{children:a.jsxs("div",{className:"relative z-10 h-full bg-transparent",children:[a.jsx(we.Outlet,{}),e&&a.jsx(co,{})]})}),a.jsx(uo,{})]})}function wb({showControlPanel:e=!0}){return ho(),a.jsxs("div",{className:"relative w-full h-screen overflow-hidden bg-transparent",children:[a.jsx(fo,{children:a.jsxs("div",{className:"relative z-10 h-full bg-transparent",children:[a.jsx(we.Outlet,{}),e&&a.jsx(co,{})]})}),a.jsx(uo,{})]})}function mo({items:e,parent:t,selectedShip:n,onShipSelect:s}){const[i,r]=b.useState(0),[o,l]=b.useState(!1),[c,u]=b.useState(6),[d,f]=b.useState(!0),[h,m]=b.useState(0),[p,y]=b.useState("slide"),[v,x]=b.useState(160),{t:N}=jt.useTranslation(),{lastEvent:E,internalEvent:j,setInternalEvent:M}=vt(),k=Se().cinematics??!1,C=Se().cinematicsOnChangeLocation??!1;k&&(b.useEffect(()=>{E?.payload?.type==="cinematics"&&E?.payload?.action==="end"&&f(!0)},[E]),b.useEffect(()=>{if(j?.payload?.type==="cinematics"){const V=j?.payload?.action;V==="start"&&f(!1),V==="end"&&f(!0)}},[j]));const w=V=>{const _=(Math.ceil(R.length/c)-1)*c*v;return V>0?0:Math.abs(V)>_?-_:V},I=V=>-(V*c*v),$=V=>{const P=Math.floor(c/2),_=Math.floor(V/c),A=(V-_*c-P)*v,T=-(_*c*v+A);return w(T)},z=we.useNavigate(),J=Se().baseUrl??"",R=e;b.useEffect(()=>{const V=()=>{let P;window.innerWidth<640?(u(2),P=120):window.innerWidth<768?(u(3),P=140):window.innerWidth<1024?(u(4),P=160):(u(6),P=180),x(P)};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[]),b.useEffect(()=>{if(!n){r(0),y("center"),m($(0));return}const V=R.findIndex(_=>_.slug===n);if(V===-1){r(0),y("center"),m($(0));return}const P=Math.floor(V/c);P!==i&&r(P),y("center"),m($(V))},[n,c,v,R]),b.useEffect(()=>{if(p==="slide")m(I(i));else{const V=R.findIndex(P=>P.slug===n);V!==-1&&m($(V))}},[c,v]);const se=V=>{s(V),y("center");const P=R.findIndex(_=>_.slug===V);P!==-1&&m($(P)),z(`${t?`/${t}/`:"/"}${V}`),k&&C&&M({...Yt})},K=()=>{const V=Math.ceil(R.length/c),P=(i+1)%V;y("slide"),r(P),m(I(P))},te=()=>{const V=Math.ceil(R.length/c),P=(i-1+V)%V;y("slide"),r(P),m(I(P))};return a.jsxs(Ne,{children:[d&&a.jsxs(S.div,{className:"absolute top-0 left-0 right-0 flex flex-col items-center justify-center z-10",initial:{opacity:0,y:-50},animate:{opacity:o?0:1,y:o?-200:0,pointerEvents:o?"none":"auto"},transition:{duration:.6,ease:[.34,1.56,.64,1]},exit:{opacity:0,y:-50,scale:.8},children:[a.jsxs(S.div,{className:"relative flex items-center justify-center w-full max-w-7xl",animate:{y:0},transition:{duration:.3,ease:"easeInOut"},children:[a.jsx(S.button,{className:"absolute left-1 sm:left-2 md:left-4 z-20 w-8 h-8 sm:w-10 sm:h-10 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/40 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60",onClick:te,whileHover:{scale:1.05,x:-2},whileTap:{scale:.95},disabled:i===0,style:{opacity:i===0?.3:1,pointerEvents:i===0?"none":"auto"},children:a.jsx(F.ArrowLeft,{className:"w-3 h-3 sm:w-4 sm:h-4"})}),a.jsx("div",{className:"flex p-2 sm:p-4 mx-10 sm:mx-16 overflow-hidden",children:a.jsx(S.div,{className:"flex space-x-2 sm:space-x-4 md:space-x-8",animate:{x:h},transition:{duration:.6,ease:[.25,.46,.45,.94]},children:R.map((V,P)=>a.jsxs(S.div,{className:`flex flex-col gap-1 items-center cursor-pointer group min-w-[100px] sm:min-w-[120px] md:min-w-[144px] ${n===V.slug?"scale-110":""}`,onClick:()=>se(V.slug),whileHover:{scale:1.05,y:-4},whileTap:{scale:.98},initial:{opacity:0,y:20},animate:{opacity:1,y:0,transition:{delay:P*.1}},children:[a.jsxs("div",{className:`relative w-24 h-24 sm:w-28 sm:h-28 md:w-32 md:h-32 flex flex-col gap-1 align-bottom items-center justify-end py-2 sm:pt-4 rounded-lg transition-all duration-500 ${n===V.slug?"bg-blue-700/80 shadow-lg shadow-blue-500/30 border border-blue-400/50":"bg-zinc-500/1 hover:bg-blue-900/40 border border-transparent hover:border-blue-600/30"}`,children:[a.jsx("div",{className:"w-full h-12 sm:h-16 relative flex items-center justify-center px-4",children:a.jsx("img",{src:`${J.replace(/\/$/,"")}/images/shapes/${V.icon??V.slug}.png`,alt:V.name,width:120,height:40,className:"object-contain brightness-200 filter transition-all duration-300 group-hover:brightness-300"})}),a.jsx("div",{className:" text-center",children:a.jsx("div",{className:"text-cyan-300 text-xs sm:text-sm font-medium transition-colors duration-300 group-hover:text-cyan-200",children:N(V.name)})})]}),V.label&&a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:`text-[10px] sm:text-xs px-2 sm:px-3 py-1 rounded-md transition-all duration-300 ${n===V.slug?"bg-cyan-500/80 text-blue-900 shadow-md":"bg-blue-900/60 text-cyan-300 group-hover:bg-blue-800/70 group-hover:text-cyan-200"}`,children:V.label})})]},V.slug))})}),a.jsx(S.button,{className:"absolute right-1 sm:right-2 md:right-4 z-20 w-8 h-8 sm:w-10 sm:h-10 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/40 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60",onClick:K,whileHover:{scale:1.05,x:2},whileTap:{scale:.95},disabled:i===Math.ceil(R.length/c)-1,style:{opacity:i===Math.ceil(R.length/c)-1?.3:1,pointerEvents:i===Math.ceil(R.length/c)-1?"none":"auto"},children:a.jsx(F.ArrowLeft,{className:"w-3 h-3 sm:w-4 sm:h-4 rotate-180"})})]}),a.jsx(S.button,{onClick:()=>l(!0),className:"p-2 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all duration-300 backdrop-blur-sm border border-white/10 hover:border-white/30 z-50",initial:{opacity:0,scale:0},animate:{opacity:.6,scale:1,y:[0,5,0]},exit:{opacity:0,y:-50,scale:0},transition:{duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.1,opacity:1},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{rotate:o?180:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsx(F.ChevronUp,{className:"w-5 h-5"})})})]}),o&&a.jsx(S.button,{onClick:()=>l(!1),className:"absolute top-8 left-1/2 -translate-x-1/2 p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all duration-300 backdrop-blur-sm border border-white/10 hover:border-white/30 z-40",initial:{opacity:0,y:-50,scale:0},animate:{opacity:.6,y:0,scale:1},exit:{opacity:0,y:-50,scale:0},transition:{duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.1,opacity:1,y:5},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{y:[0,8,0]},transition:{repeat:Number.POSITIVE_INFINITY,duration:1.5,ease:"easeInOut"},children:a.jsx(F.ChevronDown,{className:"w-6 h-6"})})})]})}const Sb=({items:e,world:t,worldSlug:n=t})=>{const[s,i]=b.useState(""),r={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},o=we.useLocation(),l=we.useNavigate(),{t:c}=jt.useTranslation(),{setInternalEvent:u}=vt(),d=Se().cinematics??!1,f=Se().cinematicsOnChangeLocation??!1;b.useEffect(()=>{o.pathname===`/${n}`?i(""):o.pathname.startsWith(n?`/${n}/`:"/")&&i(o.pathname.replace(n?`/${n}/`:"/",""))},[o]),b.useEffect(()=>{const v=x=>{const N=["INPUT","TEXTAREA"].includes(x.target.tagName),E=document.querySelector(".yarl__container");N||E||(x.key==="ArrowLeft"?(x.preventDefault(),y()):x.key==="ArrowRight"&&(x.preventDefault(),p()))};return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}},[s]),b.useEffect(()=>{let v=0,x=0,N=!1;const E=k=>{const C=k.target,w=document.getElementById("ItemPage");N=C===w,N&&(v=k.changedTouches[0].screenX)},j=k=>{N&&(x=k.changedTouches[0].screenX,M())},M=()=>{const k=x-v;Math.abs(k)<50||(k>0?y():p())};return window.addEventListener("touchstart",E),window.addEventListener("touchend",j),()=>{window.removeEventListener("touchstart",E),window.removeEventListener("touchend",j)}},[s]);const h=()=>{const x=(e.findIndex(N=>N.slug===s)+1)%e.length;return e[x]},m=()=>{const x=(e.findIndex(N=>N.slug===s)-1+e.length)%e.length;return e[x]},p=()=>{const v=h();i(v.slug),l(`${n}/${v.slug}`),d&&f&&u({...Yt})},y=()=>{const v=m();i(v.slug),l(`${n}/${v.slug}`),d&&f&&u({...Yt})};return a.jsxs(S.div,{className:"relative w-full h-full",variants:r,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[a.jsx(mo,{parent:n,items:e,onShipSelect:i,selectedShip:s}),s&&a.jsxs(a.Fragment,{children:[a.jsxs(S.button,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 w-12 h-12 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/60 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60 group z-30",initial:"initial",animate:"animate",whileHover:"hover",whileTap:{scale:.95},onClick:y,children:[a.jsx(F.ArrowLeft,{className:"w-6 h-6 transition-transform duration-300 group-hover:scale-110"}),a.jsxs(S.div,{className:"absolute left-16 top-1/2 transform -translate-y-1/2 bg-slate-900/95 backdrop-blur-md rounded-lg px-3 py-2 border border-blue-400/30 shadow-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap",children:[a.jsx("span",{className:"text-blue-100 font-medium text-sm",children:c("layout.anterior")}),a.jsx("div",{className:"absolute right-full top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-4 border-b-4 border-r-4 border-transparent border-r-slate-900/95"})]}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-blue-400/30 scale-0 group-hover:scale-125 opacity-0 group-hover:opacity-100 transition-all duration-500"})]}),a.jsxs(S.button,{className:"absolute right-4 top-1/2 transform -translate-y-1/2 w-12 h-12 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/60 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60 group z-30",initial:"initial",animate:"animate",whileHover:"hover",whileTap:{scale:.95},onClick:p,children:[a.jsx(F.ArrowLeft,{className:"w-6 h-6 rotate-180 transition-transform duration-300 group-hover:scale-110"}),a.jsxs(S.div,{className:"absolute right-16 top-1/2 transform -translate-y-1/2 bg-slate-900/95 backdrop-blur-md rounded-lg px-3 py-2 border border-blue-400/30 shadow-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap",children:[a.jsx("span",{className:"text-blue-100 font-medium text-sm",children:c("layout.siguiente")}),a.jsx("div",{className:"absolute left-full top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-4 border-b-4 border-l-4 border-transparent border-l-slate-900/95"})]}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-blue-400/30 scale-0 group-hover:scale-125 opacity-0 group-hover:opacity-100 transition-all duration-500"})]})]}),a.jsx(we.Outlet,{})]})},xu=b.createContext(void 0);function Tb({children:e}){const{isMobile:t}=Li(),n=Se().videosBaseUrl,s=t?"videos/movil":"videos",[i,r]=b.useState(""),[o,l]=b.useState(!1),c=(u,d=!0)=>{const f=`${n.replace(/\/$/,"")}/${s}/${u}`;f!==i&&(d?(l(!0),setTimeout(()=>{r(f),setTimeout(()=>l(!1),300)},150)):r(f))};return a.jsx(xu.Provider,{value:{currentVideo:i,setVideo:c,isTransitioning:o},children:e})}function vu(){const e=b.useContext(xu);return e===void 0?{currentVideo:"",setVideo:()=>{},isTransitioning:!1}:e}const po=({returnUrlOnEnded:e})=>{const{currentVideo:t,isTransitioning:n}=vu(),s=we.useNavigate(),i=b.useRef(null),[r,o]=b.useState(t),l=()=>{e&&s(e)},c=u=>u.replace(/\.mp4$/i,".webp");return b.useEffect(()=>{t!==r&&(i.current&&(i.current.pause(),i.current.removeAttribute("src"),i.current.load()),o(t))},[t,r]),b.useEffect(()=>{i.current&&r&&i.current.play().catch(u=>{console.warn("Error al intentar autoPlay del video:",u)})},[r]),a.jsxs("div",{className:"absolute inset-0 w-full h-full",children:[a.jsx(Ne,{children:n&&a.jsx(S.div,{className:"absolute inset-0 bg-black z-10",initial:{opacity:0},animate:{opacity:.3},exit:{opacity:0},transition:{duration:.15}})}),a.jsx(S.video,{ref:i,autoPlay:!0,loop:!e,muted:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover",onEnded:l,initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},src:r,poster:c(r)},r)]})};function Cb({className:e}){const n=e!==void 0?e:"fixed inset-0 overflow-hidden bg-slate-900";return a.jsxs("div",{className:n,children:[a.jsx(po,{}),a.jsx("div",{className:"relative z-10 h-full",children:a.jsx(we.Outlet,{})})]})}function Nb({x:e,y:t,dest:n}){const s=we.useNavigate(),i=r=>{s(`/product/${r}`)};return a.jsxs(S.button,{className:`absolute ${e} ${t} w-8 h-8 bg-gradient-to-br from-blue-500 to-indigo-700 rounded-full shadow-2xl border-2 border-blue-300/50 backdrop-blur-sm flex items-center justify-center group overflow-hidden`,initial:"initial",animate:"animate",whileHover:"hover",whileTap:"tap",onClick:()=>i(n),children:[a.jsx("div",{className:"absolute inset-1 bg-gradient-to-br from-blue-300/30 to-transparent rounded-full"}),a.jsx("div",{className:"relative w-2.5 h-2.5 bg-white rounded-full group-hover:scale-125 transition-all duration-300 shadow-lg",children:a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-200 to-white rounded-full animate-pulse"})}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-blue-300/60 animate-ping"}),a.jsx("div",{className:"absolute inset-1 rounded-full border border-blue-400/40 animate-pulse"}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-transparent border-t-blue-300 animate-spin",style:{animationDuration:"3s"}}),a.jsxs(S.div,{className:"absolute right-12 top-1/2 transform -translate-y-1/2 bg-slate-900/95 backdrop-blur-md rounded-lg p-4 border border-blue-400/30 shadow-xl min-w-64 group-hover:opacity-100 transition-opacity duration-300",initial:{opacity:0,x:20,scale:.8},animate:{opacity:0,x:20,scale:.8},whileHover:{opacity:1,x:0,scale:1},transition:{duration:.3},style:{pointerEvents:"none"},children:[a.jsx("h3",{className:"text-blue-300 font-bold text-lg mb-1",children:"SUBMARINO S80"}),a.jsx("p",{className:"text-blue-100/80 text-sm leading-relaxed",children:"Submarino de propulsión AIP con capacidades stealth y sistemas de combate integrados de última generación."}),a.jsx("div",{className:"absolute left-full top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-8 border-b-8 border-l-8 border-transparent border-l-slate-900/95"})]})]})}function go({home:e,item:t}){const[n,s]=b.useState({width:0,height:0}),[i,r]=b.useState(!0),[o,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(""),[h,m]=b.useState(!1),[p,y]=b.useState(!1),[v,x]=b.useState(!1),[N,E]=b.useState(!1),[j,M]=b.useState(!1),[k,C]=b.useState(""),[w,I]=b.useState(!1),$=we.useNavigate(),{lastEvent:z,internalEvent:J,setInternalEvent:R}=vt(),se=Se().cinematics??!1,K=Se().cinematicsOnChangeLocation??!1;se&&(b.useEffect(()=>{z?.payload?.type==="cinematics"&&z?.payload?.action==="end"&&r(!0)},[z]),b.useEffect(()=>{if(J?.payload?.type==="cinematics"){const T=J?.payload?.action;T==="start"&&r(!1),T==="end"&&r(!0)}},[J])),b.useEffect(()=>{const T=()=>{s({width:window.innerWidth,height:window.innerHeight})};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const te=()=>{l(!0),r(!1)},V=()=>{l(!1),r(!0)},P=T=>{$(T),se&&K&&R({...Yt})},_=T=>!!T?.trim(),A=T=>T.endsWith(".webm")||T.endsWith(".mp4");return a.jsxs(Ne,{children:[i&&a.jsx(S.div,{className:"absolute bottom-4 sm:bottom-6 md:bottom-10 left-1/2 transform -translate-x-1/2 w-full max-w-[90%] sm:max-w-[85%] md:max-w-4xl px-4 sm:px-6 md:px-8 z-9999",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:.8,duration:.6},exit:{opacity:0,y:50,scale:.8,transition:{delay:0,duration:.6}},children:a.jsxs("div",{className:"flex flex-col gap-6 backdrop-blur-xs rounded-xl sm:rounded-2xl border p-3 sm:p-4 md:p-6 text-center border-transparent max-w-6xl mx-auto title-section",children:[a.jsx("h1",{className:"text-xl sm:text-3xl md:text-4xl lg:text-5xl font-light text-white mb-2 sm:mb-4 tracking-wide",children:t?.title}),a.jsx("p",{className:"text-xs sm:text-sm md:text-base text-blue-100/90 font-light leading-relaxed max-w-5xl mx-auto mb-3 sm:mb-4 md:mb-6",children:t?.subtitle}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-3 md:gap-4",children:[!1,e&&a.jsxs(a.Fragment,{children:[a.jsx(S.button,{className:"inline-flex items-center gap-1 sm:gap-2 px-3 sm:px-4 md:px-6 py-2 sm:py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-xs sm:text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-slate-500/25 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0},animate:{opacity:1},transition:{delay:0,duration:.6},onClick:()=>{P(e)},children:a.jsx(F.Home,{className:"w-3 h-3 sm:w-4 sm:h-4"})}),t?.simulation&&a.jsx(xc,{onClick:()=>m(!0)}),_(t?.playButton)&&a.jsx(Pi,{Icon:F.Video,onClick:()=>{f(t.playButton.trim()),u(!0)}}),t?.webUrl&&a.jsx(Pi,{Icon:F.ExternalLink,onClick:()=>x(!0)}),(t?.links?.length??0)>0&&t?.links?.map(T=>a.jsx(Un,{item:T,onClick:()=>{A(T.url)?(f(T.url.trim()),u(!0)):(C(T.url),M(T.transparent),E(!0)),T.transparent===!0&&se&&R({...Yt})}})),(t?.cards?.length??0)>0&&a.jsx(Wl,{onClick:()=>y(!0)}),(t?.nodesId??0)>0&&a.jsx(yc,{label:t?.shortName??t.title,onClick:te})]})]})]})}),o&&t?.nodesId&&a.jsx(gb,{isOpen:o,onClose:V,size:n,hotspot:t.nodesId}),c&&a.jsx(mu,{source:d,onClose:()=>u(!1)}),h&&a.jsx(gu,{item:t.simulation,onClose:()=>m(!1)},t?.slug),p&&a.jsx(vc,{cards:t.cards,onClose:()=>y(!1)}),v&&a.jsx(Ht,{src:t.webUrl,onClose:()=>x(!1)}),N&&a.jsx(Ht,{src:k,transparent:j,onClose:()=>{const T=j;E(!1),C(""),M(!1),T===!0&&se&&R({...gc})}}),w&&a.jsx(Pp,{onClose:()=>I(!1)})]})}const Eb=({video:e,returnUrl:t})=>{console.log(e);const n=we.useNavigate(),s={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},i=()=>{n(t)},{t:r}=jt.useTranslation();return a.jsx(a.Fragment,{children:a.jsxs("div",{className:"fixed inset-0 overflow-hidden bg-slate-900",children:[a.jsx(po,{returnUrlOnEnded:t}),a.jsx("div",{className:"relative z-10 h-full",children:a.jsx(S.div,{className:"relative w-full h-full",variants:s,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:a.jsx(S.div,{className:"absolute inset-0 bg-black/20 flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:a.jsx(S.button,{className:"absolute bottom-8 right-8 px-4 py-2 bg-slate-900/80 backdrop-blur-md rounded-lg text-white/90 text-sm border border-white/20 hover:border-white/40 hover:bg-slate-800/90 transition-all duration-300 hover:text-white",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:i,children:r("layout.skip")})})})})]})})},kb=({world:e,worldSlug:t=e,overlay:n=!1,itemsData:s})=>{const[i,r]=b.useState(null),{itemSlug:o}=we.useParams();b.useEffect(()=>{if(o){const c=s.find(u=>u.slug===o);c&&r(c)}},[o]);const l={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};return i?a.jsx(a.Fragment,{children:a.jsxs(S.div,{className:"relative w-full h-full",variants:l,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[n&&a.jsx("div",{id:"ItemPage",className:"absolute inset-0 bg-gradient-to-b from-slate-900/30 via-transparent to-slate-900/50"}),a.jsx(go,{home:`/${t}`,item:i})]})}):a.jsx("div",{className:"relative w-full h-screen overflow-hidden bg-slate-900 flex items-center justify-center",children:a.jsx("div",{className:"text-white text-2xl",children:"Producto no encontrado"})})},Pb=({world:e,worldSlug:t=e,overlay:n=!1,itemsData:s})=>{const[i,r]=b.useState(null),{itemSlug:o}=we.useParams(),l=we.useNavigate();b.useEffect(()=>{if(o){const u=s.find(d=>d.slug===o);u&&(r(u),console.log(JSON.stringify(u)))}},[o]);const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};return i?a.jsx(a.Fragment,{children:a.jsxs(S.div,{className:"relative w-full h-full",variants:c,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[n&&a.jsx("div",{id:"ItemPage",className:"absolute inset-0 bg-gradient-to-b from-slate-900/30 via-transparent to-slate-900/50"}),a.jsx(gu,{item:i.simulation,onClose:()=>l(`/${t}`)},o)]})}):a.jsx("div",{className:"relative w-full h-screen overflow-hidden bg-slate-900 flex items-center justify-center",children:a.jsx("div",{className:"text-white text-2xl",children:"Producto no encontrado"})})},jb=({items:e,world:t,overlay:n=!1,title:s})=>{const[i,r]=b.useState(""),o={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};return a.jsx(Ne,{children:a.jsxs(S.div,{className:"relative w-full h-full",variants:o,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[n&&a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-900/20 via-transparent to-slate-900/40"}),e&&a.jsx(mo,{parent:t,items:e,onShipSelect:r,selectedShip:i}),a.jsx(go,{home:"/",item:s})]})})},Ib=()=>{const e=we.useLocation(),{sendMessage:t}=Ut(),n=Se().wsRoom;return b.useEffect(()=>{console.log("RouteListener: "+e.pathname+e.hash),t({type:"publish",room:n,payload:{type:"camera",target:pc(e.pathname)}})},[e]),null};q.CardsButton=Wl,q.ControlPanel=co,q.DynamicLucideIcon=Yl,q.EventProvider=Om,q.FontSizeManager=yb,q.FullScreenPage=Eb,q.IconButton=Pi,q.InfoCard=ao,q.ItemPage=kb,q.Layout=Cb,q.LayoutIframe=vb,q.LayoutTransparent=wb,q.LayoutWorld=Sb,q.LinkItemButton=Un,q.MinimizeProvider=Am,q.MinimizeWrapper=fo,q.NodosButton=yc,q.PointButton=Nb,q.RouteListener=Ib,q.ShipNavigation=mo,q.ShowcaseProvider=xb,q.SimulacionButton=xc,q.SlidePage=Pb,q.TabView=pu,q.TitleSection=go,q.VideoBackground=po,q.VideoProvider=Tb,q.WebSocketProvider=Np,q.WebSocketStatusWidget=uo,q.WorldPage=jb,q.cinematicsEndEvent=gc,q.cinematicsStartEvent=Yt,q.cn=bn,q.codigoANombre=Tp,q.getConfig=Se,q.initLibConfig=Su,q.nombreACodigo=mc,q.toTarget=pc,q.toVideo=Cp,q.useAutoModeTimer=ho,q.useEvent=vt,q.useMinimize=Vm,q.useOptionalMinimize=Ii,q.useScreenSize=Li,q.useShowcase=lo,q.useVideo=vu,q.useWebSocket=Ut,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
519
+ `})]})})}const bu="app-font-size",bb="100",yb=()=>{const[e,t]=we.useSearchParams(),n=e.get("size"),s=localStorage.getItem(bu);let i=bb;return n&&!isNaN(parseInt(n))?i=n:s&&!isNaN(parseInt(s))&&(i=s),b.useEffect(()=>{document.documentElement.style.fontSize=`${i}%`,n&&localStorage.setItem(bu,n)},[i,n,e,t]),null},yu=b.createContext(void 0),xb=({children:e})=>{const[t,n]=b.useState(!1),s=()=>n(i=>!i);return a.jsx(yu.Provider,{value:{isAutoMode:t,setIsAutoMode:n,toggleAutoMode:s},children:e})},lo=()=>{const e=b.useContext(yu);if(!e)throw new Error("useShowcase debe usarse dentro de un ShowcaseProvider");return e};function co(){const[e,t]=b.useState("physical"),[n,s]=b.useState(!1),[i,r]=b.useState(!1),[o,l]=b.useState("Navantia Global"),[c,u]=b.useState("high"),[d,f]=b.useState("es"),[h,m]=b.useState(!0),p=Se().controlPanelLevels,y=["physical","hybrid","digital"],v=["high","medium","low"],{t:x,i18n:N}=jt.useTranslation(),E=we.useNavigate(),j=we.useLocation(),{sendMessage:M}=Ut(),k=Se().wsRoom,{isAutoMode:C,toggleAutoMode:w}=lo();b.useEffect(()=>{N.changeLanguage(d)},[d]),b.useEffect(()=>{if(console.log("Location en control-panel: "+j.pathname),j.pathname!=="/"){const P=p.filter(_=>_.slug.length>1).find(_=>j.pathname.startsWith(_.slug));P&&(console.log("Se va a seleccionar "+P.title),l(P.title))}},[j]),b.useEffect(()=>{M({type:"publish",room:k,payload:{type:"layer",target:e}})},[e]);const I=()=>{t(P=>{const A=(y.indexOf(P)+1)%y.length;return y[A]})},$=()=>{f(P=>P==="es"?"en":"es")},z=()=>{w()},J=()=>{switch(e){case"physical":return F.Box;case"hybrid":return F.GitMerge;case"digital":return F.Cpu;default:return F.Layers}},R=P=>{switch(P){case"low":return F.Zap;case"medium":return F.Scale;case"high":return F.Flame;default:return F.Gauge}},se=P=>{switch(P){case"Navantia Global":return F.Globe;case"Smart Catalogue":return F.BookOpen;case"Coex":return F.Network;case"Plataformas Navales":return F.Ship;case"Desarrollos tecnológicos":return F.Zap;default:return F.Layers}},K=()=>{switch(e){case"physical":return{bg:"bg-slate-700/90 hover:bg-slate-600/90",text:"text-blue-200",border:"border-slate-400/30 hover:border-slate-400/60",shadow:"shadow-lg hover:shadow-slate-500/50",badgeBg:"bg-slate-600/20",badgeText:"text-blue-200",badgeBorder:"border-slate-400/30"};case"hybrid":return{bg:"bg-teal-900/90 hover:bg-teal-800/90",text:"text-teal-300",border:"border-teal-400/30 hover:border-teal-400/60",shadow:"shadow-lg hover:shadow-teal-500/50",badgeBg:"bg-teal-500/20",badgeText:"text-teal-300",badgeBorder:"border-teal-400/30"};case"digital":return{bg:"bg-sky-900/90 hover:bg-sky-800/90",text:"text-sky-300",border:"border-sky-400/30 hover:border-sky-400/60",shadow:"shadow-lg hover:shadow-sky-500/50",badgeBg:"bg-sky-500/20",badgeText:"text-sky-300",badgeBorder:"border-sky-400/30"};default:return{bg:"bg-slate-800/90 hover:bg-slate-700/90",text:"text-cyan-300",border:"border-cyan-400/30 hover:border-cyan-400/60",shadow:"shadow-lg hover:shadow-cyan-500/50",badgeBg:"bg-cyan-500/20",badgeText:"text-cyan-300",badgeBorder:"border-cyan-400/30"}}},te=J(),V=K();return a.jsxs(a.Fragment,{children:[a.jsxs(S.div,{className:"fixed bottom-8 left-8 z-40",initial:{opacity:0,y:50},animate:{opacity:h?0:1,y:0,x:h?-400:0,pointerEvents:h?"none":"auto"},transition:{delay:h?0:.3,duration:.6,ease:[.34,1.56,.64,1]},children:[a.jsx(Ne,{children:i&&a.jsx(S.div,{className:"absolute bottom-full left-0 mb-3 w-80",initial:{opacity:0,y:20,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.9},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsxs("div",{className:"relative",children:[a.jsx(S.div,{className:"absolute inset-0 bg-gradient-to-t from-red-500/20 via-amber-500/10 to-transparent rounded-3xl blur-xl",animate:{opacity:[.5,.8,.5],scale:[1,1.05,1]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative bg-gradient-to-b from-slate-900/98 via-slate-800/95 to-slate-900/98 backdrop-blur-xl rounded-3xl border border-red-400/40 shadow-2xl overflow-hidden",children:[a.jsx("div",{className:"px-6 py-4 border-b border-red-400/20 bg-gradient-to-r from-red-500/10 to-amber-500/10",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-red-300 font-semibold text-sm tracking-wider",children:"MODO DE RENDERIZADO"}),a.jsx(S.div,{className:"w-2 h-2 rounded-full bg-red-400",animate:{boxShadow:["0 0 10px rgba(248, 113, 113, 0.5)","0 0 20px rgba(248, 113, 113, 1)","0 0 10px rgba(248, 113, 113, 0.5)"]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]})}),a.jsx("div",{className:"p-4 space-y-3",children:v.map((P,_)=>{const A=c===P,T=R(P),O=(()=>{switch(P){case"low":return{bg:A?"bg-gradient-to-r from-green-500/30 via-emerald-500/30 to-green-500/30":"bg-slate-800/60",border:A?"border-2 border-green-400":"border border-green-400/20 hover:border-green-400/50",shadow:A?"shadow-lg shadow-green-500/50":"",iconBg:A?"bg-green-500":"bg-slate-700/80 group-hover:bg-slate-700",iconText:A?"text-slate-900":"text-green-300 group-hover:text-green-200",text:A?"text-white":"text-green-200 group-hover:text-green-100",indicator:"bg-green-400",glowColor:"rgba(34, 197, 94, 0.5)"};case"medium":return{bg:A?"bg-gradient-to-r from-amber-500/30 via-yellow-500/30 to-amber-500/30":"bg-slate-800/60",border:A?"border-2 border-amber-400":"border border-amber-400/20 hover:border-amber-400/50",shadow:A?"shadow-lg shadow-amber-500/50":"",iconBg:A?"bg-amber-500":"bg-slate-700/80 group-hover:bg-slate-700",iconText:A?"text-slate-900":"text-amber-300 group-hover:text-amber-200",text:A?"text-white":"text-amber-200 group-hover:text-amber-100",indicator:"bg-amber-400",glowColor:"rgba(251, 191, 36, 0.5)"};case"high":return{bg:A?"bg-gradient-to-r from-red-500/30 via-orange-500/30 to-red-500/30":"bg-slate-800/60",border:A?"border-2 border-red-400":"border border-red-400/20 hover:border-red-400/50",shadow:A?"shadow-lg shadow-red-500/50":"",iconBg:A?"bg-red-500":"bg-slate-700/80 group-hover:bg-slate-700",iconText:A?"text-slate-900":"text-red-300 group-hover:text-red-200",text:A?"text-white":"text-red-200 group-hover:text-red-100",indicator:"bg-red-400",glowColor:"rgba(239, 68, 68, 0.5)"}}})();return a.jsx(S.button,{onClick:()=>{u(P),r(!1)},className:`w-full text-left relative group ${A?"z-10":"z-0"}`,initial:{opacity:0,x:-50,rotateY:-20},animate:{opacity:1,x:0,rotateY:0},transition:{delay:_*.08,duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.02,x:8},whileTap:{scale:.98},children:a.jsxs("div",{className:`relative rounded-2xl transition-all duration-500 ${O.bg} ${O.border} ${O.shadow} hover:bg-slate-800/80`,children:[A&&a.jsx(S.div,{className:"absolute inset-0 rounded-2xl",style:{background:`radial-gradient(circle at center, ${O.glowColor} 0%, transparent 70%)`},animate:{opacity:[.3,.6,.3]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative flex items-center gap-4 px-4 py-3",children:[a.jsxs(S.div,{className:`flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center font-bold text-lg relative ${O.iconBg} ${O.iconText}`,animate:A?{boxShadow:[`0 0 15px ${O.glowColor}`,`0 0 25px ${O.glowColor}`,`0 0 15px ${O.glowColor}`]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:[a.jsx(T,{className:"w-5 h-5"}),A&&a.jsxs(a.Fragment,{children:[a.jsx(S.div,{className:"absolute inset-0 border-2 rounded-xl opacity-50",style:{borderColor:O.glowColor},animate:{scale:[1,1.3,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}}),a.jsx(S.div,{className:"absolute inset-0 border-2 rounded-xl opacity-50",style:{borderColor:O.glowColor},animate:{scale:[1,1.5,1],opacity:[.5,0,.5]},transition:{duration:2,delay:.5,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(S.p,{className:`font-semibold text-sm transition-colors duration-300 ${O.text}`,animate:A?{textShadow:[`0 0 10px ${O.glowColor}`,`0 0 20px ${O.glowColor}`,`0 0 10px ${O.glowColor}`]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:P}),A&&a.jsx(S.div,{className:"mt-1.5 h-1 bg-slate-700/50 rounded-full overflow-hidden",initial:{width:0},animate:{width:"100%"},transition:{duration:.5,delay:.2},children:a.jsx(S.div,{className:`h-full ${O.indicator}`,initial:{x:"-100%"},animate:{x:"0%"},transition:{duration:.8,delay:.3,ease:"easeOut"}})})]}),a.jsx(S.div,{className:`flex-shrink-0 w-3 h-3 rounded-full ${A?O.indicator:"bg-slate-600 group-hover:bg-slate-500"}`,animate:A?{scale:[1,1.3,1],boxShadow:[`0 0 10px ${O.glowColor}`,`0 0 20px ${O.glowColor}`,`0 0 10px ${O.glowColor}`]}:{},transition:{duration:1.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]}),a.jsx(S.div,{className:"absolute inset-0 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`radial-gradient(circle at center, ${O.glowColor} 0%, transparent 70%)`}})]})},P)})}),a.jsx(S.div,{className:"px-6 py-3 border-t border-red-400/20 bg-gradient-to-r from-slate-900/50 to-slate-800/50",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:a.jsxs("p",{className:"text-xs text-red-300/80 text-center",children:[v.length," modos disponibles"]})})]})]})})}),a.jsx(Ne,{children:n&&a.jsx(S.div,{className:"absolute bottom-full left-0 mb-3 w-80",initial:{opacity:0,y:20,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.9},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsxs("div",{className:"relative",children:[a.jsx(S.div,{className:"absolute inset-0 bg-gradient-to-t from-cyan-500/20 via-teal-500/10 to-transparent rounded-3xl blur-xl",animate:{opacity:[.5,.8,.5],scale:[1,1.05,1]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative bg-gradient-to-b from-slate-900/98 via-slate-800/95 to-slate-900/98 backdrop-blur-xl rounded-3xl border border-cyan-400/40 shadow-2xl overflow-hidden",children:[a.jsx("div",{className:"px-6 py-4 border-b border-cyan-400/20 bg-gradient-to-r from-cyan-500/10 to-teal-500/10",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-cyan-300 font-semibold text-sm tracking-wider",children:"SELECCIONAR NIVEL"}),a.jsx(S.div,{className:"w-2 h-2 rounded-full bg-cyan-400",animate:{boxShadow:["0 0 10px rgba(34, 211, 238, 0.5)","0 0 20px rgba(34, 211, 238, 1)","0 0 10px rgba(34, 211, 238, 0.5)"]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]})}),a.jsxs("div",{className:"p-4 space-y-3 relative",children:[a.jsx(S.div,{className:"absolute left-10 top-8 bottom-8 w-0.5 bg-gradient-to-b from-cyan-500/50 via-teal-500/50 to-cyan-500/50",initial:{scaleY:0},animate:{scaleY:1},transition:{duration:.8,ease:"easeOut"}}),p.map((P,_)=>{const A=o===P.title,T=se(P.title);return a.jsx(S.button,{onClick:()=>{E(P.slug),l(P.title),s(!1)},className:`w-full text-left relative group ${A?"z-10":"z-0"}`,initial:{opacity:0,x:-50,rotateY:-20},animate:{opacity:1,x:0,rotateY:0},transition:{delay:_*.08,duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.02,x:8},whileTap:{scale:.98},children:a.jsxs("div",{className:`relative rounded-2xl transition-all duration-500 ${A?"bg-gradient-to-r from-cyan-500/30 via-teal-500/30 to-cyan-500/30 border-2 border-cyan-400 shadow-lg shadow-cyan-500/50":"bg-slate-800/60 border border-cyan-400/20 hover:border-cyan-400/50 hover:bg-slate-800/80"}`,children:[A&&a.jsx(S.div,{className:"absolute inset-0 bg-gradient-to-r from-cyan-500/20 via-teal-500/20 to-cyan-500/20 rounded-2xl",animate:{opacity:[.5,.8,.5]},transition:{duration:3,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}}),a.jsxs("div",{className:"relative flex items-center gap-4 px-4 py-3",children:[a.jsxs(S.div,{className:`flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center font-bold text-lg relative ${A?"bg-cyan-500 text-slate-900":"bg-slate-700/80 text-cyan-300 group-hover:bg-slate-700 group-hover:text-cyan-200"}`,animate:A?{boxShadow:["0 0 15px rgba(34, 211, 238, 0.5)","0 0 25px rgba(34, 211, 238, 0.8)","0 0 15px rgba(34, 211, 238, 0.5)"]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:[a.jsx(T,{className:"w-5 h-5"}),A&&a.jsxs(a.Fragment,{children:[a.jsx(S.div,{className:"absolute inset-0 border-2 border-cyan-400/50 rounded-xl",animate:{scale:[1,1.3,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}}),a.jsx(S.div,{className:"absolute inset-0 border-2 border-teal-400/50 rounded-xl",animate:{scale:[1,1.5,1],opacity:[.5,0,.5]},transition:{duration:2,delay:.5,repeat:Number.POSITIVE_INFINITY,ease:"easeOut"}})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(S.p,{className:`font-semibold text-sm transition-colors duration-300 ${A?"text-white":"text-cyan-200 group-hover:text-cyan-100"}`,animate:A?{textShadow:["0 0 10px rgba(34, 211, 238, 0.3)","0 0 20px rgba(34, 211, 238, 0.6)","0 0 10px rgba(34, 211, 238, 0.3)"]}:{},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:P.title}),A&&a.jsx(S.div,{className:"mt-1.5 h-1 bg-slate-700/50 rounded-full overflow-hidden",initial:{width:0},animate:{width:"100%"},transition:{duration:.5,delay:.2},children:a.jsx(S.div,{className:"h-full bg-gradient-to-r from-cyan-400 to-teal-400",initial:{x:"-100%"},animate:{x:"0%"},transition:{duration:.8,delay:.3,ease:"easeOut"}})})]}),a.jsx(S.div,{className:`flex-shrink-0 w-3 h-3 rounded-full ${A?"bg-cyan-400":"bg-slate-600 group-hover:bg-cyan-500/50"}`,animate:A?{scale:[1,1.3,1],boxShadow:["0 0 10px rgba(34, 211, 238, 0.5)","0 0 20px rgba(34, 211, 238, 1)","0 0 10px rgba(34, 211, 238, 0.5)"]}:{},transition:{duration:1.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}})]}),a.jsx(S.div,{className:"absolute inset-0 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:"radial-gradient(circle at center, rgba(34, 211, 238, 0.1) 0%, transparent 70%)"}})]})},P.title)})]}),a.jsx(S.div,{className:"px-6 py-3 border-t border-cyan-400/20 bg-gradient-to-r from-slate-900/50 to-slate-800/50",initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},children:a.jsxs("p",{className:"text-xs text-cyan-300/80 text-center",children:[p.length," niveles disponibles"]})})]})]})})}),a.jsxs(S.button,{onClick:()=>s(!n),className:"flex items-center gap-3 px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/50 border border-cyan-400/30 hover:border-cyan-400/60 mb-3 w-60",whileHover:{scale:1.02},whileTap:{scale:.98},animate:{borderColor:n?["rgba(34, 211, 238, 0.3)","rgba(34, 211, 238, 0.6)","rgba(34, 211, 238, 0.3)"]:"rgba(34, 211, 238, 0.3)"},transition:{borderColor:{duration:2,repeat:n?Number.POSITIVE_INFINITY:0,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(F.Layers,{className:"w-5 h-5"})},n?"open":"closed")}),a.jsx("span",{children:x("control-panel.nivel")}),a.jsx(S.span,{className:"px-3 py-1 bg-cyan-500/20 text-cyan-300 rounded-full text-xs font-semibold border border-cyan-400/30 leading-3",initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:o},`level-badge-${o}`)]}),a.jsxs(S.button,{onClick:I,className:`flex items-center gap-3 px-6 py-3 ${V.bg} ${V.text} font-medium text-sm rounded-full transition-all duration-300 ${V.shadow} border ${V.border} mb-3`,whileHover:{scale:1.05},whileTap:{scale:.95,rotate:15},animate:{scale:[1,1.02,1]},transition:{scale:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(te,{className:"w-5 h-5"})},e)}),a.jsx("span",{children:"Layer Switch"}),a.jsx(S.span,{className:`px-3 py-1 ${V.badgeBg} ${V.badgeText} rounded-full text-xs font-semibold border ${V.badgeBorder}`,initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:x(`control-panel.layer.${e}`)},`badge-${e}`)]}),a.jsxs(S.button,{onClick:$,className:"flex items-center gap-3 px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/50 border border-cyan-400/30 hover:border-cyan-400/60 mb-3",whileHover:{scale:1.05},whileTap:{scale:.95,rotate:15},animate:{scale:[1,1.02,1]},transition:{scale:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(F.Languages,{className:"w-5 h-5"})},d)}),a.jsx("span",{children:x("control-panel.idioma")}),a.jsx(S.span,{className:"px-3 py-1 bg-cyan-500/20 text-cyan-300 rounded-full text-xs font-semibold border border-cyan-400/30",initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:d==="es"?"Español":"English"},`language-badge-${d}`)]}),a.jsxs(S.button,{onClick:z,className:"flex items-center gap-3 px-6 py-3 bg-slate-800/90 hover:bg-slate-700/90 text-cyan-300 font-medium text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-cyan-500/50 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95,rotate:15},animate:{scale:[1,1.02,1]},transition:{scale:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"}},children:[a.jsx(Ne,{mode:"wait",children:a.jsx(S.div,{initial:{scale:0,rotate:-180,opacity:0,filter:"blur(10px)"},animate:{scale:1,rotate:0,opacity:1,filter:"blur(0px)"},exit:{scale:0,rotate:180,opacity:0,filter:"blur(10px)"},transition:{duration:.5,ease:[.34,1.56,.64,1],scale:{type:"spring",stiffness:300,damping:20}},children:a.jsx(F.Presentation,{className:"w-5 h-5"})},d)}),a.jsx("span",{children:x("control-panel.showcasemode")}),a.jsx(S.span,{className:"px-3 py-1 bg-cyan-500/20 text-cyan-300 rounded-full text-xs font-semibold border border-cyan-400/30",initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:C?"ON":"OFF"},`showcase-badge-${C}`)]}),a.jsx(S.button,{onClick:()=>m(!h),className:"mt-3 p-2.5 bg-white/30 hover:bg-white/40 text-white rounded-full transition-all duration-300 backdrop-blur-md border-2 border-white/40 hover:border-white/60 z-[60] shadow-xl",animate:{x:[0,5,0]},transition:{x:{repeat:Number.POSITIVE_INFINITY,duration:1.5,ease:"easeInOut"}},whileHover:{scale:1.15},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{rotate:h?180:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsx(F.ChevronLeft,{className:"w-5 h-5"})})})]}),a.jsx(Ne,{children:h&&a.jsx(S.button,{onClick:()=>m(!1),className:"fixed bottom-8 left-8 p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all duration-300 backdrop-blur-sm border border-white/10 hover:border-white/30 z-40",initial:{opacity:0,x:-50,scale:0},animate:{opacity:.6,x:0,scale:1},exit:{opacity:0,x:-50,scale:0},transition:{duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.1,opacity:1,x:5},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{x:[0,8,0]},transition:{repeat:Number.POSITIVE_INFINITY,duration:1.5,ease:"easeInOut"},children:a.jsx(F.ChevronRight,{className:"w-6 h-6"})})})})]})}function uo(){const{isConnected:e,reconnect:t}=Ut(),s={connected:{color:"bg-emerald-500",ringColor:"ring-emerald-500/30",label:"Conectado",animate:!0},connecting:{color:"bg-amber-500",ringColor:"ring-amber-500/30",label:"Conectando...",animate:!0},disconnected:{color:"bg-red-500",ringColor:"ring-red-500/30",label:"Desconectado",animate:!1}}[e?"connected":"disconnected"],i=!e&&t;return a.jsxs("div",{className:bn("fixed z-50 flex items-center gap-2 rounded-full bg-background/80 backdrop-blur-sm px-3 py-2 shadow-lg","top-1 right-2",i&&"cursor-pointer hover:bg-accent transition-colors"),onClick:i?t:void 0,role:i?"button":void 0,"aria-label":i?"Reconectar WebSocket":`Estado: ${s.label}`,children:[a.jsxs("div",{className:"relative flex items-center justify-center",children:[a.jsx("div",{className:bn("w-2.5 h-2.5 rounded-full",s.color,s.animate&&"animate-pulse")}),s.animate&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:bn("absolute w-2.5 h-2.5 rounded-full ring-2",s.ringColor,"animate-ping")}),a.jsx("div",{className:bn("absolute w-4 h-4 rounded-full ring-1",s.ringColor)})]})]}),a.jsx("div",{className:"flex items-center gap-1",children:a.jsx("div",{className:"h-0.5 w-8 relative overflow-hidden transition-all duration-500 bg-emerald-500",children:a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-green-300 to-transparent animate-flow-right"})})}),a.jsx("div",{className:"relative flex items-center justify-center",children:a.jsx("div",{className:"w-2.5 h-2.5"})}),!1,!1]})}function fo({children:e}){const t=Ii();if(!t)return a.jsx(a.Fragment,{children:e});const{isMinimized:n}=t;return a.jsxs(a.Fragment,{children:[a.jsx(S.div,{className:"relative w-full h-full",initial:!1,animate:{scaleY:n?0:1,opacity:n?0:1},transition:{duration:.6,ease:[.4,0,.2,1]},style:{transformOrigin:"bottom"},children:e}),a.jsx(Ep,{})]})}const ho=()=>{const{isAutoMode:e}=lo(),{pathname:t}=we.useLocation(),n=we.useNavigate(),s=b.useRef(null),i=Se()?.showcasesUrl??[],r=Se().showcasesWait??12e4,o=()=>{const d=(i.indexOf(t)+1)%i.length;n(i[d])},l=()=>{s.current&&clearInterval(s.current),s.current=setInterval(o,r)},c=()=>{s.current&&(clearInterval(s.current),s.current=null)};b.useEffect(()=>(e?l():c(),()=>c()),[e]),b.useEffect(()=>{e&&l()},[t,e])};function vb({showControlPanel:e=!0,iframeSrc:t=""}){return ho(),a.jsxs("div",{className:"relative w-full h-screen overflow-hidden bg-transparent",children:[a.jsx("div",{className:"z-1 fixed inset-0",children:a.jsx("iframe",{id:"vagonFrame",allow:"microphone *; clipboard-read *; clipboard-write *; encrypted-media *; fullscreen *;",className:"z-1 w-full h-screen",src:t})}),a.jsx(fo,{children:a.jsxs("div",{className:"relative z-10 h-full bg-transparent",children:[a.jsx(we.Outlet,{}),e&&a.jsx(co,{})]})}),a.jsx(uo,{})]})}function wb({showControlPanel:e=!0}){return ho(),a.jsxs("div",{className:"relative w-full h-screen overflow-hidden bg-transparent",children:[a.jsx(fo,{children:a.jsxs("div",{className:"relative z-10 h-full bg-transparent",children:[a.jsx(we.Outlet,{}),e&&a.jsx(co,{})]})}),a.jsx(uo,{})]})}function mo({items:e,parent:t,selectedShip:n,onShipSelect:s}){const[i,r]=b.useState(0),[o,l]=b.useState(!1),[c,u]=b.useState(6),[d,f]=b.useState(!0),[h,m]=b.useState(0),[p,y]=b.useState("slide"),[v,x]=b.useState(160),{t:N}=jt.useTranslation(),{lastEvent:E,internalEvent:j,setInternalEvent:M}=vt(),k=Se().cinematics??!1,C=Se().cinematicsOnChangeLocation??!1;k&&(b.useEffect(()=>{E?.payload?.type==="cinematics"&&E?.payload?.action==="end"&&f(!0)},[E]),b.useEffect(()=>{if(j?.payload?.type==="cinematics"){const V=j?.payload?.action;V==="start"&&f(!1),V==="end"&&f(!0)}},[j]));const w=V=>{const _=(Math.ceil(R.length/c)-1)*c*v;return V>0?0:Math.abs(V)>_?-_:V},I=V=>-(V*c*v),$=V=>{const P=Math.floor(c/2),_=Math.floor(V/c),A=(V-_*c-P)*v,T=-(_*c*v+A);return w(T)},z=we.useNavigate(),J=Se().baseUrl??"",R=e;b.useEffect(()=>{const V=()=>{let P;window.innerWidth<640?(u(2),P=120):window.innerWidth<768?(u(3),P=140):window.innerWidth<1024?(u(4),P=160):(u(6),P=180),x(P)};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[]),b.useEffect(()=>{if(!n){r(0),y("center"),m($(0));return}const V=R.findIndex(_=>_.slug===n);if(V===-1){r(0),y("center"),m($(0));return}const P=Math.floor(V/c);P!==i&&r(P),y("center"),m($(V))},[n,c,v,R]),b.useEffect(()=>{if(p==="slide")m(I(i));else{const V=R.findIndex(P=>P.slug===n);V!==-1&&m($(V))}},[c,v]);const se=V=>{s(V),y("center");const P=R.findIndex(_=>_.slug===V);P!==-1&&m($(P)),z(`${t?`/${t}/`:"/"}${V}`),k&&C&&M({...Yt})},K=()=>{const V=Math.ceil(R.length/c),P=(i+1)%V;y("slide"),r(P),m(I(P))},te=()=>{const V=Math.ceil(R.length/c),P=(i-1+V)%V;y("slide"),r(P),m(I(P))};return a.jsxs(Ne,{children:[d&&a.jsxs(S.div,{className:"absolute top-0 left-0 right-0 flex flex-col items-center justify-center z-10",initial:{opacity:0,y:-50},animate:{opacity:o?0:1,y:o?-200:0,pointerEvents:o?"none":"auto"},transition:{duration:.6,ease:[.34,1.56,.64,1]},exit:{opacity:0,y:-50,scale:.8},children:[a.jsxs(S.div,{className:"relative flex items-center justify-center w-full max-w-7xl",animate:{y:0},transition:{duration:.3,ease:"easeInOut"},children:[a.jsx(S.button,{className:"absolute left-1 sm:left-2 md:left-4 z-20 w-8 h-8 sm:w-10 sm:h-10 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/40 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60",onClick:te,whileHover:{scale:1.05,x:-2},whileTap:{scale:.95},disabled:i===0,style:{opacity:i===0?.3:1,pointerEvents:i===0?"none":"auto"},children:a.jsx(F.ArrowLeft,{className:"w-3 h-3 sm:w-4 sm:h-4"})}),a.jsx("div",{className:"flex p-2 sm:p-4 mx-10 sm:mx-16 overflow-hidden",children:a.jsx(S.div,{className:"flex space-x-2 sm:space-x-4 md:space-x-8",animate:{x:h},transition:{duration:.6,ease:[.25,.46,.45,.94]},children:R.map((V,P)=>a.jsxs(S.div,{className:`flex flex-col gap-1 items-center cursor-pointer group min-w-[100px] sm:min-w-[120px] md:min-w-[144px] ${n===V.slug?"scale-110":""}`,onClick:()=>se(V.slug),whileHover:{scale:1.05,y:-4},whileTap:{scale:.98},initial:{opacity:0,y:20},animate:{opacity:1,y:0,transition:{delay:P*.1}},children:[a.jsxs("div",{className:`relative w-24 h-24 sm:w-28 sm:h-28 md:w-32 md:h-32 flex flex-col gap-1 align-bottom items-center justify-end py-2 sm:pt-4 rounded-lg transition-all duration-500 ${n===V.slug?"bg-blue-700/80 shadow-lg shadow-blue-500/30 border border-blue-400/50":"bg-zinc-500/1 hover:bg-blue-900/40 border border-transparent hover:border-blue-600/30"}`,children:[a.jsx("div",{className:"w-full h-12 sm:h-16 relative flex items-center justify-center px-4",children:a.jsx("img",{src:`${J.replace(/\/$/,"")}/images/shapes/${V.icon??V.slug}.png`,alt:V.name,width:120,height:40,className:"object-contain brightness-200 filter transition-all duration-300 group-hover:brightness-300"})}),a.jsx("div",{className:" text-center",children:a.jsx("div",{className:"text-cyan-300 text-xs sm:text-sm font-medium transition-colors duration-300 group-hover:text-cyan-200",children:N(V.name)})})]}),V.label&&a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:`text-[10px] sm:text-xs px-2 sm:px-3 py-1 rounded-md transition-all duration-300 ${n===V.slug?"bg-cyan-500/80 text-blue-900 shadow-md":"bg-blue-900/60 text-cyan-300 group-hover:bg-blue-800/70 group-hover:text-cyan-200"}`,children:V.label})})]},V.slug))})}),a.jsx(S.button,{className:"absolute right-1 sm:right-2 md:right-4 z-20 w-8 h-8 sm:w-10 sm:h-10 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/40 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60",onClick:K,whileHover:{scale:1.05,x:2},whileTap:{scale:.95},disabled:i===Math.ceil(R.length/c)-1,style:{opacity:i===Math.ceil(R.length/c)-1?.3:1,pointerEvents:i===Math.ceil(R.length/c)-1?"none":"auto"},children:a.jsx(F.ArrowLeft,{className:"w-3 h-3 sm:w-4 sm:h-4 rotate-180"})})]}),a.jsx(S.button,{onClick:()=>l(!0),className:"p-2 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all duration-300 backdrop-blur-sm border border-white/10 hover:border-white/30 z-50",initial:{opacity:0,scale:0},animate:{opacity:.6,scale:1,y:[0,5,0]},exit:{opacity:0,y:-50,scale:0},transition:{duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.1,opacity:1},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{rotate:o?180:0},transition:{duration:.4,ease:[.34,1.56,.64,1]},children:a.jsx(F.ChevronUp,{className:"w-5 h-5"})})})]}),o&&a.jsx(S.button,{onClick:()=>l(!1),className:"absolute top-8 left-1/2 -translate-x-1/2 p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all duration-300 backdrop-blur-sm border border-white/10 hover:border-white/30 z-40",initial:{opacity:0,y:-50,scale:0},animate:{opacity:.6,y:0,scale:1},exit:{opacity:0,y:-50,scale:0},transition:{duration:.5,ease:[.34,1.56,.64,1]},whileHover:{scale:1.1,opacity:1,y:5},whileTap:{scale:.95},children:a.jsx(S.div,{animate:{y:[0,8,0]},transition:{repeat:Number.POSITIVE_INFINITY,duration:1.5,ease:"easeInOut"},children:a.jsx(F.ChevronDown,{className:"w-6 h-6"})})})]})}const Sb=({items:e,world:t,worldSlug:n=t})=>{const[s,i]=b.useState(""),r={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},o=we.useLocation(),l=we.useNavigate(),{t:c}=jt.useTranslation(),{setInternalEvent:u}=vt(),d=Se().cinematics??!1,f=Se().cinematicsOnChangeLocation??!1;b.useEffect(()=>{o.pathname===`/${n}`?i(""):o.pathname.startsWith(n?`/${n}/`:"/")&&i(o.pathname.replace(n?`/${n}/`:"/",""))},[o]),b.useEffect(()=>{const v=x=>{const N=["INPUT","TEXTAREA"].includes(x.target.tagName),E=document.querySelector(".yarl__container");N||E||(x.key==="ArrowLeft"?(x.preventDefault(),y()):x.key==="ArrowRight"&&(x.preventDefault(),p()))};return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}},[s]),b.useEffect(()=>{let v=0,x=0,N=!1;const E=k=>{const C=k.target,w=document.getElementById("ItemPage");N=C===w,N&&(v=k.changedTouches[0].screenX)},j=k=>{N&&(x=k.changedTouches[0].screenX,M())},M=()=>{const k=x-v;Math.abs(k)<50||(k>0?y():p())};return window.addEventListener("touchstart",E),window.addEventListener("touchend",j),()=>{window.removeEventListener("touchstart",E),window.removeEventListener("touchend",j)}},[s]);const h=()=>{const x=(e.findIndex(N=>N.slug===s)+1)%e.length;return e[x]},m=()=>{const x=(e.findIndex(N=>N.slug===s)-1+e.length)%e.length;return e[x]},p=()=>{const v=h();i(v.slug),l(`${n}/${v.slug}`),d&&f&&u({...Yt})},y=()=>{const v=m();i(v.slug),l(`${n}/${v.slug}`),d&&f&&u({...Yt})};return a.jsxs(S.div,{className:"relative w-full h-full",variants:r,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[a.jsx(mo,{parent:n,items:e,onShipSelect:i,selectedShip:s}),s&&a.jsxs(a.Fragment,{children:[a.jsxs(S.button,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 w-12 h-12 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/60 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60 group z-30",initial:"initial",animate:"animate",whileHover:"hover",whileTap:{scale:.95},onClick:y,children:[a.jsx(F.ArrowLeft,{className:"w-6 h-6 transition-transform duration-300 group-hover:scale-110"}),a.jsxs(S.div,{className:"absolute left-16 top-1/2 transform -translate-y-1/2 bg-slate-900/95 backdrop-blur-md rounded-lg px-3 py-2 border border-blue-400/30 shadow-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap",children:[a.jsx("span",{className:"text-blue-100 font-medium text-sm",children:c("layout.anterior")}),a.jsx("div",{className:"absolute right-full top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-4 border-b-4 border-r-4 border-transparent border-r-slate-900/95"})]}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-blue-400/30 scale-0 group-hover:scale-125 opacity-0 group-hover:opacity-100 transition-all duration-500"})]}),a.jsxs(S.button,{className:"absolute right-4 top-1/2 transform -translate-y-1/2 w-12 h-12 bg-slate-900/40 backdrop-blur-sm rounded-full border border-blue-400/20 hover:border-blue-400/60 flex items-center justify-center text-white/60 hover:text-white transition-all duration-300 hover:bg-slate-800/60 group z-30",initial:"initial",animate:"animate",whileHover:"hover",whileTap:{scale:.95},onClick:p,children:[a.jsx(F.ArrowLeft,{className:"w-6 h-6 rotate-180 transition-transform duration-300 group-hover:scale-110"}),a.jsxs(S.div,{className:"absolute right-16 top-1/2 transform -translate-y-1/2 bg-slate-900/95 backdrop-blur-md rounded-lg px-3 py-2 border border-blue-400/30 shadow-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap",children:[a.jsx("span",{className:"text-blue-100 font-medium text-sm",children:c("layout.siguiente")}),a.jsx("div",{className:"absolute left-full top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-4 border-b-4 border-l-4 border-transparent border-l-slate-900/95"})]}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-blue-400/30 scale-0 group-hover:scale-125 opacity-0 group-hover:opacity-100 transition-all duration-500"})]})]}),a.jsx(we.Outlet,{})]})},xu=b.createContext(void 0);function Tb({children:e}){const{isMobile:t}=Li(),n=Se().videosBaseUrl,s=t?"videos/movil":"videos",[i,r]=b.useState(""),[o,l]=b.useState(!1),c=(u,d=!0)=>{const f=`${n.replace(/\/$/,"")}/${s}/${u}`;f!==i&&(d?(l(!0),setTimeout(()=>{r(f),setTimeout(()=>l(!1),300)},150)):r(f))};return a.jsx(xu.Provider,{value:{currentVideo:i,setVideo:c,isTransitioning:o},children:e})}function vu(){const e=b.useContext(xu);return e===void 0?{currentVideo:"",setVideo:()=>{},isTransitioning:!1}:e}const po=({returnUrlOnEnded:e})=>{const{currentVideo:t,isTransitioning:n}=vu(),s=we.useNavigate(),i=b.useRef(null),[r,o]=b.useState(t),l=()=>{e&&s(e)},c=u=>u.replace(/\.mp4$/i,".webp");return b.useEffect(()=>{t!==r&&(i.current&&(i.current.pause(),i.current.removeAttribute("src"),i.current.load()),o(t))},[t,r]),b.useEffect(()=>{i.current&&r&&i.current.play().catch(u=>{console.warn("Error al intentar autoPlay del video:",u)})},[r]),a.jsxs("div",{className:"absolute inset-0 w-full h-full",children:[a.jsx(Ne,{children:n&&a.jsx(S.div,{className:"absolute inset-0 bg-black z-10",initial:{opacity:0},animate:{opacity:.3},exit:{opacity:0},transition:{duration:.15}})}),a.jsx(S.video,{ref:i,autoPlay:!0,loop:!e,muted:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover",onEnded:l,initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},src:r,poster:c(r)},r)]})};function Cb({className:e}){const n=e!==void 0?e:"fixed inset-0 overflow-hidden bg-slate-900";return a.jsxs("div",{className:n,children:[a.jsx(po,{}),a.jsx("div",{className:"relative z-10 h-full",children:a.jsx(we.Outlet,{})})]})}function Nb({x:e,y:t,dest:n}){const s=we.useNavigate(),i=r=>{s(`/product/${r}`)};return a.jsxs(S.button,{className:`absolute ${e} ${t} w-8 h-8 bg-gradient-to-br from-blue-500 to-indigo-700 rounded-full shadow-2xl border-2 border-blue-300/50 backdrop-blur-sm flex items-center justify-center group overflow-hidden`,initial:"initial",animate:"animate",whileHover:"hover",whileTap:"tap",onClick:()=>i(n),children:[a.jsx("div",{className:"absolute inset-1 bg-gradient-to-br from-blue-300/30 to-transparent rounded-full"}),a.jsx("div",{className:"relative w-2.5 h-2.5 bg-white rounded-full group-hover:scale-125 transition-all duration-300 shadow-lg",children:a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-200 to-white rounded-full animate-pulse"})}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-blue-300/60 animate-ping"}),a.jsx("div",{className:"absolute inset-1 rounded-full border border-blue-400/40 animate-pulse"}),a.jsx("div",{className:"absolute inset-0 rounded-full border border-transparent border-t-blue-300 animate-spin",style:{animationDuration:"3s"}}),a.jsxs(S.div,{className:"absolute right-12 top-1/2 transform -translate-y-1/2 bg-slate-900/95 backdrop-blur-md rounded-lg p-4 border border-blue-400/30 shadow-xl min-w-64 group-hover:opacity-100 transition-opacity duration-300",initial:{opacity:0,x:20,scale:.8},animate:{opacity:0,x:20,scale:.8},whileHover:{opacity:1,x:0,scale:1},transition:{duration:.3},style:{pointerEvents:"none"},children:[a.jsx("h3",{className:"text-blue-300 font-bold text-lg mb-1",children:"SUBMARINO S80"}),a.jsx("p",{className:"text-blue-100/80 text-sm leading-relaxed",children:"Submarino de propulsión AIP con capacidades stealth y sistemas de combate integrados de última generación."}),a.jsx("div",{className:"absolute left-full top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-8 border-b-8 border-l-8 border-transparent border-l-slate-900/95"})]})]})}function go({home:e,item:t}){const[n,s]=b.useState({width:0,height:0}),[i,r]=b.useState(!0),[o,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(""),[h,m]=b.useState(!1),[p,y]=b.useState(!1),[v,x]=b.useState(!1),[N,E]=b.useState(!1),[j,M]=b.useState(!1),[k,C]=b.useState(""),[w,I]=b.useState(!1),$=we.useNavigate(),{lastEvent:z,internalEvent:J,setInternalEvent:R}=vt(),se=Se().cinematics??!1,K=Se().cinematicsOnChangeLocation??!1;se&&(b.useEffect(()=>{z?.payload?.type==="cinematics"&&z?.payload?.action==="end"&&r(!0)},[z]),b.useEffect(()=>{if(J?.payload?.type==="cinematics"){const T=J?.payload?.action;T==="start"&&r(!1),T==="end"&&r(!0)}},[J])),b.useEffect(()=>{const T=()=>{s({width:window.innerWidth,height:window.innerHeight})};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const te=()=>{l(!0),r(!1)},V=()=>{l(!1),r(!0)},P=T=>{$(T),se&&K&&R({...Yt})},_=T=>!!T?.trim(),A=T=>T?.endsWith(".webm")||T?.endsWith(".mp4");return a.jsxs(Ne,{children:[i&&a.jsx(S.div,{className:"absolute bottom-4 sm:bottom-6 md:bottom-10 left-1/2 transform -translate-x-1/2 w-full max-w-[90%] sm:max-w-[85%] md:max-w-4xl px-4 sm:px-6 md:px-8 z-9999",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:.8,duration:.6},exit:{opacity:0,y:50,scale:.8,transition:{delay:0,duration:.6}},children:a.jsxs("div",{className:"flex flex-col gap-6 backdrop-blur-xs rounded-xl sm:rounded-2xl border p-3 sm:p-4 md:p-6 text-center border-transparent max-w-6xl mx-auto title-section",children:[a.jsx("h1",{className:"text-xl sm:text-3xl md:text-4xl lg:text-5xl font-light text-white mb-2 sm:mb-4 tracking-wide",children:t?.title}),a.jsx("p",{className:"text-xs sm:text-sm md:text-base text-blue-100/90 font-light leading-relaxed max-w-5xl mx-auto mb-3 sm:mb-4 md:mb-6",children:t?.subtitle}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-3 md:gap-4",children:[!1,e&&a.jsxs(a.Fragment,{children:[a.jsx(S.button,{className:"inline-flex items-center gap-1 sm:gap-2 px-3 sm:px-4 md:px-6 py-2 sm:py-3 bg-slate-800/80 hover:bg-slate-700/80 text-cyan-300 font-medium text-xs sm:text-sm rounded-full transition-all duration-300 shadow-lg hover:shadow-slate-500/25 border border-cyan-400/30 hover:border-cyan-400/60",whileHover:{scale:1.05},whileTap:{scale:.95},initial:{opacity:0},animate:{opacity:1},transition:{delay:0,duration:.6},onClick:()=>{P(e)},children:a.jsx(F.Home,{className:"w-3 h-3 sm:w-4 sm:h-4"})}),t?.simulation&&a.jsx(xc,{onClick:()=>m(!0)}),_(t?.playMedia?.url)&&a.jsx(Pi,{Icon:F.Video,onClick:()=>{f(t.playMedia.url),u(!0)}}),t?.webUrl&&a.jsx(Pi,{Icon:F.ExternalLink,onClick:()=>x(!0)}),(t?.links?.length??0)>0&&t?.links?.map(T=>a.jsx(Un,{item:T,onClick:()=>{A(T.url)?(f(T.url.trim()),u(!0)):(C(T.url),M(T.transparent),E(!0)),T.transparent===!0&&se&&R({...Yt})}})),(t?.cards?.length??0)>0&&a.jsx(Wl,{onClick:()=>y(!0)}),(t?.nodesId??0)>0&&a.jsx(yc,{label:t?.shortName??t.title,onClick:te})]})]})]})}),o&&t?.nodesId&&a.jsx(gb,{isOpen:o,onClose:V,size:n,hotspot:t.nodesId}),c&&a.jsx(mu,{source:d,onClose:()=>u(!1)}),h&&a.jsx(gu,{item:t.simulation,onClose:()=>m(!1)},t?.slug),p&&a.jsx(vc,{cards:t.cards,onClose:()=>y(!1)}),v&&a.jsx(Ht,{src:t.webUrl,onClose:()=>x(!1)}),N&&a.jsx(Ht,{src:k,transparent:j,onClose:()=>{const T=j;E(!1),C(""),M(!1),T===!0&&se&&R({...gc})}}),w&&a.jsx(Pp,{onClose:()=>I(!1)})]})}const Eb=({video:e,returnUrl:t})=>{console.log(e);const n=we.useNavigate(),s={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},i=()=>{n(t)},{t:r}=jt.useTranslation();return a.jsx(a.Fragment,{children:a.jsxs("div",{className:"fixed inset-0 overflow-hidden bg-slate-900",children:[a.jsx(po,{returnUrlOnEnded:t}),a.jsx("div",{className:"relative z-10 h-full",children:a.jsx(S.div,{className:"relative w-full h-full",variants:s,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:a.jsx(S.div,{className:"absolute inset-0 bg-black/20 flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:a.jsx(S.button,{className:"absolute bottom-8 right-8 px-4 py-2 bg-slate-900/80 backdrop-blur-md rounded-lg text-white/90 text-sm border border-white/20 hover:border-white/40 hover:bg-slate-800/90 transition-all duration-300 hover:text-white",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:i,children:r("layout.skip")})})})})]})})},kb=({world:e,worldSlug:t=e,overlay:n=!1,itemsData:s})=>{const[i,r]=b.useState(null),{itemSlug:o}=we.useParams();b.useEffect(()=>{if(o){const c=s.find(u=>u.slug===o);c&&r(c)}},[o]);const l={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};return i?a.jsx(a.Fragment,{children:a.jsxs(S.div,{className:"relative w-full h-full",variants:l,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[n&&a.jsx("div",{id:"ItemPage",className:"absolute inset-0 bg-gradient-to-b from-slate-900/30 via-transparent to-slate-900/50"}),a.jsx(go,{home:`/${t}`,item:i})]})}):a.jsx("div",{className:"relative w-full h-screen overflow-hidden bg-slate-900 flex items-center justify-center",children:a.jsx("div",{className:"text-white text-2xl",children:"Producto no encontrado"})})},Pb=({world:e,worldSlug:t=e,overlay:n=!1,itemsData:s})=>{const[i,r]=b.useState(null),{itemSlug:o}=we.useParams(),l=we.useNavigate();b.useEffect(()=>{if(o){const u=s.find(d=>d.slug===o);u&&(r(u),console.log(JSON.stringify(u)))}},[o]);const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};return i?a.jsx(a.Fragment,{children:a.jsxs(S.div,{className:"relative w-full h-full",variants:c,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[n&&a.jsx("div",{id:"ItemPage",className:"absolute inset-0 bg-gradient-to-b from-slate-900/30 via-transparent to-slate-900/50"}),a.jsx(gu,{item:i.simulation,onClose:()=>l(`/${t}`)},o)]})}):a.jsx("div",{className:"relative w-full h-screen overflow-hidden bg-slate-900 flex items-center justify-center",children:a.jsx("div",{className:"text-white text-2xl",children:"Producto no encontrado"})})},jb=({items:e,world:t,overlay:n=!1,title:s})=>{const[i,r]=b.useState(""),o={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};return a.jsx(Ne,{children:a.jsxs(S.div,{className:"relative w-full h-full",variants:o,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.8},children:[n&&a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-900/20 via-transparent to-slate-900/40"}),e&&a.jsx(mo,{parent:t,items:e,onShipSelect:r,selectedShip:i}),a.jsx(go,{home:"/",item:s})]})})},Ib=()=>{const e=we.useLocation(),{sendMessage:t}=Ut(),n=Se().wsRoom;return b.useEffect(()=>{console.log("RouteListener: "+e.pathname+e.hash),t({type:"publish",room:n,payload:{type:"camera",target:pc(e.pathname)}})},[e]),null};q.CardsButton=Wl,q.ControlPanel=co,q.DynamicLucideIcon=Yl,q.EventProvider=Om,q.FontSizeManager=yb,q.FullScreenPage=Eb,q.IconButton=Pi,q.InfoCard=ao,q.ItemPage=kb,q.Layout=Cb,q.LayoutIframe=vb,q.LayoutTransparent=wb,q.LayoutWorld=Sb,q.LinkItemButton=Un,q.MinimizeProvider=Am,q.MinimizeWrapper=fo,q.NodosButton=yc,q.PointButton=Nb,q.RouteListener=Ib,q.ShipNavigation=mo,q.ShowcaseProvider=xb,q.SimulacionButton=xc,q.SlidePage=Pb,q.TabView=pu,q.TitleSection=go,q.VideoBackground=po,q.VideoProvider=Tb,q.WebSocketProvider=Np,q.WebSocketStatusWidget=uo,q.WorldPage=jb,q.cinematicsEndEvent=gc,q.cinematicsStartEvent=Yt,q.cn=bn,q.codigoANombre=Tp,q.getConfig=Se,q.initLibConfig=Su,q.nombreACodigo=mc,q.toTarget=pc,q.toVideo=Cp,q.useAutoModeTimer=ho,q.useEvent=vt,q.useMinimize=Vm,q.useOptionalMinimize=Ii,q.useScreenSize=Li,q.useShowcase=lo,q.useVideo=vu,q.useWebSocket=Ut,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devstgo/stgo-salta-components-react",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "main": "./dist/stgo-salta-components-react.umd.cjs",
7
7
  "module": "./dist/stgo-salta-components-react.js",