{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-WBR7H6E3.cjs","../src/embed-shims/next-link.tsx"],"names":[],"mappings":"AAAA,ylBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBA;AACE;AAAA,8BAIK;AAiCI,+CAAA;AAbJ,SAAS,YAAA,CAAa,SAAA,EAAqC;AAChE,EAAA,KAAA,EAAO,SAAA;AACT;AAjDA,IAyCI,IAAA,EAUE,IAAA,EAuCC,iBAAA;AA1FP,IAAA,eAAA,EAAA,qCAAA;AAAA,EAAA,+BAAA,CAAA,EAAA;AAyCA,IAAI,KAAA,EAAkC,IAAA;AAUtC,IAAM,KAAA,EAAO,+BAAA,SAAkD,YAAA,CAC7D,KAAA,EACA,GAAA,EACA;AAIA,MAAA,GAAA,CAAI,IAAA,EAAM;AACR,QAAA,MAAM,KAAA,EAAO,IAAA;AACb,QAAA,uBAAO,6BAAA,IAAC,EAAA,EAAK,GAAA,EAAW,GAAG,MAAA,CAAO,CAAA;AAAA,MACpC;AAIA,MAAA,MAAM;AAAA,QACJ,IAAA;AAAA,QACA,QAAA;AAAA,QACA,QAAA,EAAU,SAAA;AAAA,QACV,OAAA,EAAS,QAAA;AAAA,QACT,MAAA,EAAQ,OAAA;AAAA,QACR,OAAA,EAAS,QAAA;AAAA,QACT,QAAA,EAAU,SAAA;AAAA,QACV,cAAA,EAAgB,eAAA;AAAA,QAChB,MAAA,EAAQ,OAAA;AAAA,QACR,GAAG;AAAA,MACL,EAAA,EAAI,KAAA;AACJ,MAAA,MAAM,QAAA,EACJ,OAAO,KAAA,IAAS,SAAA,EACZ,KAAA,kBACA,IAAA,2BAAM,WAAA,EACJ,IAAA,CAAK,SAAA,EACL,KAAA,CAAA;AACR,MAAA,uBACE,6BAAA,GAAC,EAAA,EAAE,GAAA,EAAU,IAAA,EAAM,OAAA,EAAU,GAAG,IAAA,EAC7B,SAAA,CACH,CAAA;AAAA,IAEJ,CAAC,CAAA;AAED,IAAO,kBAAA,8BAAQ,IAAA;AAAA,EAAA;AAAA,CAAA,CAAA;ADlDf;AACA;AACE;AACA;AACA;AACF,4HAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-WBR7H6E3.cjs","sourcesContent":[null,"/**\n * `next/link` shim — environment-aware Link component.\n *\n * Defaults to a plain `<a>` so non-Next hosts (Vite, CRA, esbuild)\n * work out of the box. Next.js hosts can opt into the REAL `next/link`\n * (with client-router prefetching) by calling {@link registerLink}\n * ONCE at app init:\n *\n *   // hub: lib/embed-shim-registration.ts\n *   import NextLink from 'next/link'\n *   import { registerLink } from '@flamingo-stack/openframe-frontend-core/embed-shims'\n *   registerLink(NextLink)\n *\n * After registration, every lib component that renders this shim\n * delegates to `NextLink` — prefetch, replace, scroll, locale, etc.\n * all work as expected. Without registration, the shim falls through\n * to the plain `<a>` path that drops Next-specific props.\n *\n * Lib internals import this shim directly (relative path); hub-side\n * code goes through the barrel (`@flamingo-stack/.../embed-shims`).\n */\n'use client'\nimport {\n  forwardRef,\n  type AnchorHTMLAttributes,\n  type ComponentType,\n  type ReactNode,\n} from 'react'\n\ntype LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {\n  href?: string | { pathname?: string; query?: Record<string, string> }\n  prefetch?: boolean | null\n  replace?: boolean\n  scroll?: boolean\n  shallow?: boolean\n  passHref?: boolean\n  legacyBehavior?: boolean\n  locale?: string | false\n  children?: ReactNode\n}\n\nlet impl: ComponentType<any> | null = null\n\n/**\n * Register the real `next/link` so this shim delegates to it instead\n * of rendering a plain `<a>`. Call ONCE at app init in a Next.js host.\n */\nexport function registerLink(component: ComponentType<any>): void {\n  impl = component\n}\n\nconst Link = forwardRef<HTMLAnchorElement, LinkProps>(function NextLinkShim(\n  props,\n  ref,\n) {\n  // Real impl path — registered by the host. Hand off untouched so\n  // every Next-specific prop (prefetch, replace, scroll, locale…)\n  // reaches the real component intact.\n  if (impl) {\n    const Real = impl\n    return <Real ref={ref} {...props} />\n  }\n\n  // Fallback path — plain <a>. Drops Next-only props and reduces\n  // `UrlObject` href to its pathname.\n  const {\n    href,\n    children,\n    prefetch: _prefetch,\n    replace: _replace,\n    scroll: _scroll,\n    shallow: _shallow,\n    passHref: _passHref,\n    legacyBehavior: _legacyBehavior,\n    locale: _locale,\n    ...rest\n  } = props\n  const hrefStr =\n    typeof href === 'string'\n      ? href\n      : href?.pathname\n        ? href.pathname\n        : undefined\n  return (\n    <a ref={ref} href={hrefStr} {...rest}>\n      {children}\n    </a>\n  )\n})\n\nexport default Link\n"]}