Rocky_Mountain_Vending/.pnpm-store/v10/files/8c/28d74d5cf54c2e4a180d1bff51d7eb16f5f750e2ddc02552405bef8bbe55b9ec8272f4b55cd471ce07273729eebf9ab2da3a678b5db86b91fc9fec6314fe91
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

28 lines
1.3 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchCSSFromGoogleFonts = fetchCSSFromGoogleFonts;
const next_font_error_1 = require("../next-font-error");
const fetch_resource_1 = require("./fetch-resource");
const retry_1 = require("./retry");
/**
* Fetches the CSS containing the @font-face declarations from Google Fonts.
* The fetch has a user agent header with a modern browser to ensure we'll get .woff2 files.
*
* The env variable NEXT_FONT_GOOGLE_MOCKED_RESPONSES may be set containing a path to mocked data.
* It's used to define mocked data to avoid hitting the Google Fonts API during tests.
*/
async function fetchCSSFromGoogleFonts(url, fontFamily, isDev) {
if (process.env.NEXT_FONT_GOOGLE_MOCKED_RESPONSES) {
const mockFile = require(process.env.NEXT_FONT_GOOGLE_MOCKED_RESPONSES);
const mockedResponse = mockFile[url];
if (!mockedResponse) {
(0, next_font_error_1.nextFontError)('Missing mocked response for URL: ' + url);
}
return mockedResponse;
}
const buffer = await (0, retry_1.retry)(async () => {
return (0, fetch_resource_1.fetchResource)(url, isDev, `Failed to fetch font \`${fontFamily}\`: ${url}\n` +
`Please check your network connection.`);
}, 3);
return buffer.toString('utf8');
}