beautify everything

This commit is contained in:
vel 2022-01-30 15:52:16 -08:00
parent 14ae810d4c
commit 6e2b6ca024
Signed by: velvox
GPG Key ID: 1C8200C1D689CEF5
23 changed files with 21343 additions and 237 deletions

View File

@ -1,154 +1,154 @@
(function () { (function() {
'use strict'; 'use strict';
function captureEvents(events) { function captureEvents(events) {
const captured = events.map(captureEvent); const captured = events.map(captureEvent);
return () => captured.forEach((t) => t()) return () => captured.forEach((t) => t())
function captureEvent(event) { function captureEvent(event) {
let isCapturePhase = true; let isCapturePhase = true;
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
const callbacks = new Map(); const callbacks = new Map();
const eventArgs = new Set(); const eventArgs = new Set();
// This is the only listener for the native event // This is the only listener for the native event
event.addListener(handleEvent); event.addListener(handleEvent);
function handleEvent(...args) { function handleEvent(...args) {
if (isCapturePhase) { if (isCapturePhase) {
// This is before dynamic import completes // This is before dynamic import completes
eventArgs.add(args); eventArgs.add(args);
if (typeof args[2] === 'function') { if (typeof args[2] === 'function') {
// During capture phase all messages are async // During capture phase all messages are async
return true return true
} else { } else {
// Sync messages or some other event // Sync messages or some other event
return false return false
} }
} else { } else {
// The callbacks determine the listener return value // The callbacks determine the listener return value
return callListeners(...args) return callListeners(...args)
} }
}
// Called when dynamic import is complete
// and when subsequent events fire
function callListeners(...args) {
let isAsyncCallback = false;
callbacks.forEach((options, cb) => {
// A callback error should not affect the other callbacks
try {
isAsyncCallback = cb(...args) || isAsyncCallback;
} catch (error) {
console.error(error);
}
});
if (!isAsyncCallback && typeof args[2] === 'function') {
// We made this an async message callback during capture phase
// when the function handleEvent returned true
// so we are responsible to call sendResponse
// If the callbacks are sync message callbacks
// the sendMessage callback on the other side
// resolves with no arguments (this is the same behavior)
args[2]();
}
// Support events after import is complete
return isAsyncCallback
}
// This function will trigger this Event with our stored args
function triggerEvents() {
// Fire each event for this Event
eventArgs.forEach((args) => {
callListeners(...args);
});
// Dynamic import is complete
isCapturePhase = false;
// Don't need these anymore
eventArgs.clear();
}
// All future listeners are handled by our code
event.addListener = function addListener(cb, ...options) {
callbacks.set(cb, options);
};
event.hasListeners = function hasListeners() {
return callbacks.size > 0
};
event.hasListener = function hasListener(cb) {
return callbacks.has(cb)
};
event.removeListener = function removeListener(cb) {
callbacks.delete(cb);
};
event.__isCapturedEvent = true;
return triggerEvents
}
}
function delay(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
})
}
/**
* Get matches from an object of nested objects
*
* @export
* @template T Type of matches
* @param {*} object Parent object to search
* @param {(x: any) => boolean} pred A predicate function that will receive each property value of an object
* @param {string[]} excludeKeys Exclude a property if the key exactly matches
* @returns {T[]} The matched values from the parent object
*/
function getDeepMatches(object, pred, excludeKeys) {
const keys = typeof object === 'object' && object ? Object.keys(object) : [];
return keys.length
? keys
.filter((key) => !excludeKeys.includes(key))
.reduce((r, key) => {
const target = object[key];
if (target && pred(target)) {
return [...r, target]
} else {
return [...r, ...getDeepMatches(target, pred, excludeKeys)]
} }
}, [] )
: []
}
const importPath = /*@__PURE__*/JSON.parse('"../background.js"'); // Called when dynamic import is complete
const delayLength = /*@__PURE__*/JSON.parse('0'); // and when subsequent events fire
const excludedPaths = /*@__PURE__*/JSON.parse('["extension"]'); function callListeners(...args) {
let isAsyncCallback = false;
callbacks.forEach((options, cb) => {
// A callback error should not affect the other callbacks
try {
isAsyncCallback = cb(...args) || isAsyncCallback;
} catch (error) {
console.error(error);
}
});
const events = getDeepMatches( if (!isAsyncCallback && typeof args[2] === 'function') {
chrome, // We made this an async message callback during capture phase
(x) => typeof x === 'object' && 'addListener' in x, // when the function handleEvent returned true
// The webRequest API is not compatible with event pages // so we are responsible to call sendResponse
// TODO: this can be removed // If the callbacks are sync message callbacks
// if we stop using this wrapper with "webRequest" permission // the sendMessage callback on the other side
excludedPaths.concat(['webRequest']), // resolves with no arguments (this is the same behavior)
); args[2]();
const triggerEvents = captureEvents(events); }
import(importPath).then(async () => { // Support events after import is complete
if (delayLength) await delay(delayLength); return isAsyncCallback
}
triggerEvents(); // This function will trigger this Event with our stored args
}); function triggerEvents() {
// Fire each event for this Event
eventArgs.forEach((args) => {
callListeners(...args);
});
// Dynamic import is complete
isCapturePhase = false;
// Don't need these anymore
eventArgs.clear();
}
// All future listeners are handled by our code
event.addListener = function addListener(cb, ...options) {
callbacks.set(cb, options);
};
event.hasListeners = function hasListeners() {
return callbacks.size > 0
};
event.hasListener = function hasListener(cb) {
return callbacks.has(cb)
};
event.removeListener = function removeListener(cb) {
callbacks.delete(cb);
};
event.__isCapturedEvent = true;
return triggerEvents
}
}
function delay(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
})
}
/**
* Get matches from an object of nested objects
*
* @export
* @template T Type of matches
* @param {*} object Parent object to search
* @param {(x: any) => boolean} pred A predicate function that will receive each property value of an object
* @param {string[]} excludeKeys Exclude a property if the key exactly matches
* @returns {T[]} The matched values from the parent object
*/
function getDeepMatches(object, pred, excludeKeys) {
const keys = typeof object === 'object' && object ? Object.keys(object) : [];
return keys.length ?
keys
.filter((key) => !excludeKeys.includes(key))
.reduce((r, key) => {
const target = object[key];
if (target && pred(target)) {
return [...r, target]
} else {
return [...r, ...getDeepMatches(target, pred, excludeKeys)]
}
}, []) :
[]
}
const importPath = /*@__PURE__*/ JSON.parse('"../background.js"');
const delayLength = /*@__PURE__*/ JSON.parse('0');
const excludedPaths = /*@__PURE__*/ JSON.parse('["extension"]');
const events = getDeepMatches(
chrome,
(x) => typeof x === 'object' && 'addListener' in x,
// The webRequest API is not compatible with event pages
// TODO: this can be removed
// if we stop using this wrapper with "webRequest" permission
excludedPaths.concat(['webRequest']),
);
const triggerEvents = captureEvents(events);
import(importPath).then(async () => {
if (delayLength) await delay(delayLength);
triggerEvents();
});
}()); }());

View File

@ -1,8 +1,8 @@
(function () { (function() {
'use strict'; 'use strict';
const importPath = /*@__PURE__*/JSON.parse('"../content/mogultv/index.js"'); const importPath = /*@__PURE__*/ JSON.parse('"../content/mogultv/index.js"');
import(chrome.runtime.getURL(importPath)); import(chrome.runtime.getURL(importPath));
}()); }());

View File

@ -1,8 +1,8 @@
(function () { (function() {
'use strict'; 'use strict';
const importPath = /*@__PURE__*/JSON.parse('"../content/twitch/index.js"'); const importPath = /*@__PURE__*/ JSON.parse('"../content/twitch/index.js"');
import(chrome.runtime.getURL(importPath)); import(chrome.runtime.getURL(importPath));
}()); }());

View File

@ -1,8 +1,8 @@
(function () { (function() {
'use strict'; 'use strict';
const importPath = /*@__PURE__*/JSON.parse('"../content/youtube/index.js"'); const importPath = /*@__PURE__*/ JSON.parse('"../content/youtube/index.js"');
import(chrome.runtime.getURL(importPath)); import(chrome.runtime.getURL(importPath));
}()); }());

View File

@ -1,7 +1,63 @@
import { t } from './index-6137f488.js'; import {
import { s, m } from './storage-a8ac7bd3.js'; t
import { n } from './connectRuntime-a699491c.js'; } from './index-6137f488.js';
import {
s,
m
} from './storage-a8ac7bd3.js';
import {
n
} from './connectRuntime-a699491c.js';
class o extends t{constructor(){super(),this.fetch=async(t,e)=>{const s=Math.random().toString();return this.port.postMessage({nonce:s,path:t,body:e}),new Promise((t=>{const e=a=>{a.meta.nonce===s&&(this.port.onMessage.removeListener(e),t(a));};this.port.onMessage.addListener(e);}))},this.extensionId=s.runtime.id,this.port=this.connectToBackground(),this.port.onMessage.addListener(this.onMessage),window.addEventListener("message",(async t=>{var e,a,o;if(t.source!==window||(null===(e=t.data)||void 0===e?void 0:e.id)!==this.extensionId||"response"===(null===(a=t.data)||void 0===a?void 0:a.type))return;let n;switch(null===(o=t.data)||void 0===o?void 0:o.type){case"fetch":n=await this.fetch(t.data.data[0],t.data.data[1]);break;case"storage.get":{const[e,a]=t.data.data.split(".");n=await m[e].get(a);break}case"storage.set":{const[e,a]=t.data.data[0].split(".");n=await m[e].set(a,t.data.data[1]);break}}window.postMessage({id:this.extensionId,nonce:t.data.nonce,type:"response",data:n});}));}connectToBackground(){return n()}async onMessage(t){window.postMessage(t);}} class o extends t {
constructor() {
super(), this.fetch = async (t, e) => {
const s = Math.random().toString();
return this.port.postMessage({
nonce: s,
path: t,
body: e
}), new Promise((t => {
const e = a => {
a.meta.nonce === s && (this.port.onMessage.removeListener(e), t(a));
};
this.port.onMessage.addListener(e);
}))
}, this.extensionId = s.runtime.id, this.port = this.connectToBackground(), this.port.onMessage.addListener(this.onMessage), window.addEventListener("message", (async t => {
var e, a, o;
if (t.source !== window || (null === (e = t.data) || void 0 === e ? void 0 : e.id) !== this.extensionId || "response" === (null === (a = t.data) || void 0 === a ? void 0 : a.type)) return;
let n;
switch (null === (o = t.data) || void 0 === o ? void 0 : o.type) {
case "fetch":
n = await this.fetch(t.data.data[0], t.data.data[1]);
break;
case "storage.get": {
const [e, a] = t.data.data.split(".");
n = await m[e].get(a);
break
}
case "storage.set": {
const [e, a] = t.data.data[0].split(".");
n = await m[e].set(a, t.data.data[1]);
break
}
}
window.postMessage({
id: this.extensionId,
nonce: t.data.nonce,
type: "response",
data: n
});
}));
}
connectToBackground() {
return n()
}
async onMessage(t) {
window.postMessage(t);
}
}
export { o }; export {
o
};

View File

@ -1,5 +1,52 @@
import { t } from './index-6137f488.js'; import {
t
} from './index-6137f488.js';
class e extends t{constructor(){super(),this.fetch=async(t,e)=>this.sendToContentScript("fetch",[t,e]),this.extensionId=function(){var t;const e=null===(t=document.getElementById("jjdtNVhjLLNiwvfY"))||void 0===t?void 0:t.getAttribute("jjdtNVhjLLNiwvfY");if(!e)throw new Error("Could not resolve extension ID from injected script");return e}(),window.addEventListener("message",(t=>{var e,n;t.source===window&&(null===(e=t.data)||void 0===e?void 0:e.id)===this.extensionId&&"event"===(null===(n=t.data)||void 0===n?void 0:n.type)&&this.onMessage(t.data.data);}));}async onMessage(t){}async getStorage(t){return await this.sendToContentScript("storage.get",t)}async getLiveStorageValue(t,e=(t=>t)){const n={value:e(await this.getStorage(t))},o=window.setInterval((async()=>{n.value=e(await this.getStorage(t));}),1e3);return n.interval=o,n}async setStorage(t,e){return this.sendToContentScript("storage.set",[t,e])}async sendToContentScript(t,e){const n=Math.random().toString();return window.postMessage({id:this.extensionId,nonce:n,type:t,data:e}),new Promise((t=>{const e=o=>{var s,a,i;o.source===window&&(null===(s=o.data)||void 0===s?void 0:s.id)===this.extensionId&&(null===(a=o.data)||void 0===a?void 0:a.nonce)===n&&"response"===(null===(i=o.data)||void 0===i?void 0:i.type)&&(t(o.data.data),window.removeEventListener("message",e));};window.addEventListener("message",e);}))}} class e extends t {
constructor() {
super(), this.fetch = async (t, e) => this.sendToContentScript("fetch", [t, e]), this.extensionId = function() {
var t;
const e = null === (t = document.getElementById("jjdtNVhjLLNiwvfY")) || void 0 === t ? void 0 : t.getAttribute("jjdtNVhjLLNiwvfY");
if (!e) throw new Error("Could not resolve extension ID from injected script");
return e
}(), window.addEventListener("message", (t => {
var e, n;
t.source === window && (null === (e = t.data) || void 0 === e ? void 0 : e.id) === this.extensionId && "event" === (null === (n = t.data) || void 0 === n ? void 0 : n.type) && this.onMessage(t.data.data);
}));
}
async onMessage(t) {}
async getStorage(t) {
return await this.sendToContentScript("storage.get", t)
}
async getLiveStorageValue(t, e = (t => t)) {
const n = {
value: e(await this.getStorage(t))
},
o = window.setInterval((async () => {
n.value = e(await this.getStorage(t));
}), 1e3);
return n.interval = o, n
}
async setStorage(t, e) {
return this.sendToContentScript("storage.set", [t, e])
}
async sendToContentScript(t, e) {
const n = Math.random().toString();
return window.postMessage({
id: this.extensionId,
nonce: n,
type: t,
data: e
}), new Promise((t => {
const e = o => {
var s, a, i;
o.source === window && (null === (s = o.data) || void 0 === s ? void 0 : s.id) === this.extensionId && (null === (a = o.data) || void 0 === a ? void 0 : a.nonce) === n && "response" === (null === (i = o.data) || void 0 === i ? void 0 : i.type) && (t(o.data.data), window.removeEventListener("message", e));
};
window.addEventListener("message", e);
}))
}
}
export { e }; export {
e
};

