"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../engine.io-client/build/esm/socket.js"),require("../../../engine.io-parser/build/esm/encodePacket.browser.js"),require("../../../engine.io-parser/build/esm/commons.js"),require("../../../engine.io-parser/build/esm/contrib/base64-arraybuffer.js"),require("../../../@socket.io/component-emitter/lib/esm/index.js"),require("../../../engine.io-client/build/esm/util.js"),require("../../../engine.io-client/build/esm/transports/polling.js"),require("../../../engine.io-client/build/esm/transports/websocket.js"),require("../../../engine.io-client/build/esm/transports/websocket-constructor.browser.js");var e=require("../../../engine.io-client/build/esm/contrib/parseuri.js");exports.url=function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,i=t;r=r||"undefined"!=typeof location&&location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),i=e.parse(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const s=-1!==i.host.indexOf(":")?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+s+":"+i.port+o,i.href=i.protocol+"://"+s+(r&&r.port===i.port?"":":"+i.port),i};
//# sourceMappingURL=url.js.map
