Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !function(e) {
- var t = {};
- function r(n) {
- if (t[n])
- return t[n].exports;
- var o = t[n] = {
- i: n,
- l: !1,
- exports: {}
- };
- return e[n].call(o.exports, o, o.exports, r),
- o.l = !0,
- o.exports
- }
- r.m = e,
- r.c = t,
- r.d = function(e, t, n) {
- r.o(e, t) || Object.defineProperty(e, t, {
- enumerable: !0,
- get: n
- })
- }
- ,
- r.r = function(e) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
- value: "Module"
- }),
- Object.defineProperty(e, "__esModule", {
- value: !0
- })
- }
- ,
- r.t = function(e, t) {
- if (1 & t && (e = r(e)),
- 8 & t)
- return e;
- if (4 & t && "object" == typeof e && e && e.__esModule)
- return e;
- var n = Object.create(null);
- if (r.r(n),
- Object.defineProperty(n, "default", {
- enumerable: !0,
- value: e
- }),
- 2 & t && "string" != typeof e)
- for (var o in e)
- r.d(n, o, function(t) {
- return e[t]
- }
- .bind(null, o));
- return n
- }
- ,
- r.n = function(e) {
- var t = e && e.__esModule ? function() {
- return e.default
- }
- : function() {
- return e
- }
- ;
- return r.d(t, "a", t),
- t
- }
- ,
- r.o = function(e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }
- ,
- r.p = "",
- r(r.s = 1)
- }([function(e, t, r) {
- "use strict";
- t.decode = t.parse = r(4),
- t.encode = t.stringify = r(5)
- }
- , function(e, t, r) {
- "use strict";
- r.r(t),
- r.d(t, "rayOrderPlugin", function() {
- return i
- });
- let n = r(2);
- const o = "https://ant.aliceblueonline.com"
- , s = ["orders", "holdings"];
- class i {
- constructor() {}
- getCredentials() {
- window.opener.postMessage({
- type: "client_credentials_request"
- }, "*"),
- window.addEventListener("message", this.receiveMessage, !1)
- }
- receiveMessage(e) {
- if ("client_credentials_response" === e.data.type) {
- let t = window.location.search;
- new n({
- clientId: e.data.data.client_id,
- clientSecret: e.data.data.client_secret,
- accessTokenUri: o + "/oauth2/token",
- authorizationUri: o + "/oauth2/auth",
- redirectUri: o + "/plugin/callback",
- scopes: s,
- state: "3unqcjh2DN1o"
- }).code.getToken(t).then(function(e) {
- const t = {
- type: "access_token",
- data: {
- access_token: e.accessToken
- }
- };
- window.opener.postMessage(t, "*")
- })
- }
- }
- }
- window.rayOrderPluginLibrary = new i
- }
- , function(e, t, r) {
- var n = r(3).Buffer
- , o = r(0)
- , s = r(6)
- , i = r(11)
- , a = "function" == typeof n ? function(e) {
- return new n(e).toString("base64")
- }
- : window.btoa;
- e.exports = g;
- var h = {
- Accept: "application/json, application/x-www-form-urlencoded",
- "Content-Type": "application/x-www-form-urlencoded"
- }
- , c = {
- invalid_request: ["The request is missing a required parameter, includes an", "invalid parameter value, includes a parameter more than", "once, or is otherwise malformed."].join(" "),
- invalid_client: ["Client authentication failed (e.g., unknown client, no", "client authentication included, or unsupported", "authentication method)."].join(" "),
- invalid_grant: ["The provided authorization grant (e.g., authorization", "code, resource owner credentials) or refresh token is", "invalid, expired, revoked, does not match the redirection", "URI used in the authorization request, or was issued to", "another client."].join(" "),
- unauthorized_client: ["The client is not authorized to request an authorization", "code using this method."].join(" "),
- unsupported_grant_type: ["The authorization grant type is not supported by the", "authorization server."].join(" "),
- access_denied: ["The resource owner or authorization server denied the request."].join(" "),
- unsupported_response_type: ["The authorization server does not support obtaining", "an authorization code using this method."].join(" "),
- invalid_scope: ["The requested scope is invalid, unknown, or malformed."].join(" "),
- server_error: ["The authorization server encountered an unexpected", "condition that prevented it from fulfilling the request.", "(This error code is needed because a 500 Internal Server", "Error HTTP status code cannot be returned to the client", "via an HTTP redirect.)"].join(" "),
- temporarily_unavailable: ["The authorization server is currently unable to handle", "the request due to a temporary overloading or maintenance", "of the server."].join(" ")
- };
- function u(e) {
- for (var t = 1; t < arguments.length; t++) {
- var r = arguments[t];
- if (null == e[r])
- throw new TypeError('Expected "' + r + '" to exist')
- }
- }
- function l(e) {
- var t = c[e.error] || e.error_description || e.error;
- if (t) {
- var r = new Error(t);
- return r.body = e,
- r.code = "EAUTH",
- r
- }
- }
- function p(e) {
- return Array.isArray(e) ? e.join(" ") : m(e)
- }
- function f(e, t) {
- return u(e, "clientId", "authorizationUri"),
- e.authorizationUri + "?" + o.stringify(Object.assign({
- client_id: e.clientId,
- redirect_uri: e.redirectUri,
- scope: p(e.scopes),
- response_type: t,
- state: e.state
- }, e.query))
- }
- function d(e, t) {
- return "Basic " + a(m(e) + ":" + m(t))
- }
- function m(e) {
- return null == e ? "" : String(e)
- }
- function y(e, t) {
- return {
- url: e.url,
- method: e.method,
- body: Object.assign({}, e.body, t.body),
- query: Object.assign({}, e.query, t.query),
- headers: Object.assign({}, e.headers, t.headers)
- }
- }
- function g(e, t) {
- this.options = e,
- this.request = t || i,
- this.code = new T(this),
- this.token = new j(this),
- this.owner = new b(this),
- this.credentials = new w(this),
- this.jwt = new O(this)
- }
- function v(e, t) {
- this.client = e,
- this.data = t,
- this.tokenType = t.token_type && t.token_type.toLowerCase(),
- this.accessToken = t.access_token,
- this.refreshToken = t.refresh_token,
- this.expiresIn(Number(t.expires_in))
- }
- function b(e) {
- this.client = e
- }
- function j(e) {
- this.client = e
- }
- function w(e) {
- this.client = e
- }
- function T(e) {
- this.client = e
- }
- function O(e) {
- this.client = e
- }
- g.Token = v,
- g.prototype.createToken = function(e, t, r, n) {
- var o = Object.assign({}, n, "string" == typeof e ? {
- access_token: e
- } : e, "string" == typeof t ? {
- refresh_token: t
- } : t, "string" == typeof r ? {
- token_type: r
- } : r);
- return new g.Token(this,o)
- }
- ,
- g.prototype._request = function(e) {
- var t = e.url
- , r = o.stringify(e.body)
- , n = o.stringify(e.query);
- return n && (t += (-1 === t.indexOf("?") ? "?" : "&") + n),
- this.request(e.method, t, r, e.headers).then(function(e) {
- var t = function(e) {
- try {
- return JSON.parse(e)
- } catch (t) {
- return o.parse(e)
- }
- }(e.body)
- , r = l(t);
- if (r)
- return Promise.reject(r);
- if (e.status < 200 || e.status >= 399) {
- var n = new Error("HTTP status " + e.status);
- return n.status = e.status,
- n.body = e.body,
- n.code = "ESTATUS",
- Promise.reject(n)
- }
- return t
- })
- }
- ,
- v.prototype.expiresIn = function(e) {
- if ("number" == typeof e)
- this.expires = new Date,
- this.expires.setSeconds(this.expires.getSeconds() + e);
- else {
- if (!(e instanceof Date))
- throw new TypeError("Unknown duration: " + e);
- this.expires = new Date(e.getTime())
- }
- return this.expires
- }
- ,
- v.prototype.sign = function(e) {
- if (!this.accessToken)
- throw new Error("Unable to sign without access token");
- if (e.headers = e.headers || {},
- "bearer" === this.tokenType)
- e.headers.Authorization = "Bearer " + this.accessToken;
- else {
- var t = e.url.split("#")
- , r = "access_token=" + this.accessToken
- , n = t[0].replace(/[?&]access_token=[^&#]/, "")
- , o = t[1] ? "#" + t[1] : "";
- e.url = n + (n.indexOf("?") > -1 ? "&" : "?") + r + o,
- e.headers.Pragma = "no-store",
- e.headers["Cache-Control"] = "no-store"
- }
- return e
- }
- ,
- v.prototype.refresh = function(e) {
- var t = this
- , r = Object.assign({}, this.client.options, e);
- return this.refreshToken ? this.client._request(y({
- url: r.accessTokenUri,
- method: "POST",
- headers: Object.assign({}, h, {
- Authorization: d(r.clientId, r.clientSecret)
- }),
- body: {
- refresh_token: this.refreshToken,
- grant_type: "refresh_token"
- }
- }, r)).then(function(e) {
- return t.client.createToken(Object.assign({}, t.data, e))
- }) : Promise.reject(new Error("No refresh token"))
- }
- ,
- v.prototype.expired = function() {
- return Date.now() > this.expires.getTime()
- }
- ,
- b.prototype.getToken = function(e, t, r) {
- var n = this
- , o = Object.assign({}, this.client.options, r);
- return this.client._request(y({
- url: o.accessTokenUri,
- method: "POST",
- headers: Object.assign({}, h, {
- Authorization: d(o.clientId, o.clientSecret)
- }),
- body: {
- scope: p(o.scopes),
- username: e,
- password: t,
- grant_type: "password"
- }
- }, o)).then(function(e) {
- return n.client.createToken(e)
- })
- }
- ,
- j.prototype.getUri = function(e) {
- return f(Object.assign({}, this.client.options, e), "token")
- }
- ,
- j.prototype.getToken = function(e, t) {
- var r = Object.assign({}, this.client.options, t)
- , n = "object" == typeof e ? e : s.parse(e, !0)
- , i = s.parse(r.redirectUri);
- if ("string" == typeof n.pathname && n.pathname !== i.pathname)
- return Promise.reject(new TypeError("Redirected path should match configured path, but got: " + n.pathname));
- if (!n.hash && !n.search)
- return Promise.reject(new TypeError("Unable to process uri: " + e));
- var a = Object.assign({}, "string" == typeof n.query ? o.parse(n.query) : n.query || {}, "string" == typeof n.hash ? o.parse(n.hash.substr(1)) : n.hash || {})
- , h = l(a);
- return h ? Promise.reject(h) : null != r.state && a.state !== r.state ? Promise.reject(new TypeError("Invalid state: " + a.state)) : Promise.resolve(this.client.createToken(a))
- }
- ,
- w.prototype.getToken = function(e) {
- var t = this
- , r = Object.assign({}, this.client.options, e);
- return u(r, "clientId", "clientSecret", "accessTokenUri"),
- this.client._request(y({
- url: r.accessTokenUri,
- method: "POST",
- headers: Object.assign({}, h, {
- Authorization: d(r.clientId, r.clientSecret)
- }),
- body: {
- scope: p(r.scopes),
- grant_type: "client_credentials"
- }
- }, r)).then(function(e) {
- return t.client.createToken(e)
- })
- }
- ,
- T.prototype.getUri = function(e) {
- return f(Object.assign({}, this.client.options, e), "code")
- }
- ,
- T.prototype.getToken = function(e, t) {
- var r = this
- , n = Object.assign({}, this.client.options, t);
- u(n, "clientId", "accessTokenUri");
- var i = "object" == typeof e ? e : s.parse(e, !0);
- if ("string" == typeof n.redirectUri && "string" == typeof i.pathname && i.pathname !== s.parse(n.redirectUri).pathname)
- return Promise.reject(new TypeError("Redirected path should match configured path, but got: " + i.pathname));
- if (!i.query)
- return Promise.reject(new TypeError("Unable to process uri: " + e));
- var a = "string" == typeof i.query ? o.parse(i.query) : i.query || {}
- , c = l(a);
- if (c)
- return Promise.reject(c);
- if (null != n.state && a.state !== n.state)
- return Promise.reject(new TypeError("Invalid state: " + a.state));
- if (!a.code)
- return Promise.reject(new TypeError("Missing code, unable to request token"));
- var p = Object.assign({}, h)
- , f = {
- code: a.code,
- grant_type: "authorization_code",
- redirect_uri: n.redirectUri
- };
- return n.clientSecret ? p.Authorization = d(n.clientId, n.clientSecret) : f.client_id = n.clientId,
- this.client._request(y({
- url: n.accessTokenUri,
- method: "POST",
- headers: p,
- body: f
- }, n)).then(function(e) {
- return r.client.createToken(e)
- })
- }
- ,
- O.prototype.getToken = function(e, t) {
- var r = this
- , n = Object.assign({}, this.client.options, t)
- , o = Object.assign({}, h);
- return u(n, "accessTokenUri"),
- n.clientId && (o.Authorization = d(n.clientId, n.clientSecret)),
- this.client._request(y({
- url: n.accessTokenUri,
- method: "POST",
- headers: o,
- body: {
- scope: p(n.scopes),
- grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
- assertion: e
- }
- }, n)).then(function(e) {
- return r.client.createToken(e)
- })
- }
- }
- , function(e, t) {}
- , function(e, t, r) {
- "use strict";
- function n(e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }
- e.exports = function(e, t, r, s) {
- t = t || "&",
- r = r || "=";
- var i = {};
- if ("string" != typeof e || 0 === e.length)
- return i;
- var a = /\+/g;
- e = e.split(t);
- var h = 1e3;
- s && "number" == typeof s.maxKeys && (h = s.maxKeys);
- var c = e.length;
- h > 0 && c > h && (c = h);
- for (var u = 0; u < c; ++u) {
- var l, p, f, d, m = e[u].replace(a, "%20"), y = m.indexOf(r);
- y >= 0 ? (l = m.substr(0, y),
- p = m.substr(y + 1)) : (l = m,
- p = ""),
- f = decodeURIComponent(l),
- d = decodeURIComponent(p),
- n(i, f) ? o(i[f]) ? i[f].push(d) : i[f] = [i[f], d] : i[f] = d
- }
- return i
- }
- ;
- var o = Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- }
- }
- , function(e, t, r) {
- "use strict";
- var n = function(e) {
- switch (typeof e) {
- case "string":
- return e;
- case "boolean":
- return e ? "true" : "false";
- case "number":
- return isFinite(e) ? e : "";
- default:
- return ""
- }
- };
- e.exports = function(e, t, r, a) {
- return t = t || "&",
- r = r || "=",
- null === e && (e = void 0),
- "object" == typeof e ? s(i(e), function(i) {
- var a = encodeURIComponent(n(i)) + r;
- return o(e[i]) ? s(e[i], function(e) {
- return a + encodeURIComponent(n(e))
- }).join(t) : a + encodeURIComponent(n(e[i]))
- }).join(t) : a ? encodeURIComponent(n(a)) + r + encodeURIComponent(n(e)) : ""
- }
- ;
- var o = Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- }
- ;
- function s(e, t) {
- if (e.map)
- return e.map(t);
- for (var r = [], n = 0; n < e.length; n++)
- r.push(t(e[n], n));
- return r
- }
- var i = Object.keys || function(e) {
- var t = [];
- for (var r in e)
- Object.prototype.hasOwnProperty.call(e, r) && t.push(r);
- return t
- }
- }
- , function(e, t, r) {
- "use strict";
- var n = r(7)
- , o = r(10);
- function s() {
- this.protocol = null,
- this.slashes = null,
- this.auth = null,
- this.host = null,
- this.port = null,
- this.hostname = null,
- this.hash = null,
- this.search = null,
- this.query = null,
- this.pathname = null,
- this.path = null,
- this.href = null
- }
- t.parse = b,
- t.resolve = function(e, t) {
- return b(e, !1, !0).resolve(t)
- }
- ,
- t.resolveObject = function(e, t) {
- return e ? b(e, !1, !0).resolveObject(t) : t
- }
- ,
- t.format = function(e) {
- o.isString(e) && (e = b(e));
- return e instanceof s ? e.format() : s.prototype.format.call(e)
- }
- ,
- t.Url = s;
- var i = /^([a-z0-9.+-]+:)/i
- , a = /:[0-9]*$/
- , h = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
- , c = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
- , u = ["'"].concat(c)
- , l = ["%", "/", "?", ";", "#"].concat(u)
- , p = ["/", "?", "#"]
- , f = /^[+a-z0-9A-Z_-]{0,63}$/
- , d = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
- , m = {
- javascript: !0,
- "javascript:": !0
- }
- , y = {
- javascript: !0,
- "javascript:": !0
- }
- , g = {
- http: !0,
- https: !0,
- ftp: !0,
- gopher: !0,
- file: !0,
- "http:": !0,
- "https:": !0,
- "ftp:": !0,
- "gopher:": !0,
- "file:": !0
- }
- , v = r(0);
- function b(e, t, r) {
- if (e && o.isObject(e) && e instanceof s)
- return e;
- var n = new s;
- return n.parse(e, t, r),
- n
- }
- s.prototype.parse = function(e, t, r) {
- if (!o.isString(e))
- throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
- var s = e.indexOf("?")
- , a = -1 !== s && s < e.indexOf("#") ? "?" : "#"
- , c = e.split(a);
- c[0] = c[0].replace(/\\/g, "/");
- var b = e = c.join(a);
- if (b = b.trim(),
- !r && 1 === e.split("#").length) {
- var j = h.exec(b);
- if (j)
- return this.path = b,
- this.href = b,
- this.pathname = j[1],
- j[2] ? (this.search = j[2],
- this.query = t ? v.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
- this.query = {}),
- this
- }
- var w = i.exec(b);
- if (w) {
- var T = (w = w[0]).toLowerCase();
- this.protocol = T,
- b = b.substr(w.length)
- }
- if (r || w || b.match(/^\/\/[^@\/]+@[^@\/]+/)) {
- var O = "//" === b.substr(0, 2);
- !O || w && y[w] || (b = b.substr(2),
- this.slashes = !0)
- }
- if (!y[w] && (O || w && !g[w])) {
- for (var k, x, _ = -1, q = 0; q < p.length; q++) {
- -1 !== (U = b.indexOf(p[q])) && (-1 === _ || U < _) && (_ = U)
- }
- -1 !== (x = -1 === _ ? b.lastIndexOf("@") : b.lastIndexOf("@", _)) && (k = b.slice(0, x),
- b = b.slice(x + 1),
- this.auth = decodeURIComponent(k)),
- _ = -1;
- for (q = 0; q < l.length; q++) {
- var U;
- -1 !== (U = b.indexOf(l[q])) && (-1 === _ || U < _) && (_ = U)
- }
- -1 === _ && (_ = b.length),
- this.host = b.slice(0, _),
- b = b.slice(_),
- this.parseHost(),
- this.hostname = this.hostname || "";
- var I = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
- if (!I)
- for (var P = this.hostname.split(/\./), A = (q = 0,
- P.length); q < A; q++) {
- var S = P[q];
- if (S && !S.match(f)) {
- for (var C = "", z = 0, E = S.length; z < E; z++)
- S.charCodeAt(z) > 127 ? C += "x" : C += S[z];
- if (!C.match(f)) {
- var R = P.slice(0, q)
- , M = P.slice(q + 1)
- , N = S.match(d);
- N && (R.push(N[1]),
- M.unshift(N[2])),
- M.length && (b = "/" + M.join(".") + b),
- this.hostname = R.join(".");
- break
- }
- }
- }
- this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
- I || (this.hostname = n.toASCII(this.hostname));
- var H = this.port ? ":" + this.port : ""
- , L = this.hostname || "";
- this.host = L + H,
- this.href += this.host,
- I && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
- "/" !== b[0] && (b = "/" + b))
- }
- if (!m[T])
- for (q = 0,
- A = u.length; q < A; q++) {
- var F = u[q];
- if (-1 !== b.indexOf(F)) {
- var D = encodeURIComponent(F);
- D === F && (D = escape(F)),
- b = b.split(F).join(D)
- }
- }
- var $ = b.indexOf("#");
- -1 !== $ && (this.hash = b.substr($),
- b = b.slice(0, $));
- var B = b.indexOf("?");
- if (-1 !== B ? (this.search = b.substr(B),
- this.query = b.substr(B + 1),
- t && (this.query = v.parse(this.query)),
- b = b.slice(0, B)) : t && (this.search = "",
- this.query = {}),
- b && (this.pathname = b),
- g[T] && this.hostname && !this.pathname && (this.pathname = "/"),
- this.pathname || this.search) {
- H = this.pathname || "";
- var K = this.search || "";
- this.path = H + K
- }
- return this.href = this.format(),
- this
- }
- ,
- s.prototype.format = function() {
- var e = this.auth || "";
- e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
- e += "@");
- var t = this.protocol || ""
- , r = this.pathname || ""
- , n = this.hash || ""
- , s = !1
- , i = "";
- this.host ? s = e + this.host : this.hostname && (s = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
- this.port && (s += ":" + this.port)),
- this.query && o.isObject(this.query) && Object.keys(this.query).length && (i = v.stringify(this.query));
- var a = this.search || i && "?" + i || "";
- return t && ":" !== t.substr(-1) && (t += ":"),
- this.slashes || (!t || g[t]) && !1 !== s ? (s = "//" + (s || ""),
- r && "/" !== r.charAt(0) && (r = "/" + r)) : s || (s = ""),
- n && "#" !== n.charAt(0) && (n = "#" + n),
- a && "?" !== a.charAt(0) && (a = "?" + a),
- t + s + (r = r.replace(/[?#]/g, function(e) {
- return encodeURIComponent(e)
- })) + (a = a.replace("#", "%23")) + n
- }
- ,
- s.prototype.resolve = function(e) {
- return this.resolveObject(b(e, !1, !0)).format()
- }
- ,
- s.prototype.resolveObject = function(e) {
- if (o.isString(e)) {
- var t = new s;
- t.parse(e, !1, !0),
- e = t
- }
- for (var r = new s, n = Object.keys(this), i = 0; i < n.length; i++) {
- var a = n[i];
- r[a] = this[a]
- }
- if (r.hash = e.hash,
- "" === e.href)
- return r.href = r.format(),
- r;
- if (e.slashes && !e.protocol) {
- for (var h = Object.keys(e), c = 0; c < h.length; c++) {
- var u = h[c];
- "protocol" !== u && (r[u] = e[u])
- }
- return g[r.protocol] && r.hostname && !r.pathname && (r.path = r.pathname = "/"),
- r.href = r.format(),
- r
- }
- if (e.protocol && e.protocol !== r.protocol) {
- if (!g[e.protocol]) {
- for (var l = Object.keys(e), p = 0; p < l.length; p++) {
- var f = l[p];
- r[f] = e[f]
- }
- return r.href = r.format(),
- r
- }
- if (r.protocol = e.protocol,
- e.host || y[e.protocol])
- r.pathname = e.pathname;
- else {
- for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
- ;
- e.host || (e.host = ""),
- e.hostname || (e.hostname = ""),
- "" !== d[0] && d.unshift(""),
- d.length < 2 && d.unshift(""),
- r.pathname = d.join("/")
- }
- if (r.search = e.search,
- r.query = e.query,
- r.host = e.host || "",
- r.auth = e.auth,
- r.hostname = e.hostname || e.host,
- r.port = e.port,
- r.pathname || r.search) {
- var m = r.pathname || ""
- , v = r.search || "";
- r.path = m + v
- }
- return r.slashes = r.slashes || e.slashes,
- r.href = r.format(),
- r
- }
- var b = r.pathname && "/" === r.pathname.charAt(0)
- , j = e.host || e.pathname && "/" === e.pathname.charAt(0)
- , w = j || b || r.host && e.pathname
- , T = w
- , O = r.pathname && r.pathname.split("/") || []
- , k = (d = e.pathname && e.pathname.split("/") || [],
- r.protocol && !g[r.protocol]);
- if (k && (r.hostname = "",
- r.port = null,
- r.host && ("" === O[0] ? O[0] = r.host : O.unshift(r.host)),
- r.host = "",
- e.protocol && (e.hostname = null,
- e.port = null,
- e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
- e.host = null),
- w = w && ("" === d[0] || "" === O[0])),
- j)
- r.host = e.host || "" === e.host ? e.host : r.host,
- r.hostname = e.hostname || "" === e.hostname ? e.hostname : r.hostname,
- r.search = e.search,
- r.query = e.query,
- O = d;
- else if (d.length)
- O || (O = []),
- O.pop(),
- O = O.concat(d),
- r.search = e.search,
- r.query = e.query;
- else if (!o.isNullOrUndefined(e.search)) {
- if (k)
- r.hostname = r.host = O.shift(),
- (I = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = I.shift(),
- r.host = r.hostname = I.shift());
- return r.search = e.search,
- r.query = e.query,
- o.isNull(r.pathname) && o.isNull(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")),
- r.href = r.format(),
- r
- }
- if (!O.length)
- return r.pathname = null,
- r.search ? r.path = "/" + r.search : r.path = null,
- r.href = r.format(),
- r;
- for (var x = O.slice(-1)[0], _ = (r.host || e.host || O.length > 1) && ("." === x || ".." === x) || "" === x, q = 0, U = O.length; U >= 0; U--)
- "." === (x = O[U]) ? O.splice(U, 1) : ".." === x ? (O.splice(U, 1),
- q++) : q && (O.splice(U, 1),
- q--);
- if (!w && !T)
- for (; q--; q)
- O.unshift("..");
- !w || "" === O[0] || O[0] && "/" === O[0].charAt(0) || O.unshift(""),
- _ && "/" !== O.join("/").substr(-1) && O.push("");
- var I, P = "" === O[0] || O[0] && "/" === O[0].charAt(0);
- k && (r.hostname = r.host = P ? "" : O.length ? O.shift() : "",
- (I = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = I.shift(),
- r.host = r.hostname = I.shift()));
- return (w = w || r.host && O.length) && !P && O.unshift(""),
- O.length ? r.pathname = O.join("/") : (r.pathname = null,
- r.path = null),
- o.isNull(r.pathname) && o.isNull(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")),
- r.auth = e.auth || r.auth,
- r.slashes = r.slashes || e.slashes,
- r.href = r.format(),
- r
- }
- ,
- s.prototype.parseHost = function() {
- var e = this.host
- , t = a.exec(e);
- t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
- e = e.substr(0, e.length - t.length)),
- e && (this.hostname = e)
- }
- }
- , function(e, t, r) {
- (function(e, n) {
- var o;
- /*! https://mths.be/punycode v1.4.1 by @mathias */
- !function(s) {
- "object" == typeof t && t && t.nodeType,
- "object" == typeof e && e && e.nodeType;
- var i = "object" == typeof n && n;
- i.global !== i && i.window !== i && i.self;
- var a, h = 2147483647, c = 36, u = 1, l = 26, p = 38, f = 700, d = 72, m = 128, y = "-", g = /^xn--/, v = /[^\x20-\x7E]/, b = /[\x2E\u3002\uFF0E\uFF61]/g, j = {
- overflow: "Overflow: input needs wider integers to process",
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
- "invalid-input": "Invalid input"
- }, w = c - u, T = Math.floor, O = String.fromCharCode;
- function k(e) {
- throw new RangeError(j[e])
- }
- function x(e, t) {
- for (var r = e.length, n = []; r--; )
- n[r] = t(e[r]);
- return n
- }
- function _(e, t) {
- var r = e.split("@")
- , n = "";
- return r.length > 1 && (n = r[0] + "@",
- e = r[1]),
- n + x((e = e.replace(b, ".")).split("."), t).join(".")
- }
- function q(e) {
- for (var t, r, n = [], o = 0, s = e.length; o < s; )
- (t = e.charCodeAt(o++)) >= 55296 && t <= 56319 && o < s ? 56320 == (64512 & (r = e.charCodeAt(o++))) ? n.push(((1023 & t) << 10) + (1023 & r) + 65536) : (n.push(t),
- o--) : n.push(t);
- return n
- }
- function U(e) {
- return x(e, function(e) {
- var t = "";
- return e > 65535 && (t += O((e -= 65536) >>> 10 & 1023 | 55296),
- e = 56320 | 1023 & e),
- t += O(e)
- }).join("")
- }
- function I(e) {
- return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : c
- }
- function P(e, t) {
- return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
- }
- function A(e, t, r) {
- var n = 0;
- for (e = r ? T(e / f) : e >> 1,
- e += T(e / t); e > w * l >> 1; n += c)
- e = T(e / w);
- return T(n + (w + 1) * e / (e + p))
- }
- function S(e) {
- var t, r, n, o, s, i, a, p, f, g, v = [], b = e.length, j = 0, w = m, O = d;
- for ((r = e.lastIndexOf(y)) < 0 && (r = 0),
- n = 0; n < r; ++n)
- e.charCodeAt(n) >= 128 && k("not-basic"),
- v.push(e.charCodeAt(n));
- for (o = r > 0 ? r + 1 : 0; o < b; ) {
- for (s = j,
- i = 1,
- a = c; o >= b && k("invalid-input"),
- ((p = I(e.charCodeAt(o++))) >= c || p > T((h - j) / i)) && k("overflow"),
- j += p * i,
- !(p < (f = a <= O ? u : a >= O + l ? l : a - O)); a += c)
- i > T(h / (g = c - f)) && k("overflow"),
- i *= g;
- O = A(j - s, t = v.length + 1, 0 == s),
- T(j / t) > h - w && k("overflow"),
- w += T(j / t),
- j %= t,
- v.splice(j++, 0, w)
- }
- return U(v)
- }
- function C(e) {
- var t, r, n, o, s, i, a, p, f, g, v, b, j, w, x, _ = [];
- for (b = (e = q(e)).length,
- t = m,
- r = 0,
- s = d,
- i = 0; i < b; ++i)
- (v = e[i]) < 128 && _.push(O(v));
- for (n = o = _.length,
- o && _.push(y); n < b; ) {
- for (a = h,
- i = 0; i < b; ++i)
- (v = e[i]) >= t && v < a && (a = v);
- for (a - t > T((h - r) / (j = n + 1)) && k("overflow"),
- r += (a - t) * j,
- t = a,
- i = 0; i < b; ++i)
- if ((v = e[i]) < t && ++r > h && k("overflow"),
- v == t) {
- for (p = r,
- f = c; !(p < (g = f <= s ? u : f >= s + l ? l : f - s)); f += c)
- x = p - g,
- w = c - g,
- _.push(O(P(g + x % w, 0))),
- p = T(x / w);
- _.push(O(P(p, 0))),
- s = A(r, j, n == o),
- r = 0,
- ++n
- }
- ++r,
- ++t
- }
- return _.join("")
- }
- a = {
- version: "1.4.1",
- ucs2: {
- decode: q,
- encode: U
- },
- decode: S,
- encode: C,
- toASCII: function(e) {
- return _(e, function(e) {
- return v.test(e) ? "xn--" + C(e) : e
- })
- },
- toUnicode: function(e) {
- return _(e, function(e) {
- return g.test(e) ? S(e.slice(4).toLowerCase()) : e
- })
- }
- },
- void 0 === (o = function() {
- return a
- }
- .call(t, r, t, e)) || (e.exports = o)
- }()
- }
- ).call(this, r(8)(e), r(9))
- }
- , function(e, t) {
- e.exports = function(e) {
- return e.webpackPolyfill || (e.deprecate = function() {}
- ,
- e.paths = [],
- e.children || (e.children = []),
- Object.defineProperty(e, "loaded", {
- enumerable: !0,
- get: function() {
- return e.l
- }
- }),
- Object.defineProperty(e, "id", {
- enumerable: !0,
- get: function() {
- return e.i
- }
- }),
- e.webpackPolyfill = 1),
- e
- }
- }
- , function(e, t) {
- var r;
- r = function() {
- return this
- }();
- try {
- r = r || Function("return this")() || (0,
- eval)("this")
- } catch (e) {
- "object" == typeof window && (r = window)
- }
- e.exports = r
- }
- , function(e, t, r) {
- "use strict";
- e.exports = {
- isString: function(e) {
- return "string" == typeof e
- },
- isObject: function(e) {
- return "object" == typeof e && null !== e
- },
- isNull: function(e) {
- return null === e
- },
- isNullOrUndefined: function(e) {
- return null == e
- }
- }
- }
- , function(e, t) {
- e.exports = function(e, t, r, n) {
- return new Promise(function(o, s) {
- var i = new window.XMLHttpRequest;
- i.open(e, t),
- i.onload = function() {
- return o({
- status: i.status,
- body: i.responseText
- })
- }
- ,
- i.onerror = i.onabort = function() {
- return s(new Error(i.statusText || "XHR aborted: " + t))
- }
- ,
- Object.keys(n).forEach(function(e) {
- i.setRequestHeader(e, n[e])
- }),
- i.send(r)
- }
- )
- }
- }
- ]);
Add Comment
Please, Sign In to add comment