Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@titaniumnetwork-dev/ultraviolet

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@titaniumnetwork-dev/ultraviolet - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

client.d.ts

13

dist/sw.js

@@ -12,4 +12,13 @@ /*global UVServiceWorker,__uv$config*/

const sw = new UVServiceWorker();
const uv = new UVServiceWorker();
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));
self.addEventListener('fetch', event => {
event.respondWith(
(async ()=>{
if(event.request.url.startsWith(location.origin + __uv$config.prefix)) {
return await uv.fetch(event);
}
return await fetch(event.request);
})()
);
});

2

dist/uv.client.js

@@ -1,2 +0,2 @@

"use strict";(()=>{var Ie=Object.create;var q=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ue=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports);var je=(a,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ae(t))!Te.call(a,n)&&n!==r&&q(a,n,{get:()=>t[n],enumerable:!(e=He(t,n))||e.enumerable});return a};var p=(a,t,r)=>(r=a!=null?Ie(Ce(a)):{},je(t||!a||!a.__esModule?q(r,"default",{value:a,enumerable:!0}):r,a));var c=Ue((Xe,P)=>{"use strict";var m=typeof Reflect=="object"?Reflect:null,_=m&&typeof m.apply=="function"?m.apply:function(t,r,e){return Function.prototype.apply.call(t,r,e)},f;m&&typeof m.ownKeys=="function"?f=m.ownKeys:Object.getOwnPropertySymbols?f=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:f=function(t){return Object.getOwnPropertyNames(t)};function qe(a){console&&console.warn&&console.warn(a)}var W=Number.isNaN||function(t){return t!==t};function h(){h.init.call(this)}P.exports=h;P.exports.once=Be;h.EventEmitter=h;h.prototype._events=void 0;h.prototype._eventsCount=0;h.prototype._maxListeners=void 0;var F=10;function w(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return F},set:function(a){if(typeof a!="number"||a<0||W(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");F=a}});h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};h.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||W(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function B(a){return a._maxListeners===void 0?h.defaultMaxListeners:a._maxListeners}h.prototype.getMaxListeners=function(){return B(this)};h.prototype.emit=function(t){for(var r=[],e=1;e<arguments.length;e++)r.push(arguments[e]);var n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var u=i[t];if(u===void 0)return!1;if(typeof u=="function")_(u,this,r);else for(var d=u.length,v=z(u,d),e=0;e<d;++e)_(v[e],this,r);return!0};function G(a,t,r,e){var n,i,o;if(w(r),i=a._events,i===void 0?(i=a._events=Object.create(null),a._eventsCount=0):(i.newListener!==void 0&&(a.emit("newListener",t,r.listener?r.listener:r),i=a._events),o=i[t]),o===void 0)o=i[t]=r,++a._eventsCount;else if(typeof o=="function"?o=i[t]=e?[r,o]:[o,r]:e?o.unshift(r):o.push(r),n=B(a),n>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=a,l.type=t,l.count=o.length,qe(l)}return a}h.prototype.addListener=function(t,r){return G(this,t,r,!1)};h.prototype.on=h.prototype.addListener;h.prototype.prependListener=function(t,r){return G(this,t,r,!0)};function _e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function K(a,t,r){var e={fired:!1,wrapFn:void 0,target:a,type:t,listener:r},n=_e.bind(e);return n.listener=r,e.wrapFn=n,n}h.prototype.once=function(t,r){return w(r),this.on(t,K(this,t,r)),this};h.prototype.prependOnceListener=function(t,r){return w(r),this.prependListener(t,K(this,t,r)),this};h.prototype.removeListener=function(t,r){var e,n,i,o,l;if(w(r),n=this._events,n===void 0)return this;if(e=n[t],e===void 0)return this;if(e===r||e.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,e.listener||r));else if(typeof e!="function"){for(i=-1,o=e.length-1;o>=0;o--)if(e[o]===r||e[o].listener===r){l=e[o].listener,i=o;break}if(i<0)return this;i===0?e.shift():Fe(e,i),e.length===1&&(n[t]=e[0]),n.removeListener!==void 0&&this.emit("removeListener",t,l||r)}return this};h.prototype.off=h.prototype.removeListener;h.prototype.removeAllListeners=function(t){var r,e,n;if(e=this._events,e===void 0)return this;if(e.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):e[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete e[t]),this;if(arguments.length===0){var i=Object.keys(e),o;for(n=0;n<i.length;++n)o=i[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=e[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(t,r[n]);return this};function X(a,t,r){var e=a._events;if(e===void 0)return[];var n=e[t];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?We(n):z(n,n.length)}h.prototype.listeners=function(t){return X(this,t,!0)};h.prototype.rawListeners=function(t){return X(this,t,!1)};h.listenerCount=function(a,t){return typeof a.listenerCount=="function"?a.listenerCount(t):Q.call(a,t)};h.prototype.listenerCount=Q;function Q(a){var t=this._events;if(t!==void 0){var r=t[a];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function z(a,t){for(var r=new Array(t),e=0;e<t;++e)r[e]=a[e];return r}function Fe(a,t){for(;t+1<a.length;t++)a[t]=a[t+1];a.pop()}function We(a){for(var t=new Array(a.length),r=0;r<t.length;++r)t[r]=a[r].listener||a[r];return t}function Be(a,t){return new Promise(function(r,e){function n(o){a.removeListener(t,i),e(o)}function i(){typeof a.removeListener=="function"&&a.removeListener("error",n),r([].slice.call(arguments))}J(a,t,i,{once:!0}),t!=="error"&&Ge(a,n,{once:!0})})}function Ge(a,t,r){typeof a.on=="function"&&J(a,"error",t,r)}function J(a,t,r,e){if(typeof a.on=="function")e.once?a.once(t,r):a.on(t,r);else if(typeof a.addEventListener=="function")a.addEventListener(t,function n(i){e.once&&a.removeEventListener(t,n),r(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}});var Y=p(c(),1);var g=class{#e;#t;constructor(t={},r=null,e=null){this.#e=!1,this.#t=null,this.data=t,this.target=r,this.that=e}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(t){this.#t=t,this.#e=!0}},s=g;var x=class extends Y.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.document=this.window.document,this.Document=this.window.Document||{},this.DOMParser=this.window.DOMParser||{},this.docProto=this.Document.prototype||{},this.domProto=this.DOMParser.prototype||{},this.title=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"title"),this.cookie=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"cookie"),this.referrer=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"referrer"),this.domain=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"domain"),this.documentURI=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"documentURI"),this.write=this.docProto.write,this.writeln=this.docProto.writeln,this.querySelector=this.docProto.querySelector,this.querySelectorAll=this.docProto.querySelectorAll,this.parseFromString=this.domProto.parseFromString,this.URL=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"URL")}overrideParseFromString(){this.ctx.override(this.domProto,"parseFromString",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({string:n,type:i},t,r);return this.emit("parseFromString",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.string,o.data.type)})}overrideQuerySelector(){this.ctx.override(this.docProto,"querySelector",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({selectors:n},t,r);return this.emit("querySelector",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.selectors)})}overrideDomain(){this.ctx.overrideDescriptor(this.docProto,"domain",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getDomain",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setDomain",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}overrideReferrer(){this.ctx.overrideDescriptor(this.docProto,"referrer",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("referrer",e),e.intercepted?e.returnValue:e.data.value}})}overrideCreateTreeWalker(){this.ctx.override(this.docProto,"createTreeWalker",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i=4294967295,o,l]=e,u=new s({root:n,show:i,filter:o,expandEntityReferences:l},t,r);return this.emit("createTreeWalker",u),u.intercepted?u.returnValue:u.target.call(u.that,u.data.root,u.data.show,u.data.filter,u.data.expandEntityReferences)})}overrideWrite(){this.ctx.override(this.docProto,"write",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[...n]=e,i=new s({html:n},t,r);return this.emit("write",i),i.intercepted?i.returnValue:i.target.apply(i.that,i.data.html)}),this.ctx.override(this.docProto,"writeln",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[...n]=e,i=new s({html:n},t,r);return this.emit("writeln",i),i.intercepted?i.returnValue:i.target.apply(i.that,i.data.html)})}overrideDocumentURI(){this.ctx.overrideDescriptor(this.docProto,"documentURI",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("documentURI",e),e.intercepted?e.returnValue:e.data.value}})}overrideURL(){this.ctx.overrideDescriptor(this.docProto,"URL",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("url",e),e.intercepted?e.returnValue:e.data.value}})}overrideCookie(){this.ctx.overrideDescriptor(this.docProto,"cookie",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getCookie",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setCookie",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}overrideTitle(){this.ctx.overrideDescriptor(this.docProto,"title",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getTitle",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setTitle",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}},Z=x;var $=p(c(),1);var b=class extends $.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Audio=this.window.Audio,this.Element=this.window.Element,this.elemProto=this.Element?this.Element.prototype:{},this.innerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"innerHTML"),this.outerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"outerHTML"),this.setAttribute=this.elemProto.setAttribute,this.getAttribute=this.elemProto.getAttribute,this.removeAttribute=this.elemProto.removeAttribute,this.hasAttribute=this.elemProto.hasAttribute,this.querySelector=this.elemProto.querySelector,this.querySelectorAll=this.elemProto.querySelectorAll,this.insertAdjacentHTML=this.elemProto.insertAdjacentHTML,this.insertAdjacentText=this.elemProto.insertAdjacentText}overrideQuerySelector(){this.ctx.override(this.elemProto,"querySelector",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({selectors:n},t,r);return this.emit("querySelector",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.selectors)})}overrideAttribute(){this.ctx.override(this.elemProto,"getAttribute",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("getAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.elemProto,"setAttribute",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setAttribute",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.elemProto,"hasAttribute",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("hasAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.elemProto,"removeAttribute",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("removeAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)})}overrideAudio(){this.ctx.override(this.window,"Audio",(t,r,e)=>{if(!e.length)return new t(...e);let[n]=e,i=new s({url:n},t,r);return this.emit("audio",i),i.intercepted?i.returnValue:new i.target(i.data.url)},!0)}overrideHtml(){this.hookProperty(this.Element,"innerHTML",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getInnerHTML",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);if(this.emit("setInnerHTML",n),n.intercepted)return n.returnValue;t.call(r,n.data.value)}}),this.hookProperty(this.Element,"outerHTML",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getOuterHTML",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);if(this.emit("setOuterHTML",n),n.intercepted)return n.returnValue;t.call(r,n.data.value)}})}overrideInsertAdjacentHTML(){this.ctx.override(this.elemProto,"insertAdjacentHTML",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({position:n,html:i},t,r);return this.emit("insertAdjacentHTML",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.position,o.data.html)})}overrideInsertAdjacentText(){this.ctx.override(this.elemProto,"insertAdjacentText",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({position:n,text:i},t,r);return this.emit("insertAdjacentText",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.position,o.data.text)})}hookProperty(t,r,e){if(!t)return!1;if(this.ctx.nativeMethods.isArray(t)){for(let i of t)this.hookProperty(i,r,e);return!0}let n=t.prototype;return this.ctx.overrideDescriptor(n,r,e),!0}},ee=b;var te=p(c(),1);var L=class extends te.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Node=t.window.Node||{},this.nodeProto=this.Node.prototype||{},this.compareDocumentPosition=this.nodeProto.compareDocumentPosition,this.contains=this.nodeProto.contains,this.insertBefore=this.nodeProto.insertBefore,this.replaceChild=this.nodeProto.replaceChild,this.append=this.nodeProto.append,this.appendChild=this.nodeProto.appendChild,this.removeChild=this.nodeProto.removeChild,this.textContent=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"textContent"),this.parentNode=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentNode"),this.parentElement=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentElement"),this.childNodes=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"childNodes"),this.baseURI=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"baseURI"),this.previousSibling=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"previousSibling"),this.ownerDocument=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"ownerDocument")}overrideTextContent(){this.ctx.overrideDescriptor(this.nodeProto,"textContent",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getTextContent",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);if(this.emit("setTextContent",n),n.intercepted)return n.returnValue;t.call(r,n.data.value)}})}overrideAppend(){this.ctx.override(this.nodeProto,"append",(t,r,[...e])=>{let n=new s({nodes:e},t,r);return this.emit("append",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.nodes)}),this.ctx.override(this.nodeProto,"appendChild",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({node:n},t,r);return this.emit("appendChild",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.node)})}overrideBaseURI(){this.ctx.overrideDescriptor(this.nodeProto,"baseURI",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("baseURI",e),e.intercepted?e.returnValue:e.data.value}})}overrideParent(){this.ctx.overrideDescriptor(this.nodeProto,"parentNode",{get:(t,r)=>{let e=new s({node:t.call(r)},t,r);return this.emit("parentNode",e),e.intercepted?e.returnValue:e.data.node}}),this.ctx.overrideDescriptor(this.nodeProto,"parentElement",{get:(t,r)=>{let e=new s({element:t.call(r)},t,r);return this.emit("parentElement",e),e.intercepted?e.returnValue:e.data.node}})}overrideOwnerDocument(){this.ctx.overrideDescriptor(this.nodeProto,"ownerDocument",{get:(t,r)=>{let e=new s({document:t.call(r)},t,r);return this.emit("ownerDocument",e),e.intercepted?e.returnValue:e.data.document}})}overrideCompareDocumentPosit1ion(){this.ctx.override(this.nodeProto,"compareDocumentPosition",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({node:n},t,r);return i.intercepted?i.returnValue:i.target.call(i.that,i.data.node)})}overrideChildMethods(){this.ctx.override(this.nodeProto,"removeChild")}},re=L;var ie=p(c(),1);var O=class extends ie.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Attr=this.window.Attr||{},this.attrProto=this.Attr.prototype||{},this.value=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"value"),this.name=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"name"),this.getNamedItem=this.attrProto.getNamedItem||null,this.setNamedItem=this.attrProto.setNamedItem||null,this.removeNamedItem=this.attrProto.removeNamedItem||null,this.getNamedItemNS=this.attrProto.getNamedItemNS||null,this.setNamedItemNS=this.attrProto.setNamedItemNS||null,this.removeNamedItemNS=this.attrProto.removeNamedItemNS||null,this.item=this.attrProto.item||null}overrideNameValue(){this.ctx.overrideDescriptor(this.attrProto,"name",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("name",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.overrideDescriptor(this.attrProto,"value",{get:(t,r)=>{let e=new s({name:this.name.get.call(r),value:t.call(r)},t,r);return this.emit("getValue",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({name:this.name.get.call(r),value:e},t,r);if(this.emit("setValue",n),n.intercepted)return n.returnValue;n.target.call(n.that,n.data.value)}})}overrideItemMethods(){this.ctx.override(this.attrProto,"getNamedItem",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("getNamedItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"setNamedItem",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setNamedItem",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.attrProto,"removeNamedItem",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("removeNamedItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"item",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({index:n},t,r);return this.emit("item",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"getNamedItemNS",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({namespace:n,localName:i},t,r);return this.emit("getNamedItemNS",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.namespace,o.data.localName)}),this.ctx.override(this.attrProto,"setNamedItemNS",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({attr:n},t,r);return this.emit("setNamedItemNS",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"removeNamedItemNS",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({namespace:n,localName:i},t,r);return this.emit("removeNamedItemNS",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.namespace,o.data.localName)})}},ne=O;var oe=p(c(),1);var M=class extends oe.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Function=this.window.Function,this.fnProto=this.Function.prototype,this.toString=this.fnProto.toString,this.fnStrings=t.fnStrings,this.call=this.fnProto.call,this.apply=this.fnProto.apply,this.bind=this.fnProto.bind}overrideFunction(){this.ctx.override(this.window,"Function",(t,r,e)=>{if(!e.length)return t.apply(r,e);let n=e[e.length-1],i=[];for(let l=0;l<e.length-1;l++)i.push(e[l]);let o=new s({script:n,args:i},t,r);return this.emit("function",o),o.intercepted?o.returnValue:o.target.call(o.that,...o.data.args,o.data.script)},!0)}overrideToString(){this.ctx.override(this.fnProto,"toString",(t,r)=>{let e=new s({fn:r},t,r);return this.emit("toString",e),e.intercepted?e.returnValue:e.target.call(e.data.fn)})}},se=M;var ae=p(c(),1);var E=class extends ae.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Object=this.window.Object,this.getOwnPropertyDescriptors=this.Object.getOwnPropertyDescriptors,this.getOwnPropertyDescriptor=this.Object.getOwnPropertyDescriptor,this.getOwnPropertyNames=this.Object.getOwnPropertyNames}overrideGetPropertyNames(){this.ctx.override(this.Object,"getOwnPropertyNames",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({names:t.call(r,n)},t,r);return this.emit("getOwnPropertyNames",i),i.intercepted?i.returnValue:i.data.names})}overrideGetOwnPropertyDescriptors(){this.ctx.override(this.Object,"getOwnPropertyDescriptors",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({descriptors:t.call(r,n)},t,r);return this.emit("getOwnPropertyDescriptors",i),i.intercepted?i.returnValue:i.data.descriptors})}},le=E;var he=p(c(),1);var S=class extends he.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.fetch=this.window.fetch,this.Request=this.window.Request,this.Response=this.window.Response,this.Headers=this.window.Headers,this.reqProto=this.Request?this.Request.prototype:{},this.resProto=this.Response?this.Response.prototype:{},this.headersProto=this.Headers?this.Headers.prototype:{},this.reqUrl=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"url"),this.resUrl=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"url"),this.reqHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"headers"),this.resHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"headers")}override(){return this.overrideRequest(),this.overrideUrl(),this.overrideHeaders(),!0}overrideRequest(){return this.fetch?(this.ctx.override(this.window,"fetch",(t,r,e)=>{if(!e.length||e[0]instanceof this.Request)return t.apply(r,e);let[n,i={}]=e,o=new s({input:n,options:i},t,r);return this.emit("request",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.input,o.data.options)}),this.ctx.override(this.window,"Request",(t,r,e)=>{if(!e.length)return new t(...e);let[n,i={}]=e,o=new s({input:n,options:i},t);return this.emit("request",o),o.intercepted?o.returnValue:new o.target(o.data.input,o.data.options)},!0),!0):!1}overrideUrl(){return this.ctx.overrideDescriptor(this.reqProto,"url",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("requestUrl",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.overrideDescriptor(this.resProto,"url",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("responseUrl",e),e.intercepted?e.returnValue:e.data.value}}),!0}overrideHeaders(){return this.Headers?(this.ctx.overrideDescriptor(this.reqProto,"headers",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("requestHeaders",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.overrideDescriptor(this.resProto,"headers",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("responseHeaders",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.override(this.headersProto,"get",(t,r,[e])=>{if(!e)return t.call(r);let n=new s({name:e,value:t.call(r,e)},t,r);return this.emit("getHeader",n),n.intercepted?n.returnValue:n.data.value}),this.ctx.override(this.headersProto,"set",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setHeader",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.headersProto,"has",(t,r,e)=>{if(!e.length)return t.call(r);let[n]=e,i=new s({name:n,value:t.call(r,n)},t,r);return this.emit("hasHeader",i),i.intercepted?i.returnValue:i.data}),this.ctx.override(this.headersProto,"append",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("appendHeader",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.headersProto,"delete",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("deleteHeader",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),!0):!1}},ue=S;var de=p(c(),1);var D=class extends de.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.XMLHttpRequest=this.window.XMLHttpRequest,this.xhrProto=this.window.XMLHttpRequest?this.window.XMLHttpRequest.prototype:{},this.open=this.xhrProto.open,this.abort=this.xhrProto.abort,this.send=this.xhrProto.send,this.overrideMimeType=this.xhrProto.overrideMimeType,this.getAllResponseHeaders=this.xhrProto.getAllResponseHeaders,this.getResponseHeader=this.xhrProto.getResponseHeader,this.setRequestHeader=this.xhrProto.setRequestHeader,this.responseURL=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseURL"),this.responseText=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseText")}override(){this.overrideOpen(),this.overrideSend(),this.overrideMimeType(),this.overrideGetResHeader(),this.overrideGetResHeaders(),this.overrideSetReqHeader()}overrideOpen(){this.ctx.override(this.xhrProto,"open",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i,o=!0,l=null,u=null]=e,d=new s({method:n,input:i,async:o,user:l,password:u},t,r);return this.emit("open",d),d.intercepted?d.returnValue:d.target.call(d.that,d.data.method,d.data.input,d.data.async,d.data.user,d.data.password)})}overrideResponseUrl(){this.ctx.overrideDescriptor(this.xhrProto,"responseURL",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("responseUrl",e),e.intercepted?e.returnValue:e.data.value}})}overrideSend(){this.ctx.override(this.xhrProto,"send",(t,r,[e=null])=>{let n=new s({body:e},t,r);return this.emit("send",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.body)})}overrideSetReqHeader(){this.ctx.override(this.xhrProto,"setRequestHeader",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setReqHeader",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)})}overrideGetResHeaders(){this.ctx.override(this.xhrProto,"getAllResponseHeaders",(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getAllResponseHeaders",e),e.intercepted?e.returnValue:e.data.value})}overrideGetResHeader(){this.ctx.override(this.xhrProto,"getResponseHeader",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n,value:t.call(r,n)},t,r);return i.intercepted?i.returnValue:i.data.value})}},ce=D;var pe=p(c(),1);var V=class extends pe.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.EventSource=this.window.EventSource||{},this.esProto=this.EventSource.prototype||{},this.url=t.nativeMethods.getOwnPropertyDescriptor(this.esProto,"url"),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2}overrideConstruct(){this.ctx.override(this.window,"EventSource",(t,r,e)=>{if(!e.length)return new t(...e);let[n,i={}]=e,o=new s({url:n,config:i},t,r);return this.emit("construct",o),o.intercepted?o.returnValue:new o.target(o.data.url,o.data.config)},!0),"EventSource"in this.window&&(this.window.EventSource.CONNECTING=this.CONNECTING,this.window.EventSource.OPEN=this.OPEN,this.window.EventSource.CLOSED=this.CLOSED)}overrideUrl(){this.ctx.overrideDescriptor(this.esProto,"url",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("url",e),e.data.value}})}},ve=V;var me=p(c(),1);var k=class extends me.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.History=this.window.History,this.history=this.window.history,this.historyProto=this.History?this.History.prototype:{},this.pushState=this.historyProto.pushState,this.replaceState=this.historyProto.replaceState,this.go=this.historyProto.go,this.back=this.historyProto.back,this.forward=this.historyProto.forward}override(){this.overridePushState(),this.overrideReplaceState(),this.overrideGo(),this.overrideForward(),this.overrideBack()}overridePushState(){this.ctx.override(this.historyProto,"pushState",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i,o=""]=e,l=new s({state:n,title:i,url:o},t,r);return this.emit("pushState",l),l.intercepted?l.returnValue:l.target.call(l.that,l.data.state,l.data.title,l.data.url)})}overrideReplaceState(){this.ctx.override(this.historyProto,"replaceState",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i,o=""]=e,l=new s({state:n,title:i,url:o},t,r);return this.emit("replaceState",l),l.intercepted?l.returnValue:l.target.call(l.that,l.data.state,l.data.title,l.data.url)})}overrideGo(){this.ctx.override(this.historyProto,"go",(t,r,[e])=>{let n=new s({delta:e},t,r);return this.emit("go",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.delta)})}overrideForward(){this.ctx.override(this.historyProto,"forward",(t,r)=>{let e=new s(null,t,r);return this.emit("forward",e),e.intercepted?e.returnValue:e.target.call(e.that)})}overrideBack(){this.ctx.override(this.historyProto,"back",(t,r)=>{let e=new s(null,t,r);return this.emit("back",e),e.intercepted?e.returnValue:e.target.call(e.that)})}},fe=k;var we=p(c(),1),R=class extends we.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.location=this.window.location,this.WorkerLocation=this.ctx.worker?this.window.WorkerLocation:null,this.workerLocProto=this.WorkerLocation?this.WorkerLocation.prototype:{},this.keys=["href","protocol","host","hostname","port","pathname","search","hash","origin"],this.HashChangeEvent=this.window.HashChangeEvent||null,this.href=this.WorkerLocation?t.nativeMethods.getOwnPropertyDescriptor(this.workerLocProto,"href"):t.nativeMethods.getOwnPropertyDescriptor(this.location,"href")}overrideWorkerLocation(t){if(!this.WorkerLocation)return!1;let r=this;for(let e of this.keys)this.ctx.overrideDescriptor(this.workerLocProto,e,{get:()=>t(r.href.get.call(this.location))[e]});return!0}emulate(t,r){let e={},n=this;for(let i of n.keys)this.ctx.nativeMethods.defineProperty(e,i,{get(){return t(n.href.get.call(n.location))[i]},set:i!=="origin"?function(o){switch(i){case"href":n.location.href=r(o);break;case"hash":n.emit("hashchange",e.href,o.trim().startsWith("#")?new URL(o.trim(),e.href).href:new URL("#"+o.trim(),e.href).href,n);break;default:{let l=new URL(e.href);l[i]=o,n.location.href=r(l.href)}break}}:void 0,configurable:!1,enumerable:!0});return"reload"in this.location&&this.ctx.nativeMethods.defineProperty(e,"reload",{value:this.ctx.wrap(this.location,"reload",(i,o)=>i.call(o===e?this.location:o)),writable:!1,enumerable:!0}),"replace"in this.location&&this.ctx.nativeMethods.defineProperty(e,"replace",{value:this.ctx.wrap(this.location,"assign",(i,o,l)=>{(!l.length||o!==e)&&i.call(o),o=this.location;let[u]=l,d=new URL(u,e.href);return i.call(o===e?this.location:o,r(d.href))}),writable:!1,enumerable:!0}),"assign"in this.location&&this.ctx.nativeMethods.defineProperty(e,"assign",{value:this.ctx.wrap(this.location,"assign",(i,o,l)=>{(!l.length||o!==e)&&i.call(o),o=this.location;let[u]=l,d=new URL(u,e.href);return i.call(o===e?this.location:o,r(d.href))}),writable:!1,enumerable:!0}),"ancestorOrigins"in this.location&&this.ctx.nativeMethods.defineProperty(e,"ancestorOrigins",{get(){let i=[];return n.window.DOMStringList&&n.ctx.nativeMethods.setPrototypeOf(i,n.window.DOMStringList.prototype),i},set:void 0,enumerable:!0}),this.ctx.nativeMethods.defineProperty(e,"toString",{value:this.ctx.wrap(this.location,"toString",()=>e.href),enumerable:!0,writable:!1}),this.ctx.nativeMethods.defineProperty(e,Symbol.toPrimitive,{value:()=>e.href,writable:!1,enumerable:!1}),this.ctx.window.Location&&this.ctx.nativeMethods.setPrototypeOf(e,this.ctx.window.Location.prototype),e}},N=R;var ye=p(c(),1);var I=class extends ye.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.postMessage=this.window.postMessage,this.MessageEvent=this.window.MessageEvent||{},this.MessagePort=this.window.MessagePort||{},this.mpProto=this.MessagePort.prototype||{},this.mpPostMessage=this.mpProto.postMessage,this.messageProto=this.MessageEvent.prototype||{},this.messageData=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"data"),this.messageOrigin=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"origin")}overridePostMessage(){this.ctx.override(this.window,"postMessage",(t,r,e)=>{if(!e.length)return t.apply(r,e);let n,i,o;this.ctx.worker?[n,o=[]]=e:[n,i,o=[]]=e;let l=new s({message:n,origin:i,transfer:o,worker:this.ctx.worker},t,r);return this.emit("postMessage",l),l.intercepted?l.returnValue:this.ctx.worker?l.target.call(l.that,l.data.message,l.data.transfer):l.target.call(l.that,l.data.message,l.data.origin,l.data.transfer)})}wrapPostMessage(t,r,e=!1){return this.ctx.wrap(t,r,(n,i,o)=>{if(this.ctx.worker?!o.length:2>o)return n.apply(i,o);let l,u,d;e?([l,d=[]]=o,u=null):[l,u,d=[]]=o;let v=new s({message:l,origin:u,transfer:d,worker:this.ctx.worker},n,t);return this.emit("postMessage",v),v.intercepted?v.returnValue:e?v.target.call(v.that,v.data.message,v.data.transfer):v.target.call(v.that,v.data.message,v.data.origin,v.data.transfer)})}overrideMessageOrigin(){this.ctx.overrideDescriptor(this.messageProto,"origin",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("origin",e),e.intercepted?e.returnValue:e.data.value}})}overrideMessageData(){this.ctx.overrideDescriptor(this.messageProto,"data",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("data",e),e.intercepted?e.returnValue:e.data.value}})}},Pe=I;var ge=p(c(),1);var H=class extends ge.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.navigator=this.window.navigator,this.Navigator=this.window.Navigator||{},this.navProto=this.Navigator.prototype||{},this.sendBeacon=this.navProto.sendBeacon}overrideSendBeacon(){this.ctx.override(this.navProto,"sendBeacon",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i=""]=e,o=new s({url:n,data:i},t,r);return this.emit("sendBeacon",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.url,o.data.data)})}},xe=H;var be=p(c(),1);var A=class extends be.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Worker=this.window.Worker||{},this.Worklet=this.window.Worklet||{},this.workletProto=this.Worklet.prototype||{},this.workerProto=this.Worker.prototype||{},this.postMessage=this.workerProto.postMessage,this.terminate=this.workerProto.terminate,this.addModule=this.workletProto.addModule}overrideWorker(){this.ctx.override(this.window,"Worker",(t,r,e)=>{if(!e.length)return new t(...e);let[n,i={}]=e,o=new s({url:n,options:i},t,r);return this.emit("worker",o),o.intercepted?o.returnValue:new o.target(o.data.url,o.data.options)},!0)}overrideAddModule(){this.ctx.override(this.workletProto,"addModule",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i={}]=e,o=new s({url:n,options:i},t,r);return this.emit("addModule",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.url,o.data.options)})}overridePostMessage(){this.ctx.override(this.workerProto,"postMessage",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i=[]]=e,o=new s({message:n,transfer:i},t,r);return this.emit("postMessage",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.message,o.data.transfer)})}overrideImportScripts(){this.ctx.override(this.window,"importScripts",(t,r,e)=>{if(!e.length)return t.apply(r,e);let n=new s({scripts:e},t,r);return this.emit("importScripts",n),n.intercepted?n.returnValue:n.target.apply(n.that,n.data.scripts)})}},Le=A;var Oe=p(c(),1);var C=class extends Oe.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.URL=this.window.URL||{},this.createObjectURL=this.URL.createObjectURL,this.revokeObjectURL=this.URL.revokeObjectURL}overrideObjectURL(){this.ctx.override(this.URL,"createObjectURL",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({object:n},t,r);return this.emit("createObjectURL",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.object)}),this.ctx.override(this.URL,"revokeObjectURL",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({url:n},t,r);return this.emit("revokeObjectURL",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.url)})}},Me=C;var Ne=p(c(),1);var Ee=p(c(),1);var T=class extends Ee.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.localStorage=this.window.localStorage||null,this.sessionStorage=this.window.sessionStorage||null,this.Storage=this.window.Storage||{},this.storeProto=this.Storage.prototype||{},this.getItem=this.storeProto.getItem||null,this.setItem=this.storeProto.setItem||null,this.removeItem=this.storeProto.removeItem||null,this.clear=this.storeProto.clear||null,this.key=this.storeProto.key||null,this.methods=["key","getItem","setItem","removeItem","clear"],this.wrappers=new t.nativeMethods.Map}overrideMethods(){this.ctx.override(this.storeProto,"getItem",(t,r,e)=>{if(!e.length)return t.apply(this.wrappers.get(r)||r,e);let[n]=e,i=new s({name:n},t,this.wrappers.get(r)||r);return this.emit("getItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.storeProto,"setItem",(t,r,e)=>{if(2>e.length)return t.apply(this.wrappers.get(r)||r,e);let[n,i]=e,o=new s({name:n,value:i},t,this.wrappers.get(r)||r);return this.emit("setItem",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.storeProto,"removeItem",(t,r,e)=>{if(!e.length)return t.apply(this.wrappers.get(r)||r,e);let[n]=e,i=new s({name:n},t,this.wrappers.get(r)||r);return this.emit("removeItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.storeProto,"clear",(t,r)=>{let e=new s(null,t,this.wrappers.get(r)||r);return this.emit("clear",e),e.intercepted?e.returnValue:e.target.call(e.that)}),this.ctx.override(this.storeProto,"key",(t,r,e)=>{if(!e.length)return t.apply(this.wrappers.get(r)||r,e);let[n]=e,i=new s({index:n},t,this.wrappers.get(r)||r);return this.emit("key",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.index)})}overrideLength(){this.ctx.overrideDescriptor(this.storeProto,"length",{get:(t,r)=>{let e=new s({length:t.call(this.wrappers.get(r)||r)},t,this.wrappers.get(r)||r);return this.emit("length",e),e.intercepted?e.returnValue:e.data.length}})}emulate(t,r={}){this.ctx.nativeMethods.setPrototypeOf(r,this.storeProto);let e=new this.ctx.window.Proxy(r,{get:(n,i)=>{if(i in this.storeProto||typeof i=="symbol")return t[i];let o=new s({name:i},null,t);return this.emit("get",o),o.intercepted?o.returnValue:t[o.data.name]},set:(n,i,o)=>{if(i in this.storeProto||typeof i=="symbol")return t[i]=o;let l=new s({name:i,value:o},null,t);return this.emit("set",l),l.intercepted?l.returnValue:t[l.data.name]=l.data.value},deleteProperty:(n,i)=>{if(typeof i=="symbol")return delete t[i];let o=new s({name:i},null,t);return this.emit("delete",o),o.intercepted?o.returnValue:delete t[o.data.name]}});return this.wrappers.set(e,t),this.ctx.nativeMethods.setPrototypeOf(e,this.storeProto),e}},Se=T;var De=p(c(),1);var U=class extends De.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.CSSStyleDeclaration=this.window.CSSStyleDeclaration||{},this.cssStyleProto=this.CSSStyleDeclaration.prototype||{},this.getPropertyValue=this.cssStyleProto.getPropertyValue||null,this.setProperty=this.cssStyleProto.setProperty||null,this.cssText-t.nativeMethods.getOwnPropertyDescriptors(this.cssStyleProto,"cssText"),this.urlProps=["background","backgroundImage","borderImage","borderImageSource","listStyle","listStyleImage","cursor"],this.dashedUrlProps=["background","background-image","border-image","border-image-source","list-style","list-style-image","cursor"],this.propToDashed={background:"background",backgroundImage:"background-image",borderImage:"border-image",borderImageSource:"border-image-source",listStyle:"list-style",listStyleImage:"list-style-image",cursor:"cursor"}}overrideSetGetProperty(){this.ctx.override(this.cssStyleProto,"getPropertyValue",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({property:n},t,r);return this.emit("getPropertyValue",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.property)}),this.ctx.override(this.cssStyleProto,"setProperty",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({property:n,value:i},t,r);return this.emit("setProperty",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.property,o.data.value)})}overrideCssText(){this.ctx.overrideDescriptor(this.cssStyleProto,"cssText",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getCssText",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setCssText",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}},Ve=U;var ke=p(c(),1);var j=class extends ke.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.IDBDatabase=this.window.IDBDatabase||{},this.idbDatabaseProto=this.IDBDatabase.prototype||{},this.IDBFactory=this.window.IDBFactory||{},this.idbFactoryProto=this.IDBFactory.prototype||{},this.open=this.idbFactoryProto.open}overrideOpen(){this.ctx.override(this.IDBFactory.prototype,"open",(t,r,e)=>{if(!e.length||!e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,version:i},t,r);return this.emit("idbFactoryOpen",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.version)})}overrideName(){this.ctx.overrideDescriptor(this.idbDatabaseProto,"name",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("idbFactoryName",e),e.intercepted?e.returnValue:e.data.value}})}},Re=j;var y=class extends Ne.default{constructor(t=self,r=!t.window){super(),this.window=t,this.nativeMethods={fnToString:this.window.Function.prototype.toString,defineProperty:this.window.Object.defineProperty,getOwnPropertyDescriptor:this.window.Object.getOwnPropertyDescriptor,getOwnPropertyDescriptors:this.window.Object.getOwnPropertyDescriptors,getOwnPropertyNames:this.window.Object.getOwnPropertyNames,keys:this.window.Object.keys,getOwnPropertySymbols:this.window.Object.getOwnPropertySymbols,isArray:this.window.Array.isArray,setPrototypeOf:this.window.Object.setPrototypeOf,isExtensible:this.window.Object.isExtensible,Map:this.window.Map,Proxy:this.window.Proxy},this.worker=r,this.fetch=new ue(this),this.xhr=new ce(this),this.idb=new Re(this),this.history=new fe(this),this.element=new ee(this),this.node=new re(this),this.document=new Z(this),this.function=new se(this),this.object=new le(this),this.message=new Pe(this),this.navigator=new xe(this),this.eventSource=new ve(this),this.attribute=new ne(this),this.url=new Me(this),this.workers=new Le(this),this.location=new N(this),this.storage=new Se(this),this.style=new Ve(this)}initLocation(t,r){this.location=new N(this,r,t,this.worker)}override(t,r,e,n){let i=this.wrap(t,r,e,n);return t[r]=i,i}overrideDescriptor(t,r,e={}){let n=this.wrapDescriptor(t,r,e);return n?(this.nativeMethods.defineProperty(t,r,n),n):{}}wrap(t,r,e,n){let i=t[r];if(!i)return i;let o="prototype"in i?function(){return e(i,this,[...arguments])}:{attach(){return e(i,this,[...arguments])}}.attach;return n&&(o.prototype=i.prototype,o.prototype.constructor=o),this.emit("wrap",i,o,!!n),o}wrapDescriptor(t,r,e={}){let n=this.nativeMethods.getOwnPropertyDescriptor(t,r);if(!n)return!1;for(let i in e)i in n&&(i==="get"||i==="set"?n[i]=this.wrap(n,i,e[i]):n[i]=typeof e[i]=="function"?e[i](n[i]):e[i]);return n}},Qt=y;typeof self=="object"&&(self.UVClient=y);})();
(()=>{var Ie=Object.create;var q=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ue=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports);var je=(a,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ae(t))!Te.call(a,n)&&n!==r&&q(a,n,{get:()=>t[n],enumerable:!(e=He(t,n))||e.enumerable});return a};var p=(a,t,r)=>(r=a!=null?Ie(Ce(a)):{},je(t||!a||!a.__esModule?q(r,"default",{value:a,enumerable:!0}):r,a));var c=Ue((Xe,P)=>{"use strict";var m=typeof Reflect=="object"?Reflect:null,_=m&&typeof m.apply=="function"?m.apply:function(t,r,e){return Function.prototype.apply.call(t,r,e)},f;m&&typeof m.ownKeys=="function"?f=m.ownKeys:Object.getOwnPropertySymbols?f=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:f=function(t){return Object.getOwnPropertyNames(t)};function qe(a){console&&console.warn&&console.warn(a)}var W=Number.isNaN||function(t){return t!==t};function h(){h.init.call(this)}P.exports=h;P.exports.once=Be;h.EventEmitter=h;h.prototype._events=void 0;h.prototype._eventsCount=0;h.prototype._maxListeners=void 0;var F=10;function w(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return F},set:function(a){if(typeof a!="number"||a<0||W(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");F=a}});h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};h.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||W(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function B(a){return a._maxListeners===void 0?h.defaultMaxListeners:a._maxListeners}h.prototype.getMaxListeners=function(){return B(this)};h.prototype.emit=function(t){for(var r=[],e=1;e<arguments.length;e++)r.push(arguments[e]);var n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var u=i[t];if(u===void 0)return!1;if(typeof u=="function")_(u,this,r);else for(var d=u.length,v=z(u,d),e=0;e<d;++e)_(v[e],this,r);return!0};function G(a,t,r,e){var n,i,o;if(w(r),i=a._events,i===void 0?(i=a._events=Object.create(null),a._eventsCount=0):(i.newListener!==void 0&&(a.emit("newListener",t,r.listener?r.listener:r),i=a._events),o=i[t]),o===void 0)o=i[t]=r,++a._eventsCount;else if(typeof o=="function"?o=i[t]=e?[r,o]:[o,r]:e?o.unshift(r):o.push(r),n=B(a),n>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=a,l.type=t,l.count=o.length,qe(l)}return a}h.prototype.addListener=function(t,r){return G(this,t,r,!1)};h.prototype.on=h.prototype.addListener;h.prototype.prependListener=function(t,r){return G(this,t,r,!0)};function _e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function K(a,t,r){var e={fired:!1,wrapFn:void 0,target:a,type:t,listener:r},n=_e.bind(e);return n.listener=r,e.wrapFn=n,n}h.prototype.once=function(t,r){return w(r),this.on(t,K(this,t,r)),this};h.prototype.prependOnceListener=function(t,r){return w(r),this.prependListener(t,K(this,t,r)),this};h.prototype.removeListener=function(t,r){var e,n,i,o,l;if(w(r),n=this._events,n===void 0)return this;if(e=n[t],e===void 0)return this;if(e===r||e.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,e.listener||r));else if(typeof e!="function"){for(i=-1,o=e.length-1;o>=0;o--)if(e[o]===r||e[o].listener===r){l=e[o].listener,i=o;break}if(i<0)return this;i===0?e.shift():Fe(e,i),e.length===1&&(n[t]=e[0]),n.removeListener!==void 0&&this.emit("removeListener",t,l||r)}return this};h.prototype.off=h.prototype.removeListener;h.prototype.removeAllListeners=function(t){var r,e,n;if(e=this._events,e===void 0)return this;if(e.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):e[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete e[t]),this;if(arguments.length===0){var i=Object.keys(e),o;for(n=0;n<i.length;++n)o=i[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=e[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(t,r[n]);return this};function X(a,t,r){var e=a._events;if(e===void 0)return[];var n=e[t];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?We(n):z(n,n.length)}h.prototype.listeners=function(t){return X(this,t,!0)};h.prototype.rawListeners=function(t){return X(this,t,!1)};h.listenerCount=function(a,t){return typeof a.listenerCount=="function"?a.listenerCount(t):Q.call(a,t)};h.prototype.listenerCount=Q;function Q(a){var t=this._events;if(t!==void 0){var r=t[a];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function z(a,t){for(var r=new Array(t),e=0;e<t;++e)r[e]=a[e];return r}function Fe(a,t){for(;t+1<a.length;t++)a[t]=a[t+1];a.pop()}function We(a){for(var t=new Array(a.length),r=0;r<t.length;++r)t[r]=a[r].listener||a[r];return t}function Be(a,t){return new Promise(function(r,e){function n(o){a.removeListener(t,i),e(o)}function i(){typeof a.removeListener=="function"&&a.removeListener("error",n),r([].slice.call(arguments))}J(a,t,i,{once:!0}),t!=="error"&&Ge(a,n,{once:!0})})}function Ge(a,t,r){typeof a.on=="function"&&J(a,"error",t,r)}function J(a,t,r,e){if(typeof a.on=="function")e.once?a.once(t,r):a.on(t,r);else if(typeof a.addEventListener=="function")a.addEventListener(t,function n(i){e.once&&a.removeEventListener(t,n),r(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}});var Y=p(c(),1);var g=class{#e;#t;constructor(t={},r=null,e=null){this.#e=!1,this.#t=null,this.data=t,this.target=r,this.that=e}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(t){this.#t=t,this.#e=!0}},s=g;var x=class extends Y.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.document=this.window.document,this.Document=this.window.Document||{},this.DOMParser=this.window.DOMParser||{},this.docProto=this.Document.prototype||{},this.domProto=this.DOMParser.prototype||{},this.title=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"title"),this.cookie=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"cookie"),this.referrer=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"referrer"),this.domain=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"domain"),this.documentURI=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"documentURI"),this.write=this.docProto.write,this.writeln=this.docProto.writeln,this.querySelector=this.docProto.querySelector,this.querySelectorAll=this.docProto.querySelectorAll,this.parseFromString=this.domProto.parseFromString,this.URL=t.nativeMethods.getOwnPropertyDescriptor(this.docProto,"URL")}overrideParseFromString(){this.ctx.override(this.domProto,"parseFromString",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({string:n,type:i},t,r);return this.emit("parseFromString",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.string,o.data.type)})}overrideQuerySelector(){this.ctx.override(this.docProto,"querySelector",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({selectors:n},t,r);return this.emit("querySelector",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.selectors)})}overrideDomain(){this.ctx.overrideDescriptor(this.docProto,"domain",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getDomain",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setDomain",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}overrideReferrer(){this.ctx.overrideDescriptor(this.docProto,"referrer",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("referrer",e),e.intercepted?e.returnValue:e.data.value}})}overrideCreateTreeWalker(){this.ctx.override(this.docProto,"createTreeWalker",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i=4294967295,o,l]=e,u=new s({root:n,show:i,filter:o,expandEntityReferences:l},t,r);return this.emit("createTreeWalker",u),u.intercepted?u.returnValue:u.target.call(u.that,u.data.root,u.data.show,u.data.filter,u.data.expandEntityReferences)})}overrideWrite(){this.ctx.override(this.docProto,"write",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[...n]=e,i=new s({html:n},t,r);return this.emit("write",i),i.intercepted?i.returnValue:i.target.apply(i.that,i.data.html)}),this.ctx.override(this.docProto,"writeln",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[...n]=e,i=new s({html:n},t,r);return this.emit("writeln",i),i.intercepted?i.returnValue:i.target.apply(i.that,i.data.html)})}overrideDocumentURI(){this.ctx.overrideDescriptor(this.docProto,"documentURI",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("documentURI",e),e.intercepted?e.returnValue:e.data.value}})}overrideURL(){this.ctx.overrideDescriptor(this.docProto,"URL",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("url",e),e.intercepted?e.returnValue:e.data.value}})}overrideCookie(){this.ctx.overrideDescriptor(this.docProto,"cookie",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getCookie",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setCookie",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}overrideTitle(){this.ctx.overrideDescriptor(this.docProto,"title",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getTitle",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setTitle",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}},Z=x;var $=p(c(),1);var b=class extends $.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Audio=this.window.Audio,this.Element=this.window.Element,this.elemProto=this.Element?this.Element.prototype:{},this.innerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"innerHTML"),this.outerHTML=t.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"outerHTML"),this.setAttribute=this.elemProto.setAttribute,this.getAttribute=this.elemProto.getAttribute,this.removeAttribute=this.elemProto.removeAttribute,this.hasAttribute=this.elemProto.hasAttribute,this.querySelector=this.elemProto.querySelector,this.querySelectorAll=this.elemProto.querySelectorAll,this.insertAdjacentHTML=this.elemProto.insertAdjacentHTML,this.insertAdjacentText=this.elemProto.insertAdjacentText}overrideQuerySelector(){this.ctx.override(this.elemProto,"querySelector",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({selectors:n},t,r);return this.emit("querySelector",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.selectors)})}overrideAttribute(){this.ctx.override(this.elemProto,"getAttribute",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("getAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.elemProto,"setAttribute",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setAttribute",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.elemProto,"hasAttribute",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("hasAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.elemProto,"removeAttribute",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("removeAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)})}overrideAudio(){this.ctx.override(this.window,"Audio",(t,r,e)=>{if(!e.length)return new t(...e);let[n]=e,i=new s({url:n},t,r);return this.emit("audio",i),i.intercepted?i.returnValue:new i.target(i.data.url)},!0)}overrideHtml(){this.hookProperty(this.Element,"innerHTML",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getInnerHTML",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);if(this.emit("setInnerHTML",n),n.intercepted)return n.returnValue;t.call(r,n.data.value)}}),this.hookProperty(this.Element,"outerHTML",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getOuterHTML",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);if(this.emit("setOuterHTML",n),n.intercepted)return n.returnValue;t.call(r,n.data.value)}})}overrideInsertAdjacentHTML(){this.ctx.override(this.elemProto,"insertAdjacentHTML",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({position:n,html:i},t,r);return this.emit("insertAdjacentHTML",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.position,o.data.html)})}overrideInsertAdjacentText(){this.ctx.override(this.elemProto,"insertAdjacentText",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({position:n,text:i},t,r);return this.emit("insertAdjacentText",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.position,o.data.text)})}hookProperty(t,r,e){if(!t)return!1;if(this.ctx.nativeMethods.isArray(t)){for(let i of t)this.hookProperty(i,r,e);return!0}let n=t.prototype;return this.ctx.overrideDescriptor(n,r,e),!0}},ee=b;var te=p(c(),1);var L=class extends te.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Node=t.window.Node||{},this.nodeProto=this.Node.prototype||{},this.compareDocumentPosition=this.nodeProto.compareDocumentPosition,this.contains=this.nodeProto.contains,this.insertBefore=this.nodeProto.insertBefore,this.replaceChild=this.nodeProto.replaceChild,this.append=this.nodeProto.append,this.appendChild=this.nodeProto.appendChild,this.removeChild=this.nodeProto.removeChild,this.textContent=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"textContent"),this.parentNode=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentNode"),this.parentElement=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentElement"),this.childNodes=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"childNodes"),this.baseURI=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"baseURI"),this.previousSibling=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"previousSibling"),this.ownerDocument=t.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"ownerDocument")}overrideTextContent(){this.ctx.overrideDescriptor(this.nodeProto,"textContent",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getTextContent",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);if(this.emit("setTextContent",n),n.intercepted)return n.returnValue;t.call(r,n.data.value)}})}overrideAppend(){this.ctx.override(this.nodeProto,"append",(t,r,[...e])=>{let n=new s({nodes:e},t,r);return this.emit("append",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.nodes)}),this.ctx.override(this.nodeProto,"appendChild",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({node:n},t,r);return this.emit("appendChild",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.node)})}overrideBaseURI(){this.ctx.overrideDescriptor(this.nodeProto,"baseURI",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("baseURI",e),e.intercepted?e.returnValue:e.data.value}})}overrideParent(){this.ctx.overrideDescriptor(this.nodeProto,"parentNode",{get:(t,r)=>{let e=new s({node:t.call(r)},t,r);return this.emit("parentNode",e),e.intercepted?e.returnValue:e.data.node}}),this.ctx.overrideDescriptor(this.nodeProto,"parentElement",{get:(t,r)=>{let e=new s({element:t.call(r)},t,r);return this.emit("parentElement",e),e.intercepted?e.returnValue:e.data.node}})}overrideOwnerDocument(){this.ctx.overrideDescriptor(this.nodeProto,"ownerDocument",{get:(t,r)=>{let e=new s({document:t.call(r)},t,r);return this.emit("ownerDocument",e),e.intercepted?e.returnValue:e.data.document}})}overrideCompareDocumentPosit1ion(){this.ctx.override(this.nodeProto,"compareDocumentPosition",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({node:n},t,r);return i.intercepted?i.returnValue:i.target.call(i.that,i.data.node)})}overrideChildMethods(){this.ctx.override(this.nodeProto,"removeChild")}},re=L;var ie=p(c(),1);var O=class extends ie.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Attr=this.window.Attr||{},this.attrProto=this.Attr.prototype||{},this.value=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"value"),this.name=t.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"name"),this.getNamedItem=this.attrProto.getNamedItem||null,this.setNamedItem=this.attrProto.setNamedItem||null,this.removeNamedItem=this.attrProto.removeNamedItem||null,this.getNamedItemNS=this.attrProto.getNamedItemNS||null,this.setNamedItemNS=this.attrProto.setNamedItemNS||null,this.removeNamedItemNS=this.attrProto.removeNamedItemNS||null,this.item=this.attrProto.item||null}overrideNameValue(){this.ctx.overrideDescriptor(this.attrProto,"name",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("name",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.overrideDescriptor(this.attrProto,"value",{get:(t,r)=>{let e=new s({name:this.name.get.call(r),value:t.call(r)},t,r);return this.emit("getValue",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({name:this.name.get.call(r),value:e},t,r);if(this.emit("setValue",n),n.intercepted)return n.returnValue;n.target.call(n.that,n.data.value)}})}overrideItemMethods(){this.ctx.override(this.attrProto,"getNamedItem",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("getNamedItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"setNamedItem",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setNamedItem",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.attrProto,"removeNamedItem",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("removeNamedItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"item",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({index:n},t,r);return this.emit("item",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"getNamedItemNS",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({namespace:n,localName:i},t,r);return this.emit("getNamedItemNS",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.namespace,o.data.localName)}),this.ctx.override(this.attrProto,"setNamedItemNS",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({attr:n},t,r);return this.emit("setNamedItemNS",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"removeNamedItemNS",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({namespace:n,localName:i},t,r);return this.emit("removeNamedItemNS",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.namespace,o.data.localName)})}},ne=O;var oe=p(c(),1);var M=class extends oe.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Function=this.window.Function,this.fnProto=this.Function.prototype,this.toString=this.fnProto.toString,this.fnStrings=t.fnStrings,this.call=this.fnProto.call,this.apply=this.fnProto.apply,this.bind=this.fnProto.bind}overrideFunction(){this.ctx.override(this.window,"Function",(t,r,e)=>{if(!e.length)return t.apply(r,e);let n=e[e.length-1],i=[];for(let l=0;l<e.length-1;l++)i.push(e[l]);let o=new s({script:n,args:i},t,r);return this.emit("function",o),o.intercepted?o.returnValue:o.target.call(o.that,...o.data.args,o.data.script)},!0)}overrideToString(){this.ctx.override(this.fnProto,"toString",(t,r)=>{let e=new s({fn:r},t,r);return this.emit("toString",e),e.intercepted?e.returnValue:e.target.call(e.data.fn)})}},se=M;var ae=p(c(),1);var E=class extends ae.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Object=this.window.Object,this.getOwnPropertyDescriptors=this.Object.getOwnPropertyDescriptors,this.getOwnPropertyDescriptor=this.Object.getOwnPropertyDescriptor,this.getOwnPropertyNames=this.Object.getOwnPropertyNames}overrideGetPropertyNames(){this.ctx.override(this.Object,"getOwnPropertyNames",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({names:t.call(r,n)},t,r);return this.emit("getOwnPropertyNames",i),i.intercepted?i.returnValue:i.data.names})}overrideGetOwnPropertyDescriptors(){this.ctx.override(this.Object,"getOwnPropertyDescriptors",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({descriptors:t.call(r,n)},t,r);return this.emit("getOwnPropertyDescriptors",i),i.intercepted?i.returnValue:i.data.descriptors})}},le=E;var he=p(c(),1);var S=class extends he.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.fetch=this.window.fetch,this.Request=this.window.Request,this.Response=this.window.Response,this.Headers=this.window.Headers,this.reqProto=this.Request?this.Request.prototype:{},this.resProto=this.Response?this.Response.prototype:{},this.headersProto=this.Headers?this.Headers.prototype:{},this.reqUrl=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"url"),this.resUrl=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"url"),this.reqHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"headers"),this.resHeaders=t.nativeMethods.getOwnPropertyDescriptor(this.resProto,"headers")}override(){return this.overrideRequest(),this.overrideUrl(),this.overrideHeaders(),!0}overrideRequest(){return this.fetch?(this.ctx.override(this.window,"fetch",(t,r,e)=>{if(!e.length||e[0]instanceof this.Request)return t.apply(r,e);let[n,i={}]=e,o=new s({input:n,options:i},t,r);return this.emit("request",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.input,o.data.options)}),this.ctx.override(this.window,"Request",(t,r,e)=>{if(!e.length)return new t(...e);let[n,i={}]=e,o=new s({input:n,options:i},t);return this.emit("request",o),o.intercepted?o.returnValue:new o.target(o.data.input,o.data.options)},!0),!0):!1}overrideUrl(){return this.ctx.overrideDescriptor(this.reqProto,"url",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("requestUrl",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.overrideDescriptor(this.resProto,"url",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("responseUrl",e),e.intercepted?e.returnValue:e.data.value}}),!0}overrideHeaders(){return this.Headers?(this.ctx.overrideDescriptor(this.reqProto,"headers",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("requestHeaders",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.overrideDescriptor(this.resProto,"headers",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("responseHeaders",e),e.intercepted?e.returnValue:e.data.value}}),this.ctx.override(this.headersProto,"get",(t,r,[e])=>{if(!e)return t.call(r);let n=new s({name:e,value:t.call(r,e)},t,r);return this.emit("getHeader",n),n.intercepted?n.returnValue:n.data.value}),this.ctx.override(this.headersProto,"set",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setHeader",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.headersProto,"has",(t,r,e)=>{if(!e.length)return t.call(r);let[n]=e,i=new s({name:n,value:t.call(r,n)},t,r);return this.emit("hasHeader",i),i.intercepted?i.returnValue:i.data}),this.ctx.override(this.headersProto,"append",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("appendHeader",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.headersProto,"delete",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n},t,r);return this.emit("deleteHeader",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),!0):!1}},ue=S;var de=p(c(),1);var D=class extends de.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.XMLHttpRequest=this.window.XMLHttpRequest,this.xhrProto=this.window.XMLHttpRequest?this.window.XMLHttpRequest.prototype:{},this.open=this.xhrProto.open,this.abort=this.xhrProto.abort,this.send=this.xhrProto.send,this.overrideMimeType=this.xhrProto.overrideMimeType,this.getAllResponseHeaders=this.xhrProto.getAllResponseHeaders,this.getResponseHeader=this.xhrProto.getResponseHeader,this.setRequestHeader=this.xhrProto.setRequestHeader,this.responseURL=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseURL"),this.responseText=t.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseText")}override(){this.overrideOpen(),this.overrideSend(),this.overrideMimeType(),this.overrideGetResHeader(),this.overrideGetResHeaders(),this.overrideSetReqHeader()}overrideOpen(){this.ctx.override(this.xhrProto,"open",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i,o=!0,l=null,u=null]=e,d=new s({method:n,input:i,async:o,user:l,password:u},t,r);return this.emit("open",d),d.intercepted?d.returnValue:d.target.call(d.that,d.data.method,d.data.input,d.data.async,d.data.user,d.data.password)})}overrideResponseUrl(){this.ctx.overrideDescriptor(this.xhrProto,"responseURL",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("responseUrl",e),e.intercepted?e.returnValue:e.data.value}})}overrideSend(){this.ctx.override(this.xhrProto,"send",(t,r,[e=null])=>{let n=new s({body:e},t,r);return this.emit("send",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.body)})}overrideSetReqHeader(){this.ctx.override(this.xhrProto,"setRequestHeader",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,value:i},t,r);return this.emit("setReqHeader",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)})}overrideGetResHeaders(){this.ctx.override(this.xhrProto,"getAllResponseHeaders",(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getAllResponseHeaders",e),e.intercepted?e.returnValue:e.data.value})}overrideGetResHeader(){this.ctx.override(this.xhrProto,"getResponseHeader",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({name:n,value:t.call(r,n)},t,r);return i.intercepted?i.returnValue:i.data.value})}},ce=D;var pe=p(c(),1);var V=class extends pe.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.EventSource=this.window.EventSource||{},this.esProto=this.EventSource.prototype||{},this.url=t.nativeMethods.getOwnPropertyDescriptor(this.esProto,"url"),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2}overrideConstruct(){this.ctx.override(this.window,"EventSource",(t,r,e)=>{if(!e.length)return new t(...e);let[n,i={}]=e,o=new s({url:n,config:i},t,r);return this.emit("construct",o),o.intercepted?o.returnValue:new o.target(o.data.url,o.data.config)},!0),"EventSource"in this.window&&(this.window.EventSource.CONNECTING=this.CONNECTING,this.window.EventSource.OPEN=this.OPEN,this.window.EventSource.CLOSED=this.CLOSED)}overrideUrl(){this.ctx.overrideDescriptor(this.esProto,"url",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("url",e),e.data.value}})}},ve=V;var me=p(c(),1);var k=class extends me.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.History=this.window.History,this.history=this.window.history,this.historyProto=this.History?this.History.prototype:{},this.pushState=this.historyProto.pushState,this.replaceState=this.historyProto.replaceState,this.go=this.historyProto.go,this.back=this.historyProto.back,this.forward=this.historyProto.forward}override(){this.overridePushState(),this.overrideReplaceState(),this.overrideGo(),this.overrideForward(),this.overrideBack()}overridePushState(){this.ctx.override(this.historyProto,"pushState",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i,o=""]=e,l=new s({state:n,title:i,url:o},t,r);return this.emit("pushState",l),l.intercepted?l.returnValue:l.target.call(l.that,l.data.state,l.data.title,l.data.url)})}overrideReplaceState(){this.ctx.override(this.historyProto,"replaceState",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i,o=""]=e,l=new s({state:n,title:i,url:o},t,r);return this.emit("replaceState",l),l.intercepted?l.returnValue:l.target.call(l.that,l.data.state,l.data.title,l.data.url)})}overrideGo(){this.ctx.override(this.historyProto,"go",(t,r,[e])=>{let n=new s({delta:e},t,r);return this.emit("go",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.delta)})}overrideForward(){this.ctx.override(this.historyProto,"forward",(t,r)=>{let e=new s(null,t,r);return this.emit("forward",e),e.intercepted?e.returnValue:e.target.call(e.that)})}overrideBack(){this.ctx.override(this.historyProto,"back",(t,r)=>{let e=new s(null,t,r);return this.emit("back",e),e.intercepted?e.returnValue:e.target.call(e.that)})}},fe=k;var we=p(c(),1),R=class extends we.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.location=this.window.location,this.WorkerLocation=this.ctx.worker?this.window.WorkerLocation:null,this.workerLocProto=this.WorkerLocation?this.WorkerLocation.prototype:{},this.keys=["href","protocol","host","hostname","port","pathname","search","hash","origin"],this.HashChangeEvent=this.window.HashChangeEvent||null,this.href=this.WorkerLocation?t.nativeMethods.getOwnPropertyDescriptor(this.workerLocProto,"href"):t.nativeMethods.getOwnPropertyDescriptor(this.location,"href")}overrideWorkerLocation(t){if(!this.WorkerLocation)return!1;let r=this;for(let e of this.keys)this.ctx.overrideDescriptor(this.workerLocProto,e,{get:()=>t(r.href.get.call(this.location))[e]});return!0}emulate(t,r){let e={},n=this;for(let i of n.keys)this.ctx.nativeMethods.defineProperty(e,i,{get(){return t(n.href.get.call(n.location))[i]},set:i!=="origin"?function(o){switch(i){case"href":n.location.href=r(o);break;case"hash":n.emit("hashchange",e.href,o.trim().startsWith("#")?new URL(o.trim(),e.href).href:new URL("#"+o.trim(),e.href).href,n);break;default:{let l=new URL(e.href);l[i]=o,n.location.href=r(l.href)}break}}:void 0,configurable:!1,enumerable:!0});return"reload"in this.location&&this.ctx.nativeMethods.defineProperty(e,"reload",{value:this.ctx.wrap(this.location,"reload",(i,o)=>i.call(o===e?this.location:o)),writable:!1,enumerable:!0}),"replace"in this.location&&this.ctx.nativeMethods.defineProperty(e,"replace",{value:this.ctx.wrap(this.location,"assign",(i,o,l)=>{(!l.length||o!==e)&&i.call(o),o=this.location;let[u]=l,d=new URL(u,e.href);return i.call(o===e?this.location:o,r(d.href))}),writable:!1,enumerable:!0}),"assign"in this.location&&this.ctx.nativeMethods.defineProperty(e,"assign",{value:this.ctx.wrap(this.location,"assign",(i,o,l)=>{(!l.length||o!==e)&&i.call(o),o=this.location;let[u]=l,d=new URL(u,e.href);return i.call(o===e?this.location:o,r(d.href))}),writable:!1,enumerable:!0}),"ancestorOrigins"in this.location&&this.ctx.nativeMethods.defineProperty(e,"ancestorOrigins",{get(){let i=[];return n.window.DOMStringList&&n.ctx.nativeMethods.setPrototypeOf(i,n.window.DOMStringList.prototype),i},set:void 0,enumerable:!0}),this.ctx.nativeMethods.defineProperty(e,"toString",{value:this.ctx.wrap(this.location,"toString",()=>e.href),enumerable:!0,writable:!1}),this.ctx.nativeMethods.defineProperty(e,Symbol.toPrimitive,{value:()=>e.href,writable:!1,enumerable:!1}),this.ctx.window.Location&&this.ctx.nativeMethods.setPrototypeOf(e,this.ctx.window.Location.prototype),e}},N=R;var ye=p(c(),1);var I=class extends ye.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.postMessage=this.window.postMessage,this.MessageEvent=this.window.MessageEvent||{},this.MessagePort=this.window.MessagePort||{},this.mpProto=this.MessagePort.prototype||{},this.mpPostMessage=this.mpProto.postMessage,this.messageProto=this.MessageEvent.prototype||{},this.messageData=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"data"),this.messageOrigin=t.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"origin")}overridePostMessage(){this.ctx.override(this.window,"postMessage",(t,r,e)=>{if(!e.length)return t.apply(r,e);let n,i,o;this.ctx.worker?[n,o=[]]=e:[n,i,o=[]]=e;let l=new s({message:n,origin:i,transfer:o,worker:this.ctx.worker},t,r);return this.emit("postMessage",l),l.intercepted?l.returnValue:this.ctx.worker?l.target.call(l.that,l.data.message,l.data.transfer):l.target.call(l.that,l.data.message,l.data.origin,l.data.transfer)})}wrapPostMessage(t,r,e=!1){return this.ctx.wrap(t,r,(n,i,o)=>{if(this.ctx.worker?!o.length:2>o)return n.apply(i,o);let l,u,d;e?([l,d=[]]=o,u=null):[l,u,d=[]]=o;let v=new s({message:l,origin:u,transfer:d,worker:this.ctx.worker},n,t);return this.emit("postMessage",v),v.intercepted?v.returnValue:e?v.target.call(v.that,v.data.message,v.data.transfer):v.target.call(v.that,v.data.message,v.data.origin,v.data.transfer)})}overrideMessageOrigin(){this.ctx.overrideDescriptor(this.messageProto,"origin",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("origin",e),e.intercepted?e.returnValue:e.data.value}})}overrideMessageData(){this.ctx.overrideDescriptor(this.messageProto,"data",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("data",e),e.intercepted?e.returnValue:e.data.value}})}},Pe=I;var ge=p(c(),1);var H=class extends ge.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.navigator=this.window.navigator,this.Navigator=this.window.Navigator||{},this.navProto=this.Navigator.prototype||{},this.sendBeacon=this.navProto.sendBeacon}overrideSendBeacon(){this.ctx.override(this.navProto,"sendBeacon",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i=""]=e,o=new s({url:n,data:i},t,r);return this.emit("sendBeacon",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.url,o.data.data)})}},xe=H;var be=p(c(),1);var A=class extends be.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.Worker=this.window.Worker||{},this.Worklet=this.window.Worklet||{},this.workletProto=this.Worklet.prototype||{},this.workerProto=this.Worker.prototype||{},this.postMessage=this.workerProto.postMessage,this.terminate=this.workerProto.terminate,this.addModule=this.workletProto.addModule}overrideWorker(){this.ctx.override(this.window,"Worker",(t,r,e)=>{if(!e.length)return new t(...e);let[n,i={}]=e,o=new s({url:n,options:i},t,r);return this.emit("worker",o),o.intercepted?o.returnValue:new o.target(o.data.url,o.data.options)},!0)}overrideAddModule(){this.ctx.override(this.workletProto,"addModule",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i={}]=e,o=new s({url:n,options:i},t,r);return this.emit("addModule",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.url,o.data.options)})}overridePostMessage(){this.ctx.override(this.workerProto,"postMessage",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n,i=[]]=e,o=new s({message:n,transfer:i},t,r);return this.emit("postMessage",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.message,o.data.transfer)})}overrideImportScripts(){this.ctx.override(this.window,"importScripts",(t,r,e)=>{if(!e.length)return t.apply(r,e);let n=new s({scripts:e},t,r);return this.emit("importScripts",n),n.intercepted?n.returnValue:n.target.apply(n.that,n.data.scripts)})}},Le=A;var Oe=p(c(),1);var C=class extends Oe.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.URL=this.window.URL||{},this.createObjectURL=this.URL.createObjectURL,this.revokeObjectURL=this.URL.revokeObjectURL}overrideObjectURL(){this.ctx.override(this.URL,"createObjectURL",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({object:n},t,r);return this.emit("createObjectURL",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.object)}),this.ctx.override(this.URL,"revokeObjectURL",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({url:n},t,r);return this.emit("revokeObjectURL",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.url)})}},Me=C;var Ne=p(c(),1);var Ee=p(c(),1);var T=class extends Ee.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.localStorage=this.window.localStorage||null,this.sessionStorage=this.window.sessionStorage||null,this.Storage=this.window.Storage||{},this.storeProto=this.Storage.prototype||{},this.getItem=this.storeProto.getItem||null,this.setItem=this.storeProto.setItem||null,this.removeItem=this.storeProto.removeItem||null,this.clear=this.storeProto.clear||null,this.key=this.storeProto.key||null,this.methods=["key","getItem","setItem","removeItem","clear"],this.wrappers=new t.nativeMethods.Map}overrideMethods(){this.ctx.override(this.storeProto,"getItem",(t,r,e)=>{if(!e.length)return t.apply(this.wrappers.get(r)||r,e);let[n]=e,i=new s({name:n},t,this.wrappers.get(r)||r);return this.emit("getItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.storeProto,"setItem",(t,r,e)=>{if(2>e.length)return t.apply(this.wrappers.get(r)||r,e);let[n,i]=e,o=new s({name:n,value:i},t,this.wrappers.get(r)||r);return this.emit("setItem",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.value)}),this.ctx.override(this.storeProto,"removeItem",(t,r,e)=>{if(!e.length)return t.apply(this.wrappers.get(r)||r,e);let[n]=e,i=new s({name:n},t,this.wrappers.get(r)||r);return this.emit("removeItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.storeProto,"clear",(t,r)=>{let e=new s(null,t,this.wrappers.get(r)||r);return this.emit("clear",e),e.intercepted?e.returnValue:e.target.call(e.that)}),this.ctx.override(this.storeProto,"key",(t,r,e)=>{if(!e.length)return t.apply(this.wrappers.get(r)||r,e);let[n]=e,i=new s({index:n},t,this.wrappers.get(r)||r);return this.emit("key",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.index)})}overrideLength(){this.ctx.overrideDescriptor(this.storeProto,"length",{get:(t,r)=>{let e=new s({length:t.call(this.wrappers.get(r)||r)},t,this.wrappers.get(r)||r);return this.emit("length",e),e.intercepted?e.returnValue:e.data.length}})}emulate(t,r={}){this.ctx.nativeMethods.setPrototypeOf(r,this.storeProto);let e=new this.ctx.window.Proxy(r,{get:(n,i)=>{if(i in this.storeProto||typeof i=="symbol")return t[i];let o=new s({name:i},null,t);return this.emit("get",o),o.intercepted?o.returnValue:t[o.data.name]},set:(n,i,o)=>{if(i in this.storeProto||typeof i=="symbol")return t[i]=o;let l=new s({name:i,value:o},null,t);return this.emit("set",l),l.intercepted?l.returnValue:t[l.data.name]=l.data.value},deleteProperty:(n,i)=>{if(typeof i=="symbol")return delete t[i];let o=new s({name:i},null,t);return this.emit("delete",o),o.intercepted?o.returnValue:delete t[o.data.name]}});return this.wrappers.set(e,t),this.ctx.nativeMethods.setPrototypeOf(e,this.storeProto),e}},Se=T;var De=p(c(),1);var U=class extends De.default{constructor(t){super(),this.ctx=t,this.window=t.window,this.CSSStyleDeclaration=this.window.CSSStyleDeclaration||{},this.cssStyleProto=this.CSSStyleDeclaration.prototype||{},this.getPropertyValue=this.cssStyleProto.getPropertyValue||null,this.setProperty=this.cssStyleProto.setProperty||null,this.cssText-t.nativeMethods.getOwnPropertyDescriptors(this.cssStyleProto,"cssText"),this.urlProps=["background","backgroundImage","borderImage","borderImageSource","listStyle","listStyleImage","cursor"],this.dashedUrlProps=["background","background-image","border-image","border-image-source","list-style","list-style-image","cursor"],this.propToDashed={background:"background",backgroundImage:"background-image",borderImage:"border-image",borderImageSource:"border-image-source",listStyle:"list-style",listStyleImage:"list-style-image",cursor:"cursor"}}overrideSetGetProperty(){this.ctx.override(this.cssStyleProto,"getPropertyValue",(t,r,e)=>{if(!e.length)return t.apply(r,e);let[n]=e,i=new s({property:n},t,r);return this.emit("getPropertyValue",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.property)}),this.ctx.override(this.cssStyleProto,"setProperty",(t,r,e)=>{if(2>e.length)return t.apply(r,e);let[n,i]=e,o=new s({property:n,value:i},t,r);return this.emit("setProperty",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.property,o.data.value)})}overrideCssText(){this.ctx.overrideDescriptor(this.cssStyleProto,"cssText",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("getCssText",e),e.intercepted?e.returnValue:e.data.value},set:(t,r,[e])=>{let n=new s({value:e},t,r);return this.emit("setCssText",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}},Ve=U;var ke=p(c(),1);var j=class extends ke.default{constructor(t){super(),this.ctx=t,this.window=this.ctx.window,this.IDBDatabase=this.window.IDBDatabase||{},this.idbDatabaseProto=this.IDBDatabase.prototype||{},this.IDBFactory=this.window.IDBFactory||{},this.idbFactoryProto=this.IDBFactory.prototype||{},this.open=this.idbFactoryProto.open}overrideOpen(){this.ctx.override(this.IDBFactory.prototype,"open",(t,r,e)=>{if(!e.length||!e.length)return t.apply(r,e);let[n,i]=e,o=new s({name:n,version:i},t,r);return this.emit("idbFactoryOpen",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.name,o.data.version)})}overrideName(){this.ctx.overrideDescriptor(this.idbDatabaseProto,"name",{get:(t,r)=>{let e=new s({value:t.call(r)},t,r);return this.emit("idbFactoryName",e),e.intercepted?e.returnValue:e.data.value}})}},Re=j;var y=class extends Ne.default{constructor(t=self,r=!t.window){super(),this.window=t,this.nativeMethods={fnToString:this.window.Function.prototype.toString,defineProperty:this.window.Object.defineProperty,getOwnPropertyDescriptor:this.window.Object.getOwnPropertyDescriptor,getOwnPropertyDescriptors:this.window.Object.getOwnPropertyDescriptors,getOwnPropertyNames:this.window.Object.getOwnPropertyNames,keys:this.window.Object.keys,getOwnPropertySymbols:this.window.Object.getOwnPropertySymbols,isArray:this.window.Array.isArray,setPrototypeOf:this.window.Object.setPrototypeOf,isExtensible:this.window.Object.isExtensible,Map:this.window.Map,Proxy:this.window.Proxy},this.worker=r,this.fetch=new ue(this),this.xhr=new ce(this),this.idb=new Re(this),this.history=new fe(this),this.element=new ee(this),this.node=new re(this),this.document=new Z(this),this.function=new se(this),this.object=new le(this),this.message=new Pe(this),this.navigator=new xe(this),this.eventSource=new ve(this),this.attribute=new ne(this),this.url=new Me(this),this.workers=new Le(this),this.location=new N(this),this.storage=new Se(this),this.style=new Ve(this)}initLocation(t,r){this.location=new N(this,r,t,this.worker)}override(t,r,e,n){let i=this.wrap(t,r,e,n);return t[r]=i,i}overrideDescriptor(t,r,e={}){let n=this.wrapDescriptor(t,r,e);return n?(this.nativeMethods.defineProperty(t,r,n),n):{}}wrap(t,r,e,n){let i=t[r];if(!i)return i;let o="prototype"in i?function(){return e(i,this,[...arguments])}:{attach(){return e(i,this,[...arguments])}}.attach;return n&&(o.prototype=i.prototype,o.prototype.constructor=o),this.emit("wrap",i,o,!!n),o}wrapDescriptor(t,r,e={}){let n=this.nativeMethods.getOwnPropertyDescriptor(t,r);if(!n)return!1;for(let i in e)i in n&&(i==="get"||i==="set"?n[i]=this.wrap(n,i,e[i]):n[i]=typeof e[i]=="function"?e[i](n[i]):e[i]);return n}},Qt=y;typeof self=="object"&&(self.UVClient=y);})();
//# sourceMappingURL=uv.client.js.map
/*global Ultraviolet*/
self.__uv$config = {
prefix: '/service/',
bare: '/bare/',
encodeUrl: Ultraviolet.codec.xor.encode,

@@ -6,0 +5,0 @@ decodeUrl: Ultraviolet.codec.xor.decode,

@@ -1,2 +0,2 @@

"use strict";(()=>{var b=self.Ultraviolet,F=self.UVClient,V=self.__uv$config,p=self.__uv$bareData,g=self.__uv$bareURL,M=self.__uv$cookies;if(typeof p!="object"||typeof g!="string"||typeof M!="string")throw new TypeError("Unable to load global UV data");self.__uv||y(self);self.__uvHook=y;function y(o){if("__uv"in o&&o.__uv instanceof b)return!1;o.document&&o.window&&o.document.querySelectorAll("script[__uv-script]").forEach(t=>t.remove());let E=!o.window,_="__uv",s="__uv$",e=new b(V),x=WebSocket,a=new F(o),{HTMLMediaElement:f,HTMLScriptElement:S,HTMLAudioElement:O,HTMLVideoElement:j,HTMLInputElement:L,HTMLEmbedElement:T,HTMLTrackElement:H,HTMLAnchorElement:$,HTMLIFrameElement:d,HTMLAreaElement:W,HTMLLinkElement:C,HTMLBaseElement:A,HTMLFormElement:R,HTMLImageElement:P,HTMLSourceElement:D}=o;a.nativeMethods.defineProperty(o,"__uv",{value:e,enumerable:!1}),e.meta.origin=location.origin,e.location=a.location.emulate(t=>t==="about:srcdoc"?new URL(t):(t.startsWith("blob:")&&(t=t.slice(5)),new URL(e.sourceUrl(t))),t=>e.rewriteUrl(t));let c=M;e.meta.url=e.location,e.domain=e.meta.url.host,e.blobUrls=new o.Map,e.referrer="",e.cookies=[],e.localStorageObj={},e.sessionStorageObj={};let k=new b.BareClient;if(e.bareClient=k,e.location.href==="about:srcdoc"&&(e.meta=o.parent.__uv.meta),o.EventTarget&&(e.addEventListener=o.EventTarget.prototype.addEventListener,e.removeListener=o.EventTarget.prototype.removeListener,e.dispatchEvent=o.EventTarget.prototype.dispatchEvent),a.nativeMethods.defineProperty(a.storage.storeProto,"__uv$storageObj",{get(){if(this===a.storage.sessionStorage)return e.sessionStorageObj;if(this===a.storage.localStorage)return e.localStorageObj},enumerable:!1}),o.localStorage){for(let t in o.localStorage)t.startsWith(s+e.location.origin+"@")&&(e.localStorageObj[t.slice((s+e.location.origin+"@").length)]=o.localStorage.getItem(t));e.lsWrap=a.storage.emulate(a.storage.localStorage,e.localStorageObj)}if(o.sessionStorage){for(let t in o.sessionStorage)t.startsWith(s+e.location.origin+"@")&&(e.sessionStorageObj[t.slice((s+e.location.origin+"@").length)]=o.sessionStorage.getItem(t));e.ssWrap=a.storage.emulate(a.storage.sessionStorage,e.sessionStorageObj)}let m=o.document?a.node.baseURI.get.call(o.document):o.location.href,U=e.sourceUrl(m);a.nativeMethods.defineProperty(e.meta,"base",{get(){return o.document?(a.node.baseURI.get.call(o.document)!==m&&(m=a.node.baseURI.get.call(o.document),U=e.sourceUrl(m)),U):e.meta.url.href}}),e.methods={setSource:s+"setSource",source:s+"source",location:s+"location",function:s+"function",string:s+"string",eval:s+"eval",parent:s+"parent",top:s+"top"},e.filterKeys=[_,e.methods.setSource,e.methods.source,e.methods.location,e.methods.function,e.methods.string,e.methods.eval,e.methods.parent,e.methods.top,s+"protocol",s+"storageObj",s+"url",s+"modifiedStyle",s+"config",s+"dispatched","Ultraviolet","__uvHook"],a.on("wrap",(t,r)=>{a.nativeMethods.defineProperty(r,"name",a.nativeMethods.getOwnPropertyDescriptor(t,"name")),a.nativeMethods.defineProperty(r,"length",a.nativeMethods.getOwnPropertyDescriptor(t,"length")),a.nativeMethods.defineProperty(r,e.methods.string,{enumerable:!1,value:a.nativeMethods.fnToString.call(t)}),a.nativeMethods.defineProperty(r,e.methods.function,{enumerable:!1,value:t})}),a.fetch.on("request",t=>{t.data.input=e.rewriteUrl(t.data.input)}),a.fetch.on("requestUrl",t=>{t.data.value=e.sourceUrl(t.data.value)}),a.fetch.on("responseUrl",t=>{t.data.value=e.sourceUrl(t.data.value)}),a.xhr.on("open",t=>{t.data.input=e.rewriteUrl(t.data.input)}),a.xhr.on("responseUrl",t=>{t.data.value=e.sourceUrl(t.data.value)}),a.workers.on("worker",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.workers.on("addModule",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.workers.on("importScripts",t=>{for(let r in t.data.scripts)t.data.scripts[r]=e.rewriteUrl(t.data.scripts[r])}),a.workers.on("postMessage",t=>{let r=t.data.origin;t.data.origin="*",t.data.message={__data:t.data.message,__origin:e.meta.url.origin,__to:r}}),a.navigator.on("sendBeacon",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.document.on("getCookie",t=>{t.data.value=c}),a.document.on("setCookie",t=>{e.cookie.db().then(i=>{e.cookie.setCookies(t.data.value,i,e.meta),e.cookie.getCookies(i).then(l=>{c=e.cookie.serialize(l,e.meta,!0)})});let r=e.cookie.setCookie(t.data.value)[0];r.path||(r.path="/"),r.domain||(r.domain=e.meta.url.hostname),e.cookie.validateCookie(r,e.meta,!0)&&(c.length&&(c+="; "),c+=`${r.name}=${r.value}`),t.respondWith(t.data.value)}),a.element.on("setInnerHTML",t=>{switch(t.that.tagName){case"SCRIPT":t.data.value=e.js.rewrite(t.data.value);break;case"STYLE":t.data.value=e.rewriteCSS(t.data.value);break;default:t.data.value=e.rewriteHtml(t.data.value)}}),a.element.on("getInnerHTML",t=>{switch(t.that.tagName){case"SCRIPT":t.data.value=e.js.source(t.data.value);break;default:t.data.value=e.sourceHtml(t.data.value)}}),a.element.on("setOuterHTML",t=>{t.data.value=e.rewriteHtml(t.data.value,{document:t.that.tagName==="HTML"})}),a.element.on("getOuterHTML",t=>{switch(t.that.tagName){case"HEAD":t.data.value=e.sourceHtml(t.data.value.replace(/<head(.*)>(.*)<\/head>/s,"<op-head$1>$2</op-head>")).replace(/<op-head(.*)>(.*)<\/op-head>/s,"<head$1>$2</head>");break;case"BODY":t.data.value=e.sourceHtml(t.data.value.replace(/<body(.*)>(.*)<\/body>/s,"<op-body$1>$2</op-body>")).replace(/<op-body(.*)>(.*)<\/op-body>/s,"<body$1>$2</body>");break;default:t.data.value=e.sourceHtml(t.data.value,{document:t.that.tagName==="HTML"});break}}),a.document.on("write",t=>{if(!t.data.html.length)return!1;t.data.html=[e.rewriteHtml(t.data.html.join(""))]}),a.document.on("writeln",t=>{if(!t.data.html.length)return!1;t.data.html=[e.rewriteHtml(t.data.html.join(""))]}),a.element.on("insertAdjacentHTML",t=>{t.data.html=e.rewriteHtml(t.data.html)}),a.eventSource.on("construct",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.eventSource.on("url",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.idb.on("idbFactoryOpen",t=>{t.data.name!=="__op"&&(t.data.name=`${e.meta.url.origin}@${t.data.name}`)}),a.idb.on("idbFactoryName",t=>{t.data.value=t.data.value.slice(e.meta.url.origin.length+1)}),a.history.on("replaceState",t=>{t.data.url&&(t.data.url=e.rewriteUrl(t.data.url,"__uv"in t.that?t.that.__uv.meta:e.meta))}),a.history.on("pushState",t=>{t.data.url&&(t.data.url=e.rewriteUrl(t.data.url,"__uv"in t.that?t.that.__uv.meta:e.meta))}),a.element.on("getAttribute",t=>{a.element.hasAttribute.call(t.that,e.attributePrefix+"-attr-"+t.data.name)&&t.respondWith(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name))}),a.message.on("postMessage",t=>{let r=t.data.origin,i=e.call;t.that&&(i=t.that.__uv$source.call),t.data.origin="*",t.data.message={__data:t.data.message,__origin:(t.that||t.target).__uv$source.location.origin,__to:r},t.respondWith(E?i(t.target,[t.data.message,t.data.transfer],t.that):i(t.target,[t.data.message,t.data.origin,t.data.transfer],t.that))}),a.message.on("data",t=>{let{value:r}=t.data;typeof r=="object"&&"__data"in r&&"__origin"in r&&t.respondWith(r.__data)}),a.message.on("origin",t=>{let r=a.message.messageData.get.call(t.that);typeof r=="object"&&r.__data&&r.__origin&&t.respondWith(r.__origin)}),a.overrideDescriptor(o,"origin",{get:()=>e.location.origin}),a.node.on("baseURI",t=>{t.data.value.startsWith(o.location.origin)&&(t.data.value=e.sourceUrl(t.data.value))}),a.element.on("setAttribute",t=>{if(t.that instanceof f&&t.data.name==="src"&&t.data.value.startsWith("blob:")){t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.blobUrls.get(t.data.value);return}e.attrs.isUrl(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteUrl(t.data.value)),e.attrs.isStyle(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteCSS(t.data.value,{context:"declarationList"})),e.attrs.isHtml(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteHtml(t.data.value,{...e.meta,document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,g,p,c,o.location.href)})),e.attrs.isSrcset(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.html.wrapSrcset(t.data.value.toString())),e.attrs.isForbidden(t.data.name)&&(t.data.name=e.attributePrefix+"-attr-"+t.data.name)}),a.element.on("audio",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.element.hookProperty([$,W,C,A],"href",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-href",i),t.call(r,e.rewriteUrl(i))}}),a.element.hookProperty([S,O,j,f,P,L,T,d,H,D],"src",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[i])=>{if(new String(i).toString().trim().startsWith("blob:")&&r instanceof f)return a.element.setAttribute.call(r,e.attributePrefix+"-attr-src",i),t.call(r,e.blobUrls.get(i)||i);a.element.setAttribute.call(r,e.attributePrefix+"-attr-src",i),t.call(r,e.rewriteUrl(i))}}),a.element.hookProperty([R],"action",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-action",i),t.call(r,e.rewriteUrl(i))}}),a.element.hookProperty([P],"srcset",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-srcset")||t.call(r),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-srcset",i),t.call(r,e.html.wrapSrcset(i.toString()))}}),a.element.hookProperty(S,"integrity",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-integrity"),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-integrity",i)}}),a.element.hookProperty(d,"sandbox",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-sandbox")||t.call(r),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-sandbox",i)}});let I=d&&Object.getOwnPropertyDescriptor(d.prototype,"contentWindow").get;function v(t){let r=I.call(t);if(!r.__uv)try{y(r)}catch(i){console.error("catastrophic failure"),console.error(i)}}a.element.hookProperty(d,"contentWindow",{get:(t,r)=>(v(r),t.call(r))}),a.element.hookProperty(d,"contentDocument",{get:(t,r)=>(v(r),t.call(r))}),a.element.hookProperty(d,"srcdoc",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-srcdoc")||t.call(r),set:(t,r,[i])=>{t.call(r,e.rewriteHtml(i,{document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,g,p,c,o.location.href)}))}}),a.node.on("getTextContent",t=>{t.that.tagName==="SCRIPT"&&(t.data.value=e.js.source(t.data.value))}),a.node.on("setTextContent",t=>{t.that.tagName==="SCRIPT"&&(t.data.value=e.js.rewrite(t.data.value))}),"serviceWorker"in o.navigator&&delete o.Navigator.prototype.serviceWorker,a.document.on("getDomain",t=>{t.data.value=e.domain}),a.document.on("setDomain",t=>{if(!t.data.value.toString().endsWith(e.meta.url.hostname.split(".").slice(-2).join(".")))return t.respondWith("");t.respondWith(e.domain=t.data.value)}),a.document.on("url",t=>{t.data.value=e.location.href}),a.document.on("documentURI",t=>{t.data.value=e.location.href}),a.document.on("referrer",t=>{t.data.value=e.referrer||e.sourceUrl(t.data.value)}),a.document.on("parseFromString",t=>{if(t.data.type!=="text/html")return!1;t.data.string=e.rewriteHtml(t.data.string,{...e.meta,document:!0})}),a.attribute.on("getValue",t=>{a.element.hasAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name)&&(t.data.value=a.element.getAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name))}),a.attribute.on("setValue",t=>{e.attrs.isUrl(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteUrl(t.data.value)),e.attrs.isStyle(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteCSS(t.data.value,{context:"declarationList"})),e.attrs.isHtml(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteHtml(t.data.value,{...e.meta,document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,g,p,c,o.location.href)})),e.attrs.isSrcset(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.html.wrapSrcset(t.data.value.toString()))}),a.url.on("createObjectURL",t=>{let r=t.target.call(t.that,t.data.object);if(r.startsWith("blob:"+location.origin)){let i="blob:"+(e.meta.url.href!=="about:blank"?e.meta.url.origin:o.parent.__uv.meta.url.origin)+r.slice(5+location.origin.length);e.blobUrls.set(i,r),t.respondWith(i)}else t.respondWith(r)}),a.url.on("revokeObjectURL",t=>{if(e.blobUrls.has(t.data.url)){let r=t.data.url;t.data.url=e.blobUrls.get(t.data.url),e.blobUrls.delete(r)}}),a.storage.on("get",t=>{t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("set",t=>{t.that.__uv$storageObj&&(t.that.__uv$storageObj[t.data.name]=t.data.value),t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("delete",t=>{t.that.__uv$storageObj&&delete t.that.__uv$storageObj[t.data.name],t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("getItem",t=>{t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("setItem",t=>{t.that.__uv$storageObj&&(t.that.__uv$storageObj[t.data.name]=t.data.value),t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("removeItem",t=>{t.that.__uv$storageObj&&delete t.that.__uv$storageObj[t.data.name],t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("clear",t=>{if(t.that.__uv$storageObj)for(let r of a.nativeMethods.keys.call(null,t.that.__uv$storageObj))delete t.that.__uv$storageObj[r],a.storage.removeItem.call(t.that,s+e.meta.url.origin+"@"+r),t.respondWith()}),a.storage.on("length",t=>{t.that.__uv$storageObj&&t.respondWith(a.nativeMethods.keys.call(null,t.that.__uv$storageObj).length)}),a.storage.on("key",t=>{t.that.__uv$storageObj&&t.respondWith(a.nativeMethods.keys.call(null,t.that.__uv$storageObj)[t.data.index]||null)});function h(t,r){let i=`on${r}`,l=new WeakMap;Reflect.defineProperty(t,i,{enumerable:!0,configurable:!0,get(){return l.has(this)?l.get(this):null},set(n){typeof n=="function"&&(l.has(this)&&this.removeEventListener(r,l.get(this)),l.set(this,n),this.addEventListener(r,n))}})}let N=["ws:","wss:"];class u extends EventTarget{#t;#a;#e="blob";#i="";#l="";#r="";async#o(r,i){let l={};Reflect.setPrototypeOf(l,null),l.Origin=e.meta.url.origin,l["User-Agent"]=navigator.userAgent,c!==""&&(l.Cookie=c.toString()),this.#t=await k.createWebSocket(r,i,x,l),this.#t.binaryType=this.#e,this.#t.addEventListener("message",n=>{this.dispatchEvent(new MessageEvent("message",n))}),this.#t.addEventListener("open",async n=>{this.dispatchEvent(new Event("open",n))}),this.#t.addEventListener("error",n=>{this.dispatchEvent(new ErrorEvent("error",n))}),this.#t.addEventListener("close",n=>{this.dispatchEvent(new Event("close",n))})}get url(){return this.#r}constructor(...r){if(super(),!r.length)throw new DOMException("Failed to construct 'WebSocket': 1 argument required, but only 0 present.");let[i,l]=r,n;try{n=new URL(i)}catch{throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${i}' is invalid.`)}if(!N.includes(n.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${n.protocol}' is not allowed.`);this.#a=this.#o(n,l)}get protocol(){return this.#t.protocol}get extensions(){return this.#t.extensions}get readyState(){return this.#t?this.#t.readyState:u.CONNECTING}get binaryType(){return this.#e}set binaryType(r){this.#e=r,this.#t&&(this.#t.binaryType=r)}send(r){if(!this.#t)throw new DOMException("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.");this.#t.send(r)}close(r,i){if(typeof r<"u"&&(typeof r!="number"&&(r=0),r!==1e3&&(r<3e3||r>4999)))throw new DOMException(`Failed to execute 'close' on 'WebSocket': The code must be either 1000, or between 3000 and 4999. ${r} is neither.`);this.#a.then(()=>this.#t.close(r,i))}}h(u.prototype,"close"),h(u.prototype,"open"),h(u.prototype,"message"),h(u.prototype,"error");for(let t of["url","protocol","extensions","readyState","binaryType"]){let r=Object.getOwnPropertyDescriptor(o.WebSocket.prototype,t),i=Object.getOwnPropertyDescriptor(u.prototype,t);i?.get&&r?.get&&a.emit("wrap",i.get,r.get),i?.set&&r?.set&&a.emit("wrap",i.get,r.get)}if(a.emit("wrap",o.WebSocket.prototype.send,u.prototype.send),a.emit("wrap",o.WebSocket.prototype.close,u.prototype.close),a.override(o,"WebSocket",(t,r,i)=>new u(...i),!0),u.prototype.constructor=o.WebSocket,a.function.on("function",t=>{t.data.script=e.rewriteJS(t.data.script)}),a.function.on("toString",t=>{e.methods.string in t.that&&t.respondWith(t.that[e.methods.string])}),a.object.on("getOwnPropertyNames",t=>{t.data.names=t.data.names.filter(r=>!e.filterKeys.includes(r))}),a.object.on("getOwnPropertyDescriptors",t=>{for(let r of e.filterKeys)delete t.data.descriptors[r]}),a.style.on("setProperty",t=>{a.style.dashedUrlProps.includes(t.data.property)&&(t.data.value=e.rewriteCSS(t.data.value,{context:"value",...e.meta}))}),a.style.on("getPropertyValue",t=>{a.style.dashedUrlProps.includes(t.data.property)&&t.respondWith(e.sourceCSS(t.target.call(t.that,t.data.property),{context:"value",...e.meta}))}),"CSS2Properties"in o)for(let t of a.style.urlProps)a.overrideDescriptor(o.CSS2Properties.prototype,t,{get:(r,i)=>e.sourceCSS(r.call(i),{context:"value",...e.meta}),set:(r,i,l)=>{r.call(i,e.rewriteCSS(l,{context:"value",...e.meta}))}});else"HTMLElement"in o&&a.overrideDescriptor(o.HTMLElement.prototype,"style",{get:(t,r)=>{let i=t.call(r);if(!i[s+"modifiedStyle"])for(let l of a.style.urlProps)a.nativeMethods.defineProperty(i,l,{enumerable:!0,configurable:!0,get(){let n=a.style.getPropertyValue.call(this,l)||"";return e.sourceCSS(n,{context:"value",...e.meta})},set(n){a.style.setProperty.call(this,a.style.propToDashed[l]||l,e.rewriteCSS(n,{context:"value",...e.meta}))}}),a.nativeMethods.defineProperty(i,s+"modifiedStyle",{enumerable:!1,value:!0});return i}});a.style.on("setCssText",t=>{t.data.value=e.rewriteCSS(t.data.value,{context:"declarationList",...e.meta})}),a.style.on("getCssText",t=>{t.data.value=e.sourceCSS(t.data.value,{context:"declarationList",...e.meta})}),e.addEventListener.call(o,"hashchange",t=>{if(t.__uv$dispatched)return!1;t.stopImmediatePropagation();let r=o.location.hash;a.history.replaceState.call(o.history,"","",t.oldURL),e.location.hash=r}),a.location.on("hashchange",(t,r,i)=>{if(i.HashChangeEvent&&a.history.replaceState){a.history.replaceState.call(o.history,"","",e.rewriteUrl(r));let l=new i.HashChangeEvent("hashchange",{newURL:r,oldURL:t});a.nativeMethods.defineProperty(l,s+"dispatched",{value:!0,enumerable:!1}),e.dispatchEvent.call(o,l)}}),a.fetch.overrideRequest(),a.fetch.overrideUrl(),a.xhr.overrideOpen(),a.xhr.overrideResponseUrl(),a.element.overrideHtml(),a.element.overrideAttribute(),a.element.overrideInsertAdjacentHTML(),a.element.overrideAudio(),a.node.overrideBaseURI(),a.node.overrideTextContent(),a.attribute.overrideNameValue(),a.document.overrideDomain(),a.document.overrideURL(),a.document.overrideDocumentURI(),a.document.overrideWrite(),a.document.overrideReferrer(),a.document.overrideParseFromString(),a.storage.overrideMethods(),a.storage.overrideLength(),a.object.overrideGetPropertyNames(),a.object.overrideGetOwnPropertyDescriptors(),a.idb.overrideName(),a.idb.overrideOpen(),a.history.overridePushState(),a.history.overrideReplaceState(),a.eventSource.overrideConstruct(),a.eventSource.overrideUrl(),a.url.overrideObjectURL(),a.document.overrideCookie(),a.message.overridePostMessage(),a.message.overrideMessageOrigin(),a.message.overrideMessageData(),a.workers.overrideWorker(),a.workers.overrideAddModule(),a.workers.overrideImportScripts(),a.workers.overridePostMessage(),a.style.overrideSetGetProperty(),a.style.overrideCssText(),a.navigator.overrideSendBeacon(),a.function.overrideFunction(),a.function.overrideToString(),a.location.overrideWorkerLocation(t=>new URL(e.sourceUrl(t))),a.overrideDescriptor(o,"localStorage",{get:(t,r)=>(r||o).__uv.lsWrap}),a.overrideDescriptor(o,"sessionStorage",{get:(t,r)=>(r||o).__uv.ssWrap}),a.override(o,"open",(t,r,i)=>{if(!i.length)return t.apply(r,i);let[l]=i;return l=e.rewriteUrl(l),t.call(r,l)}),e.$wrap=function(t){return t==="location"?e.methods.location:t==="eval"?e.methods.eval:t},e.$get=function(t){return t===o.location?e.location:t===o.eval?e.eval:t===o.parent?o.__uv$parent:t===o.top?o.__uv$top:t},e.eval=a.wrap(o,"eval",(t,r,i)=>{if(!i.length||typeof i[0]!="string")return t.apply(r,i);let[l]=i;return l=e.rewriteJS(l),t.call(r,l)}),e.call=function(t,r,i){return i?t.apply(i,r):t(...r)},e.call$=function(t,r,i=[]){return t[r].apply(t,i)},a.nativeMethods.defineProperty(o.Object.prototype,_,{get:()=>e,enumerable:!1}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.setSource,{value:function(t){return a.nativeMethods.isExtensible(this)?(a.nativeMethods.defineProperty(this,e.methods.source,{value:t,writable:!0,enumerable:!1}),this):this},enumerable:!1}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.source,{value:e,writable:!0,enumerable:!1}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.location,{configurable:!0,get(){return this===o.document||this===o?e.location:this.location},set(t){this===o.document||this===o?e.location.href=t:this.location=t}}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.parent,{configurable:!0,get(){let t=this.parent;if(this===o)try{return"__uv"in t?t:this}catch{return this}return t},set(t){this.parent=t}}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.top,{configurable:!0,get(){let t=this.top;if(this===o){if(t===this.parent)return this[e.methods.parent];try{if("__uv"in t)return t;{let r=this;for(;r.parent!==t;)r=r.parent;return"__uv"in r?r:this}}catch{return this}}return t},set(t){this.top=t}}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.eval,{configurable:!0,get(){return this===o?e.eval:this.eval},set(t){this.eval=t}})}})();
(()=>{var b=self.Ultraviolet,F=self.UVClient,V=self.__uv$config,p=self.__uv$bareData,g=self.__uv$bareURL,M=self.__uv$cookies;if(typeof p!="object"||typeof g!="string"||typeof M!="string")throw new TypeError("Unable to load global UV data");self.__uv||y(self);self.__uvHook=y;function y(o){if("__uv"in o&&o.__uv instanceof b)return!1;o.document&&o.window&&o.document.querySelectorAll("script[__uv-script]").forEach(t=>t.remove());let E=!o.window,_="__uv",s="__uv$",e=new b(V),x=WebSocket,a=new F(o),{HTMLMediaElement:f,HTMLScriptElement:S,HTMLAudioElement:O,HTMLVideoElement:j,HTMLInputElement:L,HTMLEmbedElement:T,HTMLTrackElement:H,HTMLAnchorElement:$,HTMLIFrameElement:d,HTMLAreaElement:W,HTMLLinkElement:C,HTMLBaseElement:A,HTMLFormElement:R,HTMLImageElement:P,HTMLSourceElement:D}=o;a.nativeMethods.defineProperty(o,"__uv",{value:e,enumerable:!1}),e.meta.origin=location.origin,e.location=a.location.emulate(t=>t==="about:srcdoc"?new URL(t):(t.startsWith("blob:")&&(t=t.slice(5)),new URL(e.sourceUrl(t))),t=>e.rewriteUrl(t));let c=M;e.meta.url=e.location,e.domain=e.meta.url.host,e.blobUrls=new o.Map,e.referrer="",e.cookies=[],e.localStorageObj={},e.sessionStorageObj={};let k=new b.BareClient;if(e.bareClient=k,e.location.href==="about:srcdoc"&&(e.meta=o.parent.__uv.meta),o.EventTarget&&(e.addEventListener=o.EventTarget.prototype.addEventListener,e.removeListener=o.EventTarget.prototype.removeListener,e.dispatchEvent=o.EventTarget.prototype.dispatchEvent),a.nativeMethods.defineProperty(a.storage.storeProto,"__uv$storageObj",{get(){if(this===a.storage.sessionStorage)return e.sessionStorageObj;if(this===a.storage.localStorage)return e.localStorageObj},enumerable:!1}),o.localStorage){for(let t in o.localStorage)t.startsWith(s+e.location.origin+"@")&&(e.localStorageObj[t.slice((s+e.location.origin+"@").length)]=o.localStorage.getItem(t));e.lsWrap=a.storage.emulate(a.storage.localStorage,e.localStorageObj)}if(o.sessionStorage){for(let t in o.sessionStorage)t.startsWith(s+e.location.origin+"@")&&(e.sessionStorageObj[t.slice((s+e.location.origin+"@").length)]=o.sessionStorage.getItem(t));e.ssWrap=a.storage.emulate(a.storage.sessionStorage,e.sessionStorageObj)}let m=o.document?a.node.baseURI.get.call(o.document):o.location.href,U=e.sourceUrl(m);a.nativeMethods.defineProperty(e.meta,"base",{get(){return o.document?(a.node.baseURI.get.call(o.document)!==m&&(m=a.node.baseURI.get.call(o.document),U=e.sourceUrl(m)),U):e.meta.url.href}}),e.methods={setSource:s+"setSource",source:s+"source",location:s+"location",function:s+"function",string:s+"string",eval:s+"eval",parent:s+"parent",top:s+"top"},e.filterKeys=[_,e.methods.setSource,e.methods.source,e.methods.location,e.methods.function,e.methods.string,e.methods.eval,e.methods.parent,e.methods.top,s+"protocol",s+"storageObj",s+"url",s+"modifiedStyle",s+"config",s+"dispatched","Ultraviolet","__uvHook"],a.on("wrap",(t,r)=>{a.nativeMethods.defineProperty(r,"name",a.nativeMethods.getOwnPropertyDescriptor(t,"name")),a.nativeMethods.defineProperty(r,"length",a.nativeMethods.getOwnPropertyDescriptor(t,"length")),a.nativeMethods.defineProperty(r,e.methods.string,{enumerable:!1,value:a.nativeMethods.fnToString.call(t)}),a.nativeMethods.defineProperty(r,e.methods.function,{enumerable:!1,value:t})}),a.fetch.on("request",t=>{t.data.input=e.rewriteUrl(t.data.input)}),a.fetch.on("requestUrl",t=>{t.data.value=e.sourceUrl(t.data.value)}),a.fetch.on("responseUrl",t=>{t.data.value=e.sourceUrl(t.data.value)}),a.xhr.on("open",t=>{t.data.input=e.rewriteUrl(t.data.input)}),a.xhr.on("responseUrl",t=>{t.data.value=e.sourceUrl(t.data.value)}),a.workers.on("worker",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.workers.on("addModule",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.workers.on("importScripts",t=>{for(let r in t.data.scripts)t.data.scripts[r]=e.rewriteUrl(t.data.scripts[r])}),a.workers.on("postMessage",t=>{let r=t.data.origin;t.data.origin="*",t.data.message={__data:t.data.message,__origin:e.meta.url.origin,__to:r}}),a.navigator.on("sendBeacon",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.document.on("getCookie",t=>{t.data.value=c}),a.document.on("setCookie",t=>{e.cookie.db().then(i=>{e.cookie.setCookies(t.data.value,i,e.meta),e.cookie.getCookies(i).then(l=>{c=e.cookie.serialize(l,e.meta,!0)})});let r=e.cookie.setCookie(t.data.value)[0];r.path||(r.path="/"),r.domain||(r.domain=e.meta.url.hostname),e.cookie.validateCookie(r,e.meta,!0)&&(c.length&&(c+="; "),c+=`${r.name}=${r.value}`),t.respondWith(t.data.value)}),a.element.on("setInnerHTML",t=>{switch(t.that.tagName){case"SCRIPT":t.data.value=e.js.rewrite(t.data.value);break;case"STYLE":t.data.value=e.rewriteCSS(t.data.value);break;default:t.data.value=e.rewriteHtml(t.data.value)}}),a.element.on("getInnerHTML",t=>{switch(t.that.tagName){case"SCRIPT":t.data.value=e.js.source(t.data.value);break;default:t.data.value=e.sourceHtml(t.data.value)}}),a.element.on("setOuterHTML",t=>{t.data.value=e.rewriteHtml(t.data.value,{document:t.that.tagName==="HTML"})}),a.element.on("getOuterHTML",t=>{switch(t.that.tagName){case"HEAD":t.data.value=e.sourceHtml(t.data.value.replace(/<head(.*)>(.*)<\/head>/s,"<op-head$1>$2</op-head>")).replace(/<op-head(.*)>(.*)<\/op-head>/s,"<head$1>$2</head>");break;case"BODY":t.data.value=e.sourceHtml(t.data.value.replace(/<body(.*)>(.*)<\/body>/s,"<op-body$1>$2</op-body>")).replace(/<op-body(.*)>(.*)<\/op-body>/s,"<body$1>$2</body>");break;default:t.data.value=e.sourceHtml(t.data.value,{document:t.that.tagName==="HTML"});break}}),a.document.on("write",t=>{if(!t.data.html.length)return!1;t.data.html=[e.rewriteHtml(t.data.html.join(""))]}),a.document.on("writeln",t=>{if(!t.data.html.length)return!1;t.data.html=[e.rewriteHtml(t.data.html.join(""))]}),a.element.on("insertAdjacentHTML",t=>{t.data.html=e.rewriteHtml(t.data.html)}),a.eventSource.on("construct",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.eventSource.on("url",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.idb.on("idbFactoryOpen",t=>{t.data.name!=="__op"&&(t.data.name=`${e.meta.url.origin}@${t.data.name}`)}),a.idb.on("idbFactoryName",t=>{t.data.value=t.data.value.slice(e.meta.url.origin.length+1)}),a.history.on("replaceState",t=>{t.data.url&&(t.data.url=e.rewriteUrl(t.data.url,"__uv"in t.that?t.that.__uv.meta:e.meta))}),a.history.on("pushState",t=>{t.data.url&&(t.data.url=e.rewriteUrl(t.data.url,"__uv"in t.that?t.that.__uv.meta:e.meta))}),a.element.on("getAttribute",t=>{a.element.hasAttribute.call(t.that,e.attributePrefix+"-attr-"+t.data.name)&&t.respondWith(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name))}),a.message.on("postMessage",t=>{let r=t.data.origin,i=e.call;t.that&&(i=t.that.__uv$source.call),t.data.origin="*",t.data.message={__data:t.data.message,__origin:(t.that||t.target).__uv$source.location.origin,__to:r},t.respondWith(E?i(t.target,[t.data.message,t.data.transfer],t.that):i(t.target,[t.data.message,t.data.origin,t.data.transfer],t.that))}),a.message.on("data",t=>{let{value:r}=t.data;typeof r=="object"&&"__data"in r&&"__origin"in r&&t.respondWith(r.__data)}),a.message.on("origin",t=>{let r=a.message.messageData.get.call(t.that);typeof r=="object"&&r.__data&&r.__origin&&t.respondWith(r.__origin)}),a.overrideDescriptor(o,"origin",{get:()=>e.location.origin}),a.node.on("baseURI",t=>{t.data.value.startsWith(o.location.origin)&&(t.data.value=e.sourceUrl(t.data.value))}),a.element.on("setAttribute",t=>{if(t.that instanceof f&&t.data.name==="src"&&t.data.value.startsWith("blob:")){t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.blobUrls.get(t.data.value);return}e.attrs.isUrl(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteUrl(t.data.value)),e.attrs.isStyle(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteCSS(t.data.value,{context:"declarationList"})),e.attrs.isHtml(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteHtml(t.data.value,{...e.meta,document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,g,p,c,o.location.href)})),e.attrs.isSrcset(t.data.name)&&(t.target.call(t.that,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.html.wrapSrcset(t.data.value.toString())),e.attrs.isForbidden(t.data.name)&&(t.data.name=e.attributePrefix+"-attr-"+t.data.name)}),a.element.on("audio",t=>{t.data.url=e.rewriteUrl(t.data.url)}),a.element.hookProperty([$,W,C,A],"href",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-href",i),t.call(r,e.rewriteUrl(i))}}),a.element.hookProperty([S,O,j,f,P,L,T,d,H,D],"src",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[i])=>{if(new String(i).toString().trim().startsWith("blob:")&&r instanceof f)return a.element.setAttribute.call(r,e.attributePrefix+"-attr-src",i),t.call(r,e.blobUrls.get(i)||i);a.element.setAttribute.call(r,e.attributePrefix+"-attr-src",i),t.call(r,e.rewriteUrl(i))}}),a.element.hookProperty([R],"action",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-action",i),t.call(r,e.rewriteUrl(i))}}),a.element.hookProperty([P],"srcset",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-srcset")||t.call(r),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-srcset",i),t.call(r,e.html.wrapSrcset(i.toString()))}}),a.element.hookProperty(S,"integrity",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-integrity"),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-integrity",i)}}),a.element.hookProperty(d,"sandbox",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-sandbox")||t.call(r),set:(t,r,[i])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-sandbox",i)}});let I=d&&Object.getOwnPropertyDescriptor(d.prototype,"contentWindow").get;function v(t){let r=I.call(t);if(!r.__uv)try{y(r)}catch(i){console.error("catastrophic failure"),console.error(i)}}a.element.hookProperty(d,"contentWindow",{get:(t,r)=>(v(r),t.call(r))}),a.element.hookProperty(d,"contentDocument",{get:(t,r)=>(v(r),t.call(r))}),a.element.hookProperty(d,"srcdoc",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-srcdoc")||t.call(r),set:(t,r,[i])=>{t.call(r,e.rewriteHtml(i,{document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,g,p,c,o.location.href)}))}}),a.node.on("getTextContent",t=>{t.that.tagName==="SCRIPT"&&(t.data.value=e.js.source(t.data.value))}),a.node.on("setTextContent",t=>{t.that.tagName==="SCRIPT"&&(t.data.value=e.js.rewrite(t.data.value))}),"serviceWorker"in o.navigator&&delete o.Navigator.prototype.serviceWorker,a.document.on("getDomain",t=>{t.data.value=e.domain}),a.document.on("setDomain",t=>{if(!t.data.value.toString().endsWith(e.meta.url.hostname.split(".").slice(-2).join(".")))return t.respondWith("");t.respondWith(e.domain=t.data.value)}),a.document.on("url",t=>{t.data.value=e.location.href}),a.document.on("documentURI",t=>{t.data.value=e.location.href}),a.document.on("referrer",t=>{t.data.value=e.referrer||e.sourceUrl(t.data.value)}),a.document.on("parseFromString",t=>{if(t.data.type!=="text/html")return!1;t.data.string=e.rewriteHtml(t.data.string,{...e.meta,document:!0})}),a.attribute.on("getValue",t=>{a.element.hasAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name)&&(t.data.value=a.element.getAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name))}),a.attribute.on("setValue",t=>{e.attrs.isUrl(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteUrl(t.data.value)),e.attrs.isStyle(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteCSS(t.data.value,{context:"declarationList"})),e.attrs.isHtml(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.rewriteHtml(t.data.value,{...e.meta,document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,g,p,c,o.location.href)})),e.attrs.isSrcset(t.data.name)&&(a.element.setAttribute.call(t.that.ownerElement,e.attributePrefix+"-attr-"+t.data.name,t.data.value),t.data.value=e.html.wrapSrcset(t.data.value.toString()))}),a.url.on("createObjectURL",t=>{let r=t.target.call(t.that,t.data.object);if(r.startsWith("blob:"+location.origin)){let i="blob:"+(e.meta.url.href!=="about:blank"?e.meta.url.origin:o.parent.__uv.meta.url.origin)+r.slice(5+location.origin.length);e.blobUrls.set(i,r),t.respondWith(i)}else t.respondWith(r)}),a.url.on("revokeObjectURL",t=>{if(e.blobUrls.has(t.data.url)){let r=t.data.url;t.data.url=e.blobUrls.get(t.data.url),e.blobUrls.delete(r)}}),a.storage.on("get",t=>{t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("set",t=>{t.that.__uv$storageObj&&(t.that.__uv$storageObj[t.data.name]=t.data.value),t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("delete",t=>{t.that.__uv$storageObj&&delete t.that.__uv$storageObj[t.data.name],t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("getItem",t=>{t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("setItem",t=>{t.that.__uv$storageObj&&(t.that.__uv$storageObj[t.data.name]=t.data.value),t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("removeItem",t=>{t.that.__uv$storageObj&&delete t.that.__uv$storageObj[t.data.name],t.data.name=s+e.meta.url.origin+"@"+t.data.name}),a.storage.on("clear",t=>{if(t.that.__uv$storageObj)for(let r of a.nativeMethods.keys.call(null,t.that.__uv$storageObj))delete t.that.__uv$storageObj[r],a.storage.removeItem.call(t.that,s+e.meta.url.origin+"@"+r),t.respondWith()}),a.storage.on("length",t=>{t.that.__uv$storageObj&&t.respondWith(a.nativeMethods.keys.call(null,t.that.__uv$storageObj).length)}),a.storage.on("key",t=>{t.that.__uv$storageObj&&t.respondWith(a.nativeMethods.keys.call(null,t.that.__uv$storageObj)[t.data.index]||null)});function h(t,r){let i=`on${r}`,l=new WeakMap;Reflect.defineProperty(t,i,{enumerable:!0,configurable:!0,get(){return l.has(this)?l.get(this):null},set(n){typeof n=="function"&&(l.has(this)&&this.removeEventListener(r,l.get(this)),l.set(this,n),this.addEventListener(r,n))}})}let N=["ws:","wss:"];class u extends EventTarget{#t;#a;#e="blob";#i="";#l="";#r="";async#o(r,i){let l={};Reflect.setPrototypeOf(l,null),l.Origin=e.meta.url.origin,l["User-Agent"]=navigator.userAgent,c!==""&&(l.Cookie=c.toString()),this.#t=await k.createWebSocket(r,i,x,l),this.#t.binaryType=this.#e,this.#t.addEventListener("message",n=>{this.dispatchEvent(new MessageEvent("message",n))}),this.#t.addEventListener("open",async n=>{this.dispatchEvent(new Event("open",n))}),this.#t.addEventListener("error",n=>{this.dispatchEvent(new ErrorEvent("error",n))}),this.#t.addEventListener("close",n=>{this.dispatchEvent(new Event("close",n))})}get url(){return this.#r}constructor(...r){if(super(),!r.length)throw new DOMException("Failed to construct 'WebSocket': 1 argument required, but only 0 present.");let[i,l]=r,n;try{n=new URL(i)}catch{throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${i}' is invalid.`)}if(!N.includes(n.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${n.protocol}' is not allowed.`);this.#a=this.#o(n,l)}get protocol(){return this.#t.protocol}get extensions(){return this.#t.extensions}get readyState(){return this.#t?this.#t.readyState:u.CONNECTING}get binaryType(){return this.#e}set binaryType(r){this.#e=r,this.#t&&(this.#t.binaryType=r)}send(r){if(!this.#t)throw new DOMException("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.");this.#t.send(r)}close(r,i){if(typeof r<"u"&&(typeof r!="number"&&(r=0),r!==1e3&&(r<3e3||r>4999)))throw new DOMException(`Failed to execute 'close' on 'WebSocket': The code must be either 1000, or between 3000 and 4999. ${r} is neither.`);this.#a.then(()=>this.#t.close(r,i))}}h(u.prototype,"close"),h(u.prototype,"open"),h(u.prototype,"message"),h(u.prototype,"error");for(let t of["url","protocol","extensions","readyState","binaryType"]){let r=Object.getOwnPropertyDescriptor(o.WebSocket.prototype,t),i=Object.getOwnPropertyDescriptor(u.prototype,t);i?.get&&r?.get&&a.emit("wrap",i.get,r.get),i?.set&&r?.set&&a.emit("wrap",i.get,r.get)}if(a.emit("wrap",o.WebSocket.prototype.send,u.prototype.send),a.emit("wrap",o.WebSocket.prototype.close,u.prototype.close),a.override(o,"WebSocket",(t,r,i)=>new u(...i),!0),u.prototype.constructor=o.WebSocket,a.function.on("function",t=>{t.data.script=e.rewriteJS(t.data.script)}),a.function.on("toString",t=>{e.methods.string in t.that&&t.respondWith(t.that[e.methods.string])}),a.object.on("getOwnPropertyNames",t=>{t.data.names=t.data.names.filter(r=>!e.filterKeys.includes(r))}),a.object.on("getOwnPropertyDescriptors",t=>{for(let r of e.filterKeys)delete t.data.descriptors[r]}),a.style.on("setProperty",t=>{a.style.dashedUrlProps.includes(t.data.property)&&(t.data.value=e.rewriteCSS(t.data.value,{context:"value",...e.meta}))}),a.style.on("getPropertyValue",t=>{a.style.dashedUrlProps.includes(t.data.property)&&t.respondWith(e.sourceCSS(t.target.call(t.that,t.data.property),{context:"value",...e.meta}))}),"CSS2Properties"in o)for(let t of a.style.urlProps)a.overrideDescriptor(o.CSS2Properties.prototype,t,{get:(r,i)=>e.sourceCSS(r.call(i),{context:"value",...e.meta}),set:(r,i,l)=>{r.call(i,e.rewriteCSS(l,{context:"value",...e.meta}))}});else"HTMLElement"in o&&a.overrideDescriptor(o.HTMLElement.prototype,"style",{get:(t,r)=>{let i=t.call(r);if(!i[s+"modifiedStyle"])for(let l of a.style.urlProps)a.nativeMethods.defineProperty(i,l,{enumerable:!0,configurable:!0,get(){let n=a.style.getPropertyValue.call(this,l)||"";return e.sourceCSS(n,{context:"value",...e.meta})},set(n){a.style.setProperty.call(this,a.style.propToDashed[l]||l,e.rewriteCSS(n,{context:"value",...e.meta}))}}),a.nativeMethods.defineProperty(i,s+"modifiedStyle",{enumerable:!1,value:!0});return i}});a.style.on("setCssText",t=>{t.data.value=e.rewriteCSS(t.data.value,{context:"declarationList",...e.meta})}),a.style.on("getCssText",t=>{t.data.value=e.sourceCSS(t.data.value,{context:"declarationList",...e.meta})}),e.addEventListener.call(o,"hashchange",t=>{if(t.__uv$dispatched)return!1;t.stopImmediatePropagation();let r=o.location.hash;a.history.replaceState.call(o.history,"","",t.oldURL),e.location.hash=r}),a.location.on("hashchange",(t,r,i)=>{if(i.HashChangeEvent&&a.history.replaceState){a.history.replaceState.call(o.history,"","",e.rewriteUrl(r));let l=new i.HashChangeEvent("hashchange",{newURL:r,oldURL:t});a.nativeMethods.defineProperty(l,s+"dispatched",{value:!0,enumerable:!1}),e.dispatchEvent.call(o,l)}}),a.fetch.overrideRequest(),a.fetch.overrideUrl(),a.xhr.overrideOpen(),a.xhr.overrideResponseUrl(),a.element.overrideHtml(),a.element.overrideAttribute(),a.element.overrideInsertAdjacentHTML(),a.element.overrideAudio(),a.node.overrideBaseURI(),a.node.overrideTextContent(),a.attribute.overrideNameValue(),a.document.overrideDomain(),a.document.overrideURL(),a.document.overrideDocumentURI(),a.document.overrideWrite(),a.document.overrideReferrer(),a.document.overrideParseFromString(),a.storage.overrideMethods(),a.storage.overrideLength(),a.object.overrideGetPropertyNames(),a.object.overrideGetOwnPropertyDescriptors(),a.idb.overrideName(),a.idb.overrideOpen(),a.history.overridePushState(),a.history.overrideReplaceState(),a.eventSource.overrideConstruct(),a.eventSource.overrideUrl(),a.url.overrideObjectURL(),a.document.overrideCookie(),a.message.overridePostMessage(),a.message.overrideMessageOrigin(),a.message.overrideMessageData(),a.workers.overrideWorker(),a.workers.overrideAddModule(),a.workers.overrideImportScripts(),a.workers.overridePostMessage(),a.style.overrideSetGetProperty(),a.style.overrideCssText(),a.navigator.overrideSendBeacon(),a.function.overrideFunction(),a.function.overrideToString(),a.location.overrideWorkerLocation(t=>new URL(e.sourceUrl(t))),a.overrideDescriptor(o,"localStorage",{get:(t,r)=>(r||o).__uv.lsWrap}),a.overrideDescriptor(o,"sessionStorage",{get:(t,r)=>(r||o).__uv.ssWrap}),a.override(o,"open",(t,r,i)=>{if(!i.length)return t.apply(r,i);let[l]=i;return l=e.rewriteUrl(l),t.call(r,l)}),e.$wrap=function(t){return t==="location"?e.methods.location:t==="eval"?e.methods.eval:t},e.$get=function(t){return t===o.location?e.location:t===o.eval?e.eval:t===o.parent?o.__uv$parent:t===o.top?o.__uv$top:t},e.eval=a.wrap(o,"eval",(t,r,i)=>{if(!i.length||typeof i[0]!="string")return t.apply(r,i);let[l]=i;return l=e.rewriteJS(l),t.call(r,l)}),e.call=function(t,r,i){return i?t.apply(i,r):t(...r)},e.call$=function(t,r,i=[]){return t[r].apply(t,i)},a.nativeMethods.defineProperty(o.Object.prototype,_,{get:()=>e,enumerable:!1}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.setSource,{value:function(t){return a.nativeMethods.isExtensible(this)?(a.nativeMethods.defineProperty(this,e.methods.source,{value:t,writable:!0,enumerable:!1}),this):this},enumerable:!1}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.source,{value:e,writable:!0,enumerable:!1}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.location,{configurable:!0,get(){return this===o.document||this===o?e.location:this.location},set(t){this===o.document||this===o?e.location.href=t:this.location=t}}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.parent,{configurable:!0,get(){let t=this.parent;if(this===o)try{return"__uv"in t?t:this}catch{return this}return t},set(t){this.parent=t}}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.top,{configurable:!0,get(){let t=this.top;if(this===o){if(t===this.parent)return this[e.methods.parent];try{if("__uv"in t)return t;{let r=this;for(;r.parent!==t;)r=r.parent;return"__uv"in r?r:this}}catch{return this}}return t},set(t){this.top=t}}),a.nativeMethods.defineProperty(o.Object.prototype,e.methods.eval,{configurable:!0,get(){return this===o?e.eval:this.eval},set(t){this.eval=t}})}})();
//# sourceMappingURL=uv.handler.js.map

@@ -1,3 +0,3 @@

"use strict";(()=>{var p=self.Ultraviolet,x=["cross-origin-embedder-policy","cross-origin-opener-policy","cross-origin-resource-policy","content-security-policy","content-security-policy-report-only","expect-ct","feature-policy","origin-isolation","strict-transport-security","upgrade-insecure-requests","x-content-type-options","x-download-options","x-frame-options","x-permitted-cross-domain-policies","x-powered-by","x-xss-protection"],w=["GET","HEAD"],b=class extends p.EventEmitter{constructor(t=__uv$config){super(),t.bare||(t.bare="/bare/"),t.prefix||(t.prefix="/service/"),this.config=t;let i=(Array.isArray(t.bare)?t.bare:[t.bare]).map(e=>new URL(e,location).toString());this.address=i[~~(Math.random()*i.length)],this.bareClient=new p.BareClient}async fetch({request:t}){let i;try{if(!t.url.startsWith(location.origin+this.config.prefix))return await fetch(t);let e=new p(this.config,this.address);typeof this.config.construct=="function"&&this.config.construct(e,"service");let a=await e.cookie.db();e.meta.origin=location.origin,e.meta.base=e.meta.url=new URL(e.sourceUrl(t.url));let r=new g(t,this,e,w.includes(t.method.toUpperCase())?null:await t.blob());if(e.meta.url.protocol==="blob:"&&(r.blob=!0,r.base=r.url=new URL(r.url.pathname)),t.referrer&&t.referrer.startsWith(location.origin)){let n=new URL(e.sourceUrl(t.referrer));(r.headers.origin||e.meta.url.origin!==n.origin&&t.mode==="cors")&&(r.headers.origin=n.origin),r.headers.referer=n.href}let l=await e.cookie.getCookies(a)||[],c=e.cookie.serialize(l,e.meta,!1);r.headers["user-agent"]=navigator.userAgent,c&&(r.headers.cookie=c);let f=new m(r,null,null);if(this.emit("request",f),f.intercepted)return f.returnValue;i=r.blob?"blob:"+location.origin+r.url.pathname:r.url;let h=await this.bareClient.fetch(i,{headers:r.headers,method:r.method,body:r.body,credentials:r.credentials,mode:location.origin!==r.address.origin?"cors":r.mode,cache:r.cache,redirect:r.redirect,proxyIp:this.config.proxyIp,proxyPort:this.config.proxyPort}),o=new y(r,h),d=new m(o,null,null);if(this.emit("beforemod",d),d.intercepted)return d.returnValue;for(let n of x)o.headers[n]&&delete o.headers[n];if(o.headers.location&&(o.headers.location=e.rewriteUrl(o.headers.location)),t.destination==="document"){let n=o.headers["content-disposition"];if(!/\s*?((inline|attachment);\s*?)filename=/i.test(n)){let u=/^\s*?attachment/i.test(n)?"attachment":"inline",[v]=new URL(h.finalURL).pathname.split("/").slice(-1);o.headers["content-disposition"]=`${u}; filename=${JSON.stringify(v)}`}}if(o.headers["set-cookie"]&&(Promise.resolve(e.cookie.setCookies(o.headers["set-cookie"],a,e.meta)).then(()=>{self.clients.matchAll().then(function(n){n.forEach(function(u){u.postMessage({msg:"updateCookies",url:e.meta.url.href})})})}),delete o.headers["set-cookie"]),o.body)switch(t.destination){case"script":case"worker":{let n=[e.bundleScript,e.clientScript,e.configScript,e.handlerScript].map(u=>JSON.stringify(u)).join(",");o.body=`if (!self.__uv && self.importScripts) { ${e.createJsInject(this.address,this.bareClient.manfiest,e.cookie.serialize(l,e.meta,!0),t.referrer)} importScripts(${n}); }
`,o.body+=e.js.rewrite(await h.text())}break;case"style":o.body=e.rewriteCSS(await h.text());break;case"iframe":case"document":S(e.meta.url,o.headers["content-type"]||"")&&(o.body=e.rewriteHtml(await h.text(),{document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,this.address,this.bareClient.manfiest,e.cookie.serialize(l,e.meta,!0),t.referrer)}))}return r.headers.accept==="text/event-stream"&&(o.headers["content-type"]="text/event-stream"),crossOriginIsolated&&(o.headers["Cross-Origin-Embedder-Policy"]="require-corp"),this.emit("response",d),d.intercepted?d.returnValue:new Response(o.body,{headers:o.headers,status:o.status,statusText:o.statusText})}catch(e){return["document","iframe"].includes(t.destination)?(console.error(e),O(e,i,this.address)):new Response(void 0,{status:500})}}static Ultraviolet=p};self.UVServiceWorker=b;var y=class{constructor(t,i){this.request=t,this.raw=i,this.ultraviolet=t.ultraviolet,this.headers={};for(let e in i.rawHeaders)this.headers[e.toLowerCase()]=i.rawHeaders[e];this.status=i.status,this.statusText=i.statusText,this.body=i.body}get url(){return this.request.url}get base(){return this.request.base}set base(t){this.request.base=t}},g=class{constructor(t,i,e,a=null){this.ultraviolet=e,this.request=t,this.headers=Object.fromEntries(t.headers.entries()),this.method=t.method,this.address=i.address,this.body=a||null,this.cache=t.cache,this.redirect=t.redirect,this.credentials="omit",this.mode=t.mode==="cors"?t.mode:"same-origin",this.blob=!1}get url(){return this.ultraviolet.meta.url}set url(t){this.ultraviolet.meta.url=t}get base(){return this.ultraviolet.meta.base}set base(t){this.ultraviolet.meta.base=t}};function S(s,t=""){return(p.mime.contentType(t||s.pathname)||"text/html").split(";")[0]==="text/html"}var m=class{#e;#t;constructor(t={},i=null,e=null){this.#e=!1,this.#t=null,this.data=t,this.target=i,this.that=e}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(t){this.#t=t,this.#e=!0}};function C(s,t){let i=new URL(s),e=`remoteHostname.textContent = ${JSON.stringify(i.hostname)};bareServer.href = ${JSON.stringify(t)};uvHostname.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());uvVersion.textContent = ${JSON.stringify("3.0.0")};`;return`<!DOCTYPE html><html><head><meta charset='utf-8' /><title>Error</title></head><body><h1>This site can\u2019t be reached</h1><hr /><p><b id="remoteHostname"></b>\u2019s server IP address could not be found.</p><p>Try:</p><ul><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>'s administrator</li><li>Verifying the <a id='bareServer' title='Bare server'>Bare server</a> isn't censored</li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p><script src="${"data:application/javascript,"+encodeURIComponent(e)}"><\/script></body></html>`}function U(s,t,i,e,a,r,l){if(e==="The specified host could not be resolved.")return C(r,l);let c=`errorTitle.textContent = ${JSON.stringify(s)};errorCode.textContent = ${JSON.stringify(t)};`+(i?`errorId.textContent = ${JSON.stringify(i)};`:"")+`errorMessage.textContent = ${JSON.stringify(e)};errorTrace.value = ${JSON.stringify(a)};fetchedURL.textContent = ${JSON.stringify(r)};bareServer.href = ${JSON.stringify(l)};for (const node of document.querySelectorAll("#uvHostname")) node.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());uvVersion.textContent = ${JSON.stringify("3.0.0")};`;return`<!DOCTYPE html><html><head><meta charset='utf-8' /><title>Error</title></head><body><h1 id='errorTitle'></h1><hr /><p>Failed to load <b id="fetchedURL"></b></p><p id="errorMessage"></p><table><tbody><tr><td>Code:</td><td id="errorCode"></td></tr>`+(i?'<tr><td>ID:</td><td id="errorId"></td></tr>':"")+`</tbody></table><textarea id="errorTrace" cols="40" rows="10" readonly></textarea><p>Try:</p><ul><li>Checking your internet connection</li><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>'s administrator</li><li>Verify the <a id='bareServer' title='Bare server'>Bare server</a> isn't censored</li></ul><p>If you're the administrator of <b id="uvHostname"></b>, try:</p><ul><li>Restarting your Bare server</li><li>Updating Ultraviolet</li><li>Troubleshooting the error on the <a href="https://github.com/titaniumnetwork-dev/Ultraviolet" target="_blank">GitHub repository</a></li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p><script src="${"data:application/javascript,"+encodeURIComponent(c)}"><\/script></body></html>`}function E(s){return s instanceof Error&&typeof s.body=="object"}function O(s,t,i){let e,a,r,l="",c;return E(s)?(e=s.status,a="Error communicating with the Bare server",c=s.body.message,r=s.body.code,l=s.body.id):(e=500,a="Error processing your request",c="Internal Server Error",r=s instanceof Error?s.name:"UNKNOWN"),new Response(U(a,r,l,c,String(s),t,i),{status:e,headers:{"content-type":"text/html"}})}})();
(()=>{var m=self.Ultraviolet,w=["cross-origin-embedder-policy","cross-origin-opener-policy","cross-origin-resource-policy","content-security-policy","content-security-policy-report-only","expect-ct","feature-policy","origin-isolation","strict-transport-security","upgrade-insecure-requests","x-content-type-options","x-download-options","x-frame-options","x-permitted-cross-domain-policies","x-powered-by","x-xss-protection"],x=["GET","HEAD"],b=class extends m.EventEmitter{constructor(t=__uv$config){super(),t.bare||(t.bare="/bare/"),t.prefix||(t.prefix="/service/"),this.config=t;let i=(Array.isArray(t.bare)?t.bare:[t.bare]).map(e=>new URL(e,location).toString());this.address=i[~~(Math.random()*i.length)],this.bareClient=new m.BareClient}async fetch({request:t}){let i;try{if(!t.url.startsWith(location.origin+this.config.prefix))return await fetch(t);let e=new m(this.config,this.address);typeof this.config.construct=="function"&&this.config.construct(e,"service");let a=await e.cookie.db();e.meta.origin=location.origin,e.meta.base=e.meta.url=new URL(e.sourceUrl(t.url));let r=new g(t,this,e,x.includes(t.method.toUpperCase())?null:await t.blob());if(e.meta.url.protocol==="blob:"&&(r.blob=!0,r.base=r.url=new URL(r.url.pathname)),t.referrer&&t.referrer.startsWith(location.origin)){let n=new URL(e.sourceUrl(t.referrer));(r.headers.origin||e.meta.url.origin!==n.origin&&t.mode==="cors")&&(r.headers.origin=n.origin),r.headers.referer=n.href}let l=await e.cookie.getCookies(a)||[],c=e.cookie.serialize(l,e.meta,!1);r.headers["user-agent"]=navigator.userAgent,c&&(r.headers.cookie=c);let d=new f(r,null,null);if(this.emit("request",d),d.intercepted)return d.returnValue;i=r.blob?"blob:"+location.origin+r.url.pathname:r.url;let u=await this.bareClient.fetch(i,{headers:r.headers,method:r.method,body:r.body,credentials:r.credentials,mode:location.origin!==r.address.origin?"cors":r.mode,cache:r.cache,redirect:r.redirect,proxyIp:this.config.proxyIp,proxyPort:this.config.proxyPort}),o=new y(r,u),h=new f(o,null,null);if(this.emit("beforemod",h),h.intercepted)return h.returnValue;for(let n of w)o.headers[n]&&delete o.headers[n];if(o.headers.location&&(o.headers.location=e.rewriteUrl(o.headers.location)),t.destination==="document"){let n=o.headers["content-disposition"];if(!/\s*?((inline|attachment);\s*?)filename=/i.test(n)){let p=/^\s*?attachment/i.test(n)?"attachment":"inline",[v]=new URL(u.finalURL).pathname.split("/").slice(-1);o.headers["content-disposition"]=`${p}; filename=${JSON.stringify(v)}`}}if(o.headers["set-cookie"]&&(Promise.resolve(e.cookie.setCookies(o.headers["set-cookie"],a,e.meta)).then(()=>{self.clients.matchAll().then(function(n){n.forEach(function(p){p.postMessage({msg:"updateCookies",url:e.meta.url.href})})})}),delete o.headers["set-cookie"]),o.body)switch(t.destination){case"script":case"worker":{let n=[e.bundleScript,e.clientScript,e.configScript,e.handlerScript].map(p=>JSON.stringify(p)).join(",");o.body=`if (!self.__uv && self.importScripts) { ${e.createJsInject(this.address,this.bareClient.manfiest,e.cookie.serialize(l,e.meta,!0),t.referrer)} importScripts(${n}); }
`,o.body+=e.js.rewrite(await u.text())}break;case"style":o.body=e.rewriteCSS(await u.text());break;case"iframe":case"document":S(e.meta.url,o.headers["content-type"]||"")&&(o.body=e.rewriteHtml(await u.text(),{document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,this.address,this.bareClient.manfiest,e.cookie.serialize(l,e.meta,!0),t.referrer)}))}return r.headers.accept==="text/event-stream"&&(o.headers["content-type"]="text/event-stream"),crossOriginIsolated&&(o.headers["Cross-Origin-Embedder-Policy"]="require-corp"),this.emit("response",h),h.intercepted?h.returnValue:new Response(o.body,{headers:o.headers,status:o.status,statusText:o.statusText})}catch(e){return["document","iframe"].includes(t.destination)?(console.error(e),U(e,i,this.address)):new Response(void 0,{status:500})}}static Ultraviolet=m};self.UVServiceWorker=b;var y=class{constructor(t,i){this.request=t,this.raw=i,this.ultraviolet=t.ultraviolet,this.headers={};for(let e in i.rawHeaders)this.headers[e.toLowerCase()]=i.rawHeaders[e];this.status=i.status,this.statusText=i.statusText,this.body=i.body}get url(){return this.request.url}get base(){return this.request.base}set base(t){this.request.base=t}},g=class{constructor(t,i,e,a=null){this.ultraviolet=e,this.request=t,this.headers=Object.fromEntries(t.headers.entries()),this.method=t.method,this.address=i.address,this.body=a||null,this.cache=t.cache,this.redirect=t.redirect,this.credentials="omit",this.mode=t.mode==="cors"?t.mode:"same-origin",this.blob=!1}get url(){return this.ultraviolet.meta.url}set url(t){this.ultraviolet.meta.url=t}get base(){return this.ultraviolet.meta.base}set base(t){this.ultraviolet.meta.base=t}};function S(s,t=""){return(m.mime.contentType(t||s.pathname)||"text/html").split(";")[0]==="text/html"}var f=class{#e;#t;constructor(t={},i=null,e=null){this.#e=!1,this.#t=null,this.data=t,this.target=i,this.that=e}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(t){this.#t=t,this.#e=!0}};function C(s,t){let i=new URL(s),e=`remoteHostname.textContent = ${JSON.stringify(i.hostname)};bareServer.href = ${JSON.stringify(t)};uvHostname.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());uvVersion.textContent = ${JSON.stringify("3.0.1")};`;return`<!DOCTYPE html><html><head><meta charset='utf-8' /><title>Error</title><style>* { background-color: white }</style></head><body><h1>This site can\u2019t be reached</h1><hr /><p><b id="remoteHostname"></b>\u2019s server IP address could not be found.</p><p>Try:</p><ul><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>'s administrator</li><li>Verifying the <a id='bareServer' title='Bare server'>Bare server</a> isn't censored</li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p><script src="${"data:application/javascript,"+encodeURIComponent(e)}"><\/script></body></html>`}function E(s,t,i,e,a,r,l){if(e==="The specified host could not be resolved.")return C(r,l);let c=`errorTitle.textContent = ${JSON.stringify(s)};errorCode.textContent = ${JSON.stringify(t)};`+(i?`errorId.textContent = ${JSON.stringify(i)};`:"")+`errorMessage.textContent = ${JSON.stringify(e)};errorTrace.value = ${JSON.stringify(a)};fetchedURL.textContent = ${JSON.stringify(r)};bareServer.href = ${JSON.stringify(l)};for (const node of document.querySelectorAll("#uvHostname")) node.textContent = ${JSON.stringify(location.hostname)};reload.addEventListener("click", () => location.reload());uvVersion.textContent = ${JSON.stringify("3.0.1")};`;return`<!DOCTYPE html><html><head><meta charset='utf-8' /><title>Error</title><style>* { background-color: white }</style></head><body><h1 id='errorTitle'></h1><hr /><p>Failed to load <b id="fetchedURL"></b></p><p id="errorMessage"></p><table><tbody><tr><td>Code:</td><td id="errorCode"></td></tr>`+(i?'<tr><td>ID:</td><td id="errorId"></td></tr>':"")+`</tbody></table><textarea id="errorTrace" cols="40" rows="10" readonly></textarea><p>Try:</p><ul><li>Checking your internet connection</li><li>Verifying you entered the correct address</li><li>Clearing the site data</li><li>Contacting <b id="uvHostname"></b>'s administrator</li><li>Verify the <a id='bareServer' title='Bare server'>Bare server</a> isn't censored</li></ul><p>If you're the administrator of <b id="uvHostname"></b>, try:</p><ul><li>Restarting your Bare server</li><li>Updating Ultraviolet</li><li>Troubleshooting the error on the <a href="https://github.com/titaniumnetwork-dev/Ultraviolet" target="_blank">GitHub repository</a></li></ul><button id="reload">Reload</button><hr /><p><i>Ultraviolet v<span id="uvVersion"></span></i></p><script src="${"data:application/javascript,"+encodeURIComponent(c)}"><\/script></body></html>`}function O(s){return s instanceof Error&&typeof s.body=="object"}function U(s,t,i){let e,a,r,l="",c,d={"content-type":"text/html"};return crossOriginIsolated&&(d["Cross-Origin-Embedder-Policy"]="require-corp"),O(s)?(e=s.status,a="Error communicating with the Bare server",c=s.body.message,r=s.body.code,l=s.body.id):(e=500,a="Error processing your request",c="Internal Server Error",r=s instanceof Error?s.name:"UNKNOWN"),new Response(E(a,r,l,c,String(s),t,i),{status:e,headers:d})}})();
//# sourceMappingURL=uv.sw.js.map
{
"name": "@titaniumnetwork-dev/ultraviolet",
"version": "3.0.0",
"version": "3.0.1",
"description": "Highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers and more!",

@@ -13,3 +13,5 @@ "main": "lib/index.cjs",

"dist",
"lib"
"lib",
"uv.d.ts",
"client.d.ts"
],

@@ -20,6 +22,7 @@ "type": "module",

"dev": "rimraf dist/ && node build.js --dev",
"publish": "npm run build && npm publish --access public"
"publish": "npm run build && npm publish --access public",
"pack": "npm run build && npm pack"
},
"dependencies": {
"@mercuryworkshop/bare-mux": "1.0.0",
"@mercuryworkshop/bare-mux": "^1.0.7",
"crypto-js": "^4.2.0",

@@ -26,0 +29,0 @@ "css-tree": "^2.0.4",

@@ -27,9 +27,26 @@ <p align="center"><img src="https://raw.githubusercontent.com/titaniumnetwork-dev/Ultraviolet-Static/main/public/uv.png" height="250"></p>

- [Alu](https://github.com/titaniumnetwork-dev/Alu)
- [AnuraOS](https://github.com/MercuryWorkshop/anuraOS)
- [Nebula](https://github.com/NebulaServices/Nebula)
- [Holy Unblocker](https://github.com/holy-unblocker/website)
- [Hypertabs](https://hypertabs.cc/)
- [Terbium](https://github.com/TerbiumOS/webOS)
- [Incognito](https://github.com/caracal-js/Incognito)
- [Nebula](https://github.com/NebulaServices/Nebula)
- [Metallic](https://github.com/Metallic-Web/Metallic)
## Upgrading
A guide for updating from any version to v3 can be found [here](https://github.com/titaniumnetwork-dev/Ultraviolet/wiki/Upgrading).
## Older Ultraviolet versions
Starting from v3, Ultraviolet uses [bare-mux](https://github.com/MercuryWorkshop/bare-mux), a library that allows you to switch out your Bare client.
If you operate using an older Ultraviolet, we encourage you to update.
If you're too lazy to do either of the above, you can install an outdated and unsupported version of Ultraviolet.
```sh
npm install @titaniumnetwork-dev/ultraviolet@1
```
## Changelog

@@ -36,0 +53,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc