Rocky_Mountain_Vending/.pnpm-store/v10/files/e0/c58d272851184a7db4b4ea4abd412a4e798514b253fe1c576623fad753daec3a8444b723e02078ff0420b98011e69015bbe622a37700dcb0c780998fae4add
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

1 line
No EOL
6.2 KiB
Text

{"version":3,"sources":["../../../src/server/response-cache/web.ts"],"sourcesContent":["import { DetachedPromise } from '../../lib/detached-promise'\nimport type { ResponseCacheEntry, ResponseGenerator } from './types'\n\n/**\n * In the web server, there is currently no incremental cache provided and we\n * always SSR the page.\n */\nexport default class WebResponseCache {\n pendingResponses: Map<string, Promise<ResponseCacheEntry | null>>\n previousCacheItem?: {\n key: string\n entry: ResponseCacheEntry | null\n expiresAt: number\n }\n minimalMode?: boolean\n\n constructor(minimalMode: boolean) {\n this.pendingResponses = new Map()\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n Object.assign(this, { minimalMode })\n }\n\n public get(\n key: string | null,\n responseGenerator: ResponseGenerator,\n context: {\n isOnDemandRevalidate?: boolean\n isPrefetch?: boolean\n incrementalCache: any\n }\n ): Promise<ResponseCacheEntry | null> {\n // ensure on-demand revalidate doesn't block normal requests\n const pendingResponseKey = key\n ? `${key}-${context.isOnDemandRevalidate ? '1' : '0'}`\n : null\n\n const pendingResponse = pendingResponseKey\n ? this.pendingResponses.get(pendingResponseKey)\n : null\n if (pendingResponse) {\n return pendingResponse\n }\n\n const {\n promise,\n resolve: resolver,\n reject: rejecter,\n } = new DetachedPromise<ResponseCacheEntry | null>()\n if (pendingResponseKey) {\n this.pendingResponses.set(pendingResponseKey, promise)\n }\n\n let hasResolved = false\n const resolve = (cacheEntry: ResponseCacheEntry | null) => {\n if (pendingResponseKey) {\n // Ensure all reads from the cache get the latest value.\n this.pendingResponses.set(\n pendingResponseKey,\n Promise.resolve(cacheEntry)\n )\n }\n if (!hasResolved) {\n hasResolved = true\n resolver(cacheEntry)\n }\n }\n\n // we keep the previous cache entry around to leverage\n // when the incremental cache is disabled in minimal mode\n if (\n pendingResponseKey &&\n this.minimalMode &&\n this.previousCacheItem?.key === pendingResponseKey &&\n this.previousCacheItem.expiresAt > Date.now()\n ) {\n resolve(this.previousCacheItem.entry)\n this.pendingResponses.delete(pendingResponseKey)\n return promise\n }\n\n // We wait to do any async work until after we've added our promise to\n // `pendingResponses` to ensure that any any other calls will reuse the\n // same promise until we've fully finished our work.\n ;(async () => {\n try {\n const cacheEntry = await responseGenerator({ hasResolved })\n const resolveValue =\n cacheEntry === null\n ? null\n : {\n ...cacheEntry,\n isMiss: true,\n }\n\n // for on-demand revalidate wait to resolve until cache is set\n if (!context.isOnDemandRevalidate) {\n resolve(resolveValue)\n }\n\n if (key && cacheEntry && cacheEntry.cacheControl) {\n this.previousCacheItem = {\n key: pendingResponseKey || key,\n entry: cacheEntry,\n expiresAt: Date.now() + 1000,\n }\n } else {\n this.previousCacheItem = undefined\n }\n\n if (context.isOnDemandRevalidate) {\n resolve(resolveValue)\n }\n } catch (err) {\n // while revalidating in the background we can't reject as\n // we already resolved the cache entry so log the error here\n if (hasResolved) {\n console.error(err)\n } else {\n rejecter(err as Error)\n }\n } finally {\n if (pendingResponseKey) {\n this.pendingResponses.delete(pendingResponseKey)\n }\n }\n })()\n return promise\n }\n}\n"],"names":["WebResponseCache","constructor","minimalMode","pendingResponses","Map","Object","assign","get","key","responseGenerator","context","pendingResponseKey","isOnDemandRevalidate","pendingResponse","promise","resolve","resolver","reject","rejecter","DetachedPromise","set","hasResolved","cacheEntry","Promise","previousCacheItem","expiresAt","Date","now","entry","delete","resolveValue","isMiss","cacheControl","undefined","err","console","error"],"mappings":";;;;+BAGA;;;CAGC,GACD;;;eAAqBA;;;iCAPW;AAO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