@aztec/txe 5.1.0-nightly.20260716 → 5.1.0-nightly.20260718

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.
package/dest/bin/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
2
  import { createRequire as __txeCreateRequire } from 'node:module';
3
3
  const require = __txeCreateRequire(import.meta.url);
4
- import{createTXERpcServer,startHttpRpcServer}from"../chunk-RELAEYUE.js";import{createLogger}from"../chunk-EKHK6CRD.js";import{__name}from"../chunk-BJVAAXNA.js";process.env.HARDWARE_CONCURRENCY??="2";async function main(){let{TXE_PORT=8080}=process.env;process.on("SIGTERM",()=>{logger.info("Received SIGTERM."),process.exit(0)}),process.on("SIGINT",()=>{logger.info("Received SIGTERM."),process.exit(0)});let logger=createLogger("txe:rpc");logger.info("Setting up TXE...");let txeServer=await createTXERpcServer(logger),{port}=await startHttpRpcServer(txeServer,{host:"127.0.0.1",port:TXE_PORT,timeoutMs:1e3*60*5});logger.info(`TXE listening on port ${port}`)}__name(main,"main");main().catch(err=>{console.error(err),process.exit(1)});
4
+ import{createTXERpcServer,startHttpRpcServer}from"../chunk-VAJUWD27.js";import{createLogger}from"../chunk-ZM5DRIY2.js";import{__name}from"../chunk-BJVAAXNA.js";process.env.HARDWARE_CONCURRENCY??="2";async function main(){let{TXE_PORT=8080}=process.env;process.on("SIGTERM",()=>{logger.info("Received SIGTERM."),process.exit(0)}),process.on("SIGINT",()=>{logger.info("Received SIGTERM."),process.exit(0)});let logger=createLogger("txe:rpc");logger.info("Setting up TXE...");let txeServer=await createTXERpcServer(logger),{port}=await startHttpRpcServer(txeServer,{host:"127.0.0.1",port:TXE_PORT,timeoutMs:1e3*60*5});logger.info(`TXE listening on port ${port}`)}__name(main,"main");main().catch(err=>{console.error(err),process.exit(1)});
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __txeCreateRequire } from 'node:module';
2
2
  const require = __txeCreateRequire(import.meta.url);
