Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! function(a) {
- if ("object" == typeof exports && "undefined" != typeof module) module.exports = a();
- else if ("function" == typeof define && define.amd) define([], a);
- else {
- var b;
- b = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, b.io = a()
- }
- }(function() {
- var a;
- return function b(a, c, d) {
- function e(g, h) {
- if (!c[g]) {
- if (!a[g]) {
- var i = "function" == typeof require && require;
- if (!h && i) return i(g, !0);
- if (f) return f(g, !0);
- var j = new Error("Cannot find module '" + g + "'");
- throw j.code = "MODULE_NOT_FOUND", j
- }
- var k = c[g] = {
- exports: {}
- };
- a[g][0].call(k.exports, function(b) {
- var c = a[g][1][b];
- return e(c ? c : b)
- }, k, k.exports, b, a, c, d)
- }
- return c[g].exports
- }
- for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) e(d[g]);
- return e
- }({
- 1: [function(a, b, c) {
- b.exports = a("./lib/")
- }, {
- "./lib/": 2
- }],
- 2: [function(a, b, c) {
- b.exports = a("./socket"), b.exports.parser = a("engine.io-parser")
- }, {
- "./socket": 3,
- "engine.io-parser": 19
- }],
- 3: [function(a, b, c) {
- (function(c) {
- function d(a, b) {
- if (!(this instanceof d)) return new d(a, b);
- b = b || {}, a && "object" == typeof a && (b = a, a = null), a ? (a = k(a), b.hostname = a.host, b.secure = "https" == a.protocol || "wss" == a.protocol, b.port = a.port, a.query && (b.query = a.query)) : b.host && (b.hostname = k(b.host).host), this.secure = null != b.secure ? b.secure : c.location && "https:" == location.protocol, b.hostname && !b.port && (b.port = this.secure ? "443" : "80"), this.agent = b.agent || !1, this.hostname = b.hostname || (c.location ? location.hostname : "localhost"), this.port = b.port || (c.location && location.port ? location.port : this.secure ? 443 : 80), this.query = b.query || {}, "string" == typeof this.query && (this.query = m.decode(this.query)), this.upgrade = !1 !== b.upgrade, this.path = (b.path || "/engine.io").replace(/\/$/, "") + "/", this.forceJSONP = !!b.forceJSONP, this.jsonp = !1 !== b.jsonp, this.forceBase64 = !!b.forceBase64, this.enablesXDR = !!b.enablesXDR, this.timestampParam = b.timestampParam || "t", this.timestampRequests = b.timestampRequests, this.transports = b.transports || ["polling", "websocket"], this.readyState = "", this.writeBuffer = [], this.policyPort = b.policyPort || 843, this.rememberUpgrade = b.rememberUpgrade || !1, this.binaryType = null, this.onlyBinaryUpgrades = b.onlyBinaryUpgrades, this.perMessageDeflate = !1 !== b.perMessageDeflate ? b.perMessageDeflate || {} : !1, !0 === this.perMessageDeflate && (this.perMessageDeflate = {}), this.perMessageDeflate && null == this.perMessageDeflate.threshold && (this.perMessageDeflate.threshold = 1024), this.pfx = b.pfx || null, this.key = b.key || null, this.passphrase = b.passphrase || null, this.cert = b.cert || null, this.ca = b.ca || null, this.ciphers = b.ciphers || null, this.rejectUnauthorized = void 0 === b.rejectUnauthorized ? null : b.rejectUnauthorized;
- var e = "object" == typeof c && c;
- e.global === e && b.extraHeaders && Object.keys(b.extraHeaders).length > 0 && (this.extraHeaders = b.extraHeaders), this.open()
- }
- function e(a) {
- var b = {};
- for (var c in a) a.hasOwnProperty(c) && (b[c] = a[c]);
- return b
- }
- var f = a("./transports"),
- g = a("component-emitter"),
- h = a("debug")("engine.io-client:socket"),
- i = a("indexof"),
- j = a("engine.io-parser"),
- k = a("parseuri"),
- l = a("parsejson"),
- m = a("parseqs");
- b.exports = d, d.priorWebsocketSuccess = !1, g(d.prototype), d.protocol = j.protocol, d.Socket = d, d.Transport = a("./transport"), d.transports = a("./transports"), d.parser = a("engine.io-parser"), d.prototype.createTransport = function(a) {
- h('creating transport "%s"', a);
- var b = e(this.query);
- b.EIO = j.protocol, b.transport = a, this.id && (b.sid = this.id);
- var c = new f[a]({
- agent: this.agent,
- hostname: this.hostname,
- port: this.port,
- secure: this.secure,
- path: this.path,
- query: b,
- forceJSONP: this.forceJSONP,
- jsonp: this.jsonp,
- forceBase64: this.forceBase64,
- enablesXDR: this.enablesXDR,
- timestampRequests: this.timestampRequests,
- timestampParam: this.timestampParam,
- policyPort: this.policyPort,
- socket: this,
- pfx: this.pfx,
- key: this.key,
- passphrase: this.passphrase,
- cert: this.cert,
- ca: this.ca,
- ciphers: this.ciphers,
- rejectUnauthorized: this.rejectUnauthorized,
- perMessageDeflate: this.perMessageDeflate,
- extraHeaders: this.extraHeaders
- });
- return c
- }, d.prototype.open = function() {
- var a;
- if (this.rememberUpgrade && d.priorWebsocketSuccess && -1 != this.transports.indexOf("websocket")) a = "websocket";
- else {
- if (0 === this.transports.length) {
- var b = this;
- return void setTimeout(function() {
- b.emit("error", "No transports available")
- }, 0)
- }
- a = this.transports[0]
- }
- this.readyState = "opening";
- try {
- a = this.createTransport(a)
- } catch (c) {
- return this.transports.shift(), void this.open()
- }
- a.open(), this.setTransport(a)
- }, d.prototype.setTransport = function(a) {
- h("setting transport %s", a.name);
- var b = this;
- this.transport && (h("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = a, a.on("drain", function() {
- b.onDrain()
- }).on("packet", function(a) {
- b.onPacket(a)
- }).on("error", function(a) {
- b.onError(a)
- }).on("close", function() {
- b.onClose("transport close")
- })
- }, d.prototype.probe = function(a) {
- function b() {
- if (m.onlyBinaryUpgrades) {
- var b = !this.supportsBinary && m.transport.supportsBinary;
- l = l || b
- }
- l || (h('probe transport "%s" opened', a), k.send([{
- type: "ping",
- data: "probe"
- }]), k.once("packet", function(b) {
- if (!l)
- if ("pong" == b.type && "probe" == b.data) {
- if (h('probe transport "%s" pong', a), m.upgrading = !0, m.emit("upgrading", k), !k) return;
- d.priorWebsocketSuccess = "websocket" == k.name, h('pausing current transport "%s"', m.transport.name), m.transport.pause(function() {
- l || "closed" != m.readyState && (h("changing transport and sending upgrade packet"), j(), m.setTransport(k), k.send([{
- type: "upgrade"
- }]), m.emit("upgrade", k), k = null, m.upgrading = !1, m.flush())
- })
- } else {
- h('probe transport "%s" failed', a);
- var c = new Error("probe error");
- c.transport = k.name, m.emit("upgradeError", c)
- }
- }))
- }
- function c() {
- l || (l = !0, j(), k.close(), k = null)
- }
- function e(b) {
- var d = new Error("probe error: " + b);
- d.transport = k.name, c(), h('probe transport "%s" failed because of error: %s', a, b), m.emit("upgradeError", d)
- }
- function f() {
- e("transport closed")
- }
- function g() {
- e("socket closed")
- }
- function i(a) {
- k && a.name != k.name && (h('"%s" works - aborting "%s"', a.name, k.name), c())
- }
- function j() {
- k.removeListener("open", b), k.removeListener("error", e), k.removeListener("close", f), m.removeListener("close", g), m.removeListener("upgrading", i)
- }
- h('probing transport "%s"', a);
- var k = this.createTransport(a, {
- probe: 1
- }),
- l = !1,
- m = this;
- d.priorWebsocketSuccess = !1, k.once("open", b), k.once("error", e), k.once("close", f), this.once("close", g), this.once("upgrading", i), k.open()
- }, d.prototype.onOpen = function() {
- if (h("socket open"), this.readyState = "open", d.priorWebsocketSuccess = "websocket" == this.transport.name, this.emit("open"), this.flush(), "open" == this.readyState && this.upgrade && this.transport.pause) {
- h("starting upgrade probes");
- for (var a = 0, b = this.upgrades.length; b > a; a++) this.probe(this.upgrades[a])
- }
- }, d.prototype.onPacket = function(a) {
- if ("opening" == this.readyState || "open" == this.readyState) switch (h('socket receive: type "%s", data "%s"', a.type, a.data), this.emit("packet", a), this.emit("heartbeat"), a.type) {
- case "open":
- this.onHandshake(l(a.data));
- break;
- case "pong":
- this.setPing(), this.emit("pong");
- break;
- case "error":
- var b = new Error("server error");
- b.code = a.data, this.onError(b);
- break;
- case "message":
- this.emit("data", a.data), this.emit("message", a.data)
- } else h('packet received with socket readyState "%s"', this.readyState)
- }, d.prototype.onHandshake = function(a) {
- this.emit("handshake", a), this.id = a.sid, this.transport.query.sid = a.sid, this.upgrades = this.filterUpgrades(a.upgrades), this.pingInterval = a.pingInterval, this.pingTimeout = a.pingTimeout, this.onOpen(), "closed" != this.readyState && (this.setPing(), this.removeListener("heartbeat", this.onHeartbeat), this.on("heartbeat", this.onHeartbeat))
- }, d.prototype.onHeartbeat = function(a) {
- clearTimeout(this.pingTimeoutTimer);
- var b = this;
- b.pingTimeoutTimer = setTimeout(function() {
- "closed" != b.readyState && b.onClose("ping timeout")
- }, a || b.pingInterval + b.pingTimeout)
- }, d.prototype.setPing = function() {
- var a = this;
- clearTimeout(a.pingIntervalTimer), a.pingIntervalTimer = setTimeout(function() {
- h("writing ping packet - expecting pong within %sms", a.pingTimeout), a.ping(), a.onHeartbeat(a.pingTimeout)
- }, a.pingInterval)
- }, d.prototype.ping = function() {
- var a = this;
- this.sendPacket("ping", function() {
- a.emit("ping")
- })
- }, d.prototype.onDrain = function() {
- this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush()
- }, d.prototype.flush = function() {
- "closed" != this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length && (h("flushing %d packets in socket", this.writeBuffer.length), this.transport.send(this.writeBuffer), this.prevBufferLen = this.writeBuffer.length, this.emit("flush"))
- }, d.prototype.write = d.prototype.send = function(a, b, c) {
- return this.sendPacket("message", a, b, c), this
- }, d.prototype.sendPacket = function(a, b, c, d) {
- if ("function" == typeof b && (d = b, b = void 0), "function" == typeof c && (d = c, c = null), "closing" != this.readyState && "closed" != this.readyState) {
- c = c || {}, c.compress = !1 !== c.compress;
- var e = {
- type: a,
- data: b,
- options: c
- };
- this.emit("packetCreate", e), this.writeBuffer.push(e), d && this.once("flush", d), this.flush()
- }
- }, d.prototype.close = function() {
- function a() {
- d.onClose("forced close"), h("socket closing - telling transport to close"), d.transport.close()
- }
- function b() {
- d.removeListener("upgrade", b), d.removeListener("upgradeError", b), a()
- }
- function c() {
- d.once("upgrade", b), d.once("upgradeError", b)
- }
- if ("opening" == this.readyState || "open" == this.readyState) {
- this.readyState = "closing";
- var d = this;
- this.writeBuffer.length ? this.once("drain", function() {
- this.upgrading ? c() : a()
- }) : this.upgrading ? c() : a()
- }
- return this
- }, d.prototype.onError = function(a) {
- h("socket error %j", a), d.priorWebsocketSuccess = !1, this.emit("error", a), this.onClose("transport error", a)
- }, d.prototype.onClose = function(a, b) {
- if ("opening" == this.readyState || "open" == this.readyState || "closing" == this.readyState) {
- h('socket close with reason: "%s"', a);
- var c = this;
- clearTimeout(this.pingIntervalTimer), clearTimeout(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), this.readyState = "closed", this.id = null, this.emit("close", a, b), c.writeBuffer = [], c.prevBufferLen = 0
- }
- }, d.prototype.filterUpgrades = function(a) {
- for (var b = [], c = 0, d = a.length; d > c; c++) ~i(this.transports, a[c]) && b.push(a[c]);
- return b
- }
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "./transport": 4,
- "./transports": 5,
- "component-emitter": 15,
- debug: 17,
- "engine.io-parser": 19,
- indexof: 23,
- parsejson: 26,
- parseqs: 27,
- parseuri: 28
- }],
- 4: [function(a, b, c) {
- function d(a) {
- this.path = a.path, this.hostname = a.hostname, this.port = a.port, this.secure = a.secure, this.query = a.query, this.timestampParam = a.timestampParam, this.timestampRequests = a.timestampRequests, this.readyState = "", this.agent = a.agent || !1, this.socket = a.socket, this.enablesXDR = a.enablesXDR, this.pfx = a.pfx, this.key = a.key, this.passphrase = a.passphrase, this.cert = a.cert, this.ca = a.ca, this.ciphers = a.ciphers, this.rejectUnauthorized = a.rejectUnauthorized, this.extraHeaders = a.extraHeaders
- }
- var e = a("engine.io-parser"),
- f = a("component-emitter");
- b.exports = d, f(d.prototype), d.prototype.onError = function(a, b) {
- var c = new Error(a);
- return c.type = "TransportError", c.description = b, this.emit("error", c), this
- }, d.prototype.open = function() {
- return ("closed" == this.readyState || "" == this.readyState) && (this.readyState = "opening", this.doOpen()), this
- }, d.prototype.close = function() {
- return ("opening" == this.readyState || "open" == this.readyState) && (this.doClose(), this.onClose()), this
- }, d.prototype.send = function(a) {
- if ("open" != this.readyState) throw new Error("Transport not open");
- this.write(a)
- }, d.prototype.onOpen = function() {
- this.readyState = "open", this.writable = !0, this.emit("open")
- }, d.prototype.onData = function(a) {
- var b = e.decodePacket(a, this.socket.binaryType);
- this.onPacket(b)
- }, d.prototype.onPacket = function(a) {
- this.emit("packet", a)
- }, d.prototype.onClose = function() {
- this.readyState = "closed", this.emit("close")
- }
- }, {
- "component-emitter": 15,
- "engine.io-parser": 19
- }],
- 5: [function(a, b, c) {
- (function(b) {
- function d(a) {
- var c, d = !1,
- h = !1,
- i = !1 !== a.jsonp;
- if (b.location) {
- var j = "https:" == location.protocol,
- k = location.port;
- k || (k = j ? 443 : 80), d = a.hostname != location.hostname || k != a.port, h = a.secure != j
- }
- if (a.xdomain = d, a.xscheme = h, c = new e(a), "open" in c && !a.forceJSONP) return new f(a);
- if (!i) throw new Error("JSONP disabled");
- return new g(a)
- }
- var e = a("xmlhttprequest-ssl"),
- f = a("./polling-xhr"),
- g = a("./polling-jsonp"),
- h = a("./websocket");
- c.polling = d, c.websocket = h
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "./polling-jsonp": 6,
- "./polling-xhr": 7,
- "./websocket": 9,
- "xmlhttprequest-ssl": 10
- }],
- 6: [function(a, b, c) {
- (function(c) {
- function d() {}
- function e(a) {
- f.call(this, a), this.query = this.query || {}, h || (c.___eio || (c.___eio = []), h = c.___eio), this.index = h.length;
- var b = this;
- h.push(function(a) {
- b.onData(a)
- }), this.query.j = this.index, c.document && c.addEventListener && c.addEventListener("beforeunload", function() {
- b.script && (b.script.onerror = d)
- }, !1)
- }
- var f = a("./polling"),
- g = a("component-inherit");
- b.exports = e;
- var h, i = /\n/g,
- j = /\\n/g;
- g(e, f), e.prototype.supportsBinary = !1, e.prototype.doClose = function() {
- this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), f.prototype.doClose.call(this)
- }, e.prototype.doPoll = function() {
- var a = this,
- b = document.createElement("script");
- this.script && (this.script.parentNode.removeChild(this.script), this.script = null), b.async = !0, b.src = this.uri(), b.onerror = function(b) {
- a.onError("jsonp poll error", b)
- };
- var c = document.getElementsByTagName("script")[0];
- c ? c.parentNode.insertBefore(b, c) : (document.head || document.body).appendChild(b), this.script = b;
- var d = "undefined" != typeof navigator && /gecko/i.test(navigator.userAgent);
- d && setTimeout(function() {
- var a = document.createElement("iframe");
- document.body.appendChild(a), document.body.removeChild(a)
- }, 100)
- }, e.prototype.doWrite = function(a, b) {
- function c() {
- d(), b()
- }
- function d() {
- if (e.iframe) try {
- e.form.removeChild(e.iframe)
- } catch (a) {
- e.onError("jsonp polling iframe removal error", a)
- }
- try {
- var b = '<iframe src="javascript:0" name="' + e.iframeId + '">';
- f = document.createElement(b)
- } catch (a) {
- f = document.createElement("iframe"), f.name = e.iframeId, f.src = "javascript:0"
- }
- f.id = e.iframeId, e.form.appendChild(f), e.iframe = f
- }
- var e = this;
- if (!this.form) {
- var f, g = document.createElement("form"),
- h = document.createElement("textarea"),
- k = this.iframeId = "eio_iframe_" + this.index;
- g.className = "socketio", g.style.position = "absolute", g.style.top = "-1000px", g.style.left = "-1000px", g.target = k, g.method = "POST", g.setAttribute("accept-charset", "utf-8"), h.name = "d", g.appendChild(h), document.body.appendChild(g), this.form = g, this.area = h
- }
- this.form.action = this.uri(), d(), a = a.replace(j, "\\\n"), this.area.value = a.replace(i, "\\n");
- try {
- this.form.submit()
- } catch (l) {}
- this.iframe.attachEvent ? this.iframe.onreadystatechange = function() {
- "complete" == e.iframe.readyState && c()
- } : this.iframe.onload = c
- }
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "./polling": 8,
- "component-inherit": 16
- }],
- 7: [function(a, b, c) {
- (function(c) {
- function d() {}
- function e(a) {
- if (i.call(this, a), c.location) {
- var b = "https:" == location.protocol,
- d = location.port;
- d || (d = b ? 443 : 80), this.xd = a.hostname != c.location.hostname || d != a.port, this.xs = a.secure != b
- } else this.extraHeaders = a.extraHeaders
- }
- function f(a) {
- this.method = a.method || "GET", this.uri = a.uri, this.xd = !!a.xd, this.xs = !!a.xs, this.async = !1 !== a.async, this.data = void 0 != a.data ? a.data : null, this.agent = a.agent, this.isBinary = a.isBinary, this.supportsBinary = a.supportsBinary, this.enablesXDR = a.enablesXDR, this.pfx = a.pfx, this.key = a.key, this.passphrase = a.passphrase, this.cert = a.cert, this.ca = a.ca, this.ciphers = a.ciphers, this.rejectUnauthorized = a.rejectUnauthorized, this.extraHeaders = a.extraHeaders, this.create()
- }
- function g() {
- for (var a in f.requests) f.requests.hasOwnProperty(a) && f.requests[a].abort()
- }
- var h = a("xmlhttprequest-ssl"),
- i = a("./polling"),
- j = a("component-emitter"),
- k = a("component-inherit"),
- l = a("debug")("engine.io-client:polling-xhr");
- b.exports = e, b.exports.Request = f, k(e, i), e.prototype.supportsBinary = !0, e.prototype.request = function(a) {
- return a = a || {}, a.uri = this.uri(), a.xd = this.xd, a.xs = this.xs, a.agent = this.agent || !1, a.supportsBinary = this.supportsBinary, a.enablesXDR = this.enablesXDR, a.pfx = this.pfx, a.key = this.key, a.passphrase = this.passphrase, a.cert = this.cert, a.ca = this.ca, a.ciphers = this.ciphers, a.rejectUnauthorized = this.rejectUnauthorized, a.extraHeaders = this.extraHeaders, new f(a)
- }, e.prototype.doWrite = function(a, b) {
- var c = "string" != typeof a && void 0 !== a,
- d = this.request({
- method: "POST",
- data: a,
- isBinary: c
- }),
- e = this;
- d.on("success", b), d.on("error", function(a) {
- e.onError("xhr post error", a)
- }), this.sendXhr = d
- }, e.prototype.doPoll = function() {
- l("xhr poll");
- var a = this.request(),
- b = this;
- a.on("data", function(a) {
- b.onData(a)
- }), a.on("error", function(a) {
- b.onError("xhr poll error", a)
- }), this.pollXhr = a
- }, j(f.prototype), f.prototype.create = function() {
- var a = {
- agent: this.agent,
- xdomain: this.xd,
- xscheme: this.xs,
- enablesXDR: this.enablesXDR
- };
- a.pfx = this.pfx, a.key = this.key, a.passphrase = this.passphrase, a.cert = this.cert, a.ca = this.ca, a.ciphers = this.ciphers, a.rejectUnauthorized = this.rejectUnauthorized;
- var b = this.xhr = new h(a),
- d = this;
- try {
- l("xhr open %s: %s", this.method, this.uri), b.open(this.method, this.uri, this.async);
- try {
- if (this.extraHeaders) {
- b.setDisableHeaderCheck(!0);
- for (var e in this.extraHeaders) this.extraHeaders.hasOwnProperty(e) && b.setRequestHeader(e, this.extraHeaders[e])
- }
- } catch (g) {}
- if (this.supportsBinary && (b.responseType = "arraybuffer"), "POST" == this.method) try {
- this.isBinary ? b.setRequestHeader("Content-type", "application/octet-stream") : b.setRequestHeader("Content-type", "text/plain;charset=UTF-8")
- } catch (g) {}
- "withCredentials" in b && (b.withCredentials = !0), this.hasXDR() ? (b.onload = function() {
- d.onLoad()
- }, b.onerror = function() {
- d.onError(b.responseText)
- }) : b.onreadystatechange = function() {
- 4 == b.readyState && (200 == b.status || 1223 == b.status ? d.onLoad() : setTimeout(function() {
- d.onError(b.status)
- }, 0))
- }, l("xhr data %s", this.data), b.send(this.data)
- } catch (g) {
- return void setTimeout(function() {
- d.onError(g)
- }, 0)
- }
- c.document && (this.index = f.requestsCount++, f.requests[this.index] = this)
- }, f.prototype.onSuccess = function() {
- this.emit("success"), this.cleanup()
- }, f.prototype.onData = function(a) {
- this.emit("data", a), this.onSuccess()
- }, f.prototype.onError = function(a) {
- this.emit("error", a), this.cleanup(!0)
- }, f.prototype.cleanup = function(a) {
- if ("undefined" != typeof this.xhr && null !== this.xhr) {
- if (this.hasXDR() ? this.xhr.onload = this.xhr.onerror = d : this.xhr.onreadystatechange = d, a) try {
- this.xhr.abort()
- } catch (b) {}
- c.document && delete f.requests[this.index], this.xhr = null
- }
- }, f.prototype.onLoad = function() {
- var a;
- try {
- var b;
- try {
- b = this.xhr.getResponseHeader("Content-Type").split(";")[0]
- } catch (c) {}
- if ("application/octet-stream" === b) a = this.xhr.response;
- else if (this.supportsBinary) try {
- a = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response))
- } catch (c) {
- for (var d = new Uint8Array(this.xhr.response), e = [], f = 0, g = d.length; g > f; f++) e.push(d[f]);
- a = String.fromCharCode.apply(null, e)
- } else a = this.xhr.responseText
- } catch (c) {
- this.onError(c)
- }
- null != a && this.onData(a)
- }, f.prototype.hasXDR = function() {
- return "undefined" != typeof c.XDomainRequest && !this.xs && this.enablesXDR
- }, f.prototype.abort = function() {
- this.cleanup()
- }, c.document && (f.requestsCount = 0, f.requests = {}, c.attachEvent ? c.attachEvent("onunload", g) : c.addEventListener && c.addEventListener("beforeunload", g, !1))
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "./polling": 8,
- "component-emitter": 15,
- "component-inherit": 16,
- debug: 17,
- "xmlhttprequest-ssl": 10
- }],
- 8: [function(a, b, c) {
- function d(a) {
- var b = a && a.forceBase64;
- (!k || b) && (this.supportsBinary = !1), e.call(this, a)
- }
- var e = a("../transport"),
- f = a("parseqs"),
- g = a("engine.io-parser"),
- h = a("component-inherit"),
- i = a("yeast"),
- j = a("debug")("engine.io-client:polling");
- b.exports = d;
- var k = function() {
- var b = a("xmlhttprequest-ssl"),
- c = new b({
- xdomain: !1
- });
- return null != c.responseType
- }();
- h(d, e), d.prototype.name = "polling", d.prototype.doOpen = function() {
- this.poll()
- }, d.prototype.pause = function(a) {
- function b() {
- j("paused"), c.readyState = "paused", a()
- }
- var c = this;
- if (this.readyState = "pausing", this.polling || !this.writable) {
- var d = 0;
- this.polling && (j("we are currently polling - waiting to pause"), d++, this.once("pollComplete", function() {
- j("pre-pause polling complete"), --d || b()
- })), this.writable || (j("we are currently writing - waiting to pause"), d++, this.once("drain", function() {
- j("pre-pause writing complete"), --d || b()
- }))
- } else b()
- }, d.prototype.poll = function() {
- j("polling"), this.polling = !0, this.doPoll(), this.emit("poll")
- }, d.prototype.onData = function(a) {
- var b = this;
- j("polling got data %s", a);
- var c = function(a, c, d) {
- return "opening" == b.readyState && b.onOpen(), "close" == a.type ? (b.onClose(), !1) : void b.onPacket(a)
- };
- g.decodePayload(a, this.socket.binaryType, c), "closed" != this.readyState && (this.polling = !1, this.emit("pollComplete"), "open" == this.readyState ? this.poll() : j('ignoring poll - transport state "%s"', this.readyState))
- }, d.prototype.doClose = function() {
- function a() {
- j("writing close packet"), b.write([{
- type: "close"
- }])
- }
- var b = this;
- "open" == this.readyState ? (j("transport open - closing"), a()) : (j("transport not open - deferring close"), this.once("open", a))
- }, d.prototype.write = function(a) {
- var b = this;
- this.writable = !1;
- var c = function() {
- b.writable = !0, b.emit("drain")
- },
- b = this;
- g.encodePayload(a, this.supportsBinary, function(a) {
- b.doWrite(a, c)
- })
- }, d.prototype.uri = function() {
- var a = this.query || {},
- b = this.secure ? "https" : "http",
- c = "";
- !1 !== this.timestampRequests && (a[this.timestampParam] = i()), this.supportsBinary || a.sid || (a.b64 = 1), a = f.encode(a), this.port && ("https" == b && 443 != this.port || "http" == b && 80 != this.port) && (c = ":" + this.port), a.length && (a = "?" + a);
- var d = -1 !== this.hostname.indexOf(":");
- return b + "://" + (d ? "[" + this.hostname + "]" : this.hostname) + c + this.path + a
- }
- }, {
- "../transport": 4,
- "component-inherit": 16,
- debug: 17,
- "engine.io-parser": 19,
- parseqs: 27,
- "xmlhttprequest-ssl": 10,
- yeast: 30
- }],
- 9: [function(a, b, c) {
- (function(c) {
- function d(a) {
- var b = a && a.forceBase64;
- b && (this.supportsBinary = !1), this.perMessageDeflate = a.perMessageDeflate, e.call(this, a)
- }
- var e = a("../transport"),
- f = a("engine.io-parser"),
- g = a("parseqs"),
- h = a("component-inherit"),
- i = a("yeast"),
- j = a("debug")("engine.io-client:websocket"),
- k = c.WebSocket || c.MozWebSocket,
- l = k;
- if (!l && "undefined" == typeof window) try {
- l = a("ws")
- } catch (m) {}
- b.exports = d, h(d, e), d.prototype.name = "websocket", d.prototype.supportsBinary = !0, d.prototype.doOpen = function() {
- if (this.check()) {
- var a = this.uri(),
- b = void 0,
- c = {
- agent: this.agent,
- perMessageDeflate: this.perMessageDeflate
- };
- c.pfx = this.pfx, c.key = this.key, c.passphrase = this.passphrase, c.cert = this.cert, c.ca = this.ca, c.ciphers = this.ciphers, c.rejectUnauthorized = this.rejectUnauthorized, this.extraHeaders && (c.headers = this.extraHeaders), this.ws = k ? new l(a) : new l(a, b, c), void 0 === this.ws.binaryType && (this.supportsBinary = !1), this.ws.supports && this.ws.supports.binary ? (this.supportsBinary = !0, this.ws.binaryType = "buffer") : this.ws.binaryType = "arraybuffer", this.addEventListeners()
- }
- }, d.prototype.addEventListeners = function() {
- var a = this;
- this.ws.onopen = function() {
- a.onOpen()
- }, this.ws.onclose = function() {
- a.onClose()
- }, this.ws.onmessage = function(b) {
- a.onData(b.data)
- }, this.ws.onerror = function(b) {
- a.onError("websocket error", b)
- }
- }, "undefined" != typeof navigator && /iPad|iPhone|iPod/i.test(navigator.userAgent) && (d.prototype.onData = function(a) {
- var b = this;
- setTimeout(function() {
- e.prototype.onData.call(b, a)
- }, 0)
- }), d.prototype.write = function(a) {
- function b() {
- d.emit("flush"), setTimeout(function() {
- d.writable = !0, d.emit("drain")
- }, 0)
- }
- var d = this;
- this.writable = !1;
- for (var e = a.length, g = 0, h = e; h > g; g++) ! function(a) {
- f.encodePacket(a, d.supportsBinary, function(f) {
- if (!k) {
- var g = {};
- if (a.options && (g.compress = a.options.compress), d.perMessageDeflate) {
- var h = "string" == typeof f ? c.Buffer.byteLength(f) : f.length;
- h < d.perMessageDeflate.threshold && (g.compress = !1)
- }
- }
- try {
- k ? d.ws.send(f) : d.ws.send(f, g)
- } catch (i) {
- j("websocket closed before onclose event")
- }--e || b()
- })
- }(a[g])
- }, d.prototype.onClose = function() {
- e.prototype.onClose.call(this)
- }, d.prototype.doClose = function() {
- "undefined" != typeof this.ws && this.ws.close()
- }, d.prototype.uri = function() {
- var a = this.query || {},
- b = this.secure ? "wss" : "ws",
- c = "";
- this.port && ("wss" == b && 443 != this.port || "ws" == b && 80 != this.port) && (c = ":" + this.port), this.timestampRequests && (a[this.timestampParam] = i()), this.supportsBinary || (a.b64 = 1), a = g.encode(a), a.length && (a = "?" + a);
- var d = -1 !== this.hostname.indexOf(":");
- return b + "://" + (d ? "[" + this.hostname + "]" : this.hostname) + c + this.path + a
- }, d.prototype.check = function() {
- return !(!l || "__initialize" in l && this.name === d.prototype.name)
- }
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "../transport": 4,
- "component-inherit": 16,
- debug: 17,
- "engine.io-parser": 19,
- parseqs: 27,
- ws: void 0,
- yeast: 30
- }],
- 10: [function(a, b, c) {
- var d = a("has-cors");
- b.exports = function(a) {
- var b = a.xdomain,
- c = a.xscheme,
- e = a.enablesXDR;
- try {
- if ("undefined" != typeof XMLHttpRequest && (!b || d)) return new XMLHttpRequest
- } catch (f) {}
- try {
- if ("undefined" != typeof XDomainRequest && !c && e) return new XDomainRequest
- } catch (f) {}
- if (!b) try {
- return new ActiveXObject("Microsoft.XMLHTTP")
- } catch (f) {}
- }
- }, {
- "has-cors": 22
- }],
- 11: [function(a, b, c) {
- function d(a, b, c) {
- function d(a, e) {
- if (d.count <= 0) throw new Error("after called too many times");
- --d.count, a ? (f = !0, b(a), b = c) : 0 !== d.count || f || b(null, e)
- }
- var f = !1;
- return c = c || e, d.count = a, 0 === a ? b() : d
- }
- function e() {}
- b.exports = d
- }, {}],
- 12: [function(a, b, c) {
- b.exports = function(a, b, c) {
- var d = a.byteLength;
- if (b = b || 0, c = c || d, a.slice) return a.slice(b, c);
- if (0 > b && (b += d), 0 > c && (c += d), c > d && (c = d), b >= d || b >= c || 0 === d) return new ArrayBuffer(0);
- for (var e = new Uint8Array(a), f = new Uint8Array(c - b), g = b, h = 0; c > g; g++, h++) f[h] = e[g];
- return f.buffer
- }
- }, {}],
- 13: [function(a, b, c) {
- ! function(a) {
- "use strict";
- c.encode = function(b) {
- var c, d = new Uint8Array(b),
- e = d.length,
- f = "";
- for (c = 0; e > c; c += 3) f += a[d[c] >> 2], f += a[(3 & d[c]) << 4 | d[c + 1] >> 4], f += a[(15 & d[c + 1]) << 2 | d[c + 2] >> 6], f += a[63 & d[c + 2]];
- return e % 3 === 2 ? f = f.substring(0, f.length - 1) + "=" : e % 3 === 1 && (f = f.substring(0, f.length - 2) + "=="), f
- }, c.decode = function(b) {
- var c, d, e, f, g, h = .75 * b.length,
- i = b.length,
- j = 0;
- "=" === b[b.length - 1] && (h--, "=" === b[b.length - 2] && h--);
- var k = new ArrayBuffer(h),
- l = new Uint8Array(k);
- for (c = 0; i > c; c += 4) d = a.indexOf(b[c]), e = a.indexOf(b[c + 1]), f = a.indexOf(b[c + 2]), g = a.indexOf(b[c + 3]), l[j++] = d << 2 | e >> 4, l[j++] = (15 & e) << 4 | f >> 2, l[j++] = (3 & f) << 6 | 63 & g;
- return k
- }
- }("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
- }, {}],
- 14: [function(a, b, c) {
- (function(a) {
- function c(a) {
- for (var b = 0; b < a.length; b++) {
- var c = a[b];
- if (c.buffer instanceof ArrayBuffer) {
- var d = c.buffer;
- if (c.byteLength !== d.byteLength) {
- var e = new Uint8Array(c.byteLength);
- e.set(new Uint8Array(d, c.byteOffset, c.byteLength)), d = e.buffer
- }
- a[b] = d
- }
- }
- }
- function d(a, b) {
- b = b || {};
- var d = new f;
- c(a);
- for (var e = 0; e < a.length; e++) d.append(a[e]);
- return b.type ? d.getBlob(b.type) : d.getBlob()
- }
- function e(a, b) {
- return c(a), new Blob(a, b || {})
- }
- var f = a.BlobBuilder || a.WebKitBlobBuilder || a.MSBlobBuilder || a.MozBlobBuilder,
- g = function() {
- try {
- var a = new Blob(["hi"]);
- return 2 === a.size
- } catch (b) {
- return !1
- }
- }(),
- h = g && function() {
- try {
- var a = new Blob([new Uint8Array([1, 2])]);
- return 2 === a.size
- } catch (b) {
- return !1
- }
- }(),
- i = f && f.prototype.append && f.prototype.getBlob;
- b.exports = function() {
- return g ? h ? a.Blob : e : i ? d : void 0
- }()
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {}],
- 15: [function(a, b, c) {
- function d(a) {
- return a ? e(a) : void 0
- }
- function e(a) {
- for (var b in d.prototype) a[b] = d.prototype[b];
- return a
- }
- b.exports = d, d.prototype.on = d.prototype.addEventListener = function(a, b) {
- return this._callbacks = this._callbacks || {}, (this._callbacks[a] = this._callbacks[a] || []).push(b), this
- }, d.prototype.once = function(a, b) {
- function c() {
- d.off(a, c), b.apply(this, arguments)
- }
- var d = this;
- return this._callbacks = this._callbacks || {}, c.fn = b, this.on(a, c), this
- }, d.prototype.off = d.prototype.removeListener = d.prototype.removeAllListeners = d.prototype.removeEventListener = function(a, b) {
- if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this;
- var c = this._callbacks[a];
- if (!c) return this;
- if (1 == arguments.length) return delete this._callbacks[a], this;
- for (var d, e = 0; e < c.length; e++)
- if (d = c[e], d === b || d.fn === b) {
- c.splice(e, 1);
- break
- }
- return this
- }, d.prototype.emit = function(a) {
- this._callbacks = this._callbacks || {};
- var b = [].slice.call(arguments, 1),
- c = this._callbacks[a];
- if (c) {
- c = c.slice(0);
- for (var d = 0, e = c.length; e > d; ++d) c[d].apply(this, b)
- }
- return this
- }, d.prototype.listeners = function(a) {
- return this._callbacks = this._callbacks || {}, this._callbacks[a] || []
- }, d.prototype.hasListeners = function(a) {
- return !!this.listeners(a).length
- }
- }, {}],
- 16: [function(a, b, c) {
- b.exports = function(a, b) {
- var c = function() {};
- c.prototype = b.prototype, a.prototype = new c, a.prototype.constructor = a
- }
- }, {}],
- 17: [function(a, b, c) {
- function d() {
- return "WebkitAppearance" in document.documentElement.style || window.console && (console.firebug || console.exception && console.table) || navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31
- }
- function e() {
- var a = arguments,
- b = this.useColors;
- if (a[0] = (b ? "%c" : "") + this.namespace + (b ? " %c" : " ") + a[0] + (b ? "%c " : " ") + "+" + c.humanize(this.diff), !b) return a;
- var d = "color: " + this.color;
- a = [a[0], d, "color: inherit"].concat(Array.prototype.slice.call(a, 1));
- var e = 0,
- f = 0;
- return a[0].replace(/%[a-z%]/g, function(a) {
- "%%" !== a && (e++, "%c" === a && (f = e))
- }), a.splice(f, 0, d), a
- }
- function f() {
- return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments)
- }
- function g(a) {
- try {
- null == a ? c.storage.removeItem("debug") : c.storage.debug = a
- } catch (b) {}
- }
- function h() {
- var a;
- try {
- a = c.storage.debug
- } catch (b) {}
- return a
- }
- function i() {
- try {
- return window.localStorage
- } catch (a) {}
- }
- c = b.exports = a("./debug"), c.log = f, c.formatArgs = e, c.save = g, c.load = h, c.useColors = d, c.storage = "undefined" != typeof chrome && "undefined" != typeof chrome.storage ? chrome.storage.local : i(), c.colors = ["lightseagreen", "forestgreen", "goldenrod", "dodgerblue", "darkorchid", "crimson"], c.formatters.j = function(a) {
- return JSON.stringify(a)
- }, c.enable(h())
- }, {
- "./debug": 18
- }],
- 18: [function(a, b, c) {
- function d() {
- return c.colors[k++ % c.colors.length]
- }
- function e(a) {
- function b() {}
- function e() {
- var a = e,
- b = +new Date,
- f = b - (j || b);
- a.diff = f, a.prev = j, a.curr = b, j = b, null == a.useColors && (a.useColors = c.useColors()), null == a.color && a.useColors && (a.color = d());
- var g = Array.prototype.slice.call(arguments);
- g[0] = c.coerce(g[0]), "string" != typeof g[0] && (g = ["%o"].concat(g));
- var h = 0;
- g[0] = g[0].replace(/%([a-z%])/g, function(b, d) {
- if ("%%" === b) return b;
- h++;
- var e = c.formatters[d];
- if ("function" == typeof e) {
- var f = g[h];
- b = e.call(a, f), g.splice(h, 1), h--
- }
- return b
- }), "function" == typeof c.formatArgs && (g = c.formatArgs.apply(a, g));
- var i = e.log || c.log || console.log.bind(console);
- i.apply(a, g)
- }
- b.enabled = !1, e.enabled = !0;
- var f = c.enabled(a) ? e : b;
- return f.namespace = a, f
- }
- function f(a) {
- c.save(a);
- for (var b = (a || "").split(/[\s,]+/), d = b.length, e = 0; d > e; e++) b[e] && (a = b[e].replace(/\*/g, ".*?"), "-" === a[0] ? c.skips.push(new RegExp("^" + a.substr(1) + "$")) : c.names.push(new RegExp("^" + a + "$")))
- }
- function g() {
- c.enable("")
- }
- function h(a) {
- var b, d;
- for (b = 0, d = c.skips.length; d > b; b++)
- if (c.skips[b].test(a)) return !1;
- for (b = 0, d = c.names.length; d > b; b++)
- if (c.names[b].test(a)) return !0;
- return !1
- }
- function i(a) {
- return a instanceof Error ? a.stack || a.message : a
- }
- c = b.exports = e, c.coerce = i, c.disable = g, c.enable = f, c.enabled = h, c.humanize = a("ms"), c.names = [], c.skips = [], c.formatters = {};
- var j, k = 0
- }, {
- ms: 25
- }],
- 19: [function(a, b, c) {
- (function(b) {
- function d(a, b) {
- var d = "b" + c.packets[a.type] + a.data.data;
- return b(d)
- }
- function e(a, b, d) {
- if (!b) return c.encodeBase64Packet(a, d);
- var e = a.data,
- f = new Uint8Array(e),
- g = new Uint8Array(1 + e.byteLength);
- g[0] = r[a.type];
- for (var h = 0; h < f.length; h++) g[h + 1] = f[h];
- return d(g.buffer)
- }
- function f(a, b, d) {
- if (!b) return c.encodeBase64Packet(a, d);
- var e = new FileReader;
- return e.onload = function() {
- a.data = e.result, c.encodePacket(a, b, !0, d)
- }, e.readAsArrayBuffer(a.data)
- }
- function g(a, b, d) {
- if (!b) return c.encodeBase64Packet(a, d);
- if (q) return f(a, b, d);
- var e = new Uint8Array(1);
- e[0] = r[a.type];
- var g = new u([e.buffer, a.data]);
- return d(g)
- }
- function h(a, b, c) {
- for (var d = new Array(a.length), e = m(a.length, c), f = function(a, c, e) {
- b(c, function(b, c) {
- d[a] = c, e(b, d)
- })
- }, g = 0; g < a.length; g++) f(g, a[g], e)
- }
- var i = a("./keys"),
- j = a("has-binary"),
- k = a("arraybuffer.slice"),
- l = a("base64-arraybuffer"),
- m = a("after"),
- n = a("utf8"),
- o = navigator.userAgent.match(/Android/i),
- p = /PhantomJS/i.test(navigator.userAgent),
- q = o || p;
- c.protocol = 3;
- var r = c.packets = {
- open: 0,
- close: 1,
- ping: 2,
- pong: 3,
- message: 4,
- upgrade: 5,
- noop: 6
- },
- s = i(r),
- t = {
- type: "error",
- data: "parser error"
- },
- u = a("blob");
- c.encodePacket = function(a, c, f, h) {
- "function" == typeof c && (h = c, c = !1), "function" == typeof f && (h = f, f = null);
- var i = void 0 === a.data ? void 0 : a.data.buffer || a.data;
- if (b.ArrayBuffer && i instanceof ArrayBuffer) return e(a, c, h);
- if (u && i instanceof b.Blob) return g(a, c, h);
- if (i && i.base64) return d(a, h);
- var j = r[a.type];
- return void 0 !== a.data && (j += f ? n.encode(String(a.data)) : String(a.data)), h("" + j)
- }, c.encodeBase64Packet = function(a, d) {
- var e = "b" + c.packets[a.type];
- if (u && a.data instanceof b.Blob) {
- var f = new FileReader;
- return f.onload = function() {
- var a = f.result.split(",")[1];
- d(e + a)
- }, f.readAsDataURL(a.data)
- }
- var g;
- try {
- g = String.fromCharCode.apply(null, new Uint8Array(a.data))
- } catch (h) {
- for (var i = new Uint8Array(a.data), j = new Array(i.length), k = 0; k < i.length; k++) j[k] = i[k];
- g = String.fromCharCode.apply(null, j)
- }
- return e += b.btoa(g), d(e)
- }, c.decodePacket = function(a, b, d) {
- if ("string" == typeof a || void 0 === a) {
- if ("b" == a.charAt(0)) return c.decodeBase64Packet(a.substr(1), b);
- if (d) try {
- a = n.decode(a)
- } catch (e) {
- return t
- }
- var f = a.charAt(0);
- return Number(f) == f && s[f] ? a.length > 1 ? {
- type: s[f],
- data: a.substring(1)
- } : {
- type: s[f]
- } : t
- }
- var g = new Uint8Array(a),
- f = g[0],
- h = k(a, 1);
- return u && "blob" === b && (h = new u([h])), {
- type: s[f],
- data: h
- }
- }, c.decodeBase64Packet = function(a, c) {
- var d = s[a.charAt(0)];
- if (!b.ArrayBuffer) return {
- type: d,
- data: {
- base64: !0,
- data: a.substr(1)
- }
- };
- var e = l.decode(a.substr(1));
- return "blob" === c && u && (e = new u([e])), {
- type: d,
- data: e
- }
- }, c.encodePayload = function(a, b, d) {
- function e(a) {
- return a.length + ":" + a
- }
- function f(a, d) {
- c.encodePacket(a, g ? b : !1, !0, function(a) {
- d(null, e(a))
- })
- }
- "function" == typeof b && (d = b, b = null);
- var g = j(a);
- return b && g ? u && !q ? c.encodePayloadAsBlob(a, d) : c.encodePayloadAsArrayBuffer(a, d) : a.length ? void h(a, f, function(a, b) {
- return d(b.join(""))
- }) : d("0:")
- }, c.decodePayload = function(a, b, d) {
- if ("string" != typeof a) return c.decodePayloadAsBinary(a, b, d);
- "function" == typeof b && (d = b, b = null);
- var e;
- if ("" == a) return d(t, 0, 1);
- for (var f, g, h = "", i = 0, j = a.length; j > i; i++) {
- var k = a.charAt(i);
- if (":" != k) h += k;
- else {
- if ("" == h || h != (f = Number(h))) return d(t, 0, 1);
- if (g = a.substr(i + 1, f), h != g.length) return d(t, 0, 1);
- if (g.length) {
- if (e = c.decodePacket(g, b, !0), t.type == e.type && t.data == e.data) return d(t, 0, 1);
- var l = d(e, i + f, j);
- if (!1 === l) return
- }
- i += f, h = ""
- }
- }
- return "" != h ? d(t, 0, 1) : void 0
- }, c.encodePayloadAsArrayBuffer = function(a, b) {
- function d(a, b) {
- c.encodePacket(a, !0, !0, function(a) {
- return b(null, a)
- })
- }
- return a.length ? void h(a, d, function(a, c) {
- var d = c.reduce(function(a, b) {
- var c;
- return c = "string" == typeof b ? b.length : b.byteLength, a + c.toString().length + c + 2
- }, 0),
- e = new Uint8Array(d),
- f = 0;
- return c.forEach(function(a) {
- var b = "string" == typeof a,
- c = a;
- if (b) {
- for (var d = new Uint8Array(a.length), g = 0; g < a.length; g++) d[g] = a.charCodeAt(g);
- c = d.buffer
- }
- b ? e[f++] = 0 : e[f++] = 1;
- for (var h = c.byteLength.toString(), g = 0; g < h.length; g++) e[f++] = parseInt(h[g]);
- e[f++] = 255;
- for (var d = new Uint8Array(c), g = 0; g < d.length; g++) e[f++] = d[g]
- }), b(e.buffer)
- }) : b(new ArrayBuffer(0))
- }, c.encodePayloadAsBlob = function(a, b) {
- function d(a, b) {
- c.encodePacket(a, !0, !0, function(a) {
- var c = new Uint8Array(1);
- if (c[0] = 1, "string" == typeof a) {
- for (var d = new Uint8Array(a.length), e = 0; e < a.length; e++) d[e] = a.charCodeAt(e);
- a = d.buffer, c[0] = 0
- }
- for (var f = a instanceof ArrayBuffer ? a.byteLength : a.size, g = f.toString(), h = new Uint8Array(g.length + 1), e = 0; e < g.length; e++) h[e] = parseInt(g[e]);
- if (h[g.length] = 255, u) {
- var i = new u([c.buffer, h.buffer, a]);
- b(null, i)
- }
- })
- }
- h(a, d, function(a, c) {
- return b(new u(c))
- })
- }, c.decodePayloadAsBinary = function(a, b, d) {
- "function" == typeof b && (d = b, b = null);
- for (var e = a, f = [], g = !1; e.byteLength > 0;) {
- for (var h = new Uint8Array(e), i = 0 === h[0], j = "", l = 1; 255 != h[l]; l++) {
- if (j.length > 310) {
- g = !0;
- break
- }
- j += h[l]
- }
- if (g) return d(t, 0, 1);
- e = k(e, 2 + j.length), j = parseInt(j);
- var m = k(e, 0, j);
- if (i) try {
- m = String.fromCharCode.apply(null, new Uint8Array(m))
- } catch (n) {
- var o = new Uint8Array(m);
- m = "";
- for (var l = 0; l < o.length; l++) m += String.fromCharCode(o[l])
- }
- f.push(m), e = k(e, j)
- }
- var p = f.length;
- f.forEach(function(a, e) {
- d(c.decodePacket(a, b, !0), e, p)
- })
- }
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "./keys": 20,
- after: 11,
- "arraybuffer.slice": 12,
- "base64-arraybuffer": 13,
- blob: 14,
- "has-binary": 21,
- utf8: 29
- }],
- 20: [function(a, b, c) {
- b.exports = Object.keys || function(a) {
- var b = [],
- c = Object.prototype.hasOwnProperty;
- for (var d in a) c.call(a, d) && b.push(d);
- return b
- }
- }, {}],
- 21: [function(a, b, c) {
- (function(c) {
- function d(a) {
- function b(a) {
- if (!a) return !1;
- if (c.Buffer && c.Buffer.isBuffer(a) || c.ArrayBuffer && a instanceof ArrayBuffer || c.Blob && a instanceof Blob || c.File && a instanceof File) return !0;
- if (e(a)) {
- for (var d = 0; d < a.length; d++)
- if (b(a[d])) return !0
- } else if (a && "object" == typeof a) {
- a.toJSON && (a = a.toJSON());
- for (var f in a)
- if (Object.prototype.hasOwnProperty.call(a, f) && b(a[f])) return !0
- }
- return !1
- }
- return b(a)
- }
- var e = a("isarray");
- b.exports = d
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- isarray: 24
- }],
- 22: [function(a, b, c) {
- try {
- b.exports = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest
- } catch (d) {
- b.exports = !1
- }
- }, {}],
- 23: [function(a, b, c) {
- var d = [].indexOf;
- b.exports = function(a, b) {
- if (d) return a.indexOf(b);
- for (var c = 0; c < a.length; ++c)
- if (a[c] === b) return c;
- return -1
- }
- }, {}],
- 24: [function(a, b, c) {
- b.exports = Array.isArray || function(a) {
- return "[object Array]" == Object.prototype.toString.call(a)
- }
- }, {}],
- 25: [function(a, b, c) {
- function d(a) {
- if (a = "" + a, !(a.length > 1e4)) {
- var b = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(a);
- if (b) {
- var c = parseFloat(b[1]),
- d = (b[2] || "ms").toLowerCase();
- switch (d) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return c * l;
- case "days":
- case "day":
- case "d":
- return c * k;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return c * j;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return c * i;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return c * h;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return c
- }
- }
- }
- }
- function e(a) {
- return a >= k ? Math.round(a / k) + "d" : a >= j ? Math.round(a / j) + "h" : a >= i ? Math.round(a / i) + "m" : a >= h ? Math.round(a / h) + "s" : a + "ms"
- }
- function f(a) {
- return g(a, k, "day") || g(a, j, "hour") || g(a, i, "minute") || g(a, h, "second") || a + " ms"
- }
- function g(a, b, c) {
- return b > a ? void 0 : 1.5 * b > a ? Math.floor(a / b) + " " + c : Math.ceil(a / b) + " " + c + "s"
- }
- var h = 1e3,
- i = 60 * h,
- j = 60 * i,
- k = 24 * j,
- l = 365.25 * k;
- b.exports = function(a, b) {
- return b = b || {}, "string" == typeof a ? d(a) : b["long"] ? f(a) : e(a)
- }
- }, {}],
- 26: [function(a, b, c) {
- (function(a) {
- var c = /^[\],:{}\s]*$/,
- d = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- e = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- f = /(?:^|:|,)(?:\s*\[)+/g,
- g = /^\s+/,
- h = /\s+$/;
- b.exports = function(b) {
- return "string" == typeof b && b ? (b = b.replace(g, "").replace(h, ""), a.JSON && JSON.parse ? JSON.parse(b) : c.test(b.replace(d, "@").replace(e, "]").replace(f, "")) ? new Function("return " + b)() : void 0) : null
- }
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {}],
- 27: [function(a, b, c) {
- c.encode = function(a) {
- var b = "";
- for (var c in a) a.hasOwnProperty(c) && (b.length && (b += "&"), b += encodeURIComponent(c) + "=" + encodeURIComponent(a[c]));
- return b
- }, c.decode = function(a) {
- for (var b = {}, c = a.split("&"), d = 0, e = c.length; e > d; d++) {
- var f = c[d].split("=");
- b[decodeURIComponent(f[0])] = decodeURIComponent(f[1])
- }
- return b
- }
- }, {}],
- 28: [function(a, b, c) {
- var d = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
- e = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"];
- b.exports = function(a) {
- var b = a,
- c = a.indexOf("["),
- f = a.indexOf("]"); - 1 != c && -1 != f && (a = a.substring(0, c) + a.substring(c, f).replace(/:/g, ";") + a.substring(f, a.length));
- for (var g = d.exec(a || ""), h = {}, i = 14; i--;) h[e[i]] = g[i] || "";
- return -1 != c && -1 != f && (h.source = b, h.host = h.host.substring(1, h.host.length - 1).replace(/;/g, ":"), h.authority = h.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), h.ipv6uri = !0), h
- }
- }, {}],
- 29: [function(b, c, d) {
- (function(b) {
- ! function(e) {
- function f(a) {
- for (var b, c, d = [], e = 0, f = a.length; f > e;) b = a.charCodeAt(e++), b >= 55296 && 56319 >= b && f > e ? (c = a.charCodeAt(e++), 56320 == (64512 & c) ? d.push(((1023 & b) << 10) + (1023 & c) + 65536) : (d.push(b), e--)) : d.push(b);
- return d
- }
- function g(a) {
- for (var b, c = a.length, d = -1, e = ""; ++d < c;) b = a[d], b > 65535 && (b -= 65536, e += u(b >>> 10 & 1023 | 55296), b = 56320 | 1023 & b), e += u(b);
- return e
- }
- function h(a) {
- if (a >= 55296 && 57343 >= a) throw Error("Lone surrogate U+" + a.toString(16).toUpperCase() + " is not a scalar value")
- }
- function i(a, b) {
- return u(a >> b & 63 | 128)
- }
- function j(a) {
- if (0 == (4294967168 & a)) return u(a);
- var b = "";
- return 0 == (4294965248 & a) ? b = u(a >> 6 & 31 | 192) : 0 == (4294901760 & a) ? (h(a), b = u(a >> 12 & 15 | 224), b += i(a, 6)) : 0 == (4292870144 & a) && (b = u(a >> 18 & 7 | 240), b += i(a, 12), b += i(a, 6)), b += u(63 & a | 128)
- }
- function k(a) {
- for (var b, c = f(a), d = c.length, e = -1, g = ""; ++e < d;) b = c[e], g += j(b);
- return g
- }
- function l() {
- if (t >= s) throw Error("Invalid byte index");
- var a = 255 & r[t];
- if (t++, 128 == (192 & a)) return 63 & a;
- throw Error("Invalid continuation byte")
- }
- function m() {
- var a, b, c, d, e;
- if (t > s) throw Error("Invalid byte index");
- if (t == s) return !1;
- if (a = 255 & r[t], t++, 0 == (128 & a)) return a;
- if (192 == (224 & a)) {
- var b = l();
- if (e = (31 & a) << 6 | b, e >= 128) return e;
- throw Error("Invalid continuation byte")
- }
- if (224 == (240 & a)) {
- if (b = l(), c = l(), e = (15 & a) << 12 | b << 6 | c, e >= 2048) return h(e), e;
- throw Error("Invalid continuation byte")
- }
- if (240 == (248 & a) && (b = l(), c = l(), d = l(), e = (15 & a) << 18 | b << 12 | c << 6 | d, e >= 65536 && 1114111 >= e)) return e;
- throw Error("Invalid UTF-8 detected")
- }
- function n(a) {
- r = f(a), s = r.length, t = 0;
- for (var b, c = [];
- (b = m()) !== !1;) c.push(b);
- return g(c)
- }
- var o = "object" == typeof d && d,
- p = "object" == typeof c && c && c.exports == o && c,
- q = "object" == typeof b && b;
- (q.global === q || q.window === q) && (e = q);
- var r, s, t, u = String.fromCharCode,
- v = {
- version: "2.0.0",
- encode: k,
- decode: n
- };
- if ("function" == typeof a && "object" == typeof a.amd && a.amd) a(function() {
- return v
- });
- else if (o && !o.nodeType)
- if (p) p.exports = v;
- else {
- var w = {},
- x = w.hasOwnProperty;
- for (var y in v) x.call(v, y) && (o[y] = v[y])
- } else e.utf8 = v
- }(this)
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {}],
- 30: [function(a, b, c) {
- "use strict";
- function d(a) {
- var b = "";
- do b = h[a % i] + b, a = Math.floor(a / i); while (a > 0);
- return b
- }
- function e(a) {
- var b = 0;
- for (l = 0; l < a.length; l++) b = b * i + j[a.charAt(l)];
- return b
- }
- function f() {
- var a = d(+new Date);
- return a !== g ? (k = 0, g = a) : a + "." + d(k++)
- }
- for (var g, h = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), i = 64, j = {}, k = 0, l = 0; i > l; l++) j[h[l]] = l;
- f.encode = d, f.decode = e, b.exports = f
- }, {}],
- 31: [function(a, b, c) {
- function d(a, b) {
- "object" == typeof a && (b = a, a = void 0), b = b || {};
- var c, d = e(a),
- f = d.source,
- j = d.id,
- k = d.path,
- l = i[j] && k in i[j].nsps,
- m = b.forceNew || b["force new connection"] || !1 === b.multiplex || l;
- return m ? (h("ignoring socket cache for %s", f), c = g(f, b)) : (i[j] || (h("new io instance for %s", f), i[j] = g(f, b)), c = i[j]), c.socket(d.path)
- }
- var e = a("./url"),
- f = a("socket.io-parser"),
- g = a("./manager"),
- h = a("debug")("socket.io-client");
- b.exports = c = d;
- var i = c.managers = {};
- c.protocol = f.protocol, c.connect = d, c.Manager = a("./manager"), c.Socket = a("./socket")
- }, {
- "./manager": 32,
- "./socket": 34,
- "./url": 35,
- debug: 39,
- "socket.io-parser": 47
- }],
- 32: [function(a, b, c) {
- function d(a, b) {
- return this instanceof d ? (a && "object" == typeof a && (b = a, a = void 0), b = b || {}, b.path = b.path || "/socket.io", this.nsps = {}, this.subs = [], this.opts = b, this.reconnection(b.reconnection !== !1), this.reconnectionAttempts(b.reconnectionAttempts || 1 / 0), this.reconnectionDelay(b.reconnectionDelay || 1e3), this.reconnectionDelayMax(b.reconnectionDelayMax || 5e3), this.randomizationFactor(b.randomizationFactor || .5), this.backoff = new m({
- min: this.reconnectionDelay(),
- max: this.reconnectionDelayMax(),
- jitter: this.randomizationFactor()
- }), this.timeout(null == b.timeout ? 2e4 : b.timeout), this.readyState = "closed", this.uri = a, this.connecting = [], this.lastPing = null, this.encoding = !1, this.packetBuffer = [], this.encoder = new h.Encoder, this.decoder = new h.Decoder, this.autoConnect = b.autoConnect !== !1, void(this.autoConnect && this.open())) : new d(a, b)
- }
- var e = a("engine.io-client"),
- f = a("./socket"),
- g = a("component-emitter"),
- h = a("socket.io-parser"),
- i = a("./on"),
- j = a("component-bind"),
- k = a("debug")("socket.io-client:manager"),
- l = a("indexof"),
- m = a("backo2"),
- n = Object.prototype.hasOwnProperty;
- b.exports = d, d.prototype.emitAll = function() {
- this.emit.apply(this, arguments);
- for (var a in this.nsps) n.call(this.nsps, a) && this.nsps[a].emit.apply(this.nsps[a], arguments)
- }, d.prototype.updateSocketIds = function() {
- for (var a in this.nsps) n.call(this.nsps, a) && (this.nsps[a].id = this.engine.id)
- }, g(d.prototype), d.prototype.reconnection = function(a) {
- return arguments.length ? (this._reconnection = !!a, this) : this._reconnection
- }, d.prototype.reconnectionAttempts = function(a) {
- return arguments.length ? (this._reconnectionAttempts = a, this) : this._reconnectionAttempts
- }, d.prototype.reconnectionDelay = function(a) {
- return arguments.length ? (this._reconnectionDelay = a, this.backoff && this.backoff.setMin(a), this) : this._reconnectionDelay
- }, d.prototype.randomizationFactor = function(a) {
- return arguments.length ? (this._randomizationFactor = a, this.backoff && this.backoff.setJitter(a), this) : this._randomizationFactor
- }, d.prototype.reconnectionDelayMax = function(a) {
- return arguments.length ? (this._reconnectionDelayMax = a, this.backoff && this.backoff.setMax(a), this) : this._reconnectionDelayMax
- }, d.prototype.timeout = function(a) {
- return arguments.length ? (this._timeout = a, this) : this._timeout
- }, d.prototype.maybeReconnectOnOpen = function() {
- !this.reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect()
- }, d.prototype.open = d.prototype.connect = function(a) {
- if (k("readyState %s", this.readyState), ~this.readyState.indexOf("open")) return this;
- k("opening %s", this.uri), this.engine = e(this.uri, this.opts);
- var b = this.engine,
- c = this;
- this.readyState = "opening", this.skipReconnect = !1;
- var d = i(b, "open", function() {
- c.onopen(), a && a()
- }),
- f = i(b, "error", function(b) {
- if (k("connect_error"), c.cleanup(), c.readyState = "closed", c.emitAll("connect_error", b), a) {
- var d = new Error("Connection error");
- d.data = b, a(d)
- } else c.maybeReconnectOnOpen()
- });
- if (!1 !== this._timeout) {
- var g = this._timeout;
- k("connect attempt will timeout after %d", g);
- var h = setTimeout(function() {
- k("connect attempt timed out after %d", g), d.destroy(), b.close(), b.emit("error", "timeout"), c.emitAll("connect_timeout", g)
- }, g);
- this.subs.push({
- destroy: function() {
- clearTimeout(h)
- }
- })
- }
- return this.subs.push(d), this.subs.push(f), this
- }, d.prototype.onopen = function() {
- k("open"), this.cleanup(), this.readyState = "open", this.emit("open");
- var a = this.engine;
- this.subs.push(i(a, "data", j(this, "ondata"))), this.subs.push(i(a, "ping", j(this, "onping"))), this.subs.push(i(a, "pong", j(this, "onpong"))), this.subs.push(i(a, "error", j(this, "onerror"))), this.subs.push(i(a, "close", j(this, "onclose"))), this.subs.push(i(this.decoder, "decoded", j(this, "ondecoded")))
- }, d.prototype.onping = function() {
- this.lastPing = new Date, this.emitAll("ping")
- }, d.prototype.onpong = function() {
- this.emitAll("pong", new Date - this.lastPing)
- }, d.prototype.ondata = function(a) {
- this.decoder.add(a)
- }, d.prototype.ondecoded = function(a) {
- this.emit("packet", a)
- }, d.prototype.onerror = function(a) {
- k("error", a), this.emitAll("error", a)
- }, d.prototype.socket = function(a) {
- function b() {
- ~l(d.connecting, c) || d.connecting.push(c)
- }
- var c = this.nsps[a];
- if (!c) {
- c = new f(this, a), this.nsps[a] = c;
- var d = this;
- c.on("connecting", b), c.on("connect", function() {
- c.id = d.engine.id
- }), this.autoConnect && b()
- }
- return c
- }, d.prototype.destroy = function(a) {
- var b = l(this.connecting, a);
- ~b && this.connecting.splice(b, 1), this.connecting.length || this.close()
- }, d.prototype.packet = function(a) {
- k("writing packet %j", a);
- var b = this;
- b.encoding ? b.packetBuffer.push(a) : (b.encoding = !0, this.encoder.encode(a, function(c) {
- for (var d = 0; d < c.length; d++) b.engine.write(c[d], a.options);
- b.encoding = !1, b.processPacketQueue()
- }))
- }, d.prototype.processPacketQueue = function() {
- if (this.packetBuffer.length > 0 && !this.encoding) {
- var a = this.packetBuffer.shift();
- this.packet(a)
- }
- }, d.prototype.cleanup = function() {
- k("cleanup");
- for (var a; a = this.subs.shift();) a.destroy();
- this.packetBuffer = [], this.encoding = !1, this.lastPing = null, this.decoder.destroy()
- }, d.prototype.close = d.prototype.disconnect = function() {
- k("disconnect"), this.skipReconnect = !0, this.reconnecting = !1, "opening" == this.readyState && this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.engine && this.engine.close()
- }, d.prototype.onclose = function(a) {
- k("onclose"), this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.emit("close", a), this._reconnection && !this.skipReconnect && this.reconnect()
- }, d.prototype.reconnect = function() {
- if (this.reconnecting || this.skipReconnect) return this;
- var a = this;
- if (this.backoff.attempts >= this._reconnectionAttempts) k("reconnect failed"), this.backoff.reset(), this.emitAll("reconnect_failed"), this.reconnecting = !1;
- else {
- var b = this.backoff.duration();
- k("will wait %dms before reconnect attempt", b), this.reconnecting = !0;
- var c = setTimeout(function() {
- a.skipReconnect || (k("attempting reconnect"), a.emitAll("reconnect_attempt", a.backoff.attempts), a.emitAll("reconnecting", a.backoff.attempts), a.skipReconnect || a.open(function(b) {
- b ? (k("reconnect attempt error"), a.reconnecting = !1, a.reconnect(), a.emitAll("reconnect_error", b.data)) : (k("reconnect success"), a.onreconnect())
- }))
- }, b);
- this.subs.push({
- destroy: function() {
- clearTimeout(c)
- }
- })
- }
- }, d.prototype.onreconnect = function() {
- var a = this.backoff.attempts;
- this.reconnecting = !1, this.backoff.reset(), this.updateSocketIds(), this.emitAll("reconnect", a)
- }
- }, {
- "./on": 33,
- "./socket": 34,
- backo2: 36,
- "component-bind": 37,
- "component-emitter": 38,
- debug: 39,
- "engine.io-client": 1,
- indexof: 42,
- "socket.io-parser": 47
- }],
- 33: [function(a, b, c) {
- function d(a, b, c) {
- return a.on(b, c), {
- destroy: function() {
- a.removeListener(b, c)
- }
- }
- }
- b.exports = d
- }, {}],
- 34: [function(a, b, c) {
- function d(a, b) {
- this.io = a, this.nsp = b, this.json = this, this.ids = 0, this.acks = {}, this.receiveBuffer = [], this.sendBuffer = [], this.connected = !1, this.disconnected = !0, this.io.autoConnect && this.open()
- }
- var e = a("socket.io-parser"),
- f = a("component-emitter"),
- g = a("to-array"),
- h = a("./on"),
- i = a("component-bind"),
- j = a("debug")("socket.io-client:socket"),
- k = a("has-binary");
- b.exports = c = d;
- var l = {
- connect: 1,
- connect_error: 1,
- connect_timeout: 1,
- connecting: 1,
- disconnect: 1,
- error: 1,
- reconnect: 1,
- reconnect_attempt: 1,
- reconnect_failed: 1,
- reconnect_error: 1,
- reconnecting: 1,
- ping: 1,
- pong: 1
- },
- m = f.prototype.emit;
- f(d.prototype), d.prototype.subEvents = function() {
- if (!this.subs) {
- var a = this.io;
- this.subs = [h(a, "open", i(this, "onopen")), h(a, "packet", i(this, "onpacket")), h(a, "close", i(this, "onclose"))]
- }
- }, d.prototype.open = d.prototype.connect = function() {
- return this.connected ? this : (this.subEvents(), this.io.open(), "open" == this.io.readyState && this.onopen(), this.emit("connecting"), this)
- }, d.prototype.send = function() {
- var a = g(arguments);
- return a.unshift("message"), this.emit.apply(this, a), this
- }, d.prototype.emit = function(a) {
- if (l.hasOwnProperty(a)) return m.apply(this, arguments), this;
- var b = g(arguments),
- c = e.EVENT;
- k(b) && (c = e.BINARY_EVENT);
- var d = {
- type: c,
- data: b
- };
- return d.options = {}, d.options.compress = !this.flags || !1 !== this.flags.compress, "function" == typeof b[b.length - 1] && (j("emitting packet with ack id %d", this.ids), this.acks[this.ids] = b.pop(), d.id = this.ids++), this.connected ? this.packet(d) : this.sendBuffer.push(d), delete this.flags, this
- }, d.prototype.packet = function(a) {
- a.nsp = this.nsp, this.io.packet(a)
- }, d.prototype.onopen = function() {
- j("transport is open - connecting"), "/" != this.nsp && this.packet({
- type: e.CONNECT
- })
- }, d.prototype.onclose = function(a) {
- j("close (%s)", a), this.connected = !1, this.disconnected = !0, delete this.id, this.emit("disconnect", a)
- }, d.prototype.onpacket = function(a) {
- if (a.nsp == this.nsp) switch (a.type) {
- case e.CONNECT:
- this.onconnect();
- break;
- case e.EVENT:
- this.onevent(a);
- break;
- case e.BINARY_EVENT:
- this.onevent(a);
- break;
- case e.ACK:
- this.onack(a);
- break;
- case e.BINARY_ACK:
- this.onack(a);
- break;
- case e.DISCONNECT:
- this.ondisconnect();
- break;
- case e.ERROR:
- this.emit("error", a.data)
- }
- }, d.prototype.onevent = function(a) {
- var b = a.data || [];
- j("emitting event %j", b), null != a.id && (j("attaching ack callback to event"), b.push(this.ack(a.id))), this.connected ? m.apply(this, b) : this.receiveBuffer.push(b)
- }, d.prototype.ack = function(a) {
- var b = this,
- c = !1;
- return function() {
- if (!c) {
- c = !0;
- var d = g(arguments);
- j("sending ack %j", d);
- var f = k(d) ? e.BINARY_ACK : e.ACK;
- b.packet({
- type: f,
- id: a,
- data: d
- })
- }
- }
- }, d.prototype.onack = function(a) {
- var b = this.acks[a.id];
- "function" == typeof b ? (j("calling ack %s with %j", a.id, a.data), b.apply(this, a.data), delete this.acks[a.id]) : j("bad ack %s", a.id)
- }, d.prototype.onconnect = function() {
- this.connected = !0, this.disconnected = !1, this.emit("connect"), this.emitBuffered()
- }, d.prototype.emitBuffered = function() {
- var a;
- for (a = 0; a < this.receiveBuffer.length; a++) m.apply(this, this.receiveBuffer[a]);
- for (this.receiveBuffer = [], a = 0; a < this.sendBuffer.length; a++) this.packet(this.sendBuffer[a]);
- this.sendBuffer = []
- }, d.prototype.ondisconnect = function() {
- j("server disconnect (%s)", this.nsp), this.destroy(), this.onclose("io server disconnect")
- }, d.prototype.destroy = function() {
- if (this.subs) {
- for (var a = 0; a < this.subs.length; a++) this.subs[a].destroy();
- this.subs = null
- }
- this.io.destroy(this)
- }, d.prototype.close = d.prototype.disconnect = function() {
- return this.connected && (j("performing disconnect (%s)", this.nsp), this.packet({
- type: e.DISCONNECT
- })), this.destroy(), this.connected && this.onclose("io client disconnect"), this
- }, d.prototype.compress = function(a) {
- return this.flags = this.flags || {}, this.flags.compress = a, this
- }
- }, {
- "./on": 33,
- "component-bind": 37,
- "component-emitter": 38,
- debug: 39,
- "has-binary": 41,
- "socket.io-parser": 47,
- "to-array": 51
- }],
- 35: [function(a, b, c) {
- (function(c) {
- function d(a, b) {
- var d = a,
- b = b || c.location;
- null == a && (a = b.protocol + "//" + b.host), "string" == typeof a && ("/" == a.charAt(0) && (a = "/" == a.charAt(1) ? b.protocol + a : b.host + a), /^(https?|wss?):\/\//.test(a) || (f("protocol-less url %s", a), a = "undefined" != typeof b ? b.protocol + "//" + a : "https://" + a), f("parse %s", a), d = e(a)), d.port || (/^(http|ws)$/.test(d.protocol) ? d.port = "80" : /^(http|ws)s$/.test(d.protocol) && (d.port = "443")), d.path = d.path || "/";
- var g = -1 !== d.host.indexOf(":"),
- h = g ? "[" + d.host + "]" : d.host;
- return d.id = d.protocol + "://" + h + ":" + d.port, d.href = d.protocol + "://" + h + (b && b.port == d.port ? "" : ":" + d.port), d
- }
- var e = a("parseuri"),
- f = a("debug")("socket.io-client:url");
- b.exports = d
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- debug: 39,
- parseuri: 45
- }],
- 36: [function(a, b, c) {
- function d(a) {
- a = a || {}, this.ms = a.min || 100, this.max = a.max || 1e4, this.factor = a.factor || 2, this.jitter = a.jitter > 0 && a.jitter <= 1 ? a.jitter : 0, this.attempts = 0
- }
- b.exports = d, d.prototype.duration = function() {
- var a = this.ms * Math.pow(this.factor, this.attempts++);
- if (this.jitter) {
- var b = Math.random(),
- c = Math.floor(b * this.jitter * a);
- a = 0 == (1 & Math.floor(10 * b)) ? a - c : a + c
- }
- return 0 | Math.min(a, this.max)
- }, d.prototype.reset = function() {
- this.attempts = 0
- }, d.prototype.setMin = function(a) {
- this.ms = a
- }, d.prototype.setMax = function(a) {
- this.max = a
- }, d.prototype.setJitter = function(a) {
- this.jitter = a
- }
- }, {}],
- 37: [function(a, b, c) {
- var d = [].slice;
- b.exports = function(a, b) {
- if ("string" == typeof b && (b = a[b]), "function" != typeof b) throw new Error("bind() requires a function");
- var c = d.call(arguments, 2);
- return function() {
- return b.apply(a, c.concat(d.call(arguments)))
- }
- }
- }, {}],
- 38: [function(a, b, c) {
- function d(a) {
- return a ? e(a) : void 0
- }
- function e(a) {
- for (var b in d.prototype) a[b] = d.prototype[b];
- return a
- }
- b.exports = d, d.prototype.on = d.prototype.addEventListener = function(a, b) {
- return this._callbacks = this._callbacks || {}, (this._callbacks["$" + a] = this._callbacks["$" + a] || []).push(b), this
- }, d.prototype.once = function(a, b) {
- function c() {
- this.off(a, c), b.apply(this, arguments)
- }
- return c.fn = b, this.on(a, c), this
- }, d.prototype.off = d.prototype.removeListener = d.prototype.removeAllListeners = d.prototype.removeEventListener = function(a, b) {
- if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this;
- var c = this._callbacks["$" + a];
- if (!c) return this;
- if (1 == arguments.length) return delete this._callbacks["$" + a], this;
- for (var d, e = 0; e < c.length; e++)
- if (d = c[e], d === b || d.fn === b) {
- c.splice(e, 1);
- break
- }
- return this
- }, d.prototype.emit = function(a) {
- this._callbacks = this._callbacks || {};
- var b = [].slice.call(arguments, 1),
- c = this._callbacks["$" + a];
- if (c) {
- c = c.slice(0);
- for (var d = 0, e = c.length; e > d; ++d) c[d].apply(this, b)
- }
- return this
- }, d.prototype.listeners = function(a) {
- return this._callbacks = this._callbacks || {}, this._callbacks["$" + a] || []
- }, d.prototype.hasListeners = function(a) {
- return !!this.listeners(a).length
- }
- }, {}],
- 39: [function(a, b, c) {
- arguments[4][17][0].apply(c, arguments)
- }, {
- "./debug": 40,
- dup: 17
- }],
- 40: [function(a, b, c) {
- arguments[4][18][0].apply(c, arguments)
- }, {
- dup: 18,
- ms: 44
- }],
- 41: [function(a, b, c) {
- (function(c) {
- function d(a) {
- function b(a) {
- if (!a) return !1;
- if (c.Buffer && c.Buffer.isBuffer && c.Buffer.isBuffer(a) || c.ArrayBuffer && a instanceof ArrayBuffer || c.Blob && a instanceof Blob || c.File && a instanceof File) return !0;
- if (e(a)) {
- for (var d = 0; d < a.length; d++)
- if (b(a[d])) return !0
- } else if (a && "object" == typeof a) {
- a.toJSON && "function" == typeof a.toJSON && (a = a.toJSON());
- for (var f in a)
- if (Object.prototype.hasOwnProperty.call(a, f) && b(a[f])) return !0
- }
- return !1
- }
- return b(a)
- }
- var e = a("isarray");
- b.exports = d
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- isarray: 43
- }],
- 42: [function(a, b, c) {
- arguments[4][23][0].apply(c, arguments)
- }, {
- dup: 23
- }],
- 43: [function(a, b, c) {
- arguments[4][24][0].apply(c, arguments)
- }, {
- dup: 24
- }],
- 44: [function(a, b, c) {
- arguments[4][25][0].apply(c, arguments)
- }, {
- dup: 25
- }],
- 45: [function(a, b, c) {
- arguments[4][28][0].apply(c, arguments)
- }, {
- dup: 28
- }],
- 46: [function(a, b, c) {
- (function(b) {
- var d = a("isarray"),
- e = a("./is-buffer");
- c.deconstructPacket = function(a) {
- function b(a) {
- if (!a) return a;
- if (e(a)) {
- var f = {
- _placeholder: !0,
- num: c.length
- };
- return c.push(a), f
- }
- if (d(a)) {
- for (var g = new Array(a.length), h = 0; h < a.length; h++) g[h] = b(a[h]);
- return g
- }
- if ("object" == typeof a && !(a instanceof Date)) {
- var g = {};
- for (var i in a) g[i] = b(a[i]);
- return g
- }
- return a
- }
- var c = [],
- f = a.data,
- g = a;
- return g.data = b(f), g.attachments = c.length, {
- packet: g,
- buffers: c
- }
- }, c.reconstructPacket = function(a, b) {
- function c(a) {
- if (a && a._placeholder) {
- var e = b[a.num];
- return e
- }
- if (d(a)) {
- for (var f = 0; f < a.length; f++) a[f] = c(a[f]);
- return a
- }
- if (a && "object" == typeof a) {
- for (var g in a) a[g] = c(a[g]);
- return a
- }
- return a
- }
- return a.data = c(a.data), a.attachments = void 0, a
- }, c.removeBlobs = function(a, c) {
- function f(a, i, j) {
- if (!a) return a;
- if (b.Blob && a instanceof Blob || b.File && a instanceof File) {
- g++;
- var k = new FileReader;
- k.onload = function() {
- j ? j[i] = this.result : h = this.result, --g || c(h)
- }, k.readAsArrayBuffer(a)
- } else if (d(a))
- for (var l = 0; l < a.length; l++) f(a[l], l, a);
- else if (a && "object" == typeof a && !e(a))
- for (var m in a) f(a[m], m, a)
- }
- var g = 0,
- h = a;
- f(h), g || c(h)
- }
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {
- "./is-buffer": 48,
- isarray: 43
- }],
- 47: [function(a, b, c) {
- function d() {}
- function e(a) {
- var b = "",
- d = !1;
- return b += a.type, (c.BINARY_EVENT == a.type || c.BINARY_ACK == a.type) && (b += a.attachments, b += "-"), a.nsp && "/" != a.nsp && (d = !0, b += a.nsp), null != a.id && (d && (b += ",", d = !1), b += a.id), null != a.data && (d && (b += ","), b += l.stringify(a.data)), k("encoded %j as %s", a, b), b
- }
- function f(a, b) {
- function c(a) {
- var c = n.deconstructPacket(a),
- d = e(c.packet),
- f = c.buffers;
- f.unshift(d), b(f)
- }
- n.removeBlobs(a, c)
- }
- function g() {
- this.reconstructor = null
- }
- function h(a) {
- var b = {},
- d = 0;
- if (b.type = Number(a.charAt(0)), null == c.types[b.type]) return j();
- if (c.BINARY_EVENT == b.type || c.BINARY_ACK == b.type) {
- for (var e = "";
- "-" != a.charAt(++d) && (e += a.charAt(d), d != a.length););
- if (e != Number(e) || "-" != a.charAt(d)) throw new Error("Illegal attachments");
- b.attachments = Number(e)
- }
- if ("/" == a.charAt(d + 1))
- for (b.nsp = ""; ++d;) {
- var f = a.charAt(d);
- if ("," == f) break;
- if (b.nsp += f, d == a.length) break
- } else b.nsp = "/";
- var g = a.charAt(d + 1);
- if ("" !== g && Number(g) == g) {
- for (b.id = ""; ++d;) {
- var f = a.charAt(d);
- if (null == f || Number(f) != f) {
- --d;
- break
- }
- if (b.id += a.charAt(d), d == a.length) break
- }
- b.id = Number(b.id)
- }
- if (a.charAt(++d)) try {
- b.data = l.parse(a.substr(d))
- } catch (h) {
- return j()
- }
- return k("decoded %s as %j", a, b), b
- }
- function i(a) {
- this.reconPack = a, this.buffers = []
- }
- function j(a) {
- return {
- type: c.ERROR,
- data: "parser error"
- }
- }
- var k = a("debug")("socket.io-parser"),
- l = a("json3"),
- m = (a("isarray"), a("component-emitter")),
- n = a("./binary"),
- o = a("./is-buffer");
- c.protocol = 4, c.types = ["CONNECT", "DISCONNECT", "EVENT", "BINARY_EVENT", "ACK", "BINARY_ACK", "ERROR"], c.CONNECT = 0, c.DISCONNECT = 1, c.EVENT = 2, c.ACK = 3, c.ERROR = 4, c.BINARY_EVENT = 5, c.BINARY_ACK = 6, c.Encoder = d, c.Decoder = g, d.prototype.encode = function(a, b) {
- if (k("encoding packet %j", a), c.BINARY_EVENT == a.type || c.BINARY_ACK == a.type) f(a, b);
- else {
- var d = e(a);
- b([d])
- }
- }, m(g.prototype), g.prototype.add = function(a) {
- var b;
- if ("string" == typeof a) b = h(a), c.BINARY_EVENT == b.type || c.BINARY_ACK == b.type ? (this.reconstructor = new i(b), 0 === this.reconstructor.reconPack.attachments && this.emit("decoded", b)) : this.emit("decoded", b);
- else {
- if (!o(a) && !a.base64) throw new Error("Unknown type: " + a);
- if (!this.reconstructor) throw new Error("got binary data when not reconstructing a packet");
- b = this.reconstructor.takeBinaryData(a), b && (this.reconstructor = null, this.emit("decoded", b))
- }
- }, g.prototype.destroy = function() {
- this.reconstructor && this.reconstructor.finishedReconstruction()
- }, i.prototype.takeBinaryData = function(a) {
- if (this.buffers.push(a), this.buffers.length == this.reconPack.attachments) {
- var b = n.reconstructPacket(this.reconPack, this.buffers);
- return this.finishedReconstruction(), b
- }
- return null
- }, i.prototype.finishedReconstruction = function() {
- this.reconPack = null, this.buffers = []
- }
- }, {
- "./binary": 46,
- "./is-buffer": 48,
- "component-emitter": 49,
- debug: 39,
- isarray: 43,
- json3: 50
- }],
- 48: [function(a, b, c) {
- (function(a) {
- function c(b) {
- return a.Buffer && a.Buffer.isBuffer(b) || a.ArrayBuffer && b instanceof ArrayBuffer
- }
- b.exports = c
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {}],
- 49: [function(a, b, c) {
- arguments[4][15][0].apply(c, arguments)
- }, {
- dup: 15
- }],
- 50: [function(b, c, d) {
- (function(b) {
- (function() {
- function e(a, b) {
- function c(a) {
- if (c[a] !== q) return c[a];
- var e;
- if ("bug-string-char-index" == a) e = "a" != "a" [0];
- else if ("json" == a) e = c("json-stringify") && c("json-parse");
- else {
- var g, h = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
- if ("json-stringify" == a) {
- var i = b.stringify,
- k = "function" == typeof i && t;
- if (k) {
- (g = function() {
- return 1
- }).toJSON = g;
- try {
- k = "0" === i(0) && "0" === i(new d) && '""' == i(new f) && i(s) === q && i(q) === q && i() === q && "1" === i(g) && "[1]" == i([g]) && "[null]" == i([q]) && "null" == i(null) && "[null,null,null]" == i([q, s, null]) && i({
- a: [g, !0, !1, null, "\x00\b\n\f\r "]
- }) == h && "1" === i(null, g) && "[\n 1,\n 2\n]" == i([1, 2], null, 1) && '"-271821-04-20T00:00:00.000Z"' == i(new j(-864e13)) && '"+275760-09-13T00:00:00.000Z"' == i(new j(864e13)) && '"-000001-01-01T00:00:00.000Z"' == i(new j(-621987552e5)) && '"1969-12-31T23:59:59.999Z"' == i(new j(-1))
- } catch (l) {
- k = !1
- }
- }
- e = k
- }
- if ("json-parse" == a) {
- var m = b.parse;
- if ("function" == typeof m) try {
- if (0 === m("0") && !m(!1)) {
- g = m(h);
- var n = 5 == g.a.length && 1 === g.a[0];
- if (n) {
- try {
- n = !m('" "')
- } catch (l) {}
- if (n) try {
- n = 1 !== m("01")
- } catch (l) {}
- if (n) try {
- n = 1 !== m("1.")
- } catch (l) {}
- }
- }
- } catch (l) {
- n = !1
- }
- e = n
- }
- }
- return c[a] = !!e
- }
- a || (a = i.Object()), b || (b = i.Object());
- var d = a.Number || i.Number,
- f = a.String || i.String,
- h = a.Object || i.Object,
- j = a.Date || i.Date,
- k = a.SyntaxError || i.SyntaxError,
- l = a.TypeError || i.TypeError,
- m = a.Math || i.Math,
- n = a.JSON || i.JSON;
- "object" == typeof n && n && (b.stringify = n.stringify, b.parse = n.parse);
- var o, p, q, r = h.prototype,
- s = r.toString,
- t = new j(-0xc782b5b800cec);
- try {
- t = -109252 == t.getUTCFullYear() && 0 === t.getUTCMonth() && 1 === t.getUTCDate() && 10 == t.getUTCHours() && 37 == t.getUTCMinutes() && 6 == t.getUTCSeconds() && 708 == t.getUTCMilliseconds()
- } catch (u) {}
- if (!c("json")) {
- var v = "[object Function]",
- w = "[object Date]",
- x = "[object Number]",
- y = "[object String]",
- z = "[object Array]",
- A = "[object Boolean]",
- B = c("bug-string-char-index");
- if (!t) var C = m.floor,
- D = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],
- E = function(a, b) {
- return D[b] + 365 * (a - 1970) + C((a - 1969 + (b = +(b > 1))) / 4) - C((a - 1901 + b) / 100) + C((a - 1601 + b) / 400)
- };
- if ((o = r.hasOwnProperty) || (o = function(a) {
- var b, c = {};
- return (c.__proto__ = null, c.__proto__ = {
- toString: 1
- }, c).toString != s ? o = function(a) {
- var b = this.__proto__,
- c = a in (this.__proto__ = null, this);
- return this.__proto__ = b, c
- } : (b = c.constructor, o = function(a) {
- var c = (this.constructor || b).prototype;
- return a in this && !(a in c && this[a] === c[a])
- }), c = null, o.call(this, a)
- }), p = function(a, b) {
- var c, d, e, f = 0;
- (c = function() {
- this.valueOf = 0
- }).prototype.valueOf = 0, d = new c;
- for (e in d) o.call(d, e) && f++;
- return c = d = null, f ? p = 2 == f ? function(a, b) {
- var c, d = {},
- e = s.call(a) == v;
- for (c in a) e && "prototype" == c || o.call(d, c) || !(d[c] = 1) || !o.call(a, c) || b(c)
- } : function(a, b) {
- var c, d, e = s.call(a) == v;
- for (c in a) e && "prototype" == c || !o.call(a, c) || (d = "constructor" === c) || b(c);
- (d || o.call(a, c = "constructor")) && b(c)
- } : (d = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"], p = function(a, b) {
- var c, e, f = s.call(a) == v,
- h = !f && "function" != typeof a.constructor && g[typeof a.hasOwnProperty] && a.hasOwnProperty || o;
- for (c in a) f && "prototype" == c || !h.call(a, c) || b(c);
- for (e = d.length; c = d[--e]; h.call(a, c) && b(c));
- }), p(a, b)
- }, !c("json-stringify")) {
- var F = {
- 92: "\\\\",
- 34: '\\"',
- 8: "\\b",
- 12: "\\f",
- 10: "\\n",
- 13: "\\r",
- 9: "\\t"
- },
- G = "000000",
- H = function(a, b) {
- return (G + (b || 0)).slice(-a)
- },
- I = "\\u00",
- J = function(a) {
- for (var b = '"', c = 0, d = a.length, e = !B || d > 10, f = e && (B ? a.split("") : a); d > c; c++) {
- var g = a.charCodeAt(c);
- switch (g) {
- case 8:
- case 9:
- case 10:
- case 12:
- case 13:
- case 34:
- case 92:
- b += F[g];
- break;
- default:
- if (32 > g) {
- b += I + H(2, g.toString(16));
- break
- }
- b += e ? f[c] : a.charAt(c)
- }
- }
- return b + '"'
- },
- K = function(a, b, c, d, e, f, g) {
- var h, i, j, k, m, n, r, t, u, v, B, D, F, G, I, L;
- try {
- h = b[a]
- } catch (M) {}
- if ("object" == typeof h && h)
- if (i = s.call(h), i != w || o.call(h, "toJSON")) "function" == typeof h.toJSON && (i != x && i != y && i != z || o.call(h, "toJSON")) && (h = h.toJSON(a));
- else if (h > -1 / 0 && 1 / 0 > h) {
- if (E) {
- for (m = C(h / 864e5), j = C(m / 365.2425) + 1970 - 1; E(j + 1, 0) <= m; j++);
- for (k = C((m - E(j, 0)) / 30.42); E(j, k + 1) <= m; k++);
- m = 1 + m - E(j, k), n = (h % 864e5 + 864e5) % 864e5, r = C(n / 36e5) % 24, t = C(n / 6e4) % 60, u = C(n / 1e3) % 60, v = n % 1e3
- } else j = h.getUTCFullYear(), k = h.getUTCMonth(), m = h.getUTCDate(), r = h.getUTCHours(), t = h.getUTCMinutes(), u = h.getUTCSeconds(), v = h.getUTCMilliseconds();
- h = (0 >= j || j >= 1e4 ? (0 > j ? "-" : "+") + H(6, 0 > j ? -j : j) : H(4, j)) + "-" + H(2, k + 1) + "-" + H(2, m) + "T" + H(2, r) + ":" + H(2, t) + ":" + H(2, u) + "." + H(3, v) + "Z"
- } else h = null;
- if (c && (h = c.call(b, a, h)), null === h) return "null";
- if (i = s.call(h), i == A) return "" + h;
- if (i == x) return h > -1 / 0 && 1 / 0 > h ? "" + h : "null";
- if (i == y) return J("" + h);
- if ("object" == typeof h) {
- for (G = g.length; G--;)
- if (g[G] === h) throw l();
- if (g.push(h), B = [], I = f, f += e, i == z) {
- for (F = 0, G = h.length; G > F; F++) D = K(F, h, c, d, e, f, g), B.push(D === q ? "null" : D);
- L = B.length ? e ? "[\n" + f + B.join(",\n" + f) + "\n" + I + "]" : "[" + B.join(",") + "]" : "[]"
- } else p(d || h, function(a) {
- var b = K(a, h, c, d, e, f, g);
- b !== q && B.push(J(a) + ":" + (e ? " " : "") + b)
- }), L = B.length ? e ? "{\n" + f + B.join(",\n" + f) + "\n" + I + "}" : "{" + B.join(",") + "}" : "{}";
- return g.pop(), L
- }
- };
- b.stringify = function(a, b, c) {
- var d, e, f, h;
- if (g[typeof b] && b)
- if ((h = s.call(b)) == v) e = b;
- else if (h == z) {
- f = {};
- for (var i, j = 0, k = b.length; k > j; i = b[j++], h = s.call(i), (h == y || h == x) && (f[i] = 1));
- }
- if (c)
- if ((h = s.call(c)) == x) {
- if ((c -= c % 1) > 0)
- for (d = "", c > 10 && (c = 10); d.length < c; d += " ");
- } else h == y && (d = c.length <= 10 ? c : c.slice(0, 10));
- return K("", (i = {}, i[""] = a, i), e, f, d, "", [])
- }
- }
- if (!c("json-parse")) {
- var L, M, N = f.fromCharCode,
- O = {
- 92: "\\",
- 34: '"',
- 47: "/",
- 98: "\b",
- 116: " ",
- 110: "\n",
- 102: "\f",
- 114: "\r"
- },
- P = function() {
- throw L = M = null, k()
- },
- Q = function() {
- for (var a, b, c, d, e, f = M, g = f.length; g > L;) switch (e = f.charCodeAt(L)) {
- case 9:
- case 10:
- case 13:
- case 32:
- L++;
- break;
- case 123:
- case 125:
- case 91:
- case 93:
- case 58:
- case 44:
- return a = B ? f.charAt(L) : f[L], L++, a;
- case 34:
- for (a = "@", L++; g > L;)
- if (e = f.charCodeAt(L), 32 > e) P();
- else if (92 == e) switch (e = f.charCodeAt(++L)) {
- case 92:
- case 34:
- case 47:
- case 98:
- case 116:
- case 110:
- case 102:
- case 114:
- a += O[e], L++;
- break;
- case 117:
- for (b = ++L, c = L + 4; c > L; L++) e = f.charCodeAt(L), e >= 48 && 57 >= e || e >= 97 && 102 >= e || e >= 65 && 70 >= e || P();
- a += N("0x" + f.slice(b, L));
- break;
- default:
- P()
- } else {
- if (34 == e) break;
- for (e = f.charCodeAt(L), b = L; e >= 32 && 92 != e && 34 != e;) e = f.charCodeAt(++L);
- a += f.slice(b, L)
- }
- if (34 == f.charCodeAt(L)) return L++, a;
- P();
- default:
- if (b = L, 45 == e && (d = !0, e = f.charCodeAt(++L)), e >= 48 && 57 >= e) {
- for (48 == e && (e = f.charCodeAt(L + 1), e >= 48 && 57 >= e) && P(), d = !1; g > L && (e = f.charCodeAt(L), e >= 48 && 57 >= e); L++);
- if (46 == f.charCodeAt(L)) {
- for (c = ++L; g > c && (e = f.charCodeAt(c), e >= 48 && 57 >= e); c++);
- c == L && P(), L = c
- }
- if (e = f.charCodeAt(L), 101 == e || 69 == e) {
- for (e = f.charCodeAt(++L), (43 == e || 45 == e) && L++, c = L; g > c && (e = f.charCodeAt(c), e >= 48 && 57 >= e); c++);
- c == L && P(), L = c
- }
- return +f.slice(b, L)
- }
- if (d && P(), "true" == f.slice(L, L + 4)) return L += 4, !0;
- if ("false" == f.slice(L, L + 5)) return L += 5, !1;
- if ("null" == f.slice(L, L + 4)) return L += 4, null;
- P()
- }
- return "$"
- },
- R = function(a) {
- var b, c;
- if ("$" == a && P(), "string" == typeof a) {
- if ("@" == (B ? a.charAt(0) : a[0])) return a.slice(1);
- if ("[" == a) {
- for (b = []; a = Q(), "]" != a; c || (c = !0)) c && ("," == a ? (a = Q(), "]" == a && P()) : P()), "," == a && P(), b.push(R(a));
- return b
- }
- if ("{" == a) {
- for (b = {}; a = Q(), "}" != a; c || (c = !0)) c && ("," == a ? (a = Q(), "}" == a && P()) : P()), ("," == a || "string" != typeof a || "@" != (B ? a.charAt(0) : a[0]) || ":" != Q()) && P(), b[a.slice(1)] = R(Q());
- return b
- }
- P()
- }
- return a
- },
- S = function(a, b, c) {
- var d = T(a, b, c);
- d === q ? delete a[b] : a[b] = d
- },
- T = function(a, b, c) {
- var d, e = a[b];
- if ("object" == typeof e && e)
- if (s.call(e) == z)
- for (d = e.length; d--;) S(e, d, c);
- else p(e, function(a) {
- S(e, a, c)
- });
- return c.call(a, b, e)
- };
- b.parse = function(a, b) {
- var c, d;
- return L = 0, M = "" + a, c = R(Q()), "$" != Q() && P(), L = M = null, b && s.call(b) == v ? T((d = {}, d[""] = c, d), "", b) : c
- }
- }
- }
- return b.runInContext = e, b
- }
- var f = "function" == typeof a && a.amd,
- g = {
- "function": !0,
- object: !0
- },
- h = g[typeof d] && d && !d.nodeType && d,
- i = g[typeof window] && window || this,
- j = h && g[typeof c] && c && !c.nodeType && "object" == typeof b && b;
- if (!j || j.global !== j && j.window !== j && j.self !== j || (i = j), h && !f) e(i, h);
- else {
- var k = i.JSON,
- l = i.JSON3,
- m = !1,
- n = e(i, i.JSON3 = {
- noConflict: function() {
- return m || (m = !0, i.JSON = k, i.JSON3 = l, k = l = null), n
- }
- });
- i.JSON = {
- parse: n.parse,
- stringify: n.stringify
- }
- }
- f && a(function() {
- return n
- })
- }).call(this)
- }).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {})
- }, {}],
- 51: [function(a, b, c) {
- function d(a, b) {
- var c = [];
- b = b || 0;
- for (var d = b || 0; d < a.length; d++) c[d - b] = a[d];
- return c
- }
- b.exports = d
- }, {}]
- }, {}, [31])(31)
- }),
- function() {
- function a(a) {
- function c(b) {
- return b = b || {
- prefix: !0
- }, "object" != typeof console || "function" != typeof console.log || "function" != typeof console.log.bind ? function() {} : function() {
- var c = Array.prototype.slice.call(arguments);
- if ("production" !== a.sails.environment) {
- var d = "";
- b.prefix && c.unshift(d), console.log.bind(console).apply(this, c)
- }
- }
- }
- function f(a) {
- var b = a.requestQueue;
- if (b) {
- for (var c in b) {
- var d = {}.hasOwnProperty.call(b, c);
- if (d) {
- var e = b[c];
- a.request.apply(a, e)
- }
- }
- b = null
- }
- }
- function g(a, b) {
- if (a = a || {}, "undefined" == typeof window) return b();
- var c = document.createElement("script");
- window._sailsIoJSConnect = function(a) {
- c.parentNode.removeChild(c), b(a)
- }, c.src = a.url, document.getElementsByTagName("head")[0].appendChild(c)
- }
- function h(a) {
- this.body = a.body || {}, this.headers = a.headers || {}, this.statusCode = a.statusCode || 200, (this.statusCode < 200 || this.statusCode >= 400) && (this.error = this.body || this.statusCode)
- }
- function i(a, b) {
- if (!a._raw) throw new Error("Failed to emit from socket- raw SIO socket is missing.");
- var c = b.cb;
- delete b.cb;
- var d = b.method;
- a._raw.emit(d, b, function(a) {
- c && c(a.body, new h(a))
- })
- }
- function j(b) {
- var c = this;
- b = b || {};
- var d = {};
- ["useCORSRouteToGetCookie", "url", "multiplex", "transports", "query", "initialConnectionHeaders"].forEach(function(b) {
- Object.defineProperty(c, b, {
- get: function() {
- return "url" == b ? d[b] || c._raw && c._raw.io && c._raw.io.uri : d[b]
- },
- set: function(e) {
- if (c.isConnected() && a.sails.strict !== !1 && e != d[b]) throw new Error("Cannot change value of `" + b + "` while socket is connected.");
- d[b] = e
- }
- })
- }), c.useCORSRouteToGetCookie = b.useCORSRouteToGetCookie, c.url = b.url, c.multiplex = b.multiplex, c.transports = b.transports, c.query = b.query, c.headers = b.headers, c.initialConnectionHeaders = b.initialConnectionHeaders, c.eventQueue = {}, c.on("sails:parseError", function(a) {
- k("Sails encountered an error parsing a socket message sent from this client, and did not have access to a callback function to respond with."), k("Error details:", a)
- })
- }
- if (a || (a = e), !a) throw new Error("`sails.io.js` requires a socket.io client, but `io` was not passed in.");
- var k = c();
- return k.noPrefix = c({
- prefix: !1
- }), h.prototype.toString = function() {
- return "[ResponseFromSails] -- Status: " + this.statusCode + " -- Headers: " + this.headers + " -- Body: " + this.body
- }, h.prototype.toPOJO = function() {
- return {
- body: this.body,
- headers: this.headers,
- statusCode: this.statusCode
- }
- }, h.prototype.pipe = function() {
- return new Error("Client-side streaming support not implemented yet.")
- }, j.prototype._connect = function() {
- var b = this;
- b.isConnecting = !0, b.useCORSRouteToGetCookie = b.useCORSRouteToGetCookie || a.sails.useCORSRouteToGetCookie, b.url = b.url || a.sails.url, b.transports = b.transports || a.sails.transports, b.query = b.query || a.sails.query, b.headers = b.headers || a.sails.headers, b.extraHeaders = b.initialConnectionHeaders || a.sails.initialConnectionHeaders || {}, "object" == typeof module && "undefined" != typeof module.exports || console.warn("initialConnectionHeaders option available in Node.js only!"), b.path = b.path || a.sails.path, b.url = b.url ? b.url.replace(/(\/)$/, "") : void 0, "string" != typeof b.query ? b.query = d.versionString : b.query += "&" + d.versionString;
- var c = function() {
- if ("undefined" == typeof window || "undefined" == typeof window.location) return !1;
- if ("string" != typeof b.url) return !1;
- var a = function() {
- try {
- a = b.url.match(/^([a-z]+:\/\/)/i)[1].toLowerCase()
- } catch (c) {}
- return a = a || "http://"
- }(),
- c = !!b.url.match("^https"),
- d = function() {
- try {
- return b.url.match(/^[a-z]+:\/\/[^:]*:([0-9]*)/i)[1]
- } catch (a) {}
- return c ? "443" : "80"
- }(),
- e = b.url.replace(/^([a-z]+:\/\/)/i, "");
- if (a.replace(/[:\/]/g, "") !== window.location.protocol.replace(/[:\/]/g, "")) return !0;
- var f = 0 === e.search(window.location.hostname);
- if (!f) return !0;
- var g = window.location.protocol.match(/https/i),
- h = window.location.port + "" || (g ? "443" : "80");
- return d !== h
- }();
- ! function(a) {
- if (!b.useCORSRouteToGetCookie || !c) return a();
- var d = b.url;
- if (d += "string" == typeof b.useCORSRouteToGetCookie ? b.useCORSRouteToGetCookie : "/__getcookie", "undefined" != typeof window) return void g({
- url: d,
- method: "GET"
- }, a);
- var e = require("request");
- e.get(d, function(c, d, e) {
- return c ? (b.isConnecting = !1, void k("Failed to connect socket (failed to get cookie)", "Error:", c)) : void a()
- })
- }(function() {
- b._raw = a(b.url, b), b.replay(), b.on("connect", function() {
- b.isConnecting = !1, k.noPrefix("\n\n |> Now connected to Sails.\n\\___/ For help, see: http://bit.ly/1DmTvgK\n (using sails.io.js " + a.sails.sdk.platform + " SDK @v" + a.sails.sdk.version + ")\n\n\n")
- }), b.on("disconnect", function() {
- b.connectionLostTimestamp = (new Date).getTime(), k("===================================="), k("Socket was disconnected from Sails."), k("Usually, this is due to one of the following reasons:\n -> the server " + (b.url ? b.url + " " : "") + "was taken down\n -> your browser lost internet connectivity"), k("====================================")
- }), b.on("reconnecting", function(a) {
- k("\n Socket is trying to reconnect to Sails...\n_-|>_- (attempt #" + a + ")\n\n")
- }), b.on("reconnect", function(a, c) {
- var d = (new Date).getTime() - b.connectionLostTimestamp,
- e = d / 1e3;
- k("\n |> Socket reconnected successfully after\n\\___/ being offline for ~" + e + " seconds.\n\n")
- }), b.on("error", function(a) {
- b.isConnecting = !1, k("Failed to connect socket (probably due to failed authorization on server)", "Error:", a)
- })
- })
- }, j.prototype.reconnect = function() {
- if (this.isConnecting) throw new Error("Cannot connect- socket is already connecting");
- if (this.isConnected()) throw new Error("Cannot connect- socket is already connected");
- return this._connect()
- }, j.prototype.disconnect = function() {
- if (this.isConnecting = !1, !this.isConnected()) throw new Error("Cannot disconnect- socket is already disconnected");
- return this._raw.disconnect()
- }, j.prototype.isConnected = function() {
- return this._raw ? !!this._raw.connected : !1
- }, j.prototype.replay = function() {
- var a = this;
- for (var b in a.eventQueue)
- for (var c in a.eventQueue[b]) a._raw.on(b, a.eventQueue[b][c]);
- if (a.isConnected()) f(a);
- else {
- var d = !1;
- a._raw.on("connect", function() {
- d || (f(a), d = !0)
- })
- }
- return a
- }, j.prototype.on = function(a, b) {
- return this._raw ? (this._raw.on(a, b), this) : (this.eventQueue[a] ? this.eventQueue[a].push(b) : this.eventQueue[a] = [b], this)
- }, j.prototype.off = function(a, b) {
- return this._raw ? (this._raw.off(a, b), this) : (this.eventQueue[a] && this.eventQueue[a].indexOf(b) > -1 && this.eventQueue[a].splice(this.eventQueue[a].indexOf(b), 1), this)
- }, j.prototype.removeAllListeners = function() {
- return this._raw ? (this._raw.removeAllListeners(), this) : (this.eventQueue = {}, this)
- }, j.prototype.get = function(a, b, c) {
- return "function" == typeof b && (c = b, b = {}), this.request({
- method: "get",
- params: b,
- url: a
- }, c)
- }, j.prototype.post = function(a, b, c) {
- return "function" == typeof b && (c = b, b = {}), this.request({
- method: "post",
- data: b,
- url: a
- }, c)
- }, j.prototype.put = function(a, b, c) {
- return "function" == typeof b && (c = b, b = {}), this.request({
- method: "put",
- params: b,
- url: a
- }, c)
- }, j.prototype["delete"] = function(a, b, c) {
- return "function" == typeof b && (c = b, b = {}), this.request({
- method: "delete",
- params: b,
- url: a
- }, c)
- }, j.prototype.request = function(a, b) {
- var c = 'Usage:\nsocket.request( options, [fnToCallWhenComplete] )\n\noptions.url :: e.g. "/foo/bar"\noptions.method :: e.g. "get", "post", "put", or "delete", etc.\noptions.params :: e.g. { emailAddress: "mike@sailsjs.org" }\noptions.headers :: e.g. { "x-my-custom-header": "some string" }';
- if ("object" != typeof a || "string" != typeof a.url) throw new Error("Invalid or missing URL!\n" + c);
- if (a.method && "string" != typeof a.method) throw new Error('Invalid `method` provided (should be a string like "post" or "put")\n' + c);
- if (a.headers && "object" != typeof a.headers) throw new Error("Invalid `headers` provided (should be a dictionary with string values)\n" + c);
- if (a.params && "object" != typeof a.params) throw new Error("Invalid `params` provided (should be a dictionary with JSON-serializable values)\n" + c);
- if (a.data && "object" != typeof a.data) throw new Error("Invalid `data` provided (should be a dictionary with JSON-serializable values)\n" + c);
- if (b && "function" != typeof b) throw new Error("Invalid callback function!\n" + c);
- if (a.data && a.params) throw new Error("Cannot specify both `params` and `data`! They are aliases of each other.\n" + c);
- if (a.data && (a.params = a.data), !this.isConnected()) return this.requestQueue = this.requestQueue || [], void this.requestQueue.push([a, b]);
- a.headers = a.headers || {};
- var d = {
- method: a.method.toLowerCase() || "get",
- headers: a.headers,
- data: a.params || a.data || {},
- url: a.url.replace(/^(.+)\/*\s*$/, "$1"),
- cb: b
- };
- if (this.headers && "object" == typeof this.headers)
- for (var e in this.headers) a.headers.hasOwnProperty(e) || (a.headers[e] = this.headers[e]);
- i(this, d)
- }, j.prototype._request = function(a, b) {
- throw new Error("`_request()` was a private API deprecated as of v0.11 of the sails.io.js client. Use `.request()` instead.")
- }, a.sails = {
- autoConnect: !0,
- useCORSRouteToGetCookie: !0,
- environment: b.match(/(\#production|\.min\.js)/g) ? "production" : "development",
- sdk: d,
- transports: ["polling", "websocket"]
- }, a.sails.connect = function(a, b) {
- "object" == typeof a && (b = a, a = null), b = b || {}, b.url = a || b.url || void 0;
- var c = new j(b);
- return c._connect(), c
- }, a.socket = new j, setTimeout(function() {
- return a.sails.autoConnect ? void a.socket._connect() : void delete a.socket
- }, 0), a
- }
- var b = function() {
- if ("object" != typeof window || "object" != typeof window.document || "function" != typeof window.document.getElementsByTagName) return "";
- var a = window.document.getElementsByTagName("script"),
- b = a[a.length - 1];
- return b.src
- }(),
- c = {
- version: "__sails_io_sdk_version",
- platform: "__sails_io_sdk_platform",
- language: "__sails_io_sdk_language"
- },
- d = {
- version: "0.13.4",
- platform: "undefined" == typeof module ? "browser" : "node",
- language: "javascript"
- };
- d.versionString = c.version + "=" + d.version + "&" + c.platform + "=" + d.platform + "&" + c.language + "=" + d.language;
- var e = "undefined" != typeof io ? io : null;
- return "object" == typeof module && "undefined" != typeof module.exports ? (module.exports = a, a) : "function" == typeof define && define.amd ? void define([], function() {
- return a
- }) : a()
- }(),
- function(a, b) {
- "object" == typeof exports && "undefined" != typeof module ? module.exports = b() : "function" == typeof define && define.amd ? define(b) : a.moment = b()
- }(this, function() {
- "use strict";
- function a() {
- return Zc.apply(null, arguments)
- }
- function b(a) {
- Zc = a
- }
- function c(a) {
- return a instanceof Array || "[object Array]" === Object.prototype.toString.call(a)
- }
- function d(a) {
- return a instanceof Date || "[object Date]" === Object.prototype.toString.call(a)
- }
- function e(a, b) {
- var c, d = [];
- for (c = 0; c < a.length; ++c) d.push(b(a[c], c));
- return d
- }
- function f(a, b) {
- return Object.prototype.hasOwnProperty.call(a, b)
- }
- function g(a, b) {
- for (var c in b) f(b, c) && (a[c] = b[c]);
- return f(b, "toString") && (a.toString = b.toString), f(b, "valueOf") && (a.valueOf = b.valueOf), a
- }
- function h(a, b, c, d) {
- return Ia(a, b, c, d, !0).utc()
- }
- function i() {
- return {
- empty: !1,
- unusedTokens: [],
- unusedInput: [],
- overflow: -2,
- charsLeftOver: 0,
- nullInput: !1,
- invalidMonth: null,
- invalidFormat: !1,
- userInvalidated: !1,
- iso: !1
- }
- }
- function j(a) {
- return null == a._pf && (a._pf = i()), a._pf
- }
- function k(a) {
- if (null == a._isValid) {
- var b = j(a);
- a._isValid = !(isNaN(a._d.getTime()) || !(b.overflow < 0) || b.empty || b.invalidMonth || b.invalidWeekday || b.nullInput || b.invalidFormat || b.userInvalidated), a._strict && (a._isValid = a._isValid && 0 === b.charsLeftOver && 0 === b.unusedTokens.length && void 0 === b.bigHour)
- }
- return a._isValid
- }
- function l(a) {
- var b = h(NaN);
- return null != a ? g(j(b), a) : j(b).userInvalidated = !0, b
- }
- function m(a) {
- return void 0 === a
- }
- function n(a, b) {
- var c, d, e;
- if (m(b._isAMomentObject) || (a._isAMomentObject = b._isAMomentObject), m(b._i) || (a._i = b._i), m(b._f) || (a._f = b._f), m(b._l) || (a._l = b._l), m(b._strict) || (a._strict = b._strict), m(b._tzm) || (a._tzm = b._tzm), m(b._isUTC) || (a._isUTC = b._isUTC), m(b._offset) || (a._offset = b._offset), m(b._pf) || (a._pf = j(b)), m(b._locale) || (a._locale = b._locale), $c.length > 0)
- for (c in $c) d = $c[c], e = b[d], m(e) || (a[d] = e);
- return a
- }
- function o(b) {
- n(this, b), this._d = new Date(null != b._d ? b._d.getTime() : NaN), _c === !1 && (_c = !0, a.updateOffset(this), _c = !1)
- }
- function p(a) {
- return a instanceof o || null != a && null != a._isAMomentObject
- }
- function q(a) {
- return 0 > a ? Math.ceil(a) : Math.floor(a)
- }
- function r(a) {
- var b = +a,
- c = 0;
- return 0 !== b && isFinite(b) && (c = q(b)), c
- }
- function s(a, b, c) {
- var d, e = Math.min(a.length, b.length),
- f = Math.abs(a.length - b.length),
- g = 0;
- for (d = 0; e > d; d++)(c && a[d] !== b[d] || !c && r(a[d]) !== r(b[d])) && g++;
- return g + f
- }
- function t(b) {
- a.suppressDeprecationWarnings === !1 && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + b)
- }
- function u(a, b) {
- var c = !0;
- return g(function() {
- return c && (t(a + "\nArguments: " + Array.prototype.slice.call(arguments).join(", ") + "\n" + (new Error).stack), c = !1), b.apply(this, arguments)
- }, b)
- }
- function v(a, b) {
- ad[a] || (t(b), ad[a] = !0)
- }
- function w(a) {
- return a instanceof Function || "[object Function]" === Object.prototype.toString.call(a)
- }
- function x(a) {
- return "[object Object]" === Object.prototype.toString.call(a)
- }
- function y(a) {
- var b, c;
- for (c in a) b = a[c], w(b) ? this[c] = b : this["_" + c] = b;
- this._config = a, this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source)
- }
- function z(a, b) {
- var c, d = g({}, a);
- for (c in b) f(b, c) && (x(a[c]) && x(b[c]) ? (d[c] = {}, g(d[c], a[c]), g(d[c], b[c])) : null != b[c] ? d[c] = b[c] : delete d[c]);
- return d
- }
- function A(a) {
- null != a && this.set(a)
- }
- function B(a) {
- return a ? a.toLowerCase().replace("_", "-") : a
- }
- function C(a) {
- for (var b, c, d, e, f = 0; f < a.length;) {
- for (e = B(a[f]).split("-"), b = e.length, c = B(a[f + 1]), c = c ? c.split("-") : null; b > 0;) {
- if (d = D(e.slice(0, b).join("-"))) return d;
- if (c && c.length >= b && s(e, c, !0) >= b - 1) break;
- b--
- }
- f++
- }
- return null
- }
- function D(a) {
- var b = null;
- if (!cd[a] && "undefined" != typeof module && module && module.exports) try {
- b = bd._abbr, require("./locale/" + a), E(b)
- } catch (c) {}
- return cd[a]
- }
- function E(a, b) {
- var c;
- return a && (c = m(b) ? H(a) : F(a, b), c && (bd = c)), bd._abbr
- }
- function F(a, b) {
- return null !== b ? (b.abbr = a, null != cd[a] ? (v("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"), b = z(cd[a]._config, b)) : null != b.parentLocale && (null != cd[b.parentLocale] ? b = z(cd[b.parentLocale]._config, b) : v("parentLocaleUndefined", "specified parentLocale is not defined yet")), cd[a] = new A(b), E(a), cd[a]) : (delete cd[a], null)
- }
- function G(a, b) {
- if (null != b) {
- var c;
- null != cd[a] && (b = z(cd[a]._config, b)), c = new A(b), c.parentLocale = cd[a], cd[a] = c, E(a)
- } else null != cd[a] && (null != cd[a].parentLocale ? cd[a] = cd[a].parentLocale : null != cd[a] && delete cd[a]);
- return cd[a]
- }
- function H(a) {
- var b;
- if (a && a._locale && a._locale._abbr && (a = a._locale._abbr), !a) return bd;
- if (!c(a)) {
- if (b = D(a)) return b;
- a = [a]
- }
- return C(a)
- }
- function I() {
- return Object.keys(cd)
- }
- function J(a, b) {
- var c = a.toLowerCase();
- dd[c] = dd[c + "s"] = dd[b] = a
- }
- function K(a) {
- return "string" == typeof a ? dd[a] || dd[a.toLowerCase()] : void 0
- }
- function L(a) {
- var b, c, d = {};
- for (c in a) f(a, c) && (b = K(c), b && (d[b] = a[c]));
- return d
- }
- function M(b, c) {
- return function(d) {
- return null != d ? (O(this, b, d), a.updateOffset(this, c), this) : N(this, b)
- }
- }
- function N(a, b) {
- return a.isValid() ? a._d["get" + (a._isUTC ? "UTC" : "") + b]() : NaN
- }
- function O(a, b, c) {
- a.isValid() && a._d["set" + (a._isUTC ? "UTC" : "") + b](c)
- }
- function P(a, b) {
- var c;
- if ("object" == typeof a)
- for (c in a) this.set(c, a[c]);
- else if (a = K(a), w(this[a])) return this[a](b);
- return this
- }
- function Q(a, b, c) {
- var d = "" + Math.abs(a),
- e = b - d.length,
- f = a >= 0;
- return (f ? c ? "+" : "" : "-") + Math.pow(10, Math.max(0, e)).toString().substr(1) + d
- }
- function R(a, b, c, d) {
- var e = d;
- "string" == typeof d && (e = function() {
- return this[d]()
- }), a && (hd[a] = e), b && (hd[b[0]] = function() {
- return Q(e.apply(this, arguments), b[1], b[2])
- }), c && (hd[c] = function() {
- return this.localeData().ordinal(e.apply(this, arguments), a)
- })
- }
- function S(a) {
- return a.match(/\[[\s\S]/) ? a.replace(/^\[|\]$/g, "") : a.replace(/\\/g, "")
- }
- function T(a) {
- var b, c, d = a.match(ed);
- for (b = 0, c = d.length; c > b; b++) hd[d[b]] ? d[b] = hd[d[b]] : d[b] = S(d[b]);
- return function(e) {
- var f = "";
- for (b = 0; c > b; b++) f += d[b] instanceof Function ? d[b].call(e, a) : d[b];
- return f
- }
- }
- function U(a, b) {
- return a.isValid() ? (b = V(b, a.localeData()), gd[b] = gd[b] || T(b), gd[b](a)) : a.localeData().invalidDate()
- }
- function V(a, b) {
- function c(a) {
- return b.longDateFormat(a) || a
- }
- var d = 5;
- for (fd.lastIndex = 0; d >= 0 && fd.test(a);) a = a.replace(fd, c), fd.lastIndex = 0, d -= 1;
- return a
- }
- function W(a, b, c) {
- zd[a] = w(b) ? b : function(a, d) {
- return a && c ? c : b
- }
- }
- function X(a, b) {
- return f(zd, a) ? zd[a](b._strict, b._locale) : new RegExp(Y(a))
- }
- function Y(a) {
- return Z(a.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(a, b, c, d, e) {
- return b || c || d || e
- }))
- }
- function Z(a) {
- return a.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
- }
- function $(a, b) {
- var c, d = b;
- for ("string" == typeof a && (a = [a]), "number" == typeof b && (d = function(a, c) {
- c[b] = r(a)
- }), c = 0; c < a.length; c++) Ad[a[c]] = d
- }
- function _(a, b) {
- $(a, function(a, c, d, e) {
- d._w = d._w || {}, b(a, d._w, d, e)
- })
- }
- function aa(a, b, c) {
- null != b && f(Ad, a) && Ad[a](b, c._a, c, a)
- }
- function ba(a, b) {
- return new Date(Date.UTC(a, b + 1, 0)).getUTCDate()
- }
- function ca(a, b) {
- return c(this._months) ? this._months[a.month()] : this._months[Kd.test(b) ? "format" : "standalone"][a.month()]
- }
- function da(a, b) {
- return c(this._monthsShort) ? this._monthsShort[a.month()] : this._monthsShort[Kd.test(b) ? "format" : "standalone"][a.month()]
- }
- function ea(a, b, c) {
- var d, e, f;
- for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), d = 0; 12 > d; d++) {
- if (e = h([2e3, d]), c && !this._longMonthsParse[d] && (this._longMonthsParse[d] = new RegExp("^" + this.months(e, "").replace(".", "") + "$", "i"), this._shortMonthsParse[d] = new RegExp("^" + this.monthsShort(e, "").replace(".", "") + "$", "i")), c || this._monthsParse[d] || (f = "^" + this.months(e, "") + "|^" + this.monthsShort(e, ""), this._monthsParse[d] = new RegExp(f.replace(".", ""), "i")), c && "MMMM" === b && this._longMonthsParse[d].test(a)) return d;
- if (c && "MMM" === b && this._shortMonthsParse[d].test(a)) return d;
- if (!c && this._monthsParse[d].test(a)) return d
- }
- }
- function fa(a, b) {
- var c;
- if (!a.isValid()) return a;
- if ("string" == typeof b)
- if (/^\d+$/.test(b)) b = r(b);
- else if (b = a.localeData().monthsParse(b), "number" != typeof b) return a;
- return c = Math.min(a.date(), ba(a.year(), b)), a._d["set" + (a._isUTC ? "UTC" : "") + "Month"](b, c), a
- }
- function ga(b) {
- return null != b ? (fa(this, b), a.updateOffset(this, !0), this) : N(this, "Month")
- }
- function ha() {
- return ba(this.year(), this.month())
- }
- function ia(a) {
- return this._monthsParseExact ? (f(this, "_monthsRegex") || ka.call(this), a ? this._monthsShortStrictRegex : this._monthsShortRegex) : this._monthsShortStrictRegex && a ? this._monthsShortStrictRegex : this._monthsShortRegex
- }
- function ja(a) {
- return this._monthsParseExact ? (f(this, "_monthsRegex") || ka.call(this), a ? this._monthsStrictRegex : this._monthsRegex) : this._monthsStrictRegex && a ? this._monthsStrictRegex : this._monthsRegex
- }
- function ka() {
- function a(a, b) {
- return b.length - a.length
- }
- var b, c, d = [],
- e = [],
- f = [];
- for (b = 0; 12 > b; b++) c = h([2e3, b]), d.push(this.monthsShort(c, "")), e.push(this.months(c, "")), f.push(this.months(c, "")), f.push(this.monthsShort(c, ""));
- for (d.sort(a), e.sort(a), f.sort(a), b = 0; 12 > b; b++) d[b] = Z(d[b]), e[b] = Z(e[b]), f[b] = Z(f[b]);
- this._monthsRegex = new RegExp("^(" + f.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp("^(" + e.join("|") + ")$", "i"), this._monthsShortStrictRegex = new RegExp("^(" + d.join("|") + ")$", "i")
- }
- function la(a) {
- var b, c = a._a;
- return c && -2 === j(a).overflow && (b = c[Cd] < 0 || c[Cd] > 11 ? Cd : c[Dd] < 1 || c[Dd] > ba(c[Bd], c[Cd]) ? Dd : c[Ed] < 0 || c[Ed] > 24 || 24 === c[Ed] && (0 !== c[Fd] || 0 !== c[Gd] || 0 !== c[Hd]) ? Ed : c[Fd] < 0 || c[Fd] > 59 ? Fd : c[Gd] < 0 || c[Gd] > 59 ? Gd : c[Hd] < 0 || c[Hd] > 999 ? Hd : -1, j(a)._overflowDayOfYear && (Bd > b || b > Dd) && (b = Dd), j(a)._overflowWeeks && -1 === b && (b = Id), j(a)._overflowWeekday && -1 === b && (b = Jd), j(a).overflow = b), a
- }
- function ma(a) {
- var b, c, d, e, f, g, h = a._i,
- i = Pd.exec(h) || Qd.exec(h);
- if (i) {
- for (j(a).iso = !0, b = 0, c = Sd.length; c > b; b++)
- if (Sd[b][1].exec(i[1])) {
- e = Sd[b][0], d = Sd[b][2] !== !1;
- break
- }
- if (null == e) return void(a._isValid = !1);
- if (i[3]) {
- for (b = 0, c = Td.length; c > b; b++)
- if (Td[b][1].exec(i[3])) {
- f = (i[2] || " ") + Td[b][0];
- break
- }
- if (null == f) return void(a._isValid = !1)
- }
- if (!d && null != f) return void(a._isValid = !1);
- if (i[4]) {
- if (!Rd.exec(i[4])) return void(a._isValid = !1);
- g = "Z"
- }
- a._f = e + (f || "") + (g || ""), Ba(a)
- } else a._isValid = !1
- }
- function na(b) {
- var c = Ud.exec(b._i);
- return null !== c ? void(b._d = new Date(+c[1])) : (ma(b), void(b._isValid === !1 && (delete b._isValid, a.createFromInputFallback(b))))
- }
- function oa(a, b, c, d, e, f, g) {
- var h = new Date(a, b, c, d, e, f, g);
- return 100 > a && a >= 0 && isFinite(h.getFullYear()) && h.setFullYear(a), h
- }
- function pa(a) {
- var b = new Date(Date.UTC.apply(null, arguments));
- return 100 > a && a >= 0 && isFinite(b.getUTCFullYear()) && b.setUTCFullYear(a), b
- }
- function qa(a) {
- return ra(a) ? 366 : 365
- }
- function ra(a) {
- return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0
- }
- function sa() {
- return ra(this.year())
- }
- function ta(a, b, c) {
- var d = 7 + b - c,
- e = (7 + pa(a, 0, d).getUTCDay() - b) % 7;
- return -e + d - 1
- }
- function ua(a, b, c, d, e) {
- var f, g, h = (7 + c - d) % 7,
- i = ta(a, d, e),
- j = 1 + 7 * (b - 1) + h + i;
- return 0 >= j ? (f = a - 1, g = qa(f) + j) : j > qa(a) ? (f = a + 1, g = j - qa(a)) : (f = a, g = j), {
- year: f,
- dayOfYear: g
- }
- }
- function va(a, b, c) {
- var d, e, f = ta(a.year(), b, c),
- g = Math.floor((a.dayOfYear() - f - 1) / 7) + 1;
- return 1 > g ? (e = a.year() - 1, d = g + wa(e, b, c)) : g > wa(a.year(), b, c) ? (d = g - wa(a.year(), b, c), e = a.year() + 1) : (e = a.year(), d = g), {
- week: d,
- year: e
- }
- }
- function wa(a, b, c) {
- var d = ta(a, b, c),
- e = ta(a + 1, b, c);
- return (qa(a) - d + e) / 7
- }
- function xa(a, b, c) {
- return null != a ? a : null != b ? b : c
- }
- function ya(b) {
- var c = new Date(a.now());
- return b._useUTC ? [c.getUTCFullYear(), c.getUTCMonth(), c.getUTCDate()] : [c.getFullYear(), c.getMonth(), c.getDate()]
- }
- function za(a) {
- var b, c, d, e, f = [];
- if (!a._d) {
- for (d = ya(a), a._w && null == a._a[Dd] && null == a._a[Cd] && Aa(a), a._dayOfYear && (e = xa(a._a[Bd], d[Bd]), a._dayOfYear > qa(e) && (j(a)._overflowDayOfYear = !0), c = pa(e, 0, a._dayOfYear), a._a[Cd] = c.getUTCMonth(), a._a[Dd] = c.getUTCDate()), b = 0; 3 > b && null == a._a[b]; ++b) a._a[b] = f[b] = d[b];
- for (; 7 > b; b++) a._a[b] = f[b] = null == a._a[b] ? 2 === b ? 1 : 0 : a._a[b];
- 24 === a._a[Ed] && 0 === a._a[Fd] && 0 === a._a[Gd] && 0 === a._a[Hd] && (a._nextDay = !0, a._a[Ed] = 0), a._d = (a._useUTC ? pa : oa).apply(null, f), null != a._tzm && a._d.setUTCMinutes(a._d.getUTCMinutes() - a._tzm), a._nextDay && (a._a[Ed] = 24)
- }
- }
- function Aa(a) {
- var b, c, d, e, f, g, h, i;
- b = a._w, null != b.GG || null != b.W || null != b.E ? (f = 1, g = 4, c = xa(b.GG, a._a[Bd], va(Ja(), 1, 4).year), d = xa(b.W, 1), e = xa(b.E, 1), (1 > e || e > 7) && (i = !0)) : (f = a._locale._week.dow, g = a._locale._week.doy, c = xa(b.gg, a._a[Bd], va(Ja(), f, g).year), d = xa(b.w, 1), null != b.d ? (e = b.d, (0 > e || e > 6) && (i = !0)) : null != b.e ? (e = b.e + f, (b.e < 0 || b.e > 6) && (i = !0)) : e = f), 1 > d || d > wa(c, f, g) ? j(a)._overflowWeeks = !0 : null != i ? j(a)._overflowWeekday = !0 : (h = ua(c, d, e, f, g), a._a[Bd] = h.year, a._dayOfYear = h.dayOfYear)
- }
- function Ba(b) {
- if (b._f === a.ISO_8601) return void ma(b);
- b._a = [], j(b).empty = !0;
- var c, d, e, f, g, h = "" + b._i,
- i = h.length,
- k = 0;
- for (e = V(b._f, b._locale).match(ed) || [], c = 0; c < e.length; c++) f = e[c], d = (h.match(X(f, b)) || [])[0], d && (g = h.substr(0, h.indexOf(d)), g.length > 0 && j(b).unusedInput.push(g), h = h.slice(h.indexOf(d) + d.length), k += d.length), hd[f] ? (d ? j(b).empty = !1 : j(b).unusedTokens.push(f), aa(f, d, b)) : b._strict && !d && j(b).unusedTokens.push(f);
- j(b).charsLeftOver = i - k, h.length > 0 && j(b).unusedInput.push(h), j(b).bigHour === !0 && b._a[Ed] <= 12 && b._a[Ed] > 0 && (j(b).bigHour = void 0), b._a[Ed] = Ca(b._locale, b._a[Ed], b._meridiem), za(b), la(b)
- }
- function Ca(a, b, c) {
- var d;
- return null == c ? b : null != a.meridiemHour ? a.meridiemHour(b, c) : null != a.isPM ? (d = a.isPM(c), d && 12 > b && (b += 12), d || 12 !== b || (b = 0), b) : b
- }
- function Da(a) {
- var b, c, d, e, f;
- if (0 === a._f.length) return j(a).invalidFormat = !0, void(a._d = new Date(NaN));
- for (e = 0; e < a._f.length; e++) f = 0, b = n({}, a), null != a._useUTC && (b._useUTC = a._useUTC), b._f = a._f[e], Ba(b), k(b) && (f += j(b).charsLeftOver, f += 10 * j(b).unusedTokens.length, j(b).score = f, (null == d || d > f) && (d = f, c = b));
- g(a, c || b)
- }
- function Ea(a) {
- if (!a._d) {
- var b = L(a._i);
- a._a = e([b.year, b.month, b.day || b.date, b.hour, b.minute, b.second, b.millisecond], function(a) {
- return a && parseInt(a, 10)
- }), za(a)
- }
- }
- function Fa(a) {
- var b = new o(la(Ga(a)));
- return b._nextDay && (b.add(1, "d"), b._nextDay = void 0), b
- }
- function Ga(a) {
- var b = a._i,
- e = a._f;
- return a._locale = a._locale || H(a._l), null === b || void 0 === e && "" === b ? l({
- nullInput: !0
- }) : ("string" == typeof b && (a._i = b = a._locale.preparse(b)), p(b) ? new o(la(b)) : (c(e) ? Da(a) : e ? Ba(a) : d(b) ? a._d = b : Ha(a), k(a) || (a._d = null), a))
- }
- function Ha(b) {
- var f = b._i;
- void 0 === f ? b._d = new Date(a.now()) : d(f) ? b._d = new Date(+f) : "string" == typeof f ? na(b) : c(f) ? (b._a = e(f.slice(0), function(a) {
- return parseInt(a, 10)
- }), za(b)) : "object" == typeof f ? Ea(b) : "number" == typeof f ? b._d = new Date(f) : a.createFromInputFallback(b)
- }
- function Ia(a, b, c, d, e) {
- var f = {};
- return "boolean" == typeof c && (d = c, c = void 0), f._isAMomentObject = !0, f._useUTC = f._isUTC = e, f._l = c, f._i = a, f._f = b, f._strict = d, Fa(f)
- }
- function Ja(a, b, c, d) {
- return Ia(a, b, c, d, !1)
- }
- function Ka(a, b) {
- var d, e;
- if (1 === b.length && c(b[0]) && (b = b[0]), !b.length) return Ja();
- for (d = b[0], e = 1; e < b.length; ++e) b[e].isValid() && !b[e][a](d) || (d = b[e]);
- return d
- }
- function La() {
- var a = [].slice.call(arguments, 0);
- return Ka("isBefore", a)
- }
- function Ma() {
- var a = [].slice.call(arguments, 0);
- return Ka("isAfter", a)
- }
- function Na(a) {
- var b = L(a),
- c = b.year || 0,
- d = b.quarter || 0,
- e = b.month || 0,
- f = b.week || 0,
- g = b.day || 0,
- h = b.hour || 0,
- i = b.minute || 0,
- j = b.second || 0,
- k = b.millisecond || 0;
- this._milliseconds = +k + 1e3 * j + 6e4 * i + 36e5 * h, this._days = +g + 7 * f, this._months = +e + 3 * d + 12 * c, this._data = {}, this._locale = H(), this._bubble()
- }
- function Oa(a) {
- return a instanceof Na
- }
- function Pa(a, b) {
- R(a, 0, 0, function() {
- var a = this.utcOffset(),
- c = "+";
- return 0 > a && (a = -a, c = "-"), c + Q(~~(a / 60), 2) + b + Q(~~a % 60, 2)
- })
- }
- function Qa(a, b) {
- var c = (b || "").match(a) || [],
- d = c[c.length - 1] || [],
- e = (d + "").match(Zd) || ["-", 0, 0],
- f = +(60 * e[1]) + r(e[2]);
- return "+" === e[0] ? f : -f
- }
- function Ra(b, c) {
- var e, f;
- return c._isUTC ? (e = c.clone(), f = (p(b) || d(b) ? +b : +Ja(b)) - +e, e._d.setTime(+e._d + f), a.updateOffset(e, !1), e) : Ja(b).local()
- }
- function Sa(a) {
- return 15 * -Math.round(a._d.getTimezoneOffset() / 15)
- }
- function Ta(b, c) {
- var d, e = this._offset || 0;
- return this.isValid() ? null != b ? ("string" == typeof b ? b = Qa(wd, b) : Math.abs(b) < 16 && (b = 60 * b), !this._isUTC && c && (d = Sa(this)), this._offset = b, this._isUTC = !0, null != d && this.add(d, "m"), e !== b && (!c || this._changeInProgress ? ib(this, cb(b - e, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, a.updateOffset(this, !0), this._changeInProgress = null)), this) : this._isUTC ? e : Sa(this) : null != b ? this : NaN
- }
- function Ua(a, b) {
- return null != a ? ("string" != typeof a && (a = -a), this.utcOffset(a, b), this) : -this.utcOffset()
- }
- function Va(a) {
- return this.utcOffset(0, a)
- }
- function Wa(a) {
- return this._isUTC && (this.utcOffset(0, a), this._isUTC = !1, a && this.subtract(Sa(this), "m")), this
- }
- function Xa() {
- return this._tzm ? this.utcOffset(this._tzm) : "string" == typeof this._i && this.utcOffset(Qa(vd, this._i)), this
- }
- function Ya(a) {
- return this.isValid() ? (a = a ? Ja(a).utcOffset() : 0, (this.utcOffset() - a) % 60 === 0) : !1
- }
- function Za() {
- return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset()
- }
- function $a() {
- if (!m(this._isDSTShifted)) return this._isDSTShifted;
- var a = {};
- if (n(a, this), a = Ga(a), a._a) {
- var b = a._isUTC ? h(a._a) : Ja(a._a);
- this._isDSTShifted = this.isValid() && s(a._a, b.toArray()) > 0
- } else this._isDSTShifted = !1;
- return this._isDSTShifted
- }
- function _a() {
- return this.isValid() ? !this._isUTC : !1
- }
- function ab() {
- return this.isValid() ? this._isUTC : !1
- }
- function bb() {
- return this.isValid() ? this._isUTC && 0 === this._offset : !1;
- }
- function cb(a, b) {
- var c, d, e, g = a,
- h = null;
- return Oa(a) ? g = {
- ms: a._milliseconds,
- d: a._days,
- M: a._months
- } : "number" == typeof a ? (g = {}, b ? g[b] = a : g.milliseconds = a) : (h = $d.exec(a)) ? (c = "-" === h[1] ? -1 : 1, g = {
- y: 0,
- d: r(h[Dd]) * c,
- h: r(h[Ed]) * c,
- m: r(h[Fd]) * c,
- s: r(h[Gd]) * c,
- ms: r(h[Hd]) * c
- }) : (h = _d.exec(a)) ? (c = "-" === h[1] ? -1 : 1, g = {
- y: db(h[2], c),
- M: db(h[3], c),
- w: db(h[4], c),
- d: db(h[5], c),
- h: db(h[6], c),
- m: db(h[7], c),
- s: db(h[8], c)
- }) : null == g ? g = {} : "object" == typeof g && ("from" in g || "to" in g) && (e = fb(Ja(g.from), Ja(g.to)), g = {}, g.ms = e.milliseconds, g.M = e.months), d = new Na(g), Oa(a) && f(a, "_locale") && (d._locale = a._locale), d
- }
- function db(a, b) {
- var c = a && parseFloat(a.replace(",", "."));
- return (isNaN(c) ? 0 : c) * b
- }
- function eb(a, b) {
- var c = {
- milliseconds: 0,
- months: 0
- };
- return c.months = b.month() - a.month() + 12 * (b.year() - a.year()), a.clone().add(c.months, "M").isAfter(b) && --c.months, c.milliseconds = +b - +a.clone().add(c.months, "M"), c
- }
- function fb(a, b) {
- var c;
- return a.isValid() && b.isValid() ? (b = Ra(b, a), a.isBefore(b) ? c = eb(a, b) : (c = eb(b, a), c.milliseconds = -c.milliseconds, c.months = -c.months), c) : {
- milliseconds: 0,
- months: 0
- }
- }
- function gb(a) {
- return 0 > a ? -1 * Math.round(-1 * a) : Math.round(a)
- }
- function hb(a, b) {
- return function(c, d) {
- var e, f;
- return null === d || isNaN(+d) || (v(b, "moment()." + b + "(period, number) is deprecated. Please use moment()." + b + "(number, period)."), f = c, c = d, d = f), c = "string" == typeof c ? +c : c, e = cb(c, d), ib(this, e, a), this
- }
- }
- function ib(b, c, d, e) {
- var f = c._milliseconds,
- g = gb(c._days),
- h = gb(c._months);
- b.isValid() && (e = null == e ? !0 : e, f && b._d.setTime(+b._d + f * d), g && O(b, "Date", N(b, "Date") + g * d), h && fa(b, N(b, "Month") + h * d), e && a.updateOffset(b, g || h))
- }
- function jb(a, b) {
- var c = a || Ja(),
- d = Ra(c, this).startOf("day"),
- e = this.diff(d, "days", !0),
- f = -6 > e ? "sameElse" : -1 > e ? "lastWeek" : 0 > e ? "lastDay" : 1 > e ? "sameDay" : 2 > e ? "nextDay" : 7 > e ? "nextWeek" : "sameElse",
- g = b && (w(b[f]) ? b[f]() : b[f]);
- return this.format(g || this.localeData().calendar(f, this, Ja(c)))
- }
- function kb() {
- return new o(this)
- }
- function lb(a, b) {
- var c = p(a) ? a : Ja(a);
- return this.isValid() && c.isValid() ? (b = K(m(b) ? "millisecond" : b), "millisecond" === b ? +this > +c : +c < +this.clone().startOf(b)) : !1
- }
- function mb(a, b) {
- var c = p(a) ? a : Ja(a);
- return this.isValid() && c.isValid() ? (b = K(m(b) ? "millisecond" : b), "millisecond" === b ? +c > +this : +this.clone().endOf(b) < +c) : !1
- }
- function nb(a, b, c) {
- return this.isAfter(a, c) && this.isBefore(b, c)
- }
- function ob(a, b) {
- var c, d = p(a) ? a : Ja(a);
- return this.isValid() && d.isValid() ? (b = K(b || "millisecond"), "millisecond" === b ? +this === +d : (c = +d, +this.clone().startOf(b) <= c && c <= +this.clone().endOf(b))) : !1
- }
- function pb(a, b) {
- return this.isSame(a, b) || this.isAfter(a, b)
- }
- function qb(a, b) {
- return this.isSame(a, b) || this.isBefore(a, b)
- }
- function rb(a, b, c) {
- var d, e, f, g;
- return this.isValid() ? (d = Ra(a, this), d.isValid() ? (e = 6e4 * (d.utcOffset() - this.utcOffset()), b = K(b), "year" === b || "month" === b || "quarter" === b ? (g = sb(this, d), "quarter" === b ? g /= 3 : "year" === b && (g /= 12)) : (f = this - d, g = "second" === b ? f / 1e3 : "minute" === b ? f / 6e4 : "hour" === b ? f / 36e5 : "day" === b ? (f - e) / 864e5 : "week" === b ? (f - e) / 6048e5 : f), c ? g : q(g)) : NaN) : NaN
- }
- function sb(a, b) {
- var c, d, e = 12 * (b.year() - a.year()) + (b.month() - a.month()),
- f = a.clone().add(e, "months");
- return 0 > b - f ? (c = a.clone().add(e - 1, "months"), d = (b - f) / (f - c)) : (c = a.clone().add(e + 1, "months"), d = (b - f) / (c - f)), -(e + d)
- }
- function tb() {
- return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
- }
- function ub() {
- var a = this.clone().utc();
- return 0 < a.year() && a.year() <= 9999 ? w(Date.prototype.toISOString) ? this.toDate().toISOString() : U(a, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]") : U(a, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
- }
- function vb(b) {
- var c = U(this, b || a.defaultFormat);
- return this.localeData().postformat(c)
- }
- function wb(a, b) {
- return this.isValid() && (p(a) && a.isValid() || Ja(a).isValid()) ? cb({
- to: this,
- from: a
- }).locale(this.locale()).humanize(!b) : this.localeData().invalidDate()
- }
- function xb(a) {
- return this.from(Ja(), a)
- }
- function yb(a, b) {
- return this.isValid() && (p(a) && a.isValid() || Ja(a).isValid()) ? cb({
- from: this,
- to: a
- }).locale(this.locale()).humanize(!b) : this.localeData().invalidDate()
- }
- function zb(a) {
- return this.to(Ja(), a)
- }
- function Ab(a) {
- var b;
- return void 0 === a ? this._locale._abbr : (b = H(a), null != b && (this._locale = b), this)
- }
- function Bb() {
- return this._locale
- }
- function Cb(a) {
- switch (a = K(a)) {
- case "year":
- this.month(0);
- case "quarter":
- case "month":
- this.date(1);
- case "week":
- case "isoWeek":
- case "day":
- this.hours(0);
- case "hour":
- this.minutes(0);
- case "minute":
- this.seconds(0);
- case "second":
- this.milliseconds(0)
- }
- return "week" === a && this.weekday(0), "isoWeek" === a && this.isoWeekday(1), "quarter" === a && this.month(3 * Math.floor(this.month() / 3)), this
- }
- function Db(a) {
- return a = K(a), void 0 === a || "millisecond" === a ? this : this.startOf(a).add(1, "isoWeek" === a ? "week" : a).subtract(1, "ms")
- }
- function Eb() {
- return +this._d - 6e4 * (this._offset || 0)
- }
- function Fb() {
- return Math.floor(+this / 1e3)
- }
- function Gb() {
- return this._offset ? new Date(+this) : this._d
- }
- function Hb() {
- var a = this;
- return [a.year(), a.month(), a.date(), a.hour(), a.minute(), a.second(), a.millisecond()]
- }
- function Ib() {
- var a = this;
- return {
- years: a.year(),
- months: a.month(),
- date: a.date(),
- hours: a.hours(),
- minutes: a.minutes(),
- seconds: a.seconds(),
- milliseconds: a.milliseconds()
- }
- }
- function Jb() {
- return this.isValid() ? this.toISOString() : null
- }
- function Kb() {
- return k(this)
- }
- function Lb() {
- return g({}, j(this))
- }
- function Mb() {
- return j(this).overflow
- }
- function Nb() {
- return {
- input: this._i,
- format: this._f,
- locale: this._locale,
- isUTC: this._isUTC,
- strict: this._strict
- }
- }
- function Ob(a, b) {
- R(0, [a, a.length], 0, b)
- }
- function Pb(a) {
- return Tb.call(this, a, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy)
- }
- function Qb(a) {
- return Tb.call(this, a, this.isoWeek(), this.isoWeekday(), 1, 4)
- }
- function Rb() {
- return wa(this.year(), 1, 4)
- }
- function Sb() {
- var a = this.localeData()._week;
- return wa(this.year(), a.dow, a.doy)
- }
- function Tb(a, b, c, d, e) {
- var f;
- return null == a ? va(this, d, e).year : (f = wa(a, d, e), b > f && (b = f), Ub.call(this, a, b, c, d, e))
- }
- function Ub(a, b, c, d, e) {
- var f = ua(a, b, c, d, e),
- g = pa(f.year, 0, f.dayOfYear);
- return this.year(g.getUTCFullYear()), this.month(g.getUTCMonth()), this.date(g.getUTCDate()), this
- }
- function Vb(a) {
- return null == a ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (a - 1) + this.month() % 3)
- }
- function Wb(a) {
- return va(a, this._week.dow, this._week.doy).week
- }
- function Xb() {
- return this._week.dow
- }
- function Yb() {
- return this._week.doy
- }
- function Zb(a) {
- var b = this.localeData().week(this);
- return null == a ? b : this.add(7 * (a - b), "d")
- }
- function $b(a) {
- var b = va(this, 1, 4).week;
- return null == a ? b : this.add(7 * (a - b), "d")
- }
- function _b(a, b) {
- return "string" != typeof a ? a : isNaN(a) ? (a = b.weekdaysParse(a), "number" == typeof a ? a : null) : parseInt(a, 10)
- }
- function ac(a, b) {
- return c(this._weekdays) ? this._weekdays[a.day()] : this._weekdays[this._weekdays.isFormat.test(b) ? "format" : "standalone"][a.day()]
- }
- function bc(a) {
- return this._weekdaysShort[a.day()]
- }
- function cc(a) {
- return this._weekdaysMin[a.day()]
- }
- function dc(a, b, c) {
- var d, e, f;
- for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), d = 0; 7 > d; d++) {
- if (e = Ja([2e3, 1]).day(d), c && !this._fullWeekdaysParse[d] && (this._fullWeekdaysParse[d] = new RegExp("^" + this.weekdays(e, "").replace(".", ".?") + "$", "i"), this._shortWeekdaysParse[d] = new RegExp("^" + this.weekdaysShort(e, "").replace(".", ".?") + "$", "i"), this._minWeekdaysParse[d] = new RegExp("^" + this.weekdaysMin(e, "").replace(".", ".?") + "$", "i")), this._weekdaysParse[d] || (f = "^" + this.weekdays(e, "") + "|^" + this.weekdaysShort(e, "") + "|^" + this.weekdaysMin(e, ""), this._weekdaysParse[d] = new RegExp(f.replace(".", ""), "i")), c && "dddd" === b && this._fullWeekdaysParse[d].test(a)) return d;
- if (c && "ddd" === b && this._shortWeekdaysParse[d].test(a)) return d;
- if (c && "dd" === b && this._minWeekdaysParse[d].test(a)) return d;
- if (!c && this._weekdaysParse[d].test(a)) return d
- }
- }
- function ec(a) {
- if (!this.isValid()) return null != a ? this : NaN;
- var b = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
- return null != a ? (a = _b(a, this.localeData()), this.add(a - b, "d")) : b
- }
- function fc(a) {
- if (!this.isValid()) return null != a ? this : NaN;
- var b = (this.day() + 7 - this.localeData()._week.dow) % 7;
- return null == a ? b : this.add(a - b, "d")
- }
- function gc(a) {
- return this.isValid() ? null == a ? this.day() || 7 : this.day(this.day() % 7 ? a : a - 7) : null != a ? this : NaN
- }
- function hc(a) {
- var b = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1;
- return null == a ? b : this.add(a - b, "d")
- }
- function ic() {
- return this.hours() % 12 || 12
- }
- function jc(a, b) {
- R(a, 0, 0, function() {
- return this.localeData().meridiem(this.hours(), this.minutes(), b)
- })
- }
- function kc(a, b) {
- return b._meridiemParse
- }
- function lc(a) {
- return "p" === (a + "").toLowerCase().charAt(0)
- }
- function mc(a, b, c) {
- return a > 11 ? c ? "pm" : "PM" : c ? "am" : "AM"
- }
- function nc(a, b) {
- b[Hd] = r(1e3 * ("0." + a))
- }
- function oc() {
- return this._isUTC ? "UTC" : ""
- }
- function pc() {
- return this._isUTC ? "Coordinated Universal Time" : ""
- }
- function qc(a) {
- return Ja(1e3 * a)
- }
- function rc() {
- return Ja.apply(null, arguments).parseZone()
- }
- function sc(a, b, c) {
- var d = this._calendar[a];
- return w(d) ? d.call(b, c) : d
- }
- function tc(a) {
- var b = this._longDateFormat[a],
- c = this._longDateFormat[a.toUpperCase()];
- return b || !c ? b : (this._longDateFormat[a] = c.replace(/MMMM|MM|DD|dddd/g, function(a) {
- return a.slice(1)
- }), this._longDateFormat[a])
- }
- function uc() {
- return this._invalidDate
- }
- function vc(a) {
- return this._ordinal.replace("%d", a)
- }
- function wc(a) {
- return a
- }
- function xc(a, b, c, d) {
- var e = this._relativeTime[c];
- return w(e) ? e(a, b, c, d) : e.replace(/%d/i, a)
- }
- function yc(a, b) {
- var c = this._relativeTime[a > 0 ? "future" : "past"];
- return w(c) ? c(b) : c.replace(/%s/i, b)
- }
- function zc(a, b, c, d) {
- var e = H(),
- f = h().set(d, b);
- return e[c](f, a)
- }
- function Ac(a, b, c, d, e) {
- if ("number" == typeof a && (b = a, a = void 0), a = a || "", null != b) return zc(a, b, c, e);
- var f, g = [];
- for (f = 0; d > f; f++) g[f] = zc(a, f, c, e);
- return g
- }
- function Bc(a, b) {
- return Ac(a, b, "months", 12, "month")
- }
- function Cc(a, b) {
- return Ac(a, b, "monthsShort", 12, "month")
- }
- function Dc(a, b) {
- return Ac(a, b, "weekdays", 7, "day")
- }
- function Ec(a, b) {
- return Ac(a, b, "weekdaysShort", 7, "day")
- }
- function Fc(a, b) {
- return Ac(a, b, "weekdaysMin", 7, "day")
- }
- function Gc() {
- var a = this._data;
- return this._milliseconds = xe(this._milliseconds), this._days = xe(this._days), this._months = xe(this._months), a.milliseconds = xe(a.milliseconds), a.seconds = xe(a.seconds), a.minutes = xe(a.minutes), a.hours = xe(a.hours), a.months = xe(a.months), a.years = xe(a.years), this
- }
- function Hc(a, b, c, d) {
- var e = cb(b, c);
- return a._milliseconds += d * e._milliseconds, a._days += d * e._days, a._months += d * e._months, a._bubble()
- }
- function Ic(a, b) {
- return Hc(this, a, b, 1)
- }
- function Jc(a, b) {
- return Hc(this, a, b, -1)
- }
- function Kc(a) {
- return 0 > a ? Math.floor(a) : Math.ceil(a)
- }
- function Lc() {
- var a, b, c, d, e, f = this._milliseconds,
- g = this._days,
- h = this._months,
- i = this._data;
- return f >= 0 && g >= 0 && h >= 0 || 0 >= f && 0 >= g && 0 >= h || (f += 864e5 * Kc(Nc(h) + g), g = 0, h = 0), i.milliseconds = f % 1e3, a = q(f / 1e3), i.seconds = a % 60, b = q(a / 60), i.minutes = b % 60, c = q(b / 60), i.hours = c % 24, g += q(c / 24), e = q(Mc(g)), h += e, g -= Kc(Nc(e)), d = q(h / 12), h %= 12, i.days = g, i.months = h, i.years = d, this
- }
- function Mc(a) {
- return 4800 * a / 146097
- }
- function Nc(a) {
- return 146097 * a / 4800
- }
- function Oc(a) {
- var b, c, d = this._milliseconds;
- if (a = K(a), "month" === a || "year" === a) return b = this._days + d / 864e5, c = this._months + Mc(b), "month" === a ? c : c / 12;
- switch (b = this._days + Math.round(Nc(this._months)), a) {
- case "week":
- return b / 7 + d / 6048e5;
- case "day":
- return b + d / 864e5;
- case "hour":
- return 24 * b + d / 36e5;
- case "minute":
- return 1440 * b + d / 6e4;
- case "second":
- return 86400 * b + d / 1e3;
- case "millisecond":
- return Math.floor(864e5 * b) + d;
- default:
- throw new Error("Unknown unit " + a)
- }
- }
- function Pc() {
- return this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * r(this._months / 12)
- }
- function Qc(a) {
- return function() {
- return this.as(a)
- }
- }
- function Rc(a) {
- return a = K(a), this[a + "s"]()
- }
- function Sc(a) {
- return function() {
- return this._data[a]
- }
- }
- function Tc() {
- return q(this.days() / 7)
- }
- function Uc(a, b, c, d, e) {
- return e.relativeTime(b || 1, !!c, a, d)
- }
- function Vc(a, b, c) {
- var d = cb(a).abs(),
- e = Ne(d.as("s")),
- f = Ne(d.as("m")),
- g = Ne(d.as("h")),
- h = Ne(d.as("d")),
- i = Ne(d.as("M")),
- j = Ne(d.as("y")),
- k = e < Oe.s && ["s", e] || 1 >= f && ["m"] || f < Oe.m && ["mm", f] || 1 >= g && ["h"] || g < Oe.h && ["hh", g] || 1 >= h && ["d"] || h < Oe.d && ["dd", h] || 1 >= i && ["M"] || i < Oe.M && ["MM", i] || 1 >= j && ["y"] || ["yy", j];
- return k[2] = b, k[3] = +a > 0, k[4] = c, Uc.apply(null, k)
- }
- function Wc(a, b) {
- return void 0 === Oe[a] ? !1 : void 0 === b ? Oe[a] : (Oe[a] = b, !0)
- }
- function Xc(a) {
- var b = this.localeData(),
- c = Vc(this, !a, b);
- return a && (c = b.pastFuture(+this, c)), b.postformat(c)
- }
- function Yc() {
- var a, b, c, d = Pe(this._milliseconds) / 1e3,
- e = Pe(this._days),
- f = Pe(this._months);
- a = q(d / 60), b = q(a / 60), d %= 60, a %= 60, c = q(f / 12), f %= 12;
- var g = c,
- h = f,
- i = e,
- j = b,
- k = a,
- l = d,
- m = this.asSeconds();
- return m ? (0 > m ? "-" : "") + "P" + (g ? g + "Y" : "") + (h ? h + "M" : "") + (i ? i + "D" : "") + (j || k || l ? "T" : "") + (j ? j + "H" : "") + (k ? k + "M" : "") + (l ? l + "S" : "") : "P0D"
- }
- var Zc, $c = a.momentProperties = [],
- _c = !1,
- ad = {};
- a.suppressDeprecationWarnings = !1;
- var bd, cd = {},
- dd = {},
- ed = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
- fd = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
- gd = {},
- hd = {},
- id = /\d/,
- jd = /\d\d/,
- kd = /\d{3}/,
- ld = /\d{4}/,
- md = /[+-]?\d{6}/,
- nd = /\d\d?/,
- od = /\d\d\d\d?/,
- pd = /\d\d\d\d\d\d?/,
- qd = /\d{1,3}/,
- rd = /\d{1,4}/,
- sd = /[+-]?\d{1,6}/,
- td = /\d+/,
- ud = /[+-]?\d+/,
- vd = /Z|[+-]\d\d:?\d\d/gi,
- wd = /Z|[+-]\d\d(?::?\d\d)?/gi,
- xd = /[+-]?\d+(\.\d{1,3})?/,
- yd = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,
- zd = {},
- Ad = {},
- Bd = 0,
- Cd = 1,
- Dd = 2,
- Ed = 3,
- Fd = 4,
- Gd = 5,
- Hd = 6,
- Id = 7,
- Jd = 8;
- R("M", ["MM", 2], "Mo", function() {
- return this.month() + 1
- }), R("MMM", 0, 0, function(a) {
- return this.localeData().monthsShort(this, a)
- }), R("MMMM", 0, 0, function(a) {
- return this.localeData().months(this, a)
- }), J("month", "M"), W("M", nd), W("MM", nd, jd), W("MMM", function(a, b) {
- return b.monthsShortRegex(a)
- }), W("MMMM", function(a, b) {
- return b.monthsRegex(a)
- }), $(["M", "MM"], function(a, b) {
- b[Cd] = r(a) - 1
- }), $(["MMM", "MMMM"], function(a, b, c, d) {
- var e = c._locale.monthsParse(a, d, c._strict);
- null != e ? b[Cd] = e : j(c).invalidMonth = a
- });
- var Kd = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,
- Ld = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
- Md = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
- Nd = yd,
- Od = yd,
- Pd = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,
- Qd = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,
- Rd = /Z|[+-]\d\d(?::?\d\d)?/,
- Sd = [
- ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
- ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
- ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
- ["GGGG-[W]WW", /\d{4}-W\d\d/, !1],
- ["YYYY-DDD", /\d{4}-\d{3}/],
- ["YYYY-MM", /\d{4}-\d\d/, !1],
- ["YYYYYYMMDD", /[+-]\d{10}/],
- ["YYYYMMDD", /\d{8}/],
- ["GGGG[W]WWE", /\d{4}W\d{3}/],
- ["GGGG[W]WW", /\d{4}W\d{2}/, !1],
- ["YYYYDDD", /\d{7}/]
- ],
- Td = [
- ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
- ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
- ["HH:mm:ss", /\d\d:\d\d:\d\d/],
- ["HH:mm", /\d\d:\d\d/],
- ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
- ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
- ["HHmmss", /\d\d\d\d\d\d/],
- ["HHmm", /\d\d\d\d/],
- ["HH", /\d\d/]
- ],
- Ud = /^\/?Date\((\-?\d+)/i;
- a.createFromInputFallback = u("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", function(a) {
- a._d = new Date(a._i + (a._useUTC ? " UTC" : ""))
- }), R("Y", 0, 0, function() {
- var a = this.year();
- return 9999 >= a ? "" + a : "+" + a
- }), R(0, ["YY", 2], 0, function() {
- return this.year() % 100
- }), R(0, ["YYYY", 4], 0, "year"), R(0, ["YYYYY", 5], 0, "year"), R(0, ["YYYYYY", 6, !0], 0, "year"), J("year", "y"), W("Y", ud), W("YY", nd, jd), W("YYYY", rd, ld), W("YYYYY", sd, md), W("YYYYYY", sd, md), $(["YYYYY", "YYYYYY"], Bd), $("YYYY", function(b, c) {
- c[Bd] = 2 === b.length ? a.parseTwoDigitYear(b) : r(b)
- }), $("YY", function(b, c) {
- c[Bd] = a.parseTwoDigitYear(b)
- }), $("Y", function(a, b) {
- b[Bd] = parseInt(a, 10)
- }), a.parseTwoDigitYear = function(a) {
- return r(a) + (r(a) > 68 ? 1900 : 2e3)
- };
- var Vd = M("FullYear", !1);
- a.ISO_8601 = function() {};
- var Wd = u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function() {
- var a = Ja.apply(null, arguments);
- return this.isValid() && a.isValid() ? this > a ? this : a : l()
- }),
- Xd = u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function() {
- var a = Ja.apply(null, arguments);
- return this.isValid() && a.isValid() ? a > this ? this : a : l()
- }),
- Yd = function() {
- return Date.now ? Date.now() : +new Date
- };
- Pa("Z", ":"), Pa("ZZ", ""), W("Z", wd), W("ZZ", wd), $(["Z", "ZZ"], function(a, b, c) {
- c._useUTC = !0, c._tzm = Qa(wd, a)
- });
- var Zd = /([\+\-]|\d\d)/gi;
- a.updateOffset = function() {};
- var $d = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,
- _d = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;
- cb.fn = Na.prototype;
- var ae = hb(1, "add"),
- be = hb(-1, "subtract");
- a.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
- var ce = u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(a) {
- return void 0 === a ? this.localeData() : this.locale(a)
- });
- R(0, ["gg", 2], 0, function() {
- return this.weekYear() % 100
- }), R(0, ["GG", 2], 0, function() {
- return this.isoWeekYear() % 100
- }), Ob("gggg", "weekYear"), Ob("ggggg", "weekYear"), Ob("GGGG", "isoWeekYear"), Ob("GGGGG", "isoWeekYear"), J("weekYear", "gg"), J("isoWeekYear", "GG"), W("G", ud), W("g", ud), W("GG", nd, jd), W("gg", nd, jd), W("GGGG", rd, ld), W("gggg", rd, ld), W("GGGGG", sd, md), W("ggggg", sd, md), _(["gggg", "ggggg", "GGGG", "GGGGG"], function(a, b, c, d) {
- b[d.substr(0, 2)] = r(a)
- }), _(["gg", "GG"], function(b, c, d, e) {
- c[e] = a.parseTwoDigitYear(b)
- }), R("Q", 0, "Qo", "quarter"), J("quarter", "Q"), W("Q", id), $("Q", function(a, b) {
- b[Cd] = 3 * (r(a) - 1)
- }), R("w", ["ww", 2], "wo", "week"), R("W", ["WW", 2], "Wo", "isoWeek"), J("week", "w"), J("isoWeek", "W"), W("w", nd), W("ww", nd, jd), W("W", nd), W("WW", nd, jd), _(["w", "ww", "W", "WW"], function(a, b, c, d) {
- b[d.substr(0, 1)] = r(a)
- });
- var de = {
- dow: 0,
- doy: 6
- };
- R("D", ["DD", 2], "Do", "date"), J("date", "D"), W("D", nd), W("DD", nd, jd), W("Do", function(a, b) {
- return a ? b._ordinalParse : b._ordinalParseLenient
- }), $(["D", "DD"], Dd), $("Do", function(a, b) {
- b[Dd] = r(a.match(nd)[0], 10)
- });
- var ee = M("Date", !0);
- R("d", 0, "do", "day"), R("dd", 0, 0, function(a) {
- return this.localeData().weekdaysMin(this, a)
- }), R("ddd", 0, 0, function(a) {
- return this.localeData().weekdaysShort(this, a)
- }), R("dddd", 0, 0, function(a) {
- return this.localeData().weekdays(this, a)
- }), R("e", 0, 0, "weekday"), R("E", 0, 0, "isoWeekday"), J("day", "d"), J("weekday", "e"), J("isoWeekday", "E"), W("d", nd), W("e", nd), W("E", nd), W("dd", yd), W("ddd", yd), W("dddd", yd), _(["dd", "ddd", "dddd"], function(a, b, c, d) {
- var e = c._locale.weekdaysParse(a, d, c._strict);
- null != e ? b.d = e : j(c).invalidWeekday = a
- }), _(["d", "e", "E"], function(a, b, c, d) {
- b[d] = r(a)
- });
- var fe = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
- ge = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
- he = "Su_Mo_Tu_We_Th_Fr_Sa".split("_");
- R("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), J("dayOfYear", "DDD"), W("DDD", qd), W("DDDD", kd), $(["DDD", "DDDD"], function(a, b, c) {
- c._dayOfYear = r(a)
- }), R("H", ["HH", 2], 0, "hour"), R("h", ["hh", 2], 0, ic), R("hmm", 0, 0, function() {
- return "" + ic.apply(this) + Q(this.minutes(), 2)
- }), R("hmmss", 0, 0, function() {
- return "" + ic.apply(this) + Q(this.minutes(), 2) + Q(this.seconds(), 2)
- }), R("Hmm", 0, 0, function() {
- return "" + this.hours() + Q(this.minutes(), 2)
- }), R("Hmmss", 0, 0, function() {
- return "" + this.hours() + Q(this.minutes(), 2) + Q(this.seconds(), 2)
- }), jc("a", !0), jc("A", !1), J("hour", "h"), W("a", kc), W("A", kc), W("H", nd), W("h", nd), W("HH", nd, jd), W("hh", nd, jd), W("hmm", od), W("hmmss", pd), W("Hmm", od), W("Hmmss", pd), $(["H", "HH"], Ed), $(["a", "A"], function(a, b, c) {
- c._isPm = c._locale.isPM(a), c._meridiem = a
- }), $(["h", "hh"], function(a, b, c) {
- b[Ed] = r(a), j(c).bigHour = !0
- }), $("hmm", function(a, b, c) {
- var d = a.length - 2;
- b[Ed] = r(a.substr(0, d)), b[Fd] = r(a.substr(d)), j(c).bigHour = !0
- }), $("hmmss", function(a, b, c) {
- var d = a.length - 4,
- e = a.length - 2;
- b[Ed] = r(a.substr(0, d)), b[Fd] = r(a.substr(d, 2)), b[Gd] = r(a.substr(e)), j(c).bigHour = !0
- }), $("Hmm", function(a, b, c) {
- var d = a.length - 2;
- b[Ed] = r(a.substr(0, d)), b[Fd] = r(a.substr(d))
- }), $("Hmmss", function(a, b, c) {
- var d = a.length - 4,
- e = a.length - 2;
- b[Ed] = r(a.substr(0, d)), b[Fd] = r(a.substr(d, 2)), b[Gd] = r(a.substr(e))
- });
- var ie = /[ap]\.?m?\.?/i,
- je = M("Hours", !0);
- R("m", ["mm", 2], 0, "minute"), J("minute", "m"), W("m", nd), W("mm", nd, jd), $(["m", "mm"], Fd);
- var ke = M("Minutes", !1);
- R("s", ["ss", 2], 0, "second"), J("second", "s"), W("s", nd), W("ss", nd, jd), $(["s", "ss"], Gd);
- var le = M("Seconds", !1);
- R("S", 0, 0, function() {
- return ~~(this.millisecond() / 100)
- }), R(0, ["SS", 2], 0, function() {
- return ~~(this.millisecond() / 10)
- }), R(0, ["SSS", 3], 0, "millisecond"), R(0, ["SSSS", 4], 0, function() {
- return 10 * this.millisecond()
- }), R(0, ["SSSSS", 5], 0, function() {
- return 100 * this.millisecond()
- }), R(0, ["SSSSSS", 6], 0, function() {
- return 1e3 * this.millisecond()
- }), R(0, ["SSSSSSS", 7], 0, function() {
- return 1e4 * this.millisecond()
- }), R(0, ["SSSSSSSS", 8], 0, function() {
- return 1e5 * this.millisecond()
- }), R(0, ["SSSSSSSSS", 9], 0, function() {
- return 1e6 * this.millisecond()
- }), J("millisecond", "ms"), W("S", qd, id), W("SS", qd, jd), W("SSS", qd, kd);
- var me;
- for (me = "SSSS"; me.length <= 9; me += "S") W(me, td);
- for (me = "S"; me.length <= 9; me += "S") $(me, nc);
- var ne = M("Milliseconds", !1);
- R("z", 0, 0, "zoneAbbr"), R("zz", 0, 0, "zoneName");
- var oe = o.prototype;
- oe.add = ae, oe.calendar = jb, oe.clone = kb, oe.diff = rb, oe.endOf = Db, oe.format = vb, oe.from = wb, oe.fromNow = xb, oe.to = yb, oe.toNow = zb, oe.get = P, oe.invalidAt = Mb, oe.isAfter = lb, oe.isBefore = mb, oe.isBetween = nb, oe.isSame = ob, oe.isSameOrAfter = pb, oe.isSameOrBefore = qb, oe.isValid = Kb, oe.lang = ce, oe.locale = Ab, oe.localeData = Bb, oe.max = Xd, oe.min = Wd, oe.parsingFlags = Lb, oe.set = P, oe.startOf = Cb, oe.subtract = be, oe.toArray = Hb, oe.toObject = Ib, oe.toDate = Gb, oe.toISOString = ub, oe.toJSON = Jb, oe.toString = tb, oe.unix = Fb, oe.valueOf = Eb, oe.creationData = Nb, oe.year = Vd, oe.isLeapYear = sa, oe.weekYear = Pb, oe.isoWeekYear = Qb, oe.quarter = oe.quarters = Vb, oe.month = ga, oe.daysInMonth = ha, oe.week = oe.weeks = Zb, oe.isoWeek = oe.isoWeeks = $b, oe.weeksInYear = Sb, oe.isoWeeksInYear = Rb, oe.date = ee, oe.day = oe.days = ec, oe.weekday = fc, oe.isoWeekday = gc, oe.dayOfYear = hc, oe.hour = oe.hours = je, oe.minute = oe.minutes = ke, oe.second = oe.seconds = le, oe.millisecond = oe.milliseconds = ne, oe.utcOffset = Ta, oe.utc = Va, oe.local = Wa, oe.parseZone = Xa, oe.hasAlignedHourOffset = Ya, oe.isDST = Za, oe.isDSTShifted = $a, oe.isLocal = _a, oe.isUtcOffset = ab, oe.isUtc = bb, oe.isUTC = bb, oe.zoneAbbr = oc, oe.zoneName = pc, oe.dates = u("dates accessor is deprecated. Use date instead.", ee), oe.months = u("months accessor is deprecated. Use month instead", ga), oe.years = u("years accessor is deprecated. Use year instead", Vd), oe.zone = u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779", Ua);
- var pe = oe,
- qe = {
- sameDay: "[Today at] LT",
- nextDay: "[Tomorrow at] LT",
- nextWeek: "dddd [at] LT",
- lastDay: "[Yesterday at] LT",
- lastWeek: "[Last] dddd [at] LT",
- sameElse: "L"
- },
- re = {
- LTS: "h:mm:ss A",
- LT: "h:mm A",
- L: "MM/DD/YYYY",
- LL: "MMMM D, YYYY",
- LLL: "MMMM D, YYYY h:mm A",
- LLLL: "dddd, MMMM D, YYYY h:mm A"
- },
- se = "Invalid date",
- te = "%d",
- ue = /\d{1,2}/,
- ve = {
- future: "in %s",
- past: "%s ago",
- s: "a few seconds",
- m: "a minute",
- mm: "%d minutes",
- h: "an hour",
- hh: "%d hours",
- d: "a day",
- dd: "%d days",
- M: "a month",
- MM: "%d months",
- y: "a year",
- yy: "%d years"
- },
- we = A.prototype;
- we._calendar = qe, we.calendar = sc, we._longDateFormat = re, we.longDateFormat = tc, we._invalidDate = se, we.invalidDate = uc, we._ordinal = te, we.ordinal = vc, we._ordinalParse = ue, we.preparse = wc, we.postformat = wc, we._relativeTime = ve, we.relativeTime = xc, we.pastFuture = yc, we.set = y, we.months = ca, we._months = Ld, we.monthsShort = da, we._monthsShort = Md, we.monthsParse = ea, we._monthsRegex = Od, we.monthsRegex = ja, we._monthsShortRegex = Nd, we.monthsShortRegex = ia, we.week = Wb, we._week = de, we.firstDayOfYear = Yb, we.firstDayOfWeek = Xb, we.weekdays = ac, we._weekdays = fe, we.weekdaysMin = cc, we._weekdaysMin = he, we.weekdaysShort = bc, we._weekdaysShort = ge, we.weekdaysParse = dc, we.isPM = lc, we._meridiemParse = ie, we.meridiem = mc, E("en", {
- ordinalParse: /\d{1,2}(th|st|nd|rd)/,
- ordinal: function(a) {
- var b = a % 10,
- c = 1 === r(a % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th";
- return a + c
- }
- }), a.lang = u("moment.lang is deprecated. Use moment.locale instead.", E), a.langData = u("moment.langData is deprecated. Use moment.localeData instead.", H);
- var xe = Math.abs,
- ye = Qc("ms"),
- ze = Qc("s"),
- Ae = Qc("m"),
- Be = Qc("h"),
- Ce = Qc("d"),
- De = Qc("w"),
- Ee = Qc("M"),
- Fe = Qc("y"),
- Ge = Sc("milliseconds"),
- He = Sc("seconds"),
- Ie = Sc("minutes"),
- Je = Sc("hours"),
- Ke = Sc("days"),
- Le = Sc("months"),
- Me = Sc("years"),
- Ne = Math.round,
- Oe = {
- s: 45,
- m: 45,
- h: 22,
- d: 26,
- M: 11
- },
- Pe = Math.abs,
- Qe = Na.prototype;
- Qe.abs = Gc, Qe.add = Ic, Qe.subtract = Jc, Qe.as = Oc, Qe.asMilliseconds = ye, Qe.asSeconds = ze, Qe.asMinutes = Ae, Qe.asHours = Be, Qe.asDays = Ce, Qe.asWeeks = De, Qe.asMonths = Ee, Qe.asYears = Fe, Qe.valueOf = Pc, Qe._bubble = Lc, Qe.get = Rc, Qe.milliseconds = Ge, Qe.seconds = He, Qe.minutes = Ie, Qe.hours = Je, Qe.days = Ke, Qe.weeks = Tc, Qe.months = Le, Qe.years = Me, Qe.humanize = Xc, Qe.toISOString = Yc, Qe.toString = Yc, Qe.toJSON = Yc, Qe.locale = Ab, Qe.localeData = Bb, Qe.toIsoString = u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", Yc), Qe.lang = ce, R("X", 0, 0, "unix"), R("x", 0, 0, "valueOf"), W("x", ud), W("X", xd), $("X", function(a, b, c) {
- c._d = new Date(1e3 * parseFloat(a, 10))
- }), $("x", function(a, b, c) {
- c._d = new Date(r(a))
- }), a.version = "2.12.0", b(Ja), a.fn = pe, a.min = La, a.max = Ma, a.now = Yd, a.utc = h, a.unix = qc, a.months = Bc, a.isDate = d, a.locale = E, a.invalid = l, a.duration = cb, a.isMoment = p, a.weekdays = Dc, a.parseZone = rc, a.localeData = H, a.isDuration = Oa, a.monthsShort = Cc, a.weekdaysMin = Fc, a.defineLocale = F, a.updateLocale = G, a.locales = I, a.weekdaysShort = Ec, a.normalizeUnits = K, a.relativeTimeThreshold = Wc, a.prototype = pe;
- var Re = a;
- return Re
- }), angular.module("bootstrapLightbox", ["ui.bootstrap"]);
- try {
- angular.module("angular-loading-bar"), angular.module("bootstrapLightbox").requires.push("angular-loading-bar")
- } catch (e) {}
- try {
- angular.module("ngTouch"), angular.module("bootstrapLightbox").requires.push("ngTouch")
- } catch (e) {}
- try {
- angular.module("videosharing-embed"), angular.module("bootstrapLightbox").requires.push("videosharing-embed")
- } catch (e) {}
- angular.module("bootstrapLightbox").run(["$templateCache", function(a) {
- "use strict";
- a.put("lightbox.html", '<div class=modal-body ng-swipe-left=Lightbox.nextImage() ng-swipe-right=Lightbox.prevImage()><div class=lightbox-nav><button class=close aria-hidden=true ng-click=$dismiss()>×</button><div class=btn-group ng-if="Lightbox.images.length > 1"><a class="btn btn-xs btn-default" ng-click=Lightbox.prevImage()>‹ Previous</a> <a ng-href={{Lightbox.imageUrl}} target=_blank class="btn btn-xs btn-default" title="Open in new tab">Open image in new tab</a> <a class="btn btn-xs btn-default" ng-click=Lightbox.nextImage()>Next ›</a></div></div><div class=lightbox-image-container><div class=lightbox-image-caption><span>{{Lightbox.imageCaption}}</span></div><img ng-if=!Lightbox.isVideo(Lightbox.image) lightbox-src={{Lightbox.imageUrl}}><div ng-if=Lightbox.isVideo(Lightbox.image) class="embed-responsive embed-responsive-16by9"><video ng-if=!Lightbox.isSharedVideo(Lightbox.image) lightbox-src={{Lightbox.imageUrl}} controls autoplay></video><embed-video ng-if=Lightbox.isSharedVideo(Lightbox.image) lightbox-src={{Lightbox.imageUrl}} ng-href={{Lightbox.imageUrl}} iframe-id=lightbox-video class=embed-responsive-item><a ng-href={{Lightbox.imageUrl}}>Watch video</a></embed-video></div></div></div>')
- }]), angular.module("bootstrapLightbox").service("ImageLoader", ["$q", function(a) {
- this.load = function(b) {
- var c = a.defer(),
- d = new Image;
- return d.onload = function() {
- ("boolean" == typeof this.complete && this.complete === !1 || "number" == typeof this.naturalWidth && 0 === this.naturalWidth) && c.reject(), c.resolve(d)
- }, d.onerror = function() {
- c.reject()
- }, d.src = b, c.promise
- }
- }]), angular.module("bootstrapLightbox").provider("Lightbox", function() {
- this.templateUrl = "lightbox.html", this.fullScreenMode = !1, this.getImageUrl = function(a) {
- return "string" == typeof a ? a : a.url
- }, this.getImageCaption = function(a) {
- return a.caption
- }, this.calculateImageDimensionLimits = function(a) {
- return a.windowWidth >= 768 ? {
- maxWidth: a.windowWidth - 92,
- maxHeight: a.windowHeight - 126
- } : {
- maxWidth: a.windowWidth - 52,
- maxHeight: a.windowHeight - 86
- }
- }, this.calculateModalDimensions = function(a) {
- var b = Math.max(400, a.imageDisplayWidth + 32),
- c = Math.max(200, a.imageDisplayHeight + 66);
- return (b >= a.windowWidth - 20 || a.windowWidth < 768) && (b = "auto"), c >= a.windowHeight && (c = "auto"), {
- width: b,
- height: c
- }
- }, this.isVideo = function(a) {
- return "object" == typeof a && a && a.type ? "video" === a.type : !1
- }, this.isSharedVideo = function(a) {
- return this.isVideo(a) && !this.getImageUrl(a).match(/\.(mp4|ogg|webm)$/)
- }, this.$get = ["$document", "$injector", "$uibModal", "$timeout", "ImageLoader", function(a, b, c, d, e) {
- var f = b.has("cfpLoadingBar") ? b.get("cfpLoadingBar") : null,
- g = {};
- return g.images = [], g.index = -1, g.templateUrl = this.templateUrl, g.fullScreenMode = this.fullScreenMode, g.getImageUrl = this.getImageUrl, g.getImageCaption = this.getImageCaption, g.calculateImageDimensionLimits = this.calculateImageDimensionLimits, g.calculateModalDimensions = this.calculateModalDimensions, g.isVideo = this.isVideo, g.isSharedVideo = this.isSharedVideo, g.keyboardNavEnabled = !1, g.image = {}, g.modalInstance = null, g.loading = !1, g.openModal = function(a, b, d) {
- return g.images = a, g.setImage(b), g.modalInstance = c.open(angular.extend({
- templateUrl: g.templateUrl,
- controller: ["$scope", function(a) {
- a.Lightbox = g, g.keyboardNavEnabled = !0
- }],
- windowClass: "lightbox-modal"
- }, d || {})), g.modalInstance.result["finally"](function() {
- g.images = [], g.index = 1, g.image = {}, g.imageUrl = null, g.imageCaption = null, g.keyboardNavEnabled = !1, f && f.complete()
- }), g.modalInstance
- }, g.closeModal = function(a) {
- return g.modalInstance.close(a)
- }, g.setImage = function(a) {
- if (!(a in g.images)) throw "Invalid image.";
- g.loading = !0, f && f.start();
- var b = g.images[a],
- c = g.getImageUrl(b),
- d = function(d) {
- d = d || {}, g.index = d.index || a, g.image = d.image || b, g.imageUrl = d.imageUrl || c, g.imageCaption = d.imageCaption || g.getImageCaption(b), g.loading = !1, f && f.complete()
- };
- g.isVideo(b) ? d() : e.load(c).then(function() {
- d()
- }, function() {
- d({
- imageUrl: "//:0",
- imageCaption: "Failed to load image"
- })
- })
- }, g.firstImage = function() {
- g.setImage(0)
- }, g.prevImage = function() {
- g.setImage((g.index - 1 + g.images.length) % g.images.length)
- }, g.nextImage = function() {
- g.setImage((g.index + 1) % g.images.length)
- }, g.lastImage = function() {
- g.setImage(g.images.length - 1)
- }, g.setImages = function(a) {
- g.images = a, g.setImage(g.index)
- }, a.bind("keydown", function(a) {
- if (g.keyboardNavEnabled) {
- var b = null;
- switch (a.which) {
- case 39:
- b = "nextImage";
- break;
- case 37:
- b = "prevImage"
- }
- null !== b && -1 === ["input", "textarea"].indexOf(a.target.tagName.toLowerCase()) && (d(function() {
- g[b]()
- }), a.preventDefault())
- }
- }), g
- }]
- }), angular.module("bootstrapLightbox").directive("lightboxSrc", ["$window", "ImageLoader", "Lightbox", function(a, b, c) {
- var d = function(a, b) {
- var c = a.width,
- d = a.height,
- e = a.minWidth,
- f = a.minHeight,
- g = a.maxWidth,
- h = a.maxHeight,
- i = c,
- j = d;
- if (b) {
- var k = Math.min(g / c, h / d),
- l = Math.round(c * k),
- m = Math.round(d * k);
- i = Math.max(e, l), j = Math.max(f, m)
- } else e > c && f > d ? c / d > g / h ? (j = f, i = Math.round(c * f / d)) : (i = e, j = Math.round(d * e / c)) : e > c ? (i = e, j = Math.round(d * e / c)) : f > d && (j = f, i = Math.round(c * f / d)), c > g && d > h ? c / d > g / h ? (i = g, j = Math.round(d * g / c)) : (j = h, i = Math.round(c * h / d)) : c > g ? (i = g, j = Math.round(d * g / c)) : d > h && (j = h, i = Math.round(c * h / d));
- return {
- width: i || 0,
- height: j || 0
- }
- },
- e = function(a) {
- return "number" == typeof a ? a + "px" : a
- },
- f = 0,
- g = 0;
- return {
- link: function(h, i, j) {
- var k = function() {
- var b = a.innerWidth,
- h = a.innerHeight,
- j = c.calculateImageDimensionLimits({
- windowWidth: b,
- windowHeight: h,
- imageWidth: f,
- imageHeight: g
- }),
- k = d(angular.extend({
- width: f,
- height: g,
- minWidth: 1,
- minHeight: 1,
- maxWidth: 3e3,
- maxHeight: 3e3
- }, j), c.fullScreenMode),
- l = c.calculateModalDimensions({
- windowWidth: b,
- windowHeight: h,
- imageDisplayWidth: k.width,
- imageDisplayHeight: k.height
- });
- i.css({
- width: k.width + "px",
- height: k.height + "px"
- }), angular.element(document.querySelector(".lightbox-modal .modal-dialog")).css({
- width: e(l.width)
- }), angular.element(document.querySelector(".lightbox-modal .modal-content")).css({
- height: e(l.height)
- })
- };
- h.$watch(function() {
- return j.lightboxSrc
- }, function(a) {
- c.isVideo(c.image) ? (f = 1280, g = 720, k(), i[0].src = a) : (i[0].src = "//:0", b.load(a).then(function(b) {
- f = b.naturalWidth, g = b.naturalHeight, k(), i[0].src = a
- }, function() {
- f = 0, g = 0, k()
- }))
- }), angular.element(a).on("resize", k)
- }
- }
- }]),
- function() {
- "use strict";
- function a(a, b) {
- return a.module("angularMoment", []).constant("angularMomentConfig", {
- preprocess: null,
- timezone: "",
- format: null,
- statefulFilters: !0
- }).constant("moment", b).constant("amTimeAgoConfig", {
- withoutSuffix: !1,
- serverTime: null,
- titleFormat: null,
- fullDateThreshold: null,
- fullDateFormat: null
- }).directive("amTimeAgo", ["$window", "moment", "amMoment", "amTimeAgoConfig", "angularMomentConfig", function(b, c, d, e, f) {
- return function(g, h, i) {
- function j() {
- var a;
- if (p) a = p;
- else if (e.serverTime) {
- var b = (new Date).getTime(),
- d = b - w + e.serverTime;
- a = c(d)
- } else a = c();
- return a
- }
- function k() {
- q && (b.clearTimeout(q), q = null)
- }
- function l(a) {
- var c = j().diff(a, "day"),
- d = u && c >= u;
- if (d ? h.text(a.format(v)) : h.text(a.from(j(), s)), t && !h.attr("title") && h.attr("title", a.local().format(t)), !d) {
- var e = Math.abs(j().diff(a, "minute")),
- f = 3600;
- 1 > e ? f = 1 : 60 > e ? f = 30 : 180 > e && (f = 300), q = b.setTimeout(function() {
- l(a)
- }, 1e3 * f)
- }
- }
- function m(a) {
- z && h.attr("datetime", a)
- }
- function n() {
- if (k(), o) {
- var a = d.preprocessDate(o, x, r);
- l(a), m(a.toISOString())
- }
- }
- var o, p, q = null,
- r = f.format,
- s = e.withoutSuffix,
- t = e.titleFormat,
- u = e.fullDateThreshold,
- v = e.fullDateFormat,
- w = (new Date).getTime(),
- x = f.preprocess,
- y = i.amTimeAgo,
- z = "TIME" === h[0].nodeName.toUpperCase();
- g.$watch(y, function(a) {
- return "undefined" == typeof a || null === a || "" === a ? (k(), void(o && (h.text(""), m(""), o = null))) : (o = a, void n())
- }), a.isDefined(i.amFrom) && g.$watch(i.amFrom, function(a) {
- p = "undefined" == typeof a || null === a || "" === a ? null : c(a), n()
- }), a.isDefined(i.amWithoutSuffix) && g.$watch(i.amWithoutSuffix, function(a) {
- "boolean" == typeof a ? (s = a, n()) : s = e.withoutSuffix
- }), i.$observe("amFormat", function(a) {
- "undefined" != typeof a && (r = a, n())
- }), i.$observe("amPreprocess", function(a) {
- x = a, n()
- }), i.$observe("amFullDateThreshold", function(a) {
- u = a, n()
- }), i.$observe("amFullDateFormat", function(a) {
- v = a, n()
- }), g.$on("$destroy", function() {
- k()
- }), g.$on("amMoment:localeChanged", function() {
- n()
- })
- }
- }]).service("amMoment", ["moment", "$rootScope", "$log", "angularMomentConfig", function(b, c, d, e) {
- this.preprocessors = {
- utc: b.utc,
- unix: b.unix
- }, this.changeLocale = function(d, e) {
- var f = b.locale(d, e);
- return a.isDefined(d) && c.$broadcast("amMoment:localeChanged"), f
- }, this.changeTimezone = function(a) {
- e.timezone = a, c.$broadcast("amMoment:timezoneChanged")
- }, this.preprocessDate = function(c, f, g) {
- return a.isUndefined(f) && (f = e.preprocess), this.preprocessors[f] ? this.preprocessors[f](c, g) : (f && d.warn("angular-moment: Ignoring unsupported value for preprocess: " + f), !isNaN(parseFloat(c)) && isFinite(c) ? b(parseInt(c, 10)) : b(c, g))
- }, this.applyTimezone = function(a, b) {
- return (b = b || e.timezone) ? (b.match(/^Z|[+-]\d\d:?\d\d$/i) ? a = a.utcOffset(b) : a.tz ? a = a.tz(b) : d.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?"), a) : a
- }
- }]).filter("amCalendar", ["moment", "amMoment", "angularMomentConfig", function(a, b, c) {
- function d(c, d, e) {
- if ("undefined" == typeof c || null === c) return "";
- c = b.preprocessDate(c, d);
- var f = a(c);
- return f.isValid() ? b.applyTimezone(f, e).calendar() : ""
- }
- return d.$stateful = c.statefulFilters, d
- }]).filter("amDifference", ["moment", "amMoment", "angularMomentConfig", function(a, b, c) {
- function d(c, d, e, f, g, h) {
- if ("undefined" == typeof c || null === c) return "";
- c = b.preprocessDate(c, g);
- var i = a(c);
- if (!i.isValid()) return "";
- var j;
- if ("undefined" == typeof d || null === d) j = a();
- else if (d = b.preprocessDate(d, h), j = a(d), !j.isValid()) return "";
- return b.applyTimezone(i).diff(b.applyTimezone(j), e, f)
- }
- return d.$stateful = c.statefulFilters, d
- }]).filter("amDateFormat", ["moment", "amMoment", "angularMomentConfig", function(a, b, c) {
- function d(d, e, f, g, h) {
- var i = h || c.format;
- if ("undefined" == typeof d || null === d) return "";
- d = b.preprocessDate(d, f, i);
- var j = a(d);
- return j.isValid() ? b.applyTimezone(j, g).format(e) : ""
- }
- return d.$stateful = c.statefulFilters, d
- }]).filter("amDurationFormat", ["moment", "angularMomentConfig", function(a, b) {
- function c(b, c, d) {
- return "undefined" == typeof b || null === b ? "" : a.duration(b, c).humanize(d)
- }
- return c.$stateful = b.statefulFilters, c
- }]).filter("amTimeAgo", ["moment", "amMoment", "angularMomentConfig", function(a, b, c) {
- function d(c, d, e, f) {
- var g, h;
- return "undefined" == typeof c || null === c ? "" : (c = b.preprocessDate(c, d), g = a(c), g.isValid() ? (h = a(f), "undefined" != typeof f && h.isValid() ? b.applyTimezone(g).from(h, e) : b.applyTimezone(g).fromNow(e)) : "")
- }
- return d.$stateful = c.statefulFilters, d
- }]).filter("amSubtract", ["moment", "angularMomentConfig", function(a, b) {
- function c(b, c, d) {
- return "undefined" == typeof b || null === b ? "" : a(b).subtract(parseInt(c, 10), d)
- }
- return c.$stateful = b.statefulFilters, c
- }]).filter("amAdd", ["moment", "angularMomentConfig", function(a, b) {
- function c(b, c, d) {
- return "undefined" == typeof b || null === b ? "" : a(b).add(parseInt(c, 10), d)
- }
- return c.$stateful = b.statefulFilters, c
- }])
- }
- "function" == typeof define && define.amd ? define(["angular", "moment"], a) : "undefined" != typeof module && module && module.exports ? (a(angular, require("moment")), module.exports = "angularMoment") : a(angular, ("undefined" != typeof global ? global : window).moment)
- }(), "undefined" != typeof module && "undefined" != typeof exports && module.exports === exports && (module.exports = "ui.router"),
- function(a, b, c) {
- "use strict";
- function d(a, b) {
- return R(new(R(function() {}, {
- prototype: a
- })), b)
- }
- function e(a) {
- return Q(arguments, function(b) {
- b !== a && Q(b, function(b, c) {
- a.hasOwnProperty(c) || (a[c] = b)
- })
- }), a
- }
- function f(a, b) {
- var c = [];
- for (var d in a.path) {
- if (a.path[d] !== b.path[d]) break;
- c.push(a.path[d])
- }
- return c
- }
- function g(a) {
- if (Object.keys) return Object.keys(a);
- var b = [];
- return Q(a, function(a, c) {
- b.push(c)
- }), b
- }
- function h(a, b) {
- if (Array.prototype.indexOf) return a.indexOf(b, Number(arguments[2]) || 0);
- var c = a.length >>> 0,
- d = Number(arguments[2]) || 0;
- for (d = 0 > d ? Math.ceil(d) : Math.floor(d), 0 > d && (d += c); c > d; d++)
- if (d in a && a[d] === b) return d;
- return -1
- }
- function i(a, b, c, d) {
- var e, i = f(c, d),
- j = {},
- k = [];
- for (var l in i)
- if (i[l] && i[l].params && (e = g(i[l].params), e.length))
- for (var m in e) h(k, e[m]) >= 0 || (k.push(e[m]), j[e[m]] = a[e[m]]);
- return R({}, j, b)
- }
- function j(a, b, c) {
- if (!c) {
- c = [];
- for (var d in a) c.push(d)
- }
- for (var e = 0; e < c.length; e++) {
- var f = c[e];
- if (a[f] != b[f]) return !1
- }
- return !0
- }
- function k(a, b) {
- var c = {};
- return Q(a, function(a) {
- c[a] = b[a]
- }), c
- }
- function l(a) {
- var b = {},
- c = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
- return Q(c, function(c) {
- c in a && (b[c] = a[c])
- }), b
- }
- function m(a) {
- var b = {},
- c = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
- for (var d in a) - 1 == h(c, d) && (b[d] = a[d]);
- return b
- }
- function n(a, b) {
- var c = P(a),
- d = c ? [] : {};
- return Q(a, function(a, e) {
- b(a, e) && (d[c ? d.length : e] = a)
- }), d
- }
- function o(a, b) {
- var c = P(a) ? [] : {};
- return Q(a, function(a, d) {
- c[d] = b(a, d)
- }), c
- }
- function p(a, b) {
- var d = 1,
- f = 2,
- i = {},
- j = [],
- k = i,
- l = R(a.when(i), {
- $$promises: i,
- $$values: i
- });
- this.study = function(i) {
- function n(a, c) {
- if (s[c] !== f) {
- if (r.push(c), s[c] === d) throw r.splice(0, h(r, c)), new Error("Cyclic dependency: " + r.join(" -> "));
- if (s[c] = d, N(a)) q.push(c, [function() {
- return b.get(a)
- }], j);
- else {
- var e = b.annotate(a);
- Q(e, function(a) {
- a !== c && i.hasOwnProperty(a) && n(i[a], a)
- }), q.push(c, a, e)
- }
- r.pop(), s[c] = f
- }
- }
- function o(a) {
- return O(a) && a.then && a.$$promises
- }
- if (!O(i)) throw new Error("'invocables' must be an object");
- var p = g(i || {}),
- q = [],
- r = [],
- s = {};
- return Q(i, n), i = r = s = null,
- function(d, f, g) {
- function h() {
- --u || (v || e(t, f.$$values), r.$$values = t, r.$$promises = r.$$promises || !0, delete r.$$inheritedValues, n.resolve(t))
- }
- function i(a) {
- r.$$failure = a, n.reject(a)
- }
- function j(c, e, f) {
- function j(a) {
- l.reject(a), i(a)
- }
- function k() {
- if (!L(r.$$failure)) try {
- l.resolve(b.invoke(e, g, t)), l.promise.then(function(a) {
- t[c] = a, h()
- }, j)
- } catch (a) {
- j(a)
- }
- }
- var l = a.defer(),
- m = 0;
- Q(f, function(a) {
- s.hasOwnProperty(a) && !d.hasOwnProperty(a) && (m++, s[a].then(function(b) {
- t[a] = b, --m || k()
- }, j))
- }), m || k(), s[c] = l.promise
- }
- if (o(d) && g === c && (g = f, f = d, d = null), d) {
- if (!O(d)) throw new Error("'locals' must be an object")
- } else d = k;
- if (f) {
- if (!o(f)) throw new Error("'parent' must be a promise returned by $resolve.resolve()")
- } else f = l;
- var n = a.defer(),
- r = n.promise,
- s = r.$$promises = {},
- t = R({}, d),
- u = 1 + q.length / 3,
- v = !1;
- if (L(f.$$failure)) return i(f.$$failure), r;
- f.$$inheritedValues && e(t, m(f.$$inheritedValues, p)), R(s, f.$$promises), f.$$values ? (v = e(t, m(f.$$values, p)), r.$$inheritedValues = m(f.$$values, p), h()) : (f.$$inheritedValues && (r.$$inheritedValues = m(f.$$inheritedValues, p)), f.then(h, i));
- for (var w = 0, x = q.length; x > w; w += 3) d.hasOwnProperty(q[w]) ? h() : j(q[w], q[w + 1], q[w + 2]);
- return r
- }
- }, this.resolve = function(a, b, c, d) {
- return this.study(a)(b, c, d)
- }
- }
- function q(a, b, c) {
- this.fromConfig = function(a, b, c) {
- return L(a.template) ? this.fromString(a.template, b) : L(a.templateUrl) ? this.fromUrl(a.templateUrl, b) : L(a.templateProvider) ? this.fromProvider(a.templateProvider, b, c) : null
- }, this.fromString = function(a, b) {
- return M(a) ? a(b) : a
- }, this.fromUrl = function(c, d) {
- return M(c) && (c = c(d)), null == c ? null : a.get(c, {
- cache: b,
- headers: {
- Accept: "text/html"
- }
- }).then(function(a) {
- return a.data
- })
- }, this.fromProvider = function(a, b, d) {
- return c.invoke(a, null, d || {
- params: b
- })
- }
- }
- function r(a, b, e) {
- function f(b, c, d, e) {
- if (q.push(b), o[b]) return o[b];
- if (!/^\w+([-.]+\w+)*(?:\[\])?$/.test(b)) throw new Error("Invalid parameter name '" + b + "' in pattern '" + a + "'");
- if (p[b]) throw new Error("Duplicate parameter name '" + b + "' in pattern '" + a + "'");
- return p[b] = new U.Param(b, c, d, e), p[b]
- }
- function g(a, b, c, d) {
- var e = ["", ""],
- f = a.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&");
- if (!b) return f;
- switch (c) {
- case !1:
- e = ["(", ")" + (d ? "?" : "")];
- break;
- case !0:
- f = f.replace(/\/$/, ""), e = ["(?:/(", ")|/)?"];
- break;
- default:
- e = ["(" + c + "|", ")?"]
- }
- return f + e[0] + b + e[1]
- }
- function h(e, f) {
- var g, h, i, j, k;
- return g = e[2] || e[3], k = b.params[g], i = a.substring(m, e.index), h = f ? e[4] : e[4] || ("*" == e[1] ? ".*" : null), h && (j = U.type(h) || d(U.type("string"), {
- pattern: new RegExp(h, b.caseInsensitive ? "i" : c)
- })), {
- id: g,
- regexp: h,
- segment: i,
- type: j,
- cfg: k
- }
- }
- b = R({
- params: {}
- }, O(b) ? b : {});
- var i, j = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
- k = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
- l = "^",
- m = 0,
- n = this.segments = [],
- o = e ? e.params : {},
- p = this.params = e ? e.params.$$new() : new U.ParamSet,
- q = [];
- this.source = a;
- for (var r, s, t;
- (i = j.exec(a)) && (r = h(i, !1), !(r.segment.indexOf("?") >= 0));) s = f(r.id, r.type, r.cfg, "path"), l += g(r.segment, s.type.pattern.source, s.squash, s.isOptional), n.push(r.segment), m = j.lastIndex;
- t = a.substring(m);
- var u = t.indexOf("?");
- if (u >= 0) {
- var v = this.sourceSearch = t.substring(u);
- if (t = t.substring(0, u), this.sourcePath = a.substring(0, m + u), v.length > 0)
- for (m = 0; i = k.exec(v);) r = h(i, !0), s = f(r.id, r.type, r.cfg, "search"), m = j.lastIndex
- } else this.sourcePath = a, this.sourceSearch = "";
- l += g(t) + (b.strict === !1 ? "/?" : "") + "$", n.push(t), this.regexp = new RegExp(l, b.caseInsensitive ? "i" : c), this.prefix = n[0], this.$$paramNames = q
- }
- function s(a) {
- R(this, a)
- }
- function t() {
- function a(a) {
- return null != a ? a.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : a
- }
- function e(a) {
- return null != a ? a.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : a
- }
- function f() {
- return {
- strict: p,
- caseInsensitive: m
- }
- }
- function i(a) {
- return M(a) || P(a) && M(a[a.length - 1])
- }
- function j() {
- for (; w.length;) {
- var a = w.shift();
- if (a.pattern) throw new Error("You cannot override a type's .pattern at runtime.");
- b.extend(u[a.name], l.invoke(a.def))
- }
- }
- function k(a) {
- R(this, a || {})
- }
- U = this;
- var l, m = !1,
- p = !0,
- q = !1,
- u = {},
- v = !0,
- w = [],
- x = {
- string: {
- encode: a,
- decode: e,
- is: function(a) {
- return null == a || !L(a) || "string" == typeof a
- },
- pattern: /[^\/]*/
- },
- "int": {
- encode: a,
- decode: function(a) {
- return parseInt(a, 10)
- },
- is: function(a) {
- return L(a) && this.decode(a.toString()) === a
- },
- pattern: /\d+/
- },
- bool: {
- encode: function(a) {
- return a ? 1 : 0
- },
- decode: function(a) {
- return 0 !== parseInt(a, 10)
- },
- is: function(a) {
- return a === !0 || a === !1
- },
- pattern: /0|1/
- },
- date: {
- encode: function(a) {
- return this.is(a) ? [a.getFullYear(), ("0" + (a.getMonth() + 1)).slice(-2), ("0" + a.getDate()).slice(-2)].join("-") : c
- },
- decode: function(a) {
- if (this.is(a)) return a;
- var b = this.capture.exec(a);
- return b ? new Date(b[1], b[2] - 1, b[3]) : c
- },
- is: function(a) {
- return a instanceof Date && !isNaN(a.valueOf())
- },
- equals: function(a, b) {
- return this.is(a) && this.is(b) && a.toISOString() === b.toISOString()
- },
- pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
- capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/
- },
- json: {
- encode: b.toJson,
- decode: b.fromJson,
- is: b.isObject,
- equals: b.equals,
- pattern: /[^\/]*/
- },
- any: {
- encode: b.identity,
- decode: b.identity,
- equals: b.equals,
- pattern: /.*/
- }
- };
- t.$$getDefaultValue = function(a) {
- if (!i(a.value)) return a.value;
- if (!l) throw new Error("Injectable functions cannot be called at configuration time");
- return l.invoke(a.value)
- }, this.caseInsensitive = function(a) {
- return L(a) && (m = a), m
- }, this.strictMode = function(a) {
- return L(a) && (p = a), p
- }, this.defaultSquashPolicy = function(a) {
- if (!L(a)) return q;
- if (a !== !0 && a !== !1 && !N(a)) throw new Error("Invalid squash policy: " + a + ". Valid policies: false, true, arbitrary-string");
- return q = a, a
- }, this.compile = function(a, b) {
- return new r(a, R(f(), b))
- }, this.isMatcher = function(a) {
- if (!O(a)) return !1;
- var b = !0;
- return Q(r.prototype, function(c, d) {
- M(c) && (b = b && L(a[d]) && M(a[d]))
- }), b
- }, this.type = function(a, b, c) {
- if (!L(b)) return u[a];
- if (u.hasOwnProperty(a)) throw new Error("A type named '" + a + "' has already been defined.");
- return u[a] = new s(R({
- name: a
- }, b)), c && (w.push({
- name: a,
- def: c
- }), v || j()), this
- }, Q(x, function(a, b) {
- u[b] = new s(R({
- name: b
- }, a))
- }), u = d(u, {}), this.$get = ["$injector", function(a) {
- return l = a, v = !1, j(), Q(x, function(a, b) {
- u[b] || (u[b] = new s(a))
- }), this
- }], this.Param = function(a, d, e, f) {
- function j(a) {
- var b = O(a) ? g(a) : [],
- c = -1 === h(b, "value") && -1 === h(b, "type") && -1 === h(b, "squash") && -1 === h(b, "array");
- return c && (a = {
- value: a
- }), a.$$fn = i(a.value) ? a.value : function() {
- return a.value
- }, a
- }
- function k(c, d, e) {
- if (c.type && d) throw new Error("Param '" + a + "' has two type configurations.");
- return d ? d : c.type ? b.isString(c.type) ? u[c.type] : c.type instanceof s ? c.type : new s(c.type) : "config" === e ? u.any : u.string
- }
- function m() {
- var b = {
- array: "search" === f ? "auto" : !1
- },
- c = a.match(/\[\]$/) ? {
- array: !0
- } : {};
- return R(b, c, e).array
- }
- function p(a, b) {
- var c = a.squash;
- if (!b || c === !1) return !1;
- if (!L(c) || null == c) return q;
- if (c === !0 || N(c)) return c;
- throw new Error("Invalid squash policy: '" + c + "'. Valid policies: false, true, or arbitrary string")
- }
- function r(a, b, d, e) {
- var f, g, i = [{
- from: "",
- to: d || b ? c : ""
- }, {
- from: null,
- to: d || b ? c : ""
- }];
- return f = P(a.replace) ? a.replace : [], N(e) && f.push({
- from: e,
- to: c
- }), g = o(f, function(a) {
- return a.from
- }), n(i, function(a) {
- return -1 === h(g, a.from)
- }).concat(f)
- }
- function t() {
- if (!l) throw new Error("Injectable functions cannot be called at configuration time");
- var a = l.invoke(e.$$fn);
- if (null !== a && a !== c && !x.type.is(a)) throw new Error("Default value (" + a + ") for parameter '" + x.id + "' is not an instance of Type (" + x.type.name + ")");
- return a
- }
- function v(a) {
- function b(a) {
- return function(b) {
- return b.from === a
- }
- }
- function c(a) {
- var c = o(n(x.replace, b(a)), function(a) {
- return a.to
- });
- return c.length ? c[0] : a
- }
- return a = c(a), L(a) ? x.type.$normalize(a) : t()
- }
- function w() {
- return "{Param:" + a + " " + d + " squash: '" + A + "' optional: " + z + "}"
- }
- var x = this;
- e = j(e), d = k(e, d, f);
- var y = m();
- d = y ? d.$asArray(y, "search" === f) : d, "string" !== d.name || y || "path" !== f || e.value !== c || (e.value = "");
- var z = e.value !== c,
- A = p(e, z),
- B = r(e, y, z, A);
- R(this, {
- id: a,
- type: d,
- location: f,
- array: y,
- squash: A,
- replace: B,
- isOptional: z,
- value: v,
- dynamic: c,
- config: e,
- toString: w
- })
- }, k.prototype = {
- $$new: function() {
- return d(this, R(new k, {
- $$parent: this
- }))
- },
- $$keys: function() {
- for (var a = [], b = [], c = this, d = g(k.prototype); c;) b.push(c), c = c.$$parent;
- return b.reverse(), Q(b, function(b) {
- Q(g(b), function(b) {
- -1 === h(a, b) && -1 === h(d, b) && a.push(b)
- })
- }), a
- },
- $$values: function(a) {
- var b = {},
- c = this;
- return Q(c.$$keys(), function(d) {
- b[d] = c[d].value(a && a[d])
- }), b
- },
- $$equals: function(a, b) {
- var c = !0,
- d = this;
- return Q(d.$$keys(), function(e) {
- var f = a && a[e],
- g = b && b[e];
- d[e].type.equals(f, g) || (c = !1)
- }), c
- },
- $$validates: function(a) {
- var d, e, f, g, h, i = this.$$keys();
- for (d = 0; d < i.length && (e = this[i[d]], f = a[i[d]], f !== c && null !== f || !e.isOptional); d++) {
- if (g = e.type.$normalize(f), !e.type.is(g)) return !1;
- if (h = e.type.encode(g), b.isString(h) && !e.type.pattern.exec(h)) return !1
- }
- return !0
- },
- $$parent: c
- }, this.ParamSet = k
- }
- function u(a, d) {
- function e(a) {
- var b = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);
- return null != b ? b[1].replace(/\\(.)/g, "$1") : ""
- }
- function f(a, b) {
- return a.replace(/\$(\$|\d{1,2})/, function(a, c) {
- return b["$" === c ? 0 : Number(c)]
- })
- }
- function g(a, b, c) {
- if (!c) return !1;
- var d = a.invoke(b, b, {
- $match: c
- });
- return L(d) ? d : !0
- }
- function h(d, e, f, g, h) {
- function m(a, b, c) {
- return "/" === q ? a : b ? q.slice(0, -1) + a : c ? q.slice(1) + a : a
- }
- function n(a) {
- function b(a) {
- var b = a(f, d);
- return b ? (N(b) && d.replace().url(b), !0) : !1
- }
- if (!a || !a.defaultPrevented) {
- p && d.url() === p;
- p = c;
- var e, g = j.length;
- for (e = 0; g > e; e++)
- if (b(j[e])) return;
- k && b(k)
- }
- }
- function o() {
- return i = i || e.$on("$locationChangeSuccess", n)
- }
- var p, q = g.baseHref(),
- r = d.url();
- return l || o(), {
- sync: function() {
- n()
- },
- listen: function() {
- return o()
- },
- update: function(a) {
- return a ? void(r = d.url()) : void(d.url() !== r && (d.url(r), d.replace()))
- },
- push: function(a, b, e) {
- var f = a.format(b || {});
- null !== f && b && b["#"] && (f += "#" + b["#"]), d.url(f), p = e && e.$$avoidResync ? d.url() : c, e && e.replace && d.replace()
- },
- href: function(c, e, f) {
- if (!c.validates(e)) return null;
- var g = a.html5Mode();
- b.isObject(g) && (g = g.enabled), g = g && h.history;
- var i = c.format(e);
- if (f = f || {}, g || null === i || (i = "#" + a.hashPrefix() + i), null !== i && e && e["#"] && (i += "#" + e["#"]), i = m(i, g, f.absolute), !f.absolute || !i) return i;
- var j = !g && i ? "/" : "",
- k = d.port();
- return k = 80 === k || 443 === k ? "" : ":" + k, [d.protocol(), "://", d.host(), k, j, i].join("")
- }
- }
- }
- var i, j = [],
- k = null,
- l = !1;
- this.rule = function(a) {
- if (!M(a)) throw new Error("'rule' must be a function");
- return j.push(a), this
- }, this.otherwise = function(a) {
- if (N(a)) {
- var b = a;
- a = function() {
- return b
- }
- } else if (!M(a)) throw new Error("'rule' must be a function");
- return k = a, this
- }, this.when = function(a, b) {
- var c, h = N(b);
- if (N(a) && (a = d.compile(a)), !h && !M(b) && !P(b)) throw new Error("invalid 'handler' in when()");
- var i = {
- matcher: function(a, b) {
- return h && (c = d.compile(b), b = ["$match", function(a) {
- return c.format(a)
- }]), R(function(c, d) {
- return g(c, b, a.exec(d.path(), d.search()))
- }, {
- prefix: N(a.prefix) ? a.prefix : ""
- })
- },
- regex: function(a, b) {
- if (a.global || a.sticky) throw new Error("when() RegExp must not be global or sticky");
- return h && (c = b, b = ["$match", function(a) {
- return f(c, a)
- }]), R(function(c, d) {
- return g(c, b, a.exec(d.path()))
- }, {
- prefix: e(a)
- })
- }
- },
- j = {
- matcher: d.isMatcher(a),
- regex: a instanceof RegExp
- };
- for (var k in j)
- if (j[k]) return this.rule(i[k](a, b));
- throw new Error("invalid 'what' in when()")
- }, this.deferIntercept = function(a) {
- a === c && (a = !0), l = a
- }, this.$get = h, h.$inject = ["$location", "$rootScope", "$injector", "$browser", "$sniffer"]
- }
- function v(a, e) {
- function f(a) {
- return 0 === a.indexOf(".") || 0 === a.indexOf("^")
- }
- function m(a, b) {
- if (!a) return c;
- var d = N(a),
- e = d ? a : a.name,
- g = f(e);
- if (g) {
- if (!b) throw new Error("No reference point given for path '" + e + "'");
- b = m(b);
- for (var h = e.split("."), i = 0, j = h.length, k = b; j > i; i++)
- if ("" !== h[i] || 0 !== i) {
- if ("^" !== h[i]) break;
- if (!k.parent) throw new Error("Path '" + e + "' not valid for state '" + b.name + "'");
- k = k.parent
- } else k = b;
- h = h.slice(i).join("."), e = k.name + (k.name && h ? "." : "") + h
- }
- var l = z[e];
- return !l || !d && (d || l !== a && l.self !== a) ? c : l
- }
- function n(a, b) {
- A[a] || (A[a] = []), A[a].push(b)
- }
- function p(a) {
- for (var b = A[a] || []; b.length;) q(b.shift())
- }
- function q(b) {
- b = d(b, {
- self: b,
- resolve: b.resolve || {},
- toString: function() {
- return this.name
- }
- });
- var c = b.name;
- if (!N(c) || c.indexOf("@") >= 0) throw new Error("State must have a valid name");
- if (z.hasOwnProperty(c)) throw new Error("State '" + c + "' is already defined");
- var e = -1 !== c.indexOf(".") ? c.substring(0, c.lastIndexOf(".")) : N(b.parent) ? b.parent : O(b.parent) && N(b.parent.name) ? b.parent.name : "";
- if (e && !z[e]) return n(e, b.self);
- for (var f in C) M(C[f]) && (b[f] = C[f](b, C.$delegates[f]));
- return z[c] = b, !b[B] && b.url && a.when(b.url, ["$match", "$stateParams", function(a, c) {
- y.$current.navigable == b && j(a, c) || y.transitionTo(b, a, {
- inherit: !0,
- location: !1
- })
- }]), p(c), b
- }
- function r(a) {
- return a.indexOf("*") > -1
- }
- function s(a) {
- for (var b = a.split("."), c = y.$current.name.split("."), d = 0, e = b.length; e > d; d++) "*" === b[d] && (c[d] = "*");
- return "**" === b[0] && (c = c.slice(h(c, b[1])), c.unshift("**")), "**" === b[b.length - 1] && (c.splice(h(c, b[b.length - 2]) + 1, Number.MAX_VALUE), c.push("**")), b.length != c.length ? !1 : c.join("") === b.join("")
- }
- function t(a, b) {
- return N(a) && !L(b) ? C[a] : M(b) && N(a) ? (C[a] && !C.$delegates[a] && (C.$delegates[a] = C[a]), C[a] = b, this) : this
- }
- function u(a, b) {
- return O(a) ? b = a : b.name = a, q(b), this
- }
- function v(a, e, f, h, l, n, p, q, t) {
- function u(b, c, d, f) {
- var g = a.$broadcast("$stateNotFound", b, c, d);
- if (g.defaultPrevented) return p.update(), D;
- if (!g.retry) return null;
- if (f.$retry) return p.update(), E;
- var h = y.transition = e.when(g.retry);
- return h.then(function() {
- return h !== y.transition ? A : (b.options.$retry = !0, y.transitionTo(b.to, b.toParams, b.options))
- }, function() {
- return D
- }), p.update(), h
- }
- function v(a, c, d, g, i, j) {
- function m() {
- var c = [];
- return Q(a.views, function(d, e) {
- var g = d.resolve && d.resolve !== a.resolve ? d.resolve : {};
- g.$template = [function() {
- return f.load(e, {
- view: d,
- locals: i.globals,
- params: n,
- notify: j.notify
- }) || ""
- }], c.push(l.resolve(g, i.globals, i.resolve, a).then(function(c) {
- if (M(d.controllerProvider) || P(d.controllerProvider)) {
- var f = b.extend({}, g, i.globals);
- c.$$controller = h.invoke(d.controllerProvider, null, f)
- } else c.$$controller = d.controller;
- c.$$state = a, c.$$controllerAs = d.controllerAs, i[e] = c
- }))
- }), e.all(c).then(function() {
- return i.globals
- })
- }
- var n = d ? c : k(a.params.$$keys(), c),
- o = {
- $stateParams: n
- };
- i.resolve = l.resolve(a.resolve, o, i.resolve, a);
- var p = [i.resolve.then(function(a) {
- i.globals = a
- })];
- return g && p.push(g), e.all(p).then(m).then(function(a) {
- return i
- })
- }
- var A = e.reject(new Error("transition superseded")),
- C = e.reject(new Error("transition prevented")),
- D = e.reject(new Error("transition aborted")),
- E = e.reject(new Error("transition failed"));
- return x.locals = {
- resolve: null,
- globals: {
- $stateParams: {}
- }
- }, y = {
- params: {},
- current: x.self,
- $current: x,
- transition: null
- }, y.reload = function(a) {
- return y.transitionTo(y.current, n, {
- reload: a || !0,
- inherit: !1,
- notify: !0
- })
- }, y.go = function(a, b, c) {
- return y.transitionTo(a, b, R({
- inherit: !0,
- relative: y.$current
- }, c))
- }, y.transitionTo = function(b, c, f) {
- c = c || {}, f = R({
- location: !0,
- inherit: !1,
- relative: null,
- notify: !0,
- reload: !1,
- $retry: !1
- }, f || {});
- var g, j = y.$current,
- l = y.params,
- o = j.path,
- q = m(b, f.relative),
- r = c["#"];
- if (!L(q)) {
- var s = {
- to: b,
- toParams: c,
- options: f
- },
- t = u(s, j.self, l, f);
- if (t) return t;
- if (b = s.to, c = s.toParams, f = s.options, q = m(b, f.relative), !L(q)) {
- if (!f.relative) throw new Error("No such state '" + b + "'");
- throw new Error("Could not resolve '" + b + "' from state '" + f.relative + "'")
- }
- }
- if (q[B]) throw new Error("Cannot transition to abstract state '" + b + "'");
- if (f.inherit && (c = i(n, c || {}, y.$current, q)), !q.params.$$validates(c)) return E;
- c = q.params.$$values(c), b = q;
- var z = b.path,
- D = 0,
- F = z[D],
- G = x.locals,
- H = [];
- if (f.reload) {
- if (N(f.reload) || O(f.reload)) {
- if (O(f.reload) && !f.reload.name) throw new Error("Invalid reload state object");
- var I = f.reload === !0 ? o[0] : m(f.reload);
- if (f.reload && !I) throw new Error("No such reload state '" + (N(f.reload) ? f.reload : f.reload.name) + "'");
- for (; F && F === o[D] && F !== I;) G = H[D] = F.locals, D++, F = z[D]
- }
- } else
- for (; F && F === o[D] && F.ownParams.$$equals(c, l);) G = H[D] = F.locals, D++, F = z[D];
- if (w(b, c, j, l, G, f)) return r && (c["#"] = r), y.params = c, S(y.params, n), S(k(b.params.$$keys(), n), b.locals.globals.$stateParams), f.location && b.navigable && b.navigable.url && (p.push(b.navigable.url, c, {
- $$avoidResync: !0,
- replace: "replace" === f.location
- }), p.update(!0)), y.transition = null, e.when(y.current);
- if (c = k(b.params.$$keys(), c || {}), r && (c["#"] = r), f.notify && a.$broadcast("$stateChangeStart", b.self, c, j.self, l, f).defaultPrevented) return a.$broadcast("$stateChangeCancel", b.self, c, j.self, l), null == y.transition && p.update(), C;
- for (var J = e.when(G), K = D; K < z.length; K++, F = z[K]) G = H[K] = d(G), J = v(F, c, F === b, J, G, f);
- var M = y.transition = J.then(function() {
- var d, e, g;
- if (y.transition !== M) return A;
- for (d = o.length - 1; d >= D; d--) g = o[d], g.self.onExit && h.invoke(g.self.onExit, g.self, g.locals.globals), g.locals = null;
- for (d = D; d < z.length; d++) e = z[d], e.locals = H[d], e.self.onEnter && h.invoke(e.self.onEnter, e.self, e.locals.globals);
- return y.transition !== M ? A : (y.$current = b, y.current = b.self, y.params = c, S(y.params, n), y.transition = null, f.location && b.navigable && p.push(b.navigable.url, b.navigable.locals.globals.$stateParams, {
- $$avoidResync: !0,
- replace: "replace" === f.location
- }), f.notify && a.$broadcast("$stateChangeSuccess", b.self, c, j.self, l), p.update(!0), y.current)
- }, function(d) {
- return y.transition !== M ? A : (y.transition = null, g = a.$broadcast("$stateChangeError", b.self, c, j.self, l, d), g.defaultPrevented || p.update(), e.reject(d))
- });
- return M
- }, y.is = function(a, b, d) {
- d = R({
- relative: y.$current
- }, d || {});
- var e = m(a, d.relative);
- return L(e) ? y.$current !== e ? !1 : b ? j(e.params.$$values(b), n) : !0 : c
- }, y.includes = function(a, b, d) {
- if (d = R({
- relative: y.$current
- }, d || {}), N(a) && r(a)) {
- if (!s(a)) return !1;
- a = y.$current.name
- }
- var e = m(a, d.relative);
- return L(e) ? L(y.$current.includes[e.name]) ? b ? j(e.params.$$values(b), n, g(b)) : !0 : !1 : c
- }, y.href = function(a, b, d) {
- d = R({
- lossy: !0,
- inherit: !0,
- absolute: !1,
- relative: y.$current
- }, d || {});
- var e = m(a, d.relative);
- if (!L(e)) return null;
- d.inherit && (b = i(n, b || {}, y.$current, e));
- var f = e && d.lossy ? e.navigable : e;
- return f && f.url !== c && null !== f.url ? p.href(f.url, k(e.params.$$keys().concat("#"), b || {}), {
- absolute: d.absolute
- }) : null
- }, y.get = function(a, b) {
- if (0 === arguments.length) return o(g(z), function(a) {
- return z[a].self
- });
- var c = m(a, b || y.$current);
- return c && c.self ? c.self : null
- }, y
- }
- function w(a, b, c, d, e, f) {
- function g(a, b, c) {
- function d(b) {
- return "search" != a.params[b].location
- }
- var e = a.params.$$keys().filter(d),
- f = l.apply({}, [a.params].concat(e)),
- g = new U.ParamSet(f);
- return g.$$equals(b, c)
- }
- return !f.reload && a === c && (e === c.locals || a.self.reloadOnSearch === !1 && g(c, d, b)) ? !0 : void 0
- }
- var x, y, z = {},
- A = {},
- B = "abstract",
- C = {
- parent: function(a) {
- if (L(a.parent) && a.parent) return m(a.parent);
- var b = /^(.+)\.[^.]+$/.exec(a.name);
- return b ? m(b[1]) : x
- },
- data: function(a) {
- return a.parent && a.parent.data && (a.data = a.self.data = d(a.parent.data, a.data)), a.data
- },
- url: function(a) {
- var b = a.url,
- c = {
- params: a.params || {}
- };
- if (N(b)) return "^" == b.charAt(0) ? e.compile(b.substring(1), c) : (a.parent.navigable || x).url.concat(b, c);
- if (!b || e.isMatcher(b)) return b;
- throw new Error("Invalid url '" + b + "' in state '" + a + "'")
- },
- navigable: function(a) {
- return a.url ? a : a.parent ? a.parent.navigable : null
- },
- ownParams: function(a) {
- var b = a.url && a.url.params || new U.ParamSet;
- return Q(a.params || {}, function(a, c) {
- b[c] || (b[c] = new U.Param(c, null, a, "config"))
- }), b
- },
- params: function(a) {
- var b = l(a.ownParams, a.ownParams.$$keys());
- return a.parent && a.parent.params ? R(a.parent.params.$$new(), b) : new U.ParamSet
- },
- views: function(a) {
- var b = {};
- return Q(L(a.views) ? a.views : {
- "": a
- }, function(c, d) {
- d.indexOf("@") < 0 && (d += "@" + a.parent.name), b[d] = c
- }), b
- },
- path: function(a) {
- return a.parent ? a.parent.path.concat(a) : []
- },
- includes: function(a) {
- var b = a.parent ? R({}, a.parent.includes) : {};
- return b[a.name] = !0, b
- },
- $delegates: {}
- };
- x = q({
- name: "",
- url: "^",
- views: null,
- "abstract": !0
- }), x.navigable = null, this.decorator = t, this.state = u, this.$get = v, v.$inject = ["$rootScope", "$q", "$view", "$injector", "$resolve", "$stateParams", "$urlRouter", "$location", "$urlMatcherFactory"]
- }
- function w() {
- function a(a, b) {
- return {
- load: function(a, c) {
- var d, e = {
- template: null,
- controller: null,
- view: null,
- locals: null,
- notify: !0,
- async: !0,
- params: {}
- };
- return c = R(e, c), c.view && (d = b.fromConfig(c.view, c.params, c.locals)), d
- }
- }
- }
- this.$get = a, a.$inject = ["$rootScope", "$templateFactory"]
- }
- function x() {
- var a = !1;
- this.useAnchorScroll = function() {
- a = !0
- }, this.$get = ["$anchorScroll", "$timeout", function(b, c) {
- return a ? b : function(a) {
- return c(function() {
- a[0].scrollIntoView()
- }, 0, !1)
- }
- }]
- }
- function y(a, c, d, e) {
- function f() {
- return c.has ? function(a) {
- return c.has(a) ? c.get(a) : null
- } : function(a) {
- try {
- return c.get(a)
- } catch (b) {
- return null
- }
- }
- }
- function g(a, c) {
- function d(a) {
- return 1 === V && W >= 4 ? !!j.enabled(a) : 1 === V && W >= 2 ? !!j.enabled() : !!i
- }
- var e = {
- enter: function(a, b, c) {
- b.after(a), c()
- },
- leave: function(a, b) {
- a.remove(), b()
- }
- };
- if (a.noanimation) return e;
- if (j) return {
- enter: function(a, c, f) {
- d(a) ? b.version.minor > 2 ? j.enter(a, null, c).then(f) : j.enter(a, null, c, f) : e.enter(a, c, f)
- },
- leave: function(a, c) {
- d(a) ? b.version.minor > 2 ? j.leave(a).then(c) : j.leave(a, c) : e.leave(a, c)
- }
- };
- if (i) {
- var f = i && i(c, a);
- return {
- enter: function(a, b, c) {
- f.enter(a, null, b), c()
- },
- leave: function(a, b) {
- f.leave(a), b()
- }
- }
- }
- return e
- }
- var h = f(),
- i = h("$animator"),
- j = h("$animate"),
- k = {
- restrict: "ECA",
- terminal: !0,
- priority: 400,
- transclude: "element",
- compile: function(c, f, h) {
- return function(c, f, i) {
- function j() {
- function a() {
- b && b.remove(), c && c.$destroy()
- }
- var b = l,
- c = n;
- c && (c._willBeDestroyed = !0), m ? (r.leave(m, function() {
- a(), l = null
- }), l = m) : (a(), l = null), m = null, n = null
- }
- function k(g) {
- var k, l = A(c, i, f, e),
- s = l && a.$current && a.$current.locals[l];
- if ((g || s !== o) && !c._willBeDestroyed) {
- k = c.$new(), o = a.$current.locals[l], k.$emit("$viewContentLoading", l);
- var t = h(k, function(a) {
- r.enter(a, f, function() {
- n && n.$emit("$viewContentAnimationEnded"), (b.isDefined(q) && !q || c.$eval(q)) && d(a)
- }), j()
- });
- m = t, n = k, n.$emit("$viewContentLoaded", l), n.$eval(p)
- }
- }
- var l, m, n, o, p = i.onload || "",
- q = i.autoscroll,
- r = g(i, c);
- c.$on("$stateChangeSuccess", function() {
- k(!1)
- }), k(!0)
- }
- }
- };
- return k
- }
- function z(a, b, c, d) {
- return {
- restrict: "ECA",
- priority: -400,
- compile: function(e) {
- var f = e.html();
- return function(e, g, h) {
- var i = c.$current,
- j = A(e, h, g, d),
- k = i && i.locals[j];
- if (k) {
- g.data("$uiView", {
- name: j,
- state: k.$$state
- }), g.html(k.$template ? k.$template : f);
- var l = a(g.contents());
- if (k.$$controller) {
- k.$scope = e, k.$element = g;
- var m = b(k.$$controller, k);
- k.$$controllerAs && (e[k.$$controllerAs] = m), g.data("$ngControllerController", m), g.children().data("$ngControllerController", m)
- }
- l(e)
- }
- }
- }
- }
- }
- function A(a, b, c, d) {
- var e = d(b.uiView || b.name || "")(a),
- f = c.inheritedData("$uiView");
- return e.indexOf("@") >= 0 ? e : e + "@" + (f ? f.state.name : "")
- }
- function B(a, b) {
- var c, d = a.match(/^\s*({[^}]*})\s*$/);
- if (d && (a = b + "(" + d[1] + ")"), c = a.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/), !c || 4 !== c.length) throw new Error("Invalid state ref '" + a + "'");
- return {
- state: c[1],
- paramExpr: c[3] || null
- }
- }
- function C(a) {
- var b = a.parent().inheritedData("$uiView");
- return b && b.state && b.state.name ? b.state : void 0
- }
- function D(a) {
- var b = "[object SVGAnimatedString]" === Object.prototype.toString.call(a.prop("href")),
- c = "FORM" === a[0].nodeName;
- return {
- attr: c ? "action" : b ? "xlink:href" : "href",
- isAnchor: "A" === a.prop("tagName").toUpperCase(),
- clickable: !c
- }
- }
- function E(a, b, c, d, e) {
- return function(f) {
- var g = f.which || f.button,
- h = e();
- if (!(g > 1 || f.ctrlKey || f.metaKey || f.shiftKey || a.attr("target"))) {
- var i = c(function() {
- b.go(h.state, h.params, h.options)
- });
- f.preventDefault();
- var j = d.isAnchor && !h.href ? 1 : 0;
- f.preventDefault = function() {
- j-- <= 0 && c.cancel(i)
- }
- }
- }
- }
- function F(a, b) {
- return {
- relative: C(a) || b.$current,
- inherit: !0
- }
- }
- function G(a, c) {
- return {
- restrict: "A",
- require: ["?^uiSrefActive", "?^uiSrefActiveEq"],
- link: function(d, e, f, g) {
- var h = B(f.uiSref, a.current.name),
- i = {
- state: h.state,
- href: null,
- params: null
- },
- j = D(e),
- k = g[1] || g[0];
- i.options = R(F(e, a), f.uiSrefOpts ? d.$eval(f.uiSrefOpts) : {});
- var l = function(c) {
- c && (i.params = b.copy(c)), i.href = a.href(h.state, i.params, i.options), k && k.$$addStateInfo(h.state, i.params), null !== i.href && f.$set(j.attr, i.href)
- };
- h.paramExpr && (d.$watch(h.paramExpr, function(a) {
- a !== i.params && l(a)
- }, !0), i.params = b.copy(d.$eval(h.paramExpr))), l(), j.clickable && e.bind("click", E(e, a, c, j, function() {
- return i
- }))
- }
- }
- }
- function H(a, b) {
- return {
- restrict: "A",
- require: ["?^uiSrefActive", "?^uiSrefActiveEq"],
- link: function(c, d, e, f) {
- function g(b) {
- l.state = b[0], l.params = b[1], l.options = b[2], l.href = a.href(l.state, l.params, l.options), i && i.$$addStateInfo(l.state, l.params), l.href && e.$set(h.attr, l.href)
- }
- var h = D(d),
- i = f[1] || f[0],
- j = [e.uiState, e.uiStateParams || null, e.uiStateOpts || null],
- k = "[" + j.map(function(a) {
- return a || "null"
- }).join(", ") + "]",
- l = {
- state: null,
- params: null,
- options: null,
- href: null
- };
- c.$watch(k, g, !0), g(c.$eval(k)), h.clickable && d.bind("click", E(d, a, b, h, function() {
- return l
- }))
- }
- }
- }
- function I(a, b, c) {
- return {
- restrict: "A",
- controller: ["$scope", "$element", "$attrs", "$timeout", function(b, d, e, f) {
- function g(b, c, e) {
- var f = a.get(b, C(d)),
- g = h(b, c);
- p.push({
- state: f || {
- name: b
- },
- params: c,
- hash: g
- }), q[g] = e
- }
- function h(a, c) {
- if (!N(a)) throw new Error("state should be a string");
- return O(c) ? a + T(c) : (c = b.$eval(c), O(c) ? a + T(c) : a)
- }
- function i() {
- for (var a = 0; a < p.length; a++) l(p[a].state, p[a].params) ? j(d, q[p[a].hash]) : k(d, q[p[a].hash]), m(p[a].state, p[a].params) ? j(d, n) : k(d, n)
- }
- function j(a, b) {
- f(function() {
- a.addClass(b)
- })
- }
- function k(a, b) {
- a.removeClass(b)
- }
- function l(b, c) {
- return a.includes(b.name, c)
- }
- function m(b, c) {
- return a.is(b.name, c)
- }
- var n, o, p = [],
- q = {};
- n = c(e.uiSrefActiveEq || "", !1)(b);
- try {
- o = b.$eval(e.uiSrefActive)
- } catch (r) {}
- o = o || c(e.uiSrefActive || "", !1)(b), O(o) && Q(o, function(c, d) {
- if (N(c)) {
- var e = B(c, a.current.name);
- g(e.state, b.$eval(e.paramExpr), d)
- }
- }), this.$$addStateInfo = function(a, b) {
- O(o) && p.length > 0 || (g(a, b, o), i())
- }, b.$on("$stateChangeSuccess", i), i()
- }]
- }
- }
- function J(a) {
- var b = function(b, c) {
- return a.is(b, c)
- };
- return b.$stateful = !0, b
- }
- function K(a) {
- var b = function(b, c, d) {
- return a.includes(b, c, d)
- };
- return b.$stateful = !0, b
- }
- var L = b.isDefined,
- M = b.isFunction,
- N = b.isString,
- O = b.isObject,
- P = b.isArray,
- Q = b.forEach,
- R = b.extend,
- S = b.copy,
- T = b.toJson;
- b.module("ui.router.util", ["ng"]), b.module("ui.router.router", ["ui.router.util"]), b.module("ui.router.state", ["ui.router.router", "ui.router.util"]), b.module("ui.router", ["ui.router.state"]), b.module("ui.router.compat", ["ui.router"]), p.$inject = ["$q", "$injector"], b.module("ui.router.util").service("$resolve", p), q.$inject = ["$http", "$templateCache", "$injector"],
- b.module("ui.router.util").service("$templateFactory", q);
- var U;
- r.prototype.concat = function(a, b) {
- var c = {
- caseInsensitive: U.caseInsensitive(),
- strict: U.strictMode(),
- squash: U.defaultSquashPolicy()
- };
- return new r(this.sourcePath + a + this.sourceSearch, R(c, b), this)
- }, r.prototype.toString = function() {
- return this.source
- }, r.prototype.exec = function(a, b) {
- function c(a) {
- function b(a) {
- return a.split("").reverse().join("")
- }
- function c(a) {
- return a.replace(/\\-/g, "-")
- }
- var d = b(a).split(/-(?!\\)/),
- e = o(d, b);
- return o(e, c).reverse()
- }
- var d = this.regexp.exec(a);
- if (!d) return null;
- b = b || {};
- var e, f, g, h = this.parameters(),
- i = h.length,
- j = this.segments.length - 1,
- k = {};
- if (j !== d.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'");
- var l, m;
- for (e = 0; j > e; e++) {
- for (g = h[e], l = this.params[g], m = d[e + 1], f = 0; f < l.replace.length; f++) l.replace[f].from === m && (m = l.replace[f].to);
- m && l.array === !0 && (m = c(m)), L(m) && (m = l.type.decode(m)), k[g] = l.value(m)
- }
- for (; i > e; e++) {
- for (g = h[e], k[g] = this.params[g].value(b[g]), l = this.params[g], m = b[g], f = 0; f < l.replace.length; f++) l.replace[f].from === m && (m = l.replace[f].to);
- L(m) && (m = l.type.decode(m)), k[g] = l.value(m)
- }
- return k
- }, r.prototype.parameters = function(a) {
- return L(a) ? this.params[a] || null : this.$$paramNames
- }, r.prototype.validates = function(a) {
- return this.params.$$validates(a)
- }, r.prototype.format = function(a) {
- function b(a) {
- return encodeURIComponent(a).replace(/-/g, function(a) {
- return "%5C%" + a.charCodeAt(0).toString(16).toUpperCase()
- })
- }
- a = a || {};
- var c = this.segments,
- d = this.parameters(),
- e = this.params;
- if (!this.validates(a)) return null;
- var f, g = !1,
- h = c.length - 1,
- i = d.length,
- j = c[0];
- for (f = 0; i > f; f++) {
- var k = h > f,
- l = d[f],
- m = e[l],
- n = m.value(a[l]),
- p = m.isOptional && m.type.equals(m.value(), n),
- q = p ? m.squash : !1,
- r = m.type.encode(n);
- if (k) {
- var s = c[f + 1],
- t = f + 1 === h;
- if (q === !1) null != r && (j += P(r) ? o(r, b).join("-") : encodeURIComponent(r)), j += s;
- else if (q === !0) {
- var u = j.match(/\/$/) ? /\/?(.*)/ : /(.*)/;
- j += s.match(u)[1]
- } else N(q) && (j += q + s);
- t && m.squash === !0 && "/" === j.slice(-1) && (j = j.slice(0, -1))
- } else {
- if (null == r || p && q !== !1) continue;
- if (P(r) || (r = [r]), 0 === r.length) continue;
- r = o(r, encodeURIComponent).join("&" + l + "="), j += (g ? "&" : "?") + (l + "=" + r), g = !0
- }
- }
- return j
- }, s.prototype.is = function(a, b) {
- return !0
- }, s.prototype.encode = function(a, b) {
- return a
- }, s.prototype.decode = function(a, b) {
- return a
- }, s.prototype.equals = function(a, b) {
- return a == b
- }, s.prototype.$subPattern = function() {
- var a = this.pattern.toString();
- return a.substr(1, a.length - 2)
- }, s.prototype.pattern = /.*/, s.prototype.toString = function() {
- return "{Type:" + this.name + "}"
- }, s.prototype.$normalize = function(a) {
- return this.is(a) ? a : this.decode(a)
- }, s.prototype.$asArray = function(a, b) {
- function d(a, b) {
- function d(a, b) {
- return function() {
- return a[b].apply(a, arguments)
- }
- }
- function e(a) {
- return P(a) ? a : L(a) ? [a] : []
- }
- function f(a) {
- switch (a.length) {
- case 0:
- return c;
- case 1:
- return "auto" === b ? a[0] : a;
- default:
- return a
- }
- }
- function g(a) {
- return !a
- }
- function h(a, b) {
- return function(c) {
- if (P(c) && 0 === c.length) return c;
- c = e(c);
- var d = o(c, a);
- return b === !0 ? 0 === n(d, g).length : f(d)
- }
- }
- function i(a) {
- return function(b, c) {
- var d = e(b),
- f = e(c);
- if (d.length !== f.length) return !1;
- for (var g = 0; g < d.length; g++)
- if (!a(d[g], f[g])) return !1;
- return !0
- }
- }
- this.encode = h(d(a, "encode")), this.decode = h(d(a, "decode")), this.is = h(d(a, "is"), !0), this.equals = i(d(a, "equals")), this.pattern = a.pattern, this.$normalize = h(d(a, "$normalize")), this.name = a.name, this.$arrayMode = b
- }
- if (!a) return this;
- if ("auto" === a && !b) throw new Error("'auto' array mode is for query parameters only");
- return new d(this, a)
- }, b.module("ui.router.util").provider("$urlMatcherFactory", t), b.module("ui.router.util").run(["$urlMatcherFactory", function(a) {}]), u.$inject = ["$locationProvider", "$urlMatcherFactoryProvider"], b.module("ui.router.router").provider("$urlRouter", u), v.$inject = ["$urlRouterProvider", "$urlMatcherFactoryProvider"], b.module("ui.router.state").factory("$stateParams", function() {
- return {}
- }).provider("$state", v), w.$inject = [], b.module("ui.router.state").provider("$view", w), b.module("ui.router.state").provider("$uiViewScroll", x);
- var V = b.version.major,
- W = b.version.minor;
- y.$inject = ["$state", "$injector", "$uiViewScroll", "$interpolate"], z.$inject = ["$compile", "$controller", "$state", "$interpolate"], b.module("ui.router.state").directive("uiView", y), b.module("ui.router.state").directive("uiView", z), G.$inject = ["$state", "$timeout"], H.$inject = ["$state", "$timeout"], I.$inject = ["$state", "$stateParams", "$interpolate"], b.module("ui.router.state").directive("uiSref", G).directive("uiSrefActive", I).directive("uiSrefActiveEq", I).directive("uiState", H), J.$inject = ["$state"], K.$inject = ["$state"], b.module("ui.router.state").filter("isState", J).filter("includedByState", K)
- }(window, window.angular),
- function(a, b) {
- "object" == typeof exports && "undefined" != typeof module && "function" == typeof require ? b(require("../moment")) : "function" == typeof define && define.amd ? define(["moment"], b) : b(a.moment)
- }(this, function(a) {
- "use strict";
- var b = a.defineLocale("ka", {
- months: {
- standalone: "იáƒáƒœáƒ•áƒáƒ ი_თებერვáƒáƒšáƒ˜_მáƒáƒ ტი_áƒáƒžáƒ ილი_მáƒáƒ˜áƒ¡áƒ˜_ივნისი_ივლისი_áƒáƒ’ვისტáƒ_სექტემბერი_áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერი_ნáƒáƒ”მბერი_დეკემბერი".split("_"),
- format: "იáƒáƒœáƒ•áƒáƒ ს_თებერვáƒáƒšáƒ¡_მáƒáƒ ტს_áƒáƒžáƒ ილის_მáƒáƒ˜áƒ¡áƒ¡_ივნისს_ივლისს_áƒáƒ’ვისტს_სექტემბერს_áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერს_ნáƒáƒ”მბერს_დეკემბერს".split("_")
- },
- monthsShort: "იáƒáƒœ_თებ_მáƒáƒ _áƒáƒžáƒ _მáƒáƒ˜_ივნ_ივლ_áƒáƒ’ვ_სექ_áƒáƒ¥áƒ¢_ნáƒáƒ”_დეკ".split("_"),
- weekdays: {
- standalone: "კვირáƒ_áƒáƒ შáƒáƒ‘áƒáƒ—ი_სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ი_áƒáƒ—ხშáƒáƒ‘áƒáƒ—ი_ხუთშáƒáƒ‘áƒáƒ—ი_პáƒáƒ áƒáƒ¡áƒ™áƒ”ვი_შáƒáƒ‘áƒáƒ—ი".split("_"),
- format: "კვირáƒáƒ¡_áƒáƒ შáƒáƒ‘áƒáƒ—ს_სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ს_áƒáƒ—ხშáƒáƒ‘áƒáƒ—ს_ხუთშáƒáƒ‘áƒáƒ—ს_პáƒáƒ áƒáƒ¡áƒ™áƒ”ვს_შáƒáƒ‘áƒáƒ—ს".split("_"),
- isFormat: /(წინáƒ|შემდეგ)/
- },
- weekdaysShort: "კვი_áƒáƒ შ_სáƒáƒ›_áƒáƒ—ხ_ხუთ_პáƒáƒ _შáƒáƒ‘".split("_"),
- weekdaysMin: "კვ_áƒáƒ _სáƒ_áƒáƒ—_ხუ_პáƒ_შáƒ".split("_"),
- longDateFormat: {
- LT: "h:mm A",
- LTS: "h:mm:ss A",
- L: "DD/MM/YYYY",
- LL: "D MMMM YYYY",
- LLL: "D MMMM YYYY h:mm A",
- LLLL: "dddd, D MMMM YYYY h:mm A"
- },
- calendar: {
- sameDay: "[დღეს] LT[-ზე]",
- nextDay: "[ხვáƒáƒš] LT[-ზე]",
- lastDay: "[გუშინ] LT[-ზე]",
- nextWeek: "[შემდეგ] dddd LT[-ზე]",
- lastWeek: "[წინáƒ] dddd LT-ზე",
- sameElse: "L"
- },
- relativeTime: {
- future: function(a) {
- return /(წáƒáƒ›áƒ˜|წუთი|სáƒáƒáƒ—ი|წელი)/.test(a) ? a.replace(/ი$/, "ში") : a + "ში"
- },
- past: function(a) {
- return /(წáƒáƒ›áƒ˜|წუთი|სáƒáƒáƒ—ი|დღე|თვე)/.test(a) ? a.replace(/(ი|ე)$/, "ის წინ") : /წელი/.test(a) ? a.replace(/წელი$/, "წლის წინ") : void 0
- },
- s: "რáƒáƒ›áƒ“ენიმე წáƒáƒ›áƒ˜",
- m: "წუთი",
- mm: "%d წუთი",
- h: "სáƒáƒáƒ—ი",
- hh: "%d სáƒáƒáƒ—ი",
- d: "დღე",
- dd: "%d დღე",
- M: "თვე",
- MM: "%d თვე",
- y: "წელი",
- yy: "%d წელი"
- },
- ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
- ordinal: function(a) {
- return 0 === a ? a : 1 === a ? a + "-ლი" : 20 > a || 100 >= a && a % 20 === 0 || a % 100 === 0 ? "მე-" + a : a + "-ე"
- },
- week: {
- dow: 1,
- doy: 7
- }
- });
- return b
- }), angular.module("ngMap", []),
- function() {
- "use strict";
- var a, b = function(b, c, d, e, f, g) {
- a = f;
- var h = this;
- h.mapOptions, h.mapEvents, h.ngMapDiv, h.addObject = function(a, b) {
- if (h.map) {
- h.map[a] = h.map[a] || {};
- var c = Object.keys(h.map[a]).length;
- h.map[a][b.id || c] = b, h.map instanceof google.maps.Map && ("infoWindows" != a && b.setMap && b.setMap && b.setMap(h.map), b.centered && b.position && h.map.setCenter(b.position), "markers" == a && h.objectChanged("markers"), "customMarkers" == a && h.objectChanged("customMarkers"))
- }
- }, h.deleteObject = function(a, b) {
- if (b.map) {
- var c = b.map[a];
- for (var d in c) c[d] === b && delete c[d];
- b.map && b.setMap && b.setMap(null), "markers" == a && h.objectChanged("markers"), "customMarkers" == a && h.objectChanged("customMarkers")
- }
- }, h.observeAttrSetObj = function(b, c, d) {
- if (c.noWatcher) return !1;
- for (var e = a.getAttrsToObserve(b), f = 0; f < e.length; f++) {
- var h = e[f];
- c.$observe(h, g.observeAndSet(h, d))
- }
- }, h.zoomToIncludeMarkers = function() {
- var a = new google.maps.LatLngBounds;
- for (var b in h.map.markers) a.extend(h.map.markers[b].getPosition());
- for (var c in h.map.customMarkers) a.extend(h.map.customMarkers[c].getPosition());
- h.map.fitBounds(a)
- }, h.objectChanged = function(a) {
- "markers" != a && "customMarkers" != a || "auto" != h.map.zoomToIncludeMarkers || h.zoomToIncludeMarkers()
- }, h.initializeMap = function() {
- var a = h.mapOptions,
- c = h.mapEvents,
- f = h.ngMapDiv,
- j = h.map;
- if (h.map = new google.maps.Map(f, {}), j)
- for (var k in j) {
- var l = j[k];
- if ("object" == typeof l)
- for (var m in l) h.addObject(k, l[m])
- }
- a.zoom = a.zoom || 15;
- var n = a.center;
- if (!a.center || "string" == typeof n && n.match(/\{\{.*\}\}/)) a.center = new google.maps.LatLng(0, 0);
- else if (!(n instanceof google.maps.LatLng)) {
- var o = a.center;
- delete a.center, g.getGeoLocation(o, a.geoLocationOptions).then(function(c) {
- h.map.setCenter(c);
- var d = a.geoCallback;
- d && e(d)(b)
- }, function() {
- a.geoFallbackCenter && h.map.setCenter(a.geoFallbackCenter)
- })
- }
- h.map.setOptions(a);
- for (var p in c) google.maps.event.addListener(h.map, p, c[p]);
- h.observeAttrSetObj(i, d, h.map), h.singleInfoWindow = a.singleInfoWindow, google.maps.event.addListenerOnce(h.map, "idle", function() {
- g.addMap(h), a.zoomToIncludeMarkers && h.zoomToIncludeMarkers(), b.map = h.map, b.$emit("mapInitialized", h.map), d.mapInitialized && e(d.mapInitialized)(b, {
- map: h.map
- })
- })
- }, b.google = google;
- var i = a.orgAttributes(c),
- j = a.filter(d),
- k = a.getOptions(j),
- l = a.getControlOptions(j),
- m = angular.extend(k, l),
- n = a.getEvents(b, j);
- h.mapOptions = m, h.mapEvents = n, h.ngMapDiv = g.getNgMapDiv(c[0]), c.append(h.ngMapDiv), k.lazyInit ? (h.map = {
- id: d.id
- }, g.addMap(h)) : h.initializeMap(), c.bind("$destroy", function() {
- g.deleteMap(h)
- })
- };
- b.$inject = ["$scope", "$element", "$attrs", "$parse", "Attr2MapOptions", "NgMap"], angular.module("ngMap").controller("__MapController", b)
- }(),
- function() {
- "use strict";
- var a, b = function(b, d, e, f) {
- f = f[0] || f[1];
- var g = a.orgAttributes(d),
- h = a.filter(e),
- i = a.getOptions(h),
- j = a.getEvents(b, h),
- k = c(i, j);
- f.addObject("bicyclingLayers", k), f.observeAttrSetObj(g, e, k), d.bind("$destroy", function() {
- f.deleteObject("bicyclingLayers", k)
- })
- },
- c = function(a, b) {
- var c = new google.maps.BicyclingLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- },
- d = function(c) {
- return a = c, {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: b
- }
- };
- d.$inject = ["Attr2MapOptions"], angular.module("ngMap").directive("bicyclingLayer", d)
- }(),
- function() {
- "use strict";
- var a, b, c, d = function(d, e, f, g) {
- g = g[0] || g[1];
- var h = a.filter(f),
- i = a.getOptions(h),
- j = a.getEvents(d, h),
- k = e[0].parentElement.removeChild(e[0]);
- b(k.innerHTML.trim())(d);
- for (var l in j) google.maps.event.addDomListener(k, l, j[l]);
- g.addObject("customControls", k), c.getMap().then(function(a) {
- var b = i.position;
- a.controls[google.maps.ControlPosition[b]].push(k)
- })
- },
- e = function(e, f, g) {
- return a = e, b = f, c = g, {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: d
- }
- };
- e.$inject = ["Attr2MapOptions", "$compile", "NgMap"], angular.module("ngMap").directive("customControl", e)
- }(),
- function() {
- "use strict";
- var a, b, c, d, e = function(a) {
- a = a || {}, this.el = document.createElement("div"), this.el.style.display = "inline-block", this.visible = !0;
- for (var b in a) this[b] = a[b]
- },
- f = function() {
- e.prototype = new google.maps.OverlayView, e.prototype.setContent = function(a, b) {
- this.el.innerHTML = a, this.el.style.position = "absolute", b && c(angular.element(this.el).contents())(b)
- }, e.prototype.getDraggable = function() {
- return this.draggable
- }, e.prototype.setDraggable = function(a) {
- this.draggable = a
- }, e.prototype.getPosition = function() {
- return this.position
- }, e.prototype.setPosition = function(a) {
- if (a && (this.position = a), this.getProjection() && "function" == typeof this.position.lng) {
- var b = this.getProjection().fromLatLngToDivPixel(this.position),
- c = Math.round(b.x - this.el.offsetWidth / 2),
- d = Math.round(b.y - this.el.offsetHeight - 10);
- this.el.style.left = c + "px", this.el.style.top = d + "px"
- }
- }, e.prototype.setZIndex = function(a) {
- a && (this.zIndex = a), this.el.style.zIndex = this.zIndex
- }, e.prototype.setVisible = function(a) {
- this.el.style.display = a ? "inline-block" : "none", this.visible = a
- }, e.prototype.addClass = function(a) {
- var b = this.el.className.trim().split(" "); - 1 == b.indexOf(a) && b.push(a), this.el.className = b.join(" ")
- }, e.prototype.removeClass = function(a) {
- var b = this.el.className.split(" "),
- c = b.indexOf(a);
- c > -1 && b.splice(c, 1), this.el.className = b.join(" ")
- }, e.prototype.onAdd = function() {
- this.getPanes().overlayMouseTarget.appendChild(this.el)
- }, e.prototype.draw = function() {
- this.setPosition(), this.setZIndex(this.zIndex), this.setVisible(this.visible)
- }, e.prototype.onRemove = function() {
- this.el.parentNode.removeChild(this.el)
- }
- },
- g = function(c, f) {
- return function(g, h, i, j) {
- j = j[0] || j[1];
- var k = a.orgAttributes(h),
- l = a.filter(i),
- m = a.getOptions(l, g),
- n = a.getEvents(g, l),
- o = h[0].parentElement.removeChild(h[0]),
- p = new e(m);
- b(function() {
- g.$watch("[" + f.join(",") + "]", function() {
- p.setContent(c, g)
- }), p.setContent(o.innerHTML, g);
- var a = o.firstElementChild.className;
- p.addClass("custom-marker"), p.addClass(a), m.position instanceof google.maps.LatLng || d.getGeoLocation(m.position).then(function(a) {
- p.setPosition(a)
- })
- });
- for (var q in n) google.maps.event.addDomListener(p.el, q, n[q]);
- j.addObject("customMarkers", p), j.observeAttrSetObj(k, i, p), h.bind("$destroy", function() {
- j.deleteObject("customMarkers", p)
- })
- }
- },
- h = function(e, h, i, j) {
- return a = i, b = e, c = h, d = j, {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- compile: function(a) {
- f(), a[0].style.display = "none";
- var b = a.html(),
- c = b.match(/{{([^}]+)}}/g),
- d = [];
- return (c || []).forEach(function(a) {
- var b = a.replace("{{", "").replace("}}", ""); - 1 == a.indexOf("::") && -1 == a.indexOf("this.") && -1 == d.indexOf(b) && d.push(a.replace("{{", "").replace("}}", ""))
- }), g(b, d)
- }
- }
- };
- h.$inject = ["$timeout", "$compile", "Attr2MapOptions", "NgMap"], angular.module("ngMap").directive("customMarker", h)
- }(),
- function() {
- "use strict";
- var a, b, c, d = function(a, b) {
- a.panel && (a.panel = document.getElementById(a.panel) || document.querySelector(a.panel));
- var c = new google.maps.DirectionsRenderer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- },
- e = function(a, d) {
- var e = new google.maps.DirectionsService,
- f = d;
- f.travelMode = f.travelMode || "DRIVING";
- var g = ["origin", "destination", "travelMode", "transitOptions", "unitSystem", "durationInTraffic", "waypoints", "optimizeWaypoints", "provideRouteAlternatives", "avoidHighways", "avoidTolls", "region"];
- for (var h in f) - 1 === g.indexOf(h) && delete f[h];
- f.waypoints && ("[]" != f.waypoints && "" !== f.waypoints || delete f.waypoints);
- var i = function(c) {
- e.route(c, function(c, d) {
- d == google.maps.DirectionsStatus.OK && b(function() {
- a.setDirections(c)
- })
- })
- };
- f.origin && f.destination && ("current-location" == f.origin ? c.getCurrentPosition().then(function(a) {
- f.origin = new google.maps.LatLng(a.coords.latitude, a.coords.longitude), i(f)
- }) : "current-location" == f.destination ? c.getCurrentPosition().then(function(a) {
- f.destination = new google.maps.LatLng(a.coords.latitude, a.coords.longitude), i(f)
- }) : i(f))
- },
- f = function(f, g, h, i) {
- var j = f;
- a = i, b = g, c = h;
- var k = function(c, f, g, h) {
- h = h[0] || h[1];
- var i = j.orgAttributes(f),
- k = j.filter(g),
- l = j.getOptions(k),
- m = j.getEvents(c, k),
- n = j.getAttrsToObserve(i),
- o = d(l, m);
- h.addObject("directionsRenderers", o), n.forEach(function(a) {
- ! function(a) {
- g.$observe(a, function(c) {
- if ("panel" == a) b(function() {
- var a = document.getElementById(c) || document.querySelector(c);
- a && o.setPanel(a)
- });
- else if (l[a] !== c) {
- var d = j.toOptionValue(c, {
- key: a
- });
- l[a] = d, e(o, l)
- }
- })
- }(a)
- }), a.getMap().then(function() {
- e(o, l)
- }), f.bind("$destroy", function() {
- h.deleteObject("directionsRenderers", o)
- })
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: k
- }
- };
- f.$inject = ["Attr2MapOptions", "$timeout", "NavigatorGeolocation", "NgMap"], angular.module("ngMap").directive("directions", f)
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("drawingManager", ["Attr2MapOptions", function(a) {
- var b = a;
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, c, d, e) {
- e = e[0] || e[1];
- var f = b.filter(d),
- g = b.getOptions(f),
- h = b.getControlOptions(f),
- i = b.getEvents(a, f),
- j = new google.maps.drawing.DrawingManager({
- drawingMode: g.drawingmode,
- drawingControl: g.drawingcontrol,
- drawingControlOptions: h.drawingControlOptions,
- circleOptions: g.circleoptions,
- markerOptions: g.markeroptions,
- polygonOptions: g.polygonoptions,
- polylineOptions: g.polylineoptions,
- rectangleOptions: g.rectangleoptions
- });
- for (var k in i) google.maps.event.addListener(j, k, i[k]);
- e.addObject("mapDrawingManager", j)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("dynamicMapsEngineLayer", ["Attr2MapOptions", function(a) {
- var b = a,
- c = function(a, b) {
- var c = new google.maps.visualization.DynamicMapsEngineLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = b.filter(e),
- h = b.getOptions(g),
- i = b.getEvents(a, g, i),
- j = c(h, i);
- f.addObject("mapsEngineLayers", j)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("fusionTablesLayer", ["Attr2MapOptions", function(a) {
- var b = a,
- c = function(a, b) {
- var c = new google.maps.FusionTablesLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = b.filter(e),
- h = b.getOptions(g),
- i = b.getEvents(a, g, i),
- j = c(h, i);
- f.addObject("fusionTablesLayers", j)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("heatmapLayer", ["Attr2MapOptions", "$window", function(a, b) {
- var c = a;
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = c.filter(e),
- h = c.getOptions(g);
- if (h.data = b[e.data] || a[e.data], !(h.data instanceof Array)) throw "invalid heatmap data";
- h.data = new google.maps.MVCArray(h.data);
- var i = new google.maps.visualization.HeatmapLayer(h);
- c.getEvents(a, g);
- f.addObject("heatmapLayers", i)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- var a = function(a, b, c, d, e) {
- var f = a,
- g = function(a, d, e) {
- var f;
- !a.position || a.position instanceof google.maps.LatLng || delete a.position, f = new google.maps.InfoWindow(a), Object.keys(d).length > 0;
- for (var g in d) g && google.maps.event.addListener(f, g, d[g]);
- var h = e.html().trim();
- if (1 != angular.element(h).length) throw "info-window working as a template must have a container";
- return f.__template = h.replace(/\s?ng-non-bindable[='"]+/, ""), f.__open = function(a, d, e) {
- c(function() {
- e && (d.anchor = e);
- var c = b(f.__template)(d);
- f.setContent(c[0]), d.$apply(), e && e.getPosition ? f.open(a, e) : e && e instanceof google.maps.LatLng ? (f.open(a), f.setPosition(e)) : f.open(a)
- })
- }, f
- },
- h = function(a, b, c, h) {
- h = h[0] || h[1], b.css("display", "none");
- var i, j = f.orgAttributes(b),
- k = f.filter(c),
- l = f.getOptions(k),
- m = f.getEvents(a, k);
- !l.position || l.position instanceof google.maps.LatLng || (i = l.position);
- var n = g(l, m, b);
- i && e.getGeoLocation(i).then(function(b) {
- n.setPosition(b), n.__open(h.map, a, b);
- var e = c.geoCallback;
- e && d(e)(a)
- }), h.addObject("infoWindows", n), h.observeAttrSetObj(j, c, n), h.map.showInfoWindow = h.map.showInfoWindow || function(b, c, d) {
- var e = "string" == typeof b ? b : c,
- f = "string" == typeof b ? c : d;
- "string" == typeof f && (f = h.map.markers[f]);
- var g = h.map.infoWindows[e],
- i = f ? f : this.getPosition ? this : null;
- g.__open(h.map, a, i), h.singleInfoWindow && (h.lastInfoWindow && a.hideInfoWindow(h.lastInfoWindow), h.lastInfoWindow = e)
- }, h.map.hideInfoWindow = h.map.hideInfoWindow || function(a, b) {
- var c = "string" == typeof a ? a : b,
- d = h.map.infoWindows[c];
- d.close()
- }, a.showInfoWindow = h.map.showInfoWindow, a.hideInfoWindow = h.map.hideInfoWindow, e.getMap().then(function(b) {
- if (n.visible && n.__open(b, a), n.visibleOnMarker) {
- var c = n.visibleOnMarker;
- n.__open(b, a, b.markers[c])
- }
- })
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: h
- }
- };
- a.$inject = ["Attr2MapOptions", "$compile", "$timeout", "$parse", "NgMap"], angular.module("ngMap").directive("infoWindow", a)
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("kmlLayer", ["Attr2MapOptions", function(a) {
- var b = a,
- c = function(a, b) {
- var c = new google.maps.KmlLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = b.orgAttributes(d),
- h = b.filter(e),
- i = b.getOptions(h),
- j = b.getEvents(a, h),
- k = c(i, j);
- f.addObject("kmlLayers", k), f.observeAttrSetObj(g, e, k), d.bind("$destroy", function() {
- f.deleteObject("kmlLayers", k)
- })
- }
- }
- }])
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("mapData", ["Attr2MapOptions", "NgMap", function(a, b) {
- var c = a;
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e) {
- var f = c.filter(e),
- g = c.getOptions(f),
- h = c.getEvents(a, f, h);
- b.getMap().then(function(b) {
- for (var c in g) {
- var d = g[c];
- "function" == typeof a[d] ? b.data[c](a[d]) : b.data[c](d)
- }
- for (var e in h) b.data.addListener(e, h[e])
- })
- }
- }
- }])
- }(),
- function() {
- "use strict";
- var a, b, c, d, e = function(c, e, f) {
- var g = f.mapLazyLoadParams || f.mapLazyLoad;
- if (window.lazyLoadCallback = function() {
- a(function() {
- e.html(d), b(e.contents())(c)
- }, 100)
- }, void 0 === window.google || void 0 === window.google.maps) {
- var h = document.createElement("script");
- h.src = g + (g.indexOf("?") > -1 ? "&" : "?") + "callback=lazyLoadCallback", document.body.appendChild(h)
- } else e.html(d), b(e.contents())(c)
- },
- f = function(a, b) {
- return !b.mapLazyLoad && void 0, d = a.html(), c = b.mapLazyLoad, document.querySelector('script[src="' + c + (c.indexOf("?") > -1 ? "&" : "?") + 'callback=lazyLoadCallback"]') ? !1 : (a.html(""), {
- pre: e
- })
- },
- g = function(c, d) {
- return b = c, a = d, {
- compile: f
- }
- };
- g.$inject = ["$compile", "$timeout"], angular.module("ngMap").directive("mapLazyLoad", g)
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("mapType", ["$parse", "NgMap", function(a, b) {
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(c, d, e, f) {
- f = f[0] || f[1];
- var g, h = e.name;
- if (!h) throw "invalid map-type name";
- if (g = a(e.object)(c), !g) throw "invalid map-type object";
- b.getMap().then(function(a) {
- a.mapTypes.set(h, g)
- }), f.addObject("mapTypes", g)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- var a = function() {
- return {
- restrict: "AE",
- controller: "__MapController",
- conrollerAs: "ngmap"
- }
- };
- angular.module("ngMap").directive("map", [a]), angular.module("ngMap").directive("ngMap", [a])
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("mapsEngineLayer", ["Attr2MapOptions", function(a) {
- var b = a,
- c = function(a, b) {
- var c = new google.maps.visualization.MapsEngineLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = b.filter(e),
- h = b.getOptions(g),
- i = b.getEvents(a, g, i),
- j = c(h, i);
- f.addObject("mapsEngineLayers", j)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- var a, b, c, d = function(a, b) {
- var d;
- if (c.defaultOptions.marker)
- for (var e in c.defaultOptions.marker) "undefined" == typeof a[e] && (a[e] = c.defaultOptions.marker[e]);
- a.position instanceof google.maps.LatLng || (a.position = new google.maps.LatLng(0, 0)), d = new google.maps.Marker(a), Object.keys(b).length > 0;
- for (var f in b) f && google.maps.event.addListener(d, f, b[f]);
- return d
- },
- e = function(e, f, g, h) {
- h = h[0] || h[1];
- var i, j = a.orgAttributes(f),
- k = a.filter(g),
- l = a.getOptions(k, e),
- m = a.getEvents(e, k);
- l.position instanceof google.maps.LatLng || (i = l.position);
- var n = d(l, m);
- h.addObject("markers", n), i && c.getGeoLocation(i).then(function(a) {
- n.setPosition(a), l.centered && n.map.setCenter(a);
- var c = g.geoCallback;
- c && b(c)(e)
- }), h.observeAttrSetObj(j, g, n), f.bind("$destroy", function() {
- h.deleteObject("markers", n)
- })
- },
- f = function(d, f, g) {
- return a = d, b = f, c = g, {
- restrict: "E",
- require: ["^?map", "?^ngMap"],
- link: e
- }
- };
- f.$inject = ["Attr2MapOptions", "$parse", "NgMap"], angular.module("ngMap").directive("marker", f)
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("overlayMapType", ["NgMap", function(a) {
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(b, c, d, e) {
- e = e[0] || e[1];
- var f = d.initMethod || "insertAt",
- g = b[d.object];
- a.getMap().then(function(a) {
- if ("insertAt" == f) {
- var b = parseInt(d.index, 10);
- a.overlayMapTypes.insertAt(b, g)
- } else "push" == f && a.overlayMapTypes.push(g)
- }), e.addObject("overlayMapTypes", g)
- }
- }
- }])
- }(),
- function() {
- "use strict";
- var a = function(a, b) {
- var c = a,
- d = function(a, d, e, f) {
- if ("false" === e.placesAutoComplete) return !1;
- var g = c.filter(e),
- h = c.getOptions(g),
- i = c.getEvents(a, g),
- j = new google.maps.places.Autocomplete(d[0], h);
- for (var k in i) google.maps.event.addListener(j, k, i[k]);
- var l = function() {
- b(function() {
- f && f.$setViewValue(d.val())
- }, 100)
- };
- google.maps.event.addListener(j, "place_changed", l), d[0].addEventListener("change", l), e.$observe("types", function(a) {
- if (a) {
- var b = c.toOptionValue(a, {
- key: "types"
- });
- j.setTypes(b)
- }
- })
- };
- return {
- restrict: "A",
- require: "?ngModel",
- link: d
- }
- };
- a.$inject = ["Attr2MapOptions", "$timeout"], angular.module("ngMap").directive("placesAutoComplete", a)
- }(),
- function() {
- "use strict";
- var a = function(a, b) {
- var c, d = a.name;
- switch (delete a.name, d) {
- case "circle":
- a.center instanceof google.maps.LatLng || (a.center = new google.maps.LatLng(0, 0)), c = new google.maps.Circle(a);
- break;
- case "polygon":
- c = new google.maps.Polygon(a);
- break;
- case "polyline":
- c = new google.maps.Polyline(a);
- break;
- case "rectangle":
- c = new google.maps.Rectangle(a);
- break;
- case "groundOverlay":
- case "image":
- var e = a.url,
- f = {
- opacity: a.opacity,
- clickable: a.clickable,
- id: a.id
- };
- c = new google.maps.GroundOverlay(e, a.bounds, f)
- }
- for (var g in b) b[g] && google.maps.event.addListener(c, g, b[g]);
- return c
- },
- b = function(b, c, d) {
- var e = b,
- f = function(b, f, g, h) {
- h = h[0] || h[1];
- var i, j, k = e.orgAttributes(f),
- l = e.filter(g),
- m = e.getOptions(l),
- n = e.getEvents(b, l);
- j = m.name, m.center instanceof google.maps.LatLng || (i = m.center);
- var o = a(m, n);
- h.addObject("shapes", o), i && "circle" == j && d.getGeoLocation(i).then(function(a) {
- o.setCenter(a), o.centered && o.map.setCenter(a);
- var d = g.geoCallback;
- d && c(d)(b)
- }), h.observeAttrSetObj(k, g, o), f.bind("$destroy", function() {
- h.deleteObject("shapes", o)
- })
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: f
- }
- };
- b.$inject = ["Attr2MapOptions", "$parse", "NgMap"], angular.module("ngMap").directive("shape", b)
- }(),
- function() {
- "use strict";
- var a = function(a, b) {
- var c = a,
- d = function(a, b, c) {
- var d, e;
- b.container && (e = document.getElementById(b.container), e = e || document.querySelector(b.container)), e ? d = new google.maps.StreetViewPanorama(e, b) : (d = a.getStreetView(), d.setOptions(b));
- for (var f in c) f && google.maps.event.addListener(d, f, c[f]);
- return d
- },
- e = function(a, e, f) {
- var g = c.filter(f),
- h = c.getOptions(g),
- i = c.getControlOptions(g),
- j = angular.extend(h, i),
- k = c.getEvents(a, g);
- b.getMap().then(function(a) {
- var b = d(a, j, k);
- a.setStreetView(b), !b.getPosition() && b.setPosition(a.getCenter()), google.maps.event.addListener(b, "position_changed", function() {
- b.getPosition() !== a.getCenter() && a.setCenter(b.getPosition())
- });
- var c = google.maps.event.addListener(a, "center_changed", function() {
- b.setPosition(a.getCenter()), google.maps.event.removeListener(c)
- })
- })
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: e
- }
- };
- a.$inject = ["Attr2MapOptions", "NgMap"], angular.module("ngMap").directive("streetViewPanorama", a)
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("trafficLayer", ["Attr2MapOptions", function(a) {
- var b = a,
- c = function(a, b) {
- var c = new google.maps.TrafficLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = b.orgAttributes(d),
- h = b.filter(e),
- i = b.getOptions(h),
- j = b.getEvents(a, h),
- k = c(i, j);
- f.addObject("trafficLayers", k), f.observeAttrSetObj(g, e, k), d.bind("$destroy", function() {
- f.deleteObject("trafficLayers", k)
- })
- }
- }
- }])
- }(),
- function() {
- "use strict";
- angular.module("ngMap").directive("transitLayer", ["Attr2MapOptions", function(a) {
- var b = a,
- c = function(a, b) {
- var c = new google.maps.TransitLayer(a);
- for (var d in b) google.maps.event.addListener(c, d, b[d]);
- return c
- };
- return {
- restrict: "E",
- require: ["?^map", "?^ngMap"],
- link: function(a, d, e, f) {
- f = f[0] || f[1];
- var g = b.orgAttributes(d),
- h = b.filter(e),
- i = b.getOptions(h),
- j = b.getEvents(a, h),
- k = c(i, j);
- f.addObject("transitLayers", k), f.observeAttrSetObj(g, e, k), d.bind("$destroy", function() {
- f.deleteObject("transitLayers", k)
- })
- }
- }
- }])
- }(),
- function() {
- "use strict";
- var a = /([\:\-\_]+(.))/g,
- b = /^moz([A-Z])/,
- c = function() {
- return function(c) {
- return c.replace(a, function(a, b, c, d) {
- return d ? c.toUpperCase() : c
- }).replace(b, "Moz$1")
- }
- };
- angular.module("ngMap").filter("camelCase", c)
- }(),
- function() {
- "use strict";
- var a = function() {
- return function(a) {
- try {
- return JSON.parse(a), a
- } catch (b) {
- return a.replace(/([\$\w]+)\s*:/g, function(a, b) {
- return '"' + b + '":'
- }).replace(/'([^']+)'/g, function(a, b) {
- return '"' + b + '"'
- })
- }
- }
- };
- angular.module("ngMap").filter("jsonize", a)
- }(),
- function() {
- "use strict";
- var isoDateRE = /^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?$/,
- Attr2MapOptions = function($parse, $timeout, $log, NavigatorGeolocation, GeoCoder, camelCaseFilter, jsonizeFilter) {
- var orgAttributes = function(a) {
- a.length > 0 && (a = a[0]);
- for (var b = {}, c = 0; c < a.attributes.length; c++) {
- var d = a.attributes[c];
- b[d.name] = d.value
- }
- return b
- },
- getJSON = function(a) {
- var b = /^[\+\-]?[0-9\.]+,[ ]*\ ?[\+\-]?[0-9\.]+$/;
- return a.match(b) && (a = "[" + a + "]"), JSON.parse(jsonizeFilter(a))
- },
- getLatLng = function(a) {
- var b = a;
- return a[0].constructor == Array ? b = a.map(function(a) {
- return new google.maps.LatLng(a[0], a[1])
- }) : !isNaN(parseFloat(a[0])) && isFinite(a[0]) && (b = new google.maps.LatLng(b[0], b[1])), b
- },
- toOptionValue = function(input, options) {
- var output;
- try {
- output = getNumber(input)
- } catch (err) {
- try {
- var output = getJSON(input);
- if (output instanceof Array) output = output[0].constructor == Object ? output : getLatLng(output);
- else if (output === Object(output)) {
- var newOptions = options;
- newOptions.doNotConverStringToNumber = !0, output = getOptions(output, newOptions)
- }
- } catch (err2) {
- if (input.match(/^[A-Z][a-zA-Z0-9]+\(.*\)$/)) try {
- var exp = "new google.maps." + input;
- output = eval(exp)
- } catch (e) {
- output = input
- } else if (input.match(/^([A-Z][a-zA-Z0-9]+)\.([A-Z]+)$/)) try {
- var matches = input.match(/^([A-Z][a-zA-Z0-9]+)\.([A-Z]+)$/);
- output = google.maps[matches[1]][matches[2]]
- } catch (e) {
- output = input
- } else if (input.match(/^[A-Z]+$/)) try {
- var capitalizedKey = options.key.charAt(0).toUpperCase() + options.key.slice(1);
- options.key.match(/temperatureUnit|windSpeedUnit|labelColor/) ? (capitalizedKey = capitalizedKey.replace(/s$/, ""), output = google.maps.weather[capitalizedKey][input]) : output = google.maps[capitalizedKey][input]
- } catch (e) {
- output = input
- } else if (input.match(isoDateRE)) try {
- output = new Date(input)
- } catch (e) {
- output = input
- } else output = input
- }
- }
- if ("bounds" == options.key && output instanceof Array && (output = new google.maps.LatLngBounds(output[0], output[1])), "icons" == options.key && output instanceof Array)
- for (var i = 0; i < output.length; i++) {
- var el = output[i];
- el.icon.path.match(/^[A-Z_]+$/) && (el.icon.path = google.maps.SymbolPath[el.icon.path])
- }
- if ("icon" == options.key && output instanceof Object) {
- ("" + output.path).match(/^[A-Z_]+$/) && (output.path = google.maps.SymbolPath[output.path]);
- for (var key in output) {
- var arr = output[key];
- "anchor" == key || "origin" == key ? output[key] = new google.maps.Point(arr[0], arr[1]) : "size" != key && "scaledSize" != key || (output[key] = new google.maps.Size(arr[0], arr[1]))
- }
- }
- return output
- },
- getAttrsToObserve = function(a) {
- var b = [];
- if (!a.noWatcher)
- for (var c in a) {
- var d = a[c];
- d && d.match(/\{\{.*\}\}/) && b.push(camelCaseFilter(c))
- }
- return b
- },
- filter = function(a) {
- var b = {};
- for (var c in a) c.match(/^\$/) || c.match(/^ng[A-Z]/) || (b[c] = a[c]);
- return b
- },
- getOptions = function(a, b) {
- var c = {};
- for (var d in a)
- if (a[d] || 0 === a[d]) {
- if (d.match(/^on[A-Z]/)) continue;
- if (d.match(/ControlOptions$/)) continue;
- "string" != typeof a[d] ? c[d] = a[d] : b && b.doNotConverStringToNumber && a[d].match(/^[0-9]+$/) ? c[d] = a[d] : c[d] = toOptionValue(a[d], {
- key: d
- })
- }
- return c
- },
- getEvents = function(a, b) {
- var c = {},
- d = function(a) {
- return "_" + a.toLowerCase()
- },
- e = function(b) {
- var c = b.match(/([^\(]+)\(([^\)]*)\)/),
- d = c[1],
- e = c[2].replace(/event[ ,]*/, ""),
- f = $parse("[" + e + "]");
- return function(b) {
- function c(a, b) {
- return a[b]
- }
- var e = f(a),
- g = d.split(".").reduce(c, a);
- g && g.apply(this, [b].concat(e)), $timeout(function() {
- a.$apply()
- })
- }
- };
- for (var f in b)
- if (b[f]) {
- if (!f.match(/^on[A-Z]/)) continue;
- var g = f.replace(/^on/, "");
- g = g.charAt(0).toLowerCase() + g.slice(1), g = g.replace(/([A-Z])/g, d);
- var h = b[f];
- c[g] = new e(h)
- }
- return c
- },
- getControlOptions = function(a) {
- var b = {};
- if ("object" != typeof a) return !1;
- for (var c in a)
- if (a[c]) {
- if (!c.match(/(.*)ControlOptions$/)) continue;
- var d = a[c],
- e = d.replace(/'/g, '"');
- e = e.replace(/([^"]+)|("[^"]+")/g, function(a, b, c) {
- return b ? b.replace(/([a-zA-Z0-9]+?):/g, '"$1":') : c
- });
- try {
- var f = JSON.parse(e);
- for (var g in f)
- if (f[g]) {
- var h = f[g];
- if ("string" == typeof h ? h = h.toUpperCase() : "mapTypeIds" === g && (h = h.map(function(a) {
- return a.match(/^[A-Z]+$/) ? google.maps.MapTypeId[a.toUpperCase()] : a
- })), "style" === g) {
- var i = c.charAt(0).toUpperCase() + c.slice(1),
- j = i.replace(/Options$/, "") + "Style";
- f[g] = google.maps[j][h]
- } else "position" === g ? f[g] = google.maps.ControlPosition[h] : f[g] = h
- }
- b[c] = f
- } catch (k) {}
- }
- return b
- };
- return {
- filter: filter,
- getOptions: getOptions,
- getEvents: getEvents,
- getControlOptions: getControlOptions,
- toOptionValue: toOptionValue,
- getAttrsToObserve: getAttrsToObserve,
- orgAttributes: orgAttributes
- }
- };
- Attr2MapOptions.$inject = ["$parse", "$timeout", "$log", "NavigatorGeolocation", "GeoCoder", "camelCaseFilter", "jsonizeFilter"], angular.module("ngMap").service("Attr2MapOptions", Attr2MapOptions)
- }(),
- function() {
- "use strict";
- var a, b = function(b) {
- var c = a.defer(),
- d = new google.maps.Geocoder;
- return d.geocode(b, function(a, b) {
- b == google.maps.GeocoderStatus.OK ? c.resolve(a) : c.reject(b)
- }), c.promise
- },
- c = function(c) {
- return a = c, {
- geocode: b
- }
- };
- c.$inject = ["$q"], angular.module("ngMap").service("GeoCoder", c)
- }(),
- function() {
- "use strict";
- var a, b = function(b) {
- var c = a.defer();
- return navigator.geolocation ? (void 0 === b ? b = {
- timeout: 5e3
- } : void 0 === b.timeout && (b.timeout = 5e3),
- navigator.geolocation.getCurrentPosition(function(a) {
- c.resolve(a)
- }, function(a) {
- c.reject(a)
- }, b)) : c.reject("Browser Geolocation service failed."), c.promise
- },
- c = function(c) {
- return a = c, {
- getCurrentPosition: b
- }
- };
- c.$inject = ["$q"], angular.module("ngMap").service("NavigatorGeolocation", c)
- }(),
- function() {
- "use strict";
- var a, b, c, d, e, f, g, h = {},
- i = function(a) {
- var b = h[a || 0];
- b.map instanceof google.maps.Map || b.initializeMap()
- },
- j = function(b) {
- function d(b) {
- h[f] ? e.resolve(h[f].map) : b > g ? e.reject("could not find map") : a.setTimeout(function() {
- d(b + 100)
- }, 100)
- }
- b = b || {};
- var e = c.defer(),
- f = b.id || 0,
- g = b.timeout || 2e3;
- return d(0), e.promise
- },
- k = function(a) {
- var b = Object.keys(h).length;
- h[a.map.id || b] = a
- },
- l = function(a) {
- var b = Object.keys(h).length - 1;
- delete h[a.map.id || b]
- },
- m = function(c, d) {
- var e;
- return c.currentStyle ? e = c.currentStyle[d] : a.getComputedStyle && (e = b.defaultView.getComputedStyle(c, null).getPropertyValue(d)), e
- },
- n = function(a) {
- var c = b.createElement("div"),
- d = a.getAttribute("default-style");
- return c.style.width = "100%", c.style.height = "100%", "true" == d ? (a.style.display = "block", a.style.height = "300px") : ("block" != m(a, "display") && (a.style.display = "block"), m(a, "height").match(/^(0|auto)/) && (a.style.height = "300px")), c.addEventListener("dragstart", function(a) {
- return a.preventDefault(), !1
- }), c
- },
- o = function(a, b) {
- var e = c.defer();
- return !a || a.match(/^current/i) ? d.getCurrentPosition(b).then(function(a) {
- var b = a.coords.latitude,
- c = a.coords.longitude,
- d = new google.maps.LatLng(b, c);
- e.resolve(d)
- }, function(a) {
- e.reject(a)
- }) : f.geocode({
- address: a
- }).then(function(a) {
- e.resolve(a[0].geometry.location)
- }, function(a) {
- e.reject(a)
- }), e.promise
- },
- p = function(a, b) {
- return function(c) {
- if (c) {
- var d = g("set-" + a),
- f = e.toOptionValue(c, {
- key: a
- });
- b[d] && (a.match(/center|position/) && "string" == typeof f ? o(f).then(function(a) {
- b[d](a)
- }) : b[d](f))
- }
- }
- };
- angular.module("ngMap").provider("NgMap", function() {
- var h = {};
- this.setDefaultOptions = function(a) {
- h = a
- };
- var q = function(q, r, s, t, u, v, w) {
- return a = q, b = r[0], c = s, d = t, e = u, f = v, g = w, {
- defaultOptions: h,
- addMap: k,
- deleteMap: l,
- getMap: j,
- initMap: i,
- getStyle: m,
- getNgMapDiv: n,
- getGeoLocation: o,
- observeAndSet: p
- }
- };
- q.$inject = ["$window", "$document", "$q", "NavigatorGeolocation", "Attr2MapOptions", "GeoCoder", "camelCaseFilter"], this.$get = q
- })
- }(),
- function() {
- "use strict";
- var a, b = function(b, c) {
- c = c || b.getCenter();
- var d = a.defer(),
- e = new google.maps.StreetViewService;
- return e.getPanoramaByLocation(c || b.getCenter, 100, function(a, b) {
- b === google.maps.StreetViewStatus.OK ? d.resolve(a.location.pano) : d.resolve(!1)
- }), d.promise
- },
- c = function(a, b) {
- var c = new google.maps.StreetViewPanorama(a.getDiv(), {
- enableCloseButton: !0
- });
- c.setPano(b)
- },
- d = function(d) {
- return a = d, {
- getPanorama: b,
- setPanorama: c
- }
- };
- d.$inject = ["$q"], angular.module("ngMap").service("StreetView", d)
- }(),
- function() {
- "use strict";
- angular.module("ui.validate", []).directive("uiValidate", ["$$uiValidateApplyWatch", "$$uiValidateApplyWatchCollection", function(a, b) {
- return {
- restrict: "A",
- require: "ngModel",
- link: function(c, d, e, f) {
- var g, h = c.$eval(e.uiValidate);
- h && (angular.isString(h) && (h = {
- validator: h
- }), angular.forEach(h, function(a, b) {
- g = function(d, e) {
- var g = c.$eval(a, {
- $value: d,
- $modelValue: d,
- $viewValue: e,
- $name: f.$name
- });
- return angular.isObject(g) && angular.isFunction(g.then) ? (g.then(function() {
- f.$setValidity(b, !0)
- }, function() {
- f.$setValidity(b, !1)
- }), !0) : !!g
- }, f.$validators[b] = g
- }), e.uiValidateWatch && a(c, f, c.$eval(e.uiValidateWatch), e.uiValidateWatchObjectEquality), e.uiValidateWatchCollection && b(c, f, c.$eval(e.uiValidateWatchCollection)))
- }
- }
- }]).directive("uiValidateAsync", ["$$uiValidateApplyWatch", "$$uiValidateApplyWatchCollection", "$timeout", "$q", function(a, b, c, d) {
- return {
- restrict: "A",
- require: "ngModel",
- link: function(c, e, f, g) {
- var h, i = c.$eval(f.uiValidateAsync);
- i && (angular.isString(i) && (i = {
- validatorAsync: i
- }), angular.forEach(i, function(a, b) {
- h = function(b, e) {
- var f = c.$eval(a, {
- $value: b,
- $modelValue: b,
- $viewValue: e,
- $name: g.$name
- });
- return angular.isObject(f) && angular.isFunction(f.then) ? f : d(function(a, b) {
- setTimeout(function() {
- f ? a() : b()
- }, 0)
- })
- }, g.$asyncValidators[b] = h
- }), f.uiValidateWatch && a(c, g, c.$eval(f.uiValidateWatch), f.uiValidateWatchObjectEquality), f.uiValidateWatchCollection && b(c, g, c.$eval(f.uiValidateWatchCollection)))
- }
- }
- }]).service("$$uiValidateApplyWatch", function() {
- return function(a, b, c, d) {
- var e = function() {
- b.$validate()
- };
- angular.isString(c) ? a.$watch(c, e, d) : angular.isArray(c) ? angular.forEach(c, function(b) {
- a.$watch(b, e, d)
- }) : angular.isObject(c) && angular.forEach(c, function(b) {
- angular.isString(b) && a.$watch(b, e, d), angular.isArray(b) && angular.forEach(b, function(b) {
- a.$watch(b, e, d)
- })
- })
- }
- }).service("$$uiValidateApplyWatchCollection", function() {
- return function(a, b, c) {
- var d = function() {
- b.$validate()
- };
- angular.isString(c) ? a.$watchCollection(c, d) : angular.isArray(c) ? angular.forEach(c, function(b) {
- a.$watchCollection(b, d)
- }) : angular.isObject(c) && angular.forEach(c, function(b) {
- angular.isString(b) && a.$watchCollection(b, d), angular.isArray(b) && angular.forEach(b, function(b) {
- a.$watchCollection(b, d)
- })
- })
- }
- })
- }(), angular.module("staticConfig", []).constant("staticConfig", {
- workdays: {
- 0: !1,
- 1: !0,
- 2: !0,
- 3: !0,
- 4: !0,
- 5: !0,
- 6: !1,
- start: "1970-01-01T08:00:00.000Z",
- end: "1970-01-01T12:00:00.000Z"
- },
- hideNextWorkdayMenusUntil: 8,
- maxMenuQuantity: 10,
- numberRegex: "^(\\+995)?(5\\d{8}|322\\d{6})$",
- menuImagePath: "mnu",
- menuThumbPath: "mnu/t",
- bucketName: "img.sadili.ge"
- }),
- function() {
- "use strict";
- angular.module("sdl", ["ngResource", "ngAnimate", "ngMap", "ui.router", "ui.bootstrap", "ui.validate", "angularMoment", "bootstrapLightbox", "staticConfig"]).run(["$rootScope", "$state", "$stateParams", "$http", "config", "zopim", "amMoment", function(a, b, c, d, e, f, g) {
- e.load(), g.changeLocale("ka"), a.$state = b, a.$stateParams = c, d.get("/api/me").then(function(b) {
- a.$applyAsync(function() {
- a.user = b.data
- })
- }, function(a) {
- console.error("Error getting registered user", a)
- }), a.isRegistered = function() {
- return !!a.user
- }, f.init()
- }]).config(["$stateProvider", "$urlRouterProvider", "$locationProvider", "gaEventProvider", function(a, b, c, d) {
- var e = function(a) {
- return [function() {
- d.sendEvent(a, "enter"), d.sendPageview()
- }]
- };
- c.html5Mode(!0), a.state("orders", {
- url: "?menus&address",
- "abstract": !0,
- controller: "OrderCtrl as OC",
- templateUrl: "templates/order.html"
- }).state("home", {
- url: "/",
- parent: "orders",
- templateUrl: "templates/index.html",
- onEnter: e("home")
- }).state("welcome", {
- url: "/welcome",
- templateUrl: "templates/hello.html",
- onEnter: e("welcome")
- }).state("navbar", {
- "abstract": !0,
- template: "<ui-view/>"
- }).state("navbar.how-it-works", {
- url: "/how-it-works",
- templateUrl: "/templates/navbar/how-it-works.html",
- onEnter: e("how-it-works")
- }).state("navbar.our-kitchen", {
- url: "/our-kitchen",
- templateUrl: "/templates/navbar/our-kitchen.html",
- controller: "KitchenCtlr as KC",
- onEnter: e("our-kitchen")
- }).state("navbar.wrap", {
- url: "/wrap",
- templateUrl: "/templates/navbar/wrap.html",
- onEnter: e("/wrap")
- }).state("navbar.work-area", {
- url: "/work-area",
- templateUrl: "/templates/navbar/work-area.html",
- onEnter: e("/work-area")
- }).state("navbar.contact", {
- url: "/contact",
- templateUrl: "/templates/navbar/contact.html",
- controller: ["$scope", function(a) {
- this.mail = "mailto:", this.local = "hello", this.domain = "sadili.ge"
- }],
- controllerAs: "contact",
- onEnter: e("/contact")
- }).state("terms-and-conditions", {
- url: "/terms-and-conditions",
- templateUrl: "templates/terms-and-conditions-and-privacy-policy.html"
- }).state("auth", {
- "abstract": !0,
- parent: "orders",
- url: "/auth",
- templateUrl: "templates/auth.html",
- controller: "AuthCtrl as AUC"
- }).state("auth.login", {
- url: "/login",
- controller: "LoginCtrl as LC",
- templateUrl: "templates/auth/login.html",
- onEnter: e("auth.login")
- }).state("auth.register", {
- url: "/register",
- controller: "RegistrationCtrl as RC",
- templateUrl: "templates/auth/register.html",
- onEnter: e("auth.register")
- }).state("auth.passwordRecovery", {
- url: "/passwordRecovery",
- controller: "PasswordRecoveryCtrl",
- templateUrl: "templates/auth/password-recovery.html"
- }).state("auth.passwordUpdated", {
- url: "/passwordUpdated",
- templateUrl: "templates/auth/password-updated.html"
- }).state("orders.cancelled", {
- url: "/orders/:id/cancelled?error&errorMessage",
- templateUrl: "templates/order/cancelled.html",
- controller: "OrderCancelledCtrl as OCC"
- }).state("orders.selectAddress", {
- url: "/orders/selectAddress",
- controller: "AddressCtrl as AC",
- templateUrl: "templates/order/address.html",
- onEnter: e("orders.selectAddress")
- }).state("orders.selectPayment", {
- url: "/orders/selectPayment",
- controller: "SelectPaymentCtrl as SPC",
- templateUrl: "templates/order/cards.html",
- onEnter: e("orders.selectPayment")
- }).state("orders.delivery", {
- "abstract": !0,
- url: "/orders/:id/delivery",
- templateUrl: "templates/order/delivery.html",
- controller: "OrderDeliveryCtrl as ODC",
- onEnter: e("orders.delivery")
- }).state("orders.delivery.wait", {
- url: "/wait",
- templateUrl: "templates/order/delivery/wait.html"
- }).state("orders.delivery.map", {
- url: "/map",
- templateUrl: "templates/order/delivery/map.html",
- controller: "OrderDeliveryMapCtrl as ODMC"
- }).state("orders.delivery.finished", {
- url: "/finished",
- templateUrl: "templates/order/delivery/finished.html"
- }).state("orderprocessed", {
- url: "/orderprocessed/:status",
- templateUrl: "templates/orderprocessed.html",
- controller: "PaymentCheckCtrl as PCC",
- access: {
- requiredLogin: !1
- }
- }), b.otherwise("/")
- }]).config(["LightboxProvider", function(a) {
- a.templateUrl = "templates/lightbox.html"
- }])
- }(),
- function(a) {
- "use strict";
- a.module("sdl").controller("PaymentCheckCtrl", ["$state", "$timeout", "BankResponse", "PaymentService", "Order", function(a, b, c, d, e) {
- var f = this;
- f.statuses = {
- WAIT: "WAIT",
- OK: "OK",
- FAILED: "FAILED",
- LOADING: "LOADING"
- }, f.status = f.statuses.LOADING, f.isFailed = function() {
- return f.status === f.statuses.FAILED
- }, f.isOk = function() {
- return f.status === f.statuses.OK
- }, f.isWait = function() {
- return f.status === f.statuses.WAIT
- }, f.isLoading = function() {
- return f.status === f.statuses.LOADING
- }, f.check = function() {
- f.status = f.statuses.LOADING, d.checkByBankResponse(c.getBankResponse()).then(function(c) {
- switch (c.paymentStatus) {
- case e.paymentStatuses.OK:
- case e.paymentStatuses.FINISHED:
- f.status = f.statuses.OK, a.go("orders.delivery.wait", {
- id: c.order.id
- });
- break;
- case e.paymentStatuses.CANCELLED:
- a.go("orders.cancelled", {
- id: c.order.id
- });
- break;
- case e.paymentStatuses.FAILED:
- f.status = f.statuses.FAILED, f.error = c.paymentResult.responseStatus, f.errorMessage = c.paymentResult.responseMessage;
- break;
- default:
- b(function() {
- f.status = f.statuses.WAIT
- }, 1e4)
- }
- })["catch"](function(a) {
- f.status = f.statuses.WAIT, console.error(a)
- })
- }, c.isFailed() ? (f.status = f.statuses.FAILED, f.error = c.getError(), d.failByBankResponse(c.getBankResponse()).then(function(a) {
- console.log(a)
- })["catch"](function(a) {
- console.error(a)
- })) : f.check()
- }])
- }(window.angular),
- function(a) {
- "use strict";
- a.module("sdl").controller("SelectPaymentCtrl", ["$scope", "$state", "$uibModal", "$timeout", "PaymentRedirect", "PaymentMethod", "SavedPayment", "Order", function(a, b, c, d, e, f, g, h) {
- var i = this,
- j = 100;
- i.paymentMethods = f.query(function() {
- i.paymentMethods = i.paymentMethods.sort(f.sortByPriority), d(i.selectDefault, j)
- }), i.savedPayments = g.query(function() {
- i.savedPayments = i.savedPayments.sort(g.sortByDate), d(i.selectDefault, j)
- }), i.selectPayment = function(a) {
- i.selectedPayment = a
- }, i.selectDefault = function() {
- var a = [];
- i.savedPayments.length && (a = a.concat(i.savedPayments.filter(function(a) {
- return !a.isExpired()
- }))), i.paymentMethods.length && (a = a.concat(i.paymentMethods)), a.length && i.selectPayment(a[0].getFieldsForOrder())
- }, i.placeOrder = function() {
- a.order.paymentStrategyName = i.selectedPayment.paymentStrategyName, a.order.paymentOptions = i.selectedPayment.paymentOptions, h.create(a.order, function(a) {
- console.log("Order create result", a);
- var b = a.paymentOptions,
- c = a.paymentResult;
- return c && c.paymentStatus === h.paymentStatuses.FAILED ? (i.showError = !0, i.error = c.responseStatus, i.errorMessage = c.responseMessage, void(i.paymentFailed = !0)) : void e.redirect(b)
- }, function(a) {
- i.error = a.data && a.data.message || a.statusText || a.status || "Unknown", i.showError = !0, console.error(a)
- })
- }, i.dismissError = function() {
- i.showError = !1
- }, i.removeSavedPayment = function(a) {
- var b = c.open({
- animation: !0,
- templateUrl: "templates/directives/card-delete.html",
- size: "lg",
- resolve: {
- card: function() {
- return a
- }
- },
- controller: ["card", function(a) {
- this.card = a
- }],
- controllerAs: "MC"
- });
- b.result.then(function(b) {
- b && a.$delete(function() {
- i.savedPayments.splice(i.savedPayments.indexOf(a), 1)
- }, function(a) {
- console.error(a)
- })
- })
- }, i.renewSavedPayment = function(a) {
- i.selectedPayment = {
- paymentStrategyName: a.createdByStrategy
- }, a.$delete(function() {
- i.placeOrder()
- }, function(a) {
- console.error(a)
- })
- }
- }])
- }(window.angular),
- function(a) {
- "use strict";
- a.module("sdl").factory("PaymentMethod", ["$resource", function(a) {
- var b = a("/clientapi/payments/getStrategies");
- return b.sortByPriority = function(a, b) {
- return a.priority > b.priority ? 1 : -1
- }, b.prototype.getFieldsForOrder = function() {
- return this.fieldsForOrder = this.fieldsForOrder || {
- paymentStrategyName: this.name,
- paymentOptions: {}
- }, this.fieldsForOrder
- }, b
- }])
- }(window.angular),
- function(a) {
- "use strict";
- a.module("sdl").factory("SavedPayment", ["$resource", "CardTypeService", function(a, b) {
- var c = a("/clientapi/clients/my/cards/:id", {
- id: "@id"
- }, {
- "delete": {
- method: "delete",
- params: {
- strategyName: "@strategyName"
- }
- }
- });
- return c.sortByDate = function(a, b) {
- return a.createdAt > b.createdAt ? 1 : -1
- }, c.prototype.getFieldsForOrder = function() {
- return this.fieldsForOrder = this.fieldsForOrder || {
- paymentStrategyName: this.strategyName,
- paymentOptions: {
- cardId: this.id
- }
- }, this.fieldsForOrder
- }, c.prototype.getType = function() {
- return this.type = this.type || b.getCardType(this.cardNumber), this.type
- }, c.prototype.isExpired = function() {
- return moment(this.savingCodeExpire).add(1, "months").isBefore(moment())
- }, c.prototype.getExpireDate = function() {
- return this.cachedExpireDate ? this.cachedExpireDate : (this.cachedExpireDate = moment(this.savingCodeExpire).add(1, "months").toDate(), this.cachedExpireDate)
- }, c
- }])
- }(window.angular),
- function() {
- "use strict";
- angular.module("sdl").controller("WorkdaysController", ["$scope", "$q", "UpdateWorkdayScope", "staticConfig", function(a, b, c, d) {
- angular.extend(a, {
- thumbPath: ["/", d.bucketName, d.menuThumbPath, ""].join("/"),
- imgPath: ["/", d.bucketName, d.menuImagePath, ""].join("/"),
- getWorkdays: c
- }), a.getWorkdays(a)
- }]).controller("AuthCtrl", ["$scope", "staticConfig", "FlashMessage", function(a, b, c) {
- var d = this;
- d.numberRegex = new RegExp(b.numberRegex), d.formErrors = c.getFormErrors(), a.formSubmit = function(b, c) {
- var d = angular.element(document.getElementById(b)),
- e = d.attr("ng-action");
- c = c || a.$eval(b), d.attr("action", e), c.$valid ? d[0].submit() : d.removeAttr("action")
- }
- }]).controller("OrderCtrl", ["$scope", "$stateParams", "Order", "b64", function(a, b, c, d) {
- a.order = c.build(), b.menus && (a.order.menus = d.b64_to_obj(b.menus), a.hashedMenus = b.menus, a.$watch("order.menus", function(b) {
- a.hashedMenus = d.obj_to_b64(b)
- }, !0)), b.address && (a.order.address = b.address), a.makeOrder = function() {
- window.location = "/initOrder?menus=" + d.obj_to_b64(a.order.menus)
- }, a.orderHasMainMenus = function() {
- return a.order && a.menus && a.order.hasMainMenus(a.menus)
- }, a.getWorkdays(a)
- }]).controller("MainCtrl", ["$scope", "$state", "$filter", "Lightbox", "ResponsiveDetection", function(a, b, c, d, e) {
- a.isCollapsed = !1;
- c("sortMenus")(a.menus).map(function(b) {
- return {
- url: b.picture ? a.imgPath + b.picture : "/images/nopic.gif",
- caption: b.name
- }
- });
- a.openLightboxModal = function(a, b, f) {
- if ("xs" !== e.getBreakpoint()) {
- var g = c("sortMenus")(b).map(function(a) {
- return {
- url: a.picture ? f + a.picture : "/images/nopic.gif",
- caption: a.name
- }
- });
- d.openModal(g, a)
- }
- }, a.hideNavbarBasedOnState = function() {
- return b.includes("orders.selectAddress") || b.includes("orders.delivery") || b.includes("orders.selectPayment") || b.includes("orderprocessed") || b.includes("auth") || b.includes("welcome") || b.includes("orders.cancelled")
- }
- }]).controller("LoginCtrl", ["$scope", "$window", function(a) {
- a.formSubmit = function(b) {
- return a.$parent.formSubmit(b, a.$eval(b))
- }
- }]).controller("RegistrationCtrl", ["$scope", function(a) {
- a.formSubmit = function(b) {
- return a.$parent.formSubmit(b, a.$eval(b))
- }
- }]).controller("PasswordRecoveryCtrl", ["$scope", "$state", "$http", function(a, b, c) {
- a.sendCode = function() {
- c.post("/auth/resetCode", {
- phone: a.phone
- }).then(function() {
- a.codeSent = !0, a.numberNotFound = !1, a.smsSendError = !1, a.smsAlreadySent = !1
- })["catch"](function(b) {
- b.status && 404 === b.status ? (a.numberNotFound = !0, a.smsAlreadySent = !1) : 429 === b.status ? (a.smsAlreadySent = !0, a.codeSent = !0) : (a.smsSendError = !0, a.smsAlreadySent = !1), console.error(b)
- })
- }, a.changePassword = function() {
- c.put("/auth/password", {
- phone: a.phone,
- password: a.password,
- passwordConfirm: a.passwordConfirmation,
- key: a.smsCode
- }).then(function() {
- var b = document.createElement("form"),
- c = document.createElement("input"),
- d = document.createElement("input");
- b.action = "/auth/login?next=/auth/passwordUpdated", b.method = "post", c.name = "phone", c.value = a.phone, c.type = "hidden", d.name = "password", d.value = a.password, d.type = "hidden", b.appendChild(c), b.appendChild(d), document.body.appendChild(b), b.submit()
- })["catch"](function(b) {
- b.status && 404 === b.status && (a.invalidCode = !0), console.error(b)
- })
- }
- }]).controller("AddressCtrl", ["$scope", "$state", "Address", function(a, b, c) {
- a.userAddresses = [], c.query(function(b) {
- a.userAddresses = a.userAddresses.concat(b), 1 === a.userAddresses.length && (a.order.address = a.userAddresses[0], a.userAddresses[0].selected = !0), a.addAddress(), 1 === a.userAddresses.length && (a.order.address = a.userAddresses[0], a.userAddresses[0].open = !0, a.userAddresses[0].selected = !0, a.userAddresses[0].isDefault = !0)
- }), a.addAddress = function(b) {
- a.userAddresses.push(b || new c({
- "new": !0,
- geoName: "სხვრმისáƒáƒ›áƒáƒ თი"
- }))
- }, a.removeAddress = function(b) {
- b.id && b.$remove(), a.userAddresses.splice(a.userAddresses.indexOf(b), 1)
- }, a.saveAddress = function(b) {
- b.id ? b.$save().then(function() {
- b.genEdited(), b.selected = !0, a.order.address = b
- })["catch"](function(a) {
- console.error("Fail Saving Adress", a)
- }) : b.$post().then(function() {
- b.genEdited(), b.selected = !0, a.order.address = b
- })["catch"](function(a) {
- console.error("Fail adding Adress", a)
- })
- }, a.switchOnWarnings = function() {
- var b = function() {
- a.order.address.showWarnings = "yes"
- };
- a.$$phase ? a.$applyAsync(b) : a.$apply(b)
- }, a.switchOffWarnings = function() {
- var b = 1e3;
- setTimeout(function() {
- a.$applyAsync(function() {
- a.order.address.showWarnings = !1
- })
- }, b)
- }, a.addressOkay = function() {
- var b = a.order.address;
- return b ? b.open ? Boolean(b.edited && !b.edited.error && b.edited.latlng) : Boolean(b.geoName && b.lat) : !1
- }, a.proceed = function() {
- var c = a.order.address;
- if (!a.order.isEmpty()) {
- if (!a.addressOkay()) return void a.switchOnWarnings();
- c.open && c.edited && (c.lat = c.edited.latlng.lat, c.lng = c.edited.latlng.lng, c.geoName = c.edited.geoName, c.isDefault = c.edited.isDefault, a.saveAddress(c)), b.go("orders.selectPayment", {
- address: c.id
- })
- }
- }
- }]).controller("OrderCancelledCtrl", ["$state", "$stateParams", function(a, b) {
- var c = this;
- c.error = b.error, c.errorMessage = b.errorMessage
- }]).controller("OrderDeliveryCtrl", ["$scope", "$state", "$stateParams", "$anchorScroll", "Order", "OrderService", function(a, b, c, d, e, f) {
- var g = function(d) {
- a.$applyAsync(function() {
- switch (angular.extend(a.order, d), d.deliveryStatus) {
- case e.deliveryStatuses.PROCESSING:
- case e.deliveryStatuses.DELIVERED:
- "orders.delivery.map" === b.current.name && "DELIVERED" !== d.deliveryStatuses ? b.transitionTo("orders.delivery.map", c, {
- reload: "orders.delivery.map",
- inherit: !0,
- notify: !0
- }) : b.go("orders.delivery.map");
- break;
- case e.deliveryStatuses.READY:
- b.go("orders.delivery.wait");
- break;
- case e.deliveryStatuses.FINISHED:
- b.go("orders.delivery.finished");
- break;
- case e.deliveryStatuses.CANCELLED:
- b.go("orders.cancelled", c)
- }
- a.order = d
- })
- },
- h = function() {
- io.socket.get("/clientapi/orders/" + encodeURIComponent(c.id) + "/subscribe"), i()
- },
- i = function() {
- e.get({
- orderId: c.id
- }, function(a) {
- g(a)
- }, function(a) {
- console.error(a), confirm("დáƒáƒ¤áƒ˜áƒ¥áƒ¡áƒ˜áƒ დრშეცდáƒáƒ›áƒ, გვერდის გáƒáƒ“áƒáƒ¡áƒáƒ¢áƒ•áƒ˜áƒ თáƒáƒ“ დáƒáƒáƒáƒ˜áƒ ეთ OK-ს") && window.location.reload()
- })
- };
- a.order = e.build(), a.countPrice = f.countPrice, c.id ? (io.socket.on("order", function(a) {
- g(a.data)
- }), h(), io.socket.on("connect", h), d("order-wait")) : b.go("home"), a.$on("$destroy", function() {
- a.order && io.socket.get("/clientapi/orders/" + encodeURIComponent(a.order.id) + "/unsubscribe")
- })
- }]).controller("OrderDeliveryMapCtrl", ["$scope", "$anchorScroll", function(a, b) {
- var c, d = function() {
- var b, c = new google.maps.LatLngBounds;
- a.driver && a.driver.location && (b = a.driver.location.coordinates, c.extend(new google.maps.LatLng(b[1], b[0]))), a.order && a.order.lat && c.extend(new google.maps.LatLng(a.order.lat, a.order.lng)), a.map && a.map.fitBounds(c)
- };
- c = function() {
- a.order && a.order.driver && (a.driverId = a.order.driver.id || a.order.driver, io.socket.get("/clientapi/drivers/" + encodeURIComponent(a.driverId) + "/subscribe", function(c, e) {
- c && a.$applyAsync(function() {
- a.driver = c, b("delivery-map"), d()
- })
- }))
- }, io.socket.on("driverworkday", function(b) {
- b.data && a.$applyAsync(function() {
- a.driver ? angular.extend(a.driver, b.data) : a.driver = b.data
- })
- }), io.socket.on("connect", c), c(), a.$on("$destroy", function() {
- a.driverId && io.socket.get("/clientapi/drivers/" + encodeURIComponent(a.driverId) + "/unsubscribe")
- })
- }]).controller("KitchenCtlr", function() {
- var a = this,
- b = a.slides = [],
- c = 6;
- a.addSlide = function() {
- b.push({
- image: "../images/kitchen/kitchen" + d + ".jpg",
- index: d
- })
- };
- for (var d = 0; c > d; d++) a.addSlide()
- }).controller("PaymentSuccessCtrl", ["$scope", "$stateParams", "$state", "$http", function(a, b, c, d) {
- var e = decodeURIComponent(b.trans_id);
- d.get("/api/transactions/checkStatus/" + encodeURIComponent(e)).then(function(a) {
- c.go("orders.delivery.wait", {
- id: a.data.orderId
- })
- }, function(a, b) {
- console.error("ERROR Geting transaction status", a), c.go("orderprocessed.fail", {
- trans_id: e,
- error: "TRANSACTION_FAILED"
- })
- })
- }]).controller("PaymentFailCtrl", ["$scope", "$stateParams", "$http", function(a, b, c) {
- var d = this,
- e = decodeURIComponent(b.trans_id),
- f = {
- CANNOT_CREATE_ORDER: "შეკვეთის მიღებრვერმáƒáƒ®áƒ”რხდáƒ",
- TRANSACTION_FAILED: "ტრáƒáƒœáƒ–áƒáƒ¥áƒªáƒ˜áƒ ვერშესრულდáƒ",
- ORDER_CANCELLED: "შეკვეთრგáƒáƒ£áƒ¥áƒ›áƒ”ბულიáƒ",
- "default": "ბáƒáƒœáƒ™áƒ˜áƒ¡ შეცდáƒáƒ›áƒ"
- },
- g = f[b.error || "default"];
- d.errorMessage = g, b.trans_id && c.get("/api/transactions/fail/" + encodeURIComponent(e)).then(function(a) {
- d.errorStatus = a.data && a.data.fail_log && a.data.fail_log.status, d.errorMessage = a.data && a.data.fail_log && a.data.fail_log.message || g, console.error("Transaction faliled", a.data)
- }, function(a, b) {
- d.errorStatus = res.data && res.data.status, d.errorMessage = res.statusText && res.statusText || g, console.error("Failed to check why transaction failed", a, b)
- })
- }]).controller("OrderedMenusCtrl", ["$scope", function(a) {
- var b = this;
- b.sortByMenuQuantity = function(b) {
- return a.order.menus[b.menu] || 0
- }
- }])
- }(),
- function() {
- "use strict";
- angular.module("sdl").directive("sdlQuantity", function() {
- return {
- restrict: "AE",
- scope: {
- min: "=",
- max: "=",
- value: "="
- },
- template: 'რáƒáƒáƒ“ენáƒáƒ‘áƒ:<form class="d-i-b"><button class="btn btn-default btn-number" ng-click="value = value - 1" ng-disabled="value <= vm.min || !value"><i class="icon-minus fs-md"></i></button><input name="quant[0]" class="form-control input-number text-center vertical-middle" min="1" type="number" ng-model="value"><button class="btn btn-default btn-number" ng-click="value = value + 1" ng-disabled="value >= vm.max"><i class="icon-plus fs-md"></i></button></form>',
- controller: ["$scope", "staticConfig", function(a, b) {
- var c = this;
- c.max = Math.min(a.max, b.maxMenuQuantity)
- }],
- controllerAs: "vm"
- }
- }).directive("sdlAddressQuantity", function() {
- return {
- restrict: "AE",
- scope: {
- min: "=",
- max: "=",
- value: "="
- },
- template: '<form><button class="btn btn-default btn-number" ng-click="incValue(-1)" ng-disabled="value <= vm.min || !value"><i class="icon-minus fs-md text-gray"></i></button><span name="quant[0]" class="d-i-b vertical-middle padding-horizontal-xs fs-xlg text-dark" min="1" max="{{ vm.max }}" type="number" ng-model="value"> {{value || 0}}</span><button class="btn btn-default btn-number" ng-click="incValue(1)" ng-disabled="value >= vm.max"><i class="icon-plus fs-md text-gray"></i></button></form>',
- controller: ["$scope", "staticConfig", function(a, b) {
- var c = this;
- c.max = Math.min(a.max, b.maxMenuQuantity), a.incValue = function(b) {
- a.$applyAsync(function() {
- a.value = (a.value || 0) + b
- })
- }
- }],
- controllerAs: "vm"
- }
- }).directive("sdlGallery", function() {
- return {
- restrict: "EA",
- scope: {
- slides: "=sdlGallery"
- },
- templateUrl: "/templates/directives/sdl-gallery.html",
- controller: ["$scope", "$element", "$attrs", function(a, b, c) {
- var d = b[0].getElementsByTagName("thumbs-slider-container")[0],
- e = d.getElementsByTagName("thumbs-slider")[0];
- angular.extend(a, {
- setActive: function(b) {
- a.slides.forEach(function(a) {
- a.active = a.index === b
- })
- },
- moveRight: function() {
- var a = d.clientWidth,
- b = e.clientWidth,
- c = parseInt(e.style.left),
- f = e.children[0].clientWidth,
- g = b - a + c,
- h = c - a;
- c = g >= a ? (h / f | 0) * f : c - g, e.style.left = c + "px"
- },
- moveleft: function() {
- var a = d.clientWidth,
- b = parseInt(e.style.left),
- c = e.children[0].clientWidth,
- f = b + a;
- b = -b >= a ? (f / c | 0) * c : 0, e.style.left = b + "px"
- },
- isHidden: function() {
- var a = d.clientWidth,
- b = e.clientWidth;
- return a > b
- },
- isNotActive: {
- left: function() {
- var a = parseInt(e.style.left);
- return a >= 0
- },
- right: function() {
- var a = parseInt(e.style.left),
- b = d.clientWidth,
- c = e.clientWidth;
- return -(c - b) >= a
- }
- }
- })
- }]
- }
- }).directive("orderPrice", function() {
- return {
- restrict: "AE",
- scope: {
- orderPrice: "=",
- menus: "=",
- price: "&"
- },
- template: '{{price}}<i class="icon-lari padding-horizontal-xxs fs-md valign-sm"></i>',
- link: function(a, b, c) {
- var d = {},
- e = {},
- f = 0,
- g = function() {
- d.recalculatemenus(e), f = 0;
- var b = {};
- Array.isArray(d.menus) ? d.menus.forEach(function(a) {
- b[a.menu] = a.quantity
- }) : b = d.menus, d.menus && Array.isArray(e) && e.filter(function(a) {
- return !!b[a.menu]
- }).forEach(function(a) {
- f += a.price * b[a.menu]
- }), a.$applyAsync(function() {
- a.price = f / 100
- })
- };
- a.$watch("orderPrice", function(a) {
- d = a, g()
- }, !0), a.$watchCollection("menus", function(a) {
- e = a, g()
- })
- }
- }
- }).directive("flash", ["FlashMessage", function(a) {
- return {
- require: "ngModel",
- scope: {
- ngModel: "="
- },
- link: function(b, c, d, e) {
- e.$validators.flash = function(b, c) {
- var f = a.getError(d.name);
- return f && e.$pristine ? (e.$error.message = f, !1) : (delete e.$error.message, !0)
- };
- var f = a.getValue(d.name);
- f && (e.$modelValue = f, b.ngModel = f)
- }
- }
- }]).directive("uniqPhone", ["Customer", function(a) {
- return {
- require: "ngModel",
- link: function(b, c, d, e) {
- e.$asyncValidators.uniqPhone = function(b) {
- return a.hasUniquePhone(b)
- }
- }
- }
- }]).directive("addressMap", function() {
- return {
- restrict: "E",
- scope: {
- address: "="
- },
- template: '<ng-map style="height: 400px !important;" default-style="false"></ng-map><div class="pinpoint"></div><button class="myLocation no-border z1" ng-click="locate()"></button>',
- controller: ["$scope", "$q", "geoCode", "Settings", "GeoJsonHelper", function(a, b, c, d, e) {
- var f = function(b) {
- var c = new google.maps.LatLng(b.lat, b.lng),
- d = !0;
- return a.restrict.polygons.length ? (a.restrict.polygons.forEach(function(a) {
- google.maps.geometry.poly.containsLocation(c, a) && (d = !1)
- }), d) : !1
- },
- g = function(b) {
- a.$applyAsync(function() {
- a.address.error = b
- })
- },
- h = function(b) {
- a.$applyAsync(function() {
- a.address.geoName = b
- })
- },
- i = function() {
- return a.map.getZoom() < a.restrict.zoom ? (g("დáƒáƒáƒ–უსტეთ მისáƒáƒ›áƒáƒ თი (Zoom in)"), !1) : !0
- },
- j = function() {
- a.address.latlng.lat = a.map.center.lat(), a.address.latlng.lng = a.map.center.lng(), f(a.address.latlng) ? g("მხáƒáƒšáƒáƒ“ თბილისის ფáƒáƒ გლებში") : (g(!1), c.reverse({
- lat: a.address.latlng.lat,
- lng: a.address.latlng.lng
- }, function(b) {
- i() && !f(a.address.latlng) && g(!1), h(b ? b : a.address.latlng.lat + "," + a.address.latlng.lng)
- }))
- },
- k = function() {
- i() && j()
- };
- a.locate = function() {
- navigator.geolocation.getCurrentPosition(function(b) {
- a.$apply(function() {
- a.address.latlng.lat = b.coords.latitude, a.address.latlng.lng = b.coords.longitude, a.map.setCenter(a.address.latlng), a.map.setZoom(a.restrict.zoom)
- })
- })
- };
- var l = b.defer(),
- m = b.defer();
- b.all([l.promise, m.promise]).then(function() {
- a.map.setCenter(a.address.latlng), a.map.setZoom(a.address.zoom), a.map.addListener("center_changed", k), a.map.addListener("zoom_changed", k);
- for (var b in a.restrict.polygons) a.restrict.polygons[b] = new google.maps.Polygon(a.restrict.polygons[b]), a.restrict.polygons[b].setMap(a.map);
- a.address["new"] && a.locate(), k()
- }), d.getDefault().then(function(b) {
- a.restrict = {
- zoom: 18
- };
- var c = e.multiPolyToPolyArray(b.servingArea);
- a.restrict.polygons = c.map(function(a) {
- return {
- paths: a,
- fillColor: "#440044",
- fillOpacity: .1,
- strokeColor: "#550011",
- strokeOpacity: .7,
- strokeWeight: 2
- }
- }), l.resolve()
- }), a.$on("mapInitialized", function(b, c) {
- a.map = c, m.resolve(c)
- })
- }]
- }
- }).directive("addressRow", function() {
- return {
- restrict: "EA",
- scope: {
- address: "=",
- selectedAddress: "="
- },
- templateUrl: "/templates/directives/address-row.html",
- controller: ["$scope", function(a) {
- a.randomImage = 6 * Math.random() | 0, a.commitAddress = function() {
- return a.address.edited.error ? !1 : (a.address["new"] && a.addAddress(), a.address.lat = a.address.edited.latlng.lat, a.address.lng = a.address.edited.latlng.lng, a.address.geoName = a.address.edited.geoName, a.address.isDefault = a.address.edited.isDefault, a.address["new"] = !1, a.address.selected = !0, a.selectedAddress = a.address, a.saveAddress(), !0)
- }, a.resetAddress = function() {
- return a.address.edited = {
- latlng: {
- lat: a.address.lat || 41.72554013514525,
- lng: a.address.lng || 44.74450071978755
- },
- zoom: 18,
- isDefault: a.address.isDefault,
- geoName: a.address.geoName,
- "new": a.address["new"],
- id: a.address.id || "new"
- }, !0
- }, a.resetAddress(), a.addAddress = function() {
- a.$parent.addAddress()
- }, a.removeAddress = function() {
- a.$parent.removeAddress(a.address), a.address.selected && (a.selectedAddress.geoName = null)
- }, a.saveAddress = function() {
- a.$parent.saveAddress(a.address)
- }, a.selectAddress = function() {
- a.address["new"] && (a.address.open = !0), a.address.selected = !0, a.selectedAddress = a.address
- }, a.toggleOpen = function(b) {
- a.address.open = !a.address.open, b && b.stopPropagation()
- }, a.address.selected && (a.selectedAddress = a.address), a.address.isDefault && a.selectAddress()
- }]
- }
- }).directive("autoFillSync", function(a) {
- return {
- require: "ngModel",
- link: function(b, c, d, e) {
- var f = c.val();
- a(function() {
- var a = c.val();
- e.$pristine && f !== a && e.$setViewValue(a)
- }, 500)
- }
- }
- }).directive("workArea", function() {
- return {
- restrict: "AE",
- scope: {
- address: "="
- },
- template: '<ng-map class="padding-msm-right-xlg" style="height: 600px !important;" center="41.72793381699124, 44.76327871692967" zoom="13" default-style="false"><shape paths="{{polygon}}" name="polygon" stroke-color="#f9d200" stroke-opacity="1" stroke-weight="2" fill-color="#f9d200" fill-opacity="0.6" ></shape>',
- controller: ["$scope", "$q", "Settings", "GeoJsonHelper", function(a, b, c, d) {
- c.getDefault().then(function(b) {
- a.polygon = d.multiPolyToPolyArray(b.servingArea)[0]
- })
- }]
- }
- })
- }(),
- function() {
- "use strict";
- angular.module("sdl").factory("Menu", ["$resource", function(a) {
- var b = a("/api/menus", {}, {
- get: {
- method: "GET",
- isArray: !0
- }
- });
- return angular.extend(b.prototype, {}), b
- }]).factory("Address", ["$resource", function(a) {
- var b = [44.74450071978755, 41.72554013514525],
- c = 18,
- d = a("/api/me/address/:addressId", {
- addressId: "@id"
- }, {
- save: {
- method: "PUT"
- },
- post: {
- method: "POST"
- }
- });
- return d.prototype.genEdited = function() {
- this.edited = {
- latlng: {
- lat: this.lat || b[1],
- lng: this.lng || b[0]
- },
- zoom: c,
- isDefault: this.isDefault,
- geoName: this.geoName,
- "new": this["new"],
- id: this.id || "new"
- }
- }, d
- }]).factory("Workday", ["$resource", function(a) {
- return a("/api/workdays/:workdayId", {
- workdayId: "@id"
- }, {})
- }]).factory("Customer", ["$http", "$q", function(a, b) {
- return {
- hasUniquePhone: function(c) {
- var d = b.defer();
- return a.get("/api/customer/checkPhone/" + c).then(function(a) {
- d.reject(a.body)
- }, function(a, b) {
- d.resolve()
- }), d.promise
- }
- }
- }]).factory("Settings", ["$http", function(a) {
- return {
- getDefault: function() {
- return a.get("/api/settings/default").then(function(a) {
- return a.data
- })
- }
- }
- }]).factory("Order", ["$resource", "staticConfig", function(a, b) {
- var c = a("/clientapi/orders/:orderId", {
- orderId: "@id"
- }, {
- create: {
- method: "POST"
- }
- });
- return c.deliveryStatuses = {
- INIT: "INIT",
- READY: "READY",
- PROCESSING: "PROCESSING",
- CANCELLED: "CANCELLED",
- DELIVERED: "DELIVERED",
- FINISHED: "FINISHED"
- }, c.paymentStatuses = {
- OK: "OK",
- FAILED: "FAILED",
- WAIT: "WAIT",
- CANCELLED: "CANCELLED",
- REFUNDED: "REFUNDED",
- FINISHED: "FINISHED"
- }, angular.extend(c.prototype, {
- isEmpty: function() {
- var a;
- for (a in this.menus)
- if (a && this.menus.hasOwnProperty(a) && this.menus[a] > 0) return !1;
- return !0
- },
- getMenusQuantity: function() {
- var a, b = this.menus,
- c = 0;
- for (a in b) b.hasOwnProperty(a) && (c += b[a]);
- return c
- },
- hasMainMenus: function(a) {
- var b, c, d, e = ["MD", "SP", "SL", "FD"],
- f = this.menus,
- g = a.length,
- h = !1;
- for (b in f)
- if (f.hasOwnProperty(b))
- for (c = 0; g > c; c++)
- if (b === a[c].menu && (d = a[c].category, d && e.indexOf(d) > -1)) {
- h = !0;
- break
- }
- return h
- },
- recalculatemenus: function(a) {
- var c, d, e, f, g = this.menus,
- h = a ? a.length || 0 : 0;
- if (!this.id && g && a && a.length)
- for (c in g) {
- if (d = !1, g.hasOwnProperty(c))
- for (e = 0; h > e; e++)
- if (c === a[e].menu) {
- f = Math.min(a[e].quantity, a[e].templateQuantity, b.maxMenuQuantity), d = !0, "number" != typeof g[c] && (g[c] = f), g[c] = Math.min(g[c], f), g[c] <= 0 && delete g[c];
- break
- }
- d || delete g[c]
- }
- }
- }), c.build = function(a) {
- return new c({
- menus: a && a.menus || {},
- address: a && a.address || {}
- })
- }, c
- }])
- }(),
- function() {
- "use strict";
- var a = {
- MD: 0,
- FD: 1,
- SL: 2,
- SP: 3,
- DS: 4,
- PB: 5,
- BV: 6,
- DEF: 7
- },
- b = 3;
- angular.module("sdl").filter("sortMenus", [function() {
- return function(b) {
- var c = b ? b.slice() : [];
- return c.sort(function(b, c) {
- return b.category === c.category ? b.sid > c.sid ? 1 : -1 : a[b.category || "DEF"] > a[c.category || "DEF"] ? 1 : -1
- }), c
- }
- }]).filter("mainMenus", [function() {
- return function(c) {
- return c.filter(function(c) {
- return a[c.category || "DEF"] <= b
- })
- }
- }]).filter("byObjectKeysName", [function() {
- return function(a, b, c) {
- return a.filter(function(a) {
- return b[a[c]]
- })
- }
- }]).filter("c2d", function() {
- return function(a) {
- return (a / 100).toFixed(2)
- }
- })
- }(),
- function() {
- "use strict";
- angular.module("sdl").service("geoCode", ["$http", "$q", function(a, b) {
- var c, d, e, f = 800;
- return {
- reverse: function(a, b) {
- e || (e = new google.maps.Geocoder), d = a, c || (c = setTimeout(function() {
- e.geocode({
- location: d
- }, function(a, d) {
- d === google.maps.GeocoderStatus.OK ? b(a[0].formatted_address) : (console.error("Error rev geoc", d), b()), c = null
- })
- }, f))
- }
- }
- }]).service("GeoJsonHelper", function() {
- return {
- multiPolyToPolyArray: function(a) {
- return a.coordinates.map(function(a) {
- return a[0].map(function(a) {
- return {
- lat: a[1],
- lng: a[0]
- }
- })
- })
- }
- }
- }).service("OrderService", [function() {
- return {
- countPrice: function(a, b) {
- var c = 0;
- return b.filter(function(b) {
- return !!a.menus[b.id]
- }).forEach(function(b) {
- c += b.price * a.menus[b.id]
- }), c
- }
- }
- }]).factory("config", ["$http", "staticConfig", function(a, b) {
- var c = b,
- d = function() {
- a.get("/api/config/1").then(function(a) {
- c = a.data
- })
- };
- return d(), {
- get: function(a) {
- return d(), c[a] || ""
- },
- load: function() {
- d()
- }
- }
- }]).service("b64", [function() {
- var a = function(a) {
- try {
- return window.btoa(unescape(encodeURIComponent(JSON.stringify(a))))
- } catch (b) {
- console.error(b)
- }
- },
- b = function(a) {
- try {
- return JSON.parse(decodeURIComponent(escape(window.atob(a))))
- } catch (b) {
- console.error(b)
- }
- };
- return {
- obj_to_b64: a,
- b64_to_obj: b
- }
- }]).service("DateTimeService", function() {
- var a = (new Date, ["კვი", "áƒáƒ შ", "სáƒáƒ›", "áƒáƒ—ხ", "ხუთ", "პáƒáƒ ", "შáƒáƒ‘"]),
- b = function() {
- var a = new Date;
- return a.setUTCHours(0), a.setUTCMinutes(0), a.setUTCSeconds(0), a.setUTCMilliseconds(0), a
- },
- c = function(b) {
- var c, d, e, f, g, h, i, j = [],
- k = "";
- for (b.map(function(a) {
- a.isWorkDay && j.push(new Date(a.id).getDay())
- }), c = 0, d = j.length; d > c; c++) e = j[c], f = j[c - 1], g = j[c + 1], h = e - f, i = g - e, 1 === h && 1 === i || (k && k.lastIndexOf("-") !== k.length - 2 && k.lastIndexOf(",") !== k.length - 2 && (k += ", "), k += a[e]), i > 1 ? k += ", " : 1 === i && k.lastIndexOf("-") !== k.length - 2 && (k += " - ");
- return k + ":"
- },
- d = function(a) {
- return a.filter(function(a) {
- return a.id.getTime() === b().getTime()
- })[0]
- },
- e = function(a, c) {
- var d = a.filter(function(a) {
- return new Date(a.id).getTime() > b().getTime() && a.isWorkDay
- }).sort(function(a, b) {
- return new Date(a.id) - new Date(b.id)
- });
- return d && d[0]
- },
- f = function(a, b, c) {
- var d = e(a, b),
- f = 3600 * c * 1e3;
- return d.start <= new Date(Date.now() + f)
- },
- g = function(a, c) {
- var d = new Date,
- f = e(a, c),
- g = f && f.id;
- return d.getTime() <= c.start.getTime() ? 0 : Math.floor((+g - +b()) / 864e5)
- },
- h = function(a) {
- var b = new Date;
- return a.isWorkDay && +b >= +a.start && +b < +a.end
- },
- i = function(a) {
- var b = new Date;
- return a.isWorkDay && +b > +a.end
- },
- j = function(b, c) {
- var d = new Date,
- f = d.getTime() <= c.start.getTime() ? c.start : e(b, c).start;
- return {
- name: a[f.getDay()],
- start: f
- }
- },
- k = function(a, b) {
- var c = 0;
- return a.menus && b ? c = a.menus.filter(function(a) {
- return a.id === b
- }).map(function(a) {
- return a.quantity
- })[0] : a.menus && a.menus.forEach(function(a) {
- c += a.quantity
- }), c
- };
- return {
- generateNowDate: b,
- getWorkDaysPeriod: c,
- getToday: d,
- getClosestWorkDayNameAndStart: j,
- todayWorkdayIsOver: i,
- getNextWorkDay: e,
- daysBeforeNextWorkDay: g,
- isOpenHours: h,
- nextWorkdayStartsInHours: f,
- menusLeft: k
- }
- }).service("UpdateWorkdayScope", ["$q", "Workday", "DateTimeService", "staticConfig", function(a, b, c, d) {
- return function(e) {
- var f = a.defer();
- return b.query(function(a) {
- a.forEach(function(a) {
- a.id = new Date(a.id), a.start = new Date(a.start), a.end = new Date(a.end)
- }), e.$applyAsync(function() {
- e.workDays = a, e.workWeek = c.getWorkDaysPeriod(a), e.today = c.getToday(a), e.nextWorkDay = c.getNextWorkDay(a, e.today), e.willWorkAt = c.getClosestWorkDayNameAndStart(a, e.today), e.daysBeforeNextWorkDay = c.daysBeforeNextWorkDay(a, e.today), e.todayWorkdayIsOver = c.todayWorkdayIsOver(e.today), e.todaysmenusLeft = c.menusLeft(e.today), e.nextWorkDaysmenusLeft = c.menusLeft(e.nextWorkDay), e.menusLeft = c.menusLeft, e.isOpenHours = c.isOpenHours(e.today), e.isOpen = e.isOpenHours && e.todaysmenusLeft, e.workDaysPeriod = c.getWorkDaysPeriod, e.nextWorkdayStartsSoon = c.nextWorkdayStartsInHours(a, e.today, d.hideNextWorkdayMenusUntil), e.todaysmenusLeft && !e.todayWorkdayIsOver ? e.menus = e.today.menus : e.nextWorkdayStartsSoon ? e.menus = e.nextWorkDay.menus : e.menus = e.today.menus
- }), f.resolve(e.menus)
- }, function(a, b) {
- console.error(a, b), f.reject(a)
- }), f.promise
- }
- }]).factory("ResponsiveDetection", ["$window", function(a) {
- return {
- getBreakpoint: function() {
- var b = a.innerWidth;
- return 768 > b ? "xs" : "lg"
- }
- }
- }]).service("FlashMessage", function() {
- var a = {
- formErrors: []
- },
- b = {};
- return {
- setFlashErrors: function(b) {
- b.forEach(function(b) {
- "string" == typeof b ? a.formErrors.push(b) : a[b.field] = b.message
- })
- },
- setFlashValues: function(a) {
- b = a[0] || {}
- },
- getFormErrors: function() {
- return a.formErrors
- },
- getFlashValues: function() {
- return b
- },
- getError: function(b) {
- return a[b]
- },
- getValue: function(a) {
- return b[a]
- },
- clearError: function(b) {
- delete a[b]
- }
- }
- })
- }(),
- function(a) {
- "use strict";
- a.module("sdl").service("BankResponse", [function() {
- var a = {},
- b = "FAIL";
- return {
- setPaymentStrategyName: function(b) {
- a.paymentStrategyName = b
- },
- setTransId: function(b) {
- a.trans_id = b
- },
- setPaymentId: function(b) {
- a.paymentId = b
- },
- setResponseStatus: function(b) {
- a.responseStatus = b
- },
- setError: function(b) {
- a.error = b
- },
- getPaymentStrategyName: function() {
- return a.paymentStrategyName
- },
- getTransId: function() {
- return a.trans_id
- },
- getPaymentId: function() {
- return a.paymentId
- },
- getResponseStatus: function() {
- return a.responseStatus
- },
- getError: function() {
- return a.error
- },
- isFailed: function() {
- return a.responseStatus === b
- },
- getBankResponse: function() {
- return a
- }
- }
- }])
- }(window.angular),
- function(a) {
- "use strict";
- a.module("sdl").service("CardTypeService", [function() {
- var a = [{
- icon: "visa",
- name: "Visa",
- regex: /^4/
- }, {
- icon: "mc",
- name: "MasterCard",
- regex: /^5/
- }, {
- icon: "amex",
- name: "American Express",
- regex: /^3/
- }],
- b = a[1];
- return {
- getCardType: function(c) {
- return a.filter(function(a) {
- return a.regex.test(c)
- })[0] || b
- }
- }
- }])
- }(window.angular),
- function(a, b) {
- "use strict";
- b.module("sdl").service("PaymentRedirect", [function() {
- return {
- redirect: function(b) {
- var c = a.createElement("form");
- c.action = b.redirectUrl, c.method = "post";
- for (var d in b.redirectFields)
- if (b.redirectFields.hasOwnProperty(d)) {
- var e = a.createElement("input");
- e.name = d, e.type = "hidden", e.value = b.redirectFields[d], c.appendChild(e)
- }
- a.body.appendChild(c), c.submit()
- }
- }
- }])
- }(window.document, window.angular),
- function(a) {
- "use strict";
- a.module("sdl").service("PaymentService", ["$http", function(a) {
- var b = function(a) {
- if (200 !== a.status) throw {
- code: a.status,
- message: "Error"
- };
- return a.data
- };
- return {
- checkByBankResponse: function(a) {
- return a.paymentId ? this.check(a.paymentId) : this.checkByTransId(a.trans_id, a.paymentStrategyName)
- },
- failByBankResponse: function(a) {
- return this.failByTransId(a.trans_id, a.error)
- },
- check: function(c) {
- return a.post("/clientapi/payments/check", {
- paymentId: c
- }).then(b)
- },
- checkByTransId: function(c, d) {
- return a.post("/clientapi/payments/check", {
- trans_id: c,
- paymentStrategyName: d
- }).then(b)
- },
- failByTransId: function(c, d) {
- return a.post("/clientapi/tbcPayments/failTransaction", {
- trans_id: c,
- error: d
- }).then(b)
- }
- }
- }])
- }(window.angular),
- function(a) {
- "use strict";
- window.angular.module("sdl").provider("gaEvent", [function() {
- var a = window.location;
- this.sendEvent = function(a, b, c, d) {
- var e = e || window.ga,
- f = {
- hitType: "event",
- eventCategory: a,
- eventAction: b
- };
- e && (d || "number" != typeof c || (d = c, c = null), c && (f.eventLabel = c), d && (f.eventValue = d), e("send", f))
- }, this.sendPageview = function(b) {
- var c = c || window.ga,
- d = {
- hitType: "pageview",
- page: b || a.pathname || ""
- };
- c && c("send", d)
- }, this.$get = function() {
- return {
- sendEvent: this.send,
- sendPageview: this.sendPageview
- }
- }
- }])
- }(window),
- function(a) {
- "use strict";
- a.angular.module("sdl").provider("zopim", [function() {
- this.init = function() {
- a.$zopim || function(b, c) {
- var d = a.$zopim = function(a) {
- d._.push(a)
- },
- e = d.s = b.createElement(c),
- f = b.getElementsByTagName(c)[0];
- d.set = function(a) {
- d.set._.push(a)
- }, d._ = [], d.set._ = [], e.async = !0, e.setAttribute("charset", "utf-8"), e.src = "//v2.zopim.com/?32rKnPxWbSjIPoDvfUQpEi0xAF90cOfe", d.t = +new Date, e.type = "text/javascript", f.parentNode.insertBefore(e, f)
- }(document, "script")
- }, this.$get = function() {
- return {
- init: this.init
- }
- }
- }])
- }(window);
Add Comment
Please, Sign In to add comment