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

ses

Package Overview
Dependencies
Maintainers
3
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ses - npm Package Compare versions

Comparing version 0.10.3 to 0.10.4

2

dist/lockdown.umd.min.js

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

!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";const{assign:t,create:e,defineProperties:r,entries:o,freeze:n,getOwnPropertyDescriptor:a,getOwnPropertyDescriptors:i,getOwnPropertyNames:c,getPrototypeOf:s,keys:p,prototype:l,setPrototypeOf:u,values:y}=Object,f=(t,e,o)=>r(t,{[e]:o}),{apply:g,construct:m,get:d,set:P}=Reflect,{isArray:b,prototype:h}=Array,{revocable:S}=Proxy,{prototype:w}=RegExp,{prototype:E}=String,{prototype:I}=WeakMap,T=t=>(e,...r)=>g(t,e,r),A=T(l.hasOwnProperty),v=(T(h.filter),T(h.join)),F=(T(h.push),T(h.pop)),x=T(h.includes),U=T(w.test),k=(T(E.match),T(E.search)),_=T(E.slice),R=T(E.split),O=(T(I.get),T(I.set),T(I.has),n({__proto__:null}));function C(){const t=new WeakSet,e=Function.prototype.toString,r={toString(){const r=g(e,this,[]);return r.endsWith(") { [native code] }")||!t.has(this)?r:`function ${this.name}() { [native code] }`}};return f(Function.prototype,"toString",{value:r.toString}),e=>t.add(e)}const M={Infinity:1/0,NaN:NaN,undefined:void 0},N={isFinite:"isFinite",isNaN:"isNaN",parseFloat:"parseFloat",parseInt:"parseInt",decodeURI:"decodeURI",decodeURIComponent:"decodeURIComponent",encodeURI:"encodeURI",encodeURIComponent:"encodeURIComponent",Array:"Array",ArrayBuffer:"ArrayBuffer",BigInt:"BigInt",BigInt64Array:"BigInt64Array",BigUint64Array:"BigUint64Array",Boolean:"Boolean",DataView:"DataView",EvalError:"EvalError",Float32Array:"Float32Array",Float64Array:"Float64Array",Int8Array:"Int8Array",Int16Array:"Int16Array",Int32Array:"Int32Array",Map:"Map",Number:"Number",Object:"Object",Promise:"Promise",Proxy:"Proxy",RangeError:"RangeError",ReferenceError:"ReferenceError",Set:"Set",String:"String",Symbol:"Symbol",SyntaxError:"SyntaxError",TypeError:"TypeError",Uint8Array:"Uint8Array",Uint8ClampedArray:"Uint8ClampedArray",Uint16Array:"Uint16Array",Uint32Array:"Uint32Array",URIError:"URIError",WeakMap:"WeakMap",WeakSet:"WeakSet",JSON:"JSON",Reflect:"Reflect",escape:"escape",unescape:"unescape",lockdown:"lockdown",harden:"harden",HandledPromise:"HandledPromise",StaticModuleRecord:"StaticModuleRecord"},$={Date:"%InitialDate%",Error:"%InitialError%",RegExp:"%InitialRegExp%",Math:"%InitialMath%",getStackString:"%InitialGetStackString%"},G={Date:"%SharedDate%",Error:"%SharedError%",RegExp:"%SharedRegExp%",Math:"%SharedMath%"},j=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError],B={"[[Proto]]":"%FunctionPrototype%",length:"number",name:"string"},D=B,L={get:D,set:"undefined"},W={get:D,set:D};function z(t){return t===L||t===W}function V(t){return{"[[Proto]]":"%SharedError%",prototype:t}}function Y(t){return{"[[Proto]]":"%ErrorPrototype%",constructor:t,message:"string",name:"string",toString:!1}}function H(t){return{"[[Proto]]":"%TypedArray%",BYTES_PER_ELEMENT:"number",prototype:t}}function J(t){return{"[[Proto]]":"%TypedArrayPrototype%",BYTES_PER_ELEMENT:"number",constructor:t}}const K={E:"number",LN10:"number",LN2:"number",LOG10E:"number",LOG2E:"number",PI:"number",SQRT1_2:"number",SQRT2:"number","@@toStringTag":"string",abs:D,acos:D,acosh:D,asin:D,asinh:D,atan:D,atanh:D,atan2:D,cbrt:D,ceil:D,clz32:D,cos:D,cosh:D,exp:D,expm1:D,floor:D,fround:D,hypot:D,imul:D,log:D,log1p:D,log10:D,log2:D,max:D,min:D,pow:D,round:D,sign:D,sin:D,sinh:D,sqrt:D,tan:D,tanh:D,trunc:D},q={"[[Proto]]":null,"%ThrowTypeError%":D,Infinity:"number",NaN:"number",undefined:"undefined","%UniqueEval%":D,isFinite:D,isNaN:D,parseFloat:D,parseInt:D,decodeURI:D,decodeURIComponent:D,encodeURI:D,encodeURIComponent:D,Object:{"[[Proto]]":"%FunctionPrototype%",assign:D,create:D,defineProperties:D,defineProperty:D,entries:D,freeze:D,fromEntries:D,getOwnPropertyDescriptor:D,getOwnPropertyDescriptors:D,getOwnPropertyNames:D,getOwnPropertySymbols:D,getPrototypeOf:D,is:D,isExtensible:D,isFrozen:D,isSealed:D,keys:D,preventExtensions:D,prototype:"%ObjectPrototype%",seal:D,setPrototypeOf:D,values:D},"%ObjectPrototype%":{"[[Proto]]":null,constructor:"Object",hasOwnProperty:D,isPrototypeOf:D,propertyIsEnumerable:D,toLocaleString:D,toString:D,valueOf:D,"--proto--":W,__defineGetter__:D,__defineSetter__:D,__lookupGetter__:D,__lookupSetter__:D},"%UniqueFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%InertFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%FunctionPrototype%":{apply:D,bind:D,call:D,constructor:"%InertFunction%",toString:D,"@@hasInstance":D,caller:!1,arguments:!1},Boolean:{"[[Proto]]":"%FunctionPrototype%",prototype:"%BooleanPrototype%"},"%BooleanPrototype%":{constructor:"Boolean",toString:D,valueOf:D},Symbol:{"[[Proto]]":"%FunctionPrototype%",asyncIterator:"symbol",for:D,hasInstance:"symbol",isConcatSpreadable:"symbol",iterator:"symbol",keyFor:D,match:"symbol",matchAll:"symbol",prototype:"%SymbolPrototype%",replace:"symbol",search:"symbol",species:"symbol",split:"symbol",toPrimitive:"symbol",toStringTag:"symbol",unscopables:"symbol"},"%SymbolPrototype%":{constructor:"Symbol",description:L,toString:D,valueOf:D,"@@toPrimitive":D,"@@toStringTag":"string"},"%InitialError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:D,stackTraceLimit:W,prepareStackTrace:W},"%SharedError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:D,stackTraceLimit:W,prepareStackTrace:W},"%ErrorPrototype%":{constructor:"%SharedError%",message:"string",name:"string",toString:D},EvalError:V("%EvalErrorPrototype%"),RangeError:V("%RangeErrorPrototype%"),ReferenceError:V("%ReferenceErrorPrototype%"),SyntaxError:V("%SyntaxErrorPrototype%"),TypeError:V("%TypeErrorPrototype%"),URIError:V("%URIErrorPrototype%"),"%EvalErrorPrototype%":Y("EvalError"),"%RangeErrorPrototype%":Y("RangeError"),"%ReferenceErrorPrototype%":Y("ReferenceError"),"%SyntaxErrorPrototype%":Y("SyntaxError"),"%TypeErrorPrototype%":Y("TypeError"),"%URIErrorPrototype%":Y("URIError"),Number:{"[[Proto]]":"%FunctionPrototype%",EPSILON:"number",isFinite:D,isInteger:D,isNaN:D,isSafeInteger:D,MAX_SAFE_INTEGER:"number",MAX_VALUE:"number",MIN_SAFE_INTEGER:"number",MIN_VALUE:"number",NaN:"number",NEGATIVE_INFINITY:"number",parseFloat:D,parseInt:D,POSITIVE_INFINITY:"number",prototype:"%NumberPrototype%"},"%NumberPrototype%":{constructor:"Number",toExponential:D,toFixed:D,toLocaleString:D,toPrecision:D,toString:D,valueOf:D},BigInt:{"[[Proto]]":"%FunctionPrototype%",asIntN:D,asUintN:D,prototype:"%BigIntPrototype%"},"%BigIntPrototype%":{constructor:"BigInt",toLocaleString:D,toString:D,valueOf:D,"@@toStringTag":"string"},"%InitialMath%":{...K,random:D},"%SharedMath%":K,"%InitialDate%":{"[[Proto]]":"%FunctionPrototype%",now:D,parse:D,prototype:"%DatePrototype%",UTC:D},"%SharedDate%":{"[[Proto]]":"%FunctionPrototype%",now:D,parse:D,prototype:"%DatePrototype%",UTC:D},"%DatePrototype%":{constructor:"%SharedDate%",getDate:D,getDay:D,getFullYear:D,getHours:D,getMilliseconds:D,getMinutes:D,getMonth:D,getSeconds:D,getTime:D,getTimezoneOffset:D,getUTCDate:D,getUTCDay:D,getUTCFullYear:D,getUTCHours:D,getUTCMilliseconds:D,getUTCMinutes:D,getUTCMonth:D,getUTCSeconds:D,setDate:D,setFullYear:D,setHours:D,setMilliseconds:D,setMinutes:D,setMonth:D,setSeconds:D,setTime:D,setUTCDate:D,setUTCFullYear:D,setUTCHours:D,setUTCMilliseconds:D,setUTCMinutes:D,setUTCMonth:D,setUTCSeconds:D,toDateString:D,toISOString:D,toJSON:D,toLocaleDateString:D,toLocaleString:D,toLocaleTimeString:D,toString:D,toTimeString:D,toUTCString:D,valueOf:D,"@@toPrimitive":D,getYear:D,setYear:D,toGMTString:D},String:{"[[Proto]]":"%FunctionPrototype%",fromCharCode:D,fromCodePoint:D,prototype:"%StringPrototype%",raw:D},"%StringPrototype%":{length:"number",charAt:D,charCodeAt:D,codePointAt:D,concat:D,constructor:"String",endsWith:D,includes:D,indexOf:D,lastIndexOf:D,localeCompare:D,match:D,matchAll:D,normalize:D,padEnd:D,padStart:D,repeat:D,replace:D,search:D,slice:D,split:D,startsWith:D,substring:D,toLocaleLowerCase:D,toLocaleUpperCase:D,toLowerCase:D,toString:D,toUpperCase:D,trim:D,trimEnd:D,trimStart:D,valueOf:D,"@@iterator":D,substr:D,anchor:D,big:D,blink:D,bold:D,fixed:D,fontcolor:D,fontsize:D,italics:D,link:D,small:D,strike:D,sub:D,sup:D,trimLeft:D,trimRight:D},"%StringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},"%InitialRegExp%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%RegExpPrototype%","@@species":L,input:!1,$_:!1,lastMatch:!1,"$&":!1,lastParen:!1,"$+":!1,leftContext:!1,"$`":!1,rightContext:!1,"$'":!1,$1:!1,$2:!1,$3:!1,$4:!1,$5:!1,$6:!1,$7:!1,$8:!1,$9:!1},"%SharedRegExp%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%RegExpPrototype%","@@species":L},"%RegExpPrototype%":{constructor:"%SharedRegExp%",exec:D,dotAll:L,flags:L,global:L,ignoreCase:L,"@@match":D,"@@matchAll":D,multiline:L,"@@replace":D,"@@search":D,source:L,"@@split":D,sticky:L,test:D,toString:D,unicode:L,compile:!1},"%RegExpStringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},Array:{"[[Proto]]":"%FunctionPrototype%",from:D,isArray:D,of:D,prototype:"%ArrayPrototype%","@@species":L},"%ArrayPrototype%":{length:"number",concat:D,constructor:"Array",copyWithin:D,entries:D,every:D,fill:D,filter:D,find:D,findIndex:D,flat:D,flatMap:D,forEach:D,includes:D,indexOf:D,join:D,keys:D,lastIndexOf:D,map:D,pop:D,push:D,reduce:D,reduceRight:D,reverse:D,shift:D,slice:D,some:D,sort:D,splice:D,toLocaleString:D,toString:D,unshift:D,values:D,"@@iterator":D,"@@unscopables":{"[[Proto]]":null,copyWithin:"boolean",entries:"boolean",fill:"boolean",find:"boolean",findIndex:"boolean",flat:"boolean",flatMap:"boolean",includes:"boolean",keys:"boolean",values:"boolean"}},"%ArrayIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},"%TypedArray%":{"[[Proto]]":"%FunctionPrototype%",from:D,of:D,prototype:"%TypedArrayPrototype%","@@species":L},"%TypedArrayPrototype%":{buffer:L,byteLength:L,byteOffset:L,constructor:"%TypedArray%",copyWithin:D,entries:D,every:D,fill:D,filter:D,find:D,findIndex:D,forEach:D,includes:D,indexOf:D,join:D,keys:D,lastIndexOf:D,length:L,map:D,reduce:D,reduceRight:D,reverse:D,set:D,slice:D,some:D,sort:D,subarray:D,toLocaleString:D,toString:D,values:D,"@@iterator":D,"@@toStringTag":L},BigInt64Array:H("%BigInt64ArrayPrototype%"),BigUint64Array:H("%BigUint64ArrayPrototype%"),Float32Array:H("%Float32ArrayPrototype%"),Float64Array:H("%Float64ArrayPrototype%"),Int16Array:H("%Int16ArrayPrototype%"),Int32Array:H("%Int32ArrayPrototype%"),Int8Array:H("%Int8ArrayPrototype%"),Uint16Array:H("%Uint16ArrayPrototype%"),Uint32Array:H("%Uint32ArrayPrototype%"),Uint8Array:H("%Uint8ArrayPrototype%"),Uint8ClampedArray:H("%Uint8ClampedArrayPrototype%"),"%BigInt64ArrayPrototype%":J("BigInt64Array"),"%BigUint64ArrayPrototype%":J("BigUint64Array"),"%Float32ArrayPrototype%":J("Float32Array"),"%Float64ArrayPrototype%":J("Float64Array"),"%Int16ArrayPrototype%":J("Int16Array"),"%Int32ArrayPrototype%":J("Int32Array"),"%Int8ArrayPrototype%":J("Int8Array"),"%Uint16ArrayPrototype%":J("Uint16Array"),"%Uint32ArrayPrototype%":J("Uint32Array"),"%Uint8ArrayPrototype%":J("Uint8Array"),"%Uint8ClampedArrayPrototype%":J("Uint8ClampedArray"),Map:{"[[Proto]]":"%FunctionPrototype%","@@species":L,prototype:"%MapPrototype%"},"%MapPrototype%":{clear:D,constructor:"Map",delete:D,entries:D,forEach:D,get:D,has:D,keys:D,set:D,size:L,values:D,"@@iterator":D,"@@toStringTag":"string"},"%MapIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},Set:{"[[Proto]]":"%FunctionPrototype%",prototype:"%SetPrototype%","@@species":L},"%SetPrototype%":{add:D,clear:D,constructor:"Set",delete:D,entries:D,forEach:D,has:D,keys:D,size:L,values:D,"@@iterator":D,"@@toStringTag":"string"},"%SetIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},WeakMap:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakMapPrototype%"},"%WeakMapPrototype%":{constructor:"WeakMap",delete:D,get:D,has:D,set:D,"@@toStringTag":"string"},WeakSet:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakSetPrototype%"},"%WeakSetPrototype%":{add:D,constructor:"WeakSet",delete:D,has:D,"@@toStringTag":"string"},ArrayBuffer:{"[[Proto]]":"%FunctionPrototype%",isView:D,prototype:"%ArrayBufferPrototype%","@@species":L},"%ArrayBufferPrototype%":{byteLength:L,constructor:"ArrayBuffer",slice:D,"@@toStringTag":"string"},SharedArrayBuffer:!1,"%SharedArrayBufferPrototype%":!1,DataView:{"[[Proto]]":"%FunctionPrototype%",prototype:"%DataViewPrototype%"},"%DataViewPrototype%":{buffer:L,byteLength:L,byteOffset:L,constructor:"DataView",getBigInt64:D,getBigUint64:D,getFloat32:D,getFloat64:D,getInt8:D,getInt16:D,getInt32:D,getUint8:D,getUint16:D,getUint32:D,setBigInt64:D,setBigUint64:D,setFloat32:D,setFloat64:D,setInt8:D,setInt16:D,setInt32:D,setUint8:D,setUint16:D,setUint32:D,"@@toStringTag":"string"},Atomics:!1,JSON:{parse:D,stringify:D,"@@toStringTag":"string"},"%IteratorPrototype%":{"@@iterator":D},"%AsyncIteratorPrototype%":{"@@asyncIterator":D},"%InertGeneratorFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%Generator%"},"%Generator%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertGeneratorFunction%",prototype:"%GeneratorPrototype%","@@toStringTag":"string"},"%InertAsyncGeneratorFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%AsyncGenerator%"},"%AsyncGenerator%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertAsyncGeneratorFunction%",prototype:"%AsyncGeneratorPrototype%","@@toStringTag":"string"},"%GeneratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",constructor:"%Generator%",next:D,return:D,throw:D,"@@toStringTag":"string"},"%AsyncGeneratorPrototype%":{"[[Proto]]":"%AsyncIteratorPrototype%",constructor:"%AsyncGenerator%",next:D,return:D,throw:D,"@@toStringTag":"string"},HandledPromise:{"[[Proto]]":"Promise",applyFunction:D,applyFunctionSendOnly:D,applyMethod:D,applyMethodSendOnly:D,get:D,getSendOnly:D,prototype:"%PromisePrototype%",resolve:D},Promise:{"[[Proto]]":"%FunctionPrototype%",all:D,allSettled:D,prototype:"%PromisePrototype%",race:D,reject:D,resolve:D,"@@species":L},"%PromisePrototype%":{catch:D,constructor:"Promise",finally:D,then:D,"@@toStringTag":"string"},"%InertAsyncFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%AsyncFunctionPrototype%"},"%AsyncFunctionPrototype%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertAsyncFunction%","@@toStringTag":"string"},Reflect:{apply:D,construct:D,defineProperty:D,deleteProperty:D,get:D,getOwnPropertyDescriptor:D,getPrototypeOf:D,has:D,isExtensible:D,ownKeys:D,preventExtensions:D,set:D,setPrototypeOf:D},Proxy:{"[[Proto]]":"%FunctionPrototype%",revocable:D},escape:D,unescape:D,"%UniqueCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:D},"%InertCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:D},"%CompartmentPrototype%":{constructor:"%InertCompartment%",evaluate:D,globalThis:L,name:L,toString:D},lockdown:D,harden:D,"%InitialGetStackString%":D};function Q(t,e,r){if(A(t,e)){const o=a(t,e);if(!Object.is(o.value,r.value)||o.get!==r.get||o.set!==r.set||o.writable!==r.writable||o.enumerable!==r.enumerable||o.configurable!==r.configurable)throw new Error("Conflicting definitions of "+e)}f(t,e,r)}function X(t,e){const r={__proto__:null};for(const[n,a]of o(e))A(t,n)&&(r[a]=t[n]);return r}function Z(){const t={__proto__:null};let e;const r={addIntrinsics(e){!function(t,e){for(const[r,n]of o(e))Q(t,r,n)}(t,i(e))},completePrototypes(){for(const[e,r]of o(t)){if(r!==Object(r))continue;if(!A(r,"prototype"))continue;const o=q[e];if("object"!=typeof o)throw new Error("Expected permit object at whitelist."+e);const n=o.prototype;if(!n)throw new Error(e+".prototype property not whitelisted");if("string"!=typeof n||!A(q,n))throw new Error(`Unrecognized ${e}.prototype whitelist entry`);const a=r.prototype;if(A(t,n)){if(t[n]!==a)throw new Error("Conflicting bindings of "+n)}else t[n]=a}},finalIntrinsics:()=>(n(t),e=new WeakSet(y(t).filter(t=>"function"==typeof t)),t),isPseudoNative(t){if(!e)throw new Error("isPseudoNative can only be called after finalIntrinsics");return e.has(t)}};return r.addIntrinsics(M),r.addIntrinsics(X(globalThis,N)),r}const{freeze:tt,getOwnPropertyDescriptors:et,getPrototypeOf:rt}=Object,{ownKeys:ot}=Reflect;function nt(t,e){if(!t)throw new TypeError(e)}const{apply:at,ownKeys:it}=Reflect,ct=(t=>(e,...r)=>at(t,e,r))(Object.prototype.hasOwnProperty);function st(t,e){if("string"==typeof e)return e;if("symbol"==typeof e)return"@@"+e.toString().slice(14,-1);throw new TypeError(`Unexpected property name type ${t} ${e}`)}function pt(t,e){const r=["undefined","boolean","number","string","symbol"];function o(e,o,n,a){if("object"==typeof a)return c(e,o,a),!0;if(!1===a)return!1;if("string"==typeof a)if("prototype"===n||"constructor"===n){if(ct(t,a)){if(o!==t[a])throw new TypeError("Does not match whitelist "+e);return!0}}else if(r.includes(a)){if(typeof o!==a)throw new TypeError(`At ${e} expected ${a} not ${typeof o}`);return!0}throw new TypeError(`Unexpected whitelist permit ${a} at ${e}`)}function n(t,e,r,n){const i=a(e,r);if(ct(i,"value")){if(z(n))throw new TypeError("Accessor expected at "+t);return o(t,i.value,r,n)}if(!z(n))throw new TypeError("Accessor not expected at "+t);return o(t+"<get>",i.get,r,n.get)&&o(t+"<set>",i.set,r,n.set)}function i(t,r,o){const n="__proto__"===o?"--proto--":o;return ct(r,n)?r[n]:"function"==typeof t&&(e(t),ct(B,n))?B[n]:void 0}function c(e,r,o){if(void 0===r)return;!function(e,r,o){if(r!==Object(r))throw new TypeError(`Object expected: ${e}, ${r}, ${o}`);const n=s(r);if(null!==n||null!==o){if(void 0!==o&&"string"!=typeof o)throw new TypeError(`Malformed whitelist permit ${e}.__proto__`);if(n!==t[o||"%ObjectPrototype%"])throw new Error(`Unexpected intrinsic ${e}.__proto__ at ${o}`)}}(e,r,o["[[Proto]]"]);for(const t of it(r)){const a=st(e,t),c=`${e}.${a}`,s=i(r,o,a);s&&n(c,r,t,s)||(!1!==s&&console.log("Removing "+c),delete r[t])}}c("intrinsics",t,q)}const lt=["getTypeName","getFunctionName","getMethodName","getFileName","getLineNumber","getColumnNumber","getEvalOrigin","isToplevel","isEval","isNative","isConstructor","isAsync","getPosition","getScriptNameOrSourceURL","toString"],ut=t=>{const e=Object.fromEntries(lt.map(e=>[e,()=>t[e]()]));return Object.create(e,{})},yt=(t,e)=>[""+t,...e.map(t=>"\n at "+t)].join("");function ft(t,e,o){const n=new WeakMap,a={captureStackTrace(e,r=a.captureStackTrace){"function"!=typeof t.captureStackTrace?Reflect.set(e,"stack",""):t.captureStackTrace(e,r)},getStackString(t){n.has(t)||t.stack;const e=n.get(t);return e?yt(t,e):""},prepareStackTrace:(t,e)=>(n.set(t,e),"unsafe"===o?yt(t,e):"")},i=a.prepareStackTrace;t.prepareStackTrace=i;const c=new WeakSet([i]),s=t=>{if(c.has(t))return t;const e={prepareStackTrace:(e,r)=>(n.set(e,r),t(e,(t=>t.map(ut))(r)))};return c.add(e.prepareStackTrace),e.prepareStackTrace};return r(e,{captureStackTrace:{value:a.captureStackTrace,writable:!0,enumerable:!1,configurable:!0},stackTraceLimit:{get(){if("number"==typeof t.stackTraceLimit)return t.stackTraceLimit},set(e){"number"!=typeof t.stackTraceLimit||(t.stackTraceLimit=e)},enumerable:!1,configurable:!0},prepareStackTrace:{get:()=>t.prepareStackTrace,set(e){if("function"==typeof e){const r=s(e);t.prepareStackTrace=r}else t.prepareStackTrace=i},enumerable:!1,configurable:!0}}),a.getStackString}const gt={getStackString:t=>""};var mt={"%ObjectPrototype%":"*","%ArrayPrototype%":"*","%FunctionPrototype%":{constructor:!0,bind:!0,apply:!0,name:!0,toString:!0},"%ErrorPrototype%":{constructor:!0,message:!0,name:!0,toString:!0},"%TypeErrorPrototype%":{constructor:!0,message:!0,name:!0},"%SyntaxErrorPrototype%":{message:!0},"%RangeErrorPrototype%":{message:!0},"%URIErrorPrototype%":{message:!0},"%EvalErrorPrototype%":{message:!0},"%ReferenceErrorPrototype%":{message:!0},"%PromisePrototype%":{constructor:!0},"%TypedArrayPrototype%":"*","%Generator%":{constructor:!0,name:!0,toString:!0},"%IteratorPrototype%":"*"};const{ownKeys:dt}=Reflect;function Pt(t){return null!==t&&"object"==typeof t}const bt=/^(\w*[a-z])Locale([A-Z]\w*)$/,ht={localeCompare(t){if(null==this)throw new TypeError('Cannot localeCompare with null or undefined "this" value');const e=""+this;return e<(t=""+t)?-1:e>t?1:(nt(e===t,`expected ${e} and ${t} to compare`),0)}}.localeCompare;const St=function(t={},e={},r={}){throw new TypeError("Not available")},wt=function(t,e){throw new TypeError("Not available")};function Et(t){return s(t).constructor}function It(t,e){const r="please report internal shim error: "+t;throw console.error(r),e&&(console.error(""+e),console.error(""+e.stack)),TypeError(r)}function Tt(t,e){t||It(e)}const At=["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","let","static","enum","implements","package","protected","interface","private","public","await","null","true","false","this","arguments"],vt=new RegExp("^[a-zA-Z_$][\\w$]*$");function Ft(t){return"eval"!==t&&!x(At,t)&&U(vt,t)}function xt(t,e){const r=a(t,e);return!1===r.configurable&&!1===r.writable&&A(r,"value")}const Ut=eval,kt=new Proxy(O,{get(t,e){It("unexpected scope handler trap called: "+String(e))}});function _t(t,e){const r=k(t,e);return r<0?-1:R(_(t,0,r),"\n").length}const Rt=new RegExp("(?:\x3c!--|--\x3e)");const Ot=new RegExp("\\bimport\\s*(?:\\(|/[/*])");const Ct=new RegExp("\\beval\\s*(?:\\(|/[/*])");function Mt(t){return t=function(t){const e=_t(t,Ct);if(e<0)return t;throw new SyntaxError("possible direct eval expression rejected around line "+e)}(t=function(t){const e=_t(t,Ot);if(e<0)return t;throw new SyntaxError("possible import expression rejected around line "+e)}(t=function(t){const e=_t(t,Rt);if(e<0)return t;throw new SyntaxError("possible html comment syntax rejected around line "+e)}(t)))}const Nt=Function;function $t(t=[]){const e=function(t){return 0===t.length?"":`const {${v(t,",")}} = this;`}(t);return Nt(`\n with (this) {\n ${e}\n return function() {\n 'use strict';\n return eval(arguments[0]);\n };\n }\n `)}function Gt(t,e,r={},{localTransforms:o=[],globalTransforms:n=[],sloppyGlobalsMode:i=!1}={}){t=function(t,e){for(const r of e)t=r(t);return t}(t,[...o,...n,Mt]);const s=function(t,e={},{sloppyGlobalsMode:r=!1}={}){return{__proto__:kt,useUnsafeEvaluator:!1,get(r,o){if("symbol"!=typeof o)return"eval"===o&&!0===this.useUnsafeEvaluator?(this.useUnsafeEvaluator=!1,Ut):o in e?d(e,o,t):d(t,o)},set(r,o,n){if(o in e){return"value"in a(e,o)?P(e,o,n):P(e,o,n,t)}return P(t,o,n)},has:(o,n)=>!!(r||"eval"===n||n in e||n in t||n in globalThis),getPrototypeOf:()=>null,getOwnPropertyDescriptor(t,e){const r=JSON.stringify(String(e));console.warn("getOwnPropertyDescriptor trap on scopeHandler for "+r,(new Error).stack)}}}(e,r,{sloppyGlobalsMode:i}),p=S(O,s),l=$t(function(t,e={}){const r=c(t),o=c(e),n=o.filter(t=>Ft(t)&&xt(e,t));return[...r.filter(e=>!o.includes(e)&&Ft(e)&&xt(t,e)),...n]}(e,r)),u=g(l,p.proxy,[]);let y;s.useUnsafeEvaluator=!0;try{return g(u,e,[t])}catch(t){throw y=t,t}finally{!0===s.useUnsafeEvaluator&&(It("handler did not revoke useUnsafeEvaluator",y),p.revoke())}}const jt=(t,e={})=>r=>"string"!=typeof r?r:Gt(r,t,{},e),Bt=Function;function Dt(t,e={}){const o=function(r){const o=""+(F(arguments)||""),n=""+v(arguments,",");new Bt(n,o);const a=`(function anonymous(${n}\n) {\n${o}\n})`;return Gt(a,t,{},e)};return r(o,{prototype:{value:Function.prototype,writable:!1,enumerable:!1,configurable:!1}}),Tt(s(Function)===Function.prototype,"Function prototype is the same accross compartments"),Tt(s(o)===Function.prototype,"Function constructor prototype is the same accross compartments"),o}function Lt(t,e,r,n,a,{globalTransforms:i,nativeBrander:c}){for(const[e,r]of o(M))f(t,e,{value:r,writable:!1,enumerable:!1,configurable:!1});for(const[r,n]of o(N))A(e,n)&&f(t,r,{value:e[n],writable:!0,enumerable:!1,configurable:!0});for(const[n,a]of o(r))A(e,a)&&f(t,n,{value:e[a],writable:!0,enumerable:!1,configurable:!0});const s={globalThis:t,eval:jt(t,{globalTransforms:i}),Function:Dt(t,{globalTransforms:i})};s.Compartment=n(n,e,c);for(const[e,r]of o(s))f(t,e,{value:r,writable:!0,enumerable:!1,configurable:!0}),"function"==typeof r&&c(r)}let Wt,zt=!1;const Vt=function(){if(arguments.length>=1)throw new TypeError("makeHardener no longer takes any options");const t=new WeakSet,{harden:e}={harden(e){const r=new Set,o=new Map,n=new WeakMap;function a(e,o){if(Object(e)!==e)return;const a=typeof e;if("object"!==a&&"function"!==a)throw new TypeError("Unexpected typeof: "+a);t.has(e)||r.has(e)||(r.add(e),n.set(e,o))}function i(t){tt(t);const e=rt(t),r=et(t),i=n.get(t)||"unknown";null===e||o.has(e)||(o.set(e,i),n.set(e,i+".__proto__")),ot(r).forEach(t=>{const e=`${i}.${String(t)}`,o=r[t];"value"in o?a(o.value,""+e):(a(o.get,e+"(get)"),a(o.set,e+"(set)"))})}return a(e),r.forEach(i),o.forEach((e,o)=>{if(!r.has(o)&&!t.has(o)){let t;try{t=`prototype ${o} of ${e} is not already in the fringeSet`}catch(r){t="a prototype of something is not already in the fringeset (and .toString failed)";try{console.log(t),console.log("the prototype:",o),console.log("of something:",e)}catch(t){}}throw new TypeError(t)}}),r.forEach(t.add,t),e}};return e}(),Yt=()=>!1;function Ht(t,o,n={}){n={...Wt,...n};const{dateTaming:y="safe",errorTaming:d="safe",mathTaming:P="safe",regExpTaming:b="safe",localeTaming:h="safe",...S}=n,w=Reflect.ownKeys(S);if(nt(0===w.length,"lockdown(): non supported option "+w.join(", ")),Wt){for(const t of p(Wt))nt(n[t]===Wt[t],"lockdown(): cannot re-invoke with different option "+t);return Yt}Wt={dateTaming:y,errorTaming:d,mathTaming:P,regExpTaming:b,localeTaming:h};const E=Z();E.addIntrinsics(function(){try{(0,Function.prototype.constructor)("return 1")}catch(t){return{}}const t={};function e(e,o,n){let a;try{a=(0,eval)(n)}catch(t){if(t instanceof SyntaxError)return;throw t}const i=s(a),c=function(){throw new TypeError("Not available")};r(c,{prototype:{value:i},name:{value:e,writable:!1,enumerable:!1,configurable:!0}}),r(i,{constructor:{value:c}}),c!==Function.prototype.constructor&&u(c,Function.prototype.constructor),t[o]=c}return e("Function","%InertFunction%","(function(){})"),e("GeneratorFunction","%InertGeneratorFunction%","(function*(){})"),e("AsyncFunction","%InertAsyncFunction%","(async function(){})"),e("AsyncGeneratorFunction","%InertAsyncGeneratorFunction%","(async function*(){})"),t}()),E.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized dateTaming "+t);const e=Date,o=e.prototype,n={now:()=>NaN},a=({powers:t="none"}={})=>{let n;return n="original"===t?function(...t){return void 0===new.target?Reflect.apply(e,void 0,t):Reflect.construct(e,t,new.target)}:function(...t){return void 0===new.target?"Invalid Date":(0===t.length&&(t=[NaN]),Reflect.construct(e,t,new.target))},r(n,{length:{value:7},prototype:{value:o,writable:!1,enumerable:!1,configurable:!1},parse:{value:Date.parse,writable:!0,enumerable:!1,configurable:!0},UTC:{value:Date.UTC,writable:!0,enumerable:!1,configurable:!0}}),n},i=a({powers:"original"}),c=a({power:"none"});return r(i,{now:{value:Date.now,writable:!0,enumerable:!1,configurable:!0}}),r(c,{now:{value:n.now,writable:!0,enumerable:!1,configurable:!0}}),r(o,{constructor:{value:c}}),{"%InitialDate%":i,"%SharedDate%":c}}(y)),E.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized errorTaming "+t);const e=Error,o=e.prototype,n="function"==typeof e.captureStackTrace?"v8":"unknown",a=(t={})=>{const a=function(...t){let r;return r=void 0===new.target?g(e,this,t):m(e,t,new.target),"v8"===n&&e.captureStackTrace(r,a),r};return r(a,{length:{value:1},prototype:{value:o,writable:!1,enumerable:!1,configurable:!1}}),a},i=a({powers:"original"}),c=a({powers:"none"});r(o,{constructor:{value:c}});for(const t of j)u(t,c);let s=gt.getStackString;return"v8"===n&&(s=ft(e,i,t)),{"%InitialGetStackString%":s,"%InitialError%":i,"%SharedError%":c}}(d)),E.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized mathTaming "+t);const r=Math,o=r,{random:n,...a}=i(r);return{"%InitialMath%":o,"%SharedMath%":e(Object.prototype,a)}}(P)),E.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized regExpTaming "+t);const e=RegExp,o=e.prototype,n=(t={})=>{const n=function(...t){return void 0===new.target?e(...t):Reflect.construct(e,t,new.target)};return r(n,{length:{value:2},prototype:{value:o,writable:!1,enumerable:!1,configurable:!1},[Symbol.species]:a(e,Symbol.species)}),n},i=n(),c=n();return"unsafe"!==t&&delete o.compile,r(o,{constructor:{value:c}}),{"%InitialRegExp%":i,"%SharedRegExp%":c}}(b)),E.addIntrinsics(function(){const t=Function.prototype.constructor,e=typeof Symbol&&Symbol.iterator||"@@iterator",r=typeof Symbol&&Symbol.matchAll||"@@matchAll",o=a(arguments,"callee").get,n=(new String)[e](),i=s(n),c=(new RegExp)[r](),p=s(c),l=(new Array)[e](),u=s(l),y=s(Float32Array),f=(new Map)[e](),g=s(f),m=(new Set)[e](),d=s(m),P=s(u);function*b(){}const h=Et(b),S=h.prototype;async function*w(){}const E=Et(w),I=E.prototype,T=I.prototype,A=s(T);async function v(){}const F=Et(v),x={"%InertFunction%":t,"%ArrayIteratorPrototype%":u,"%InertAsyncFunction%":F,"%AsyncGenerator%":I,"%InertAsyncGeneratorFunction%":E,"%AsyncGeneratorPrototype%":T,"%AsyncIteratorPrototype%":A,"%Generator%":S,"%InertGeneratorFunction%":h,"%IteratorPrototype%":P,"%MapIteratorPrototype%":g,"%RegExpStringIteratorPrototype%":p,"%SetIteratorPrototype%":d,"%StringIteratorPrototype%":i,"%ThrowTypeError%":o,"%TypedArray%":y,"%InertCompartment%":St,"%InertStaticModuleRecord%":wt};return x}()),E.completePrototypes();const I=E.finalIntrinsics();!function(t,e="safe"){if("safe"!==e&&"unsafe"!==e)throw new Error("unrecognized dateTaming "+e);if("unsafe"!==e){f(String.prototype,"localeCompare",{value:ht});for(const e of c(t)){const r=t[e];if(r===Object(r))for(const t of c(r)){const e=bt.exec(t);if(e){nt("function"==typeof r[t],`expected ${t} to be a function`);const o=`${e[1]}${e[2]}`,n=r[o];nt("function"==typeof n,`function ${o} not found`),f(r,t,{value:n})}}}}}(I,h);const T=C();return pt(I,T),function(){try{(0,Object.prototype.__lookupGetter__)("x")}catch(t){return}function t(t){if(null==t)throw new TypeError("can't convert undefined or null to object");return Object(t)}function e(t){return"symbol"==typeof t?t:""+t}function o(t,e){if("function"!=typeof t)throw TypeError(`invalid ${e} usage`);return t}r(l,{__defineGetter__:{value:function(e,r){const n=t(this);f(n,e,{get:o(r,"getter"),enumerable:!0,configurable:!0})}},__defineSetter__:{value:function(e,r){const n=t(this);f(n,e,{set:o(r,"setter"),enumerable:!0,configurable:!0})}},__lookupGetter__:{value:function(r){let o,n=t(this);for(r=e(r);n&&!(o=a(n,r));)n=s(n);return o&&o.get}},__lookupSetter__:{value:function(r){let o,n=t(this);for(r=e(r);n&&!(o=a(n,r));)n=s(n);return o&&o.set}}})}(),Lt(globalThis,I,$,t,0,{nativeBrander:T}),function(){const t=function(t){const e={};function r(t,r,o,n){if("value"in n&&n.configurable){const{value:a}=n;e[t]=a,f(r,o,{get:function(){return a},set:function(e){if(r===this)throw new TypeError(`Cannot assign to read only property '${o}' of '${t}'`);hasOwnProperty.call(this,o)?this[o]=e:f(this,o,{value:e,writable:!0,enumerable:!0,configurable:!0})},enumerable:n.enumerable,configurable:n.configurable})}}function o(t,e,o){const n=a(e,o);n&&r(t,e,o,n)}function n(t,e){const o=i(e);o&&dt(o).forEach(n=>r(t,e,n,o[n]))}return function t(e,r,i){for(const s of c(i)){const c=a(r,s);if(!c||c.get||c.set)continue;const p=`${e}.${s}`,l=i[s];if(!0===l)o(p,r,s);else if("*"===l)n(p,c.value);else{if(!Pt(l))throw new TypeError("Unexpected override enablement plan "+p);t(p,c.value,l)}}}("root",t,mt),e}(I);return Vt(I),Vt(t),zt=!0,!0}}const Jt=new WeakMap,Kt={constructor:St,get globalThis(){return Jt.get(this).globalObject},get name(){return Jt.get(this).name},evaluate(t,o={}){if("string"!=typeof t)throw new TypeError("first argument of evaluate() must be a string");const{transforms:n=[],sloppyGlobalsMode:a=!1,__moduleShimLexicals__:c}=o,s=[...n],{globalTransforms:p,globalObject:l,globalLexicals:u}=Jt.get(this);let y=u;return void 0!==c&&(y=e(null,i(u)),r(y,i(c))),Gt(t,l,y,{globalTransforms:p,localTransforms:s,sloppyGlobalsMode:a})},toString:()=>"[object Compartment]"};r(St,{prototype:{value:Kt}});const qt=(e,r,o)=>{function a(a={},i={},s={}){if(void 0===new.target)throw new TypeError("Class constructor Compartment cannot be invoked without 'new'");const{name:p="<unknown>",transforms:l=[],globalLexicals:u={}}=s,y=[...l],f={};Lt(f,r,G,e,this.constructor.prototype,{globalTransforms:y,nativeBrander:o}),t(f,a);const g=c(u).filter(t=>!Ft(t));if(g.length)throw new Error(`Cannot create compartment with invalid names for global lexicals: ${g.join(", ")}; these names would not be lexically mentionable`);Jt.set(this,{name:p,globalTransforms:y,globalObject:f,globalLexicals:n({...u})})}return a.prototype=Kt,a},Qt=C(),Xt=qt(qt,function(t){const e=Z();return e.addIntrinsics(X(t,G)),e.finalIntrinsics()}(globalThis),Qt);t(globalThis,{harden:t=>(nt(zt,"Cannot harden before lockdown"),Vt(t)),lockdown:((t,e)=>(e={})=>Ht(t,0,e)())(qt),Compartment:Xt})}));
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";const{assign:t,create:e,defineProperties:r,entries:o,freeze:n,getOwnPropertyDescriptor:a,getOwnPropertyDescriptors:i,getOwnPropertyNames:c,getPrototypeOf:s,keys:p,prototype:l,setPrototypeOf:u,values:y}=Object,f=(t,e,o)=>r(t,{[e]:o}),{apply:g,construct:m,get:d,set:P}=Reflect,{isArray:b,prototype:h}=Array,{revocable:S}=Proxy,{prototype:w}=RegExp,{prototype:E}=String,{prototype:I}=WeakMap,T=t=>(e,...r)=>g(t,e,r),A=T(l.hasOwnProperty),v=(T(h.filter),T(h.join)),F=(T(h.push),T(h.pop)),x=T(h.includes),U=T(w.test),k=(T(E.match),T(E.search)),_=T(E.slice),R=T(E.split),O=(T(I.get),T(I.set),T(I.has),n({__proto__:null}));function C(){const t=new WeakSet,e=Function.prototype.toString,r={toString(){const r=g(e,this,[]);return r.endsWith(") { [native code] }")||!t.has(this)?r:`function ${this.name}() { [native code] }`}};return f(Function.prototype,"toString",{value:r.toString}),e=>t.add(e)}const M={Infinity:1/0,NaN:NaN,undefined:void 0},N={isFinite:"isFinite",isNaN:"isNaN",parseFloat:"parseFloat",parseInt:"parseInt",decodeURI:"decodeURI",decodeURIComponent:"decodeURIComponent",encodeURI:"encodeURI",encodeURIComponent:"encodeURIComponent",Array:"Array",ArrayBuffer:"ArrayBuffer",BigInt:"BigInt",BigInt64Array:"BigInt64Array",BigUint64Array:"BigUint64Array",Boolean:"Boolean",DataView:"DataView",EvalError:"EvalError",Float32Array:"Float32Array",Float64Array:"Float64Array",Int8Array:"Int8Array",Int16Array:"Int16Array",Int32Array:"Int32Array",Map:"Map",Number:"Number",Object:"Object",Promise:"Promise",Proxy:"Proxy",RangeError:"RangeError",ReferenceError:"ReferenceError",Set:"Set",String:"String",Symbol:"Symbol",SyntaxError:"SyntaxError",TypeError:"TypeError",Uint8Array:"Uint8Array",Uint8ClampedArray:"Uint8ClampedArray",Uint16Array:"Uint16Array",Uint32Array:"Uint32Array",URIError:"URIError",WeakMap:"WeakMap",WeakSet:"WeakSet",JSON:"JSON",Reflect:"Reflect",escape:"escape",unescape:"unescape",lockdown:"lockdown",harden:"harden",HandledPromise:"HandledPromise",StaticModuleRecord:"StaticModuleRecord"},$={Date:"%InitialDate%",Error:"%InitialError%",RegExp:"%InitialRegExp%",Math:"%InitialMath%",getStackString:"%InitialGetStackString%"},G={Date:"%SharedDate%",Error:"%SharedError%",RegExp:"%SharedRegExp%",Math:"%SharedMath%"},j=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError],B={"[[Proto]]":"%FunctionPrototype%",length:"number",name:"string"},D=B,L={get:D,set:"undefined"},W={get:D,set:D};function z(t){return t===L||t===W}function V(t){return{"[[Proto]]":"%SharedError%",prototype:t}}function Y(t){return{"[[Proto]]":"%ErrorPrototype%",constructor:t,message:"string",name:"string",toString:!1}}function H(t){return{"[[Proto]]":"%TypedArray%",BYTES_PER_ELEMENT:"number",prototype:t}}function J(t){return{"[[Proto]]":"%TypedArrayPrototype%",BYTES_PER_ELEMENT:"number",constructor:t}}const K={E:"number",LN10:"number",LN2:"number",LOG10E:"number",LOG2E:"number",PI:"number",SQRT1_2:"number",SQRT2:"number","@@toStringTag":"string",abs:D,acos:D,acosh:D,asin:D,asinh:D,atan:D,atanh:D,atan2:D,cbrt:D,ceil:D,clz32:D,cos:D,cosh:D,exp:D,expm1:D,floor:D,fround:D,hypot:D,imul:D,log:D,log1p:D,log10:D,log2:D,max:D,min:D,pow:D,round:D,sign:D,sin:D,sinh:D,sqrt:D,tan:D,tanh:D,trunc:D},q={"[[Proto]]":null,"%ThrowTypeError%":D,Infinity:"number",NaN:"number",undefined:"undefined","%UniqueEval%":D,isFinite:D,isNaN:D,parseFloat:D,parseInt:D,decodeURI:D,decodeURIComponent:D,encodeURI:D,encodeURIComponent:D,Object:{"[[Proto]]":"%FunctionPrototype%",assign:D,create:D,defineProperties:D,defineProperty:D,entries:D,freeze:D,fromEntries:D,getOwnPropertyDescriptor:D,getOwnPropertyDescriptors:D,getOwnPropertyNames:D,getOwnPropertySymbols:D,getPrototypeOf:D,is:D,isExtensible:D,isFrozen:D,isSealed:D,keys:D,preventExtensions:D,prototype:"%ObjectPrototype%",seal:D,setPrototypeOf:D,values:D},"%ObjectPrototype%":{"[[Proto]]":null,constructor:"Object",hasOwnProperty:D,isPrototypeOf:D,propertyIsEnumerable:D,toLocaleString:D,toString:D,valueOf:D,"--proto--":W,__defineGetter__:D,__defineSetter__:D,__lookupGetter__:D,__lookupSetter__:D},"%UniqueFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%InertFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%FunctionPrototype%":{apply:D,bind:D,call:D,constructor:"%InertFunction%",toString:D,"@@hasInstance":D,caller:!1,arguments:!1},Boolean:{"[[Proto]]":"%FunctionPrototype%",prototype:"%BooleanPrototype%"},"%BooleanPrototype%":{constructor:"Boolean",toString:D,valueOf:D},Symbol:{"[[Proto]]":"%FunctionPrototype%",asyncIterator:"symbol",for:D,hasInstance:"symbol",isConcatSpreadable:"symbol",iterator:"symbol",keyFor:D,match:"symbol",matchAll:"symbol",prototype:"%SymbolPrototype%",replace:"symbol",search:"symbol",species:"symbol",split:"symbol",toPrimitive:"symbol",toStringTag:"symbol",unscopables:"symbol"},"%SymbolPrototype%":{constructor:"Symbol",description:L,toString:D,valueOf:D,"@@toPrimitive":D,"@@toStringTag":"string"},"%InitialError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:D,stackTraceLimit:W,prepareStackTrace:W},"%SharedError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:D,stackTraceLimit:W,prepareStackTrace:W},"%ErrorPrototype%":{constructor:"%SharedError%",message:"string",name:"string",toString:D},EvalError:V("%EvalErrorPrototype%"),RangeError:V("%RangeErrorPrototype%"),ReferenceError:V("%ReferenceErrorPrototype%"),SyntaxError:V("%SyntaxErrorPrototype%"),TypeError:V("%TypeErrorPrototype%"),URIError:V("%URIErrorPrototype%"),"%EvalErrorPrototype%":Y("EvalError"),"%RangeErrorPrototype%":Y("RangeError"),"%ReferenceErrorPrototype%":Y("ReferenceError"),"%SyntaxErrorPrototype%":Y("SyntaxError"),"%TypeErrorPrototype%":Y("TypeError"),"%URIErrorPrototype%":Y("URIError"),Number:{"[[Proto]]":"%FunctionPrototype%",EPSILON:"number",isFinite:D,isInteger:D,isNaN:D,isSafeInteger:D,MAX_SAFE_INTEGER:"number",MAX_VALUE:"number",MIN_SAFE_INTEGER:"number",MIN_VALUE:"number",NaN:"number",NEGATIVE_INFINITY:"number",parseFloat:D,parseInt:D,POSITIVE_INFINITY:"number",prototype:"%NumberPrototype%"},"%NumberPrototype%":{constructor:"Number",toExponential:D,toFixed:D,toLocaleString:D,toPrecision:D,toString:D,valueOf:D},BigInt:{"[[Proto]]":"%FunctionPrototype%",asIntN:D,asUintN:D,prototype:"%BigIntPrototype%"},"%BigIntPrototype%":{constructor:"BigInt",toLocaleString:D,toString:D,valueOf:D,"@@toStringTag":"string"},"%InitialMath%":{...K,random:D},"%SharedMath%":K,"%InitialDate%":{"[[Proto]]":"%FunctionPrototype%",now:D,parse:D,prototype:"%DatePrototype%",UTC:D},"%SharedDate%":{"[[Proto]]":"%FunctionPrototype%",now:D,parse:D,prototype:"%DatePrototype%",UTC:D},"%DatePrototype%":{constructor:"%SharedDate%",getDate:D,getDay:D,getFullYear:D,getHours:D,getMilliseconds:D,getMinutes:D,getMonth:D,getSeconds:D,getTime:D,getTimezoneOffset:D,getUTCDate:D,getUTCDay:D,getUTCFullYear:D,getUTCHours:D,getUTCMilliseconds:D,getUTCMinutes:D,getUTCMonth:D,getUTCSeconds:D,setDate:D,setFullYear:D,setHours:D,setMilliseconds:D,setMinutes:D,setMonth:D,setSeconds:D,setTime:D,setUTCDate:D,setUTCFullYear:D,setUTCHours:D,setUTCMilliseconds:D,setUTCMinutes:D,setUTCMonth:D,setUTCSeconds:D,toDateString:D,toISOString:D,toJSON:D,toLocaleDateString:D,toLocaleString:D,toLocaleTimeString:D,toString:D,toTimeString:D,toUTCString:D,valueOf:D,"@@toPrimitive":D,getYear:D,setYear:D,toGMTString:D},String:{"[[Proto]]":"%FunctionPrototype%",fromCharCode:D,fromCodePoint:D,prototype:"%StringPrototype%",raw:D},"%StringPrototype%":{length:"number",charAt:D,charCodeAt:D,codePointAt:D,concat:D,constructor:"String",endsWith:D,includes:D,indexOf:D,lastIndexOf:D,localeCompare:D,match:D,matchAll:D,normalize:D,padEnd:D,padStart:D,repeat:D,replace:D,search:D,slice:D,split:D,startsWith:D,substring:D,toLocaleLowerCase:D,toLocaleUpperCase:D,toLowerCase:D,toString:D,toUpperCase:D,trim:D,trimEnd:D,trimStart:D,valueOf:D,"@@iterator":D,substr:D,anchor:D,big:D,blink:D,bold:D,fixed:D,fontcolor:D,fontsize:D,italics:D,link:D,small:D,strike:D,sub:D,sup:D,trimLeft:D,trimRight:D},"%StringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},"%InitialRegExp%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%RegExpPrototype%","@@species":L,input:!1,$_:!1,lastMatch:!1,"$&":!1,lastParen:!1,"$+":!1,leftContext:!1,"$`":!1,rightContext:!1,"$'":!1,$1:!1,$2:!1,$3:!1,$4:!1,$5:!1,$6:!1,$7:!1,$8:!1,$9:!1},"%SharedRegExp%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%RegExpPrototype%","@@species":L},"%RegExpPrototype%":{constructor:"%SharedRegExp%",exec:D,dotAll:L,flags:L,global:L,ignoreCase:L,"@@match":D,"@@matchAll":D,multiline:L,"@@replace":D,"@@search":D,source:L,"@@split":D,sticky:L,test:D,toString:D,unicode:L,compile:!1},"%RegExpStringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},Array:{"[[Proto]]":"%FunctionPrototype%",from:D,isArray:D,of:D,prototype:"%ArrayPrototype%","@@species":L},"%ArrayPrototype%":{length:"number",concat:D,constructor:"Array",copyWithin:D,entries:D,every:D,fill:D,filter:D,find:D,findIndex:D,flat:D,flatMap:D,forEach:D,includes:D,indexOf:D,join:D,keys:D,lastIndexOf:D,map:D,pop:D,push:D,reduce:D,reduceRight:D,reverse:D,shift:D,slice:D,some:D,sort:D,splice:D,toLocaleString:D,toString:D,unshift:D,values:D,"@@iterator":D,"@@unscopables":{"[[Proto]]":null,copyWithin:"boolean",entries:"boolean",fill:"boolean",find:"boolean",findIndex:"boolean",flat:"boolean",flatMap:"boolean",includes:"boolean",keys:"boolean",values:"boolean"}},"%ArrayIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},"%TypedArray%":{"[[Proto]]":"%FunctionPrototype%",from:D,of:D,prototype:"%TypedArrayPrototype%","@@species":L},"%TypedArrayPrototype%":{buffer:L,byteLength:L,byteOffset:L,constructor:"%TypedArray%",copyWithin:D,entries:D,every:D,fill:D,filter:D,find:D,findIndex:D,forEach:D,includes:D,indexOf:D,join:D,keys:D,lastIndexOf:D,length:L,map:D,reduce:D,reduceRight:D,reverse:D,set:D,slice:D,some:D,sort:D,subarray:D,toLocaleString:D,toString:D,values:D,"@@iterator":D,"@@toStringTag":L},BigInt64Array:H("%BigInt64ArrayPrototype%"),BigUint64Array:H("%BigUint64ArrayPrototype%"),Float32Array:H("%Float32ArrayPrototype%"),Float64Array:H("%Float64ArrayPrototype%"),Int16Array:H("%Int16ArrayPrototype%"),Int32Array:H("%Int32ArrayPrototype%"),Int8Array:H("%Int8ArrayPrototype%"),Uint16Array:H("%Uint16ArrayPrototype%"),Uint32Array:H("%Uint32ArrayPrototype%"),Uint8Array:H("%Uint8ArrayPrototype%"),Uint8ClampedArray:H("%Uint8ClampedArrayPrototype%"),"%BigInt64ArrayPrototype%":J("BigInt64Array"),"%BigUint64ArrayPrototype%":J("BigUint64Array"),"%Float32ArrayPrototype%":J("Float32Array"),"%Float64ArrayPrototype%":J("Float64Array"),"%Int16ArrayPrototype%":J("Int16Array"),"%Int32ArrayPrototype%":J("Int32Array"),"%Int8ArrayPrototype%":J("Int8Array"),"%Uint16ArrayPrototype%":J("Uint16Array"),"%Uint32ArrayPrototype%":J("Uint32Array"),"%Uint8ArrayPrototype%":J("Uint8Array"),"%Uint8ClampedArrayPrototype%":J("Uint8ClampedArray"),Map:{"[[Proto]]":"%FunctionPrototype%","@@species":L,prototype:"%MapPrototype%"},"%MapPrototype%":{clear:D,constructor:"Map",delete:D,entries:D,forEach:D,get:D,has:D,keys:D,set:D,size:L,values:D,"@@iterator":D,"@@toStringTag":"string"},"%MapIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},Set:{"[[Proto]]":"%FunctionPrototype%",prototype:"%SetPrototype%","@@species":L},"%SetPrototype%":{add:D,clear:D,constructor:"Set",delete:D,entries:D,forEach:D,has:D,keys:D,size:L,values:D,"@@iterator":D,"@@toStringTag":"string"},"%SetIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:D,"@@toStringTag":"string"},WeakMap:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakMapPrototype%"},"%WeakMapPrototype%":{constructor:"WeakMap",delete:D,get:D,has:D,set:D,"@@toStringTag":"string"},WeakSet:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakSetPrototype%"},"%WeakSetPrototype%":{add:D,constructor:"WeakSet",delete:D,has:D,"@@toStringTag":"string"},ArrayBuffer:{"[[Proto]]":"%FunctionPrototype%",isView:D,prototype:"%ArrayBufferPrototype%","@@species":L},"%ArrayBufferPrototype%":{byteLength:L,constructor:"ArrayBuffer",slice:D,"@@toStringTag":"string"},SharedArrayBuffer:!1,"%SharedArrayBufferPrototype%":!1,DataView:{"[[Proto]]":"%FunctionPrototype%",prototype:"%DataViewPrototype%"},"%DataViewPrototype%":{buffer:L,byteLength:L,byteOffset:L,constructor:"DataView",getBigInt64:D,getBigUint64:D,getFloat32:D,getFloat64:D,getInt8:D,getInt16:D,getInt32:D,getUint8:D,getUint16:D,getUint32:D,setBigInt64:D,setBigUint64:D,setFloat32:D,setFloat64:D,setInt8:D,setInt16:D,setInt32:D,setUint8:D,setUint16:D,setUint32:D,"@@toStringTag":"string"},Atomics:!1,JSON:{parse:D,stringify:D,"@@toStringTag":"string"},"%IteratorPrototype%":{"@@iterator":D},"%AsyncIteratorPrototype%":{"@@asyncIterator":D},"%InertGeneratorFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%Generator%"},"%Generator%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertGeneratorFunction%",prototype:"%GeneratorPrototype%","@@toStringTag":"string"},"%InertAsyncGeneratorFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%AsyncGenerator%"},"%AsyncGenerator%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertAsyncGeneratorFunction%",prototype:"%AsyncGeneratorPrototype%","@@toStringTag":"string"},"%GeneratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",constructor:"%Generator%",next:D,return:D,throw:D,"@@toStringTag":"string"},"%AsyncGeneratorPrototype%":{"[[Proto]]":"%AsyncIteratorPrototype%",constructor:"%AsyncGenerator%",next:D,return:D,throw:D,"@@toStringTag":"string"},HandledPromise:{"[[Proto]]":"Promise",applyFunction:D,applyFunctionSendOnly:D,applyMethod:D,applyMethodSendOnly:D,get:D,getSendOnly:D,prototype:"%PromisePrototype%",resolve:D},Promise:{"[[Proto]]":"%FunctionPrototype%",all:D,allSettled:D,prototype:"%PromisePrototype%",race:D,reject:D,resolve:D,"@@species":L},"%PromisePrototype%":{catch:D,constructor:"Promise",finally:D,then:D,"@@toStringTag":"string"},"%InertAsyncFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%AsyncFunctionPrototype%"},"%AsyncFunctionPrototype%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertAsyncFunction%","@@toStringTag":"string"},Reflect:{apply:D,construct:D,defineProperty:D,deleteProperty:D,get:D,getOwnPropertyDescriptor:D,getPrototypeOf:D,has:D,isExtensible:D,ownKeys:D,preventExtensions:D,set:D,setPrototypeOf:D},Proxy:{"[[Proto]]":"%FunctionPrototype%",revocable:D},escape:D,unescape:D,"%UniqueCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:D},"%InertCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:D},"%CompartmentPrototype%":{constructor:"%InertCompartment%",evaluate:D,globalThis:L,name:L,toString:D},lockdown:D,harden:D,"%InitialGetStackString%":D};function Q(t,e,r){if(A(t,e)){const o=a(t,e);if(!Object.is(o.value,r.value)||o.get!==r.get||o.set!==r.set||o.writable!==r.writable||o.enumerable!==r.enumerable||o.configurable!==r.configurable)throw new Error("Conflicting definitions of "+e)}f(t,e,r)}function X(t,e){const r={__proto__:null};for(const[n,a]of o(e))A(t,n)&&(r[a]=t[n]);return r}function Z(){const t={__proto__:null};let e;const r={addIntrinsics(e){!function(t,e){for(const[r,n]of o(e))Q(t,r,n)}(t,i(e))},completePrototypes(){for(const[e,r]of o(t)){if(r!==Object(r))continue;if(!A(r,"prototype"))continue;const o=q[e];if("object"!=typeof o)throw new Error("Expected permit object at whitelist."+e);const n=o.prototype;if(!n)throw new Error(e+".prototype property not whitelisted");if("string"!=typeof n||!A(q,n))throw new Error(`Unrecognized ${e}.prototype whitelist entry`);const a=r.prototype;if(A(t,n)){if(t[n]!==a)throw new Error("Conflicting bindings of "+n)}else t[n]=a}},finalIntrinsics:()=>(n(t),e=new WeakSet(y(t).filter(t=>"function"==typeof t)),t),isPseudoNative(t){if(!e)throw new Error("isPseudoNative can only be called after finalIntrinsics");return e.has(t)}};return r.addIntrinsics(M),r.addIntrinsics(X(globalThis,N)),r}const tt=function(t={},e={},r={}){throw new TypeError("Not available")};function et(t){return s(t).constructor}const{freeze:rt,getOwnPropertyDescriptors:ot,getPrototypeOf:nt}=Object,{ownKeys:at}=Reflect;function it(t,e){if(!t)throw new TypeError(e)}const{apply:ct,ownKeys:st}=Reflect,pt=(t=>(e,...r)=>ct(t,e,r))(Object.prototype.hasOwnProperty);function lt(t,e){if("string"==typeof e)return e;if("symbol"==typeof e)return"@@"+e.toString().slice(14,-1);throw new TypeError(`Unexpected property name type ${t} ${e}`)}function ut(t,e){const r=["undefined","boolean","number","string","symbol"];function o(e,o,n,a){if("object"==typeof a)return c(e,o,a),!0;if(!1===a)return!1;if("string"==typeof a)if("prototype"===n||"constructor"===n){if(pt(t,a)){if(o!==t[a])throw new TypeError("Does not match whitelist "+e);return!0}}else if(r.includes(a)){if(typeof o!==a)throw new TypeError(`At ${e} expected ${a} not ${typeof o}`);return!0}throw new TypeError(`Unexpected whitelist permit ${a} at ${e}`)}function n(t,e,r,n){const i=a(e,r);if(pt(i,"value")){if(z(n))throw new TypeError("Accessor expected at "+t);return o(t,i.value,r,n)}if(!z(n))throw new TypeError("Accessor not expected at "+t);return o(t+"<get>",i.get,r,n.get)&&o(t+"<set>",i.set,r,n.set)}function i(t,r,o){const n="__proto__"===o?"--proto--":o;return pt(r,n)?r[n]:"function"==typeof t&&(e(t),pt(B,n))?B[n]:void 0}function c(e,r,o){if(void 0===r)return;!function(e,r,o){if(r!==Object(r))throw new TypeError(`Object expected: ${e}, ${r}, ${o}`);const n=s(r);if(null!==n||null!==o){if(void 0!==o&&"string"!=typeof o)throw new TypeError(`Malformed whitelist permit ${e}.__proto__`);if(n!==t[o||"%ObjectPrototype%"])throw new Error(`Unexpected intrinsic ${e}.__proto__ at ${o}`)}}(e,r,o["[[Proto]]"]);for(const t of st(r)){const a=lt(e,t),c=`${e}.${a}`,s=i(r,o,a);s&&n(c,r,t,s)||(!1!==s&&console.log("Removing "+c),delete r[t])}}c("intrinsics",t,q)}const yt=["getTypeName","getFunctionName","getMethodName","getFileName","getLineNumber","getColumnNumber","getEvalOrigin","isToplevel","isEval","isNative","isConstructor","isAsync","getPosition","getScriptNameOrSourceURL","toString"],ft=t=>{const e=Object.fromEntries(yt.map(e=>[e,()=>t[e]()]));return Object.create(e,{})},gt=(t,e)=>[""+t,...e.map(t=>"\n at "+t)].join("");function mt(t,e,o){const n=new WeakMap,a={captureStackTrace(e,r=a.captureStackTrace){"function"!=typeof t.captureStackTrace?Reflect.set(e,"stack",""):t.captureStackTrace(e,r)},getStackString(t){n.has(t)||t.stack;const e=n.get(t);return e?gt(t,e):""},prepareStackTrace:(t,e)=>(n.set(t,e),"unsafe"===o?gt(t,e):"")},i=a.prepareStackTrace;t.prepareStackTrace=i;const c=new WeakSet([i]),s=t=>{if(c.has(t))return t;const e={prepareStackTrace:(e,r)=>(n.set(e,r),t(e,(t=>t.map(ft))(r)))};return c.add(e.prepareStackTrace),e.prepareStackTrace};return r(e,{captureStackTrace:{value:a.captureStackTrace,writable:!0,enumerable:!1,configurable:!0},stackTraceLimit:{get(){if("number"==typeof t.stackTraceLimit)return t.stackTraceLimit},set(e){"number"!=typeof t.stackTraceLimit||(t.stackTraceLimit=e)},enumerable:!1,configurable:!0},prepareStackTrace:{get:()=>t.prepareStackTrace,set(e){if("function"==typeof e){const r=s(e);t.prepareStackTrace=r}else t.prepareStackTrace=i},enumerable:!1,configurable:!0}}),a.getStackString}const dt={getStackString:t=>""};var Pt={"%ObjectPrototype%":"*","%ArrayPrototype%":"*","%FunctionPrototype%":{constructor:!0,bind:!0,name:!0,toString:!0},"%ErrorPrototype%":{constructor:!0,message:!0,name:!0,toString:!0},"%TypeErrorPrototype%":{constructor:!0,message:!0,name:!0},"%SyntaxErrorPrototype%":{message:!0},"%RangeErrorPrototype%":{message:!0},"%URIErrorPrototype%":{message:!0},"%EvalErrorPrototype%":{message:!0},"%ReferenceErrorPrototype%":{message:!0},"%PromisePrototype%":{constructor:!0},"%TypedArrayPrototype%":"*","%Generator%":{constructor:!0,name:!0,toString:!0},"%IteratorPrototype%":"*"};const{ownKeys:bt}=Reflect;function ht(t){return null!==t&&"object"==typeof t}const St=/^(\w*[a-z])Locale([A-Z]\w*)$/,wt={localeCompare(t){if(null==this)throw new TypeError('Cannot localeCompare with null or undefined "this" value');const e=""+this;return e<(t=""+t)?-1:e>t?1:(it(e===t,`expected ${e} and ${t} to compare`),0)}}.localeCompare;function Et(t,e){const r="please report internal shim error: "+t;throw console.error(r),e&&(console.error(""+e),console.error(""+e.stack)),TypeError(r)}function It(t,e){t||Et(e)}const Tt=["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","let","static","enum","implements","package","protected","interface","private","public","await","null","true","false","this","arguments"],At=new RegExp("^[a-zA-Z_$][\\w$]*$");function vt(t){return"eval"!==t&&!x(Tt,t)&&U(At,t)}function Ft(t,e){const r=a(t,e);return!1===r.configurable&&!1===r.writable&&A(r,"value")}const xt=eval,Ut=new Proxy(O,{get(t,e){Et("unexpected scope handler trap called: "+String(e))}});function kt(t,e){const r=k(t,e);return r<0?-1:R(_(t,0,r),"\n").length}const _t=new RegExp("(?:\x3c!--|--\x3e)");const Rt=new RegExp("\\bimport\\s*(?:\\(|/[/*])");const Ot=new RegExp("\\beval\\s*(?:\\(|/[/*])");function Ct(t){return t=function(t){const e=kt(t,Ot);if(e<0)return t;throw new SyntaxError("possible direct eval expression rejected around line "+e)}(t=function(t){const e=kt(t,Rt);if(e<0)return t;throw new SyntaxError("possible import expression rejected around line "+e)}(t=function(t){const e=kt(t,_t);if(e<0)return t;throw new SyntaxError("possible html comment syntax rejected around line "+e)}(t)))}const Mt=Function;function Nt(t=[]){const e=function(t){return 0===t.length?"":`const {${v(t,",")}} = this;`}(t);return Mt(`\n with (this) {\n ${e}\n return function() {\n 'use strict';\n return eval(arguments[0]);\n };\n }\n `)}function $t(t,e,r={},{localTransforms:o=[],globalTransforms:n=[],sloppyGlobalsMode:i=!1}={}){t=function(t,e){for(const r of e)t=r(t);return t}(t,[...o,...n,Ct]);const s=function(t,e={},{sloppyGlobalsMode:r=!1}={}){return{__proto__:Ut,useUnsafeEvaluator:!1,get(r,o){if("symbol"!=typeof o)return"eval"===o&&!0===this.useUnsafeEvaluator?(this.useUnsafeEvaluator=!1,xt):o in e?d(e,o,t):d(t,o)},set(r,o,n){if(o in e){return"value"in a(e,o)?P(e,o,n):P(e,o,n,t)}return P(t,o,n)},has:(o,n)=>!!(r||"eval"===n||n in e||n in t||n in globalThis),getPrototypeOf:()=>null,getOwnPropertyDescriptor(t,e){const r=JSON.stringify(String(e));console.warn("getOwnPropertyDescriptor trap on scopeHandler for "+r,(new Error).stack)}}}(e,r,{sloppyGlobalsMode:i}),p=S(O,s),l=Nt(function(t,e={}){const r=c(t),o=c(e),n=o.filter(t=>vt(t)&&Ft(e,t));return[...r.filter(e=>!o.includes(e)&&vt(e)&&Ft(t,e)),...n]}(e,r)),u=g(l,p.proxy,[]);let y;s.useUnsafeEvaluator=!0;try{return g(u,e,[t])}catch(t){throw y=t,t}finally{!0===s.useUnsafeEvaluator&&(Et("handler did not revoke useUnsafeEvaluator",y),p.revoke())}}const Gt=(t,e={})=>r=>"string"!=typeof r?r:$t(r,t,{},e),jt=Function;function Bt(t,e={}){const o=function(r){const o=""+(F(arguments)||""),n=""+v(arguments,",");new jt(n,o);const a=`(function anonymous(${n}\n) {\n${o}\n})`;return $t(a,t,{},e)};return r(o,{prototype:{value:Function.prototype,writable:!1,enumerable:!1,configurable:!1}}),It(s(Function)===Function.prototype,"Function prototype is the same accross compartments"),It(s(o)===Function.prototype,"Function constructor prototype is the same accross compartments"),o}function Dt(t,e,r,n,a,{globalTransforms:i,nativeBrander:c}){for(const[e,r]of o(M))f(t,e,{value:r,writable:!1,enumerable:!1,configurable:!1});for(const[r,n]of o(N))A(e,n)&&f(t,r,{value:e[n],writable:!0,enumerable:!1,configurable:!0});for(const[n,a]of o(r))A(e,a)&&f(t,n,{value:e[a],writable:!0,enumerable:!1,configurable:!0});const s={globalThis:t,eval:Gt(t,{globalTransforms:i}),Function:Bt(t,{globalTransforms:i})};s.Compartment=n(n,e,c);for(const[e,r]of o(s))f(t,e,{value:r,writable:!0,enumerable:!1,configurable:!0}),"function"==typeof r&&c(r)}let Lt,Wt=!1;const zt=function(){if(arguments.length>=1)throw new TypeError("makeHardener no longer takes any options");const t=new WeakSet,{harden:e}={harden(e){const r=new Set,o=new Map,n=new WeakMap;function a(e,o){if(Object(e)!==e)return;const a=typeof e;if("object"!==a&&"function"!==a)throw new TypeError("Unexpected typeof: "+a);t.has(e)||r.has(e)||(r.add(e),n.set(e,o))}function i(t){rt(t);const e=nt(t),r=ot(t),i=n.get(t)||"unknown";null===e||o.has(e)||(o.set(e,i),n.set(e,i+".__proto__")),at(r).forEach(t=>{const e=`${i}.${String(t)}`,o=r[t];"value"in o?a(o.value,""+e):(a(o.get,e+"(get)"),a(o.set,e+"(set)"))})}return a(e),r.forEach(i),o.forEach((e,o)=>{if(!r.has(o)&&!t.has(o)){let t;try{t=`prototype ${o} of ${e} is not already in the fringeSet`}catch(r){t="a prototype of something is not already in the fringeset (and .toString failed)";try{console.log(t),console.log("the prototype:",o),console.log("of something:",e)}catch(t){}}throw new TypeError(t)}}),r.forEach(t.add,t),e}};return e}(),Vt=()=>!1;function Yt(t,o,n,y={}){y={...Lt,...y};const{dateTaming:d="safe",errorTaming:P="safe",mathTaming:b="safe",regExpTaming:h="safe",localeTaming:S="safe",...w}=y,E=Reflect.ownKeys(w);if(it(0===E.length,"lockdown(): non supported option "+E.join(", ")),Lt){for(const t of p(Lt))it(y[t]===Lt[t],"lockdown(): cannot re-invoke with different option "+t);return Vt}Lt={dateTaming:d,errorTaming:P,mathTaming:b,regExpTaming:h,localeTaming:S};const I=Z();I.addIntrinsics(function(){try{(0,Function.prototype.constructor)("return 1")}catch(t){return{}}const t={};function e(e,o,n){let a;try{a=(0,eval)(n)}catch(t){if(t instanceof SyntaxError)return;throw t}const i=s(a),c=function(){throw new TypeError("Not available")};r(c,{prototype:{value:i},name:{value:e,writable:!1,enumerable:!1,configurable:!0}}),r(i,{constructor:{value:c}}),c!==Function.prototype.constructor&&u(c,Function.prototype.constructor),t[o]=c}return e("Function","%InertFunction%","(function(){})"),e("GeneratorFunction","%InertGeneratorFunction%","(function*(){})"),e("AsyncFunction","%InertAsyncFunction%","(async function(){})"),e("AsyncGeneratorFunction","%InertAsyncGeneratorFunction%","(async function*(){})"),t}()),I.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized dateTaming "+t);const e=Date,o=e.prototype,n={now:()=>NaN},a=({powers:t="none"}={})=>{let n;return n="original"===t?function(...t){return void 0===new.target?Reflect.apply(e,void 0,t):Reflect.construct(e,t,new.target)}:function(...t){return void 0===new.target?"Invalid Date":(0===t.length&&(t=[NaN]),Reflect.construct(e,t,new.target))},r(n,{length:{value:7},prototype:{value:o,writable:!1,enumerable:!1,configurable:!1},parse:{value:Date.parse,writable:!0,enumerable:!1,configurable:!0},UTC:{value:Date.UTC,writable:!0,enumerable:!1,configurable:!0}}),n},i=a({powers:"original"}),c=a({power:"none"});return r(i,{now:{value:Date.now,writable:!0,enumerable:!1,configurable:!0}}),r(c,{now:{value:n.now,writable:!0,enumerable:!1,configurable:!0}}),r(o,{constructor:{value:c}}),{"%InitialDate%":i,"%SharedDate%":c}}(d)),I.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized errorTaming "+t);const e=Error,o=e.prototype,n="function"==typeof e.captureStackTrace?"v8":"unknown",a=(t={})=>{const a=function(...t){let r;return r=void 0===new.target?g(e,this,t):m(e,t,new.target),"v8"===n&&e.captureStackTrace(r,a),r};return r(a,{length:{value:1},prototype:{value:o,writable:!1,enumerable:!1,configurable:!1}}),a},i=a({powers:"original"}),c=a({powers:"none"});r(o,{constructor:{value:c}});for(const t of j)u(t,c);let s=dt.getStackString;return"v8"===n&&(s=mt(e,i,t)),{"%InitialGetStackString%":s,"%InitialError%":i,"%SharedError%":c}}(P)),I.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized mathTaming "+t);const r=Math,o=r,{random:n,...a}=i(r);return{"%InitialMath%":o,"%SharedMath%":e(Object.prototype,a)}}(b)),I.addIntrinsics(function(t="safe"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized regExpTaming "+t);const e=RegExp,o=e.prototype,n=(t={})=>{const n=function(...t){return void 0===new.target?e(...t):Reflect.construct(e,t,new.target)};return r(n,{length:{value:2},prototype:{value:o,writable:!1,enumerable:!1,configurable:!1},[Symbol.species]:a(e,Symbol.species)}),n},i=n(),c=n();return"unsafe"!==t&&delete o.compile,r(o,{constructor:{value:c}}),{"%InitialRegExp%":i,"%SharedRegExp%":c}}(h)),I.addIntrinsics(n()),I.completePrototypes();const T=I.finalIntrinsics();!function(t,e="safe"){if("safe"!==e&&"unsafe"!==e)throw new Error("unrecognized dateTaming "+e);if("unsafe"!==e){f(String.prototype,"localeCompare",{value:wt});for(const e of c(t)){const r=t[e];if(r===Object(r))for(const t of c(r)){const e=St.exec(t);if(e){it("function"==typeof r[t],`expected ${t} to be a function`);const o=`${e[1]}${e[2]}`,n=r[o];it("function"==typeof n,`function ${o} not found`),f(r,t,{value:n})}}}}}(T,S);const v=C();return ut(T,v),function(){try{(0,Object.prototype.__lookupGetter__)("x")}catch(t){return}function t(t){if(null==t)throw new TypeError("can't convert undefined or null to object");return Object(t)}function e(t){return"symbol"==typeof t?t:""+t}function o(t,e){if("function"!=typeof t)throw TypeError(`invalid ${e} usage`);return t}r(l,{__defineGetter__:{value:function(e,r){const n=t(this);f(n,e,{get:o(r,"getter"),enumerable:!0,configurable:!0})}},__defineSetter__:{value:function(e,r){const n=t(this);f(n,e,{set:o(r,"setter"),enumerable:!0,configurable:!0})}},__lookupGetter__:{value:function(r){let o,n=t(this);for(r=e(r);n&&!(o=a(n,r));)n=s(n);return o&&o.get}},__lookupSetter__:{value:function(r){let o,n=t(this);for(r=e(r);n&&!(o=a(n,r));)n=s(n);return o&&o.set}}})}(),Dt(globalThis,T,$,t,0,{nativeBrander:v}),function(){return function(t){function e(t,e,r,o){if("value"in o&&o.configurable){const{value:a}=o;function n(){return a}f(n,"originalValue",{value:a,writable:!1,enumerable:!1,configurable:!1}),f(e,r,{get:n,set:function(o){if(e===this)throw new TypeError(`Cannot assign to read only property '${r}' of '${t}'`);A(this,r)?this[r]=o:f(this,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},enumerable:o.enumerable,configurable:o.configurable})}}function r(t,r,o){const n=a(r,o);n&&e(t,r,o,n)}function o(t,r){const o=i(r);o&&bt(o).forEach(n=>e(t,r,n,o[n]))}!function t(e,n,i){for(const s of c(i)){const c=a(n,s);if(!c||c.get||c.set)continue;const p=`${e}.${s}`,l=i[s];if(!0===l)r(p,n,s);else if("*"===l)o(p,c.value);else{if(!ht(l))throw new TypeError("Unexpected override enablement plan "+p);t(p,c.value,l)}}}("root",t,Pt)}(T),zt(T),Wt=!0,!0}}const Ht=new WeakMap,Jt={constructor:tt,get globalThis(){return Ht.get(this).globalObject},get name(){return Ht.get(this).name},evaluate(t,o={}){if("string"!=typeof t)throw new TypeError("first argument of evaluate() must be a string");const{transforms:n=[],sloppyGlobalsMode:a=!1,__moduleShimLexicals__:c}=o,s=[...n],{globalTransforms:p,globalObject:l,globalLexicals:u}=Ht.get(this);let y=u;return void 0!==c&&(y=e(null,i(u)),r(y,i(c))),$t(t,l,y,{globalTransforms:p,localTransforms:s,sloppyGlobalsMode:a})},toString:()=>"[object Compartment]"};r(tt,{prototype:{value:Jt}});const Kt=(e,r,o)=>{function a(a={},i={},s={}){if(void 0===new.target)throw new TypeError("Class constructor Compartment cannot be invoked without 'new'");const{name:p="<unknown>",transforms:l=[],globalLexicals:u={}}=s,y=[...l],f={};Dt(f,r,G,e,this.constructor.prototype,{globalTransforms:y,nativeBrander:o}),t(f,a);const g=c(u).filter(t=>!vt(t));if(g.length)throw new Error(`Cannot create compartment with invalid names for global lexicals: ${g.join(", ")}; these names would not be lexically mentionable`);Ht.set(this,{name:p,globalTransforms:y,globalObject:f,globalLexicals:n({...u})})}return a.prototype=Jt,a},qt=C(),Qt=Kt(Kt,function(t){const e=Z();return e.addIntrinsics(X(t,G)),e.finalIntrinsics()}(globalThis),qt);t(globalThis,{harden:t=>(it(Wt,"Cannot harden before lockdown"),zt(t)),lockdown:((t,e,r)=>(e={})=>Yt(t,0,r,e)())(Kt,0,(function(){const t=Function.prototype.constructor,e=typeof Symbol&&Symbol.iterator||"@@iterator",r=typeof Symbol&&Symbol.matchAll||"@@matchAll",o=a(arguments,"callee").get,n=(new String)[e](),i=s(n),c=(new RegExp)[r](),p=s(c),l=(new Array)[e](),u=s(l),y=s(Float32Array),f=(new Map)[e](),g=s(f),m=(new Set)[e](),d=s(m),P=s(u);function*b(){}const h=et(b),S=h.prototype;async function*w(){}const E=et(w),I=E.prototype,T=I.prototype,A=s(T);async function v(){}const F=et(v),x={"%InertFunction%":t,"%ArrayIteratorPrototype%":u,"%InertAsyncFunction%":F,"%AsyncGenerator%":I,"%InertAsyncGeneratorFunction%":E,"%AsyncGeneratorPrototype%":T,"%AsyncIteratorPrototype%":A,"%Generator%":S,"%InertGeneratorFunction%":h,"%IteratorPrototype%":P,"%MapIteratorPrototype%":g,"%RegExpStringIteratorPrototype%":p,"%SetIteratorPrototype%":d,"%StringIteratorPrototype%":i,"%ThrowTypeError%":o,"%TypedArray%":y,"%InertCompartment%":tt};return x})),Compartment:Qt})}));

