Boto/www/tmi.min.js

1 line
48 KiB
JavaScript
Raw Normal View History

2022-02-13 03:43:04 +00:00
!function s(o,i,r){function a(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return a(o[t][1][e]||e)},n,n.exports,s,o,i,r)}return i[t].exports}for(var c="function"==typeof require&&require,e=0;e<r.length;e++)a(r[e]);return a}({1:[function(e,t,n){"use strict";e=e("./lib/client");t.exports={client:e,Client:e}},{"./lib/client":3}],2:[function(e,t,n){"use strict";function i(t,e){var n,s=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,n)),s}function u(s){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?i(Object(o),!0).forEach(function(e){var t,n;t=s,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(o,e))})}return s}var l=e("node-fetch"),m=e("./utils");t.exports=function(e,t){var n=void 0!==e.url?e.url:e.uri;if(m.isURL(n)||(n="https://api.twitch.tv/kraken".concat("/"===n[0]?n:"/".concat(n))),m.isNode()){var s=Object.assign({method:"GET",json:!0},e);s.qs&&(o=new URLSearchParams(s.qs),n+="?".concat(o));var o={};"fetchAgent"in this.opts.connection&&(o.agent=this.opts.connection.fetchAgent);var o=l(n,u(u({},o),{},{method:s.method,headers:s.headers,body:s.body})),i={};o.then(function(e){return i={statusCode:e.status,headers:e.headers},s.json?e.json():e.text()}).then(function(e){return t(null,i,e)},function(e){return t(e,i,null)})}else{var r,a=Object.assign({method:"GET",headers:{}},e,{url:n}),c=new XMLHttpRequest;for(r in c.open(a.method,a.url,!0),a.headers)c.setRequestHeader(r,a.headers[r]);c.responseType="json",c.addEventListener("load",function(e){4===c.readyState&&(200!==c.status?t(c.status,null,null):t(null,null,c.response))}),c.send()}}},{"./utils":9,"node-fetch":10}],3:[function(p,d,e){!function(f){!function(){"use strict";function t(t,e){var n,s=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,n)),s}function i(s){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?t(Object(o),!0).forEach(function(e){var t,n;t=s,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(o,e))})}return s}function H(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function n(e){if(this instanceof n==!1)return new n(e);this.opts=V.get(e,{}),this.opts.channels=this.opts.channels||[],this.opts.connection=this.opts.connection||{},this.opts.identity=this.opts.identity||{},this.opts.options=this.opts.options||{},this.clientId=V.get(this.opts.options.clientId,null),this._globalDefaultChannel=V.channel(V.get(this.opts.options.globalDefaultChannel,"#tmijs")),this._skipMembership=V.get(thi