{"version":3,"sources":["../src/types.ts","../src/shared/campaign-detail-overlay.ts","../src/LegionOpportunities.tsx","../src/community-gallery/types.ts","../src/community-gallery/LegionCommunityGallery.tsx","../src/qa/types.ts","../src/qa/LegionQA.tsx","../src/social/types.ts","../src/social/LegionSocial.tsx","../src/wallet/types.ts","../src/wallet/LegionWallet.tsx","../src/matrix/types.ts","../src/matrix/LegionMatrix.tsx","../src/profile/types.ts","../src/profile/LegionProfile.tsx","../src/profile-edit/types.ts","../src/profile-edit/LegionProfileEdit.tsx","../src/notifications/types.ts","../src/notifications/LegionNotifications.tsx","../src/saved-opportunities/types.ts","../src/saved-opportunities/LegionSavedOpportunities.tsx","../src/campaigns-carousel/types.ts","../src/campaigns-carousel/LegionCampaignsCarousel.tsx","../src/campaign-detail/types.ts","../src/campaign-detail/LegionCampaignDetail.tsx","../src/community-groups/types.ts","../src/community-groups/LegionCommunityGroups.tsx","../src/community-header/types.ts","../src/community-header/LegionCommunityHeader.tsx","../src/community-posts/types.ts","../src/community-posts/LegionCommunityPosts.tsx","../src/community-sidebar/types.ts","../src/community-sidebar/LegionCommunitySidebar.tsx","../src/pioneer-point-status/LegionPioneerPointStatus.tsx","../src/points-history/types.ts","../src/points-history/LegionPointsHistory.tsx"],"names":["_a","_b","LegionOpportunities","forwardRef","LegionCommunityGallery","useRef","useImperativeHandle","useMemo","useCallback","jsx","LegionQA","LegionSocial","LegionWallet","LegionMatrix","LegionProfile","LegionProfileEdit","LegionNotifications","LegionSavedOpportunities","LegionCampaignsCarousel","LegionCampaignDetail","useEffect","LegionCommunityGroups","LegionCommunityHeader","LegionCommunityPosts","LegionCommunitySidebar","LegionPioneerPointStatus","LegionPointsHistory"],"mappings":";;;;;;AA2HO,IAAM,qBAAA,GAGT;AAAA,EACF,aAAA,EAAe,eAAA;AAAA,EACf,WAAA,EAAa,aAAA;AAAA,EACb,WAAA,EAAa,aAAA;AAAA,EACb,aAAA,EAAe,eAAA;AAAA,EACf,cAAA,EAAgB,gBAAA;A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AA,GACF;AAEA,EAAA,uBACEC,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,KAAA,EAAO,cAAA;AAAA,MACP,aAAA,EAAY,uBAAA;AAAA,MAEZ,QAAA,kBAAAA,GAAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,GAAA,EAAK,SAAA;AAAA,UACL,GAAA;AAAA,UACA,KAAA,EAAM,uBAAA;AAAA,UACN,KAAA,EAAM,MAAA;AAAA,UACN,OAAA,EAAQ,MAAA;AAAA,UACR,KAAA,EAAO,WAAA;AAAA,UACP,MAAA,EAAQ,UAAA;AAAA,UACR,OAAA,EAAS;AAAA;AAAA;AACX;AAAA,GACF;AAEJ,CAAC","file":"index.mjs","sourcesContent":["/**\n * Theming props for the Opportunities Widget.\n * These map to the CSS custom properties used internally.\n */\nexport interface OpportunitiesThemingProps {\n  // Panel theming\n  /** Panel gradient start opacity (0-1) */\n  oppPanelStart?: string;\n  /** Panel gradient mid opacity (0-1) */\n  oppPanelMid?: string;\n  /** Panel gradient end opacity (0-1) */\n  oppPanelEnd?: string;\n  /** Panel color as RGB, e.g. \"0, 0, 0\" */\n  oppPanelColor?: string;\n  /** Panel shadow CSS value */\n  oppPanelShadow?: string;\n  /** Panel backdrop blur, e.g. \"2px\" */\n  oppPanelBlur?: string;\n  /** Panel border radius, e.g. \"10px\" */\n  oppPanelRadius?: string;\n  /** Panel padding CSS value */\n  oppPanelPadding?: string;\n  /** Panel max width CSS value */\n  oppPanelMaxWidth?: string;\n\n  // Card theming\n  /** Card border radius, e.g. \"12px\" */\n  oppCardRadius?: string;\n  /** Card shadow CSS value */\n  oppCardShadow?: string;\n  /** Card border CSS value */\n  oppCardBorder?: string;\n  /** Card minimum height, e.g. \"240px\" */\n  oppCardMinHeight?: string;\n\n  // Title typography\n  /** Title font size, e.g. \"clamp(18px, 2.6vmin, 36px)\" */\n  oppTitleSize?: string;\n  /** Title text color */\n  oppTitleColor?: string;\n  /** Title font weight */\n  oppTitleWeight?: string;\n  /** Title text shadow */\n  oppTitleShadow?: string;\n  /** Title font family */\n  oppTitleFontFamily?: string;\n  /** Title letter spacing */\n  oppTitleLetterSpacing?: string;\n\n  // Description typography\n  /** Description font size */\n  oppDescriptionSize?: string;\n  /** Description text color */\n  oppDescriptionColor?: string;\n  /** Description text shadow */\n  oppDescriptionShadow?: string;\n  /** Description font family */\n  oppDescriptionFontFamily?: string;\n  /** Description line height */\n  oppDescriptionLineHeight?: string;\n\n  // Expires typography\n  /** Expires text font size */\n  oppExpiresSize?: string;\n  /** Expires text color */\n  oppExpiresColor?: string;\n  /** Expires text shadow */\n  oppExpiresShadow?: string;\n\n  // Button theming\n  /** Button background color */\n  oppButtonBg?: string;\n  /** Button text color */\n  oppButtonColor?: string;\n  /** Button border radius */\n  oppButtonRadius?: string;\n  /** Button shadow */\n  oppButtonShadow?: string;\n\n  // Animation theming\n  /** Transition duration, e.g. \"0.3s\" */\n  oppTransitionDuration?: string;\n  /** Hover scale factor, e.g. \"1.02\" */\n  oppAnimationScale?: string;\n}\n\n/**\n * Core configuration props for the Opportunities Widget.\n */\nexport interface OpportunitiesWidgetProps extends OpportunitiesThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** Number of opportunities to display (1-20). Default: 5 */\n  count?: number;\n  /** Layout direction. Default: \"horizontal\" */\n  layout?: \"horizontal\" | \"vertical\";\n  /** Comma-separated list of tags to filter by */\n  tags?: string;\n  /** Preset theme. Default: \"light\" */\n  theme?: \"light\" | \"dark\" | \"minimal\" | \"bold\" | \"corporate\" | \"vibrant\";\n  /** Widget height: \"auto\", \"100%\", or specific value (e.g. \"400px\"). Default: \"auto\" */\n  height?: string;\n  /** Optional API key for authentication */\n  apiKey?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: {\n    widget: string;\n    count: number;\n    layout: string;\n    tags: string;\n  }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase prop names to the kebab-case query parameter names\n * used by the widget iframe URL.\n */\nexport const THEMING_PROP_TO_PARAM: Record<\n  keyof OpportunitiesThemingProps,\n  string\n> = {\n  oppPanelStart: \"oppPanelStart\",\n  oppPanelMid: \"oppPanelMid\",\n  oppPanelEnd: \"oppPanelEnd\",\n  oppPanelColor: \"oppPanelColor\",\n  oppPanelShadow: \"oppPanelShadow\",\n  oppPanelBlur: \"oppPanelBlur\",\n  oppPanelRadius: \"oppPanelRadius\",\n  oppPanelPadding: \"oppPanelPadding\",\n  oppPanelMaxWidth: \"oppPanelMaxWidth\",\n  oppCardRadius: \"oppCardRadius\",\n  oppCardShadow: \"oppCardShadow\",\n  oppCardBorder: \"oppCardBorder\",\n  oppCardMinHeight: \"oppCardMinHeight\",\n  oppTitleSize: \"oppTitleSize\",\n  oppTitleColor: \"oppTitleColor\",\n  oppTitleWeight: \"oppTitleWeight\",\n  oppTitleShadow: \"oppTitleShadow\",\n  oppTitleFontFamily: \"oppTitleFontFamily\",\n  oppTitleLetterSpacing: \"oppTitleLetterSpacing\",\n  oppDescriptionSize: \"oppDescriptionSize\",\n  oppDescriptionColor: \"oppDescriptionColor\",\n  oppDescriptionShadow: \"oppDescriptionShadow\",\n  oppDescriptionFontFamily: \"oppDescriptionFontFamily\",\n  oppDescriptionLineHeight: \"oppDescriptionLineHeight\",\n  oppExpiresSize: \"oppExpiresSize\",\n  oppExpiresColor: \"oppExpiresColor\",\n  oppExpiresShadow: \"oppExpiresShadow\",\n  oppButtonBg: \"oppButtonBg\",\n  oppButtonColor: \"oppButtonColor\",\n  oppButtonRadius: \"oppButtonRadius\",\n  oppButtonShadow: \"oppButtonShadow\",\n  oppTransitionDuration: \"oppTransitionDuration\",\n  oppAnimationScale: \"oppAnimationScale\",\n};\n\n","/**\n * Host-level Campaign Detail overlay manager.\n *\n * Bridges the gap between the embedded opportunities iframe and the host page:\n * when a card click would normally open the in-iframe modal (clipped to the\n * iframe rect), the iframe instead posts `LEGION_REQUEST_CAMPAIGN_DETAIL` and\n * this manager mounts a viewport-filling overlay on the host page that loads\n * `/widget/campaign-detail/<id>` directly. The overlay is dismissed on ESC,\n * backdrop click, or a `CAMPAIGN_DETAIL_CLOSE` message from the detail iframe.\n *\n * The manager is a singleton: only one detail overlay can be open at a time,\n * and multiple `<legion-opportunities>` hosts on the same page share it.\n */\n\nexport interface OverlayHost {\n  /** The custom element / wrapper that mounted the opportunities iframe. */\n  element: HTMLElement;\n  /** Returns the opportunities iframe currently rendered by this host. */\n  iframeAccessor: () => HTMLIFrameElement | null;\n  /** Base URL of the Legion instance serving the widgets. */\n  baseUrl: () => string;\n  /** Resolves the current auth token (attribute or auth bridge). */\n  tokenAccessor?: () => string | null;\n  /** Returns the active theme (passed through to the detail iframe URL). */\n  themeAccessor?: () => string;\n}\n\ninterface ActiveOverlay {\n  overlayEl: HTMLDivElement;\n  iframeEl: HTMLIFrameElement;\n  host: OverlayHost;\n  baseUrl: string;\n  prevOverflow: string;\n  onKey: (e: KeyboardEvent) => void;\n  id: string;\n}\n\nconst REQUEST_TYPE = \"LEGION_REQUEST_CAMPAIGN_DETAIL\";\nconst ACCEPTED_TYPE = \"LEGION_CAMPAIGN_DETAIL_ACCEPTED\";\n\nconst hosts = new Set<OverlayHost>();\nlet listenerAttached = false;\nlet active: ActiveOverlay | null = null;\n\nfunction originOf(url: string): string | null {\n  try {\n    return new URL(url).origin;\n  } catch {\n    return null;\n  }\n}\n\nfunction findHostBySource(\n  source: MessageEventSource | null\n): OverlayHost | null {\n  if (!source) return null;\n  for (const host of hosts) {\n    const iframe = host.iframeAccessor();\n    if (iframe && iframe.contentWindow === source) return host;\n  }\n  return null;\n}\n\nfunction open(host: OverlayHost, id: string): void {\n  close();\n\n  const baseUrl = host.baseUrl();\n  const theme = host.themeAccessor?.() ?? \"light\";\n\n  const overlayEl = document.createElement(\"div\");\n  overlayEl.setAttribute(\"data-legion-overlay\", \"campaign-detail\");\n  Object.assign(overlayEl.style, {\n    position: \"fixed\",\n    inset: \"0\",\n    background: \"rgba(0,0,0,0.6)\",\n    backdropFilter: \"blur(4px)\",\n    WebkitBackdropFilter: \"blur(4px)\",\n    zIndex: \"2147483000\",\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"center\",\n    padding: \"16px\",\n  } as CSSStyleDeclaration);\n\n  const container = document.createElement(\"div\");\n  Object.assign(container.style, {\n    position: \"relative\",\n    width: \"100%\",\n    maxWidth: \"640px\",\n    maxHeight: \"90vh\",\n    background: \"transparent\",\n    borderRadius: \"16px\",\n    overflow: \"hidden\",\n    boxShadow: \"0 24px 64px rgba(0,0,0,0.35)\",\n  } as CSSStyleDeclaration);\n\n  const iframeEl = document.createElement(\"iframe\");\n  const url = new URL(\n    `/widget/campaign-detail/${encodeURIComponent(id)}`,\n    baseUrl\n  );\n  url.searchParams.set(\"theme\", theme);\n  iframeEl.src = url.toString();\n  iframeEl.title = \"Campaign Detail\";\n  iframeEl.frameBorder = \"0\";\n  iframeEl.scrolling = \"auto\";\n  Object.assign(iframeEl.style, {\n    width: \"100%\",\n    height: \"90vh\",\n    border: \"none\",\n    background: \"transparent\",\n    display: \"block\",\n  } as CSSStyleDeclaration);\n\n  iframeEl.addEventListener(\"load\", () => {\n    const token = host.tokenAccessor?.() ?? null;\n    if (!iframeEl.contentWindow) return;\n    try {\n      if (token) {\n        iframeEl.contentWindow.postMessage(\n          { type: \"CONFIG\", apiKey: token, theme },\n          baseUrl\n        );\n        iframeEl.contentWindow.postMessage(\n          { type: \"AUTH_TOKEN\", token },\n          baseUrl\n        );\n      }\n    } catch {\n      // ignore postMessage failures\n    }\n  });\n\n  container.appendChild(iframeEl);\n  overlayEl.appendChild(container);\n  document.body.appendChild(overlayEl);\n\n  const prevOverflow = document.body.style.overflow;\n  document.body.style.overflow = \"hidden\";\n\n  overlayEl.addEventListener(\"click\", (e) => {\n    if (e.target === overlayEl) close();\n  });\n\n  const onKey = (e: KeyboardEvent) => {\n    if (e.key === \"Escape\") close();\n  };\n  document.addEventListener(\"keydown\", onKey);\n\n  active = {\n    overlayEl,\n    iframeEl,\n    host,\n    baseUrl,\n    prevOverflow,\n    onKey,\n    id,\n  };\n}\n\nexport function close(): void {\n  if (!active) return;\n  document.removeEventListener(\"keydown\", active.onKey);\n  if (active.overlayEl.parentNode) {\n    active.overlayEl.parentNode.removeChild(active.overlayEl);\n  }\n  document.body.style.overflow = active.prevOverflow;\n  const closed = active;\n  active = null;\n  closed.host.element.dispatchEvent(\n    new CustomEvent(\"campaign-detail-close\", {\n      detail: { id: closed.id },\n      bubbles: true,\n      composed: true,\n    })\n  );\n}\n\nfunction onMessage(event: MessageEvent): void {\n  const data = event.data;\n  if (!data || typeof data !== \"object\") return;\n\n  // Detail-overlay request from an opportunities iframe.\n  if (data.type === REQUEST_TYPE && typeof data.id === \"string\" && data.id) {\n    const host = findHostBySource(event.source);\n    if (!host) return;\n    const expected = originOf(host.baseUrl());\n    if (expected && event.origin !== expected) return;\n    open(host, data.id);\n    try {\n      (event.source as Window).postMessage(\n        { type: ACCEPTED_TYPE, id: data.id },\n        event.origin\n      );\n    } catch {\n      // ignore\n    }\n    return;\n  }\n\n  // Messages from the detail iframe living inside our overlay.\n  if (active && event.source === active.iframeEl.contentWindow) {\n    const expected = originOf(active.baseUrl);\n    if (expected && event.origin !== expected) return;\n    if (data.type === \"CAMPAIGN_DETAIL_CLOSE\") {\n      close();\n    } else if (data.type === \"CAMPAIGN_DETAIL_CLAIMED\") {\n      active.host.element.dispatchEvent(\n        new CustomEvent(\"campaign-detail-claim\", {\n          detail: { id: data.id ? String(data.id) : null },\n          bubbles: true,\n          composed: true,\n        })\n      );\n    } else if (\n      data.type === \"CAMPAIGN_DETAIL_REQUEST_LOGIN\" ||\n      data.type === \"REQUEST_LOGIN\"\n    ) {\n      active.host.element.dispatchEvent(\n        new CustomEvent(\"campaign-detail-requestlogin\", {\n          detail: { id: data.id ? String(data.id) : null },\n          bubbles: true,\n          composed: true,\n        })\n      );\n    }\n  }\n}\n\nexport function register(host: OverlayHost): () => void {\n  hosts.add(host);\n  if (!listenerAttached) {\n    window.addEventListener(\"message\", onMessage);\n    listenerAttached = true;\n  }\n  return () => {\n    hosts.delete(host);\n    if (active && active.host === host) close();\n    if (hosts.size === 0 && listenerAttached) {\n      window.removeEventListener(\"message\", onMessage);\n      listenerAttached = false;\n    }\n  };\n}\n","import React, {\n  useRef,\n  useCallback,\n  useEffect,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type OpportunitiesWidgetProps,\n  type OpportunitiesThemingProps,\n  THEMING_PROP_TO_PARAM,\n} from \"./types\";\nimport { register as registerOverlayHost } from \"./shared/campaign-detail-overlay\";\n\n/**\n * Ref handle exposed by LegionOpportunities for imperative control.\n */\nexport interface LegionOpportunitiesHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nfunction buildWidgetUrl(props: OpportunitiesWidgetProps): string {\n  const {\n    baseUrl,\n    count = 5,\n    layout = \"horizontal\",\n    tags,\n    theme = \"light\",\n  } = props;\n\n  const url = new URL(\"/widget/opportunities\", baseUrl);\n  url.searchParams.set(\"count\", String(Math.min(Math.max(count, 1), 20)));\n  url.searchParams.set(\n    \"layout\",\n    layout === \"vertical\" ? \"vertical\" : \"horizontal\"\n  );\n\n  if (tags) {\n    url.searchParams.set(\"tags\", tags);\n  }\n\n  if (theme) {\n    url.searchParams.set(\"theme\", theme);\n  }\n\n  // Append theming params\n  const themingKeys = Object.keys(THEMING_PROP_TO_PARAM) as Array<\n    keyof OpportunitiesThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionOpportunities – a React component that embeds the Legion\n * Opportunities widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionOpportunities } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionOpportunities\n *       baseUrl=\"https://your-legion-domain.com\"\n *       count={5}\n *       layout=\"horizontal\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionOpportunities = forwardRef<\n  LegionOpportunitiesHandle,\n  OpportunitiesWidgetProps\n>(function LegionOpportunities(props, ref) {\n  const {\n    baseUrl,\n    count = 5,\n    layout = \"horizontal\",\n    tags = \"\",\n    theme,\n    height = \"auto\",\n    apiKey,\n    className,\n    style,\n    onLoad,\n    onError,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  // Register this instance with the host-level campaign detail overlay so\n  // clicks inside the iframe open a viewport-filling overlay on the host\n  // page instead of a modal clipped to the iframe rect.\n  useEffect(() => {\n    if (!containerRef.current) return;\n    const detach = registerOverlayHost({\n      element: containerRef.current,\n      iframeAccessor: () => iframeRef.current,\n      baseUrl: () => baseUrl,\n      tokenAccessor: () => apiKey || null,\n      themeAccessor: () => theme || \"light\",\n    });\n    return detach;\n  }, [apiKey, baseUrl, theme]);\n\n  // Expose imperative refresh method\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildWidgetUrl(props),\n    [\n      baseUrl,\n      count,\n      layout,\n      tags,\n      theme,\n      // Include all theming props in the dep array via a stable key\n      ...Object.keys(THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    const iframe = iframeRef.current;\n\n    // Send API key to iframe if provided\n    if (iframe?.contentWindow && apiKey) {\n      iframe.contentWindow.postMessage(\n        { type: \"CONFIG\", apiKey, theme },\n        baseUrl\n      );\n    }\n\n    onLoad?.({\n      widget: \"opportunities\",\n      count: Math.min(Math.max(count, 1), 20),\n      layout: layout === \"vertical\" ? \"vertical\" : \"horizontal\",\n      tags: tags || \"\",\n    });\n  }, [apiKey, baseUrl, count, layout, tags, theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load opportunities widget\");\n  }, [onError]);\n\n  const isFullHeight = height === \"auto\" || height === \"100%\";\n  const minHeight = layout === \"vertical\" ? \"600px\" : \"320px\";\n\n  const containerStyle: React.CSSProperties = {\n    display: \"block\",\n    width: \"100%\",\n    backgroundColor: \"transparent\",\n    ...(isFullHeight ? { height: \"100%\", minHeight } : { height }),\n    ...style,\n  };\n\n  const iframeStyle: React.CSSProperties = {\n    border: \"none\",\n    borderRadius: \"8px\",\n    overflow: \"hidden\",\n    width: \"100%\",\n    ...(isFullHeight ? { height: \"100%\", minHeight } : { height }),\n  };\n\n  return (\n    <div ref={containerRef} className={className} style={containerStyle}>\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Opportunities Widget\"\n        width=\"100%\"\n        scrolling=\"no\"\n        style={iframeStyle}\n        onLoad={handleLoad}\n        onError={handleError}\n      />\n    </div>\n  );\n});\n","/**\n * Theming props for the Community Gallery Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface CommunityGalleryThemingProps {\n  /** Primary accent color, e.g. \"#228be6\" */\n  galleryPrimaryColor?: string;\n  /** Container background color */\n  galleryBackgroundColor?: string;\n  /** Primary text color */\n  galleryTextColor?: string;\n  /** Overlay gradient background */\n  galleryOverlayBg?: string;\n  /** Card border radius, e.g. \"12px\" */\n  galleryCardRadius?: string;\n  /** Card box shadow */\n  galleryCardShadow?: string;\n  /** Grid gap, e.g. \"8px\" */\n  galleryGap?: string;\n  /** Hover scale factor, e.g. \"1.03\" */\n  galleryHoverScale?: string;\n  /** Transition duration, e.g. \"0.2s\" */\n  galleryTransitionDuration?: string;\n  /** Username text size, e.g. \"12px\" */\n  galleryUsernameSize?: string;\n  /** Username text color */\n  galleryUsernameColor?: string;\n  /** Media icon size, e.g. \"20px\" */\n  galleryIconSize?: string;\n  /** Font family */\n  galleryFontFamily?: string;\n}\n\n/**\n * Core configuration props for the Community Gallery Widget.\n */\nexport interface CommunityGalleryWidgetProps\n  extends CommunityGalleryThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** Number of gallery items to display (1-12). Default: 4 */\n  count?: number;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Show \"View all in Gallery\" link. Default: true */\n  showViewAll?: boolean;\n  /** URL for the \"View all\" link. Default: \"/gallery\" */\n  viewAllUrl?: string;\n  /** URL to open when clicking on a media item */\n  communityUrl?: string;\n  /** Widget height: \"auto\" or a specific CSS value. Default: \"auto\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: {\n    widget: string;\n    count: number;\n    theme: string;\n  }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the community gallery widget iframe URL.\n */\nexport const GALLERY_THEMING_PROP_TO_PARAM: Record<\n  keyof CommunityGalleryThemingProps,\n  string\n> = {\n  galleryPrimaryColor: \"gallery-primary-color\",\n  galleryBackgroundColor: \"gallery-background-color\",\n  galleryTextColor: \"gallery-text-color\",\n  galleryOverlayBg: \"gallery-overlay-bg\",\n  galleryCardRadius: \"gallery-card-radius\",\n  galleryCardShadow: \"gallery-card-shadow\",\n  galleryGap: \"gallery-gap\",\n  galleryHoverScale: \"gallery-hover-scale\",\n  galleryTransitionDuration: \"gallery-transition-duration\",\n  galleryUsernameSize: \"gallery-username-size\",\n  galleryUsernameColor: \"gallery-username-color\",\n  galleryIconSize: \"gallery-icon-size\",\n  galleryFontFamily: \"gallery-font-family\",\n};\n\n","import React, {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CommunityGalleryWidgetProps,\n  type CommunityGalleryThemingProps,\n  GALLERY_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCommunityGallery for imperative control.\n */\nexport interface LegionCommunityGalleryHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildGalleryWidgetUrl(\n  props: CommunityGalleryWidgetProps\n): string {\n  const {\n    baseUrl,\n    count = 4,\n    theme = \"light\",\n    showViewAll = true,\n    viewAllUrl = \"/gallery\",\n    communityUrl,\n  } = props;\n\n  const url = new URL(\"/widget/community-gallery\", baseUrl);\n  url.searchParams.set(\"count\", String(Math.min(Math.max(count, 1), 12)));\n  url.searchParams.set(\"theme\", theme);\n  url.searchParams.set(\"showViewAll\", String(showViewAll));\n  url.searchParams.set(\"viewAllUrl\", viewAllUrl);\n\n  if (communityUrl) {\n    url.searchParams.set(\"communityUrl\", communityUrl);\n  }\n\n  // Append theming params\n  const themingKeys = Object.keys(GALLERY_THEMING_PROP_TO_PARAM) as Array<\n    keyof CommunityGalleryThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(GALLERY_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCommunityGallery – a React component that embeds the Legion\n * Community Gallery widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionCommunityGallery } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionCommunityGallery\n *       baseUrl=\"https://your-legion-domain.com\"\n *       count={4}\n *       theme=\"light\"\n *       communityUrl=\"/community\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionCommunityGallery = forwardRef<\n  LegionCommunityGalleryHandle,\n  CommunityGalleryWidgetProps\n>(function LegionCommunityGallery(props, ref) {\n  const {\n    count = 4,\n    theme = \"light\",\n    showViewAll,\n    viewAllUrl,\n    communityUrl,\n    height = \"auto\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildGalleryWidgetUrl(props),\n    [\n      baseUrl,\n      count,\n      theme,\n      showViewAll,\n      viewAllUrl,\n      communityUrl,\n      ...Object.keys(GALLERY_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    onLoad?.({\n      widget: \"community-gallery\",\n      count: Math.min(Math.max(count, 1), 12),\n      theme,\n    });\n  }, [count, theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load community gallery widget\");\n  }, [onError]);\n\n  const resolvedHeight = height === \"auto\" ? \"200px\" : height;\n\n  const containerStyle: React.CSSProperties = {\n    display: \"block\",\n    width: \"100%\",\n    backgroundColor: \"transparent\",\n    minHeight: \"150px\",\n    height: resolvedHeight,\n    ...style,\n  };\n\n  const iframeStyle: React.CSSProperties = {\n    border: \"none\",\n    borderRadius: \"8px\",\n    overflow: \"hidden\",\n    width: \"100%\",\n    height: resolvedHeight,\n  };\n\n  return (\n    <div className={className} style={containerStyle}>\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Community Gallery Widget\"\n        width=\"100%\"\n        loading=\"lazy\"\n        style={iframeStyle}\n        onLoad={handleLoad}\n        onError={handleError}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Q&A Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface QAThemingProps {\n  /** Primary accent color, e.g. \"#228be6\" */\n  qaPrimaryColor?: string;\n  /** Container background color */\n  qaBackgroundColor?: string;\n  /** Primary text color */\n  qaTextColor?: string;\n  /** Secondary text color */\n  qaSecondaryTextColor?: string;\n  /** Border color */\n  qaBorderColor?: string;\n  /** Staff badge color */\n  qaStaffBadgeColor?: string;\n  /** Accepted answer color */\n  qaAcceptedColor?: string;\n  /** Title font size, e.g. \"clamp(16px, 2vmin, 20px)\" */\n  qaTitleSize?: string;\n  /** Body font size */\n  qaBodySize?: string;\n  /** Meta text font size */\n  qaMetaSize?: string;\n  /** Font family */\n  qaFontFamily?: string;\n  /** Card padding, e.g. \"16px\" */\n  qaCardPadding?: string;\n  /** Gap between cards, e.g. \"12px\" */\n  qaCardGap?: string;\n  /** Border radius, e.g. \"8px\" */\n  qaBorderRadius?: string;\n  /** Card box shadow */\n  qaCardShadow?: string;\n  /** Button border radius, e.g. \"4px\" */\n  qaButtonRadius?: string;\n  /** Vote button size, e.g. \"28px\" */\n  qaVoteButtonSize?: string;\n}\n\n/**\n * Core configuration props for the Q&A Widget.\n */\nexport interface QAWidgetProps extends QAThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token for authenticated features */\n  authToken?: string;\n  /** Product ID to scope questions to a specific product */\n  productId?: string;\n  /** Display name for the user. Default: \"Anonymous\" */\n  username?: string;\n  /** Number of items per page. Default: 5 */\n  pageSize?: number;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Show search bar. Default: true */\n  showSearch?: boolean;\n  /** Show the \"Ask a Question\" button. Default: true */\n  showAskButton?: boolean;\n  /** Widget width CSS value. Default: \"600px\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"800px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the Q&A widget iframe URL.\n */\nexport const QA_THEMING_PROP_TO_PARAM: Record<keyof QAThemingProps, string> = {\n  qaPrimaryColor: \"qa-primary-color\",\n  qaBackgroundColor: \"qa-background-color\",\n  qaTextColor: \"qa-text-color\",\n  qaSecondaryTextColor: \"qa-secondary-text-color\",\n  qaBorderColor: \"qa-border-color\",\n  qaStaffBadgeColor: \"qa-staff-badge-color\",\n  qaAcceptedColor: \"qa-accepted-color\",\n  qaTitleSize: \"qa-title-size\",\n  qaBodySize: \"qa-body-size\",\n  qaMetaSize: \"qa-meta-size\",\n  qaFontFamily: \"qa-font-family\",\n  qaCardPadding: \"qa-card-padding\",\n  qaCardGap: \"qa-card-gap\",\n  qaBorderRadius: \"qa-border-radius\",\n  qaCardShadow: \"qa-card-shadow\",\n  qaButtonRadius: \"qa-button-radius\",\n  qaVoteButtonSize: \"qa-vote-button-size\",\n};\n\n","import React, {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type QAWidgetProps,\n  type QAThemingProps,\n  QA_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionQA for imperative control.\n */\nexport interface LegionQAHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildQAWidgetUrl(props: QAWidgetProps): string {\n  const {\n    baseUrl,\n    productId,\n    username = \"Anonymous\",\n    pageSize = 5,\n    theme = \"light\",\n    showSearch = true,\n    showAskButton = true,\n  } = props;\n\n  const url = new URL(\"/widget/qa\", baseUrl);\n\n  if (productId) {\n    url.searchParams.set(\"productId\", productId);\n  }\n  if (username) {\n    url.searchParams.set(\"username\", username);\n  }\n  if (pageSize) {\n    url.searchParams.set(\"pageSize\", String(pageSize));\n  }\n  if (theme) {\n    url.searchParams.set(\"theme\", theme);\n  }\n  url.searchParams.set(\"showSearch\", String(showSearch));\n  url.searchParams.set(\"showAskButton\", String(showAskButton));\n\n  // Append theming params\n  const themingKeys = Object.keys(QA_THEMING_PROP_TO_PARAM) as Array<\n    keyof QAThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(QA_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionQA – a React component that embeds the Legion Q&A widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionQA } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionQA\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionQA = forwardRef<LegionQAHandle, QAWidgetProps>(\n  function LegionQA(props, ref) {\n    const {\n      theme = \"light\",\n      authToken,\n      productId,\n      username,\n      pageSize,\n      showSearch,\n      showAskButton,\n      width = \"600px\",\n      height = \"800px\",\n      className,\n      style,\n      onLoad,\n      onError,\n      baseUrl,\n      ...rest\n    } = props;\n\n    const iframeRef = useRef<HTMLIFrameElement>(null);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        refresh: () => {\n          const iframe = iframeRef.current;\n          if (iframe?.contentWindow) {\n            iframe.contentWindow.location.reload();\n          }\n        },\n      }),\n      []\n    );\n\n    const src = useMemo(\n      () => buildQAWidgetUrl(props),\n      [\n        baseUrl,\n        productId,\n        username,\n        pageSize,\n        theme,\n        showSearch,\n        showAskButton,\n        ...Object.keys(QA_THEMING_PROP_TO_PARAM).map(\n          (k) => rest[k as keyof typeof rest]\n        ),\n      ]\n    );\n\n    const handleLoad = useCallback(() => {\n      // Send auth token via postMessage\n      if (authToken && iframeRef.current?.contentWindow) {\n        iframeRef.current.contentWindow.postMessage(\n          { type: \"AUTH_TOKEN\", token: authToken },\n          baseUrl\n        );\n      }\n      onLoad?.({ widget: \"qa\", theme });\n    }, [authToken, baseUrl, theme, onLoad]);\n\n    const handleError = useCallback(() => {\n      onError?.(\"Failed to load Q&A widget\");\n    }, [onError]);\n\n    const containerStyle: React.CSSProperties = {\n      display: \"block\",\n      width,\n      height,\n      ...style,\n    };\n\n    const iframeStyle: React.CSSProperties = {\n      border: \"none\",\n      borderRadius: \"8px\",\n      boxShadow: \"0 2px 10px rgba(0, 0, 0, 0.1)\",\n      width: \"100%\",\n      height: \"100%\",\n    };\n\n    return (\n      <div className={className} style={containerStyle}>\n        <iframe\n          ref={iframeRef}\n          src={src}\n          title=\"Community Q&A Widget\"\n          width=\"100%\"\n          height=\"100%\"\n          loading=\"lazy\"\n          style={iframeStyle}\n          onLoad={handleLoad}\n          onError={handleError}\n        />\n      </div>\n    );\n  }\n);\n\n","/**\n * Theming props for the Social Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface SocialThemingProps {\n  /** Container background color */\n  socialBackgroundColor?: string;\n  /** Primary text color */\n  socialTextColor?: string;\n  /** Secondary text color */\n  socialSecondaryTextColor?: string;\n  /** Border color */\n  socialBorderColor?: string;\n  /** Container border radius */\n  socialBorderRadius?: string;\n  /** Container padding */\n  socialPadding?: string;\n  /** Container box shadow */\n  socialShadow?: string;\n  /** Primary accent color */\n  socialPrimaryColor?: string;\n  /** Primary hover color */\n  socialPrimaryHover?: string;\n  /** Card background */\n  socialCardBg?: string;\n  /** Card border */\n  socialCardBorder?: string;\n  /** Card border radius */\n  socialCardRadius?: string;\n  /** Card box shadow */\n  socialCardShadow?: string;\n  /** Card hover shadow */\n  socialCardHoverShadow?: string;\n  /** Avatar size */\n  socialAvatarSize?: string;\n  /** Avatar border radius */\n  socialAvatarRadius?: string;\n  /** Avatar border */\n  socialAvatarBorder?: string;\n  /** Post background */\n  socialPostBg?: string;\n  /** Post border radius */\n  socialPostBorderRadius?: string;\n  /** Post padding */\n  socialPostPadding?: string;\n  /** Grid gap */\n  socialGridGap?: string;\n  /** Grid item border radius */\n  socialGridRadius?: string;\n  /** Grid overlay background */\n  socialGridOverlayBg?: string;\n  /** Grid hover scale */\n  socialGridHoverScale?: string;\n  /** Image border radius */\n  socialImageRadius?: string;\n  /** Image border */\n  socialImageBorder?: string;\n  /** Button background */\n  socialButtonBg?: string;\n  /** Button hover background */\n  socialButtonHoverBg?: string;\n  /** Button text color */\n  socialButtonColor?: string;\n  /** Button border radius */\n  socialButtonRadius?: string;\n  /** Action button background */\n  socialActionBg?: string;\n  /** Action button hover background */\n  socialActionHoverBg?: string;\n  /** Action button active background */\n  socialActionActiveBg?: string;\n  /** Action button active text color */\n  socialActionActiveColor?: string;\n  /** Action button border radius */\n  socialActionRadius?: string;\n  /** Action icon size */\n  socialActionSize?: string;\n  /** Like color */\n  socialLikeColor?: string;\n  /** Like active background */\n  socialLikeActiveBg?: string;\n  /** Comment background */\n  socialCommentBg?: string;\n  /** Comment border */\n  socialCommentBorder?: string;\n  /** Comment border radius */\n  socialCommentRadius?: string;\n  /** Font family */\n  socialFontFamily?: string;\n  /** Username font size */\n  socialUsernameSize?: string;\n  /** Username font weight */\n  socialUsernameWeight?: string;\n  /** Timestamp font size */\n  socialTimestampSize?: string;\n  /** Body text font size */\n  socialBodySize?: string;\n  /** Meta text font size */\n  socialMetaSize?: string;\n  /** Divider color */\n  socialDividerColor?: string;\n  /** Create post card background */\n  socialCreateCardBg?: string;\n  /** Create post card border */\n  socialCreateCardBorder?: string;\n  /** Empty state icon color */\n  socialEmptyIconColor?: string;\n  /** Empty state text color */\n  socialEmptyTextColor?: string;\n  /** Transition duration */\n  socialTransitionDuration?: string;\n  /** Hover scale factor */\n  socialHoverScale?: string;\n  /** Loader spinner color */\n  socialLoaderColor?: string;\n}\n\n/**\n * Core configuration props for the Social Widget.\n */\nexport interface SocialWidgetProps extends SocialThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token for authenticated features */\n  authToken?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Layout mode. Default: \"feed\" */\n  layout?: \"feed\" | \"grid\";\n  /** Number of grid rows (grid layout only). Default: 3 */\n  rows?: number;\n  /** Number of grid columns (grid layout only). Default: 3 */\n  cols?: number;\n  /** URL for community page click-throughs (grid layout) */\n  communityUrl?: string;\n  /** Channel filter for social feed/grid */\n  channel?: string;\n  /** Widget width CSS value. Default: \"600px\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"800px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; layout: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the social widget iframe URL.\n */\nexport const SOCIAL_THEMING_PROP_TO_PARAM: Record<\n  keyof SocialThemingProps,\n  string\n> = {\n  socialBackgroundColor: \"social-background-color\",\n  socialTextColor: \"social-text-color\",\n  socialSecondaryTextColor: \"social-secondary-text-color\",\n  socialBorderColor: \"social-border-color\",\n  socialBorderRadius: \"social-border-radius\",\n  socialPadding: \"social-padding\",\n  socialShadow: \"social-shadow\",\n  socialPrimaryColor: \"social-primary-color\",\n  socialPrimaryHover: \"social-primary-hover\",\n  socialCardBg: \"social-card-bg\",\n  socialCardBorder: \"social-card-border\",\n  socialCardRadius: \"social-card-radius\",\n  socialCardShadow: \"social-card-shadow\",\n  socialCardHoverShadow: \"social-card-hover-shadow\",\n  socialAvatarSize: \"social-avatar-size\",\n  socialAvatarRadius: \"social-avatar-radius\",\n  socialAvatarBorder: \"social-avatar-border\",\n  socialPostBg: \"social-post-bg\",\n  socialPostBorderRadius: \"social-post-border-radius\",\n  socialPostPadding: \"social-post-padding\",\n  socialGridGap: \"social-grid-gap\",\n  socialGridRadius: \"social-grid-radius\",\n  socialGridOverlayBg: \"social-grid-overlay-bg\",\n  socialGridHoverScale: \"social-grid-hover-scale\",\n  socialImageRadius: \"social-image-radius\",\n  socialImageBorder: \"social-image-border\",\n  socialButtonBg: \"social-button-bg\",\n  socialButtonHoverBg: \"social-button-hover-bg\",\n  socialButtonColor: \"social-button-color\",\n  socialButtonRadius: \"social-button-radius\",\n  socialActionBg: \"social-action-bg\",\n  socialActionHoverBg: \"social-action-hover-bg\",\n  socialActionActiveBg: \"social-action-active-bg\",\n  socialActionActiveColor: \"social-action-active-color\",\n  socialActionRadius: \"social-action-radius\",\n  socialActionSize: \"social-action-size\",\n  socialLikeColor: \"social-like-color\",\n  socialLikeActiveBg: \"social-like-active-bg\",\n  socialCommentBg: \"social-comment-bg\",\n  socialCommentBorder: \"social-comment-border\",\n  socialCommentRadius: \"social-comment-radius\",\n  socialFontFamily: \"social-font-family\",\n  socialUsernameSize: \"social-username-size\",\n  socialUsernameWeight: \"social-username-weight\",\n  socialTimestampSize: \"social-timestamp-size\",\n  socialBodySize: \"social-body-size\",\n  socialMetaSize: \"social-meta-size\",\n  socialDividerColor: \"social-divider-color\",\n  socialCreateCardBg: \"social-create-card-bg\",\n  socialCreateCardBorder: \"social-create-card-border\",\n  socialEmptyIconColor: \"social-empty-icon-color\",\n  socialEmptyTextColor: \"social-empty-text-color\",\n  socialTransitionDuration: \"social-transition-duration\",\n  socialHoverScale: \"social-hover-scale\",\n  socialLoaderColor: \"social-loader-color\",\n};\n\n","import React, {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type SocialWidgetProps,\n  type SocialThemingProps,\n  SOCIAL_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionSocial for imperative control.\n */\nexport interface LegionSocialHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildSocialWidgetUrl(props: SocialWidgetProps): string {\n  const {\n    baseUrl,\n    layout = \"feed\",\n    theme = \"light\",\n    rows = 3,\n    cols = 3,\n    communityUrl,\n    channel,\n    height = \"800\",\n  } = props;\n\n  const url = new URL(\"/widget/social\", baseUrl);\n\n  if (layout) url.searchParams.set(\"layout\", layout);\n  if (theme) url.searchParams.set(\"theme\", theme);\n\n  if (layout === \"grid\") {\n    url.searchParams.set(\"rows\", String(rows));\n    url.searchParams.set(\"cols\", String(cols));\n    if (communityUrl) {\n      url.searchParams.set(\"communityUrl\", communityUrl);\n    }\n  } else if (layout === \"feed\") {\n    // For feed layout, pass height to enable constrained scrolling\n    const rawHeight = String(height).replace(\"px\", \"\");\n    if (rawHeight !== \"800\") {\n      url.searchParams.set(\"height\", rawHeight);\n    }\n  }\n\n  if (channel) {\n    url.searchParams.set(\"channel\", channel);\n  }\n\n  // Append theming params\n  const themingKeys = Object.keys(SOCIAL_THEMING_PROP_TO_PARAM) as Array<\n    keyof SocialThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(SOCIAL_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionSocial – a React component that embeds the Legion Social widget\n * via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionSocial } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionSocial\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       layout=\"feed\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionSocial = forwardRef<LegionSocialHandle, SocialWidgetProps>(\n  function LegionSocial(props, ref) {\n    const {\n      theme = \"light\",\n      layout = \"feed\",\n      authToken,\n      rows,\n      cols,\n      communityUrl,\n      channel,\n      width = \"600px\",\n      height = \"800px\",\n      className,\n      style,\n      onLoad,\n      onError,\n      baseUrl,\n      ...rest\n    } = props;\n\n    const iframeRef = useRef<HTMLIFrameElement>(null);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        refresh: () => {\n          const iframe = iframeRef.current;\n          if (iframe?.contentWindow) {\n            iframe.contentWindow.location.reload();\n          }\n        },\n      }),\n      []\n    );\n\n    const src = useMemo(\n      () => buildSocialWidgetUrl(props),\n      [\n        baseUrl,\n        layout,\n        theme,\n        rows,\n        cols,\n        communityUrl,\n        channel,\n        height,\n        ...Object.keys(SOCIAL_THEMING_PROP_TO_PARAM).map(\n          (k) => rest[k as keyof typeof rest]\n        ),\n      ]\n    );\n\n    const handleLoad = useCallback(() => {\n      // Auth only for non-grid layouts\n      if (layout !== \"grid\" && authToken && iframeRef.current?.contentWindow) {\n        iframeRef.current.contentWindow.postMessage(\n          { type: \"AUTH_TOKEN\", token: authToken },\n          baseUrl\n        );\n      }\n      onLoad?.({ widget: \"social\", layout, theme });\n    }, [authToken, baseUrl, layout, theme, onLoad]);\n\n    const handleError = useCallback(() => {\n      onError?.(\"Failed to load social widget\");\n    }, [onError]);\n\n    const containerStyle: React.CSSProperties = {\n      display: \"block\",\n      width,\n      height,\n      ...style,\n    };\n\n    const iframeStyle: React.CSSProperties = {\n      border: \"none\",\n      borderRadius: \"8px\",\n      boxShadow: \"0 2px 10px rgba(0, 0, 0, 0.1)\",\n      width: \"100%\",\n      height: \"100%\",\n    };\n\n    return (\n      <div className={className} style={containerStyle}>\n        <iframe\n          ref={iframeRef}\n          src={src}\n          title=\"Social Feed Widget\"\n          width=\"100%\"\n          height=\"100%\"\n          loading=\"lazy\"\n          style={iframeStyle}\n          onLoad={handleLoad}\n          onError={handleError}\n        />\n      </div>\n    );\n  }\n);\n\n","/**\n * Theming props for the Wallet Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface WalletThemingProps {\n  /** Container background color */\n  walletBackgroundColor?: string;\n  /** Primary text color */\n  walletTextColor?: string;\n  /** Secondary text color */\n  walletSecondaryTextColor?: string;\n  /** Border color */\n  walletBorderColor?: string;\n  /** Container border radius */\n  walletBorderRadius?: string;\n  /** Container padding */\n  walletPadding?: string;\n  /** Container box shadow */\n  walletShadow?: string;\n  /** Primary accent color */\n  walletPrimaryColor?: string;\n  /** Primary hover color */\n  walletPrimaryHover?: string;\n  /** Tab background */\n  walletTabBackground?: string;\n  /** Active tab background */\n  walletTabActiveBackground?: string;\n  /** Active tab text color */\n  walletTabActiveColor?: string;\n  /** Tab border color */\n  walletTabBorderColor?: string;\n  /** Tab border radius */\n  walletTabRadius?: string;\n  /** Coupon gradient start */\n  walletCouponBgStart?: string;\n  /** Coupon gradient end */\n  walletCouponBgEnd?: string;\n  /** Coupon border color */\n  walletCouponBorderColor?: string;\n  /** Coupon border radius */\n  walletCouponRadius?: string;\n  /** Coupon box shadow */\n  walletCouponShadow?: string;\n  /** Coupon hover shadow */\n  walletCouponHoverShadow?: string;\n  /** Voucher gradient start */\n  walletVoucherBgStart?: string;\n  /** Voucher gradient mid */\n  walletVoucherBgMid?: string;\n  /** Voucher gradient end */\n  walletVoucherBgEnd?: string;\n  /** Voucher accent gradient start */\n  walletVoucherAccentStart?: string;\n  /** Voucher accent gradient mid */\n  walletVoucherAccentMid?: string;\n  /** Voucher accent gradient end */\n  walletVoucherAccentEnd?: string;\n  /** Voucher border color */\n  walletVoucherBorderColor?: string;\n  /** Voucher border radius */\n  walletVoucherRadius?: string;\n  /** Voucher box shadow */\n  walletVoucherShadow?: string;\n  /** Font family */\n  walletFontFamily?: string;\n  /** Title font size */\n  walletTitleSize?: string;\n  /** Title font weight */\n  walletTitleWeight?: string;\n  /** Body text font size */\n  walletBodySize?: string;\n  /** Meta text font size */\n  walletMetaSize?: string;\n  /** Active badge background */\n  walletBadgeActiveBg?: string;\n  /** Active badge text color */\n  walletBadgeActiveColor?: string;\n  /** Expired badge background */\n  walletBadgeExpiredBg?: string;\n  /** Expired badge text color */\n  walletBadgeExpiredColor?: string;\n  /** Redeemed badge background */\n  walletBadgeRedeemedBg?: string;\n  /** Redeemed badge text color */\n  walletBadgeRedeemedColor?: string;\n  /** Button border radius */\n  walletButtonRadius?: string;\n  /** Button padding */\n  walletButtonPadding?: string;\n  /** Progress bar background */\n  walletProgressBg?: string;\n  /** Progress bar color */\n  walletProgressColor?: string;\n  /** Progress bar warning color */\n  walletProgressWarningColor?: string;\n  /** Transition duration */\n  walletTransitionDuration?: string;\n  /** Hover scale factor */\n  walletHoverScale?: string;\n  /** Empty state icon color */\n  walletEmptyIconColor?: string;\n  /** Empty state text color */\n  walletEmptyTextColor?: string;\n}\n\n/**\n * Core configuration props for the Wallet Widget.\n */\nexport interface WalletWidgetProps extends WalletThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** User ID (required) */\n  userId: string;\n  /** API key for authentication */\n  apiKey?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Show wallet balance. Default: true */\n  showBalance?: boolean;\n  /** Show transaction history. Default: true */\n  showHistory?: boolean;\n  /** Widget height CSS value. Default: \"500px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the wallet widget iframe URL.\n */\nexport const WALLET_THEMING_PROP_TO_PARAM: Record<\n  keyof WalletThemingProps,\n  string\n> = {\n  walletBackgroundColor: \"wallet-background-color\",\n  walletTextColor: \"wallet-text-color\",\n  walletSecondaryTextColor: \"wallet-secondary-text-color\",\n  walletBorderColor: \"wallet-border-color\",\n  walletBorderRadius: \"wallet-border-radius\",\n  walletPadding: \"wallet-padding\",\n  walletShadow: \"wallet-shadow\",\n  walletPrimaryColor: \"wallet-primary-color\",\n  walletPrimaryHover: \"wallet-primary-hover\",\n  walletTabBackground: \"wallet-tab-background\",\n  walletTabActiveBackground: \"wallet-tab-active-background\",\n  walletTabActiveColor: \"wallet-tab-active-color\",\n  walletTabBorderColor: \"wallet-tab-border-color\",\n  walletTabRadius: \"wallet-tab-radius\",\n  walletCouponBgStart: \"wallet-coupon-bg-start\",\n  walletCouponBgEnd: \"wallet-coupon-bg-end\",\n  walletCouponBorderColor: \"wallet-coupon-border-color\",\n  walletCouponRadius: \"wallet-coupon-radius\",\n  walletCouponShadow: \"wallet-coupon-shadow\",\n  walletCouponHoverShadow: \"wallet-coupon-hover-shadow\",\n  walletVoucherBgStart: \"wallet-voucher-bg-start\",\n  walletVoucherBgMid: \"wallet-voucher-bg-mid\",\n  walletVoucherBgEnd: \"wallet-voucher-bg-end\",\n  walletVoucherAccentStart: \"wallet-voucher-accent-start\",\n  walletVoucherAccentMid: \"wallet-voucher-accent-mid\",\n  walletVoucherAccentEnd: \"wallet-voucher-accent-end\",\n  walletVoucherBorderColor: \"wallet-voucher-border-color\",\n  walletVoucherRadius: \"wallet-voucher-radius\",\n  walletVoucherShadow: \"wallet-voucher-shadow\",\n  walletFontFamily: \"wallet-font-family\",\n  walletTitleSize: \"wallet-title-size\",\n  walletTitleWeight: \"wallet-title-weight\",\n  walletBodySize: \"wallet-body-size\",\n  walletMetaSize: \"wallet-meta-size\",\n  walletBadgeActiveBg: \"wallet-badge-active-bg\",\n  walletBadgeActiveColor: \"wallet-badge-active-color\",\n  walletBadgeExpiredBg: \"wallet-badge-expired-bg\",\n  walletBadgeExpiredColor: \"wallet-badge-expired-color\",\n  walletBadgeRedeemedBg: \"wallet-badge-redeemed-bg\",\n  walletBadgeRedeemedColor: \"wallet-badge-redeemed-color\",\n  walletButtonRadius: \"wallet-button-radius\",\n  walletButtonPadding: \"wallet-button-padding\",\n  walletProgressBg: \"wallet-progress-bg\",\n  walletProgressColor: \"wallet-progress-color\",\n  walletProgressWarningColor: \"wallet-progress-warning-color\",\n  walletTransitionDuration: \"wallet-transition-duration\",\n  walletHoverScale: \"wallet-hover-scale\",\n  walletEmptyIconColor: \"wallet-empty-icon-color\",\n  walletEmptyTextColor: \"wallet-empty-text-color\",\n};\n\n","import React, {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type WalletWidgetProps,\n  type WalletThemingProps,\n  WALLET_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionWallet for imperative control.\n */\nexport interface LegionWalletHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildWalletWidgetUrl(props: WalletWidgetProps): string {\n  const {\n    baseUrl,\n    userId,\n    apiKey,\n    theme = \"light\",\n    showBalance = true,\n    showHistory = true,\n  } = props;\n\n  const url = new URL(\"/widget/wallet\", baseUrl);\n\n  url.searchParams.set(\"userId\", userId);\n  url.searchParams.set(\"theme\", theme);\n  url.searchParams.set(\"showBalance\", String(showBalance));\n  url.searchParams.set(\"showHistory\", String(showHistory));\n\n  if (apiKey) {\n    url.searchParams.set(\"apiKey\", apiKey);\n  }\n\n  // Append theming params\n  const themingKeys = Object.keys(WALLET_THEMING_PROP_TO_PARAM) as Array<\n    keyof WalletThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(WALLET_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionWallet – a React component that embeds the Legion Wallet widget\n * via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionWallet } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionWallet\n *       baseUrl=\"https://your-legion-domain.com\"\n *       userId=\"user-123\"\n *       apiKey=\"your-api-key\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionWallet = forwardRef<LegionWalletHandle, WalletWidgetProps>(\n  function LegionWallet(props, ref) {\n    const {\n      theme = \"light\",\n      userId,\n      apiKey,\n      showBalance,\n      showHistory,\n      height = \"500px\",\n      className,\n      style,\n      onLoad,\n      onError,\n      baseUrl,\n      ...rest\n    } = props;\n\n    const iframeRef = useRef<HTMLIFrameElement>(null);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        refresh: () => {\n          const iframe = iframeRef.current;\n          if (iframe?.contentWindow) {\n            iframe.contentWindow.location.reload();\n          }\n        },\n      }),\n      []\n    );\n\n    const src = useMemo(\n      () => buildWalletWidgetUrl(props),\n      [\n        baseUrl,\n        userId,\n        apiKey,\n        theme,\n        showBalance,\n        showHistory,\n        ...Object.keys(WALLET_THEMING_PROP_TO_PARAM).map(\n          (k) => rest[k as keyof typeof rest]\n        ),\n      ]\n    );\n\n    const handleLoad = useCallback(() => {\n      // Send API key via postMessage\n      if (apiKey && iframeRef.current?.contentWindow) {\n        iframeRef.current.contentWindow.postMessage(\n          { type: \"AUTH_TOKEN\", token: apiKey },\n          baseUrl\n        );\n      }\n      onLoad?.({ widget: \"wallet\", theme });\n    }, [apiKey, baseUrl, theme, onLoad]);\n\n    const handleError = useCallback(() => {\n      onError?.(\"Failed to load wallet widget\");\n    }, [onError]);\n\n    const containerStyle: React.CSSProperties = {\n      display: \"block\",\n      width: \"100%\",\n      height,\n      ...style,\n    };\n\n    const iframeStyle: React.CSSProperties = {\n      border: \"none\",\n      borderRadius: \"8px\",\n      boxShadow: \"0 2px 10px rgba(0, 0, 0, 0.1)\",\n      width: \"100%\",\n      height: \"100%\",\n    };\n\n    return (\n      <div className={className} style={containerStyle}>\n        <iframe\n          ref={iframeRef}\n          src={src}\n          title=\"Wallet Widget\"\n          width=\"100%\"\n          height=\"100%\"\n          loading=\"lazy\"\n          style={iframeStyle}\n          onLoad={handleLoad}\n          onError={handleError}\n        />\n      </div>\n    );\n  }\n);\n\n","/**\n * Theming props for the Matrix Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface MatrixThemingProps {\n  /** Container background color */\n  matrixBackgroundColor?: string;\n  /** Primary text color */\n  matrixTextColor?: string;\n  /** Secondary text color */\n  matrixSecondaryTextColor?: string;\n  /** Border color */\n  matrixBorderColor?: string;\n  /** Container border radius */\n  matrixBorderRadius?: string;\n  /** Container padding */\n  matrixPadding?: string;\n  /** Container box shadow */\n  matrixShadow?: string;\n  /** Primary color */\n  matrixPrimaryColor?: string;\n  /** Accent color */\n  matrixAccentColor?: string;\n  /** Card background */\n  matrixCardBg?: string;\n  /** Card hover background */\n  matrixCardHoverBg?: string;\n  /** Card border */\n  matrixCardBorder?: string;\n  /** Card border radius */\n  matrixCardRadius?: string;\n  /** Card box shadow */\n  matrixCardShadow?: string;\n  /** Card padding */\n  matrixCardPadding?: string;\n  /** Card gap */\n  matrixCardGap?: string;\n  /** Icon background */\n  matrixIconBg?: string;\n  /** Icon color */\n  matrixIconColor?: string;\n  /** Icon size */\n  matrixIconSize?: string;\n  /** Icon border radius */\n  matrixIconRadius?: string;\n  /** Indicator color */\n  matrixIndicatorColor?: string;\n  /** Indicator size */\n  matrixIndicatorSize?: string;\n  /** Badge background */\n  matrixBadgeBg?: string;\n  /** Badge text color */\n  matrixBadgeColor?: string;\n  /** Font family */\n  matrixFontFamily?: string;\n  /** Title font size */\n  matrixTitleSize?: string;\n  /** Title font weight */\n  matrixTitleWeight?: string;\n  /** Body text font size */\n  matrixBodySize?: string;\n  /** Body text font weight */\n  matrixBodyWeight?: string;\n  /** Timestamp font size */\n  matrixTimestampSize?: string;\n  /** Timestamp text color */\n  matrixTimestampColor?: string;\n  /** Empty state icon color */\n  matrixEmptyIconColor?: string;\n  /** Empty state icon size */\n  matrixEmptyIconSize?: string;\n  /** Empty state title font size */\n  matrixEmptyTitleSize?: string;\n  /** Empty state text color */\n  matrixEmptyTextColor?: string;\n  /** Button background */\n  matrixButtonBg?: string;\n  /** Button text color */\n  matrixButtonColor?: string;\n  /** Button border radius */\n  matrixButtonRadius?: string;\n  /** Button padding */\n  matrixButtonPadding?: string;\n  /** Transition duration */\n  matrixTransitionDuration?: string;\n  /** Hover scale factor */\n  matrixHoverScale?: string;\n  /** Animation timing function */\n  matrixAnimationTiming?: string;\n  /** Container minimum height */\n  matrixMinHeight?: string;\n  /** Container maximum width */\n  matrixMaxWidth?: string;\n  /** Layout gap */\n  matrixGap?: string;\n}\n\n/**\n * Core configuration props for the Matrix Widget.\n */\nexport interface MatrixWidgetProps extends MatrixThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Title shown in empty state. Default: \"You're all caught up\" */\n  emptyTitle?: string;\n  /** Subtitle shown in empty state. Default: \"No updates right now\" */\n  emptySubtitle?: string;\n  /** Accent color name. Default: \"blue\" (light) / \"gray\" (dark) */\n  accentColor?: string;\n  /** Icon for empty state. Default: \"bell\" */\n  emptyIcon?: \"bell\" | \"gift\" | \"activity\" | \"trophy\";\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"400px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the matrix widget iframe URL.\n */\nexport const MATRIX_THEMING_PROP_TO_PARAM: Record<\n  keyof MatrixThemingProps,\n  string\n> = {\n  matrixBackgroundColor: \"matrix-background-color\",\n  matrixTextColor: \"matrix-text-color\",\n  matrixSecondaryTextColor: \"matrix-secondary-text-color\",\n  matrixBorderColor: \"matrix-border-color\",\n  matrixBorderRadius: \"matrix-border-radius\",\n  matrixPadding: \"matrix-padding\",\n  matrixShadow: \"matrix-shadow\",\n  matrixPrimaryColor: \"matrix-primary-color\",\n  matrixAccentColor: \"matrix-accent-color\",\n  matrixCardBg: \"matrix-card-bg\",\n  matrixCardHoverBg: \"matrix-card-hover-bg\",\n  matrixCardBorder: \"matrix-card-border\",\n  matrixCardRadius: \"matrix-card-radius\",\n  matrixCardShadow: \"matrix-card-shadow\",\n  matrixCardPadding: \"matrix-card-padding\",\n  matrixCardGap: \"matrix-card-gap\",\n  matrixIconBg: \"matrix-icon-bg\",\n  matrixIconColor: \"matrix-icon-color\",\n  matrixIconSize: \"matrix-icon-size\",\n  matrixIconRadius: \"matrix-icon-radius\",\n  matrixIndicatorColor: \"matrix-indicator-color\",\n  matrixIndicatorSize: \"matrix-indicator-size\",\n  matrixBadgeBg: \"matrix-badge-bg\",\n  matrixBadgeColor: \"matrix-badge-color\",\n  matrixFontFamily: \"matrix-font-family\",\n  matrixTitleSize: \"matrix-title-size\",\n  matrixTitleWeight: \"matrix-title-weight\",\n  matrixBodySize: \"matrix-body-size\",\n  matrixBodyWeight: \"matrix-body-weight\",\n  matrixTimestampSize: \"matrix-timestamp-size\",\n  matrixTimestampColor: \"matrix-timestamp-color\",\n  matrixEmptyIconColor: \"matrix-empty-icon-color\",\n  matrixEmptyIconSize: \"matrix-empty-icon-size\",\n  matrixEmptyTitleSize: \"matrix-empty-title-size\",\n  matrixEmptyTextColor: \"matrix-empty-text-color\",\n  matrixButtonBg: \"matrix-button-bg\",\n  matrixButtonColor: \"matrix-button-color\",\n  matrixButtonRadius: \"matrix-button-radius\",\n  matrixButtonPadding: \"matrix-button-padding\",\n  matrixTransitionDuration: \"matrix-transition-duration\",\n  matrixHoverScale: \"matrix-hover-scale\",\n  matrixAnimationTiming: \"matrix-animation-timing\",\n  matrixMinHeight: \"matrix-min-height\",\n  matrixMaxWidth: \"matrix-max-width\",\n  matrixGap: \"matrix-gap\",\n};\n\n","import React, {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type MatrixWidgetProps,\n  type MatrixThemingProps,\n  MATRIX_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionMatrix for imperative control.\n */\nexport interface LegionMatrixHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildMatrixWidgetUrl(props: MatrixWidgetProps): string {\n  const {\n    baseUrl,\n    theme = \"light\",\n    emptyTitle = \"You're all caught up\",\n    emptySubtitle = \"No updates right now\",\n    accentColor,\n    emptyIcon = \"bell\",\n  } = props;\n\n  const url = new URL(\"/widget/matrix\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n  url.searchParams.set(\"emptyTitle\", emptyTitle);\n  url.searchParams.set(\"emptySubtitle\", emptySubtitle);\n\n  // Default accent color depends on theme\n  const resolvedAccentColor =\n    accentColor ?? (theme === \"dark\" ? \"gray\" : \"blue\");\n  url.searchParams.set(\"accentColor\", resolvedAccentColor);\n\n  // Validate emptyIcon\n  const validIcons: Array<MatrixWidgetProps[\"emptyIcon\"]> = [\n    \"bell\",\n    \"gift\",\n    \"activity\",\n    \"trophy\",\n  ];\n  const resolvedIcon = validIcons.includes(emptyIcon) ? emptyIcon : \"bell\";\n  url.searchParams.set(\"emptyIcon\", resolvedIcon!);\n\n  // Append theming params\n  const themingKeys = Object.keys(MATRIX_THEMING_PROP_TO_PARAM) as Array<\n    keyof MatrixThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(MATRIX_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionMatrix – a React component that embeds the Legion\n * Matrix (site-wide notification feed) widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionMatrix } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionMatrix\n *       baseUrl=\"https://your-legion-domain.com\"\n *       theme=\"light\"\n *       emptyTitle=\"You're all caught up\"\n *       emptyIcon=\"bell\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionMatrix = forwardRef<LegionMatrixHandle, MatrixWidgetProps>(\n  function LegionMatrix(props, ref) {\n    const {\n      theme = \"light\",\n      emptyTitle,\n      emptySubtitle,\n      accentColor,\n      emptyIcon,\n      width = \"100%\",\n      height = \"400px\",\n      className,\n      style,\n      onLoad,\n      onError,\n      baseUrl,\n      ...rest\n    } = props;\n\n    const iframeRef = useRef<HTMLIFrameElement>(null);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        refresh: () => {\n          const iframe = iframeRef.current;\n          if (iframe?.contentWindow) {\n            iframe.contentWindow.location.reload();\n          }\n        },\n      }),\n      []\n    );\n\n    const src = useMemo(\n      () => buildMatrixWidgetUrl(props),\n      [\n        baseUrl,\n        theme,\n        emptyTitle,\n        emptySubtitle,\n        accentColor,\n        emptyIcon,\n        ...Object.keys(MATRIX_THEMING_PROP_TO_PARAM).map(\n          (k) => rest[k as keyof typeof rest]\n        ),\n      ]\n    );\n\n    const handleLoad = useCallback(() => {\n      onLoad?.({ widget: \"matrix\", theme });\n    }, [theme, onLoad]);\n\n    const handleError = useCallback(() => {\n      onError?.(\"Failed to load matrix widget\");\n    }, [onError]);\n\n    const containerStyle: React.CSSProperties = {\n      display: \"block\",\n      width,\n      backgroundColor: \"transparent\",\n      ...style,\n    };\n\n    const iframeStyle: React.CSSProperties = {\n      border: \"none\",\n      borderRadius: \"8px\",\n      overflow: \"hidden\",\n      width: \"100%\",\n      height,\n    };\n\n    return (\n      <div className={className} style={containerStyle}>\n        <iframe\n          ref={iframeRef}\n          src={src}\n          title=\"Matrix Widget\"\n          width=\"100%\"\n          loading=\"lazy\"\n          style={iframeStyle}\n          onLoad={handleLoad}\n          onError={handleError}\n        />\n      </div>\n    );\n  }\n);\n\n","/**\n * Theming props for the Profile Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface ProfileThemingProps {\n  /** Container background color */\n  profileBackgroundColor?: string;\n  /** Primary text color */\n  profileTextColor?: string;\n  /** Secondary text color */\n  profileSecondaryTextColor?: string;\n  /** Border color */\n  profileBorderColor?: string;\n  /** Container border radius, e.g. \"12px\" */\n  profileBorderRadius?: string;\n  /** Container padding */\n  profilePadding?: string;\n  /** Container box shadow */\n  profileShadow?: string;\n  /** Primary accent color */\n  profilePrimaryColor?: string;\n  /** Primary hover color */\n  profilePrimaryHover?: string;\n  /** Accent color */\n  profileAccentColor?: string;\n  /** Card background */\n  profileCardBg?: string;\n  /** Card border */\n  profileCardBorder?: string;\n  /** Card border radius */\n  profileCardRadius?: string;\n  /** Card box shadow */\n  profileCardShadow?: string;\n  /** Card padding */\n  profileCardPadding?: string;\n  /** Avatar size, e.g. \"80px\" */\n  profileAvatarSize?: string;\n  /** Avatar border radius */\n  profileAvatarRadius?: string;\n  /** Avatar border */\n  profileAvatarBorder?: string;\n  /** Avatar box shadow */\n  profileAvatarShadow?: string;\n  /** Header background */\n  profileHeaderBg?: string;\n  /** Header height */\n  profileHeaderHeight?: string;\n  /** Badge background */\n  profileBadgeBg?: string;\n  /** Badge text color */\n  profileBadgeColor?: string;\n  /** Badge border radius */\n  profileBadgeRadius?: string;\n  /** Stat background */\n  profileStatBg?: string;\n  /** Stat border */\n  profileStatBorder?: string;\n  /** Stat value text color */\n  profileStatValueColor?: string;\n  /** Stat label text color */\n  profileStatLabelColor?: string;\n  /** Tab active background */\n  profileTabActiveBg?: string;\n  /** Tab active text color */\n  profileTabActiveColor?: string;\n  /** Tab text color */\n  profileTabColor?: string;\n  /** Tab hover background */\n  profileTabHoverBg?: string;\n  /** Tab border radius */\n  profileTabRadius?: string;\n  /** Button background */\n  profileButtonBg?: string;\n  /** Button hover background */\n  profileButtonHoverBg?: string;\n  /** Button text color */\n  profileButtonColor?: string;\n  /** Button border radius */\n  profileButtonRadius?: string;\n  /** Font family */\n  profileFontFamily?: string;\n  /** Name font size */\n  profileNameSize?: string;\n  /** Name font weight */\n  profileNameWeight?: string;\n  /** Username font size */\n  profileUsernameSize?: string;\n  /** Bio font size */\n  profileBioSize?: string;\n  /** Stat font size */\n  profileStatSize?: string;\n  /** Label font size */\n  profileLabelSize?: string;\n  /** Divider color */\n  profileDividerColor?: string;\n  /** Transition duration, e.g. \"0.2s\" */\n  profileTransitionDuration?: string;\n  /** Hover scale factor, e.g. \"1.02\" */\n  profileHoverScale?: string;\n}\n\n/**\n * Core configuration props for the Profile Widget.\n */\nexport interface ProfileWidgetProps extends ProfileThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token for authenticated profile viewing */\n  authToken?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget width CSS value. Default: \"400px\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"400px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the profile widget iframe URL.\n */\nexport const PROFILE_THEMING_PROP_TO_PARAM: Record<\n  keyof ProfileThemingProps,\n  string\n> = {\n  profileBackgroundColor: \"profile-background-color\",\n  profileTextColor: \"profile-text-color\",\n  profileSecondaryTextColor: \"profile-secondary-text-color\",\n  profileBorderColor: \"profile-border-color\",\n  profileBorderRadius: \"profile-border-radius\",\n  profilePadding: \"profile-padding\",\n  profileShadow: \"profile-shadow\",\n  profilePrimaryColor: \"profile-primary-color\",\n  profilePrimaryHover: \"profile-primary-hover\",\n  profileAccentColor: \"profile-accent-color\",\n  profileCardBg: \"profile-card-bg\",\n  profileCardBorder: \"profile-card-border\",\n  profileCardRadius: \"profile-card-radius\",\n  profileCardShadow: \"profile-card-shadow\",\n  profileCardPadding: \"profile-card-padding\",\n  profileAvatarSize: \"profile-avatar-size\",\n  profileAvatarRadius: \"profile-avatar-radius\",\n  profileAvatarBorder: \"profile-avatar-border\",\n  profileAvatarShadow: \"profile-avatar-shadow\",\n  profileHeaderBg: \"profile-header-bg\",\n  profileHeaderHeight: \"profile-header-height\",\n  profileBadgeBg: \"profile-badge-bg\",\n  profileBadgeColor: \"profile-badge-color\",\n  profileBadgeRadius: \"profile-badge-radius\",\n  profileStatBg: \"profile-stat-bg\",\n  profileStatBorder: \"profile-stat-border\",\n  profileStatValueColor: \"profile-stat-value-color\",\n  profileStatLabelColor: \"profile-stat-label-color\",\n  profileTabActiveBg: \"profile-tab-active-bg\",\n  profileTabActiveColor: \"profile-tab-active-color\",\n  profileTabColor: \"profile-tab-color\",\n  profileTabHoverBg: \"profile-tab-hover-bg\",\n  profileTabRadius: \"profile-tab-radius\",\n  profileButtonBg: \"profile-button-bg\",\n  profileButtonHoverBg: \"profile-button-hover-bg\",\n  profileButtonColor: \"profile-button-color\",\n  profileButtonRadius: \"profile-button-radius\",\n  profileFontFamily: \"profile-font-family\",\n  profileNameSize: \"profile-name-size\",\n  profileNameWeight: \"profile-name-weight\",\n  profileUsernameSize: \"profile-username-size\",\n  profileBioSize: \"profile-bio-size\",\n  profileStatSize: \"profile-stat-size\",\n  profileLabelSize: \"profile-label-size\",\n  profileDividerColor: \"profile-divider-color\",\n  profileTransitionDuration: \"profile-transition-duration\",\n  profileHoverScale: \"profile-hover-scale\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type ProfileWidgetProps,\n  type ProfileThemingProps,\n  PROFILE_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionProfile for imperative control.\n */\nexport interface LegionProfileHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildProfileWidgetUrl(props: ProfileWidgetProps): string {\n  const { baseUrl, theme = \"light\" } = props;\n\n  const url = new URL(\"/widget/profile\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n\n  // Append theming CSS variable params\n  const themingKeys = Object.keys(PROFILE_THEMING_PROP_TO_PARAM) as Array<\n    keyof ProfileThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(PROFILE_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionProfile – a React component that embeds the Legion Profile widget\n * via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionProfile } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionProfile\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionProfile = forwardRef<LegionProfileHandle, ProfileWidgetProps>(\n  function LegionProfile(props, ref) {\n    const {\n      theme = \"light\",\n      authToken,\n      width = \"400px\",\n      height = \"400px\",\n      className,\n      style,\n      onLoad,\n      onError,\n      baseUrl,\n      ...rest\n    } = props;\n\n    const iframeRef = useRef<HTMLIFrameElement>(null);\n\n    useImperativeHandle(\n      ref,\n      () => ({\n        refresh: () => {\n          const iframe = iframeRef.current;\n          if (iframe?.contentWindow) {\n            iframe.contentWindow.location.reload();\n          }\n        },\n      }),\n      []\n    );\n\n    const src = useMemo(\n      () => buildProfileWidgetUrl(props),\n      [\n        baseUrl,\n        theme,\n        ...Object.keys(PROFILE_THEMING_PROP_TO_PARAM).map(\n          (k) => rest[k as keyof typeof rest]\n        ),\n      ]\n    );\n\n    const handleLoad = useCallback(() => {\n      // Send auth token via postMessage\n      const iframe = iframeRef.current;\n      if (authToken && iframe?.contentWindow) {\n        iframe.contentWindow.postMessage(\n          { type: \"AUTH_TOKEN\", token: authToken },\n          baseUrl\n        );\n      }\n      onLoad?.({ widget: \"profile\", theme: theme ?? \"light\" });\n    }, [onLoad, theme, authToken, baseUrl]);\n\n    const handleError = useCallback(() => {\n      onError?.(\"Failed to load profile widget\");\n    }, [onError]);\n\n    return (\n      <div\n        className={className}\n        style={{ width, height, ...style }}\n        data-testid=\"legion-profile\"\n      >\n        <iframe\n          ref={iframeRef}\n          src={src}\n          title=\"Profile Widget\"\n          width=\"100%\"\n          height=\"100%\"\n          frameBorder=\"0\"\n          scrolling=\"no\"\n          onLoad={handleLoad}\n          onError={handleError}\n          style={{ border: \"none\" }}\n        />\n      </div>\n    );\n  }\n);\n\n","/**\n * Theming props for the Profile Edit Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface ProfileEditThemingProps {\n  /** Container background color */\n  profileEditBackgroundColor?: string;\n  /** Primary text color */\n  profileEditTextColor?: string;\n  /** Secondary text color */\n  profileEditSecondaryTextColor?: string;\n  /** Border color */\n  profileEditBorderColor?: string;\n  /** Container border radius, e.g. \"12px\" */\n  profileEditBorderRadius?: string;\n  /** Container padding */\n  profileEditPadding?: string;\n  /** Container box shadow */\n  profileEditShadow?: string;\n  /** Primary accent color */\n  profileEditPrimaryColor?: string;\n  /** Primary hover color */\n  profileEditPrimaryHover?: string;\n  /** Accent color */\n  profileEditAccentColor?: string;\n  /** Card background */\n  profileEditCardBg?: string;\n  /** Card border */\n  profileEditCardBorder?: string;\n  /** Card border radius */\n  profileEditCardRadius?: string;\n  /** Card box shadow */\n  profileEditCardShadow?: string;\n  /** Card padding */\n  profileEditCardPadding?: string;\n  /** Avatar size, e.g. \"80px\" */\n  profileEditAvatarSize?: string;\n  /** Avatar border radius */\n  profileEditAvatarRadius?: string;\n  /** Avatar border */\n  profileEditAvatarBorder?: string;\n  /** Avatar box shadow */\n  profileEditAvatarShadow?: string;\n  /** Button background */\n  profileEditButtonBg?: string;\n  /** Button hover background */\n  profileEditButtonHoverBg?: string;\n  /** Button text color */\n  profileEditButtonColor?: string;\n  /** Button border radius */\n  profileEditButtonRadius?: string;\n  /** Secondary button background */\n  profileEditButtonSecondaryBg?: string;\n  /** Secondary button text color */\n  profileEditButtonSecondaryColor?: string;\n  /** Input background */\n  profileEditInputBg?: string;\n  /** Input border */\n  profileEditInputBorder?: string;\n  /** Input focus border color */\n  profileEditInputFocusBorder?: string;\n  /** Input border radius */\n  profileEditInputRadius?: string;\n  /** Input text color */\n  profileEditInputText?: string;\n  /** Input placeholder color */\n  profileEditInputPlaceholder?: string;\n  /** Font family */\n  profileEditFontFamily?: string;\n  /** Name font size */\n  profileEditNameSize?: string;\n  /** Name font weight */\n  profileEditNameWeight?: string;\n  /** Label font size */\n  profileEditLabelSize?: string;\n  /** Divider color */\n  profileEditDividerColor?: string;\n  /** Transition duration, e.g. \"0.2s\" */\n  profileEditTransitionDuration?: string;\n}\n\n/**\n * Core configuration props for the Profile Edit Widget.\n */\nexport interface ProfileEditWidgetProps extends ProfileEditThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token for authenticated profile editing */\n  authToken?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget width CSS value. Default: \"600px\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"800px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the profile-edit widget iframe URL.\n */\nexport const PROFILE_EDIT_THEMING_PROP_TO_PARAM: Record<\n  keyof ProfileEditThemingProps,\n  string\n> = {\n  profileEditBackgroundColor: \"profile-background-color\",\n  profileEditTextColor: \"profile-text-color\",\n  profileEditSecondaryTextColor: \"profile-secondary-text-color\",\n  profileEditBorderColor: \"profile-border-color\",\n  profileEditBorderRadius: \"profile-border-radius\",\n  profileEditPadding: \"profile-padding\",\n  profileEditShadow: \"profile-shadow\",\n  profileEditPrimaryColor: \"profile-primary-color\",\n  profileEditPrimaryHover: \"profile-primary-hover\",\n  profileEditAccentColor: \"profile-accent-color\",\n  profileEditCardBg: \"profile-card-bg\",\n  profileEditCardBorder: \"profile-card-border\",\n  profileEditCardRadius: \"profile-card-radius\",\n  profileEditCardShadow: \"profile-card-shadow\",\n  profileEditCardPadding: \"profile-card-padding\",\n  profileEditAvatarSize: \"profile-avatar-size\",\n  profileEditAvatarRadius: \"profile-avatar-radius\",\n  profileEditAvatarBorder: \"profile-avatar-border\",\n  profileEditAvatarShadow: \"profile-avatar-shadow\",\n  profileEditButtonBg: \"profile-button-bg\",\n  profileEditButtonHoverBg: \"profile-button-hover-bg\",\n  profileEditButtonColor: \"profile-button-color\",\n  profileEditButtonRadius: \"profile-button-radius\",\n  profileEditButtonSecondaryBg: \"profile-button-secondary-bg\",\n  profileEditButtonSecondaryColor: \"profile-button-secondary-color\",\n  profileEditInputBg: \"profile-input-bg\",\n  profileEditInputBorder: \"profile-input-border\",\n  profileEditInputFocusBorder: \"profile-input-focus-border\",\n  profileEditInputRadius: \"profile-input-radius\",\n  profileEditInputText: \"profile-input-text\",\n  profileEditInputPlaceholder: \"profile-input-placeholder\",\n  profileEditFontFamily: \"profile-font-family\",\n  profileEditNameSize: \"profile-name-size\",\n  profileEditNameWeight: \"profile-name-weight\",\n  profileEditLabelSize: \"profile-label-size\",\n  profileEditDividerColor: \"profile-divider-color\",\n  profileEditTransitionDuration: \"profile-transition-duration\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type ProfileEditWidgetProps,\n  type ProfileEditThemingProps,\n  PROFILE_EDIT_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionProfileEdit for imperative control.\n */\nexport interface LegionProfileEditHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildProfileEditWidgetUrl(\n  props: ProfileEditWidgetProps\n): string {\n  const { baseUrl, theme = \"light\" } = props;\n\n  const url = new URL(\"/widget/profile-edit\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n\n  // Append theming CSS variable params\n  const themingKeys = Object.keys(\n    PROFILE_EDIT_THEMING_PROP_TO_PARAM\n  ) as Array<keyof ProfileEditThemingProps>;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(\n        PROFILE_EDIT_THEMING_PROP_TO_PARAM[key],\n        String(value)\n      );\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionProfileEdit – a React component that embeds the Legion Profile Edit\n * widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionProfileEdit } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionProfileEdit\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionProfileEdit = forwardRef<\n  LegionProfileEditHandle,\n  ProfileEditWidgetProps\n>(function LegionProfileEdit(props, ref) {\n  const {\n    theme = \"light\",\n    authToken,\n    width = \"600px\",\n    height = \"800px\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildProfileEditWidgetUrl(props),\n    [\n      baseUrl,\n      theme,\n      ...Object.keys(PROFILE_EDIT_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    // Send auth token via postMessage\n    const iframe = iframeRef.current;\n    if (authToken && iframe?.contentWindow) {\n      iframe.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"profile-edit\", theme: theme ?? \"light\" });\n  }, [onLoad, theme, authToken, baseUrl]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load profile edit widget\");\n  }, [onError]);\n\n  return (\n    <div\n      className={className}\n      style={{ width, height, ...style }}\n      data-testid=\"legion-profile-edit\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Profile Edit Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Notifications Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface NotificationsThemingProps {\n  /** Container background color */\n  notifBackgroundColor?: string;\n  /** Primary text color */\n  notifTextColor?: string;\n  /** Secondary text color */\n  notifSecondaryTextColor?: string;\n  /** Border color */\n  notifBorderColor?: string;\n  /** Container border radius */\n  notifBorderRadius?: string;\n  /** Container padding */\n  notifPadding?: string;\n  /** Container box shadow */\n  notifShadow?: string;\n  /** Primary color */\n  notifPrimaryColor?: string;\n  /** Primary hover color */\n  notifPrimaryHover?: string;\n  /** Accent color (CSS) */\n  notifAccentColor?: string;\n  /** Notification item background */\n  notifItemBg?: string;\n  /** Notification item hover background */\n  notifItemHoverBg?: string;\n  /** Notification item border */\n  notifItemBorder?: string;\n  /** Notification item border radius */\n  notifItemRadius?: string;\n  /** Notification item box shadow */\n  notifItemShadow?: string;\n  /** Notification item padding */\n  notifItemPadding?: string;\n  /** Notification item gap */\n  notifItemGap?: string;\n  /** Unread notification background */\n  notifUnreadBg?: string;\n  /** Unread notification border */\n  notifUnreadBorder?: string;\n  /** Unread indicator color */\n  notifUnreadIndicator?: string;\n  /** Avatar size */\n  notifAvatarSize?: string;\n  /** Avatar border radius */\n  notifAvatarRadius?: string;\n  /** Avatar border */\n  notifAvatarBorder?: string;\n  /** Icon size */\n  notifIconSize?: string;\n  /** Icon color */\n  notifIconColor?: string;\n  /** Badge background */\n  notifBadgeBg?: string;\n  /** Badge text color */\n  notifBadgeColor?: string;\n  /** Badge size */\n  notifBadgeSize?: string;\n  /** Font family */\n  notifFontFamily?: string;\n  /** Title font size */\n  notifTitleSize?: string;\n  /** Title font weight */\n  notifTitleWeight?: string;\n  /** Body text font size */\n  notifBodySize?: string;\n  /** Timestamp font size */\n  notifTimestampSize?: string;\n  /** Empty state icon color */\n  notifEmptyIconColor?: string;\n  /** Empty state text color */\n  notifEmptyTextColor?: string;\n  /** Empty state icon size */\n  notifEmptyIconSize?: string;\n  /** Divider color */\n  notifDividerColor?: string;\n  /** Header background */\n  notifHeaderBg?: string;\n  /** Header border */\n  notifHeaderBorder?: string;\n  /** Button background */\n  notifButtonBg?: string;\n  /** Button text color */\n  notifButtonColor?: string;\n  /** Button border radius */\n  notifButtonRadius?: string;\n  /** Transition duration */\n  notifTransitionDuration?: string;\n  /** Hover scale factor */\n  notifHoverScale?: string;\n  /** Loader/spinner color */\n  notifLoaderColor?: string;\n}\n\n/**\n * Core configuration props for the Notifications Widget.\n */\nexport interface NotificationsWidgetProps extends NotificationsThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT / API key for authenticated access (sent via postMessage, never in URL) */\n  authToken?: string;\n  /** User ID for notification lookup */\n  userId?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Maximum number of notifications. Default: 10 */\n  maxNotifications?: number;\n  /** Enable auto-refresh (every 30 s). Default: true */\n  autoRefresh?: boolean;\n  /** Title shown in empty state. Default: \"You're all caught up\" */\n  emptyTitle?: string;\n  /** Subtitle shown in empty state. Default: \"No notifications right now\" */\n  emptySubtitle?: string;\n  /** Accent color name. Default: \"blue\" (light) / \"gray\" (dark) */\n  accentColor?: string;\n  /** Icon for empty state. Default: \"bell\" */\n  emptyIcon?: \"bell\" | \"gift\" | \"activity\" | \"trophy\";\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"400px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the notifications widget iframe URL.\n */\nexport const NOTIF_THEMING_PROP_TO_PARAM: Record<\n  keyof NotificationsThemingProps,\n  string\n> = {\n  notifBackgroundColor: \"notif-background-color\",\n  notifTextColor: \"notif-text-color\",\n  notifSecondaryTextColor: \"notif-secondary-text-color\",\n  notifBorderColor: \"notif-border-color\",\n  notifBorderRadius: \"notif-border-radius\",\n  notifPadding: \"notif-padding\",\n  notifShadow: \"notif-shadow\",\n  notifPrimaryColor: \"notif-primary-color\",\n  notifPrimaryHover: \"notif-primary-hover\",\n  notifAccentColor: \"notif-accent-color\",\n  notifItemBg: \"notif-item-bg\",\n  notifItemHoverBg: \"notif-item-hover-bg\",\n  notifItemBorder: \"notif-item-border\",\n  notifItemRadius: \"notif-item-radius\",\n  notifItemShadow: \"notif-item-shadow\",\n  notifItemPadding: \"notif-item-padding\",\n  notifItemGap: \"notif-item-gap\",\n  notifUnreadBg: \"notif-unread-bg\",\n  notifUnreadBorder: \"notif-unread-border\",\n  notifUnreadIndicator: \"notif-unread-indicator\",\n  notifAvatarSize: \"notif-avatar-size\",\n  notifAvatarRadius: \"notif-avatar-radius\",\n  notifAvatarBorder: \"notif-avatar-border\",\n  notifIconSize: \"notif-icon-size\",\n  notifIconColor: \"notif-icon-color\",\n  notifBadgeBg: \"notif-badge-bg\",\n  notifBadgeColor: \"notif-badge-color\",\n  notifBadgeSize: \"notif-badge-size\",\n  notifFontFamily: \"notif-font-family\",\n  notifTitleSize: \"notif-title-size\",\n  notifTitleWeight: \"notif-title-weight\",\n  notifBodySize: \"notif-body-size\",\n  notifTimestampSize: \"notif-timestamp-size\",\n  notifEmptyIconColor: \"notif-empty-icon-color\",\n  notifEmptyTextColor: \"notif-empty-text-color\",\n  notifEmptyIconSize: \"notif-empty-icon-size\",\n  notifDividerColor: \"notif-divider-color\",\n  notifHeaderBg: \"notif-header-bg\",\n  notifHeaderBorder: \"notif-header-border\",\n  notifButtonBg: \"notif-button-bg\",\n  notifButtonColor: \"notif-button-color\",\n  notifButtonRadius: \"notif-button-radius\",\n  notifTransitionDuration: \"notif-transition-duration\",\n  notifHoverScale: \"notif-hover-scale\",\n  notifLoaderColor: \"notif-loader-color\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type NotificationsWidgetProps,\n  type NotificationsThemingProps,\n  NOTIF_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionNotifications for imperative control.\n */\nexport interface LegionNotificationsHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildNotificationsWidgetUrl(\n  props: NotificationsWidgetProps\n): string {\n  const {\n    baseUrl,\n    theme = \"light\",\n    maxNotifications = 10,\n    autoRefresh = true,\n    emptyTitle = \"You're all caught up\",\n    emptySubtitle = \"No notifications right now\",\n    accentColor,\n    emptyIcon = \"bell\",\n    userId,\n  } = props;\n\n  const url = new URL(\"/widget/notifications\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n  url.searchParams.set(\"maxNotifications\", String(maxNotifications));\n  url.searchParams.set(\"autoRefresh\", String(autoRefresh));\n\n  if (emptyTitle) url.searchParams.set(\"emptyTitle\", emptyTitle);\n  if (emptySubtitle) url.searchParams.set(\"emptySubtitle\", emptySubtitle);\n\n  // Default accent color depends on theme\n  const resolvedAccentColor =\n    accentColor ?? (theme === \"dark\" ? \"gray\" : \"blue\");\n  url.searchParams.set(\"accentColor\", resolvedAccentColor);\n\n  // Validate emptyIcon\n  const validIcons: Array<NotificationsWidgetProps[\"emptyIcon\"]> = [\n    \"bell\",\n    \"gift\",\n    \"activity\",\n    \"trophy\",\n  ];\n  const resolvedIcon = validIcons.includes(emptyIcon) ? emptyIcon : \"bell\";\n  url.searchParams.set(\"emptyIcon\", resolvedIcon!);\n\n  if (userId) {\n    url.searchParams.set(\"userId\", userId);\n  }\n\n  // NOTE: authToken is NEVER added to the URL – it's sent via postMessage\n\n  // Append theming CSS variable params\n  const themingKeys = Object.keys(NOTIF_THEMING_PROP_TO_PARAM) as Array<\n    keyof NotificationsThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(NOTIF_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionNotifications – a React component that embeds the Legion\n * Notifications widget (Supabase-backed) via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionNotifications } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionNotifications\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionNotifications = forwardRef<\n  LegionNotificationsHandle,\n  NotificationsWidgetProps\n>(function LegionNotifications(props, ref) {\n  const {\n    theme = \"light\",\n    authToken,\n    userId,\n    maxNotifications,\n    autoRefresh,\n    emptyTitle,\n    emptySubtitle,\n    accentColor,\n    emptyIcon,\n    width = \"100%\",\n    height = \"400px\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildNotificationsWidgetUrl(props),\n    [\n      baseUrl,\n      theme,\n      userId,\n      maxNotifications,\n      autoRefresh,\n      emptyTitle,\n      emptySubtitle,\n      accentColor,\n      emptyIcon,\n      ...Object.keys(NOTIF_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  // Send auth token via postMessage after iframe loads\n  const handleLoad = useCallback(() => {\n    if (authToken && iframeRef.current?.contentWindow) {\n      iframeRef.current.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"notifications\", theme });\n  }, [authToken, baseUrl, theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load notifications widget\");\n  }, [onError]);\n\n  const containerStyle: React.CSSProperties = {\n    display: \"block\",\n    width,\n    backgroundColor: \"transparent\",\n    ...style,\n  };\n\n  const iframeStyle: React.CSSProperties = {\n    border: \"none\",\n    borderRadius: \"8px\",\n    overflow: \"hidden\",\n    width: \"100%\",\n    height,\n  };\n\n  return (\n    <div className={className} style={containerStyle}>\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Notifications Widget\"\n        width=\"100%\"\n        loading=\"lazy\"\n        style={iframeStyle}\n        onLoad={handleLoad}\n        onError={handleError}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Saved Opportunities Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface SavedOpportunitiesThemingProps {\n  /** Primary color */\n  savedPrimaryColor?: string;\n  /** Accent color */\n  savedAccentColor?: string;\n  /** Container background color */\n  savedBackgroundColor?: string;\n  /** Card background */\n  savedCardBg?: string;\n  /** Card hover background */\n  savedCardHoverBg?: string;\n  /** Primary text color */\n  savedTextColor?: string;\n  /** Secondary text color */\n  savedSecondaryTextColor?: string;\n  /** Heading color */\n  savedHeadingColor?: string;\n  /** Border color */\n  savedBorderColor?: string;\n  /** Card border color */\n  savedCardBorder?: string;\n  /** Container border radius */\n  savedBorderRadius?: string;\n  /** Card border radius */\n  savedCardRadius?: string;\n  /** Button border radius */\n  savedButtonRadius?: string;\n  /** Container box shadow */\n  savedShadow?: string;\n  /** Card box shadow */\n  savedCardShadow?: string;\n  /** Container padding */\n  savedPadding?: string;\n  /** Card padding */\n  savedCardPadding?: string;\n  /** Gap between cards */\n  savedGap?: string;\n  /** Font family */\n  savedFontFamily?: string;\n  /** Title font size */\n  savedTitleSize?: string;\n  /** Body font size */\n  savedBodySize?: string;\n  /** Meta font size */\n  savedMetaSize?: string;\n  /** Title font weight */\n  savedTitleWeight?: string;\n  /** Button background */\n  savedButtonBg?: string;\n  /** Button text color */\n  savedButtonColor?: string;\n  /** Button hover background */\n  savedButtonHoverBg?: string;\n  /** Empty state icon color */\n  savedEmptyIconColor?: string;\n  /** Empty state text color */\n  savedEmptyTextColor?: string;\n  /** Transition duration */\n  savedTransitionDuration?: string;\n  /** Hover scale factor */\n  savedHoverScale?: string;\n}\n\n/**\n * Props for the LegionSavedOpportunities React component.\n */\nexport interface SavedOpportunitiesWidgetProps\n  extends SavedOpportunitiesThemingProps {\n  /** Base URL of your Legion deployment (required). */\n  baseUrl: string;\n  /** JWT / API key for authenticated access (sent via postMessage, never in URL). */\n  authToken?: string;\n  /** Theme preset. */\n  theme?: \"light\" | \"dark\";\n  /** Widget width (CSS value). */\n  width?: string;\n  /** Widget height (CSS value). */\n  height?: string;\n  /** CSS class applied to the outer container. */\n  className?: string;\n  /** Inline styles merged into the container. */\n  style?: React.CSSProperties;\n  /** Called when the widget iframe finishes loading. */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Called if the widget iframe fails to load. */\n  onError?: (message: string) => void;\n}\n\n/**\n * Maps camelCase theming prop names to their kebab-case CSS variable query param names.\n */\nexport const SAVED_THEMING_PROP_TO_PARAM: Record<\n  keyof SavedOpportunitiesThemingProps,\n  string\n> = {\n  savedPrimaryColor: \"saved-primary-color\",\n  savedAccentColor: \"saved-accent-color\",\n  savedBackgroundColor: \"saved-background-color\",\n  savedCardBg: \"saved-card-bg\",\n  savedCardHoverBg: \"saved-card-hover-bg\",\n  savedTextColor: \"saved-text-color\",\n  savedSecondaryTextColor: \"saved-secondary-text-color\",\n  savedHeadingColor: \"saved-heading-color\",\n  savedBorderColor: \"saved-border-color\",\n  savedCardBorder: \"saved-card-border\",\n  savedBorderRadius: \"saved-border-radius\",\n  savedCardRadius: \"saved-card-radius\",\n  savedButtonRadius: \"saved-button-radius\",\n  savedShadow: \"saved-shadow\",\n  savedCardShadow: \"saved-card-shadow\",\n  savedPadding: \"saved-padding\",\n  savedCardPadding: \"saved-card-padding\",\n  savedGap: \"saved-gap\",\n  savedFontFamily: \"saved-font-family\",\n  savedTitleSize: \"saved-title-size\",\n  savedBodySize: \"saved-body-size\",\n  savedMetaSize: \"saved-meta-size\",\n  savedTitleWeight: \"saved-title-weight\",\n  savedButtonBg: \"saved-button-bg\",\n  savedButtonColor: \"saved-button-color\",\n  savedButtonHoverBg: \"saved-button-hover-bg\",\n  savedEmptyIconColor: \"saved-empty-icon-color\",\n  savedEmptyTextColor: \"saved-empty-text-color\",\n  savedTransitionDuration: \"saved-transition-duration\",\n  savedHoverScale: \"saved-hover-scale\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type SavedOpportunitiesWidgetProps,\n  type SavedOpportunitiesThemingProps,\n  SAVED_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionSavedOpportunities for imperative control.\n */\nexport interface LegionSavedOpportunitiesHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildSavedOpportunitiesWidgetUrl(\n  props: SavedOpportunitiesWidgetProps\n): string {\n  const { baseUrl, theme = \"light\" } = props;\n\n  const url = new URL(\"/widget/saved-opportunities\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n\n  // Append theming CSS variable params\n  const themingKeys = Object.keys(SAVED_THEMING_PROP_TO_PARAM) as Array<\n    keyof SavedOpportunitiesThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(SAVED_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionSavedOpportunities – a React component that embeds the Legion\n * Saved Opportunities widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionSavedOpportunities } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionSavedOpportunities\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionSavedOpportunities = forwardRef<\n  LegionSavedOpportunitiesHandle,\n  SavedOpportunitiesWidgetProps\n>(function LegionSavedOpportunities(props, ref) {\n  const {\n    theme = \"light\",\n    authToken,\n    width = \"100%\",\n    height = \"400px\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildSavedOpportunitiesWidgetUrl(props),\n    [\n      baseUrl,\n      theme,\n      ...Object.keys(SAVED_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    // Send auth token via postMessage\n    const iframe = iframeRef.current;\n    if (authToken && iframe?.contentWindow) {\n      iframe.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"saved-opportunities\", theme: theme ?? \"light\" });\n  }, [onLoad, theme, authToken, baseUrl]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load saved opportunities widget\");\n  }, [onError]);\n\n  return (\n    <div\n      className={className}\n      style={{ width, height, ...style }}\n      data-testid=\"legion-saved-opportunities\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Saved Opportunities Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        loading=\"lazy\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Campaigns Carousel Widget.\n * Unlike other widgets, the carousel uses camelCase query parameters\n * rather than kebab-case CSS variable parameters.\n */\nexport interface CampaignsCarouselThemingProps {\n  /** Panel gradient start color, e.g. \"#1a1b5e\" */\n  panelStart?: string;\n  /** Panel gradient mid color */\n  panelMid?: string;\n  /** Panel gradient end color */\n  panelEnd?: string;\n  /** Panel box shadow */\n  panelShadow?: string;\n  /** Title font size, e.g. \"1.5rem\" */\n  titleSize?: string;\n  /** Description font size, e.g. \"0.9rem\" */\n  descriptionSize?: string;\n  /** Title text shadow */\n  titleShadow?: string;\n  /** Description text shadow */\n  descriptionShadow?: string;\n}\n\n/**\n * Core configuration props for the Campaigns Carousel Widget.\n */\nexport interface CampaignsCarouselWidgetProps\n  extends CampaignsCarouselThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** API key for authorization */\n  apiKey?: string;\n  /** Maximum number of campaigns to show (default: 5) */\n  maxCampaigns?: number;\n  /** Whether to show expiration dates (default: true) */\n  showExpiration?: boolean;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget height in pixels. Default: 280 */\n  height?: number;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: {\n    widget: string;\n    maxCampaigns: number;\n    theme: string;\n  }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the camelCase query\n * parameter names used by the campaigns carousel widget iframe URL.\n *\n * NOTE: Unlike other widgets, this uses camelCase params (not kebab-case).\n */\nexport const CAROUSEL_THEMING_PROP_TO_PARAM: Record<\n  keyof CampaignsCarouselThemingProps,\n  string\n> = {\n  panelStart: \"panelStart\",\n  panelMid: \"panelMid\",\n  panelEnd: \"panelEnd\",\n  panelShadow: \"panelShadow\",\n  titleSize: \"titleSize\",\n  descriptionSize: \"descriptionSize\",\n  titleShadow: \"titleShadow\",\n  descriptionShadow: \"descriptionShadow\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CampaignsCarouselWidgetProps,\n  type CampaignsCarouselThemingProps,\n  CAROUSEL_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCampaignsCarousel for imperative control.\n */\nexport interface LegionCampaignsCarouselHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildCampaignsCarouselWidgetUrl(\n  props: CampaignsCarouselWidgetProps\n): string {\n  const {\n    baseUrl,\n    apiKey,\n    maxCampaigns = 5,\n    showExpiration = true,\n    theme = \"light\",\n    height = 280,\n  } = props;\n\n  const url = new URL(\"/widget/campaigns-carousel\", baseUrl);\n  url.searchParams.set(\"maxCampaigns\", String(maxCampaigns));\n  url.searchParams.set(\"showExpiration\", String(showExpiration));\n  url.searchParams.set(\"theme\", theme);\n  url.searchParams.set(\"height\", String(height));\n\n  if (apiKey) {\n    url.searchParams.set(\"apiKey\", apiKey);\n  }\n\n  // Append theming params (camelCase, not kebab-case)\n  const themingKeys = Object.keys(CAROUSEL_THEMING_PROP_TO_PARAM) as Array<\n    keyof CampaignsCarouselThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(CAROUSEL_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCampaignsCarousel – a React component that embeds the Legion\n * Campaigns Carousel widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionCampaignsCarousel } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionCampaignsCarousel\n *       baseUrl=\"https://your-legion-domain.com\"\n *       apiKey=\"your-api-key\"\n *       maxCampaigns={5}\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionCampaignsCarousel = forwardRef<\n  LegionCampaignsCarouselHandle,\n  CampaignsCarouselWidgetProps\n>(function LegionCampaignsCarousel(props, ref) {\n  const {\n    maxCampaigns = 5,\n    showExpiration = true,\n    theme = \"light\",\n    height = 280,\n    apiKey,\n    width = \"100%\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildCampaignsCarouselWidgetUrl(props),\n    [\n      baseUrl,\n      apiKey,\n      maxCampaigns,\n      showExpiration,\n      theme,\n      height,\n      ...Object.keys(CAROUSEL_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    onLoad?.({ widget: \"campaigns-carousel\", maxCampaigns, theme });\n  }, [maxCampaigns, theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load campaigns carousel widget\");\n  }, [onError]);\n\n  const resolvedHeight = `${height}px`;\n\n  return (\n    <div\n      className={className}\n      style={{ width, height: resolvedHeight, ...style }}\n      data-testid=\"legion-campaigns-carousel\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Campaigns Carousel Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        loading=\"lazy\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Campaign Detail Widget.\n * These map to camelCase query params consumed by the iframe page.\n */\nexport interface CampaignDetailThemingProps {\n  /** Container background color */\n  detailBackgroundColor?: string;\n  /** Primary text color */\n  detailTextColor?: string;\n  /** Secondary text color */\n  detailSecondaryTextColor?: string;\n  /** Border color */\n  detailBorderColor?: string;\n  /** Container border radius, e.g. \"12px\" */\n  detailBorderRadius?: string;\n  /** Container padding */\n  detailPadding?: string;\n  /** Container box shadow */\n  detailShadow?: string;\n  /** Primary accent color (CTAs, progress, links) */\n  detailPrimaryColor?: string;\n  /** Primary hover color */\n  detailPrimaryHover?: string;\n  /** Hero overlay color */\n  detailHeroOverlay?: string;\n  /** Reward badge background */\n  detailRewardBg?: string;\n  /** Reward badge text color */\n  detailRewardColor?: string;\n  /** Task complete state color */\n  detailTaskCompleteColor?: string;\n  /** Title font size, e.g. \"1.5rem\" */\n  detailTitleSize?: string;\n  /** Title font weight */\n  detailTitleWeight?: string;\n  /** Body text font size */\n  detailBodySize?: string;\n  /** Font family */\n  detailFontFamily?: string;\n  /** Button border radius */\n  detailButtonRadius?: string;\n  /** Transition duration */\n  detailTransitionDuration?: string;\n}\n\n/**\n * Core configuration props for the Campaign Detail Widget.\n */\nexport interface CampaignDetailWidgetProps extends CampaignDetailThemingProps {\n  /** Campaign UUID (required) */\n  id: string;\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** API key / bearer token for authenticated mode */\n  apiKey?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget height CSS value. Default: \"auto\" */\n  height?: string | number;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; id: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n  /**\n   * Callback fired when the embedded view requests to close\n   * (user clicks the in-widget close affordance, or completes the flow).\n   * Hosts typically use this to close the modal that wraps the widget.\n   */\n  onClose?: () => void;\n  /**\n   * Callback fired when the user successfully claims / begins the campaign.\n   * Hosts can use this to refetch their campaign listing.\n   */\n  onClaim?: (detail: { id: string }) => void;\n  /**\n   * Callback fired when the embedded view requires the user to sign in\n   * (e.g. they click \"Claim Gift\" / \"Start Earning\" without a valid token).\n   * Hosts typically use this to open their own login UI, then push a fresh\n   * `auth-token` back to the widget.\n   */\n  onRequestLogin?: (detail: { id: string | null }) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the kebab-case query\n * parameter names used by the campaign detail widget iframe URL.\n */\nexport const CAMPAIGN_DETAIL_THEMING_PROP_TO_PARAM: Record<\n  keyof CampaignDetailThemingProps,\n  string\n> = {\n  detailBackgroundColor: \"detail-background-color\",\n  detailTextColor: \"detail-text-color\",\n  detailSecondaryTextColor: \"detail-secondary-text-color\",\n  detailBorderColor: \"detail-border-color\",\n  detailBorderRadius: \"detail-border-radius\",\n  detailPadding: \"detail-padding\",\n  detailShadow: \"detail-shadow\",\n  detailPrimaryColor: \"detail-primary-color\",\n  detailPrimaryHover: \"detail-primary-hover\",\n  detailHeroOverlay: \"detail-hero-overlay\",\n  detailRewardBg: \"detail-reward-bg\",\n  detailRewardColor: \"detail-reward-color\",\n  detailTaskCompleteColor: \"detail-task-complete-color\",\n  detailTitleSize: \"detail-title-size\",\n  detailTitleWeight: \"detail-title-weight\",\n  detailBodySize: \"detail-body-size\",\n  detailFontFamily: \"detail-font-family\",\n  detailButtonRadius: \"detail-button-radius\",\n  detailTransitionDuration: \"detail-transition-duration\",\n};\n","import React, {\n  useRef,\n  useCallback,\n  useMemo,\n  useEffect,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CampaignDetailWidgetProps,\n  type CampaignDetailThemingProps,\n  CAMPAIGN_DETAIL_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCampaignDetail for imperative control.\n */\nexport interface LegionCampaignDetailHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildCampaignDetailWidgetUrl(\n  props: CampaignDetailWidgetProps\n): string {\n  const { baseUrl, id, apiKey, theme = \"light\" } = props;\n\n  const url = new URL(\n    `/widget/campaign-detail/${encodeURIComponent(id)}`,\n    baseUrl\n  );\n  url.searchParams.set(\"theme\", theme);\n\n  if (apiKey) {\n    url.searchParams.set(\"apiKey\", apiKey);\n  }\n\n  const themingKeys = Object.keys(\n    CAMPAIGN_DETAIL_THEMING_PROP_TO_PARAM\n  ) as Array<keyof CampaignDetailThemingProps>;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(\n        CAMPAIGN_DETAIL_THEMING_PROP_TO_PARAM[key],\n        String(value)\n      );\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCampaignDetail – a React component that embeds the Legion\n * Campaign Detail widget via an iframe. Designed to be opened inside\n * a host-controlled modal: pair with `onClose` for dismissal.\n *\n * @example\n * ```tsx\n * import { LegionCampaignDetail } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   const [open, setOpen] = useState(false);\n *   const [campaignId, setCampaignId] = useState<string | null>(null);\n *\n *   return (\n *     <Modal opened={open} onClose={() => setOpen(false)}>\n *       {campaignId && (\n *         <LegionCampaignDetail\n *           id={campaignId}\n *           apiKey={token}\n *           baseUrl=\"https://your-legion-domain.com\"\n *           onClose={() => setOpen(false)}\n *         />\n *       )}\n *     </Modal>\n *   );\n * }\n * ```\n */\nexport const LegionCampaignDetail = forwardRef<\n  LegionCampaignDetailHandle,\n  CampaignDetailWidgetProps\n>(function LegionCampaignDetail(props, ref) {\n  const {\n    id,\n    apiKey,\n    theme = \"light\",\n    height = \"auto\",\n    width = \"100%\",\n    className,\n    style,\n    onLoad,\n    onError,\n    onClose,\n    onClaim,\n    onRequestLogin,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildCampaignDetailWidgetUrl(props),\n    [\n      baseUrl,\n      id,\n      apiKey,\n      theme,\n      ...Object.keys(CAMPAIGN_DETAIL_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  // Listen for postMessage events from the iframe.\n  useEffect(() => {\n    if (typeof window === \"undefined\") return;\n\n    let expectedOrigin: string | null = null;\n    try {\n      expectedOrigin = new URL(baseUrl).origin;\n    } catch {\n      expectedOrigin = null;\n    }\n\n    const handleMessage = (event: MessageEvent) => {\n      // Reject all messages if expectedOrigin could not be derived from\n      // baseUrl, otherwise a forged event from any page could trigger\n      // onClose / onClaim / onRequestLogin in the host.\n      if (!expectedOrigin || event.origin !== expectedOrigin) return;\n      const data = event.data;\n      if (!data || typeof data !== \"object\") return;\n      if (data.type === \"CAMPAIGN_DETAIL_CLOSE\") {\n        onClose?.();\n      } else if (data.type === \"CAMPAIGN_DETAIL_CLAIMED\" && data.id) {\n        onClaim?.({ id: String(data.id) });\n      } else if (data.type === \"CAMPAIGN_DETAIL_REQUEST_LOGIN\") {\n        onRequestLogin?.({\n          id: data.id ? String(data.id) : null,\n        });\n      }\n    };\n\n    window.addEventListener(\"message\", handleMessage);\n    return () => window.removeEventListener(\"message\", handleMessage);\n  }, [baseUrl, onClose, onClaim, onRequestLogin]);\n\n  const handleLoad = useCallback(() => {\n    const iframe = iframeRef.current;\n    if (iframe?.contentWindow && apiKey) {\n      iframe.contentWindow.postMessage(\n        { type: \"CONFIG\", apiKey, theme },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"campaign-detail\", id, theme });\n  }, [apiKey, baseUrl, id, theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load campaign detail widget\");\n  }, [onError]);\n\n  const resolvedHeight =\n    typeof height === \"number\" ? `${height}px` : height || \"auto\";\n  const isFullHeight = resolvedHeight === \"auto\" || resolvedHeight === \"100%\";\n\n  const containerStyle: React.CSSProperties = {\n    display: \"block\",\n    width,\n    backgroundColor: \"transparent\",\n    ...(isFullHeight ?\n      { height: \"100%\", minHeight: \"480px\" }\n    : { height: resolvedHeight }),\n    ...style,\n  };\n\n  const iframeStyle: React.CSSProperties = {\n    border: \"none\",\n    borderRadius: \"8px\",\n    overflow: \"hidden\",\n    width: \"100%\",\n    ...(isFullHeight ?\n      { height: \"100%\", minHeight: \"480px\" }\n    : { height: resolvedHeight }),\n  };\n\n  return (\n    <div\n      className={className}\n      style={containerStyle}\n      data-testid=\"legion-campaign-detail\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Campaign Detail Widget\"\n        width=\"100%\"\n        loading=\"lazy\"\n        style={iframeStyle}\n        onLoad={handleLoad}\n        onError={handleError}\n      />\n    </div>\n  );\n});\n","/**\n * Theming props for the Community Groups Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface CommunityGroupsThemingProps {\n  /** Primary color */\n  groupsPrimaryColor?: string;\n  /** Container background color */\n  groupsBackgroundColor?: string;\n  /** Primary text color */\n  groupsTextColor?: string;\n  /** Secondary text color */\n  groupsSecondaryTextColor?: string;\n  /** Border color */\n  groupsBorderColor?: string;\n  /** Card background */\n  groupsCardBg?: string;\n  /** Card border radius */\n  groupsCardRadius?: string;\n  /** Card box shadow */\n  groupsCardShadow?: string;\n  /** Card hover box shadow */\n  groupsCardHoverShadow?: string;\n  /** Card padding */\n  groupsCardPadding?: string;\n  /** Avatar size */\n  groupsAvatarSize?: string;\n  /** Avatar border radius */\n  groupsAvatarRadius?: string;\n  /** Group name font size */\n  groupsNameSize?: string;\n  /** Group name font weight */\n  groupsNameWeight?: string;\n  /** Meta text font size */\n  groupsMetaSize?: string;\n  /** Font family */\n  groupsFontFamily?: string;\n  /** Grid gap */\n  groupsGridGap?: string;\n  /** Transition duration */\n  groupsTransitionDuration?: string;\n  /** Hover scale factor */\n  groupsHoverScale?: string;\n}\n\n/**\n * Core configuration props for the Community Groups Widget.\n */\nexport interface CommunityGroupsWidgetProps\n  extends CommunityGroupsThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token for authenticated features, sent via postMessage */\n  authToken?: string;\n  /** Number of groups to display (1-20). Default: 6 */\n  count?: number;\n  /** Layout mode. Default: \"grid\" */\n  layout?: \"grid\" | \"list\";\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Show \"View all\" link. Default: true */\n  showViewAll?: boolean;\n  /** Community URL prefix. Default: \"/community\" */\n  communityUrl?: string;\n  /** URL for the \"View all\" link. Default: \"{communityUrl}/groups\" */\n  viewAllUrl?: string;\n  /** Sort order. Default: \"trending\" */\n  sortBy?: \"trending\" | \"popular\" | \"recent\";\n  /** Widget height CSS value. Default: \"auto\" */\n  height?: string;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; count: number; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to kebab-case query params.\n */\nexport const GROUPS_THEMING_PROP_TO_PARAM: Record<\n  keyof CommunityGroupsThemingProps,\n  string\n> = {\n  groupsPrimaryColor: \"groups-primary-color\",\n  groupsBackgroundColor: \"groups-background-color\",\n  groupsTextColor: \"groups-text-color\",\n  groupsSecondaryTextColor: \"groups-secondary-text-color\",\n  groupsBorderColor: \"groups-border-color\",\n  groupsCardBg: \"groups-card-bg\",\n  groupsCardRadius: \"groups-card-radius\",\n  groupsCardShadow: \"groups-card-shadow\",\n  groupsCardHoverShadow: \"groups-card-hover-shadow\",\n  groupsCardPadding: \"groups-card-padding\",\n  groupsAvatarSize: \"groups-avatar-size\",\n  groupsAvatarRadius: \"groups-avatar-radius\",\n  groupsNameSize: \"groups-name-size\",\n  groupsNameWeight: \"groups-name-weight\",\n  groupsMetaSize: \"groups-meta-size\",\n  groupsFontFamily: \"groups-font-family\",\n  groupsGridGap: \"groups-grid-gap\",\n  groupsTransitionDuration: \"groups-transition-duration\",\n  groupsHoverScale: \"groups-hover-scale\",\n};\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CommunityGroupsWidgetProps,\n  type CommunityGroupsThemingProps,\n  GROUPS_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCommunityGroups for imperative control.\n */\nexport interface LegionCommunityGroupsHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildCommunityGroupsWidgetUrl(\n  props: CommunityGroupsWidgetProps\n): string {\n  const {\n    baseUrl,\n    count = 6,\n    layout = \"grid\",\n    theme = \"light\",\n    showViewAll = true,\n    communityUrl = \"/community\",\n    viewAllUrl,\n    sortBy = \"trending\",\n  } = props;\n\n  const url = new URL(\"/widget/community-groups\", baseUrl);\n  url.searchParams.set(\"count\", String(Math.min(Math.max(count, 1), 20)));\n  url.searchParams.set(\"layout\", layout);\n  url.searchParams.set(\"theme\", theme);\n  url.searchParams.set(\"showViewAll\", String(showViewAll));\n  url.searchParams.set(\"communityUrl\", communityUrl);\n  url.searchParams.set(\"viewAllUrl\", viewAllUrl || `${communityUrl}/groups`);\n  url.searchParams.set(\"sortBy\", sortBy);\n\n  // Append theming params\n  const themingKeys = Object.keys(GROUPS_THEMING_PROP_TO_PARAM) as Array<\n    keyof CommunityGroupsThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(GROUPS_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCommunityGroups – a React component that embeds the Legion\n * Community Groups widget via an iframe.\n */\nexport const LegionCommunityGroups = forwardRef<\n  LegionCommunityGroupsHandle,\n  CommunityGroupsWidgetProps\n>(function LegionCommunityGroups(props, ref) {\n  const {\n    count = 6,\n    layout = \"grid\",\n    theme = \"light\",\n    showViewAll,\n    communityUrl,\n    viewAllUrl,\n    sortBy,\n    height = \"auto\",\n    width = \"100%\",\n    className,\n    style,\n    onLoad,\n    onError,\n    authToken,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildCommunityGroupsWidgetUrl(props),\n    [\n      baseUrl,\n      count,\n      layout,\n      theme,\n      showViewAll,\n      communityUrl,\n      viewAllUrl,\n      sortBy,\n      ...Object.keys(GROUPS_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    const iframe = iframeRef.current;\n    if (authToken && iframe?.contentWindow) {\n      iframe.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({\n      widget: \"community-groups\",\n      count: Math.min(Math.max(count, 1), 20),\n      theme,\n    });\n  }, [authToken, baseUrl, count, theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load community groups widget\");\n  }, [onError]);\n\n  const resolvedHeight = height === \"auto\" ? \"200px\" : height;\n\n  return (\n    <div\n      className={className}\n      style={{ width, height: resolvedHeight, ...style }}\n      data-testid=\"legion-community-groups\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Community Groups Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        loading=\"lazy\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n","/**\n * Theming props for the Community Header Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface CommunityHeaderThemingProps {\n  /** Primary color */\n  headerPrimaryColor?: string;\n  /** Container background color */\n  headerBackgroundColor?: string;\n  /** Primary text color */\n  headerTextColor?: string;\n  /** Secondary text color */\n  headerSecondaryTextColor?: string;\n  /** Border color */\n  headerBorderColor?: string;\n  /** Search input background */\n  headerSearchBg?: string;\n  /** Search input border */\n  headerSearchBorder?: string;\n  /** Search input border radius */\n  headerSearchRadius?: string;\n  /** Stat card background */\n  headerStatBg?: string;\n  /** Stat card border radius */\n  headerStatRadius?: string;\n  /** Font family */\n  headerFontFamily?: string;\n  /** Title font size */\n  headerTitleSize?: string;\n  /** Title font weight */\n  headerTitleWeight?: string;\n  /** Stat value font size */\n  headerStatSize?: string;\n  /** Stat label font size */\n  headerStatLabelSize?: string;\n  /** Container padding */\n  headerPadding?: string;\n  /** Gap between elements */\n  headerGap?: string;\n  /** Transition duration */\n  headerTransitionDuration?: string;\n}\n\n/**\n * Core configuration props for the Community Header Widget.\n */\nexport interface CommunityHeaderWidgetProps\n  extends CommunityHeaderThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** Community title. Default: \"Community\" */\n  title?: string;\n  /** Show search bar. Default: true */\n  showSearch?: boolean;\n  /** Show stats section. Default: true */\n  showStats?: boolean;\n  /** Show online count. Default: true */\n  showOnline?: boolean;\n  /** Community URL prefix */\n  communityUrl?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget height CSS value. Default: \"auto\" */\n  height?: string;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to kebab-case query params.\n */\nexport const HEADER_THEMING_PROP_TO_PARAM: Record<\n  keyof CommunityHeaderThemingProps,\n  string\n> = {\n  headerPrimaryColor: \"header-primary-color\",\n  headerBackgroundColor: \"header-background-color\",\n  headerTextColor: \"header-text-color\",\n  headerSecondaryTextColor: \"header-secondary-text-color\",\n  headerBorderColor: \"header-border-color\",\n  headerSearchBg: \"header-search-bg\",\n  headerSearchBorder: \"header-search-border\",\n  headerSearchRadius: \"header-search-radius\",\n  headerStatBg: \"header-stat-bg\",\n  headerStatRadius: \"header-stat-radius\",\n  headerFontFamily: \"header-font-family\",\n  headerTitleSize: \"header-title-size\",\n  headerTitleWeight: \"header-title-weight\",\n  headerStatSize: \"header-stat-size\",\n  headerStatLabelSize: \"header-stat-label-size\",\n  headerPadding: \"header-padding\",\n  headerGap: \"header-gap\",\n  headerTransitionDuration: \"header-transition-duration\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CommunityHeaderWidgetProps,\n  type CommunityHeaderThemingProps,\n  HEADER_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCommunityHeader for imperative control.\n */\nexport interface LegionCommunityHeaderHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildCommunityHeaderWidgetUrl(\n  props: CommunityHeaderWidgetProps\n): string {\n  const {\n    baseUrl,\n    title = \"Community\",\n    showSearch = true,\n    showStats = true,\n    showOnline = true,\n    communityUrl,\n    theme = \"light\",\n  } = props;\n\n  const url = new URL(\"/widget/community-header\", baseUrl);\n  url.searchParams.set(\"title\", title);\n  url.searchParams.set(\"showSearch\", String(showSearch));\n  url.searchParams.set(\"showStats\", String(showStats));\n  url.searchParams.set(\"showOnline\", String(showOnline));\n  url.searchParams.set(\"theme\", theme);\n\n  if (communityUrl) {\n    url.searchParams.set(\"communityUrl\", communityUrl);\n  }\n\n  // Append theming params\n  const themingKeys = Object.keys(HEADER_THEMING_PROP_TO_PARAM) as Array<\n    keyof CommunityHeaderThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(HEADER_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCommunityHeader – a React component that embeds the Legion\n * Community Header widget via an iframe.\n */\nexport const LegionCommunityHeader = forwardRef<\n  LegionCommunityHeaderHandle,\n  CommunityHeaderWidgetProps\n>(function LegionCommunityHeader(props, ref) {\n  const {\n    title = \"Community\",\n    showSearch,\n    showStats,\n    showOnline,\n    communityUrl,\n    theme = \"light\",\n    height = \"auto\",\n    width = \"100%\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildCommunityHeaderWidgetUrl(props),\n    [\n      baseUrl, title, showSearch, showStats, showOnline, communityUrl, theme,\n      ...Object.keys(HEADER_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    onLoad?.({ widget: \"community-header\", theme });\n  }, [theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load community header widget\");\n  }, [onError]);\n\n  const resolvedHeight = height === \"auto\" ? \"120px\" : height;\n\n  return (\n    <div\n      className={className}\n      style={{ width, height: resolvedHeight, ...style }}\n      data-testid=\"legion-community-header\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Community Header Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        loading=\"lazy\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Community Posts Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface CommunityPostsThemingProps {\n  /** Primary color */\n  postsPrimaryColor?: string;\n  /** Container background color */\n  postsBackgroundColor?: string;\n  /** Primary text color */\n  postsTextColor?: string;\n  /** Secondary text color */\n  postsSecondaryTextColor?: string;\n  /** Border color */\n  postsBorderColor?: string;\n  /** Card background */\n  postsCardBg?: string;\n  /** Card border radius */\n  postsCardRadius?: string;\n  /** Card box shadow */\n  postsCardShadow?: string;\n  /** Card padding */\n  postsCardPadding?: string;\n  /** Avatar size */\n  postsAvatarSize?: string;\n  /** Avatar border radius */\n  postsAvatarRadius?: string;\n  /** Post title font size */\n  postsTitleSize?: string;\n  /** Post title font weight */\n  postsTitleWeight?: string;\n  /** Post body font size */\n  postsBodySize?: string;\n  /** Meta text font size */\n  postsMetaSize?: string;\n  /** Font family */\n  postsFontFamily?: string;\n  /** Gap between posts */\n  postsGap?: string;\n  /** Tag background */\n  postsTagBg?: string;\n  /** Tag text color */\n  postsTagColor?: string;\n  /** Tag border radius */\n  postsTagRadius?: string;\n  /** Action button background */\n  postsActionBg?: string;\n  /** Action button text color */\n  postsActionColor?: string;\n  /** Action button hover background */\n  postsActionHoverBg?: string;\n  /** Like button color */\n  postsLikeColor?: string;\n  /** Transition duration */\n  postsTransitionDuration?: string;\n}\n\n/**\n * Core configuration props for the Community Posts Widget.\n */\nexport interface CommunityPostsWidgetProps extends CommunityPostsThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token for authenticated features */\n  authToken?: string;\n  /** Number of posts per page (5-50). Default: 10 */\n  pageSize?: number;\n  /** Filter mode. Default: \"recent\" */\n  filter?: \"recent\" | \"popular\" | \"unanswered\";\n  /** Channel/group ID to filter posts */\n  channelId?: string;\n  /** Show filter bar. Default: true */\n  showFilters?: boolean;\n  /** Show action buttons (like, comment). Default: true */\n  showActions?: boolean;\n  /** Current user ID */\n  userId?: string;\n  /** Current username */\n  username?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget height CSS value. Default: \"800px\" */\n  height?: string;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to kebab-case query params.\n */\nexport const POSTS_THEMING_PROP_TO_PARAM: Record<\n  keyof CommunityPostsThemingProps,\n  string\n> = {\n  postsPrimaryColor: \"posts-primary-color\",\n  postsBackgroundColor: \"posts-background-color\",\n  postsTextColor: \"posts-text-color\",\n  postsSecondaryTextColor: \"posts-secondary-text-color\",\n  postsBorderColor: \"posts-border-color\",\n  postsCardBg: \"posts-card-bg\",\n  postsCardRadius: \"posts-card-radius\",\n  postsCardShadow: \"posts-card-shadow\",\n  postsCardPadding: \"posts-card-padding\",\n  postsAvatarSize: \"posts-avatar-size\",\n  postsAvatarRadius: \"posts-avatar-radius\",\n  postsTitleSize: \"posts-title-size\",\n  postsTitleWeight: \"posts-title-weight\",\n  postsBodySize: \"posts-body-size\",\n  postsMetaSize: \"posts-meta-size\",\n  postsFontFamily: \"posts-font-family\",\n  postsGap: \"posts-gap\",\n  postsTagBg: \"posts-tag-bg\",\n  postsTagColor: \"posts-tag-color\",\n  postsTagRadius: \"posts-tag-radius\",\n  postsActionBg: \"posts-action-bg\",\n  postsActionColor: \"posts-action-color\",\n  postsActionHoverBg: \"posts-action-hover-bg\",\n  postsLikeColor: \"posts-like-color\",\n  postsTransitionDuration: \"posts-transition-duration\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CommunityPostsWidgetProps,\n  type CommunityPostsThemingProps,\n  POSTS_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCommunityPosts for imperative control.\n */\nexport interface LegionCommunityPostsHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildCommunityPostsWidgetUrl(\n  props: CommunityPostsWidgetProps\n): string {\n  const {\n    baseUrl,\n    pageSize = 10,\n    filter = \"recent\",\n    channelId,\n    showFilters = true,\n    showActions = true,\n    userId,\n    username,\n    theme = \"light\",\n  } = props;\n\n  const url = new URL(\"/widget/community-posts\", baseUrl);\n  url.searchParams.set(\"pageSize\", String(Math.min(Math.max(pageSize, 5), 50)));\n  url.searchParams.set(\"filter\", filter);\n  url.searchParams.set(\"showFilters\", String(showFilters));\n  url.searchParams.set(\"showActions\", String(showActions));\n  url.searchParams.set(\"theme\", theme);\n\n  if (channelId) url.searchParams.set(\"channelId\", channelId);\n  if (userId) url.searchParams.set(\"userId\", userId);\n  if (username) url.searchParams.set(\"username\", username);\n\n  // Append theming params\n  const themingKeys = Object.keys(POSTS_THEMING_PROP_TO_PARAM) as Array<\n    keyof CommunityPostsThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(POSTS_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCommunityPosts – a React component that embeds the Legion\n * Community Posts widget via an iframe.\n *\n * Supports postMessage authentication for features like liking and commenting.\n */\nexport const LegionCommunityPosts = forwardRef<\n  LegionCommunityPostsHandle,\n  CommunityPostsWidgetProps\n>(function LegionCommunityPosts(props, ref) {\n  const {\n    pageSize = 10,\n    filter,\n    channelId,\n    showFilters,\n    showActions,\n    userId,\n    username,\n    authToken,\n    theme = \"light\",\n    height = \"800px\",\n    width = \"100%\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildCommunityPostsWidgetUrl(props),\n    [\n      baseUrl, pageSize, filter, channelId, showFilters, showActions,\n      userId, username, theme,\n      ...Object.keys(POSTS_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    // Send auth token via postMessage\n    const iframe = iframeRef.current;\n    if (authToken && iframe?.contentWindow) {\n      iframe.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"community-posts\", theme: theme ?? \"light\" });\n  }, [onLoad, theme, authToken, baseUrl]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load community posts widget\");\n  }, [onError]);\n\n  return (\n    <div\n      className={className}\n      style={{ width, height, ...style }}\n      data-testid=\"legion-community-posts\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Community Posts Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        loading=\"lazy\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n\n","/**\n * Theming props for the Community Sidebar Widget.\n * These map to CSS custom properties used internally.\n */\nexport interface CommunitySidebarThemingProps {\n  /** Primary color */\n  sidebarPrimaryColor?: string;\n  /** Container background color */\n  sidebarBackgroundColor?: string;\n  /** Primary text color */\n  sidebarTextColor?: string;\n  /** Secondary text color */\n  sidebarSecondaryTextColor?: string;\n  /** Border color */\n  sidebarBorderColor?: string;\n  /** Card background */\n  sidebarCardBg?: string;\n  /** Card border radius */\n  sidebarCardRadius?: string;\n  /** Card box shadow */\n  sidebarCardShadow?: string;\n  /** Link color */\n  sidebarLinkColor?: string;\n  /** Link hover color */\n  sidebarLinkHoverColor?: string;\n  /** Icon color */\n  sidebarIconColor?: string;\n  /** Section border radius */\n  sidebarSectionRadius?: string;\n  /** Section background */\n  sidebarSectionBg?: string;\n  /** Font family */\n  sidebarFontFamily?: string;\n  /** Title font size */\n  sidebarTitleSize?: string;\n  /** Title font weight */\n  sidebarTitleWeight?: string;\n  /** Link font size */\n  sidebarLinkSize?: string;\n  /** Container padding */\n  sidebarPadding?: string;\n  /** Gap between elements */\n  sidebarGap?: string;\n  /** Transition duration */\n  sidebarTransitionDuration?: string;\n}\n\n/**\n * Core configuration props for the Community Sidebar Widget.\n */\nexport interface CommunitySidebarWidgetProps\n  extends CommunitySidebarThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** Sidebar title. Default: \"Getting Started\" */\n  title?: string;\n  /** Show community guidelines link. Default: true */\n  showGuidelines?: boolean;\n  /** Show FAQs link. Default: true */\n  showFaqs?: boolean;\n  /** Show tutorials link. Default: true */\n  showTutorials?: boolean;\n  /** Show search links section. Default: true */\n  showSearchLinks?: boolean;\n  /** Community URL prefix. Default: \"/community\" */\n  communityUrl?: string;\n  /** Guidelines page URL. Default: \"/guidelines\" */\n  guidelinesUrl?: string;\n  /** FAQs page URL. Default: \"/faqs\" */\n  faqsUrl?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /** Widget height CSS value. Default: \"auto\" */\n  height?: string;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to kebab-case query params.\n */\nexport const SIDEBAR_THEMING_PROP_TO_PARAM: Record<\n  keyof CommunitySidebarThemingProps,\n  string\n> = {\n  sidebarPrimaryColor: \"sidebar-primary-color\",\n  sidebarBackgroundColor: \"sidebar-background-color\",\n  sidebarTextColor: \"sidebar-text-color\",\n  sidebarSecondaryTextColor: \"sidebar-secondary-text-color\",\n  sidebarBorderColor: \"sidebar-border-color\",\n  sidebarCardBg: \"sidebar-card-bg\",\n  sidebarCardRadius: \"sidebar-card-radius\",\n  sidebarCardShadow: \"sidebar-card-shadow\",\n  sidebarLinkColor: \"sidebar-link-color\",\n  sidebarLinkHoverColor: \"sidebar-link-hover-color\",\n  sidebarIconColor: \"sidebar-icon-color\",\n  sidebarSectionRadius: \"sidebar-section-radius\",\n  sidebarSectionBg: \"sidebar-section-bg\",\n  sidebarFontFamily: \"sidebar-font-family\",\n  sidebarTitleSize: \"sidebar-title-size\",\n  sidebarTitleWeight: \"sidebar-title-weight\",\n  sidebarLinkSize: \"sidebar-link-size\",\n  sidebarPadding: \"sidebar-padding\",\n  sidebarGap: \"sidebar-gap\",\n  sidebarTransitionDuration: \"sidebar-transition-duration\",\n};\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type CommunitySidebarWidgetProps,\n  type CommunitySidebarThemingProps,\n  SIDEBAR_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionCommunitySidebar for imperative control.\n */\nexport interface LegionCommunitySidebarHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildCommunitySidebarWidgetUrl(\n  props: CommunitySidebarWidgetProps\n): string {\n  const {\n    baseUrl,\n    title = \"Getting Started\",\n    showGuidelines = true,\n    showFaqs = true,\n    showTutorials = true,\n    showSearchLinks = true,\n    communityUrl = \"/community\",\n    guidelinesUrl = \"/guidelines\",\n    faqsUrl = \"/faqs\",\n    theme = \"light\",\n  } = props;\n\n  const url = new URL(\"/widget/community-sidebar\", baseUrl);\n  url.searchParams.set(\"title\", title);\n  url.searchParams.set(\"showGuidelines\", String(showGuidelines));\n  url.searchParams.set(\"showFaqs\", String(showFaqs));\n  url.searchParams.set(\"showTutorials\", String(showTutorials));\n  url.searchParams.set(\"showSearchLinks\", String(showSearchLinks));\n  url.searchParams.set(\"communityUrl\", communityUrl);\n  url.searchParams.set(\"guidelinesUrl\", guidelinesUrl);\n  url.searchParams.set(\"faqsUrl\", faqsUrl);\n  url.searchParams.set(\"theme\", theme);\n\n  // Append theming params\n  const themingKeys = Object.keys(SIDEBAR_THEMING_PROP_TO_PARAM) as Array<\n    keyof CommunitySidebarThemingProps\n  >;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(SIDEBAR_THEMING_PROP_TO_PARAM[key], String(value));\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionCommunitySidebar – a React component that embeds the Legion\n * Community Sidebar widget via an iframe.\n */\nexport const LegionCommunitySidebar = forwardRef<\n  LegionCommunitySidebarHandle,\n  CommunitySidebarWidgetProps\n>(function LegionCommunitySidebar(props, ref) {\n  const {\n    title = \"Getting Started\",\n    showGuidelines,\n    showFaqs,\n    showTutorials,\n    showSearchLinks,\n    communityUrl,\n    guidelinesUrl,\n    faqsUrl,\n    theme = \"light\",\n    height = \"auto\",\n    width = \"100%\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildCommunitySidebarWidgetUrl(props),\n    [\n      baseUrl, title, showGuidelines, showFaqs, showTutorials, showSearchLinks,\n      communityUrl, guidelinesUrl, faqsUrl, theme,\n      ...Object.keys(SIDEBAR_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    onLoad?.({ widget: \"community-sidebar\", theme });\n  }, [theme, onLoad]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load community sidebar widget\");\n  }, [onError]);\n\n  const resolvedHeight = height === \"auto\" ? \"400px\" : height;\n\n  return (\n    <div\n      className={className}\n      style={{ width, height: resolvedHeight, ...style }}\n      data-testid=\"legion-community-sidebar\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Community Sidebar Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        loading=\"lazy\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport { type PioneerPointStatusWidgetProps } from \"./types\";\n\n/**\n * Ref handle exposed by LegionPioneerPointStatus for imperative control.\n */\nexport interface LegionPioneerPointStatusHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildPioneerPointStatusWidgetUrl(\n  props: PioneerPointStatusWidgetProps\n): string {\n  const { baseUrl, theme = \"light\" } = props;\n\n  const url = new URL(\"/widget/pioneer-point-status\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n\n  return url.toString();\n}\n\n/**\n * LegionPioneerPointStatus – a React component that embeds the Legion\n * Pioneer Point Status widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionPioneerPointStatus } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionPioneerPointStatus\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionPioneerPointStatus = forwardRef<\n  LegionPioneerPointStatusHandle,\n  PioneerPointStatusWidgetProps\n>(function LegionPioneerPointStatus(props, ref) {\n  const {\n    theme = \"light\",\n    authToken,\n    width = \"100%\",\n    height = \"180px\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildPioneerPointStatusWidgetUrl(props),\n    [baseUrl, theme]\n  );\n\n  const handleLoad = useCallback(() => {\n    const iframe = iframeRef.current;\n    if (authToken && iframe?.contentWindow) {\n      iframe.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"pioneer-point-status\", theme });\n  }, [onLoad, theme, authToken, baseUrl]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load pioneer point status widget\");\n  }, [onError]);\n\n  return (\n    <div\n      className={className}\n      style={{ width, height, ...style }}\n      data-testid=\"legion-pioneer-point-status\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Pioneer Point Status Widget\"\n        width=\"100%\"\n        height=\"100%\"\n        frameBorder=\"0\"\n        scrolling=\"no\"\n        onLoad={handleLoad}\n        onError={handleError}\n        style={{ border: \"none\" }}\n      />\n    </div>\n  );\n});\n","/**\n * Theming props for the Points History Widget.\n * These map 1:1 to the camelCase URL query params the host page reads.\n */\nexport interface PointsHistoryThemingProps {\n  /** Header row background color */\n  pointsHistoryHeaderBg?: string;\n  /** Header row text color */\n  pointsHistoryHeaderTextColor?: string;\n  /** Alternate row background color (zebra striping) */\n  pointsHistoryAltRowBg?: string;\n  /** Body text color */\n  pointsHistoryTextColor?: string;\n  /** Row border color */\n  pointsHistoryBorderColor?: string;\n  /** Active page button background color */\n  pointsHistoryPaginationActiveBg?: string;\n  /** Active page button text color */\n  pointsHistoryPaginationActiveColor?: string;\n  /** Container font family */\n  pointsHistoryFontFamily?: string;\n  /** Title font size, e.g. \"24px\" */\n  pointsHistoryTitleSize?: string;\n  /** Cell font size, e.g. \"14px\" */\n  pointsHistoryCellSize?: string;\n}\n\n/**\n * Core configuration props for the Points History Widget.\n */\nexport interface PointsHistoryWidgetProps extends PointsHistoryThemingProps {\n  /** Base URL of the Legion application (required) */\n  baseUrl: string;\n  /** JWT auth token (sent via postMessage, never via URL) */\n  authToken?: string;\n  /** Theme preset. Default: \"light\" */\n  theme?: \"light\" | \"dark\";\n  /**\n   * Show a close (✕) button that emits a `CLOSE_WIDGET` postMessage to the\n   * parent window when clicked. Default: false.\n   */\n  showClose?: boolean;\n  /** Widget width CSS value. Default: \"100%\" */\n  width?: string;\n  /** Widget height CSS value. Default: \"600px\" */\n  height?: string;\n  /** Additional CSS class name for the container */\n  className?: string;\n  /** Additional inline styles for the container */\n  style?: React.CSSProperties;\n  /** Callback when the widget iframe has loaded */\n  onLoad?: (detail: { widget: string; theme: string }) => void;\n  /** Callback when the widget iframe fails to load */\n  onError?: (message: string) => void;\n}\n\n/**\n * Mapping from camelCase theming prop names to the camelCase query\n * parameter names the host points-history page reads from\n * `useSearchParams()`.\n */\nexport const POINTS_HISTORY_THEMING_PROP_TO_PARAM: Record<\n  keyof PointsHistoryThemingProps,\n  string\n> = {\n  pointsHistoryHeaderBg: \"headerBg\",\n  pointsHistoryHeaderTextColor: \"headerTextColor\",\n  pointsHistoryAltRowBg: \"altRowBg\",\n  pointsHistoryTextColor: \"textColor\",\n  pointsHistoryBorderColor: \"borderColor\",\n  pointsHistoryPaginationActiveBg: \"paginationActiveBg\",\n  pointsHistoryPaginationActiveColor: \"paginationActiveColor\",\n  pointsHistoryFontFamily: \"fontFamily\",\n  pointsHistoryTitleSize: \"titleSize\",\n  pointsHistoryCellSize: \"cellSize\",\n};\n","import {\n  useRef,\n  useCallback,\n  useMemo,\n  forwardRef,\n  useImperativeHandle,\n} from \"react\";\nimport {\n  type PointsHistoryWidgetProps,\n  type PointsHistoryThemingProps,\n  POINTS_HISTORY_THEMING_PROP_TO_PARAM,\n} from \"./types\";\n\n/**\n * Ref handle exposed by LegionPointsHistory for imperative control.\n */\nexport interface LegionPointsHistoryHandle {\n  /** Reload the widget iframe */\n  refresh: () => void;\n}\n\n/**\n * Build the iframe src URL from widget props.\n */\nexport function buildPointsHistoryWidgetUrl(\n  props: PointsHistoryWidgetProps\n): string {\n  const { baseUrl, theme = \"light\", showClose } = props;\n\n  const url = new URL(\"/widget/points-history\", baseUrl);\n  url.searchParams.set(\"theme\", theme);\n  if (showClose) url.searchParams.set(\"showClose\", \"true\");\n\n  // Append theming params (camelCase param names matching host expectations)\n  const themingKeys = Object.keys(\n    POINTS_HISTORY_THEMING_PROP_TO_PARAM\n  ) as Array<keyof PointsHistoryThemingProps>;\n  for (const key of themingKeys) {\n    const value = props[key];\n    if (value !== undefined && value !== null && String(value).length > 0) {\n      url.searchParams.set(\n        POINTS_HISTORY_THEMING_PROP_TO_PARAM[key],\n        String(value)\n      );\n    }\n  }\n\n  return url.toString();\n}\n\n/**\n * LegionPointsHistory – a React component that embeds the Legion\n * Points History widget via an iframe.\n *\n * @example\n * ```tsx\n * import { LegionPointsHistory } from '@legionhandtech/lht-react-widgets';\n *\n * function App() {\n *   return (\n *     <LegionPointsHistory\n *       baseUrl=\"https://your-legion-domain.com\"\n *       authToken=\"your-jwt-token\"\n *       theme=\"light\"\n *     />\n *   );\n * }\n * ```\n */\nexport const LegionPointsHistory = forwardRef<\n  LegionPointsHistoryHandle,\n  PointsHistoryWidgetProps\n>(function LegionPointsHistory(props, ref) {\n  const {\n    theme = \"light\",\n    authToken,\n    showClose,\n    width = \"100%\",\n    height = \"600px\",\n    className,\n    style,\n    onLoad,\n    onError,\n    baseUrl,\n    ...rest\n  } = props;\n\n  const iframeRef = useRef<HTMLIFrameElement>(null);\n\n  useImperativeHandle(\n    ref,\n    () => ({\n      refresh: () => {\n        const iframe = iframeRef.current;\n        if (iframe?.contentWindow) {\n          iframe.contentWindow.location.reload();\n        }\n      },\n    }),\n    []\n  );\n\n  const src = useMemo(\n    () => buildPointsHistoryWidgetUrl(props),\n    [\n      baseUrl,\n      theme,\n      showClose,\n      ...Object.keys(POINTS_HISTORY_THEMING_PROP_TO_PARAM).map(\n        (k) => rest[k as keyof typeof rest]\n      ),\n    ]\n  );\n\n  const handleLoad = useCallback(() => {\n    const iframe = iframeRef.current;\n    if (authToken && iframe?.contentWindow) {\n      iframe.contentWindow.postMessage(\n        { type: \"AUTH_TOKEN\", token: authToken },\n        baseUrl\n      );\n    }\n    onLoad?.({ widget: \"points-history\", theme });\n  }, [onLoad, theme, authToken, baseUrl]);\n\n  const handleError = useCallback(() => {\n    onError?.(\"Failed to load points history widget\");\n  }, [onError]);\n\n  const containerStyle: React.CSSProperties = {\n    display: \"block\",\n    width,\n    backgroundColor: \"transparent\",\n    ...style,\n  };\n\n  const iframeStyle: React.CSSProperties = {\n    border: \"none\",\n    overflow: \"hidden\",\n    width: \"100%\",\n    height,\n  };\n\n  return (\n    <div\n      className={className}\n      style={containerStyle}\n      data-testid=\"legion-points-history\"\n    >\n      <iframe\n        ref={iframeRef}\n        src={src}\n        title=\"Points History Widget\"\n        width=\"100%\"\n        loading=\"lazy\"\n        style={iframeStyle}\n        onLoad={handleLoad}\n        onError={handleError}\n      />\n    </div>\n  );\n});\n"]}