@nyariv/sandboxjs 0.8.25 → 0.8.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxExec.js","sources":["../src/SandboxExec.ts"],"sourcesContent":["import { IEvalContext } from './eval.js';\nimport { Change, ExecReturn, executeTree, executeTreeAsync } from './executor.js';\nimport {\n createContext,\n IContext,\n IExecContext,\n IGlobals,\n IOptionParams,\n IOptions,\n IScope,\n replacementCallback,\n SandboxGlobal,\n SubscriptionSubject,\n} from './utils.js';\n\nfunction subscribeSet(\n obj: unknown,\n name: string,\n callback: (modification: Change) => void,\n context: {\n setSubscriptions: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >;\n changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;\n }\n): { unsubscribe: () => void } {\n if (!(obj instanceof Object))\n throw new Error(\n 'Invalid subscription object, got ' + (typeof obj === 'object' ? 'null' : typeof obj)\n );\n const names =\n context.setSubscriptions.get(obj) || new Map<string, Set<(modification: Change) => void>>();\n context.setSubscriptions.set(obj, names);\n const callbacks = names.get(name) || new Set();\n names.set(name, callbacks);\n callbacks.add(callback);\n let changeCbs: Set<(modification: Change) => void>;\n const val = (obj as any)[name] as unknown;\n if (val instanceof Object) {\n changeCbs = context.changeSubscriptions.get(val) || new Set();\n changeCbs.add(callback);\n context.changeSubscriptions.set(val, changeCbs);\n }\n return {\n unsubscribe: () => {\n callbacks.delete(callback);\n changeCbs?.delete(callback);\n },\n };\n}\n\nexport default class SandboxExec {\n context: IContext;\n setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>> =\n new WeakMap();\n changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>> =\n new WeakMap();\n sandboxFunctions: WeakMap<(...args: any[]) => any, IExecContext> = new WeakMap();\n constructor(options?: IOptionParams, public evalContext?: IEvalContext) {\n const opt: IOptions = Object.assign(\n {\n audit: false,\n forbidFunctionCalls: false,\n forbidFunctionCreation: false,\n globals: SandboxExec.SAFE_GLOBALS,\n prototypeWhitelist: SandboxExec.SAFE_PROTOTYPES,\n prototypeReplacements: new Map<new () => any, replacementCallback>(),\n },\n options || {}\n );\n this.context = createContext(this, opt);\n }\n\n static get SAFE_GLOBALS(): IGlobals {\n return {\n Function,\n console: {\n debug: console.debug,\n error: console.error,\n info: console.info,\n log: console.log,\n table: console.table,\n warn: console.warn,\n },\n isFinite,\n isNaN,\n parseFloat,\n parseInt,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n unescape,\n Boolean,\n Number,\n BigInt,\n String,\n Object,\n Array,\n Symbol,\n Error,\n EvalError,\n RangeError,\n ReferenceError,\n SyntaxError,\n TypeError,\n URIError,\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Map,\n Set,\n WeakMap,\n WeakSet,\n Promise,\n Intl,\n JSON,\n Math,\n Date,\n RegExp,\n };\n }\n\n static get SAFE_PROTOTYPES(): Map<any, Set<string>> {\n const protos = [\n SandboxGlobal,\n Function,\n Boolean,\n Number,\n BigInt,\n String,\n Date,\n Error,\n Array,\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Map,\n Set,\n WeakMap,\n WeakSet,\n Promise,\n Symbol,\n Date,\n RegExp,\n ];\n const map = new Map<any, Set<string>>();\n protos.forEach((proto) => {\n map.set(proto, new Set());\n });\n map.set(\n Object,\n new Set([\n 'entries',\n 'fromEntries',\n 'getOwnPropertyNames',\n 'is',\n 'keys',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf',\n 'values',\n ])\n );\n return map;\n }\n\n subscribeGet(\n callback: (obj: SubscriptionSubject, name: string) => void,\n context: IExecContext\n ): { unsubscribe: () => void } {\n context.getSubscriptions.add(callback);\n return { unsubscribe: () => context.getSubscriptions.delete(callback) };\n }\n\n subscribeSet(\n obj: object,\n name: string,\n callback: (modification: Change) => void,\n context: SandboxExec | IExecContext\n ): { unsubscribe: () => void } {\n return subscribeSet(obj, name, callback, context);\n }\n\n subscribeSetGlobal(\n obj: SubscriptionSubject,\n name: string,\n callback: (modification: Change) => void\n ): { unsubscribe: () => void } {\n return subscribeSet(obj, name, callback, this);\n }\n\n getContext(fn: (...args: any[]) => any) {\n return this.sandboxFunctions.get(fn);\n }\n\n executeTree<T>(context: IExecContext, scopes: IScope[] = []): ExecReturn<T> {\n return executeTree(\n {\n ticks: BigInt(0),\n },\n context,\n context.tree,\n scopes\n );\n }\n\n executeTreeAsync<T>(context: IExecContext, scopes: IScope[] = []): Promise<ExecReturn<T>> {\n return executeTreeAsync(\n {\n ticks: BigInt(0),\n },\n context,\n context.tree,\n scopes\n );\n }\n}\n"],"names":[],"mappings":";;;AAeA,SAAS,YAAY,CACnB,GAAY,EACZ,IAAY,EACZ,QAAwC,EACxC,OAMC,EAAA;AAED,IAAA,IAAI,EAAE,GAAG,YAAY,MAAM,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,mCAAmC,IAAI,OAAO,GAAG,KAAK,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,CACtF,CAAC;AACJ,IAAA,MAAM,KAAK,GACT,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAA+C,CAAC;IAC9F,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACzC,IAAA,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;AAC/C,IAAA,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC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E,YAAA,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;SACjB,EACD,OAAO,EACP,OAAO,CAAC,IAAI,EACZ,MAAM,CACP,CAAC;KACH;AAED,IAAA,gBAAgB,CAAI,OAAqB,EAAE,MAAA,GAAmB,EAAE,EAAA;AAC9D,QAAA,OAAO,gBAAgB,CACrB;AACE,YAAA,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;SACjB,EACD,OAAO,EACP,OAAO,CAAC,IAAI,EACZ,MAAM,CACP,CAAC;KACH;AACF;;;;"}
1
+ {"version":3,"file":"SandboxExec.js","sources":["../src/SandboxExec.ts"],"sourcesContent":["import { IEvalContext } from './eval.js';\nimport { Change, ExecReturn, executeTree, executeTreeAsync } from './executor.js';\nimport {\n AsyncFunction,\n createContext,\n IContext,\n IExecContext,\n IGlobals,\n IOptionParams,\n IOptions,\n IScope,\n replacementCallback,\n SandboxGlobal,\n SubscriptionSubject,\n} from './utils.js';\n\nfunction subscribeSet(\n obj: unknown,\n name: string,\n callback: (modification: Change) => void,\n context: {\n setSubscriptions: WeakMap<\n SubscriptionSubject,\n Map<string, Set<(modification: Change) => void>>\n >;\n changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;\n }\n): { unsubscribe: () => void } {\n if (!(obj instanceof Object))\n throw new Error(\n 'Invalid subscription object, got ' + (typeof obj === 'object' ? 'null' : typeof obj)\n );\n const names =\n context.setSubscriptions.get(obj) || new Map<string, Set<(modification: Change) => void>>();\n context.setSubscriptions.set(obj, names);\n const callbacks = names.get(name) || new Set();\n names.set(name, callbacks);\n callbacks.add(callback);\n let changeCbs: Set<(modification: Change) => void>;\n const val = (obj as any)[name] as unknown;\n if (val instanceof Object) {\n changeCbs = context.changeSubscriptions.get(val) || new Set();\n changeCbs.add(callback);\n context.changeSubscriptions.set(val, changeCbs);\n }\n return {\n unsubscribe: () => {\n callbacks.delete(callback);\n changeCbs?.delete(callback);\n },\n };\n}\n\nexport default class SandboxExec {\n context: IContext;\n setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>> =\n new WeakMap();\n changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>> =\n new WeakMap();\n sandboxFunctions: WeakMap<(...args: any[]) => any, IExecContext> = new WeakMap();\n constructor(options?: IOptionParams, public evalContext?: IEvalContext) {\n const opt: IOptions = Object.assign(\n {\n audit: false,\n forbidFunctionCalls: false,\n forbidFunctionCreation: false,\n globals: SandboxExec.SAFE_GLOBALS,\n prototypeWhitelist: SandboxExec.SAFE_PROTOTYPES,\n prototypeReplacements: new Map<new () => any, replacementCallback>(),\n },\n options || {}\n );\n this.context = createContext(this, opt);\n }\n\n static get SAFE_GLOBALS(): IGlobals {\n return {\n Function,\n console: {\n debug: console.debug,\n error: console.error,\n info: console.info,\n log: console.log,\n table: console.table,\n warn: console.warn,\n },\n isFinite,\n isNaN,\n parseFloat,\n parseInt,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n unescape,\n Boolean,\n Number,\n BigInt,\n String,\n Object,\n Array,\n Symbol,\n Error,\n EvalError,\n RangeError,\n ReferenceError,\n SyntaxError,\n TypeError,\n URIError,\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Map,\n Set,\n WeakMap,\n WeakSet,\n Promise,\n Intl,\n JSON,\n Math,\n Date,\n RegExp,\n };\n }\n\n static get SAFE_PROTOTYPES(): Map<any, Set<string>> {\n const protos = [\n SandboxGlobal,\n Function,\n Boolean,\n Number,\n BigInt,\n String,\n Date,\n Error,\n Array,\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Map,\n Set,\n WeakMap,\n WeakSet,\n Promise,\n Symbol,\n Date,\n RegExp,\n ];\n const map = new Map<any, Set<string>>();\n protos.forEach((proto) => {\n map.set(proto, new Set());\n });\n map.set(\n Object,\n new Set([\n 'entries',\n 'fromEntries',\n 'getOwnPropertyNames',\n 'is',\n 'keys',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf',\n 'values',\n ])\n );\n return map;\n }\n\n subscribeGet(\n callback: (obj: SubscriptionSubject, name: string) => void,\n context: IExecContext\n ): { unsubscribe: () => void } {\n context.getSubscriptions.add(callback);\n return { unsubscribe: () => context.getSubscriptions.delete(callback) };\n }\n\n subscribeSet(\n obj: object,\n name: string,\n callback: (modification: Change) => void,\n context: SandboxExec | IExecContext\n ): { unsubscribe: () => void } {\n return subscribeSet(obj, name, callback, context);\n }\n\n subscribeSetGlobal(\n obj: SubscriptionSubject,\n name: string,\n callback: (modification: Change) => void\n ): { unsubscribe: () => void } {\n return subscribeSet(obj, name, callback, this);\n }\n\n getContext(fn: (...args: any[]) => any) {\n return this.sandboxFunctions.get(fn);\n }\n\n executeTree<T>(context: IExecContext, scopes: IScope[] = []): ExecReturn<T> {\n return executeTree(\n {\n ticks: BigInt(0),\n },\n context,\n context.tree,\n scopes\n );\n }\n\n executeTreeAsync<T>(context: IExecContext, scopes: IScope[] = []): Promise<ExecReturn<T>> {\n return executeTreeAsync(\n {\n ticks: BigInt(0),\n },\n context,\n context.tree,\n scopes\n );\n }\n}\n"],"names":[],"mappings":";;;AAgBA,SAAS,YAAY,CACnB,GAAY,EACZ,IAAY,EACZ,QAAwC,EACxC,OAMC,EAAA;AAED,IAAA,IAAI,EAAE,GAAG,YAAY,MAAM,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,mCAAmC,IAAI,OAAO,GAAG,KAAK,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,CACtF;AACH,IAAA,MAAM,KAAK,GACT,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAA+C;IAC7F,OAAO,CAAC,gBAAg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AA;AACzD,QAAA,OAAO,WAAW,CAChB;AACE,YAAA,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;SACjB,EACD,OAAO,EACP,OAAO,CAAC,IAAI,EACZ,MAAM,CACP;IACH;AAEA,IAAA,gBAAgB,CAAI,OAAqB,EAAE,MAAA,GAAmB,EAAE,EAAA;AAC9D,QAAA,OAAO,gBAAgB,CACrB;AACE,YAAA,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;SACjB,EACD,OAAO,EACP,OAAO,CAAC,IAAI,EACZ,MAAM,CACP;IACH;AACD;;;;"}
@@ -1,2 +1,2 @@
1
- const t=function(t){if(t===globalThis)return globalThis;for(const e in t)this[e]=t[e]};class e{constructor(t){this.ref={str:""},t instanceof e?(this.ref=t.ref,this.start=t.start,this.end=t.end):(this.ref.str=t,this.start=0,this.end=t.length)}substring(t,o){if(!this.length)return this;(t=this.start+t)<0&&(t=0),t>this.end&&(t=this.end),(o=void 0===o?this.end:this.start+o)<0&&(o=0),o>this.end&&(o=this.end);const n=new e(this);return n.start=t,n.end=o,n}get length(){const t=this.end-this.start;return t<0?0:t}char(t){if(this.start!==this.end)return this.ref.str[this.start+t]}toString(){return this.ref.str.substring(this.start,this.end)}trimStart(){const t=/^\s+/.exec(this.toString()),o=new e(this);return t&&(o.start+=t[0].length),o}slice(t,e){return t<0&&(t=this.end-this.start+t),t<0&&(t=0),void 0===e&&(e=this.end-this.start),e<0&&(e=this.end-this.start+e),e<0&&(e=0),this.substring(t,e)}trim(){const t=this.trimStart(),e=/\s+$/.exec(t.toString());return e&&(t.end-=e[0].length),t}valueOf(){return this.toString()}}function o(t){const e=Object.assign({},t);for(const t in e)e[t]=!0;return e}const n=new Set(["instanceof","typeof","return","throw","try","catch","if","finally","else","in","of","var","let","const","for","delete","false","true","while","do","break","continue","new","function","async","await","switch","case"]);class r{constructor(t,e={},n){this.const={},this.let={},this.var={};const r=void 0!==n||null===t;this.parent=t,this.allVars=e,this.let=r?this.let:o(e),this.var=r?o(e):this.var,this.globals=null===t?o(e):{},this.functionThis=n}get(t,e=!1){const o=this.functionThis;if("this"===t&&void 0!==o)return new c({this:o},t,!0,!1,!0);if(n.has(t))throw new SyntaxError("Unexepected token '"+t+"'");if(null===this.parent||!e||void 0!==o){if(this.globals.hasOwnProperty(t))return new c(o,t,!1,!0,!0);if(t in this.allVars&&(!(t in{})||this.allVars.hasOwnProperty(t)))return new c(this.allVars,t,this.const.hasOwnProperty(t),this.globals.hasOwnProperty(t),!0);if(null===this.parent)return new c(void 0,t)}return this.parent.get(t,e)}set(t,e){if("this"===t)throw new SyntaxError('"this" cannot be assigned');if(n.has(t))throw new SyntaxError("Unexepected token '"+t+"'");const o=this.get(t);if(void 0===o.context)throw new ReferenceError(`Variable '${t}' was not declared.`);if(o.isConst)throw new TypeError(`Cannot assign to const variable '${t}'`);if(o.isGlobal)throw new s(`Cannot override global variable '${t}'`);if(!(o.context instanceof Object))throw new s("Scope is not an object");return o.context[o.prop]=e,o}declare(t,e,o=undefined,r=!1){if("this"===t)throw new SyntaxError('"this" cannot be declared');if(n.has(t))throw new SyntaxError("Unexepected token '"+t+"'");if("var"===e&&void 0===this.functionThis&&null!==this.parent)return this.parent.declare(t,e,o,r);if((!this[e].hasOwnProperty(t)||"const"===e||this.globals.hasOwnProperty(t))&&t in this.allVars)throw new s(`Identifier '${t}' has already been declared`);return r&&(this.globals[t]=!0),this[e][t]=!0,this.allVars[t]=o,new c(this.allVars,t,this.const.hasOwnProperty(t),r)}}class i{}class s extends Error{}function a(t){return Array.isArray(t)&&"number"==typeof t[0]&&0!==t[0]&&88!==t[0]}class c{constructor(t,e,o=!1,n=!1,r=!1){this.context=t,this.prop=e,this.isConst=o,this.isGlobal=n,this.isVariable=r}get(t){const e=this.context;if(void 0===e)throw new ReferenceError(`${this.prop} is not defined`);if(null===e)throw new TypeError(`Cannot read properties of null, (reading '${this.prop}')`);return t.getSubscriptions.forEach((t=>t(e,this.prop))),e[this.prop]}}class l{constructor(t,e,o,n=!1,r=!1){this.auditReport=t,this.result=e,this.returned=o,this.breakLoop=n,this.continueLoop=r}}const p={};function d(t,e){const o={};return t.forEach(((t,n)=>{t.startsWith("...")?o[t.substring(3)]=e.slice(n):o[t]=e[n]})),o}const u=new WeakSet;function f(t,e,o,n,i,a){if(n.ctx.options.forbidFunctionCreation)throw new s("Function creation is forbidden");let c;return c=void 0===a?(...s)=>{const a=d(t,s);return $(o,n,e,void 0===i?[]:[new r(i,a)]).result}:function(...s){const a=d(t,s);return $(o,n,e,void 0===i?[]:[new r(i,a,this)]).result},n.registerSandboxFunction(c),u.add(c),c}function h(t,e,o,n,i,a){if(n.ctx.options.forbidFunctionCreation)throw new s("Function creation is forbidden");if(!n.ctx.prototypeWhitelist?.has(Promise.prototype))throw new s("Async/await not permitted");let c;return c=void 0===a?async(...s)=>{const a=d(t,s);return(await U(o,n,e,void 0===i?[]:[new r(i,a)])).result}:async function(...s){const a=d(t,s);return(await U(o,n,e,void 0===i?[]:[new r(i,a,this)])).result},n.registerSandboxFunction(c),u.add(c),c}function v(t,e,o="assign"){if(void 0===t.context)throw new ReferenceError(`Cannot ${o} value to undefined.`);if("object"!=typeof t.context&&"function"!=typeof t.context)throw new SyntaxError(`Cannot ${o} value to a primitive.`);if(t.isConst)throw new TypeError(`Cannot set value to const variable '${t.prop}'`);if(t.isGlobal)throw new s(`Cannot ${o} property '${t.prop}' of a global object`);if(null===t.context)throw new TypeError("Cannot set properties of null");if("function"==typeof t.context[t.prop]&&!t.context.hasOwnProperty(t.prop))throw new s(`Override prototype property '${t.prop}' not allowed`);"delete"===o?t.context.hasOwnProperty(t.prop)&&(e.changeSubscriptions.get(t.context)?.forEach((e=>e({type:"delete",prop:t.prop}))),e.changeSubscriptionsGlobal.get(t.context)?.forEach((e=>e({type:"delete",prop:t.prop})))):t.context.hasOwnProperty(t.prop)?(e.setSubscriptions.get(t.context)?.get(t.prop)?.forEach((t=>t({type:"replace"}))),e.setSubscriptionsGlobal.get(t.context)?.get(t.prop)?.forEach((t=>t({type:"replace"})))):(e.changeSubscriptions.get(t.context)?.forEach((e=>e({type:"create",prop:t.prop}))),e.changeSubscriptionsGlobal.get(t.context)?.forEach((e=>e({type:"create",prop:t.prop}))))}const w=new Set([[].push,[].pop,[].shift,[].unshift,[].splice,[].reverse,[].sort,[].copyWithin]);class y{constructor(t,e){this.key=t,this.val=e}}class g{constructor(t){this.item=t}}class b{constructor(t){this.item=t}}class x{constructor(t,e){this.t=t,this.f=e}}const S=/(\$\$)*(\$)?\${(\d+)}/g,m=new Map;function E(t,e){m.set(t,e)}function I(t,e){return t instanceof c?t.get(e):t!==p?t:void 0}function A(t,e,o,n,r,i,s){e===C?function(t,e,o,n,r,i){const s=[];for(let c=0;c<e.length;c++){let p;try{p=R((o=>C(t,e[c],n,r,o,i))).result}catch(t){return void o(t)}if(p instanceof l&&(p.returned||p.breakLoop||p.continueLoop))return void o(void 0,p);if(a(e[c])&&8===e[c][0])return void o(void 0,new l(r.ctx.auditReport,p,!0));s.push(p)}o(void 0,s)}(t,o,n,r,i,s):async function(t,e,o,n,r,i){const s=[];for(let c=0;c<e.length;c++){let p;try{let o;p=!0===(o=O((o=>k(t,e[c],n,r,o,i)))).isInstant?o.instant:(await o.p).result}catch(t){return void o(t)}if(p instanceof l&&(p.returned||p.breakLoop||p.continueLoop))return void o(void 0,p);if(a(e[c])&&8===e[c][0])return void o(void 0,new l(r.ctx.auditReport,p,!0));s.push(p)}o(void 0,s)}(t,o,n,r,i,s).catch(n)}function O(t){let e,o=!1;const n=new Promise(((n,r)=>{t(((t,i)=>{t?r(t):(o=!0,e=i,n({result:i}))}))}));return{isInstant:o,instant:e,p:n}}function R(t){let e,o;if(t(((t,n)=>{o=t,e=n})),o)throw o;return{result:e}}async function k(t,e,o,n,r,i){let s=r;const l=new Promise((t=>{s=(e,o)=>{r(e,o),t()}}));if(!F(t,e,o,n,s,!0,i)&&a(e)){let r,a=e[0];try{let s;r=!0===(s=O((r=>k(t,e[1],o,n,r,i)))).isInstant?s.instant:(await s.p).result}catch(t){return void s(t)}let l,d=r;try{d=r instanceof c?r.get(n):r}catch(t){return void s(t)}if(20===a||21===a){if(null==d)return void s(void 0,p);a=20===a?1:5}if(d===p){if(1===a||5===a)return void s(void 0,d);d=void 0}try{let r;l=!0===(r=O((r=>k(t,e[2],o,n,r,i)))).isInstant?r.instant:(await r.p).result}catch(t){return void s(t)}let u=l;try{u=l instanceof c?l.get(n):l}catch(t){return void s(t)}if(u===p&&(u=void 0),m.has(a))try{m.get(a)?.(k,s,t,d,u,r,n,o,l,i)}catch(t){s(t)}else s(new SyntaxError("Unknown operator: "+a))}await l}function C(t,e,o,n,r,i){if(!F(t,e,o,n,r,!1,i)&&a(e)){let s,a=e[0];try{s=R((r=>C(t,e[1],o,n,r,i))).result}catch(t){return void r(t)}let l,d=s;try{d=s instanceof c?s.get(n):s}catch(t){return void r(t)}if(20===a||21===a){if(null==d)return void r(void 0,p);a=20===a?1:5}if(d===p){if(1===a||5===a)return void r(void 0,d);d=void 0}try{l=R((r=>C(t,e[2],o,n,r,i))).result}catch(t){return void r(t)}let u=l;try{u=l instanceof c?l.get(n):l}catch(t){return void r(t)}if(u===p&&(u=void 0),m.has(a))try{m.get(a)?.(C,r,t,d,u,s,n,o,l,i)}catch(t){r(t)}else r(new SyntaxError("Unknown operator: "+a))}}E(1,((t,e,o,n,r,i,a,l)=>{if(null===n)throw new TypeError(`Cannot get property ${r} of null`);const p=typeof n;if("undefined"===p&&void 0===i){const t=l.get(r);if(t.context===a.ctx.sandboxGlobal){a.ctx.options.audit&&a.ctx.auditReport?.globalsAccess.add(r);const t=a.ctx.globalsWhitelist.has(a.ctx.sandboxGlobal[r])?a.evals.get(a.ctx.sandboxGlobal[r]):void 0;if(t)return void e(void 0,t)}return t.context&&t.context[r]===globalThis?void e(void 0,a.ctx.globalScope.get("this")):void e(void 0,t)}if(void 0===n)throw new s("Cannot get property '"+r+"' of undefined");if("object"!==p)"number"===p?n=new Number(n):"string"===p?n=new String(n):"boolean"===p&&(n=new Boolean(n));else if(void 0===n.hasOwnProperty)return void e(void 0,new c(void 0,r));const d="function"===p,f=d||!(n.hasOwnProperty(r)||"number"==typeof r);if(a.ctx.options.audit&&f&&"string"==typeof r){let t=Object.getPrototypeOf(n);do{t.hasOwnProperty(r)&&(a.ctx.auditReport&&!a.ctx.auditReport.prototypeAccess[t.constructor.name]&&(a.ctx.auditReport.prototypeAccess[t.constructor.name]=new Set),a.ctx.auditReport?.prototypeAccess[t.constructor.name].add(r))}while(t=Object.getPrototypeOf(t))}if(f)if(d){if(!["name","length","constructor"].includes(r)&&(n.hasOwnProperty(r)||"__proto__"===r)){const t=a.ctx.prototypeWhitelist.get(n.prototype),o=a.ctx.options.prototypeReplacements.get(n);if(o)return void e(void 0,new c(o(n,!0),r));if(!t||t.size&&!t.has(r))throw new s(`Static method or property access not permitted: ${n.name}.${r}`)}}else if("constructor"!==r){let t=n;for(;t=Object.getPrototypeOf(t);)if(t.hasOwnProperty(r)){const o=a.ctx.prototypeWhitelist.get(t),i=a.ctx.options.prototypeReplacements.get(t.constuctor);if(i)return void e(void 0,new c(i(n,!1),r));if(o&&(!o.size||o.has(r)))break;throw new s(`Method or property access not permitted: ${t.constructor.name}.${r}`)}}if(a.evals.has(n[r]))return void e(void 0,a.evals.get(n[r]));if(n[r]===globalThis)return void e(void 0,a.ctx.globalScope.get("this"));const h=i.isGlobal||d&&!u.has(n)||a.ctx.globalsWhitelist.has(n);e(void 0,new c(n,r,!1,h))})),E(5,((t,e,o,n,r,i,a)=>{if(a.ctx.options.forbidFunctionCalls)throw new s("Function invocations are not allowed");if("function"!=typeof n)throw new TypeError(`${"symbol"==typeof i.prop?"Symbol":i.prop} is not a function`);const c=r.map((t=>t instanceof b?[...t.item]:[t])).flat().map((t=>I(t,a)));if("function"!=typeof i){if(i.context[i.prop]===JSON.stringify&&a.getSubscriptions.size){const t=new Set,e=o=>{if(o&&"object"==typeof o&&!t.has(o)){t.add(o);for(const t of Object.keys(o))a.getSubscriptions.forEach((e=>e(o,t))),e(o[t])}};e(c[0])}if(i.context instanceof Array&&w.has(i.context[i.prop])&&(a.changeSubscriptions.get(i.context)||a.changeSubscriptionsGlobal.get(i.context))){let t,e=!1;if("push"===i.prop)t={type:"push",added:c},e=!!c.length;else if("pop"===i.prop)t={type:"pop",removed:i.context.slice(-1)},e=!!t.removed.length;else if("shift"===i.prop)t={type:"shift",removed:i.context.slice(0,1)},e=!!t.removed.length;else if("unshift"===i.prop)t={type:"unshift",added:c},e=!!c.length;else if("splice"===i.prop)t={type:"splice",startIndex:c[0],deleteCount:void 0===c[1]?i.context.length:c[1],added:c.slice(2),removed:i.context.slice(c[0],void 0===c[1]?void 0:c[0]+c[1])},e=!!t.added.length||!!t.removed.length;else if("reverse"===i.prop||"sort"===i.prop)t={type:i.prop},e=!!i.context.length;else if("copyWithin"===i.prop){const o=void 0===c[2]?i.context.length-c[1]:Math.min(i.context.length,c[2]-c[1]);t={type:"copyWithin",startIndex:c[0],endIndex:c[0]+o,added:i.context.slice(c[1],c[1]+o),removed:i.context.slice(c[0],c[0]+o)},e=!!t.added.length||!!t.removed.length}e&&(a.changeSubscriptions.get(i.context)?.forEach((e=>e(t))),a.changeSubscriptionsGlobal.get(i.context)?.forEach((e=>e(t))))}i.get(a),e(void 0,i.context[i.prop](...c))}else e(void 0,i(...c))})),E(22,((t,e,o,n,r)=>{let i={};for(const t of r)t.key instanceof g?i={...i,...t.key.item}:i[t.key]=t.val;e(void 0,i)})),E(6,((t,e,o,n,r)=>e(void 0,new y(n,r)))),E(12,((t,e,o,n,r,i,s)=>{e(void 0,r.map((t=>t instanceof b?[...t.item]:[t])).flat().map((t=>I(t,s))))})),E(23,((t,e,o,n,r)=>e(void 0,r))),E(35,((t,e,o,n,r)=>{switch(r){case"true":return e(void 0,!0);case"false":return e(void 0,!1);case"null":return e(void 0,null);case"undefined":return e(void 0,void 0);case"NaN":return e(void 0,NaN);case"Infinity":return e(void 0,1/0)}e(new Error("Unknown symbol: "+r))})),E(7,((t,e,o,n,r)=>e(void 0,Number(r)))),E(83,((t,e,o,n,r)=>e(void 0,BigInt(r)))),E(2,((t,e,o,n,r,i,s)=>e(void 0,s.constants.strings[parseInt(r)]))),E(85,((t,e,o,n,r,i,a)=>{const c=a.constants.regexes[parseInt(r)];if(!a.ctx.globalsWhitelist.has(RegExp))throw new s("Regex not permitted");e(void 0,new RegExp(c.regex,c.flags))})),E(84,((t,e,o,n,r,i,s,a)=>{const c=s.constants.literals[parseInt(r)],[,l,p]=c,d=[];let u;const f=[];for(;u=S.exec(l);)u[2]||(d.push(p[parseInt(u[3],10)]),f.push(u[3]));t(o,d,a,s,((t,o)=>{const n={};if(t)e(t);else{for(const t of Object.keys(o)){const e=f[t];n[e]=o[t]}e(void 0,l.replace(/(\\\\)*(\\)?\${(\d+)}/g,((t,e,o,r)=>{if(o)return t;return(e||"")+`${I(n[r],s)}`})))}}))})),E(18,((t,e,o,n,r)=>{e(void 0,new b(r))})),E(17,((t,e,o,n,r)=>{e(void 0,new g(r))})),E(24,((t,e,o,n,r)=>e(void 0,!r))),E(64,((t,e,o,n,r)=>e(void 0,~r))),E(25,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,++i.context[i.prop])})),E(26,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]++)})),E(27,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,--i.context[i.prop])})),E(28,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]--)})),E(9,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]=r)})),E(66,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]+=r)})),E(65,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]-=r)})),E(67,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]/=r)})),E(69,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]*=r)})),E(68,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]**=r)})),E(70,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]%=r)})),E(71,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]^=r)})),E(72,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]&=r)})),E(73,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]|=r)})),E(76,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]<<=r)})),E(75,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]>>=r)})),E(74,((t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]>>=r)})),E(57,((t,e,o,n,r)=>e(void 0,n>r))),E(56,((t,e,o,n,r)=>e(void 0,n<r))),E(55,((t,e,o,n,r)=>e(void 0,n>=r))),E(54,((t,e,o,n,r)=>e(void 0,n<=r))),E(52,((t,e,o,n,r)=>e(void 0,n==r))),E(32,((t,e,o,n,r)=>e(void 0,n===r))),E(53,((t,e,o,n,r)=>e(void 0,n!=r))),E(31,((t,e,o,n,r)=>e(void 0,n!==r))),E(29,((t,e,o,n,r)=>e(void 0,n&&r))),E(30,((t,e,o,n,r)=>e(void 0,n||r))),E(77,((t,e,o,n,r)=>e(void 0,n&r))),E(78,((t,e,o,n,r)=>e(void 0,n|r))),E(33,((t,e,o,n,r)=>e(void 0,n+r))),E(47,((t,e,o,n,r)=>e(void 0,n-r))),E(59,((t,e,o,n,r)=>e(void 0,+r))),E(58,((t,e,o,n,r)=>e(void 0,-r))),E(48,((t,e,o,n,r)=>e(void 0,n/r))),E(79,((t,e,o,n,r)=>e(void 0,n^r))),E(50,((t,e,o,n,r)=>e(void 0,n*r))),E(51,((t,e,o,n,r)=>e(void 0,n%r))),E(80,((t,e,o,n,r)=>e(void 0,n<<r))),E(81,((t,e,o,n,r)=>e(void 0,n>>r))),E(82,((t,e,o,n,r)=>e(void 0,n>>>r))),E(60,((t,e,o,n,r,i,s,a)=>{t(o,r,a,s,((t,o)=>{e(void 0,typeof I(o,s))}))})),E(62,((t,e,o,n,r)=>e(void 0,n instanceof r))),E(63,((t,e,o,n,r)=>e(void 0,n in r))),E(61,((t,e,o,n,r,i,s,a,c)=>{void 0!==c.context?(v(c,s,"delete"),c.isVariable?e(void 0,!1):e(void 0,delete c.context?.[c.prop])):e(void 0,!0)})),E(8,((t,e,o,n,r)=>e(void 0,r))),E(34,((t,e,o,n,r,i,s,a)=>{e(void 0,a.declare(n,"var",r))})),E(3,((t,e,o,n,r,i,s,a,c)=>{e(void 0,a.declare(n,"let",r,c&&c.isGlobal))})),E(4,((t,e,o,n,r,i,s,a)=>{e(void 0,a.declare(n,"const",r))})),E(11,((t,o,n,r,i,a,c,l)=>{if(r=[...r],"string"==typeof a[2]||a[2]instanceof e){if(!c.allowJit||!c.evalContext)throw new s("Unevaluated code detected, JIT not allowed");a[2]=i=c.evalContext.lispifyFunction(new e(a[2]),c.constants)}r.shift()?o(void 0,h(r,i,n,c,l)):o(void 0,f(r,i,n,c,l))})),E(37,((t,o,n,r,i,a,c,l)=>{if("string"==typeof a[2]||a[2]instanceof e){if(!c.allowJit||!c.evalContext)throw new s("Unevaluated code detected, JIT not allowed");a[2]=i=c.evalContext.lispifyFunction(new e(a[2]),c.constants)}const p=r.shift(),d=r.shift();let u;u=88===p?h(r,i,n,c,l,d):f(r,i,n,c,l,d),d&&l.declare(d,"var",u),o(void 0,u)})),E(10,((t,o,n,i,a,c,l,p)=>{if("string"==typeof c[2]||c[2]instanceof e){if(!l.allowJit||!l.evalContext)throw new s("Unevaluated code detected, JIT not allowed");c[2]=a=l.evalContext.lispifyFunction(new e(c[2]),l.constants)}const d=i.shift(),u=i.shift();let v;u&&(p=new r(p,{})),v=88===d?h(i,a,n,l,p,u):f(i,a,n,l,p,u),u&&p.declare(u,"let",v),o(void 0,v)})),E(38,((t,e,o,n,i,s,a,c)=>{const[p,d,u,f,h,v,w]=n;let y=!0;const g=new r(c,{}),b={$$obj:void 0},x=new r(g,b);if(t===k)(async()=>{let n;for(n=O((e=>t(o,f,g,a,e))),b.$$obj=!0===(n=O((e=>t(o,u,g,a,e)))).isInstant?n.instant:(await n.p).result,n=O((e=>t(o,d,x,a,e))),p&&(y=!0===(n=O((e=>t(o,v,x,a,e)))).isInstant?n.instant:(await n.p).result);y;){const s={};n=O((e=>t(o,w,new r(x,s),a,e))),!0===n.isInstant?n.instant:(await n.p).result;const c=await U(o,a,i,[new r(g,s)],"loop");if(c instanceof l&&c.returned)return void e(void 0,c);if(c instanceof l&&c.breakLoop)break;n=O((e=>t(o,h,x,a,e))),y=!0===(n=O((e=>t(o,v,x,a,e)))).isInstant?n.instant:(await n.p).result}e()})().catch(e);else{for(R((e=>t(o,f,g,a,e))),b.$$obj=R((e=>t(o,u,g,a,e))).result,R((e=>t(o,d,x,a,e))),p&&(y=R((e=>t(o,v,x,a,e))).result);y;){const n={};R((e=>t(o,w,new r(x,n),a,e)));const s=$(o,a,i,[new r(g,n)],"loop");if(s instanceof l&&s.returned)return void e(void 0,s);if(s instanceof l&&s.breakLoop)break;R((e=>t(o,h,x,a,e))),y=R((e=>t(o,v,x,a,e))).result}e()}})),E(86,((t,e,o,n,r,i,a,c,p,d)=>{if("switch"===d&&"continue"===n||!d)throw new s("Illegal "+n+" statement");e(void 0,new l(a.ctx.auditReport,void 0,!1,"break"===n,"continue"===n))})),E(13,((t,e,o,n,r,i,s,a)=>{t(o,I(n,s)?r.t:r.f,a,s,e)})),E(15,((t,e,o,n,r,i,s,a)=>{t(o,I(n,s)?r.t:r.f,a,s,e)})),E(16,((t,e,o,n,r)=>e(void 0,new x(n,r)))),E(14,((t,e,o,n,r)=>e(void 0,new x(n,r)))),E(40,((t,e,o,n,r,i,s,a)=>{t(o,n,a,s,((n,i)=>{if(n)e(n);else if(i=I(i,s),t===C){let n,c=!1;for(const l of r)if(c||(c=!l[1]||i===I(R((e=>t(o,l[1],a,s,e))).result,s))){if(!l[2])continue;if(n=$(o,s,l[2],[a],"switch"),n.breakLoop)break;if(n.returned)return void e(void 0,n);if(!l[1])break}e()}else(async()=>{let n,c=!1;for(const l of r){let r;if(c||(c=!l[1]||i===I(!0===(r=O((e=>t(o,l[1],a,s,e)))).isInstant?r.instant:(await r.p).result,s))){if(!l[2])continue;if(n=await U(o,s,l[2],[a],"switch"),n.breakLoop)break;if(n.returned)return void e(void 0,n);if(!l[1])break}}e()})().catch(e)}))})),E(39,((t,e,o,n,i,s,a,c,l,p)=>{const[d,u,f]=i;j(t,((n,i)=>{j(t,(s=>{s?e(s):n?j(t,e,o,a,u,[new r(c)],p):e(void 0,i)}),o,a,f,[new r(c,{})])}),o,a,n,[new r(c)],p)})),E(87,((t,e)=>{e()})),E(45,((t,e,o,n,r,i,a)=>{if(!a.ctx.globalsWhitelist.has(n)&&!u.has(n))throw new s(`Object construction not allowed: ${n.constructor.name}`);e(void 0,new n(...r))})),E(46,((t,e,o,n,r)=>{e(r)})),E(43,((t,e,o,n)=>e(void 0,n.pop()))),E(0,((t,e)=>e()));const P=new Set([11,37,10,38,39,40,14,16,60]);function F(t,e,o,n,r,i,l){const d=i?k:C;if(n.ctx.options.executionQuota&&n.ctx.options.executionQuota<=t.ticks&&("function"!=typeof n.ctx.options.onExecutionQuotaReached||!n.ctx.options.onExecutionQuotaReached(t,o,n,e)))return r(new s("Execution quota exceeded")),!0;if(t.ticks++,e instanceof c)try{r(void 0,e.get(n))}catch(t){r(t)}else if(e===p)r();else if(Array.isArray(e)&&!a(e))0===e[0]?r():A(t,d,e,r,o,n,l);else if(a(e))if(42===e[0])A(t,d,e[1],r,o,n,l);else if(44===e[0])i?n.ctx.prototypeWhitelist?.has(Promise.prototype)?k(t,e[1],o,n,(async(t,e)=>{if(t)r(t);else try{r(void 0,await I(e,n))}catch(t){r(t)}}),l).catch(r):r(new s("Async/await is not permitted")):r(new s("Illegal use of 'await', must be inside async function"));else{if(!P.has(e[0]))return!1;try{m.get(e[0])?.(d,r,t,e[1],e[2],e,n,o,void 0,l)}catch(t){r(t)}}else r(void 0,e);return!0}function $(t,e,o,n=[],r){return R((i=>j(C,i,t,e,o,n,r))).result}async function U(t,e,o,n=[],r){let i;return!0===(i=O((i=>j(k,i,t,e,o,n,r)))).isInstant?i.instant:(await i.p).result}function j(t,e,o,n,s,c=[],p){if(!s)return void e();if(!(s instanceof Array))throw new SyntaxError("Bad execution tree");let d,u=n.ctx.globalScope;for(;d=c.shift();)"object"==typeof d&&(u=d instanceof r?d:new r(u,d,d instanceof i?void 0:null));n.ctx.options.audit&&!n.ctx.auditReport&&(n.ctx.auditReport={globalsAccess:new Set,prototypeAccess:{}}),t===C?function(t,e,o,n,r,i){if(!(n instanceof Array))throw new SyntaxError("Bad execution tree");let s=0;for(s=0;s<n.length;s++){let c,p;const d=n[s];try{C(e,d,r,o,((t,e)=>{p=t,c=e}),i)}catch(t){p=t}if(p)return void t(p);if(c instanceof l)return void t(void 0,c);if(a(d)&&8===d[0])return void t(void 0,new l(o.ctx.auditReport,c,!0))}t(void 0,new l(o.ctx.auditReport,void 0,!1))}(e,o,n,s,u,p):async function(t,e,o,n,r,i){if(!(n instanceof Array))throw new SyntaxError("Bad execution tree");let s=0;for(s=0;s<n.length;s++){let c,p;const d=n[s];try{await k(e,d,r,o,((t,e)=>{p=t,c=e}),i)}catch(t){p=t}if(p)return void t(p);if(c instanceof l)return void t(void 0,c);if(a(d)&&8===d[0])return void t(void 0,new l(o.ctx.auditReport,c,!0))}t(void 0,new l(o.ctx.auditReport,void 0,!1))}(e,o,n,s,u,p).catch(e)}function W(t,e,o,n){if(!(t instanceof Object))throw new Error("Invalid subscription object, got "+("object"==typeof t?"null":typeof t));const r=n.setSubscriptions.get(t)||new Map;n.setSubscriptions.set(t,r);const i=r.get(e)||new Set;let s;r.set(e,i),i.add(o);const a=t[e];return a instanceof Object&&(s=n.changeSubscriptions.get(a)||new Set,s.add(o),n.changeSubscriptions.set(a,s)),{unsubscribe:()=>{i.delete(o),s?.delete(o)}}}BigInt(0);class T{constructor(e,o){this.evalContext=o,this.setSubscriptions=new WeakMap,this.changeSubscriptions=new WeakMap,this.sandboxFunctions=new WeakMap;const n=Object.assign({audit:!1,forbidFunctionCalls:!1,forbidFunctionCreation:!1,globals:T.SAFE_GLOBALS,prototypeWhitelist:T.SAFE_PROTOTYPES,prototypeReplacements:new Map},e||{});this.context=function(e,o){const n=new t(o.globals),i={sandbox:e,globalsWhitelist:new Set(Object.values(o.globals)),prototypeWhitelist:new Map([...o.prototypeWhitelist].map((t=>[t[0].prototype,t[1]]))),options:o,globalScope:new r(null,o.globals,n),sandboxGlobal:n};return i.prototypeWhitelist.set(Object.getPrototypeOf([][Symbol.iterator]()),new Set),i}(this,n)}static get SAFE_GLOBALS(){return{Function:Function,console:{debug:console.debug,error:console.error,info:console.info,log:console.log,table:console.table,warn:console.warn},isFinite:isFinite,isNaN:isNaN,parseFloat:parseFloat,parseInt:parseInt,decodeURI:decodeURI,decodeURIComponent:decodeURIComponent,encodeURI:encodeURI,encodeURIComponent:encodeURIComponent,escape:escape,unescape:unescape,Boolean:Boolean,Number:Number,BigInt:BigInt,String:String,Object:Object,Array:Array,Symbol:Symbol,Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError,Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,Map:Map,Set:Set,WeakMap:WeakMap,WeakSet:WeakSet,Promise:Promise,Intl:Intl,JSON:JSON,Math:Math,Date:Date,RegExp:RegExp}}static get SAFE_PROTOTYPES(){const e=[t,Function,Boolean,Number,BigInt,String,Date,Error,Array,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Map,Set,WeakMap,WeakSet,Promise,Symbol,Date,RegExp],o=new Map;return e.forEach((t=>{o.set(t,new Set)})),o.set(Object,new Set(["entries","fromEntries","getOwnPropertyNames","is","keys","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","values"])),o}subscribeGet(t,e){return e.getSubscriptions.add(t),{unsubscribe:()=>e.getSubscriptions.delete(t)}}subscribeSet(t,e,o,n){return W(t,e,o,n)}subscribeSetGlobal(t,e,o){return W(t,e,o,this)}getContext(t){return this.sandboxFunctions.get(t)}executeTree(t,e=[]){return $({ticks:BigInt(0)},t,t.tree,e)}executeTreeAsync(t,e=[]){return U({ticks:BigInt(0)},t,t.tree,e)}}export{T as default};
1
+ Object.getPrototypeOf(async function(){}).constructor,Object.getPrototypeOf(function*(){}).constructor,Object.getPrototypeOf(async function*(){}).constructor;const t=function(t){if(t===globalThis)return globalThis;for(const e in t)this[e]=t[e]};class e{constructor(t){this.ref={str:""},t instanceof e?(this.ref=t.ref,this.start=t.start,this.end=t.end):(this.ref.str=t,this.start=0,this.end=t.length)}substring(t,o){if(!this.length)return this;(t=this.start+t)<0&&(t=0),t>this.end&&(t=this.end),(o=void 0===o?this.end:this.start+o)<0&&(o=0),o>this.end&&(o=this.end);const n=new e(this);return n.start=t,n.end=o,n}get length(){const t=this.end-this.start;return t<0?0:t}char(t){if(this.start!==this.end)return this.ref.str[this.start+t]}toString(){return this.ref.str.substring(this.start,this.end)}trimStart(){const t=/^\s+/.exec(this.toString()),o=new e(this);return t&&(o.start+=t[0].length),o}slice(t,e){return t<0&&(t=this.end-this.start+t),t<0&&(t=0),void 0===e&&(e=this.end-this.start),e<0&&(e=this.end-this.start+e),e<0&&(e=0),this.substring(t,e)}trim(){const t=this.trimStart(),e=/\s+$/.exec(t.toString());return e&&(t.end-=e[0].length),t}valueOf(){return this.toString()}}function o(t){const e=Object.assign({},t);for(const t in e)e[t]=!0;return e}const n=new Set(["instanceof","typeof","return","throw","try","catch","if","finally","else","in","of","var","let","const","for","delete","false","true","while","do","break","continue","new","function","async","await","switch","case"]);class r{constructor(t,e={},n){this.const={},this.let={},this.var={};const r=void 0!==n||null===t;this.parent=t,this.allVars=e,this.let=r?this.let:o(e),this.var=r?o(e):this.var,this.globals=null===t?o(e):{},this.functionThis=n}get(t,e=!1){const o=this.functionThis;if("this"===t&&void 0!==o)return new c({this:o},t,!0,!1,!0);if(n.has(t))throw new SyntaxError("Unexepected token '"+t+"'");if(null===this.parent||!e||void 0!==o){if(this.globals.hasOwnProperty(t))return new c(o,t,!1,!0,!0);if(t in this.allVars&&(!(t in{})||this.allVars.hasOwnProperty(t)))return new c(this.allVars,t,this.const.hasOwnProperty(t),this.globals.hasOwnProperty(t),!0);if(null===this.parent)return new c(void 0,t)}return this.parent.get(t,e)}set(t,e){if("this"===t)throw new SyntaxError('"this" cannot be assigned');if(n.has(t))throw new SyntaxError("Unexepected token '"+t+"'");const o=this.get(t);if(void 0===o.context)throw new ReferenceError(`Variable '${t}' was not declared.`);if(o.isConst)throw new TypeError(`Cannot assign to const variable '${t}'`);if(o.isGlobal)throw new s(`Cannot override global variable '${t}'`);if(!(o.context instanceof Object))throw new s("Scope is not an object");return o.context[o.prop]=e,o}declare(t,e,o=void 0,r=!1){if("this"===t)throw new SyntaxError('"this" cannot be declared');if(n.has(t))throw new SyntaxError("Unexepected token '"+t+"'");if("var"===e&&void 0===this.functionThis&&null!==this.parent)return this.parent.declare(t,e,o,r);if((!this[e].hasOwnProperty(t)||"const"===e||this.globals.hasOwnProperty(t))&&t in this.allVars)throw new s(`Identifier '${t}' has already been declared`);return r&&(this.globals[t]=!0),this[e][t]=!0,this.allVars[t]=o,new c(this.allVars,t,this.const.hasOwnProperty(t),r)}}class i{}class s extends Error{}function a(t){return Array.isArray(t)&&"number"==typeof t[0]&&0!==t[0]&&88!==t[0]}class c{constructor(t,e,o=!1,n=!1,r=!1){this.context=t,this.prop=e,this.isConst=o,this.isGlobal=n,this.isVariable=r}get(t){const e=this.context;if(void 0===e)throw new ReferenceError(`${this.prop} is not defined`);if(null===e)throw new TypeError(`Cannot read properties of null, (reading '${this.prop}')`);return t.getSubscriptions.forEach(t=>t(e,this.prop)),e[this.prop]}}class l{constructor(t,e,o,n=!1,r=!1){this.auditReport=t,this.result=e,this.returned=o,this.breakLoop=n,this.continueLoop=r}}const p={};function d(t,e){const o={};return t.forEach((t,n)=>{t.startsWith("...")?o[t.substring(3)]=e.slice(n):o[t]=e[n]}),o}const u=new WeakSet;function f(t,e,o,n,i,a){if(n.ctx.options.forbidFunctionCreation)throw new s("Function creation is forbidden");let c;return c=void 0===a?(...s)=>{const a=d(t,s);return $(o,n,e,void 0===i?[]:[new r(i,a)]).result}:function(...s){const a=d(t,s);return $(o,n,e,void 0===i?[]:[new r(i,a,this)]).result},n.registerSandboxFunction(c),u.add(c),c}function h(t,e,o,n,i,a){if(n.ctx.options.forbidFunctionCreation)throw new s("Function creation is forbidden");if(!n.ctx.prototypeWhitelist?.has(Promise.prototype))throw new s("Async/await not permitted");let c;return c=void 0===a?async(...s)=>{const a=d(t,s);return(await U(o,n,e,void 0===i?[]:[new r(i,a)])).result}:async function(...s){const a=d(t,s);return(await U(o,n,e,void 0===i?[]:[new r(i,a,this)])).result},n.registerSandboxFunction(c),u.add(c),c}function v(t,e,o="assign"){if(void 0===t.context)throw new ReferenceError(`Cannot ${o} value to undefined.`);if("object"!=typeof t.context&&"function"!=typeof t.context)throw new SyntaxError(`Cannot ${o} value to a primitive.`);if(t.isConst)throw new TypeError(`Cannot set value to const variable '${t.prop}'`);if(t.isGlobal)throw new s(`Cannot ${o} property '${t.prop}' of a global object`);if(null===t.context)throw new TypeError("Cannot set properties of null");if("function"==typeof t.context[t.prop]&&!t.context.hasOwnProperty(t.prop))throw new s(`Override prototype property '${t.prop}' not allowed`);"delete"===o?t.context.hasOwnProperty(t.prop)&&(e.changeSubscriptions.get(t.context)?.forEach(e=>e({type:"delete",prop:t.prop})),e.changeSubscriptionsGlobal.get(t.context)?.forEach(e=>e({type:"delete",prop:t.prop}))):t.context.hasOwnProperty(t.prop)?(e.setSubscriptions.get(t.context)?.get(t.prop)?.forEach(t=>t({type:"replace"})),e.setSubscriptionsGlobal.get(t.context)?.get(t.prop)?.forEach(t=>t({type:"replace"}))):(e.changeSubscriptions.get(t.context)?.forEach(e=>e({type:"create",prop:t.prop})),e.changeSubscriptionsGlobal.get(t.context)?.forEach(e=>e({type:"create",prop:t.prop})))}const w=new Set([[].push,[].pop,[].shift,[].unshift,[].splice,[].reverse,[].sort,[].copyWithin]);class y{constructor(t,e){this.key=t,this.val=e}}class g{constructor(t){this.item=t}}class b{constructor(t){this.item=t}}class x{constructor(t,e){this.t=t,this.f=e}}const S=/(\$\$)*(\$)?\${(\d+)}/g,m=new Map;function E(t,e){m.set(t,e)}function I(t,e){return t instanceof c?t.get(e):t!==p?t:void 0}function O(t,e,o,n,r,i,s){e===P?function(t,e,o,n,r,i){const s=[];for(let c=0;c<e.length;c++){let p;try{p=R(o=>P(t,e[c],n,r,o,i)).result}catch(t){return void o(t)}if(p instanceof l&&(p.returned||p.breakLoop||p.continueLoop))return void o(void 0,p);if(a(e[c])&&8===e[c][0])return void o(void 0,new l(r.ctx.auditReport,p,!0));s.push(p)}o(void 0,s)}(t,o,n,r,i,s):async function(t,e,o,n,r,i){const s=[];for(let c=0;c<e.length;c++){let p;try{let o;p=!0===(o=A(o=>k(t,e[c],n,r,o,i))).isInstant?o.instant:(await o.p).result}catch(t){return void o(t)}if(p instanceof l&&(p.returned||p.breakLoop||p.continueLoop))return void o(void 0,p);if(a(e[c])&&8===e[c][0])return void o(void 0,new l(r.ctx.auditReport,p,!0));s.push(p)}o(void 0,s)}(t,o,n,r,i,s).catch(n)}function A(t){let e,o=!1;const n=new Promise((n,r)=>{t((t,i)=>{t?r(t):(o=!0,e=i,n({result:i}))})});return{isInstant:o,instant:e,p:n}}function R(t){let e,o;if(t((t,n)=>{o=t,e=n}),o)throw o;return{result:e}}async function k(t,e,o,n,r,i){let s=r;const l=new Promise(t=>{s=(e,o)=>{r(e,o),t()}});if(!F(t,e,o,n,s,!0,i)&&a(e)){let r,a=e[0];try{let s;r=!0===(s=A(r=>k(t,e[1],o,n,r,i))).isInstant?s.instant:(await s.p).result}catch(t){return void s(t)}let l,d=r;try{d=r instanceof c?r.get(n):r}catch(t){return void s(t)}if(20===a||21===a){if(null==d)return void s(void 0,p);a=20===a?1:5}if(d===p){if(1===a||5===a)return void s(void 0,d);d=void 0}try{let r;l=!0===(r=A(r=>k(t,e[2],o,n,r,i))).isInstant?r.instant:(await r.p).result}catch(t){return void s(t)}let u=l;try{u=l instanceof c?l.get(n):l}catch(t){return void s(t)}if(u===p&&(u=void 0),m.has(a))try{m.get(a)?.(k,s,t,d,u,r,n,o,l,i)}catch(t){s(t)}else s(new SyntaxError("Unknown operator: "+a))}await l}function P(t,e,o,n,r,i){if(!F(t,e,o,n,r,!1,i)&&a(e)){let s,a=e[0];try{s=R(r=>P(t,e[1],o,n,r,i)).result}catch(t){return void r(t)}let l,d=s;try{d=s instanceof c?s.get(n):s}catch(t){return void r(t)}if(20===a||21===a){if(null==d)return void r(void 0,p);a=20===a?1:5}if(d===p){if(1===a||5===a)return void r(void 0,d);d=void 0}try{l=R(r=>P(t,e[2],o,n,r,i)).result}catch(t){return void r(t)}let u=l;try{u=l instanceof c?l.get(n):l}catch(t){return void r(t)}if(u===p&&(u=void 0),m.has(a))try{m.get(a)?.(P,r,t,d,u,s,n,o,l,i)}catch(t){r(t)}else r(new SyntaxError("Unknown operator: "+a))}}E(1,(t,e,o,n,r,i,a,l)=>{if(null===n)throw new TypeError(`Cannot get property ${r} of null`);const p=typeof n;if("undefined"===p&&void 0===i){const t=l.get(r);if(t.context===a.ctx.sandboxGlobal){a.ctx.options.audit&&a.ctx.auditReport?.globalsAccess.add(r);const t=a.ctx.globalsWhitelist.has(a.ctx.sandboxGlobal[r])?a.evals.get(a.ctx.sandboxGlobal[r]):void 0;if(t)return void e(void 0,t)}return t.context&&t.context[r]===globalThis?void e(void 0,a.ctx.globalScope.get("this")):void e(void 0,t)}if(void 0===n)throw new s("Cannot get property '"+r+"' of undefined");if("object"!==p)"number"===p?n=new Number(n):"string"===p?n=new String(n):"boolean"===p&&(n=new Boolean(n));else if(void 0===n.hasOwnProperty)return void e(void 0,new c(void 0,r));const d="function"===p,f=d||!(n.hasOwnProperty(r)||"number"==typeof r);if(a.ctx.options.audit&&f&&"string"==typeof r){let t=Object.getPrototypeOf(n);do{t.hasOwnProperty(r)&&(a.ctx.auditReport&&!a.ctx.auditReport.prototypeAccess[t.constructor.name]&&(a.ctx.auditReport.prototypeAccess[t.constructor.name]=new Set),a.ctx.auditReport?.prototypeAccess[t.constructor.name].add(r))}while(t=Object.getPrototypeOf(t))}if(f){if(d&&!["name","length","constructor"].includes(r)&&n.hasOwnProperty(r)){const t=a.ctx.prototypeWhitelist.get(n.prototype),o=a.ctx.options.prototypeReplacements.get(n);if(o)return void e(void 0,new c(o(n,!0),r));if(!t||t.size&&!t.has(r))throw new s(`Static method or property access not permitted: ${n.name}.${r}`)}if("constructor"!==r){let t=n;for(;t=Object.getPrototypeOf(t);)if(t.hasOwnProperty(r)){const o=a.ctx.prototypeWhitelist.get(t),i=a.ctx.options.prototypeReplacements.get(t.constuctor);if(i)return void e(void 0,new c(i(n,!1),r));if(o&&(!o.size||o.has(r)))break;throw new s(`Method or property access not permitted: ${t.constructor.name}.${r}`)}}}if(a.evals.has(n[r]))return void e(void 0,a.evals.get(n[r]));if(n[r]===globalThis)return void e(void 0,a.ctx.globalScope.get("this"));const h=i.isGlobal||d&&!u.has(n)||a.ctx.globalsWhitelist.has(n);e(void 0,new c(n,r,!1,h))}),E(5,(t,e,o,n,r,i,a)=>{if(a.ctx.options.forbidFunctionCalls)throw new s("Function invocations are not allowed");if("function"!=typeof n)throw new TypeError(`${"symbol"==typeof i.prop?"Symbol":i.prop} is not a function`);const c=r.map(t=>t instanceof b?[...t.item]:[t]).flat().map(t=>I(t,a));if("function"!=typeof i){if(i.context[i.prop]===JSON.stringify&&a.getSubscriptions.size){const t=new Set,e=o=>{if(o&&"object"==typeof o&&!t.has(o)){t.add(o);for(const t of Object.keys(o))a.getSubscriptions.forEach(e=>e(o,t)),e(o[t])}};e(c[0])}if(i.context instanceof Array&&w.has(i.context[i.prop])&&(a.changeSubscriptions.get(i.context)||a.changeSubscriptionsGlobal.get(i.context))){let t,e=!1;if("push"===i.prop)t={type:"push",added:c},e=!!c.length;else if("pop"===i.prop)t={type:"pop",removed:i.context.slice(-1)},e=!!t.removed.length;else if("shift"===i.prop)t={type:"shift",removed:i.context.slice(0,1)},e=!!t.removed.length;else if("unshift"===i.prop)t={type:"unshift",added:c},e=!!c.length;else if("splice"===i.prop)t={type:"splice",startIndex:c[0],deleteCount:void 0===c[1]?i.context.length:c[1],added:c.slice(2),removed:i.context.slice(c[0],void 0===c[1]?void 0:c[0]+c[1])},e=!!t.added.length||!!t.removed.length;else if("reverse"===i.prop||"sort"===i.prop)t={type:i.prop},e=!!i.context.length;else if("copyWithin"===i.prop){const o=void 0===c[2]?i.context.length-c[1]:Math.min(i.context.length,c[2]-c[1]);t={type:"copyWithin",startIndex:c[0],endIndex:c[0]+o,added:i.context.slice(c[1],c[1]+o),removed:i.context.slice(c[0],c[0]+o)},e=!!t.added.length||!!t.removed.length}e&&(a.changeSubscriptions.get(i.context)?.forEach(e=>e(t)),a.changeSubscriptionsGlobal.get(i.context)?.forEach(e=>e(t)))}i.get(a),e(void 0,i.context[i.prop](...c))}else e(void 0,i(...c))}),E(22,(t,e,o,n,r)=>{let i={};for(const t of r)t.key instanceof g?i={...i,...t.key.item}:i[t.key]=t.val;e(void 0,i)}),E(6,(t,e,o,n,r)=>e(void 0,new y(n,r))),E(12,(t,e,o,n,r,i,s)=>{e(void 0,r.map(t=>t instanceof b?[...t.item]:[t]).flat().map(t=>I(t,s)))}),E(23,(t,e,o,n,r)=>e(void 0,r)),E(35,(t,e,o,n,r)=>{switch(r){case"true":return e(void 0,!0);case"false":return e(void 0,!1);case"null":return e(void 0,null);case"undefined":return e(void 0,void 0);case"NaN":return e(void 0,NaN);case"Infinity":return e(void 0,1/0)}e(new Error("Unknown symbol: "+r))}),E(7,(t,e,o,n,r)=>e(void 0,Number(r))),E(83,(t,e,o,n,r)=>e(void 0,BigInt(r))),E(2,(t,e,o,n,r,i,s)=>e(void 0,s.constants.strings[parseInt(r)])),E(85,(t,e,o,n,r,i,a)=>{const c=a.constants.regexes[parseInt(r)];if(!a.ctx.globalsWhitelist.has(RegExp))throw new s("Regex not permitted");e(void 0,new RegExp(c.regex,c.flags))}),E(84,(t,e,o,n,r,i,s,a)=>{const c=s.constants.literals[parseInt(r)],[,l,p]=c,d=[];let u;const f=[];for(;u=S.exec(l);)u[2]||(d.push(p[parseInt(u[3],10)]),f.push(u[3]));t(o,d,a,s,(t,o)=>{const n={};if(t)e(t);else{for(const t of Object.keys(o)){const e=f[t];n[e]=o[t]}e(void 0,l.replace(/(\\\\)*(\\)?\${(\d+)}/g,(t,e,o,r)=>{if(o)return t;return(e||"")+`${I(n[r],s)}`}))}})}),E(18,(t,e,o,n,r)=>{e(void 0,new b(r))}),E(17,(t,e,o,n,r)=>{e(void 0,new g(r))}),E(24,(t,e,o,n,r)=>e(void 0,!r)),E(64,(t,e,o,n,r)=>e(void 0,~r)),E(25,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,++i.context[i.prop])}),E(26,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]++)}),E(27,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,--i.context[i.prop])}),E(28,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]--)}),E(9,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]=r)}),E(66,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]+=r)}),E(65,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]-=r)}),E(67,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]/=r)}),E(69,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]*=r)}),E(68,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]**=r)}),E(70,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]%=r)}),E(71,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]^=r)}),E(72,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]&=r)}),E(73,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]|=r)}),E(76,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]<<=r)}),E(75,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]>>=r)}),E(74,(t,e,o,n,r,i,s)=>{v(i,s),e(void 0,i.context[i.prop]>>=r)}),E(57,(t,e,o,n,r)=>e(void 0,n>r)),E(56,(t,e,o,n,r)=>e(void 0,n<r)),E(55,(t,e,o,n,r)=>e(void 0,n>=r)),E(54,(t,e,o,n,r)=>e(void 0,n<=r)),E(52,(t,e,o,n,r)=>e(void 0,n==r)),E(32,(t,e,o,n,r)=>e(void 0,n===r)),E(53,(t,e,o,n,r)=>e(void 0,n!=r)),E(31,(t,e,o,n,r)=>e(void 0,n!==r)),E(29,(t,e,o,n,r)=>e(void 0,n&&r)),E(30,(t,e,o,n,r)=>e(void 0,n||r)),E(77,(t,e,o,n,r)=>e(void 0,n&r)),E(78,(t,e,o,n,r)=>e(void 0,n|r)),E(33,(t,e,o,n,r)=>e(void 0,n+r)),E(47,(t,e,o,n,r)=>e(void 0,n-r)),E(59,(t,e,o,n,r)=>e(void 0,+r)),E(58,(t,e,o,n,r)=>e(void 0,-r)),E(48,(t,e,o,n,r)=>e(void 0,n/r)),E(79,(t,e,o,n,r)=>e(void 0,n^r)),E(50,(t,e,o,n,r)=>e(void 0,n*r)),E(51,(t,e,o,n,r)=>e(void 0,n%r)),E(80,(t,e,o,n,r)=>e(void 0,n<<r)),E(81,(t,e,o,n,r)=>e(void 0,n>>r)),E(82,(t,e,o,n,r)=>e(void 0,n>>>r)),E(60,(t,e,o,n,r,i,s,a)=>{t(o,r,a,s,(t,o)=>{e(void 0,typeof I(o,s))})}),E(62,(t,e,o,n,r)=>e(void 0,n instanceof r)),E(63,(t,e,o,n,r)=>e(void 0,n in r)),E(61,(t,e,o,n,r,i,s,a,c)=>{void 0!==c.context?(v(c,s,"delete"),c.isVariable?e(void 0,!1):e(void 0,delete c.context?.[c.prop])):e(void 0,!0)}),E(8,(t,e,o,n,r)=>e(void 0,r)),E(34,(t,e,o,n,r,i,s,a)=>{e(void 0,a.declare(n,"var",r))}),E(3,(t,e,o,n,r,i,s,a,c)=>{e(void 0,a.declare(n,"let",r,c&&c.isGlobal))}),E(4,(t,e,o,n,r,i,s,a)=>{e(void 0,a.declare(n,"const",r))}),E(11,(t,o,n,r,i,a,c,l)=>{if(r=[...r],"string"==typeof a[2]||a[2]instanceof e){if(!c.allowJit||!c.evalContext)throw new s("Unevaluated code detected, JIT not allowed");a[2]=i=c.evalContext.lispifyFunction(new e(a[2]),c.constants)}r.shift()?o(void 0,h(r,i,n,c,l)):o(void 0,f(r,i,n,c,l))}),E(37,(t,o,n,r,i,a,c,l)=>{if("string"==typeof a[2]||a[2]instanceof e){if(!c.allowJit||!c.evalContext)throw new s("Unevaluated code detected, JIT not allowed");a[2]=i=c.evalContext.lispifyFunction(new e(a[2]),c.constants)}const p=r.shift(),d=r.shift();let u;u=88===p?h(r,i,n,c,l,d):f(r,i,n,c,l,d),d&&l.declare(d,"var",u),o(void 0,u)}),E(10,(t,o,n,i,a,c,l,p)=>{if("string"==typeof c[2]||c[2]instanceof e){if(!l.allowJit||!l.evalContext)throw new s("Unevaluated code detected, JIT not allowed");c[2]=a=l.evalContext.lispifyFunction(new e(c[2]),l.constants)}const d=i.shift(),u=i.shift();let v;u&&(p=new r(p,{})),v=88===d?h(i,a,n,l,p,u):f(i,a,n,l,p,u),u&&p.declare(u,"let",v),o(void 0,v)}),E(38,(t,e,o,n,i,s,a,c)=>{const[p,d,u,f,h,v,w]=n;let y=!0;const g=new r(c,{}),b={$$obj:void 0},x=new r(g,b);if(t===k)(async()=>{let n;for(n=A(e=>t(o,f,g,a,e)),b.$$obj=!0===(n=A(e=>t(o,u,g,a,e))).isInstant?n.instant:(await n.p).result,n=A(e=>t(o,d,x,a,e)),p&&(y=!0===(n=A(e=>t(o,v,x,a,e))).isInstant?n.instant:(await n.p).result);y;){const s={};n=A(e=>t(o,w,new r(x,s),a,e)),!0===n.isInstant?n.instant:(await n.p).result;const c=await U(o,a,i,[new r(g,s)],"loop");if(c instanceof l&&c.returned)return void e(void 0,c);if(c instanceof l&&c.breakLoop)break;n=A(e=>t(o,h,x,a,e)),y=!0===(n=A(e=>t(o,v,x,a,e))).isInstant?n.instant:(await n.p).result}e()})().catch(e);else{for(R(e=>t(o,f,g,a,e)),b.$$obj=R(e=>t(o,u,g,a,e)).result,R(e=>t(o,d,x,a,e)),p&&(y=R(e=>t(o,v,x,a,e)).result);y;){const n={};R(e=>t(o,w,new r(x,n),a,e));const s=$(o,a,i,[new r(g,n)],"loop");if(s instanceof l&&s.returned)return void e(void 0,s);if(s instanceof l&&s.breakLoop)break;R(e=>t(o,h,x,a,e)),y=R(e=>t(o,v,x,a,e)).result}e()}}),E(86,(t,e,o,n,r,i,a,c,p,d)=>{if("switch"===d&&"continue"===n||!d)throw new s("Illegal "+n+" statement");e(void 0,new l(a.ctx.auditReport,void 0,!1,"break"===n,"continue"===n))}),E(13,(t,e,o,n,r,i,s,a)=>{t(o,I(n,s)?r.t:r.f,a,s,e)}),E(15,(t,e,o,n,r,i,s,a)=>{t(o,I(n,s)?r.t:r.f,a,s,e)}),E(16,(t,e,o,n,r)=>e(void 0,new x(n,r))),E(14,(t,e,o,n,r)=>e(void 0,new x(n,r))),E(40,(t,e,o,n,r,i,s,a)=>{t(o,n,a,s,(n,i)=>{if(n)e(n);else if(i=I(i,s),t===P){let n,c=!1;for(const l of r)if(c||(c=!l[1]||i===I(R(e=>t(o,l[1],a,s,e)).result,s))){if(!l[2])continue;if(n=$(o,s,l[2],[a],"switch"),n.breakLoop)break;if(n.returned)return void e(void 0,n);if(!l[1])break}e()}else(async()=>{let n,c=!1;for(const l of r){let r;if(c||(c=!l[1]||i===I(!0===(r=A(e=>t(o,l[1],a,s,e))).isInstant?r.instant:(await r.p).result,s))){if(!l[2])continue;if(n=await U(o,s,l[2],[a],"switch"),n.breakLoop)break;if(n.returned)return void e(void 0,n);if(!l[1])break}}e()})().catch(e)})}),E(39,(t,e,o,n,i,s,a,c,l,p)=>{const[d,u,f]=i;j(t,(n,i)=>{j(t,s=>{s?e(s):n?j(t,e,o,a,u,[new r(c)],p):e(void 0,i)},o,a,f,[new r(c,{})])},o,a,n,[new r(c)],p)}),E(87,(t,e)=>{e()}),E(45,(t,e,o,n,r,i,a)=>{if(!a.ctx.globalsWhitelist.has(n)&&!u.has(n))throw new s(`Object construction not allowed: ${n.constructor.name}`);e(void 0,new n(...r))}),E(46,(t,e,o,n,r)=>{e(r)}),E(43,(t,e,o,n)=>e(void 0,n.pop())),E(0,(t,e)=>e());const C=new Set([11,37,10,38,39,40,14,16,60]);function F(t,e,o,n,r,i,l){const d=i?k:P;if(n.ctx.options.executionQuota&&n.ctx.options.executionQuota<=t.ticks&&("function"!=typeof n.ctx.options.onExecutionQuotaReached||!n.ctx.options.onExecutionQuotaReached(t,o,n,e)))return r(new s("Execution quota exceeded")),!0;if(t.ticks++,e instanceof c)try{r(void 0,e.get(n))}catch(t){r(t)}else if(e===p)r();else if(Array.isArray(e)&&!a(e))0===e[0]?r():O(t,d,e,r,o,n,l);else if(a(e))if(42===e[0])O(t,d,e[1],r,o,n,l);else if(44===e[0])i?n.ctx.prototypeWhitelist?.has(Promise.prototype)?k(t,e[1],o,n,async(t,e)=>{if(t)r(t);else try{r(void 0,await I(e,n))}catch(t){r(t)}},l).catch(r):r(new s("Async/await is not permitted")):r(new s("Illegal use of 'await', must be inside async function"));else{if(!C.has(e[0]))return!1;try{m.get(e[0])?.(d,r,t,e[1],e[2],e,n,o,void 0,l)}catch(t){r(t)}}else r(void 0,e);return!0}function $(t,e,o,n=[],r){return R(i=>j(P,i,t,e,o,n,r)).result}async function U(t,e,o,n=[],r){let i;return!0===(i=A(i=>j(k,i,t,e,o,n,r))).isInstant?i.instant:(await i.p).result}function j(t,e,o,n,s,c=[],p){if(!s)return void e();if(!(s instanceof Array))throw new SyntaxError("Bad execution tree");let d,u=n.ctx.globalScope;for(;d=c.shift();)"object"==typeof d&&(u=d instanceof r?d:new r(u,d,d instanceof i?void 0:null));n.ctx.options.audit&&!n.ctx.auditReport&&(n.ctx.auditReport={globalsAccess:new Set,prototypeAccess:{}}),t===P?function(t,e,o,n,r,i){if(!(n instanceof Array))throw new SyntaxError("Bad execution tree");let s=0;for(s=0;s<n.length;s++){let c,p;const d=n[s];try{P(e,d,r,o,(t,e)=>{p=t,c=e},i)}catch(t){p=t}if(p)return void t(p);if(c instanceof l)return void t(void 0,c);if(a(d)&&8===d[0])return void t(void 0,new l(o.ctx.auditReport,c,!0))}t(void 0,new l(o.ctx.auditReport,void 0,!1))}(e,o,n,s,u,p):async function(t,e,o,n,r,i){if(!(n instanceof Array))throw new SyntaxError("Bad execution tree");let s=0;for(s=0;s<n.length;s++){let c,p;const d=n[s];try{await k(e,d,r,o,(t,e)=>{p=t,c=e},i)}catch(t){p=t}if(p)return void t(p);if(c instanceof l)return void t(void 0,c);if(a(d)&&8===d[0])return void t(void 0,new l(o.ctx.auditReport,c,!0))}t(void 0,new l(o.ctx.auditReport,void 0,!1))}(e,o,n,s,u,p).catch(e)}function W(t,e,o,n){if(!(t instanceof Object))throw new Error("Invalid subscription object, got "+("object"==typeof t?"null":typeof t));const r=n.setSubscriptions.get(t)||new Map;n.setSubscriptions.set(t,r);const i=r.get(e)||new Set;let s;r.set(e,i),i.add(o);const a=t[e];return a instanceof Object&&(s=n.changeSubscriptions.get(a)||new Set,s.add(o),n.changeSubscriptions.set(a,s)),{unsubscribe:()=>{i.delete(o),s?.delete(o)}}}BigInt(0);class T{constructor(e,o){this.evalContext=o,this.setSubscriptions=new WeakMap,this.changeSubscriptions=new WeakMap,this.sandboxFunctions=new WeakMap;const n=Object.assign({audit:!1,forbidFunctionCalls:!1,forbidFunctionCreation:!1,globals:T.SAFE_GLOBALS,prototypeWhitelist:T.SAFE_PROTOTYPES,prototypeReplacements:new Map},e||{});this.context=function(e,o){const n=new t(o.globals),i={sandbox:e,globalsWhitelist:new Set(Object.values(o.globals)),prototypeWhitelist:new Map([...o.prototypeWhitelist].map(t=>[t[0].prototype,t[1]])),options:o,globalScope:new r(null,o.globals,n),sandboxGlobal:n};return i.prototypeWhitelist.set(Object.getPrototypeOf([][Symbol.iterator]()),new Set),i}(this,n)}static get SAFE_GLOBALS(){return{Function:Function,console:{debug:console.debug,error:console.error,info:console.info,log:console.log,table:console.table,warn:console.warn},isFinite:isFinite,isNaN:isNaN,parseFloat:parseFloat,parseInt:parseInt,decodeURI:decodeURI,decodeURIComponent:decodeURIComponent,encodeURI:encodeURI,encodeURIComponent:encodeURIComponent,escape:escape,unescape:unescape,Boolean:Boolean,Number:Number,BigInt:BigInt,String:String,Object:Object,Array:Array,Symbol:Symbol,Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError,Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,Map:Map,Set:Set,WeakMap:WeakMap,WeakSet:WeakSet,Promise:Promise,Intl:Intl,JSON:JSON,Math:Math,Date:Date,RegExp:RegExp}}static get SAFE_PROTOTYPES(){const e=[t,Function,Boolean,Number,BigInt,String,Date,Error,Array,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Map,Set,WeakMap,WeakSet,Promise,Symbol,Date,RegExp],o=new Map;return e.forEach(t=>{o.set(t,new Set)}),o.set(Object,new Set(["entries","fromEntries","getOwnPropertyNames","is","keys","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","values"])),o}subscribeGet(t,e){return e.getSubscriptions.add(t),{unsubscribe:()=>e.getSubscriptions.delete(t)}}subscribeSet(t,e,o,n){return W(t,e,o,n)}subscribeSetGlobal(t,e,o){return W(t,e,o,this)}getContext(t){return this.sandboxFunctions.get(t)}executeTree(t,e=[]){return $({ticks:BigInt(0)},t,t.tree,e)}executeTreeAsync(t,e=[]){return U({ticks:BigInt(0)},t,t.tree,e)}}export{T as default};
2
2
  //# sourceMappingURL=SandboxExec.min.js.map