@@ -20,2 +20,3 @@ // Copyright (C) 2018 Agoric

import { getGlobalIntrinsics } from './src/intrinsics.js';
import { getAnonymousIntrinsics } from './src/get-anonymous-intrinsics.js';
import { makeLockdown, harden } from './src/lockdown-shim.js';

@@ -39,4 +40,8 @@ import {

harden,
lockdown: makeLockdown(makeCompartmentConstructor, CompartmentPrototype),
lockdown: makeLockdown(
makeCompartmentConstructor,
CompartmentPrototype,
getAnonymousIntrinsics,
),
Compartment,
});
{
"name": "ses",
"version": "0.10.3",
"version": "0.10.4",
"description": "Secure ECMAScript",

@@ -5,0 +5,0 @@ "author": "Agoric",

@@ -275,3 +275,18 @@ # Secure EcmaScript (SES)

### Imperfect emulation
JavaScript suffers from the so-called
[override mistake](https://web.archive.org/web/20141230041441/http://wiki.ecmascript.org/doku.php?id=strawman:fixing_override_mistake),
which prevents lockdown from *simply* hardening all the primordials. Rather,
for each of
[these data properties](src/enablements.js), we convert it to an accessor
property whose getter and setter emulate [a data property without the override
mistake](https://github.com/tc39/ecma262/pull/1320). For non-reflective code
the illusion is perfect. But reflective code sees that it is an accessor
rather than a data property. We add a `originalValue` property to the getter
of that accessor, letting reflective code know that a getter alleges that it
results from this transform, and what the original data value was. This enables
a form of cooperative emulation, where that code can decide whether to uphold
the illusion by pretending it sees the data property that would have been there.
## Bug Disclosure

@@ -278,0 +293,0 @@

@@ -18,2 +18,3 @@ // Copyright (C) 2018 Agoric

import { getGlobalIntrinsics } from './src/intrinsics.js';
import { getModularAnonymousIntrinsics } from './src/get-anonymous-intrinsics.js';
import { makeLockdown, harden } from './src/lockdown-shim.js';

@@ -44,2 +45,3 @@ import { whitelist, modulesWhitelist } from './src/whitelist.js';

CompartmentPrototype,
getModularAnonymousIntrinsics,
),

@@ -46,0 +48,0 @@ Compartment: ModularCompartment,

@@ -8,3 +8,3 @@ /**

* We capture these, not just for brevity, but for security. If any code
* modifies Object to change what 'assign' points to, the Compatment shim
* modifies Object to change what 'assign' points to, the Compartment shim
* would be corrupted.

@@ -11,0 +11,0 @@ */

// Adapted from SES/Caja
// Copyright (C) 2011 Google Inc.
// @ts-check
import {

@@ -9,6 +11,5 @@ defineProperty,

getOwnPropertyDescriptors,
objectHasOwnProperty,
} from './commons.js';
// https://github.com/google/caja/blob/master/src/com/google/caja/ses/startSES.js
// https://github.com/google/caja/blob/master/src/com/google/caja/ses/repairES5.js
import enablements from './enablements.js';

@@ -23,20 +24,54 @@

/**
* For a special set of properties (defined in the enablement plan), it ensures
* that the effect of freezing does not suppress the ability to override
* these properties on derived objects by simple assignment.
* For a special set of properties defined in the `enablement` whitelist,
* `enablePropertyOverrides` ensures that the effect of freezing does not
* suppress the ability to override these properties on derived objects by
* simple assignment.
*
* Because of lack of sufficient foresight at the time, ES5 unfortunately
* specified that a simple assignment to a non-existent property must fail if
* it would override a non-writable data property of the same name. (In
* retrospect, this was a mistake, but it is now too late and we must live
* with the consequences.) As a result, simply freezing an object to make it
* tamper proof has the unfortunate side effect of breaking previously correct
* code that is considered to have followed JS best practices, if this
* previous code used assignment to override.
* it would override an non-writable data property of the same name in the
* shadow of the prototype chain. In retrospect, this was a mistake, the
* so-called "override mistake". But it is now too late and we must live with
* the consequences.
*
* As a result, simply freezing an object to make it tamper proof has the
* unfortunate side effect of breaking previously correct code that is
* considered to have followed JS best practices, if this previous code used
* assignment to override.
*
* For the enabled properties, `enablePropertyOverrides` effectively shims what
* the assignment behavior would have been in the absence of the override
* mistake. However, the shim produces an imperfect emulation. It shims the
* behavior by turning these data properties into accessor properties, where
* the accessor's getter and setter provide the desired behavior. For
* non-reflective operations, the illusion is perfect. However, reflective
* operations like `getOwnPropertyDescriptor` see the descriptor of an accessor
* property rather than the descriptor of a data property. At the time of this
* writing, this is the best we know how to do.
*
* To the getter of the accessor we add a property named
* `'originalValue'` whose value is, as it says, the value that the
* data property had before being converted to an accessor property. We add
* this extra property to the getter for two reason:
*
* The harden algorithm walks the own properties reflectively, i.e., with
* `getOwnPropertyDescriptor` semantics, rather than `[[Get]]` semantics. When
* it sees an accessor property, it does not invoke the getter. Rather, it
* proceeds to walk both the getter and setter as part of its transitive
* traversal. Without this extra property, `enablePropertyOverrides` would have
* hidden the original data property value from `harden`, which would be bad.
* Instead, by exposing that value in an own data property on the getter,
* `harden` finds and walks it anyway.
*
* We enable a form of cooperative emulation, giving reflective code an
* opportunity to cooperate in upholding the illusion. When such cooperative
* reflective code sees an accessor property, where the accessor's getter
* has an `originalValue` property, it knows that the getter is
* alleging that it is the result of the `enablePropertyOverrides` conversion
* pattern, so it can decide to cooperatively "pretend" that it sees a data
* property with that value.
*
* @param {Record<string, any>} intrinsics
*/
// TODO exmplain parameters
export default function enablePropertyOverrides(intrinsics) {
const detachedProperties = {};
function enable(path, obj, prop, desc) {

@@ -46,7 +81,11 @@ if ('value' in desc && desc.configurable) {

detachedProperties[path] = value;
function getter() {
return value;
}
defineProperty(getter, 'originalValue', {
value,
writable: false,
enumerable: false,
configurable: false,
});

@@ -59,3 +98,3 @@ function setter(newValue) {

}
if (hasOwnProperty.call(this, prop)) {
if (objectHasOwnProperty(this, prop)) {
this[prop] = newValue;

@@ -125,4 +164,2 @@ } else {

enableProperties('root', intrinsics, enablements);
return detachedProperties;
}

@@ -67,3 +67,2 @@ /**

bind: true, // set by "underscore"
apply: true, // set by "tape"
name: true,

@@ -70,0 +69,0 @@ toString: true,

@@ -111,3 +111,2 @@ import { getOwnPropertyDescriptor, getPrototypeOf } from './commons.js';

'%InertCompartment%': InertCompartment,
'%InertStaticModuleRecord%': InertStaticModuleRecord,
};

@@ -117,1 +116,8 @@

}
export function getModularAnonymousIntrinsics() {
return {
...getAnonymousIntrinsics(),
'%InertStaticModuleRecord%': InertStaticModuleRecord,
};
}

@@ -30,3 +30,2 @@ // Copyright (C) 2018 Agoric

import tameLocaleMethods from './tame-locale-methods.js';
import { getAnonymousIntrinsics } from './get-anonymous-intrinsics.js';
import { initGlobalObject } from './global-object.js';

@@ -56,2 +55,3 @@ import { initialGlobalPropertyNames } from './whitelist.js';

compartmentPrototype,
getAnonymousIntrinsics,
options = {},

@@ -158,3 +158,3 @@ ) {

// Circumvent the override mistake.
const detachedProperties = enablePropertyOverrides(intrinsics);
enablePropertyOverrides(intrinsics);

@@ -164,3 +164,2 @@ // Finally register and optionally freeze all the intrinsics. This

lockdownHarden(intrinsics);
lockdownHarden(detachedProperties);

@@ -183,2 +182,3 @@ // Having completed lockdown without failing, the user may now

compartmentPrototype,
getAnonymousIntrinsics,
) => {

@@ -189,2 +189,3 @@ const lockdown = (options = {}) => {

compartmentPrototype,
getAnonymousIntrinsics,
options,

@@ -191,0 +192,0 @@ );

Sorry, the diff of this file is not supported yet

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 too big to display

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc