Rocky_Mountain_Vending/.pnpm-store/v10/files/78/162fa43626c578e6f2d23add18db38c8efe0cc597c33c7225f528716989e1490be460cf76f775c9dd9dcf4d9ddb5cc4435288e55dce7544f8c20ad9032f4d8
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

95 lines
No EOL
4.5 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "hmrRefreshReducer", {
enumerable: true,
get: function() {
return hmrRefreshReducer;
}
});
const _fetchserverresponse = require("../fetch-server-response");
const _createhreffromurl = require("../create-href-from-url");
const _applyrouterstatepatchtotree = require("../apply-router-state-patch-to-tree");
const _isnavigatingtonewrootlayout = require("../is-navigating-to-new-root-layout");
const _navigatereducer = require("./navigate-reducer");
const _handlemutable = require("../handle-mutable");
const _applyflightdata = require("../apply-flight-data");
const _approuter = require("../../app-router");
const _handlesegmentmismatch = require("../handle-segment-mismatch");
const _hasinterceptionrouteincurrenttree = require("./has-interception-route-in-current-tree");
// A version of refresh reducer that keeps the cache around instead of wiping all of it.
function hmrRefreshReducerImpl(state, action) {
const { origin } = action;
const mutable = {};
const href = state.canonicalUrl;
mutable.preserveCustomHistoryState = false;
const cache = (0, _approuter.createEmptyCacheNode)();
// If the current tree was intercepted, the nextUrl should be included in the request.
// This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.
const includeNextUrl = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree);
// TODO-APP: verify that `href` is not an external url.
// Fetch data from the root of the tree.
const navigatedAt = Date.now();
cache.lazyData = (0, _fetchserverresponse.fetchServerResponse)(new URL(href, origin), {
flightRouterState: [
state.tree[0],
state.tree[1],
state.tree[2],
'refetch'
],
nextUrl: includeNextUrl ? state.nextUrl : null,
isHmrRefresh: true
});
return cache.lazyData.then((result)=>{
// Handle case when navigating to page in `pages` from `app`
if (typeof result === 'string') {
return (0, _navigatereducer.handleExternalUrl)(state, mutable, result, state.pushRef.pendingPush);
}
const { flightData, canonicalUrl, renderedSearch } = result;
// Remove cache.lazyData as it has been resolved at this point.
cache.lazyData = null;
let currentTree = state.tree;
let currentCache = state.cache;
for (const normalizedFlightData of flightData){
const { tree: treePatch, isRootRender } = normalizedFlightData;
if (!isRootRender) {
// TODO-APP: handle this case better
console.log('REFRESH FAILED');
return state;
}
const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''
[
''
], currentTree, treePatch, state.canonicalUrl);
if (newTree === null) {
return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);
}
if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {
return (0, _navigatereducer.handleExternalUrl)(state, mutable, href, state.pushRef.pendingPush);
}
const applied = (0, _applyflightdata.applyFlightData)(navigatedAt, currentCache, cache, normalizedFlightData);
if (applied) {
mutable.cache = cache;
currentCache = cache;
}
mutable.patchedTree = newTree;
mutable.renderedSearch = renderedSearch;
mutable.canonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl);
currentTree = newTree;
}
return (0, _handlemutable.handleMutable)(state, mutable);
}, ()=>state);
}
function hmrRefreshReducerNoop(state, _action) {
return state;
}
const hmrRefreshReducer = process.env.NODE_ENV === 'production' ? hmrRefreshReducerNoop : hmrRefreshReducerImpl;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=hmr-refresh-reducer.js.map