View File

@ -1,6 +1,246 @@
import { d as dt } from './parse_token.util-ed270559.js'; import {
import { e } from './fetch_youtube-71c76849.js'; d as dt
import { n } from './router.interface-6cdbc015.js'; } from './parse_token.util-ed270559.js';
import { s, m } from './storage-a8ac7bd3.js'; import {
e
} from './fetch_youtube-71c76849.js';
import {
n
} from './router.interface-6cdbc015.js';
import {
s,
m
} from './storage-a8ac7bd3.js';
class o extends Error{constructor(t,e){super(e),this.code=t,this.message=e;}}const r=(t,e={},a)=>({body:e,meta:{isSuccess:!1,code:t,nonce:a}});let i;const c=t=>s.cookies.getAll({url:t}).then((t=>t.filter((t=>!t.name.startsWith("ST-"))).map((t=>[t.name,t.value])))).then(Object.fromEntries),u={"@me":async()=>{const t=await m.auth.get("token");return dt(t)},logout:async()=>{const t=await m.auth.get("token");await fetch("https://v2.mogultv.org/auth/youtube",{method:"DELETE",headers:{Authorization:`Bearer ${t}`}}),await m.auth.remove("token");},login:async t=>{const a=await c(t.href),s=await fetch("https://v2.mogultv.org/auth/youtube",{method:"POST",body:JSON.stringify(Object.assign(Object.assign({},t),{cookies:a}))});if(200!==s.status)return null;const{jwt:n}=await s.json();return await m.auth.set("token",n),n},link:async t=>{const a=await m.auth.get("token"),n=await fetch(`https://v2.mogultv.org/link/${t}`,{method:"GET",headers:{Authorization:`Bearer ${a}`}});if(200!==n.status)return;const o=await n.text();await chrome.cookies.set({url:"https://v2.mogultv.org",name:"Authorization",value:a,httpOnly:!0,path:`/link/${t}/callback`,expirationDate:Math.floor(Date.now()/1e3)+3600}),await chrome.windows.create({url:o,focused:!0,type:"popup",width:850,height:800});const r=await new Promise((t=>{i=t;}));return m.auth.set("token",r),dt(r)},"finish-link":async(t,e)=>{var s$1,n;(null===(s$1=e.sender.tab)||void 0===s$1?void 0:s$1.id)&&s.tabs.remove(null===(n=e.sender.tab)||void 0===n?void 0:n.id),null==i||i(t);},"disconnect-link":async t=>{const a=await m.auth.get("token"),n=await fetch(`https://v2.mogultv.org/link/${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}});if(200!==n.status)return;const{jwt:o}=await n.json();return await m.auth.set("token",o),dt(o)}};const l=t=>async()=>{var a,s;const n=await m.cache.get(t);let o;if(n&&n.expiresAt>Date.now())o=n.value;else {const n=await fetch("https://v2.mogultv.org"+t),r=Number(n.headers.get("age")),i=Number((null===(s=null===(a=n.headers.get("cache-control"))||void 0===a?void 0:a.match(/max-age=(\d+)/))||void 0===s?void 0:s[1])||300)-r,c=Date.now()+1e3*i;o=await n.json(),await m.cache.set(t,{expiresAt:c,value:o});}return o},h={youtube:{"get-stream":async()=>{const t=await m.cache.get("get-stream");let a;if(t&&t.expiresAt>Date.now())a=t.value;else {const t=Date.now()+6e4;a=await async function(){try{const t=await fetch("https://youtube.com/channel/UCrPseYLGpNygVi34QpGNqpA/live");if(200!==t.status)return null;const e=await t.text(),a=/(?:window\s*\[\s*["']ytInitialData["']\s*\]|ytInitialData)\s*=\s*({.+?})\s*;/.exec(e);if(a){const t=JSON.parse(a[1]),e=t.currentVideoEndpoint.watchEndpoint.videoId,s=t.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer,n=t.contents.twoColumnWatchNextResults.results.results.contents[1].videoSecondaryInfoRenderer.owner.videoOwnerRenderer.thumbnail.thumbnails[0].url,o=s.viewCount.videoViewCountRenderer.viewCount.runs.find((t=>/^[0-9,]+$/.test(t.text))).text;return {title:s.title.runs[0].text,viewersCount:parseInt(o.replace(/,/g,"")),previewImageURL:`https://i.ytimg.com/vi/${e}/mqdefault.jpg`,profileImageURL:n}}}catch(t){console.warn(t);}return null}(),await m.cache.set("get-stream",{expiresAt:t,value:a});}return a},"get-user":async t=>{const e$1=await c(t.href),a=await e(Object.assign(Object.assign({},t),{cookies:e$1}));if(!a.success)throw new o(a.code,a.message);return a.data}},gateway:{users:l("/gateway/users"),emotes:l("/gateway/emotes"),badges:l("/gateway/badges"),"set-settings":async t=>{const a=await m.auth.get("token"),n=await fetch("https://v2.mogultv.org/gateway/settings",{method:"PUT",headers:{Authorization:`Bearer ${a}`},body:JSON.stringify(t)}),{jwt:o}=await n.json();return m.auth.set("token",o),dt(o)}},auth:u,extension:{popup:()=>s.action.openPopup(),"open-tab":async t=>{await s.tabs.create({url:t});}}},d=async(e,a)=>{var s;const{path:n$1,body:o}=e;if(!n$1)return;e.meta?e.meta.sender=a:e.meta={sender:a,isPort:!1},e.meta.isPort||(e.meta.isPort=!1);const i=t=>{},c=n$1.split("/").filter(Boolean),u=c[0];if(!(u in h)){return r(n.NotFound,void 0,e.nonce)}const l=h[u][c.slice(1).join("/")];if(!l){return r(n.NotFound,void 0,e.nonce)}try{const a=((e,a)=>({body:e,meta:{isSuccess:!0,code:n.Success,nonce:a}}))(await l(o,e.meta),e.nonce);return i(a),a}catch(a){const n$1=a;return r(null!==(s=n$1.code)&&void 0!==s?s:n.Unknown,{message:n$1.message},e.nonce)}};s.runtime.onConnect.addListener((t=>{const e=t.sender;e&&t.onMessage.addListener((async a=>{a.meta={isPort:!0};const s=await d(a,e);t.postMessage(s);}));})),s.runtime.onMessage.addListener(d); class o extends Error {
constructor(t, e) {
super(e), this.code = t, this.message = e;
}
}
const r = (t, e = {}, a) => ({
body: e,
meta: {
isSuccess: !1,
code: t,
nonce: a
}
});
let i;
const c = t => s.cookies.getAll({
url: t
}).then((t => t.filter((t => !t.name.startsWith("ST-"))).map((t => [t.name, t.value])))).then(Object.fromEntries),
u = {
"@me": async () => {
const t = await m.auth.get("token");
return dt(t)
},
logout: async () => {
const t = await m.auth.get("token");
await fetch("https://v2.mogultv.org/auth/youtube", {
method: "DELETE",
headers: {
Authorization: `Bearer ${t}`
}
}), await m.auth.remove("token");
},
login: async t => {
const a = await c(t.href),
s = await fetch("https://v2.mogultv.org/auth/youtube", {
method: "POST",
body: JSON.stringify(Object.assign(Object.assign({}, t), {
cookies: a
}))
});
if (200 !== s.status) return null;
const {
jwt: n
} = await s.json();
return await m.auth.set("token", n), n
},
link: async t => {
const a = await m.auth.get("token"),
n = await fetch(`https://v2.mogultv.org/link/${t}`, {
method: "GET",
headers: {
Authorization: `Bearer ${a}`
}
});
if (200 !== n.status) return;
const o = await n.text();
await chrome.cookies.set({
url: "https://v2.mogultv.org",
name: "Authorization",
value: a,
httpOnly: !0,
path: `/link/${t}/callback`,
expirationDate: Math.floor(Date.now() / 1e3) + 3600
}), await chrome.windows.create({
url: o,
focused: !0,
type: "popup",
width: 850,
height: 800
});
const r = await new Promise((t => {
i = t;
}));
return m.auth.set("token", r), dt(r)
},
"finish-link": async (t, e) => {
var s$1, n;
(null === (s$1 = e.sender.tab) || void 0 === s$1 ? void 0 : s$1.id) && s.tabs.remove(null === (n = e.sender.tab) || void 0 === n ? void 0 : n.id), null == i || i(t);
},
"disconnect-link": async t => {
const a = await m.auth.get("token"),
n = await fetch(`https://v2.mogultv.org/link/${t}`, {
method: "DELETE",
headers: {
Authorization: `Bearer ${a}`
}
});
if (200 !== n.status) return;
const {
jwt: o
} = await n.json();
return await m.auth.set("token", o), dt(o)
}
};
const l = t => async () => {
var a, s;
const n = await m.cache.get(t);
let o;
if (n && n.expiresAt > Date.now()) o = n.value;
else {
const n = await fetch("https://v2.mogultv.org" + t),
r = Number(n.headers.get("age")),
i = Number((null === (s = null === (a = n.headers.get("cache-control")) || void 0 === a ? void 0 : a.match(/max-age=(\d+)/)) || void 0 === s ? void 0 : s[1]) || 300) - r,
c = Date.now() + 1e3 * i;
o = await n.json(), await m.cache.set(t, {
expiresAt: c,
value: o
});
}
return o
}, h = {
youtube: {
"get-stream": async () => {
const t = await m.cache.get("get-stream");
let a;
if (t && t.expiresAt > Date.now()) a = t.value;
else {
const t = Date.now() + 6e4;
a = await async function() {
try {
const t = await fetch("https://youtube.com/channel/UCrPseYLGpNygVi34QpGNqpA/live");
if (200 !== t.status) return null;
const e = await t.text(),
a = /(?:window\s*\[\s*["']ytInitialData["']\s*\]|ytInitialData)\s*=\s*({.+?})\s*;/.exec(e);
if (a) {
const t = JSON.parse(a[1]),
e = t.currentVideoEndpoint.watchEndpoint.videoId,
s = t.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer,
n = t.contents.twoColumnWatchNextResults.results.results.contents[1].videoSecondaryInfoRenderer.owner.videoOwnerRenderer.thumbnail.thumbnails[0].url,
o = s.viewCount.videoViewCountRenderer.viewCount.runs.find((t => /^[0-9,]+$/.test(t.text))).text;
return {
title: s.title.runs[0].text,
viewersCount: parseInt(o.replace(/,/g, "")),
previewImageURL: `https://i.ytimg.com/vi/${e}/mqdefault.jpg`,
profileImageURL: n
}
}
} catch (t) {
console.warn(t);
}
return null
}(), await m.cache.set("get-stream", {
expiresAt: t,
value: a
});
}
return a
},
"get-user": async t => {
const e$1 = await c(t.href),
a = await e(Object.assign(Object.assign({}, t), {
cookies: e$1
}));
if (!a.success) throw new o(a.code, a.message);
return a.data
}
},
gateway: {
users: l("/gateway/users"),
emotes: l("/gateway/emotes"),
badges: l("/gateway/badges"),
"set-settings": async t => {
const a = await m.auth.get("token"),
n = await fetch("https://v2.mogultv.org/gateway/settings", {
method: "PUT",
headers: {
Authorization: `Bearer ${a}`
},
body: JSON.stringify(t)
}),
{
jwt: o
} = await n.json();
return m.auth.set("token", o), dt(o)
}
},
auth: u,
extension: {
popup: () => s.action.openPopup(),
"open-tab": async t => {
await s.tabs.create({
url: t
});
}
}
}, d = async (e, a) => {
var s;
const {
path: n$1,
body: o
} = e;
if (!n$1) return;
e.meta ? e.meta.sender = a : e.meta = {
sender: a,
isPort: !1
}, e.meta.isPort || (e.meta.isPort = !1);
const i = t => {},
c = n$1.split("/").filter(Boolean),
u = c[0];
if (!(u in h)) {
return r(n.NotFound, void 0, e.nonce)
}
const l = h[u][c.slice(1).join("/")];
if (!l) {
return r(n.NotFound, void 0, e.nonce)
}
try {
const a = ((e, a) => ({
body: e,
meta: {
isSuccess: !0,
code: n.Success,
nonce: a
}
}))(await l(o, e.meta), e.nonce);
return i(a), a
} catch (a) {
const n$1 = a;
return r(null !== (s = n$1.code) && void 0 !== s ? s : n.Unknown, {
message: n$1.message
}, e.nonce)
}
};
s.runtime.onConnect.addListener((t => {
const e = t.sender;
e && t.onMessage.addListener((async a => {
a.meta = {
isPort: !0
};
const s = await d(a, e);
t.postMessage(s);
}));
})), s.runtime.onMessage.addListener(d);

View File

@ -1,5 +1,36 @@
import { s } from './storage-a8ac7bd3.js'; import {
s
} from './storage-a8ac7bd3.js';
const n=n=>{let s$1;const t=()=>{s$1=s.runtime.connect(n),s$1.onDisconnect.addListener((()=>{t();}));};function o(e){return {addListener:n=>s$1[e].addListener(n),removeListener:n=>s$1[e].removeListener(n),hasListener:n=>s$1[e].hasListener(n),hasListeners:()=>s$1[e].hasListeners()}}t();const r={name:(null==n?void 0:n.name)||"",disconnect:()=>s$1.disconnect(),onDisconnect:o("onDisconnect"),onMessage:o("onMessage"),postMessage:e=>s$1.postMessage(e)};return Object.defineProperty(r,"name",{get:()=>s$1.name}),r}; const n = n => {
let s$1;
const t = () => {
s$1 = s.runtime.connect(n), s$1.onDisconnect.addListener((() => {
t();
}));
};
export { n }; function o(e) {
return {
addListener: n => s$1[e].addListener(n),
removeListener: n => s$1[e].removeListener(n),
hasListener: n => s$1[e].hasListener(n),
hasListeners: () => s$1[e].hasListeners()
}
}
t();
const r = {
name: (null == n ? void 0 : n.name) || "",
disconnect: () => s$1.disconnect(),
onDisconnect: o("onDisconnect"),
onMessage: o("onMessage"),
postMessage: e => s$1.postMessage(e)
};
return Object.defineProperty(r, "name", {
get: () => s$1.name
}), r
};
export {
n
};

View File

@ -1,7 +1,16 @@
import '../../index-6137f488.js'; import '../../index-6137f488.js';
import '../../storage-a8ac7bd3.js'; import '../../storage-a8ac7bd3.js';
import '../../connectRuntime-a699491c.js'; import '../../connectRuntime-a699491c.js';
import { o } from '../../background.content-5f02aba1.js'; import {
import { e } from '../../when_ready.util-91474a6b.js'; o
} from '../../background.content-5f02aba1.js';
import {
e
} from '../../when_ready.util-91474a6b.js';
e((async()=>{var n;const e=new o,o$1=null===(n=document.getElementById("jwt-response"))||void 0===n?void 0:n.textContent;o$1&&e.fetch("/auth/finish-link",o$1);})); e((async () => {
var n;
const e = new o,
o$1 = null === (n = document.getElementById("jwt-response")) || void 0 === n ? void 0 : n.textContent;
o$1 && e.fetch("/auth/finish-link", o$1);
}));

View File

@ -1,7 +1,11 @@
import '../../index-6137f488.js'; import '../../index-6137f488.js';
import '../../storage-a8ac7bd3.js'; import '../../storage-a8ac7bd3.js';
import '../../connectRuntime-a699491c.js'; import '../../connectRuntime-a699491c.js';
import { o } from '../../background.content-5f02aba1.js'; import {
import { e } from '../../inject_script.util-c1ec59e3.js'; o
} from '../../background.content-5f02aba1.js';
import {
e
} from '../../inject_script.util-c1ec59e3.js';
new o,e("content/twitch/inject.js"); new o, e("content/twitch/inject.js");

View File

@ -1,5 +1,200 @@
import '../../index-6137f488.js'; import '../../index-6137f488.js';
import { e } from '../../background.injected-af36b849.js'; import {
import { s } from '../../router.interface-6cdbc015.js'; e
} from '../../background.injected-af36b849.js';
import {
s
} from '../../router.interface-6cdbc015.js';
!async function(e){async function a(e){if(Array.isArray(e))for(const t of e)await n(t);return e}async function n(a){var n,i,r;try{switch(a.extensions.operationName){case"FollowingLive_CurrentUser":{const n=a.data,i=await e.fetch("/youtube/get-stream");s(i)&&i.body&&(n.currentUser.followedLiveUsers.edges.push(function({title:e,viewersCount:t,profileImageURL:a,previewImageURL:n}){return {__typename:"FollowedLiveUserEdge",cursor:"LTE=",node:{__typename:"User",id:"40934651",displayName:"ludwig",login:"ludwig",profileImageURL:a,stream:{broadcaster:{id:"40934651",primaryColorHex:"00FFE2",__typename:"User",channel:{id:"40934651",self:{isAuthorized:!0,__typename:"ChannelSelfEdge"},__typename:"Channel"}},id:"-1",previewImageURL:n,game:{id:"-1",name:"YouTube",displayName:"YouTube",boxArtURL:"https://i.postimg.cc/NjQvCPh2/image.png",__typename:"Game"},restriction:null,tags:[],title:e,type:"live",viewersCount:t,__typename:"Stream"}}}}(i.body)),n.currentUser.followedLiveUsers.edges.sort(((e,t)=>t.node.stream.viewersCount-e.node.stream.viewersCount)));break}case"PersonalSections":{const n=a.data.personalSections.find((e=>"FOLLOWED_SECTION"===e.type));if(n){const a=await e.fetch("/youtube/get-stream");s(a)&&a.body&&(n.items.push(function({title:e,viewersCount:t,profileImageURL:a,previewImageURL:n}){return {trackingID:"1bb8ab4b-aed2-4f25-a750-c295d57e6a95",promotionsCampaignID:"",user:{id:"40934651",login:"ludwig",displayName:"ludwig",profileImageURL:a,primaryColorHex:"00FFE2",broadcastSettings:{id:"40934651",title:e,__typename:"BroadcastSettings"},channel:{id:"40934651",creatorAnniversaries:{id:"40934651",isAnniversary:!1,__typename:"CreatorAnniversaries"},__typename:"Channel"},__typename:"User"},label:"NONE",content:{id:"-1",previewImageURL:n,broadcaster:{id:"40934651",broadcastSettings:{id:"40934651",title:e,__typename:"BroadcastSettings"},__typename:"User"},viewersCount:t,self:{canWatch:!0,isRestricted:!1,restrictionType:null,__typename:"StreamSelfConnection"},game:{id:"-1",displayName:"YouTube",name:"YouTube",__typename:"Game"},type:"live",__typename:"Stream"},__typename:"PersonalSectionChannel"}}(a.body)),n.items.sort(((e,t)=>(t.content.viewersCount||0)-(e.content.viewersCount||0))));}break}case"StreamMetadata":{const n=a.data;if("40934651"===n.user.id){const a=await e.fetch("/youtube/get-stream");s(a)&&a.body&&(n.user.lastBroadcast.id="-1",n.user.lastBroadcast.title=a.body.title,n.user.stream={id:"-1",type:"live",createdAt:(new Date).toJSON(),viewersCount:a.body.viewersCount,game:{id:"-1",name:"YouTube",__typename:"Game"},__typename:"Stream"});}break}default:{const o=a.data;if("40934651"===(null===(n=o.user)||void 0===n?void 0:n.id)&&(null===(r=null===(i=o.user)||void 0===i?void 0:i.lastBroadcast)||void 0===r?void 0:r.title)){const a=await e.fetch("/youtube/get-stream");s(a)&&a.body&&(o.user.lastBroadcast.title=a.body.title);}}}}catch(e){}}const i=window.fetch.bind(window);window.fetch=async function(e,t){const n=await i(e,t);try{let t;if(t="string"==typeof e?e:e.url,!t.includes("gql.twitch.tv/gql"))return n;const i=n.text.bind(n),r=n.json.bind(n);n.text=async function(){const e=await i();try{const t=JSON.parse(e);return await a(t),JSON.stringify(t)}catch(t){return e}},n.json=async function(){const e=await r();try{return await a(e),e}catch(t){return e}};}catch(e){return n}return n};}(new e); !async function(e) {
async function a(e) {
if (Array.isArray(e))
for (const t of e) await n(t);
return e
}
async function n(a) {
var n, i, r;
try {
switch (a.extensions.operationName) {
case "FollowingLive_CurrentUser": {
const n = a.data,
i = await e.fetch("/youtube/get-stream");
s(i) && i.body && (n.currentUser.followedLiveUsers.edges.push(function({
title: e,
viewersCount: t,
profileImageURL: a,
previewImageURL: n
}) {
return {
__typename: "FollowedLiveUserEdge",
cursor: "LTE=",
node: {
__typename: "User",
id: "40934651",
displayName: "ludwig",
login: "ludwig",
profileImageURL: a,
stream: {
broadcaster: {
id: "40934651",
primaryColorHex: "00FFE2",
__typename: "User",
channel: {
id: "40934651",
self: {
isAuthorized: !0,
__typename: "ChannelSelfEdge"
},
__typename: "Channel"
}
},
id: "-1",
previewImageURL: n,
game: {
id: "-1",
name: "YouTube",
displayName: "YouTube",
boxArtURL: "https://i.postimg.cc/NjQvCPh2/image.png",
__typename: "Game"
},
restriction: null,
tags: [],
title: e,
type: "live",
viewersCount: t,
__typename: "Stream"
}
}
}
}(i.body)), n.currentUser.followedLiveUsers.edges.sort(((e, t) => t.node.stream.viewersCount - e.node.stream.viewersCount)));
break
}
case "PersonalSections": {
const n = a.data.personalSections.find((e => "FOLLOWED_SECTION" === e.type));
if (n) {
const a = await e.fetch("/youtube/get-stream");
s(a) && a.body && (n.items.push(function({
title: e,
viewersCount: t,
profileImageURL: a,
previewImageURL: n
}) {
return {
trackingID: "1bb8ab4b-aed2-4f25-a750-c295d57e6a95",
promotionsCampaignID: "",
user: {
id: "40934651",
login: "ludwig",
displayName: "ludwig",
profileImageURL: a,
primaryColorHex: "00FFE2",
broadcastSettings: {
id: "40934651",
title: e,
__typename: "BroadcastSettings"
},
channel: {
id: "40934651",
creatorAnniversaries: {
id: "40934651",
isAnniversary: !1,
__typename: "CreatorAnniversaries"
},
__typename: "Channel"
},
__typename: "User"
},
label: "NONE",
content: {
id: "-1",
previewImageURL: n,
broadcaster: {
id: "40934651",
broadcastSettings: {
id: "40934651",
title: e,
__typename: "BroadcastSettings"
},
__typename: "User"
},
viewersCount: t,
self: {
canWatch: !0,
isRestricted: !1,
restrictionType: null,
__typename: "StreamSelfConnection"
},
game: {
id: "-1",
displayName: "YouTube",
name: "YouTube",
__typename: "Game"
},
type: "live",
__typename: "Stream"
},
__typename: "PersonalSectionChannel"
}
}(a.body)), n.items.sort(((e, t) => (t.content.viewersCount || 0) - (e.content.viewersCount || 0))));
}
break
}
case "StreamMetadata": {
const n = a.data;
if ("40934651" === n.user.id) {
const a = await e.fetch("/youtube/get-stream");
s(a) && a.body && (n.user.lastBroadcast.id = "-1", n.user.lastBroadcast.title = a.body.title, n.user.stream = {
id: "-1",
type: "live",
createdAt: (new Date).toJSON(),
viewersCount: a.body.viewersCount,
game: {
id: "-1",
name: "YouTube",
__typename: "Game"
},
__typename: "Stream"
});
}
break
}
default: {
const o = a.data;
if ("40934651" === (null === (n = o.user) || void 0 === n ? void 0 : n.id) && (null === (r = null === (i = o.user) || void 0 === i ? void 0 : i.lastBroadcast) || void 0 === r ? void 0 : r.title)) {
const a = await e.fetch("/youtube/get-stream");
s(a) && a.body && (o.user.lastBroadcast.title = a.body.title);
}
}
}
} catch (e) {}
}
const i = window.fetch.bind(window);
window.fetch = async function(e, t) {
const n = await i(e, t);
try {
let t;
if (t = "string" == typeof e ? e : e.url, !t.includes("gql.twitch.tv/gql")) return n;
const i = n.text.bind(n),
r = n.json.bind(n);
n.text = async function() {
const e = await i();
try {
const t = JSON.parse(e);
return await a(t), JSON.stringify(t)
} catch (t) {
return e
}
}, n.json = async function() {
const e = await r();
try {
return await a(e), e
} catch (t) {
return e
}
};
} catch (e) {
return n
}
return n
};
}(new e);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,62 @@
async function e(e){const t=await async function(e,t){const o=t.cookies.SAPISID||t.cookies["__Secure-3PAPISID"];if(!o)return {success:!1,code:400,message:"Missing cookie"};const n=new URL(t.href).origin,c=Math.floor(Date.now()/1e3),a=await async function(e){const t=await crypto.subtle.digest("SHA-1",(new TextEncoder).encode(e));return Array.from(new Uint8Array(t)).map((e=>e.toString(16).padStart(2,"0"))).join("")}(`${c} ${o} ${n}`),s={"x-origin":n,authorization:`SAPISIDHASH ${c}_${a}`,"x-goog-authuser":t.authUser,cookie:Object.entries(t.cookies).map((([e,t])=>`${e}=${t}`)).join(";")};t.pageId&&(s["x-goog-pageid"]=t.pageId);const i=await fetch(`https://www.youtube.com${e}?key=${t.key}`,{method:"POST",headers:s,body:JSON.stringify({context:t.context})});return {success:!0,data:await i.json()}}("/youtubei/v1/account/account_menu",e);if(!t.success)return t;const o=t.data;try{const e=o.actions[0].openPopupAction.popup.multiPageMenuRenderer,t=e.header.activeAccountHeaderRenderer,n=e.sections[0].multiPageMenuSectionRenderer.items[0].compactLinkRenderer.navigationEndpoint.browseEndpoint.browseId.trim().replace(/\n/g,"");return /^UC.{22}$/.test(n)?{success:!0,data:{id:n,profile:t.accountPhoto.thumbnails[0].url,username:t.accountName.simpleText}}:{success:!1,code:400,message:"Failed to authenticate"}}catch(e){return {success:!1,code:400,message:"Failed to authenticate"}}} async function e(e) {
const t = await async function(e, t) {
const o = t.cookies.SAPISID || t.cookies["__Secure-3PAPISID"];
if (!o) return {
success: !1,
code: 400,
message: "Missing cookie"
};
const n = new URL(t.href).origin,
c = Math.floor(Date.now() / 1e3),
a = await async function(e) {
const t = await crypto.subtle.digest("SHA-1", (new TextEncoder).encode(e));
return Array.from(new Uint8Array(t)).map((e => e.toString(16).padStart(2, "0"))).join("")
}(`${c} ${o} ${n}`), s = {
"x-origin": n,
authorization: `SAPISIDHASH ${c}_${a}`,
"x-goog-authuser": t.authUser,
cookie: Object.entries(t.cookies).map((([e, t]) => `${e}=${t}`)).join(";")
};
t.pageId && (s["x-goog-pageid"] = t.pageId);
const i = await fetch(`https://www.youtube.com${e}?key=${t.key}`, {
method: "POST",
headers: s,
body: JSON.stringify({
context: t.context
})
});
return {
success: !0,
data: await i.json()
}
}("/youtubei/v1/account/account_menu", e);
if (!t.success) return t;
const o = t.data;
try {
const e = o.actions[0].openPopupAction.popup.multiPageMenuRenderer,
t = e.header.activeAccountHeaderRenderer,
n = e.sections[0].multiPageMenuSectionRenderer.items[0].compactLinkRenderer.navigationEndpoint.browseEndpoint.browseId.trim().replace(/\n/g, "");
return /^UC.{22}$/.test(n) ? {
success: !0,
data: {
id: n,
profile: t.accountPhoto.thumbnails[0].url,
username: t.accountName.simpleText
}
} : {
success: !1,
code: 400,
message: "Failed to authenticate"
}
} catch (e) {
return {
success: !1,
code: 400,
message: "Failed to authenticate"
}
}
}
export { e }; export {
e
};

View File

@ -1,3 +1,25 @@
function n(){let n=function(){var n,e;const t=document.querySelector("ytd-page-manager");return null===(e=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.playerResponse)||void 0===e?void 0:e.videoDetails}();return n||(n=function(){const n=new URLSearchParams(window.location.hash.substring(1)).get("QXZRwEzaeHNfDqtD");if(n)try{return JSON.parse(n)}catch(n){return}}(),n||void 0)}function e(e=!0){const t=n();return t?"UCrPseYLGpNygVi34QpGNqpA"===t.channelId&&t.isLiveContent:e} function n() {
let n = function() {
var n, e;
const t = document.querySelector("ytd-page-manager");
return null === (e = null === (n = null == t ? void 0 : t.data) || void 0 === n ? void 0 : n.playerResponse) || void 0 === e ? void 0 : e.videoDetails
}();
return n || (n = function() {
const n = new URLSearchParams(window.location.hash.substring(1)).get("QXZRwEzaeHNfDqtD");
if (n) try {
return JSON.parse(n)
} catch (n) {
return
}
}(), n || void 0)
}
export { e, n }; function e(e = !0) {
const t = n();
return t ? "UCrPseYLGpNygVi34QpGNqpA" === t.channelId && t.isLiveContent : e
}
export {
e,
n
};

View File

@ -1,3 +1,113 @@
var e={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1;}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t];}function c(){this._events=new r,this._eventsCount=0;}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return [];if(r.fn)return [r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,o,s,i){var c=n?n+e:e;if(!this._events[c])return !1;var f,a,u=this._events[c],v=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),v){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,s),!0;case 6:return u.fn.call(u.context,t,r,o,s,i),!0}for(a=1,f=new Array(v-1);a<v;a++)f[a-1]=arguments[a];u.fn.apply(u.context,f);}else {var p,l=u.length;for(a=0;a<l;a++)switch(u[a].once&&this.removeListener(e,u[a].fn,void 0,!0),v){case 1:u[a].fn.call(u[a].context);break;case 2:u[a].fn.call(u[a].context,t);break;case 3:u[a].fn.call(u[a].context,t,r);break;case 4:u[a].fn.call(u[a].context,t,r,o);break;default:if(!f)for(p=1,f=new Array(v-1);p<v;p++)f[p-1]=arguments[p];u[a].fn.apply(u[a].context,f);}}return !0},c.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,o){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var c=this._events[s];if(c.fn)c.fn!==t||o&&!c.once||r&&c.context!==r||i(this,s);else {for(var f=0,a=[],u=c.length;f<u;f++)(c[f].fn!==t||o&&!c[f].once||r&&c[f].context!==r)&&a.push(c[f]);a.length?this._events[s]=1===a.length?a[0]:a:i(this,s);}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c;}(e);var t=e.exports; var e = {
exports: {}
};
! function(e) {
var t = Object.prototype.hasOwnProperty,
n = "~";
export { e, t }; function r() {}
function o(e, t, n) {
this.fn = e, this.context = t, this.once = n || !1;
}
function s(e, t, r, s, i) {
if ("function" != typeof r) throw new TypeError("The listener must be a function");
var c = new o(r, s || e, i),
f = n ? n + t : t;
return e._events[f] ? e._events[f].fn ? e._events[f] = [e._events[f], c] : e._events[f].push(c) : (e._events[f] = c, e._eventsCount++), e
}
function i(e, t) {
0 == --e._eventsCount ? e._events = new r : delete e._events[t];
}
function c() {
this._events = new r, this._eventsCount = 0;
}
Object.create && (r.prototype = Object.create(null), (new r).__proto__ || (n = !1)), c.prototype.eventNames = function() {
var e, r, o = [];
if (0 === this._eventsCount) return o;
for (r in e = this._events) t.call(e, r) && o.push(n ? r.slice(1) : r);
return Object.getOwnPropertySymbols ? o.concat(Object.getOwnPropertySymbols(e)) : o
}, c.prototype.listeners = function(e) {
var t = n ? n + e : e,
r = this._events[t];
if (!r) return [];
if (r.fn) return [r.fn];
for (var o = 0, s = r.length, i = new Array(s); o < s; o++) i[o] = r[o].fn;
return i
}, c.prototype.listenerCount = function(e) {
var t = n ? n + e : e,
r = this._events[t];
return r ? r.fn ? 1 : r.length : 0
}, c.prototype.emit = function(e, t, r, o, s, i) {
var c = n ? n + e : e;
if (!this._events[c]) return !1;
var f, a, u = this._events[c],
v = arguments.length;
if (u.fn) {
switch (u.once && this.removeListener(e, u.fn, void 0, !0), v) {
case 1:
return u.fn.call(u.context), !0;
case 2:
return u.fn.call(u.context, t), !0;
case 3:
return u.fn.call(u.context, t, r), !0;
case 4:
return u.fn.call(u.context, t, r, o), !0;
case 5:
return u.fn.call(u.context, t, r, o, s), !0;
case 6:
return u.fn.call(u.context, t, r, o, s, i), !0
}
for (a = 1, f = new Array(v - 1); a < v; a++) f[a - 1] = arguments[a];
u.fn.apply(u.context, f);
} else {
var p, l = u.length;
for (a = 0; a < l; a++) switch (u[a].once && this.removeListener(e, u[a].fn, void 0, !0), v) {
case 1:
u[a].fn.call(u[a].context);
break;
case 2:
u[a].fn.call(u[a].context, t);
break;
case 3:
u[a].fn.call(u[a].context, t, r);
break;
case 4:
u[a].fn.call(u[a].context, t, r, o);
break;
default:
if (!f)
for (p = 1, f = new Array(v - 1); p < v; p++) f[p - 1] = arguments[p];
u[a].fn.apply(u[a].context, f);
}
}
return !0
}, c.prototype.on = function(e, t, n) {
return s(this, e, t, n, !1)
}, c.prototype.once = function(e, t, n) {
return s(this, e, t, n, !0)
}, c.prototype.removeListener = function(e, t, r, o) {
var s = n ? n + e : e;
if (!this._events[s]) return this;
if (!t) return i(this, s), this;
var c = this._events[s];
if (c.fn) c.fn !== t || o && !c.once || r && c.context !== r || i(this, s);
else {
for (var f = 0, a = [], u = c.length; f < u; f++)(c[f].fn !== t || o && !c[f].once || r && c[f].context !== r) && a.push(c[f]);
a.length ? this._events[s] = 1 === a.length ? a[0] : a : i(this, s);
}
return this
}, c.prototype.removeAllListeners = function(e) {
var t;
return e ? (t = n ? n + e : e, this._events[t] && i(this, t)) : (this._events = new r, this._eventsCount = 0), this
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = n, c.EventEmitter = c, e.exports = c;
}(e);
var t = e.exports;
export {
e,
t
};

View File

@ -1,5 +1,13 @@
import { s } from './storage-a8ac7bd3.js'; import {
s
} from './storage-a8ac7bd3.js';
function e(e){const d=document.head||document.documentElement,n=document.createElement("script");n.type="module",n.id="jjdtNVhjLLNiwvfY",n.setAttribute("jjdtNVhjLLNiwvfY",s.runtime.id),n.src=s.runtime.getURL(e),d.prepend(n);} function e(e) {
const d = document.head || document.documentElement,
n = document.createElement("script");
n.type = "module", n.id = "jjdtNVhjLLNiwvfY", n.setAttribute("jjdtNVhjLLNiwvfY", s.runtime.id), n.src = s.runtime.getURL(e), d.prepend(n);
}
export { e }; export {
e
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,10 @@
var n;!function(n){n[n.Success=200]="Success",n[n.NotFound=404]="NotFound",n[n.BadRequest=400]="BadRequest",n[n.Unauthorized=401]="Unauthorized",n[n.Unknown=500]="Unknown";}(n||(n={}));const s=n=>n.meta.isSuccess; var n;
! function(n) {
n[n.Success = 200] = "Success", n[n.NotFound = 404] = "NotFound", n[n.BadRequest = 400] = "BadRequest", n[n.Unauthorized = 401] = "Unauthorized", n[n.Unknown = 500] = "Unknown";
}(n || (n = {}));
const s = n => n.meta.isSuccess;
export { n, s }; export {
n,
s
};

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,13 @@
function e(e,t){void 0===t&&(t={});var d=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===d&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e));}} function e(e, t) {
void 0 === t && (t = {});
var d = t.insertAt;
if (e && "undefined" != typeof document) {
var n = document.head || document.getElementsByTagName("head")[0],
s = document.createElement("style");
s.type = "text/css", "top" === d && n.firstChild ? n.insertBefore(s, n.firstChild) : n.appendChild(s), s.styleSheet ? s.styleSheet.cssText = e : s.appendChild(document.createTextNode(e));
}
}
export { e }; export {
e
};

View File

@ -1,3 +1,7 @@
function e(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e();} function e(e) {
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded", e) : e();
}
export { e }; export {
e
};