| 582 | return i && (this._url = i), this.fetch(this._url).then((t) => this.parse(t)); |
| 583 | } |
| 584 | parse(i) { |
| 585 | const { key: t, websocket: n } = i; |
| 586 | t && (this._token = i.key); |
| 587 | for (const s in i.data) |
| 588 | this.data[s] = i.data[s]; |
| 589 | for (const s in i.api) { |
| 590 | const a = this.api[s] = {}, o = i.api[s]; |
| 591 | for (const _ in o) |
| 592 | a[_] = this._wrapper(s + "." + _); |
| 593 | } |
| 594 | return n && this.connect(), this; |
| 595 | } |
| 596 | connect() { |
| 597 | const i = this._socket; |
| 598 | i && (this._socket = null, i.onclose = function() { |