Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "0zbP": function(e, t, i) {
- "use strict";
- (function(r) {
- function f(e) {
- var t, n = {},
- i = typeof(e = e || r.location || {});
- if ("blob:" === e.protocol)
- n = new _(unescape(e.pathname), {});
- else if ("string" === i)
- for (t in n = new _(e, {}),
- o)
- delete n[t];
- else if ("object" === i) {
- for (t in e)
- t in o || (n[t] = e[t]);
- void 0 === n.slashes && (n.slashes = a.test(e.href))
- }
- return n
- }
- function p(e) {
- var t = n.exec(e);
- return {
- protocol: t[1] ? t[1].toLowerCase() : "",
- slashes: !!t[2],
- rest: t[3]
- }
- }
- function _(e, t, n) {
- if (!(this instanceof _))
- return new _(e, t, n);
- var i, r, a, o, s, l, u = v.slice(),
- c = typeof t,
- d = this,
- h = 0;
- for ("object" !== c && "string" !== c && (n = t,
- t = null),
- n && "function" != typeof n && (n = m.parse),
- t = f(t),
- i = !(r = p(e || "")).protocol && !r.slashes,
- d.slashes = r.slashes || i && t.slashes,
- d.protocol = r.protocol || t.protocol || "",
- e = r.rest,
- r.slashes || (u[2] = [/(.*)/, "pathname"]); h < u.length; h++)
- a = (o = u[h])[0],
- l = o[1],
- a != a ? d[l] = e : "string" == typeof a ? ~(s = e.indexOf(a)) && ("number" == typeof o[2] ? (d[l] = e.slice(0, s),
- e = e.slice(s + o[2])) : (d[l] = e.slice(s),
- e = e.slice(0, s))) : (s = a.exec(e)) && (d[l] = s[1],
- e = e.slice(0, s.index)),
- d[l] = d[l] || i && o[3] && t[l] || "",
- o[4] && (d[l] = d[l].toLowerCase());
- n && (d.query = n(d.query)),
- i && t.slashes && "/" !== d.pathname.charAt(0) && ("" !== d.pathname || "" !== t.pathname) && (d.pathname = function(e, t) {
- for (var n = "/".split("/").slice(0, -1).concat(e.split("/")), i = n.length, r = n[i - 1], a = !1, o = 0; i--;)
- "." === n[i] ? n.splice(i, 1) : ".." === n[i] ? (n.splice(i, 1),
- o++) : o && (0 === i && (a = !0),
- n.splice(i, 1),
- o--);
- return a && n.unshift(""),
- "." !== r && ".." !== r || n.push(""),
- n.join("/")
- }(d.pathname, t.pathname)),
- g(d.port, d.protocol) || (d.host = d.hostname,
- d.port = ""),
- d.username = d.password = "",
- d.auth && (o = d.auth.split(":"),
- d.username = o[0] || "",
- d.password = o[1] || ""),
- d.origin = d.protocol && d.host && "file:" !== d.protocol ? d.protocol + "//" + d.host : "null",
- d.href = d.toString()
- }
- var g = i("1HwD"),
- m = i("gmze"),
- n = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,
- a = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//,
- v = [
- ["#", "hash"],
- ["?", "query"],
- ["/", "pathname"],
- ["@", "auth", 1],
- [NaN, "host", void 0, 1, 1],
- [/:(\d+)$/, "port", void 0, 1],
- [NaN, "hostname", void 0, 1, 1]
- ],
- o = {
- hash: 1,
- query: 1
- };
- _.prototype = {
- set: function(e, t, n) {
- var i = this;
- switch (e) {
- case "query":
- "string" == typeof t && t.length && (t = (n || m.parse)(t)),
- i[e] = t;
- break;
- case "port":
- i[e] = t,
- g(t, i.protocol) ? t && (i.host = i.hostname + ":" + t) : (i.host = i.hostname,
- i[e] = "");
- break;
- case "hostname":
- i[e] = t,
- i.port && (t += ":" + i.port),
- i.host = t;
- break;
- case "host":
- i[e] = t,
- /:\d+$/.test(t) ? (t = t.split(":"),
- i.port = t.pop(),
- i.hostname = t.join(":")) : (i.hostname = t,
- i.port = "");
- break;
- case "protocol":
- i.protocol = t.toLowerCase(),
- i.slashes = !n;
- break;
- case "pathname":
- case "hash":
- if (t) {
- var r = "pathname" === e ? "/" : "#";
- i[e] = t.charAt(0) !== r ? r + t : t
- } else
- i[e] = t;
- break;
- default:
- i[e] = t
- }
- for (var a = 0; a < v.length; a++) {
- var o = v[a];
- o[4] && (i[o[1]] = i[o[1]].toLowerCase())
- }
- return i.origin = i.protocol && i.host && "file:" !== i.protocol ? i.protocol + "//" + i.host : "null",
- i.href = i.toString(),
- i
- },
- toString: function(e) {
- e && "function" == typeof e || (e = m.stringify);
- var t, n = this,
- i = n.protocol;
- i && ":" !== i.charAt(i.length - 1) && (i += ":");
- var r = i + (n.slashes ? "//" : "");
- return n.username && (r += n.username,
- n.password && (r += ":" + n.password),
- r += "@"),
- r += n.host + n.pathname,
- (t = "object" == typeof n.query ? e(n.query) : n.query) && (r += "?" !== t.charAt(0) ? "?" + t : t),
- n.hash && (r += n.hash),
- r
- }
- },
- _.extractProtocol = p,
- _.location = f,
- _.qs = m,
- e.exports = _
- }).call(t, i("aY11"))
- },
Add Comment
Please, Sign In to add comment