Rocky_Mountain_Vending/.pnpm-store/v10/files/ef/20623eb0a0fbd7ed915b9d6be561638d0b7554b693d8e9340d14eb0388d57dea06d87576480ed58d723293e25fedc85cbecfebf784daedb041418bd10500ca
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

38 lines
No EOL
1.4 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getSocketUrl", {
enumerable: true,
get: function() {
return getSocketUrl;
}
});
const _normalizedassetprefix = require("../../../shared/lib/normalized-asset-prefix");
function getSocketProtocol(assetPrefix) {
let protocol = window.location.protocol;
try {
// assetPrefix is a url
protocol = new URL(assetPrefix).protocol;
} catch {}
return protocol === 'http:' ? 'ws:' : 'wss:';
}
function getSocketUrl(assetPrefix) {
const prefix = (0, _normalizedassetprefix.normalizedAssetPrefix)(assetPrefix);
const protocol = getSocketProtocol(assetPrefix || '');
if (URL.canParse(prefix)) {
// since normalized asset prefix is ensured to be a URL format,
// we can safely replace the protocol
return prefix.replace(/^http/, 'ws');
}
const { hostname, port } = window.location;
return `${protocol}//${hostname}${port ? `:${port}` : ''}${prefix}`;
}
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=get-socket-url.js.map