"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    httpToWsUrl: function() {
        return httpToWsUrl;
    },
    normalizeURLWithProtocol: function() {
        return normalizeURLWithProtocol;
    }
});
const _normalizeurl = require("./normalize-url");
function httpToWsUrl(url, protocol = "ws") {
    const wsUrl = new URL("/sockjs/websocket", (0, _normalizeurl.normalizeUrl)(url));
    wsUrl.protocol = `${protocol}`;
    wsUrl.pathname = "/sockjs/websocket";
    return wsUrl;
}
function normalizeURLWithProtocol(printerURL) {
    if (!printerURL) return;
    if (!printerURL.startsWith("http://") && !printerURL.startsWith("https://")) {
        printerURL = `http://${printerURL}`;
    }
    return (0, _normalizeurl.normalizeUrl)(printerURL);
}

//# sourceMappingURL=url.utils.js.map