Comparing version 0.12.3 to 0.12.4
@@ -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:s,getPrototypeOf:c,is:l,isExtensible:p,keys:u,prototype:y,seal:g,setPrototypeOf:f,values:d}=Object,m=Object.fromEntries||(t=>{const e={};for(const[r,o]of t)e[r]=o;return e}),b=(t,e,o)=>r(t,{[e]:o}),{apply:P,construct:h,get:S,set:E}=Reflect,{isArray:w,prototype:T}=Array,{revocable:v}=Proxy,{prototype:I}=RegExp,{prototype:A}=String,{prototype:k}=WeakMap,_=t=>(e,...r)=>P(t,e,r),F=_(y.hasOwnProperty),x=(_(T.filter),_(T.join)),U=(_(T.push),_(T.pop)),R=_(T.includes),O=_(I.test),$=(_(A.match),_(A.search)),M=_(A.slice),C=_(A.split),N=(_(k.get),_(k.set),_(k.has),n({__proto__:null}));let L;function j(){if(void 0===L){const t=new WeakSet,e=Function.prototype.toString,r={toString(){const r=P(e,this,[]);return r.endsWith(") { [native code] }")||!t.has(this)?r:`function ${this.name}() { [native code] }`}};b(Function.prototype,"toString",{value:r.toString}),L=n(e=>t.add(e))}return L}const G={Infinity:1/0,NaN:NaN,undefined:void 0},B={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"},D={Date:"%InitialDate%",Error:"%InitialError%",RegExp:"%InitialRegExp%",Math:"%InitialMath%",getStackString:"%InitialGetStackString%"},W={Date:"%SharedDate%",Error:"%SharedError%",RegExp:"%SharedRegExp%",Math:"%SharedMath%"},z=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError],V={"[[Proto]]":"%FunctionPrototype%",length:"number",name:"string"},H=V,Y={get:H,set:"undefined"},q={get:H,set:H};function J(t){return t===Y||t===q}function Z(t){return{"[[Proto]]":"%SharedError%",prototype:t}}function K(t){return{"[[Proto]]":"%ErrorPrototype%",constructor:t,message:"string",name:"string",toString:!1}}function Q(t){return{"[[Proto]]":"%TypedArray%",BYTES_PER_ELEMENT:"number",prototype:t}}function X(t){return{"[[Proto]]":"%TypedArrayPrototype%",BYTES_PER_ELEMENT:"number",constructor:t}}const tt={E:"number",LN10:"number",LN2:"number",LOG10E:"number",LOG2E:"number",PI:"number",SQRT1_2:"number",SQRT2:"number","@@toStringTag":"string",abs:H,acos:H,acosh:H,asin:H,asinh:H,atan:H,atanh:H,atan2:H,cbrt:H,ceil:H,clz32:H,cos:H,cosh:H,exp:H,expm1:H,floor:H,fround:H,hypot:H,imul:H,log:H,log1p:H,log10:H,log2:H,max:H,min:H,pow:H,round:H,sign:H,sin:H,sinh:H,sqrt:H,tan:H,tanh:H,trunc:H,idiv:!1,idivmod:!1,imod:!1,imuldiv:!1,irem:!1,mod:!1},et={"[[Proto]]":null,"%ThrowTypeError%":H,Infinity:"number",NaN:"number",undefined:"undefined","%UniqueEval%":H,isFinite:H,isNaN:H,parseFloat:H,parseInt:H,decodeURI:H,decodeURIComponent:H,encodeURI:H,encodeURIComponent:H,Object:{"[[Proto]]":"%FunctionPrototype%",assign:H,create:H,defineProperties:H,defineProperty:H,entries:H,freeze:H,fromEntries:H,getOwnPropertyDescriptor:H,getOwnPropertyDescriptors:H,getOwnPropertyNames:H,getOwnPropertySymbols:H,getPrototypeOf:H,is:H,isExtensible:H,isFrozen:H,isSealed:H,keys:H,preventExtensions:H,prototype:"%ObjectPrototype%",seal:H,setPrototypeOf:H,values:H},"%ObjectPrototype%":{"[[Proto]]":null,constructor:"Object",hasOwnProperty:H,isPrototypeOf:H,propertyIsEnumerable:H,toLocaleString:H,toString:H,valueOf:H,"--proto--":q,__defineGetter__:H,__defineSetter__:H,__lookupGetter__:H,__lookupSetter__:H},"%UniqueFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%InertFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%FunctionPrototype%":{apply:H,bind:H,call:H,constructor:"%InertFunction%",toString:H,"@@hasInstance":H,caller:!1,arguments:!1},Boolean:{"[[Proto]]":"%FunctionPrototype%",prototype:"%BooleanPrototype%"},"%BooleanPrototype%":{constructor:"Boolean",toString:H,valueOf:H},Symbol:{"[[Proto]]":"%FunctionPrototype%",asyncIterator:"symbol",for:H,hasInstance:"symbol",isConcatSpreadable:"symbol",iterator:"symbol",keyFor:H,match:"symbol",matchAll:"symbol",prototype:"%SymbolPrototype%",replace:"symbol",search:"symbol",species:"symbol",split:"symbol",toPrimitive:"symbol",toStringTag:"symbol",unscopables:"symbol"},"%SymbolPrototype%":{constructor:"Symbol",description:Y,toString:H,valueOf:H,"@@toPrimitive":H,"@@toStringTag":"string"},"%InitialError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:H,stackTraceLimit:q,prepareStackTrace:q},"%SharedError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:H,stackTraceLimit:q,prepareStackTrace:q},"%ErrorPrototype%":{constructor:"%SharedError%",message:"string",name:"string",toString:H},EvalError:Z("%EvalErrorPrototype%"),RangeError:Z("%RangeErrorPrototype%"),ReferenceError:Z("%ReferenceErrorPrototype%"),SyntaxError:Z("%SyntaxErrorPrototype%"),TypeError:Z("%TypeErrorPrototype%"),URIError:Z("%URIErrorPrototype%"),"%EvalErrorPrototype%":K("EvalError"),"%RangeErrorPrototype%":K("RangeError"),"%ReferenceErrorPrototype%":K("ReferenceError"),"%SyntaxErrorPrototype%":K("SyntaxError"),"%TypeErrorPrototype%":K("TypeError"),"%URIErrorPrototype%":K("URIError"),Number:{"[[Proto]]":"%FunctionPrototype%",EPSILON:"number",isFinite:H,isInteger:H,isNaN:H,isSafeInteger:H,MAX_SAFE_INTEGER:"number",MAX_VALUE:"number",MIN_SAFE_INTEGER:"number",MIN_VALUE:"number",NaN:"number",NEGATIVE_INFINITY:"number",parseFloat:H,parseInt:H,POSITIVE_INFINITY:"number",prototype:"%NumberPrototype%"},"%NumberPrototype%":{constructor:"Number",toExponential:H,toFixed:H,toLocaleString:H,toPrecision:H,toString:H,valueOf:H},BigInt:{"[[Proto]]":"%FunctionPrototype%",asIntN:H,asUintN:H,prototype:"%BigIntPrototype%",bitLength:!1,fromArrayBuffer:!1},"%BigIntPrototype%":{constructor:"BigInt",toLocaleString:H,toString:H,valueOf:H,"@@toStringTag":"string"},"%InitialMath%":{...tt,random:H},"%SharedMath%":tt,"%InitialDate%":{"[[Proto]]":"%FunctionPrototype%",now:H,parse:H,prototype:"%DatePrototype%",UTC:H},"%SharedDate%":{"[[Proto]]":"%FunctionPrototype%",now:H,parse:H,prototype:"%DatePrototype%",UTC:H},"%DatePrototype%":{constructor:"%SharedDate%",getDate:H,getDay:H,getFullYear:H,getHours:H,getMilliseconds:H,getMinutes:H,getMonth:H,getSeconds:H,getTime:H,getTimezoneOffset:H,getUTCDate:H,getUTCDay:H,getUTCFullYear:H,getUTCHours:H,getUTCMilliseconds:H,getUTCMinutes:H,getUTCMonth:H,getUTCSeconds:H,setDate:H,setFullYear:H,setHours:H,setMilliseconds:H,setMinutes:H,setMonth:H,setSeconds:H,setTime:H,setUTCDate:H,setUTCFullYear:H,setUTCHours:H,setUTCMilliseconds:H,setUTCMinutes:H,setUTCMonth:H,setUTCSeconds:H,toDateString:H,toISOString:H,toJSON:H,toLocaleDateString:H,toLocaleString:H,toLocaleTimeString:H,toString:H,toTimeString:H,toUTCString:H,valueOf:H,"@@toPrimitive":H,getYear:H,setYear:H,toGMTString:H},String:{"[[Proto]]":"%FunctionPrototype%",fromCharCode:H,fromCodePoint:H,prototype:"%StringPrototype%",raw:H,fromArrayBuffer:!1},"%StringPrototype%":{length:"number",charAt:H,charCodeAt:H,codePointAt:H,concat:H,constructor:"String",endsWith:H,includes:H,indexOf:H,lastIndexOf:H,localeCompare:H,match:H,matchAll:H,normalize:H,padEnd:H,padStart:H,repeat:H,replace:H,replaceAll:H,search:H,slice:H,split:H,startsWith:H,substring:H,toLocaleLowerCase:H,toLocaleUpperCase:H,toLowerCase:H,toString:H,toUpperCase:H,trim:H,trimEnd:H,trimStart:H,valueOf:H,"@@iterator":H,substr:H,anchor:H,big:H,blink:H,bold:H,fixed:H,fontcolor:H,fontsize:H,italics:H,link:H,small:H,strike:H,sub:H,sup:H,trimLeft:H,trimRight:H,compare:!1},"%StringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},"%InitialRegExp%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%RegExpPrototype%","@@species":Y,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":Y},"%RegExpPrototype%":{constructor:"%SharedRegExp%",exec:H,dotAll:Y,flags:Y,global:Y,ignoreCase:Y,"@@match":H,"@@matchAll":H,multiline:Y,"@@replace":H,"@@search":H,source:Y,"@@split":H,sticky:Y,test:H,toString:H,unicode:Y,compile:!1},"%RegExpStringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},Array:{"[[Proto]]":"%FunctionPrototype%",from:H,isArray:H,of:H,prototype:"%ArrayPrototype%","@@species":Y},"%ArrayPrototype%":{length:"number",concat:H,constructor:"Array",copyWithin:H,entries:H,every:H,fill:H,filter:H,find:H,findIndex:H,flat:H,flatMap:H,forEach:H,includes:H,indexOf:H,join:H,keys:H,lastIndexOf:H,map:H,pop:H,push:H,reduce:H,reduceRight:H,reverse:H,shift:H,slice:H,some:H,sort:H,splice:H,toLocaleString:H,toString:H,unshift:H,values:H,"@@iterator":H,"@@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:H,"@@toStringTag":"string"},"%TypedArray%":{"[[Proto]]":"%FunctionPrototype%",from:H,of:H,prototype:"%TypedArrayPrototype%","@@species":Y},"%TypedArrayPrototype%":{buffer:Y,byteLength:Y,byteOffset:Y,constructor:"%TypedArray%",copyWithin:H,entries:H,every:H,fill:H,filter:H,find:H,findIndex:H,forEach:H,includes:H,indexOf:H,join:H,keys:H,lastIndexOf:H,length:Y,map:H,reduce:H,reduceRight:H,reverse:H,set:H,slice:H,some:H,sort:H,subarray:H,toLocaleString:H,toString:H,values:H,"@@iterator":H,"@@toStringTag":Y},BigInt64Array:Q("%BigInt64ArrayPrototype%"),BigUint64Array:Q("%BigUint64ArrayPrototype%"),Float32Array:Q("%Float32ArrayPrototype%"),Float64Array:Q("%Float64ArrayPrototype%"),Int16Array:Q("%Int16ArrayPrototype%"),Int32Array:Q("%Int32ArrayPrototype%"),Int8Array:Q("%Int8ArrayPrototype%"),Uint16Array:Q("%Uint16ArrayPrototype%"),Uint32Array:Q("%Uint32ArrayPrototype%"),Uint8Array:Q("%Uint8ArrayPrototype%"),Uint8ClampedArray:Q("%Uint8ClampedArrayPrototype%"),"%BigInt64ArrayPrototype%":X("BigInt64Array"),"%BigUint64ArrayPrototype%":X("BigUint64Array"),"%Float32ArrayPrototype%":X("Float32Array"),"%Float64ArrayPrototype%":X("Float64Array"),"%Int16ArrayPrototype%":X("Int16Array"),"%Int32ArrayPrototype%":X("Int32Array"),"%Int8ArrayPrototype%":X("Int8Array"),"%Uint16ArrayPrototype%":X("Uint16Array"),"%Uint32ArrayPrototype%":X("Uint32Array"),"%Uint8ArrayPrototype%":X("Uint8Array"),"%Uint8ClampedArrayPrototype%":X("Uint8ClampedArray"),Map:{"[[Proto]]":"%FunctionPrototype%","@@species":Y,prototype:"%MapPrototype%"},"%MapPrototype%":{clear:H,constructor:"Map",delete:H,entries:H,forEach:H,get:H,has:H,keys:H,set:H,size:Y,values:H,"@@iterator":H,"@@toStringTag":"string"},"%MapIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},Set:{"[[Proto]]":"%FunctionPrototype%",prototype:"%SetPrototype%","@@species":Y},"%SetPrototype%":{add:H,clear:H,constructor:"Set",delete:H,entries:H,forEach:H,has:H,keys:H,size:Y,values:H,"@@iterator":H,"@@toStringTag":"string"},"%SetIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},WeakMap:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakMapPrototype%"},"%WeakMapPrototype%":{constructor:"WeakMap",delete:H,get:H,has:H,set:H,"@@toStringTag":"string"},WeakSet:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakSetPrototype%"},"%WeakSetPrototype%":{add:H,constructor:"WeakSet",delete:H,has:H,"@@toStringTag":"string"},ArrayBuffer:{"[[Proto]]":"%FunctionPrototype%",isView:H,prototype:"%ArrayBufferPrototype%","@@species":Y,fromString:!1,fromBigInt:!1},"%ArrayBufferPrototype%":{byteLength:Y,constructor:"ArrayBuffer",slice:H,"@@toStringTag":"string",concat:!1},SharedArrayBuffer:!1,"%SharedArrayBufferPrototype%":!1,DataView:{"[[Proto]]":"%FunctionPrototype%",BYTES_PER_ELEMENT:"number",prototype:"%DataViewPrototype%"},"%DataViewPrototype%":{buffer:Y,byteLength:Y,byteOffset:Y,constructor:"DataView",getBigInt64:H,getBigUint64:H,getFloat32:H,getFloat64:H,getInt8:H,getInt16:H,getInt32:H,getUint8:H,getUint16:H,getUint32:H,setBigInt64:H,setBigUint64:H,setFloat32:H,setFloat64:H,setInt8:H,setInt16:H,setInt32:H,setUint8:H,setUint16:H,setUint32:H,"@@toStringTag":"string"},Atomics:!1,JSON:{parse:H,stringify:H,"@@toStringTag":"string"},"%IteratorPrototype%":{"@@iterator":H},"%AsyncIteratorPrototype%":{"@@asyncIterator":H},"%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:H,return:H,throw:H,"@@toStringTag":"string"},"%AsyncGeneratorPrototype%":{"[[Proto]]":"%AsyncIteratorPrototype%",constructor:"%AsyncGenerator%",next:H,return:H,throw:H,"@@toStringTag":"string"},HandledPromise:{"[[Proto]]":"Promise",applyFunction:H,applyFunctionSendOnly:H,applyMethod:H,applyMethodSendOnly:H,get:H,getSendOnly:H,prototype:"%PromisePrototype%",resolve:H},Promise:{"[[Proto]]":"%FunctionPrototype%",all:H,allSettled:H,any:!1,prototype:"%PromisePrototype%",race:H,reject:H,resolve:H,"@@species":Y},"%PromisePrototype%":{catch:H,constructor:"Promise",finally:H,then:H,"@@toStringTag":"string"},"%InertAsyncFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%AsyncFunctionPrototype%"},"%AsyncFunctionPrototype%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertAsyncFunction%","@@toStringTag":"string"},Reflect:{apply:H,construct:H,defineProperty:H,deleteProperty:H,get:H,getOwnPropertyDescriptor:H,getPrototypeOf:H,has:H,isExtensible:H,ownKeys:H,preventExtensions:H,set:H,setPrototypeOf:H,"@@toStringTag":"string"},Proxy:{"[[Proto]]":"%FunctionPrototype%",revocable:H},escape:H,unescape:H,"%UniqueCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:H},"%InertCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:H},"%CompartmentPrototype%":{constructor:"%InertCompartment%",evaluate:H,globalThis:Y,name:Y,toString:H},lockdown:H,harden:H,"%InitialGetStackString%":H};function rt(t,e,r){if(F(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)}b(t,e,r)}function ot(t,e){const r={__proto__:null};for(const[n,a]of o(e))F(t,n)&&(r[a]=t[n]);return r}function nt(){const t={__proto__:null};let e;const r={addIntrinsics(e){!function(t,e){for(const[r,n]of o(e))rt(t,r,n)}(t,i(e))},completePrototypes(){for(const[e,r]of o(t)){if(r!==Object(r))continue;if(!F(r,"prototype"))continue;const o=et[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||!F(et,n))throw new Error(`Unrecognized ${e}.prototype whitelist entry`);const a=r.prototype;if(F(t,n)){if(t[n]!==a)throw new Error("Conflicting bindings of "+n)}else t[n]=a}},finalIntrinsics:()=>(n(t),e=new WeakSet(d(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(G),r.addIntrinsics(ot(globalThis,B)),r}const at=function(t={},e={},r={}){throw new TypeError("Not available")};function it(t){return c(t).constructor}const{freeze:st,getOwnPropertyDescriptors:ct,getPrototypeOf:lt}=Object,{ownKeys:pt}=Reflect;const{apply:ut,ownKeys:yt}=Reflect,gt=(t=>(e,...r)=>ut(t,e,r))(Object.prototype.hasOwnProperty);function ft(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 dt(t,e){const r=["undefined","boolean","number","string","symbol"];function o(e,o,n,a){if("object"==typeof a)return s(e,o,a),!0;if(!1===a)return!1;if("string"==typeof a)if("prototype"===n||"constructor"===n){if(gt(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(gt(i,"value")){if(J(n))throw new TypeError("Accessor expected at "+t);return o(t,i.value,r,n)}if(!J(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 gt(r,n)?r[n]:"function"==typeof t&&(e(t),gt(V,n))?V[n]:void 0}function s(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=c(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 yt(r)){const a=ft(e,t),s=`${e}.${a}`,c=i(r,o,a);if(!c||!n(s,r,t,c)){!1!==c&&console.log("Removing "+s);try{delete r[t]}catch(e){throw t in r?console.error("failed to delete "+s,e):console.error(`deleting ${s} threw`,e),e}}}}s("intrinsics",t,et)}const mt={"%ObjectPrototype%":{hasOwnProperty:!0,toString:!0,valueOf:!0},"%ArrayPrototype%":{toString:!0},"%FunctionPrototype%":{constructor:!0,bind:!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%":{toString:!0},"%Generator%":{constructor:!0,name:!0,toString:!0},"%IteratorPrototype%":{toString:!0}},bt={"%ObjectPrototype%":{toString:!0},"%FunctionPrototype%":{toString:!0},"%ErrorPrototype%":{name:!0}},{ownKeys:Pt}=Reflect;function ht(t){return null!==t&&"object"==typeof t}const St=t=>(t=""+t).length>=1&&"aeiouAEIOU".includes(t[0])?"an "+t:"a "+t;n(St);const Et=(t,e)=>{const r=new Set;return JSON.stringify(t,(t,e)=>{switch(typeof e){case"object":return null===e?null:r.has(e)?"[Seen]":(r.add(e),Promise.resolve(e)===e?"[Promise]":e instanceof Error?`[${e.name}: ${e.message}]`:0===Object.keys(e).length&&Symbol.toStringTag in e?`[${e[Symbol.toStringTag]}]`:e);case"function":return`[Function ${e.name||"<anon>"}]`;case"string":return e.startsWith("[")?`[${e}]`:e;case"undefined":case"symbol":return`[${String(e)}]`;case"bigint":return`[${e}n]`;case"number":return Object.is(e,NaN)?"[NaN]":e===1/0?"[Infinity]":e===-1/0?"[-Infinity]":e;default:return e}},e)};n(Et);const wt=new WeakMap,Tt=(t,e)=>{const r=n({toString:n(()=>Et(t,e))});return wt.set(r,t),r};n(Tt);const vt=new WeakMap,It=(t,...e)=>{const r=n({__proto__:null});return vt.set(r,{template:t,args:e}),r};n(It);const At=({template:t,args:e})=>{const r=[t[0]];for(let o=0;o<e.length;o+=1){let n=e[o];wt.has(n)&&(n=wt.get(n));const a=(r.pop()||"").replace(/ $/,"");""!==a&&r.push(a);const i=t[o+1].replace(/^ /,"");r.push(n,i)}return""===r[r.length-1]&&r.pop(),r},kt=new WeakMap,_t=(t=It`Assert failed`,e=Error)=>{"string"==typeof t&&(t=It([t]));const r=vt.get(t);if(void 0===r)throw new Error("unrecognized details "+t);const o=new e((({template:t,args:e})=>{const r=[t[0]];for(let o=0;o<e.length;o+=1){const n=e[o];let a;a=wt.has(n)?""+n:n instanceof Error?`(${St(n.name)})`:`(${St(typeof n)})`,r.push(a,t[o+1])}return r.join("")})(r));return kt.set(o,At(r)),o};n(_t);const Ft=new WeakMap,xt=new WeakMap,Ut=(t,e)=>{"string"==typeof e&&(e=It([e]));const r=vt.get(e);if(void 0===r)throw new Error("unrecognized details "+e);const o=At(r),n=xt.get(t);if(void 0!==n)for(const e of n)e(t,o);else{const e=Ft.get(t);void 0!==e?e.push(o):Ft.set(t,[o])}};n(Ut);const Rt={getStackString:globalThis.getStackString||(t=>{if(!("stack"in t))return"";const e=""+t.stack,r=e.indexOf("\n");return e.startsWith(" ")||-1===r?e:e.slice(r+1)}),takeMessageLogArgs:t=>{const e=kt.get(t);return kt.delete(t),e},takeNoteLogArgsArray:(t,e)=>{const r=Ft.get(t);if(Ft.delete(t),void 0!==e){const r=xt.get(t);r?r.push(e):xt.set(t,[e])}return r||[]}};n(Rt);const Ot=e=>{const r=(t=It`Assert failed`,r=Error)=>{const o=_t(t,r);throw void 0!==e&&e(o),o};function o(t,e=It`Check failed`,o=Error){if(!t)throw r(e,o)}n(r);const a=(t,e,r=It`Expected ${t} is same as ${e}`,n=RangeError)=>{o(l(t,e),r,n)};n(a);const i=(t,e,r)=>{o("string"==typeof e,It`${Tt(e)} must be a string`),void 0===r&&(r=It([""," must be "+St(e)],t)),a(typeof t,e,r,TypeError)};n(i);const s=t(o,{error:_t,fail:r,equal:a,typeof:i,string:(t,e)=>i(t,"string",e),note:Ut,details:It,quote:Tt,makeAssert:Ot});return n(s)};n(Ot);const $t=Ot(),{details:Mt,quote:Ct}=$t,Nt=/^(\w*[a-z])Locale([A-Z]\w*)$/,Lt={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:($t(e===t,Mt`expected ${Ct(e)} and ${Ct(t)} to compare`),0)}}.localeCompare;const jt=["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"],Gt=new RegExp("^[a-zA-Z_$][\\w$]*$");function Bt(t){return"eval"!==t&&!R(jt,t)&&O(Gt,t)}function Dt(t,e){const r=a(t,e);return!1===r.configurable&&!1===r.writable&&F(r,"value")}const{details:Wt,quote:zt}=$t,Vt=eval,Ht=new Proxy(N,{get(t,e){$t.fail(Wt`Please report unexpected scope handler trap: ${zt(String(e))}`)}});const Yt=new RegExp("(?:\\s*//\\s*[@#]\\s*([a-zA-Z][a-zA-Z0-9]*)\\s*=\\s*([^\\s\\*]*)|/\\*\\s*[@#]\\s*([a-zA-Z][a-zA-Z0-9]*)\\s*=\\s*([^\\s\\*]*)\\s*\\*/)\\s*$");function qt(t){let e="<unknown>";for(;t.length>0;){const r=Yt.exec(t);if(null===r)break;t=t.slice(0,t.length-r[0].length),"sourceURL"===r[3]?e=r[4]:"sourceURL"===r[1]&&(e=r[2])}return e}function Jt(t,e){const r=$(t,e);return r<0?-1:C(M(t,0,r),"\n").length}const Zt=new RegExp("(?:\x3c!--|--\x3e)","g");function Kt(t){return t.replace(Zt,t=>"<"===t[0]?"< ! --":"-- >")}const Qt=new RegExp("\\bimport(\\s*(?:\\(|/[/*]))","g");function Xt(t){return t.replace(Qt,(t,e)=>"__import__"+e)}const te=new RegExp("\\beval(\\s*\\()","g");function ee(t){const e=Jt(t,te);if(e<0)return t;const r=qt(t);throw new SyntaxError(`Possible direct eval expression rejected at ${r}:${e}. (SES_EVAL_REJECTED)`)}function re(t){return t=function(t){const e=Jt(t,Qt);if(e<0)return t;const r=qt(t);throw new SyntaxError(`Possible import expression rejected at ${r}:${e}. (SES_IMPORT_REJECTED)`)}(t=function(t){const e=Jt(t,Zt);if(e<0)return t;const r=qt(t);throw new SyntaxError(`Possible HTML comment rejected at ${r}:${e}. (SES_HTML_COMMENT_REJECTED)`)}(t))}const oe=Function;function ne(t=[]){const e=function(t){return 0===t.length?"":`const {${x(t,",")}} = this;`}(t);return oe(`\n with (this) {\n ${e}\n return function() {\n 'use strict';\n return eval(arguments[0]);\n };\n }\n `)}const{details:ae}=$t;function ie(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,re]);const c=function(t,e={},{sloppyGlobalsMode:r=!1}={}){return{__proto__:Ht,useUnsafeEvaluator:!1,get(r,o){if("symbol"!=typeof o)return"eval"===o&&!0===this.useUnsafeEvaluator?(this.useUnsafeEvaluator=!1,Vt):o in e?S(e,o,t):S(t,o)},set(r,o,n){if(o in e){return"value"in a(e,o)?E(e,o,n):E(e,o,n,t)}return E(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}),l=v(N,c),p=ne(function(t,e={}){const r=s(t),o=s(e),n=o.filter(t=>Bt(t)&&Dt(e,t));return[...r.filter(e=>!o.includes(e)&&Bt(e)&&Dt(t,e)),...n]}(e,r)),u=P(p,l.proxy,[]);let y;c.useUnsafeEvaluator=!0;try{return P(u,e,[t])}catch(t){throw y=t,t}finally{!0===c.useUnsafeEvaluator&&(l.revoke(),$t.fail(ae`handler did not revoke useUnsafeEvaluator ${y}`))}}const se=(t,e={})=>r=>"string"!=typeof r?r:ie(r,t,{},e),ce=Function;function le(t,e={}){const o=function(r){const o=""+(U(arguments)||""),n=""+x(arguments,",");new ce(n,o);const a=`(function anonymous(${n}\n) {\n${o}\n})`;return ie(a,t,{},e)};return r(o,{prototype:{value:Function.prototype,writable:!1,enumerable:!1,configurable:!1}}),$t(c(Function)===Function.prototype,"Function prototype is the same accross compartments"),$t(c(o)===Function.prototype,"Function constructor prototype is the same accross compartments"),o}function pe(t,e,r,n,a,{globalTransforms:i,nativeBrander:s}){for(const[e,r]of o(G))b(t,e,{value:r,writable:!1,enumerable:!1,configurable:!1});for(const[r,n]of o(B))F(e,n)&&b(t,r,{value:e[n],writable:!0,enumerable:!1,configurable:!0});for(const[n,a]of o(r))F(e,a)&&b(t,n,{value:e[a],writable:!0,enumerable:!1,configurable:!0});const c={globalThis:t,eval:se(t,{globalTransforms:i}),Function:le(t,{globalTransforms:i})};c.Compartment=n(n,e,s);for(const[e,r]of o(c))b(t,e,{value:r,writable:!0,enumerable:!1,configurable:!0}),"function"==typeof r&&s(r)}const ue=n([["debug","debug"],["log","log"],["info","info"],["warn","warn"],["error","error"],["trace","log"],["dirxml","log"],["group","log"],["groupCollapsed","log"]]),ye=n([["assert","error"],["timeLog","log"],["clear",void 0],["count","info"],["countReset",void 0],["dir","log"],["groupEnd","log"],["table","log"],["time","info"],["timeEnd","info"],["profile",void 0],["profileEnd",void 0],["timeStamp",void 0]]),ge=n([...ue,...ye]);n(()=>{let t=[];const e=m(ge.map(([e,r])=>{const o=(...r)=>{t.push([e,...r])};return b(o,"name",{value:e}),[e,n(o)]}));n(e);const r=()=>{const e=n(t);return t=[],e};n(r);return n({loggingConsole:e,takeLog:r})});const fe={NOTE:"ERROR_NOTE:",MESSAGE:"ERROR_MESSAGE:"};n(fe);const de=(t,e)=>{const{getStackString:r,takeMessageLogArgs:o,takeNoteLogArgsArray:a}=e;let i=0;const s=new WeakMap,c=t=>{let e;return s.has(t)?e=s.get(t):(i+=1,s.set(t,i),e=i),`${t.name}#${e}`},l=(t,e)=>t.map(t=>t instanceof Error?(e.push(t),`(${c(t)})`):t),p=(e,r,o,n)=>{const a=c(e),i=r===fe.MESSAGE?a+":":`${a} ${r}`,s=l(o,n);t.debug(i,...s)},u=(e,r)=>{if(0===e.length)return;if(1===e.length&&void 0===r)return void f(e[0]);let o;o=1===e.length?"Nested error":`Nested ${e.length} errors`,void 0!==r&&(o=`${o} under ${r}`),t.group(o);try{for(const t of e)f(t)}finally{t.groupEnd()}},y=new WeakSet,g=(t,e)=>{const r=[];p(t,fe.NOTE,e,r),u(r,c(t))},f=e=>{if(y.has(e))return;const n=c(e);y.add(e);const i=[],s=o(e),l=a(e,g);void 0===s?t.debug(n+":",e.message):p(e,fe.MESSAGE,s,i);let f=r(e);"string"==typeof f&&f.length>=1&&!f.endsWith("\n")&&(f+="\n"),t.debug(f);for(const t of l)p(e,fe.NOTE,t,i);u(i,n)},d=ue.map(([e,r])=>{const o=(...r)=>{const o=[],n=l(r,o);t[e](...n),u(o)};return b(o,"name",{value:e}),[e,n(o)]}),P=ye.filter(([e,r])=>e in t).map(([e,r])=>{const o=(...r)=>{t[e](...r)};return b(o,"name",{value:e}),[e,n(o)]}),h=m([...d,...P]);return n(h)};n(de);n((t,e,r)=>{const o=ge.filter(([e,r])=>e in t).map(([r,o])=>[r,n((...n)=>{(void 0===o||e.canLog(o))&&t[r](...n)})]),a=m(o);return n(a)});const me=console,be=["getTypeName","getFunctionName","getMethodName","getFileName","getLineNumber","getColumnNumber","getEvalOrigin","isToplevel","isEval","isNative","isConstructor","isAsync","getPosition","getScriptNameOrSourceURL","toString"],Pe=t=>{const e=m(be.map(e=>[e,()=>t[e]()]));return Object.create(e,{})},he=[/\/node_modules\//,/^(?:node:)?internal\//,/\/packages\/ses\/src\/error\/assert.js$/,/\/packages\/eventual-send\/src\//],Se=[/^((?:.*[( ])?)[:/\w_-]*\/\.\.\.\/(.+)$/,/^((?:.*[( ])?)[:/\w_-]*\/(packages\/.+)$/];function Ee(t,e,o,n){const a=t=>"verbose"===n||(t=>{if(!t)return!0;for(const e of he)if(e.test(t))return!1;return!0})(t.getFileName()),i=t=>{let e=""+t;return"concise"===n&&(e=(t=>{for(const e of Se){const r=e.exec(t);if(r)return r.slice(1).join("")}return t})(e)),"\n at "+e},s=(t,e)=>[...e.filter(a).map(i)].join(""),c=new WeakMap,l={captureStackTrace(e,r=l.captureStackTrace){"function"!=typeof t.captureStackTrace?Reflect.set(e,"stack",""):t.captureStackTrace(e,r)},getStackString(t){c.has(t)||t.stack;const e=c.get(t);return e?s(0,e):""},prepareStackTrace(t,e){if(c.set(t,e),"unsafe"===o){return`${t}${s(0,e)}`}return""}},p=l.prepareStackTrace;t.prepareStackTrace=p;const u=new WeakSet([p]),y=t=>{if(u.has(t))return t;const e={prepareStackTrace:(e,r)=>(c.set(e,r),t(e,(t=>t.map(Pe))(r)))};return u.add(e.prepareStackTrace),e.prepareStackTrace};return r(e,{captureStackTrace:{value:l.captureStackTrace,writable:!0,enumerable:!1,configurable:!0},prepareStackTrace:{get:()=>t.prepareStackTrace,set(e){if("function"==typeof e){const r=y(e);t.prepareStackTrace=r}else t.prepareStackTrace=p},enumerable:!1,configurable:!0}}),l.getStackString}const we=a(Error.prototype,"stack"),Te=we&&we.get,ve={getStackString:t=>"function"==typeof Te?P(Te,t,[]):"stack"in t?""+t.stack:""};const{details:Ie,quote:Ae}=$t;let ke,_e=!1;const Fe=function(){const t=new WeakSet,{harden:e}={harden(e){const r=new Set,o=new WeakMap;function n(e,n){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),o.set(e,n))}function a(t){st(t);const e=o.get(t)||"unknown",r=ct(t);n(lt(t),e+".__proto__"),pt(r).forEach(t=>{const o=`${e}.${String(t)}`,a=r[t];"value"in a?n(a.value,""+o):(n(a.get,o+"(get)"),n(a.set,o+"(set)"))})}return n(e),r.forEach(a),r.forEach(t.add,t),e}};return e}(),xe=()=>!1;function Ue(t,o,n,l={}){l={...ke,...l};const{dateTaming:p="safe",errorTaming:g="safe",mathTaming:d="safe",regExpTaming:m="safe",localeTaming:S="safe",consoleTaming:E="safe",overrideTaming:w="moderate",stackFiltering:T="concise",...v}=l,I=Reflect.ownKeys(v);if($t(0===I.length,Ie`lockdown(): non supported option ${Ae(I)}`),ke){for(const t of u(ke))$t(l[t]===ke[t],Ie`lockdown(): cannot re-invoke with different option ${Ae(t)}`);return xe}ke={dateTaming:p,errorTaming:g,mathTaming:d,regExpTaming:m,localeTaming:S,consoleTaming:E,overrideTaming:w,stackFiltering:T};const A=nt();A.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=c(a),s=function(){throw new TypeError("Not available")};r(s,{prototype:{value:i},name:{value:e,writable:!1,enumerable:!1,configurable:!0}}),r(i,{constructor:{value:s}}),s!==Function.prototype.constructor&&f(s,Function.prototype.constructor),t[o]=s}return e("Function","%InertFunction%","(function(){})"),e("GeneratorFunction","%InertGeneratorFunction%","(function*(){})"),e("AsyncFunction","%InertAsyncFunction%","(async function(){})"),e("AsyncGeneratorFunction","%InertAsyncGeneratorFunction%","(async function*(){})"),t}()),A.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"}),s=a({power:"none"});return r(i,{now:{value:Date.now,writable:!0,enumerable:!1,configurable:!0}}),r(s,{now:{value:n.now,writable:!0,enumerable:!1,configurable:!0}}),r(o,{constructor:{value:s}}),{"%InitialDate%":i,"%SharedDate%":s}}(p)),A.addIntrinsics(function(t="safe",e="concise"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized errorTaming "+t);if("concise"!==e&&"verbose"!==e)throw new Error("unrecognized stackFiltering "+e);const o=Error,n=o.prototype,a="function"==typeof o.captureStackTrace?"v8":"unknown",i=(t={})=>{const e=function(...t){let r;return r=void 0===new.target?P(o,this,t):h(o,t,new.target),"v8"===a&&o.captureStackTrace(r,e),r};return r(e,{length:{value:1},prototype:{value:n,writable:!1,enumerable:!1,configurable:!1}}),e},s=i({powers:"original"}),c=i({powers:"none"});r(n,{constructor:{value:c}});for(const t of z)f(t,c);r(s,{stackTraceLimit:{get(){if("number"==typeof o.stackTraceLimit)return o.stackTraceLimit},set(t){"number"==typeof t&&("number"!=typeof o.stackTraceLimit||(o.stackTraceLimit=t))},enumerable:!1,configurable:!0}}),r(c,{stackTraceLimit:{get(){},set(t){},enumerable:!1,configurable:!0}});let l=ve.getStackString;return"v8"===a&&(l=Ee(o,s,t,e)),{"%InitialGetStackString%":l,"%InitialError%":s,"%SharedError%":c}}(g,T)),A.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)}}(d)),A.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(),s=n();return"unsafe"!==t&&delete o.compile,r(o,{constructor:{value:s}}),{"%InitialRegExp%":i,"%SharedRegExp%":s}}(m)),A.addIntrinsics(n()),A.completePrototypes();const k=A.finalIntrinsics();let _;"unsafe"!==g&&(_=k["%InitialGetStackString%"]);const x=((t="safe",e)=>{if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized consoleTaming "+t);if("unsafe"===t)return{console:me};let r;r=void 0===e?Rt:{...Rt,getStackString:e};return{console:de(me,r)}})(E,_);globalThis.console=x.console,function(t,e="safe"){if("safe"!==e&&"unsafe"!==e)throw new Error("unrecognized dateTaming "+e);if("unsafe"!==e){b(String.prototype,"localeCompare",{value:Lt});for(const e of s(t)){const r=t[e];if(r===Object(r))for(const t of s(r)){const e=Nt.exec(t);if(e){$t("function"==typeof r[t],Mt`expected ${Ct(t)} to be a function`);const o=`${e[1]}${e[2]}`,n=r[o];$t("function"==typeof n,Mt`function ${Ct(o)} not found`),b(r,t,{value:n})}}}}}(k,S);const U=j();return dt(k,U),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(y,{__defineGetter__:{value:function(e,r){const n=t(this);b(n,e,{get:o(r,"getter"),enumerable:!0,configurable:!0})}},__defineSetter__:{value:function(e,r){const n=t(this);b(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=c(n);return o&&o.get}},__lookupSetter__:{value:function(r){let o,n=t(this);for(r=e(r);n&&!(o=a(n,r));)n=c(n);return o&&o.set}}})}(),pe(globalThis,k,D,t,0,{nativeBrander:U}),function(){return function(t,e){function r(t,e,r,o){if("value"in o&&o.configurable){const{value:a}=o;function n(){return a}b(n,"originalValue",{value:a,writable:!1,enumerable:!1,configurable:!1}),b(e,r,{get:n,set:function(o){if(e===this)throw new TypeError(`Cannot assign to read only property '${String(r)}' of '${t}'`);F(this,r)?this[r]=o:b(this,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},enumerable:o.enumerable,configurable:o.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&&Pt(o).forEach(n=>r(t,e,n,o[n]))}let c;switch(e){case"min":c=bt;break;case"moderate":c=mt;break;default:throw new Error("unrecognized overrideTaming "+e)}!function t(e,r,i){for(const c of s(i)){const s=a(r,c);if(!s||s.get||s.set)continue;const l=`${e}.${String(c)}`,p=i[c];if(!0===p)o(l,r,c);else if("*"===p)n(l,s.value);else{if(!ht(p))throw new TypeError("Unexpected override enablement plan "+l);t(l,s.value,p)}}}("root",t,c)}(k,w),Fe(k),_e=!0,!0}}const Re=new WeakMap,Oe={constructor:at,get globalThis(){return Re.get(this).globalObject},get name(){return Re.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__:s,__evadeHtmlCommentTest__:c=!1,__evadeImportExpressionTest__:l=!1,__rejectSomeDirectEvalExpressions__:p=!0}=o,u=[...n];!0===c&&u.push(Kt),!0===l&&u.push(Xt),!0===p&&u.push(ee);const y=Re.get(this);let{globalTransforms:g}=y;const{globalObject:f,globalLexicals:d}=y;let m=d;return void 0!==s&&(g=void 0,m=e(null,i(d)),r(m,i(s))),ie(t,f,m,{globalTransforms:g,localTransforms:u,sloppyGlobalsMode:a})},toString:()=>"[object Compartment]"};r(at,{prototype:{value:Oe}});const $e=(e,r,o)=>{function a(a={},i={},c={}){if(void 0===new.target)throw new TypeError("Class constructor Compartment cannot be invoked without 'new'");const{name:l="<unknown>",transforms:p=[],__shimTransforms__:u=[],globalLexicals:y={}}=c,g=[...p,...u],f={};pe(f,r,W,e,this.constructor.prototype,{globalTransforms:g,nativeBrander:o}),t(f,a);const d=s(y).filter(t=>!Bt(t));if(d.length)throw new Error(`Cannot create compartment with invalid names for global lexicals: ${d.join(", ")}; these names would not be lexically mentionable`);Re.set(this,{name:l,globalTransforms:g,globalObject:f,globalLexicals:n({...y})})}return a.prototype=Oe,a},Me=j(),Ce=$e($e,function(t){const e=nt();return e.addIntrinsics(ot(t,W)),e.finalIntrinsics()}(globalThis),Me);t(globalThis,{harden:t=>($t(_e,"Cannot harden before lockdown"),Fe(t)),lockdown:((t,e,r)=>(e={})=>Ue(t,0,r,e)())($e,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=c(n),s=RegExp.prototype[r]&&(new RegExp)[r](),l=s&&c(s),p=(new Array)[e](),u=c(p),y=c(Float32Array),g=(new Map)[e](),f=c(g),d=(new Set)[e](),m=c(d),b=c(u);function*P(){}const h=it(P),S=h.prototype;async function*E(){}const w=it(E),T=w.prototype,v=T.prototype,I=c(v);async function A(){}const k=it(A),_={"%InertFunction%":t,"%ArrayIteratorPrototype%":u,"%InertAsyncFunction%":k,"%AsyncGenerator%":T,"%InertAsyncGeneratorFunction%":w,"%AsyncGeneratorPrototype%":v,"%AsyncIteratorPrototype%":I,"%Generator%":S,"%InertGeneratorFunction%":h,"%IteratorPrototype%":b,"%MapIteratorPrototype%":f,"%RegExpStringIteratorPrototype%":l,"%SetIteratorPrototype%":m,"%StringIteratorPrototype%":i,"%ThrowTypeError%":o,"%TypedArray%":y,"%InertCompartment%":at};return _})),Compartment:Ce,assert:$t})})); | ||
!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:s,getPrototypeOf:c,is:p,isExtensible:l,keys:u,prototype:y,seal:g,setPrototypeOf:f,values:d}=Object,m=Object.fromEntries||(t=>{const e={};for(const[r,o]of t)e[r]=o;return e}),P=(t,e,o)=>r(t,{[e]:o}),{apply:b,construct:h,get:S,set:E}=Reflect,{isArray:w,prototype:T}=Array,{revocable:I}=Proxy,{prototype:v}=RegExp,{prototype:A}=String,{prototype:k}=WeakMap,F=t=>(e,...r)=>b(t,e,r),_=F(y.hasOwnProperty),x=(F(T.filter),F(T.join)),U=(F(T.push),F(T.pop)),R=F(T.includes),O=F(v.test),$=(F(A.match),F(A.search)),M=F(A.slice),C=F(A.split),N=(F(k.get),F(k.set),F(k.has),n({__proto__:null}));let L;function j(){if(void 0===L){const t=new WeakSet,e=Function.prototype.toString,r={toString(){const r=b(e,this,[]);return r.endsWith(") { [native code] }")||!t.has(this)?r:`function ${this.name}() { [native code] }`}};P(Function.prototype,"toString",{value:r.toString}),L=n(e=>t.add(e))}return L}const B={Infinity:1/0,NaN:NaN,undefined:void 0},G={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"},D={Date:"%InitialDate%",Error:"%InitialError%",RegExp:"%InitialRegExp%",Math:"%InitialMath%",getStackString:"%InitialGetStackString%"},W={Date:"%SharedDate%",Error:"%SharedError%",RegExp:"%SharedRegExp%",Math:"%SharedMath%"},z=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError],V={"[[Proto]]":"%FunctionPrototype%",length:"number",name:"string"},H=V,Y={get:H,set:"undefined"},q={get:H,set:H};function J(t){return t===Y||t===q}function K(t){return{"[[Proto]]":"%SharedError%",prototype:t}}function Z(t){return{"[[Proto]]":"%ErrorPrototype%",constructor:t,message:"string",name:"string",toString:!1}}function Q(t){return{"[[Proto]]":"%TypedArray%",BYTES_PER_ELEMENT:"number",prototype:t}}function X(t){return{"[[Proto]]":"%TypedArrayPrototype%",BYTES_PER_ELEMENT:"number",constructor:t}}const tt={E:"number",LN10:"number",LN2:"number",LOG10E:"number",LOG2E:"number",PI:"number",SQRT1_2:"number",SQRT2:"number","@@toStringTag":"string",abs:H,acos:H,acosh:H,asin:H,asinh:H,atan:H,atanh:H,atan2:H,cbrt:H,ceil:H,clz32:H,cos:H,cosh:H,exp:H,expm1:H,floor:H,fround:H,hypot:H,imul:H,log:H,log1p:H,log10:H,log2:H,max:H,min:H,pow:H,round:H,sign:H,sin:H,sinh:H,sqrt:H,tan:H,tanh:H,trunc:H,idiv:!1,idivmod:!1,imod:!1,imuldiv:!1,irem:!1,mod:!1},et={"[[Proto]]":null,"%ThrowTypeError%":H,Infinity:"number",NaN:"number",undefined:"undefined","%UniqueEval%":H,isFinite:H,isNaN:H,parseFloat:H,parseInt:H,decodeURI:H,decodeURIComponent:H,encodeURI:H,encodeURIComponent:H,Object:{"[[Proto]]":"%FunctionPrototype%",assign:H,create:H,defineProperties:H,defineProperty:H,entries:H,freeze:H,fromEntries:H,getOwnPropertyDescriptor:H,getOwnPropertyDescriptors:H,getOwnPropertyNames:H,getOwnPropertySymbols:H,getPrototypeOf:H,is:H,isExtensible:H,isFrozen:H,isSealed:H,keys:H,preventExtensions:H,prototype:"%ObjectPrototype%",seal:H,setPrototypeOf:H,values:H},"%ObjectPrototype%":{"[[Proto]]":null,constructor:"Object",hasOwnProperty:H,isPrototypeOf:H,propertyIsEnumerable:H,toLocaleString:H,toString:H,valueOf:H,"--proto--":q,__defineGetter__:H,__defineSetter__:H,__lookupGetter__:H,__lookupSetter__:H},"%UniqueFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%InertFunction%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%FunctionPrototype%"},"%FunctionPrototype%":{apply:H,bind:H,call:H,constructor:"%InertFunction%",toString:H,"@@hasInstance":H,caller:!1,arguments:!1},Boolean:{"[[Proto]]":"%FunctionPrototype%",prototype:"%BooleanPrototype%"},"%BooleanPrototype%":{constructor:"Boolean",toString:H,valueOf:H},Symbol:{"[[Proto]]":"%FunctionPrototype%",asyncIterator:"symbol",for:H,hasInstance:"symbol",isConcatSpreadable:"symbol",iterator:"symbol",keyFor:H,match:"symbol",matchAll:"symbol",prototype:"%SymbolPrototype%",replace:"symbol",search:"symbol",species:"symbol",split:"symbol",toPrimitive:"symbol",toStringTag:"symbol",unscopables:"symbol"},"%SymbolPrototype%":{constructor:"Symbol",description:Y,toString:H,valueOf:H,"@@toPrimitive":H,"@@toStringTag":"string"},"%InitialError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:H,stackTraceLimit:q,prepareStackTrace:q},"%SharedError%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%ErrorPrototype%",captureStackTrace:H,stackTraceLimit:q,prepareStackTrace:q},"%ErrorPrototype%":{constructor:"%SharedError%",message:"string",name:"string",toString:H,at:!1,stack:!1},EvalError:K("%EvalErrorPrototype%"),RangeError:K("%RangeErrorPrototype%"),ReferenceError:K("%ReferenceErrorPrototype%"),SyntaxError:K("%SyntaxErrorPrototype%"),TypeError:K("%TypeErrorPrototype%"),URIError:K("%URIErrorPrototype%"),"%EvalErrorPrototype%":Z("EvalError"),"%RangeErrorPrototype%":Z("RangeError"),"%ReferenceErrorPrototype%":Z("ReferenceError"),"%SyntaxErrorPrototype%":Z("SyntaxError"),"%TypeErrorPrototype%":Z("TypeError"),"%URIErrorPrototype%":Z("URIError"),Number:{"[[Proto]]":"%FunctionPrototype%",EPSILON:"number",isFinite:H,isInteger:H,isNaN:H,isSafeInteger:H,MAX_SAFE_INTEGER:"number",MAX_VALUE:"number",MIN_SAFE_INTEGER:"number",MIN_VALUE:"number",NaN:"number",NEGATIVE_INFINITY:"number",parseFloat:H,parseInt:H,POSITIVE_INFINITY:"number",prototype:"%NumberPrototype%"},"%NumberPrototype%":{constructor:"Number",toExponential:H,toFixed:H,toLocaleString:H,toPrecision:H,toString:H,valueOf:H},BigInt:{"[[Proto]]":"%FunctionPrototype%",asIntN:H,asUintN:H,prototype:"%BigIntPrototype%",bitLength:!1,fromArrayBuffer:!1},"%BigIntPrototype%":{constructor:"BigInt",toLocaleString:H,toString:H,valueOf:H,"@@toStringTag":"string"},"%InitialMath%":{...tt,random:H},"%SharedMath%":tt,"%InitialDate%":{"[[Proto]]":"%FunctionPrototype%",now:H,parse:H,prototype:"%DatePrototype%",UTC:H},"%SharedDate%":{"[[Proto]]":"%FunctionPrototype%",now:H,parse:H,prototype:"%DatePrototype%",UTC:H},"%DatePrototype%":{constructor:"%SharedDate%",getDate:H,getDay:H,getFullYear:H,getHours:H,getMilliseconds:H,getMinutes:H,getMonth:H,getSeconds:H,getTime:H,getTimezoneOffset:H,getUTCDate:H,getUTCDay:H,getUTCFullYear:H,getUTCHours:H,getUTCMilliseconds:H,getUTCMinutes:H,getUTCMonth:H,getUTCSeconds:H,setDate:H,setFullYear:H,setHours:H,setMilliseconds:H,setMinutes:H,setMonth:H,setSeconds:H,setTime:H,setUTCDate:H,setUTCFullYear:H,setUTCHours:H,setUTCMilliseconds:H,setUTCMinutes:H,setUTCMonth:H,setUTCSeconds:H,toDateString:H,toISOString:H,toJSON:H,toLocaleDateString:H,toLocaleString:H,toLocaleTimeString:H,toString:H,toTimeString:H,toUTCString:H,valueOf:H,"@@toPrimitive":H,getYear:H,setYear:H,toGMTString:H},String:{"[[Proto]]":"%FunctionPrototype%",fromCharCode:H,fromCodePoint:H,prototype:"%StringPrototype%",raw:H,fromArrayBuffer:!1},"%StringPrototype%":{length:"number",charAt:H,charCodeAt:H,codePointAt:H,concat:H,constructor:"String",endsWith:H,includes:H,indexOf:H,lastIndexOf:H,localeCompare:H,match:H,matchAll:H,normalize:H,padEnd:H,padStart:H,repeat:H,replace:H,replaceAll:H,search:H,slice:H,split:H,startsWith:H,substring:H,toLocaleLowerCase:H,toLocaleUpperCase:H,toLowerCase:H,toString:H,toUpperCase:H,trim:H,trimEnd:H,trimStart:H,valueOf:H,"@@iterator":H,substr:H,anchor:H,big:H,blink:H,bold:H,fixed:H,fontcolor:H,fontsize:H,italics:H,link:H,small:H,strike:H,sub:H,sup:H,trimLeft:H,trimRight:H,compare:!1},"%StringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},"%InitialRegExp%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%RegExpPrototype%","@@species":Y,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":Y},"%RegExpPrototype%":{constructor:"%SharedRegExp%",exec:H,dotAll:Y,flags:Y,global:Y,ignoreCase:Y,"@@match":H,"@@matchAll":H,multiline:Y,"@@replace":H,"@@search":H,source:Y,"@@split":H,sticky:Y,test:H,toString:H,unicode:Y,compile:!1,hasIndices:!1},"%RegExpStringIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},Array:{"[[Proto]]":"%FunctionPrototype%",from:H,isArray:H,of:H,prototype:"%ArrayPrototype%","@@species":Y},"%ArrayPrototype%":{length:"number",concat:H,constructor:"Array",copyWithin:H,entries:H,every:H,fill:H,filter:H,find:H,findIndex:H,flat:H,flatMap:H,forEach:H,includes:H,indexOf:H,join:H,keys:H,lastIndexOf:H,map:H,pop:H,push:H,reduce:H,reduceRight:H,reverse:H,shift:H,slice:H,some:H,sort:H,splice:H,toLocaleString:H,toString:H,unshift:H,values:H,"@@iterator":H,"@@unscopables":{"[[Proto]]":null,copyWithin:"boolean",entries:"boolean",fill:"boolean",find:"boolean",findIndex:"boolean",flat:"boolean",flatMap:"boolean",includes:"boolean",keys:"boolean",values:"boolean",at:!1},at:!1},"%ArrayIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},"%TypedArray%":{"[[Proto]]":"%FunctionPrototype%",from:H,of:H,prototype:"%TypedArrayPrototype%","@@species":Y},"%TypedArrayPrototype%":{buffer:Y,byteLength:Y,byteOffset:Y,constructor:"%TypedArray%",copyWithin:H,entries:H,every:H,fill:H,filter:H,find:H,findIndex:H,forEach:H,includes:H,indexOf:H,join:H,keys:H,lastIndexOf:H,length:Y,map:H,reduce:H,reduceRight:H,reverse:H,set:H,slice:H,some:H,sort:H,subarray:H,toLocaleString:H,toString:H,values:H,"@@iterator":H,"@@toStringTag":Y,at:!1},BigInt64Array:Q("%BigInt64ArrayPrototype%"),BigUint64Array:Q("%BigUint64ArrayPrototype%"),Float32Array:Q("%Float32ArrayPrototype%"),Float64Array:Q("%Float64ArrayPrototype%"),Int16Array:Q("%Int16ArrayPrototype%"),Int32Array:Q("%Int32ArrayPrototype%"),Int8Array:Q("%Int8ArrayPrototype%"),Uint16Array:Q("%Uint16ArrayPrototype%"),Uint32Array:Q("%Uint32ArrayPrototype%"),Uint8Array:Q("%Uint8ArrayPrototype%"),Uint8ClampedArray:Q("%Uint8ClampedArrayPrototype%"),"%BigInt64ArrayPrototype%":X("BigInt64Array"),"%BigUint64ArrayPrototype%":X("BigUint64Array"),"%Float32ArrayPrototype%":X("Float32Array"),"%Float64ArrayPrototype%":X("Float64Array"),"%Int16ArrayPrototype%":X("Int16Array"),"%Int32ArrayPrototype%":X("Int32Array"),"%Int8ArrayPrototype%":X("Int8Array"),"%Uint16ArrayPrototype%":X("Uint16Array"),"%Uint32ArrayPrototype%":X("Uint32Array"),"%Uint8ArrayPrototype%":X("Uint8Array"),"%Uint8ClampedArrayPrototype%":X("Uint8ClampedArray"),Map:{"[[Proto]]":"%FunctionPrototype%","@@species":Y,prototype:"%MapPrototype%"},"%MapPrototype%":{clear:H,constructor:"Map",delete:H,entries:H,forEach:H,get:H,has:H,keys:H,set:H,size:Y,values:H,"@@iterator":H,"@@toStringTag":"string"},"%MapIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},Set:{"[[Proto]]":"%FunctionPrototype%",prototype:"%SetPrototype%","@@species":Y},"%SetPrototype%":{add:H,clear:H,constructor:"Set",delete:H,entries:H,forEach:H,has:H,keys:H,size:Y,values:H,"@@iterator":H,"@@toStringTag":"string"},"%SetIteratorPrototype%":{"[[Proto]]":"%IteratorPrototype%",next:H,"@@toStringTag":"string"},WeakMap:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakMapPrototype%"},"%WeakMapPrototype%":{constructor:"WeakMap",delete:H,get:H,has:H,set:H,"@@toStringTag":"string"},WeakSet:{"[[Proto]]":"%FunctionPrototype%",prototype:"%WeakSetPrototype%"},"%WeakSetPrototype%":{add:H,constructor:"WeakSet",delete:H,has:H,"@@toStringTag":"string"},ArrayBuffer:{"[[Proto]]":"%FunctionPrototype%",isView:H,prototype:"%ArrayBufferPrototype%","@@species":Y,fromString:!1,fromBigInt:!1},"%ArrayBufferPrototype%":{byteLength:Y,constructor:"ArrayBuffer",slice:H,"@@toStringTag":"string",concat:!1},SharedArrayBuffer:!1,"%SharedArrayBufferPrototype%":!1,DataView:{"[[Proto]]":"%FunctionPrototype%",BYTES_PER_ELEMENT:"number",prototype:"%DataViewPrototype%"},"%DataViewPrototype%":{buffer:Y,byteLength:Y,byteOffset:Y,constructor:"DataView",getBigInt64:H,getBigUint64:H,getFloat32:H,getFloat64:H,getInt8:H,getInt16:H,getInt32:H,getUint8:H,getUint16:H,getUint32:H,setBigInt64:H,setBigUint64:H,setFloat32:H,setFloat64:H,setInt8:H,setInt16:H,setInt32:H,setUint8:H,setUint16:H,setUint32:H,"@@toStringTag":"string"},Atomics:!1,JSON:{parse:H,stringify:H,"@@toStringTag":"string"},"%IteratorPrototype%":{"@@iterator":H},"%AsyncIteratorPrototype%":{"@@asyncIterator":H},"%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:H,return:H,throw:H,"@@toStringTag":"string"},"%AsyncGeneratorPrototype%":{"[[Proto]]":"%AsyncIteratorPrototype%",constructor:"%AsyncGenerator%",next:H,return:H,throw:H,"@@toStringTag":"string"},HandledPromise:{"[[Proto]]":"Promise",applyFunction:H,applyFunctionSendOnly:H,applyMethod:H,applyMethodSendOnly:H,get:H,getSendOnly:H,prototype:"%PromisePrototype%",resolve:H},Promise:{"[[Proto]]":"%FunctionPrototype%",all:H,allSettled:H,any:!1,prototype:"%PromisePrototype%",race:H,reject:H,resolve:H,"@@species":Y},"%PromisePrototype%":{catch:H,constructor:"Promise",finally:H,then:H,"@@toStringTag":"string"},"%InertAsyncFunction%":{"[[Proto]]":"%InertFunction%",prototype:"%AsyncFunctionPrototype%"},"%AsyncFunctionPrototype%":{"[[Proto]]":"%FunctionPrototype%",constructor:"%InertAsyncFunction%","@@toStringTag":"string"},Reflect:{apply:H,construct:H,defineProperty:H,deleteProperty:H,get:H,getOwnPropertyDescriptor:H,getPrototypeOf:H,has:H,isExtensible:H,ownKeys:H,preventExtensions:H,set:H,setPrototypeOf:H,"@@toStringTag":"string"},Proxy:{"[[Proto]]":"%FunctionPrototype%",revocable:H},escape:H,unescape:H,"%UniqueCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:H},"%InertCompartment%":{"[[Proto]]":"%FunctionPrototype%",prototype:"%CompartmentPrototype%",toString:H},"%CompartmentPrototype%":{constructor:"%InertCompartment%",evaluate:H,globalThis:Y,name:Y,toString:H,__isKnownScopeProxy__:H},lockdown:H,harden:H,"%InitialGetStackString%":H};function rt(t,e,r){if(_(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)}P(t,e,r)}function ot(t,e){const r={__proto__:null};for(const[n,a]of o(e))_(t,n)&&(r[a]=t[n]);return r}function nt(){const t={__proto__:null};let e;const r={addIntrinsics(e){!function(t,e){for(const[r,n]of o(e))rt(t,r,n)}(t,i(e))},completePrototypes(){for(const[e,r]of o(t)){if(r!==Object(r))continue;if(!_(r,"prototype"))continue;const o=et[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||!_(et,n))throw new Error(`Unrecognized ${e}.prototype whitelist entry`);const a=r.prototype;if(_(t,n)){if(t[n]!==a)throw new Error("Conflicting bindings of "+n)}else t[n]=a}},finalIntrinsics:()=>(n(t),e=new WeakSet(d(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(B),r.addIntrinsics(ot(globalThis,G)),r}const at=function(t={},e={},r={}){throw new TypeError("Not available")};function it(t){return c(t).constructor}const{freeze:st,getOwnPropertyDescriptors:ct,getPrototypeOf:pt}=Object,{ownKeys:lt}=Reflect;const{apply:ut,ownKeys:yt}=Reflect,gt=(t=>(e,...r)=>ut(t,e,r))(Object.prototype.hasOwnProperty);function ft(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 dt(t,e){const r=["undefined","boolean","number","string","symbol"];function o(e,o,n,a){if("object"==typeof a)return s(e,o,a),!0;if(!1===a)return!1;if("string"==typeof a)if("prototype"===n||"constructor"===n){if(gt(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(gt(i,"value")){if(J(n))throw new TypeError("Accessor expected at "+t);return o(t,i.value,r,n)}if(!J(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 gt(r,n)?r[n]:"function"==typeof t&&(e(t),gt(V,n))?V[n]:void 0}function s(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=c(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 yt(r)){const a=ft(e,t),s=`${e}.${a}`,c=i(r,o,a);if(!c||!n(s,r,t,c)){!1!==c&&console.log("Removing "+s);try{delete r[t]}catch(e){throw t in r?console.error("failed to delete "+s,e):console.error(`deleting ${s} threw`,e),e}}}}s("intrinsics",t,et)}const mt={"%ObjectPrototype%":{toString:!0},"%FunctionPrototype%":{toString:!0},"%ErrorPrototype%":{name:!0}},Pt={"%ObjectPrototype%":{toString:!0,valueOf:!0},"%ArrayPrototype%":{toString:!0,push:!0},"%FunctionPrototype%":{constructor:!0,bind:!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%":{toString:!0}},bt={...Pt,"%ObjectPrototype%":"*","%TypedArrayPrototype%":"*"},{ownKeys:ht}=Reflect;function St(t){return null!==t&&"object"==typeof t}const Et=t=>(t=""+t).length>=1&&"aeiouAEIOU".includes(t[0])?"an "+t:"a "+t;n(Et);const wt=(t,e)=>{const r=new Set;return JSON.stringify(t,(t,e)=>{switch(typeof e){case"object":return null===e?null:r.has(e)?"[Seen]":(r.add(e),e instanceof Error?`[${e.name}: ${e.message}]`:Symbol.toStringTag in e?`[${e[Symbol.toStringTag]}]`:e);case"function":return`[Function ${e.name||"<anon>"}]`;case"string":return e.startsWith("[")?`[${e}]`:e;case"undefined":case"symbol":return`[${String(e)}]`;case"bigint":return`[${e}n]`;case"number":return Object.is(e,NaN)?"[NaN]":e===1/0?"[Infinity]":e===-1/0?"[-Infinity]":e;default:return e}},e)};n(wt);const Tt=new WeakMap,It=(t,e)=>{const r=n({toString:n(()=>wt(t,e))});return Tt.set(r,t),r};n(It);const vt=new WeakMap,At=(t,...e)=>{const r=n({__proto__:null});return vt.set(r,{template:t,args:e}),r};n(At);const kt=(t,...e)=>{const r=n({__proto__:null});return e=e.map(t=>vt.has(t)?t:It(t)),vt.set(r,{template:t,args:e}),r};n(kt);const Ft=({template:t,args:e})=>{const r=[t[0]];for(let o=0;o<e.length;o+=1){let n=e[o];Tt.has(n)&&(n=Tt.get(n));const a=(r.pop()||"").replace(/ $/,"");""!==a&&r.push(a);const i=t[o+1].replace(/^ /,"");r.push(n,i)}return""===r[r.length-1]&&r.pop(),r},_t=new WeakMap,xt=(t=At`Assert failed`,e=Error)=>{"string"==typeof t&&(t=At([t]));const r=vt.get(t);if(void 0===r)throw new Error("unrecognized details "+t);const o=new e((({template:t,args:e})=>{const r=[t[0]];for(let o=0;o<e.length;o+=1){const n=e[o];let a;a=Tt.has(n)?""+n:n instanceof Error?`(${Et(n.name)})`:`(${Et(typeof n)})`,r.push(a,t[o+1])}return r.join("")})(r));return _t.set(o,Ft(r)),o};n(xt);const Ut=new WeakMap,Rt=new WeakMap,Ot=(t,e)=>{"string"==typeof e&&(e=At([e]));const r=vt.get(e);if(void 0===r)throw new Error("unrecognized details "+e);const o=Ft(r),n=Rt.get(t);if(void 0!==n)for(const e of n)e(t,o);else{const e=Ut.get(t);void 0!==e?e.push(o):Ut.set(t,[o])}};n(Ot);const $t={getStackString:globalThis.getStackString||(t=>{if(!("stack"in t))return"";const e=""+t.stack,r=e.indexOf("\n");return e.startsWith(" ")||-1===r?e:e.slice(r+1)}),takeMessageLogArgs:t=>{const e=_t.get(t);return _t.delete(t),e},takeNoteLogArgsArray:(t,e)=>{const r=Ut.get(t);if(Ut.delete(t),void 0!==e){const r=Rt.get(t);r?r.push(e):Rt.set(t,[e])}return r||[]}};n($t);const Mt=(e,r=!1)=>{const o=r?kt:At,a=(t=o`Assert failed`,r=Error)=>{const n=xt(t,r);throw void 0!==e&&e(n),n};function i(t,e=o`Check failed`,r=Error){if(!t)throw a(e,r)}n(a);const s=(t,e,r=o`Expected ${t} is same as ${e}`,n=RangeError)=>{i(p(t,e),r,n)};n(s);const c=(t,e,r)=>{i("string"==typeof e,o`${It(e)} must be a string`),void 0===r&&(r=o([""," must be "+Et(e)],t)),s(typeof t,e,r,TypeError)};n(c);const l=t(i,{error:xt,fail:a,equal:s,typeof:c,string:(t,e)=>c(t,"string",e),note:Ot,details:o,quote:It,makeAssert:Mt});return n(l)};n(Mt);const Ct=Mt(),{details:Nt,quote:Lt}=Ct,jt=/^(\w*[a-z])Locale([A-Z]\w*)$/,Bt={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:(Ct(e===t,Nt`expected ${Lt(e)} and ${Lt(t)} to compare`),0)}}.localeCompare;const Gt=["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"],Dt=new RegExp("^[a-zA-Z_$][\\w$]*$");function Wt(t){return"eval"!==t&&!R(Gt,t)&&O(Dt,t)}function zt(t,e){const r=a(t,e);return!1===r.configurable&&!1===r.writable&&_(r,"value")}const{details:Vt,quote:Ht}=Ct,Yt=eval,qt=new Proxy(N,{get(t,e){Ct.fail(Vt`Please report unexpected scope handler trap: ${Ht(String(e))}`)}});const Jt=new RegExp("(?:\\s*//\\s*[@#]\\s*([a-zA-Z][a-zA-Z0-9]*)\\s*=\\s*([^\\s\\*]*)|/\\*\\s*[@#]\\s*([a-zA-Z][a-zA-Z0-9]*)\\s*=\\s*([^\\s\\*]*)\\s*\\*/)\\s*$");function Kt(t){let e="<unknown>";for(;t.length>0;){const r=Jt.exec(t);if(null===r)break;t=t.slice(0,t.length-r[0].length),"sourceURL"===r[3]?e=r[4]:"sourceURL"===r[1]&&(e=r[2])}return e}function Zt(t,e){const r=$(t,e);return r<0?-1:C(M(t,0,r),"\n").length}const Qt=new RegExp("(?:\x3c!--|--\x3e)","g");function Xt(t){return t.replace(Qt,t=>"<"===t[0]?"< ! --":"-- >")}const te=new RegExp("\\bimport(\\s*(?:\\(|/[/*]))","g");function ee(t){return t.replace(te,(t,e)=>"__import__"+e)}const re=new RegExp("\\beval(\\s*\\()","g");function oe(t){const e=Zt(t,re);if(e<0)return t;const r=Kt(t);throw new SyntaxError(`Possible direct eval expression rejected at ${r}:${e}. (SES_EVAL_REJECTED)`)}function ne(t){return t=function(t){const e=Zt(t,te);if(e<0)return t;const r=Kt(t);throw new SyntaxError(`Possible import expression rejected at ${r}:${e}. (SES_IMPORT_REJECTED)`)}(t=function(t){const e=Zt(t,Qt);if(e<0)return t;const r=Kt(t);throw new SyntaxError(`Possible HTML comment rejected at ${r}:${e}. (SES_HTML_COMMENT_REJECTED)`)}(t))}const ae=Function;function ie(t=[]){const e=function(t){return 0===t.length?"":`const {${x(t,",")}} = this;`}(t);return ae(`\n with (this) {\n ${e}\n return function() {\n 'use strict';\n return eval(arguments[0]);\n };\n }\n `)}const{details:se}=Ct;function ce(t,e,r={},{localTransforms:o=[],globalTransforms:n=[],sloppyGlobalsMode:i=!1,knownScopeProxies:c=new WeakSet}={}){t=function(t,e){for(const r of e)t=r(t);return t}(t,[...o,...n,ne]);const p=function(t,e={},{sloppyGlobalsMode:r=!1}={}){return{__proto__:qt,useUnsafeEvaluator:!1,get(r,o){if("symbol"!=typeof o)return"eval"===o&&!0===this.useUnsafeEvaluator?(this.useUnsafeEvaluator=!1,Yt):o in e?S(e,o,t):S(t,o)},set(r,o,n){if(o in e){return"value"in a(e,o)?E(e,o,n):E(e,o,n,t)}return E(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}),l=I(N,p),u=ie(function(t,e={}){const r=s(t),o=s(e),n=o.filter(t=>Wt(t)&&zt(e,t));return[...r.filter(e=>!o.includes(e)&&Wt(e)&&zt(t,e)),...n]}(e,r)),y=b(u,l.proxy,[]);let g;p.useUnsafeEvaluator=!0;try{return c.add(l.proxy),b(y,e,[t])}catch(t){throw g=t,t}finally{!0===p.useUnsafeEvaluator&&(l.revoke(),Ct.fail(se`handler did not revoke useUnsafeEvaluator ${g}`))}}const pe=(t,e={})=>r=>"string"!=typeof r?r:ce(r,t,{},e),le=Function;function ue(t,e={}){const o=function(r){const o=""+(U(arguments)||""),n=""+x(arguments,",");new le(n,o);const a=`(function anonymous(${n}\n) {\n${o}\n})`;return ce(a,t,{},e)};return r(o,{prototype:{value:Function.prototype,writable:!1,enumerable:!1,configurable:!1}}),Ct(c(Function)===Function.prototype,"Function prototype is the same accross compartments"),Ct(c(o)===Function.prototype,"Function constructor prototype is the same accross compartments"),o}function ye(t,e,r,n,a,{globalTransforms:i,nativeBrander:s}){for(const[e,r]of o(B))P(t,e,{value:r,writable:!1,enumerable:!1,configurable:!1});for(const[r,n]of o(G))_(e,n)&&P(t,r,{value:e[n],writable:!0,enumerable:!1,configurable:!0});for(const[n,a]of o(r))_(e,a)&&P(t,n,{value:e[a],writable:!0,enumerable:!1,configurable:!0});const c={globalThis:t,eval:pe(t,{globalTransforms:i}),Function:ue(t,{globalTransforms:i})};c.Compartment=n(n,e,s);for(const[e,r]of o(c))P(t,e,{value:r,writable:!0,enumerable:!1,configurable:!0}),"function"==typeof r&&s(r)}const ge=n([["debug","debug"],["log","log"],["info","info"],["warn","warn"],["error","error"],["trace","log"],["dirxml","log"],["group","log"],["groupCollapsed","log"]]),fe=n([["assert","error"],["timeLog","log"],["clear",void 0],["count","info"],["countReset",void 0],["dir","log"],["groupEnd","log"],["table","log"],["time","info"],["timeEnd","info"],["profile",void 0],["profileEnd",void 0],["timeStamp",void 0]]),de=n([...ge,...fe]);n(()=>{let t=[];const e=m(de.map(([e,r])=>{const o=(...r)=>{t.push([e,...r])};return P(o,"name",{value:e}),[e,n(o)]}));n(e);const r=()=>{const e=n(t);return t=[],e};n(r);return n({loggingConsole:e,takeLog:r})});const me={NOTE:"ERROR_NOTE:",MESSAGE:"ERROR_MESSAGE:"};n(me);const Pe=(t,e)=>{const{getStackString:r,takeMessageLogArgs:o,takeNoteLogArgsArray:a}=e;let i=0;const s=new WeakMap,c=t=>{let e;return s.has(t)?e=s.get(t):(i+=1,s.set(t,i),e=i),`${t.name}#${e}`},p=(t,e)=>t.map(t=>t instanceof Error?(e.push(t),`(${c(t)})`):t),l=(e,r,o,n)=>{const a=c(e),i=r===me.MESSAGE?a+":":`${a} ${r}`,s=p(o,n);t.debug(i,...s)},u=(e,r)=>{if(0===e.length)return;if(1===e.length&&void 0===r)return void f(e[0]);let o;o=1===e.length?"Nested error":`Nested ${e.length} errors`,void 0!==r&&(o=`${o} under ${r}`),t.group(o);try{for(const t of e)f(t)}finally{t.groupEnd()}},y=new WeakSet,g=(t,e)=>{const r=[];l(t,me.NOTE,e,r),u(r,c(t))},f=e=>{if(y.has(e))return;const n=c(e);y.add(e);const i=[],s=o(e),p=a(e,g);void 0===s?t.debug(n+":",e.message):l(e,me.MESSAGE,s,i);let f=r(e);"string"==typeof f&&f.length>=1&&!f.endsWith("\n")&&(f+="\n"),t.debug(f);for(const t of p)l(e,me.NOTE,t,i);u(i,n)},d=ge.map(([e,r])=>{const o=(...r)=>{const o=[],n=p(r,o);t[e](...n),u(o)};return P(o,"name",{value:e}),[e,n(o)]}),b=fe.filter(([e,r])=>e in t).map(([e,r])=>{const o=(...r)=>{t[e](...r)};return P(o,"name",{value:e}),[e,n(o)]}),h=m([...d,...b]);return n(h)};n(Pe);n((t,e,r)=>{const o=de.filter(([e,r])=>e in t).map(([r,o])=>[r,n((...n)=>{(void 0===o||e.canLog(o))&&t[r](...n)})]),a=m(o);return n(a)});const be=console,he=["getTypeName","getFunctionName","getMethodName","getFileName","getLineNumber","getColumnNumber","getEvalOrigin","isToplevel","isEval","isNative","isConstructor","isAsync","getPosition","getScriptNameOrSourceURL","toString"],Se=t=>{const e=m(he.map(e=>[e,()=>t[e]()]));return Object.create(e,{})},Ee=[/\/node_modules\//,/^(?:node:)?internal\//,/\/packages\/ses\/src\/error\/assert.js$/,/\/packages\/eventual-send\/src\//],we=[/^((?:.*[( ])?)[:/\w_-]*\/\.\.\.\/(.+)$/,/^((?:.*[( ])?)[:/\w_-]*\/(packages\/.+)$/];function Te(t,e,o,n){const a=t=>"verbose"===n||(t=>{if(!t)return!0;for(const e of Ee)if(e.test(t))return!1;return!0})(t.getFileName()),i=t=>{let e=""+t;return"concise"===n&&(e=(t=>{for(const e of we){const r=e.exec(t);if(r)return r.slice(1).join("")}return t})(e)),"\n at "+e},s=(t,e)=>[...e.filter(a).map(i)].join(""),c=new WeakMap,p={captureStackTrace(e,r=p.captureStackTrace){"function"!=typeof t.captureStackTrace?Reflect.set(e,"stack",""):t.captureStackTrace(e,r)},getStackString(t){c.has(t)||t.stack;const e=c.get(t);return e?s(0,e):""},prepareStackTrace(t,e){if(c.set(t,e),"unsafe"===o){return`${t}${s(0,e)}`}return""}},l=p.prepareStackTrace;t.prepareStackTrace=l;const u=new WeakSet([l]),y=t=>{if(u.has(t))return t;const e={prepareStackTrace:(e,r)=>(c.set(e,r),t(e,(t=>t.map(Se))(r)))};return u.add(e.prepareStackTrace),e.prepareStackTrace};return r(e,{captureStackTrace:{value:p.captureStackTrace,writable:!0,enumerable:!1,configurable:!0},prepareStackTrace:{get:()=>t.prepareStackTrace,set(e){if("function"==typeof e){const r=y(e);t.prepareStackTrace=r}else t.prepareStackTrace=l},enumerable:!1,configurable:!0}}),p.getStackString}const Ie=a(Error.prototype,"stack"),ve=Ie&&Ie.get,Ae={getStackString:t=>"function"==typeof ve?b(ve,t,[]):"stack"in t?""+t.stack:""};const{details:ke,quote:Fe}=Ct;let _e,xe=!1;const Ue=function(){const t=new WeakSet,{harden:e}={harden(e){const r=new Set,o=new WeakMap;function n(e,n){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),o.set(e,n))}function a(t){st(t);const e=o.get(t)||"unknown",r=ct(t);n(pt(t),e+".__proto__"),lt(r).forEach(t=>{const o=`${e}.${String(t)}`,a=r[t];"value"in a?n(a.value,""+o):(n(a.get,o+"(get)"),n(a.set,o+"(set)"))})}return n(e),r.forEach(a),r.forEach(t.add,t),e}};return e}(),Re=()=>!1;function Oe(t,o,n,p={}){p={..._e,...p};const{dateTaming:l="safe",errorTaming:y="safe",mathTaming:g="safe",regExpTaming:d="safe",localeTaming:m="safe",consoleTaming:S="safe",overrideTaming:E="moderate",stackFiltering:w="concise",...T}=p,I=Reflect.ownKeys(T);if(Ct(0===I.length,ke`lockdown(): non supported option ${Fe(I)}`),_e){for(const t of u(_e))Ct(p[t]===_e[t],ke`lockdown(): cannot re-invoke with different option ${Fe(t)}`);return Re}_e={dateTaming:l,errorTaming:y,mathTaming:g,regExpTaming:d,localeTaming:m,consoleTaming:S,overrideTaming:E,stackFiltering:w};const v=nt();v.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=c(a),s=function(){throw new TypeError("Not available")};r(s,{prototype:{value:i},name:{value:e,writable:!1,enumerable:!1,configurable:!0}}),r(i,{constructor:{value:s}}),s!==Function.prototype.constructor&&f(s,Function.prototype.constructor),t[o]=s}return e("Function","%InertFunction%","(function(){})"),e("GeneratorFunction","%InertGeneratorFunction%","(function*(){})"),e("AsyncFunction","%InertAsyncFunction%","(async function(){})"),e("AsyncGeneratorFunction","%InertAsyncGeneratorFunction%","(async function*(){})"),t}()),v.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"}),s=a({power:"none"});return r(i,{now:{value:Date.now,writable:!0,enumerable:!1,configurable:!0}}),r(s,{now:{value:n.now,writable:!0,enumerable:!1,configurable:!0}}),r(o,{constructor:{value:s}}),{"%InitialDate%":i,"%SharedDate%":s}}(l)),v.addIntrinsics(function(t="safe",e="concise"){if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized errorTaming "+t);if("concise"!==e&&"verbose"!==e)throw new Error("unrecognized stackFiltering "+e);const o=Error,n=o.prototype,a="function"==typeof o.captureStackTrace?"v8":"unknown",i=(t={})=>{const e=function(...t){let r;return r=void 0===new.target?b(o,this,t):h(o,t,new.target),"v8"===a&&o.captureStackTrace(r,e),r};return r(e,{length:{value:1},prototype:{value:n,writable:!1,enumerable:!1,configurable:!1}}),e},s=i({powers:"original"}),c=i({powers:"none"});r(n,{constructor:{value:c}});for(const t of z)f(t,c);r(s,{stackTraceLimit:{get(){if("number"==typeof o.stackTraceLimit)return o.stackTraceLimit},set(t){"number"==typeof t&&("number"!=typeof o.stackTraceLimit||(o.stackTraceLimit=t))},enumerable:!1,configurable:!0}}),r(c,{stackTraceLimit:{get(){},set(t){},enumerable:!1,configurable:!0}});let p=Ae.getStackString;return"v8"===a&&(p=Te(o,s,t,e)),{"%InitialGetStackString%":p,"%InitialError%":s,"%SharedError%":c}}(y,w)),v.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)}}(g)),v.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(),s=n();return"unsafe"!==t&&delete o.compile,r(o,{constructor:{value:s}}),{"%InitialRegExp%":i,"%SharedRegExp%":s}}(d)),v.addIntrinsics(n()),v.completePrototypes();const A=v.finalIntrinsics();let k;"unsafe"!==y&&(k=A["%InitialGetStackString%"]);const F=((t="safe",e)=>{if("safe"!==t&&"unsafe"!==t)throw new Error("unrecognized consoleTaming "+t);if("unsafe"===t)return{console:be};let r;r=void 0===e?$t:{...$t,getStackString:e};return{console:Pe(be,r)}})(S,k);globalThis.console=F.console,"unsafe"===y&&globalThis.assert===Ct&&(globalThis.assert=Mt(void 0,!0)),function(t,e="safe"){if("safe"!==e&&"unsafe"!==e)throw new Error("unrecognized dateTaming "+e);if("unsafe"!==e){P(String.prototype,"localeCompare",{value:Bt});for(const e of s(t)){const r=t[e];if(r===Object(r))for(const t of s(r)){const e=jt.exec(t);if(e){Ct("function"==typeof r[t],Nt`expected ${Lt(t)} to be a function`);const o=`${e[1]}${e[2]}`,n=r[o];Ct("function"==typeof n,Nt`function ${Lt(o)} not found`),P(r,t,{value:n})}}}}}(A,m);const x=j();return dt(A,x),ye(globalThis,A,D,t,0,{nativeBrander:x}),function(){return function(t,e){function r(t,e,r,o){if("value"in o&&o.configurable){const{value:a}=o;function n(){return a}P(n,"originalValue",{value:a,writable:!1,enumerable:!1,configurable:!1}),P(e,r,{get:n,set:function(o){if(e===this)throw new TypeError(`Cannot assign to read only property '${String(r)}' of '${t}'`);_(this,r)?this[r]=o:P(this,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},enumerable:o.enumerable,configurable:o.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&&ht(o).forEach(n=>r(t,e,n,o[n]))}let c;switch(e){case"min":c=mt;break;case"moderate":c=Pt;break;case"severe":c=bt;break;default:throw new Error("unrecognized overrideTaming "+e)}!function t(e,r,i){for(const c of s(i)){const s=a(r,c);if(!s||s.get||s.set)continue;const p=`${e}.${String(c)}`,l=i[c];if(!0===l)o(p,r,c);else if("*"===l)n(p,s.value);else{if(!St(l))throw new TypeError("Unexpected override enablement plan "+p);t(p,s.value,l)}}}("root",t,c)}(A,E),Ue(A),xe=!0,!0}}const $e=new WeakMap,Me={constructor:at,get globalThis(){return $e.get(this).globalObject},get name(){return $e.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__:s,__evadeHtmlCommentTest__:c=!1,__evadeImportExpressionTest__:p=!1,__rejectSomeDirectEvalExpressions__:l=!0}=o,u=[...n];!0===c&&u.push(Xt),!0===p&&u.push(ee),!0===l&&u.push(oe);const y=$e.get(this);let{globalTransforms:g}=y;const{globalObject:f,globalLexicals:d,knownScopeProxies:m}=y;let P=d;return void 0!==s&&(g=void 0,P=e(null,i(d)),r(P,i(s))),ce(t,f,P,{globalTransforms:g,localTransforms:u,sloppyGlobalsMode:a,knownScopeProxies:m})},toString:()=>"[object Compartment]",__isKnownScopeProxy__(t){return $e.get(this).knownScopeProxies.has(t)}};r(at,{prototype:{value:Me}});const Ce=(e,r,o)=>{function a(a={},i={},c={}){if(void 0===new.target)throw new TypeError("Class constructor Compartment cannot be invoked without 'new'");const{name:p="<unknown>",transforms:l=[],__shimTransforms__:u=[],globalLexicals:y={}}=c,g=[...l,...u],f={};ye(f,r,W,e,this.constructor.prototype,{globalTransforms:g,nativeBrander:o}),t(f,a);const d=s(y).filter(t=>!Wt(t));if(d.length)throw new Error(`Cannot create compartment with invalid names for global lexicals: ${d.join(", ")}; these names would not be lexically mentionable`);const m=new WeakSet;$e.set(this,{name:p,globalTransforms:g,globalObject:f,knownScopeProxies:m,globalLexicals:n({...y})})}return a.prototype=Me,a},Ne=j(),Le=Ce(Ce,function(t){const e=nt();return e.addIntrinsics(ot(t,W)),e.finalIntrinsics()}(globalThis),Ne);t(globalThis,{harden:t=>(Ct(xe,"Cannot harden before lockdown"),Ue(t)),lockdown:((t,e,r)=>(e={})=>Oe(t,0,r,e)())(Ce,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=c(n),s=RegExp.prototype[r]&&(new RegExp)[r](),p=s&&c(s),l=(new Array)[e](),u=c(l),y=c(Float32Array),g=(new Map)[e](),f=c(g),d=(new Set)[e](),m=c(d),P=c(u);function*b(){}const h=it(b),S=h.prototype;async function*E(){}const w=it(E),T=w.prototype,I=T.prototype,v=c(I);async function A(){}const k=it(A),F={"%InertFunction%":t,"%ArrayIteratorPrototype%":u,"%InertAsyncFunction%":k,"%AsyncGenerator%":T,"%InertAsyncGeneratorFunction%":w,"%AsyncGeneratorPrototype%":I,"%AsyncIteratorPrototype%":v,"%Generator%":S,"%InertGeneratorFunction%":h,"%IteratorPrototype%":P,"%MapIteratorPrototype%":f,"%RegExpStringIteratorPrototype%":p,"%SetIteratorPrototype%":m,"%StringIteratorPrototype%":i,"%ThrowTypeError%":o,"%TypedArray%":y,"%InertCompartment%":at};return F})),Compartment:Le,assert:Ct})})); |
@@ -8,2 +8,3 @@ /* eslint-disable */ | ||
import type { Lockdown } from './src/lockdown-shim'; | ||
import type { StaticModuleRecord } from './module-shim'; | ||
@@ -13,4 +14,20 @@ // For scripts. | ||
declare var lockdown: Lockdown; | ||
declare var Compartment: CompartmentConstructor; | ||
declare var Compartment : ReturnType<CompartmentConstructor>; | ||
declare var StaticModuleRecord : StaticModuleRecord; | ||
declare type StaticModuleType = RedirectStaticModuleInterface | FinalStaticModuleType; | ||
declare interface RedirectStaticModuleInterface { | ||
readonly record: FinalStaticModuleType, | ||
specifier: string | ||
}; | ||
declare type FinalStaticModuleType = StaticModuleRecord | ThirdPartyModuleInterface; | ||
declare interface ThirdPartyStaticModuleInterface { | ||
readonly imports: Array<string>, | ||
readonly execute: (exports: Object) => void, | ||
}; | ||
declare type Transform = (source: string) => string; | ||
declare type ImportHook = (moduleSpecifier: string) => Promise<Object>; | ||
declare type ModuleMapHook = (moduleSpecifier: string) => string | Object | void; | ||
declare global { | ||
@@ -20,3 +37,19 @@ // For modules. | ||
var lockdown : Lockdown; | ||
var Compartment : CompartmentConstructor; | ||
var Compartment : ReturnType<CompartmentConstructor>; | ||
var StaticModuleRecord : StaticModuleRecord; | ||
type StaticModuleType = RedirectStaticModuleInterface | FinalStaticModuleType; | ||
interface RedirectStaticModuleInterface { | ||
readonly record: FinalStaticModuleType, | ||
specifier: string | ||
}; | ||
type FinalStaticModuleType = StaticModuleRecord | ThirdPartyModuleInterface; | ||
interface ThirdPartyStaticModuleInterface { | ||
readonly imports: Array<string>, | ||
readonly execute: (exports: Object) => void, | ||
}; | ||
type Transform = (source: string) => string; | ||
type ImportHook = (moduleSpecifier: string) => Promise<Object>; | ||
type ModuleMapHook = (moduleSpecifier: string) => string | Object | void; | ||
} |
43
NEWS.md
User-visible changes in SES: | ||
## Release 0.12.4 (24-Mar-2021) | ||
- Expand TypeScript definitions to include Compartment, StaticModuleRecord, | ||
StaticModuleType, RedirectStaticModuleInterface, FinalStaticModuleType, | ||
ThirdPartyStaticModuleInterface, Transform, ImportHook, and ModuleMapHook. | ||
- The previous took `Object.prototype.constructor` off of the default | ||
[list of properties](src/enablements.js) we enable to be overridden by | ||
assignment. This default is the `{overrideTaming: 'moderate'}` setting. | ||
In this release, we stop enabling `'hasOwnProperty'` by default as | ||
well. With both of these gone, we now have a reasonable debugging | ||
experience. | ||
- Unfortunately, both rollup and webpack seem to turn exported names | ||
into assignments to an `exports` object that inherits from | ||
`Object.prototype`, thereby potentially stepping on any name. | ||
To deal with this perverse case, the release also provides an | ||
`{overrideTaming: 'severe'}` option which enables all properties on | ||
at least `Object.prototype`. This is more compatible but makes the | ||
vscode debugger's inspector unusable. At | ||
[Tracking issue for getting 3rd party packages more SES friendly (#576)](https://github.com/endojs/endo/issues/576) | ||
we track the incompatibilities we encounter and progress toward | ||
getting them fixed. | ||
- Add utility function `Compartment.prototype.__isKnownScopeProxy__(value)` to | ||
aid working around scopeProxy leakage. Returns true if `value` is one of the | ||
scopeProxies created during calls to this Compartment instances's | ||
`Compartment.prototype.evaluate`. See `test-compartment-known-scope-proxy.js` | ||
for an example of performing a scopeProxy leak workaround. | ||
- Under the default `{errorTaming: 'safe'}` setting, the SES shim already redacts stack traces from error instances when it can (currently: v8, spiderMonkey, XS). The setting `{errorTaming: 'unsafe'}` suppresses that redaction, instead blabbing these stack traces on error instances via the expected `errorInstance.stack`. | ||
The purpose of the `details` template literal tag (often spelled `X` or `d`) together with the `quote` function (often spelled `q`) is to redact data from the error messages carried by error instances. With this release, the same `{errorTaming: 'unsafe'}` would suppress that redaction as well, so that all substitution values would act like they've been quoted. IOW, with this setting | ||
```js | ||
assert(false, X`literal part ${secretData} with ${q(publicData)}.`); | ||
``` | ||
acts like | ||
```js | ||
assert(false, X`literal part ${q(secretData)} with ${q(publicData)}.`); | ||
``` | ||
Note that the information rendered by the SES shim `console` object always includes all the unredacted data independent of the setting of `errorTaming`. | ||
## Release 0.12.3 (1-Mar-2021) | ||
@@ -4,0 +47,0 @@ |
{ | ||
"name": "ses", | ||
"version": "0.12.3", | ||
"version": "0.12.4", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Secure ECMAScript", |
@@ -1,16 +0,37 @@ | ||
# Secure EcmaScript (SES) | ||
# Secure ECMAScript (SES) | ||
Secure EcmaScript (SES) is a frozen environment for running EcmaScript | ||
Secure ECMAScript (SES) is an execution environment that provides fine-grained | ||
sandboxing with Compartments. | ||
* **Compartments** Compartments are separate execution contexts: each one has | ||
its own global object and global lexical scope. | ||
* **Frozen realm** Compartments share their intrinsics to avoid identity | ||
discontinuity. By freezing the intrinsics, SES protects programs from each | ||
other. By sharing the intrinsics, programs from separate compartments | ||
can recognize each other's arrays, data objects, and so on. | ||
* **Strict mode** SES enforces JavaScript strict mode that enhances security, | ||
for example by changing some silent errors into throw errors. | ||
* **POLA** (Principle of Least Authority) By default, Compartments receive no | ||
ambient authority. They are created without host-provided APIs, (for example | ||
no `fetch`). Compartments can be selectively endowed with powerful arguments, | ||
globals, or modules. | ||
[Learn about the SES specification](https://github.com/tc39/proposal-ses). | ||
[Learn how to use SES in your own project](https://ses-secure-ecmascript.readthedocs.io/en/latest). | ||
Secure ECMAScript (SES) is a frozen environment for running ECMAScript | ||
(Javascript) 'strict' mode programs with no ambient authority in their global | ||
scope, and with the addition of a safe two-argument evaluator | ||
(`SES.confine(code, endowments)`). By freezing everything accessible from the | ||
global scope, it removes programs abilities to interfere with each other, and | ||
thus enables isolated evaluation of arbitrary code. | ||
scope, and with the addition of Compartments to evaluate third-party code | ||
safely. | ||
By freezing everything accessible from the global scope, it removes programs' | ||
abilities to interfere with each other, and thus enables isolated evaluation of | ||
arbitrary code. | ||
It runs atop an ES6-compliant platform, enabling safe interaction of | ||
SES runs atop an ES6-compliant platform, enabling safe interaction of | ||
mutually-suspicious code, using object-capability -style programming. | ||
See https://github.com/Agoric/Jessie to see how SES fits into the various | ||
flavors of confined EcmaScript execution. And visit | ||
https://rawgit.com/Agoric/ses-shim/master/demo/ for a demo. | ||
flavors of confined ECMAScript execution. And visit | ||
https://ses-demo.netlify.app/demos/ for a demo. | ||
@@ -17,0 +38,0 @@ Derived from the Caja project, https://github.com/google/caja/wiki/SES. |
@@ -82,3 +82,7 @@ // @ts-check | ||
let { globalTransforms } = compartmentFields; | ||
const { globalObject, globalLexicals } = compartmentFields; | ||
const { | ||
globalObject, | ||
globalLexicals, | ||
knownScopeProxies, | ||
} = compartmentFields; | ||
@@ -108,2 +112,3 @@ let localObject = globalLexicals; | ||
sloppyGlobalsMode, | ||
knownScopeProxies, | ||
}); | ||
@@ -115,2 +120,7 @@ }, | ||
}, | ||
/* eslint-disable-next-line no-underscore-dangle */ | ||
__isKnownScopeProxy__(value) { | ||
return privateFields.get(this).knownScopeProxies.has(value); | ||
}, | ||
}; | ||
@@ -193,2 +203,3 @@ | ||
const knownScopeProxies = new WeakSet(); | ||
privateFields.set(this, { | ||
@@ -198,2 +209,3 @@ name, | ||
globalObject, | ||
knownScopeProxies, | ||
// The caller continues to own the globalLexicals object they passed to | ||
@@ -200,0 +212,0 @@ // the compartment constructor, but the compartment only respects the |
@@ -14,3 +14,7 @@ // Adapted from SES/Caja | ||
import { moderateEnablements, minEnablements } from './enablements.js'; | ||
import { | ||
minEnablements, | ||
moderateEnablements, | ||
severeEnablements, | ||
} from './enablements.js'; | ||
@@ -74,3 +78,3 @@ const { ownKeys } = Reflect; | ||
* @param {Record<string, any>} intrinsics | ||
* @param {'min' | 'moderate'} overrideTaming | ||
* @param {'min' | 'moderate' | 'severe'} overrideTaming | ||
*/ | ||
@@ -178,2 +182,6 @@ export default function enablePropertyOverrides(intrinsics, overrideTaming) { | ||
} | ||
case 'severe': { | ||
plan = severeEnablements; | ||
break; | ||
} | ||
default: { | ||
@@ -180,0 +188,0 @@ throw new Error(`unrecognized overrideTaming ${overrideTaming}`); |
@@ -8,2 +8,3 @@ /** | ||
* @author JF Paradis | ||
* @author Mark S. Miller | ||
*/ | ||
@@ -59,21 +60,27 @@ | ||
*/ | ||
/** | ||
* Minimal enablements when all the code is modern and known not to | ||
* step into the override mistake, except for the following pervasive | ||
* cases. | ||
*/ | ||
export const minEnablements = { | ||
'%ObjectPrototype%': { | ||
toString: true, | ||
}, | ||
'%FunctionPrototype%': { | ||
toString: true, // set by "rollup" | ||
}, | ||
'%ErrorPrototype%': { | ||
name: true, // set by "precond", "ava", "node-fetch" | ||
}, | ||
}; | ||
/** | ||
* Moderate enablements are usually good enough for legacy compat. | ||
*/ | ||
export const moderateEnablements = { | ||
'%ObjectPrototype%': { | ||
// Acorn 7 does override `constructor` by assignment, but | ||
// this is fixed as of acorn 8. Including the commented out | ||
// line below in this list confuses the Node console. | ||
// See https://github.com/Agoric/agoric-sdk/issues/2324 | ||
// | ||
// So please update all | ||
// acorn dependencies to at least 8 instead. We are unable to do | ||
// so at this time due to a dependency via rollup. Instead we | ||
// do a post-install patch of acorn. | ||
// See https://github.com/Agoric/SES-shim/pull/588 | ||
// If you are similarly stuck, do likewise. Or uncomment out | ||
// the following line and let us know why. The only known | ||
// cost is the ugly display from the Node console. | ||
// | ||
// constructor: true, // set by acorn 7 | ||
hasOwnProperty: true, // set by "vega-util". | ||
toString: true, | ||
@@ -85,2 +92,3 @@ valueOf: true, | ||
toString: true, | ||
push: true, // set by "Google Analytics" | ||
}, | ||
@@ -135,5 +143,3 @@ | ||
'%TypedArrayPrototype%': { | ||
toString: true, | ||
}, | ||
'%TypedArrayPrototype%': '*', // set by https://github.com/feross/buffer | ||
@@ -151,14 +157,48 @@ '%Generator%': { | ||
export const minEnablements = { | ||
'%ObjectPrototype%': { | ||
toString: true, | ||
}, | ||
/** | ||
* The 'severe' enablement are needed because of issues tracked at | ||
* https://github.com/endojs/endo/issues/576 | ||
* | ||
* They are like the `moderate` enablements except for the entries below. | ||
*/ | ||
export const severeEnablements = { | ||
...moderateEnablements, | ||
'%FunctionPrototype%': { | ||
toString: true, // set by "rollup" | ||
}, | ||
/** | ||
* Rollup(as used at least by vega) and webpack | ||
* (as used at least by regenerator) both turn exports into assignments | ||
* to a big `exports` object that inherits directly from | ||
* `Object.prototype`.Some of the exported names we've seen include | ||
* `hasOwnProperty`, `constructor`, and `toString`. But the strategy used | ||
* by rollup and webpack means potentionally turns any exported name | ||
* into an assignment rejected by the override mistake.That's why | ||
* we take the extreme step of enabling everything on`Object.prototype`. | ||
* | ||
* In addition, code doing inheritance manually will often override | ||
* the `constructor` property on the new prototype by assignment. We've | ||
* see this several times. | ||
* | ||
* The cost of enabling all these is that they create a miserable debugging | ||
* experience. https://github.com/Agoric/agoric-sdk/issues/2324 explains | ||
* how it confused the Node console. | ||
* | ||
* The vscode debugger's object inspector shows the own data properties of | ||
* an object, which is typically what you want, but also shows both getter | ||
* and setter for every accessor property whether inherited or own. | ||
* With the `'*'` setting here, all the properties inherited from | ||
* `Object.prototype` are accessors, creating an unusable display as seen | ||
* at As explained at | ||
* https://github.com/endojs/endo/blob/master/packages/ses/lockdown-options.md#overridetaming-options | ||
* Open the triangles at the bottom of that section. | ||
*/ | ||
'%ObjectPrototype%': '*', | ||
'%ErrorPrototype%': { | ||
name: true, // set by "precond", "ava", "node-fetch" | ||
}, | ||
/** | ||
* The widely used Buffer defined at https://github.com/feross/buffer | ||
* on initialization, manually creates the equivalent of a subclass of | ||
* `TypedArray`, which it then initializes by assignment. These assignments | ||
* include enough of the `TypeArray` methods that here, we just enable | ||
* them all. | ||
*/ | ||
'%TypedArrayPrototype%': '*', | ||
}; |
@@ -56,4 +56,14 @@ // Copyright (C) 2019 Agoric, under Apache License 2.0 | ||
/** @type {DetailsTag} */ | ||
const details = (template, ...args) => { | ||
/** | ||
* Normally this is the function exported as `assert.details` and often | ||
* spelled `d`. However, if the `{errorTaming: 'unsafe'}` option is given to | ||
* `lockdown`, then `unredactedDetails` is used instead. | ||
* | ||
* There are some unconditional uses of `redactedDetails` in this module. All | ||
* of them should be uses where the template literal has no redacted | ||
* substitution values. In those cases, the two are equivalent. | ||
* | ||
* @type {DetailsTag} | ||
*/ | ||
const redactedDetails = (template, ...args) => { | ||
// Keep in mind that the vast majority of calls to `details` creates | ||
@@ -67,5 +77,27 @@ // a details token that is never used, so this path must remain as fast as | ||
}; | ||
freeze(details); | ||
freeze(redactedDetails); | ||
/** | ||
* `unredactedDetails` is like `details` except that it does not redact | ||
* anything. It acts like `details` would act if all substitution values | ||
* were wrapped with the `quote` function above (the function normally | ||
* spelled `q`). If the `{errorTaming: 'unsafe'}` option is given to | ||
* `lockdown`, then the lockdown-shim arranges for the global `assert` to be | ||
* one whose `details` property is `unredactedDetails`. | ||
* This setting optimizes the debugging and testing experience at the price | ||
* of safety. `unredactedDetails` also sacrifices the speed of `details`, | ||
* which is usually fine in debugging and testing. | ||
* | ||
* @type {DetailsTag} | ||
*/ | ||
const unredactedDetails = (template, ...args) => { | ||
const detailsToken = freeze({ __proto__: null }); | ||
args = args.map(arg => (hiddenDetailsMap.has(arg) ? arg : quote(arg))); | ||
hiddenDetailsMap.set(detailsToken, { template, args }); | ||
return detailsToken; | ||
}; | ||
freeze(unredactedDetails); | ||
export { unredactedDetails }; | ||
/** | ||
* @param {HiddenDetails} hiddenDetails | ||
@@ -130,3 +162,3 @@ * @returns {string} | ||
const makeError = ( | ||
optDetails = details`Assert failed`, | ||
optDetails = redactedDetails`Assert failed`, | ||
ErrorConstructor = Error, | ||
@@ -137,3 +169,3 @@ ) => { | ||
// it doesn't get quoted. | ||
optDetails = details([optDetails]); | ||
optDetails = redactedDetails([optDetails]); | ||
} | ||
@@ -185,3 +217,3 @@ const hiddenDetails = hiddenDetailsMap.get(optDetails); | ||
// it doesn't get quoted. | ||
detailsNote = details([detailsNote]); | ||
detailsNote = redactedDetails([detailsNote]); | ||
} | ||
@@ -259,3 +291,4 @@ const hiddenDetails = hiddenDetailsMap.get(detailsNote); | ||
*/ | ||
const makeAssert = (optRaise = undefined) => { | ||
const makeAssert = (optRaise = undefined, unredacted = false) => { | ||
const details = unredacted ? unredactedDetails : redactedDetails; | ||
/** @type {AssertFail} */ | ||
@@ -262,0 +295,0 @@ const fail = ( |
@@ -5,3 +5,3 @@ # Logging Errors | ||
* Writing defensive programs under SES requires carefully considering what an error reveals to code positioned to catch those errors up the call chain. | ||
* To that end, SES introduces an `assert` global with functions that add to errors annotations that will be hidden from callers. SES also tames the `Error` constructor to hide the `stack` to parent callers. | ||
* To that end, SES introduces an `assert` global with functions that add to errors annotations that will be hidden from callers. SES also tames the `Error` constructor to hide the `stack` to parent callers when possible (currently: v8, SpiderMonkey, XS). | ||
* SES tames the global `console` and grants it the ability to reveal error annotations and stacks to the actual console. | ||
@@ -8,0 +8,0 @@ * Both `assert` and `console` are powerful globals that SES does not implicitly carry into child compartments. When creating a child compartment, add `assert` to the compartment’s globals. Either add `console` too, or add a wrapper that annotates the console with a topic. |
@@ -61,18 +61,27 @@ // @ts-check | ||
seenSet.add(val); | ||
if (Promise.resolve(val) === val) { | ||
return '[Promise]'; | ||
} | ||
if (val instanceof Error) { | ||
return `[${val.name}: ${val.message}]`; | ||
} | ||
if (Object.keys(val).length === 0 && Symbol.toStringTag in val) { | ||
// Note that this test is `Object.keys` rather than `Refect.ownKeys`. | ||
// Like `JSON.stringify`, `Object.ownKeys` will enumerate only | ||
// string-named enumerable own properties, which will therefore | ||
// omit Symbol.toStringTag even if it is own and enumerable. | ||
// This case will happen to do a good job with presences without | ||
if (Symbol.toStringTag in val) { | ||
// For the built-ins that have or inherit a `Symbol.toStringTag`-named | ||
// property, most of them inherit the default `toString` method, | ||
// which will print in a similar manner: `"[object Foo]"` vs | ||
// `"[Foo]"`. The exceptions are | ||
// * `Symbol.prototype`, `BigInt.prototype`, `String.prototype` | ||
// which don't matter to us since we handle primitives | ||
// separately and we don't care about primitive wrapper objects. | ||
// * TODO | ||
// `Date.prototype`, `TypedArray.prototype`. | ||
// Hmmm, we probably should make special cases for these. We're | ||
// not using these yet, so it's not urgent. But others will run | ||
// into these. | ||
// | ||
// Once #2018 is closed, the only objects in our code that have or | ||
// inherit a `Symbol.toStringTag`-named property are remotables | ||
// or their remote presences. | ||
// This printing will do a good job for these without | ||
// violating abstraction layering. This behavior makes sense | ||
// purely in terms of JavaScript concepts. That's some of the | ||
// motivation for choosing that representation of remotables | ||
// in the first place. | ||
// and their remote presences in the first place. | ||
return `[${val[Symbol.toStringTag]}]`; | ||
@@ -79,0 +88,0 @@ } |
@@ -91,3 +91,3 @@ // Much of this file is duplicated at | ||
* @param {Details=} optDetails | ||
* @returns {asserts specimen is object} | ||
* @returns {asserts specimen is Record<any, any> | null} | ||
* | ||
@@ -222,3 +222,3 @@ * @callback AssertTypeofString | ||
* Makes and returns an `assert` function object that shares the bookkeeping | ||
* state defined by this module with other `assert` function objects make by | ||
* state defined by this module with other `assert` function objects made by | ||
* `makeAssert`. This state is per-module-instance and is exposed by the | ||
@@ -237,2 +237,3 @@ * `loggedErrorHandler` above. We refer to `assert` as a "function object" | ||
* @param {Raise=} optRaise | ||
* @param {boolean=} unredacted | ||
* @returns {Assert} | ||
@@ -239,0 +240,0 @@ */ |
@@ -25,2 +25,3 @@ // Portions adapted from V8 - Copyright 2016 the V8 project authors. | ||
* @param {bool} [options.sloppyGlobalsMode] | ||
* @param {WeakSet} [options.knownScopeProxies] | ||
*/ | ||
@@ -35,2 +36,3 @@ export function performEval( | ||
sloppyGlobalsMode = false, | ||
knownScopeProxies = new WeakSet(), | ||
} = {}, | ||
@@ -60,2 +62,3 @@ ) { | ||
// Ensure that "this" resolves to the safe global. | ||
knownScopeProxies.add(scopeProxyRevocable.proxy); | ||
return apply(evaluate, globalObject, [source]); | ||
@@ -62,0 +65,0 @@ } catch (e) { |
@@ -21,3 +21,2 @@ // Copyright (C) 2018 Agoric | ||
import whitelistIntrinsics from './whitelist-intrinsics.js'; | ||
import repairLegacyAccessors from './repair-legacy-accessors.js'; | ||
import tameFunctionConstructors from './tame-function-constructors.js'; | ||
@@ -35,3 +34,3 @@ import tameDateConstructor from './tame-date-constructor.js'; | ||
import tameErrorConstructor from './error/tame-error-constructor.js'; | ||
import { assert } from './error/assert.js'; | ||
import { assert, makeAssert } from './error/assert.js'; | ||
@@ -46,3 +45,3 @@ /** | ||
* consoleTaming?: 'safe' | 'unsafe', | ||
* overrideTaming?: 'min' | 'moderate', | ||
* overrideTaming?: 'min' | 'moderate' | 'severe', | ||
* stackFiltering?: 'concise' | 'verbose', | ||
@@ -212,2 +211,11 @@ * }} LockdownOptions | ||
if (errorTaming === 'unsafe' && globalThis.assert === assert) { | ||
// If errorTaming is 'unsafe' we replace the global assert with | ||
// one whose `details` template literal tag does not redact | ||
// unmarked substitution values. IOW, it blabs information that | ||
// was supposed to be secret from callers, as an aid to debugging | ||
// at a further cost in safety. | ||
globalThis.assert = makeAssert(undefined, true); | ||
} | ||
// Replace *Locale* methods with their non-locale equivalents | ||
@@ -229,5 +237,2 @@ tameLocaleMethods(intrinsics, localeTaming); | ||
// Repair problems with legacy accessors if necessary. | ||
repairLegacyAccessors(); | ||
// Initialize the powerful initial global, i.e., the global of the | ||
@@ -234,0 +239,0 @@ // start compartment, from the intrinsics. |
@@ -547,3 +547,6 @@ /** | ||
// proposed de-facto, assumed TODO | ||
// stack: accessor, | ||
// Seen on FF Nightly 88.0a1 | ||
at: false, | ||
// Seen on FF and XS | ||
stack: false, | ||
}, | ||
@@ -834,2 +837,5 @@ | ||
compile: false, // UNSAFE and suppressed. | ||
// Seen on FF Nightly 88.0a1, Chrome Canary 91.0.4446.0, | ||
// Safari Tech Preview Release 122 (Safari 14.2, WebKit 16612.1.6.2) | ||
hasIndices: false, | ||
}, | ||
@@ -904,3 +910,9 @@ | ||
values: 'boolean', | ||
// Failed tc39 proposal | ||
// Seen on FF Nightly 88.0a1 | ||
at: false, | ||
}, | ||
// Failed tc39 proposal | ||
// Seen on FF Nightly 88.0a1 | ||
at: false, | ||
}, | ||
@@ -959,2 +971,5 @@ | ||
'@@toStringTag': getter, | ||
// Failed tc39 proposal | ||
// Seen on FF Nightly 88.0a1 | ||
at: false, | ||
}, | ||
@@ -1322,2 +1337,3 @@ | ||
toString: fn, | ||
__isKnownScopeProxy__: fn, | ||
}, | ||
@@ -1324,0 +1340,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
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
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
12342267
306454
451
59