| 1151 | return t2 && (this._url = t2), this.fetch(this._url).then((t3) => this.parse(t3)); |
| 1152 | } |
| 1153 | parse(t2) { |
| 1154 | const { key: e, websocket: s } = t2; |
| 1155 | e && (this._token = t2.key); |
| 1156 | for (const e2 in t2.data) |
| 1157 | this.data[e2] = t2.data[e2]; |
| 1158 | for (const e2 in t2.api) { |
| 1159 | const s2 = this.api[e2] = {}, i = t2.api[e2]; |
| 1160 | for (const t3 in i) |
| 1161 | s2[t3] = this._wrapper(e2 + "." + t3); |
| 1162 | } |
| 1163 | return s && this.connect(), this; |
| 1164 | } |
| 1165 | connect() { |
| 1166 | const t2 = this._socket; |
| 1167 | t2 && (this._socket = null, t2.onclose = function() { |