3
- import{ContractStore,Fr,LazyProtocolContractsProvider,TXEDispatcher,TXEDispatcherApiSchema,TXE_REQUIRED_PROTOCOL_CONTRACTS,ZodError,createLogger,external_exports,getContractClassFromArtifact,getSchemaParameters,getStandardAuthRegistry,getStandardHandshakeRegistry,jsonStringify,loadContractArtifact,openEphemeralStore,parseWithOptionals,promiseWithResolvers,require_inherits,schemaHasMethod,sha256ToField}from"./chunk-EKHK6CRD.js";import{__commonJS,__name,__require,__toESM}from"./chunk-BJVAAXNA.js";var require_vary=__commonJS({"../node_modules/vary/index.js"(exports2,module2){"use strict";module2.exports=vary;module2.exports.append=append;var FIELD_NAME_REGEXP=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function append(header,field){if(typeof header!="string")throw new TypeError("header argument is required");if(!field)throw new TypeError("field argument is required");for(var fields=Array.isArray(field)?field:parse(String(field)),j=0;j<fields.length;j++)if(!FIELD_NAME_REGEXP.test(fields[j]))throw new TypeError("field argument contains an invalid header name");if(header==="*")return header;var val=header,vals=parse(header.toLowerCase());if(fields.indexOf("*")!==-1||vals.indexOf("*")!==-1)return"*";for(var i=0;i<fields.length;i++){var fld=fields[i].toLowerCase();vals.indexOf(fld)===-1&&(vals.push(fld),val=val?val+", "+fields[i]:fields[i])}return val}__name(append,"append");function parse(header){for(var end=0,list=[],start=0,i=0,len=header.length;i<len;i++)switch(header.charCodeAt(i)){case 32:start===end&&(start=end=i+1);break;case 44:list.push(header.substring(start,end)),start=end=i+1;break;default:end=i+1;break}return list.push(header.substring(start,end)),list}__name(parse,"parse");function vary(res,field){if(!res||!res.getHeader||!res.setHeader)throw new TypeError("res argument is required");var val=res.getHeader("Vary")||"",header=Array.isArray(val)?val.join(", "):String(val);(val=append(header,field))&&res.setHeader("Vary",val)}__name(vary,"vary")}});var require_cors=__commonJS({"../node_modules/@koa/cors/index.js"(exports2,module2){var vary=require_vary();module2.exports=function(options){return options={...{allowMethods:"GET,HEAD,PUT,POST,DELETE,PATCH",secureContext:!1},...options},Array.isArray(options.exposeHeaders)&&(options.exposeHeaders=options.exposeHeaders.join(",")),Array.isArray(options.allowMethods)&&(options.allowMethods=options.allowMethods.join(",")),Array.isArray(options.allowHeaders)&&(options.allowHeaders=options.allowHeaders.join(",")),options.maxAge&&(options.maxAge=String(options.maxAge)),options.keepHeadersOnError=options.keepHeadersOnError===void 0||!!options.keepHeadersOnError,__name(async function(ctx,next){let requestOrigin=ctx.get("Origin");ctx.vary("Origin");let origin;if(typeof options.origin=="function"){if(origin=await options.origin(ctx),!origin)return await next()}else origin=options.origin||"*";let credentials;typeof options.credentials=="function"?credentials=await options.credentials(ctx):credentials=!!options.credentials,credentials&&origin==="*"&&(origin=requestOrigin);let headersSet={};function set(key,value){ctx.set(key,value),headersSet[key]=value}if(__name(set,"set"),ctx.method!=="OPTIONS"){if(set("Access-Control-Allow-Origin",origin),credentials===!0&&set("Access-Control-Allow-Credentials","true"),options.exposeHeaders&&set("Access-Control-Expose-Headers",options.exposeHeaders),options.secureContext&&(set("Cross-Origin-Opener-Policy","same-origin"),set("Cross-Origin-Embedder-Policy","require-corp")),!options.keepHeadersOnError)return await next();try{return await next()}catch(err){let errHeadersSet=err.headers||{},varyWithOrigin=vary.append(errHeadersSet.vary||errHeadersSet.Vary||"","Origin");throw delete errHeadersSet.Vary,err.headers={...errHeadersSet,...headersSet,vary:varyWithOrigin},err}}else{if(!ctx.get("Access-Control-Request-Method"))return await next();ctx.set("Access-Control-Allow-Origin",origin),credentials===!0&&ctx.set("Access-Control-Allow-Credentials","true"),options.maxAge&&ctx.set("Access-Control-Max-Age",options.maxAge),options.privateNetworkAccess&&ctx.get("Access-Control-Request-Private-Network")&&ctx.set("Access-Control-Allow-Private-Network","true"),options.allowMethods&&ctx.set("Access-Control-Allow-Methods",options.allowMethods),options.secureContext&&(set("Cross-Origin-Opener-Policy","same-origin"),set("Cross-Origin-Embedder-Policy","require-corp"));let allowHeaders=options.allowHeaders;allowHeaders||(allowHeaders=ctx.get("Access-Control-Request-Headers")),allowHeaders&&ctx.set("Access-Control-Allow-Headers",allowHeaders),ctx.status=204}},"cors")}}});var require_es_object_atoms=__commonJS({"../node_modules/es-object-atoms/index.js"(exports2,module2){"use strict";module2.exports=Object}});var require_es_errors=__commonJS({"../node_modules/es-errors/index.js"(exports2,module2){"use strict";module2.exports=Error}});var require_eval=__commonJS({"../node_modules/es-errors/eval.js"(exports2,module2){"use strict";module2.exports=EvalError}});var require_range=__commonJS({"../node_modules/es-errors/range.js"(exports2,module2){"use strict";module2.exports=RangeError}});var require_ref=__commonJS({"../node_modules/es-errors/ref.js"(exports2,module2){"use strict";module2.exports=ReferenceError}});var require_syntax=__commonJS({"../node_modules/es-errors/syntax.js"(exports2,module2){"use strict";module2.exports=SyntaxError}});var require_type=__commonJS({"../node_modules/es-errors/type.js"(exports2,module2){"use strict";module2.exports=TypeError}});var require_uri=__commonJS({"../node_modules/es-errors/uri.js"(exports2,module2){"use strict";module2.exports=URIError}});var require_abs=__commonJS({"../node_modules/math-intrinsics/abs.js"(exports2,module2){"use strict";module2.exports=Math.abs}});var require_floor=__commonJS({"../node_modules/math-intrinsics/floor.js"(exports2,module2){"use strict";module2.exports=Math.floor}});var require_max=__commonJS({"../node_modules/math-intrinsics/max.js"(exports2,module2){"use strict";module2.exports=Math.max}});var require_min=__commonJS({"../node_modules/math-intrinsics/min.js"(exports2,module2){"use strict";module2.exports=Math.min}});var require_pow=__commonJS({"../node_modules/math-intrinsics/pow.js"(exports2,module2){"use strict";module2.exports=Math.pow}});var require_round=__commonJS({"../node_modules/math-intrinsics/round.js"(exports2,module2){"use strict";module2.exports=Math.round}});var require_isNaN=__commonJS({"../node_modules/math-intrinsics/isNaN.js"(exports2,module2){"use strict";module2.exports=Number.isNaN||__name(function(a){return a!==a},"isNaN")}});var require_sign=__commonJS({"../node_modules/math-intrinsics/sign.js"(exports2,module2){"use strict";var $isNaN=require_isNaN();module2.exports=__name(function(number){return $isNaN(number)||number===0?number:number<0?-1:1},"sign")}});var require_gOPD=__commonJS({"../node_modules/gopd/gOPD.js"(exports2,module2){"use strict";module2.exports=Object.getOwnPropertyDescriptor}});var require_gopd=__commonJS({"../node_modules/gopd/index.js"(exports2,module2){"use strict";var $gOPD=require_gOPD();if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}module2.exports=$gOPD}});var require_es_define_property=__commonJS({"../node_modules/es-define-property/index.js"(exports2,module2){"use strict";var $defineProperty=Object.defineProperty||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch{$defineProperty=!1}module2.exports=$defineProperty}});var require_shams=__commonJS({"../node_modules/has-symbols/shams.js"(exports2,module2){"use strict";module2.exports=__name(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var obj={},sym=Symbol("test"),symObj=Object(sym);if(typeof sym=="string"||Object.prototype.toString.call(sym)!=="[object Symbol]"||Object.prototype.toString.call(symObj)!=="[object Symbol]")return!1;var symVal=42;obj[sym]=symVal;for(var _ in obj)return!1;if(typeof Object.keys=="function"&&Object.keys(obj).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(obj).length!==0)return!1;var syms=Object.getOwnPropertySymbols(obj);if(syms.length!==1||syms[0]!==sym||!Object.prototype.propertyIsEnumerable.call(obj,sym))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var descriptor=Object.getOwnPropertyDescriptor(obj,sym);if(descriptor.value!==symVal||descriptor.enumerable!==!0)return!1}return!0},"hasSymbols")}});var require_has_symbols=__commonJS({"../node_modules/has-symbols/index.js"(exports2,module2){"use strict";var origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=require_shams();module2.exports=__name(function(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()},"hasNativeSymbols")}});var require_Reflect_getPrototypeOf=__commonJS({"../node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2,module2){"use strict";module2.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}});var require_Object_getPrototypeOf=__commonJS({"../node_modules/get-proto/Object.getPrototypeOf.js"(exports2,module2){"use strict";var $Object=require_es_object_atoms();module2.exports=$Object.getPrototypeOf||null}});var require_implementation=__commonJS({"../node_modules/function-bind/implementation.js"(exports2,module2){"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=__name(function(a,b){for(var arr=[],i=0;i<a.length;i+=1)arr[i]=a[i];for(var j=0;j<b.length;j+=1)arr[j+a.length]=b[j];return arr},"concatty"),slicy=__name(function(arrLike,offset){for(var arr=[],i=offset||0,j=0;i<arrLike.length;i+=1,j+=1)arr[j]=arrLike[i];return arr},"slicy"),joiny=__name(function(arr,joiner){for(var str="",i=0;i<arr.length;i+=1)str+=arr[i],i+1<arr.length&&(str+=joiner);return str},"joiny");module2.exports=__name(function(that){var target=this;if(typeof target!="function"||toStr.apply(target)!==funcType)throw new TypeError(ERROR_MESSAGE+target);for(var args2=slicy(arguments,1),bound,binder=__name(function(){if(this instanceof bound){var result=target.apply(this,concatty(args2,arguments));return Object(result)===result?result:this}return target.apply(that,concatty(args2,arguments))},"binder"),boundLength=max(0,target.length-args2.length),boundArgs=[],i=0;i<boundLength;i++)boundArgs[i]="$"+i;if(bound=Function("binder","return function ("+joiny(boundArgs,",")+"){ return binder.apply(this,arguments); }")(binder),target.prototype){var Empty=__name(function(){},"Empty");Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null}return bound},"bind")}});var require_function_bind=__commonJS({"../node_modules/function-bind/index.js"(exports2,module2){"use strict";var implementation=require_implementation();module2.exports=Function.prototype.bind||implementation}});var require_functionCall=__commonJS({"../node_modules/call-bind-apply-helpers/functionCall.js"(exports2,module2){"use strict";module2.exports=Function.prototype.call}});var require_functionApply=__commonJS({"../node_modules/call-bind-apply-helpers/functionApply.js"(exports2,module2){"use strict";module2.exports=Function.prototype.apply}});var require_reflectApply=__commonJS({"../node_modules/call-bind-apply-helpers/reflectApply.js"(exports2,module2){"use strict";module2.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}});var require_actualApply=__commonJS({"../node_modules/call-bind-apply-helpers/actualApply.js"(exports2,module2){"use strict";var bind=require_function_bind(),$apply=require_functionApply(),$call=require_functionCall(),$reflectApply=require_reflectApply();module2.exports=$reflectApply||bind.call($call,$apply)}});var require_call_bind_apply_helpers=__commonJS({"../node_modules/call-bind-apply-helpers/index.js"(exports2,module2){"use strict";var bind=require_function_bind(),$TypeError=require_type(),$call=require_functionCall(),$actualApply=require_actualApply();module2.exports=__name(function(args2){if(args2.length<1||typeof args2[0]!="function")throw new $TypeError("a function is required");return $actualApply(bind,$call,args2)},"callBindBasic")}});var require_get=__commonJS({"../node_modules/dunder-proto/get.js"(exports2,module2){"use strict";var callBind=require_call_bind_apply_helpers(),gOPD=require_gopd(),hasProtoAccessor;try{hasProtoAccessor=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module2.exports=desc&&typeof desc.get=="function"?callBind([desc.get]):typeof $getPrototypeOf=="function"?__name(function(value){return $getPrototypeOf(value==null?value:$Object(value))},"getDunder"):!1}});var require_get_proto=__commonJS({"../node_modules/get-proto/index.js"(exports2,module2){"use strict";var reflectGetProto=require_Reflect_getPrototypeOf(),originalGetProto=require_Object_getPrototypeOf(),getDunderProto=require_get();module2.exports=reflectGetProto?__name(function(O){return reflectGetProto(O)},"getProto"):originalGetProto?__name(function(O){if(!O||typeof O!="object"&&typeof O!="function")throw new TypeError("getProto: not an object");return originalGetProto(O)},"getProto"):getDunderProto?__name(function(O){return getDunderProto(O)},"getProto"):null}});var require_hasown=__commonJS({"../node_modules/hasown/index.js"(exports2,module2){"use strict";var call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind=require_function_bind();module2.exports=bind.call(call,$hasOwn)}});var require_get_intrinsic=__commonJS({"../node_modules/get-intrinsic/index.js"(exports2,module2){"use strict";var undefined2,$Object=require_es_object_atoms(),$Error=require_es_errors(),$EvalError=require_eval(),$RangeError=require_range(),$ReferenceError=require_ref(),$SyntaxError=require_syntax(),$TypeError=require_type(),$URIError=require_uri(),abs=require_abs(),floor=require_floor(),max=require_max(),min=require_min(),pow=require_pow(),round=require_round(),sign=require_sign(),$Function=Function,getEvalledConstructor=__name(function(expressionSyntax){try{return $Function('"use strict"; return ('+expressionSyntax+").constructor;")()}catch{}},"getEvalledConstructor"),$gOPD=require_gopd(),$defineProperty=require_es_define_property(),throwTypeError=__name(function(){throw new $TypeError},"throwTypeError"),ThrowTypeError=$gOPD?(function(){try{return arguments.callee,throwTypeError}catch{try{return $gOPD(arguments,"callee").get}catch{return throwTypeError}}})():throwTypeError,hasSymbols=require_has_symbols()(),getProto=require_get_proto(),$ObjectGPO=require_Object_getPrototypeOf(),$ReflectGPO=require_Reflect_getPrototypeOf(),$apply=require_functionApply(),$call=require_functionCall(),needsEval={},TypedArray=typeof Uint8Array>"u"||!getProto?undefined2:getProto(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined2:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined2:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined2,"%AsyncFromSyncIteratorPrototype%":undefined2,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined2:Atomics,"%BigInt%":typeof BigInt>"u"?undefined2:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined2:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined2:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined2:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":typeof Float16Array>"u"?undefined2:Float16Array,"%Float32Array%":typeof Float32Array>"u"?undefined2:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined2:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined2:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined2:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined2:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined2:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined2,"%JSON%":typeof JSON=="object"?JSON:undefined2,"%Map%":typeof Map>"u"?undefined2:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined2:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined2:Promise,"%Proxy%":typeof Proxy>"u"?undefined2:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined2:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined2:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined2:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined2:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined2,"%Symbol%":hasSymbols?Symbol:undefined2,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":typeof Uint8Array>"u"?undefined2:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined2:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined2:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined2:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined2:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined2:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined2:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(e){errorProto=getProto(getProto(e)),INTRINSICS["%Error.prototype%"]=errorProto}var errorProto,doEval=__name(function doEval2(name){var value;if(name==="%AsyncFunction%")value=getEvalledConstructor("async function () {}");else if(name==="%GeneratorFunction%")value=getEvalledConstructor("function* () {}");else if(name==="%AsyncGeneratorFunction%")value=getEvalledConstructor("async function* () {}");else if(name==="%AsyncGenerator%"){var fn2=doEval2("%AsyncGeneratorFunction%");fn2&&(value=fn2.prototype)}else if(name==="%AsyncIteratorPrototype%"){var gen=doEval2("%AsyncGenerator%");gen&&getProto&&(value=getProto(gen.prototype))}return INTRINSICS[name]=value,value},"doEval"),LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require_function_bind(),hasOwn=require_hasown(),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=__name(function(string){var first=$strSlice(string,0,1),last=$strSlice(string,-1);if(first==="%"&&last!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(last==="%"&&first!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var result=[];return $replace(string,rePropName,function(match,number,quote,subString){result[result.length]=quote?$replace(subString,reEscapeChar,"$1"):number||match}),result},"stringToPath"),getBaseIntrinsic=__name(function(name,allowMissing){var intrinsicName=name,alias;if(hasOwn(LEGACY_ALIASES,intrinsicName)&&(alias=LEGACY_ALIASES[intrinsicName],intrinsicName="%"+alias[0]+"%"),hasOwn(INTRINSICS,intrinsicName)){var value=INTRINSICS[intrinsicName];if(value===needsEval&&(value=doEval(intrinsicName)),typeof value>"u"&&!allowMissing)throw new $TypeError("intrinsic "+name+" exists, but is not available. Please file an issue!");return{alias,name:intrinsicName,value}}throw new $SyntaxError("intrinsic "+name+" does not exist!")},"getBaseIntrinsic");module2.exports=__name(function(name,allowMissing){if(typeof name!="string"||name.length===0)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof allowMissing!="boolean")throw new $TypeError('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,name)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var parts=stringToPath(name),intrinsicBaseName=parts.length>0?parts[0]:"",intrinsic=getBaseIntrinsic("%"+intrinsicBaseName+"%",allowMissing),intrinsicRealName=intrinsic.name,value=intrinsic.value,skipFurtherCaching=!1,alias=intrinsic.alias;alias&&(intrinsicBaseName=alias[0],$spliceApply(parts,$concat([0,1],alias)));for(var i=1,isOwn=!0;i<parts.length;i+=1){var part=parts[i],first=$strSlice(part,0,1),last=$strSlice(part,-1);if((first==='"'||first==="'"||first==="`"||last==='"'||last==="'"||last==="`")&&first!==last)throw new $SyntaxError("property names with quotes must have matching quotes");if((part==="constructor"||!isOwn)&&(skipFurtherCaching=!0),intrinsicBaseName+="."+part,intrinsicRealName="%"+intrinsicBaseName+"%",hasOwn(INTRINSICS,intrinsicRealName))value=INTRINSICS[intrinsicRealName];else if(value!=null){if(!(part in value)){if(!allowMissing)throw new $TypeError("base intrinsic for "+name+" exists, but the property is not available.");return}if($gOPD&&i+1>=parts.length){var desc=$gOPD(value,part);isOwn=!!desc,isOwn&&"get"in desc&&!("originalValue"in desc.get)?value=desc.get:value=value[part]}else isOwn=hasOwn(value,part),value=value[part];isOwn&&!skipFurtherCaching&&(INTRINSICS[intrinsicRealName]=value)}}return value},"GetIntrinsic")}});var require_call_bound=__commonJS({"../node_modules/call-bound/index.js"(exports2,module2){"use strict";var GetIntrinsic=require_get_intrinsic(),callBindBasic=require_call_bind_apply_helpers(),$indexOf=callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);module2.exports=__name(function(name,allowMissing){var intrinsic=GetIntrinsic(name,!!allowMissing);return typeof intrinsic=="function"&&$indexOf(name,".prototype.")>-1?callBindBasic([intrinsic]):intrinsic},"callBoundIntrinsic")}});var require_shams2=__commonJS({"../node_modules/has-tostringtag/shams.js"(exports2,module2){"use strict";var hasSymbols=require_shams();module2.exports=__name(function(){return hasSymbols()&&!!Symbol.toStringTag},"hasToStringTagShams")}});var require_is_regex=__commonJS({"../node_modules/is-regex/index.js"(exports2,module2){"use strict";var callBound=require_call_bound(),hasToStringTag=require_shams2()(),hasOwn=require_hasown(),gOPD=require_gopd(),fn2;hasToStringTag?($exec=callBound("RegExp.prototype.exec"),isRegexMarker={},throwRegexMarker=__name(function(){throw isRegexMarker},"throwRegexMarker"),badStringifier={toString:throwRegexMarker,valueOf:throwRegexMarker},typeof Symbol.toPrimitive=="symbol"&&(badStringifier[Symbol.toPrimitive]=throwRegexMarker),fn2=__name(function(value){if(!value||typeof value!="object")return!1;var descriptor=gOPD(value,"lastIndex"),hasLastIndexDataProperty=descriptor&&hasOwn(descriptor,"value");if(!hasLastIndexDataProperty)return!1;try{$exec(value,badStringifier)}catch(e){return e===isRegexMarker}},"isRegex")):($toString=callBound("Object.prototype.toString"),regexClass="[object RegExp]",fn2=__name(function(value){return!value||typeof value!="object"&&typeof value!="function"?!1:$toString(value)===regexClass},"isRegex"));var $exec,isRegexMarker,throwRegexMarker,badStringifier,$toString,regexClass;module2.exports=fn2}});var require_safe_regex_test=__commonJS({"../node_modules/safe-regex-test/index.js"(exports2,module2){"use strict";var callBound=require_call_bound(),isRegex=require_is_regex(),$exec=callBound("RegExp.prototype.exec"),$TypeError=require_type();module2.exports=__name(function(regex){if(!isRegex(regex))throw new $TypeError("`regex` must be a RegExp");return __name(function(s){return $exec(regex,s)!==null},"test")},"regexTester")}});var require_is_generator_function=__commonJS({"../node_modules/is-generator-function/index.js"(exports2,module2){"use strict";var callBound=require_call_bound(),safeRegexTest=require_safe_regex_test(),isFnRegex=safeRegexTest(/^\s*(?:function)?\*/),hasToStringTag=require_shams2()(),getProto=require_get_proto(),toStr=callBound("Object.prototype.toString"),fnToStr=callBound("Function.prototype.toString"),getGeneratorFunc=__name(function(){if(!hasToStringTag)return!1;try{return Function("return function*() {}")()}catch{}},"getGeneratorFunc"),GeneratorFunction;module2.exports=__name(function(fn2){if(typeof fn2!="function")return!1;if(isFnRegex(fnToStr(fn2)))return!0;if(!hasToStringTag){var str=toStr(fn2);return str==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var generatorFunc=getGeneratorFunc();GeneratorFunction=generatorFunc?getProto(generatorFunc):!1}return getProto(fn2)===GeneratorFunction},"isGeneratorFunction")}});var require_ms=__commonJS({"../node_modules/ms/index.js"(exports2,module2){var s=1e3,m=s*60,h=m*60,d=h*24,w=d*7,y=d*365.25;module2.exports=function(val,options){options=options||{};var type=typeof val;if(type==="string"&&val.length>0)return parse(val);if(type==="number"&&isFinite(val))return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){if(str=String(str),!(str.length>100)){var match=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]),type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}__name(parse,"parse");function fmtShort(ms){var msAbs=Math.abs(ms);return msAbs>=d?Math.round(ms/d)+"d":msAbs>=h?Math.round(ms/h)+"h":msAbs>=m?Math.round(ms/m)+"m":msAbs>=s?Math.round(ms/s)+"s":ms+"ms"}__name(fmtShort,"fmtShort");function fmtLong(ms){var msAbs=Math.abs(ms);return msAbs>=d?plural(ms,msAbs,d,"day"):msAbs>=h?plural(ms,msAbs,h,"hour"):msAbs>=m?plural(ms,msAbs,m,"minute"):msAbs>=s?plural(ms,msAbs,s,"second"):ms+" ms"}__name(fmtLong,"fmtLong");function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+" "+name+(isPlural?"s":"")}__name(plural,"plural")}});var require_common=__commonJS({"../node_modules/debug/src/common.js"(exports2,module2){function setup(env){createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=coerce,createDebug.disable=disable,createDebug.enable=enable,createDebug.enabled=enabled,createDebug.humanize=require_ms(),createDebug.destroy=destroy,Object.keys(env).forEach(key=>{createDebug[key]=env[key]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={};function selectColor(namespace){let hash=0;for(let i=0;i<namespace.length;i++)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return createDebug.colors[Math.abs(hash)%createDebug.colors.length]}__name(selectColor,"selectColor"),createDebug.selectColor=selectColor;function createDebug(namespace){let prevTime,enableOverride=null,namespacesCache,enabledCache;function debug(...args2){if(!debug.enabled)return;let self=debug,curr=Number(new Date),ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr,args2[0]=createDebug.coerce(args2[0]),typeof args2[0]!="string"&&args2.unshift("%O");let index=0;args2[0]=args2[0].replace(/%([a-zA-Z%])/g,(match,format2)=>{if(match==="%%")return"%";index++;let formatter=createDebug.formatters[format2];if(typeof formatter=="function"){let val=args2[index];match=formatter.call(self,val),args2.splice(index,1),index--}return match}),createDebug.formatArgs.call(self,args2),(self.log||createDebug.log).apply(self,args2)}return __name(debug,"debug"),debug.namespace=namespace,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(namespace),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:__name(()=>enableOverride!==null?enableOverride:(namespacesCache!==createDebug.namespaces&&(namespacesCache=createDebug.namespaces,enabledCache=createDebug.enabled(namespace)),enabledCache),"get"),set:__name(v=>{enableOverride=v},"set")}),typeof createDebug.init=="function"&&createDebug.init(debug),debug}__name(createDebug,"createDebug");function extend(namespace,delimiter){let newDebug=createDebug(this.namespace+(typeof delimiter>"u"?":":delimiter)+namespace);return newDebug.log=this.log,newDebug}__name(extend,"extend");function enable(namespaces){createDebug.save(namespaces),createDebug.namespaces=namespaces,createDebug.names=[],createDebug.skips=[];let split=(typeof namespaces=="string"?namespaces:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let ns of split)ns[0]==="-"?createDebug.skips.push(ns.slice(1)):createDebug.names.push(ns)}__name(enable,"enable");function matchesTemplate(search,template){let searchIndex=0,templateIndex=0,starIndex=-1,matchIndex=0;for(;searchIndex<search.length;)if(templateIndex<template.length&&(template[templateIndex]===search[searchIndex]||template[templateIndex]==="*"))template[templateIndex]==="*"?(starIndex=templateIndex,matchIndex=searchIndex,templateIndex++):(searchIndex++,templateIndex++);else if(starIndex!==-1)templateIndex=starIndex+1,matchIndex++,searchIndex=matchIndex;else return!1;for(;templateIndex<template.length&&template[templateIndex]==="*";)templateIndex++;return templateIndex===template.length}__name(matchesTemplate,"matchesTemplate");function disable(){let namespaces=[...createDebug.names,...createDebug.skips.map(namespace=>"-"+namespace)].join(",");return createDebug.enable(""),namespaces}__name(disable,"disable");function enabled(name){for(let skip of createDebug.skips)if(matchesTemplate(name,skip))return!1;for(let ns of createDebug.names)if(matchesTemplate(name,ns))return!0;return!1}__name(enabled,"enabled");function coerce(val){return val instanceof Error?val.stack||val.message:val}__name(coerce,"coerce");function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return __name(destroy,"destroy"),createDebug.enable(createDebug.load()),createDebug}__name(setup,"setup");module2.exports=setup}});var require_browser=__commonJS({"../node_modules/debug/src/browser.js"(exports2,module2){exports2.formatArgs=formatArgs;exports2.save=save;exports2.load=load;exports2.useColors=useColors;exports2.storage=localstorage();exports2.destroy=(()=>{let warned=!1;return()=>{warned||(warned=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();exports2.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let m;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(m=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(m[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}__name(useColors,"useColors");function formatArgs(args2){if(args2[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+args2[0]+(this.useColors?"%c ":" ")+"+"+module2.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;args2.splice(1,0,c,"color: inherit");let index=0,lastC=0;args2[0].replace(/%[a-zA-Z%]/g,match=>{match!=="%%"&&(index++,match==="%c"&&(lastC=index))}),args2.splice(lastC,0,c)}__name(formatArgs,"formatArgs");exports2.log=console.debug||console.log||(()=>{});function save(namespaces){try{namespaces?exports2.storage.setItem("debug",namespaces):exports2.storage.removeItem("debug")}catch{}}__name(save,"save");function load(){let r;try{r=exports2.storage.getItem("debug")||exports2.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}__name(load,"load");function localstorage(){try{return localStorage}catch{}}__name(localstorage,"localstorage");module2.exports=require_common()(exports2);var{formatters}=module2.exports;formatters.j=function(v){try{return JSON.stringify(v)}catch(error){return"[UnexpectedJSONParseError]: "+error.message}}}});var require_has_flag=__commonJS({"../node_modules/has-flag/index.js"(exports2,module2){"use strict";module2.exports=(flag,argv=process.argv)=>{let prefix=flag.startsWith("-")?"":flag.length===1?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return position!==-1&&(terminatorPosition===-1||position<terminatorPosition)}}});var require_supports_color=__commonJS({"../node_modules/supports-color/index.js"(exports2,module2){"use strict";var os=__require("os"),tty=__require("tty"),hasFlag=require_has_flag(),{env}=process,flagForceColor;hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?flagForceColor=0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(flagForceColor=1);function envForceColor(){if("FORCE_COLOR"in env)return env.FORCE_COLOR==="true"?1:env.FORCE_COLOR==="false"?0:env.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(env.FORCE_COLOR,10),3)}__name(envForceColor,"envForceColor");function translateLevel(level){return level===0?!1:{level,hasBasic:!0,has256:level>=2,has16m:level>=3}}__name(translateLevel,"translateLevel");function supportsColor(haveStream,{streamIsTTY,sniffFlags=!0}={}){let noFlagForceColor=envForceColor();noFlagForceColor!==void 0&&(flagForceColor=noFlagForceColor);let forceColor=sniffFlags?flagForceColor:noFlagForceColor;if(forceColor===0)return 0;if(sniffFlags){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2}if(haveStream&&!streamIsTTY&&forceColor===void 0)return 0;let min=forceColor||0;if(env.TERM==="dumb")return min;if(process.platform==="win32"){let osRelease=os.release().split(".");return Number(osRelease[0])>=10&&Number(osRelease[2])>=10586?Number(osRelease[2])>=14931?3:2:1}if("CI"in env)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(sign=>sign in env)||env.CI_NAME==="codeship"?1:min;if("TEAMCITY_VERSION"in env)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)?1:0;if(env.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in env){let version=Number.parseInt((env.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return version>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:min}__name(supportsColor,"supportsColor");function getSupportLevel(stream,options={}){let level=supportsColor(stream,{streamIsTTY:stream&&stream.isTTY,...options});return translateLevel(level)}__name(getSupportLevel,"getSupportLevel");module2.exports={supportsColor:getSupportLevel,stdout:getSupportLevel({isTTY:tty.isatty(1)}),stderr:getSupportLevel({isTTY:tty.isatty(2)})}}});var require_node=__commonJS({"../node_modules/debug/src/node.js"(exports2,module2){var tty=__require("tty"),util=__require("util");exports2.init=init;exports2.log=log3;exports2.formatArgs=formatArgs;exports2.save=save;exports2.load=load;exports2.useColors=useColors;exports2.destroy=util.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");exports2.colors=[6,2,3,4,5,1];try{let supportsColor=require_supports_color();supportsColor&&(supportsColor.stderr||supportsColor).level>=2&&(exports2.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}exports2.inspectOpts=Object.keys(process.env).filter(key=>/^debug_/i.test(key)).reduce((obj,key)=>{let prop=key.substring(6).toLowerCase().replace(/_([a-z])/g,(_,k)=>k.toUpperCase()),val=process.env[key];return/^(yes|on|true|enabled)$/i.test(val)?val=!0:/^(no|off|false|disabled)$/i.test(val)?val=!1:val==="null"?val=null:val=Number(val),obj[prop]=val,obj},{});function useColors(){return"colors"in exports2.inspectOpts?!!exports2.inspectOpts.colors:tty.isatty(process.stderr.fd)}__name(useColors,"useColors");function formatArgs(args2){let{namespace:name,useColors:useColors2}=this;if(useColors2){let c=this.color,colorCode="\x1B[3"+(c<8?c:"8;5;"+c),prefix=` ${colorCode};1m${name} \x1B[0m`;args2[0]=prefix+args2[0].split(`
3
+ import{ContractStore,Fr,LazyProtocolContractsProvider,TXEDispatcher,TXEDispatcherApiSchema,TXE_REQUIRED_PROTOCOL_CONTRACTS,ZodError,createLogger,external_exports,getContractClassFromArtifact,getSchemaParameters,getStandardAuthRegistry,getStandardHandshakeRegistry,jsonStringify,loadContractArtifact,openEphemeralStore,parseWithOptionals,promiseWithResolvers,require_inherits,schemaHasMethod,sha256ToField}from"./chunk-ZM5DRIY2.js";import{__commonJS,__name,__require,__toESM}from"./chunk-BJVAAXNA.js";var require_vary=__commonJS({"../node_modules/vary/index.js"(exports2,module2){"use strict";module2.exports=vary;module2.exports.append=append;var FIELD_NAME_REGEXP=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function append(header,field){if(typeof header!="string")throw new TypeError("header argument is required");if(!field)throw new TypeError("field argument is required");for(var fields=Array.isArray(field)?field:parse(String(field)),j=0;j<fields.length;j++)if(!FIELD_NAME_REGEXP.test(fields[j]))throw new TypeError("field argument contains an invalid header name");if(header==="*")return header;var val=header,vals=parse(header.toLowerCase());if(fields.indexOf("*")!==-1||vals.indexOf("*")!==-1)return"*";for(var i=0;i<fields.length;i++){var fld=fields[i].toLowerCase();vals.indexOf(fld)===-1&&(vals.push(fld),val=val?val+", "+fields[i]:fields[i])}return val}__name(append,"append");function parse(header){for(var end=0,list=[],start=0,i=0,len=header.length;i<len;i++)switch(header.charCodeAt(i)){case 32:start===end&&(start=end=i+1);break;case 44:list.push(header.substring(start,end)),start=end=i+1;break;default:end=i+1;break}return list.push(header.substring(start,end)),list}__name(parse,"parse");function vary(res,field){if(!res||!res.getHeader||!res.setHeader)throw new TypeError("res argument is required");var val=res.getHeader("Vary")||"",header=Array.isArray(val)?val.join(", "):String(val);(val=append(header,field))&&res.setHeader("Vary",val)}__name(vary,"vary")}});var require_cors=__commonJS({"../node_modules/@koa/cors/index.js"(exports2,module2){var vary=require_vary();module2.exports=function(options){return options={...{allowMethods:"GET,HEAD,PUT,POST,DELETE,PATCH",secureContext:!1},...options},Array.isArray(options.exposeHeaders)&&(options.exposeHeaders=options.exposeHeaders.join(",")),Array.isArray(options.allowMethods)&&(options.allowMethods=options.allowMethods.join(",")),Array.isArray(options.allowHeaders)&&(options.allowHeaders=options.allowHeaders.join(",")),options.maxAge&&(options.maxAge=String(options.maxAge)),options.keepHeadersOnError=options.keepHeadersOnError===void 0||!!options.keepHeadersOnError,__name(async function(ctx,next){let requestOrigin=ctx.get("Origin");ctx.vary("Origin");let origin;if(typeof options.origin=="function"){if(origin=await options.origin(ctx),!origin)return await next()}else origin=options.origin||"*";let credentials;typeof options.credentials=="function"?credentials=await options.credentials(ctx):credentials=!!options.credentials,credentials&&origin==="*"&&(origin=requestOrigin);let headersSet={};function set(key,value){ctx.set(key,value),headersSet[key]=value}if(__name(set,"set"),ctx.method!=="OPTIONS"){if(set("Access-Control-Allow-Origin",origin),credentials===!0&&set("Access-Control-Allow-Credentials","true"),options.exposeHeaders&&set("Access-Control-Expose-Headers",options.exposeHeaders),options.secureContext&&(set("Cross-Origin-Opener-Policy","same-origin"),set("Cross-Origin-Embedder-Policy","require-corp")),!options.keepHeadersOnError)return await next();try{return await next()}catch(err){let errHeadersSet=err.headers||{},varyWithOrigin=vary.append(errHeadersSet.vary||errHeadersSet.Vary||"","Origin");throw delete errHeadersSet.Vary,err.headers={...errHeadersSet,...headersSet,vary:varyWithOrigin},err}}else{if(!ctx.get("Access-Control-Request-Method"))return await next();ctx.set("Access-Control-Allow-Origin",origin),credentials===!0&&ctx.set("Access-Control-Allow-Credentials","true"),options.maxAge&&ctx.set("Access-Control-Max-Age",options.maxAge),options.privateNetworkAccess&&ctx.get("Access-Control-Request-Private-Network")&&ctx.set("Access-Control-Allow-Private-Network","true"),options.allowMethods&&ctx.set("Access-Control-Allow-Methods",options.allowMethods),options.secureContext&&(set("Cross-Origin-Opener-Policy","same-origin"),set("Cross-Origin-Embedder-Policy","require-corp"));let allowHeaders=options.allowHeaders;allowHeaders||(allowHeaders=ctx.get("Access-Control-Request-Headers")),allowHeaders&&ctx.set("Access-Control-Allow-Headers",allowHeaders),ctx.status=204}},"cors")}}});var require_es_object_atoms=__commonJS({"../node_modules/es-object-atoms/index.js"(exports2,module2){"use strict";module2.exports=Object}});var require_es_errors=__commonJS({"../node_modules/es-errors/index.js"(exports2,module2){"use strict";module2.exports=Error}});var require_eval=__commonJS({"../node_modules/es-errors/eval.js"(exports2,module2){"use strict";module2.exports=EvalError}});var require_range=__commonJS({"../node_modules/es-errors/range.js"(exports2,module2){"use strict";module2.exports=RangeError}});var require_ref=__commonJS({"../node_modules/es-errors/ref.js"(exports2,module2){"use strict";module2.exports=ReferenceError}});var require_syntax=__commonJS({"../node_modules/es-errors/syntax.js"(exports2,module2){"use strict";module2.exports=SyntaxError}});var require_type=__commonJS({"../node_modules/es-errors/type.js"(exports2,module2){"use strict";module2.exports=TypeError}});var require_uri=__commonJS({"../node_modules/es-errors/uri.js"(exports2,module2){"use strict";module2.exports=URIError}});var require_abs=__commonJS({"../node_modules/math-intrinsics/abs.js"(exports2,module2){"use strict";module2.exports=Math.abs}});var require_floor=__commonJS({"../node_modules/math-intrinsics/floor.js"(exports2,module2){"use strict";module2.exports=Math.floor}});var require_max=__commonJS({"../node_modules/math-intrinsics/max.js"(exports2,module2){"use strict";module2.exports=Math.max}});var require_min=__commonJS({"../node_modules/math-intrinsics/min.js"(exports2,module2){"use strict";module2.exports=Math.min}});var require_pow=__commonJS({"../node_modules/math-intrinsics/pow.js"(exports2,module2){"use strict";module2.exports=Math.pow}});var require_round=__commonJS({"../node_modules/math-intrinsics/round.js"(exports2,module2){"use strict";module2.exports=Math.round}});var require_isNaN=__commonJS({"../node_modules/math-intrinsics/isNaN.js"(exports2,module2){"use strict";module2.exports=Number.isNaN||__name(function(a){return a!==a},"isNaN")}});var require_sign=__commonJS({"../node_modules/math-intrinsics/sign.js"(exports2,module2){"use strict";var $isNaN=require_isNaN();module2.exports=__name(function(number){return $isNaN(number)||number===0?number:number<0?-1:1},"sign")}});var require_gOPD=__commonJS({"../node_modules/gopd/gOPD.js"(exports2,module2){"use strict";module2.exports=Object.getOwnPropertyDescriptor}});var require_gopd=__commonJS({"../node_modules/gopd/index.js"(exports2,module2){"use strict";var $gOPD=require_gOPD();if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}module2.exports=$gOPD}});var require_es_define_property=__commonJS({"../node_modules/es-define-property/index.js"(exports2,module2){"use strict";var $defineProperty=Object.defineProperty||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch{$defineProperty=!1}module2.exports=$defineProperty}});var require_shams=__commonJS({"../node_modules/has-symbols/shams.js"(exports2,module2){"use strict";module2.exports=__name(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var obj={},sym=Symbol("test"),symObj=Object(sym);if(typeof sym=="string"||Object.prototype.toString.call(sym)!=="[object Symbol]"||Object.prototype.toString.call(symObj)!=="[object Symbol]")return!1;var symVal=42;obj[sym]=symVal;for(var _ in obj)return!1;if(typeof Object.keys=="function"&&Object.keys(obj).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(obj).length!==0)return!1;var syms=Object.getOwnPropertySymbols(obj);if(syms.length!==1||syms[0]!==sym||!Object.prototype.propertyIsEnumerable.call(obj,sym))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var descriptor=Object.getOwnPropertyDescriptor(obj,sym);if(descriptor.value!==symVal||descriptor.enumerable!==!0)return!1}return!0},"hasSymbols")}});var require_has_symbols=__commonJS({"../node_modules/has-symbols/index.js"(exports2,module2){"use strict";var origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=require_shams();module2.exports=__name(function(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()},"hasNativeSymbols")}});var require_Reflect_getPrototypeOf=__commonJS({"../node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2,module2){"use strict";module2.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}});var require_Object_getPrototypeOf=__commonJS({"../node_modules/get-proto/Object.getPrototypeOf.js"(exports2,module2){"use strict";var $Object=require_es_object_atoms();module2.exports=$Object.getPrototypeOf||null}});var require_implementation=__commonJS({"../node_modules/function-bind/implementation.js"(exports2,module2){"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=__name(function(a,b){for(var arr=[],i=0;i<a.length;i+=1)arr[i]=a[i];for(var j=0;j<b.length;j+=1)arr[j+a.length]=b[j];return arr},"concatty"),slicy=__name(function(arrLike,offset){for(var arr=[],i=offset||0,j=0;i<arrLike.length;i+=1,j+=1)arr[j]=arrLike[i];return arr},"slicy"),joiny=__name(function(arr,joiner){for(var str="",i=0;i<arr.length;i+=1)str+=arr[i],i+1<arr.length&&(str+=joiner);return str},"joiny");module2.exports=__name(function(that){var target=this;if(typeof target!="function"||toStr.apply(target)!==funcType)throw new TypeError(ERROR_MESSAGE+target);for(var args2=slicy(arguments,1),bound,binder=__name(function(){if(this instanceof bound){var result=target.apply(this,concatty(args2,arguments));return Object(result)===result?result:this}return target.apply(that,concatty(args2,arguments))},"binder"),boundLength=max(0,target.length-args2.length),boundArgs=[],i=0;i<boundLength;i++)boundArgs[i]="$"+i;if(bound=Function("binder","return function ("+joiny(boundArgs,",")+"){ return binder.apply(this,arguments); }")(binder),target.prototype){var Empty=__name(function(){},"Empty");Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null}return bound},"bind")}});var require_function_bind=__commonJS({"../node_modules/function-bind/index.js"(exports2,module2){"use strict";var implementation=require_implementation();module2.exports=Function.prototype.bind||implementation}});var require_functionCall=__commonJS({"../node_modules/call-bind-apply-helpers/functionCall.js"(exports2,module2){"use strict";module2.exports=Function.prototype.call}});var require_functionApply=__commonJS({"../node_modules/call-bind-apply-helpers/functionApply.js"(exports2,module2){"use strict";module2.exports=Function.prototype.apply}});var require_reflectApply=__commonJS({"../node_modules/call-bind-apply-helpers/reflectApply.js"(exports2,module2){"use strict";module2.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}});var require_actualApply=__commonJS({"../node_modules/call-bind-apply-helpers/actualApply.js"(exports2,module2){"use strict";var bind=require_function_bind(),$apply=require_functionApply(),$call=require_functionCall(),$reflectApply=require_reflectApply();module2.exports=$reflectApply||bind.call($call,$apply)}});var require_call_bind_apply_helpers=__commonJS({"../node_modules/call-bind-apply-helpers/index.js"(exports2,module2){"use strict";var bind=require_function_bind(),$TypeError=require_type(),$call=require_functionCall(),$actualApply=require_actualApply();module2.exports=__name(function(args2){if(args2.length<1||typeof args2[0]!="function")throw new $TypeError("a function is required");return $actualApply(bind,$call,args2)},"callBindBasic")}});var require_get=__commonJS({"../node_modules/dunder-proto/get.js"(exports2,module2){"use strict";var callBind=require_call_bind_apply_helpers(),gOPD=require_gopd(),hasProtoAccessor;try{hasProtoAccessor=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module2.exports=desc&&typeof desc.get=="function"?callBind([desc.get]):typeof $getPrototypeOf=="function"?__name(function(value){return $getPrototypeOf(value==null?value:$Object(value))},"getDunder"):!1}});var require_get_proto=__commonJS({"../node_modules/get-proto/index.js"(exports2,module2){"use strict";var reflectGetProto=require_Reflect_getPrototypeOf(),originalGetProto=require_Object_getPrototypeOf(),getDunderProto=require_get();module2.exports=reflectGetProto?__name(function(O){return reflectGetProto(O)},"getProto"):originalGetProto?__name(function(O){if(!O||typeof O!="object"&&typeof O!="function")throw new TypeError("getProto: not an object");return originalGetProto(O)},"getProto"):getDunderProto?__name(function(O){return getDunderProto(O)},"getProto"):null}});var require_hasown=__commonJS({"../node_modules/hasown/index.js"(exports2,module2){"use strict";var call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind=require_function_bind();module2.exports=bind.call(call,$hasOwn)}});var require_get_intrinsic=__commonJS({"../node_modules/get-intrinsic/index.js"(exports2,module2){"use strict";var undefined2,$Object=require_es_object_atoms(),$Error=require_es_errors(),$EvalError=require_eval(),$RangeError=require_range(),$ReferenceError=require_ref(),$SyntaxError=require_syntax(),$TypeError=require_type(),$URIError=require_uri(),abs=require_abs(),floor=require_floor(),max=require_max(),min=require_min(),pow=require_pow(),round=require_round(),sign=require_sign(),$Function=Function,getEvalledConstructor=__name(function(expressionSyntax){try{return $Function('"use strict"; return ('+expressionSyntax+").constructor;")()}catch{}},"getEvalledConstructor"),$gOPD=require_gopd(),$defineProperty=require_es_define_property(),throwTypeError=__name(function(){throw new $TypeError},"throwTypeError"),ThrowTypeError=$gOPD?(function(){try{return arguments.callee,throwTypeError}catch{try{return $gOPD(arguments,"callee").get}catch{return throwTypeError}}})():throwTypeError,hasSymbols=require_has_symbols()(),getProto=require_get_proto(),$ObjectGPO=require_Object_getPrototypeOf(),$ReflectGPO=require_Reflect_getPrototypeOf(),$apply=require_functionApply(),$call=require_functionCall(),needsEval={},TypedArray=typeof Uint8Array>"u"||!getProto?undefined2:getProto(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined2:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined2:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined2,"%AsyncFromSyncIteratorPrototype%":undefined2,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined2:Atomics,"%BigInt%":typeof BigInt>"u"?undefined2:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined2:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined2:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined2:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":typeof Float16Array>"u"?undefined2:Float16Array,"%Float32Array%":typeof Float32Array>"u"?undefined2:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined2:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined2:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined2:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined2:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined2:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined2,"%JSON%":typeof JSON=="object"?JSON:undefined2,"%Map%":typeof Map>"u"?undefined2:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined2:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined2:Promise,"%Proxy%":typeof Proxy>"u"?undefined2:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined2:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined2:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined2:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined2:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined2,"%Symbol%":hasSymbols?Symbol:undefined2,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":typeof Uint8Array>"u"?undefined2:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined2:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined2:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined2:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined2:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined2:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined2:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(e){errorProto=getProto(getProto(e)),INTRINSICS["%Error.prototype%"]=errorProto}var errorProto,doEval=__name(function doEval2(name){var value;if(name==="%AsyncFunction%")value=getEvalledConstructor("async function () {}");else if(name==="%GeneratorFunction%")value=getEvalledConstructor("function* () {}");else if(name==="%AsyncGeneratorFunction%")value=getEvalledConstructor("async function* () {}");else if(name==="%AsyncGenerator%"){var fn2=doEval2("%AsyncGeneratorFunction%");fn2&&(value=fn2.prototype)}else if(name==="%AsyncIteratorPrototype%"){var gen=doEval2("%AsyncGenerator%");gen&&getProto&&(value=getProto(gen.prototype))}return INTRINSICS[name]=value,value},"doEval"),LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require_function_bind(),hasOwn=require_hasown(),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=__name(function(string){var first=$strSlice(string,0,1),last=$strSlice(string,-1);if(first==="%"&&last!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(last==="%"&&first!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var result=[];return $replace(string,rePropName,function(match,number,quote,subString){result[result.length]=quote?$replace(subString,reEscapeChar,"$1"):number||match}),result},"stringToPath"),getBaseIntrinsic=__name(function(name,allowMissing){var intrinsicName=name,alias;if(hasOwn(LEGACY_ALIASES,intrinsicName)&&(alias=LEGACY_ALIASES[intrinsicName],intrinsicName="%"+alias[0]+"%"),hasOwn(INTRINSICS,intrinsicName)){var value=INTRINSICS[intrinsicName];if(value===needsEval&&(value=doEval(intrinsicName)),typeof value>"u"&&!allowMissing)throw new $TypeError("intrinsic "+name+" exists, but is not available. Please file an issue!");return{alias,name:intrinsicName,value}}throw new $SyntaxError("intrinsic "+name+" does not exist!")},"getBaseIntrinsic");module2.exports=__name(function(name,allowMissing){if(typeof name!="string"||name.length===0)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof allowMissing!="boolean")throw new $TypeError('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,name)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var parts=stringToPath(name),intrinsicBaseName=parts.length>0?parts[0]:"",intrinsic=getBaseIntrinsic("%"+intrinsicBaseName+"%",allowMissing),intrinsicRealName=intrinsic.name,value=intrinsic.value,skipFurtherCaching=!1,alias=intrinsic.alias;alias&&(intrinsicBaseName=alias[0],$spliceApply(parts,$concat([0,1],alias)));for(var i=1,isOwn=!0;i<parts.length;i+=1){var part=parts[i],first=$strSlice(part,0,1),last=$strSlice(part,-1);if((first==='"'||first==="'"||first==="`"||last==='"'||last==="'"||last==="`")&&first!==last)throw new $SyntaxError("property names with quotes must have matching quotes");if((part==="constructor"||!isOwn)&&(skipFurtherCaching=!0),intrinsicBaseName+="."+part,intrinsicRealName="%"+intrinsicBaseName+"%",hasOwn(INTRINSICS,intrinsicRealName))value=INTRINSICS[intrinsicRealName];else if(value!=null){if(!(part in value)){if(!allowMissing)throw new $TypeError("base intrinsic for "+name+" exists, but the property is not available.");return}if($gOPD&&i+1>=parts.length){var desc=$gOPD(value,part);isOwn=!!desc,isOwn&&"get"in desc&&!("originalValue"in desc.get)?value=desc.get:value=value[part]}else isOwn=hasOwn(value,part),value=value[part];isOwn&&!skipFurtherCaching&&(INTRINSICS[intrinsicRealName]=value)}}return value},"GetIntrinsic")}});var require_call_bound=__commonJS({"../node_modules/call-bound/index.js"(exports2,module2){"use strict";var GetIntrinsic=require_get_intrinsic(),callBindBasic=require_call_bind_apply_helpers(),$indexOf=callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);module2.exports=__name(function(name,allowMissing){var intrinsic=GetIntrinsic(name,!!allowMissing);return typeof intrinsic=="function"&&$indexOf(name,".prototype.")>-1?callBindBasic([intrinsic]):intrinsic},"callBoundIntrinsic")}});var require_shams2=__commonJS({"../node_modules/has-tostringtag/shams.js"(exports2,module2){"use strict";var hasSymbols=require_shams();module2.exports=__name(function(){return hasSymbols()&&!!Symbol.toStringTag},"hasToStringTagShams")}});var require_is_regex=__commonJS({"../node_modules/is-regex/index.js"(exports2,module2){"use strict";var callBound=require_call_bound(),hasToStringTag=require_shams2()(),hasOwn=require_hasown(),gOPD=require_gopd(),fn2;hasToStringTag?($exec=callBound("RegExp.prototype.exec"),isRegexMarker={},throwRegexMarker=__name(function(){throw isRegexMarker},"throwRegexMarker"),badStringifier={toString:throwRegexMarker,valueOf:throwRegexMarker},typeof Symbol.toPrimitive=="symbol"&&(badStringifier[Symbol.toPrimitive]=throwRegexMarker),fn2=__name(function(value){if(!value||typeof value!="object")return!1;var descriptor=gOPD(value,"lastIndex"),hasLastIndexDataProperty=descriptor&&hasOwn(descriptor,"value");if(!hasLastIndexDataProperty)return!1;try{$exec(value,badStringifier)}catch(e){return e===isRegexMarker}},"isRegex")):($toString=callBound("Object.prototype.toString"),regexClass="[object RegExp]",fn2=__name(function(value){return!value||typeof value!="object"&&typeof value!="function"?!1:$toString(value)===regexClass},"isRegex"));var $exec,isRegexMarker,throwRegexMarker,badStringifier,$toString,regexClass;module2.exports=fn2}});var require_safe_regex_test=__commonJS({"../node_modules/safe-regex-test/index.js"(exports2,module2){"use strict";var callBound=require_call_bound(),isRegex=require_is_regex(),$exec=callBound("RegExp.prototype.exec"),$TypeError=require_type();module2.exports=__name(function(regex){if(!isRegex(regex))throw new $TypeError("`regex` must be a RegExp");return __name(function(s){return $exec(regex,s)!==null},"test")},"regexTester")}});var require_is_generator_function=__commonJS({"../node_modules/is-generator-function/index.js"(exports2,module2){"use strict";var callBound=require_call_bound(),safeRegexTest=require_safe_regex_test(),isFnRegex=safeRegexTest(/^\s*(?:function)?\*/),hasToStringTag=require_shams2()(),getProto=require_get_proto(),toStr=callBound("Object.prototype.toString"),fnToStr=callBound("Function.prototype.toString"),getGeneratorFunc=__name(function(){if(!hasToStringTag)return!1;try{return Function("return function*() {}")()}catch{}},"getGeneratorFunc"),GeneratorFunction;module2.exports=__name(function(fn2){if(typeof fn2!="function")return!1;if(isFnRegex(fnToStr(fn2)))return!0;if(!hasToStringTag){var str=toStr(fn2);return str==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var generatorFunc=getGeneratorFunc();GeneratorFunction=generatorFunc?getProto(generatorFunc):!1}return getProto(fn2)===GeneratorFunction},"isGeneratorFunction")}});var require_ms=__commonJS({"../node_modules/ms/index.js"(exports2,module2){var s=1e3,m=s*60,h=m*60,d=h*24,w=d*7,y=d*365.25;module2.exports=function(val,options){options=options||{};var type=typeof val;if(type==="string"&&val.length>0)return parse(val);if(type==="number"&&isFinite(val))return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){if(str=String(str),!(str.length>100)){var match=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]),type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}__name(parse,"parse");function fmtShort(ms){var msAbs=Math.abs(ms);return msAbs>=d?Math.round(ms/d)+"d":msAbs>=h?Math.round(ms/h)+"h":msAbs>=m?Math.round(ms/m)+"m":msAbs>=s?Math.round(ms/s)+"s":ms+"ms"}__name(fmtShort,"fmtShort");function fmtLong(ms){var msAbs=Math.abs(ms);return msAbs>=d?plural(ms,msAbs,d,"day"):msAbs>=h?plural(ms,msAbs,h,"hour"):msAbs>=m?plural(ms,msAbs,m,"minute"):msAbs>=s?plural(ms,msAbs,s,"second"):ms+" ms"}__name(fmtLong,"fmtLong");function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+" "+name+(isPlural?"s":"")}__name(plural,"plural")}});var require_common=__commonJS({"../node_modules/debug/src/common.js"(exports2,module2){function setup(env){createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=coerce,createDebug.disable=disable,createDebug.enable=enable,createDebug.enabled=enabled,createDebug.humanize=require_ms(),createDebug.destroy=destroy,Object.keys(env).forEach(key=>{createDebug[key]=env[key]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={};function selectColor(namespace){let hash=0;for(let i=0;i<namespace.length;i++)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return createDebug.colors[Math.abs(hash)%createDebug.colors.length]}__name(selectColor,"selectColor"),createDebug.selectColor=selectColor;function createDebug(namespace){let prevTime,enableOverride=null,namespacesCache,enabledCache;function debug(...args2){if(!debug.enabled)return;let self=debug,curr=Number(new Date),ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr,args2[0]=createDebug.coerce(args2[0]),typeof args2[0]!="string"&&args2.unshift("%O");let index=0;args2[0]=args2[0].replace(/%([a-zA-Z%])/g,(match,format2)=>{if(match==="%%")return"%";index++;let formatter=createDebug.formatters[format2];if(typeof formatter=="function"){let val=args2[index];match=formatter.call(self,val),args2.splice(index,1),index--}return match}),createDebug.formatArgs.call(self,args2),(self.log||createDebug.log).apply(self,args2)}return __name(debug,"debug"),debug.namespace=namespace,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(namespace),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:__name(()=>enableOverride!==null?enableOverride:(namespacesCache!==createDebug.namespaces&&(namespacesCache=createDebug.namespaces,enabledCache=createDebug.enabled(namespace)),enabledCache),"get"),set:__name(v=>{enableOverride=v},"set")}),typeof createDebug.init=="function"&&createDebug.init(debug),debug}__name(createDebug,"createDebug");function extend(namespace,delimiter){let newDebug=createDebug(this.namespace+(typeof delimiter>"u"?":":delimiter)+namespace);return newDebug.log=this.log,newDebug}__name(extend,"extend");function enable(namespaces){createDebug.save(namespaces),createDebug.namespaces=namespaces,createDebug.names=[],createDebug.skips=[];let split=(typeof namespaces=="string"?namespaces:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let ns of split)ns[0]==="-"?createDebug.skips.push(ns.slice(1)):createDebug.names.push(ns)}__name(enable,"enable");function matchesTemplate(search,template){let searchIndex=0,templateIndex=0,starIndex=-1,matchIndex=0;for(;searchIndex<search.length;)if(templateIndex<template.length&&(template[templateIndex]===search[searchIndex]||template[templateIndex]==="*"))template[templateIndex]==="*"?(starIndex=templateIndex,matchIndex=searchIndex,templateIndex++):(searchIndex++,templateIndex++);else if(starIndex!==-1)templateIndex=starIndex+1,matchIndex++,searchIndex=matchIndex;else return!1;for(;templateIndex<template.length&&template[templateIndex]==="*";)templateIndex++;return templateIndex===template.length}__name(matchesTemplate,"matchesTemplate");function disable(){let namespaces=[...createDebug.names,...createDebug.skips.map(namespace=>"-"+namespace)].join(",");return createDebug.enable(""),namespaces}__name(disable,"disable");function enabled(name){for(let skip of createDebug.skips)if(matchesTemplate(name,skip))return!1;for(let ns of createDebug.names)if(matchesTemplate(name,ns))return!0;return!1}__name(enabled,"enabled");function coerce(val){return val instanceof Error?val.stack||val.message:val}__name(coerce,"coerce");function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return __name(destroy,"destroy"),createDebug.enable(createDebug.load()),createDebug}__name(setup,"setup");module2.exports=setup}});var require_browser=__commonJS({"../node_modules/debug/src/browser.js"(exports2,module2){exports2.formatArgs=formatArgs;exports2.save=save;exports2.load=load;exports2.useColors=useColors;exports2.storage=localstorage();exports2.destroy=(()=>{let warned=!1;return()=>{warned||(warned=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();exports2.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let m;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(m=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(m[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}__name(useColors,"useColors");function formatArgs(args2){if(args2[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+args2[0]+(this.useColors?"%c ":" ")+"+"+module2.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;args2.splice(1,0,c,"color: inherit");let index=0,lastC=0;args2[0].replace(/%[a-zA-Z%]/g,match=>{match!=="%%"&&(index++,match==="%c"&&(lastC=index))}),args2.splice(lastC,0,c)}__name(formatArgs,"formatArgs");exports2.log=console.debug||console.log||(()=>{});function save(namespaces){try{namespaces?exports2.storage.setItem("debug",namespaces):exports2.storage.removeItem("debug")}catch{}}__name(save,"save");function load(){let r;try{r=exports2.storage.getItem("debug")||exports2.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}__name(load,"load");function localstorage(){try{return localStorage}catch{}}__name(localstorage,"localstorage");module2.exports=require_common()(exports2);var{formatters}=module2.exports;formatters.j=function(v){try{return JSON.stringify(v)}catch(error){return"[UnexpectedJSONParseError]: "+error.message}}}});var require_has_flag=__commonJS({"../node_modules/has-flag/index.js"(exports2,module2){"use strict";module2.exports=(flag,argv=process.argv)=>{let prefix=flag.startsWith("-")?"":flag.length===1?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return position!==-1&&(terminatorPosition===-1||position<terminatorPosition)}}});var require_supports_color=__commonJS({"../node_modules/supports-color/index.js"(exports2,module2){"use strict";var os=__require("os"),tty=__require("tty"),hasFlag=require_has_flag(),{env}=process,flagForceColor;hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?flagForceColor=0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(flagForceColor=1);function envForceColor(){if("FORCE_COLOR"in env)return env.FORCE_COLOR==="true"?1:env.FORCE_COLOR==="false"?0:env.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(env.FORCE_COLOR,10),3)}__name(envForceColor,"envForceColor");function translateLevel(level){return level===0?!1:{level,hasBasic:!0,has256:level>=2,has16m:level>=3}}__name(translateLevel,"translateLevel");function supportsColor(haveStream,{streamIsTTY,sniffFlags=!0}={}){let noFlagForceColor=envForceColor();noFlagForceColor!==void 0&&(flagForceColor=noFlagForceColor);let forceColor=sniffFlags?flagForceColor:noFlagForceColor;if(forceColor===0)return 0;if(sniffFlags){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2}if(haveStream&&!streamIsTTY&&forceColor===void 0)return 0;let min=forceColor||0;if(env.TERM==="dumb")return min;if(process.platform==="win32"){let osRelease=os.release().split(".");return Number(osRelease[0])>=10&&Number(osRelease[2])>=10586?Number(osRelease[2])>=14931?3:2:1}if("CI"in env)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(sign=>sign in env)||env.CI_NAME==="codeship"?1:min;if("TEAMCITY_VERSION"in env)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)?1:0;if(env.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in env){let version=Number.parseInt((env.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return version>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:min}__name(supportsColor,"supportsColor");function getSupportLevel(stream,options={}){let level=supportsColor(stream,{streamIsTTY:stream&&stream.isTTY,...options});return translateLevel(level)}__name(getSupportLevel,"getSupportLevel");module2.exports={supportsColor:getSupportLevel,stdout:getSupportLevel({isTTY:tty.isatty(1)}),stderr:getSupportLevel({isTTY:tty.isatty(2)})}}});var require_node=__commonJS({"../node_modules/debug/src/node.js"(exports2,module2){var tty=__require("tty"),util=__require("util");exports2.init=init;exports2.log=log3;exports2.formatArgs=formatArgs;exports2.save=save;exports2.load=load;exports2.useColors=useColors;exports2.destroy=util.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");exports2.colors=[6,2,3,4,5,1];try{let supportsColor=require_supports_color();supportsColor&&(supportsColor.stderr||supportsColor).level>=2&&(exports2.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}exports2.inspectOpts=Object.keys(process.env).filter(key=>/^debug_/i.test(key)).reduce((obj,key)=>{let prop=key.substring(6).toLowerCase().replace(/_([a-z])/g,(_,k)=>k.toUpperCase()),val=process.env[key];return/^(yes|on|true|enabled)$/i.test(val)?val=!0:/^(no|off|false|disabled)$/i.test(val)?val=!1:val==="null"?val=null:val=Number(val),obj[prop]=val,obj},{});function useColors(){return"colors"in exports2.inspectOpts?!!exports2.inspectOpts.colors:tty.isatty(process.stderr.fd)}__name(useColors,"useColors");function formatArgs(args2){let{namespace:name,useColors:useColors2}=this;if(useColors2){let c=this.color,colorCode="\x1B[3"+(c<8?c:"8;5;"+c),prefix=` ${colorCode};1m${name} \x1B[0m`;args2[0]=prefix+args2[0].split(`
4
4
  `).join(`
5
5
  `+prefix),args2.push(colorCode+"m+"+module2.exports.humanize(this.diff)+"\x1B[0m")}else args2[0]=getDate()+name+" "+args2[0]}__name(formatArgs,"formatArgs");function getDate(){return exports2.inspectOpts.hideDate?"":new Date().toISOString()+" "}__name(getDate,"getDate");function log3(...args2){return process.stderr.write(util.formatWithOptions(exports2.inspectOpts,...args2)+`
6
6
  `)}__name(log3,"log");function save(namespaces){namespaces?process.env.DEBUG=namespaces:delete process.env.DEBUG}__name(save,"save");function load(){return process.env.DEBUG}__name(load,"load");function init(debug){debug.inspectOpts={};let keys=Object.keys(exports2.inspectOpts);for(let i=0;i<keys.length;i++)debug.inspectOpts[keys[i]]=exports2.inspectOpts[keys[i]]}__name(init,"init");module2.exports=require_common()(exports2);var{formatters}=module2.exports;formatters.o=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts).split(`
@@ -214,7 +214,7 @@ See docs for context: https://docs.aztec.network/errors/14`);let functionDao=art
214
214
  Tagging window length ${UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN} is configured too low. Contact the Aztec team
215
215
  to increase it!`);if(finalizedIndex!==void 0&&range.lowestIndex<=finalizedIndex)throw new Error(`Cannot store pending index range [${range.lowestIndex}, ${range.highestIndex}] for secret ${secretStr}: lowestIndex is lower than or equal to the last finalized index ${finalizedIndex}`);let existingEntry=pendingData.find(entry=>entry.txHash===txHashStr),updatedPending;if(!existingEntry)updatedPending=[...pendingData,{lowestIndex:range.lowestIndex,highestIndex:range.highestIndex,txHash:txHashStr}];else if(mergeExisting){let lowestIndex=Math.min(existingEntry.lowestIndex,range.lowestIndex),highestIndex=Math.max(existingEntry.highestIndex,range.highestIndex);(lowestIndex!==existingEntry.lowestIndex||highestIndex!==existingEntry.highestIndex)&&(updatedPending=pendingData.map(entry=>entry===existingEntry?{lowestIndex,highestIndex,txHash:entry.txHash}:entry))}else if(existingEntry.lowestIndex!==range.lowestIndex||existingEntry.highestIndex!==range.highestIndex)throw new Error(`Conflicting range for secret ${secretStr} and txHash ${txHashStr}: existing [${existingEntry.lowestIndex}, ${existingEntry.highestIndex}] vs new [${range.lowestIndex}, ${range.highestIndex}]`);updatedPending&&this.#writePendingIndexes(jobId,secretStr,updatedPending)}})}getTxHashesOfPendingIndexes(secret,startIndex,endIndex,jobId){return this.#store.transactionAsync(async()=>{let txHashes=(await this.#readPendingIndexes(jobId,secret.toString())).filter(entry=>entry.highestIndex>=startIndex&&entry.highestIndex<endIndex).map(entry=>entry.txHash);return Array.from(new Set(txHashes)).map(TxHash.fromString)})}getLastFinalizedIndex(secret,jobId){return this.#store.transactionAsync(()=>this.#readLastFinalizedIndex(jobId,secret.toString()))}getLastUsedIndex(secret,jobId){let secretStr=secret.toString();return this.#store.transactionAsync(async()=>{let pendingPromise=this.#readPendingIndexes(jobId,secretStr),finalizedPromise=this.#readLastFinalizedIndex(jobId,secretStr),[pendingEntries,lastFinalized]=await Promise.all([pendingPromise,finalizedPromise]);return pendingEntries.length===0?lastFinalized:Math.max(...pendingEntries.map(entry=>entry.highestIndex))})}dropPendingIndexes(txHashes,jobId){if(txHashes.length===0)return Promise.resolve();let txHashStrings=new Set(txHashes.map(txHash=>txHash.toString()));return this.#store.transactionAsync(async()=>{let secretReadPromises=new Map;for await(let secret of this.#pendingIndexes.keysAsync())secretReadPromises.set(secret,this.#readPendingIndexes(jobId,secret));for(let secret of this.#getPendingIndexesForJob(jobId).keys())secretReadPromises.has(secret)||secretReadPromises.set(secret,Promise.resolve(this.#getPendingIndexesForJob(jobId).get(secret)??[]));let secrets=[...secretReadPromises.keys()],pendingDataResults=await Promise.all(secretReadPromises.values());for(let i=0;i<secrets.length;i++){let secret=secrets[i],pendingData=pendingDataResults[i];if(pendingData&&pendingData.length>0){let filtered=pendingData.filter(item=>!txHashStrings.has(item.txHash));filtered.length===0?this.#writePendingIndexes(jobId,secret,[]):filtered.length!==pendingData.length&&this.#writePendingIndexes(jobId,secret,filtered)}}})}#getSecretsWithPendingData(jobId){return this.#store.transactionAsync(async()=>{let secretDataPromises=new Map;for await(let secret of this.#pendingIndexes.keysAsync())secretDataPromises.set(secret,{pending:this.#readPendingIndexes(jobId,secret),finalized:this.#readLastFinalizedIndex(jobId,secret)});for(let secret of this.#getPendingIndexesForJob(jobId).keys())secretDataPromises.has(secret)||secretDataPromises.set(secret,{pending:Promise.resolve(this.#getPendingIndexesForJob(jobId).get(secret)??[]),finalized:Promise.resolve(this.#getLastFinalizedIndexesForJob(jobId).get(secret))});let secrets=[...secretDataPromises.keys()];return(await Promise.all(secrets.map(async secret=>({secret,pendingData:await secretDataPromises.get(secret).pending,lastFinalized:await secretDataPromises.get(secret).finalized})))).filter(r2=>r2.pendingData.length>0)})}async finalizePendingIndexes(txHashes,jobId){if(txHashes.length===0)return;let txHashStrings=new Set(txHashes.map(tx=>tx.toString())),secretsWithData=await this.#getSecretsWithPendingData(jobId);for(let{secret,pendingData,lastFinalized}of secretsWithData){let currentPending=pendingData,currentFinalized=lastFinalized;for(let txHashStr of txHashStrings){let matchingEntries=currentPending.filter(item=>item.txHash===txHashStr);if(matchingEntries.length===0)continue;if(matchingEntries.length>1)throw new Error(`Multiple pending entries found for tx hash ${txHashStr} and secret ${secret}`);let newFinalized=matchingEntries[0].highestIndex;if(newFinalized<(currentFinalized??0))throw new Error(`New finalized index ${newFinalized} is smaller than the current last finalized index ${currentFinalized}`);currentFinalized=newFinalized,currentPending=currentPending.filter(item=>item.highestIndex>currentFinalized)}currentFinalized!==lastFinalized&&this.#writeLastFinalizedIndex(jobId,secret,currentFinalized),currentPending!==pendingData&&this.#writePendingIndexes(jobId,secret,currentPending)}}async finalizePendingIndexesOfAPartiallyRevertedTx(txEffect,jobId){let txHashStr=txEffect.txHash.toString(),onChainTags=new Set(txEffect.privateLogs.map(log2=>log2.fields[0].toString())),secretsWithData=await this.#getSecretsWithPendingData(jobId);for(let{secret,pendingData,lastFinalized}of secretsWithData){let matchingEntries=pendingData.filter(item=>item.txHash===txHashStr);if(matchingEntries.length===0)continue;if(matchingEntries.length>1)throw new Error(`Multiple pending entries found for tx hash ${txHashStr} and secret ${secret}`);let pendingEntry=matchingEntries[0],appTaggingSecret=AppTaggingSecret.fromString(secret),highestSurvivingIndex;for(let index=pendingEntry.lowestIndex;index<=pendingEntry.highestIndex;index++){let siloedTag=await SiloedTag.compute({extendedSecret:appTaggingSecret,index});onChainTags.has(siloedTag.value.toString())&&(highestSurvivingIndex=highestSurvivingIndex!==void 0?Math.max(highestSurvivingIndex,index):index)}let currentPending=pendingData.filter(item=>item.txHash!==txHashStr);if(highestSurvivingIndex!==void 0){let newFinalized=Math.max(lastFinalized??0,highestSurvivingIndex);this.#writeLastFinalizedIndex(jobId,secret,newFinalized),currentPending=currentPending.filter(item=>item.highestIndex>newFinalized)}this.#writePendingIndexes(jobId,secret,currentPending)}}};var TaggingSecretSourcesStore=class{static{__name(this,"TaggingSecretSourcesStore")}#store;#senders;#sharedSecretsByRecipient;constructor(store){this.#store=store,this.#senders=this.#store.openMap("senders"),this.#sharedSecretsByRecipient=this.#store.openMultiMap("recipient_shared_secrets")}addSender(address){return this.#store.transactionAsync(async()=>await this.#senders.hasAsync(address.toString())?!1:(await this.#senders.set(address.toString(),!0),!0))}getSenders(){return this.#store.transactionAsync(async()=>(await toArray(this.#senders.keysAsync())).map(AztecAddress.fromStringUnsafe))}removeSender(address){return this.#store.transactionAsync(async()=>await this.#senders.hasAsync(address.toString())?(await this.#senders.delete(address.toString()),!0):!1)}addSharedSecret(recipient,kind,secret){return this.#store.transactionAsync(async()=>{let secretStr=secret.toString();for await(let existing of this.#sharedSecretsByRecipient.getValuesAsync(recipient.toString()))if(existing.secret===secretStr){if(existing.kind!==kind)throw new Error(`Secret already registered for recipient with kind '${existing.kind}', cannot re-register it as '${kind}'.`);return!1}return await this.#sharedSecretsByRecipient.set(recipient.toString(),{kind,secret:secretStr}),!0})}getSharedSecretsForRecipient(recipient){return this.#store.transactionAsync(async()=>(await toArray(this.#sharedSecretsByRecipient.getValuesAsync(recipient.toString()))).map(deserializeSharedSecret))}getAllSharedSecrets(){return this.#store.transactionAsync(async()=>(await toArray(this.#sharedSecretsByRecipient.entriesAsync())).map(([recipient,entry])=>({recipient:AztecAddress.fromStringUnsafe(recipient),...deserializeSharedSecret(entry)})))}removeSharedSecret(recipient,kind,secret){return this.#store.transactionAsync(async()=>{let secretStr=secret.toString();for await(let existing of this.#sharedSecretsByRecipient.getValuesAsync(recipient.toString()))if(existing.kind===kind&&existing.secret===secretStr)return await this.#sharedSecretsByRecipient.deleteValue(recipient.toString(),existing),!0;return!1})}};function deserializeSharedSecret(entry){return{kind:entry.kind,secret:Point.fromString(entry.secret)}}__name(deserializeSharedSecret,"deserializeSharedSecret");var RecipientTaggingStore=class{static{__name(this,"RecipientTaggingStore")}storeName="recipient_tagging";#store;#highestAgedIndex;#highestFinalizedIndex;#highestAgedIndexForJob;#highestFinalizedIndexForJob;constructor(store){this.#store=store,this.#highestAgedIndex=this.#store.openMap("highest_aged_index"),this.#highestFinalizedIndex=this.#store.openMap("highest_finalized_index"),this.#highestAgedIndexForJob=new Map,this.#highestFinalizedIndexForJob=new Map}#getHighestAgedIndexForJob(jobId){let highestAgedIndexForJob=this.#highestAgedIndexForJob.get(jobId);return highestAgedIndexForJob||(highestAgedIndexForJob=new Map,this.#highestAgedIndexForJob.set(jobId,highestAgedIndexForJob)),highestAgedIndexForJob}async#readHighestAgedIndex(jobId,secret){let dbValue=await this.#highestAgedIndex.getAsync(secret);return this.#getHighestAgedIndexForJob(jobId).get(secret)??dbValue}#writeHighestAgedIndex(jobId,secret,index){this.#getHighestAgedIndexForJob(jobId).set(secret,index)}#getHighestFinalizedIndexForJob(jobId){let jobStagedHighestFinalizedIndex=this.#highestFinalizedIndexForJob.get(jobId);return jobStagedHighestFinalizedIndex||(jobStagedHighestFinalizedIndex=new Map,this.#highestFinalizedIndexForJob.set(jobId,jobStagedHighestFinalizedIndex)),jobStagedHighestFinalizedIndex}async#readHighestFinalizedIndex(jobId,secret){let dbValue=await this.#highestFinalizedIndex.getAsync(secret);return this.#getHighestFinalizedIndexForJob(jobId).get(secret)??dbValue}#writeHighestFinalizedIndex(jobId,secret,index){this.#getHighestFinalizedIndexForJob(jobId).set(secret,index)}async commit(jobId){let highestAgedIndexForJob=this.#highestAgedIndexForJob.get(jobId);if(highestAgedIndexForJob)for(let[secret,index]of highestAgedIndexForJob.entries())await this.#highestAgedIndex.set(secret,index);let highestFinalizedIndexForJob=this.#highestFinalizedIndexForJob.get(jobId);if(highestFinalizedIndexForJob)for(let[secret,index]of highestFinalizedIndexForJob.entries())await this.#highestFinalizedIndex.set(secret,index);return this.discardStaged(jobId)}discardStaged(jobId){return this.#highestAgedIndexForJob.delete(jobId),this.#highestFinalizedIndexForJob.delete(jobId),Promise.resolve()}getHighestAgedIndex(secret,jobId){return this.#store.transactionAsync(()=>this.#readHighestAgedIndex(jobId,secret.toString()))}updateHighestAgedIndex(secret,index,jobId){return this.#store.transactionAsync(async()=>{let currentIndex=await this.#readHighestAgedIndex(jobId,secret.toString());if(currentIndex!==void 0&&index<=currentIndex)throw new Error(`New highest aged index (${index}) must be higher than the current one (${currentIndex})`);this.#writeHighestAgedIndex(jobId,secret.toString(),index)})}getHighestFinalizedIndex(secret,jobId){return this.#store.transactionAsync(()=>this.#readHighestFinalizedIndex(jobId,secret.toString()))}updateHighestFinalizedIndex(secret,index,jobId){return this.#store.transactionAsync(async()=>{let currentIndex=await this.#readHighestFinalizedIndex(jobId,secret.toString());if(currentIndex!==void 0&&index<currentIndex)throw new Error(`New highest finalized index (${index}) must be higher than the current one (${currentIndex})`);this.#writeHighestFinalizedIndex(jobId,secret.toString(),index)})}};import{pickL1ContractAddressMappings as pickL1ContractAddressMappings3}from"@aztec/ethereum/l1-contract-addresses";var emptyChainConfig={l1ChainId:0,rollupVersion:0,rollupAddress:EthAddress.ZERO},chainConfigMappings={l1ChainId:{env:"L1_CHAIN_ID",...numberConfigHelper(31337),description:"The chain ID of the ethereum host."},rollupVersion:{env:"ROLLUP_VERSION",description:"The version of the rollup.",parseEnv:__name(val=>{let parsed=parseInt(val,10);if(!Number.isSafeInteger(parsed))throw new Error(`Invalid rollup version: ${val}`);return parsed},"parseEnv")},...pickL1ContractAddressMappings3("rollupAddress")};import{l1ContractsConfigMappings,validateSlotDurations}from"@aztec/ethereum/config";var DEFAULT_BLOCK_DURATION_MS=3*1e3;var DEFAULT_MAX_BLOCKS_PER_CHECKPOINT=24,sharedSequencerConfigMappings={blockDurationMs:{env:"SEQ_BLOCK_DURATION_MS",description:"Duration per block in milliseconds, used to derive how many blocks fit in a slot.",...numberConfigHelper(DEFAULT_BLOCK_DURATION_MS)},expectedBlockProposalsPerSlot:{env:"SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT",description:"Expected number of block proposals per slot for P2P peer scoring. 0 (default) disables block proposal scoring. Set to a positive value to enable.",...numberConfigHelper(0)},checkpointProposalSyncGraceSeconds:{env:"CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS",description:"Consensus grace in seconds for a received checkpoint proposal to materialize into local proposed state. Defaults to twice the block duration.",defaultValue:getDefaultCheckpointProposalSyncGrace(DEFAULT_BLOCK_DURATION_MS/1e3),...optionalNumberConfigHelper()},maxTxsPerBlock:{env:"SEQ_MAX_TX_PER_BLOCK",description:"The maximum number of txs to include in a block.",...optionalNumberConfigHelper()},attestationPropagationTime:{env:"SEQ_ATTESTATION_PROPAGATION_TIME",description:"How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way).",defaultValue:2,...floatConfigHelper(2)},checkpointProposalPrepareTime:{env:"SEQ_CHECKPOINT_PROPOSAL_PREPARE_TIME",description:"Local time in seconds between the last block build finishing and the checkpoint proposal being ready for p2p send.",defaultValue:1,...floatConfigHelper(1)},minBlockDuration:{env:"SEQ_MIN_BLOCK_DURATION",description:"Minimum block-building time in seconds still worth allocating if the proposer starts late.",defaultValue:2,...floatConfigHelper(2)},maxBlocksPerCheckpoint:{env:"MAX_BLOCKS_PER_CHECKPOINT",description:"Maximum number of blocks the sequencer packs into a single checkpoint, and the maximum indexWithinCheckpoint accepted on inbound block proposals.",parseEnv:__name(val=>parseInt(val,10),"parseEnv"),defaultValue:DEFAULT_MAX_BLOCKS_PER_CHECKPOINT}};var networkConsensusConfigMappings={...pickConfigMappings(l1ContractsConfigMappings,["aztecSlotDuration","ethereumSlotDuration"]),...pickConfigMappings(sharedSequencerConfigMappings,["blockDurationMs","maxBlocksPerCheckpoint","checkpointProposalSyncGraceSeconds"])};var nodeRpcConfigMappings={rpcSimulatePublicMaxGasLimit:{env:"RPC_SIMULATE_PUBLIC_MAX_GAS_LIMIT",description:"Maximum gas limit for public tx simulation in the node on `simulatePublicCalls`.",...numberConfigHelper(1e10)},rpcSimulatePublicMaxDebugLogMemoryReads:{env:"RPC_SIMULATE_PUBLIC_MAX_DEBUG_LOG_MEMORY_READS",description:"Maximum memory reads for debug logs performed for public tx simulation in the node on `simulatePublicCalls`. ",...numberConfigHelper(125e3)},rpcMaxBatchSize:{env:"RPC_MAX_BATCH_SIZE",description:"Maximum allowed batch size for JSON RPC batch requests.",...numberConfigHelper(100)},rpcMaxBodySize:{env:"RPC_MAX_BODY_SIZE",description:"Maximum allowed batch size for JSON RPC batch requests.",defaultValue:"1mb"}};function composeHooks(hooks){if(!Object.values(hooks).every(v=>v===void 0))return hooks}__name(composeHooks,"composeHooks");var pxeConfigMappings={...dataConfigMappings,...chainConfigMappings,l2BlockBatchSize:{env:"PXE_L2_BLOCK_BATCH_SIZE",...numberConfigHelper(50),description:"Maximum amount of blocks to pull from the stream in one request when synchronizing"},proverEnabled:{env:"PXE_PROVER_ENABLED",description:"Enable real proofs",...booleanConfigHelper(!0)},syncChainTip:{env:"PXE_SYNC_CHAIN_TIP",description:"Which chain tip to sync to (proposed, checkpointed, proven, finalized)",...enumConfigHelper(["proposed","checkpointed","proven","finalized"],"proposed")},autoSync:{env:"PXE_AUTO_SYNC",description:"Whether PXE syncs with the node automatically before each operation. Disable to let the caller (e.g. a wallet) drive syncs explicitly via pxe.sync().",...booleanConfigHelper(!0)}};var pxeCliConfigMappings={nodeUrl:{env:"AZTEC_NODE_URL",description:"Custom Aztec Node URL to connect to"}},allPxeConfigMappings={...pxeConfigMappings,...pxeCliConfigMappings,...dataConfigMappings,proverEnabled:{env:"PXE_PROVER_ENABLED",parseEnv:__name(val=>parseBooleanEnv(val)||!!process.env.NETWORK,"parseEnv"),description:"Enable real proofs",isBoolean:!0,defaultValue:!0}};import{LazyArtifactProvider}from"@aztec/noir-protocol-circuits-types/client/lazy";import{AztecClientBackend,Barretenberg as Barretenberg2}from"@aztec/bb.js";import{serializeWitness as serializeWitness2}from"@aztec/noir-noirc_abi";import{convertHidingKernelPublicInputsToWitnessMapWithAbi,convertHidingKernelToRollupInputsToWitnessMapWithAbi,convertPrivateKernelInit2InputsToWitnessMapWithAbi,convertPrivateKernelInit2OutputsFromWitnessMapWithAbi,convertPrivateKernelInit3InputsToWitnessMapWithAbi,convertPrivateKernelInit3OutputsFromWitnessMapWithAbi,convertPrivateKernelInitInputsToWitnessMapWithAbi,convertPrivateKernelInitOutputsFromWitnessMapWithAbi,convertPrivateKernelInner2InputsToWitnessMapWithAbi,convertPrivateKernelInner2OutputsFromWitnessMapWithAbi,convertPrivateKernelInner3InputsToWitnessMapWithAbi,convertPrivateKernelInner3OutputsFromWitnessMapWithAbi,convertPrivateKernelInnerInputsToWitnessMapWithAbi,convertPrivateKernelInnerOutputsFromWitnessMapWithAbi,convertPrivateKernelResetInputsToWitnessMapWithAbi,convertPrivateKernelResetOutputsFromWitnessMapWithAbi,convertPrivateKernelResetTailInputsToWitnessMapWithAbi,convertPrivateKernelResetTailToPublicInputsToWitnessMapWithAbi,convertPrivateKernelTailForPublicOutputsFromWitnessMapWithAbi,convertPrivateKernelTailOutputsFromWitnessMapWithAbi,foreignCallHandler,getPrivateKernelResetArtifactName,getPrivateKernelResetTailArtifactName,updateResetCircuitSampleInputs}from"@aztec/noir-protocol-circuits-types/client";import{mapProtocolArtifactNameToCircuitName}from"@aztec/noir-protocol-circuits-types/types";import{ungzip}from"pako";function makeProtocolContract(name,artifact){let address=ProtocolContractAddress[name],salt=ProtocolContractSalt[name],classId=ProtocolContractClassId[name],{artifactHash,privateFunctionsRoot,publicBytecodeCommitment}=ProtocolContractClassIdPreimage[name],initializationHash=ProtocolContractInitializationHash[name],contractClass={id:classId,version:1,artifactHash,privateFunctionsRoot,publicBytecodeCommitment,packedBytecode:artifact.functions.find(f=>f.name==="public_dispatch")?.bytecode??Buffer.alloc(0),privateFunctions:ProtocolContractPrivateFunctions[name]};return{instance:{version:2,currentContractClassId:classId,originalContractClassId:classId,initializationHash,immutablesHash:Fr.ZERO,publicKeys:PublicKeys.default(),salt,deployer:address,address},contractClass,artifact,address}}__name(makeProtocolContract,"makeProtocolContract");var ContractClassPublishedEvent=class _ContractClassPublishedEvent{static{__name(this,"ContractClassPublishedEvent")}contractClassId;version;artifactHash;privateFunctionsRoot;packedPublicBytecode;constructor(contractClassId,version2,artifactHash,privateFunctionsRoot,packedPublicBytecode){this.contractClassId=contractClassId,this.version=version2,this.artifactHash=artifactHash,this.privateFunctionsRoot=privateFunctionsRoot,this.packedPublicBytecode=packedPublicBytecode}static isContractClassPublishedEvent(log2){return log2.contractAddress.equals(ProtocolContractAddress.ContractClassRegistry)&&log2.fields.fields[0].toBigInt()===CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE}static fromLog(log2){let fieldsWithoutTag=log2.fields.fields.slice(1),reader=new FieldReader(fieldsWithoutTag),contractClassId=reader.readField(),version2=reader.readField().toNumber(),artifactHash=reader.readField(),privateFunctionsRoot=reader.readField(),bytecodeFields=reader.readFieldArray(fieldsWithoutTag.length-reader.cursor),maxByteLength=(bytecodeFields.length-1)*(Fr.SIZE_IN_BYTES-1),packedPublicBytecode=bufferFromFields(bytecodeFields,maxByteLength);return new _ContractClassPublishedEvent(contractClassId,version2,artifactHash,privateFunctionsRoot,packedPublicBytecode)}toContractClassPublic(){return{id:this.contractClassId,artifactHash:this.artifactHash,packedBytecode:this.packedPublicBytecode,privateFunctionsRoot:this.privateFunctionsRoot,version:this.version}}async toContractClassPublicWithBytecodeCommitment(){let publicBytecodeCommitment=await computePublicBytecodeCommitment(this.packedPublicBytecode);return{...this.toContractClassPublic(),publicBytecodeCommitment}}static extractContractClassEvents(logs){return logs.filter(log2=>_ContractClassPublishedEvent.isContractClassPublishedEvent(log2)).map(log2=>_ContractClassPublishedEvent.fromLog(log2))}};var protocolContract,protocolContractArtifact;async function getContractClassRegistryArtifact(){if(!protocolContractArtifact){let{default:contractClassRegistryJson}=await import("./ContractClassRegistry-N6NA3SFA.js");protocolContractArtifact=loadContractArtifact(contractClassRegistryJson)}return protocolContractArtifact}__name(getContractClassRegistryArtifact,"getContractClassRegistryArtifact");async function getCanonicalClassRegistry(){if(!protocolContract){let contractClassRegistryArtifact=await getContractClassRegistryArtifact();protocolContract=makeProtocolContract("ContractClassRegistry",contractClassRegistryArtifact)}return protocolContract}__name(getCanonicalClassRegistry,"getCanonicalClassRegistry");var protocolContract2,protocolContractArtifact2;async function getFeeJuiceArtifact(){if(!protocolContractArtifact2){let{default:feeJuiceJson}=await import("./FeeJuice-QBH5JWJV.js");protocolContractArtifact2=loadContractArtifact(feeJuiceJson)}return protocolContractArtifact2}__name(getFeeJuiceArtifact,"getFeeJuiceArtifact");async function getCanonicalFeeJuice(){if(!protocolContract2){let feeJuiceArtifact=await getFeeJuiceArtifact();protocolContract2=makeProtocolContract("FeeJuice",feeJuiceArtifact)}return protocolContract2}__name(getCanonicalFeeJuice,"getCanonicalFeeJuice");var ContractInstancePublishedEvent=class _ContractInstancePublishedEvent{static{__name(this,"ContractInstancePublishedEvent")}address;version;salt;contractClassId;initializationHash;immutablesHash;publicKeys;deployer;constructor(address,version2,salt,contractClassId,initializationHash,immutablesHash,publicKeys,deployer){this.address=address,this.version=version2,this.salt=salt,this.contractClassId=contractClassId,this.initializationHash=initializationHash,this.immutablesHash=immutablesHash,this.publicKeys=publicKeys,this.deployer=deployer}static isContractInstancePublishedEvent(log2){return log2.fields[0].equals(CONTRACT_INSTANCE_PUBLISHED_EVENT_TAG)}static fromLog(log2){let bufferWithoutTag=log2.toBuffer().subarray(32),reader=new BufferReader(bufferWithoutTag),address=reader.readObject(AztecAddress),version2=reader.readObject(Fr).toNumber(),salt=reader.readObject(Fr),contractClassId=reader.readObject(Fr),initializationHash=reader.readObject(Fr),immutablesHash=reader.readObject(Fr),publicKeys=reader.readObject(PublicKeys),deployer=reader.readObject(AztecAddress);return new _ContractInstancePublishedEvent(address,version2,salt,contractClassId,initializationHash,immutablesHash,publicKeys,deployer)}toContractInstance(){if(this.version!==2)throw new Error(`Unexpected contract instance version ${this.version}`);return{address:this.address,version:this.version,currentContractClassId:this.contractClassId,originalContractClassId:this.contractClassId,initializationHash:this.initializationHash,immutablesHash:this.immutablesHash,publicKeys:this.publicKeys,salt:this.salt,deployer:this.deployer}}static extractContractInstanceEvents(logs){return logs.filter(log2=>_ContractInstancePublishedEvent.isContractInstancePublishedEvent(log2)).map(log2=>_ContractInstancePublishedEvent.fromLog(log2))}};var ContractInstanceUpdatedEvent=class _ContractInstanceUpdatedEvent{static{__name(this,"ContractInstanceUpdatedEvent")}address;prevContractClassId;newContractClassId;timestampOfChange;constructor(address,prevContractClassId,newContractClassId,timestampOfChange){this.address=address,this.prevContractClassId=prevContractClassId,this.newContractClassId=newContractClassId,this.timestampOfChange=timestampOfChange}static isContractInstanceUpdatedEvent(log2){return log2.contractAddress.equals(ProtocolContractAddress.ContractInstanceRegistry)&&log2.fields[0].toBigInt()===CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE}static fromLog(log2){let reader=new FieldReader(log2.fields.slice(1)),address=reader.readObject(AztecAddress),prevContractClassId=reader.readField(),newContractClassId=reader.readField(),timestampOfChange=reader.readField().toBigInt();return new _ContractInstanceUpdatedEvent(address,prevContractClassId,newContractClassId,timestampOfChange)}toContractInstanceUpdate(){return{address:this.address,prevContractClassId:this.prevContractClassId,newContractClassId:this.newContractClassId,timestampOfChange:this.timestampOfChange}}};var protocolContract3,protocolContractArtifact3;async function getContractInstanceRegistryArtifact(){if(!protocolContractArtifact3){let{default:contractInstanceRegistryJson}=await import("./ContractInstanceRegistry-NADDSLGL.js");protocolContractArtifact3=loadContractArtifact(contractInstanceRegistryJson)}return protocolContractArtifact3}__name(getContractInstanceRegistryArtifact,"getContractInstanceRegistryArtifact");async function getCanonicalInstanceRegistry(){if(!protocolContract3){let contractInstanceRegistryArtifact=await getContractInstanceRegistryArtifact();protocolContract3=makeProtocolContract("ContractInstanceRegistry",contractInstanceRegistryArtifact)}return protocolContract3}__name(getCanonicalInstanceRegistry,"getCanonicalInstanceRegistry");var LazyProtocolContractsProvider=class{static{__name(this,"LazyProtocolContractsProvider")}getProtocolContractArtifact(name){switch(name){case"ContractInstanceRegistry":return getCanonicalInstanceRegistry();case"ContractClassRegistry":return getCanonicalClassRegistry();case"FeeJuice":return getCanonicalFeeJuice();default:throw new Error(`Unknown protocol contract name: ${name}`)}}};function makeStandardContract(name,artifact){let address=StandardContractAddress[name],salt=StandardContractSalt[name],classId=StandardContractClassId[name],{artifactHash,privateFunctionsRoot,publicBytecodeCommitment}=StandardContractClassIdPreimage[name],initializationHash=StandardContractInitializationHash[name],contractClass={id:classId,version:1,artifactHash,privateFunctionsRoot,publicBytecodeCommitment,packedBytecode:artifact.functions.find(f=>f.name==="public_dispatch")?.bytecode??Buffer.alloc(0),privateFunctions:StandardContractPrivateFunctions[name]};return{instance:{version:2,currentContractClassId:classId,originalContractClassId:classId,initializationHash,immutablesHash:Fr.ZERO,publicKeys:PublicKeys.default(),salt,deployer:AztecAddress.ZERO,address},contractClass,artifact,address}}__name(makeStandardContract,"makeStandardContract");var STANDARD_AUTH_REGISTRY_ADDRESS=StandardContractAddress.AuthRegistry,STANDARD_AUTH_REGISTRY_CLASS_ID=StandardContractClassId.AuthRegistry,STANDARD_AUTH_REGISTRY_SALT=StandardContractSalt.AuthRegistry;var standardContract,standardContractArtifact;async function getAuthRegistryArtifact(){if(!standardContractArtifact){let{default:authRegistryJson}=await import("./AuthRegistry-56AMRLSQ.js");standardContractArtifact=loadContractArtifact(authRegistryJson)}return standardContractArtifact}__name(getAuthRegistryArtifact,"getAuthRegistryArtifact");async function getStandardAuthRegistry(){if(!standardContract){let artifact=await getAuthRegistryArtifact();standardContract=makeStandardContract("AuthRegistry",artifact)}return standardContract}__name(getStandardAuthRegistry,"getStandardAuthRegistry");var standardContract2,standardContractArtifact2;async function getHandshakeRegistryArtifact(){if(!standardContractArtifact2){let{default:handshakeRegistryJson}=await import("./HandshakeRegistry-D2W3AOPD.js");standardContractArtifact2=loadContractArtifact(handshakeRegistryJson)}return standardContractArtifact2}__name(getHandshakeRegistryArtifact,"getHandshakeRegistryArtifact");async function getStandardHandshakeRegistry(){if(!standardContract2){let artifact=await getHandshakeRegistryArtifact();standardContract2=makeStandardContract("HandshakeRegistry",artifact)}return standardContract2}__name(getStandardHandshakeRegistry,"getStandardHandshakeRegistry");var STANDARD_MULTI_CALL_ENTRYPOINT_ADDRESS=StandardContractAddress.MultiCallEntrypoint,STANDARD_MULTI_CALL_ENTRYPOINT_CLASS_ID=StandardContractClassId.MultiCallEntrypoint,STANDARD_MULTI_CALL_ENTRYPOINT_SALT=StandardContractSalt.MultiCallEntrypoint;var decoder;try{decoder=new TextDecoder}catch{}var src,srcEnd,position2=0;var EMPTY_ARRAY=[],strings=EMPTY_ARRAY,stringPosition=0,currentUnpackr={},currentStructures,srcString,srcStringStart=0,srcStringEnd=0,bundledStrings,referenceMap,currentExtensions=[],dataView,defaultOptions={useRecords:!1,mapsAsObjects:!0},C1Type=class{static{__name(this,"C1Type")}},C1=new C1Type;C1.name="MessagePack 0xC1";var sequentialMode=!1,inlineObjectReadThreshold=2,readStruct,onLoadedStructures,onSaveState;try{new Function("")}catch{inlineObjectReadThreshold=1/0}var Unpackr=class _Unpackr{static{__name(this,"Unpackr")}constructor(options){options&&(options.useRecords===!1&&options.mapsAsObjects===void 0&&(options.mapsAsObjects=!0),options.sequential&&options.trusted!==!1&&(options.trusted=!0,!options.structures&&options.useRecords!=!1&&(options.structures=[],options.maxSharedStructures||(options.maxSharedStructures=0))),options.structures?options.structures.sharedLength=options.structures.length:options.getStructures&&((options.structures=[]).uninitialized=!0,options.structures.sharedLength=0),options.int64AsNumber&&(options.int64AsType="number")),Object.assign(this,options)}unpack(source,options){if(src)return saveState(()=>(clearSource(),this?this.unpack(source,options):_Unpackr.prototype.unpack.call(defaultOptions,source,options)));!source.buffer&&source.constructor===ArrayBuffer&&(source=typeof Buffer<"u"?Buffer.from(source):new Uint8Array(source)),typeof options=="object"?(srcEnd=options.end||source.length,position2=options.start||0):(position2=0,srcEnd=options>-1?options:source.length),stringPosition=0,srcStringEnd=0,srcString=null,strings=EMPTY_ARRAY,bundledStrings=null,src=source;try{dataView=source.dataView||(source.dataView=new DataView(source.buffer,source.byteOffset,source.byteLength))}catch(error2){throw src=null,source instanceof Uint8Array?error2:new Error("Source must be a Uint8Array or Buffer but was a "+(source&&typeof source=="object"?source.constructor.name:typeof source))}if(this instanceof _Unpackr){if(currentUnpackr=this,this.structures)return currentStructures=this.structures,checkedRead(options);(!currentStructures||currentStructures.length>0)&&(currentStructures=[])}else currentUnpackr=defaultOptions,(!currentStructures||currentStructures.length>0)&&(currentStructures=[]);return checkedRead(options)}unpackMultiple(source,forEach){let values,lastPosition=0;try{sequentialMode=!0;let size=source.length,value=this?this.unpack(source,size):defaultUnpackr.unpack(source,size);if(forEach){if(forEach(value,lastPosition,position2)===!1)return;for(;position2<size;)if(lastPosition=position2,forEach(checkedRead(),lastPosition,position2)===!1)return}else{for(values=[value];position2<size;)lastPosition=position2,values.push(checkedRead());return values}}catch(error2){throw error2.lastPosition=lastPosition,error2.values=values,error2}finally{sequentialMode=!1,clearSource()}}_mergeStructures(loadedStructures,existingStructures){onLoadedStructures&&(loadedStructures=onLoadedStructures.call(this,loadedStructures)),loadedStructures=loadedStructures||[],Object.isFrozen(loadedStructures)&&(loadedStructures=loadedStructures.map(structure=>structure.slice(0)));for(let i=0,l=loadedStructures.length;i<l;i++){let structure=loadedStructures[i];structure&&(structure.isShared=!0,i>=32&&(structure.highByte=i-32>>5))}loadedStructures.sharedLength=loadedStructures.length;for(let id in existingStructures||[])if(id>=0){let structure=loadedStructures[id],existing=existingStructures[id];existing&&(structure&&((loadedStructures.restoreStructures||(loadedStructures.restoreStructures=[]))[id]=structure),loadedStructures[id]=existing)}return this.structures=loadedStructures}decode(source,options){return this.unpack(source,options)}};function checkedRead(options){try{if(!currentUnpackr.trusted&&!sequentialMode){let sharedLength=currentStructures.sharedLength||0;sharedLength<currentStructures.length&&(currentStructures.length=sharedLength)}let result;if(currentUnpackr.randomAccessStructure&&src[position2]<64&&src[position2]>=32&&readStruct?(result=readStruct(src,position2,srcEnd,currentUnpackr),src=null,!(options&&options.lazy)&&result&&(result=result.toJSON()),position2=srcEnd):result=read(),bundledStrings&&(position2=bundledStrings.postBundlePosition,bundledStrings=null),sequentialMode&&(currentStructures.restoreStructures=null),position2==srcEnd)currentStructures&&currentStructures.restoreStructures&&restoreStructures(),currentStructures=null,src=null,referenceMap&&(referenceMap=null);else{if(position2>srcEnd)throw new Error("Unexpected end of MessagePack data");if(!sequentialMode){let jsonView;try{jsonView=JSON.stringify(result,(_,value)=>typeof value=="bigint"?`${value}n`:value).slice(0,100)}catch(error2){jsonView="(JSON view not available "+error2+")"}throw new Error("Data read, but end of buffer not reached "+jsonView)}}return result}catch(error2){throw currentStructures&&currentStructures.restoreStructures&&restoreStructures(),clearSource(),(error2 instanceof RangeError||error2.message.startsWith("Unexpected end of buffer")||position2>srcEnd)&&(error2.incomplete=!0),error2}}__name(checkedRead,"checkedRead");function restoreStructures(){for(let id in currentStructures.restoreStructures)currentStructures[id]=currentStructures.restoreStructures[id];currentStructures.restoreStructures=null}__name(restoreStructures,"restoreStructures");function read(){let token=src[position2++];if(token<160)if(token<128){if(token<64)return token;{let structure=currentStructures[token&63]||currentUnpackr.getStructures&&loadStructures()[token&63];return structure?(structure.read||(structure.read=createStructureReader(structure,token&63)),structure.read()):token}}else if(token<144)if(token-=128,currentUnpackr.mapsAsObjects){let object2={};for(let i=0;i<token;i++){let key=readKey2();key==="__proto__"&&(key="__proto_"),object2[key]=read()}return object2}else{let map2=new Map;for(let i=0;i<token;i++)map2.set(read(),read());return map2}else{token-=144;let array2=new Array(token);for(let i=0;i<token;i++)array2[i]=read();return currentUnpackr.freezeData?Object.freeze(array2):array2}else if(token<192){let length=token-160;if(srcStringEnd>=position2)return srcString.slice(position2-srcStringStart,(position2+=length)-srcStringStart);if(srcStringEnd==0&&srcEnd<140){let string4=length<16?shortStringInJS(length):longStringInJS(length);if(string4!=null)return string4}return readFixedString(length)}else{let value;switch(token){case 192:return null;case 193:return bundledStrings?(value=read(),value>0?bundledStrings[1].slice(bundledStrings.position1,bundledStrings.position1+=value):bundledStrings[0].slice(bundledStrings.position0,bundledStrings.position0-=value)):C1;case 194:return!1;case 195:return!0;case 196:if(value=src[position2++],value===void 0)throw new Error("Unexpected end of buffer");return readBin(value);case 197:return value=dataView.getUint16(position2),position2+=2,readBin(value);case 198:return value=dataView.getUint32(position2),position2+=4,readBin(value);case 199:return readExt(src[position2++]);case 200:return value=dataView.getUint16(position2),position2+=2,readExt(value);case 201:return value=dataView.getUint32(position2),position2+=4,readExt(value);case 202:if(value=dataView.getFloat32(position2),currentUnpackr.useFloat32>2){let multiplier=mult10[(src[position2]&127)<<1|src[position2+1]>>7];return position2+=4,(multiplier*value+(value>0?.5:-.5)>>0)/multiplier}return position2+=4,value;case 203:return value=dataView.getFloat64(position2),position2+=8,value;case 204:return src[position2++];case 205:return value=dataView.getUint16(position2),position2+=2,value;case 206:return value=dataView.getUint32(position2),position2+=4,value;case 207:return currentUnpackr.int64AsType==="number"?(value=dataView.getUint32(position2)*4294967296,value+=dataView.getUint32(position2+4)):currentUnpackr.int64AsType==="string"?value=dataView.getBigUint64(position2).toString():currentUnpackr.int64AsType==="auto"?(value=dataView.getBigUint64(position2),value<=BigInt(2)<<BigInt(52)&&(value=Number(value))):value=dataView.getBigUint64(position2),position2+=8,value;case 208:return dataView.getInt8(position2++);case 209:return value=dataView.getInt16(position2),position2+=2,value;case 210:return value=dataView.getInt32(position2),position2+=4,value;case 211:return currentUnpackr.int64AsType==="number"?(value=dataView.getInt32(position2)*4294967296,value+=dataView.getUint32(position2+4)):currentUnpackr.int64AsType==="string"?value=dataView.getBigInt64(position2).toString():currentUnpackr.int64AsType==="auto"?(value=dataView.getBigInt64(position2),value>=BigInt(-2)<<BigInt(52)&&value<=BigInt(2)<<BigInt(52)&&(value=Number(value))):value=dataView.getBigInt64(position2),position2+=8,value;case 212:if(value=src[position2++],value==114)return recordDefinition(src[position2++]&63);{let extension=currentExtensions[value];if(extension)return extension.read?(position2++,extension.read(read())):extension.noBuffer?(position2++,extension()):extension(src.subarray(position2,++position2));throw new Error("Unknown extension "+value)}case 213:return value=src[position2],value==114?(position2++,recordDefinition(src[position2++]&63,src[position2++])):readExt(2);case 214:return readExt(4);case 215:return readExt(8);case 216:return readExt(16);case 217:return value=src[position2++],srcStringEnd>=position2?srcString.slice(position2-srcStringStart,(position2+=value)-srcStringStart):readString8(value);case 218:return value=dataView.getUint16(position2),position2+=2,srcStringEnd>=position2?srcString.slice(position2-srcStringStart,(position2+=value)-srcStringStart):readString16(value);case 219:return value=dataView.getUint32(position2),position2+=4,srcStringEnd>=position2?srcString.slice(position2-srcStringStart,(position2+=value)-srcStringStart):readString32(value);case 220:return value=dataView.getUint16(position2),position2+=2,readArray(value);case 221:return value=dataView.getUint32(position2),position2+=4,readArray(value);case 222:return value=dataView.getUint16(position2),position2+=2,readMap(value);case 223:return value=dataView.getUint32(position2),position2+=4,readMap(value);default:if(token>=224)return token-256;if(token===void 0){let error2=new Error("Unexpected end of MessagePack data");throw error2.incomplete=!0,error2}throw new Error("Unknown MessagePack token "+token)}}}__name(read,"read");var validName=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function createStructureReader(structure,firstId){function readObject(){if(readObject.count++>inlineObjectReadThreshold){let readObject2=structure.read=new Function("r","return function(){return "+(currentUnpackr.freezeData?"Object.freeze":"")+"({"+structure.map(key=>key==="__proto__"?"__proto_:r()":validName.test(key)?key+":r()":"["+JSON.stringify(key)+"]:r()").join(",")+"})}")(read);return structure.highByte===0&&(structure.read=createSecondByteReader(firstId,structure.read)),readObject2()}let object2={};for(let i=0,l=structure.length;i<l;i++){let key=structure[i];key==="__proto__"&&(key="__proto_"),object2[key]=read()}return currentUnpackr.freezeData?Object.freeze(object2):object2}return __name(readObject,"readObject"),readObject.count=0,structure.highByte===0?createSecondByteReader(firstId,readObject):readObject}__name(createStructureReader,"createStructureReader");var createSecondByteReader=__name((firstId,read0)=>function(){let highByte=src[position2++];if(highByte===0)return read0();let id=firstId<32?-(firstId+(highByte<<5)):firstId+(highByte<<5),structure=currentStructures[id]||loadStructures()[id];if(!structure)throw new Error("Record id is not defined for "+id);return structure.read||(structure.read=createStructureReader(structure,firstId)),structure.read()},"createSecondByteReader");function loadStructures(){let loadedStructures=saveState(()=>(src=null,currentUnpackr.getStructures()));return currentStructures=currentUnpackr._mergeStructures(loadedStructures,currentStructures)}__name(loadStructures,"loadStructures");var readFixedString=readStringJS,readString8=readStringJS,readString16=readStringJS,readString32=readStringJS,isNativeAccelerationEnabled=!1;function setExtractor(extractStrings){isNativeAccelerationEnabled=!0,readFixedString=readString3(1),readString8=readString3(2),readString16=readString3(3),readString32=readString3(5);function readString3(headerLength){return __name(function(length){let string4=strings[stringPosition++];if(string4==null){if(bundledStrings)return readStringJS(length);let byteOffset=src.byteOffset,extraction=extractStrings(position2-headerLength+byteOffset,srcEnd+byteOffset,src.buffer);if(typeof extraction=="string")string4=extraction,strings=EMPTY_ARRAY;else if(strings=extraction,stringPosition=1,srcStringEnd=1,string4=strings[0],string4===void 0)throw new Error("Unexpected end of buffer")}let srcStringLength=string4.length;return srcStringLength<=length?(position2+=length,string4):(srcString=string4,srcStringStart=position2,srcStringEnd=position2+srcStringLength,position2+=length,string4.slice(0,length))},"readString")}__name(readString3,"readString")}__name(setExtractor,"setExtractor");function readStringJS(length){let result;if(length<16&&(result=shortStringInJS(length)))return result;if(length>64&&decoder)return decoder.decode(src.subarray(position2,position2+=length));let end=position2+length,units=[];for(result="";position2<end;){let byte1=src[position2++];if((byte1&128)===0)units.push(byte1);else if((byte1&224)===192){let byte2=src[position2++]&63;units.push((byte1&31)<<6|byte2)}else if((byte1&240)===224){let byte2=src[position2++]&63,byte3=src[position2++]&63;units.push((byte1&31)<<12|byte2<<6|byte3)}else if((byte1&248)===240){let byte2=src[position2++]&63,byte3=src[position2++]&63,byte4=src[position2++]&63,unit=(byte1&7)<<18|byte2<<12|byte3<<6|byte4;unit>65535&&(unit-=65536,units.push(unit>>>10&1023|55296),unit=56320|unit&1023),units.push(unit)}else units.push(byte1);units.length>=4096&&(result+=fromCharCode2.apply(String,units),units.length=0)}return units.length>0&&(result+=fromCharCode2.apply(String,units)),result}__name(readStringJS,"readStringJS");function readString2(source,start,length){let existingSrc=src;src=source,position2=start;try{return readStringJS(length)}finally{src=existingSrc}}__name(readString2,"readString");function readArray(length){let array2=new Array(length);for(let i=0;i<length;i++)array2[i]=read();return currentUnpackr.freezeData?Object.freeze(array2):array2}__name(readArray,"readArray");function readMap(length){if(currentUnpackr.mapsAsObjects){let object2={};for(let i=0;i<length;i++){let key=readKey2();key==="__proto__"&&(key="__proto_"),object2[key]=read()}return object2}else{let map2=new Map;for(let i=0;i<length;i++)map2.set(read(),read());return map2}}__name(readMap,"readMap");var fromCharCode2=String.fromCharCode;function longStringInJS(length){let start=position2,bytes=new Array(length);for(let i=0;i<length;i++){let byte=src[position2++];if((byte&128)>0){position2=start;return}bytes[i]=byte}return fromCharCode2.apply(String,bytes)}__name(longStringInJS,"longStringInJS");function shortStringInJS(length){if(length<4)if(length<2){if(length===0)return"";{let a=src[position2++];if((a&128)>1){position2-=1;return}return fromCharCode2(a)}}else{let a=src[position2++],b=src[position2++];if((a&128)>0||(b&128)>0){position2-=2;return}if(length<3)return fromCharCode2(a,b);let c2=src[position2++];if((c2&128)>0){position2-=3;return}return fromCharCode2(a,b,c2)}else{let a=src[position2++],b=src[position2++],c2=src[position2++],d=src[position2++];if((a&128)>0||(b&128)>0||(c2&128)>0||(d&128)>0){position2-=4;return}if(length<6){if(length===4)return fromCharCode2(a,b,c2,d);{let e2=src[position2++];if((e2&128)>0){position2-=5;return}return fromCharCode2(a,b,c2,d,e2)}}else if(length<8){let e2=src[position2++],f=src[position2++];if((e2&128)>0||(f&128)>0){position2-=6;return}if(length<7)return fromCharCode2(a,b,c2,d,e2,f);let g=src[position2++];if((g&128)>0){position2-=7;return}return fromCharCode2(a,b,c2,d,e2,f,g)}else{let e2=src[position2++],f=src[position2++],g=src[position2++],h=src[position2++];if((e2&128)>0||(f&128)>0||(g&128)>0||(h&128)>0){position2-=8;return}if(length<10){if(length===8)return fromCharCode2(a,b,c2,d,e2,f,g,h);{let i=src[position2++];if((i&128)>0){position2-=9;return}return fromCharCode2(a,b,c2,d,e2,f,g,h,i)}}else if(length<12){let i=src[position2++],j=src[position2++];if((i&128)>0||(j&128)>0){position2-=10;return}if(length<11)return fromCharCode2(a,b,c2,d,e2,f,g,h,i,j);let k=src[position2++];if((k&128)>0){position2-=11;return}return fromCharCode2(a,b,c2,d,e2,f,g,h,i,j,k)}else{let i=src[position2++],j=src[position2++],k=src[position2++],l=src[position2++];if((i&128)>0||(j&128)>0||(k&128)>0||(l&128)>0){position2-=12;return}if(length<14){if(length===12)return fromCharCode2(a,b,c2,d,e2,f,g,h,i,j,k,l);{let m=src[position2++];if((m&128)>0){position2-=13;return}return fromCharCode2(a,b,c2,d,e2,f,g,h,i,j,k,l,m)}}else{let m=src[position2++],n=src[position2++];if((m&128)>0||(n&128)>0){position2-=14;return}if(length<15)return fromCharCode2(a,b,c2,d,e2,f,g,h,i,j,k,l,m,n);let o=src[position2++];if((o&128)>0){position2-=15;return}return fromCharCode2(a,b,c2,d,e2,f,g,h,i,j,k,l,m,n,o)}}}}}__name(shortStringInJS,"shortStringInJS");function readOnlyJSString(){let token=src[position2++],length;if(token<192)length=token-160;else switch(token){case 217:length=src[position2++];break;case 218:length=dataView.getUint16(position2),position2+=2;break;case 219:length=dataView.getUint32(position2),position2+=4;break;default:throw new Error("Expected string")}return readStringJS(length)}__name(readOnlyJSString,"readOnlyJSString");function readBin(length){return currentUnpackr.copyBuffers?Uint8Array.prototype.slice.call(src,position2,position2+=length):src.subarray(position2,position2+=length)}__name(readBin,"readBin");function readExt(length){let type=src[position2++];if(currentExtensions[type]){let end;return currentExtensions[type](src.subarray(position2,end=position2+=length),readPosition=>{position2=readPosition;try{return read()}finally{position2=end}})}else throw new Error("Unknown extension type "+type)}__name(readExt,"readExt");var keyCache=new Array(4096);function readKey2(){let length=src[position2++];if(length>=160&&length<192){if(length=length-160,srcStringEnd>=position2)return srcString.slice(position2-srcStringStart,(position2+=length)-srcStringStart);if(!(srcStringEnd==0&&srcEnd<180))return readFixedString(length)}else return position2--,asSafeString(read());let key=(length<<5^(length>1?dataView.getUint16(position2):length>0?src[position2]:0))&4095,entry=keyCache[key],checkPosition=position2,end=position2+length-3,chunk3,i=0;if(entry&&entry.bytes==length){for(;checkPosition<end;){if(chunk3=dataView.getUint32(checkPosition),chunk3!=entry[i++]){checkPosition=1879048192;break}checkPosition+=4}for(end+=3;checkPosition<end;)if(chunk3=src[checkPosition++],chunk3!=entry[i++]){checkPosition=1879048192;break}if(checkPosition===end)return position2=checkPosition,entry.string;end-=3,checkPosition=position2}for(entry=[],keyCache[key]=entry,entry.bytes=length;checkPosition<end;)chunk3=dataView.getUint32(checkPosition),entry.push(chunk3),checkPosition+=4;for(end+=3;checkPosition<end;)chunk3=src[checkPosition++],entry.push(chunk3);let string4=length<16?shortStringInJS(length):longStringInJS(length);return string4!=null?entry.string=string4:entry.string=readFixedString(length)}__name(readKey2,"readKey");function asSafeString(property){if(typeof property=="string")return property;if(typeof property=="number"||typeof property=="boolean"||typeof property=="bigint")return property.toString();if(property==null)return property+"";throw new Error("Invalid property type for record",typeof property)}__name(asSafeString,"asSafeString");var recordDefinition=__name((id,highByte)=>{let structure=read().map(asSafeString),firstByte=id;highByte!==void 0&&(id=id<32?-((highByte<<5)+id):(highByte<<5)+id,structure.highByte=highByte);let existingStructure=currentStructures[id];return existingStructure&&(existingStructure.isShared||sequentialMode)&&((currentStructures.restoreStructures||(currentStructures.restoreStructures=[]))[id]=existingStructure),currentStructures[id]=structure,structure.read=createStructureReader(structure,firstByte),structure.read()},"recordDefinition");currentExtensions[0]=()=>{};currentExtensions[0].noBuffer=!0;currentExtensions[66]=data=>{let length=data.length,value=BigInt(data[0]&128?data[0]-256:data[0]);for(let i=1;i<length;i++)value<<=BigInt(8),value+=BigInt(data[i]);return value};var errors={Error,TypeError,ReferenceError};currentExtensions[101]=()=>{let data=read();return(errors[data[0]]||Error)(data[1],{cause:data[2]})};currentExtensions[105]=data=>{if(currentUnpackr.structuredClone===!1)throw new Error("Structured clone extension is disabled");let id=dataView.getUint32(position2-4);referenceMap||(referenceMap=new Map);let token=src[position2],target2;token>=144&&token<160||token==220||token==221?target2=[]:target2={};let refEntry={target:target2};referenceMap.set(id,refEntry);let targetProperties=read();return refEntry.used?Object.assign(target2,targetProperties):(refEntry.target=targetProperties,targetProperties)};currentExtensions[112]=data=>{if(currentUnpackr.structuredClone===!1)throw new Error("Structured clone extension is disabled");let id=dataView.getUint32(position2-4),refEntry=referenceMap.get(id);return refEntry.used=!0,refEntry.target};currentExtensions[115]=()=>new Set(read());var typedArrays=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(type=>type+"Array"),glbl=typeof globalThis=="object"?globalThis:window;currentExtensions[116]=data=>{let typeCode=data[0],typedArrayName=typedArrays[typeCode];if(!typedArrayName){if(typeCode===16){let ab=new ArrayBuffer(data.length-1);return new Uint8Array(ab).set(data.subarray(1)),ab}throw new Error("Could not find typed array for code "+typeCode)}return new glbl[typedArrayName](Uint8Array.prototype.slice.call(data,1).buffer)};currentExtensions[120]=()=>{let data=read();return new RegExp(data[0],data[1])};var TEMP_BUNDLE=[];currentExtensions[98]=data=>{let dataSize=(data[0]<<24)+(data[1]<<16)+(data[2]<<8)+data[3],dataPosition=position2;return position2+=dataSize-data.length,bundledStrings=TEMP_BUNDLE,bundledStrings=[readOnlyJSString(),readOnlyJSString()],bundledStrings.position0=0,bundledStrings.position1=0,bundledStrings.postBundlePosition=position2,position2=dataPosition,read()};currentExtensions[255]=data=>data.length==4?new Date((data[0]*16777216+(data[1]<<16)+(data[2]<<8)+data[3])*1e3):data.length==8?new Date(((data[0]<<22)+(data[1]<<14)+(data[2]<<6)+(data[3]>>2))/1e6+((data[3]&3)*4294967296+data[4]*16777216+(data[5]<<16)+(data[6]<<8)+data[7])*1e3):data.length==12?new Date(((data[0]<<24)+(data[1]<<16)+(data[2]<<8)+data[3])/1e6+((data[4]&128?-281474976710656:0)+data[6]*1099511627776+data[7]*4294967296+data[8]*16777216+(data[9]<<16)+(data[10]<<8)+data[11])*1e3):new Date("invalid");function saveState(callback){onSaveState&&onSaveState();let savedSrcEnd=srcEnd,savedPosition=position2,savedStringPosition=stringPosition,savedSrcStringStart=srcStringStart,savedSrcStringEnd=srcStringEnd,savedSrcString=srcString,savedStrings=strings,savedReferenceMap=referenceMap,savedBundledStrings=bundledStrings,savedSrc=new Uint8Array(src.slice(0,srcEnd)),savedStructures=currentStructures,savedStructuresContents=currentStructures.slice(0,currentStructures.length),savedPackr=currentUnpackr,savedSequentialMode=sequentialMode,value=callback();return srcEnd=savedSrcEnd,position2=savedPosition,stringPosition=savedStringPosition,srcStringStart=savedSrcStringStart,srcStringEnd=savedSrcStringEnd,srcString=savedSrcString,strings=savedStrings,referenceMap=savedReferenceMap,bundledStrings=savedBundledStrings,src=savedSrc,sequentialMode=savedSequentialMode,currentStructures=savedStructures,currentStructures.splice(0,currentStructures.length,...savedStructuresContents),currentUnpackr=savedPackr,dataView=new DataView(src.buffer,src.byteOffset,src.byteLength),value}__name(saveState,"saveState");function clearSource(){src=null,referenceMap=null,currentStructures=null}__name(clearSource,"clearSource");var mult10=new Array(147);for(let i=0;i<256;i++)mult10[i]=+("1e"+Math.floor(45.15-i*.30103));var defaultUnpackr=new Unpackr({useRecords:!1}),unpack=defaultUnpackr.unpack,unpackMultiple=defaultUnpackr.unpackMultiple,decode3=defaultUnpackr.unpack,FLOAT32_OPTIONS={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4},f32Array=new Float32Array(1),u8Array=new Uint8Array(f32Array.buffer,0,4);function setReadStruct(updatedReadStruct,loadedStructs,saveState3){readStruct=updatedReadStruct,onLoadedStructures=loadedStructs,onSaveState=saveState3}__name(setReadStruct,"setReadStruct");var textEncoder2;try{textEncoder2=new TextEncoder}catch{}var extensions,extensionClasses,hasNodeBuffer2=typeof Buffer<"u",ByteArrayAllocate2=hasNodeBuffer2?function(length){return Buffer.allocUnsafeSlow(length)}:Uint8Array,ByteArray=hasNodeBuffer2?Buffer:Uint8Array,MAX_BUFFER_SIZE=hasNodeBuffer2?4294967296:2144337920,target,keysTarget,targetView,position3=0,safeEnd,bundledStrings2=null,writeStructSlots,MAX_BUNDLE_SIZE=21760,hasNonLatin=/[\u0080-\uFFFF]/,RECORD_SYMBOL=Symbol("record-id"),Packr=class extends Unpackr{static{__name(this,"Packr")}constructor(options){super(options),this.offset=0;let typeBuffer,start,hasSharedUpdate,structures,referenceMap2,encodeUtf82=ByteArray.prototype.utf8Write?function(string4,position4){return target.utf8Write(string4,position4,target.byteLength-position4)}:textEncoder2&&textEncoder2.encodeInto?function(string4,position4){return textEncoder2.encodeInto(string4,target.subarray(position4)).written}:!1,packr=this;options||(options={});let isSequential=options&&options.sequential,hasSharedStructures=options.structures||options.saveStructures,maxSharedStructures=options.maxSharedStructures;if(maxSharedStructures==null&&(maxSharedStructures=hasSharedStructures?32:0),maxSharedStructures>8160)throw new Error("Maximum maxSharedStructure is 8160");options.structuredClone&&options.moreTypes==null&&(this.moreTypes=!0);let maxOwnStructures=options.maxOwnStructures;maxOwnStructures==null&&(maxOwnStructures=hasSharedStructures?32:64),!this.structures&&options.useRecords!=!1&&(this.structures=[]);let useTwoByteRecords=maxSharedStructures>32||maxOwnStructures+maxSharedStructures>64,sharedLimitId=maxSharedStructures+64,maxStructureId=maxSharedStructures+maxOwnStructures+64;if(maxStructureId>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let recordIdsToRemove=[],transitionsCount=0,serializationsSinceTransitionRebuild=0;this.pack=this.encode=function(value,encodeOptions){if(target||(target=new ByteArrayAllocate2(8192),targetView=target.dataView||(target.dataView=new DataView(target.buffer,0,8192)),position3=0),safeEnd=target.length-10,safeEnd-position3<2048?(target=new ByteArrayAllocate2(target.length),targetView=target.dataView||(target.dataView=new DataView(target.buffer,0,target.length)),safeEnd=target.length-10,position3=0):position3=position3+7&2147483640,start=position3,encodeOptions&RESERVE_START_SPACE&&(position3+=encodeOptions&255),referenceMap2=packr.structuredClone?new Map:null,packr.bundleStrings&&typeof value!="string"?(bundledStrings2=[],bundledStrings2.size=1/0):bundledStrings2=null,structures=packr.structures,structures){structures.uninitialized&&(structures=packr._mergeStructures(packr.getStructures()));let sharedLength=structures.sharedLength||0;if(sharedLength>maxSharedStructures)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+structures.sharedLength);if(!structures.transitions){structures.transitions=Object.create(null);for(let i=0;i<sharedLength;i++){let keys=structures[i];if(!keys)continue;let nextTransition,transition=structures.transitions;for(let j=0,l=keys.length;j<l;j++){let key=keys[j];nextTransition=transition[key],nextTransition||(nextTransition=transition[key]=Object.create(null)),transition=nextTransition}transition[RECORD_SYMBOL]=i+64}this.lastNamedStructuresLength=sharedLength}isSequential||(structures.nextId=sharedLength+64)}hasSharedUpdate&&(hasSharedUpdate=!1);let encodingError;try{packr.randomAccessStructure&&value&&value.constructor&&value.constructor===Object?writeStruct2(value):pack2(value);let lastBundle=bundledStrings2;if(bundledStrings2&&writeBundles(start,pack2,0),referenceMap2&&referenceMap2.idsToInsert){let idsToInsert=referenceMap2.idsToInsert.sort((a,b)=>a.offset>b.offset?1:-1),i=idsToInsert.length,incrementPosition=-1;for(;lastBundle&&i>0;){let insertionPoint=idsToInsert[--i].offset+start;insertionPoint<lastBundle.stringsPosition+start&&incrementPosition===-1&&(incrementPosition=0),insertionPoint>lastBundle.position+start?incrementPosition>=0&&(incrementPosition+=6):(incrementPosition>=0&&(targetView.setUint32(lastBundle.position+start,targetView.getUint32(lastBundle.position+start)+incrementPosition),incrementPosition=-1),lastBundle=lastBundle.previous,i++)}incrementPosition>=0&&lastBundle&&targetView.setUint32(lastBundle.position+start,targetView.getUint32(lastBundle.position+start)+incrementPosition),position3+=idsToInsert.length*6,position3>safeEnd&&makeRoom(position3),packr.offset=position3;let serialized=insertIds(target.subarray(start,position3),idsToInsert);return referenceMap2=null,serialized}return packr.offset=position3,encodeOptions&REUSE_BUFFER_MODE?(target.start=start,target.end=position3,target):target.subarray(start,position3)}catch(error2){throw encodingError=error2,error2}finally{if(structures&&(resetStructures(),hasSharedUpdate&&packr.saveStructures)){let sharedLength=structures.sharedLength||0,returnBuffer=target.subarray(start,position3),newSharedData=prepareStructures(structures,packr);if(!encodingError)return packr.saveStructures(newSharedData,newSharedData.isCompatible)===!1?packr.pack(value,encodeOptions):(packr.lastNamedStructuresLength=sharedLength,target.length>1073741824&&(target=null),returnBuffer)}target.length>1073741824&&(target=null),encodeOptions&RESET_BUFFER_MODE&&(position3=start)}};let resetStructures=__name(()=>{serializationsSinceTransitionRebuild<10&&serializationsSinceTransitionRebuild++;let sharedLength=structures.sharedLength||0;if(structures.length>sharedLength&&!isSequential&&(structures.length=sharedLength),transitionsCount>1e4)structures.transitions=null,serializationsSinceTransitionRebuild=0,transitionsCount=0,recordIdsToRemove.length>0&&(recordIdsToRemove=[]);else if(recordIdsToRemove.length>0&&!isSequential){for(let i=0,l=recordIdsToRemove.length;i<l;i++)recordIdsToRemove[i][RECORD_SYMBOL]=0;recordIdsToRemove=[]}},"resetStructures"),packArray=__name(value=>{var length=value.length;length<16?target[position3++]=144|length:length<65536?(target[position3++]=220,target[position3++]=length>>8,target[position3++]=length&255):(target[position3++]=221,targetView.setUint32(position3,length),position3+=4);for(let i=0;i<length;i++)pack2(value[i])},"packArray"),pack2=__name(value=>{position3>safeEnd&&(target=makeRoom(position3));var type=typeof value,length;if(type==="string"){let strLength=value.length;if(bundledStrings2&&strLength>=4&&strLength<4096){if((bundledStrings2.size+=strLength)>MAX_BUNDLE_SIZE){let extStart,maxBytes2=(bundledStrings2[0]?bundledStrings2[0].length*3+bundledStrings2[1].length:0)+10;position3+maxBytes2>safeEnd&&(target=makeRoom(position3+maxBytes2));let lastBundle;bundledStrings2.position?(lastBundle=bundledStrings2,target[position3]=200,position3+=3,target[position3++]=98,extStart=position3-start,position3+=4,writeBundles(start,pack2,0),targetView.setUint16(extStart+start-3,position3-start-extStart)):(target[position3++]=214,target[position3++]=98,extStart=position3-start,position3+=4),bundledStrings2=["",""],bundledStrings2.previous=lastBundle,bundledStrings2.size=0,bundledStrings2.position=extStart}let twoByte=hasNonLatin.test(value);bundledStrings2[twoByte?0:1]+=value,target[position3++]=193,pack2(twoByte?-strLength:strLength);return}let headerSize;strLength<32?headerSize=1:strLength<256?headerSize=2:strLength<65536?headerSize=3:headerSize=5;let maxBytes=strLength*3;if(position3+maxBytes>safeEnd&&(target=makeRoom(position3+maxBytes)),strLength<64||!encodeUtf82){let i,c1,c2,strPosition=position3+headerSize;for(i=0;i<strLength;i++)c1=value.charCodeAt(i),c1<128?target[strPosition++]=c1:c1<2048?(target[strPosition++]=c1>>6|192,target[strPosition++]=c1&63|128):(c1&64512)===55296&&((c2=value.charCodeAt(i+1))&64512)===56320?(c1=65536+((c1&1023)<<10)+(c2&1023),i++,target[strPosition++]=c1>>18|240,target[strPosition++]=c1>>12&63|128,target[strPosition++]=c1>>6&63|128,target[strPosition++]=c1&63|128):(target[strPosition++]=c1>>12|224,target[strPosition++]=c1>>6&63|128,target[strPosition++]=c1&63|128);length=strPosition-position3-headerSize}else length=encodeUtf82(value,position3+headerSize);length<32?target[position3++]=160|length:length<256?(headerSize<2&&target.copyWithin(position3+2,position3+1,position3+1+length),target[position3++]=217,target[position3++]=length):length<65536?(headerSize<3&&target.copyWithin(position3+3,position3+2,position3+2+length),target[position3++]=218,target[position3++]=length>>8,target[position3++]=length&255):(headerSize<5&&target.copyWithin(position3+5,position3+3,position3+3+length),target[position3++]=219,targetView.setUint32(position3,length),position3+=4),position3+=length}else if(type==="number")if(value>>>0===value)value<32||value<128&&this.useRecords===!1||value<64&&!this.randomAccessStructure?target[position3++]=value:value<256?(target[position3++]=204,target[position3++]=value):value<65536?(target[position3++]=205,target[position3++]=value>>8,target[position3++]=value&255):(target[position3++]=206,targetView.setUint32(position3,value),position3+=4);else if(value>>0===value)value>=-32?target[position3++]=256+value:value>=-128?(target[position3++]=208,target[position3++]=value+256):value>=-32768?(target[position3++]=209,targetView.setInt16(position3,value),position3+=2):(target[position3++]=210,targetView.setInt32(position3,value),position3+=4);else{let useFloat32;if((useFloat32=this.useFloat32)>0&&value<4294967296&&value>=-2147483648){target[position3++]=202,targetView.setFloat32(position3,value);let xShifted;if(useFloat32<4||(xShifted=value*mult10[(target[position3]&127)<<1|target[position3+1]>>7])>>0===xShifted){position3+=4;return}else position3--}target[position3++]=203,targetView.setFloat64(position3,value),position3+=8}else if(type==="object"||type==="function")if(!value)target[position3++]=192;else{if(referenceMap2){let referee=referenceMap2.get(value);if(referee){if(!referee.id){let idsToInsert=referenceMap2.idsToInsert||(referenceMap2.idsToInsert=[]);referee.id=idsToInsert.push(referee)}target[position3++]=214,target[position3++]=112,targetView.setUint32(position3,referee.id),position3+=4;return}else referenceMap2.set(value,{offset:position3-start})}let constructor=value.constructor;if(constructor===Object)writeObject(value);else if(constructor===Array)packArray(value);else if(constructor===Map)if(this.mapAsEmptyObject)target[position3++]=128;else{length=value.size,length<16?target[position3++]=128|length:length<65536?(target[position3++]=222,target[position3++]=length>>8,target[position3++]=length&255):(target[position3++]=223,targetView.setUint32(position3,length),position3+=4);for(let[key,entryValue]of value)pack2(key),pack2(entryValue)}else{for(let i=0,l=extensions.length;i<l;i++){let extensionClass=extensionClasses[i];if(value instanceof extensionClass){let extension=extensions[i];if(extension.write){extension.type&&(target[position3++]=212,target[position3++]=extension.type,target[position3++]=0);let writeResult=extension.write.call(this,value);writeResult===value?Array.isArray(value)?packArray(value):writeObject(value):pack2(writeResult);return}let currentTarget=target,currentTargetView=targetView,currentPosition=position3;target=null;let result;try{result=extension.pack.call(this,value,size=>(target=currentTarget,currentTarget=null,position3+=size,position3>safeEnd&&makeRoom(position3),{target,targetView,position:position3-size}),pack2)}finally{currentTarget&&(target=currentTarget,targetView=currentTargetView,position3=currentPosition,safeEnd=target.length-10)}result&&(result.length+position3>safeEnd&&makeRoom(result.length+position3),position3=writeExtensionData(result,target,position3,extension.type));return}}if(Array.isArray(value))packArray(value);else{if(value.toJSON){let json2=value.toJSON();if(json2!==value)return pack2(json2)}if(type==="function")return pack2(this.writeFunction&&this.writeFunction(value));writeObject(value)}}}else if(type==="boolean")target[position3++]=value?195:194;else if(type==="bigint"){if(value<BigInt(1)<<BigInt(63)&&value>=-(BigInt(1)<<BigInt(63)))target[position3++]=211,targetView.setBigInt64(position3,value);else if(value<BigInt(1)<<BigInt(64)&&value>0)target[position3++]=207,targetView.setBigUint64(position3,value);else if(this.largeBigIntToFloat)target[position3++]=203,targetView.setFloat64(position3,Number(value));else{if(this.largeBigIntToString)return pack2(value.toString());if(this.useBigIntExtension&&value<BigInt(2)**BigInt(1023)&&value>-(BigInt(2)**BigInt(1023))){target[position3++]=199,position3++,target[position3++]=66;let bytes=[],alignedSign;do{let byte=value&BigInt(255);alignedSign=(byte&BigInt(128))===(value<BigInt(0)?BigInt(128):BigInt(0)),bytes.push(byte),value>>=BigInt(8)}while(!((value===BigInt(0)||value===BigInt(-1))&&alignedSign));target[position3-2]=bytes.length;for(let i=bytes.length;i>0;)target[position3++]=Number(bytes[--i]);return}else throw new RangeError(value+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}position3+=8}else if(type==="undefined")this.encodeUndefinedAsNil?target[position3++]=192:(target[position3++]=212,target[position3++]=0,target[position3++]=0);else throw new Error("Unknown type: "+type)},"pack"),writePlainObject=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?object2=>{let keys;if(this.skipValues){keys=[];for(let key2 in object2)(typeof object2.hasOwnProperty!="function"||object2.hasOwnProperty(key2))&&!this.skipValues.includes(object2[key2])&&keys.push(key2)}else keys=Object.keys(object2);let length=keys.length;length<16?target[position3++]=128|length:length<65536?(target[position3++]=222,target[position3++]=length>>8,target[position3++]=length&255):(target[position3++]=223,targetView.setUint32(position3,length),position3+=4);let key;if(this.coercibleKeyAsNumber)for(let i=0;i<length;i++){key=keys[i];let num=Number(key);pack2(isNaN(num)?key:num),pack2(object2[key])}else for(let i=0;i<length;i++)pack2(key=keys[i]),pack2(object2[key])}:object2=>{target[position3++]=222;let objectOffset=position3-start;position3+=2;let size=0;for(let key in object2)(typeof object2.hasOwnProperty!="function"||object2.hasOwnProperty(key))&&(pack2(key),pack2(object2[key]),size++);if(size>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');target[objectOffset+++start]=size>>8,target[objectOffset+start]=size&255},writeRecord=this.useRecords===!1?writePlainObject:options.progressiveRecords&&!useTwoByteRecords?object2=>{let nextTransition,transition=structures.transitions||(structures.transitions=Object.create(null)),objectOffset=position3++-start,wroteKeys;for(let key in object2)if(typeof object2.hasOwnProperty!="function"||object2.hasOwnProperty(key)){if(nextTransition=transition[key],nextTransition)transition=nextTransition;else{let keys=Object.keys(object2),lastTransition=transition;transition=structures.transitions;let newTransitions=0;for(let i=0,l=keys.length;i<l;i++){let key2=keys[i];nextTransition=transition[key2],nextTransition||(nextTransition=transition[key2]=Object.create(null),newTransitions++),transition=nextTransition}objectOffset+start+1==position3?(position3--,newRecord(transition,keys,newTransitions)):insertNewRecord(transition,keys,objectOffset,newTransitions),wroteKeys=!0,transition=lastTransition[key]}pack2(object2[key])}if(!wroteKeys){let recordId=transition[RECORD_SYMBOL];recordId?target[objectOffset+start]=recordId:insertNewRecord(transition,Object.keys(object2),objectOffset,0)}}:object2=>{let nextTransition,transition=structures.transitions||(structures.transitions=Object.create(null)),newTransitions=0;for(let key in object2)(typeof object2.hasOwnProperty!="function"||object2.hasOwnProperty(key))&&(nextTransition=transition[key],nextTransition||(nextTransition=transition[key]=Object.create(null),newTransitions++),transition=nextTransition);let recordId=transition[RECORD_SYMBOL];recordId?recordId>=96&&useTwoByteRecords?(target[position3++]=((recordId-=96)&31)+96,target[position3++]=recordId>>5):target[position3++]=recordId:newRecord(transition,transition.__keys__||Object.keys(object2),newTransitions);for(let key in object2)(typeof object2.hasOwnProperty!="function"||object2.hasOwnProperty(key))&&pack2(object2[key])},checkUseRecords=typeof this.useRecords=="function"&&this.useRecords,writeObject=checkUseRecords?object2=>{checkUseRecords(object2)?writeRecord(object2):writePlainObject(object2)}:writeRecord,makeRoom=__name(end=>{let newSize;if(end>16777216){if(end-start>MAX_BUFFER_SIZE)throw new Error("Packed buffer would be larger than maximum buffer size");newSize=Math.min(MAX_BUFFER_SIZE,Math.round(Math.max((end-start)*(end>67108864?1.25:2),4194304)/4096)*4096)}else newSize=(Math.max(end-start<<2,target.length-1)>>12)+1<<12;let newBuffer=new ByteArrayAllocate2(newSize);return targetView=newBuffer.dataView||(newBuffer.dataView=new DataView(newBuffer.buffer,0,newSize)),end=Math.min(end,target.length),target.copy?target.copy(newBuffer,0,start,end):newBuffer.set(target.slice(start,end)),position3-=start,start=0,safeEnd=newBuffer.length-10,target=newBuffer},"makeRoom"),newRecord=__name((transition,keys,newTransitions)=>{let recordId=structures.nextId;recordId||(recordId=64),recordId<sharedLimitId&&this.shouldShareStructure&&!this.shouldShareStructure(keys)?(recordId=structures.nextOwnId,recordId<maxStructureId||(recordId=sharedLimitId),structures.nextOwnId=recordId+1):(recordId>=maxStructureId&&(recordId=sharedLimitId),structures.nextId=recordId+1);let highByte=keys.highByte=recordId>=96&&useTwoByteRecords?recordId-96>>5:-1;transition[RECORD_SYMBOL]=recordId,transition.__keys__=keys,structures[recordId-64]=keys,recordId<sharedLimitId?(keys.isShared=!0,structures.sharedLength=recordId-63,hasSharedUpdate=!0,highByte>=0?(target[position3++]=(recordId&31)+96,target[position3++]=highByte):target[position3++]=recordId):(highByte>=0?(target[position3++]=213,target[position3++]=114,target[position3++]=(recordId&31)+96,target[position3++]=highByte):(target[position3++]=212,target[position3++]=114,target[position3++]=recordId),newTransitions&&(transitionsCount+=serializationsSinceTransitionRebuild*newTransitions),recordIdsToRemove.length>=maxOwnStructures&&(recordIdsToRemove.shift()[RECORD_SYMBOL]=0),recordIdsToRemove.push(transition),pack2(keys))},"newRecord"),insertNewRecord=__name((transition,keys,insertionOffset,newTransitions)=>{let mainTarget=target,mainPosition=position3,mainSafeEnd=safeEnd,mainStart=start;target=keysTarget,position3=0,start=0,target||(keysTarget=target=new ByteArrayAllocate2(8192)),safeEnd=target.length-10,newRecord(transition,keys,newTransitions),keysTarget=target;let keysPosition=position3;if(target=mainTarget,position3=mainPosition,safeEnd=mainSafeEnd,start=mainStart,keysPosition>1){let newEnd=position3+keysPosition-1;newEnd>safeEnd&&makeRoom(newEnd);let insertionPosition=insertionOffset+start;target.copyWithin(insertionPosition+keysPosition,insertionPosition+1,position3),target.set(keysTarget.slice(0,keysPosition),insertionPosition),position3=newEnd}else target[insertionOffset+start]=keysTarget[0]},"insertNewRecord"),writeStruct2=__name(object2=>{let newPosition=writeStructSlots(object2,target,start,position3,structures,makeRoom,(value,newPosition2,notifySharedUpdate)=>{if(notifySharedUpdate)return hasSharedUpdate=!0;position3=newPosition2;let startTarget=target;return pack2(value),resetStructures(),startTarget!==target?{position:position3,targetView,target}:position3},this);if(newPosition===0)return writeObject(object2);position3=newPosition},"writeStruct")}useBuffer(buffer){target=buffer,target.dataView||(target.dataView=new DataView(target.buffer,target.byteOffset,target.byteLength)),position3=0}set position(value){position3=value}get position(){return position3}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}};extensionClasses=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,C1Type];extensions=[{pack(date5,allocateForWrite,pack2){let seconds=date5.getTime()/1e3;if((this.useTimestamp32||date5.getMilliseconds()===0)&&seconds>=0&&seconds<4294967296){let{target:target2,targetView:targetView2,position:position4}=allocateForWrite(6);target2[position4++]=214,target2[position4++]=255,targetView2.setUint32(position4,seconds)}else if(seconds>0&&seconds<4294967296){let{target:target2,targetView:targetView2,position:position4}=allocateForWrite(10);target2[position4++]=215,target2[position4++]=255,targetView2.setUint32(position4,date5.getMilliseconds()*4e6+(seconds/1e3/4294967296>>0)),targetView2.setUint32(position4+4,seconds)}else if(isNaN(seconds)){if(this.onInvalidDate)return allocateForWrite(0),pack2(this.onInvalidDate());let{target:target2,targetView:targetView2,position:position4}=allocateForWrite(3);target2[position4++]=212,target2[position4++]=255,target2[position4++]=255}else{let{target:target2,targetView:targetView2,position:position4}=allocateForWrite(15);target2[position4++]=199,target2[position4++]=12,target2[position4++]=255,targetView2.setUint32(position4,date5.getMilliseconds()*1e6),targetView2.setBigInt64(position4+4,BigInt(Math.floor(seconds)))}}},{pack(set2,allocateForWrite,pack2){if(this.setAsEmptyObject)return allocateForWrite(0),pack2({});let array2=Array.from(set2),{target:target2,position:position4}=allocateForWrite(this.moreTypes?3:0);this.moreTypes&&(target2[position4++]=212,target2[position4++]=115,target2[position4++]=0),pack2(array2)}},{pack(error2,allocateForWrite,pack2){let{target:target2,position:position4}=allocateForWrite(this.moreTypes?3:0);this.moreTypes&&(target2[position4++]=212,target2[position4++]=101,target2[position4++]=0),pack2([error2.name,error2.message,error2.cause])}},{pack(regex,allocateForWrite,pack2){let{target:target2,position:position4}=allocateForWrite(this.moreTypes?3:0);this.moreTypes&&(target2[position4++]=212,target2[position4++]=120,target2[position4++]=0),pack2([regex.source,regex.flags])}},{pack(arrayBuffer,allocateForWrite){this.moreTypes?writeExtBuffer(arrayBuffer,16,allocateForWrite):writeBuffer(hasNodeBuffer2?Buffer.from(arrayBuffer):new Uint8Array(arrayBuffer),allocateForWrite)}},{pack(typedArray,allocateForWrite){let constructor=typedArray.constructor;constructor!==ByteArray&&this.moreTypes?writeExtBuffer(typedArray,typedArrays.indexOf(constructor.name),allocateForWrite):writeBuffer(typedArray,allocateForWrite)}},{pack(c1,allocateForWrite){let{target:target2,position:position4}=allocateForWrite(1);target2[position4]=193}}];function writeExtBuffer(typedArray,type,allocateForWrite,encode4){let length=typedArray.byteLength;if(length+1<256){var{target:target2,position:position4}=allocateForWrite(4+length);target2[position4++]=199,target2[position4++]=length+1}else if(length+1<65536){var{target:target2,position:position4}=allocateForWrite(5+length);target2[position4++]=200,target2[position4++]=length+1>>8,target2[position4++]=length+1&255}else{var{target:target2,position:position4,targetView:targetView2}=allocateForWrite(7+length);target2[position4++]=201,targetView2.setUint32(position4,length+1),position4+=4}target2[position4++]=116,target2[position4++]=type,typedArray.buffer||(typedArray=new Uint8Array(typedArray)),target2.set(new Uint8Array(typedArray.buffer,typedArray.byteOffset,typedArray.byteLength),position4)}__name(writeExtBuffer,"writeExtBuffer");function writeBuffer(buffer,allocateForWrite){let length=buffer.byteLength;var target2,position4;if(length<256){var{target:target2,position:position4}=allocateForWrite(length+2);target2[position4++]=196,target2[position4++]=length}else if(length<65536){var{target:target2,position:position4}=allocateForWrite(length+3);target2[position4++]=197,target2[position4++]=length>>8,target2[position4++]=length&255}else{var{target:target2,position:position4,targetView:targetView2}=allocateForWrite(length+5);target2[position4++]=198,targetView2.setUint32(position4,length),position4+=4}target2.set(buffer,position4)}__name(writeBuffer,"writeBuffer");function writeExtensionData(result,target2,position4,type){let length=result.length;switch(length){case 1:target2[position4++]=212;break;case 2:target2[position4++]=213;break;case 4:target2[position4++]=214;break;case 8:target2[position4++]=215;break;case 16:target2[position4++]=216;break;default:length<256?(target2[position4++]=199,target2[position4++]=length):length<65536?(target2[position4++]=200,target2[position4++]=length>>8,target2[position4++]=length&255):(target2[position4++]=201,target2[position4++]=length>>24,target2[position4++]=length>>16&255,target2[position4++]=length>>8&255,target2[position4++]=length&255)}return target2[position4++]=type,target2.set(result,position4),position4+=length,position4}__name(writeExtensionData,"writeExtensionData");function insertIds(serialized,idsToInsert){let nextId,distanceToMove=idsToInsert.length*6,lastEnd=serialized.length-distanceToMove;for(;nextId=idsToInsert.pop();){let offset=nextId.offset,id=nextId.id;serialized.copyWithin(offset+distanceToMove,offset,lastEnd),distanceToMove-=6;let position4=offset+distanceToMove;serialized[position4++]=214,serialized[position4++]=105,serialized[position4++]=id>>24,serialized[position4++]=id>>16&255,serialized[position4++]=id>>8&255,serialized[position4++]=id&255,lastEnd=offset}return serialized}__name(insertIds,"insertIds");function writeBundles(start,pack2,incrementPosition){if(bundledStrings2.length>0){targetView.setUint32(bundledStrings2.position+start,position3+incrementPosition-bundledStrings2.position-start),bundledStrings2.stringsPosition=position3-start;let writeStrings=bundledStrings2;bundledStrings2=null,pack2(writeStrings[0]),pack2(writeStrings[1])}}__name(writeBundles,"writeBundles");function prepareStructures(structures,packr){return structures.isCompatible=existingStructures=>{let compatible=!existingStructures||(packr.lastNamedStructuresLength||0)===existingStructures.length;return compatible||packr._mergeStructures(existingStructures),compatible},structures}__name(prepareStructures,"prepareStructures");function setWriteStructSlots(writeSlots,makeStructures){writeStructSlots=writeSlots,prepareStructures=makeStructures}__name(setWriteStructSlots,"setWriteStructSlots");var defaultPackr=new Packr({useRecords:!1}),pack=defaultPackr.pack,encode3=defaultPackr.pack,Encoder6=Packr,{NEVER:NEVER2,ALWAYS,DECIMAL_ROUND,DECIMAL_FIT}=FLOAT32_OPTIONS,REUSE_BUFFER_MODE=512,RESET_BUFFER_MODE=1024,RESERVE_START_SPACE=2048;var ASCII=3,NUMBER=0,UTF8=2,OBJECT_DATA=1,DATE=16,TYPE_NAMES=["num","object","string","ascii"];TYPE_NAMES[DATE]="date";var float32Headers=[!1,!0,!0,!1,!1,!0,!0,!1],evalSupported;try{new Function(""),evalSupported=!0}catch{}var updatedPosition,hasNodeBuffer3=typeof Buffer<"u",textEncoder3,currentSource;try{textEncoder3=new TextEncoder}catch{}var encodeUtf8=hasNodeBuffer3?function(target2,string4,position4){return target2.utf8Write(string4,position4,target2.byteLength-position4)}:textEncoder3&&textEncoder3.encodeInto?function(target2,string4,position4){return textEncoder3.encodeInto(string4,target2.subarray(position4)).written}:!1;setWriteStructSlots(writeStruct,prepareStructures2);function writeStruct(object2,target2,encodingStart,position4,structures,makeRoom,pack2,packr){let typedStructs=packr.typedStructs||(packr.typedStructs=[]),targetView2=target2.dataView,refsStartPosition=(typedStructs.lastStringStart||100)+position4,safeEnd2=target2.length-10,start=position4;position4>safeEnd2&&(target2=makeRoom(position4),targetView2=target2.dataView,position4-=encodingStart,start-=encodingStart,refsStartPosition-=encodingStart,encodingStart=0,safeEnd2=target2.length-10);let refOffset,refPosition=refsStartPosition,transition=typedStructs.transitions||(typedStructs.transitions=Object.create(null)),nextId=typedStructs.nextId||typedStructs.length,headerSize=nextId<15?1:nextId<240?2:nextId<61440?3:nextId<15728640?4:0;if(headerSize===0)return 0;position4+=headerSize;let queuedReferences=[],usedAscii0,keyIndex=0;for(let key in object2){let value=object2[key],nextTransition=transition[key];switch(nextTransition||(transition[key]=nextTransition={key,parent:transition,enumerationOffset:0,ascii0:null,ascii8:null,num8:null,string16:null,object16:null,num32:null,float64:null,date64:null}),position4>safeEnd2&&(target2=makeRoom(position4),targetView2=target2.dataView,position4-=encodingStart,start-=encodingStart,refsStartPosition-=encodingStart,refPosition-=encodingStart,encodingStart=0,safeEnd2=target2.length-10),typeof value){case"number":let number4=value;if(nextId<200||!nextTransition.num64){if(number4>>0===number4&&number4<536870912&&number4>-520093696){number4<246&&number4>=0&&(nextTransition.num8&&!(nextId>200&&nextTransition.num32)||number4<32&&!nextTransition.num32)?(transition=nextTransition.num8||createTypeTransition(nextTransition,NUMBER,1),target2[position4++]=number4):(transition=nextTransition.num32||createTypeTransition(nextTransition,NUMBER,4),targetView2.setUint32(position4,number4,!0),position4+=4);break}else if(number4<4294967296&&number4>=-2147483648&&(targetView2.setFloat32(position4,number4,!0),float32Headers[target2[position4+3]>>>5])){let xShifted;if((xShifted=number4*mult10[(target2[position4+3]&127)<<1|target2[position4+2]>>7])>>0===xShifted){transition=nextTransition.num32||createTypeTransition(nextTransition,NUMBER,4),position4+=4;break}}}transition=nextTransition.num64||createTypeTransition(nextTransition,NUMBER,8),targetView2.setFloat64(position4,number4,!0),position4+=8;break;case"string":let strLength=value.length;if(refOffset=refPosition-refsStartPosition,(strLength<<2)+refPosition>safeEnd2&&(target2=makeRoom((strLength<<2)+refPosition),targetView2=target2.dataView,position4-=encodingStart,start-=encodingStart,refsStartPosition-=encodingStart,refPosition-=encodingStart,encodingStart=0,safeEnd2=target2.length-10),strLength>65280+refOffset>>2){queuedReferences.push(key,value,position4-start);break}let isNotAscii,strStart=refPosition;if(strLength<64){let i,c1,c2;for(i=0;i<strLength;i++)c1=value.charCodeAt(i),c1<128?target2[refPosition++]=c1:c1<2048?(isNotAscii=!0,target2[refPosition++]=c1>>6|192,target2[refPosition++]=c1&63|128):(c1&64512)===55296&&((c2=value.charCodeAt(i+1))&64512)===56320?(isNotAscii=!0,c1=65536+((c1&1023)<<10)+(c2&1023),i++,target2[refPosition++]=c1>>18|240,target2[refPosition++]=c1>>12&63|128,target2[refPosition++]=c1>>6&63|128,target2[refPosition++]=c1&63|128):(isNotAscii=!0,target2[refPosition++]=c1>>12|224,target2[refPosition++]=c1>>6&63|128,target2[refPosition++]=c1&63|128)}else refPosition+=encodeUtf8(target2,value,refPosition),isNotAscii=refPosition-strStart>strLength;if(refOffset<160||refOffset<246&&(nextTransition.ascii8||nextTransition.string8)){if(isNotAscii)(transition=nextTransition.string8)||(typedStructs.length>10&&(transition=nextTransition.ascii8)?(transition.__type=UTF8,nextTransition.ascii8=null,nextTransition.string8=transition,pack2(null,0,!0)):transition=createTypeTransition(nextTransition,UTF8,1));else if(refOffset===0&&!usedAscii0){usedAscii0=!0,transition=nextTransition.ascii0||createTypeTransition(nextTransition,ASCII,0);break}else!(transition=nextTransition.ascii8)&&!(typedStructs.length>10&&(transition=nextTransition.string8))&&(transition=createTypeTransition(nextTransition,ASCII,1));target2[position4++]=refOffset}else transition=nextTransition.string16||createTypeTransition(nextTransition,UTF8,2),targetView2.setUint16(position4,refOffset,!0),position4+=2;break;case"object":if(value){value.constructor===Date?(transition=nextTransition.date64||createTypeTransition(nextTransition,DATE,8),targetView2.setFloat64(position4,value.getTime(),!0),position4+=8):queuedReferences.push(key,value,keyIndex);break}else nextTransition=anyType(nextTransition,position4,targetView2,-10),nextTransition?(transition=nextTransition,position4=updatedPosition):queuedReferences.push(key,value,keyIndex);break;case"boolean":transition=nextTransition.num8||nextTransition.ascii8||createTypeTransition(nextTransition,NUMBER,1),target2[position4++]=value?249:248;break;case"undefined":nextTransition=anyType(nextTransition,position4,targetView2,-9),nextTransition?(transition=nextTransition,position4=updatedPosition):queuedReferences.push(key,value,keyIndex);break;default:queuedReferences.push(key,value,keyIndex)}keyIndex++}for(let i=0,l=queuedReferences.length;i<l;){let key=queuedReferences[i++],value=queuedReferences[i++],propertyIndex=queuedReferences[i++],nextTransition=transition[key];nextTransition||(transition[key]=nextTransition={key,parent:transition,enumerationOffset:propertyIndex-keyIndex,ascii0:null,ascii8:null,num8:null,string16:null,object16:null,num32:null,float64:null});let newPosition;if(value){let size;refOffset=refPosition-refsStartPosition,refOffset<65280?(transition=nextTransition.object16,transition?size=2:(transition=nextTransition.object32)?size=4:(transition=createTypeTransition(nextTransition,OBJECT_DATA,2),size=2)):(transition=nextTransition.object32||createTypeTransition(nextTransition,OBJECT_DATA,4),size=4),newPosition=pack2(value,refPosition),typeof newPosition=="object"?(refPosition=newPosition.position,targetView2=newPosition.targetView,target2=newPosition.target,refsStartPosition-=encodingStart,position4-=encodingStart,start-=encodingStart,encodingStart=0):refPosition=newPosition,size===2?(targetView2.setUint16(position4,refOffset,!0),position4+=2):(targetView2.setUint32(position4,refOffset,!0),position4+=4)}else transition=nextTransition.object16||createTypeTransition(nextTransition,OBJECT_DATA,2),targetView2.setInt16(position4,value===null?-10:-9,!0),position4+=2;keyIndex++}let recordId=transition[RECORD_SYMBOL];if(recordId==null){recordId=packr.typedStructs.length;let structure=[],nextTransition=transition,key,type;for(;(type=nextTransition.__type)!==void 0;){let size=nextTransition.__size;nextTransition=nextTransition.__parent,key=nextTransition.key;let property=[type,size,key];nextTransition.enumerationOffset&&property.push(nextTransition.enumerationOffset),structure.push(property),nextTransition=nextTransition.parent}structure.reverse(),transition[RECORD_SYMBOL]=recordId,packr.typedStructs[recordId]=structure,pack2(null,0,!0)}switch(headerSize){case 1:if(recordId>=16)return 0;target2[start]=recordId+32;break;case 2:if(recordId>=256)return 0;target2[start]=56,target2[start+1]=recordId;break;case 3:if(recordId>=65536)return 0;target2[start]=57,targetView2.setUint16(start+1,recordId,!0);break;case 4:if(recordId>=16777216)return 0;targetView2.setUint32(start,(recordId<<8)+58,!0);break}if(position4<refsStartPosition){if(refsStartPosition===refPosition)return position4;target2.copyWithin(position4,refsStartPosition,refPosition),refPosition+=position4-refsStartPosition,typedStructs.lastStringStart=position4-start}else if(position4>refsStartPosition)return refsStartPosition===refPosition?position4:(typedStructs.lastStringStart=position4-start,writeStruct(object2,target2,encodingStart,start,structures,makeRoom,pack2,packr));return refPosition}__name(writeStruct,"writeStruct");function anyType(transition,position4,targetView2,value){let nextTransition;if(nextTransition=transition.ascii8||transition.num8)return targetView2.setInt8(position4,value,!0),updatedPosition=position4+1,nextTransition;if(nextTransition=transition.string16||transition.object16)return targetView2.setInt16(position4,value,!0),updatedPosition=position4+2,nextTransition;if(nextTransition=transition.num32)return targetView2.setUint32(position4,3758096640+value,!0),updatedPosition=position4+4,nextTransition;if(nextTransition=transition.num64)return targetView2.setFloat64(position4,NaN,!0),targetView2.setInt8(position4,value),updatedPosition=position4+8,nextTransition;updatedPosition=position4}__name(anyType,"anyType");function createTypeTransition(transition,type,size){let typeName=TYPE_NAMES[type]+(size<<3),newTransition=transition[typeName]||(transition[typeName]=Object.create(null));return newTransition.__type=type,newTransition.__size=size,newTransition.__parent=transition,newTransition}__name(createTypeTransition,"createTypeTransition");function onLoadedStructures2(sharedData){if(!(sharedData instanceof Map))return sharedData;let typed=sharedData.get("typed")||[];Object.isFrozen(typed)&&(typed=typed.map(structure=>structure.slice(0)));let named=sharedData.get("named"),transitions=Object.create(null);for(let i=0,l=typed.length;i<l;i++){let structure=typed[i],transition=transitions;for(let[type,size,key]of structure){let nextTransition=transition[key];nextTransition||(transition[key]=nextTransition={key,parent:transition,enumerationOffset:0,ascii0:null,ascii8:null,num8:null,string16:null,object16:null,num32:null,float64:null,date64:null}),transition=createTypeTransition(nextTransition,type,size)}transition[RECORD_SYMBOL]=i}return typed.transitions=transitions,this.typedStructs=typed,this.lastTypedStructuresLength=typed.length,named}__name(onLoadedStructures2,"onLoadedStructures");var sourceSymbol=Symbol.for("source");function readStruct2(src2,position4,srcEnd2,unpackr){let recordId=src2[position4++]-32;if(recordId>=24)switch(recordId){case 24:recordId=src2[position4++];break;case 25:recordId=src2[position4++]+(src2[position4++]<<8);break;case 26:recordId=src2[position4++]+(src2[position4++]<<8)+(src2[position4++]<<16);break;case 27:recordId=src2[position4++]+(src2[position4++]<<8)+(src2[position4++]<<16)+(src2[position4++]<<24);break}let structure=unpackr.typedStructs&&unpackr.typedStructs[recordId];if(!structure){if(src2=Uint8Array.prototype.slice.call(src2,position4,srcEnd2),srcEnd2-=position4,position4=0,!unpackr.getStructures)throw new Error(`Reference to shared structure ${recordId} without getStructures method`);if(unpackr._mergeStructures(unpackr.getStructures()),!unpackr.typedStructs)throw new Error("Could not find any shared typed structures");if(unpackr.lastTypedStructuresLength=unpackr.typedStructs.length,structure=unpackr.typedStructs[recordId],!structure)throw new Error("Could not find typed structure "+recordId)}var construct=structure.construct;if(!construct){construct=structure.construct=__name(function(){},"LazyObject");var prototype=construct.prototype;let properties=[],currentOffset=0,lastRefProperty;for(let i=0,l=structure.length;i<l;i++){let definition=structure[i],[type,size,key,enumerationOffset]=definition;key==="__proto__"&&(key="__proto_");let property={key,offset:currentOffset};enumerationOffset?properties.splice(i+enumerationOffset,0,property):properties.push(property);let getRef;switch(size){case 0:getRef=__name(()=>0,"getRef");break;case 1:getRef=__name((source,position5)=>{let ref=source.bytes[position5+property.offset];return ref>=246?toConstant(ref):ref},"getRef");break;case 2:getRef=__name((source,position5)=>{let src3=source.bytes,ref=(src3.dataView||(src3.dataView=new DataView(src3.buffer,src3.byteOffset,src3.byteLength))).getUint16(position5+property.offset,!0);return ref>=65280?toConstant(ref&255):ref},"getRef");break;case 4:getRef=__name((source,position5)=>{let src3=source.bytes,ref=(src3.dataView||(src3.dataView=new DataView(src3.buffer,src3.byteOffset,src3.byteLength))).getUint32(position5+property.offset,!0);return ref>=4294967040?toConstant(ref&255):ref},"getRef");break}property.getRef=getRef,currentOffset+=size;let get;switch(type){case ASCII:lastRefProperty&&!lastRefProperty.next&&(lastRefProperty.next=property),lastRefProperty=property,property.multiGetCount=0,get=__name(function(source){let src3=source.bytes,position5=source.position,refStart=currentOffset+position5,ref=getRef(source,position5);if(typeof ref!="number")return ref;let end,next=property.next;for(;next&&(end=next.getRef(source,position5),typeof end!="number");)end=null,next=next.next;return end==null&&(end=source.bytesEnd-refStart),source.srcString?source.srcString.slice(ref,end):readString2(src3,ref+refStart,end-ref)},"get");break;case UTF8:case OBJECT_DATA:lastRefProperty&&!lastRefProperty.next&&(lastRefProperty.next=property),lastRefProperty=property,get=__name(function(source){let position5=source.position,refStart=currentOffset+position5,ref=getRef(source,position5);if(typeof ref!="number")return ref;let src3=source.bytes,end,next=property.next;for(;next&&(end=next.getRef(source,position5),typeof end!="number");)end=null,next=next.next;if(end==null&&(end=source.bytesEnd-refStart),type===UTF8)return src3.toString("utf8",ref+refStart,end+refStart);currentSource=source;try{return unpackr.unpack(src3,{start:ref+refStart,end:end+refStart})}finally{currentSource=null}},"get");break;case NUMBER:switch(size){case 4:get=__name(function(source){let src3=source.bytes,dataView2=src3.dataView||(src3.dataView=new DataView(src3.buffer,src3.byteOffset,src3.byteLength)),position5=source.position+property.offset,value=dataView2.getInt32(position5,!0);if(value<536870912){if(value>-520093696)return value;if(value>-536870912)return toConstant(value&255)}let fValue=dataView2.getFloat32(position5,!0),multiplier=mult10[(src3[position5+3]&127)<<1|src3[position5+2]>>7];return(multiplier*fValue+(fValue>0?.5:-.5)>>0)/multiplier},"get");break;case 8:get=__name(function(source){let src3=source.bytes,value=(src3.dataView||(src3.dataView=new DataView(src3.buffer,src3.byteOffset,src3.byteLength))).getFloat64(source.position+property.offset,!0);if(isNaN(value)){let byte=src3[source.position+property.offset];if(byte>=246)return toConstant(byte)}return value},"get");break;case 1:get=__name(function(source){let value=source.bytes[source.position+property.offset];return value<246?value:toConstant(value)},"get");break}break;case DATE:get=__name(function(source){let src3=source.bytes,dataView2=src3.dataView||(src3.dataView=new DataView(src3.buffer,src3.byteOffset,src3.byteLength));return new Date(dataView2.getFloat64(source.position+property.offset,!0))},"get");break}property.get=get}if(evalSupported){let objectLiteralProperties=[],args=[],i=0,hasInheritedProperties;for(let property of properties){if(unpackr.alwaysLazyProperty&&unpackr.alwaysLazyProperty(property.key)){hasInheritedProperties=!0;continue}Object.defineProperty(prototype,property.key,{get:withSource(property.get),enumerable:!0});let valueFunction="v"+i++;args.push(valueFunction),objectLiteralProperties.push("["+JSON.stringify(property.key)+"]:"+valueFunction+"(s)")}hasInheritedProperties&&objectLiteralProperties.push("__proto__:this");let toObject=new Function(...args,"return function(s){return{"+objectLiteralProperties.join(",")+"}}").apply(null,properties.map(prop=>prop.get));Object.defineProperty(prototype,"toJSON",{value(omitUnderscoredProperties){return toObject.call(this,this[sourceSymbol])}})}else Object.defineProperty(prototype,"toJSON",{value(omitUnderscoredProperties){let resolved={};for(let i=0,l=properties.length;i<l;i++){let key=properties[i].key;resolved[key]=this[key]}return resolved}})}var instance=new construct;return instance[sourceSymbol]={bytes:src2,position:position4,srcString:"",bytesEnd:srcEnd2},instance}__name(readStruct2,"readStruct");function toConstant(code){switch(code){case 246:return null;case 247:return;case 248:return!1;case 249:return!0}throw new Error("Unknown constant")}__name(toConstant,"toConstant");function withSource(get){return function(){return get(this[sourceSymbol])}}__name(withSource,"withSource");function saveState2(){currentSource&&(currentSource.bytes=Uint8Array.prototype.slice.call(currentSource.bytes,currentSource.position,currentSource.bytesEnd),currentSource.position=0,currentSource.bytesEnd=currentSource.bytes.length)}__name(saveState2,"saveState");function prepareStructures2(structures,packr){if(packr.typedStructs){let structMap=new Map;structMap.set("named",structures),structMap.set("typed",packr.typedStructs),structures=structMap}let lastTypedStructuresLength=packr.lastTypedStructuresLength||0;return structures.isCompatible=existing=>{let compatible=!0;return existing instanceof Map?((existing.get("named")||[]).length!==(packr.lastNamedStructuresLength||0)&&(compatible=!1),(existing.get("typed")||[]).length!==lastTypedStructuresLength&&(compatible=!1)):(existing instanceof Array||Array.isArray(existing))&&existing.length!==(packr.lastNamedStructuresLength||0)&&(compatible=!1),compatible||packr._mergeStructures(existing),compatible},packr.lastTypedStructuresLength=packr.typedStructs&&packr.typedStructs.length,structures}__name(prepareStructures2,"prepareStructures");setReadStruct(readStruct2,onLoadedStructures2,saveState2);import{createRequire}from"module";var nativeAccelerationDisabled=process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED!==void 0&&process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED.toLowerCase()==="true";if(!nativeAccelerationDisabled){let extractor;try{typeof __require=="function"?extractor=__require("msgpackr-extract"):extractor=createRequire(import.meta.url)("msgpackr-extract"),extractor&&setExtractor(extractor.extractStrings)}catch{}}function serialize(o){return typeof o=="string"?`'${o}'`:new c().serialize(o)}__name(serialize,"serialize");var c=(function(){class o{static{__name(this,"o")}#t=new Map;compare(t,r2){let e2=typeof t,n=typeof r2;return e2==="string"&&n==="string"?t.localeCompare(r2):e2==="number"&&n==="number"?t-r2:String.prototype.localeCompare.call(this.serialize(t,!0),this.serialize(r2,!0))}serialize(t,r2){if(t===null)return"null";switch(typeof t){case"string":return r2?t:`'${t}'`;case"bigint":return`${t}n`;case"object":return this.$object(t);case"function":return this.$function(t)}return String(t)}serializeObject(t){let r2=Object.prototype.toString.call(t);if(r2!=="[object Object]")return this.serializeBuiltInType(r2.length<10?`unknown:${r2}`:r2.slice(8,-1),t);let e2=t.constructor,n=e2===Object||e2===void 0?"":e2.name;if(n!==""&&globalThis[n]===e2)return this.serializeBuiltInType(n,t);if(typeof t.toJSON=="function"){let i=t.toJSON();return n+(i!==null&&typeof i=="object"?this.$object(i):`(${this.serialize(i)})`)}return this.serializeObjectEntries(n,Object.entries(t))}serializeBuiltInType(t,r2){let e2=this["$"+t];if(e2)return e2.call(this,r2);if(typeof r2?.entries=="function")return this.serializeObjectEntries(t,r2.entries());throw new Error(`Cannot serialize ${t}`)}serializeObjectEntries(t,r2){let e2=Array.from(r2).sort((i,a)=>this.compare(i[0],a[0])),n=`${t}{`;for(let i=0;i<e2.length;i++){let[a,l]=e2[i];n+=`${this.serialize(a,!0)}:${this.serialize(l)}`,i<e2.length-1&&(n+=",")}return n+"}"}$object(t){let r2=this.#t.get(t);return r2===void 0&&(this.#t.set(t,`#${this.#t.size}`),r2=this.serializeObject(t),this.#t.set(t,r2)),r2}$function(t){let r2=Function.prototype.toString.call(t);return r2.slice(-15)==="[native code] }"?`${t.name||""}()[native]`:`${t.name}(${t.length})${r2.replace(/\s*\n\s*/g,"")}`}$Array(t){let r2="[";for(let e2=0;e2<t.length;e2++)r2+=this.serialize(t[e2]),e2<t.length-1&&(r2+=",");return r2+"]"}$Date(t){try{return`Date(${t.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(t){return`ArrayBuffer[${new Uint8Array(t).join(",")}]`}$Set(t){return`Set${this.$Array(Array.from(t).sort((r2,e2)=>this.compare(r2,e2)))}`}$Map(t){return this.serializeObjectEntries("Map",t.entries())}}for(let s2 of["Error","RegExp","URL"])o.prototype["$"+s2]=function(t){return`${s2}(${t})`};for(let s2 of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])o.prototype["$"+s2]=function(t){return`${s2}[${t.join(",")}]`};for(let s2 of["BigInt64Array","BigUint64Array"])o.prototype["$"+s2]=function(t){return`${s2}[${t.join("n,")}${t.length>0?"n":""}]`};return o})();import{createHash}from"node:crypto";var e=globalThis.process?.getBuiltinModule?.("crypto")?.hash,r="sha256",s="base64url";function digest(t){if(e)return e(r,t,s);let o=createHash(r).update(t);return globalThis.process?.versions?.webcontainer?o.digest().toString(s):o.digest(s)}__name(digest,"digest");function hash4(input){return digest(serialize(input))}__name(hash4,"hash");var _computedKey36;_computedKey36=Symbol.asyncIterator;var SQLiteOPFSAztecArray=class{static{__name(this,"SQLiteOPFSAztecArray")}store;#name;#container;#encoder;constructor(store,name){this.store=store,this.#encoder=new Encoder6,this.#name=name,this.#container=`array:${name}`}async lengthAsync(){let rows=await this.store.allAsync("SELECT COUNT(*) FROM data WHERE container = ? AND key = ?",[this.#container,this.#encodedKey()]);return Number(rows[0]?.[0]??0)}async push(...vals){return vals.length===0?this.lengthAsync():await this.store.transactionAsync(async()=>{let length=await this.lengthAsync();for(let val of vals)await this.store.runAsync(`INSERT INTO data (slot, container, key, key_count, hash, value)
216
216
  VALUES (?, ?, ?, ?, ?, ?)`,[this.#slot(length),this.#container,this.#encodedKey(),length+1,hash4(val),this.#encoder.pack(val)]),length+=1;return length})}async pop(){return await this.store.transactionAsync(async()=>{let length=await this.lengthAsync();if(length===0)return;let slot=this.#slot(length-1),rows=await this.store.allAsync("SELECT value FROM data WHERE slot = ? LIMIT 1",[slot]);await this.store.runAsync("DELETE FROM data WHERE slot = ?",[slot]);let raw=rows[0]?.[0];return raw instanceof Uint8Array?this.#encoder.unpack(raw):void 0})}async atAsync(index){let length=await this.lengthAsync(),resolved=index<0?length+index:index;if(resolved<0||resolved>=length)return;let raw=(await this.store.allAsync("SELECT value FROM data WHERE slot = ? LIMIT 1",[this.#slot(resolved)]))[0]?.[0];return raw instanceof Uint8Array?this.#encoder.unpack(raw):void 0}async setAt(index,val){return await this.store.transactionAsync(async()=>{let length=await this.lengthAsync(),resolved=index<0?length+index:index;return resolved<0||resolved>=length?!1:(await this.store.runAsync(`INSERT OR REPLACE INTO data (slot, container, key, key_count, hash, value)
217
- VALUES (?, ?, ?, ?, ?, ?)`,[this.#slot(resolved),this.#container,this.#encodedKey(),resolved+1,hash4(val),this.#encoder.pack(val)]),!0)})}async*entriesAsync(){let rows=await this.store.allAsync("SELECT key_count, value FROM data WHERE container = ? AND key = ? ORDER BY key_count ASC",[this.#container,this.#encodedKey()]);for(let row of rows){let keyCount=Number(row[0]),raw=row[1];raw instanceof Uint8Array&&(yield[keyCount-1,this.#encoder.unpack(raw)])}}async*valuesAsync(){for await(let[,val]of this.entriesAsync())yield val}[_computedKey36](){return this.valuesAsync()}#encodedKey(){return toBufferKey([this.#name])}#slot(index){return`array:${this.#name}:slot:${index}`}};import{join as join5}from"path";import{addExtension as addExtension4}from"msgpackr";addExtension4({Class:Fr,write:__name(fr=>fr.toBuffer(),"write")});import{BundleArtifactProvider}from"@aztec/noir-protocol-circuits-types/client/bundle";import{strict as assert4}from"assert";function computeEffectiveGasFees(gasFees,gasSettings){let{maxFeesPerGas,maxPriorityFeesPerGas}=gasSettings,minBigInt=__name((f1,f2)=>f1<f2?f1:f2,"minBigInt");assert4(maxFeesPerGas.feePerDaGas>=gasFees.feePerDaGas,`maxFeesPerGas.feePerDaGas must be greater than or equal to gasFees.feePerDaGas, but got maxFeesPerGas.feePerDaGas=${maxFeesPerGas.feePerDaGas} and gasFees.feePerDaGas=${gasFees.feePerDaGas}`),assert4(maxFeesPerGas.feePerL2Gas>=gasFees.feePerL2Gas,`maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2Gas, but got maxFeesPerGas.feePerL2Gas=${maxFeesPerGas.feePerL2Gas} and gasFees.feePerL2Gas=${gasFees.feePerL2Gas}`);let priorityFees=new GasFees(minBigInt(maxPriorityFeesPerGas.feePerDaGas,maxFeesPerGas.feePerDaGas-gasFees.feePerDaGas),minBigInt(maxPriorityFeesPerGas.feePerL2Gas,maxFeesPerGas.feePerL2Gas-gasFees.feePerL2Gas));return new GasFees(gasFees.feePerDaGas+priorityFees.feePerDaGas,gasFees.feePerL2Gas+priorityFees.feePerL2Gas)}__name(computeEffectiveGasFees,"computeEffectiveGasFees");function computeTransactionFee(gasFees,gasSettings,gasUsed){let effectiveFees=computeEffectiveGasFees(gasFees,gasSettings);return gasUsed.computeFee(effectiveFees)}__name(computeTransactionFee,"computeTransactionFee");var WorldStateRevision=class _WorldStateRevision{static{__name(this,"WorldStateRevision")}forkId;blockNumber;includeUncommitted;static LATEST=4294967295;constructor(forkId,blockNumber,includeUncommitted){this.forkId=forkId,this.blockNumber=blockNumber,this.includeUncommitted=includeUncommitted}toString(){return`WorldStateRevision(forkId: ${this.forkId}, blockNumber: ${this.blockNumber}, includeUncommitted: ${this.includeUncommitted})`}static empty(){return new _WorldStateRevision(0,_WorldStateRevision.LATEST,!1)}static get schema(){return external_exports.object({forkId:external_exports.number(),blockNumber:external_exports.number(),includeUncommitted:external_exports.boolean()}).transform(({forkId,blockNumber,includeUncommitted})=>new _WorldStateRevision(forkId,blockNumber,includeUncommitted))}},WorldStateRevisionWithHandle=class _WorldStateRevisionWithHandle extends WorldStateRevision{static{__name(this,"WorldStateRevisionWithHandle")}handle;constructor(forkId,blockNumber,includeUncommitted,handle){super(forkId,blockNumber,includeUncommitted),this.handle=handle}toWorldStateRevision(){return new WorldStateRevision(this.forkId,this.blockNumber,this.includeUncommitted)}static fromWorldStateRevision(revision,handle){return new _WorldStateRevisionWithHandle(revision.forkId,revision.blockNumber,revision.includeUncommitted,handle)}static get schema(){return external_exports.object({forkId:external_exports.number(),blockNumber:external_exports.number(),includeUncommitted:external_exports.boolean(),handle:external_exports.any()}).transform(({forkId,blockNumber,includeUncommitted,handle})=>new _WorldStateRevisionWithHandle(forkId,blockNumber,includeUncommitted,handle))}};import{inspect as inspect37}from"util";import{inspect as inspect36}from"util";var _computedKey37,_computedKey113;_computedKey37=inspect36.custom;var AvmAccumulatedData=class _AvmAccumulatedData{static{__name(this,"AvmAccumulatedData")}noteHashes;nullifiers;l2ToL1Msgs;publicLogs;publicDataWrites;constructor(noteHashes,nullifiers,l2ToL1Msgs,publicLogs,publicDataWrites){this.noteHashes=noteHashes,this.nullifiers=nullifiers,this.l2ToL1Msgs=l2ToL1Msgs,this.publicLogs=publicLogs,this.publicDataWrites=publicDataWrites}static get schema(){return external_exports.object({noteHashes:schemas.Fr.array().min(64).max(64),nullifiers:schemas.Fr.array().min(64).max(64),l2ToL1Msgs:ScopedL2ToL1Message.schema.array().min(8).max(8),publicLogs:FlatPublicLogs.schema,publicDataWrites:PublicDataWrite.schema.array().min(64).max(64)}).transform(({noteHashes,nullifiers,l2ToL1Msgs,publicLogs,publicDataWrites})=>new _AvmAccumulatedData(assertLength(noteHashes,64),assertLength(nullifiers,64),assertLength(l2ToL1Msgs,8),publicLogs,assertLength(publicDataWrites,64)))}getSize(){return arraySerializedSizeOfNonEmpty(this.noteHashes)+arraySerializedSizeOfNonEmpty(this.nullifiers)+arraySerializedSizeOfNonEmpty(this.l2ToL1Msgs)+this.publicLogs.toBuffer().length+arraySerializedSizeOfNonEmpty(this.publicDataWrites)}static fromBuffer(buffer){let reader=BufferReader.asReader(buffer);return new this(reader.readArray(64,Fr),reader.readArray(64,Fr),reader.readArray(8,ScopedL2ToL1Message),reader.readObject(FlatPublicLogs),reader.readArray(64,PublicDataWrite))}toBuffer(){return serializeToBuffer(this.noteHashes,this.nullifiers,this.l2ToL1Msgs,this.publicLogs,this.publicDataWrites)}static getFields(fields){return[fields.noteHashes,fields.nullifiers,fields.l2ToL1Msgs,fields.publicLogs,fields.publicDataWrites]}static fromFields(fields){let reader=FieldReader.asReader(fields);return new this(reader.readFieldArray(64),reader.readFieldArray(64),reader.readArray(8,ScopedL2ToL1Message),reader.readObject(FlatPublicLogs),reader.readArray(64,PublicDataWrite))}toFields(){let fields=serializeToFields(..._AvmAccumulatedData.getFields(this));if(fields.length!==4377)throw new Error(`Invalid number of fields for AvmAccumulatedData. Expected ${4377}, got ${fields.length}`);return fields}static fromString(str){return this.fromBuffer(hexToBuffer(str))}toString(){return bufferToHex(this.toBuffer())}static empty(){return new this(makeTuple(64,Fr.zero),makeTuple(64,Fr.zero),makeTuple(8,ScopedL2ToL1Message.empty),FlatPublicLogs.empty(),makeTuple(64,PublicDataWrite.empty))}static fromPlainObject(obj){return new _AvmAccumulatedData(assertLength(obj.noteHashes.map(h=>Fr.fromPlainObject(h)),64),assertLength(obj.nullifiers.map(n=>Fr.fromPlainObject(n)),64),assertLength(obj.l2ToL1Msgs.map(m=>ScopedL2ToL1Message.fromPlainObject(m)),8),FlatPublicLogs.fromPlainObject(obj.publicLogs),assertLength(obj.publicDataWrites.map(w=>PublicDataWrite.fromPlainObject(w)),64))}isEmpty(){return this.noteHashes.every(x=>x.isZero())&&this.nullifiers.every(x=>x.isZero())&&this.l2ToL1Msgs.every(x=>x.isEmpty())&&this.publicLogs.isEmpty()&&this.publicDataWrites.every(x=>x.isEmpty())}[_computedKey37](){return`AvmAccumulatedData {
217
+ VALUES (?, ?, ?, ?, ?, ?)`,[this.#slot(resolved),this.#container,this.#encodedKey(),resolved+1,hash4(val),this.#encoder.pack(val)]),!0)})}async*entriesAsync(){let rows=await this.store.allAsync("SELECT key_count, value FROM data WHERE container = ? AND key = ? ORDER BY key_count ASC",[this.#container,this.#encodedKey()]);for(let row of rows){let keyCount=Number(row[0]),raw=row[1];raw instanceof Uint8Array&&(yield[keyCount-1,this.#encoder.unpack(raw)])}}async*valuesAsync(){for await(let[,val]of this.entriesAsync())yield val}[_computedKey36](){return this.valuesAsync()}#encodedKey(){return toBufferKey([this.#name])}#slot(index){return`array:${this.#name}:slot:${index}`}};var HEADER_MAX_PATH_SIZE=512,HEADER_FLAGS_SIZE=4,HEADER_DIGEST_SIZE=8,HEADER_CORPUS_SIZE=HEADER_MAX_PATH_SIZE+HEADER_FLAGS_SIZE,HEADER_SIZE=HEADER_CORPUS_SIZE+HEADER_DIGEST_SIZE;var SQLITE_OPEN_MAIN_DB=256,SQLITE_OPEN_MAIN_JOURNAL=2048,SQLITE_OPEN_SUPER_JOURNAL=16384,SQLITE_OPEN_WAL=524288,PERSISTENT_FILE_TYPES=SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_MAIN_JOURNAL|SQLITE_OPEN_SUPER_JOURNAL|SQLITE_OPEN_WAL;import{join as join5}from"path";import{addExtension as addExtension4}from"msgpackr";addExtension4({Class:Fr,write:__name(fr=>fr.toBuffer(),"write")});import{BundleArtifactProvider}from"@aztec/noir-protocol-circuits-types/client/bundle";import{strict as assert4}from"assert";function computeEffectiveGasFees(gasFees,gasSettings){let{maxFeesPerGas,maxPriorityFeesPerGas}=gasSettings,minBigInt=__name((f1,f2)=>f1<f2?f1:f2,"minBigInt");assert4(maxFeesPerGas.feePerDaGas>=gasFees.feePerDaGas,`maxFeesPerGas.feePerDaGas must be greater than or equal to gasFees.feePerDaGas, but got maxFeesPerGas.feePerDaGas=${maxFeesPerGas.feePerDaGas} and gasFees.feePerDaGas=${gasFees.feePerDaGas}`),assert4(maxFeesPerGas.feePerL2Gas>=gasFees.feePerL2Gas,`maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2Gas, but got maxFeesPerGas.feePerL2Gas=${maxFeesPerGas.feePerL2Gas} and gasFees.feePerL2Gas=${gasFees.feePerL2Gas}`);let priorityFees=new GasFees(minBigInt(maxPriorityFeesPerGas.feePerDaGas,maxFeesPerGas.feePerDaGas-gasFees.feePerDaGas),minBigInt(maxPriorityFeesPerGas.feePerL2Gas,maxFeesPerGas.feePerL2Gas-gasFees.feePerL2Gas));return new GasFees(gasFees.feePerDaGas+priorityFees.feePerDaGas,gasFees.feePerL2Gas+priorityFees.feePerL2Gas)}__name(computeEffectiveGasFees,"computeEffectiveGasFees");function computeTransactionFee(gasFees,gasSettings,gasUsed){let effectiveFees=computeEffectiveGasFees(gasFees,gasSettings);return gasUsed.computeFee(effectiveFees)}__name(computeTransactionFee,"computeTransactionFee");var WorldStateRevision=class _WorldStateRevision{static{__name(this,"WorldStateRevision")}forkId;blockNumber;includeUncommitted;static LATEST=4294967295;constructor(forkId,blockNumber,includeUncommitted){this.forkId=forkId,this.blockNumber=blockNumber,this.includeUncommitted=includeUncommitted}toString(){return`WorldStateRevision(forkId: ${this.forkId}, blockNumber: ${this.blockNumber}, includeUncommitted: ${this.includeUncommitted})`}static empty(){return new _WorldStateRevision(0,_WorldStateRevision.LATEST,!1)}static get schema(){return external_exports.object({forkId:external_exports.number(),blockNumber:external_exports.number(),includeUncommitted:external_exports.boolean()}).transform(({forkId,blockNumber,includeUncommitted})=>new _WorldStateRevision(forkId,blockNumber,includeUncommitted))}},WorldStateRevisionWithHandle=class _WorldStateRevisionWithHandle extends WorldStateRevision{static{__name(this,"WorldStateRevisionWithHandle")}handle;constructor(forkId,blockNumber,includeUncommitted,handle){super(forkId,blockNumber,includeUncommitted),this.handle=handle}toWorldStateRevision(){return new WorldStateRevision(this.forkId,this.blockNumber,this.includeUncommitted)}static fromWorldStateRevision(revision,handle){return new _WorldStateRevisionWithHandle(revision.forkId,revision.blockNumber,revision.includeUncommitted,handle)}static get schema(){return external_exports.object({forkId:external_exports.number(),blockNumber:external_exports.number(),includeUncommitted:external_exports.boolean(),handle:external_exports.any()}).transform(({forkId,blockNumber,includeUncommitted,handle})=>new _WorldStateRevisionWithHandle(forkId,blockNumber,includeUncommitted,handle))}};import{inspect as inspect37}from"util";import{inspect as inspect36}from"util";var _computedKey37,_computedKey113;_computedKey37=inspect36.custom;var AvmAccumulatedData=class _AvmAccumulatedData{static{__name(this,"AvmAccumulatedData")}noteHashes;nullifiers;l2ToL1Msgs;publicLogs;publicDataWrites;constructor(noteHashes,nullifiers,l2ToL1Msgs,publicLogs,publicDataWrites){this.noteHashes=noteHashes,this.nullifiers=nullifiers,this.l2ToL1Msgs=l2ToL1Msgs,this.publicLogs=publicLogs,this.publicDataWrites=publicDataWrites}static get schema(){return external_exports.object({noteHashes:schemas.Fr.array().min(64).max(64),nullifiers:schemas.Fr.array().min(64).max(64),l2ToL1Msgs:ScopedL2ToL1Message.schema.array().min(8).max(8),publicLogs:FlatPublicLogs.schema,publicDataWrites:PublicDataWrite.schema.array().min(64).max(64)}).transform(({noteHashes,nullifiers,l2ToL1Msgs,publicLogs,publicDataWrites})=>new _AvmAccumulatedData(assertLength(noteHashes,64),assertLength(nullifiers,64),assertLength(l2ToL1Msgs,8),publicLogs,assertLength(publicDataWrites,64)))}getSize(){return arraySerializedSizeOfNonEmpty(this.noteHashes)+arraySerializedSizeOfNonEmpty(this.nullifiers)+arraySerializedSizeOfNonEmpty(this.l2ToL1Msgs)+this.publicLogs.toBuffer().length+arraySerializedSizeOfNonEmpty(this.publicDataWrites)}static fromBuffer(buffer){let reader=BufferReader.asReader(buffer);return new this(reader.readArray(64,Fr),reader.readArray(64,Fr),reader.readArray(8,ScopedL2ToL1Message),reader.readObject(FlatPublicLogs),reader.readArray(64,PublicDataWrite))}toBuffer(){return serializeToBuffer(this.noteHashes,this.nullifiers,this.l2ToL1Msgs,this.publicLogs,this.publicDataWrites)}static getFields(fields){return[fields.noteHashes,fields.nullifiers,fields.l2ToL1Msgs,fields.publicLogs,fields.publicDataWrites]}static fromFields(fields){let reader=FieldReader.asReader(fields);return new this(reader.readFieldArray(64),reader.readFieldArray(64),reader.readArray(8,ScopedL2ToL1Message),reader.readObject(FlatPublicLogs),reader.readArray(64,PublicDataWrite))}toFields(){let fields=serializeToFields(..._AvmAccumulatedData.getFields(this));if(fields.length!==4377)throw new Error(`Invalid number of fields for AvmAccumulatedData. Expected ${4377}, got ${fields.length}`);return fields}static fromString(str){return this.fromBuffer(hexToBuffer(str))}toString(){return bufferToHex(this.toBuffer())}static empty(){return new this(makeTuple(64,Fr.zero),makeTuple(64,Fr.zero),makeTuple(8,ScopedL2ToL1Message.empty),FlatPublicLogs.empty(),makeTuple(64,PublicDataWrite.empty))}static fromPlainObject(obj){return new _AvmAccumulatedData(assertLength(obj.noteHashes.map(h=>Fr.fromPlainObject(h)),64),assertLength(obj.nullifiers.map(n=>Fr.fromPlainObject(n)),64),assertLength(obj.l2ToL1Msgs.map(m=>ScopedL2ToL1Message.fromPlainObject(m)),8),FlatPublicLogs.fromPlainObject(obj.publicLogs),assertLength(obj.publicDataWrites.map(w=>PublicDataWrite.fromPlainObject(w)),64))}isEmpty(){return this.noteHashes.every(x=>x.isZero())&&this.nullifiers.every(x=>x.isZero())&&this.l2ToL1Msgs.every(x=>x.isEmpty())&&this.publicLogs.isEmpty()&&this.publicDataWrites.every(x=>x.isEmpty())}[_computedKey37](){return`AvmAccumulatedData {
218
218
  noteHashes: [${this.noteHashes.filter(x=>!x.isZero()).map(h=>inspect36(h)).join(", ")}],
219
219
  nullifiers: [${this.nullifiers.filter(x=>!x.isZero()).map(h=>inspect36(h)).join(", ")}],
220
220
  l2ToL1Msgs: [${this.l2ToL1Msgs.filter(x=>!x.isEmpty()).map(h=>inspect36(h)).join(", ")}],