Rocky_Mountain_Vending/.pnpm-store/v10/files/9d/fd64b9585cd6b67ae3bee515856bc1659c96bcb685846aa310107a5fa42e347a0d9fe4e1d4e4cb471078b265745f6e2e2dc6fc8e961fec4e00acb458e23c69
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

29 lines
No EOL
821 B
Text

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = closest;
var _matches = _interopRequireDefault(require("./matches"));
/**
* Returns the closest parent element that matches a given selector.
*
* @param node the reference element
* @param selector the selector to match
* @param stopAt stop traversing when this element is found
*/
function closest(node, selector, stopAt) {
if (node.closest && !stopAt) node.closest(selector);
var nextNode = node;
do {
if ((0, _matches.default)(nextNode, selector)) return nextNode;
nextNode = nextNode.parentElement;
} while (nextNode && nextNode !== stopAt && nextNode.nodeType === document.ELEMENT_NODE);
return null;
}
module.exports = exports["default"];