@titaniumnetwork-dev/ultraviolet
Advanced tools
Comparing version 3.0.2 to 3.1.0
declare const Ultraviolet: typeof import('./uv').Ultraviolet; | ||
declare var __uv$config: import('./uv').UVConfig; | ||
declare var __uv$config: import('./uv').UVConfig; |
@@ -23,2 +23,2 @@ /*global UVServiceWorker,__uv$config*/ | ||
); | ||
}); | ||
}); |
@@ -1,2 +0,2 @@ | ||
(()=>{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 Ae=Object.create;var q=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var We=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var _e=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ue(e))!qe.call(a,n)&&n!==r&&q(a,n,{get:()=>e[n],enumerable:!(t=Te(e,n))||t.enumerable});return a};var p=(a,e,r)=>(r=a!=null?Ae(je(a)):{},_e(e||!a||!a.__esModule?q(r,"default",{value:a,enumerable:!0}):r,a));var c=We((Je,P)=>{"use strict";var m=typeof Reflect=="object"?Reflect:null,W=m&&typeof m.apply=="function"?m.apply:function(e,r,t){return Function.prototype.apply.call(e,r,t)},f;m&&typeof m.ownKeys=="function"?f=m.ownKeys:Object.getOwnPropertySymbols?f=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:f=function(e){return Object.getOwnPropertyNames(e)};function Fe(a){console&&console.warn&&console.warn(a)}var F=Number.isNaN||function(e){return e!==e};function l(){l.init.call(this)}P.exports=l;P.exports.once=Xe;l.EventEmitter=l;l.prototype._events=void 0;l.prototype._eventsCount=0;l.prototype._maxListeners=void 0;var _=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(l,"defaultMaxListeners",{enumerable:!0,get:function(){return _},set:function(a){if(typeof a!="number"||a<0||F(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");_=a}});l.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};l.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||F(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function G(a){return a._maxListeners===void 0?l.defaultMaxListeners:a._maxListeners}l.prototype.getMaxListeners=function(){return G(this)};l.prototype.emit=function(e){for(var r=[],t=1;t<arguments.length;t++)r.push(arguments[t]);var n=e==="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 h=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw h.context=o,h}var u=i[e];if(u===void 0)return!1;if(typeof u=="function")W(u,this,r);else for(var d=u.length,v=z(u,d),t=0;t<d;++t)W(v[t],this,r);return!0};function B(a,e,r,t){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",e,r.listener?r.listener:r),i=a._events),o=i[e]),o===void 0)o=i[e]=r,++a._eventsCount;else if(typeof o=="function"?o=i[e]=t?[r,o]:[o,r]:t?o.unshift(r):o.push(r),n=G(a),n>0&&o.length>n&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=a,h.type=e,h.count=o.length,Fe(h)}return a}l.prototype.addListener=function(e,r){return B(this,e,r,!1)};l.prototype.on=l.prototype.addListener;l.prototype.prependListener=function(e,r){return B(this,e,r,!0)};function Ge(){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,e,r){var t={fired:!1,wrapFn:void 0,target:a,type:e,listener:r},n=Ge.bind(t);return n.listener=r,t.wrapFn=n,n}l.prototype.once=function(e,r){return w(r),this.on(e,K(this,e,r)),this};l.prototype.prependOnceListener=function(e,r){return w(r),this.prependListener(e,K(this,e,r)),this};l.prototype.removeListener=function(e,r){var t,n,i,o,h;if(w(r),n=this._events,n===void 0)return this;if(t=n[e],t===void 0)return this;if(t===r||t.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,t.listener||r));else if(typeof t!="function"){for(i=-1,o=t.length-1;o>=0;o--)if(t[o]===r||t[o].listener===r){h=t[o].listener,i=o;break}if(i<0)return this;i===0?t.shift():Be(t,i),t.length===1&&(n[e]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",e,h||r)}return this};l.prototype.off=l.prototype.removeListener;l.prototype.removeAllListeners=function(e){var r,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){var i=Object.keys(t),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=t[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function X(a,e,r){var t=a._events;if(t===void 0)return[];var n=t[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Ke(n):z(n,n.length)}l.prototype.listeners=function(e){return X(this,e,!0)};l.prototype.rawListeners=function(e){return X(this,e,!1)};l.listenerCount=function(a,e){return typeof a.listenerCount=="function"?a.listenerCount(e):Q.call(a,e)};l.prototype.listenerCount=Q;function Q(a){var e=this._events;if(e!==void 0){var r=e[a];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}l.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function z(a,e){for(var r=new Array(e),t=0;t<e;++t)r[t]=a[t];return r}function Be(a,e){for(;e+1<a.length;e++)a[e]=a[e+1];a.pop()}function Ke(a){for(var e=new Array(a.length),r=0;r<e.length;++r)e[r]=a[r].listener||a[r];return e}function Xe(a,e){return new Promise(function(r,t){function n(o){a.removeListener(e,i),t(o)}function i(){typeof a.removeListener=="function"&&a.removeListener("error",n),r([].slice.call(arguments))}J(a,e,i,{once:!0}),e!=="error"&&Qe(a,n,{once:!0})})}function Qe(a,e,r){typeof a.on=="function"&&J(a,"error",e,r)}function J(a,e,r,t){if(typeof a.on=="function")t.once?a.once(e,r):a.on(e,r);else if(typeof a.addEventListener=="function")a.addEventListener(e,function n(i){t.once&&a.removeEventListener(e,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(e={},r=null,t=null){this.#e=!1,this.#t=null,this.data=e,this.target=r,this.that=t}get intercepted(){return this.#e}get returnValue(){return this.#t}respondWith(e){this.#t=e,this.#e=!0}},s=g;var x=class extends Y.default{constructor(e){super(),this.ctx=e,this.window=e.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=e.nativeMethods.getOwnPropertyDescriptor(this.docProto,"title"),this.cookie=e.nativeMethods.getOwnPropertyDescriptor(this.docProto,"cookie"),this.referrer=e.nativeMethods.getOwnPropertyDescriptor(this.docProto,"referrer"),this.domain=e.nativeMethods.getOwnPropertyDescriptor(this.docProto,"domain"),this.documentURI=e.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=e.nativeMethods.getOwnPropertyDescriptor(this.docProto,"URL")}overrideParseFromString(){this.ctx.override(this.domProto,"parseFromString",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({string:n,type:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({selectors:n},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getDomain",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("referrer",t),t.intercepted?t.returnValue:t.data.value}})}overrideCreateTreeWalker(){this.ctx.override(this.docProto,"createTreeWalker",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n,i=4294967295,o,h]=t,u=new s({root:n,show:i,filter:o,expandEntityReferences:h},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[...n]=t,i=new s({html:n},e,r);return this.emit("write",i),i.intercepted?i.returnValue:i.target.apply(i.that,i.data.html)}),this.ctx.override(this.docProto,"writeln",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[...n]=t,i=new s({html:n},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("documentURI",t),t.intercepted?t.returnValue:t.data.value}})}overrideURL(){this.ctx.overrideDescriptor(this.docProto,"URL",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("url",t),t.intercepted?t.returnValue:t.data.value}})}overrideCookie(){this.ctx.overrideDescriptor(this.docProto,"cookie",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getCookie",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getTitle",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,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(e){super(),this.ctx=e,this.window=e.window,this.Audio=this.window.Audio,this.Element=this.window.Element,this.elemProto=this.Element?this.Element.prototype:{},this.innerHTML=e.nativeMethods.getOwnPropertyDescriptor(this.elemProto,"innerHTML"),this.outerHTML=e.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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({selectors:n},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n},e,r);return this.emit("getAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.elemProto,"setAttribute",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({name:n,value:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n},e,r);return this.emit("hasAttribute",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.elemProto,"removeAttribute",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n},e,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",(e,r,t)=>{if(!t.length)return new e(...t);let[n]=t,i=new s({url:n},e,r);return this.emit("audio",i),i.intercepted?i.returnValue:new i.target(i.data.url)},!0)}overrideHtml(){this.hookProperty(this.Element,"innerHTML",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getInnerHTML",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,r);if(this.emit("setInnerHTML",n),n.intercepted)return n.returnValue;e.call(r,n.data.value)}}),this.hookProperty(this.Element,"outerHTML",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getOuterHTML",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,r);if(this.emit("setOuterHTML",n),n.intercepted)return n.returnValue;e.call(r,n.data.value)}})}overrideInsertAdjacentHTML(){this.ctx.override(this.elemProto,"insertAdjacentHTML",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({position:n,html:i},e,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",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({position:n,text:i},e,r);return this.emit("insertAdjacentText",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.position,o.data.text)})}hookProperty(e,r,t){if(!e)return!1;if(this.ctx.nativeMethods.isArray(e)){for(let i of e)this.hookProperty(i,r,t);return!0}let n=e.prototype;return this.ctx.overrideDescriptor(n,r,t),!0}},ee=b;var te=p(c(),1);var O=class extends te.default{constructor(e){super(),this.ctx=e,this.window=e.window,this.Node=e.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=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"textContent"),this.parentNode=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentNode"),this.parentElement=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"parentElement"),this.childNodes=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"childNodes"),this.baseURI=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"baseURI"),this.previousSibling=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"previousSibling"),this.ownerDocument=e.nativeMethods.getOwnPropertyDescriptor(this.nodeProto,"ownerDocument")}overrideTextContent(){this.ctx.overrideDescriptor(this.nodeProto,"textContent",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getTextContent",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,r);if(this.emit("setTextContent",n),n.intercepted)return n.returnValue;e.call(r,n.data.value)}})}overrideAppend(){this.ctx.override(this.nodeProto,"append",(e,r,[...t])=>{let n=new s({nodes:t},e,r);return this.emit("append",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.nodes)}),this.ctx.override(this.nodeProto,"appendChild",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({node:n},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("baseURI",t),t.intercepted?t.returnValue:t.data.value}})}overrideParent(){this.ctx.overrideDescriptor(this.nodeProto,"parentNode",{get:(e,r)=>{let t=new s({node:e.call(r)},e,r);return this.emit("parentNode",t),t.intercepted?t.returnValue:t.data.node}}),this.ctx.overrideDescriptor(this.nodeProto,"parentElement",{get:(e,r)=>{let t=new s({element:e.call(r)},e,r);return this.emit("parentElement",t),t.intercepted?t.returnValue:t.data.node}})}overrideOwnerDocument(){this.ctx.overrideDescriptor(this.nodeProto,"ownerDocument",{get:(e,r)=>{let t=new s({document:e.call(r)},e,r);return this.emit("ownerDocument",t),t.intercepted?t.returnValue:t.data.document}})}overrideCompareDocumentPosit1ion(){this.ctx.override(this.nodeProto,"compareDocumentPosition",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({node:n},e,r);return i.intercepted?i.returnValue:i.target.call(i.that,i.data.node)})}overrideChildMethods(){this.ctx.override(this.nodeProto,"removeChild")}},re=O;var ie=p(c(),1);var S=class extends ie.default{constructor(e){super(),this.ctx=e,this.window=e.window,this.Attr=this.window.Attr||{},this.attrProto=this.Attr.prototype||{},this.value=e.nativeMethods.getOwnPropertyDescriptor(this.attrProto,"value"),this.name=e.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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("name",t),t.intercepted?t.returnValue:t.data.value}}),this.ctx.overrideDescriptor(this.attrProto,"value",{get:(e,r)=>{let t=new s({name:this.name.get.call(r),value:e.call(r)},e,r);return this.emit("getValue",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({name:this.name.get.call(r),value:t},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n},e,r);return this.emit("getNamedItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"setNamedItem",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({name:n,value:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n},e,r);return this.emit("removeNamedItem",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"item",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({index:n},e,r);return this.emit("item",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"getNamedItemNS",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({namespace:n,localName:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({attr:n},e,r);return this.emit("setNamedItemNS",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),this.ctx.override(this.attrProto,"removeNamedItemNS",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({namespace:n,localName:i},e,r);return this.emit("removeNamedItemNS",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.namespace,o.data.localName)})}},ne=S;var oe=p(c(),1);var L=class extends oe.default{constructor(e){super(),this.ctx=e,this.window=e.window,this.Function=this.window.Function,this.fnProto=this.Function.prototype,this.toString=this.fnProto.toString,this.fnStrings=e.fnStrings,this.call=this.fnProto.call,this.apply=this.fnProto.apply,this.bind=this.fnProto.bind}overrideFunction(){this.ctx.override(this.window,"Function",(e,r,t)=>{if(!t.length)return e.apply(r,t);let n=t[t.length-1],i=[];for(let h=0;h<t.length-1;h++)i.push(t[h]);let o=new s({script:n,args:i},e,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",(e,r)=>{let t=new s({fn:r},e,r);return this.emit("toString",t),t.intercepted?t.returnValue:t.target.call(t.data.fn)})}},se=L;var ae=p(c(),1);var E=class extends ae.default{constructor(e){super(),this.ctx=e,this.window=e.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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({names:e.call(r,n)},e,r);return this.emit("getOwnPropertyNames",i),i.intercepted?i.returnValue:i.data.names})}overrideGetOwnPropertyDescriptors(){this.ctx.override(this.Object,"getOwnPropertyDescriptors",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({descriptors:e.call(r,n)},e,r);return this.emit("getOwnPropertyDescriptors",i),i.intercepted?i.returnValue:i.data.descriptors})}},he=E;var le=p(c(),1);var D=class extends le.default{constructor(e){super(),this.ctx=e,this.window=e.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=e.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"url"),this.resUrl=e.nativeMethods.getOwnPropertyDescriptor(this.resProto,"url"),this.reqHeaders=e.nativeMethods.getOwnPropertyDescriptor(this.reqProto,"headers"),this.resHeaders=e.nativeMethods.getOwnPropertyDescriptor(this.resProto,"headers")}override(){return this.overrideRequest(),this.overrideUrl(),this.overrideHeaders(),!0}overrideRequest(){return this.fetch?(this.ctx.override(this.window,"fetch",(e,r,t)=>{if(!t.length||t[0]instanceof this.Request)return e.apply(r,t);let[n,i={}]=t,o=new s({input:n,options:i},e,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",(e,r,t)=>{if(!t.length)return new e(...t);let[n,i={}]=t,o=new s({input:n,options:i},e);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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("requestUrl",t),t.intercepted?t.returnValue:t.data.value}}),this.ctx.overrideDescriptor(this.resProto,"url",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("responseUrl",t),t.intercepted?t.returnValue:t.data.value}}),!0}overrideHeaders(){return this.Headers?(this.ctx.overrideDescriptor(this.reqProto,"headers",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("requestHeaders",t),t.intercepted?t.returnValue:t.data.value}}),this.ctx.overrideDescriptor(this.resProto,"headers",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("responseHeaders",t),t.intercepted?t.returnValue:t.data.value}}),this.ctx.override(this.headersProto,"get",(e,r,[t])=>{if(!t)return e.call(r);let n=new s({name:t,value:e.call(r,t)},e,r);return this.emit("getHeader",n),n.intercepted?n.returnValue:n.data.value}),this.ctx.override(this.headersProto,"set",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({name:n,value:i},e,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",(e,r,t)=>{if(!t.length)return e.call(r);let[n]=t,i=new s({name:n,value:e.call(r,n)},e,r);return this.emit("hasHeader",i),i.intercepted?i.returnValue:i.data}),this.ctx.override(this.headersProto,"append",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({name:n,value:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n},e,r);return this.emit("deleteHeader",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.name)}),!0):!1}},ue=D;var de=p(c(),1);var M=class extends de.default{constructor(e){super(),this.ctx=e,this.window=e.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=e.nativeMethods.getOwnPropertyDescriptor(this.xhrProto,"responseURL"),this.responseText=e.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",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i,o=!0,h=null,u=null]=t,d=new s({method:n,input:i,async:o,user:h,password:u},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("responseUrl",t),t.intercepted?t.returnValue:t.data.value}})}overrideSend(){this.ctx.override(this.xhrProto,"send",(e,r,[t=null])=>{let n=new s({body:t},e,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",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({name:n,value:i},e,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",(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getAllResponseHeaders",t),t.intercepted?t.returnValue:t.data.value})}overrideGetResHeader(){this.ctx.override(this.xhrProto,"getResponseHeader",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({name:n,value:e.call(r,n)},e,r);return i.intercepted?i.returnValue:i.data.value})}},ce=M;var pe=p(c(),1);var k=class extends pe.default{constructor(e){super(),this.ctx=e,this.window=e.window,this.EventSource=this.window.EventSource||{},this.esProto=this.EventSource.prototype||{},this.url=e.nativeMethods.getOwnPropertyDescriptor(this.esProto,"url"),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2}overrideConstruct(){this.ctx.override(this.window,"EventSource",(e,r,t)=>{if(!t.length)return new e(...t);let[n,i={}]=t,o=new s({url:n,config:i},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("url",t),t.data.value}})}},ve=k;var me=p(c(),1);var V=class extends me.default{constructor(e){super(),this.ctx=e,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",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i,o=""]=t,h=new s({state:n,title:i,url:o},e,r);return this.emit("pushState",h),h.intercepted?h.returnValue:h.target.call(h.that,h.data.state,h.data.title,h.data.url)})}overrideReplaceState(){this.ctx.override(this.historyProto,"replaceState",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i,o=""]=t,h=new s({state:n,title:i,url:o},e,r);return this.emit("replaceState",h),h.intercepted?h.returnValue:h.target.call(h.that,h.data.state,h.data.title,h.data.url)})}overrideGo(){this.ctx.override(this.historyProto,"go",(e,r,[t])=>{let n=new s({delta:t},e,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",(e,r)=>{let t=new s(null,e,r);return this.emit("forward",t),t.intercepted?t.returnValue:t.target.call(t.that)})}overrideBack(){this.ctx.override(this.historyProto,"back",(e,r)=>{let t=new s(null,e,r);return this.emit("back",t),t.intercepted?t.returnValue:t.target.call(t.that)})}},fe=V;var we=p(c(),1),N=class extends we.default{constructor(e){super(),this.ctx=e,this.window=e.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?e.nativeMethods.getOwnPropertyDescriptor(this.workerLocProto,"href"):e.nativeMethods.getOwnPropertyDescriptor(this.location,"href")}overrideWorkerLocation(e){if(!this.WorkerLocation)return!1;let r=this;for(let t of this.keys)this.ctx.overrideDescriptor(this.workerLocProto,t,{get:()=>e(r.href.get.call(this.location))[t]});return!0}emulate(e,r){let t={},n=this;for(let i of n.keys)this.ctx.nativeMethods.defineProperty(t,i,{get(){return e(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",t.href,o.trim().startsWith("#")?new URL(o.trim(),t.href).href:new URL("#"+o.trim(),t.href).href,n);break;default:{let h=new URL(t.href);h[i]=o,n.location.href=r(h.href)}break}}:void 0,configurable:!1,enumerable:!0});return"reload"in this.location&&this.ctx.nativeMethods.defineProperty(t,"reload",{value:this.ctx.wrap(this.location,"reload",(i,o)=>i.call(o===t?this.location:o)),writable:!1,enumerable:!0}),"replace"in this.location&&this.ctx.nativeMethods.defineProperty(t,"replace",{value:this.ctx.wrap(this.location,"assign",(i,o,h)=>{(!h.length||o!==t)&&i.call(o),o=this.location;let[u]=h,d=new URL(u,t.href);return i.call(o===t?this.location:o,r(d.href))}),writable:!1,enumerable:!0}),"assign"in this.location&&this.ctx.nativeMethods.defineProperty(t,"assign",{value:this.ctx.wrap(this.location,"assign",(i,o,h)=>{(!h.length||o!==t)&&i.call(o),o=this.location;let[u]=h,d=new URL(u,t.href);return i.call(o===t?this.location:o,r(d.href))}),writable:!1,enumerable:!0}),"ancestorOrigins"in this.location&&this.ctx.nativeMethods.defineProperty(t,"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(t,"toString",{value:this.ctx.wrap(this.location,"toString",()=>t.href),enumerable:!0,writable:!1}),this.ctx.nativeMethods.defineProperty(t,Symbol.toPrimitive,{value:()=>t.href,writable:!1,enumerable:!1}),this.ctx.window.Location&&this.ctx.nativeMethods.setPrototypeOf(t,this.ctx.window.Location.prototype),t}},ye=N;var Pe=p(c(),1);var R=class extends Pe.default{constructor(e){super(),this.ctx=e,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=e.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"data"),this.messageOrigin=e.nativeMethods.getOwnPropertyDescriptor(this.messageProto,"origin")}overridePostMessage(){this.ctx.override(this.window,"postMessage",(e,r,t)=>{if(!t.length)return e.apply(r,t);let n,i,o;this.ctx.worker?[n,o=[]]=t:[n,i,o=[]]=t;let h=new s({message:n,origin:i,transfer:o,worker:this.ctx.worker},e,r);return this.emit("postMessage",h),h.intercepted?h.returnValue:this.ctx.worker?h.target.call(h.that,h.data.message,h.data.transfer):h.target.call(h.that,h.data.message,h.data.origin,h.data.transfer)})}wrapPostMessage(e,r,t=!1){return this.ctx.wrap(e,r,(n,i,o)=>{if(this.ctx.worker?!o.length:2>o)return n.apply(i,o);let h,u,d;t?([h,d=[]]=o,u=null):[h,u,d=[]]=o;let v=new s({message:h,origin:u,transfer:d,worker:this.ctx.worker},n,e);return this.emit("postMessage",v),v.intercepted?v.returnValue:t?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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("origin",t),t.intercepted?t.returnValue:t.data.value}})}overrideMessageData(){this.ctx.overrideDescriptor(this.messageProto,"data",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("data",t),t.intercepted?t.returnValue:t.data.value}})}},ge=R;var xe=p(c(),1);var I=class extends xe.default{constructor(e){super(),this.ctx=e,this.window=e.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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n,i=""]=t,o=new s({url:n,data:i},e,r);return this.emit("sendBeacon",o),o.intercepted?o.returnValue:o.target.call(o.that,o.data.url,o.data.data)})}},be=I;var Oe=p(c(),1);var H=class extends Oe.default{constructor(e){super(),this.ctx=e,this.window=e.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",(e,r,t)=>{if(!t.length)return new e(...t);let[n,i={}]=t,o=new s({url:n,options:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n,i={}]=t,o=new s({url:n,options:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n,i=[]]=t,o=new s({message:n,transfer:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let n=new s({scripts:t},e,r);return this.emit("importScripts",n),n.intercepted?n.returnValue:n.target.apply(n.that,n.data.scripts)})}},Se=H;var Le=p(c(),1);var C=class extends Le.default{constructor(e){super(),this.ctx=e,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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({object:n},e,r);return this.emit("createObjectURL",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.object)}),this.ctx.override(this.URL,"revokeObjectURL",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({url:n},e,r);return this.emit("revokeObjectURL",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.url)})}},Ee=C;var Ce=p(c(),1);var De=p(c(),1);var A=class extends De.default{constructor(e){super(),this.ctx=e,this.window=e.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 e.nativeMethods.Map}overrideMethods(){this.ctx.override(this.storeProto,"getItem",(e,r,t)=>{if(!t.length)return e.apply(this.wrappers.get(r)||r,t);let[n]=t,i=new s({name:n},e,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",(e,r,t)=>{if(2>t.length)return e.apply(this.wrappers.get(r)||r,t);let[n,i]=t,o=new s({name:n,value:i},e,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",(e,r,t)=>{if(!t.length)return e.apply(this.wrappers.get(r)||r,t);let[n]=t,i=new s({name:n},e,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",(e,r)=>{let t=new s(null,e,this.wrappers.get(r)||r);return this.emit("clear",t),t.intercepted?t.returnValue:t.target.call(t.that)}),this.ctx.override(this.storeProto,"key",(e,r,t)=>{if(!t.length)return e.apply(this.wrappers.get(r)||r,t);let[n]=t,i=new s({index:n},e,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:(e,r)=>{let t=new s({length:e.call(this.wrappers.get(r)||r)},e,this.wrappers.get(r)||r);return this.emit("length",t),t.intercepted?t.returnValue:t.data.length}})}emulate(e,r={}){this.ctx.nativeMethods.setPrototypeOf(r,this.storeProto);let t=new this.ctx.window.Proxy(r,{get:(n,i)=>{if(i in this.storeProto||typeof i=="symbol")return e[i];let o=new s({name:i},null,e);return this.emit("get",o),o.intercepted?o.returnValue:e[o.data.name]},set:(n,i,o)=>{if(i in this.storeProto||typeof i=="symbol")return e[i]=o;let h=new s({name:i,value:o},null,e);return this.emit("set",h),h.intercepted?h.returnValue:e[h.data.name]=h.data.value},deleteProperty:(n,i)=>{if(typeof i=="symbol")return delete e[i];let o=new s({name:i},null,e);return this.emit("delete",o),o.intercepted?o.returnValue:delete e[o.data.name]}});return this.wrappers.set(t,e),this.ctx.nativeMethods.setPrototypeOf(t,this.storeProto),t}},Me=A;var ke=p(c(),1);var T=class extends ke.default{constructor(e){super(),this.ctx=e,this.window=e.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-e.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",(e,r,t)=>{if(!t.length)return e.apply(r,t);let[n]=t,i=new s({property:n},e,r);return this.emit("getPropertyValue",i),i.intercepted?i.returnValue:i.target.call(i.that,i.data.property)}),this.ctx.override(this.cssStyleProto,"setProperty",(e,r,t)=>{if(2>t.length)return e.apply(r,t);let[n,i]=t,o=new s({property:n,value:i},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("getCssText",t),t.intercepted?t.returnValue:t.data.value},set:(e,r,[t])=>{let n=new s({value:t},e,r);return this.emit("setCssText",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.value)}})}},Ve=T;var Ne=p(c(),1);var U=class extends Ne.default{constructor(e){super(),this.ctx=e,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",(e,r,t)=>{if(!t.length||!t.length)return e.apply(r,t);let[n,i]=t,o=new s({name:n,version:i},e,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:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("idbFactoryName",t),t.intercepted?t.returnValue:t.data.value}})}},Re=U;var Ie=p(c(),1);var j=class extends Ie.default{constructor(e){super(),this.ctx=e,this.window=e.window,this.WebSocket=this.window.WebSocket||{},this.wsProto=this.WebSocket.prototype||{},this.url=e.nativeMethods.getOwnPropertyDescriptor(this.wsProto,"url"),this.protocol=e.nativeMethods.getOwnPropertyDescriptor(this.wsProto,"protocol"),this.readyState=e.nativeMethods.getOwnPropertyDescriptor(this.wsProto,"readyState"),this.send=this.wsProto.send,this.CONNECTING=WebSocket.CONNECTING,this.OPEN=WebSocket.OPEN,this.CLOSING=WebSocket.CLOSING,this.CLOSED=WebSocket.CLOSED}overrideWebSocket(){this.ctx.override(this.window,"WebSocket",(e,r,t)=>{if(!t.length)return new e(...t);let n=new s({args:t},e,r);return this.emit("websocket",n),n.intercepted?n.returnValue:new n.target(n.data.url,n.data.protocols)},!0),this.window.WebSocket.CONNECTING=this.CONNECTING,this.window.WebSocket.OPEN=this.OPEN,this.window.WebSocket.CLOSING=this.CLOSING,this.window.WebSocket.CLOSED=this.CLOSED}overrideURL(){this.ctx.overrideDescriptor(this.wsProto,"url",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("url",t),t.data.value}})}overrideProtocol(){this.ctx.overrideDescriptor(this.wsProto,"protocol",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("protocol",t),t.data.value}})}overrideReadyState(){this.ctx.overrideDescriptor(this.wsProto,"readyState",{get:(e,r)=>{let t=new s({value:e.call(r)},e,r);return this.emit("readyState",t),t.data.value}})}overrideSend(){this.ctx.override(this.wsProto,"send",(e,r,t)=>{let n=new s({args:t},e,r);return this.emit("send",n),n.intercepted?n.returnValue:n.target.call(n.that,n.data.args)})}},He=j;var y=class extends Ce.default{constructor(e=self,r,t=!e.window){super(),this.window=e,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=t,this.bareClient=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 he(this),this.websocket=new He(this),this.message=new ge(this),this.navigator=new be(this),this.eventSource=new ve(this),this.attribute=new ne(this),this.url=new Ee(this),this.workers=new Se(this),this.location=new ye(this),this.storage=new Me(this),this.style=new Ve(this)}override(e,r,t,n){let i=this.wrap(e,r,t,n);return e[r]=i,i}overrideDescriptor(e,r,t={}){let n=this.wrapDescriptor(e,r,t);return n?(this.nativeMethods.defineProperty(e,r,n),n):{}}wrap(e,r,t,n=!1){let i=e[r];if(!i)return i;let o="prototype"in i?function(){return t(i,this,[...arguments])}:{attach(){return t(i,this,[...arguments])}}.attach;return n&&(o.prototype=i.prototype,o.prototype.constructor=o),this.emit("wrap",i,o,n),o}wrapDescriptor(e,r,t={}){let n=this.nativeMethods.getOwnPropertyDescriptor(e,r);if(!n)return!1;for(let i in t)i in n&&(i==="get"||i==="set"?n[i]=this.wrap(n,i,t[i]):n[i]=typeof t[i]=="function"?t[i](n[i]):t[i]);return n}},er=y;typeof self=="object"&&(self.UVClient=y);})(); | ||
//# sourceMappingURL=uv.client.js.map |
@@ -1,2 +0,2 @@ | ||
(()=>{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 f=self.Ultraviolet,R=self.UVClient,I=self.__uv$config,d=self.__uv$bareData,m=self.__uv$bareURL,v=self.__uv$cookies;if(typeof d!="object"||typeof m!="string"||typeof v!="string")throw new TypeError("Unable to load global UV data");self.__uv||p(self);self.__uvHook=p;function p(o){if("__uv"in o&&o.__uv instanceof f)return!1;o.document&&o.window&&o.document.querySelectorAll("script[__uv-script]").forEach(t=>t.remove());let b=!o.window,_="__uv",i="__uv$",e=new f(I),y=new f.BareClient,a=new R(o,y,b),{HTMLMediaElement:h,HTMLScriptElement:S,HTMLAudioElement:M,HTMLVideoElement:j,HTMLInputElement:H,HTMLEmbedElement:$,HTMLTrackElement:x,HTMLAnchorElement:L,HTMLIFrameElement:u,HTMLAreaElement:O,HTMLLinkElement:T,HTMLBaseElement:E,HTMLFormElement:C,HTMLImageElement:P,HTMLSourceElement:W}=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 n=v;if(e.meta.url=e.location,e.domain=e.meta.url.host,e.blobUrls=new o.Map,e.referrer="",e.cookies=[],e.localStorageObj={},e.sessionStorageObj={},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(i+e.location.origin+"@")&&(e.localStorageObj[t.slice((i+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(i+e.location.origin+"@")&&(e.sessionStorageObj[t.slice((i+e.location.origin+"@").length)]=o.sessionStorage.getItem(t));e.ssWrap=a.storage.emulate(a.storage.sessionStorage,e.sessionStorageObj)}let c=o.document?a.node.baseURI.get.call(o.document):o.location.href,k=e.sourceUrl(c);a.nativeMethods.defineProperty(e.meta,"base",{get(){return o.document?(a.node.baseURI.get.call(o.document)!==c&&(c=a.node.baseURI.get.call(o.document),k=e.sourceUrl(c)),k):e.meta.url.href}}),e.methods={setSource:i+"setSource",source:i+"source",location:i+"location",function:i+"function",string:i+"string",eval:i+"eval",parent:i+"parent",top:i+"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,i+"protocol",i+"storageObj",i+"url",i+"modifiedStyle",i+"config",i+"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=n}),a.document.on("setCookie",t=>{e.cookie.db().then(l=>{e.cookie.setCookies(t.data.value,l,e.meta),e.cookie.getCookies(l).then(s=>{n=e.cookie.serialize(s,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)&&(n.length&&(n+="; "),n+=`${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,l=e.call;t.that&&(l=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(b?l(t.target,[t.data.message,t.data.transfer],t.that):l(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 h&&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,m,d,n,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([L,O,T,E],"href",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[l])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-href",l),t.call(r,e.rewriteUrl(l))}}),a.element.hookProperty([S,M,j,h,P,H,$,u,x,W],"src",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[l])=>{if(new String(l).toString().trim().startsWith("blob:")&&r instanceof h)return a.element.setAttribute.call(r,e.attributePrefix+"-attr-src",l),t.call(r,e.blobUrls.get(l)||l);a.element.setAttribute.call(r,e.attributePrefix+"-attr-src",l),t.call(r,e.rewriteUrl(l))}}),a.element.hookProperty([C],"action",{get:(t,r)=>e.sourceUrl(t.call(r)),set:(t,r,[l])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-action",l),t.call(r,e.rewriteUrl(l))}}),a.element.hookProperty([P],"srcset",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-srcset")||t.call(r),set:(t,r,[l])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-srcset",l),t.call(r,e.html.wrapSrcset(l.toString()))}}),a.element.hookProperty(S,"integrity",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-integrity"),set:(t,r,[l])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-integrity",l)}}),a.element.hookProperty(u,"sandbox",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-sandbox")||t.call(r),set:(t,r,[l])=>{a.element.setAttribute.call(r,e.attributePrefix+"-attr-sandbox",l)}});let A=u&&Object.getOwnPropertyDescriptor(u.prototype,"contentWindow").get;function U(t){let r=A.call(t);if(!r.__uv)try{p(r)}catch(l){console.error("catastrophic failure"),console.error(l)}}if(a.element.hookProperty(u,"contentWindow",{get:(t,r)=>(U(r),t.call(r))}),a.element.hookProperty(u,"contentDocument",{get:(t,r)=>(U(r),t.call(r))}),a.element.hookProperty(u,"srcdoc",{get:(t,r)=>a.element.getAttribute.call(r,e.attributePrefix+"-attr-srcdoc")||t.call(r),set:(t,r,[l])=>{t.call(r,e.rewriteHtml(l,{document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,m,d,n,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,m,d,n,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 l="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(l,r),t.respondWith(l)}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=i+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=i+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=i+e.meta.url.origin+"@"+t.data.name}),a.storage.on("getItem",t=>{t.data.name=i+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=i+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=i+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,i+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)}),a.websocket.on("websocket",async t=>{let r=Object.create(null);r.Origin=e.meta.url.origin,r["User-Agent"]=navigator.userAgent,n!==""&&(r.Cookie=n.toString()),t.respondWith(y.createWebSocket(t.data.args[0],t.data.args[1],t.target,r))}),a.websocket.on("readyState",t=>{"__uv$getReadyState"in t.that&&(t.data.value=t.that.__uv$getReadyState())}),a.websocket.on("send",t=>{if("__uv$getSendError"in t.that){let r=t.that.__uv$getSendError();if(r)throw r}}),a.websocket.on("url",t=>{"__uv$socketUrl"in t.that&&(t.data.value=t.that.__uv$socketUrl.toString())}),a.websocket.on("protocol",t=>{"__uv$getProtocol"in t.that&&(t.data.value=t.that.__uv$getProtocol())}),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,l)=>e.sourceCSS(r.call(l),{context:"value",...e.meta}),set:(r,l,s)=>{r.call(l,e.rewriteCSS(s,{context:"value",...e.meta}))}});else"HTMLElement"in o&&a.overrideDescriptor(o.HTMLElement.prototype,"style",{get:(t,r)=>{let l=t.call(r);if(!l[i+"modifiedStyle"])for(let s of a.style.urlProps)a.nativeMethods.defineProperty(l,s,{enumerable:!0,configurable:!0,get(){let g=a.style.getPropertyValue.call(this,s)||"";return e.sourceCSS(g,{context:"value",...e.meta})},set(g){a.style.setProperty.call(this,a.style.propToDashed[s]||s,e.rewriteCSS(g,{context:"value",...e.meta}))}}),a.nativeMethods.defineProperty(l,i+"modifiedStyle",{enumerable:!1,value:!0});return l}});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,l)=>{if(l.HashChangeEvent&&a.history.replaceState){a.history.replaceState.call(o.history,"","",e.rewriteUrl(r));let s=new l.HashChangeEvent("hashchange",{newURL:r,oldURL:t});a.nativeMethods.defineProperty(s,i+"dispatched",{value:!0,enumerable:!1}),e.dispatchEvent.call(o,s)}}),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.websocket.overrideWebSocket(),a.websocket.overrideProtocol(),a.websocket.overrideURL(),a.websocket.overrideReadyState(),a.websocket.overrideProtocol(),a.websocket.overrideSend(),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,l)=>{if(!l.length)return t.apply(r,l);let[s]=l;return s=e.rewriteUrl(s),t.call(r,s)}),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,l)=>{if(!l.length||typeof l[0]!="string")return t.apply(r,l);let[s]=l;return s=e.rewriteJS(s),t.call(r,s)}),e.call=function(t,r,l){return l?t.apply(l,r):t(...r)},e.call$=function(t,r,l=[]){return t[r].apply(t,l)},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 @@ | ||
(()=>{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})}})(); | ||
(()=>{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"],S=["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,S.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}),s=new y(r,u),h=new f(s,null,null);if(this.emit("beforemod",h),h.intercepted)return h.returnValue;for(let n of w)s.headers[n]&&delete s.headers[n];if(s.headers.location&&(s.headers.location=e.rewriteUrl(s.headers.location)),t.destination==="document"){let n=s.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);s.headers["content-disposition"]=`${p}; filename=${JSON.stringify(v)}`}}if(s.headers["set-cookie"]&&(Promise.resolve(e.cookie.setCookies(s.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 s.headers["set-cookie"]),s.body)switch(t.destination){case"script":case"worker":{let n=[e.bundleScript,e.clientScript,e.configScript,e.handlerScript].map(p=>JSON.stringify(p)).join(",");s.body=`if (!self.__uv && self.importScripts) { ${e.createJsInject(this.address,this.bareClient.manifest,e.cookie.serialize(l,e.meta,!0),t.referrer)} importScripts(${n}); } | ||
`,s.body+=e.js.rewrite(await u.text())}break;case"style":s.body=e.rewriteCSS(await u.text());break;case"iframe":case"document":x(e.meta.url,s.headers["content-type"]||"")&&(s.body=e.rewriteHtml(await u.text(),{document:!0,injectHead:e.createHtmlInject(e.handlerScript,e.bundleScript,e.clientScript,e.configScript,this.address,this.bareClient.manifest,e.cookie.serialize(l,e.meta,!0),t.referrer)}))}return r.headers.accept==="text/event-stream"&&(s.headers["content-type"]="text/event-stream"),crossOriginIsolated&&(s.headers["Cross-Origin-Embedder-Policy"]="require-corp"),this.emit("response",h),h.intercepted?h.returnValue:new Response(s.body,{headers:s.headers,status:s.status,statusText:s.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 x(o,t=""){return(m.mime.contentType(t||o.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(o,t){let i=new URL(o),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.1.0")};`;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(o,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(o)};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.1.0")};`;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(o){return o instanceof Error&&typeof o.body=="object"}function U(o,t,i){let e,a,r,l="",c,d={"content-type":"text/html"};return crossOriginIsolated&&(d["Cross-Origin-Embedder-Policy"]="require-corp"),O(o)?(e=o.status,a="Error communicating with the Bare server",c=o.body.message,r=o.body.code,l=o.body.id):(e=500,a="Error processing your request",c="Internal Server Error",r=o instanceof Error?o.name:"UNKNOWN"),new Response(E(a,r,l,c,String(o),t,i),{status:e,headers:d})}})(); | ||
//# sourceMappingURL=uv.sw.js.map |
{ | ||
"name": "@titaniumnetwork-dev/ultraviolet", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers and more!", | ||
@@ -19,32 +19,23 @@ "main": "lib/index.cjs", | ||
"scripts": { | ||
"build": "rimraf dist/ && node build.js", | ||
"dev": "rimraf dist/ && node build.js --dev", | ||
"build": "node build.js", | ||
"dev": "node build.js --dev", | ||
"prepack": "npm run build", | ||
"publish": "npm run build && npm publish --access public", | ||
"pack": "npm run build && npm pack" | ||
}, | ||
"dependencies": { | ||
"@mercuryworkshop/bare-mux": "^1.0.7", | ||
"crypto-js": "^4.2.0", | ||
"css-tree": "^2.0.4", | ||
"esbuild": "^0.19.11", | ||
"esotope-hammerhead": "^0.6.1", | ||
"devDependencies": { | ||
"@mercuryworkshop/bare-mux": "^1.0.9", | ||
"css-tree": "^2.3.1", | ||
"esbuild": "^0.18.11", | ||
"eslint": "^8.28.0", | ||
"esotope-hammerhead": "^0.6.4", | ||
"events": "^3.3.0", | ||
"idb": "^7.1.1", | ||
"meriyah": "^4.3.3", | ||
"mime-db": "^1.51.0", | ||
"meriyah": "^4.3.7", | ||
"mime-db": "^1.52.0", | ||
"parse5": "^7.1.2", | ||
"rimraf": "^5.0.5", | ||
"set-cookie-parser": "^2.4.8" | ||
}, | ||
"devDependencies": { | ||
"copy-webpack-plugin": "^11.0.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.28.0", | ||
"eslint-webpack-plugin": "^3.2.0", | ||
"prettier": "^2.8.0", | ||
"source-map-loader": "^4.0.1", | ||
"terser-webpack-plugin": "^5.3.6", | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^5.0.0" | ||
"rimraf": "^5.0.1", | ||
"set-cookie-parser": "^2.6.0" | ||
} | ||
} |
@@ -61,2 +61,2 @@ <p align="center"><img src="https://raw.githubusercontent.com/titaniumnetwork-dev/Ultraviolet-Static/main/public/uv.png" height="250"></p> | ||
Documentation can be found in the [wiki](https://github.com/titaniumnetwork-dev/Ultraviolet/wiki). | ||
Documentation can be found in the [wiki](https://github.com/titaniumnetwork-dev/Ultraviolet/wiki). |
@@ -91,2 +91,2 @@ const Ultraviolet: typeof import('./src/rewrite/index').default; | ||
decodeUrl?: UVDecode; | ||
} | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Obfuscated code
Supply chain riskObfuscated files are intentionally packed to hide their behavior. This could be a sign of malware.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
0
0
0
3267706
13
3109
61
- Removed@mercuryworkshop/bare-mux@^1.0.7
- Removedcrypto-js@^4.2.0
- Removedcss-tree@^2.0.4
- Removedesbuild@^0.19.11
- Removedesotope-hammerhead@^0.6.1
- Removedevents@^3.3.0
- Removedidb@^7.1.1
- Removedmeriyah@^4.3.3
- Removedmime-db@^1.51.0
- Removedparse5@^7.1.2
- Removedrimraf@^5.0.5
- Removedset-cookie-parser@^2.4.8
- Removed@esbuild/aix-ppc64@0.19.12(transitive)
- Removed@esbuild/android-arm@0.19.12(transitive)
- Removed@esbuild/android-arm64@0.19.12(transitive)
- Removed@esbuild/android-x64@0.19.12(transitive)
- Removed@esbuild/darwin-arm64@0.19.12(transitive)
- Removed@esbuild/darwin-x64@0.19.12(transitive)
- Removed@esbuild/freebsd-arm64@0.19.12(transitive)
- Removed@esbuild/freebsd-x64@0.19.12(transitive)
- Removed@esbuild/linux-arm@0.19.12(transitive)
- Removed@esbuild/linux-arm64@0.19.12(transitive)
- Removed@esbuild/linux-ia32@0.19.12(transitive)
- Removed@esbuild/linux-loong64@0.19.12(transitive)
- Removed@esbuild/linux-mips64el@0.19.12(transitive)
- Removed@esbuild/linux-ppc64@0.19.12(transitive)
- Removed@esbuild/linux-riscv64@0.19.12(transitive)
- Removed@esbuild/linux-s390x@0.19.12(transitive)
- Removed@esbuild/linux-x64@0.19.12(transitive)
- Removed@esbuild/netbsd-x64@0.19.12(transitive)
- Removed@esbuild/openbsd-x64@0.19.12(transitive)
- Removed@esbuild/sunos-x64@0.19.12(transitive)
- Removed@esbuild/win32-arm64@0.19.12(transitive)
- Removed@esbuild/win32-ia32@0.19.12(transitive)
- Removed@esbuild/win32-x64@0.19.12(transitive)
- Removed@isaacs/cliui@8.0.2(transitive)
- Removed@mercuryworkshop/bare-mux@1.1.4(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removed@types/estree@0.0.46(transitive)
- Removed@types/uuid@9.0.8(transitive)
- Removedansi-regex@5.0.16.1.0(transitive)
- Removedansi-styles@4.3.06.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedcrypto-js@4.2.0(transitive)
- Removedcss-tree@2.3.1(transitive)
- Removedeastasianwidth@0.2.0(transitive)
- Removedemoji-regex@8.0.09.2.2(transitive)
- Removedentities@4.5.0(transitive)
- Removedesbuild@0.19.12(transitive)
- Removedesotope-hammerhead@0.6.8(transitive)
- Removedevents@3.3.0(transitive)
- Removedforeground-child@3.3.0(transitive)
- Removedglob@10.4.5(transitive)
- Removedidb@7.1.1(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjackspeak@3.4.3(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedmdn-data@2.0.30(transitive)
- Removedmeriyah@4.5.0(transitive)
- Removedmime-db@1.53.0(transitive)
- Removedminimatch@9.0.5(transitive)
- Removedminipass@7.1.2(transitive)
- Removedpackage-json-from-dist@1.0.1(transitive)
- Removedparse5@7.2.1(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
- Removedrimraf@5.0.10(transitive)
- Removedset-cookie-parser@2.7.1(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedsignal-exit@4.1.0(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedstring-width@4.2.35.1.2(transitive)
- Removedstrip-ansi@6.0.17.1.0(transitive)
- Removeduuid@9.0.1(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwrap-ansi@7.0.08.1.0(transitive)