@govtechsg/sgds-web-component 3.30.1-rc.0 → 3.30.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32036,7 +32036,7 @@
32036
32036
  "package": {
32037
32037
  "name": "@govtechsg/sgds-web-component",
32038
32038
  "description": "",
32039
- "version": "3.30.1-rc.0",
32039
+ "version": "3.30.1-rc.2",
32040
32040
  "author": "GovTechSG",
32041
32041
  "license": "MIT"
32042
32042
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govtechsg/sgds-web-component",
3
- "version": "3.30.1-rc.0",
3
+ "version": "3.30.1-rc.2",
4
4
  "description": "",
5
5
  "main": "./index.umd.js",
6
6
  "module": "./index.js",
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-nonce.js","names":[],"sources":["../../../../src/utils/ssr-nonce.ts"],"sourcesContent":["export function getCSPNonce(): string | null {\n return ((globalThis as Record<string, unknown>)[\"litNonce\"] as string) ?? null;\n}\n\n/**\n * Patch LitElementRenderer.renderShadow() to inject CSP nonces into\n * DSD <style> tags. Call this ONCE at server startup from instrumentation.ts.\n *\n * This must run before any SSR request is handled. Next.js's\n * instrumentation.ts `register()` hook guarantees this.\n */\nexport async function registerSSRNonce(): Promise<void> {\n if (typeof window !== \"undefined\") return;\n\n try {\n const { LitElementRenderer } = await import(\"@lit-labs/ssr/lib/lit-element-renderer.js\");\n\n // Guard against double-patching\n if ((LitElementRenderer as Record<string, unknown>)._sgdsNoncePatched) {\n return;\n }\n (LitElementRenderer as Record<string, unknown>)._sgdsNoncePatched = true;\n\n const originalRenderShadow = LitElementRenderer.prototype.renderShadow;\n\n LitElementRenderer.prototype.renderShadow = function (renderInfo: unknown) {\n const result = originalRenderShadow.call(this, renderInfo);\n if (!result) return result;\n\n const litNonce = (globalThis as Record<string, unknown>)[\"litNonce\"];\n if (!litNonce) return result;\n\n return result.map((item: unknown) => {\n if (typeof item === \"string\" && item === \"<style>\") {\n return `<style nonce=\"${litNonce}\">`;\n }\n return item;\n });\n };\n } catch {\n // @lit-labs/ssr not available — nonce injection disabled\n }\n}\n\n/**\n * CSP nonce for Declarative Shadow DOM (DSD) styles.\n *\n * Two functions:\n * - `registerSSRNonce()` — call ONCE at server startup (instrumentation.ts).\n * Patches LitElementRenderer to respect globalThis.litNonce.\n * - `setCSPNonce()` — call per-request in layout.tsx.\n * Sets globalThis.litNonce for the current request.\n *\n * @example\n * ```ts\n * // instrumentation.ts\n * import { registerSSRNonce } from '@govtechsg/sgds-web-component/react/ssr';\n *\n * export async function register() {\n * await registerSSRNonce();\n * }\n * ```\n *\n * ```tsx\n * // app/layout.tsx (server component)\n * import { setCSPNonce } from '@govtechsg/sgds-web-component/react/ssr';\n * import { headers } from 'next/headers';\n *\n * export default async function Layout({ children }) {\n * const nonce = (await headers()).get('x-nonce');\n * if (nonce) setCSPNonce(nonce);\n * return <html><body>{children}</body></html>;\n * }\n * ```\n */\n/**\n * Set the CSP nonce for the current request. Call this in your server\n * component (e.g. layout.tsx) before SGDS components render.\n * This is synchronous — no await needed.\n */\nexport function setCSPNonce(nonce: string | null): void {\n (globalThis as Record<string, unknown>)[\"litNonce\"] = nonce ?? undefined;\n}\n"],"mappings":";AAAA,SAAgB,cAA6B;CAC3C,OAAS,WAAuC,eAA0B;AAC5E;;;;;;;;AASA,eAAsB,mBAAkC;CACtD,IAAI,OAAO,WAAW,aAAa;CAEnC,IAAI;EACF,MAAM,EAAE,uBAAuB,MAAM,OAAO;EAG5C,IAAK,mBAA+C,mBAClD;EAEF,mBAAgD,oBAAoB;EAEpE,MAAM,uBAAuB,mBAAmB,UAAU;EAE1D,mBAAmB,UAAU,eAAe,SAAU,YAAqB;GACzE,MAAM,SAAS,qBAAqB,KAAK,MAAM,UAAU;GACzD,IAAI,CAAC,QAAQ,OAAO;GAEpB,MAAM,WAAY,WAAuC;GACzD,IAAI,CAAC,UAAU,OAAO;GAEtB,OAAO,OAAO,KAAK,SAAkB;IACnC,IAAI,OAAO,SAAS,YAAY,SAAS,WACvC,OAAO,iBAAiB,SAAS;IAEnC,OAAO;GACT,CAAC;EACH;CACF,QAAQ,CAER;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,YAAY,OAA4B;CACtD,WAAwC,cAAc,SAAS,KAAA;AACjE"}
1
+ {"version":3,"file":"ssr-nonce.js","names":[],"sources":["../../../../src/utils/ssr-nonce.ts"],"sourcesContent":["export function getCSPNonce(): string | null {\n return ((globalThis as Record<string, unknown>)[\"litNonce\"] as string) ?? null;\n}\n\n/**\n * Patch LitElementRenderer.renderShadow() to inject CSP nonces into\n * DSD <style> tags. Call this ONCE at server startup from instrumentation.ts.\n *\n * This must run before any SSR request is handled. Next.js's\n * instrumentation.ts `register()` hook guarantees this.\n */\nexport async function registerSSRNonce(): Promise<void> {\n if (typeof window !== \"undefined\") return;\n\n try {\n const { LitElementRenderer } = await import(\"@lit-labs/ssr/lib/lit-element-renderer.js\");\n\n // Guard against double-patching\n if ((LitElementRenderer as unknown as Record<string, unknown>)._sgdsNoncePatched) {\n return;\n }\n (LitElementRenderer as unknown as Record<string, unknown>)._sgdsNoncePatched = true;\n\n const originalRenderShadow = LitElementRenderer.prototype.renderShadow;\n\n LitElementRenderer.prototype.renderShadow = function (renderInfo: unknown) {\n const result = originalRenderShadow.call(this, renderInfo);\n if (!result) return result;\n\n const litNonce = (globalThis as Record<string, unknown>)[\"litNonce\"];\n if (!litNonce) return result;\n\n return result.map((item: unknown) => {\n if (typeof item === \"string\" && item === \"<style>\") {\n return `<style nonce=\"${litNonce}\">`;\n }\n return item;\n });\n };\n } catch {\n // @lit-labs/ssr not available — nonce injection disabled\n }\n}\n\n/**\n * CSP nonce for Declarative Shadow DOM (DSD) styles.\n *\n * Two functions:\n * - `registerSSRNonce()` — call ONCE at server startup (instrumentation.ts).\n * Patches LitElementRenderer to respect globalThis.litNonce.\n * - `setCSPNonce()` — call per-request in layout.tsx.\n * Sets globalThis.litNonce for the current request.\n *\n * @example\n * ```ts\n * // instrumentation.ts\n * import { registerSSRNonce } from '@govtechsg/sgds-web-component/react/ssr';\n *\n * export async function register() {\n * await registerSSRNonce();\n * }\n * ```\n *\n * ```tsx\n * // app/layout.tsx (server component)\n * import { setCSPNonce } from '@govtechsg/sgds-web-component/react/ssr';\n * import { headers } from 'next/headers';\n *\n * export default async function Layout({ children }) {\n * const nonce = (await headers()).get('x-nonce');\n * if (nonce) setCSPNonce(nonce);\n * return <html><body>{children}</body></html>;\n * }\n * ```\n */\n/**\n * Set the CSP nonce for the current request. Call this in your server\n * component (e.g. layout.tsx) before SGDS components render.\n * This is synchronous — no await needed.\n */\nexport function setCSPNonce(nonce: string | null): void {\n (globalThis as Record<string, unknown>)[\"litNonce\"] = nonce ?? undefined;\n}\n"],"mappings":";AAAA,SAAgB,cAA6B;CAC3C,OAAS,WAAuC,eAA0B;AAC5E;;;;;;;;AASA,eAAsB,mBAAkC;CACtD,IAAI,OAAO,WAAW,aAAa;CAEnC,IAAI;EACF,MAAM,EAAE,uBAAuB,MAAM,OAAO;EAG5C,IAAK,mBAA0D,mBAC7D;EAEF,mBAA2D,oBAAoB;EAE/E,MAAM,uBAAuB,mBAAmB,UAAU;EAE1D,mBAAmB,UAAU,eAAe,SAAU,YAAqB;GACzE,MAAM,SAAS,qBAAqB,KAAK,MAAM,UAAU;GACzD,IAAI,CAAC,QAAQ,OAAO;GAEpB,MAAM,WAAY,WAAuC;GACzD,IAAI,CAAC,UAAU,OAAO;GAEtB,OAAO,OAAO,KAAK,SAAkB;IACnC,IAAI,OAAO,SAAS,YAAY,SAAS,WACvC,OAAO,iBAAiB,SAAS;IAEnC,OAAO;GACT,CAAC;EACH;CACF,QAAQ,CAER;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,YAAY,OAA4B;CACtD,WAAwC,cAAc,SAAS,KAAA;AACjE"}
@@ -4,12 +4,13 @@
4
4
  * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect
5
5
  * globalThis.litNonce for CSP nonce injection.
6
6
  *
7
- * Uses globalThis.require (Node.js CJS require) for SYNCHRONOUS module
8
- * resolution. This ensures the patch is applied at module evaluation time —
9
- * before any SSR rendering starts, including on the first request.
7
+ * Uses new Function("return require")() to get a synchronous require
8
+ * that is invisible to both Rolldown and webpack. Bundlers cannot
9
+ * statically analyze new Function(), so they leave it alone.
10
+ * At runtime in Node.js, it returns the real require function.
10
11
  */
11
12
  if (typeof window === "undefined") try {
12
- const mod = (typeof require !== "undefined" ? require : new Function("id", "return import(id)"))("@lit-labs/ssr/lib/lit-element-renderer.js");
13
+ const mod = new Function("return require")()("@lit-labs/ssr/lib/lit-element-renderer.js");
13
14
  const LitElementRenderer = mod.LitElementRenderer || mod.default?.LitElementRenderer;
14
15
  if (LitElementRenderer && !LitElementRenderer._sgdsNoncePatched) {
15
16
  LitElementRenderer._sgdsNoncePatched = true;
@@ -17,7 +18,7 @@ if (typeof window === "undefined") try {
17
18
  LitElementRenderer.prototype.renderShadow = function(renderInfo) {
18
19
  const result = originalRenderShadow.call(this, renderInfo);
19
20
  if (!result) return result;
20
- const nonce = globalThis["litNonce"];
21
+ const nonce = globalThis.litNonce;
21
22
  if (!nonce) return result;
22
23
  return result.map((item) => {
23
24
  if (typeof item === "string" && item === "<style>") return `<style nonce="${nonce}">`;
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-nonce-patch.cjs.js","names":[],"sources":["../../../src/utils/ssr-nonce-patch.ts"],"sourcesContent":["/**\n * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect\n * globalThis.litNonce for CSP nonce injection.\n *\n * Uses globalThis.require (Node.js CJS require) for SYNCHRONOUS module\n * resolution. This ensures the patch is applied at module evaluation time —\n * before any SSR rendering starts, including on the first request.\n */\n\nif (typeof window === \"undefined\") {\n try {\n // Use Function constructor to get a raw require that bundlers won't transform.\n // In webpack's server bundle, this resolves to the bundled module synchronously.\n // In Node.js runtime, this resolves via the module cache.\n const _require = typeof require !== \"undefined\" ? require : new Function(\"id\", \"return import(id)\");\n\n const mod = _require(\"@lit-labs/ssr/lib/lit-element-renderer.js\");\n const LitElementRenderer = mod.LitElementRenderer || mod.default?.LitElementRenderer;\n\n if (LitElementRenderer && !LitElementRenderer._sgdsNoncePatched) {\n LitElementRenderer._sgdsNoncePatched = true;\n\n const originalRenderShadow = LitElementRenderer.prototype.renderShadow;\n\n LitElementRenderer.prototype.renderShadow = function (renderInfo: unknown) {\n const result = originalRenderShadow.call(this, renderInfo);\n if (!result) return result;\n\n const nonce = (globalThis as Record<string, unknown>)[\"litNonce\"];\n if (!nonce) return result;\n\n return result.map((item: unknown) => {\n if (typeof item === \"string\" && item === \"<style>\") {\n return `<style nonce=\"${nonce}\">`;\n }\n return item;\n });\n };\n }\n } catch {\n // @lit-labs/ssr not available — nonce injection disabled\n }\n}\n"],"mappings":";;;;;;;;;;AASA,IAAI,OAAO,WAAW,aACpB,IAAI;CAMF,MAAM,OAFW,OAAO,YAAY,cAAc,UAAU,IAAI,SAAS,MAAM,mBAAmB,EAAA,CAE7E,2CAA2C;CAChE,MAAM,qBAAqB,IAAI,sBAAsB,IAAI,SAAS;CAElE,IAAI,sBAAsB,CAAC,mBAAmB,mBAAmB;EAC/D,mBAAmB,oBAAoB;EAEvC,MAAM,uBAAuB,mBAAmB,UAAU;EAE1D,mBAAmB,UAAU,eAAe,SAAU,YAAqB;GACzE,MAAM,SAAS,qBAAqB,KAAK,MAAM,UAAU;GACzD,IAAI,CAAC,QAAQ,OAAO;GAEpB,MAAM,QAAS,WAAuC;GACtD,IAAI,CAAC,OAAO,OAAO;GAEnB,OAAO,OAAO,KAAK,SAAkB;IACnC,IAAI,OAAO,SAAS,YAAY,SAAS,WACvC,OAAO,iBAAiB,MAAM;IAEhC,OAAO;GACT,CAAC;EACH;CACF;AACF,QAAQ,CAER"}
1
+ {"version":3,"file":"ssr-nonce-patch.cjs.js","names":[],"sources":["../../../src/utils/ssr-nonce-patch.ts"],"sourcesContent":["/**\n * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect\n * globalThis.litNonce for CSP nonce injection.\n *\n * Uses new Function(\"return require\")() to get a synchronous require\n * that is invisible to both Rolldown and webpack. Bundlers cannot\n * statically analyze new Function(), so they leave it alone.\n * At runtime in Node.js, it returns the real require function.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nif (typeof window === \"undefined\") {\n try {\n // new Function hides require from all bundlers — synchronous at runtime\n const _require = new Function(\"return require\")() as (\n id: string\n ) => any;\n const mod = _require(\"@lit-labs/ssr/lib/lit-element-renderer.js\");\n const LitElementRenderer =\n mod.LitElementRenderer || mod.default?.LitElementRenderer;\n\n if (LitElementRenderer && !LitElementRenderer._sgdsNoncePatched) {\n LitElementRenderer._sgdsNoncePatched = true;\n\n const originalRenderShadow =\n LitElementRenderer.prototype.renderShadow;\n\n LitElementRenderer.prototype.renderShadow = function (\n renderInfo: unknown\n ) {\n const result = originalRenderShadow.call(this, renderInfo);\n if (!result) return result;\n\n const nonce = (globalThis as any).litNonce;\n if (!nonce) return result;\n\n return result.map((item: unknown) => {\n if (typeof item === \"string\" && item === \"<style>\") {\n return `<style nonce=\"${nonce}\">`;\n }\n return item;\n });\n };\n }\n } catch {\n // @lit-labs/ssr not available — nonce injection disabled\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAI,OAAO,WAAW,aACpB,IAAI;CAKF,MAAM,MAHW,IAAI,SAAS,gBAAgB,CAAC,CAG5B,CAAC,CAAC,2CAA2C;CAChE,MAAM,qBACJ,IAAI,sBAAsB,IAAI,SAAS;CAEzC,IAAI,sBAAsB,CAAC,mBAAmB,mBAAmB;EAC/D,mBAAmB,oBAAoB;EAEvC,MAAM,uBACJ,mBAAmB,UAAU;EAE/B,mBAAmB,UAAU,eAAe,SAC1C,YACA;GACA,MAAM,SAAS,qBAAqB,KAAK,MAAM,UAAU;GACzD,IAAI,CAAC,QAAQ,OAAO;GAEpB,MAAM,QAAS,WAAmB;GAClC,IAAI,CAAC,OAAO,OAAO;GAEnB,OAAO,OAAO,KAAK,SAAkB;IACnC,IAAI,OAAO,SAAS,YAAY,SAAS,WACvC,OAAO,iBAAiB,MAAM;IAEhC,OAAO;GACT,CAAC;EACH;CACF;AACF,QAAQ,CAER"}
@@ -1,16 +1,16 @@
1
1
  "use client";
2
- import { __require } from "../_virtual/_rolldown/runtime.js";
3
2
  //#region src/utils/ssr-nonce-patch.ts
4
3
  /**
5
4
  * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect
6
5
  * globalThis.litNonce for CSP nonce injection.
7
6
  *
8
- * Uses globalThis.require (Node.js CJS require) for SYNCHRONOUS module
9
- * resolution. This ensures the patch is applied at module evaluation time —
10
- * before any SSR rendering starts, including on the first request.
7
+ * Uses new Function("return require")() to get a synchronous require
8
+ * that is invisible to both Rolldown and webpack. Bundlers cannot
9
+ * statically analyze new Function(), so they leave it alone.
10
+ * At runtime in Node.js, it returns the real require function.
11
11
  */
12
12
  if (typeof window === "undefined") try {
13
- const mod = (typeof __require !== "undefined" ? __require : new Function("id", "return import(id)"))("@lit-labs/ssr/lib/lit-element-renderer.js");
13
+ const mod = new Function("return require")()("@lit-labs/ssr/lib/lit-element-renderer.js");
14
14
  const LitElementRenderer = mod.LitElementRenderer || mod.default?.LitElementRenderer;
15
15
  if (LitElementRenderer && !LitElementRenderer._sgdsNoncePatched) {
16
16
  LitElementRenderer._sgdsNoncePatched = true;
@@ -18,7 +18,7 @@ if (typeof window === "undefined") try {
18
18
  LitElementRenderer.prototype.renderShadow = function(renderInfo) {
19
19
  const result = originalRenderShadow.call(this, renderInfo);
20
20
  if (!result) return result;
21
- const nonce = globalThis["litNonce"];
21
+ const nonce = globalThis.litNonce;
22
22
  if (!nonce) return result;
23
23
  return result.map((item) => {
24
24
  if (typeof item === "string" && item === "<style>") return `<style nonce="${nonce}">`;
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-nonce-patch.js","names":[],"sources":["../../../src/utils/ssr-nonce-patch.ts"],"sourcesContent":["/**\n * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect\n * globalThis.litNonce for CSP nonce injection.\n *\n * Uses globalThis.require (Node.js CJS require) for SYNCHRONOUS module\n * resolution. This ensures the patch is applied at module evaluation time —\n * before any SSR rendering starts, including on the first request.\n */\n\nif (typeof window === \"undefined\") {\n try {\n // Use Function constructor to get a raw require that bundlers won't transform.\n // In webpack's server bundle, this resolves to the bundled module synchronously.\n // In Node.js runtime, this resolves via the module cache.\n const _require = typeof require !== \"undefined\" ? require : new Function(\"id\", \"return import(id)\");\n\n const mod = _require(\"@lit-labs/ssr/lib/lit-element-renderer.js\");\n const LitElementRenderer = mod.LitElementRenderer || mod.default?.LitElementRenderer;\n\n if (LitElementRenderer && !LitElementRenderer._sgdsNoncePatched) {\n LitElementRenderer._sgdsNoncePatched = true;\n\n const originalRenderShadow = LitElementRenderer.prototype.renderShadow;\n\n LitElementRenderer.prototype.renderShadow = function (renderInfo: unknown) {\n const result = originalRenderShadow.call(this, renderInfo);\n if (!result) return result;\n\n const nonce = (globalThis as Record<string, unknown>)[\"litNonce\"];\n if (!nonce) return result;\n\n return result.map((item: unknown) => {\n if (typeof item === \"string\" && item === \"<style>\") {\n return `<style nonce=\"${nonce}\">`;\n }\n return item;\n });\n };\n }\n } catch {\n // @lit-labs/ssr not available — nonce injection disabled\n }\n}\n"],"mappings":";;;;;;;;;;;AASA,IAAI,OAAO,WAAW,aACpB,IAAI;CAMF,MAAM,OAFW,OAAA,cAAmB,cAAA,YAAwB,IAAI,SAAS,MAAM,mBAAmB,EAAA,CAE7E,2CAA2C;CAChE,MAAM,qBAAqB,IAAI,sBAAsB,IAAI,SAAS;CAElE,IAAI,sBAAsB,CAAC,mBAAmB,mBAAmB;EAC/D,mBAAmB,oBAAoB;EAEvC,MAAM,uBAAuB,mBAAmB,UAAU;EAE1D,mBAAmB,UAAU,eAAe,SAAU,YAAqB;GACzE,MAAM,SAAS,qBAAqB,KAAK,MAAM,UAAU;GACzD,IAAI,CAAC,QAAQ,OAAO;GAEpB,MAAM,QAAS,WAAuC;GACtD,IAAI,CAAC,OAAO,OAAO;GAEnB,OAAO,OAAO,KAAK,SAAkB;IACnC,IAAI,OAAO,SAAS,YAAY,SAAS,WACvC,OAAO,iBAAiB,MAAM;IAEhC,OAAO;GACT,CAAC;EACH;CACF;AACF,QAAQ,CAER"}
1
+ {"version":3,"file":"ssr-nonce-patch.js","names":[],"sources":["../../../src/utils/ssr-nonce-patch.ts"],"sourcesContent":["/**\n * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect\n * globalThis.litNonce for CSP nonce injection.\n *\n * Uses new Function(\"return require\")() to get a synchronous require\n * that is invisible to both Rolldown and webpack. Bundlers cannot\n * statically analyze new Function(), so they leave it alone.\n * At runtime in Node.js, it returns the real require function.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nif (typeof window === \"undefined\") {\n try {\n // new Function hides require from all bundlers — synchronous at runtime\n const _require = new Function(\"return require\")() as (\n id: string\n ) => any;\n const mod = _require(\"@lit-labs/ssr/lib/lit-element-renderer.js\");\n const LitElementRenderer =\n mod.LitElementRenderer || mod.default?.LitElementRenderer;\n\n if (LitElementRenderer && !LitElementRenderer._sgdsNoncePatched) {\n LitElementRenderer._sgdsNoncePatched = true;\n\n const originalRenderShadow =\n LitElementRenderer.prototype.renderShadow;\n\n LitElementRenderer.prototype.renderShadow = function (\n renderInfo: unknown\n ) {\n const result = originalRenderShadow.call(this, renderInfo);\n if (!result) return result;\n\n const nonce = (globalThis as any).litNonce;\n if (!nonce) return result;\n\n return result.map((item: unknown) => {\n if (typeof item === \"string\" && item === \"<style>\") {\n return `<style nonce=\"${nonce}\">`;\n }\n return item;\n });\n };\n }\n } catch {\n // @lit-labs/ssr not available — nonce injection disabled\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAI,OAAO,WAAW,aACpB,IAAI;CAKF,MAAM,MAHW,IAAI,SAAS,gBAAgB,CAAC,CAG5B,CAAC,CAAC,2CAA2C;CAChE,MAAM,qBACJ,IAAI,sBAAsB,IAAI,SAAS;CAEzC,IAAI,sBAAsB,CAAC,mBAAmB,mBAAmB;EAC/D,mBAAmB,oBAAoB;EAEvC,MAAM,uBACJ,mBAAmB,UAAU;EAE/B,mBAAmB,UAAU,eAAe,SAC1C,YACA;GACA,MAAM,SAAS,qBAAqB,KAAK,MAAM,UAAU;GACzD,IAAI,CAAC,QAAQ,OAAO;GAEpB,MAAM,QAAS,WAAmB;GAClC,IAAI,CAAC,OAAO,OAAO;GAEnB,OAAO,OAAO,KAAK,SAAkB;IACnC,IAAI,OAAO,SAAS,YAAY,SAAS,WACvC,OAAO,iBAAiB,MAAM;IAEhC,OAAO;GACT,CAAC;EACH;CACF;AACF,QAAQ,CAER"}
@@ -2,7 +2,8 @@
2
2
  * Patches @lit-labs/ssr's LitElementRenderer.renderShadow() to respect
3
3
  * globalThis.litNonce for CSP nonce injection.
4
4
  *
5
- * Uses globalThis.require (Node.js CJS require) for SYNCHRONOUS module
6
- * resolution. This ensures the patch is applied at module evaluation time —
7
- * before any SSR rendering starts, including on the first request.
5
+ * Uses new Function("return require")() to get a synchronous require
6
+ * that is invisible to both Rolldown and webpack. Bundlers cannot
7
+ * statically analyze new Function(), so they leave it alone.
8
+ * At runtime in Node.js, it returns the real require function.
8
9
  */
@@ -1,8 +0,0 @@
1
- "use client";
2
- //#region \0rolldown/runtime.js
3
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
6
- });
7
- //#endregion
8
- export { __require };